|
@@ -102,6 +102,24 @@
|
|
|
<image class="img" src="../../static/img/green.png"></image>
|
|
|
<font class="wenziT">{{$t('equipmentStatusList.green')}}</font>
|
|
|
</view>
|
|
|
+ <view class="search">
|
|
|
+ <view class="search-title">
|
|
|
+ <picker @change="changeSearch" :value="index" :range="searchList">
|
|
|
+ <view class="uni-input">{{searchList[index]}}</view>
|
|
|
+ </picker>
|
|
|
+ <!-- {{$t('equipmentStatusList.equipmentClientID')}} -->
|
|
|
+ </view>
|
|
|
+ <view class="search-input">
|
|
|
+ <input v-if="searchList[index] === $t('equipmentStatusList.equipmentClientID')" type="text" :placeholder="$t('equipmentStatusList.devicePlaceholder')" v-model="searchClientId" />
|
|
|
+ <input v-else type="text" :placeholder="$t('equipmentStatusList.deviceNamePlaceholder')" v-model="searchDeviceName" />
|
|
|
+ </view>
|
|
|
+ <view class="search-button">
|
|
|
+ <button type="primary" size="mini" class="" @click="search()">
|
|
|
+ <p class="">{{$t('equipmentStatusList.search')}}</P>
|
|
|
+ </button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="line"></view>
|
|
|
<view class="titlelist" style="position: relative;" v-for="(equipment, index) in equipmentList"
|
|
|
:key="equipment.id">
|
|
|
<span class="status-css" :class="equipment.hasTodayAlarm===true?statusError : statusNormal"></span>
|
|
@@ -358,19 +376,30 @@
|
|
|
input: 0,
|
|
|
isReadOnly: true,
|
|
|
editBtn:true,
|
|
|
- sleepDesc:null,
|
|
|
+ sleepDesc:false,
|
|
|
descShow:false,
|
|
|
btnShow:false, // 按钮显示
|
|
|
upBtn:false, // 上一页按钮
|
|
|
nextBtn:true, // 下一页按钮
|
|
|
equipmentTotal:0, // 设备总数
|
|
|
isLoading: false, //是否加载中
|
|
|
+ searchList:[this.$t('equipmentStatusList.equipmentClientID'),this.$t('equipmentStatusList.deviceName')],
|
|
|
+ index: 0,
|
|
|
+ searchClientId: null,
|
|
|
+ searchDeviceName: null,
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['loginUser']),
|
|
|
},
|
|
|
onPullDownRefresh() {
|
|
|
+ this.index = 0;
|
|
|
+ this.searchClientId = null;
|
|
|
+ this.searchDeviceName = null;
|
|
|
+ this.globalUser.deviceName = null;
|
|
|
+ this.globalUser.clientId = null;
|
|
|
+ this.globalUser.offset = 0;
|
|
|
+ this.globalUser.limit = 20;
|
|
|
this.getEquipmentListData();
|
|
|
},
|
|
|
onShow() {
|
|
@@ -378,6 +407,10 @@
|
|
|
this.globalUser = uni.getStorageSync("globalUser");
|
|
|
this.globalUser.offset = 0;
|
|
|
this.globalUser.limit = 20;
|
|
|
+ this.searchClientId = null;
|
|
|
+ this.searchDeviceName = null;
|
|
|
+ this.globalUser.deviceName = null;
|
|
|
+ this.globalUser.clientId = null;
|
|
|
uni.setNavigationBarTitle({
|
|
|
title: this.$t('equipmentStatusList.title')
|
|
|
});
|
|
@@ -413,8 +446,10 @@
|
|
|
// this.equipmentList.push(...data[0].equipmentList);
|
|
|
this.equipmentList = data[0].equipmentList;
|
|
|
this.equipmentTotal = this.merchantList[0].equipmentTotal;
|
|
|
- if(this.equipmentTotal > this.globalUser.limit) {
|
|
|
+ if(this.equipmentTotal > this.globalUser.limit && this.globalUser.limit != null) {
|
|
|
this.btnShow = true;
|
|
|
+ } else {
|
|
|
+ this.btnShow = false;
|
|
|
}
|
|
|
console.log(this.equipmentList);
|
|
|
this.isLoading = false;
|
|
@@ -478,6 +513,53 @@
|
|
|
this.editBtn = true;
|
|
|
},
|
|
|
|
|
|
+ // 选择搜索类型
|
|
|
+ changeSearch: function(e) {
|
|
|
+ // console.log('picker发送选择改变,携带值为', e.detail.value)
|
|
|
+ this.index = e.detail.value
|
|
|
+ this.searchClientId = null;
|
|
|
+ this.searchDeviceName = null;
|
|
|
+ this.globalUser.deviceName = null;
|
|
|
+ this.globalUser.clientId = null;
|
|
|
+ },
|
|
|
+
|
|
|
+ // 点击搜索
|
|
|
+ search() {
|
|
|
+ if(this.index === 0) {
|
|
|
+ if(this.searchClientId === null || this.searchClientId === '') {
|
|
|
+ uni.showToast({
|
|
|
+ title: '请输入设备编码后6位',
|
|
|
+ icon: "none",
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ // this.globalUser.offset = 0;
|
|
|
+ // this.globalUser.limit = 20;
|
|
|
+ } else {
|
|
|
+ this.globalUser.offset = null;
|
|
|
+ this.globalUser.limit = null;
|
|
|
+ console.log(this.globalUser)
|
|
|
+ this.globalUser.clientId = this.searchClientId;
|
|
|
+ this.getEquipmentListData();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if(this.searchDeviceName === null || this.searchDeviceName === '') {
|
|
|
+ uni.showToast({
|
|
|
+ title: '请输入设备名称关键字',
|
|
|
+ icon: "none",
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ this.globalUser.offset = null;
|
|
|
+ this.globalUser.limit = null;
|
|
|
+ this.globalUser.deviceName = this.searchDeviceName;
|
|
|
+ this.getEquipmentListData();
|
|
|
+ console.log(this.globalUser)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
// 更改睡眠描述
|
|
|
confirmDesc(sleepDesc,id) {
|
|
|
var that = this;
|
|
@@ -552,12 +634,6 @@
|
|
|
.stringify(item))
|
|
|
});
|
|
|
}
|
|
|
- // uni.navigateTo({
|
|
|
- // // url:'map?item='+ encodeURIComponent(JSON.stringify(item))
|
|
|
- // url:'../../packageA/pages/equipmentStatus/map?item='+ encodeURIComponent(JSON.stringify(item))
|
|
|
- // // url:'../../packageA/pages/equipmentStatus/GoogleMap?item='+ encodeURIComponent(JSON.stringify(item))
|
|
|
- // // url: '/pages/user/map?item='+ encodeURIComponent(JSON.stringify(item))
|
|
|
- // });
|
|
|
},
|
|
|
//一键重启
|
|
|
reboot(id) {
|
|
@@ -882,12 +958,13 @@
|
|
|
|
|
|
},
|
|
|
change(id, code, index) {
|
|
|
+ this.sleepChecked = true;
|
|
|
var that = this;
|
|
|
- that.sleepChecked = true;
|
|
|
var code1 = code;
|
|
|
- console.log(index);
|
|
|
- console.log(code);
|
|
|
+ // console.log(index);
|
|
|
+ // console.log(code);
|
|
|
if (code1 == 1) {
|
|
|
+ // that.sleepChecked = true;
|
|
|
uni.showModal({
|
|
|
title: that.$t('equipmentStatusList.tip'),
|
|
|
content: that.$t('equipmentStatusList.sleepTip'),
|
|
@@ -910,10 +987,11 @@
|
|
|
success: (res) => {
|
|
|
var list = res.data.data;
|
|
|
that.equipmentList[index].isSleep = true;
|
|
|
+ that.sleepChecked = null;
|
|
|
that.getEquipmentListData();
|
|
|
}
|
|
|
});
|
|
|
- } else if (res.cancel) {
|
|
|
+ } else {
|
|
|
that.equipmentList[index].isSleep = false;
|
|
|
that.sleepChecked = false;
|
|
|
that.getEquipmentListData();
|
|
@@ -940,6 +1018,7 @@
|
|
|
success: (res) => {
|
|
|
var list = res.data.data;
|
|
|
that.equipmentList[index].isSleep = false;
|
|
|
+ that.sleepChecked = false;
|
|
|
that.getEquipmentListData();
|
|
|
}
|
|
|
});
|
|
@@ -1114,6 +1193,13 @@
|
|
|
height: 3upx;
|
|
|
background: #000000;
|
|
|
}
|
|
|
+
|
|
|
+ .line {
|
|
|
+ width: 100%;
|
|
|
+ height: 3upx;
|
|
|
+ background: #c8c7cc;
|
|
|
+ }
|
|
|
+
|
|
|
.button-container {
|
|
|
display: flex;
|
|
|
}
|
|
@@ -1122,4 +1208,43 @@
|
|
|
.right-button {
|
|
|
flex: 1;
|
|
|
}
|
|
|
+
|
|
|
+ .search {
|
|
|
+ width: 100%;
|
|
|
+ padding-top: 10upx;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ justify-content: flex-start;
|
|
|
+ }
|
|
|
+
|
|
|
+ .search-title {
|
|
|
+ width: 25%;
|
|
|
+ /* margin: 0 10px; */
|
|
|
+ margin-right: 10px;
|
|
|
+ text-align: center;
|
|
|
+ font-family: "PingFang-SC-Bold";
|
|
|
+ /* box-shadow: 0upx 0upx 20upx #D3D3D3; */
|
|
|
+ border-radius: 20px;
|
|
|
+ /* padding: 2px; */
|
|
|
+ }
|
|
|
+
|
|
|
+ .search-input{
|
|
|
+ width: 48%;
|
|
|
+ height: 25px;
|
|
|
+ text-align: center;
|
|
|
+ margin-top: 5px;
|
|
|
+ font-size: 26upx;
|
|
|
+ font-family: "PingFang-SC-Bold";
|
|
|
+ box-shadow: 0upx 0upx 30upx #D3D3D3;
|
|
|
+ border-radius: 5upx;
|
|
|
+ }
|
|
|
+ .search-button{
|
|
|
+ width: 20%;
|
|
|
+ padding-left: 10px;
|
|
|
+ padding-bottom: 5px;
|
|
|
+ margin-top: 3px;
|
|
|
+ text-align: center;
|
|
|
+ height: 60upx;
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
</style>
|