128 lines
5.3 KiB
JavaScript
128 lines
5.3 KiB
JavaScript
|
var vms = Vue.component("Company-amplify-xmspyj", {
|
|||
|
template: `
|
|||
|
<div>
|
|||
|
<div class="amplify-title-icon">
|
|||
|
<img src="https://fileimg.makalu.cc/WEB_DBD5893450984E50AFF356EF44FF4139.png" @click="openAmplify">
|
|||
|
</div>
|
|||
|
<transition name="el-zoom-in-top">
|
|||
|
<div class="amplify-fixed" v-show="show" style="display: none" @click="closeAmplifyAll">
|
|||
|
<div class="amplify-max">
|
|||
|
<div class="amplify-title">
|
|||
|
<div>项目视频预警</div>
|
|||
|
<div class="amplify-close" @click="closeAmplify"><i class="el-icon-close"></i></div>
|
|||
|
</div>
|
|||
|
<div class="amplify-content">
|
|||
|
<!--内容区域-->
|
|||
|
|
|||
|
<div class="amplify-labour-warning">
|
|||
|
<div class="amplify-labour-warning-title">
|
|||
|
<div class="amplify-labour-warning-img">
|
|||
|
<div class="amplify-labour-warning-bgd">
|
|||
|
<img src="/images/labour_warning_icon.png">
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="amplify-labour-warning-data">
|
|||
|
<p>今日预警数</p>
|
|||
|
<div class="amplify-labour-warning-number"><span v-cloak>{{this.businessdata.dayOffLineNum}}</span> </div>
|
|||
|
</div>
|
|||
|
<div class="amplify-labour-warning-data">
|
|||
|
<p>当月预警数</p>
|
|||
|
<div class="amplify-labour-warning-number"><span v-cloak>{{this.businessdata.monthOffLineNum}}</span> </div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="labour-warning-table">
|
|||
|
<el-table ref="warning" :data="this.businessdata.warningTableData" height="358" :cell-style="cellStyle" :header-row-style="headerStyle" @cell-mouse-enter="warningMouseEnter" @cell-mouse-leave="warningMouseLeave" class="elTable">
|
|||
|
<el-table-column type="index" label="序号" width="80"></el-table-column>
|
|||
|
<el-table-column prop="position" label="视频位置" show-overflow-tooltip></el-table-column>
|
|||
|
<el-table-column label="状态" width="100" >
|
|||
|
<template slot-scope="scope">
|
|||
|
<div style="color: #f73647" v-if="scope.row.state == 1">离线</div>
|
|||
|
<div style="color: #ff9900" v-if="scope.row.state == 2">故障</div>
|
|||
|
</template>
|
|||
|
</el-table-column>
|
|||
|
<el-table-column label="预警时间" width="260" prop="time"></el-table-column>
|
|||
|
</el-table>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</transition>
|
|||
|
</div>
|
|||
|
`,
|
|||
|
props: {
|
|||
|
businessdata:{
|
|||
|
type:Object
|
|||
|
}
|
|||
|
},
|
|||
|
data() {
|
|||
|
return {
|
|||
|
show:false,
|
|||
|
dayOffLineNum:0,
|
|||
|
monthOffLineNum:0,
|
|||
|
|
|||
|
cellStyle:{
|
|||
|
color:'#B6CFEF',
|
|||
|
fontSize:'24px',
|
|||
|
height:'64px',
|
|||
|
},
|
|||
|
headerStyle:{
|
|||
|
color:'#B6CFEF',
|
|||
|
fontSize:'18px',
|
|||
|
height:'64px'
|
|||
|
},
|
|||
|
warningInterval:'',
|
|||
|
warningTableData:[
|
|||
|
|
|||
|
],
|
|||
|
}
|
|||
|
},
|
|||
|
mounted(){
|
|||
|
console.log(this.businessdata)
|
|||
|
},
|
|||
|
methods: {
|
|||
|
openAmplify(){
|
|||
|
this.show = true
|
|||
|
|
|||
|
//预警分析
|
|||
|
// this.warningInterval = setInterval(this.warningScroll,50);
|
|||
|
},
|
|||
|
closeAmplify(){
|
|||
|
this.show = false
|
|||
|
},
|
|||
|
closeAmplifyAll(e){
|
|||
|
if(e.target.className == 'amplify-fixed'){
|
|||
|
this.show = false
|
|||
|
}
|
|||
|
},
|
|||
|
|
|||
|
|
|||
|
|
|||
|
// 表格滚动 方法 --------- 开始
|
|||
|
warningScroll(){
|
|||
|
let maxHeight=this.$refs.warning.$el.querySelectorAll('.el-table__body')[0].offsetHeight;
|
|||
|
let clientHeight=this.$refs.warning.bodyWrapper.clientHeight;
|
|||
|
if(Math.abs(this.$refs.warning.bodyWrapper.scrollTop-(maxHeight-clientHeight))<5){ //预留5像素误差
|
|||
|
this.$refs.warning.bodyWrapper.scrollTop=0;
|
|||
|
}else{
|
|||
|
this.$refs.warning.bodyWrapper.scrollTop+= 1;//32是每一行表格的高度,每秒滚一行
|
|||
|
}
|
|||
|
},
|
|||
|
warningMouseEnter(){//鼠标移入停止滚动
|
|||
|
clearInterval(this.warningInterval);
|
|||
|
},
|
|||
|
warningMouseLeave(){//鼠标离开继续滚动
|
|||
|
this.warningInterval=setInterval(this.warningScroll,30);
|
|||
|
},
|
|||
|
// 表格滚动 方法 ------ 结束
|
|||
|
|
|||
|
},
|
|||
|
watch:{
|
|||
|
|
|||
|
},
|
|||
|
|
|||
|
})
|
|||
|
|
|||
|
|