|
|
@ -19,20 +19,22 @@
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
|
|
|
|
class="rightbtn"
|
|
|
|
v-if="msgTitle == '设备类型实时数据'"
|
|
|
|
v-if="msgTitle == '设备类型实时数据'"
|
|
|
|
@click="exporTypeData"
|
|
|
|
@click="exporTypeData"
|
|
|
|
type="primary"
|
|
|
|
type="primary"
|
|
|
|
style="margin-left: 16px"
|
|
|
|
style="margin-left: 16px"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
按设备类型导出
|
|
|
|
导出
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
v-else
|
|
|
|
v-else
|
|
|
|
|
|
|
|
class="rightbtn"
|
|
|
|
@click="exporZsbData"
|
|
|
|
@click="exporZsbData"
|
|
|
|
type="primary"
|
|
|
|
type="primary"
|
|
|
|
style="margin-left: 16px"
|
|
|
|
style="margin-left: 16px"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
按主设备导出
|
|
|
|
导出
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
|
<el-drawer title="选择条件" :visible.sync="typedrawer" direction="ttb">
|
|
|
|
<el-drawer title="选择条件" :visible.sync="typedrawer" direction="ttb">
|
|
|
|
<div class="greyBox">
|
|
|
|
<div class="greyBox">
|
|
|
@ -117,10 +119,12 @@
|
|
|
|
>历史数据</el-button
|
|
|
|
>历史数据</el-button
|
|
|
|
>
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<el-tooltip placement="top-start">
|
|
|
|
<el-tooltip placement="bottom-start">
|
|
|
|
<div slot="content">
|
|
|
|
<div slot="content">
|
|
|
|
<div class="textitem">
|
|
|
|
<div class="textitem">
|
|
|
|
<h3 class="headTitle" :title="item.name">{{ item.name }}</h3>
|
|
|
|
<h3 class="headTitle" :title="item.name">
|
|
|
|
|
|
|
|
{{ item.jgName }}/{{ item.zsbName }}/{{ item.name }}
|
|
|
|
|
|
|
|
</h3>
|
|
|
|
<p>
|
|
|
|
<p>
|
|
|
|
采集时间:
|
|
|
|
采集时间:
|
|
|
|
<span v-if="item.lastData" class="timeclass">
|
|
|
|
<span v-if="item.lastData" class="timeclass">
|
|
|
@ -212,7 +216,7 @@ import {
|
|
|
|
zsbListAllApi,
|
|
|
|
zsbListAllApi,
|
|
|
|
monitoringListAllApi,
|
|
|
|
monitoringListAllApi,
|
|
|
|
// getDetailApi,
|
|
|
|
// getDetailApi,
|
|
|
|
modevtypeListAllApi,
|
|
|
|
getlistAllCountApi,
|
|
|
|
} from "@/utils/api/index";
|
|
|
|
} from "@/utils/api/index";
|
|
|
|
import historyDialog from "./components/historyDialog";
|
|
|
|
import historyDialog from "./components/historyDialog";
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
@ -221,6 +225,7 @@ export default {
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
msgTitle: "设备类型实时数据",
|
|
|
|
msgTitle: "设备类型实时数据",
|
|
|
|
|
|
|
|
deviceTitle: "",
|
|
|
|
typedrawer: false,
|
|
|
|
typedrawer: false,
|
|
|
|
areadrawer: false,
|
|
|
|
areadrawer: false,
|
|
|
|
deviceTypeVal: null,
|
|
|
|
deviceTypeVal: null,
|
|
|
@ -263,24 +268,32 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//获取所有的设备类型
|
|
|
|
//获取所有的设备类型
|
|
|
|
getdeviceTypeAll() {
|
|
|
|
getdeviceTypeAll() {
|
|
|
|
modevtypeListAllApi()
|
|
|
|
getlistAllCountApi()
|
|
|
|
.then((res) => {
|
|
|
|
.then((res) => {
|
|
|
|
console.log(res);
|
|
|
|
console.log(res);
|
|
|
|
this.deviceTypeList = res.data;
|
|
|
|
this.deviceTypeList = res.data.filter(
|
|
|
|
|
|
|
|
(item) => item.sensorCount !== 0
|
|
|
|
|
|
|
|
);
|
|
|
|
// 尝试从 localStorage 获取 areaVal
|
|
|
|
// 尝试从 localStorage 获取 areaVal
|
|
|
|
const storeddeviceTypeVal = localStorage.getItem("deviceTypeVal");
|
|
|
|
const storeddeviceTypeVal = localStorage.getItem("deviceTypeVal");
|
|
|
|
|
|
|
|
const deviceInfoVal = localStorage.getItem("deviceTitle");
|
|
|
|
if (storeddeviceTypeVal) {
|
|
|
|
if (storeddeviceTypeVal) {
|
|
|
|
// 如果 localStorage 中有 areaVal,则将其解析为数字(假设 id 是数字)并赋值给 this.areaVal
|
|
|
|
// 如果 localStorage 中有 areaVal,则将其解析为数字(假设 id 是数字)并赋值给 this.areaVal
|
|
|
|
this.areaVal = JSON.parse(storeddeviceTypeVal);
|
|
|
|
this.areaVal = JSON.parse(storeddeviceTypeVal);
|
|
|
|
|
|
|
|
this.deviceTitle = JSON.parse(deviceInfoVal);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// 否则,使用 res.data[0].id
|
|
|
|
// 否则,使用 res.data[0].id
|
|
|
|
this.deviceTypeVal = res.data[0]?.id; // 使用可选链操作符避免 res.data[0] 为 undefined 的情况
|
|
|
|
this.deviceTypeVal = res.data[0]?.id; // 使用可选链操作符避免 res.data[0] 为 undefined 的情况
|
|
|
|
|
|
|
|
this.deviceTitle = res.data[0].mc;
|
|
|
|
// 同时,将新获取的 areaVal 存储到 localStorage 中
|
|
|
|
// 同时,将新获取的 areaVal 存储到 localStorage 中
|
|
|
|
localStorage.setItem(
|
|
|
|
localStorage.setItem(
|
|
|
|
"deviceTypeVal",
|
|
|
|
"deviceTypeVal",
|
|
|
|
JSON.stringify(this.deviceTypeVal)
|
|
|
|
JSON.stringify(this.deviceTypeVal)
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
localStorage.setItem(
|
|
|
|
|
|
|
|
"deviceTitle",
|
|
|
|
|
|
|
|
JSON.stringify(this.deviceTitle)
|
|
|
|
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.getTypeAllList();
|
|
|
|
this.getTypeAllList();
|
|
|
|
this.startIntervalIfNeededType();
|
|
|
|
this.startIntervalIfNeededType();
|
|
|
@ -292,8 +305,12 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handletypeChange(value) {
|
|
|
|
handletypeChange(value) {
|
|
|
|
this.deviceTypeVal = value;
|
|
|
|
this.deviceTypeVal = value;
|
|
|
|
|
|
|
|
const typeArr = this.deviceTypeList.find((item) => item.id === value);
|
|
|
|
|
|
|
|
console.log(typeArr.mc);
|
|
|
|
|
|
|
|
this.deviceTitle = typeArr.mc;
|
|
|
|
localStorage.removeItem("deviceTypeVal");
|
|
|
|
localStorage.removeItem("deviceTypeVal");
|
|
|
|
localStorage.setItem("deviceTypeVal", JSON.stringify(value));
|
|
|
|
localStorage.setItem("deviceTypeVal", JSON.stringify(value));
|
|
|
|
|
|
|
|
localStorage.setItem("deviceTitle", JSON.stringify(typeArr.mc));
|
|
|
|
this.jksbAllList = [];
|
|
|
|
this.jksbAllList = [];
|
|
|
|
this.getTypeAllList();
|
|
|
|
this.getTypeAllList();
|
|
|
|
this.startIntervalIfNeededType();
|
|
|
|
this.startIntervalIfNeededType();
|
|
|
@ -401,6 +418,7 @@ export default {
|
|
|
|
handlezsbChange(value) {
|
|
|
|
handlezsbChange(value) {
|
|
|
|
this.zsbVal = value;
|
|
|
|
this.zsbVal = value;
|
|
|
|
localStorage.setItem("zsbVal", JSON.stringify(value));
|
|
|
|
localStorage.setItem("zsbVal", JSON.stringify(value));
|
|
|
|
|
|
|
|
|
|
|
|
// 调用 getjcsbAllList 方法获取监测设备列表
|
|
|
|
// 调用 getjcsbAllList 方法获取监测设备列表
|
|
|
|
this.getjcsbAllList();
|
|
|
|
this.getjcsbAllList();
|
|
|
|
|
|
|
|
|
|
|
@ -464,6 +482,9 @@ export default {
|
|
|
|
margin: 10px 0px;
|
|
|
|
margin: 10px 0px;
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
.rightbtn {
|
|
|
|
|
|
|
|
margin-left: auto !important;
|
|
|
|
|
|
|
|
}
|
|
|
|
.el-drawer__wrapper {
|
|
|
|
.el-drawer__wrapper {
|
|
|
|
.el-drawer__header {
|
|
|
|
.el-drawer__header {
|
|
|
|
margin-bottom: 14px;
|
|
|
|
margin-bottom: 14px;
|
|
|
|