Commit 2c7fe558 authored by mahui's avatar mahui

init

parent 1794765e
...@@ -28,4 +28,8 @@ export default { ...@@ -28,4 +28,8 @@ export default {
getYewei(params) { getYewei(params) {
return http.post('web/data/getYewei', params) return http.post('web/data/getYewei', params)
}, },
//获取监控信息
getMonitorInfo(params) {
return http.post('web/toilet/getMonitorInfo', params)
},
} }
...@@ -34,9 +34,13 @@ ...@@ -34,9 +34,13 @@
next_time:Date.now() next_time:Date.now()
} }
}, },
mounted(){ watch:{
url(){
this.$nextTick(()=>{
this.init(); this.init();
window.addEventListener('onresize',this.resize); window.addEventListener('onresize',this.resize);
})
}
}, },
methods: { methods: {
play() { play() {
......
...@@ -123,10 +123,10 @@ ...@@ -123,10 +123,10 @@
</div> </div>
</div> </div>
<div class="table-body"> <div class="table-body">
<div class="row" v-for="(item,index) in typeList.filter(one=>one.show)" :key="index"> <div class="row" v-for="(item,index) in list.data" :key="index">
<div class="cell flex_2"> <div class="cell flex_2">
<span class="point" :style="`background-color:${item.color}`"></span> <span class="point" :style="`background-color:#09a8ae`"></span>
<span :style="`color:${item.color}`">{{item.name}}</span> <span :style="`color:#09a8ae`">{{item.typeName}}</span>
</div> </div>
<div class="cell flex_3">{{item.value}} {{item.unit}}</div> <div class="cell flex_3">{{item.value}} {{item.unit}}</div>
<div class="cell">{{item.CreatedAt}}</div> <div class="cell">{{item.CreatedAt}}</div>
...@@ -278,15 +278,14 @@ ...@@ -278,15 +278,14 @@
setup(props, {emit}) { setup(props, {emit}) {
const state = reactive({ const state = reactive({
show:false, show:false,
url:'ezopen://open.ys7.com/E77565052/1.hd.live',
order_id:'', order_id:'',
detail: { detail: {
poster:[], poster:[],
index: 0, index: 0,
yewei:0, yewei:0,
type:1, type:1,
accessToken:'at.bvx2ea007tfqqdvkcb9iuhk70q6gjodm-7smdnjfh9j-1wdmw5f-mal3go2vz', accessToken:'',
url:'ezopen://open.ys7.com/E77565052/1.live', url:'',
}, },
showBanner:false, showBanner:false,
tabs: [ tabs: [
...@@ -439,6 +438,16 @@ ...@@ -439,6 +438,16 @@
} }
}); });
} }
function getMonitorInfo() {
api.getMonitorInfo({id:props.site_id}).then((res)=>{
if(res.code==0){
if(res.data.access_token){
state.detail.accessToken = res.data.access_token;
state.detail.url = res.data.camera_url;
}
}
});
}
function typeChange(type=1) { function typeChange(type=1) {
switch (type) { switch (type) {
case 1: case 1:
...@@ -463,7 +472,7 @@ ...@@ -463,7 +472,7 @@
getYewei(); getYewei();
} }
if(item.value=='monitor'){ if(item.value=='monitor'){
// getList(); getMonitorInfo();
} }
if(item.value=='history'||item.value=='process'){ if(item.value=='history'||item.value=='process'){
getHistoryDataList(); getHistoryDataList();
...@@ -604,12 +613,7 @@ ...@@ -604,12 +613,7 @@
if(res.code==0){ if(res.code==0){
if(Array.isArray(res.data.list)){ if(Array.isArray(res.data.list)){
res.data.list.forEach((item)=>{ res.data.list.forEach((item)=>{
if(state.typeList.find(one=>one.name==item.typeName)){ item.CreatedAt = myPublic.dateFormat.format(item.CreatedAt);
state.typeList.find(one=>one.name==item.typeName).show = true;
state.typeList.find(one=>one.name==item.typeName).value = item.value;
state.typeList.find(one=>one.name==item.typeName).unit = item.unit;
state.typeList.find(one=>one.name==item.typeName).CreatedAt = myPublic.dateFormat.format(item.CreatedAt);
}
}); });
state.list.data = res.data.list; state.list.data = res.data.list;
state.list.total = res.data.total; state.list.total = res.data.total;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment