| | |
| | | <template> |
| | | <el-dialog title="字典名称字典配置" v-model="visible" :width="1000" destroy-on-close @closed="$emit('closed')"> |
| | | <div class="dict-main"> |
| | | <el-form :inline="true" :model="searchData" abel-width="120px"> |
| | | <el-form :inline="true" :model="searchData" label-width="80px"> |
| | | <el-form-item label="字典编号"> |
| | | <el-input v-model="searchData.code" placeholder="字典编号" clearable /> |
| | | </el-form-item> |
| | |
| | | emits: ['success', 'closed'], |
| | | data(){ |
| | | return { |
| | | oldRow: {}, |
| | | selection: [], |
| | | mode: "edit", |
| | | visible: false, |
| | |
| | | }, |
| | | //字典配置 |
| | | table_allocation(row) { |
| | | this.addAllocation(); |
| | | this.addAllocation(row,"subitem"); |
| | | }, |
| | | showDict() { |
| | | this.$HTTP.get("/api/blade-system/dict/tree?code=DICT").then(res=> { |
| | | if(res.code == 200) { |
| | | res.data.forEach(item=> { |
| | | if(item.id == this.addAllocationForm.parentId) { |
| | | this.addAllocationForm.$parentId = item.title; |
| | | } |
| | | }) |
| | | this.parentData = res.data; |
| | | } |
| | | }) |
| | | }, |
| | | //删除 |
| | | table_del(row) { |
| | |
| | | }) |
| | | }, |
| | | //添加 |
| | | addAllocation(){ |
| | | this.dialog.allocation = true |
| | | addAllocation(row,type){ |
| | | this.dialog.allocation = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.SubitemAddDict.open('edit').setData(this.allocationTableData[0]) |
| | | if(type == "subitem") { //添加子项 |
| | | this.$refs.SubitemAddDict.open('edit').setData(row) |
| | | }else { |
| | | this.$refs.SubitemAddDict.open('edit').setData(this.oldRow) |
| | | } |
| | | }) |
| | | }, |
| | | table_edit(row){ |
| | | this.dialog.allocation = true |
| | | row.mode = "edit"; |
| | | this.$nextTick(() => { |
| | | this.$refs.SubitemAddDict.open('edit').setData(row) |
| | | }) |
| | |
| | | //查看 |
| | | table_show(row){ |
| | | this.dialog.allocation = true |
| | | row.mode = "show"; |
| | | this.$nextTick(() => { |
| | | this.$refs.SubitemAddDict.open('show').setData(row) |
| | | }) |
| | |
| | | setData(row){ |
| | | //可以和上面一样单个注入,也可以像下面一样直接合并进去 |
| | | this.searchData.parentId = row.id; |
| | | this.oldRow = row; |
| | | this.searchBtn(); |
| | | }, |
| | | //显示 |