{"remainingRequest":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\deviceManage\\components\\modle\\EquipmentAlarmDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\deviceManage\\components\\modle\\EquipmentAlarmDialog.vue","mtime":1686877672995},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport equipmentManage from '@/api/device/equipmentManage.js'\nimport dictUtils from '@/components/dict/DictSelectUtils.js'\nimport utils from '@/hotent-ui-util.js'\nexport default {\n\tprops: {\n\t\tproductId: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t\tids: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\tname: 'EquipmentAlarmDialog',\n\tdata() {\n\t\treturn {\n\t\t\tvisible: false,\n\t\t\tisSaved: false,\n\t\t\ttitle: '新增',\n\t\t\tparams: {\n\t\t\t\tdetails: [{\n\t\t\t\t\tmetadataCode: '', //标识\n\t\t\t\t\twarnRelation: 'and', //关系\n\t\t\t\t\twarnKey: null, //告警参数名称\n\t\t\t\t\twarnCondition: null, //告警条件\n\t\t\t\t\twarnType: '1', //告警数据类型\n\t\t\t\t\twarnValue: null, //告警值\n\t\t\t\t}, ],\n\t\t\t\tdeviceId: this.ids,\n\t\t\t\twarnName: '',\n\t\t\t\tmemo: '', //备注\n\t\t\t},\n\t\t\tgjtjs: [], //事件等级\n\t\t\twarnTypeList: [{\n\t\t\t\t\tname: '物模型属性',\n\t\t\t\t\tvalue: '1',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: '物模型事件',\n\t\t\t\t\tvalue: '2',\n\t\t\t\t},\n\t\t\t],\n\t\t\twarnRelationList: [{\n\t\t\t\t\tname: 'or',\n\t\t\t\t\tvalue: 'or',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'and',\n\t\t\t\t\tvalue: 'and',\n\t\t\t\t},\n\t\t\t],\n\t\t\twarnKeyList: [],\n\t\t\tactiveCollapse1: '1',\n\t\t\tqueryParam: {\n\t\t\t\tpageBean: {\n\t\t\t\t\tpage: 1,\n\t\t\t\t\tpageSize: -1,\n\t\t\t\t\tshowTotal: true,\n\t\t\t\t},\n\t\t\t\tparams: {},\n\t\t\t\tquerys: [],\n\t\t\t},\n\t\t\teventDefinitionList: [],\n\t\t\tattributeLists: [],\n\t\t\tproductConfList: [],\n\t\t\trules: {\n\t\t\t\twarnName: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请输入告警名称',\n\t\t\t\t\ttrigger: 'blur',\n\t\t\t\t}, ],\n\t\t\t},\n\t\t}\n\t},\n\tcreated() {\n\t\tthis.gjtjs = dictUtils.getDictItemsFromCache('gjtj')\n\t\tthis.outDataFormartList = dictUtils.getDictItemsFromCache('sjgsh')\n\t\tthis.outDataTypeList = dictUtils.getDictItemsFromCache('sxlx')\n\t},\n\tmounted() {},\n\tmethods: {\n\t\tadd(userRow) {\n\t\t\t// this.params.fullName = userRow.name\n\t\t\t// this.params.typeId = userRow.id\n\t\t\t// this.params.deviceType = this.deviceTypeList[0].value\n\t\t\t// this.params.isIntellect = this.isIntellectList[0].value\n\t\t\tthis.visible = true\n\t\t\tthis.queryParam.querys = [{\n\t\t\t\tgroup: 'main',\n\t\t\t\toperation: 'EQUAL',\n\t\t\t\tparentGroup: '',\n\t\t\t\tproperty: 'productId',\n\t\t\t\trelation: 'AND',\n\t\t\t\tvalue: this.productId,\n\t\t\t}, ]\n\t\t\tthis.getload()\n\t\t\tthis.loadEventDefinition()\n\t\t\tthis.attributeList()\n\t\t},\n\t\t//获取产品告警\n\t\tgetload() {\n\t\t\tequipmentManage.load(this.queryParam, (res) => {\n\t\t\t\tthis.productConfList = res.rows\n\t\t\t\t// console.log(this.productConfList);\n\t\t\t})\n\t\t},\n\t\t// 继承产品自动填触发器数据\n\t\tchangeDeploy(itemID) {\n\t\t\tif (!!itemID) {\n\t\t\t\tequipmentManage.findProductAlerts(itemID, (res) => {\n\t\t\t\t\tconsole.log(res, 'bian')\n\t\t\t\t\tres.list.forEach((item) => {\n\t\t\t\t\t\tif (!!item.id) {\n\t\t\t\t\t\t\tdelete item.id\n\t\t\t\t\t\t\tdelete item.pkVal\n\t\t\t\t\t\t\tdelete item.productWarnConfId\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\tconsole.log(res.list)\n\t\t\t\t\tthis.params.details = res.list\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tthis.params.details = [{\n\t\t\t\t\tmetadataCode: null, //标识\n\t\t\t\t\twarnRelation: 'and', //关系\n\t\t\t\t\twarnKey: null, //告警参数名称\n\t\t\t\t\twarnCondition: null, //告警条件\n\t\t\t\t\twarnType: '1', //告警数据类型\n\t\t\t\t\twarnValue: null, //告警值\n\t\t\t\t}, ]\n\t\t\t}\n\t\t},\n\t\t//获取事件\n\t\tloadEventDefinition() {\n\t\t\tequipmentManage.loadEventDefinition(this.queryParam, (res) => {\n\t\t\t\tthis.eventDefinitionList = res.rows\n\t\t\t\tif (this.title == '修改') {\n\t\t\t\t\tthis.getMetadataCode(this.params.details[0], 'edit')\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\t//获取属性\n\t\tattributeList() {\n\t\t\tequipmentManage.attributeList(this.queryParam, (res) => {\n\t\t\t\tthis.attributeLists = res.rows\n\t\t\t\tthis.attributeLists.forEach((e) => {\n\t\t\t\t\tif (this.isJSON(e.dataFormart)) {\n\t\t\t\t\t\tlet a = JSON.parse(e.dataFormart)\n\t\t\t\t\t\tthis.warnKeyList = a\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tif (this.title == '修改') {\n\t\t\t\t\tthis.getMetadataCode(this.params.details[0], 'edit')\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\tisJSON(str) {\n\t\t\tif (typeof str == 'string') {\n\t\t\t\ttry {\n\t\t\t\t\tvar obj = JSON.parse(str)\n\t\t\t\t\tconsole.log(typeof obj)\n\t\t\t\t\tif (typeof obj == 'object' && obj) {\n\t\t\t\t\t\treturn true\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tgetMetadataCode(val, edit) {\n\t\t\tthis.warnKeyList = []\n\t\t\tconsole.log(val.warnType);\n\t\t\tif (val.warnType == 1) {\n\t\t\t\tthis.attributeLists.forEach((a) => {\n\t\t\t\t\tif (val.warnKey == a.code) {\n\t\t\t\t\t\tif (this.isJSON(a.code)) {\n\t\t\t\t\t\t\tlet list = JSON.parse(a.code)\n\t\t\t\t\t\t\tthis.warnKeyList = list\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.warnKeyList = [{\n\t\t\t\t\t\t\t\tlabel: a.code,\n\t\t\t\t\t\t\t\tvalue: a.code,\n\t\t\t\t\t\t\t}, ]\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.params.details[0].metadataCode = this.warnKeyList[0].value\n\t\t\t\t\t\tthis.$set(this.params.details[0].metadataCode)\n\t\t\t\t\t\tconsole.log(this.params.details[0].metadataCode);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t} else if (val.warnType == 2) {\n\t\t\t\tthis.eventDefinitionList.forEach((a) => {\n\t\t\t\t\tif (val.warnKey == a.code) {\n\t\t\t\t\t\tif (this.isJSON(a.code)) {\n\t\t\t\t\t\t\tlet list = JSON.parse(a.code)\n\t\t\t\t\t\t\tthis.warnKeyList = list\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.warnKeyList = [{\n\t\t\t\t\t\t\t\tlabel: a.code,\n\t\t\t\t\t\t\t\tvalue: a.code,\n\t\t\t\t\t\t\t}, ]\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.params.details[0].metadataCode = this.warnKeyList[0].value\n\t\t\t\t\t\tconsole.log(this.params.details[0].metadataCode);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t\tif (!edit) val.metadataCode = null\n\t\t},\n\t\tremoveWarnKey(val) {\n\t\t\tval.warnKey = null\n\t\t\tval.warnCondition = null\n\t\t\tval.warnValue = null\n\t\t\tval.metadataCode = null\n\t\t},\n\t\t// 保存产品信息\n\t\thandleSave() {\n\t\t\tthis.params.details.forEach((v) => {\n\t\t\t\t// 修改warnKey传参\n\t\t\t\tif (v.warnType == '1' && !!v.warnKey) {\n\t\t\t\t\tthis.attributeLists.forEach((item) => {\n\t\t\t\t\t\tif (v.warnKey == item.name) {\n\t\t\t\t\t\t\tv.warnKey = item.code\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\tif (v.warnType == '2' && !!v.warnKey) {\n\t\t\t\t\tthis.eventDefinitionList.forEach((item) => {\n\t\t\t\t\t\tif (v.warnKey == item.name) {\n\t\t\t\t\t\t\tv.warnKey = item.code\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\tif (!v.warnKey) {\n\t\t\t\t\t// 判断告警参数名称是否为空\n\t\t\t\t\tif (v.warnType == '1') {\n\t\t\t\t\t\tthis.$notify({\n\t\t\t\t\t\t\ttype: 'warning',\n\t\t\t\t\t\t\tmessage: '请配置物模型属性!',\n\t\t\t\t\t\t\tduration: 2000,\n\t\t\t\t\t\t})\n\t\t\t\t\t\tthis.isSaved = false\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t\tif (v.warnType == '2') {\n\t\t\t\t\t\tthis.$notify({\n\t\t\t\t\t\t\ttype: 'warning',\n\t\t\t\t\t\t\tmessage: '请配置物模型事件!',\n\t\t\t\t\t\t\tduration: 2000,\n\t\t\t\t\t\t})\n\t\t\t\t\t\tthis.isSaved = false\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t} else if (!v.warnType && !v.warnKey) {\n\t\t\t\t\tthis.isSaved = true\n\t\t\t\t} else if (!!v.warnType && !!v.warnKey) {\n\t\t\t\t\tthis.isSaved = true\n\t\t\t\t}\n\t\t\t})\n\t\t\tif (this.isSaved) {\n\t\t\t\tthis.$refs.formInfo.validate((valid) => {\n\t\t\t\t\tif (valid) {\n\t\t\t\t\t\tif (this.title === '新增') {\n\t\t\t\t\t\t\tequipmentManage.addAlerts(this.params, (res) => {\n\t\t\t\t\t\t\t\tif (res.state) {\n\t\t\t\t\t\t\t\t\tthis.$notify({\n\t\t\t\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\t\t\t\tmessage: '新增成功',\n\t\t\t\t\t\t\t\t\t\tduration: 2000,\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\tthis.handleClose()\n\t\t\t\t\t\t\t\t\tthis.$emit('reload')\n\t\t\t\t\t\t\t\t} else {}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (this.title === '修改') {\n\t\t\t\t\t\t\tdelete this.params.lastTime\n\t\t\t\t\t\t\tequipmentManage.modifyAlerts(this.params, (res) => {\n\t\t\t\t\t\t\t\tif (res.state) {\n\t\t\t\t\t\t\t\t\tthis.$notify({\n\t\t\t\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\t\t\t\tmessage: '修改成功',\n\t\t\t\t\t\t\t\t\t\tduration: 2000,\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\tthis.handleClose()\n\t\t\t\t\t\t\t\t\tthis.$emit('reload')\n\t\t\t\t\t\t\t\t} else {}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\tedit(row) {\n\t\t\t// this.params = utils.deepClone(row)\n\t\t\t// this.params.id = row.id\n\t\t\tthis.visible = true\n\t\t\tthis.title = '修改'\n\t\t\tif (this.title === '修改') {\n\t\t\t\tequipmentManage.findAlerts(row.id, (res) => {\n\t\t\t\t\tthis.params = res\n\t\t\t\t\tconsole.log(this.params)\n\t\t\t\t\tthis.queryParam.querys = [{\n\t\t\t\t\t\tgroup: 'main',\n\t\t\t\t\t\toperation: 'EQUAL',\n\t\t\t\t\t\tparentGroup: '',\n\t\t\t\t\t\tproperty: 'productId',\n\t\t\t\t\t\trelation: 'AND',\n\t\t\t\t\t\tvalue: this.productId,\n\t\t\t\t\t}, ]\n\t\t\t\t\tthis.getload()\n\t\t\t\t\tthis.loadEventDefinition()\n\t\t\t\t\tthis.attributeList()\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\n\t\t// 关闭新增人员窗口\n\t\thandleClose() {\n\t\t\tthis.params = {\n\t\t\t\tdeviceId: this.ids,\n\t\t\t\tdetails: [{\n\t\t\t\t\tmetadataCode: null,\n\t\t\t\t\twarnKey: null,\n\t\t\t\t\twarnRelation: 'and', //关系\n\t\t\t\t\twarnCondition: null,\n\t\t\t\t\twarnType: '1',\n\t\t\t\t\twarnValue: null,\n\t\t\t\t}, ],\n\t\t\t\twarnName: '',\n\t\t\t\tmemo: '', //备注\n\t\t\t}\n\t\t\tthis.title = '新增'\n\t\t\tthis.visible = false\n\t\t\tthis.activeCollapse1 = '1'\n\t\t},\n\t},\n}\n",null]}