| | |
| | | getNumberCollect: "/deviceScope/getNumberCollect", //查询数采配置 |
| | | numberCollect: "/deviceScope/numberCollect", //维护数采配置 |
| | | saveDataAcquisitionConfiguration: "/deviceScope/saveDataAcquisitionConfiguration", // 维护数采配置 |
| | | |
| | | queryDataAcquisitionConfiguration: "/deviceScope/queryDataAcquisitionConfiguration", // 查询数采配置 |
| | | deleteDataAcquisitionConfiguration: "/deviceScope/deleteDataAcquisitionConfiguration", // 删除数采配置 |
| | | } |
| | | |
| | | const insOrder = { |
| | |
| | | dataConfig (row) { |
| | | this.configForm = { |
| | | deviceId: row.deviceId, |
| | | insProductItem: row.insProductItem |
| | | insProductItem: row.insProductItem.trim() |
| | | } |
| | | this.dialogVisible3 = true |
| | | // this.$axios.post(this.$api.deviceScope.getNumberCollect+'?id='+row.id).then(res => { |
| | | // this.configForm = res.data |
| | | // }) |
| | | this.$axios.get(this.$api.deviceScope.queryDataAcquisitionConfiguration + "?deviceId=" + row.deviceId + "&insProductItem=" + row.insProductItem.trim()).then(res => { |
| | | const data = res.data |
| | | if(data[0]) { |
| | | this.domains.splice(0, 1) |
| | | this.$set(this.configForm, 'fileType', data[0].fileType) |
| | | this.$set(this.configForm, 'collectUrl', data[0].collectUrl) |
| | | this.$set(this.configForm, 'storageUrl', data[0].storageUrl) |
| | | this.$set(this.configForm, 'formula', data[0].formula) |
| | | data.forEach(i => { |
| | | this.domains.push({ |
| | | referx: i.referx, |
| | | refery: i.refery, |
| | | x: i.x, |
| | | y: i.y, |
| | | id: i.id |
| | | }); |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | submitForm3() { |
| | | this.$refs.configForm.validate((valid) => { // 表单校验 |
| | |
| | | i.deviceId = this.configForm.deviceId |
| | | i.insProductItem = this.configForm.insProductItem |
| | | }) |
| | | console.log(`output->this.domains`,this.domains) |
| | | this.$axios.post(this.$api.deviceScope.saveDataAcquisitionConfiguration, this.domains).then(res => { |
| | | console.log(`output->res`,res) |
| | | this.$axios.post(this.$api.deviceScope.saveDataAcquisitionConfiguration, {dataConfigList: JSON.parse(JSON.stringify(this.domains))},{headers: { |
| | | 'Content-Type': 'application/json' |
| | | }}).then(res => { |
| | | this.dialogVisible3 = false |
| | | this.domains = [ |
| | | { |
| | | referx: '', |
| | | refery: '', |
| | | x: '', |
| | | y: '', |
| | | id: '' |
| | | } |
| | | ] |
| | | this.$message.success('添加成功') |
| | | }) |
| | | } else { |
| | | return false; |
| | |
| | | // 删除公式formItem |
| | | const index = this.domains.indexOf(item) |
| | | if (index !== -1 && this.domains.length > 1) { |
| | | this.domains.splice(index, 1) |
| | | this.$axios.get(this.$api.deviceScope.deleteDataAcquisitionConfiguration + "?id=" + item.id).then(res => { |
| | | if(res.code == 200) { |
| | | this.domains.splice(index, 1) |
| | | } |
| | | }) |
| | | } else { |
| | | this.$message.error('不允许删除最后一条数据!'); |
| | | } |
| | | }, |
| | | addDomain() { |
| | |
| | | referx: '', |
| | | refery: '', |
| | | x: '', |
| | | y: '' |
| | | y: '', |
| | | id: '' |
| | | }); |
| | | }, |
| | | evalResult () { |
| | |
| | | referx: '', |
| | | refery: '', |
| | | x: '', |
| | | y: '' |
| | | y: '', |
| | | id: '' |
| | | }] |
| | | this.dialogVisible3 = false |
| | | this.$refs.configForm.resetFields(); |
| | |
| | | if (power[i].menuMethod == 'addDeviceParameter') { |
| | | add = true |
| | | } |
| | | if (power[i].menuMethod == 'numberCollect') { |
| | | if (power[i].menuMethod == 'saveDataAcquisitionConfiguration') { |
| | | config = true |
| | | } |
| | | } |