Compare commits

..

No commits in common. "98550c0e6be6f0469cb52e5a496027d5adcacda8" and "5c44f7060ef02e5a0878bfdc0720d755b3f2832a" have entirely different histories.

11 changed files with 141 additions and 277 deletions

View File

@ -1,5 +1,5 @@
{ {
"name": "zhihuiyun", "name": "ysws-vue",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {

View File

@ -43,12 +43,7 @@ input::-webkit-inner-spin-button {
-webkit-appearance: none !important; -webkit-appearance: none !important;
margin: 0; margin: 0;
} }
#app{
min-width: 1290px;
min-height: 900px;
width: 100vw;
height: 100vh;
}
@font-face { @font-face {
font-family: Oswald; font-family: Oswald;
src: url(./assets/ttf/Oswald-Medium.ttf); src: url(./assets/ttf/Oswald-Medium.ttf);

View File

@ -112,8 +112,4 @@ export default {
getGethls(data){ getGethls(data){
return sendGetRequest("/camera/gethls",data); return sendGetRequest("/camera/gethls",data);
}, },
//根据ID查询用户信息
getUser(data){
return sendGetRequest('/api/sel/user',data)
},
}; };

View File

@ -203,8 +203,8 @@
} }
.index { .index {
width: 100%; width: 100vw;
height: 100%; height: 100vh;
min-height: 900px; min-height: 900px;
overflow: auto; overflow: auto;
background: url(../image/index-background.png) no-repeat; background: url(../image/index-background.png) no-repeat;
@ -377,13 +377,11 @@
height: 100%; height: 100%;
background: rgba(0, 29, 68, 0.25); background: rgba(0, 29, 68, 0.25);
border-right: 2px solid rgba(0, 180, 255, 0.25); border-right: 2px solid rgba(0, 180, 255, 0.25);
overflow: auto;
} }
.index .index-content .right { .index .index-content .right {
width: calc(100% - 240px); width: calc(100% - 240px);
height: 100%; height: 100%;
overflow: auto;
} }
.input-view { .input-view {
@ -1360,45 +1358,29 @@
margin-left: 10px; margin-left: 10px;
} }
.realTime .page-content .realTime-list { .realTime .page-content .flex-list {
width: 100%;
overflow: hidden;
}
.realTime .page-content .realTime-list .seamless-warp {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-around;
} }
.realTime .page-content .realTime-list .seamless-warp > div { .realTime .page-content .flex-list > div {
display: flex;
overflow: unset !important;
}
.realTime .page-content .realTime-list .seamless-warp > div > div {
display: flex;
align-items: center;
flex-shrink: 0;
}
.realTime .page-content .realTime-list .seamless-warp .list-view {
flex-shrink: 0; flex-shrink: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
margin-right: 20px;
} }
.realTime .page-content .realTime-list .seamless-warp .list-view img { .realTime .page-content .flex-list > div img {
width: 80px; width: 80px;
height: 80px; height: 80px;
} }
.realTime .page-content .realTime-list .seamless-warp .list-view .text { .realTime .page-content .flex-list > div .text {
margin: 5px 0; margin: 5px 0;
} }
.realTime .page-content .realTime-list .seamless-warp .list-view .number { .realTime .page-content .flex-list > div .number {
width: 106px; width: 106px;
height: 40px; height: 40px;
background: url(../image/real-time-text.png) no-repeat center; background: url(../image/real-time-text.png) no-repeat center;
@ -1412,12 +1394,6 @@
justify-content: center; justify-content: center;
} }
.realTime .page-content .flex-list {
display: flex;
align-items: center;
justify-content: space-around;
}
.realTime .page-content .realTime-bottom { .realTime .page-content .realTime-bottom {
height: 440px; height: 440px;
margin-top: 30px; margin-top: 30px;

File diff suppressed because one or more lines are too long

View File

@ -217,13 +217,14 @@
} }
.index { .index {
width: 100%; width: 100vw;
height: 100%; height: 100vh;
min-height: 900px; min-height: 900px;
overflow: auto; overflow: auto;
background: url(../image/index-background.png) no-repeat; background: url(../image/index-background.png) no-repeat;
background-size: 1920px 1080px; background-size: 1920px 1080px;
background-position: center top; background-position: center top;
.no-list { .no-list {
color: #fff; color: #fff;
display: flex; display: flex;
@ -391,13 +392,12 @@
background: rgba(0, 29, 68, 0.25); background: rgba(0, 29, 68, 0.25);
border-right: 2px solid rgba(0, 180, 255, 0.25); border-right: 2px solid rgba(0, 180, 255, 0.25);
overflow: auto;
} }
.right { .right {
width: calc(100% - 240px); width: calc(100% - 240px);
height: 100%; height: 100%;
overflow: auto;
} }
} }
} }
@ -1431,61 +1431,43 @@
margin-left: 10px; margin-left: 10px;
} }
} }
.realTime-list{
width: 100%;
overflow: hidden;
.seamless-warp{
display: flex;
align-items: center;
>div{
// width: 100%!important;
display: flex;
overflow: unset!important;
>div{
display: flex;
align-items: center;
flex-shrink: 0;
}
}
.list-view {
flex-shrink: 0;
display: flex;
flex-direction: column;
align-items: center;
margin-right: 20px;
img {
width: 80px;
height: 80px;
}
.text {
margin: 5px 0;
}
.number {
width: 106px;
height: 40px;
background: url(../image/real-time-text.png) no-repeat center;
background-size: 100% 100%;
font-size: 20px;
font-family: Arial;
font-weight: bold;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
}
}
}
}
.flex-list { .flex-list {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-around; justify-content: space-around;
// flex-wrap: wrap; // flex-wrap: wrap;
>div {
flex-shrink: 0;
display: flex;
flex-direction: column;
align-items: center;
img {
width: 80px;
height: 80px;
}
.text {
margin: 5px 0;
}
.number {
width: 106px;
height: 40px;
background: url(../image/real-time-text.png) no-repeat center;
background-size: 100% 100%;
font-size: 20px;
font-family: Arial;
font-weight: bold;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
}
}
} }

