Merge pull request 'pc-master' (#7) from pc-master into master

Reviewed-on: #7
master
clibing 2023-10-08 03:44:03 +00:00
commit 96911cfc27
8 changed files with 69 additions and 45 deletions

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

View File

@ -19,5 +19,8 @@ import 'videojs-contrib-hls'; // 引入支持HLS的插件
new Vue({ new Vue({
router, router,
store, store,
render: h => h(App) render: h => h(App),
beforeCreate(){
Vue.prototype.$bus=this
},
}).$mount('#app') }).$mount('#app')

View File

@ -61,7 +61,7 @@ export default new Vuex.Store({
{ label: '土壤氮含量', value: 41, countType: 0,unit:'mg/kg' }, { label: '土壤氮含量', value: 41, countType: 0,unit:'mg/kg' },
{ label: '土壤磷含量', value: 42, countType: 0,unit:'mg/kg' }, { label: '土壤磷含量', value: 42, countType: 0,unit:'mg/kg' },
{ label: '土壤钾含量', value: 43, 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: 45, countType: 0,unit:'ppm' },
{ label: '氨气', value: 46, countType: 0,unit:'ppm' }, { label: '氨气', value: 46, countType: 0,unit:'ppm' },
{ label: '硫化氢', value: 47, countType: 0,unit:'ppm' }, { label: '硫化氢', value: 47, countType: 0,unit:'ppm' },

View File

View File

@ -5,6 +5,7 @@
<div> <div>
<div class="return-btn" @click="returnRouter()"></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' : ''" <!-- <div class="router-list" @click="toRouter(item)" :class="routerAct == item.router ? 'active' : ''"
v-for="item, index in routerList" :key="index"> v-for="item, index in routerList" :key="index">
{{ item.name }} {{ item.name }}
@ -14,6 +15,7 @@
</div> </div>
<div class="header-center" v-if="deviceDetail">{{ deviceDetail.deviceTypeName }}</div> <div class="header-center" v-if="deviceDetail">{{ deviceDetail.deviceTypeName }}</div>
<div class="header-right"> <div class="header-right">
<div class="time" v-if="time"> <div class="time" v-if="time">
{{ time.year.year }}-{{ time.year.month }}-{{ time.year.date }}<span>{{ time.time }}</span> {{ time.year.year }}-{{ time.year.month }}-{{ time.year.date }}<span>{{ time.time }}</span>
<div>{{ time.week }}</div> <div>{{ time.week }}</div>
@ -53,6 +55,10 @@ export default {
} }
}, },
methods: { methods: {
refreshData(){
this.getEqbyid()
this.$bus.$emit('refreshData')
},
getEqbyid() { getEqbyid() {
var store=this.$store.state var store=this.$store.state
var userInfo = JSON.parse(localStorage.getItem('userInfo')) var userInfo = JSON.parse(localStorage.getItem('userInfo'))
@ -105,7 +111,22 @@ export default {
background: url(../assets/image/background.jpg) no-repeat; background: url(../assets/image/background.jpg) no-repeat;
background-size: 1920px 1080px; background-size: 1920px 1080px;
background-position: center top; 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 { .header {
display: flex; display: flex;
align-items: center; align-items: center;
@ -124,25 +145,10 @@ export default {
flex-shrink: 0; flex-shrink: 0;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; // justify-content: space-between;
width: 500px; 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 { .router-list {

View File

@ -75,12 +75,13 @@ export default {
setTimeout(() => { setTimeout(() => {
that.dataInit(); that.dataInit();
that.timer&&clearInterval(that.timer) that.timer&&clearInterval(that.timer)
setInterval(() => { that.timer= setInterval(() => {
that.dataInit(); that.dataInit();
}, 60000); }, 60000);
}, 0); }, 0);
}, },
beforeDestroy() { beforeDestroy() {
const that = this;
// //
if (this.player) { if (this.player) {
this.player.dispose(); this.player.dispose();

View File

@ -35,8 +35,8 @@
</div> </div>
</div> </div>
<div class="left-btn"> <div class="left-btn">
<div :class="left1Act == 0 ? 'active' : ''">进水泵</div> <div :class="left1Act == 1&&left1Act==3 ? 'active' : ''">进水泵</div>
<div :class="left1Act == 1 ? 'active' : ''">配肥泵</div> <div :class="left1Act == 2&&left1Act==3 ? 'active' : ''">配肥泵</div>
</div> </div>
</div> </div>
@ -247,8 +247,8 @@ export default {
ADdata: 0, ADdata: 0,
},], },],
right2Index: [], right2Index: [],
rightList2: ['外控信号2#', rightList2: ['外控信号1#',
'外控信号1#', '外控信号2#',
'外控信号3#', '外控信号3#',
'外控信号4#', '外控信号4#',
'高液位信号', '高液位信号',
@ -279,24 +279,27 @@ export default {
} }
}, },
// //
beforeDestroy(){ beforeDestroy(){
that.pageTimer&&clearInterval(that.pageTimer) const that = this;
this.$bus.$off('refreshData')
// that.pageTimer&&clearInterval(that.pageTimer)
}, },
mounted() { mounted() {
const that = this; const that = this;
if (localStorage.getItem('token')) { if (localStorage.getItem('token')) {
setTimeout(() => {
that.getEqbyid(); that.getEqbyid();
that.pageTimer&&clearInterval(that.pageTimer) // setTimeout(() => {
that.pageTimer= setInterval(() => { // that.pageTimer&&clearInterval(that.pageTimer)
that.getEqbyid(); // that.pageTimer= setInterval(() => {
}, 5000); // that.getEqbyid();
}, 0); // }, 5000);
// }, 0);
} else { } else {
// this.$router.push({ name: 'login' }) // this.$router.push({ name: 'login' })
} }
this.$bus.$on('refreshData',(res)=>{
that.getEqbyid();
})
}, },
methods: { methods: {
//countType //countType
@ -478,6 +481,7 @@ export default {
var number = this.padString(this.inputData['29'].toString(2), 14) var number = this.padString(this.inputData['29'].toString(2), 14)
var index = 6 var index = 6
var typeNumber = -1 var typeNumber = -1
for (var i = 0; i < index; i++) { for (var i = 0; i < index; i++) {
if (Number(number[i])) { if (Number(number[i])) {
typeNumber = i typeNumber = i
@ -488,21 +492,31 @@ export default {
var statusIndex = 8 var statusIndex = 8
for (var j = 0; j < statusIndex; j++) { for (var j = 0; j < statusIndex; j++) {
if (Number(number[number.length-1 - 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() { getData30() {
var number = this.padString(this.inputData['30'].toString(2), 2) // var number = this.padString(this.inputData['30'].toString(2), 2)
if (Number(number[0])) { // if (Number(number[0])) {
this.left1Act = 1 // this.left1Act = 1
} // }
else if (Number(number[1])) { // if (Number(number[1])) {
this.left1Act = 0 // this.left1Act = 0
} else { // }
this.left1Act = -1 // if (Number(number[0])&&Number(number[1])) {
} // this.left1Act = 3
// }
// else {
// this.left1Act = -1
// }
}, },
dataInit() { dataInit() {
var deviceDetail = this.deviceDetail var deviceDetail = this.deviceDetail