Commit f7508ced by 姜雷

Merge branch 'develop' into test

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