pc-master #7
Binary file not shown.
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
|
@ -19,5 +19,8 @@ import 'videojs-contrib-hls'; // 引入支持HLS的插件
|
|||
new Vue({
|
||||
router,
|
||||
store,
|
||||
render: h => h(App)
|
||||
render: h => h(App),
|
||||
beforeCreate(){
|
||||
Vue.prototype.$bus=this
|
||||
},
|
||||
}).$mount('#app')
|
||||
|
|
|
@ -61,7 +61,7 @@ export default new Vuex.Store({
|
|||
{ label: '土壤氮含量', value: 41, countType: 0,unit:'mg/kg' },
|
||||
{ label: '土壤磷含量', value: 42, countType: 0,unit:'mg/kg' },
|
||||
{ label: '土壤钾含量', value: 43, countType: 0,unit:'mg/kg' },
|
||||
{ label: '臭氧', value: 44, countType: 0,unit:'ppm' },
|
||||
{ label: '管道压力', value: 44, countType: 0,unit:'Kpa' },
|
||||
{ label: '一氧化碳', value: 45, countType: 0,unit:'ppm' },
|
||||
{ label: '氨气', value: 46, countType: 0,unit:'ppm' },
|
||||
{ label: '硫化氢', value: 47, countType: 0,unit:'ppm' },
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
<div>
|
||||
<div class="return-btn" @click="returnRouter()">返回</div>
|
||||
<div class="return-btn" @click="refreshData()">数据刷新</div>
|
||||
<!-- <div class="router-list" @click="toRouter(item)" :class="routerAct == item.router ? 'active' : ''"
|
||||
v-for="item, index in routerList" :key="index">
|
||||
{{ item.name }}
|
||||
|
@ -14,6 +15,7 @@
|
|||
</div>
|
||||
<div class="header-center" v-if="deviceDetail">{{ deviceDetail.deviceTypeName }}</div>
|
||||
<div class="header-right">
|
||||
|
||||
<div class="time" v-if="time">
|
||||
{{ time.year.year }}-{{ time.year.month }}-{{ time.year.date }}<span>{{ time.time }}</span>
|
||||
<div>{{ time.week }}</div>
|
||||
|
@ -53,6 +55,10 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
refreshData(){
|
||||
this.getEqbyid()
|
||||
this.$bus.$emit('refreshData')
|
||||
},
|
||||
getEqbyid() {
|
||||
var store=this.$store.state
|
||||
var userInfo = JSON.parse(localStorage.getItem('userInfo'))
|
||||
|
@ -105,7 +111,22 @@ export default {
|
|||
background: url(../assets/image/background.jpg) no-repeat;
|
||||
background-size: 1920px 1080px;
|
||||
background-position: center top;
|
||||
|
||||
.return-btn {
|
||||
width: 120px;
|
||||
margin: 0 8px;
|
||||
padding: 0 20px;
|
||||
border-radius: 3px;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 16px;
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
cursor: pointer;
|
||||
background: #00BB88;
|
||||
}
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
@ -124,25 +145,10 @@ export default {
|
|||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
// justify-content: space-between;
|
||||
width: 500px;
|
||||
|
||||
.return-btn {
|
||||
width: 120px;
|
||||
margin: 0 8px;
|
||||
padding: 0 20px;
|
||||
border-radius: 3px;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 16px;
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
cursor: pointer;
|
||||
background: #00BB88;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.router-list {
|
||||
|
|
|
@ -75,12 +75,13 @@ export default {
|
|||
setTimeout(() => {
|
||||
that.dataInit();
|
||||
that.timer&&clearInterval(that.timer)
|
||||
setInterval(() => {
|
||||
that.timer= setInterval(() => {
|
||||
that.dataInit();
|
||||
}, 60000);
|
||||
}, 0);
|
||||
},
|
||||
beforeDestroy() {
|
||||
const that = this;
|
||||
// 销毁播放器
|
||||
if (this.player) {
|
||||
this.player.dispose();
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="left-btn">
|
||||
<div :class="left1Act == 0 ? 'active' : ''">进水泵</div>
|
||||
<div :class="left1Act == 1 ? 'active' : ''">配肥泵</div>
|
||||
<div :class="left1Act == 1&&left1Act==3 ? 'active' : ''">进水泵</div>
|
||||
<div :class="left1Act == 2&&left1Act==3 ? 'active' : ''">配肥泵</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -247,8 +247,8 @@ export default {
|
|||
ADdata: 0,
|
||||
},],
|
||||
right2Index: [],
|
||||
rightList2: ['外控信号2#',
|
||||
'外控信号1#',
|
||||
rightList2: ['外控信号1#',
|
||||
'外控信号2#',
|
||||
'外控信号3#',
|
||||
'外控信号4#',
|
||||
'高液位信号',
|
||||
|
@ -280,23 +280,26 @@ export default {
|
|||
},
|
||||
//清除监听
|
||||
beforeDestroy(){
|
||||
that.pageTimer&&clearInterval(that.pageTimer)
|
||||
const that = this;
|
||||
this.$bus.$off('refreshData')
|
||||
// that.pageTimer&&clearInterval(that.pageTimer)
|
||||
},
|
||||
mounted() {
|
||||
const that = this;
|
||||
if (localStorage.getItem('token')) {
|
||||
|
||||
setTimeout(() => {
|
||||
that.getEqbyid();
|
||||
that.pageTimer&&clearInterval(that.pageTimer)
|
||||
that.pageTimer= setInterval(() => {
|
||||
that.getEqbyid();
|
||||
}, 5000);
|
||||
}, 0);
|
||||
// setTimeout(() => {
|
||||
// that.pageTimer&&clearInterval(that.pageTimer)
|
||||
// that.pageTimer= setInterval(() => {
|
||||
// that.getEqbyid();
|
||||
// }, 5000);
|
||||
// }, 0);
|
||||
} else {
|
||||
// this.$router.push({ name: 'login' })
|
||||
|
||||
}
|
||||
this.$bus.$on('refreshData',(res)=>{
|
||||
that.getEqbyid();
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
//countType计算类型
|
||||
|
@ -478,6 +481,7 @@ export default {
|
|||
var number = this.padString(this.inputData['29'].toString(2), 14)
|
||||
var index = 6
|
||||
var typeNumber = -1
|
||||
|
||||
for (var i = 0; i < index; i++) {
|
||||
if (Number(number[i])) {
|
||||
typeNumber = i
|
||||
|
@ -488,21 +492,31 @@ export default {
|
|||
var statusIndex = 8
|
||||
for (var j = 0; j < statusIndex; j++) {
|
||||
if (Number(number[number.length-1 - j])) {
|
||||
this.right2Index.push(j)
|
||||
if(j=0){
|
||||
this.right2Index.push(1)
|
||||
}else if(j=1){
|
||||
this.right2Index.push(0)
|
||||
}else{
|
||||
this.right2Index.push(j)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
//进水泵和出水泵状态
|
||||
getData30() {
|
||||
var number = this.padString(this.inputData['30'].toString(2), 2)
|
||||
if (Number(number[0])) {
|
||||
this.left1Act = 1
|
||||
}
|
||||
else if (Number(number[1])) {
|
||||
this.left1Act = 0
|
||||
} else {
|
||||
this.left1Act = -1
|
||||
}
|
||||
// var number = this.padString(this.inputData['30'].toString(2), 2)
|
||||
// if (Number(number[0])) {
|
||||
// this.left1Act = 1
|
||||
// }
|
||||
// if (Number(number[1])) {
|
||||
// this.left1Act = 0
|
||||
// }
|
||||
// if (Number(number[0])&&Number(number[1])) {
|
||||
// this.left1Act = 3
|
||||
// }
|
||||
// else {
|
||||
// this.left1Act = -1
|
||||
// }
|
||||
},
|
||||
dataInit() {
|
||||
var deviceDetail = this.deviceDetail
|
||||
|
|
Loading…
Reference in New Issue