{"remainingRequest":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\stManager\\components\\alertComponents\\disPForm-dialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\stManager\\components\\alertComponents\\disPForm-dialog.vue","mtime":1684458239574},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bbsl-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\r\nimport alertConfigur from '@/api/stManager/alertConfigur.js'\r\nimport portal from '@/api/portal.js'\r\nimport req from '@/request.js'\r\nexport default {\r\n name: 'deviceForm-dialog',\r\n props: {\r\n showFormDia: {\r\n type: Boolean,\r\n default: false\r\n },\r\n title: {\r\n type: String,\r\n default: ''\r\n },\r\n pId: {\r\n type: String,\r\n default: ''\r\n }\r\n },\r\n data() {\r\n return {\r\n paramst: {\r\n\r\n },\r\n stcds: [],\r\n gradeCodes: [],\r\n params: {\r\n isNoteMsg: '1',\r\n gradeCode: null,\r\n gradeName: null,\r\n stcd: null,\r\n xrdsThr: null,\r\n yrdsThr: null,\r\n zrdsThr: null,\r\n sttp: null,\r\n rscd: null\r\n },\r\n rules: {\r\n stcd: [\r\n {\r\n required: true,\r\n message: '请选择关联测站',\r\n trigger: 'blur'\r\n }\r\n ],\r\n gradeCode: [\r\n { required: true, message: '请选择预警等级', trigger: 'blur' }\r\n ],\r\n isNoteMsg: [\r\n { required: true, message: '请选择是否预警通知', trigger: 'blur' }\r\n ],\r\n xrdsThr: [\r\n { required: true, message: '请输入北方向形变值', trigger: 'blur' }\r\n ],\r\n yrdsThr: [\r\n { required: true, message: '请输入东方向形变值', trigger: 'blur' }\r\n ],\r\n zrdsThr: [\r\n { required: true, message: '请输入垂直方向形变值', trigger: 'blur' }\r\n ]\r\n }\r\n }\r\n },\r\n created() {\r\n this.getSysDict()\r\n this.getDetailInfo()\r\n this.getList()\r\n },\r\n methods: {\r\n changeregion(val) {\r\n if (val) {\r\n this.params.stcd = val[val.length - 1]\r\n this.params.rscd = val[val.length - 2]\r\n } else {\r\n this.params.stcd = null\r\n }\r\n },\r\n getList() {\r\n portal.getgqList(1, res => {\r\n // JSON.stringify(res.value).replace(/warehouseId/g,'usId')\r\n let str = JSON.stringify(res.value).replace(/mpnm/g, 'rsnm')\r\n str = str.replace(/mpcd/g, 'rscd')\r\n this.stcds = JSON.parse(str)\r\n this.stcds.forEach(m => {\r\n if (m.children == undefined) {\r\n m.disabled = true;\r\n }\r\n })\r\n console.log(this.stcds);\r\n })\r\n },\r\n changeCode(val) {\r\n this.gradeCodes.forEach(e => {\r\n if (e.value === val) {\r\n this.params.gradeName = e.name\r\n }\r\n })\r\n },\r\n //获取字典数据\r\n getSysDict() {\r\n let portal = window.context.portal\r\n return new Promise((resolve, reject) => {\r\n req.post(portal + '/sys/sysDictionary/v1/queryAllDictItems').then(\r\n response => {\r\n resolve(response.data)\r\n this.gradeCodes = response.data.yjdj\r\n if (this.title === '新增') {\r\n this.params.gradeCode = this.gradeCodes[0].value\r\n this.params.gradeName = this.gradeCodes[0].name\r\n }\r\n this.changeCode()\r\n },\r\n error => {\r\n reject(error)\r\n }\r\n )\r\n })\r\n },\r\n // 根据ID查询\r\n getDetailInfo() {\r\n if (this.title === '修改') {\r\n alertConfigur.detailId(this.pId, res => {\r\n this.params = res.value\r\n this.params.gradeCode = String(res.value.gradeCode)\r\n this.$set(this.params)\r\n })\r\n } else {\r\n this.params = {\r\n isNoteMsg: '1',\r\n gradeCode: null,\r\n gradeName: null,\r\n stcd: null,\r\n xrdsThr: null,\r\n yrdsThr: null,\r\n zrdsThr: null\r\n }\r\n }\r\n },\r\n handleClose() {\r\n this.params = {\r\n code: null,\r\n name: null,\r\n address: null,\r\n areaCode: null,\r\n areaName: null, //列表展示\r\n deviceId: null, //设备id\r\n deviceName: null, //列表展示\r\n manager: null,\r\n managerPhone: null,\r\n runStatus: null,\r\n siteLat: null,\r\n siteLong: null\r\n }\r\n this.$emit('closeFormDiao')\r\n },\r\n goInfo(e) {\r\n this.$refs.formInfo.validate(valid => {\r\n if (valid) {\r\n if (this.title === '新增') {\r\n this.params.sttp = 1\r\n alertConfigur.addSave(this.params, response => {\r\n if (response.state) {\r\n this.$notify({\r\n type: 'success',\r\n message: '新增成功',\r\n duration: 2000\r\n // offset: 80\r\n })\r\n this.$emit('closeFormDiao')\r\n this.$emit('refList')\r\n } else {\r\n }\r\n })\r\n\r\n }\r\n if (this.title === '修改') {\r\n alertConfigur.upData(this.params, response => {\r\n if (response.state) {\r\n this.$notify({\r\n type: 'success',\r\n message: '修改成功',\r\n duration: 2000\r\n // offset: 80\r\n })\r\n this.$emit('closeFormDiao')\r\n this.$emit('refList')\r\n } else {\r\n }\r\n })\r\n }\r\n } else {\r\n return false\r\n }\r\n })\r\n }\r\n }\r\n}\r\n",null]}