{"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\\osmForm-dialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\stManager\\components\\alertComponents\\osmForm-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\r\nimport osmotic from '@/api/stManager/osmotic.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 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 spprwlThr: null,\r\n pztbwlThr: null,\r\n sttp: null,\r\n rscd: null\r\n },\r\n defaultProps: {\r\n children: 'children',\r\n emitPath: true,\r\n value: 'value',\r\n label: 'label',\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 spprwlThr: [\r\n { required: true, message: '请输入渗流压力水位阈值', trigger: 'blur' }\r\n ],\r\n pztbwlThr: [\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.getDetailInfo()\r\n this.getList()\r\n this.getSysDict()\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\r\n getList() {\r\n portal.getgqList(3, (res) => {\r\n this.stcds = res.value\r\n this.stcds.map(i => {\r\n i.label = i.rsnm\r\n i.value = i.rscd\r\n if (i.children) {\r\n i.children = JSON.parse(JSON.stringify(i.children).replace(/mpcd/g, 'value'))\r\n i.children = JSON.parse(JSON.stringify(i.children).replace(/mpnm/g, 'label'))\r\n }\r\n })\r\n this.stcds.forEach(m => {\r\n if (m.children == undefined) {\r\n m.disabled = true;\r\n }\r\n })\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\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 osmotic.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 spprwlThr: null,\r\n pztbwlThr: null\r\n }\r\n }\r\n },\r\n handleClose() {\r\n ; (this.params = {\r\n isNoteMsg: null,\r\n gradeCode: null,\r\n gradeName: null,\r\n stcd: null,\r\n spprwlThr: null,\r\n pztbwlThr: 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 = 3\r\n console.log(this.params);\r\n osmotic.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 osmotic.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 }\r\n } else {\r\n return false\r\n }\r\n })\r\n }\r\n }\r\n}\r\n",null]}