|
@@ -41,6 +41,12 @@
|
|
:text="deviceName ? deviceName : '选择设备'"
|
|
:text="deviceName ? deviceName : '选择设备'"
|
|
@click="deviceShow = true"
|
|
@click="deviceShow = true"
|
|
></u-button>
|
|
></u-button>
|
|
|
|
+ <!-- <u-button
|
|
|
|
+ v-show="TabCur == 'fanmain' || TabCur == 'fanlocal'"
|
|
|
|
+ type="primary"
|
|
|
|
+ :text="labelName ? labelName : '子设备'"
|
|
|
|
+ @click="deviceShow1 = true"
|
|
|
|
+ ></u-button> -->
|
|
<u-button
|
|
<u-button
|
|
type="primary"
|
|
type="primary"
|
|
:text="lable ? lable : '间隔时间'"
|
|
:text="lable ? lable : '间隔时间'"
|
|
@@ -61,6 +67,13 @@
|
|
>
|
|
>
|
|
</u-picker>
|
|
</u-picker>
|
|
<u-picker
|
|
<u-picker
|
|
|
|
+ :show="deviceShow1"
|
|
|
|
+ :columns="devices1"
|
|
|
|
+ @cancel="deviceShow1 = false"
|
|
|
|
+ @confirm="selectDevice1"
|
|
|
|
+ keyName="label"
|
|
|
|
+ ></u-picker>
|
|
|
|
+ <u-picker
|
|
:show="show"
|
|
:show="show"
|
|
:columns="timeColumns"
|
|
:columns="timeColumns"
|
|
@cancel="show = false"
|
|
@cancel="show = false"
|
|
@@ -108,44 +121,82 @@
|
|
<u--text class="timetext" :text="item.ttime"></u--text>
|
|
<u--text class="timetext" :text="item.ttime"></u--text>
|
|
</u-col>
|
|
</u-col>
|
|
</u-row>
|
|
</u-row>
|
|
- <div
|
|
|
|
|
|
+ <view
|
|
class="datacard"
|
|
class="datacard"
|
|
- v-for="(showitem, index) in currentHistory"
|
|
|
|
- v-show="showitem.appshow == 1"
|
|
|
|
- :key="showitem.id + index"
|
|
|
|
|
|
+ v-for="(showitem, index) in deviceShowList"
|
|
|
|
+ :key="index"
|
|
|
|
+ v-show="showitem.appShow == 1"
|
|
>
|
|
>
|
|
- <div class="content">
|
|
|
|
|
|
+ <view
|
|
|
|
+ :class="TabCur"
|
|
|
|
+ style="
|
|
|
|
+ padding-top: 10rpx;
|
|
|
|
+ padding-bottom: 10rpx;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ align-items: center;
|
|
|
|
+ height: 100%;
|
|
|
|
+ "
|
|
|
|
+ >
|
|
|
|
+ <view
|
|
|
|
+ v-if="
|
|
|
|
+ showitem.datatype == 1 &&
|
|
|
|
+ showitem.monitorcode == 'doorUse'
|
|
|
|
+ "
|
|
|
|
+ class="demo-layout bg-purple-light"
|
|
|
|
+ style="
|
|
|
|
+ margin-top: 10rpx;
|
|
|
|
+ color: #3787fe;
|
|
|
|
+ font-size: 30rpx;
|
|
|
|
+ margin-top: 20rpx;
|
|
|
|
+ "
|
|
|
|
+ >
|
|
|
|
+ {{
|
|
|
|
+ item[showitem.monitorcode] == "2"
|
|
|
|
+ ? "行人"
|
|
|
|
+ : item[showitem.monitorcode] == "1"
|
|
|
|
+ ? "行车"
|
|
|
|
+ : "-"
|
|
|
|
+ }}
|
|
|
|
+ </view>
|
|
<view
|
|
<view
|
|
- v-if="showitem.datatype == 1"
|
|
|
|
|
|
+ v-else-if="showitem.datatype == 1"
|
|
class="demo-layout bg-purple-light"
|
|
class="demo-layout bg-purple-light"
|
|
- style="margin-top: 60rpx; color: #3787fe"
|
|
|
|
|
|
+ style="
|
|
|
|
+ margin-top: 10rpx;
|
|
|
|
+ color: #3787fe;
|
|
|
|
+ font-size: 30rpx;
|
|
|
|
+ margin-top: 20rpx;
|
|
|
|
+ "
|
|
>
|
|
>
|
|
{{
|
|
{{
|
|
item[showitem.monitorcode] == null ||
|
|
item[showitem.monitorcode] == null ||
|
|
item[showitem.monitorcode] == ""
|
|
item[showitem.monitorcode] == ""
|
|
- ? "--"
|
|
|
|
|
|
+ ? "-"
|
|
: item[showitem.monitorcode]
|
|
: item[showitem.monitorcode]
|
|
}}
|
|
}}
|
|
</view>
|
|
</view>
|
|
<view
|
|
<view
|
|
v-else-if="showitem.datatype == 2"
|
|
v-else-if="showitem.datatype == 2"
|
|
class="demo-layout bg-purple-light"
|
|
class="demo-layout bg-purple-light"
|
|
- style="margin-top: 60rpx; color: #3787fe"
|
|
|
|
|
|
+ style="color: #3787fe; font-size: 30rpx; margin-top: 20rpx"
|
|
>
|
|
>
|
|
{{
|
|
{{
|
|
- item.readData[showitem.monitorcode] == null ||
|
|
|
|
- item.readData[showitem.monitorcode] == ""
|
|
|
|
- ? "--"
|
|
|
|
- : item.readData[showitem.monitorcode]
|
|
|
|
|
|
+ item[showitem.monitorcode] == null ||
|
|
|
|
+ item[showitem.monitorcode] == ""
|
|
|
|
+ ? "-"
|
|
|
|
+ : item[showitem.monitorcode]
|
|
}}
|
|
}}
|
|
</view>
|
|
</view>
|
|
|
|
+
|
|
<view
|
|
<view
|
|
class="demo-layout bg-purple-light"
|
|
class="demo-layout bg-purple-light"
|
|
- style="color: #3787fe"
|
|
|
|
- >{{ showitem.des }}</view
|
|
|
|
|
|
+ style="margin-top: 20rpx; color: #677799; margin-top: 20rpx"
|
|
>
|
|
>
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ {{ showitem.des }}
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
</u-list-item>
|
|
</u-list-item>
|
|
</template>
|
|
</template>
|
|
<template v-else>
|
|
<template v-else>
|
|
@@ -174,12 +225,26 @@ export default {
|
|
endDate: null,
|
|
endDate: null,
|
|
show: false,
|
|
show: false,
|
|
deviceShow: false,
|
|
deviceShow: false,
|
|
|
|
+ deviceShow1: false,
|
|
dataShow: false,
|
|
dataShow: false,
|
|
dataShow1: false,
|
|
dataShow1: false,
|
|
StartTime: "", //起始时间
|
|
StartTime: "", //起始时间
|
|
EndTime: "", //结束时间
|
|
EndTime: "", //结束时间
|
|
devices: [], //设备类型数组
|
|
devices: [], //设备类型数组
|
|
|
|
+ devices1: [
|
|
|
|
+ [
|
|
|
|
+ {
|
|
|
|
+ label: "1#风机",
|
|
|
|
+ value: "fan1",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "2#风机",
|
|
|
|
+ value: "fan2",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ ], //子设备类型数组
|
|
deviceName: "", //设备名称
|
|
deviceName: "", //设备名称
|
|
|
|
+ labelName: "", //子设备名称
|
|
timeS: "", //间隔时间
|
|
timeS: "", //间隔时间
|
|
lable: "", //间隔时间
|
|
lable: "", //间隔时间
|
|
timeColumns: [
|
|
timeColumns: [
|
|
@@ -223,6 +288,7 @@ export default {
|
|
skip: 8, //时间间隔
|
|
skip: 8, //时间间隔
|
|
dataTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
|
|
dataTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
|
|
historyData: [], //历史数据
|
|
historyData: [], //历史数据
|
|
|
|
+ deviceShowList: [],
|
|
loading: false, // 是否正在加载数据
|
|
loading: false, // 是否正在加载数据
|
|
hasMoreData: true, // 是否还有更多数据可以加载
|
|
hasMoreData: true, // 是否还有更多数据可以加载
|
|
pageNo: 1, // 当前页码(用于请求数据时分页)
|
|
pageNo: 1, // 当前页码(用于请求数据时分页)
|
|
@@ -255,6 +321,8 @@ export default {
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.colums = this.showColum;
|
|
this.colums = this.showColum;
|
|
|
|
+ const key = this.TabCur + "_history";
|
|
|
|
+ this.deviceShowList = this.colums[key];
|
|
const startTime = new Date().getTime() - 3600 * 1000 * 24 * 30;
|
|
const startTime = new Date().getTime() - 3600 * 1000 * 24 * 30;
|
|
const endTime = new Date();
|
|
const endTime = new Date();
|
|
this.StartTime = dayjs(startTime).format("YYYY-MM-DD HH:mm:ss");
|
|
this.StartTime = dayjs(startTime).format("YYYY-MM-DD HH:mm:ss");
|
|
@@ -265,11 +333,7 @@ export default {
|
|
this.loadData(this.TabCur);
|
|
this.loadData(this.TabCur);
|
|
},
|
|
},
|
|
|
|
|
|
- computed: {
|
|
|
|
- currentHistory() {
|
|
|
|
- return this.colums[this.TabCur + "_history"] || [];
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
|
|
+ computed: {},
|
|
methods: {
|
|
methods: {
|
|
loadData(type) {
|
|
loadData(type) {
|
|
new Promise((resolve, reject) => {
|
|
new Promise((resolve, reject) => {
|
|
@@ -308,10 +372,16 @@ export default {
|
|
//选择设备 点击确定按钮 保存id
|
|
//选择设备 点击确定按钮 保存id
|
|
selectDevice(e) {
|
|
selectDevice(e) {
|
|
this.deviceID = e.value[0].id;
|
|
this.deviceID = e.value[0].id;
|
|
- this.TabCur = e.value[0].type;
|
|
|
|
|
|
+ // this.TabCur = e.value[0].type;
|
|
|
|
+ // console.log(this.TabCur, "设备类型");
|
|
this.deviceName = e.value[0].strinstallpos;
|
|
this.deviceName = e.value[0].strinstallpos;
|
|
this.deviceShow = false;
|
|
this.deviceShow = false;
|
|
},
|
|
},
|
|
|
|
+ selectDevice1(e) {
|
|
|
|
+ this.deviceNum = e.value[0].value;
|
|
|
|
+ this.labelName = e.value[0].label;
|
|
|
|
+ this.deviceShow1 = false;
|
|
|
|
+ },
|
|
//选择起始时间
|
|
//选择起始时间
|
|
selectStartTime(e) {
|
|
selectStartTime(e) {
|
|
const startTime = e.value;
|
|
const startTime = e.value;
|
|
@@ -334,7 +404,6 @@ export default {
|
|
},
|
|
},
|
|
//查询历史数据 getDeviceHistory
|
|
//查询历史数据 getDeviceHistory
|
|
checkHistory() {
|
|
checkHistory() {
|
|
- // debugger;
|
|
|
|
const params = {
|
|
const params = {
|
|
ttime_begin: this.StartTime,
|
|
ttime_begin: this.StartTime,
|
|
ttime_end: this.EndTime,
|
|
ttime_end: this.EndTime,
|
|
@@ -351,7 +420,7 @@ export default {
|
|
debugger;
|
|
debugger;
|
|
if (response.data.code == 200) {
|
|
if (response.data.code == 200) {
|
|
const infolist = response.data.result;
|
|
const infolist = response.data.result;
|
|
- this.historyData = infolist.datalist.records;
|
|
|
|
|
|
+ this.historyData = infolist.records;
|
|
this.historyData.forEach((item) => {
|
|
this.historyData.forEach((item) => {
|
|
if (item.readData.frontGateOpen == 1) {
|
|
if (item.readData.frontGateOpen == 1) {
|
|
item.readData.frontGateOpen = "打开";
|
|
item.readData.frontGateOpen = "打开";
|
|
@@ -422,7 +491,6 @@ export default {
|
|
},
|
|
},
|
|
devicemenuShow(e) {
|
|
devicemenuShow(e) {
|
|
this.menushow = !this.menushow;
|
|
this.menushow = !this.menushow;
|
|
- console.log(this.menushow, "dainjichengg成都多大事");
|
|
|
|
},
|
|
},
|
|
menuClick(id) {
|
|
menuClick(id) {
|
|
this.TabCur = id;
|
|
this.TabCur = id;
|
|
@@ -464,7 +532,6 @@ export default {
|
|
.content {
|
|
.content {
|
|
width: 100%;
|
|
width: 100%;
|
|
display: flex;
|
|
display: flex;
|
|
- height: 290rpx;
|
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
}
|
|
}
|
|
.main {
|
|
.main {
|