forked from zhurui/management
1 line
19 KiB
JSON
1 line
19 KiB
JSON
{"remainingRequest":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js!C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!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":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/es6.regexp.search\";\nimport _defineProperty from \"C:\\\\Users\\\\27446\\\\Desktop\\\\up\\\\front\\\\dkha-web-sz-main\\\\node_modules\\\\@babel\\\\runtime-corejs2/helpers/esm/defineProperty\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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: function 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: [{\n required: true,\n message: '请输入',\n trigger: ['blur', 'change']\n }],\n rcNo: [{\n required: true,\n message: '请输入',\n trigger: ['blur', 'change']\n }],\n rcAddress: [{\n required: true,\n message: '请输入',\n trigger: ['blur', 'change']\n }],\n rcFloor: [{\n required: true,\n message: '请选择',\n trigger: ['blur', 'change']\n }],\n rcFenceId: [{\n required: true,\n message: '请选择',\n trigger: ['blur', 'change']\n }],\n rcType: [{\n required: true,\n message: '请选择',\n trigger: ['blur', 'change']\n }]\n },\n genderList: [],\n buildList: [],\n fenceList: [],\n areaList: getDictDataList('areaType')\n };\n },\n created: function created() {\n this.getBuildTree();\n this.getAreaFence();\n },\n methods: {\n init: function init(id) {\n var _this = this;\n\n this.dialogVisible = true; // 编辑\n\n if (id) {\n this.type = \"put\";\n\n if (id) {\n this.$http({\n url: \"/system/scregionconfig/\".concat(id),\n method: \"get\"\n }).then(function (_ref) {\n var res = _ref.data;\n\n if (res.code != 0) {\n return _this.$message.error(res.msg);\n }\n\n _this.dataForm = _objectSpread({}, res.data, {\n rcType: String(res.data.rcType)\n });\n }).catch(function (err) {\n _this.$message.error(err);\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(function () {\n _this.$refs['dataForm'].clearValidate();\n });\n }\n },\n submitInfo: debounce(function () {\n var _this2 = this;\n\n this.$refs['dataForm'].validate(function (valid) {\n if (!valid) {\n return false;\n }\n\n _this2.loading = true; // 提交需要区域围栏名称 回显\n\n var currentFence = _this2.fenceList.filter(function (item) {\n return item.id == _this2.dataForm.rcFenceId;\n })[0];\n\n _this2.dataForm.rcFenceName = currentFence.floor + currentFence.fenceName;\n\n _this2.$http({\n url: \"/system/scregionconfig\",\n method: _this2.type,\n data: _this2.dataForm\n }).then(function (_ref2) {\n var data = _ref2.data;\n\n if (data.code != 0) {\n return _this2.$message.error(data.msg);\n }\n\n _this2.dialogVisible = false;\n\n if (_this2.type == 'post') {\n _this2.$parent.$parent.resetForm('ruleForm');\n } else {\n _this2.$parent.$parent.search();\n }\n\n _this2.$message.success(data.msg);\n }).finally(function () {\n _this2.loading = false;\n });\n });\n }, 1000),\n getBuildTree: function getBuildTree() {\n var _this3 = this;\n\n this.$http.get('/system/scdormitoryfloor/tree/-1').then(function (_ref3) {\n var res = _ref3.data;\n\n if (res.code !== 0) {\n return _this3.$message.error(res.msg);\n }\n\n _this3.buildList = treeDataTranslate(res.data, 'df_floorid', 'df_parentid');\n }).catch(function () {});\n },\n getAreaFence: function getAreaFence() {\n var _this4 = this;\n\n this.$http({\n url: \"/system/scregionconfig/getUwbRegionList\",\n method: \"get\"\n }).then(function (_ref4) {\n var res = _ref4.data;\n console.log(res);\n _this4.fenceList = res.data;\n }).catch(function () {});\n }\n }\n};",{"version":3,"sources":["area-add-or-update.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmEA,SAAA,eAAA,EAAA,iBAAA,QAAA,SAAA;AACA,OAAA,QAAA,MAAA,iBAAA;AACA,eAAA;AACA,EAAA,IADA,kBACA;AACA,WAAA;AACA,MAAA,aAAA,EAAA,KADA;AAEA,MAAA,OAAA,EAAA,KAFA;AAGA,MAAA,IAAA,EAAA,MAHA;AAIA,MAAA,QAAA,EAAA;AACA,QAAA,MAAA,EAAA,EADA;AAEA,QAAA,IAAA,EAAA,EAFA;AAGA,QAAA,SAAA,EAAA,EAHA;AAIA,QAAA,OAAA,EAAA,EAJA;AAKA,QAAA,SAAA,EAAA,EALA;AAMA,QAAA,WAAA,EAAA,EANA;AAOA,QAAA,MAAA,EAAA;AAPA,OAJA;AAaA,MAAA,KAAA,EAAA;AACA,QAAA,MAAA,EAAA,CAAA;AAAA,UAAA,QAAA,EAAA,IAAA;AAAA,UAAA,OAAA,EAAA,KAAA;AAAA,UAAA,OAAA,EAAA,CAAA,MAAA,EAAA,QAAA;AAAA,SAAA,CADA;AAEA,QAAA,IAAA,EAAA,CAAA;AAAA,UAAA,QAAA,EAAA,IAAA;AAAA,UAAA,OAAA,EAAA,KAAA;AAAA,UAAA,OAAA,EAAA,CAAA,MAAA,EAAA,QAAA;AAAA,SAAA,CAFA;AAGA,QAAA,SAAA,EAAA,CAAA;AAAA,UAAA,QAAA,EAAA,IAAA;AAAA,UAAA,OAAA,EAAA,KAAA;AAAA,UAAA,OAAA,EAAA,CAAA,MAAA,EAAA,QAAA;AAAA,SAAA,CAHA;AAIA,QAAA,OAAA,EAAA,CAAA;AAAA,UAAA,QAAA,EAAA,IAAA;AAAA,UAAA,OAAA,EAAA,KAAA;AAAA,UAAA,OAAA,E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A;AAOA;AAvFA;AAjCA,CAAA","sourcesContent":["<template>\n <el-dialog\n :title=\"type=='post'?'新建':'修改'\"\n :visible.sync=\"dialogVisible\"\n :close-on-click-modal=\"false\"\n >\n <div>\n <el-form ref=\"dataForm\" :model=\"dataForm\" :rules=\"rules\" label-width=\"100px\">\n <el-row>\n <el-col :span=\"12\">\n <el-form-item label=\"区域名称\" prop=\"rcName\">\n <el-input v-model.trim=\"dataForm.rcName\" placeholder=\"请输入\"></el-input>\n </el-form-item>\n </el-col>\n <el-col :span=\"11\" :offset=\"1\">\n <el-form-item label=\"区域编号\" prop=\"rcNo\">\n <el-input v-model=\"dataForm.rcNo\" placeholder=\"请输入\"></el-input>\n </el-form-item>\n </el-col>\n </el-row>\n <el-row>\n <el-col :span=\"12\">\n <el-form-item label=\"区域位置\" prop=\"rcAddress\">\n <el-input v-model=\"dataForm.rcAddress\" placeholder=\"请输入\"></el-input>\n </el-form-item>\n </el-col>\n <el-col :span=\"11\" :offset=\"1\">\n <el-form-item label=\"楼层/楼栋\" prop=\"rcFloor\">\n <el-cascader v-model=\"dataForm.rcFloor\" clearable placeholder=\"请选择\" :options=\"buildList\" :props=\"{value:'df_floorid',label:'df_floorname'}\"></el-cascader>\n </el-form-item>\n </el-col>\n </el-row>\n <el-row>\n <el-col :span=\"12\">\n <el-form-item label=\"区域围栏\" prop=\"rcFenceId\">\n <el-select v-model=\"dataForm.rcFenceId\" placeholder=\"请选择\" clearable>\n <el-option\n v-for=\"item in fenceList\"\n :key=\"item.id\"\n :label=\"item.fenceName\"\n :value=\"item.id\"\n ></el-option>\n </el-select>\n </el-form-item>\n </el-col>\n <el-col :span=\"11\" :offset=\"1\">\n <el-form-item label=\"类别\" prop=\"rcType\">\n <el-select v-model=\"dataForm.rcType\" placeholder=\"请选择\" clearable>\n <el-option\n v-for=\"item in areaList\"\n :key=\"item.dictLabel\"\n :label=\"item.dictLabel\"\n :value=\"item.dictValue\"\n ></el-option>\n </el-select>\n </el-form-item>\n </el-col>\n </el-row>\n </el-form>\n </div>\n <div slot=\"footer\">\n <el-button @click=\"dialogVisible = false\">取 消</el-button>\n <el-button type=\"primary\" v-loading=\"loading\" @click=\"submitInfo\">确 定</el-button>\n </div>\n </el-dialog>\n</template>\n<script>\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</script>\n<style lang=\"scss\" scoped>\n.el-dialog {\n .el-form {\n .el-form-item {\n .el-date-editor--date,\n .el-cascader,\n .el-select {\n width: 100%;\n }\n }\n }\n}\n</style>"],"sourceRoot":"src/views/modules/sys"}]} |