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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<template>
<el-card class="card-contianer">
<label>{{radioTitle}}:</label>
<el-radio-group v-model="activeRadio" style="margin-left: 50px;">
<el-radio
v-for="(option, index) in options"
:key="index"
:label="option.value"
>
{{ option.lable }}
</el-radio>
</el-radio-group>
</el-card>
<el-tabs :tab-position="tabPosition" style="height: 100%" class="demo-tabs">
<el-tab-pane label="换热站状态" v-if="isTransferStatus">
<TransferStatusControl :activeRadio="activeRadio"/>
</el-tab-pane>
<el-tab-pane label="远程寄存器" v-if="isTransferRegControl">
<TransferRegControl :activeRadio="activeRadio"/>
</el-tab-pane>
<el-tab-pane label="节假日参数组" v-if="isHolidayControl">
<HolidayControl :activeRadio="activeRadio"/>
</el-tab-pane>
<el-tab-pane label="夜间参数组" v-if="isNightControl">
<NightControl :activeRadio="activeRadio"/>
</el-tab-pane>
<el-tab-pane label="二次网供水温度" v-if="isSecTempControl">
<SecTempControl :activeRadio="activeRadio"/>
</el-tab-pane>
<el-tab-pane label="曲线对应" v-if="isCurveControl">
<CurveControl :activeRadio="activeRadio"/>
</el-tab-pane>
<el-tab-pane label="气象仪" v-if="isWeatherControl">
<WeatherControl :activeRadio="activeRadio"/>
</el-tab-pane>
<el-tab-pane label="温度上下限" v-if="isLimitControl">
<LimitControl :activeRadio="activeRadio"/>
</el-tab-pane>
<el-tab-pane label="风向控制" v-if="isWinDirectionControl">
<WinDirectionControl :activeRadio="activeRadio"/>
</el-tab-pane>
<el-tab-pane label="热量" v-if="isHeatControl">
<HeatControl :activeRadio="activeRadio"/>
</el-tab-pane>
<el-tab-pane label="循环泵夜间降频" v-if="isNightFrequency">
<NightFrequency :activeRadio="activeRadio"/>
</el-tab-pane>
</el-tabs>
<!-- <el-tabs v-model="activeTab" @tab-click="handleClick" :tab-position="tabPosition" style="height: 100%" class="demo-tabs">
<el-tab-pane
v-for="item in editableTabs"
:key="item.name"
:label="item.title"
:name="item.name"
></el-tab-pane> -->
<!-- <el-tab-pane name="TransferStatusControl" label="换热站状态" v-if="isTransferStatus"></el-tab-pane>
<el-tab-pane name="TransferRegControl" label="远程寄存器" v-if="isTransferRegControl"></el-tab-pane> -->
<!-- </el-tabs> -->
<!-- <router-view /> -->
</template>
<script lang="ts" setup>
import { ref, reactive, onMounted, onUnmounted, watch } from 'vue';
import http from '../../api/http';
import store from "../../store/index";
// import { useRoute, useRouter } from 'vue-router';
import TransferStatusControl from '../../components/Remote/TransferStatusControl.vue';
import TransferRegControl from '../../components/Remote/TransferRegControl.vue';
import HolidayControl from '../../components/Remote/HolidayControl.vue';
import NightControl from '../../components/Remote/NightControl.vue';
import SecTempControl from '../../components/Remote/SecTempControl.vue';
import CurveControl from '../../components/Remote/CurveControl.vue';
import WinDirectionControl from '../../components/Remote/WinDirectionControl.vue';
import WeatherControl from '../../components/Remote/WeatherControl.vue';
import LimitControl from '../../components/Remote/LimitControl.vue';
import HeatControl from '../../components/Remote/HeatControl.vue';
//import OutdoorTempControl from '../../components/Remote/OutdoorTempControl.vue';
import NightFrequency from '../../components/Remote/NightFrequency.vue';
const radioTitle = ref('供热站');
const options = reactive([]);
const enterpriseId = ref(null);
const tabPosition = ref('left');
const activeRadio = ref(null);
const isTransferStatus = ref(false);
const isTransferRegControl = ref(false);
const isHolidayControl = ref(false);
const isNightControl = ref(false);
const isSecTempControl = ref(false);
const isCurveControl = ref(false);
const isWeatherControl = ref(false);
const isLimitControl = ref(false);
const isWinDirectionControl = ref(false);
const isHeatControl = ref(false);
const isNightFrequency = ref(false);
//初始化页面
function initPage(){
initRadioList();
initRomateList();
}
//根据权限初始化单选列表
function initRadioList(){
var result = store.getters.getEnterprise();
if (result) {
enterpriseId.value = result[0].enterpriseId;
result.forEach(element=>{
if(element.enterpriseId=== enterpriseId.value){
if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){
radioTitle.value = "片区";
element.serviceCenterList.forEach(center=>{
center.supplyList.forEach(supply => {
supply.jurisdictionList.forEach(jurisdiction => {
options.push({value: jurisdiction.jurisdictionId, lable: jurisdiction.jurisdictionName});
});
});
})
}else{
radioTitle.value = "供热站";
element.supplyList.forEach(element => {
options.push({ value: element.supplyId, lable: element.supplyName});
})
}
}
});
activeRadio.value = options[0].value;
console.log("activeRadio.value:"+activeRadio.value);
}
}
//根据权限初始化远程控制页列表
function initRomateList(){
http.post("/api/module/RemoteModules", '').then((result) => {
if(result.data !== null){
//console.log(result.data);
result.data.forEach(item =>{
if(item.moduleCode ==="RemoteTransferStatus"){
isTransferStatus.value = true;
}
if(item.moduleCode ==="RemoteTransferReg"){
isTransferRegControl.value = true;
}
if(item.moduleCode ==="HolidayControl"){
isHolidayControl.value = true;
}
if(item.moduleCode ==="NightControl"){
isNightControl.value = true;
}
if(item.moduleCode ==="SecTempControl"){
isSecTempControl.value = true;
}
if(item.moduleCode ==="CurveControl"){
isCurveControl.value = true;
}
if(item.moduleCode ==="WeatherControl"){
isWeatherControl.value = true;
}
if(item.moduleCode ==="LimitControl"){
isLimitControl.value = true;
}
if(item.moduleCode ==="WinDirectionControl"){
isWinDirectionControl.value = true;
}
if(item.moduleCode ==="HeatControl"){
isHeatControl.value = true;
}
if(item.moduleCode ==="NightFrequency"){
isNightFrequency.value = true;
}
})
}
});
}
initPage();
// 当选中项变化时,这里会打印新的值
watch(activeRadio, (newValue) => {
// console.log('Selected value changed:', newValue);
});
</script>
<style lang="less" scoped>
.card-contianer {
display: flex;
width: 100%;
height: 50px;
align-items: center;
vertical-align: middle;
margin: 0;
padding: 0;
}
.demo-tabs > .el-tabs__content {
padding: 32px;
color: #6b778c;
font-size: 32px;
font-weight: 600;
}
.el-tabs--right .el-tabs__content,
.el-tabs--left .el-tabs__content {
height: 100%;
}
</style>