{"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\\AlarmConfigurationDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\deviceManage\\components\\modle\\AlarmConfigurationDialog.vue","mtime":1687668352363},{"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 _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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport PhysicalModel from '@/api/device/PhysicalModel.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 },\n name: 'AlarmConfigurationDialog',\n data: function data() {\n return {\n visible: false,\n isSaved: false,\n title: '新增',\n params: {\n productId: this.productId,\n list: [{\n metadataCode: '',\n warnRelation: 'and',\n //关系\n warnKey: null,\n warnCondition: null,\n warnType: '1',\n warnValue: null\n }],\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', value: 'or'},\n // {name: 'and', value: 'and'},\n // ],\n warnKeyList: [],\n activeCollapse1: '1',\n queryParam: {\n pageBean: {\n page: -1,\n pageSize: 10,\n showTotal: true\n },\n params: {},\n querys: []\n },\n eventDefinitionList: [],\n attributeLists: [],\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.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 }]; // this.loadEventDefinition()\n\n this.attributeList();\n },\n //获取事件\n loadEventDefinition: function loadEventDefinition() {\n var _this = this;\n\n PhysicalModel.loadEventDefinition(this.queryParam, function (res) {\n _this.eventDefinitionList = res.rows;\n\n if (_this.title == '修改') {\n _this.getMetadataCode(_this.params.list[0], 'edit');\n }\n });\n },\n //获取属性\n attributeList: function attributeList() {\n var _this2 = this;\n\n PhysicalModel.attributeList(this.queryParam, function (res) {\n // this.attributeLists = res.rows\n // console.log(this.attributeLists);\n // this.attributeLists.forEach((e) => {\n // \tconsole.log(\n // \t\tthis.isJSON(e.dataFormart),\n // \t\t'this.isJSON(e.dataFormart)'\n // \t)\n // \tif (this.isJSON(e.dataFormart)) {\n // \t\tlet a = JSON.parse(e.dataFormart)\n // \t\tthis.warnKeyList = a\n // \t}\n // })\n // if (this.title == '修改') {\n // \tthis.getMetadataCode(this.params.list[0], 'edit')\n // }\n _this2.attributeLists = res.rows;\n\n _this2.attributeLists.forEach(function (e) {\n if (_this2.isJSON(e.dataFormart)) {\n var a = JSON.parse(e.dataFormart);\n _this2.warnKeyList = a;\n }\n });\n\n if (_this2.title == '修改') {\n _this2.getMetadataCode(_this2.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\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 _this3 = this;\n\n this.warnKeyList = [];\n\n if (val.warnType == 1) {\n this.attributeLists.forEach(function (a) {\n if (val.warnKey == a.code) {\n if (_this3.isJSON(a.code)) {\n var list = JSON.parse(a.code);\n _this3.warnKeyList = list;\n } else {\n _this3.warnKeyList = [{\n label: a.code,\n value: a.code\n }];\n }\n\n console.log(_this3.params.list);\n _this3.params.list[0].metadataCode = _this3.warnKeyList[0].value;\n\n _this3.$set(_this3.params.list[0].metadataCode);\n }\n });\n } else if (val.warnType == 2) {\n this.eventDefinitionList.forEach(function (a) {\n if (val.warnKey == a.code) {\n if (_this3.isJSON(a.code)) {\n var list = JSON.parse(a.code);\n _this3.warnKeyList = list;\n } else {\n _this3.warnKeyList = [{\n label: a.code,\n value: a.code\n }];\n }\n\n _this3.params.list[0].metadataCode = _this3.warnKeyList[0].value;\n }\n });\n }\n\n if (!edit) val.metadataCode = '';\n },\n removeWarnKey: function removeWarnKey(val) {\n val.warnKey = null;\n val.warnCondition = null;\n val.warnValue = null;\n val.metadataCode = '';\n },\n // 保存产品信息\n handleSave: function handleSave() {\n var _this4 = this;\n\n this.isSaved = true;\n this.$refs.formInfo.validate(function (valid) {\n if (valid) {\n if (_this4.title === '新增') {\n PhysicalModel.addAlerts(_this4.params, function (res) {\n if (res.state) {\n _this4.$notify({\n type: 'success',\n message: '新增成功',\n duration: 2000\n });\n\n _this4.handleClose();\n\n _this4.$emit('reload');\n } else {}\n });\n }\n\n if (_this4.title === '修改') {\n PhysicalModel.modifyAlerts(_this4.params, function (res) {\n if (res.state) {\n _this4.$notify({\n type: 'success',\n message: '修改成功',\n duration: 2000\n });\n\n _this4.handleClose();\n\n _this4.$emit('reload');\n } else {}\n });\n }\n } else {\n return false;\n }\n });\n },\n edit: function edit(row) {\n var _this5 = 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 PhysicalModel.findAlerts(row.id, function (res) {\n _this5.params = res;\n _this5.queryParam.querys = [{\n group: 'main',\n operation: 'EQUAL',\n parentGroup: '',\n property: 'productId',\n relation: 'AND',\n value: _this5.productId\n }];\n\n _this5.loadEventDefinition();\n\n _this5.attributeList();\n });\n }\n },\n // 关闭新增人员窗口\n handleClose: function handleClose() {\n this.params = {\n productId: this.productId,\n list: [{\n metadataCode: '',\n warnRelation: 'and',\n //关系\n warnKey: null,\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]}