2024-03-21 19:30:54 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="header-btn">
|
|
|
|
|
<el-popover
|
|
|
|
|
placement="bottom"
|
|
|
|
|
trigger="click"
|
|
|
|
|
width="450"
|
|
|
|
|
class="popover"
|
|
|
|
|
v-model="visible"
|
|
|
|
|
>
|
|
|
|
|
<div class="changeBox">
|
|
|
|
|
<div class="title-content">
|
2024-03-30 11:51:22 +08:00
|
|
|
<span>{{isUserList?'切换用户':'用户组织'}}</span>
|
|
|
|
|
<i class="el-icon-arrow-left" style="cursor: pointer;" @click="isUserList = true;"></i>
|
|
|
|
|
<i class="el-icon-arrow-right" style="cursor: pointer;" @click="isUserList = false;"></i>
|
2024-03-21 19:30:54 +08:00
|
|
|
</div>
|
2024-03-30 11:51:22 +08:00
|
|
|
<div class="content-list" v-if="isUserList">
|
2024-03-21 19:30:54 +08:00
|
|
|
<div class="content-list-item">
|
|
|
|
|
<i class="el-icon-trophy-1"></i>
|
|
|
|
|
<span>中国建筑第八工程局第三建设有限公司</span>
|
|
|
|
|
<i class="el-icon-arrow-right"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="content-list-item">
|
|
|
|
|
<i class="el-icon-trophy-1"></i>
|
|
|
|
|
<span>中国建筑第八工程局第三建设有限公司</span>
|
|
|
|
|
<i class="el-icon-arrow-right"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="content-list-item">
|
|
|
|
|
<i class="el-icon-trophy-1"></i>
|
|
|
|
|
<span>中国建筑第八工程局第三建设有限公司</span>
|
|
|
|
|
<i class="el-icon-arrow-right"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="content-list-item">
|
|
|
|
|
<i class="el-icon-trophy-1"></i>
|
|
|
|
|
<span>中国建筑第八工程局第三建设有限公司</span>
|
|
|
|
|
<i class="el-icon-arrow-right"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="content-list-item">
|
|
|
|
|
<i class="el-icon-trophy-1"></i>
|
|
|
|
|
<span>中国建筑第八工程局第三建设有限公司</span>
|
|
|
|
|
<i class="el-icon-arrow-right"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="content-list-item">
|
|
|
|
|
<i class="el-icon-trophy-1"></i>
|
|
|
|
|
<span>中国建筑第八工程局第三建设有限公司</span>
|
|
|
|
|
<i class="el-icon-arrow-right"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="content-list-item">
|
|
|
|
|
<i class="el-icon-trophy-1"></i>
|
|
|
|
|
<span>中国建筑第八工程局第三建设有限公司</span>
|
|
|
|
|
<span>个人租户</span>
|
|
|
|
|
<i class="el-icon-arrow-right"></i>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-03-30 11:51:22 +08:00
|
|
|
<div class="tree-group" v-else>
|
|
|
|
|
<div class="select-list">
|
|
|
|
|
<el-input
|
|
|
|
|
placeholder="输入关键字进行查找"
|
|
|
|
|
v-model="filterText"
|
|
|
|
|
style="width: 98%;"
|
|
|
|
|
suffix-icon="el-icon-search"
|
|
|
|
|
size="medium"
|
|
|
|
|
>
|
|
|
|
|
</el-input>
|
|
|
|
|
<el-tree
|
|
|
|
|
:data="level1CompanyData"
|
|
|
|
|
:props="selectTreeProps"
|
|
|
|
|
node-key="id"
|
|
|
|
|
ref="tree"
|
|
|
|
|
:filter-node-method="filterNode"
|
|
|
|
|
:highlight-current="true"
|
|
|
|
|
:check-on-click-node="true"
|
|
|
|
|
@node-click="treeClick"
|
|
|
|
|
style="margin:10px 5px;"
|
|
|
|
|
></el-tree>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-03-21 19:30:54 +08:00
|
|
|
</div>
|
|
|
|
|
<!-- 点击内容 -->
|
|
|
|
|
<div slot="reference" class="click-content">
|
|
|
|
|
<i class="el-icon-trophy-1"></i>
|
|
|
|
|
<span>18772114025</span>
|
|
|
|
|
<i class="el-icon-arrow-down"></i>
|
|
|
|
|
</div>
|
|
|
|
|
</el-popover>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
2024-03-30 11:51:22 +08:00
|
|
|
import { getComapnyStatisticsListApi } from "@/assets/js/api/company/project";
|
2024-03-21 19:30:54 +08:00
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2024-03-30 11:51:22 +08:00
|
|
|
visible: false,
|
|
|
|
|
isUserList: true,
|
|
|
|
|
filterText: "",
|
|
|
|
|
level1CompanyData: [],
|
|
|
|
|
selectTreeProps: {
|
|
|
|
|
children: "children",
|
|
|
|
|
label: "label",
|
|
|
|
|
},
|
2024-03-21 19:30:54 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
2024-03-30 11:51:22 +08:00
|
|
|
this.loadData();
|
2024-03-21 19:30:54 +08:00
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
2024-03-30 11:51:22 +08:00
|
|
|
// 树形控件点击
|
|
|
|
|
treeClick(data) {
|
|
|
|
|
console.log(data);
|
|
|
|
|
},
|
|
|
|
|
filterNode(value, data) {
|
|
|
|
|
if (!value) return true;
|
|
|
|
|
return data.name.indexOf(value) !== -1;
|
|
|
|
|
},
|
|
|
|
|
loadData() {
|
|
|
|
|
let sn = this.$store.state.userInfo.sn;
|
|
|
|
|
let projectType = 1; // 展示项目列表
|
|
|
|
|
if (this.$store.state.userInfo.addProjectType == 1) {
|
|
|
|
|
projectType = 0; // 不展示项目列表
|
|
|
|
|
}
|
|
|
|
|
getComapnyStatisticsListApi({
|
|
|
|
|
sn: sn,
|
|
|
|
|
projectType: projectType,
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
this.level1CompanyData = res.result.companyList
|
|
|
|
|
? res.result.companyList
|
|
|
|
|
: res.result.projectList;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
filterText(val) {
|
|
|
|
|
this.$refs.tree.filter(val);
|
|
|
|
|
},
|
|
|
|
|
},
|
2024-03-21 19:30:54 +08:00
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
.flexStyle(){
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
.changeBox {
|
|
|
|
|
padding: 0px 10px;
|
|
|
|
|
.title-content{
|
|
|
|
|
.flexStyle();
|
|
|
|
|
>span{
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-family: PingFang SC, PingFang SC;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: #000000;
|
|
|
|
|
margin-right: auto;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.content-list{
|
|
|
|
|
margin-top: 15px;
|
|
|
|
|
&-item{
|
|
|
|
|
.flexStyle();
|
|
|
|
|
padding: 10px 15px;
|
|
|
|
|
border: 1px solid #DADBDB;
|
|
|
|
|
border-radius: 5px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
>span:nth-child(2){
|
|
|
|
|
margin: 2px 10px 0px 10px;
|
|
|
|
|
}
|
|
|
|
|
>span:nth-child(3){
|
|
|
|
|
padding:3px 10px;
|
|
|
|
|
color: #79ACFA;
|
|
|
|
|
background-color: #E4F5FF;
|
|
|
|
|
border: 1px solid #99C3FB;
|
|
|
|
|
border-radius: 5px;
|
|
|
|
|
font-size: 10px;
|
|
|
|
|
}
|
|
|
|
|
/deep/.el-icon-arrow-right{
|
|
|
|
|
margin-left: auto;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
&-item:not(:last-child){
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-03-30 11:51:22 +08:00
|
|
|
.tree-group{
|
|
|
|
|
margin-top: 15px;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
.select-list {
|
|
|
|
|
&-item {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-03-21 19:30:54 +08:00
|
|
|
}
|
|
|
|
|
.click-content{
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
.flexStyle();
|
|
|
|
|
>span{
|
|
|
|
|
margin: 0px 10px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<style>
|
|
|
|
|
.el-popover {
|
|
|
|
|
box-sizing: content-box !important;
|
|
|
|
|
}
|
|
|
|
|
</style>
|