{"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\\deviceForm-dialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\stManager\\components\\deviceForm-dialog.vue","mtime":1684458239606},{"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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 deviceManger from '@/api/stManager/deviceManger.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 params: {\r\n code: null,\r\n name: null,\r\n deviceFun: null,\r\n floodHz: null,\r\n objId: null,\r\n parentId: null,\r\n producerLinkPhone: null,\r\n producerLinkUser: null,\r\n producerName: null,\r\n remark: null,\r\n simCard: null,\r\n snNo: null,\r\n type: null,\r\n // appTypeCodes: [],\r\n // appTypeNames: [],\r\n },\r\n types: [], //设备类型\r\n objIds: [],\r\n parentIds: [], //上级设备数组\r\n // appTypeCodesType: [], //应用分类\r\n ifMainDams: [\r\n {name: '未知', value: '0'},\r\n {name: '是', value: '1'},\r\n {name: '否', value: '2'},\r\n ],\r\n elevSyss: [], //工程建设情况\r\n rules: {\r\n name: [\r\n {\r\n required: true,\r\n message: '请输入名称',\r\n trigger: 'blur',\r\n },\r\n ],\r\n code: [{required: true, message: '请输入代码', trigger: 'blur'}],\r\n type: [{required: true, message: '请选择类型', trigger: 'blur'}],\r\n objId: [{required: true, message: '请选择对象分类', trigger: 'blur'}],\r\n },\r\n }\r\n },\r\n created() {\r\n this.getDetailInfo()\r\n this.getSysDict()\r\n // 设备\r\n deviceManger.getParaIds({}, (res) => {\r\n this.parentIds = res.value\r\n })\r\n },\r\n methods: {\r\n changeParentId(val) {\r\n this.params.parentId = '1'\r\n },\r\n // changeappType(val) {\r\n // this.params.appTypeNames=[];\r\n // this.appTypeCodesType.forEach((e, i) => {\r\n // val.forEach((j) => {\r\n // if (e.value == j) {\r\n // this.params.appTypeNames.push(e.name)\r\n // }\r\n // })\r\n // })\r\n // // 去重\r\n // this.params.appTypeNames = [...new Set(this.params.appTypeNames)]\r\n // },\r\n // 根据ID查询\r\n getDetailInfo() {\r\n if (this.title === '修改') {\r\n this.getSysDict()\r\n deviceManger.detailId(this.pId, (res) => {\r\n this.params = res.value\r\n this.$set(this.params)\r\n })\r\n }\r\n },\r\n handleClose() {\r\n this.params = {\r\n code: null,\r\n name: null,\r\n deviceFun: null,\r\n floodHz: null,\r\n objId: null,\r\n parentId: null,\r\n producerLinkPhone: null,\r\n producerLinkUser: null,\r\n producerName: null,\r\n remark: null,\r\n simCard: null,\r\n snNo: null,\r\n type: 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 let param = JSON.parse(JSON.stringify(this.params))\r\n // param.appTypeCodes = param.appTypeCodes.toString();\r\n // param.appTypeNames = param.appTypeNames.toString();\r\n deviceManger.addSave(param, (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 // this.$message.success(response.message)\r\n } else {\r\n // this.$message.success(response.message)\r\n }\r\n // this.$emit('closeFormDiao')\r\n // this.$router.go(-1)\r\n })\r\n }\r\n if (this.title === '修改') {\r\n deviceManger.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 // this.$message.success(response.message)\r\n } else {\r\n // this.$message.success(response.message)\r\n }\r\n // this.$emit('closeFormDiao')\r\n // this.$router.go(-1)\r\n })\r\n }\r\n } else {\r\n return false\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.types = response.data.sblx;\r\n this.objIds = response.data.sbdxfl;\r\n this.appTypeCodesType = response.data.sbyyfl;\r\n if(this.title==='新增'){\r\n this.params.type=this.types[0].value;\r\n this.params.objId=this.objIds[0].value;\r\n }\r\n },\r\n (error) => {\r\n reject(error)\r\n }\r\n )\r\n })\r\n },\r\n },\r\n}\r\n",null]}