{"remainingRequest":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\warningRelease\\components\\personForm-dialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\warningRelease\\components\\personForm-dialog.vue","mtime":1684458239684},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"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":["import \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es6.regexp.replace\";\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//\nimport personWarn from '@/api/warningRelease/personWarn';\nimport req from '@/request.js';\nexport default {\n name: 'deviceForm-dialog',\n props: {\n showFormDia: {\n type: Boolean,\n default: false\n },\n title: {\n type: String,\n default: ''\n },\n pId: {\n type: String,\n default: ''\n }\n },\n data: function data() {\n return {\n stnms: [],\n //测站名称\n params: {\n stcd: 'null',\n //测站代码\n warnGrade: null,\n //预警等级\n sendDate: '',\n //预警时间\n alertContent: null //预警内容\n\n },\n yjdjs: [],\n //预警等级\n rules: {\n stcd: [{\n required: true,\n message: '请选择测站名称',\n trigger: 'blur'\n }],\n warnGrade: [{\n required: true,\n message: '请选择预警等级',\n trigger: 'blur'\n }],\n sendDate: [{\n required: true,\n message: '请选择预警时间',\n trigger: 'blur'\n }],\n alertContent: [{\n required: true,\n message: '请输入预警内容',\n trigger: 'blur'\n }]\n }\n };\n },\n created: function created() {\n this.getDetailInfo();\n this.getList();\n this.getSysDict();\n },\n // watch: {\n // params: {\n // handler(newVal) {\n // console.log(newVal)\n // },\n // },\n // },\n methods: {\n getList: function getList(value) {\n var _this = this;\n\n personWarn.getTree({}, function (response) {\n if (value) {\n response.value.forEach(function (item) {\n if (item.children) {\n item.children.forEach(function (ii) {\n if (ii.stcd === value) {\n _this.params.warnType = ii.parentId;\n _this.params.stcd = ii.stcd;\n }\n });\n }\n });\n }\n\n _this.stnms = response.value;\n\n _this.stnms.forEach(function (item) {\n if (item.children) {\n item.children = JSON.parse(JSON.stringify(item.children).replace(/stnm/g, 'name'));\n }\n });\n });\n },\n // changeCode(val) {\n // this.gradeCodes.forEach((e) => {\n // if (e.value === val) {\n // this.params.gradeName = e.name\n // }\n // })\n // },\n //获取字典数据\n getSysDict: function getSysDict() {\n var _this2 = this;\n\n var portal = window.context.portal;\n return new Promise(function (resolve, reject) {\n req.post(portal + '/sys/sysDictionary/v1/queryAllDictItems').then(function (response) {\n _this2.yjdjs = response.data.yjdj; //预警等级\n\n if (_this2.params.warnGrade) {\n _this2.yjdjs.forEach(function (item) {\n if (item.value == _this2.params.warnGrade.trim()) {\n _this2.params.warnGrade = item.name;\n }\n });\n }\n\n if (_this2.params.stcd) {\n console.log(_this2.params.stcd);\n }\n }, function (error) {\n reject(error);\n });\n });\n },\n // 根据ID查询\n getDetailInfo: function getDetailInfo() {\n var _this3 = this;\n\n if (this.title === '修改') {\n personWarn.detailId(this.pId, function (res) {\n _this3.params = res.value;\n\n _this3.$set(_this3.params);\n });\n } else {\n this.params = {\n stcd: null,\n //测站代码\n warnType: null,\n //测站代码\n warnGrade: null,\n //预警等级\n sendDate: null,\n //预警时间\n alertContent: null //预警内容\n\n };\n }\n },\n handleClose: function handleClose() {\n this.params = {\n stcd: null,\n //测站代码\n warnType: null,\n //测站代码\n warnGrade: null,\n //预警等级\n sendDate: null,\n //预警时间\n alertContent: null //预警内容\n\n };\n this.$emit('closeFormDiao');\n },\n handelerget: function handelerget(value) {\n this.getList(value[1]);\n },\n goInfo: function goInfo(e) {\n var _this4 = this;\n\n this.$refs.formInfo.validate(function (valid) {\n if (valid) {\n if (_this4.title === '新增') {\n var params = _this4.params;\n\n _this4.stnms.forEach(function (item) {\n if (item.children) {\n item.children.forEach(function (ii) {\n if (ii.stcd == params.stcd) {\n params.stnm = ii.name;\n console.log(params);\n }\n });\n }\n });\n\n personWarn.addSave(params, function (response) {\n if (response.state) {\n _this4.$notify({\n type: 'success',\n message: '新增成功',\n duration: 2000 // offset: 80\n\n });\n\n _this4.$emit('closeFormDiao');\n\n _this4.$emit('refList');\n } else {}\n });\n }\n\n if (_this4.title === '修改') {\n _this4.params.stcd = _this4.params.stcd[1];\n personWarn.upData(_this4.params, function (response) {\n if (response.state) {\n _this4.$notify({\n type: 'success',\n message: '修改成功',\n duration: 2000 // offset: 80\n\n });\n\n _this4.$emit('closeFormDiao');\n\n _this4.$emit('refList');\n } else {}\n });\n }\n } else {\n return false;\n }\n });\n }\n }\n};",null]}