| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- <template>
- <div>
- <el-dialog :title="title" v-dialogDrag :visible.sync="visible" class="avue-dialog avue-dialog--top"
- width="500px" append-to-body @closed="closed">
- <span>
- <avue-form ref="form" :key="reload" v-model="form" :option="option"></avue-form>
- </span>
- <div class="avue-dialog__footer">
- <el-button @click="visible = false">取 消</el-button>
- <el-button @click="save" type="primary">确 定</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
-
- <script>
- import {
- add
- } from '@/api/system/dictbiz'
- export default {
- data() {
- return {
- visible: false,
- form: {},
- option: {
- menuBtn: false,
- column: [
- {
- label: '字典名称',
- prop: 'dictValue',
- rules: [
- {
- required: true,
- message: "",
- trigger: "blur"
- }
- ],
- span: 24
- },
- {
- label: '字典键值',
- prop: 'dictKey',
- rules: [
- {
- required: true,
- message: "",
- trigger: "blur"
- }
- ],
- span: 24
- },
- {
- label: '字典排序',
- prop: 'sort',
- rules: [
- {
- required: true,
- message: "",
- trigger: "blur"
- }
- ],
- span: 24
- }
- ]
- }
- };
- },
- props: {
- title: {
- type: String,
- default: '添加字典'
- },
- code: {
- type: String,
- default: '添加字典'
- },
- parentId: {
- type: String,
- default: '0'
- }
- },
- created() { },
- methods: {
- open() {
- this.visible = true
- },
- closed() {
- this.reload = Math.random();
- this.form = this.$options.data().form
- this.$emit('closed')
- },
- save() {
- this.$refs["form"].validate((valid, done) => {
- done();
- if (valid) {
- let data = {
- ...this.form,
- code: this.code,
- isSealed: 0,
- parentId: this.parentId
- }
- add(data).then(res => {
- this.visible = false
- })
- } else {
- return false;
- }
- });
- }
- }
- };
- </script>
-
- <style scoped lang="scss">
- </style>
-
|