{"remainingRequest":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\views\\modules\\sys\\area-add-or-update.vue?vue&type=script&lang=js&","dependencies":[{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\views\\modules\\sys\\area-add-or-update.vue","mtime":1614735254000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\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\nimport { getDictDataList,treeDataTranslate} from '@/utils'\nimport debounce from 'lodash/debounce'\nexport default {\n data(){\n return {\n dialogVisible:false,\n loading:false,\n type:'post',\n dataForm:{\n rcName:'',\n rcNo:'',\n rcAddress:'',\n rcFloor:'',\n rcFenceId:'',\n rcFenceName:'',\n rcType:'',\n },\n rules:{\n rcName:[{required: true, message:'请输入', trigger: ['blur','change']},],\n rcNo:[{required: true, message:'请输入', trigger: ['blur','change']},],\n rcAddress:[{required: true, message:'请输入', trigger: ['blur','change']},],\n rcFloor:[{required: true, message:'请选择', trigger: ['blur','change']},],\n rcFenceId:[{required: true, message:'请选择', trigger: ['blur','change']},],\n rcType:[{required: true, message:'请选择', trigger: ['blur','change']},],\n },\n genderList:[],\n buildList:[],\n fenceList:[],\n areaList:getDictDataList('areaType')\n }\n },\n created(){\n this.getBuildTree()\n this.getAreaFence()\n },\n methods:{\n init(id){\n this.dialogVisible=true;\n // 编辑\n if(id){\n this.type=\"put\";\n if(id){\n this.$http({\n url:`/system/scregionconfig/${id}`,\n method:\"get\"\n }).then(({data:res})=>{\n if(res.code!=0){\n return this.$message.error(res.msg)\n }\n this.dataForm={\n ...res.data,\n rcType:String(res.data.rcType)\n };\n }).catch(err=>{\n this.$message.error(err)\n })\n }\n }\n // 新增\n else{\n this.type=\"post\";\n this.dataForm={\n rcName:'',\n rcNo:'',\n rcAddress:'',\n rcFloor:'',\n rcFenceId:'',\n rcFenceName:'',\n rcType:'',\n };\n this.$nextTick(()=>{\n this.$refs['dataForm'].clearValidate()\n })\n }\n },\n submitInfo:debounce(function(){\n this.$refs['dataForm'].validate((valid)=>{\n if(!valid){\n return false\n }\n this.loading=true;\n // 提交需要区域围栏名称 回显\n let currentFence=this.fenceList.filter(item=>item.id==this.dataForm.rcFenceId)[0];\n this.dataForm.rcFenceName=currentFence.floor+currentFence.fenceName;\n this.$http({\n url:\"/system/scregionconfig\",\n method:this.type,\n data:this.dataForm\n }).then(({data})=>{\n if(data.code!=0){\n return this.$message.error(data.msg)\n }\n this.dialogVisible=false;\n if(this.type=='post'){\n this.$parent.$parent.resetForm('ruleForm');\n }\n else{\n this.$parent.$parent.search();\n }\n this.$message.success(data.msg)\n }).finally(()=>{\n this.loading=false\n })\n })\n \n },1000),\n getBuildTree () {\n this.$http.get('/system/scdormitoryfloor/tree/-1').then(({ data: res }) => {\n if (res.code !== 0) {\n return this.$message.error(res.msg)\n }\n this.buildList = treeDataTranslate(res.data,'df_floorid','df_parentid')\n }).catch(() => {})\n },\n getAreaFence(){\n this.$http({\n url:\"/system/scregionconfig/getUwbRegionList\",\n method:\"get\"\n }).then(({data:res})=>{\n console.log(res)\n this.fenceList=res.data;\n }).catch(()=>{})\n }\n }\n}\n",{"version":3,"sources":["area-add-or-update.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"area-add-or-update.vue","sourceRoot":"src/views/modules/sys","sourcesContent":["\n\n"]}]}