|
|
@@ -3,7 +3,7 @@
|
|
|
<div class="cbdbox">
|
|
|
<div class="cbdboxs_search">
|
|
|
<el-input v-model="idinput" placeholder="请输入设备ID"></el-input>
|
|
|
- <el-select v-model="inoffvalue" placeholder="请选择在线状态">
|
|
|
+ <el-select v-model="inoffvalue" placeholder="请选择所在监测点">
|
|
|
<el-option
|
|
|
v-for="item in inoffoptions"
|
|
|
:key="item.value"
|
|
|
@@ -12,7 +12,7 @@
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
- <el-select v-model="versionsvalue" placeholder="请选择设备版本">
|
|
|
+ <el-select v-model="versionsvalue" placeholder="请选择组织">
|
|
|
<el-option
|
|
|
v-for="item in versionsoptions"
|
|
|
:key="item.value"
|
|
|
@@ -21,75 +21,59 @@
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
- <el-button type="primary" @click="search">搜索</el-button>
|
|
|
+ <el-select v-model="versionsvalue" placeholder="请选择诱捕器">
|
|
|
+ <el-option
|
|
|
+ v-for="item in versionsoptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-button type="info" @click="search">搜索</el-button>
|
|
|
<el-button>重置</el-button>
|
|
|
+ <el-button type="info">添加诱捕器</el-button>
|
|
|
+ <el-button type="info">批量导入诱捕器</el-button>
|
|
|
+ <el-button type="info">导出数据</el-button>
|
|
|
</div>
|
|
|
<div class="cbdboxs_table" v-loading="loading">
|
|
|
<el-table :data="tableData" style="width: 100%" :stripe="true">
|
|
|
<el-table-column prop="index" label="序号"> </el-table-column>
|
|
|
- <el-table-column prop="device_name" label="设备名称">
|
|
|
- <template slot-scope="scope">
|
|
|
- <p>
|
|
|
- {{ scope.row.device_name == "" ? "--" : scope.row.device_name }}
|
|
|
- </p>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="imei" label="设备ID"></el-table-column>
|
|
|
- <el-table-column prop="is_online" label="在线状态">
|
|
|
- <template slot-scope="scope">
|
|
|
- <p>{{ scope.row.is_online == 1 ? "在线" : "离线" }}</p>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="dver_num" label="设备版本">
|
|
|
- <template slot-scope="scope">
|
|
|
- <p>{{ scope.row.dver_num == "" ? "--" : scope.row.dver_num }}</p>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="uptime" label="最新上报时间">
|
|
|
- <template slot-scope="scope">{{
|
|
|
- (scope.row.uptime * 1000) | formatTime
|
|
|
- }}</template>
|
|
|
+ <el-table-column prop="trap_number" label="编号"></el-table-column>
|
|
|
+ <el-table-column prop="lng" label="经度"> </el-table-column>
|
|
|
+ <el-table-column prop="lat" label="纬度"> </el-table-column>
|
|
|
+ <el-table-column prop="org_name" label="组织"> </el-table-column>
|
|
|
+ <el-table-column prop="point_name" label="监测点"> </el-table-column>
|
|
|
+ <el-table-column prop="inducer_name" label="诱剂"> </el-table-column>
|
|
|
+ <el-table-column prop="create_time" label="添加时间" width="200">
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="address" label="地址">
|
|
|
+ <el-table-column prop="is_online" label="状态">
|
|
|
<template slot-scope="scope">
|
|
|
- <p>{{ scope.row.address == "" ? "--" : scope.row.address }}</p>
|
|
|
+ <p>·{{ scope.row.trap_status == "1" ? "正常" : "停用" }}</p>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" width="300">
|
|
|
<template slot-scope="scope">
|
|
|
<span
|
|
|
style="color: #409eff; margin-right: 5px"
|
|
|
- @click="
|
|
|
- viewPhotoDialog(
|
|
|
- scope.row.imei,
|
|
|
- scope.row.d_id,
|
|
|
- scope.row.device_name,
|
|
|
- scope.row.address
|
|
|
- )
|
|
|
- "
|
|
|
- >查看图片</span
|
|
|
+ @click="viewPhotoDialog(scope.row)"
|
|
|
+ >编辑</span
|
|
|
>
|
|
|
<span
|
|
|
style="color: #409eff; margin-right: 5px"
|
|
|
- @click="
|
|
|
- showTimeControlDialog(
|
|
|
- scope.row.d_id,
|
|
|
- scope.row.imei,
|
|
|
- scope.row.disable
|
|
|
- )
|
|
|
- "
|
|
|
- >害虫统计</span
|
|
|
- >
|
|
|
- <span
|
|
|
- style="color: #409eff; margin-right: 5px"
|
|
|
- @click="dataDetails(scope.row.imei, scope.row.d_id, scope.row)"
|
|
|
- >数据详情</span
|
|
|
+ @click="showTimeControlDialog(scope.row)"
|
|
|
+ >删除</span
|
|
|
>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
- <el-pagination background layout="prev, pager, next" :total="total" @current-change="pageChange">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ layout="prev, pager, next"
|
|
|
+ :total="total"
|
|
|
+ @current-change="pageChange"
|
|
|
+ >
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -127,8 +111,8 @@ export default {
|
|
|
},
|
|
|
tableData: [],
|
|
|
device_id: "",
|
|
|
- total:10,
|
|
|
- loading:false
|
|
|
+ total: 10,
|
|
|
+ loading: false,
|
|
|
};
|
|
|
},
|
|
|
//监听属性 类似于data概念
|
|
|
@@ -137,70 +121,40 @@ export default {
|
|
|
watch: {},
|
|
|
//方法集合
|
|
|
methods: {
|
|
|
- getcbdlist() {
|
|
|
- this.loading = true
|
|
|
+ getcbdlist() {//获取设备列表
|
|
|
+ this.loading = true;
|
|
|
this.$axios({
|
|
|
method: "POST",
|
|
|
- url: "/api/api_gateway?method=monitor_manage.cbd_manage.cbd_list",
|
|
|
+ url: "/api/api_gateway?method=monitor_manage.trap_manage.trap_list",
|
|
|
data: this.qs.stringify({
|
|
|
- device_type_id: 3,
|
|
|
page_size: 10,
|
|
|
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,
|
|
|
+ trap_number: this.queryInfo.f_id,
|
|
|
}),
|
|
|
}).then((res) => {
|
|
|
- this.loading = false
|
|
|
+ this.loading = false;
|
|
|
console.log(res.data.data);
|
|
|
- this.total = res.data.data.counts
|
|
|
- this.tableData = res.data.data.data;
|
|
|
+ this.total = res.data.data.total_item;
|
|
|
+ this.tableData = res.data.data.trap_data;
|
|
|
for (var i = 0; i < this.tableData.length; i++) {
|
|
|
this.tableData[i]["index"] = i + 1;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- viewPhotoDialog(id, d_id, name, addr) {
|
|
|
- this.device_id = id;
|
|
|
- this.$router.push({
|
|
|
- path: `/index/cbdDataPhotos/${id}`,
|
|
|
- query: { d_id: d_id, name: name, addr: addr },
|
|
|
+ getmon(){//获取监测点列表
|
|
|
+ this.$axios({
|
|
|
+ method: "POST",
|
|
|
+ url: "/api/api_gateway?method=monitor_manage.maintain.checkpoint_list",
|
|
|
+ }).then((res) => {
|
|
|
+ console.log(res.data.data);
|
|
|
});
|
|
|
},
|
|
|
- showTimeControlDialog(d_id, id, disable) {
|
|
|
- this.device_id = id;
|
|
|
- if (sessionStorage.getItem("myuser_type") == 1) {
|
|
|
- // 管理员
|
|
|
- this.$router.push({
|
|
|
- path: `/index/pestsStats/${d_id}/${id}`,
|
|
|
- query: { disable: disable },
|
|
|
- });
|
|
|
- } else {
|
|
|
- // 非管理员
|
|
|
- if (disable == 2) {
|
|
|
- // 计数
|
|
|
- this.$router.push({
|
|
|
- path: `/index/PestsStatsNumber/${d_id}/${id}`,
|
|
|
- query: { disable: disable },
|
|
|
- });
|
|
|
- } else if (disable == 1 || disable == 0) {
|
|
|
- // 识别开启或关闭
|
|
|
- this.$router.push({
|
|
|
- path: `/index/pestsStats/${d_id}/${id}`,
|
|
|
- query: { disable: disable },
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- dataDetails(e_id, d_id, data) {
|
|
|
- this.device_id = e_id;
|
|
|
- this.$router.push({
|
|
|
- path: `/index/cbdDataDetails/${e_id}/${d_id}`,
|
|
|
- query: {
|
|
|
- addr: data.address,
|
|
|
- name: data.device_name,
|
|
|
- },
|
|
|
+ getorgin(){//获取组织列表
|
|
|
+ this.$axios({
|
|
|
+ method: "POST",
|
|
|
+ url: "/api/api_gateway?method=sysmenage.usermanager.org_list",
|
|
|
+ }).then((res) => {
|
|
|
+ console.log(res.data.data);
|
|
|
});
|
|
|
},
|
|
|
search() {
|
|
|
@@ -210,11 +164,11 @@ export default {
|
|
|
// console.log(this.inoffvalue,this.versionsvalue)
|
|
|
this.getcbdlist();
|
|
|
},
|
|
|
- pageChange(e){
|
|
|
+ pageChange(e) {
|
|
|
// console.log(e)
|
|
|
- this.queryInfo.page = e
|
|
|
+ this.queryInfo.page = e;
|
|
|
this.getcbdlist();
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
beforeCreate() {}, //生命周期 - 创建之前
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
@@ -222,6 +176,8 @@ export default {
|
|
|
beforeMount() {}, //生命周期 - 挂载之前
|
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted() {
|
|
|
+ this.getmon()
|
|
|
+ this.getorgin()
|
|
|
this.getcbdlist();
|
|
|
},
|
|
|
beforeUpdate() {}, //生命周期 - 更新之前
|
|
|
@@ -237,11 +193,11 @@ export default {
|
|
|
justify-content: flex-start;
|
|
|
height: 40px;
|
|
|
.el-select {
|
|
|
- width: 300px;
|
|
|
+ width: 250px;
|
|
|
margin-right: 15px;
|
|
|
}
|
|
|
.el-input {
|
|
|
- width: 300px;
|
|
|
+ width: 250px;
|
|
|
margin-right: 15px;
|
|
|
}
|
|
|
}
|
|
|
@@ -253,4 +209,8 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+/deep/.el-button--info{
|
|
|
+ background-color: #409EFF;
|
|
|
+ border-color: #409EFF;
|
|
|
+}
|
|
|
</style>
|