|
@@ -2,26 +2,46 @@
|
|
|
<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="实验室"
|
|
|
- clearable
|
|
|
- style="width:178px;"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <p class="form-inquire-common-style-button" @click="handleQuery">查询</p>
|
|
|
- <p class="form-reset-common-style-button" @click="resetQuery">重置</p>
|
|
|
- </el-form>
|
|
|
- <div class="for-level-max-box">
|
|
|
- <div class="for-level-box"
|
|
|
- @click="checkLevelButton(item,index)"
|
|
|
- v-for="(item,index) in levelList" :key="index">
|
|
|
- {{item.titleName}}
|
|
|
- <p class="checkLevel" v-if="checkLeveList[index].type"><span class="el-icon-check"></span></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: 217px">
|
|
|
+ <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:60px;" @click="handleQuery">查询</p>
|
|
|
+ <p class="form-reset-common-style-button" style="width:60px;" @click="resetQuery">重置</p>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ <div style="margin-top:20px;">
|
|
|
+ <el-form-item label="" prop="searchValue">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.searchValue"
|
|
|
+ placeholder="请输入"
|
|
|
+ style="width:370px;"
|
|
|
+ >
|
|
|
+ <el-select v-model="inputType" class="input-select" 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>
|
|
|
+ <div class="for-level-max-box">
|
|
|
+ <div class="for-level-box"
|
|
|
+ @click="checkLevelButton(item,index)"
|
|
|
+ v-for="(item,index) in levelList" :key="index">
|
|
|
+ {{item.titleName}}
|
|
|
+ <p class="checkLevel" v-if="checkLeveList[index].type"><span class="el-icon-check"></span></p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
<div class="tree-max-box">
|
|
|
<el-tree
|
|
|
class="tree-line"
|
|
@@ -46,7 +66,7 @@
|
|
|
overflow:hidden;
|
|
|
text-overflow:ellipsis;
|
|
|
white-space:nowrap;"
|
|
|
- :style="!data.level?'font-size:20px':(data.level==1?'font-size:26px':(data.level==2||data.level==3||data.level==4?'font-size:24px':(data.level==5?'font-size:20px':'')))">{{data.deptName}}</span>
|
|
|
+ :style="!data.level?'font-size:20px':(data.level==1?'font-size:26px':(data.level==2?'font-size:24px':(data.level==3?'font-size:20px':'')))">{{data.deptName}}</span>
|
|
|
</template>
|
|
|
</el-tree>
|
|
|
</div>
|
|
@@ -56,9 +76,10 @@
|
|
|
<script>
|
|
|
import {
|
|
|
laboratoryLevelConfigGetLevelTitleList,
|
|
|
- laboratoryLabDeptTreeGetTreeList,
|
|
|
- laboratoryLabDeptTreeGetRoomList,
|
|
|
+ laboratoryLabDeptTreeLargeTree,
|
|
|
+ laboratoryLabDeptTreeLargeRooms,
|
|
|
laboratorySubPassOutGetCountByBuildId,
|
|
|
+ getDeptDropList,
|
|
|
} from "@/api/index";
|
|
|
export default {
|
|
|
name: 'deptListComponent',
|
|
@@ -72,9 +93,11 @@
|
|
|
buildName:null,
|
|
|
floorId:null,
|
|
|
floorName:null,
|
|
|
+ deptList:[],
|
|
|
//新树
|
|
|
deptOptions: null,
|
|
|
defaultKey:null,
|
|
|
+ inputType:'1',
|
|
|
defaultProps: {
|
|
|
children: "childTreeList",
|
|
|
label: "deptName",
|
|
@@ -84,6 +107,7 @@
|
|
|
treeId:null,
|
|
|
queryParams: {
|
|
|
searchValue: '',
|
|
|
+ deptId:'',
|
|
|
},
|
|
|
levelList:[],
|
|
|
checkLeveList:[],
|
|
@@ -93,24 +117,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 +158,35 @@
|
|
|
});
|
|
|
},
|
|
|
//新树
|
|
|
- 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);
|
|
|
this.$nextTick(()=>{
|
|
|
- let checkData = list[0].childTreeList[0].childTreeList[0].childTreeList[0];
|
|
|
+ let checkData = list[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]);
|
|
|
+ this.$set(this,'defaultKey',[list[0].treeId,list[0].childTreeList[0].treeId]);
|
|
|
setTimeout(function(){
|
|
|
//选中列表
|
|
|
self.$refs.tree.setCurrentKey(checkData.treeId);
|
|
@@ -162,60 +198,37 @@
|
|
|
//父级视屏数据
|
|
|
self.$parent.setVideoData(checkData);
|
|
|
},200);
|
|
|
- // let minObj = JSON.parse(JSON.stringify(obj))
|
|
|
- // minObj.floorId = list[0].childTreeList[0].childTreeList[0].childTreeList[0].treeId;
|
|
|
- // laboratoryLabDeptTreeGetRoomList(minObj).then(minResponse => {
|
|
|
- // for(let i=0;i<minResponse.data.length;i++){
|
|
|
- // minResponse.data[i].leaf = true;
|
|
|
- // }
|
|
|
- // list[0].childTreeList[0].childTreeList[0].childTreeList[0].childTreeList[0].childTreeList = minResponse.data[0]?minResponse.data:[];
|
|
|
- // //选中逻辑
|
|
|
- // 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,list[0].childTreeList[0].childTreeList[0].childTreeList[0].childTreeList[0].treeId]
|
|
|
- // this.$nextTick(()=>{
|
|
|
- // this.$refs.tree.setCurrentKey(list[0].childTreeList[0].childTreeList[0].childTreeList[0].childTreeList[0].treeId);
|
|
|
- // this.$nextTick(()=>{
|
|
|
- // setTimeout(function(){
|
|
|
- // self.$refs.tree.setCurrentKey(list[0].childTreeList[0].childTreeList[0].childTreeList[0].childTreeList[0].childTreeList[0].treeId);
|
|
|
- // self.$set(self,'treeId',list[0].childTreeList[0].childTreeList[0].childTreeList[0].childTreeList[0].childTreeList[0].treeId);
|
|
|
- // },200);
|
|
|
- // })
|
|
|
- // })
|
|
|
- // this.$set(this,'deptOptions',list)
|
|
|
- // })
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- //空数据处理
|
|
|
- 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);
|
|
@@ -228,19 +241,25 @@
|
|
|
loadNode(node, resolve) {
|
|
|
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:[]);
|
|
@@ -248,7 +267,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]){
|
|
@@ -311,6 +330,12 @@
|
|
|
this.$parent.setUserNum(response.data)
|
|
|
});
|
|
|
},
|
|
|
+ //查询学院列表
|
|
|
+ getDeptDropList(){
|
|
|
+ getDeptDropList({deptName:"",level:2,deptType:1}).then(response => {
|
|
|
+ this.$set(this, 'deptList', response.data)
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
@@ -335,11 +360,23 @@
|
|
|
line-height: 38px;
|
|
|
font-size: 16px;
|
|
|
}
|
|
|
+ .input-select{
|
|
|
+ ::v-deep .el-input--medium .el-input__inner{
|
|
|
+ background: #013138;
|
|
|
+ font-size: 18px;
|
|
|
+ line-height: 20px;
|
|
|
+ width:140px;
|
|
|
+ color:#fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
::v-deep .el-form-item__content{
|
|
|
height:40px;
|
|
|
}
|
|
|
::v-deep .el-input--medium .el-input__inner{
|
|
|
height:40px;
|
|
|
+ border:1px solid #04BECB;
|
|
|
+ font-size:18px;
|
|
|
+ line-height: 20px;
|
|
|
}
|
|
|
.form-reset-common-style-button{
|
|
|
width:80px;
|
|
@@ -365,7 +402,7 @@
|
|
|
}
|
|
|
.for-level-max-box{
|
|
|
display: flex;
|
|
|
- padding-left:29px;
|
|
|
+ margin-top:20px;
|
|
|
.for-level-box{
|
|
|
cursor: pointer;
|
|
|
color:#fff;
|