{"remainingRequest":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!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\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"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":["import \"core-js/modules/es6.function.name\";\nimport _typeof from \"D:/jenkins/workspace/bzzgj-fvue/node_modules/@babel/runtime/helpers/esm/typeof\";\nimport \"core-js/modules/web.dom.iterable\";\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 props: {\n productId: {\n type: String,\n default: ''\n },\n ids: {\n type: String,\n default: ''\n }\n },\n name: 'EquipmentAlarmDialog',\n data: function data() {\n return {\n visible: false,\n isSaved: false,\n title: '新增',\n params: {\n details: [{\n metadataCode: '',\n //标识\n warnRelation: 'and',\n //关系\n warnKey: null,\n //告警参数名称\n warnCondition: null,\n //告警条件\n warnType: '1',\n //告警数据类型\n warnValue: null //告警值\n\n }],\n deviceId: this.ids,\n warnName: '',\n memo: '' //备注\n\n },\n gjtjs: [],\n //事件等级\n warnTypeList: [{\n name: '物模型属性',\n value: '1'\n }, {\n name: '物模型事件',\n value: '2'\n }],\n warnRelationList: [{\n name: 'or',\n value: 'or'\n }, {\n name: 'and',\n value: 'and'\n }],\n warnKeyList: [],\n activeCollapse1: '1',\n queryParam: {\n pageBean: {\n page: 1,\n pageSize: -1,\n showTotal: true\n },\n params: {},\n querys: []\n },\n eventDefinitionList: [],\n attributeLists: [],\n productConfList: [],\n rules: {\n warnName: [{\n required: true,\n message: '请输入告警名称',\n trigger: 'blur'\n }]\n }\n };\n },\n created: function created() {\n this.gjtjs = dictUtils.getDictItemsFromCache('gjtj');\n this.outDataFormartList = dictUtils.getDictItemsFromCache('sjgsh');\n this.outDataTypeList = dictUtils.getDictItemsFromCache('sxlx');\n },\n mounted: function mounted() {},\n methods: {\n add: function add(userRow) {\n // this.params.fullName = userRow.name\n // this.params.typeId = userRow.id\n // this.params.deviceType = this.deviceTypeList[0].value\n // this.params.isIntellect = this.isIntellectList[0].value\n this.visible = true;\n this.queryParam.querys = [{\n group: 'main',\n operation: 'EQUAL',\n parentGroup: '',\n property: 'productId',\n relation: 'AND',\n value: this.productId\n }];\n this.getload();\n this.loadEventDefinition();\n this.attributeList();\n },\n //获取产品告警\n getload: function getload() {\n var _this = this;\n\n equipmentManage.load(this.queryParam, function (res) {\n _this.productConfList = res.rows; // console.log(this.productConfList);\n });\n },\n // 继承产品自动填触发器数据\n changeDeploy: function changeDeploy(itemID) {\n var _this2 = this;\n\n if (!!itemID) {\n equipmentManage.findProductAlerts(itemID, function (res) {\n console.log(res, 'bian');\n res.list.forEach(function (item) {\n if (!!item.id) {\n delete item.id;\n delete item.pkVal;\n delete item.productWarnConfId;\n }\n });\n console.log(res.list);\n _this2.params.details = res.list;\n });\n } else {\n this.params.details = [{\n metadataCode: null,\n //标识\n warnRelation: 'and',\n //关系\n warnKey: null,\n //告警参数名称\n warnCondition: null,\n //告警条件\n warnType: '1',\n //告警数据类型\n warnValue: null //告警值\n\n }];\n }\n },\n //获取事件\n loadEventDefinition: function loadEventDefinition() {\n var _this3 = this;\n\n equipmentManage.loadEventDefinition(this.queryParam, function (res) {\n _this3.eventDefinitionList = res.rows;\n\n if (_this3.title == '修改') {\n _this3.getMetadataCode(_this3.params.details[0], 'edit');\n }\n });\n },\n //获取属性\n attributeList: function attributeList() {\n var _this4 = this;\n\n equipmentManage.attributeList(this.queryParam, function (res) {\n _this4.attributeLists = res.rows;\n\n _this4.attributeLists.forEach(function (e) {\n if (_this4.isJSON(e.dataFormart)) {\n var a = JSON.parse(e.dataFormart);\n _this4.warnKeyList = a;\n }\n });\n\n if (_this4.title == '修改') {\n _this4.getMetadataCode(_this4.params.details[0], 'edit');\n }\n });\n },\n isJSON: function isJSON(str) {\n if (typeof str == 'string') {\n try {\n var obj = JSON.parse(str);\n console.log(_typeof(obj));\n\n if (_typeof(obj) == 'object' && obj) {\n return true;\n } else {\n return false;\n }\n } catch (e) {\n return false;\n }\n }\n },\n getMetadataCode: function getMetadataCode(val, edit) {\n var _this5 = this;\n\n this.warnKeyList = [];\n console.log(val.warnType);\n\n if (val.warnType == 1) {\n this.attributeLists.forEach(function (a) {\n if (val.warnKey == a.code) {\n if (_this5.isJSON(a.code)) {\n var list = JSON.parse(a.code);\n _this5.warnKeyList = list;\n } else {\n _this5.warnKeyList = [{\n label: a.code,\n value: a.code\n }];\n }\n\n _this5.params.details[0].metadataCode = _this5.warnKeyList[0].value;\n\n _this5.$set(_this5.params.details[0].metadataCode);\n\n console.log(_this5.params.details[0].metadataCode);\n }\n });\n } else if (val.warnType == 2) {\n this.eventDefinitionList.forEach(function (a) {\n if (val.warnKey == a.code) {\n if (_this5.isJSON(a.code)) {\n var list = JSON.parse(a.code);\n _this5.warnKeyList = list;\n } else {\n _this5.warnKeyList = [{\n label: a.code,\n value: a.code\n }];\n }\n\n _this5.params.details[0].metadataCode = _this5.warnKeyList[0].value;\n console.log(_this5.params.details[0].metadataCode);\n }\n });\n }\n\n if (!edit) val.metadataCode = null;\n },\n removeWarnKey: function removeWarnKey(val) {\n val.warnKey = null;\n val.warnCondition = null;\n val.warnValue = null;\n val.metadataCode = null;\n },\n // 保存产品信息\n handleSave: function handleSave() {\n var _this6 = this;\n\n this.params.details.forEach(function (v) {\n // 修改warnKey传参\n if (v.warnType == '1' && !!v.warnKey) {\n _this6.attributeLists.forEach(function (item) {\n if (v.warnKey == item.name) {\n v.warnKey = item.code;\n }\n });\n }\n\n if (v.warnType == '2' && !!v.warnKey) {\n _this6.eventDefinitionList.forEach(function (item) {\n if (v.warnKey == item.name) {\n v.warnKey = item.code;\n }\n });\n }\n\n if (!v.warnKey) {\n // 判断告警参数名称是否为空\n if (v.warnType == '1') {\n _this6.$notify({\n type: 'warning',\n message: '请配置物模型属性!',\n duration: 2000\n });\n\n _this6.isSaved = false;\n return false;\n }\n\n if (v.warnType == '2') {\n _this6.$notify({\n type: 'warning',\n message: '请配置物模型事件!',\n duration: 2000\n });\n\n _this6.isSaved = false;\n return false;\n }\n } else if (!v.warnType && !v.warnKey) {\n _this6.isSaved = true;\n } else if (!!v.warnType && !!v.warnKey) {\n _this6.isSaved = true;\n }\n });\n\n if (this.isSaved) {\n this.$refs.formInfo.validate(function (valid) {\n if (valid) {\n if (_this6.title === '新增') {\n equipmentManage.addAlerts(_this6.params, function (res) {\n if (res.state) {\n _this6.$notify({\n type: 'success',\n message: '新增成功',\n duration: 2000\n });\n\n _this6.handleClose();\n\n _this6.$emit('reload');\n } else {}\n });\n }\n\n if (_this6.title === '修改') {\n delete _this6.params.lastTime;\n equipmentManage.modifyAlerts(_this6.params, function (res) {\n if (res.state) {\n _this6.$notify({\n type: 'success',\n message: '修改成功',\n duration: 2000\n });\n\n _this6.handleClose();\n\n _this6.$emit('reload');\n } else {}\n });\n }\n } else {\n return false;\n }\n });\n }\n },\n edit: function edit(row) {\n var _this7 = this;\n\n // this.params = utils.deepClone(row)\n // this.params.id = row.id\n this.visible = true;\n this.title = '修改';\n\n if (this.title === '修改') {\n equipmentManage.findAlerts(row.id, function (res) {\n _this7.params = res;\n console.log(_this7.params);\n _this7.queryParam.querys = [{\n group: 'main',\n operation: 'EQUAL',\n parentGroup: '',\n property: 'productId',\n relation: 'AND',\n value: _this7.productId\n }];\n\n _this7.getload();\n\n _this7.loadEventDefinition();\n\n _this7.attributeList();\n });\n }\n },\n // 关闭新增人员窗口\n handleClose: function handleClose() {\n this.params = {\n deviceId: this.ids,\n details: [{\n metadataCode: null,\n warnKey: null,\n warnRelation: 'and',\n //关系\n warnCondition: null,\n warnType: '1',\n warnValue: null\n }],\n warnName: '',\n memo: '' //备注\n\n };\n this.title = '新增';\n this.visible = false;\n this.activeCollapse1 = '1';\n }\n }\n};",null]}