Compare commits

..

No commits in common. "96911cfc27fa8e458c7d165e3416b5bfeca35f71" and "ef9e02bf4742ce06e01900e4dbe2ce1732ddb884" have entirely different histories.

8 changed files with 45 additions and 69 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@ -19,8 +19,5 @@ 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:'Kpa' }, { label: '臭氧', value: 44, countType: 0,unit:'ppm' },
{ 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,7 +5,6 @@
<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 }}
@ -15,7 +14,6 @@
</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>
@ -55,10 +53,6 @@ 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'))
@ -111,22 +105,7 @@ 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;
@ -145,10 +124,25 @@ 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,13 +75,12 @@ export default {
setTimeout(() => { setTimeout(() => {
that.dataInit(); that.dataInit();
that.timer&&clearInterval(that.timer) that.timer&&clearInterval(that.timer)
that.timer= setInterval(() => { 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 == 1&&left1Act==3 ? 'active' : ''">进水泵</div> <div :class="left1Act == 0 ? 'active' : ''">进水泵</div>
<div :class="left1Act == 2&&left1Act==3 ? 'active' : ''">配肥泵</div> <div :class="left1Act == 1 ? 'active' : ''">配肥泵</div>
</div> </div>
</div> </div>
@ -247,8 +247,8 @@ export default {
ADdata: 0, ADdata: 0,
},], },],
right2Index: [], right2Index: [],
rightList2: ['外控信号1#', rightList2: ['外控信号2#',
'外控信号2#', '外控信号1#',
'外控信号3#', '外控信号3#',
'外控信号4#', '外控信号4#',
'高液位信号', '高液位信号',
@ -279,27 +279,24 @@ export default {
} }
}, },
// //
beforeDestroy(){ beforeDestroy(){
const that = this; that.pageTimer&&clearInterval(that.pageTimer)
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();
// setTimeout(() => { that.pageTimer&&clearInterval(that.pageTimer)
// that.pageTimer&&clearInterval(that.pageTimer) that.pageTimer= setInterval(() => {
// that.pageTimer= setInterval(() => { that.getEqbyid();
// that.getEqbyid(); }, 5000);
// }, 5000); }, 0);
// }, 0);
} else { } else {
// this.$router.push({ name: 'login' }) // this.$router.push({ name: 'login' })
} }
this.$bus.$on('refreshData',(res)=>{
that.getEqbyid();
})
}, },
methods: { methods: {
//countType //countType
@ -481,7 +478,6 @@ 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
@ -492,31 +488,21 @@ 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])) {
if(j=0){ this.right2Index.push(j)
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
// } }
// if (Number(number[1])) { else if (Number(number[1])) {
// this.left1Act = 0 this.left1Act = 0
// } } else {
// if (Number(number[0])&&Number(number[1])) { this.left1Act = -1
// this.left1Act = 3 }
// }
// else {
// this.left1Act = -1
// }
}, },
dataInit() { dataInit() {
var deviceDetail = this.deviceDetail var deviceDetail = this.deviceDetail