View File

@ -65,12 +65,5 @@ const router = new VueRouter({
base: process.env.BASE_URL, base: process.env.BASE_URL,
routes routes
}) })
router.beforeEach(async (to,from,next) => {
if (to.meta.title) { // 判断是否有标题
document.title = to.meta.title;
}else{
document.title ='温室智慧云'
}
next();
});
export default router export default router

View File

@ -44,7 +44,7 @@ export default {
}, },
}, },
mounted() { mounted() {
// this.getTime() this.getTime()
this.gerRouter(); this.gerRouter();
if (localStorage.getItem('token')) { if (localStorage.getItem('token')) {
@ -53,10 +53,6 @@ export default {
this.$router.push({ name: 'login' }) this.$router.push({ name: 'login' })
} }
this.$bus.$on('refreshTime',(res)=>{
console.log(res,'time');
this.time=res
})
}, },
methods: { methods: {
refreshData(){ refreshData(){
@ -108,8 +104,8 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
.home { .home {
width: 100%; width: 100vw;
height: 100%; height: 100vh;
min-height: 900px; min-height: 900px;
overflow: auto; overflow: auto;
background: url(../assets/image/background.jpg) no-repeat; background: url(../assets/image/background.jpg) no-repeat;

View File

@ -2,7 +2,7 @@
<div class="index"> <div class="index">
<div class="header"> <div class="header">
<div class="header-left"> <div class="header-left">
<img src="../assets/image/logo.png" alt=""> <img src="../assets/image/logo.png" alt="">
</div> </div>
<div class="header-center"> <div class="header-center">
<div @click="toRouter(item)" :class="item.routerList.indexOf(routerNow) != -1 ? 'active' : ''" <div @click="toRouter(item)" :class="item.routerList.indexOf(routerNow) != -1 ? 'active' : ''"
@ -14,7 +14,7 @@
<div class="header-right" v-if="userInfo"> <div class="header-right" v-if="userInfo">
<img src="../assets/image/avatar.png" alt=""> <img src="../assets/image/avatar.png" alt="">
<div class="user-data"> <div class="user-data">
<div class="name">欢迎{{ userInfo.nickName }}</div> <div class="name">欢迎{{ userInfo.nickname }}</div>
<div class="time" v-if="time"> {{ time.year.year }}-{{ time.year.month }}-{{ time.year.date }}</div> <div class="time" v-if="time"> {{ time.year.year }}-{{ time.year.month }}-{{ time.year.date }}</div>
</div> </div>
<div class="login-out" @click="loginOut"></div> <div class="login-out" @click="loginOut"></div>
@ -32,9 +32,9 @@
<li class="table-li" @click="toRouter1(item1)" <li class="table-li" @click="toRouter1(item1)"
:class="item.routerList.indexOf(routerNow) != -1 && routerIndex == item1.index ? 'active' : ''" :class="item.routerList.indexOf(routerNow) != -1 && routerIndex == item1.index ? 'active' : ''"
v-for="item1, index1 in item.list" :key="index1">{{ item1.deviceTypeName }} <div v-for="item1, index1 in item.list" :key="index1">{{ item1.deviceTypeName }} <div
class="status" :class="item1.deviceState == 0 ? 'outline' : 'online'" class="status" :class="item1.status == 0 ? 'outline' : 'online'"
v-if="item1.deviceState >= 0">{{ v-if="item1.status >= 0">{{
item1.deviceState == 0 ? '离线' : '在线' }}</div> item1.status == 0 ? '离线' : '在线' }}</div>
</li> </li>
</ul> </ul>
</el-collapse-item> </el-collapse-item>
@ -73,13 +73,12 @@ export default {
{ name: '首页', img: require('../assets/image/index-icon.png'), list: [], router: 'realTime', isRouter: true, }, { name: '首页', img: require('../assets/image/index-icon.png'), list: [], router: 'realTime', isRouter: true, },
{ name: '一号温室', img: require('../assets/image/left-img0.png'), list: [] }, { name: '一号温室', img: require('../assets/image/left-img0.png'), list: [] },
{ name: '二号温室', img: require('../assets/image/left-img1.png'), list: [] }, { name: '二号温室', img: require('../assets/image/left-img1.png'), list: [] },
{ name: '施肥机', routerList: ['formula', 'irrigateSet', 'PIDSet', 'systemSet', 'upload', 'sensorSet', 'realTime'], img: require('../assets/image/left-img2.png'), list: [] },], { name: '施肥机', routerList: ['formula', 'irrigateSet', 'PIDSet', 'systemSet', 'upload', 'sensorSet','realTime'], img: require('../assets/image/left-img2.png'), list: [] },],
routerNow: 'realTime', routerNow: 'realTime',
routerIndex: 1, routerIndex: 1,
equipmentList: [], equipmentList: [],
userInfo: null, userInfo: null,
loading: true,// loading:true,//
IDTimer:null,
} }
}, },
watch: { watch: {
@ -88,73 +87,51 @@ export default {
}, },
}, },
mounted() { mounted() {
const that = this
this.getTime() this.getTime()
var router = this.$route.query if (localStorage.getItem('token')) {
if (router.token && router.userid) { this.userInfo = JSON.parse(localStorage.getItem('userInfo'))
localStorage.setItem('token', router.token)
this.api.getUser({ userId: router.userid }).then(res => {
var data=res.data.data
data.userid=router.userid
localStorage.setItem('userInfo', JSON.stringify(data))
this.userInfo = JSON.parse(localStorage.getItem('userInfo'))
this.gerRouter();
this.getEqbyid()
})
return
} else {
if (localStorage.getItem('token')) {
this.userInfo = JSON.parse(localStorage.getItem('userInfo'))
}
this.gerRouter();
this.getEqbyid()
} }
this.IDTimer&&clearInterval( this.IDTimer) this.gerRouter();
this.IDTimer= setInterval(() => { this.getEqbyid()
that.getEqbyid()
}, 120000);
}, },
beforeDestroy(){
this.IDTimer&&clearInterval( this.IDTimer)
},
methods: { methods: {
/// ///
getByid() { getByid(){
var store = this.$store.state var store=this.$store.state
var data = { var data = {
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId, deviceId:store.equipmentList[store.equipmentIndex-1].deviceId,
}; };
this.api.getByid(data).then((res) => { this.api.getByid(data).then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
store.equipmentName = res.data.data store.equipmentName=res.data.data
} else { } else {
this.$message.error(res.data.msg); this.$message.error(res.data.msg);
} }
this.loading = false this.loading=false
}); });
}, },
// //
getEqbyid() { getEqbyid() {
var userInfo = JSON.parse(localStorage.getItem('userInfo')) var userInfo = JSON.parse(localStorage.getItem('userInfo'))
this.api.getEqbyid(userInfo.userid).then((res) => { this.api.getEqbyid(userInfo.userid).then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.$store.state.equipmentList = res.data.data.map((item, index) => { this.$store.state.equipmentList = res.data.data.map((item,index) => {
return { return {
...item, ...item,
router: 'formula', router: 'formula',
index: index + 1, index: index+1,
}; };
}); });
this.leftList.forEach((el, index) => { this.leftList.forEach((el, index) => {
if (el.name == '施肥机') { if (el.name == '施肥机') {
this.leftList[index].list = this.$store.state.equipmentList this.leftList[index].list = this.$store.state.equipmentList
} }
}) })
this.getByid() this.getByid()
} }
}) })
}, },
@ -186,9 +163,9 @@ export default {
if (item.http) { if (item.http) {
window.location.href = item.http; window.location.href = item.http;
} else if (item.router == 'formula' && this.$route.query.index != item.index) { } else if (item.router == 'formula' && this.$route.query.index != item.index) {
this.$store.state.equipmentIndex = item.index this.$store.state.equipmentIndex=item.index
this.$router.push({ path: `/${item.router}?index=${item.index ? item.index : 1}` }) this.$router.push({ path: `/${item.router}?index=${item.index ? item.index : 1}` })
} else if (item.router != this.routerNow && !item.http) { } else if (item.router != this.routerNow && !item.http) {
this.$router.push({ name: item.router }) this.$router.push({ name: item.router })
} }
@ -201,13 +178,13 @@ export default {
if (item.http) { if (item.http) {
window.location.href = item.http; window.location.href = item.http;
} else if (item.router == 'formula' && this.$route.query.index != item.index) { } else if (item.router == 'formula' && this.$route.query.index != item.index) {
if (this.routerNow == 'realTime') { if(this.routerNow=='realTime'){
this.$router.push({ path: `/realTime?index=${item.index ? item.index : 1}` }) this.$router.push({ path: `/realTime?index=${item.index ? item.index : 1}` })
} else { }else{
this.$store.state.equipmentIndex = item.index this.$store.state.equipmentIndex=item.index
this.$router.push({ path: `/formula?index=${item.index ? item.index : 1}` }) this.$router.push({ path: `/formula?index=${item.index ? item.index : 1}` })
} }
} else if (item.router != this.routerNow && !item.http) { } else if (item.router != this.routerNow && !item.http) {
this.$router.push({ name: item.router }) this.$router.push({ name: item.router })
} }

View File

@ -1,10 +1,9 @@
<template> <template>
<div class="formula realTime"> <div class="formula realTime">
<div class="page-content"> <div class="page-content">
<div class="timeNow" v-if="list.length"> <div class="timeNow" v-if="time">
<!-- {{ time.year.year }}-{{ time.year.month }}-{{ time.year.date }}<span> {{ time.time }}:{{ time.timeS {{ time.year.year }}-{{ time.year.month }}-{{ time.year.date }}<span> {{ time.time }}:{{ time.timeS
}}</span> --> }}</span>
{{ list[0].updateTime?list[0].updateTime:'' }}
</div> </div>
<div class="table-title"> <div class="table-title">
<img src="../../assets/image/real-time.png" alt="" /> <img src="../../assets/image/real-time.png" alt="" />
@ -21,15 +20,12 @@
</div> </div>
</div> --> </div> -->
</div> </div>
<div class="realTime-list" v-if="list.length"> <div class="flex-list scroll">
<vue-seamless class="seamless-warp" :data="list" :class-option="defaultOption"> <div class="" v-for="item, index in list " :key="index">
<div class="list-view" v-for="item, index in list " :key="index">
<img :src="item.img" alt=""> <img :src="item.img" alt="">
<div class="text">{{ item.name }}</div> <div class="text">{{ item.name }}</div>
<div class="number">{{ item.num }}</div> <div class="number">{{ item.num }}</div>
</div> </div>
</vue-seamless>
</div> </div>
<div class="flex-list realTime-bottom"> <div class="flex-list realTime-bottom">
<div class="left"> <div class="left">
@ -47,23 +43,8 @@ import { getnowtime } from '../../assets/js/nowTime'
import { realTimeLine } from '@/assets/js/charts' import { realTimeLine } from '@/assets/js/charts'
import videojs from 'video.js'; import videojs from 'video.js';
import video_zhCN from 'video.js/dist/lang/zh-CN.json' import video_zhCN from 'video.js/dist/lang/zh-CN.json'
import vueSeamless from 'vue-seamless-scroll'
export default { export default {
components: { vueSeamless },
computed: {
defaultOption() {
return {
step: 0.3, //
limitMoveNum: 9, // this.dataList.length
hoverStop: true, // stop
direction: 2, // 0 1 2 3
openWatch: true, // dom
singleHeight: 0, // (0) direction => 0/1
singleWidth: 0, // (0) direction => 2/3
waitTime: 1000 // (1000ms)
}
}
},
data() { data() {
return { return {
time: null,// time: null,//
@ -88,7 +69,7 @@ export default {
const that = this; const that = this;
this.indexs = this.$route.query.index ? this.$route.query.index : 1; this.indexs = this.$route.query.index ? this.$route.query.index : 1;
// this.getTime() this.getTime()
setTimeout(() => { setTimeout(() => {
@ -98,7 +79,6 @@ export default {
that.dataInit(); that.dataInit();
}, 60000); }, 60000);
}, 0); }, 0);
}, },
beforeDestroy() { beforeDestroy() {
const that = this; const that = this;
@ -107,7 +87,6 @@ export default {
this.player.dispose(); this.player.dispose();
} }
that.timer&&clearInterval(that.timer) that.timer&&clearInterval(that.timer)
this.$bus.$off('refreshTime')
}, },
methods: { methods: {
createVideo() { createVideo() {
@ -195,12 +174,10 @@ export default {
} }
this.list.push({ this.list.push({
...el,
name:name, name:name,
num: num, num: num,
img: require(`../../assets/image/real-time-${el.formula}.png`) img: require(`../../assets/image/real-time-${el.formula}.png`)
})
})
} }
}) })

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 == 1&&left1Act==3 ? 'active' : ''">进水泵</div>
<div :class="left1Act == 2 && left1Act == 3 ? 'active' : ''">配肥泵</div> <div :class="left1Act == 2&&left1Act==3 ? 'active' : ''">配肥泵</div>
</div> </div>
</div> </div>
@ -139,7 +139,7 @@ import vueSeamless from 'vue-seamless-scroll'
export default { export default {
data() { data() {
return { return {
pageTimer: null, pageTimer:null,
left1Act: -1, left1Act: -1,
openType: '', openType: '',
left2List: [ left2List: [
@ -260,7 +260,7 @@ export default {
centerBottom: [], centerBottom: [],
numberList: [273, 278, 283, 288, 293, 298], numberList: [273, 278, 283, 288, 293, 298],
inputData1: [], inputData1: [],
loading: true, loading:true,
} }
}, },
components: { vueSeamless }, components: { vueSeamless },
@ -279,26 +279,26 @@ export default {
} }
}, },
// //
beforeDestroy() { beforeDestroy(){
const that = this; const that = this;
this.$bus.$off('refreshData') this.$bus.$off('refreshData')
that.pageTimer && clearInterval(that.pageTimer) // that.pageTimer&&clearInterval(that.pageTimer)
}, },
mounted() { mounted() {
const that = this; const that = this;
if (localStorage.getItem('token')) { if (localStorage.getItem('token')) {
that.getEqbyid(); that.getEqbyid();
setTimeout(() => { // 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) => { this.$bus.$on('refreshData',(res)=>{
that.getEqbyid(); that.getEqbyid();
}) })
}, },
methods: { methods: {
@ -308,16 +308,16 @@ export default {
//2/10 //2/10
//3(-400) / 10 //3(-400) / 10
countType1(data) { countType1(data) {
var num = data - 400 var num=data - 400
return num.toFixed(2) return num.toFixed(2)
}, },
countType2(data) { countType2(data) {
var num = data / 10 var num=data / 10
return num.toFixed(2) return num.toFixed(2)
}, },
countType3(data) { countType3(data) {
var num = (data - 400) / 10 var num=(data - 400) / 10
return num.toFixed(2) return num.toFixed(2)
}, },
getTypeData(dataCode, typeCode) { getTypeData(dataCode, typeCode) {
@ -357,17 +357,17 @@ export default {
data: '1#EC ' + this.countData100(inputData['52']), data: '1#EC ' + this.countData100(inputData['52']),
ADdata: '2#EC ' + this.countData100(inputData['54']), ADdata: '2#EC ' + this.countData100(inputData['54']),
} }
this.tableList1[2] = { this.tableList1[2] = {
name: '传感器1', name: '传感器1',
data: this.getTypeData('40', '273'), data: this.getTypeData('40', '273'),
ADdata: inputData['39'], ADdata:inputData['39'],
} }
this.tableList1[3] = { this.tableList1[3] = {
name: '传感器2', name: '传感器2',
data: this.getTypeData('42', '278'), data: this.getTypeData('42', '278'),
ADdata: inputData['41'], ADdata:inputData['41'] ,
} }
this.tableList1[4] = { this.tableList1[4] = {
@ -385,15 +385,15 @@ export default {
this.tableList1[6] = { this.tableList1[6] = {
name: '传感器5', name: '传感器5',
data: this.getTypeData('48', '293'), data: this.getTypeData('48', '293'),
ADdata: inputData['47'], ADdata:inputData['47'] ,
} }
this.tableList1[7] = { this.tableList1[7] = {
name: '传感器6', name: '传感器6',
data: this.getTypeData('50', '298'), data: this.getTypeData('50', '298'),
ADdata: inputData['49'], ADdata:inputData['49'] ,
} }
this.loading = false this.loading=false
}, },
getEqbyid() { getEqbyid() {
var store = this.$store.state var store = this.$store.state
@ -491,51 +491,40 @@ 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) { if(j=0){
this.right2Index.push('1') this.right2Index.push(1)
} else if (j == 1) { }else if(j=1){
this.right2Index.push('0') this.right2Index.push(0)
} else { }else{
this.right2Index.push(j) this.right2Index.push(j)
} }
} }
} }
console.log(this.right2Index, 123);
}, },
// //
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])) { // if (Number(number[1])) {
// this.left1Act = 0 // this.left1Act = 0
// } // }
// if (Number(number[0])&&Number(number[1])) { // if (Number(number[0])&&Number(number[1])) {
// this.left1Act = 3 // this.left1Act = 3
// } // }
// else { // else {
// this.left1Act = -1 // this.left1Act = -1
// } // }
}, },
dataInit() { dataInit() {
const that = this
var deviceDetail = this.deviceDetail var deviceDetail = this.deviceDetail
var data = { var data = {
"equipmentId": deviceDetail.deviceId, "equipmentId": deviceDetail.deviceId,
"pattern": 0,// //6ph- "pattern": 0,// //6ph-
"regNum": 71 "regNum": 71
} }
var week = [
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六",
]
this.api.postState(data).then(res => { this.api.postState(data).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.inputData = res.data.data; this.inputData = res.data.data;
@ -546,37 +535,20 @@ export default {
this.getleft2List()// this.getleft2List()//
this.getrightList3()// this.getrightList3()//
this.getcenterBottom()// this.getcenterBottom()//
var h = this.checkTime(this.inputData[3])
var m = this.checkTime(this.inputData[4])
var month_ = this.checkTime(this.inputData[1])
var date_ = this.checkTime(this.inputData[2])
var time = {
year: { year: this.inputData[0], month: month_, date: date_ },
week: week[this.inputData[5]],
time: h + ":" + m,
}
this.$bus.$emit('refreshTime',time)
} else { } else {
this.$message.error(res.data.msg); this.$message.error(res.data.msg);
} }
}) })
}, },
checkTime(i) {
if (i < 10) {
i = "0" + i;
}
return i;
},
getReg() { getReg() {
var deviceDetail = this.deviceDetail var deviceDetail = this.deviceDetail
// //
var data1 = { var data1 = {
equipmentId: deviceDetail.deviceId, equipmentId: deviceDetail.deviceId,
pattern: 272, // //6ph- pattern: 272, // //6ph-
regNum: 31,//pattern regNum: 31,//pattern
}; };
this.api.postReg(data1).then((res) => { this.api.postReg(data1).then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.inputData1 = res.data.data; this.inputData1 = res.data.data;