From f62fc8bbb37aebb402f3636aa3b658a2a1b5ce3e Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 10 Nov 2020 11:07:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=87=E4=BB=A4=E5=AD=97=E5=85=B8=E7=94=9F?= =?UTF-8?q?=E6=88=90=20=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/shape/utils/ShapeStatusCovert.js | 24 ++++++------- .../system/commandDictionary/copyParam.vue | 35 ++++++------------- src/views/system/commandDictionary/index.vue | 22 +++++++----- 3 files changed, 35 insertions(+), 46 deletions(-) diff --git a/src/jmapNew/shape/utils/ShapeStatusCovert.js b/src/jmapNew/shape/utils/ShapeStatusCovert.js index afedfc490..5682e7202 100644 --- a/src/jmapNew/shape/utils/ShapeStatusCovert.js +++ b/src/jmapNew/shape/utils/ShapeStatusCovert.js @@ -4,18 +4,18 @@ export function traverseLineElements(currentType, elementTypeList, model, style, obj) { const currentTypeList = currentType.elemnetType; currentTypeList.forEach(element => { - const ClassName = elementTypeList[element]; - if (ClassName) { - obj[element] = new ClassName({ - zlevel: model.zlevel, - z: 1 + currentType[element].z, - style: style, - modelData:model - }); - obj.add(obj[element]); - } else { - console.error(`not find class name: ${ClassName}`); - } + const ClassName = elementTypeList[element]; + if (ClassName) { + obj[element] = new ClassName({ + zlevel: model.zlevel, + z: 1 + currentType[element].z, + style: style, + modelData:model + }); + obj.add(obj[element]); + } else { + console.error(`not find class name: ${ClassName}`); + } }); } // 遍历后端返回的状态控制的绘图 diff --git a/src/views/system/commandDictionary/copyParam.vue b/src/views/system/commandDictionary/copyParam.vue index 1d6bd21c0..7ced5e307 100644 --- a/src/views/system/commandDictionary/copyParam.vue +++ b/src/views/system/commandDictionary/copyParam.vue @@ -19,6 +19,12 @@ export default { default() { return []; } + }, + deviceTypeList:{ + type: Array, + default() { + return []; + } } }, data() { @@ -30,9 +36,7 @@ export default { targetIds: '', deviceType: [] }, - deviceTypeList: [], - targetList: [], - lineCode: '' + targetList: [] }; }, computed: { @@ -58,36 +62,17 @@ export default { }; } }, - watch: { - taskStatusList(list) { - this.targetList = []; - list.forEach(item => { - if (item.value != this.lineCode) { - this.targetList.push(item); - } - }); - } - }, - created() { - this.deviceTypeList = []; - this.$ConstSelect.deviceTypeList.forEach(item => { - this.deviceTypeList.push(item); - }); - }, methods: { doShow(lineCode) { this.dialogVisible = true; if (lineCode) { - this.lineCode = lineCode; this.targetList = []; this.taskStatusList.forEach(item => { - item.value = item.code; - item.label = item.name; - if (item.code != lineCode) { + if (item.value != lineCode) { this.targetList.push(item); } else { - this.formModel.fromCode = item.code; - this.formModel.fromName = item.name; + this.formModel.fromCode = item.value; + this.formModel.fromName = item.label; } }); } diff --git a/src/views/system/commandDictionary/index.vue b/src/views/system/commandDictionary/index.vue index b164868ba..3406cbb34 100644 --- a/src/views/system/commandDictionary/index.vue +++ b/src/views/system/commandDictionary/index.vue @@ -2,7 +2,7 @@