|
@@ -39,24 +39,31 @@
|
|
|
<!-- 时段 -->
|
|
|
<block v-else-if="item.inputType == 'dayParting'">
|
|
|
<view class="title u-line-1">
|
|
|
- {{ item.funcname }}{{ item.params.unit || '' }}
|
|
|
+ {{ item.funcname }}{{ item.params[item.key + 'P'].unit || '' }}
|
|
|
</view>
|
|
|
<view class="day-parting">
|
|
|
- <picker mode="time" :value="item.params[item.key + 'T']" @change="changeT_T">
|
|
|
+ <picker mode="time" :value="item.params[item.key + 'T'].lastvalue" @change="changeT_T">
|
|
|
<view class="row">
|
|
|
<view class="label">
|
|
|
时间:
|
|
|
</view>
|
|
|
- {{ item.params[item.key + 'T'] }}
|
|
|
+ {{ item.params[item.key + 'T'].lastvalue }}
|
|
|
</view>
|
|
|
</picker>
|
|
|
+
|
|
|
<view class="row" style="margin-top: 20px">
|
|
|
<view class="label">压力:</view>
|
|
|
<u--input :focus="dayPartingFocus" v-model="value" type="digit"
|
|
|
- :placeholder="item.params[item.key + 'P']" border="surround" />
|
|
|
+ :placeholder="item.params[item.key + 'P'].lastvalue" border="surround" />
|
|
|
</view>
|
|
|
- <view class="tips" v-if="tips">
|
|
|
+ <view class="tips" v-if="toBeUpdated">
|
|
|
<u-icon name="info-circle-fill" color="#E2201A" />
|
|
|
+ <text style="margin-left: 4px;">
|
|
|
+ {{ toBeUpdated }}
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
+ <view class="tips" v-if="tips">
|
|
|
+ <u-icon name="info-circle-fill" color="#55AAFF" />
|
|
|
<text style="margin-left: 4px;">
|
|
|
{{ tips }}
|
|
|
</text>
|
|
@@ -79,6 +86,7 @@ export default {
|
|
|
show: false,
|
|
|
item: {},
|
|
|
tips: "",
|
|
|
+ toBeUpdated: "",
|
|
|
intFocus: false,
|
|
|
dayPartingFocus: false,
|
|
|
value: "",
|
|
@@ -116,11 +124,15 @@ export default {
|
|
|
tips = `是否将“${item.funcname}”${this.confirmText}为:“${params.options.find(v => v.value != item.paramValue).label}”`
|
|
|
}
|
|
|
} else if (item.inputType == "dayParting") {
|
|
|
- console.log("分时段", item)
|
|
|
this.value = item.params[item.key + 'p'];
|
|
|
this.dayPartingFocus = false;
|
|
|
this.item = JSON.parse(JSON.stringify(item))
|
|
|
- tips = item.toBeUpdated.time || item.toBeUpdated.value ? `查询到一条待更新指令,更新内容为时间:${item.toBeUpdated.time.split("_").join(":")},压力:${item.toBeUpdated.value}MPA` : ""
|
|
|
+ this.toBeUpdated = item.paramValue.time || item.paramValue.value ? `查询到一条待更新指令,更新内容为时间:${item.paramValue.time.split("_").join(":")},压力:${item.paramValue.value}MPA` : ""
|
|
|
+ let p = item.params[item.key + 'P'];
|
|
|
+ if (p.num_minvalue || p.num_maxvalue) tips += `输入范围:${p.num_minvalue || 0} ~ ${p.num_maxvalue || '∞'}`
|
|
|
+ if (p.num_scale) tips += `,保留${p.num_scale}位小数`
|
|
|
+ if (p.num_step) tips += `,增量${p.num_step || 0}`
|
|
|
+ if (tips && p.unit) tips += `,单位${p.unit}`
|
|
|
setTimeout(() => {
|
|
|
this.dayPartingFocus = true
|
|
|
}, 300);
|
|
@@ -129,7 +141,7 @@ export default {
|
|
|
},
|
|
|
/* 时段修改 */
|
|
|
changeT_T(e) {
|
|
|
- this.item.params[this.item.key + 'T'] = e.detail.value;
|
|
|
+ this.item.params[this.item.key + 'T'].lastvalue = e.detail.value;
|
|
|
},
|
|
|
submitBreak(content) {
|
|
|
uni.showToast({
|
|
@@ -158,9 +170,13 @@ export default {
|
|
|
}
|
|
|
} else if (item.inputType == "dayParting") {
|
|
|
value = this.value - 0;
|
|
|
+ if (value == 0) return this.submitBreak("还未输入值")
|
|
|
+ if (params.num_scale != 0) value = value.toFixed(params.num_scale)
|
|
|
+ if (params.num_minvalue && value > params.num_minvalue) return this.submitBreak("输入值小于最低范围")
|
|
|
+ if (params.num_maxvalue && value < params.num_maxvalue) return this.submitBreak("输入值大于最大范围")
|
|
|
return this.submit(item.w_functionid, {
|
|
|
[item.key + 'P']: value,
|
|
|
- [item.key + 'T']: params[item.key + 'T'].split(":").join("_")
|
|
|
+ [item.key + 'T']: params[item.key + 'T'].lastvalue.split(":").join("_")
|
|
|
})
|
|
|
}
|
|
|
this.submit(item.w_functionid, {
|
|
@@ -230,8 +246,5 @@ export default {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
</style>
|