|
@@ -2,16 +2,37 @@
|
|
|
<div class="deptListComponent">
|
|
|
<div id="tree-box">
|
|
|
<el-form :model="queryParams" class="form-box" ref="queryForm"
|
|
|
- :inline="true" style="width:100%;">
|
|
|
- <el-form-item label="" prop="state">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.searchValue"
|
|
|
- placeholder="实验室"
|
|
|
- style="width:350px;border-radius:10px;"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <p class="form-inquire-common-style-button" @click="handleQuery">查询</p>
|
|
|
- <p class="form-reset-common-style-button" @click="resetQuery">重置</p>
|
|
|
+ :inline="true" style="width:100%;display: flex;flex-direction: column">
|
|
|
+ <div style="display: flex;">
|
|
|
+ <el-form-item label="" prop="deptId">
|
|
|
+ <el-select v-model="queryParams.deptId"
|
|
|
+ placeholder="请选择学院"
|
|
|
+ style="width: 450px">
|
|
|
+ <el-option
|
|
|
+ v-for="item in deptList"
|
|
|
+ :key="item.deptId"
|
|
|
+ :label="item.deptName"
|
|
|
+ :value="item.deptId"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <p class="form-inquire-common-style-button" style="width:100px;margin:0 20px 0 10px;" @click="handleQuery">查询</p>
|
|
|
+ <p class="form-reset-common-style-button" style="width:100px;" @click="resetQuery">重置</p>
|
|
|
+ </div>
|
|
|
+ <div class="input-select">
|
|
|
+ <el-form-item label="" prop="searchValue">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.searchValue"
|
|
|
+ placeholder="请输入"
|
|
|
+ style="width:690px;"
|
|
|
+ >
|
|
|
+ <el-select v-model="inputType" slot="prepend" placeholder="请选择">
|
|
|
+ <el-option label="实验室名称" value="1"></el-option>
|
|
|
+ <el-option label="房号" value="2"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
</el-form>
|
|
|
<div class="for-level-max-box">
|
|
|
<div class="for-level-box"
|
|
@@ -46,7 +67,7 @@
|
|
|
overflow:hidden;
|
|
|
text-overflow:ellipsis;
|
|
|
white-space:nowrap;"
|
|
|
- :style="!data.level?'font-size:34px':(data.level==1?'font-size:40px':(data.level==2||data.level==3||data.level==4?'font-size:36px':(data.level==5?'font-size:34px':'')))">{{data.deptName}}</span>
|
|
|
+ :style="!data.level?'font-size:34px':(data.level==1?'font-size:40px':(data.level==2?'font-size:36px':(data.level==3?'font-size:34px':'')))">{{data.deptName}}</span>
|
|
|
</template>
|
|
|
</el-tree>
|
|
|
</div>
|
|
@@ -56,9 +77,10 @@
|
|
|
<script>
|
|
|
import {
|
|
|
laboratoryLevelConfigGetLevelTitleList,
|
|
|
- laboratoryLabDeptTreeGetTreeList,
|
|
|
- laboratoryLabDeptTreeGetRoomList,
|
|
|
+ laboratoryLabDeptTreeLargeTree,
|
|
|
+ laboratoryLabDeptTreeLargeRooms,
|
|
|
laboratorySubPassOutGetCountByBuildId,
|
|
|
+ getDeptDropList,
|
|
|
} from "@/api/index";
|
|
|
export default {
|
|
|
name: 'deptListComponent',
|
|
@@ -72,9 +94,11 @@
|
|
|
buildName:null,
|
|
|
floorId:null,
|
|
|
floorName:null,
|
|
|
+ deptList:[],
|
|
|
//新树
|
|
|
deptOptions: null,
|
|
|
defaultKey:null,
|
|
|
+ inputType:'1',
|
|
|
defaultProps: {
|
|
|
children: "childTreeList",
|
|
|
label: "deptName",
|
|
@@ -84,6 +108,7 @@
|
|
|
treeId:null,
|
|
|
queryParams: {
|
|
|
searchValue: '',
|
|
|
+ deptId:'',
|
|
|
},
|
|
|
levelList:[],
|
|
|
checkLeveList:[],
|
|
@@ -93,24 +118,27 @@
|
|
|
|
|
|
},
|
|
|
mounted(){
|
|
|
+ this.getDeptDropList();
|
|
|
this.laboratoryLevelConfigGetLevelTitleList();
|
|
|
- this.laboratoryLabDeptTreeGetTreeList()
|
|
|
+ this.laboratoryLabDeptTreeLargeTree()
|
|
|
},
|
|
|
methods:{
|
|
|
//查询按钮
|
|
|
handleQuery(){
|
|
|
- this.laboratoryLabDeptTreeGetTreeList();
|
|
|
+ this.laboratoryLabDeptTreeLargeTree();
|
|
|
},
|
|
|
//重置按钮
|
|
|
resetQuery(){
|
|
|
let self = this;
|
|
|
+ this.$set(this,'inputType','1');
|
|
|
this.$set(this,'queryParams',{
|
|
|
searchValue: '',
|
|
|
+ deptId:'',
|
|
|
});
|
|
|
for(let i=0;i<self.checkLeveList.length;i++){
|
|
|
self.checkLeveList[i].type = false;
|
|
|
}
|
|
|
- this.laboratoryLabDeptTreeGetTreeList();
|
|
|
+ this.laboratoryLabDeptTreeLargeTree();
|
|
|
},
|
|
|
//选中级别
|
|
|
checkLevelButton(item,index){
|
|
@@ -131,26 +159,46 @@
|
|
|
});
|
|
|
},
|
|
|
//新树
|
|
|
- laboratoryLabDeptTreeGetTreeList() {
|
|
|
+ laboratoryLabDeptTreeLargeTree() {
|
|
|
let self = this;
|
|
|
let obj = {
|
|
|
- searchValue:this.searchValue,
|
|
|
+ deptId:this.queryParams.deptId,
|
|
|
levelIds:[],
|
|
|
}
|
|
|
+ if (this.inputType == 1){
|
|
|
+ obj.subName = this.queryParams.searchValue;
|
|
|
+ } else if(this.inputType == 2){
|
|
|
+ obj.roomNum = this.queryParams.searchValue;
|
|
|
+ }
|
|
|
for(let i=0;i<self.checkLeveList.length;i++){
|
|
|
if(self.checkLeveList[i].type){
|
|
|
obj.levelIds.push(self.checkLeveList[i].levelId)
|
|
|
}
|
|
|
}
|
|
|
- laboratoryLabDeptTreeGetTreeList(obj).then(response => {
|
|
|
+ laboratoryLabDeptTreeLargeTree(obj).then(response => {
|
|
|
+ if(!response.data[0]){
|
|
|
+ this.msgSuccess('未找到相关数据')
|
|
|
+ return
|
|
|
+ }
|
|
|
let self = this;
|
|
|
- let list = this.delList(response.data);
|
|
|
+ let list = this.forTreeId(response.data);
|
|
|
+ //写入楼层下数据
|
|
|
+ self.$set(self,'deptOptions',list)
|
|
|
this.$nextTick(()=>{
|
|
|
- let checkData = list[0].childTreeList[0].childTreeList[0].childTreeList[0];
|
|
|
- //写入楼层下数据
|
|
|
- this.$set(this,'deptOptions',list)
|
|
|
- //展开列表
|
|
|
- this.$set(this,'defaultKey',[list[0].treeId,list[0].childTreeList[0].treeId,list[0].childTreeList[0].childTreeList[0].treeId,list[0].childTreeList[0].childTreeList[0].childTreeList[0].treeId]);
|
|
|
+ let checkData = []
|
|
|
+ if(obj.subName || obj.roomNum){
|
|
|
+ checkData = list[0].childTreeList[0].childTreeList[0];
|
|
|
+ //展开列表
|
|
|
+ // self.$set(self,'defaultKey',[list[0].treeId,list[0].childTreeList[0].childTreeList[0].treeId]);
|
|
|
+ self.$set(self,'defaultKey',[list[0].treeId,list[0].childTreeList[0].treeId]);
|
|
|
+ setTimeout(function(){
|
|
|
+ self.$set(self,'defaultKey',[list[0].treeId,list[0].childTreeList[0].childTreeList[0].treeId]);
|
|
|
+ },200)
|
|
|
+ }else{
|
|
|
+ checkData = list[0].childTreeList[0];
|
|
|
+ //展开列表
|
|
|
+ self.$set(self,'defaultKey',[list[0].treeId,list[0].childTreeList[0].treeId]);
|
|
|
+ }
|
|
|
setTimeout(function(){
|
|
|
//选中列表
|
|
|
self.$refs.tree.setCurrentKey(checkData.treeId);
|
|
@@ -160,45 +208,42 @@
|
|
|
//查询实验室人数
|
|
|
self.laboratorySubPassOutGetCountByBuildId(1,checkData.treeId);
|
|
|
//父级视屏数据
|
|
|
- self.$parent.setVideoData(checkData);
|
|
|
- },200);
|
|
|
+ self.getSubId(checkData);
|
|
|
+ },600);
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- //空数据处理
|
|
|
- delList(list){
|
|
|
+ forTreeId(list){
|
|
|
let self = this;
|
|
|
- for(let i=1;i<4;i++){
|
|
|
- list.forEach((item,index)=>{
|
|
|
- if(item.level != 5){
|
|
|
- if(item.childTreeList){
|
|
|
- if(!item.childTreeList[0]){
|
|
|
- list.splice(index,1)
|
|
|
- }else{
|
|
|
- self.delList(item.childTreeList);
|
|
|
- }
|
|
|
- }else{
|
|
|
- list.splice(index,1)
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+ list.forEach((item,index)=>{
|
|
|
+ item.treeId = item.id;
|
|
|
+ item.deptName = item.name;
|
|
|
+ item.level = item.type;
|
|
|
+ item.childTreeList = item.buildFloorVoList;
|
|
|
+ delete item.id
|
|
|
+ delete item.name
|
|
|
+ delete item.type
|
|
|
+ delete item.buildFloorVoList
|
|
|
+ if(item.childTreeList[0]){
|
|
|
+ self.forTreeId(item.childTreeList);
|
|
|
+ }
|
|
|
+ })
|
|
|
return list
|
|
|
},
|
|
|
//点击操作
|
|
|
nodeClickButton(e,data){
|
|
|
this.$nextTick(() => {
|
|
|
- if (!e.level||e.level == 4||e.level == 5) {
|
|
|
+ if (!e.level||e.level == 2||e.level == 3) {
|
|
|
if(this.treeId != e.treeId){
|
|
|
this.treeId = e.treeId;
|
|
|
//等待后续逻辑-面板展示-实验室信息-视屏信息
|
|
|
//当前位置展示
|
|
|
this.checkAddress(e.treeId);
|
|
|
//查询实验室人数
|
|
|
- let type = !e.subId&&!e.level?3:(e.level == 4 ?1:(e.level == 5?2:''))
|
|
|
+ let type = !e.subId&&!e.level?3:(e.level == 2 ?1:(e.level == 3?2:''))
|
|
|
this.laboratorySubPassOutGetCountByBuildId(type,e.treeId);
|
|
|
- //父级视屏数据
|
|
|
- this.$parent.setVideoData(e);
|
|
|
+ //查询楼栋/楼层下所有实验室ID
|
|
|
+ this.getSubId(e);
|
|
|
}
|
|
|
}
|
|
|
this.$refs.tree.setCurrentKey(this.treeId);
|
|
@@ -206,21 +251,28 @@
|
|
|
},
|
|
|
//手动加载
|
|
|
loadNode(node, resolve) {
|
|
|
+ console.log('手动')
|
|
|
let self = this;
|
|
|
if (node.data){
|
|
|
- if(node.data.level == 5){
|
|
|
+ if(node.data.level == 3){
|
|
|
let obj = {
|
|
|
- searchValue:this.searchValue,
|
|
|
+ deptId:this.queryParams.deptId,
|
|
|
levelIds:[],
|
|
|
}
|
|
|
+ if (this.inputType == 1){
|
|
|
+ obj.subName = this.queryParams.searchValue;
|
|
|
+ } else if(this.inputType == 2){
|
|
|
+ obj.roomNum = this.queryParams.searchValue;
|
|
|
+ }
|
|
|
for(let i=0;i<self.checkLeveList.length;i++){
|
|
|
if(self.checkLeveList[i].type){
|
|
|
obj.levelIds.push(self.checkLeveList[i].levelId)
|
|
|
}
|
|
|
}
|
|
|
obj.floorId = node.data.treeId;
|
|
|
- laboratoryLabDeptTreeGetRoomList(obj).then(response => {
|
|
|
+ laboratoryLabDeptTreeLargeRooms(obj).then(response => {
|
|
|
for(let i=0;i<response.data.length;i++){
|
|
|
+ response.data[i].deptName = response.data[i].formatRoomName;
|
|
|
response.data[i].leaf = true;
|
|
|
}
|
|
|
resolve(response.data[0]?response.data:[]);
|
|
@@ -228,7 +280,7 @@
|
|
|
}else{
|
|
|
if(node.data.childTreeList){
|
|
|
if(node.data.childTreeList[0]){
|
|
|
- if(node.data.level != 4){
|
|
|
+ if(node.data.level != 2){
|
|
|
node.data.childTreeList.forEach((item)=>{
|
|
|
if(item.childTreeList){
|
|
|
if(!item.childTreeList[0]){
|
|
@@ -250,6 +302,48 @@
|
|
|
}
|
|
|
|
|
|
},
|
|
|
+ //实验室ID查询
|
|
|
+ getSubId(e){
|
|
|
+ let self = this;
|
|
|
+ let obj = {
|
|
|
+ deptId:this.queryParams.deptId,
|
|
|
+ levelIds:[],
|
|
|
+ }
|
|
|
+ if (this.inputType == 1){
|
|
|
+ obj.subName = this.queryParams.searchValue;
|
|
|
+ } else if(this.inputType == 2){
|
|
|
+ obj.roomNum = this.queryParams.searchValue;
|
|
|
+ }
|
|
|
+ for(let i=0;i<self.checkLeveList.length;i++){
|
|
|
+ if(self.checkLeveList[i].type){
|
|
|
+ obj.levelIds.push(self.checkLeveList[i].levelId)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!e.level){
|
|
|
+ //实验室
|
|
|
+ this.$parent.setVideoData([e.treeId]);
|
|
|
+ }else if(e.level == 2){
|
|
|
+ //楼栋
|
|
|
+ obj.buildingId = e.treeId;
|
|
|
+ laboratoryLabDeptTreeLargeRooms(obj).then(response => {
|
|
|
+ let list = [];
|
|
|
+ for(let i=0;i<response.data.length;i++){
|
|
|
+ list.push(response.data[i].treeId)
|
|
|
+ }
|
|
|
+ this.$parent.setVideoData(list);
|
|
|
+ })
|
|
|
+ }else if(e.level == 3){
|
|
|
+ //楼层
|
|
|
+ obj.floorId = e.treeId;
|
|
|
+ laboratoryLabDeptTreeLargeRooms(obj).then(response => {
|
|
|
+ let list = [];
|
|
|
+ for(let i=0;i<response.data.length;i++){
|
|
|
+ list.push(response.data[i].treeId)
|
|
|
+ }
|
|
|
+ this.$parent.setVideoData(list);
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
//选中位置联查
|
|
|
checkAddress(id){
|
|
|
let list = this.forAddress(this.$refs.tree._data.root.childNodes,id);
|
|
@@ -291,6 +385,12 @@
|
|
|
this.$parent.setUserNum(response.data)
|
|
|
});
|
|
|
},
|
|
|
+ //查询学院列表
|
|
|
+ getDeptDropList(){
|
|
|
+ getDeptDropList({deptName:"",level:2,deptType:1}).then(response => {
|
|
|
+ this.$set(this, 'deptList', response.data)
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
@@ -318,6 +418,30 @@
|
|
|
font-size: 34px;
|
|
|
font-family: SOURCEHANSANSCN;
|
|
|
}
|
|
|
+ .input-select{
|
|
|
+ margin-top:20px;
|
|
|
+ ::v-deep .el-input--medium .el-input__inner{
|
|
|
+ border: none;
|
|
|
+ }
|
|
|
+ ::v-deep .el-input-group__prepend .el-input{
|
|
|
+ border-right:1px solid #0591F3;
|
|
|
+ }
|
|
|
+ ::v-deep .el-form-item__content .el-input-group{
|
|
|
+ border:1px solid #0591F3;
|
|
|
+ border-radius: 10px;
|
|
|
+ }
|
|
|
+ ::v-deep .el-input-group__prepend{
|
|
|
+ border: none;
|
|
|
+ background-color: rgba(0,0,0,0);
|
|
|
+ }
|
|
|
+ ::v-deep .el-input--medium .el-input__inner{
|
|
|
+ font-size: 34px;
|
|
|
+ line-height: 68px;
|
|
|
+ width:220px;
|
|
|
+ color:#fff;
|
|
|
+ font-family: SOURCEHANSANSCN;
|
|
|
+ }
|
|
|
+ }
|
|
|
::v-deep .el-form-item__content{
|
|
|
height:70px;
|
|
|
}
|
|
@@ -327,7 +451,7 @@
|
|
|
color: #fff;
|
|
|
height:70px;
|
|
|
background-color:rgba(0,0,0,0)!important;
|
|
|
- border:1px solid #0591F3!important;
|
|
|
+ border:1px solid #0591F3;
|
|
|
border-radius:10px;
|
|
|
}
|
|
|
.form-reset-common-style-button{
|