From 22005ee766e78a02abfa5fb5fee98447039264aa Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期二, 16 四月 2024 22:23:26 +0800 Subject: [PATCH] 属性池映射管理取消保存按钮 --- Source/UBCS-WEB/src/views/integration/vciAttribute.vue | 50 +++++++++++++++++++++++++++++++++----------------- 1 files changed, 33 insertions(+), 17 deletions(-) diff --git a/Source/UBCS-WEB/src/views/integration/vciAttribute.vue b/Source/UBCS-WEB/src/views/integration/vciAttribute.vue index b169485..c07974a 100644 --- a/Source/UBCS-WEB/src/views/integration/vciAttribute.vue +++ b/Source/UBCS-WEB/src/views/integration/vciAttribute.vue @@ -4,7 +4,7 @@ @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> @@ -12,7 +12,7 @@ </template> <script> -import {getGroupAttrPoolALlList, editGroupAttr,syncGroupAttrMapping} from '@/api/vciAttrbute' +import {getGroupAttrPoolALlList, editGroupAttr, syncGroupAttrMapping} from '@/api/vciAttrbute' import {getPage} from "@/api/omd/OmdAttribute"; export default { @@ -25,7 +25,7 @@ calcHeight: 20, headerAlign: "center", border: true, - selection: true, + // selection: true, tip: false, index: true, refreshBtn: false, @@ -55,6 +55,12 @@ type: 'select', cell: true, filterable: true, + change: (val) => { + if (!this.ChangeStatus) { + this.ChangeName = val.value + this.status = true; + } + }, props: { label: 'codeMetaAttrName', value: 'codeMetaAttrOid', @@ -68,7 +74,9 @@ currentPage: 1, total: 0 }, - selectList: [] + selectList: [], + ChangeName: '', + ChangeStatus: false } }, created() { @@ -89,11 +97,8 @@ 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; } @@ -132,12 +137,22 @@ done(); return; } - // row.codeMetaAttrName鍥犱负涓嬫媺妗唙alue鍊煎師鍥犵粦瀹氫负codeMetaAttrOid - const updataList = this.codeMetaColumn.dicData.find(item => item.codeMetaAttrOid === row.codeMetaAttrName) + // row.codeMetaAttrName鍥犱负涓嬫媺妗唙alue鍊煎師鍥犵粦瀹氫负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, @@ -148,7 +163,7 @@ codeMetaAttrName: row.codeMetaAttrName } const response = await editGroupAttr([objet]) - if (response.data.data.success) { + if (response.data.success) { this.$message.success('淇濆瓨鎴愬姛锛�') } done() @@ -163,10 +178,11 @@ } 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, @@ -184,10 +200,10 @@ } } }, - 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({ @@ -196,7 +212,7 @@ }) } 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_', -- Gitblit v1.9.3