pc-master #65

Merged
xiaomeng merged 4 commits from pc-master into portal 2023-12-09 06:54:11 +00:00
5 changed files with 161 additions and 48 deletions

View File

@ -102,9 +102,13 @@
</div>
<div class="drag_box1" ref="drag_box1" v-show="limitUserId == 2">
<img class="drag_img" src="../../assets/img/map1.png" alt="" />
<img class="axis_init" :class="'axis_' + (index + 8)" src="../../assets/img/axis1.png" :style="'left:' + (48.5 + index * 4.1) + '%'" alt="" @click="handlerAxis_2" v-for="(i,index) in 10" :key="index + '_1'"/>
<img class="axis_init" :class="'axis_' + (index + 8)" src="../../assets/img/axis1.png"
:style="'left:' + (48.5 + index * 4.1) + '%'" alt="" @click="handlerAxis_2" v-for="(i, index) in 10"
:key="index + '_1'" />
<img class="axis_init1" :class="'axis_' + (index1 + 17)" src="../../assets/img/axis1.png" :style="'top:' + (22 + index1 * 0.105) + '%' + ';' + 'left:' + (5 + index1 * 3.3) + '%' + ';'" alt="" @click="handlerAxis_2" v-for="(i,index1) in 25" :key="index1 + '_2'"/>
<img class="axis_init1" :class="'axis_' + (index1 + 17)" src="../../assets/img/axis1.png"
:style="'top:' + (22 + index1 * 0.105) + '%' + ';' + 'left:' + (5 + index1 * 3.3) + '%' + ';'" alt=""
@click="handlerAxis_2" v-for="(i, index1) in 25" :key="index1 + '_2'" />
</div>
</div>
</div>
@ -138,12 +142,12 @@
<div>
<div class="swiper-container middle_disasterWarningAnalysis" :style="styleContainer">
<div class="swiper-wrapper">
<div :class="current == index
? 'swiper-slide swiper-slide2'
: 'swiper-slide swiper-slide1'
<div :class="(limitUserId == 1 ? current : current1) == index
? 'swiper-slide swiper-slide2'
: 'swiper-slide swiper-slide1'
" v-for="(item, index) in dataList" :key="index" :style="styleItem"
@click="getCurrent(index, item)">
{{ item.greenhouseName + "温室" }}
{{ item.greenhouseName + (limitUserId == 1 ? "温室" : '') }}
</div>
</div>
</div>
@ -158,7 +162,9 @@
</div>
<div class="device_content scroll">
<div class="content_item">
<!-- 丽水 -->
<div class="content_item" v-if="limitUserId == 1">
<div class="i_title" v-if="fanStatus.open != 0">
<img src="../../assets/img/i_title_img.png" alt="" />
<span>风机</span>
@ -224,6 +230,30 @@
</template>
</div>
</div>
<!-- 东北 -->
<div class="content_item" v-if="limitUserId == 2" style="margin-top: 0.05rem;">
<div v-for="(item,index) in fiveControlList" :key="index" style="margin-bottom: 0.15rem;">
<div class="i_title" v-if="item.controlState != 0">
<img src="../../assets/img/i_title_img.png" alt="" />
<span>{{ item.title }}</span>
<span class="line"></span>
<span>{{item.controlState == 1 ? "自动控制" : "手机控制"}}</span>
<span class="line"></span>
<i class="progress" v-if="Number(item.progress) == ''">{{ item.progress }}%</i>
<span>菜单</span>
</div>
<div class="i_title" v-else>
<img src="../../assets/img/i_title_img.png" alt="" />
<span>{{ item.title }}</span>
<span class="line"></span>
<span>无效</span>
<span class="line"></span>
<span>菜单</span>
</div>
</div>
</div>
</div>
</div>
</div>
@ -269,6 +299,7 @@ export default {
content_item_current: -1,
current: 5,
current1: 1,
dataList: [
// "", "", "", "", "", ""
@ -680,7 +711,51 @@ export default {
},
],
limitUserId:''
limitUserId: '',
//
fiveControlList: [{
title: '加温水泵',
controlState: 0,
num: '1000',
close_btn: false
},
{
title: '地热风机',
controlState: 0,
num: '1002',
close_btn: false
},
{
title: '上风口',
controlState: 0,
num: '1004',
close_btn: true,
progress_num: '1006',
progress: ''
},
{
title: '下风口',
controlState: 0,
num: '1007',
close_btn: true,
progress_num: '1009',
progress: ''
},
{
title: '卷被',
controlState: 0,
num: '1010',
close_btn: true
},
{
title: '除雪',
controlState: 0,
num: '1013',
close_btn: false
},
]
};
},
mounted() {
@ -700,7 +775,7 @@ export default {
},
methods: {
// id
dataInit(userid) {
dataInit(userid, limitUserId) {
this.api.Bigdata_getAllControl(userid).then((res) => {
// console.log('id', res);
this.dataList = res.data.data;
@ -722,11 +797,22 @@ export default {
// this.get_environmentData(el.deviceId)
// this.get_readControl_getState(el.deviceId)
});
this.get_weather_echart_data(2023042214250027);
this.get_thisWeekTemperature_echart_data(2023042214250027);
this.get_environmentData(2023042214250027);
this.get_readControl_getState(2023042214250027);
this.getWeatherData(2023042214250027);
if (limitUserId == 1) {
//
this.get_weather_echart_data(2023042214250027);
this.get_thisWeekTemperature_echart_data(2023042214250027);
this.get_environmentData(2023042214250027);
this.get_readControl_getState(2023042214250027);
this.getWeatherData(2023042214250027);
} else if (limitUserId == 2) {
//
this.get_weather_echart_data(2023112911050004);
this.get_thisWeekTemperature_echart_data(2023112911050004);
this.get_environmentData(2023112911050004);
this.get_readControl_getState(2023112911050004);
this.getWeatherData(2023112911050004);
}
}
});
},
@ -858,7 +944,6 @@ export default {
}, 100);
}
});
// console.log(this.get_sel_eqbyid_list);
});
},
@ -907,8 +992,16 @@ export default {
this.statusList.push(statusData);
}
// console.log(this.statusList);
//
this.fiveControlList.forEach(el => {
el.controlState = res.data.data[el.num];
if(el.progress_num){
el.progress = res.data.data[el.progress_num];
}
})
}
});
});0
},
//
@ -949,7 +1042,7 @@ export default {
// })
let userInfo = JSON.parse(localStorage.getItem("userInfo"));
this.dataInit(userInfo.userid);
//this.dataInit(userInfo.userid);
this.get_sel_eqbyid(userInfo.userid);
// id
@ -967,14 +1060,16 @@ export default {
},
// id
get_user_getjurisdiction(userId){
this.api.user_getjurisdiction(userId).then(res=>{
if(res.data.code == 200){
get_user_getjurisdiction(userId) {
this.api.user_getjurisdiction(userId).then(res => {
if (res.data.code == 200) {
this.limitUserId = res.data.data[0].id;
if(this.limitUserId == 1){
if (this.limitUserId == 1) {
this.drag_boxHandler();
}else if(this.limitUserId == 2){
this.dataInit(userId, this.limitUserId);
} else if (this.limitUserId == 2) {
this.drag_boxHandler1();
this.dataInit(userId, this.limitUserId);
}
}
})
@ -1048,8 +1143,10 @@ export default {
getCurrent(index, item) {
this.current = index;
this.current1 = index;
// console.log(item,'00000000000000');
this.get_readControl_getState(item.deviceId);
// this.get_readControl_getState(item.deviceId);
this.get_readControl_getState(2023112911050004);
},
drag_boxHandler() {
@ -1500,6 +1597,7 @@ export default {
width: 3.98rem;
height: 3.08rem;
overflow: hidden;
padding-top: 0.15rem;
.title_child {
width: 100%;
@ -1604,7 +1702,7 @@ export default {
transform: translate(-50%, -50%);
overflow: hidden;
.drag_box1{
.drag_box1 {
width: 100%;
height: 100%;
position: absolute;
@ -1626,7 +1724,7 @@ export default {
transparent 97%);
}
.axis_init{
.axis_init {
width: 0.4rem;
height: 0.5rem;
position: absolute;
@ -1634,13 +1732,14 @@ export default {
z-index: 99;
}
.axis_init1{
.axis_init1 {
width: 0.4rem;
height: 0.5rem;
position: absolute;
z-index: 99;
}
}
.drag_box {
width: 100%;
height: 100%;
@ -1985,7 +2084,17 @@ export default {
// margin-right: 0.47rem;
// }
>span:nth-child(6) {
.progress{
width: 18%;
font-size: 0.14rem;
font-style: normal;
font-family: MicrosoftYaHei;
font-weight: 400;
color: #7ae1ff;
margin-right: 0.47rem;
}
>span:nth-child(6),>span:nth-child(7) {
width: 0.66rem;
height: 0.3rem;
background: linear-gradient(-35deg,
@ -2119,5 +2228,4 @@ export default {
}
}
}
}
</style>
}</style>

View File

@ -50,13 +50,13 @@
<span></span>
</div>
<div class="input-main">
<div>展开的输出通道</div>
<div>打开的通道</div>
<input @blur="blurChange('21546', $event)" v-model="inputData['21546']" @input="change('21546', $event)"
type="text" value="60" placeholder="60" />
<span></span>
</div>
<div class="input-main">
<div>关闭的输出通道</div>
<div>关闭的通道</div>
<input @blur="blurChange('21547', $event)" v-model="inputData['21547']" @input="change('21547', $event)"
type="text" value="60" placeholder="60" />
<span></span>

View File

@ -228,24 +228,29 @@ export default {
getStatus(data) {
this.api.getControlGetState(data).then(res => {
if (res.data.code == 200) {
this.sunrise = this.convertToTimeMinutes(res.data.data['1021'])
this.sunset = this.convertToTimeMinutes(res.data.data['1022'])
this.sunrise = this.insertColonEveryTwoDigits(this.convertToTimeMinutes(res.data.data['1021']))
this.sunset = this.insertColonEveryTwoDigits(this.convertToTimeMinutes(res.data.data['1022']))
}
})
},
//16 16
convertToTimeMinutes(hexValue) {
// 16 16
const intValue = hexValue
// 16
let hexString = hexValue.toString(16);
//
const hours = (intValue >> 8) & 0xFF;
const minutes = intValue & 0xFF;
// 416
while (hexString.length < 4) {
hexString = '0' + hexString;
}
// :
const formattedTime = `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}`;
return hexString;
return formattedTime;
},
insertColonEveryTwoDigits(inputString) {
// 使
const chunks = inputString.match(/.{1,2}/g);
return chunks.join(':')
// 使join
},
dataInit() {
var store = this.$store.state

View File

@ -56,7 +56,7 @@
<div class="flex-sel border-right" @click="changeOpenTrue(1)">
<div v-if="openTrue[1] == 0" class="no-sel"></div>
<div v-else class="sel"></div>
大风保护
大风保护有效
</div>
<div class="flex-sel border-right" @click="changeOpenTrue(2)">
<div v-if="openTrue[2] == 0" class="no-sel"></div>
@ -87,13 +87,13 @@
<span></span>
</div>
<div class="input-main">
<div>展开的输出通道</div>
<div>打开的通道</div>
<input @blur="blurChange('21539', $event)" v-model="inputData['21539']" @input="change('21539', $event)"
type="text" value="60" placeholder="60" />
<span></span>
</div>
<div class="input-main">
<div>收拢的输出通道</div>
<div>关闭的通道</div>
<input @blur="blurChange('21540', $event)" v-model="inputData['21540']" @input="change('21540', $event)"
type="text" value="60" placeholder="60" />
<span></span>

View File

@ -44,7 +44,7 @@
<span>室内1#平均温度夜间时段高于</span>
<input @blur="blurChangeCount('21524', $event)" v-model="inputData['21524']"
@input="changeCountData('21524', $event)" type="text" value="60" placeholder="60" />
<span>启动</span>
<span>停止</span>
</div>
</div>
<div class="flex-view border-none">