{"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\\building\\add-or-update.vue?vue&type=script&lang=js&","dependencies":[{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\views\\modules\\building\\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 _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//\nimport { getDictDataList } from '@/utils';\nimport debounce from 'lodash/debounce';\nimport buildingTree from '@/views/modules/building/building-tree';\nimport ajax from '@/utils/login';\nexport default {\n components: {\n buildingTree: buildingTree\n },\n inject: ['refresh'],\n data: function data() {\n var _this = this;\n\n var validateType = function validateType(rule, value, UWBallback) {\n if (value != '0' && !_this.dataForm.dfParentName) {\n UWBallback(new Error('请选择楼层或房间上级'));\n } else {\n UWBallback();\n }\n };\n\n return {\n showFloorCascader: false,\n // 是否显示楼层的cascader(当选择楼层\"1\"时展示)\n uwbFloorList: [],\n // 楼栋、楼层\n dialogVisible: false,\n loading: false,\n type: 'post',\n dfTypeList: getDictDataList('buildingType'),\n dfPurposeList: getDictDataList('purpose'),\n dataForm: {\n dfParentid: '0',\n dfParentName: '',\n dfType: '',\n uwbFloors: [],\n dfFloorname: '',\n dfPurpose: '',\n dfOrder: 0,\n drCapacity: 1\n },\n rules: {\n dfType: [{\n required: true,\n message: '请选择',\n trigger: ['blur', 'change']\n }, {\n validator: validateType,\n trigger: ['blur', 'change']\n }],\n uwbFloors: [{\n required: true,\n message: '请选择',\n trigger: ['blur', 'change']\n }],\n dfPurpose: [{\n required: true,\n message: '请选择',\n trigger: ['blur', 'change']\n }],\n dfFloorname: [{\n required: true,\n message: '请输入',\n trigger: ['blur', 'change']\n }, {\n max: 30,\n message: '最多 30 个字符',\n trigger: ['blur', 'change']\n }],\n dfOrder: [{\n required: true,\n message: '请输入',\n trigger: ['blur', 'change']\n }],\n drCapacity: [{\n required: true,\n message: '请输入',\n trigger: ['blur', 'change']\n }]\n }\n };\n },\n created: function created() {\n var _this2 = this;\n\n // 获取UWB楼栋和楼层的cascader\n ajax({\n url: \"/map/map\",\n // url:\"/system/scdormitoryfloor/uwbbuildingtree\",\n method: \"get\"\n }).then(function (_ref) {\n var res = _ref.data;\n\n // status 200\n if (res.status !== 200) {\n return _this2.$message.error(res.msg);\n } // this.uwbFloorList = res.data.map(item => {\n // \titem.children = item.children.map(item1 => {\n // \t\treturn {\n // \t\t\tlabel: item1.label,\n // \t\t\tvalue: item1.value\n // \t\t}\n // \t})\n // \treturn item\n // })\n\n\n _this2.uwbFloorList = res.result.filter(function (item) {\n return item.mapType == 1;\n }).map(function (item) {\n item.children = JSON.parse(item.floorList).map(function (label) {\n return {\n label: label,\n value: label\n };\n });\n item.label = item.buildingName;\n item.value = String(item.id);\n return item;\n });\n }).catch(function (err) {\n console.log('building error', err);\n });\n },\n methods: {\n init: function init(id, type) {\n var _this3 = this;\n\n this.dialogVisible = true; // 编辑\n\n if (id) {\n this.type = 'put';\n this.$http({\n url: \"/system/scdormitoryfloor/\".concat(id, \"/\").concat(type),\n method: \"get\"\n }).then(function (_ref2) {\n var data = _ref2.data;\n\n if (data.code == 0) {\n // 1 是楼层\n if (data.data.dfType == 1) {\n _this3.showFloorCascader = true;\n } else {\n _this3.showFloorCascader = false;\n data.data.uwbFloors = [];\n }\n\n _this3.dataForm = _objectSpread({}, data.data, {\n dfPurpose: String(data.data.dfPurpose),\n dfType: String(data.data.dfType),\n dfParentName: data.data.parentName\n });\n } else {\n _this3.$message.warning(data.msg);\n }\n });\n } // 新增\n else {\n this.type = 'post';\n this.dataForm = {\n dfParentid: '0',\n dfParentName: '',\n dfType: '',\n uwbFloors: [],\n dfFloorname: '',\n dfPurpose: '',\n dfOrder: 0,\n drCapacity: 1\n };\n this.showFloorCascader = false;\n this.dataForm.uwbFloors = [];\n this.$nextTick(function () {\n _this3.$refs['dataForm'].resetFields();\n });\n }\n },\n typeHandle: function typeHandle(e) {\n if (e == 1) {\n this.showFloorCascader = true;\n } else {\n this.showFloorCascader = false;\n this.dataForm.uwbFloors = [];\n }\n },\n submitForm: debounce(function () {\n var _this4 = this;\n\n this.$refs['dataForm'].validate(function (valid) {\n if (!valid) {\n return false;\n } // 当uwbFloors没数据时,后端返回的时\"\",但是提交数据时后端接收的是[]\n\n\n if (_this4.dataForm.uwbFloors === \"\") {\n _this4.dataForm.uwbFloors = [];\n }\n\n _this4.loading = true;\n\n _this4.$http({\n url: \"/system/scdormitoryfloor\",\n method: _this4.type,\n data: _objectSpread({}, _this4.dataForm)\n }).then(function (_ref3) {\n var data = _ref3.data;\n\n if (data.code == 0) {\n _this4.dialogVisible = false; // this.$parent.$parent.initTree();\n\n _this4.refresh();\n\n _this4.$message.success(data.msg);\n } else {\n _this4.$message.warning(data.msg);\n }\n }).finally(function () {\n _this4.loading = false;\n });\n });\n }, 1000, {\n 'leading': true,\n 'trailing': false\n })\n }\n};",{"version":3,"sources":["add-or-update.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,SACA,eADA,QAEA,SAFA;AAGA,OAAA,QAAA,MAAA,iBAAA;AACA,OAAA,YAAA,MAAA,wCAAA;AACA,OAAA,IAAA,MAAA,eAAA;AACA,eAAA;AACA,EAAA,UAAA,EAAA;AACA,IAAA,YAAA,EAAA;AADA,GADA;AAIA,EAAA,MAAA,EAAA,CAAA,SAAA,CAJA;AAKA,EAAA,IALA,kBAKA;AAAA;;AACA,QAAA,YAAA,GAAA,SAAA,YAAA,CAAA,IAAA,EAAA,KAAA,EAAA,UAAA,EAAA;AACA,UAAA,KAAA,IAAA,GAAA,IAAA,CAAA,KAAA,CAAA,QAAA,CAAA,YAAA,EAAA;AACA,QAAA,UAAA,CAAA,IAAA,KAAA,CAAA,YAAA,CAAA,CAAA;AACA,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