zhgdyunapp/pages/areaTree/areaTree.vue

221 lines
5.2 KiB
Vue
Raw Normal View History

2022-06-08 15:48:09 +08:00
<template>
<view class="areaTreePage">
<scroll-view scroll-y="true" class="pageContent">
<headers :showBack="pageType=='video'?false:true">
<view class="headerName">
{{headerName}}
2022-06-08 15:48:09 +08:00
</view>
</headers>
<view class="areaTreeBox">
<view class="uni-form-item">
<input class="uni-input" name="projectName" v-model="projectName" @input="searchFile"
placeholder="请输入项目名称" />
<button class="mini-btn" type="primary" size="mini" @click="loadData">搜索</button>
</view>
2025-11-13 13:49:42 +08:00
<template v-if="mapData.length > 0">
<tree-menu :pageType="pageType" :iconShow="true" v-for="(item,index) in mapData" :key="item.companyId" :item="item"
:expandedIndex="index" :treeIndex="treeIndex" @clickItem="clickTreeItem"></tree-menu>
</template>
2022-06-08 15:48:09 +08:00
</view>
</scroll-view>
2025-11-13 13:49:42 +08:00
<footers v-if="pageType=='video' || pageType=='backend'" :activeTab="pageType=='video' ? 'videoManage': 'menu'"></footers>
2022-06-08 15:48:09 +08:00
</view>
</template>
<script>
import footers from "../../components/footers/footers.vue"
import uniIcons from "@/components/uni-icons/uni-icons.vue"
2025-11-13 13:49:42 +08:00
import TreeMenu from '@/components/tree-node/areaIndex.vue'
2022-06-08 15:48:09 +08:00
import headers from "../../components/headers/headers.vue"
export default {
components: {
2025-11-13 13:49:42 +08:00
footers,
TreeMenu
},
2022-06-08 15:48:09 +08:00
data() {
return {
projectName: '',
searchsn: '',
userInfo: null,
mapData: [],
headerName: '集团',
2025-11-13 13:49:42 +08:00
pageType: 'video',
treeIndex: 1, // 树形层级index
2022-06-08 15:48:09 +08:00
};
},
onLoad(options) {
console.log(options.type)
if (options.type && options.type != undefined && options.type != 'undefined') {
this.pageType = options.type
2022-06-08 15:48:09 +08:00
}
// uni.setStorageSync('pageType',this.pageType)
},
mounted() {
this.userInfo = JSON.parse(uni.getStorageSync('userInfo'))
this.initData(true);
},
methods: {
2025-11-13 13:49:42 +08:00
clickTreeItem(item) {
this.viewVideoListFn(item)
},
searchFile(e) {
this.projectName = e.detail.value
},
viewVideoListFn(item) {
if (this.pageType == 'video') {
2022-06-08 15:48:09 +08:00
uni.navigateTo({
2025-09-25 09:21:56 +08:00
// url: '../videoManage/videoList?sn=' + item.projectSn
url: '../videoManage/videoGroup?sn=' + item.projectSn
2022-06-08 15:48:09 +08:00
})
} else if (this.pageType == 'markRoom') {
uni.setStorageSync('projectDetail', JSON.stringify({
projectSn: item.projectSn,
projectName: item.projectName
}))
2022-06-08 15:48:09 +08:00
uni.navigateTo({
url: '../projectEnd/markRoom/markRoom?sn=' + item.projectSn + '&projectName=' + item
.projectName
2022-06-08 15:48:09 +08:00
})
} else if (this.pageType == 'backend' && item.projectSn) {
uni.setStorageSync('projectDetail', JSON.stringify(item))
2023-03-20 18:43:57 +08:00
// if(this.userInfo.styleType==1){
uni.navigateTo({
url: '../projectEnd/projectIndex/projectIndex?sn=' + item.projectSn + '&projectName=' +
item.projectName
})
2023-03-20 18:43:57 +08:00
// }else{
// uni.redirectTo({
// url: '/pages/workstation/workstationIndex/workstationIndex?sn='+item.projectSn+'&projectName='+item.projectName
// })
// }
2022-06-08 15:48:09 +08:00
}
2022-06-08 15:48:09 +08:00
},
initData(type) {
var that = this
switch (that.userInfo.accountType) {
case 2:
this.searchsn = that.userInfo.headquartersSn
2022-06-08 15:48:09 +08:00
break;
case 3:
this.searchsn = that.userInfo.sn
2022-06-08 15:48:09 +08:00
break;
case 4:
this.searchsn = that.userInfo.sn
2022-06-08 15:48:09 +08:00
break;
case 5:
this.searchsn = that.userInfo.sn
2022-06-08 15:48:09 +08:00
break;
case 7:
this.searchsn = that.userInfo.sn
2022-06-08 15:48:09 +08:00
break;
}
2025-11-13 13:49:42 +08:00
this.loadData(type);
2022-06-08 15:48:09 +08:00
},
//获取所有企业下区域数据
loadData(type) {
//typetrue代表第一调用
var that = this
this.sendRequest({
url: "xmgl/company/getComapnyStatisticsList",
data: {
sn: that.searchsn,
2025-11-13 13:49:42 +08:00
projectName: that.projectName,
showVideoNum: 1,
standardType: that.pageType == 'markRoom' ? 1 : 0
},
2022-06-08 15:48:09 +08:00
method: "POST",
success(res) {
2025-11-13 13:49:42 +08:00
if (res.code == 200) {
that.mapData = res.result.companyList ? res.result.companyList : res.result.projectList
console.log(88488, that.mapData)
if (res.result.companyInfo) {
that.headerName = res.result.companyInfo.companyName
}
2022-06-08 15:48:09 +08:00
}
}
})
},
}
}
</script>
<style lang="scss" scoped>
.statusBox {
2022-06-08 15:48:09 +08:00
display: inline-flex;
align-items: center;
.icon-status {
2025-09-25 09:21:56 +08:00
margin-left: 16rpx;
2022-06-08 15:48:09 +08:00
}
}
.areaTreePage {
background-color: white;
height: 100%;
color: $uni-text-color;
}
// .areaTreeBox{
2025-09-25 09:21:56 +08:00
// padding: 0 20rpx;
// }
.areaInner {
border-bottom: 1px solid rgba(221, 221, 221, 0.67);
}
.areaTitle {
2025-09-25 09:21:56 +08:00
font-size: 30rpx;
border-bottom: 1px solid rgba(221, 221, 221, 0.67);
2025-09-25 09:21:56 +08:00
padding: 20rpx 30rpx;
}
.arrow {
float: right;
opacity: 0.7;
}
.areaTitle2 {
font-size: 14px;
2025-09-25 09:21:56 +08:00
padding: 20rpx 30rpx 20rpx 30px;
}
.projectTitle {
font-size: 14px;
2025-09-25 09:21:56 +08:00
padding: 20rpx 30rpx 20rpx 30px;
}
.projectTitle2 {
2025-09-25 09:21:56 +08:00
padding-left: 100rpx;
}
.projectBox {
background-color: rgba(221, 221, 221, 0.26);
}
.uni-input {
2025-09-25 09:21:56 +08:00
border-radius: 30rpx;
margin: 20rpx 20rpx;
background-color: #f2f2f2;
2025-09-25 09:21:56 +08:00
height: 60rpx;
line-height: 60rpx;
padding: 0 40rpx;
font-size: 28rpx;
width: 65%;
}
2025-11-13 13:49:42 +08:00
2025-09-25 09:21:56 +08:00
.uni-form-item {
position: relative;
}
2025-11-13 13:49:42 +08:00
.mini-btn {
position: absolute;
2025-09-25 09:21:56 +08:00
right: 30rpx;
top: 50%;
transform: translateY(-50%);
border-radius: 30rpx;
height: 60rpx;
line-height: 60rpx;
}
2025-11-13 13:49:42 +08:00
</style>