forked from zhurui/management
1 line
12 KiB
JSON
1 line
12 KiB
JSON
{"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\\components\\public\\dormitory-tree.vue?vue&type=script&lang=js&","dependencies":[{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\components\\public\\dormitory-tree.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\nimport { treeDataTranslateDis,treeDataTranslate } from '@/utils'\n export default {\n props: {\n type: String\n },\n data(){\n return{\n filterText:'',\n dataList: [],\n defaultCheckedKeysElectric:[],\n defaultCheckedKeysGoout:[],\n defaultCheckedKeysRoom:[],\n keyElectric:'',\n keyGoout:'',\n }\n },\n watch: {\n filterText (val) {\n this.$refs.tree.filter(val);\n },\n },\n mounted(){\n this.initTree(); \n },\n methods:{\n //第一级数据\n initTree(){\n this.$http.get('/system/scdormitoryfloor/roomTree/0').then(({data:res})=>{\n if(res.code==0){\n let list=res.data.map(item=>{\n return {\n ...item,\n name:item.df_floorname,\n id:item.df_floorid,\n pid:item.df_parentid\n }\n })\n this.dataList= treeDataTranslate(list)\n // 宿舍电流 展示第一栋 的 第一层 的 第一个房间\n this.keyElectric=this.dataList[0]['children'][0]['children'][0].id;\n\n //外出管理 展示第一栋 的 第一层\n this.keyGoout=this.dataList[0]['children'][0].id;\n let type=this.dataList[0]['children'][0].df_type;\n let valGoout={\n df_floorid:this.keyGoout,\n df_type:type\n }\n\n //宿舍房间 展示第一栋\n this.keyRoom=this.dataList[0].id;\n let typeroom=this.dataList[0].df_type;\n let valRoom={\n df_floorid:this.keyRoom,\n df_type:typeroom\n }\n\n //树 默认展示 数组结构\n this.defaultCheckedKeysElectric.push(this.keyElectric);\n this.defaultCheckedKeysGoout.push(this.keyGoout);\n this.defaultCheckedKeysRoom.push(this.keyRoom);\n\n //储存数据\n this.$store.state.user.defaultCheckedKeys=this.keyElectric\n this.$store.state.user.valGoout=valGoout;\n this.$store.state.user.valRoom=valRoom;\n\n //默认展开 的 节点 标亮\n this.$nextTick(()=>{\n if(this.type == 'electric'){\n this.$refs.tree.setCurrentKey(this.keyElectric); \n }else if(this.type =='goout'){\n this.$refs.tree.setCurrentKey(this.keyGoout); \n }else if(this.type == 'room'){\n this.$refs.tree.setCurrentKey(this.keyRoom); \n }\n \n })\n }\n else{\n this.dataList=[]\n this.$message.error(data.msg)\n }\n })\n },\n handleNodeClick(data){\n let a=JSON.parse(JSON.stringify(data));\n let val={\n df_floorid:a.df_floorid,\n df_type:a.df_type,\n df_floorname:a.df_floorname \n }\n this.$emit('treeFun',val)\n },\n filterNode(value, data) {\n if (!value) return true;\n return data.name.indexOf(value) !== -1;\n },\n }\n }\n",{"version":3,"sources":["dormitory-tree.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;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;AACA;AACA;AACA","file":"dormitory-tree.vue","sourceRoot":"src/components/public","sourcesContent":["<template>\n <div>\n <el-input\n v-if=\"type!='goout'\"\n placeholder=\"请输入\"\n clearable\n v-model=\"filterText\">\n <i slot=\"suffix\" class=\"el-input__icon el-icon-search\"></i>\n </el-input>\n <p class=\"title\"></p>\n <el-tree \n v-if=\"type=='room'\"\n :data=\"dataList\" \n :props=\"{ label: 'df_floorname', children: 'children'}\"\n highlight-current \n accordion \n node-key=\"df_floorid\" \n ref=\"tree\" \n check-on-click-node\n :default-expanded-keys=\"defaultCheckedKeysRoom\"\n :default-checked-keys=\"defaultCheckedKeysRoom\"\n :filter-node-method=\"filterNode\" \n @check=\"handleNodeClick\">\n </el-tree>\n <el-tree \n v-else-if=\"type=='electric'\"\n :data=\"dataList\" \n :props=\"{ label: 'df_floorname', children: 'children'}\"\n accordion \n highlight-current \n node-key=\"df_floorid\" \n ref=\"tree\" \n check-on-click-node\n :default-expanded-keys=\"defaultCheckedKeysElectric\"\n :default-checked-keys=\"defaultCheckedKeysElectric\"\n :filter-node-method=\"filterNode\" \n @check=\"handleNodeClick\">\n </el-tree>\n <el-tree \n class=\"gooutTree\"\n v-else-if=\"type=='goout'\"\n :data=\"dataList\" \n :props=\"{ label: 'df_floorname', children: 'children'}\"\n accordion \n highlight-current \n node-key=\"df_floorid\" \n ref=\"tree\" \n check-on-click-node\n :default-expanded-keys=\"defaultCheckedKeysGoout\"\n :default-checked-keys=\"defaultCheckedKeysGoout\"\n :filter-node-method=\"filterNode\" \n @check=\"handleNodeClick\">\n </el-tree> \n </div>\n</template>\n\n<script>\nimport { treeDataTranslateDis,treeDataTranslate } from '@/utils'\n export default {\n props: {\n type: String\n },\n data(){\n return{\n filterText:'',\n dataList: [],\n defaultCheckedKeysElectric:[],\n defaultCheckedKeysGoout:[],\n defaultCheckedKeysRoom:[],\n keyElectric:'',\n keyGoout:'',\n }\n },\n watch: {\n filterText (val) {\n this.$refs.tree.filter(val);\n },\n },\n mounted(){\n this.initTree(); \n },\n methods:{\n //第一级数据\n initTree(){\n this.$http.get('/system/scdormitoryfloor/roomTree/0').then(({data:res})=>{\n if(res.code==0){\n let list=res.data.map(item=>{\n return {\n ...item,\n name:item.df_floorname,\n id:item.df_floorid,\n pid:item.df_parentid\n }\n })\n this.dataList= treeDataTranslate(list)\n // 宿舍电流 展示第一栋 的 第一层 的 第一个房间\n this.keyElectric=this.dataList[0]['children'][0]['children'][0].id;\n\n //外出管理 展示第一栋 的 第一层\n this.keyGoout=this.dataList[0]['children'][0].id;\n let type=this.dataList[0]['children'][0].df_type;\n let valGoout={\n df_floorid:this.keyGoout,\n df_type:type\n }\n\n //宿舍房间 展示第一栋\n this.keyRoom=this.dataList[0].id;\n let typeroom=this.dataList[0].df_type;\n let valRoom={\n df_floorid:this.keyRoom,\n df_type:typeroom\n }\n\n //树 默认展示 数组结构\n this.defaultCheckedKeysElectric.push(this.keyElectric);\n this.defaultCheckedKeysGoout.push(this.keyGoout);\n this.defaultCheckedKeysRoom.push(this.keyRoom);\n\n //储存数据\n this.$store.state.user.defaultCheckedKeys=this.keyElectric\n this.$store.state.user.valGoout=valGoout;\n this.$store.state.user.valRoom=valRoom;\n\n //默认展开 的 节点 标亮\n this.$nextTick(()=>{\n if(this.type == 'electric'){\n this.$refs.tree.setCurrentKey(this.keyElectric); \n }else if(this.type =='goout'){\n this.$refs.tree.setCurrentKey(this.keyGoout); \n }else if(this.type == 'room'){\n this.$refs.tree.setCurrentKey(this.keyRoom); \n }\n \n })\n }\n else{\n this.dataList=[]\n this.$message.error(data.msg)\n }\n })\n },\n handleNodeClick(data){\n let a=JSON.parse(JSON.stringify(data));\n let val={\n df_floorid:a.df_floorid,\n df_type:a.df_type,\n df_floorname:a.df_floorname \n }\n this.$emit('treeFun',val)\n },\n filterNode(value, data) {\n if (!value) return true;\n return data.name.indexOf(value) !== -1;\n },\n }\n }\n</script>\n\n<style lang=\"scss\" scoped>\n.title{\n color:#fff\n}\n/* 滚动条 */\n.el-tree::-webkit-scrollbar-track{\n -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.3);\n border-radius: 15px;\n background-color: rgba(255,255,255,0.8);\n}\n.el-tree::-webkit-scrollbar{\n width: 5px;\n background-color: rgba(179, 174, 174, 0);\n}\n.el-tree::-webkit-scrollbar-thumb{\n border-radius: 15px;\n -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,.3);\n background-color: #555;\n}\n/deep/.el-tree-node__label{\n\tfont-size: 18px;\n}\n</style>"]}]} |