|
@@ -1,5 +1,9 @@
|
|
<template>
|
|
<template>
|
|
- <el-table ref="initList" :data="videoSelect" height="200" @row-click="clickData" highlight-current-row @cell-mouse-enter="mouseEnter" @cell-mouse-leave="mouseLeave">
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <el-table ref="initList" :data="videoSelect" height="200" @row-click="clickData" highlight-current-row @cell-mouse-enter="mouseEnter" @cell-mouse-leave="mouseLeave" v-if="select1" v-loading="loading">
|
|
|
|
+ <template slot="empty">
|
|
|
|
+ <span>{{text}}</span>
|
|
|
|
+ </template>
|
|
<el-table-column label="设备名称" prop="name" show-overflow-tooltip min-width="35%" />
|
|
<el-table-column label="设备名称" prop="name" show-overflow-tooltip min-width="35%" />
|
|
<el-table-column label="安装位置" prop="name" show-overflow-tooltip min-width="25%" />
|
|
<el-table-column label="安装位置" prop="name" show-overflow-tooltip min-width="25%" />
|
|
<el-table-column label="设备类型" prop="name" show-overflow-tooltip min-width="25%" >
|
|
<el-table-column label="设备类型" prop="name" show-overflow-tooltip min-width="25%" >
|
|
@@ -13,39 +17,79 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
|
|
+ <!-- <el-table ref="initList" :data="videoSelect" height="200" @row-click="clickData" highlight-current-row @cell-mouse-enter="mouseEnter" @cell-mouse-leave="mouseLeave" v-if="select2">
|
|
|
|
+ <el-table-column label="设备名称" prop="name" show-overflow-tooltip min-width="35%" />
|
|
|
|
+ <el-table-column label="安装位置" prop="name" show-overflow-tooltip min-width="25%" />
|
|
|
|
+ <el-table-column label="设备类型" prop="name" show-overflow-tooltip min-width="25%" >
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ {{scope.row.unitType == "1" ? "摄像头" : scope.row.unitType == "2" ? "打印机" : scope.row.unitType == "3" ? "考勤机" : scope.row.unitType == "4" ? "人脸识别终端" : ""}}
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="状态" prop="status" min-width="15%">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span :class="scope.row.status == '0' ? 'handle2' : 'untreated2'">{{scope.row.status == "0" ? "在线" : "离线" }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table> -->
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import axios from 'axios'
|
|
import axios from 'axios'
|
|
export default {
|
|
export default {
|
|
|
|
+ // props: ["select"],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
table_interval:null,
|
|
table_interval:null,
|
|
- videoSelect:[]
|
|
|
|
|
|
+ videoSelect:[],
|
|
|
|
+ value:undefined,
|
|
|
|
+ select1:true,
|
|
|
|
+ select2:false,
|
|
|
|
+ text:"",
|
|
|
|
+ loading:true,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created(){
|
|
created(){
|
|
- this.initData();
|
|
|
|
|
|
+ this.initDataVideo()
|
|
|
|
+ // this.selectChange()
|
|
},
|
|
},
|
|
|
|
+ // watch: {
|
|
|
|
+ // select: {
|
|
|
|
+ // handler (n, o) {
|
|
|
|
+ // this.selectChange()
|
|
|
|
+ // },
|
|
|
|
+ // deep: true // 深度监听父组件传过来对象变化
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
mounted() {},
|
|
mounted() {},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ selectChange(){
|
|
|
|
+ if(this.select == "1"){
|
|
|
|
+ this.initDataVideo()
|
|
|
|
+ }
|
|
|
|
+ if(this.select == "2"){
|
|
|
|
+ this.initDataSBSS()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
//初始化数据
|
|
//初始化数据
|
|
-
|
|
|
|
- initData() {
|
|
|
|
- let arr1 =
|
|
|
|
|
|
+ initDataVideo() {
|
|
|
|
+ this.select1 = false
|
|
|
|
+ this.select1 = true
|
|
|
|
+ this.videoSelect = []
|
|
|
|
+ let arr1 =
|
|
{
|
|
{
|
|
"unitType": "2",
|
|
"unitType": "2",
|
|
"cameraFunctions": 0,
|
|
"cameraFunctions": 0,
|
|
"name": "8楼公共打印机",
|
|
"name": "8楼公共打印机",
|
|
"status": 0,
|
|
"status": 0,
|
|
}
|
|
}
|
|
- let arr2 =
|
|
|
|
|
|
+ let arr2 =
|
|
{
|
|
{
|
|
"unitType": "3",
|
|
"unitType": "3",
|
|
"cameraFunctions": 0,
|
|
"cameraFunctions": 0,
|
|
"name": "考勤机",
|
|
"name": "考勤机",
|
|
"status": 0,
|
|
"status": 0,
|
|
}
|
|
}
|
|
- let arr3 =
|
|
|
|
|
|
+ let arr3 =
|
|
{
|
|
{
|
|
"unitType": "4",
|
|
"unitType": "4",
|
|
"cameraFunctions": 0,
|
|
"cameraFunctions": 0,
|
|
@@ -54,7 +98,7 @@ export default {
|
|
}
|
|
}
|
|
axios({
|
|
axios({
|
|
method: 'post',
|
|
method: 'post',
|
|
- url: 'http://10.21.39.1:8082/dhController/getLocalChannel?pageNo=1&pageSize=10&unitType=1&name=1F',
|
|
|
|
|
|
+ url: 'http://10.21.39.1:8082/dhController/getLocalChannel?pageNo=1&pageSize=500&unitType=1',
|
|
timeout: 3000,
|
|
timeout: 3000,
|
|
}).then(res =>{
|
|
}).then(res =>{
|
|
if(res.data.data.pageList){
|
|
if(res.data.data.pageList){
|
|
@@ -68,8 +112,18 @@ export default {
|
|
this.videoSelect.push(arr2)
|
|
this.videoSelect.push(arr2)
|
|
this.videoSelect.push(arr3)
|
|
this.videoSelect.push(arr3)
|
|
}
|
|
}
|
|
|
|
+ this.loading = false
|
|
|
|
+ this.text = "暂无数据"
|
|
|
|
+ }).catch(err =>{
|
|
|
|
+ this.loading = false
|
|
|
|
+ this.text = "数据加载失败..."
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ initDataSBSS(){
|
|
|
|
+ this.select2 = true
|
|
|
|
+ this.select1 = false
|
|
|
|
+ this.videoSelect = []
|
|
|
|
+ },
|
|
//数据滚动
|
|
//数据滚动
|
|
dataScrolling:function(){
|
|
dataScrolling:function(){
|
|
let top=this.$refs.initList.bodyWrapper;
|
|
let top=this.$refs.initList.bodyWrapper;
|
|
@@ -91,7 +145,9 @@ export default {
|
|
},
|
|
},
|
|
//点击行
|
|
//点击行
|
|
clickData(row){
|
|
clickData(row){
|
|
- this.$emit("videoClick", row);
|
|
|
|
|
|
+ if(this.select1 == "1"){
|
|
|
|
+ this.$emit("videoClick", row);
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// cellStyle (row, column, rowIndex, columnIndex) {
|
|
// cellStyle (row, column, rowIndex, columnIndex) {
|
|
// //列的label的名称
|
|
// //列的label的名称
|
|
@@ -120,4 +176,4 @@ export default {
|
|
background: $modularBackGround;//滚动条背景色
|
|
background: $modularBackGround;//滚动条背景色
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-</style>
|
|
|
|
|
|
+</style>
|