Commit f7508ced by 姜雷

Merge branch 'develop' into test

parents b0ab75ac 78aec937
......@@ -166,6 +166,11 @@ Component({
if (!this.data.dataList[status].length) this.refreshList();
},
openEquipment(e) {
wx.showModal({
title: '提示',
content: '是否启用设备',
success: res => {
if (res.confirm) {
const { code, type } = e.currentTarget.dataset;
console.log(code);
deviceFetch({
......@@ -181,8 +186,16 @@ Component({
.catch(err => {
console.log(err);
});
}
},
});
},
closeEquipment(e) {
wx.showModal({
title: '提示',
content: '是否禁用设备',
success: res => {
if (res.confirm) {
const { code, type } = e.currentTarget.dataset;
console.log(code);
deviceFetch({
......@@ -198,6 +211,9 @@ Component({
.catch(err => {
console.log(err);
});
}
},
});
},
},
});
......@@ -53,7 +53,10 @@
}
.EquipmentState-elist-ItemLocation {
margin-left: 20rpx;
flex: 1;
width: 340rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.EquipmentState-elist-ItemBtn {
width: 80rpx;
......
import { deviceFetch } from '../../../api/fetch';
let warningLevelRangeOption = { key: null, value: '' };
// pages/components/EquipmentWarning/EquipmentWarning.js
Component({
lifetimes: {
......@@ -49,7 +50,7 @@ Component({
.then(res => {
console.log(res);
this.setData({
warningLevelRange: res.data,
warningLevelRange: [warningLevelRangeOption, ...res.data],
});
})
.catch(err => {
......@@ -61,10 +62,18 @@ Component({
if (index === this.data.warnLevelIndex) return;
const item = this.data.warningLevelRange[index];
console.log(item);
if (item.key) {
this.setData({
warnLevelIndex: index,
warnLevel: item.key,
});
} else {
this.setData({
warnLevelIndex: '',
warnLevel: 0,
});
}
this.refreshList();
},
changeLocation(e) {
......@@ -147,6 +156,11 @@ Component({
});
},
openEquipment(e) {
wx.showModal({
title: '提示',
content: '是否启用设备',
success: res => {
if (res.confirm) {
const { code, type } = e.currentTarget.dataset;
console.log(code);
deviceFetch({
......@@ -162,8 +176,16 @@ Component({
.catch(err => {
console.log(err);
});
}
},
});
},
closeEquipment(e) {
wx.showModal({
title: '提示',
content: '是否禁用设备',
success: res => {
if (res.confirm) {
const { code, type } = e.currentTarget.dataset;
console.log(code);
deviceFetch({
......@@ -179,6 +201,9 @@ Component({
.catch(err => {
console.log(err);
});
}
},
});
},
},
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment