|
|
@@ -25,11 +25,12 @@
|
|
|
:label="treeValue.label"
|
|
|
style="max-width: 1.354167rem /* 260/192 */; height: auto; padding: 0"
|
|
|
>
|
|
|
+ <!-- style="max-width: 1.354167rem /* 260/192 */; height: auto; padding: 0" -->
|
|
|
<el-tree
|
|
|
:data="treeDatas"
|
|
|
:props="defaultProps"
|
|
|
:expand-on-click-node="false"
|
|
|
- default-expand-all=""
|
|
|
+ default-expand-all
|
|
|
node-key="name"
|
|
|
highlight-current
|
|
|
@node-click="nodeClick"
|
|
|
@@ -56,7 +57,7 @@
|
|
|
</div>
|
|
|
<div class="otherItem">
|
|
|
<div class="specificTime">{{ specificTime }}</div>
|
|
|
- <div class="entrySys" v-if="treeValue.pid === 2" @click="enterSys()">{{ operationName }}</div>
|
|
|
+ <div class="entrySys" v-if="!isShowGroupPage" @click="enterSys()">{{ operationName }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="underline"></div>
|
|
|
@@ -70,6 +71,7 @@ import { appconfig } from '@/config/bigScreenConfig'
|
|
|
import { getUserMenu } from '@/api/user'
|
|
|
import { setParams } from 'staticPub/config'
|
|
|
import { fetchProjects, setProjectKey } from '@/api/common'
|
|
|
+import { findByCode } from '../apis'
|
|
|
import { setSessionStorage } from '@/utils/auth'
|
|
|
export default {
|
|
|
name: 'bigScreenHeader', //大屏头部菜单栏
|
|
|
@@ -83,7 +85,7 @@ export default {
|
|
|
specificTime: null, //系统当前时间
|
|
|
operationName: null,
|
|
|
//
|
|
|
- treeSelectText: '三峡发展',
|
|
|
+ treeSelectText: '',
|
|
|
treeValue: {},
|
|
|
defaultProps: {
|
|
|
children: 'children',
|
|
|
@@ -106,6 +108,9 @@ export default {
|
|
|
},
|
|
|
currentProjectInfo() {
|
|
|
return this.$store.state.bigScreen.currentProjectInfo
|
|
|
+ },
|
|
|
+ isShowGroupPage() {
|
|
|
+ return this.$store.state.bigScreen.isShowGroupPage
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
@@ -142,22 +147,33 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
//项目切换
|
|
|
- switchingItems(val) {
|
|
|
- console.log('项目切换')
|
|
|
- const { label, value, pid, id, data } = val
|
|
|
- const { geo_info } = data
|
|
|
+ async switchingItems(val) {
|
|
|
+ console.log('项目切换', val)
|
|
|
+ const { label, value, pid } = val
|
|
|
this.treeSelectText = label
|
|
|
if (pid == 2) {
|
|
|
- this.getUserActiveModule()
|
|
|
- this.setCurrentPrj(data)
|
|
|
- appconfig.bigScreenMapSettings.initPosition = geo_info && JSON.parse(geo_info)
|
|
|
- this.$store.state.bigScreen.isShowGroupPage = false
|
|
|
- this.$store.state.bigScreen.currentProjectCode = value
|
|
|
+ const currentPrj = await this.setCurrentPrj(value)
|
|
|
+ if (!currentPrj) {
|
|
|
+ this.$message.info('暂未查询到此项目信息')
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ const { geo_info, id } = currentPrj
|
|
|
+ if (!geo_info) {
|
|
|
+ this.$message.info('暂无此项目GIS信息')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.getUserActiveModule()
|
|
|
+ appconfig.bigScreenMapSettings.initPosition = geo_info && JSON.parse(geo_info)
|
|
|
+ this.$store.state.bigScreen.currentProjectInfo = currentPrj //设置当前项目信息
|
|
|
+ this.$store.state.bigScreen.currentPrjId = id //设置项目id
|
|
|
+ this.$store.state.bigScreen.isShowGroupPage = false //切换显示为项目级大屏
|
|
|
+ this.$store.state.bigScreen.currentProjectCode = value //设置指标代码
|
|
|
+ }
|
|
|
} else {
|
|
|
this.menuList = []
|
|
|
this.$store.state.bigScreen.groupName = label
|
|
|
- this.$store.state.bigScreen.groupCodeValue = value
|
|
|
- this.$store.state.bigScreen.isShowGroupPage = true
|
|
|
+ this.$store.state.bigScreen.groupCodeValue = pid == 0 ? value : label //设置指标代码,总公司为0,分公司为指标名称
|
|
|
+ this.$store.state.bigScreen.isShowGroupPage = true //切换显示为公司级大屏
|
|
|
}
|
|
|
},
|
|
|
// 点击tree节点
|
|
|
@@ -275,12 +291,16 @@ export default {
|
|
|
this.specificTime = getnow()
|
|
|
}, 100)
|
|
|
},
|
|
|
- async setCurrentPrj(data) {
|
|
|
- const { id } = data || {}
|
|
|
- const { result } = await setProjectKey(id)
|
|
|
- if (result) {
|
|
|
- this.$store.state.bigScreen.currentProjectInfo = data
|
|
|
- this.$store.state.bigScreen.currentPrjId = id
|
|
|
+ async setCurrentPrj(code) {
|
|
|
+ const res = await findByCode({ prjCode: code })
|
|
|
+ const { result } = res || {}
|
|
|
+ if (res.code != 1 || result.length == 0) return false
|
|
|
+ else {
|
|
|
+ const { id } = result[0]
|
|
|
+ const isSetting = await setProjectKey(id)
|
|
|
+ if (isSetting.result) {
|
|
|
+ return result[0]
|
|
|
+ } else return false
|
|
|
}
|
|
|
},
|
|
|
async onProjectSelect() {
|