From 95650470500fc15e478c94a65cbd5e089197835b Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Mon, 11 Mar 2024 09:54:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96icd=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/icdConfig/colDialog.vue | 139 +++++++++++++++++++++++++++++- 1 file changed, 138 insertions(+), 1 deletion(-) diff --git a/src/views/icdConfig/colDialog.vue b/src/views/icdConfig/colDialog.vue index 51d10794..e1b6dbbd 100644 --- a/src/views/icdConfig/colDialog.vue +++ b/src/views/icdConfig/colDialog.vue @@ -9,6 +9,15 @@ :close-on-click-modal="false" >
+
+ 批量配置字段名 +
+
+ + + + + + {{ item.name + }}({{ item.comment }}) + + + + + + @@ -94,15 +146,24 @@ export default { data() { return { colDialogshow: false, + innerVisible: false, colTableData: {}, colLoading: false, - innerVisible: false, colName: "", colOptions: [], + multipleSelection: [], colData: "", cellIndex: null, attTableList: [], colIndex: 0, + formInfo: { + colName: "", + }, + rules: { + colName: [ + { required: true, message: "请选择字段名", trigger: "change" }, + ], + }, }; }, watch: { @@ -125,6 +186,58 @@ export default { this.cellIndex = $index; this.colData = row; }, + //多选 + handleSelectionChange(val) { + this.multipleSelection = val; + //console.log(this.multipleSelection); + }, + handleBindClick() { + //点击绑定弹出框 传入选中的值 + console.log(this.multipleSelection); + this.innerVisible = true; + //this.$refs.bindingRef.display(this.multipleSelection); + }, + //批量设置 + submitSetForm() { + this.$refs.formInfo.validate((valid) => { + console.log(valid); + if (valid) { + //选中的 + console.log(this.multipleSelection); + let plidlistArr = []; + this.multipleSelection.forEach((item) => { + // 将每个对象的id字段push到plidlistArr数组中 + plidlistArr.push(item.id); + }); + icdupdateAttApi({ + colName: this.formInfo.colName, + idList: plidlistArr, + }) + .then((res) => { + if (res.success) { + this.innerVisible = false; + this.cellIndex = null; + console.log(this.colTableData); + this.$parent.geticdList( + this.colTableData.iedName, + this.colIndex + ); + } else { + this.$message({ + duration: 1500, + showClose: true, + message: res.errorMsg, + type: "error", + }); + } + }) + .catch((err) => {}); + } else { + console.log("error submit!!"); + return false; + } + }); + }, //保存 handlecolSaveClick({ row }) { const idlistArr = []; @@ -139,6 +252,13 @@ export default { this.cellIndex = null; console.log(this.colTableData); this.$parent.geticdList(this.colTableData.iedName, this.colIndex); + } else { + this.$message({ + duration: 1500, + showClose: true, + message: res.errorMsg, + type: "error", + }); } }) .catch((err) => {}); @@ -215,6 +335,18 @@ export default { .colDialogBox { .colContain { height: 540px; + position: relative; + .bindBox { + position: absolute; + background: #fff; + height: 38px; + width: calc(100% - 62px); + z-index: 2; + left: 60px; + display: flex; + align-items: center; + top: 1px; + } .el-table { .editClass { .el-link.el-link--primary { @@ -233,4 +365,9 @@ export default { width: 268px; } } +.colBlindDialog { + .el-select { + width: 306px; + } +}