footerBi.vue
3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<template>
<a-row class="foot-view">
<a-col :span="12" class="select-view">
<a-space :size="1">
<img src="@/assets/bi/logo.png" alt="">
<a-tree-select v-model="companyValue"
:allow-clear="false"
:data="companyList"
:style="{width:'300px',height:'100%'}"
:fieldNames="{ key: 'id', title: 'deptName', children: 'children' }"
:filter-tree-node="filterTreeNode" allow-search placeholder="请选择站点"
@change="companyChange">
<template #arrow-icon>
<icon-caret-down size="18" style="color: white"/>
</template>
</a-tree-select>
<div class="full-btn" @click="toggleFullscreen">
<img v-if="isFullscreen" src="@/assets/bi/icon-shrink.png" alt="">
<icon-expand v-else/>
<text>{{ isFullscreen ? '退出全屏' : '全屏' }}</text>
</div>
</a-space>
</a-col>
<a-col :span="12">
<div class="version-view">YunPower EMS Ver 1.0.0</div>
</a-col>
</a-row>
</template>
<script setup lang="ts">
import {useFullscreen} from '@/utils/bi/useFullscreen';
import {useCompanyStore} from "@/store";
import {onMounted, ref} from "vue";
import {findById} from "@/utils/ruoyi";
import {useRoute, useRouter} from "vue-router";
const emit = defineEmits(['select'])
const {isFullscreen, toggleFullscreen} = useFullscreen();
const companyStore = useCompanyStore();
const {companyList} = companyStore; // 选择的机构, 机构列表
const companyValue = ref<string | number>('');
const route = useRoute();
const router = useRouter();
/**
* 站点搜索
* @param searchValue
* @param nodeData
*/
const filterTreeNode = (searchValue: any, nodeData: any) => {
return nodeData.deptName.toLowerCase().indexOf(searchValue.toLowerCase()) > -1;
}
const convertToQueryString = (params: Record<string, string | number>) => {
return Object.entries(params)
.map(([key, value]) => {
// 只对键进行转义,而值中的斜杠不转义
const escapedKey = encodeURIComponent(key);
const escapedValue = value.toString().replace(/%2F/g, '/');
return `${escapedKey}=${escapedValue}`;
})
.join('&');
};
// 机构下拉框change
const companyChange = (val: any) => {
// const findData = findById(companyList, val);
window.location.href = window.location.href.replace(/(stationId=)\d+/, `$1${val}`)
}
onMounted(() => {
const { stationId } = route.query;
if (stationId) {
companyValue.value = Number(stationId);
}
})
</script>
<style scoped lang="less">
@font-size: 14px;
@font-size-mini: 12px;
@font-size-medium: 16px;
@font-size-large: 22px;
@font-size-title: 18px;
@color-w: white;
@font-family: Source Han Sans;
.foot-view {
text-align: center;
align-items: center;
height: 100%;
.select-view {
text-align: start;
padding-left: 32px;
img {
width: 30px;
height: 30px;
}
.full-btn {
display: flex;
align-items: center;
font-size: @font-size-medium;
margin-left: 26px;
text {
margin-left: 5px;
font-size: @font-size;
}
img {
width: 14px;
height: 14px;
margin-right: 4px;
}
}
}
.version-view {
font-size: 15px;
text-align: end;
padding-right: 32px;
}
}
::v-deep(.arco-select-view) {
background-color: transparent;
border-radius: 0;
border: none;
color: #FFFFFF !important;
.arco-select-view-value {
font-size: 15px;
}
}
</style>