From 9b4433fddf5b401edb0aace8a404ac733b122702 Mon Sep 17 00:00:00 2001 From: 田源 <tianyuan@vci-tech.com> Date: 星期四, 03 四月 2025 14:35:02 +0800 Subject: [PATCH] 添加非密字段显示 --- Source/UBCS-WEB/src/views/integration/groupMapAttrXML.vue | 103 ++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 89 insertions(+), 14 deletions(-) diff --git a/Source/UBCS-WEB/src/views/integration/groupMapAttrXML.vue b/Source/UBCS-WEB/src/views/integration/groupMapAttrXML.vue index 94ac602..89c31da 100644 --- a/Source/UBCS-WEB/src/views/integration/groupMapAttrXML.vue +++ b/Source/UBCS-WEB/src/views/integration/groupMapAttrXML.vue @@ -1,37 +1,112 @@ <template> - <el-container> - <div class="editor-total"> - <div id="editor" v-html="xmlContent"></div> - <button @click="saveXml">淇� 瀛�</button> - </div> - </el-container> + <basic-container> + <avue-crud :data="tableData" + :option="option" + @on-load="onLoad" + @row-save="rowSave" + @row-update="rowUpdate"> + <template slot="groupMapAttrContent" slot-scope="scope"> + <avue-text-ellipsis :height="50" :text="scope.row.groupMapAttrContent"> + <small slot="more">...</small> + </avue-text-ellipsis> + </template> + </avue-crud> + </basic-container> </template> - + <script> -import { getGroupMapXML } from "@/api/integration/groupMapAttrXML.js"; +import {getGroupMapXML, addGroupMapXML, updateGroupMapXML} from "@/api/integration/groupMapAttrXML.js"; export default { data() { return { xmlContent: "", // 浠庡悗绔幏鍙栫殑XML鍐呭 + tableData: [], + option: { + height: 'auto', + border: true, + index: true, + viewBtn: true, + delBtn: false, + columnBtn: false, + refreshBtn: false, + highlightCurrentRow: true, + dialogClickModal: true, + column: [ + { + label: "鏂囦欢鍚嶇О", + prop: "groupMapAttrName", + }, + { + label: "鏂囦欢淇濆瓨璺緞", + prop: "attrMapPath", + display: false, + labelWidth: 120, + }, + { + type: "textarea", + label: "鏂囦欢鍐呭", + prop: "groupMapAttrContent", + slot: true, + minRows: 15, + span: 24 + }, + { + label: '鏄犲皠鏂囦欢鐘舵��', + prop: "isEnable", + dicData: [{key: true, value: '鍚敤'}, {key: false, value: '鏈惎鐢�'}], + html: true, + align: 'center', + width: 125, + display: false, + formatter: function (row) { + return row.isEnable ? '<i class="el-icon-check" style="color: #32cd32;font-size: 20px;font-weight: 800"></i>' : '<i class="el-icon-close" style="color: #ff0000;font-size: 20px;font-weight: 800"></i>' + } + } + ] + } }; }, mounted() { }, created() { - this.onLoad(); + }, methods: { onLoad() { - let xmlName = "PDM"; - getGroupMapXML({ xmlName: xmlName }).then((res) => { - this.xmlContent = res.data.data; - console.log(res.data.data); + getGroupMapXML().then((res) => { + this.tableData = res.data.data; }); }, + rowSave(row, done) { + row.groupMapAttrName = row.groupMapAttrName + '.xml'; + addGroupMapXML(row).then(res => { + this.$message({ + type: "success", + message: res.data.msg + }); + done(row) + this.onLoad() + }) + }, + rowUpdate(row, index, done) { + // updateXMLName 淇敼鏂囦欢鍚� + // groupMapAttrName 鍘熸枃浠跺悕 - }, + row.updateXMLName = row.groupMapAttrName.includes('.xml') ? row.groupMapAttrName : row.groupMapAttrName + '.xml'; + row.groupMapAttrName = this.tableData[index].groupMapAttrName; + + updateGroupMapXML(row).then(res => { + this.$message({ + type: "success", + message: res.data.msg + }); + done(); + this.onLoad(); + }); + } + } }; </script> <style> -- Gitblit v1.9.3