From 2d05e10f14827c75566daafcfc6a535881ad62b7 Mon Sep 17 00:00:00 2001 From: 23688nl <329261568@qq.com> Date: Thu, 23 Dec 2021 14:09:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/iot/device/index.vue | 5 + src/views/personal/circuitBreaker/index.vue | 291 ------------------ .../personal/device/profile/runStarts.vue | 143 ++++++--- .../DeviceDetailsView/deviceSelectNav.vue | 45 ++- src/views/profile/DeviceRunStarts/index.vue | 144 ++++++--- 5 files changed, 241 insertions(+), 387 deletions(-) diff --git a/src/views/iot/device/index.vue b/src/views/iot/device/index.vue index 5f316876..99995b36 100644 --- a/src/views/iot/device/index.vue +++ b/src/views/iot/device/index.vue @@ -453,6 +453,11 @@ export default { key: "ONENET", label: "ONENET", value: "ONENET" + }, + { + key: "OFFICIAL", + label: "官方平台", + value: "OFFICIAL" } ], optionKey: { diff --git a/src/views/personal/circuitBreaker/index.vue b/src/views/personal/circuitBreaker/index.vue index 157d270a..50fce6b7 100644 --- a/src/views/personal/circuitBreaker/index.vue +++ b/src/views/personal/circuitBreaker/index.vue @@ -268,229 +268,6 @@ export default { toTableClick() { this.componectVal = ""; }, - // 打开厂商选择窗口 ——表格 - openModelTableSelectDialog() { - this.selectResult = {}; - this.tableSelectOption = { - otherOption: { - tableType: "model" - }, - queryOpt: { - disable: false, - labelWidth: "68px", - params: { - protocolType: "", - modelName: "" - }, - page: { - pageSize: 10, - pageNum: 1, - total: 0 - }, - inline: true, - queryChilds: [ - { - style: "", - placeholder: "型号名称", - clearable: true, - label: "型号名称", - type: "input", - key: "modelName", - size: "small", - value: "" - }, - { - style: "", - placeholder: "协议类型", - clearable: true, - label: "协议类型", - type: "select", - key: "protocolType", - size: "small", - value: "", - options: [ - { - key: "IOTOS", - label: "iot平台", - value: "IOTOS" - }, - { - key: "ONENET", - label: "ONENET", - value: "ONENET" - } - ], - optionKey: { - key: "key", - label: "label", - value: "value" - } - } - ] - }, - tableOpt: { - loading: false, - rowKey: "deviceId", - selection: false, - maxHeight: "45vh", - childs: [ - { - style: "", - label: "厂商名称", - type: "", - prop: "vendorName", - align: "left", - width: "200", - "show-overflow-tooltip": false, - tempType: "span" - }, - { - style: "", - label: "型号名称", - type: "", - prop: "modelName", - align: "left", - width: "200", - "show-overflow-tooltip": false, - tempType: "span" - }, - { - style: "", - label: "设备类型", - type: "", - prop: "deviceTypeName", - align: "left", - width: "120", - "show-overflow-tooltip": false, - tempType: "span" - }, - { - style: "", - label: "产品PK", - type: "", - prop: "prodKey", - align: "left", - width: "", - "show-overflow-tooltip": false, - tempType: "span" - }, - { - style: "", - label: "产品密钥", - type: "", - prop: "prodSecret", - align: "left", - width: "", - "show-overflow-tooltip": false, - tempType: "span" - } - ], - tableList: { - type: Array - } - }, - tableList: [] - }; - this.selectTableShow = true; - }, - // 打开设备选择窗口 ——表格 - openTableSelectDialog() { - this.selectResult = {}; - this.tableSelectOption = { - otherOption: { - tableType: "device" - }, - queryOpt: { - disable: false, - labelWidth: "68px", - params: { - deviceName: "", - modelId: "", - parentId: 0, - deviceType: "GATEWAY_CONTROLLER" - }, - page: { - pageSize: 10, - pageNum: 1, - total: 0 - }, - inline: true, - queryChilds: [ - { - style: "", - placeholder: "设备名称", - clearable: true, - label: "设备名称", - type: "input", - key: "deviceName", - size: "small", - value: "" - } - ] - }, - tableOpt: { - loading: false, - rowKey: "deviceId", - selection: false, - maxHeight: "45vh", - childs: [ - { - style: "", - label: "所属型号", - type: "", - prop: "modelName", - align: "left", - width: "", - "show-overflow-tooltip": false, - tempType: "span" - }, - { - style: "", - label: "设备名称", - type: "", - prop: "deviceName", - align: "left", - width: "", - "show-overflow-tooltip": false, - tempType: "span" - }, - { - style: "", - label: "设备Key", - type: "", - prop: "deviceKey", - align: "left", - width: "", - "show-overflow-tooltip": false, - tempType: "span" - }, - { - style: "", - label: "创建时间", - type: "time", - prop: "createTime", - align: "center", - width: "160", - "show-overflow-tooltip": false, - tempType: "span" - } - ], - tableList: { - type: Array - } - }, - tableList: [] - }; - this.selectTableShow = true; - }, - // 查询回调 - childGetList(data) { - if (data.otherOption.tableType === "device") { - this.deviceChildList(data); - } else if (data.otherOption.tableType === "model") { - this.modelChildList(data); - } - }, initGetModelList() { listModel({ pageNum: 1, @@ -499,74 +276,6 @@ export default { this.queryModelOpt = response.rows; }); }, - modelChildList(data) { - listModel(Object.assign(data.page, data.param, { selected: 1 })).then( - response => { - this.tableSelectOption.tableList = response.rows; - this.tableSelectOption.queryOpt.page.total = Number(response.total); - } - ); - }, - deviceChildList(data) { - listDevice(Object.assign(data.page, data.param, { selected: 1 })).then( - response => { - this.tableSelectOption.tableList = response.rows; - this.tableSelectOption.queryOpt.page.total = Number(response.total); - } - ); - }, - // 根据 型号id 获取 型号详情 - getModelInfoById(modelId) { - getModel(modelId).then(res => { - this.$refs.paramWrap.setList(res.data.paramList || []); - }); - }, - // 点击或者双击数据回调 - returnEvent(data) { - if (data.type === "dblclick") { - if (data.otherOption.tableType === "device") { - this.form.parentId = data.value.deviceId; - this.form.parentName = data.value.deviceName; - } else if (data.otherOption.tableType === "model") { - this.getModelInfoById(data.value.modelId); - this.form.modelId = data.value.modelId; - this.form.modelName = data.value.modelName; - this.form.deviceType = data.value.deviceType; - this.form.prodKey = data.value.prodKey; - this.deviceTypeChange(this.form.deviceType); - } - this.selectTableShow = false; - } else if (data.type === "click") { - this.selectResult = {}; - if (data.otherOption.tableType === "device") { - this.selectResult.parentId = data.value.deviceId; - this.selectResult.parentName = data.value.deviceName; - } else if (data.otherOption.tableType === "model") { - this.selectResult.modelId = data.value.modelId; - this.selectResult.modelName = data.value.modelName; - this.selectResult.deviceType = data.value.deviceType; - // this.selectResult.paramList = data.value.paramList; - this.selectResult.prodKey = data.value.prodKey; - } - this.selectResult.tableType = data.otherOption.tableType; - } - }, - // 点击确定按钮 - resuleClick() { - if (this.selectResult.tableType === "device") { - this.form.parentId = this.selectResult.parentId; - this.form.parentName = this.selectResult.parentName; - } else if (this.selectResult.tableType === "model") { - this.form.modelId = this.selectResult.modelId; - this.form.prodKey = this.selectResult.prodKey; - this.form.modelName = this.selectResult.modelName; - this.form.deviceType = this.selectResult.deviceType; - this.deviceTypeChange(this.form.deviceType); - this.getModelInfoById(this.selectResult.modelId); - // this.$refs.paramWrap.setList(this.selectResult.paramList || []); - } - this.selectTableShow = false; - }, deviceTypeChange(val) { if (val !== "MINIATURE_BREAKER") { this.form.parentId = 0; diff --git a/src/views/personal/device/profile/runStarts.vue b/src/views/personal/device/profile/runStarts.vue index 1c14e5f3..c286461e 100644 --- a/src/views/personal/device/profile/runStarts.vue +++ b/src/views/personal/device/profile/runStarts.vue @@ -3,28 +3,62 @@