Browse Source

Merge branch 'develop'

master
chenJinxu 11 months ago
parent
commit
9c7e18c28c
4 changed files with 29 additions and 8 deletions
  1. +6
    -0
      README.md
  2. +1
    -1
      src/config/models.js
  3. +0
    -1
      src/views/gps-card-frontend/device-setting/index.scss
  4. +22
    -6
      src/views/gps-card-frontend/device-setting/index.vue

+ 6
- 0
README.md View File

@@ -850,3 +850,9 @@ feat
- c1后台设备功耗查看页面 - c1后台设备功耗查看页面
- 增加 设备状态查看菜单 - 增加 设备状态查看菜单
- 优化 设备离线行为查看明细,增加最近离线时间 - 优化 设备离线行为查看明细,增加最近离线时间

## v1.0.107
`2023.12.7`
update
- c1后台设备功耗查看页面
- 优化 设备状态文字

+ 1
- 1
src/config/models.js View File

@@ -5,7 +5,7 @@
* @FilePath: \TelpoH5FrontendWeb\src\config\models.js * @FilePath: \TelpoH5FrontendWeb\src\config\models.js
* @description: * @description:
*/ */
export const VERSION_MODEL = '1.0.106F'; //版本号
export const VERSION_MODEL = '1.0.107F'; //版本号
export const IMAGE_URL = { export const IMAGE_URL = {
production: 'http://zfb.ssjlai.com/web/', production: 'http://zfb.ssjlai.com/web/',
test: 'http://zfb.ssjlai.com/web/', test: 'http://zfb.ssjlai.com/web/',


+ 0
- 1
src/views/gps-card-frontend/device-setting/index.scss View File

@@ -10,6 +10,5 @@
@media screen and (max-width: 550px) and (min-width: 200px){ @media screen and (max-width: 550px) and (min-width: 200px){
font-size: 16px; font-size: 16px;
} }

} }
} }

+ 22
- 6
src/views/gps-card-frontend/device-setting/index.vue View File

@@ -8,7 +8,7 @@
<template> <template>
<div classs="device-setting"> <div classs="device-setting">
<div class="tree-select"> <div class="tree-select">
<van-tree-select :items="settingItems" :main-active-index.sync="active" :height="clientHeight" @click-nav="onCkickNav">
<van-tree-select :items="settingItems" :main-active-index.sync="active" :height="clientHeight" @click-nav="onCkickNav">
<template #content> <template #content>
<div class="item" v-for="(item, index) in settingItems" :key="index" v-show="item.index === active"> <div class="item" v-for="(item, index) in settingItems" :key="index" v-show="item.index === active">
<div class="item-setting" v-for="(child, index) in item.data" :key="index"> <div class="item-setting" v-for="(child, index) in item.data" :key="index">
@@ -36,7 +36,7 @@ export default {
return { return {
active: 0, active: 0,
settingItems: [ settingItems: [
{ text: '设备状态', index: 0, data: [],},
{ text: '设备状态', index: 0, data: [], className: '',},
{ text: '监护角色', index: 1, data: [],}, { text: '监护角色', index: 1, data: [],},
{ text: '场景模式', index: 2, data: []}, { text: '场景模式', index: 2, data: []},
{ text: '加强省电模式', index: 3, data: []}, { text: '加强省电模式', index: 3, data: []},
@@ -63,6 +63,7 @@ export default {
created() { created() {
this.getAuth(); this.getAuth();
this.getUrlQueryParams(); this.getUrlQueryParams();
this.loadRequest();
}, },
mounted() { mounted() {
/* this.$toast.loading({message: "加载中"}); /* this.$toast.loading({message: "加载中"});
@@ -78,8 +79,6 @@ export default {
this.clientHeight = document.documentElement.clientHeight; this.clientHeight = document.documentElement.clientHeight;
this.active = Number(this.$store.getters.active) || 0; this.active = Number(this.$store.getters.active) || 0;
this.$toast.success({message: "加载完成"}); */ this.$toast.success({message: "加载完成"}); */
//this.loadRequest();
this.loadRequest();
}, },
methods: { methods: {
// 加载接口 // 加载接口
@@ -652,6 +651,7 @@ export default {
return item.index === index return item.index === index
}); });
if(data.code === 200) { if(data.code === 200) {
this.settingItems[findIndex].className = this.calcDeviceStatus(data.data.data.status, true);
this.settingItems[findIndex].text = `设备状态(${this.calcDeviceStatus(data.data.data.status)})`; this.settingItems[findIndex].text = `设备状态(${this.calcDeviceStatus(data.data.data.status)})`;
} else { } else {
this.settingItems[findIndex].text = `设备状态(无数据)`; this.settingItems[findIndex].text = `设备状态(无数据)`;
@@ -661,24 +661,29 @@ export default {
}) })
}, },
// 计算设备状态 // 计算设备状态
calcDeviceStatus(status) {
calcDeviceStatus(status, isCallClass) {
let result = '' let result = ''
let className = '';
switch(status) { switch(status) {
case 'ONLINE': case 'ONLINE':
result = '在线'; result = '在线';
className = 'device-status-online';
break; break;
case 'OFFLINE': case 'OFFLINE':
result = '离线'; result = '离线';
className = 'device-status-other';
break; break;
case 'UNACTIVE': case 'UNACTIVE':
result = '未激活'; result = '未激活';
className = 'device-status-other';
break; break;
case 'DISABLE': case 'DISABLE':
result = '已禁用'; result = '已禁用';
className = 'device-status-other';
break; break;
default: break; default: break;
}; };
return result;
return isCallClass ? className : result;
}, },
// 点击左边树形图 // 点击左边树形图
onCkickNav(value) { onCkickNav(value) {
@@ -751,6 +756,16 @@ export default {
.van-tree-select__nav-item { .van-tree-select__nav-item {
padding: 15px 5px !important; padding: 15px 5px !important;
} }
.device-status-other {
.van-sidebar-item__text {
color: red !important;
}
}
.device-status-online {
.van-sidebar-item__text {
color: green !important;
}
}
.van-tree-select__content { .van-tree-select__content {
padding: 5px; padding: 5px;
} }
@@ -760,6 +775,7 @@ export default {
.van-tree-select__content { .van-tree-select__content {
@include center(); @include center();
} }
</style> </style>
<style scoped lang="scss"> <style scoped lang="scss">
@import "./index.scss"; @import "./index.scss";


Loading…
Cancel
Save