|
@@ -85,7 +85,7 @@
|
|
|
:class="{ emptyhistory: historyData.length === 0 }"
|
|
|
class="historycontainer"
|
|
|
>
|
|
|
- <template v-if="historyData.length > 0">
|
|
|
+ <template v-if="historyData && historyData.length > 0">
|
|
|
<u-list-item
|
|
|
class="itemback"
|
|
|
v-for="(item, index) in historyData"
|
|
@@ -93,7 +93,7 @@
|
|
|
>
|
|
|
<u-row gutter="5" customStyle="margin-bottom: 10px">
|
|
|
<u-col span="24">
|
|
|
- <u--text :text="item.ginstallpos"></u--text>
|
|
|
+ <u--text :text="item.ginstallpos || item.devicePos"></u--text>
|
|
|
</u-col>
|
|
|
</u-row>
|
|
|
<u-row gutter="5" customStyle="margin-bottom: 10px">
|
|
@@ -118,21 +118,18 @@
|
|
|
<u-col span="2"> </u-col>
|
|
|
<u-col span="3"> </u-col>
|
|
|
<u-col span="5">
|
|
|
- <u--text class="timetext" :text="item.ttime"></u--text>
|
|
|
+ <u--text
|
|
|
+ class="timetext"
|
|
|
+ :text="item.time || item.ttime"
|
|
|
+ ></u--text>
|
|
|
</u-col>
|
|
|
</u-row>
|
|
|
- <view
|
|
|
- style="
|
|
|
- display: flex;
|
|
|
- flex-wrap: wrap;
|
|
|
- justify-content: space-between;
|
|
|
- "
|
|
|
- >
|
|
|
+ <view style="display: flex; flex-wrap: wrap">
|
|
|
<view
|
|
|
class="datacard"
|
|
|
v-for="(showitem, index) in deviceShowList"
|
|
|
:key="index"
|
|
|
- v-show="showitem.appShow == 1"
|
|
|
+ v-if="showitem.appShow == 1"
|
|
|
>
|
|
|
<view
|
|
|
:class="TabCur"
|
|
@@ -146,10 +143,7 @@
|
|
|
"
|
|
|
>
|
|
|
<view
|
|
|
- v-if="
|
|
|
- showitem.datatype == 1 &&
|
|
|
- showitem.monitorcode == 'doorUse'
|
|
|
- "
|
|
|
+ v-if="showitem.monitorcode == 'doorUse'"
|
|
|
class="demo-layout bg-purple-light"
|
|
|
style="
|
|
|
margin-top: 10rpx;
|
|
@@ -167,44 +161,7 @@
|
|
|
}}
|
|
|
</view>
|
|
|
<view
|
|
|
- v-else-if="showitem.datatype == 1"
|
|
|
- class="demo-layout bg-purple-light"
|
|
|
- style="
|
|
|
- margin-top: 10rpx;
|
|
|
- color: #3787fe;
|
|
|
- font-size: 30rpx;
|
|
|
- margin-top: 20rpx;
|
|
|
- "
|
|
|
- >
|
|
|
- {{
|
|
|
- item[showitem.monitorcode] == null ||
|
|
|
- item[showitem.monitorcode] == ""
|
|
|
- ? "-"
|
|
|
- : item[showitem.monitorcode]
|
|
|
- }}
|
|
|
- </view>
|
|
|
- <view
|
|
|
- v-else-if="
|
|
|
- showitem.datatype == 2 && stationType != 'redis'
|
|
|
- "
|
|
|
- class="demo-layout bg-purple-light"
|
|
|
- style="
|
|
|
- color: #3787fe;
|
|
|
- font-size: 30rpx;
|
|
|
- margin-top: 20rpx;
|
|
|
- "
|
|
|
- >
|
|
|
- {{
|
|
|
- item.readData[showitem.monitorcode] == null ||
|
|
|
- item.readData[showitem.monitorcode] == ""
|
|
|
- ? "-"
|
|
|
- : item.readData[showitem.monitorcode]
|
|
|
- }}
|
|
|
- </view>
|
|
|
- <view
|
|
|
- v-else-if="
|
|
|
- showitem.datatype == 2 && stationType == 'redis'
|
|
|
- "
|
|
|
+ v-else
|
|
|
class="demo-layout bg-purple-light"
|
|
|
style="
|
|
|
color: #3787fe;
|
|
@@ -327,7 +284,7 @@ export default {
|
|
|
],
|
|
|
],
|
|
|
deviceID: "", //设备ID
|
|
|
- //deviceType: "", //设备类型
|
|
|
+ deviceType1: "", //设备类型
|
|
|
skip: 8, //时间间隔
|
|
|
interval: "1h", //时间间隔
|
|
|
dataTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
|
|
@@ -393,7 +350,6 @@ export default {
|
|
|
if (response.data.code == 200) {
|
|
|
this.deviceList[type] = response.data.result.msgTxt[0].datalist;
|
|
|
this.curlist = this.deviceList[type];
|
|
|
- console.log(this.curlist, "设备列表");
|
|
|
this.setData(this.curlist);
|
|
|
} else {
|
|
|
resolve(response);
|
|
@@ -409,10 +365,10 @@ export default {
|
|
|
this.devices = [];
|
|
|
data.forEach((element) => {
|
|
|
const deviceObj = {
|
|
|
- id: element.deviceID,
|
|
|
+ id: element.deviceId ? element.deviceId : element.deviceID,
|
|
|
strinstallpos: element.strinstallpos,
|
|
|
type: element.deviceType,
|
|
|
- stationType: element.stationType,
|
|
|
+ stationtype: element.stationtype,
|
|
|
strtype: element.strtype,
|
|
|
};
|
|
|
this.devices.push(deviceObj);
|
|
@@ -421,9 +377,9 @@ export default {
|
|
|
//选择设备 点击确定按钮 保存id
|
|
|
selectDevice(e) {
|
|
|
this.deviceID = e.value[0].id;
|
|
|
- this.stationType = e.value[0].stationType;
|
|
|
+ this.stationType = e.value[0].stationtype;
|
|
|
this.strType = e.value[0].strtype;
|
|
|
- // console.log(this.TabCur, "设备类型");
|
|
|
+ this.deviceType1 = e.value[0].type;
|
|
|
this.deviceName = e.value[0].strinstallpos;
|
|
|
this.deviceShow = false;
|
|
|
},
|
|
@@ -460,6 +416,7 @@ export default {
|
|
|
} else {
|
|
|
this.getHistoryData2();
|
|
|
}
|
|
|
+ // this.getHistoryData2();
|
|
|
},
|
|
|
// 查询历史数据
|
|
|
getHistoryData() {
|
|
@@ -478,26 +435,11 @@ export default {
|
|
|
.then((response) => {
|
|
|
if (response.data.code == 200) {
|
|
|
const infolist = response.data.result;
|
|
|
- this.historyData = infolist.datalist.records;
|
|
|
- // console.log(this.historyData, "111111111111111111");
|
|
|
- // this.historyData.forEach((item) => {
|
|
|
- // if (item.readData.frontGateOpen == 1) {
|
|
|
- // item.readData.frontGateOpen = "打开";
|
|
|
- // } else {
|
|
|
- // item.readData.frontGateOpen = "关闭";
|
|
|
- // }
|
|
|
- // if (item.readData.rearGateOpen == 1) {
|
|
|
- // item.readData.rearGateOpen = "打开";
|
|
|
- // 1;
|
|
|
- // } else {
|
|
|
- // item.readData.rearGateOpen = "关闭";
|
|
|
- // }
|
|
|
- // if (item.readData.midGateOpen == 1) {
|
|
|
- // item.readData.midGateOpen = "打开";
|
|
|
- // } else {
|
|
|
- // item.readData.midGateOpen = "关闭";
|
|
|
- // }
|
|
|
- // });
|
|
|
+ const result = infolist.datalist.records;
|
|
|
+ result.forEach((item) => {
|
|
|
+ const newData = { ...item, ...item.readData };
|
|
|
+ this.historyData.push(newData);
|
|
|
+ });
|
|
|
this.pageNo = response.data.result.datalist.current;
|
|
|
} else {
|
|
|
resolve(response);
|
|
@@ -510,41 +452,22 @@ export default {
|
|
|
},
|
|
|
getHistoryData2() {
|
|
|
const params = {
|
|
|
- column: "createTime",
|
|
|
startTime: this.StartTime,
|
|
|
- endTIme: this.EndTime,
|
|
|
+ endTime: this.EndTime,
|
|
|
deviceId: this.deviceID,
|
|
|
interval: this.interval,
|
|
|
- isEmployee: true,
|
|
|
- pageNo: 1,
|
|
|
+ isEmployee: this.TabCur.startsWith("vehicle") ? false : true,
|
|
|
+ pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- strtype: this.strType,
|
|
|
+ strtype: this.TabCur + "*",
|
|
|
};
|
|
|
new Promise((resolve, reject) => {
|
|
|
api
|
|
|
.getDeviceHistory2(params)
|
|
|
.then((response) => {
|
|
|
if (response.data.code == 200) {
|
|
|
- const infolist = response.data.result;
|
|
|
- this.historyData = infolist.records;
|
|
|
- // this.historyData.forEach((item) => {
|
|
|
- // if (item.readData.frontGateOpen == 1) {
|
|
|
- // item.readData.frontGateOpen = "打开";
|
|
|
- // } else {
|
|
|
- // item.readData.frontGateOpen = "关闭";
|
|
|
- // }
|
|
|
- // if (item.readData.rearGateOpen == 1) {
|
|
|
- // item.readData.rearGateOpen = "打开";
|
|
|
- // } else {
|
|
|
- // item.readData.rearGateOpen = "关闭";
|
|
|
- // }
|
|
|
- // if (item.readData.midGateOpen == 1) {
|
|
|
- // item.readData.midGateOpen = "打开";
|
|
|
- // } else {
|
|
|
- // item.readData.midGateOpen = "关闭";
|
|
|
- // }
|
|
|
- // });
|
|
|
- this.pageNo = response.data.result.datalist.current;
|
|
|
+ this.historyData = response.data.result.records;
|
|
|
+ // this.pageNo = response.data.result.datalist.current;
|
|
|
} else {
|
|
|
resolve(response);
|
|
|
}
|