{"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\\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":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\timport {\n\t\tgetDictDataList\n\t} from '@/utils'\n\timport debounce from 'lodash/debounce'\n\timport buildingTree from '@/views/modules/building/building-tree'\n\timport ajax from '@/utils/login'\n\texport default {\n\t\tcomponents: {\n\t\t\tbuildingTree\n\t\t},\n \t\tinject: ['refresh'],\n\t\tdata() {\n\t\t\tconst validateType = (rule, value, UWBallback) => {\n\t\t\t\tif (value != '0' && !this.dataForm.dfParentName) {\n\t\t\t\t\tUWBallback(new Error('请选择楼层或房间上级'))\n\t\t\t\t} else {\n\t\t\t\t\tUWBallback()\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tshowFloorCascader: false, // 是否显示楼层的cascader(当选择楼层\"1\"时展示)\n\t\t\t\tuwbFloorList: [], // 楼栋、楼层\n\t\t\t\tdialogVisible: false,\n\t\t\t\tloading: false,\n\t\t\t\ttype: 'post',\n\t\t\t\tdfTypeList: getDictDataList('buildingType'),\n\t\t\t\tdfPurposeList: getDictDataList('purpose'),\n\t\t\t\tdataForm: {\n\t\t\t\t\tdfParentid: '0',\n\t\t\t\t\tdfParentName: '',\n\t\t\t\t\tdfType: '',\n\t\t\t\t\tuwbFloors: [],\n\t\t\t\t\tdfFloorname: '',\n\t\t\t\t\tdfPurpose: '',\n\t\t\t\t\tdfOrder: 0,\n\t\t\t\t\tdrCapacity: 1\n\t\t\t\t},\n\t\t\t\trules: {\n\t\t\t\t\tdfType: [{\n\t\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\t\tmessage: '请选择',\n\t\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvalidator: validateType,\n\t\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\tuwbFloors: [{\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tmessage: '请选择',\n\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t}],\n\t\t\t\t\tdfPurpose: [{\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tmessage: '请选择',\n\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t}, ],\n\t\t\t\t\tdfFloorname: [{\n\t\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\t\tmessage: '请输入',\n\t\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmax: 30,\n\t\t\t\t\t\t\tmessage: '最多 30 个字符',\n\t\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\tdfOrder: [{\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tmessage: '请输入',\n\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t}, ],\n\t\t\t\t\tdrCapacity: [{\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tmessage: '请输入',\n\t\t\t\t\t\ttrigger: ['blur', 'change']\n\t\t\t\t\t}, ]\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tcreated() {\n\t\t\t\t// 获取UWB楼栋和楼层的cascader\n\t\t\t\tajax({\n\t\t\t\t\turl:\"/map/map\",\n\t\t\t\t\t// url:\"/system/scdormitoryfloor/uwbbuildingtree\",\n\t\t\t\t\tmethod:\"get\"\n\t\t\t\t}).then(({\n\t\t\t\t\tdata: res\n\t\t\t\t}) => {\n\t\t\t\t\t// status 200\n\t\t\t\t\tif (res.status !==200) {\n\t\t\t\t\t\treturn this.$message.error(res.msg)\n\t\t\t\t\t}\n\t\t\t\t\t// this.uwbFloorList = res.data.map(item => {\n\t\t\t\t\t// \titem.children = item.children.map(item1 => {\n\t\t\t\t\t// \t\treturn {\n\t\t\t\t\t// \t\t\tlabel: item1.label,\n\t\t\t\t\t// \t\t\tvalue: item1.value\n\t\t\t\t\t// \t\t}\n\t\t\t\t\t// \t})\n\t\t\t\t\t// \treturn item\n\t\t\t\t\t// })\n\t\t\t\t\tthis.uwbFloorList=res.result.filter(item=>{\n\t\t\t\t\t\treturn item.mapType==1\n\t\t\t\t\t}).map(item=>{\n\t\t\t\t\t\titem.children=JSON.parse(item.floorList).map(label=>{\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tlabel: label,\n\t\t\t\t\t\t\t\tvalue: label\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\titem.label=item.buildingName;\n\t\t\t\t\t\titem.value=String(item.id);\n\t\t\t\t\t\treturn item\n\t\t\t\t\t})\n\t\t\t\t}).catch((err) => {\n\t\t\t\t\tconsole.log('building error',err)\n\t\t\t\t})\n\t\t},\n\t\tmethods: {\n\t\t\tinit(id, type) {\n\t\t\t\tthis.dialogVisible = true;\n\t\t\t\t\t// 编辑\n\t\t\t\t\tif (id) {\n\t\t\t\t\t\tthis.type = 'put';\n\t\t\t\t\t\tthis.$http({\n\t\t\t\t\t\t\turl: `/system/scdormitoryfloor/${id}/${type}`,\n\t\t\t\t\t\t\tmethod: \"get\"\n\t\t\t\t\t\t}).then(({\n\t\t\t\t\t\t\tdata\n\t\t\t\t\t\t}) => {\n\t\t\t\t\t\t\tif (data.code == 0) {\n\t\t\t\t\t\t\t\t// 1 是楼层\n\t\t\t\t\t\t\t\tif (data.data.dfType == 1) {\n\t\t\t\t\t\t\t\t\tthis.showFloorCascader = true\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tthis.showFloorCascader = false\n\t\t\t\t\t\t\t\t\tdata.data.uwbFloors = []\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis.dataForm = {\n\t\t\t\t\t\t\t\t\t...data.data,\n\t\t\t\t\t\t\t\t\tdfPurpose: String(data.data.dfPurpose),\n\t\t\t\t\t\t\t\t\tdfType: String(data.data.dfType),\n\t\t\t\t\t\t\t\t\tdfParentName: data.data.parentName\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.$message.warning(data.msg)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\t// 新增\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis.type = 'post';\n\t\t\t\t\t\tthis.dataForm = {\n\t\t\t\t\t\t\tdfParentid: '0',\n\t\t\t\t\t\t\tdfParentName: '',\n\t\t\t\t\t\t\tdfType: '',\n\t\t\t\t\t\t\tuwbFloors: [],\n\t\t\t\t\t\t\tdfFloorname: '',\n\t\t\t\t\t\t\tdfPurpose: '',\n\t\t\t\t\t\t\tdfOrder: 0,\n\t\t\t\t\t\t\tdrCapacity: 1\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.showFloorCascader = false\n\t\t\t\t\t\tthis.dataForm.uwbFloors = []\n\t\t\t\t\t\tthis.$nextTick(() => {\n\t\t\t\t\t\t\tthis.$refs['dataForm'].resetFields();\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t},\n\t\t\ttypeHandle(e) {\n\t\t\t\tif (e == 1) {\n\t\t\t\t\tthis.showFloorCascader = true\n\t\t\t\t} else {\n\t\t\t\t\tthis.showFloorCascader = false\n\t\t\t\t\tthis.dataForm.uwbFloors = []\n\t\t\t\t}\n\t\t\t},\n\t\t\tsubmitForm: debounce(function() {\n\t\t\t\tthis.$refs['dataForm'].validate((valid) => {\n\t\t\t\t\tif (!valid) {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t\t// 当uwbFloors没数据时,后端返回的时\"\",但是提交数据时后端接收的是[]\n\t\t\t\t\tif(this.dataForm.uwbFloors === \"\"){\n\t\t\t\t\t\tthis.dataForm.uwbFloors = []\n\t\t\t\t\t}\n\t\t\t\t\tthis.loading = true;\n\t\t\t\t\tthis.$http({\n\t\t\t\t\t\turl: \"/system/scdormitoryfloor\",\n\t\t\t\t\t\tmethod: this.type,\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t...this.dataForm\n\t\t\t\t\t\t}\n\t\t\t\t\t}).then(({\n\t\t\t\t\t\tdata\n\t\t\t\t\t}) => {\n\t\t\t\t\t\tif (data.code == 0) {\n\t\t\t\t\t\t\tthis.dialogVisible = false;\n\t\t\t\t\t\t\t// this.$parent.$parent.initTree();\n\t\t\t\t\t\t\tthis.refresh();\n\t\t\t\t\t\t\tthis.$message.success(data.msg)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.$message.warning(data.msg)\n\t\t\t\t\t\t}\n\t\t\t\t\t}).finally(() => {\n\t\t\t\t\t\tthis.loading = false;\n\t\t\t\t\t})\n\n\t\t\t\t})\n\t\t\t}, 1000, {\n\t\t\t\t'leading': true,\n\t\t\t\t'trailing': false\n\t\t\t})\n\t\t}\n\t}\n",{"version":3,"sources":["add-or-update.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA;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;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;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA","file":"add-or-update.vue","sourceRoot":"src/views/modules/building","sourcesContent":["\n\n\n"]}]}