|
@@ -3,42 +3,9 @@
|
|
|
<el-breadcrumb separator-class="el-icon-arrow-right">
|
|
<el-breadcrumb separator-class="el-icon-arrow-right">
|
|
|
<el-breadcrumb-item>虫情测报</el-breadcrumb-item>
|
|
<el-breadcrumb-item>虫情测报</el-breadcrumb-item>
|
|
|
</el-breadcrumb>
|
|
</el-breadcrumb>
|
|
|
- <search-bar @fun="getDisplayType" @fun2="getIDName" @fun3="getIsOnline">
|
|
|
|
|
- <template slot="search-box">
|
|
|
|
|
- <template v-if="role=='admin'">
|
|
|
|
|
- <el-select
|
|
|
|
|
- v-model="queryInfo.dver"
|
|
|
|
|
- class="select01"
|
|
|
|
|
- clearable
|
|
|
|
|
- size="mini"
|
|
|
|
|
- placeholder="请选择设备版本"
|
|
|
|
|
- @change="searchChange()"
|
|
|
|
|
- >
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="item in dverGather"
|
|
|
|
|
- :key="item.value"
|
|
|
|
|
- :label="item.label"
|
|
|
|
|
- :value="item.value"
|
|
|
|
|
- ></el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </template>
|
|
|
|
|
- <!-- <template v-if="role=='admin'">
|
|
|
|
|
- <el-select
|
|
|
|
|
- v-model="queryInfo.selectUser"
|
|
|
|
|
- class="select01"
|
|
|
|
|
- clearable
|
|
|
|
|
- size="mini"
|
|
|
|
|
- filterable
|
|
|
|
|
- placeholder="请选择用户"
|
|
|
|
|
- @change="searchChange()"
|
|
|
|
|
- >
|
|
|
|
|
- <el-option v-for="item in userList" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </template> -->
|
|
|
|
|
- </template>
|
|
|
|
|
- </search-bar>
|
|
|
|
|
|
|
+ <search-bar @fun="getDisplayType" @fun2="getIDName" @fun3="getIsOnline"></search-bar>
|
|
|
<template v-if="displayType==1">
|
|
<template v-if="displayType==1">
|
|
|
- <el-row :gutter="10">
|
|
|
|
|
|
|
+ <el-row :gutter="10" v-loading="tableLoading">
|
|
|
<el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="6" v-for="item in equipList" :key="item.imei">
|
|
<el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="6" v-for="item in equipList" :key="item.imei">
|
|
|
<el-card class="box-card">
|
|
<el-card class="box-card">
|
|
|
<equip-item :is_online="item.device_status">
|
|
<equip-item :is_online="item.device_status">
|
|
@@ -66,7 +33,7 @@
|
|
|
</p>
|
|
</p>
|
|
|
<p>
|
|
<p>
|
|
|
<i class="iconfont icon-shijian"></i>
|
|
<i class="iconfont icon-shijian"></i>
|
|
|
- 最新上报时间 : {{item.status_time*1000 | formatTime}}
|
|
|
|
|
|
|
+ 最新上报时间 : {{item.status_time}}
|
|
|
</p>
|
|
</p>
|
|
|
<p>
|
|
<p>
|
|
|
<i class="iconfont icon-dizhi"></i>
|
|
<i class="iconfont icon-dizhi"></i>
|
|
@@ -86,10 +53,10 @@
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-if="displayType==2">
|
|
<template v-if="displayType==2">
|
|
|
- <el-card class="box-card">
|
|
|
|
|
|
|
+ <el-card class="box-card" v-loading="tableLoading">
|
|
|
<el-table :data="equipList" stripe style="width: 100%">
|
|
<el-table :data="equipList" stripe style="width: 100%">
|
|
|
<el-table-column prop="device_id" label="设备ID" width="180">
|
|
<el-table-column prop="device_id" label="设备ID" width="180">
|
|
|
- <template slot-scope="scope">{{scope.row.device_id.slice(-8)}}</template>
|
|
|
|
|
|
|
+ <template slot-scope="scope">{{scope.row.device_id}}</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column prop="device_name" label="设备名称" width="180">
|
|
<el-table-column prop="device_name" label="设备名称" width="180">
|
|
|
<template slot-scope="scope">{{scope.row.device_name==""?"无":scope.row.device_name}}</template>
|
|
<template slot-scope="scope">{{scope.row.device_name==""?"无":scope.row.device_name}}</template>
|
|
@@ -100,9 +67,9 @@
|
|
|
<p style="color:#eb6765" v-if="scope.row.device_status==0">离线</p>
|
|
<p style="color:#eb6765" v-if="scope.row.device_status==0">离线</p>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column prop="dver_num" label="设备版本"></el-table-column>
|
|
|
|
|
|
|
+ <el-table-column prop="address" label="地址"></el-table-column>
|
|
|
<el-table-column prop="status_time" label="最新上报时间">
|
|
<el-table-column prop="status_time" label="最新上报时间">
|
|
|
- <template slot-scope="scope">{{scope.row.status_time*1000 | formatTime}}</template>
|
|
|
|
|
|
|
+ <template slot-scope="scope">{{scope.row.status_time}}</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" width="400">
|
|
<el-table-column label="操作" width="400">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
@@ -283,20 +250,8 @@ export default {
|
|
|
displayType: '1',
|
|
displayType: '1',
|
|
|
//设备列表
|
|
//设备列表
|
|
|
equipList: [],
|
|
equipList: [],
|
|
|
- role: 'admin',
|
|
|
|
|
- dverGather: [
|
|
|
|
|
- { label: '全部', value: '' },
|
|
|
|
|
- { label: '版本1', value: '1' },
|
|
|
|
|
- { label: '版本2', value: '2' },
|
|
|
|
|
- { label: '版本3', value: '3' },
|
|
|
|
|
- { label: '版本4', value: '4' },
|
|
|
|
|
- { label: '版本5', value: '5' }
|
|
|
|
|
- ],
|
|
|
|
|
- userList: [
|
|
|
|
|
- { label: '用户1', value: '用户1' },
|
|
|
|
|
- { label: '用户2', value: '用户2' }
|
|
|
|
|
- ],
|
|
|
|
|
- d_id: '',
|
|
|
|
|
|
|
+ // 设备加载loading
|
|
|
|
|
+ tableLoading : true,
|
|
|
device_id: '',
|
|
device_id: '',
|
|
|
ws: 0, //工作模式
|
|
ws: 0, //工作模式
|
|
|
equipContrlForm: {
|
|
equipContrlForm: {
|
|
@@ -315,9 +270,7 @@ export default {
|
|
|
//参数
|
|
//参数
|
|
|
queryInfo: {
|
|
queryInfo: {
|
|
|
page: 1,
|
|
page: 1,
|
|
|
- is_online: null,
|
|
|
|
|
- dver: null,
|
|
|
|
|
- selectUser: '',
|
|
|
|
|
|
|
+ is_online: '',
|
|
|
f_id: '',
|
|
f_id: '',
|
|
|
ename: ''
|
|
ename: ''
|
|
|
},
|
|
},
|
|
@@ -355,20 +308,31 @@ export default {
|
|
|
getEquipList() {
|
|
getEquipList() {
|
|
|
this.$axios({
|
|
this.$axios({
|
|
|
method: 'POST',
|
|
method: 'POST',
|
|
|
- url: '/api/api_gateway?method=forecast.worm_lamp.lamp_list',
|
|
|
|
|
|
|
+ url: '/api/equipmanage_cbd',
|
|
|
data: this.qs.stringify({
|
|
data: this.qs.stringify({
|
|
|
- device_type_id: 3,
|
|
|
|
|
- page_size: 8,
|
|
|
|
|
|
|
+ req: 'filter',
|
|
|
page: this.queryInfo.page,
|
|
page: this.queryInfo.page,
|
|
|
- device_status: this.queryInfo.is_online,
|
|
|
|
|
- device_name: this.queryInfo.ename,
|
|
|
|
|
- device_id: this.queryInfo.f_id,
|
|
|
|
|
- dver_num: this.queryInfo.dver
|
|
|
|
|
|
|
+ is_online: this.queryInfo.is_online,
|
|
|
|
|
+ ename: this.queryInfo.ename,
|
|
|
|
|
+ f_id: this.queryInfo.f_id,
|
|
|
|
|
+ dver: this.queryInfo.dver,
|
|
|
})
|
|
})
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
- if (res.data.message == '') {
|
|
|
|
|
- this.equipList = res.data.data.data
|
|
|
|
|
- this.totalNum = res.data.data.counts
|
|
|
|
|
|
|
+ this.tableLoading = false;
|
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
|
+ var dataArr = [];
|
|
|
|
|
+ var dat = res.data.dat;
|
|
|
|
|
+ for(var i = 0;i<dat.length;i++){
|
|
|
|
|
+ dataArr.push({
|
|
|
|
|
+ address: dat[i].locat,
|
|
|
|
|
+ device_id: dat[i].equip_id,
|
|
|
|
|
+ device_name: dat[i].equip_name,
|
|
|
|
|
+ device_status: parseInt(dat[i].is_online),
|
|
|
|
|
+ status_time: dat[i].upl_time,
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ this.equipList = dataArr
|
|
|
|
|
+ this.totalNum = res.data.nums
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
@@ -488,13 +452,6 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- // 设备版本、用户筛选
|
|
|
|
|
- searchChange() {
|
|
|
|
|
- console.log(this.queryInfo.selectUser)
|
|
|
|
|
- this.getEquipList()
|
|
|
|
|
- },
|
|
|
|
|
},
|
|
},
|
|
|
components: {
|
|
components: {
|
|
|
SearchBar,
|
|
SearchBar,
|