|
@@ -93,7 +93,7 @@
|
|
|
<span style="margin: auto 0"> {{ item.commandName }}</span>
|
|
|
<span style="margin: auto 0 auto auto"> {{ item.commandValue }}</span>
|
|
|
</view>
|
|
|
- <u-slider v-model="item.commandValue" :min="item.minimum" :max="item.maximum" height="5px" @change="selectItem(item)"></u-slider>
|
|
|
+ <u-slider v-model="item.commandValue" :min="item.minimum" :max="item.maximum" :step="item.dataType == 4 ? 0.1 : 1" height="5px" @change="selectItem(item)"></u-slider>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -200,6 +200,7 @@ function init() {
|
|
|
deviceuuid: [commonStore.deviceManageData.deviceUuid],
|
|
|
}).then((requset) => {
|
|
|
if (requset.status != "SUCCESS") return;
|
|
|
+ if (requset.data.length <= 0) return;
|
|
|
state.metricsValue = requset.data[0].metrics;
|
|
|
Object.keys(state.metricsValue).forEach((key) => {
|
|
|
state.realTimeData.forEach((el) => {
|
|
@@ -281,28 +282,28 @@ function historyMetricsApi() {
|
|
|
deviceuuid: [commonStore.deviceManageData.deviceUuid],
|
|
|
metrics: state.checkbox.value.length > 0 ? state.checkbox.value : state.metrics,
|
|
|
}).then((requset) => {
|
|
|
- if (requset.status === "SUCCESS") {
|
|
|
- var metrics = requset.data[0].metrics;
|
|
|
-
|
|
|
- state.checkbox.list.forEach((el) => {
|
|
|
- metrics.forEach((e) => {
|
|
|
- if (el.attributeCode.toLowerCase() == e.metric) {
|
|
|
- e.attributeName = el.attributeName;
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
- metrics.forEach((el) => {
|
|
|
- el.data = [];
|
|
|
- if (el.metricItems.length > 0) {
|
|
|
- el.metricItems.forEach((e) => {
|
|
|
- el.data.push([e.timestamp, e.value]);
|
|
|
- });
|
|
|
+ if (requset.status != "SUCCESS") return;
|
|
|
+ if (requset.data.length <= 0) return;
|
|
|
+
|
|
|
+ var metrics = requset.data[0].metrics;
|
|
|
+ state.checkbox.list.forEach((el) => {
|
|
|
+ metrics.forEach((e) => {
|
|
|
+ if (el.attributeCode.toLowerCase() == e.metric) {
|
|
|
+ e.attributeName = el.attributeName;
|
|
|
}
|
|
|
});
|
|
|
+ });
|
|
|
|
|
|
- state.ecahrtsDate = metrics;
|
|
|
- }
|
|
|
+ metrics.forEach((el) => {
|
|
|
+ el.data = [];
|
|
|
+ if (el.metricItems.length > 0) {
|
|
|
+ el.metricItems.forEach((e) => {
|
|
|
+ el.data.push([e.timestamp, e.value]);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ state.ecahrtsDate = metrics;
|
|
|
});
|
|
|
}
|
|
|
|