From ef5bf67bac4342cf66c447295ab108cd569735f1 Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期二, 16 四月 2024 18:20:08 +0800 Subject: [PATCH] 属性池映射管理 --- Source/UBCS-WEB/src/views/modeling/LinkType.vue | 9 + Source/UBCS-WEB/src/api/vciAttrbute.js | 28 ++++ Source/UBCS-WEB/src/views/integration/vciAttribute.vue | 228 ++++++++++++++++++++++++++++++++++++++ Source/UBCS-WEB/src/views/integration/integrationIndex.vue | 52 +++++--- 4 files changed, 294 insertions(+), 23 deletions(-) diff --git a/Source/UBCS-WEB/src/api/vciAttrbute.js b/Source/UBCS-WEB/src/api/vciAttrbute.js new file mode 100644 index 0000000..422c466 --- /dev/null +++ b/Source/UBCS-WEB/src/api/vciAttrbute.js @@ -0,0 +1,28 @@ +import request from '@/router/axios'; + +// 鏁版嵁鏌ヨ鎺ュ彛 +export const getGroupAttrPoolALlList = (params) => { + return request({ + url: '/api/ubcs-applyjtcodeservice/groupAttrPoolMapping/getGroupAttrPoolALlList', + method: 'get', + params: { + ...params + } + }) +} +// 淇濆瓨鎺ュ彛 +export const editGroupAttr = (data) => { + return request({ + url: '/api/ubcs-applyjtcodeservice/groupAttrPoolMapping/editGroupAttr', + method: 'post', + data + }) +} +// 鍚屾鎺ュ彛 +export const syncGroupAttrMapping = (data) => { + return request({ + url: '/api/ubcs-applyjtcodeservice/groupAttrPoolMapping/syncGroupAttrMapping', + method: 'post', + data + }) +} diff --git a/Source/UBCS-WEB/src/views/integration/integrationIndex.vue b/Source/UBCS-WEB/src/views/integration/integrationIndex.vue index b0de958..9e77493 100644 --- a/Source/UBCS-WEB/src/views/integration/integrationIndex.vue +++ b/Source/UBCS-WEB/src/views/integration/integrationIndex.vue @@ -51,9 +51,9 @@ @selection-change="selectionChange" @select-all="handleSelectAll"> <template slot="menuLeft"> -<!-- <el-button :disabled="disabledPush" icon="el-icon-plus" size="small" type="primary"--> -<!-- @click="dialogPush = true">鏂� 澧�--> -<!-- </el-button>--> + <!-- <el-button :disabled="disabledPush" icon="el-icon-plus" size="small" type="primary"--> + <!-- @click="dialogPush = true">鏂� 澧�--> + <!-- </el-button>--> <el-button icon="el-icon-check" size="small" type="primary" @click="handleSave">淇� 瀛� </el-button> <el-button icon="el-icon-connection" size="small" type="primary" @@ -62,6 +62,9 @@ <el-button icon="el-icon-connection" size="small" type="primary" @click="handleSync('one')">鍚屾璇︾粏妯″瀷 </el-button> + <el-button icon="el-icon-coordinate" size="small" type="primary" + @click="handlerAuto">鑷姩濉厖 + </el-button> </template> </avue-crud> </el-card> @@ -69,6 +72,11 @@ <avue-crud ref="crudRange" :data="rangeData" :option="optinoRange" :style="{ marginTop: '-20px'}" @row-update="handleUpdate" @row-dblclick="handleRowClick"> + <template slot="menuLeft"> + <el-button icon="el-icon-coordinate" size="small" type="primary" + @click="handlerAuto">鑷姩濉厖 + </el-button> + </template> </avue-crud> </el-card> </el-card> @@ -140,8 +148,8 @@ optinoRange: { title: '灞炴�ф槧灏勫彇鍊艰寖鍥�', maxHeight: '280px', - header: false, rowKey: 'oid', + refreshBtn: false, column: [ {label: '灞炴�ч泦鍥㈡灇涓惧��', prop: 'numTextValue', minWidth: 80}, {label: '闆嗗洟灞炴�ф灇涓炬樉绀哄悕绉�', prop: 'numText', minWidth: 80}, @@ -181,7 +189,7 @@ border: true, searchMenuSpan: 8, highlightCurrentRow: true, - $cellEdit:true, + $cellEdit: true, column: [ {label: '闆嗗洟鍒嗙被', prop: 'sourceClassifyName', minWidth: 80}, {label: '鎵�灞炶鍥�', prop: 'viewName', minWidth: 80}, @@ -192,14 +200,13 @@ prop: 'targetAttrName', type: 'select', cell: true, - allowCreate: true, filterable: true, minWidth: 80, - props:{ - label:'targetAttrName', - value:'targetAttrName' + props: { + label: 'targetAttrName', + value: 'targetAttrName' }, - dicData: this.targetNameList, + dicData: [], }, // { // label: '榛樿鍊�', @@ -277,7 +284,7 @@ targetAttrId: item.oid, targetAttrKey: item.id, targetAttrName: item.name, - disabled:false + disabled: false } }); }, @@ -305,8 +312,8 @@ this.loading = false this.mappingData = response.data.data - for (const item of this.mappingData){ - if(item.targetAttrName && item.targetAttrId && item.targetAttrKey){ + for (const item of this.mappingData) { + if (item.targetAttrName && item.targetAttrId && item.targetAttrKey) { const targetObject = this.targetColumn.dicData.find(obj => obj.targetAttrName === item.targetAttrName); targetObject.disabled = true; } @@ -417,14 +424,14 @@ }, // 淇濆瓨鎸夐挳 async handleSave() { - const getTargetCorresponding = (row) =>{ + const getTargetCorresponding = (row) => { return this.targetColumn.dicData.find(column => column.targetAttrName === row.targetAttrName); } for (const item of this.mappingData) { item.$cellEdit = false; - if(item.targetAttrName){ - const { targetAttrId, targetAttrKey, targetAttrName } = await getTargetCorresponding(item); - Object.assign(item, { targetAttrId, targetAttrKey, targetAttrName }); + if (item.targetAttrName) { + const {targetAttrId, targetAttrKey, targetAttrName} = await getTargetCorresponding(item); + Object.assign(item, {targetAttrId, targetAttrKey, targetAttrName}); } } const response = await batchAddSave({dockingPreAttrMappingVOList: this.mappingData}) @@ -547,12 +554,12 @@ } // 鑾峰彇鐩爣灞炴�т俊鎭� - const { targetAttrId, targetAttrKey, targetAttrName } = await getTargetCorresponding(row); + const {targetAttrId, targetAttrKey, targetAttrName} = await getTargetCorresponding(row); // 鏇存柊琛屾暟鎹� - Object.assign(row, { targetAttrId, targetAttrKey, targetAttrName }); + Object.assign(row, {targetAttrId, targetAttrKey, targetAttrName}); - const response = await batchAddSave({ dockingPreAttrMappingVOList: this.mappingData }); + const response = await batchAddSave({dockingPreAttrMappingVOList: this.mappingData}); if (response.status === 200) { this.$message({ @@ -613,8 +620,9 @@ .el-transfer-panel { width: 270px; } - .el-scrollbar__view { - height: 100px ; + + .el-scrollbar__view { + height: 100px; } } diff --git a/Source/UBCS-WEB/src/views/integration/vciAttribute.vue b/Source/UBCS-WEB/src/views/integration/vciAttribute.vue new file mode 100644 index 0000000..940d3ab --- /dev/null +++ b/Source/UBCS-WEB/src/views/integration/vciAttribute.vue @@ -0,0 +1,228 @@ +<template> + <basic-container> + <avue-crud ref="crud" :data="data" :option="options" :page.sync="page" @current-change="currentChange" + @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="primary" @click="syncHandler">鍚屾</el-button> + </template> + </avue-crud> + </basic-container> +</template> + +<script> +import {getGroupAttrPoolALlList, editGroupAttr,syncGroupAttrMapping} from '@/api/vciAttrbute' +import {getPage} from "@/api/omd/OmdAttribute"; + +export default { + name: "vciAttribute", + data() { + return { + data: [], + options: { + height: 'auto', + calcHeight: 20, + headerAlign: "center", + border: true, + selection: true, + tip: false, + index: true, + refreshBtn: false, + searchShowBtn: false, + addBtn: false, + delBtn: false, + $cellEdit: true, + rowKey: 'oid', + cellBtn: true, + highlightCurrentRow: true, + column: [ + { + label: '闆嗗洟灞炴�х紪鍙�', + prop: 'groupAttrKey' + }, + { + label: '闆嗗洟灞炴�у悕绉�', + prop: 'groupAttrName' + }, + { + label: '灞炴�х紪鍙�', + prop: 'codeMetaAttrKey' + }, + { + label: '灞炴�у悕绉�', + prop: 'codeMetaAttrName', + type: 'select', + cell: true, + filterable: true, + props: { + label: 'codeMetaAttrName', + value: 'codeMetaAttrOid', + }, + dicData: [] + } + ] + }, + page: { + pageSize: 10, + currentPage: 1, + total: 0 + }, + selectList: [] + } + }, + created() { + const params = { + 'conditionMap[groupAttrKey_like]': 'RY_', + page: this.page.currentPage, + limit: this.page.pageSize + } + this.onLoad(params) + this.codeColumnOnload() + }, + computed: { + codeMetaColumn() { + return this.options.column.find(column => column.prop === 'codeMetaAttrName'); + } + }, + methods: { + 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; + } + } + }, + selectChange(list) { + this.selectList = list; + }, + async onLoad(params) { + getGroupAttrPoolALlList(params).then(res => { + const data = res.data.data; + this.data = data.records; + this.page.total = data.total; + }) + }, + codeColumnOnload() { + getPage(1, -1).then(res => { + const data = res.data.data; + this.codeMetaColumn.dicData = data.records.filter(item => item.name && item.name.trim() !== "") // 杩囨护鎺塶ame涓虹┖鐨勫睘鎬� + .map(item => { + return { + codeMetaAttrOid: item.oid, + codeMetaAttrKey: item.id, + codeMetaAttrName: item.name, + disabled: false + } + }) + }) + }, + handleRowClick(row, column) { + if (column.label === '灞炴�у悕绉�') this.$refs.crud.rowCell(row, row.$index) + }, + async handleUpdate(row, index, done) { + if (!row.codeMetaAttrName) { + this.$message.warning('璇烽�夋嫨瑕佷繚瀛樼殑灞炴�у悕绉帮紒'); + done(); + return; + } + // row.codeMetaAttrName鍥犱负涓嬫媺妗唙alue鍊煎師鍥犵粦瀹氫负codeMetaAttrOid + const updataList = this.codeMetaColumn.dicData.find(item => item.codeMetaAttrOid === row.codeMetaAttrName) + + // 鍥犱负row閲岄潰鐨勫�兼槸涓嶆纭殑 閲嶆柊璧嬪�间竴閬� + const {codeMetaAttrOid, codeMetaAttrKey, codeMetaAttrName} = updataList; + Object.assign(row, {codeMetaAttrOid, codeMetaAttrKey, codeMetaAttrName}); + + const objet = { + oid: row.oid, + groupAttrKey: row.groupAttrKey, + groupAttrName: row.groupAttrName, + codeMetaAttrOid: row.codeMetaAttrOid, + codeMetaAttrKey: row.codeMetaAttrKey, + codeMetaAttrName: row.codeMetaAttrName + } + const response = await editGroupAttr([objet]) + if (response.data.data.success) { + this.$message.success('淇濆瓨鎴愬姛锛�') + } + done() + }, + async savaHandler() { + if (this.selectList.length <= 0) { + this.$message.warning('璇烽�夋嫨涓�鏉℃暟鎹悗杩涜淇濆瓨锛�') + } else { + const hasTrueValue = this.selectList.some(item => !item.$cellEdit); + if (hasTrueValue) { + this.$message.warning('璇峰紑鍚紪杈戝悗淇濆瓨锛�') + } else { + let saveList = [] + for (const item of this.selectList) { + const updataList = this.codeMetaColumn.dicData.find(p => p.codeMetaAttrOid === item.codeMetaAttrName); + const {codeMetaAttrOid, codeMetaAttrKey, codeMetaAttrName} = updataList; + Object.assign(item, {codeMetaAttrOid, codeMetaAttrKey, codeMetaAttrName}); + + item.$cellEdit = false; + saveList.push({ + oid: item.oid, + groupAttrKey: item.groupAttrKey, + groupAttrName: item.groupAttrName, + codeMetaAttrOid: item.codeMetaAttrOid, + codeMetaAttrKey: item.codeMetaAttrKey, + codeMetaAttrName: item.codeMetaAttrName + }) + } + const response = await editGroupAttr(saveList) + if (response.data.data.success) { + this.$message.success('淇濆瓨鎴愬姛锛�') + } + } + } + }, + async syncHandler(){ + if(this.selectList.length <= 0){ + this.$message.warning('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹繘琛屽悓姝ワ紒') + }else { + const syncList = []; + for (const item of this.selectList) { + syncList.push({ + groupAttrKey: item.groupAttrKey, + groupAttrName: item.groupAttrName, + }) + } + const response = await syncGroupAttrMapping(syncList) + if(response.data.success){ + this.$message.success(response.data.msg) + } + } + }, + currentChange(currentPage) { + this.page.currentPage = currentPage; + const params = { + 'conditionMap[groupAttrKey_like]': 'RY_', + page: this.page.currentPage, + limit: this.page.pageSize + } + this.onLoad(params) + }, + sizeChange(pageSize) { + this.page.pageSize = pageSize; + const params = { + 'conditionMap[groupAttrKey_like]': 'RY_', + page: this.page.currentPage, + limit: this.page.pageSize + } + this.onLoad(params) + }, + } +} +</script> + +<style scoped> + +</style> diff --git a/Source/UBCS-WEB/src/views/modeling/LinkType.vue b/Source/UBCS-WEB/src/views/modeling/LinkType.vue index 13e9fed..5e50452 100644 --- a/Source/UBCS-WEB/src/views/modeling/LinkType.vue +++ b/Source/UBCS-WEB/src/views/modeling/LinkType.vue @@ -141,7 +141,7 @@ </el-container> <link-type-add ref="linkAdd" :domainOption="domainOptions" :icons="icons" :linkStatus="linkStatus" :linkType="addOption.linkType" - @refreshTable="initTreeOnLoad"> + @refreshTable="initTable"> </link-type-add> </el-container> @@ -161,6 +161,7 @@ name: "LinkType", data() { return { + nodeClickOid:'', linkStatus: '', addOption: { linkType: { @@ -253,10 +254,16 @@ methods: { // 鏍戠偣鍑� nodeClick(data) { + this.nodeClickOid = data.oid; getDetail(data.oid).then(res => { this.obj = res.data.data; }) }, + initTable(){ + getDetail(this.nodeClickOid).then(res => { + this.obj = res.data.data; + }) + }, // 娣诲姞鎸夐挳鐐瑰嚮浜嬩欢 linkTypeAdd() { this.$refs.linkAdd.linkType = {}; -- Gitblit v1.9.3