| | |
| | | @size-change="sizeChange" @row-dblclick="handleRowClick" @row-update="handleUpdate" |
| | | @selection-change="selectChange"> |
| | | <template slot="menuLeft"> |
| | | <el-button plain size="small" type="success" @click="savaHandler">保存</el-button> |
| | | <!-- <el-button plain size="small" type="success" @click="savaHandler">保存</el-button>--> |
| | | <el-button plain size="small" type="primary" @click="syncHandler">同步</el-button> |
| | | </template> |
| | | </avue-crud> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {getGroupAttrPoolALlList, editGroupAttr,syncGroupAttrMapping} from '@/api/vciAttrbute' |
| | | import {getGroupAttrPoolALlList, editGroupAttr, syncGroupAttrMapping} from '@/api/vciAttrbute' |
| | | import {getPage} from "@/api/omd/OmdAttribute"; |
| | | |
| | | export default { |
| | |
| | | calcHeight: 20, |
| | | headerAlign: "center", |
| | | border: true, |
| | | selection: true, |
| | | // selection: true, |
| | | tip: false, |
| | | index: true, |
| | | refreshBtn: false, |
| | |
| | | type: 'select', |
| | | cell: true, |
| | | filterable: true, |
| | | change: (val) => { |
| | | if (!this.ChangeStatus) { |
| | | this.ChangeName = val.value |
| | | this.status = true; |
| | | } |
| | | }, |
| | | props: { |
| | | label: 'codeMetaAttrName', |
| | | value: 'codeMetaAttrOid', |
| | |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | selectList: [] |
| | | selectList: [], |
| | | ChangeName: '', |
| | | ChangeStatus: false |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | codeMetaDis() { |
| | | for (const item of this.data) { |
| | | if (item.codeMetaAttrOid && item.codeMetaAttrKey && item.codeMetaAttrName) { |
| | | console.log(this.codeMetaColumn) |
| | | console.log(this.codeMetaColumn.dicData) |
| | | if (this.codeMetaColumn.dicData.length >= 1) { |
| | | const targetObject = this.codeMetaColumn.dicData.find(obj => obj.codeMetaAttrName === item.codeMetaAttrName); |
| | | console.log(targetObject) |
| | | } |
| | | // targetObject.disabled = true; |
| | | } |
| | |
| | | done(); |
| | | return; |
| | | } |
| | | // row.codeMetaAttrName因为下拉框value值原因绑定为codeMetaAttrOid |
| | | const updataList = this.codeMetaColumn.dicData.find(item => item.codeMetaAttrOid === row.codeMetaAttrName) |
| | | |
| | | // row.codeMetaAttrName因为下拉框value值原因绑定为codeMetaAttrOid |
| | | let updataList = [] |
| | | |
| | | if (this.ChangeName && this.ChangeName === row.codeMetaAttrName) { |
| | | updataList = this.codeMetaColumn.dicData.find(item => item.codeMetaAttrOid === row.codeMetaAttrOid) |
| | | } else { |
| | | if (row.codeMetaAttrName !== "" && row.codeMetaAttrName) { |
| | | updataList = this.codeMetaColumn.dicData.find(item => item.codeMetaAttrOid === row.codeMetaAttrName) |
| | | } |
| | | } |
| | | // 因为row里面的值是不正确的 重新赋值一遍 |
| | | const {codeMetaAttrOid, codeMetaAttrKey, codeMetaAttrName} = updataList; |
| | | Object.assign(row, {codeMetaAttrOid, codeMetaAttrKey, codeMetaAttrName}); |
| | | if (updataList) { |
| | | const {codeMetaAttrOid, codeMetaAttrKey, codeMetaAttrName} = updataList; |
| | | Object.assign(row, {codeMetaAttrOid, codeMetaAttrKey, codeMetaAttrName}); |
| | | } |
| | | |
| | | const objet = { |
| | | oid: row.oid, |
| | |
| | | codeMetaAttrName: row.codeMetaAttrName |
| | | } |
| | | const response = await editGroupAttr([objet]) |
| | | if (response.data.data.success) { |
| | | if (response.data.success) { |
| | | this.$message.success('保存成功!') |
| | | } |
| | | done() |
| | |
| | | } else { |
| | | let saveList = [] |
| | | for (const item of this.selectList) { |
| | | console.log(item) |
| | | const updataList = this.codeMetaColumn.dicData.find(p => p.codeMetaAttrOid === item.codeMetaAttrName); |
| | | const {codeMetaAttrOid, codeMetaAttrKey, codeMetaAttrName} = updataList; |
| | | Object.assign(item, {codeMetaAttrOid, codeMetaAttrKey, codeMetaAttrName}); |
| | | |
| | | console.log(updataList) |
| | | item.$cellEdit = false; |
| | | saveList.push({ |
| | | oid: item.oid, |
| | |
| | | } |
| | | } |
| | | }, |
| | | async syncHandler(){ |
| | | if(this.selectList.length <= 0){ |
| | | async syncHandler() { |
| | | if (this.selectList.length <= 0) { |
| | | this.$message.warning('请至少选择一条数据进行同步!') |
| | | }else { |
| | | } else { |
| | | const syncList = []; |
| | | for (const item of this.selectList) { |
| | | syncList.push({ |
| | |
| | | }) |
| | | } |
| | | const response = await syncGroupAttrMapping(syncList) |
| | | if(response.data.success){ |
| | | if (response.data.success) { |
| | | this.$message.success(response.data.msg); |
| | | const params = { |
| | | 'conditionMap[groupAttrKey_like]': 'RY_', |