|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<view class="container">
|
|
|
<!-- 控制模式 -->
|
|
|
- <mpattern />
|
|
|
+ <mpattern ref="mpattern" />
|
|
|
<!-- 基础控制 -->
|
|
|
<basics ref="basics" />
|
|
|
<!-- 分时开关 -->
|
|
@@ -22,31 +22,60 @@ export default {
|
|
|
watch: {
|
|
|
control: function (newVal) {
|
|
|
if (newVal) {
|
|
|
- console.log(newVal)
|
|
|
try {
|
|
|
let nameList = ['Flow control', 'pressure control', 'Config', 'Sleep time', 'Pilot valve', 'Minimum', 'MOP']
|
|
|
this.$refs.basics.itemList = this.__proto__.getControlItem(nameList, newVal.function, newVal.paramcmdvalues, newVal.params)
|
|
|
this.$refs.basics.preview = ['Batt4', 'Batt12', 'BatFlow'].map(v => {
|
|
|
return newVal.params[v]
|
|
|
})
|
|
|
- console.log(this.$refs.basics.preview)
|
|
|
} catch (error) {
|
|
|
- console.error(error)
|
|
|
+ console.error("06基础控制", error)
|
|
|
}
|
|
|
try {
|
|
|
let division = this.$refs.division;
|
|
|
division && division.loadData(newVal.function, newVal.paramcmdvalues, newVal.params)
|
|
|
} catch (error) {
|
|
|
- console.error(error)
|
|
|
+ console.error("06分时控制", error)
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ let ctrlModel = this.__proto__.getControlItem(['Ctrl'], newVal.function, newVal.paramcmdvalues, newVal.params, { Ctrl: "radio" })[0]
|
|
|
+ let preview = [];
|
|
|
+ switch (ctrlModel.params.lastvalue - 0) {
|
|
|
+ case 0:
|
|
|
+ preview = {
|
|
|
+ now: newVal.params['UpP'],
|
|
|
+ tar: this.__proto__.getControlItem(['Upstream'], newVal.function, newVal.paramcmdvalues, newVal.params)[0]
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ preview = {
|
|
|
+ now: newVal.params['DownP'],
|
|
|
+ tar: this.__proto__.getControlItem(['Downstream'], newVal.function, newVal.paramcmdvalues, newVal.params)[0]
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ preview = {
|
|
|
+ now: newVal.params['NowFlow'],
|
|
|
+ tar: this.__proto__.getControlItem(['Constantflow'], newVal.function, newVal.paramcmdvalues, newVal.params)[0]
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ preview = {
|
|
|
+ now: newVal.params['MostBad'],
|
|
|
+ tar: this.__proto__.getControlItem(['unfavorable'], newVal.function, newVal.paramcmdvalues, newVal.params)[0]
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ this.$refs.mpattern.ctrlModel = ctrlModel;
|
|
|
+ this.$refs.mpattern.preview = preview;
|
|
|
+ } catch (error) {
|
|
|
+ console.error("06控制模式", error)
|
|
|
}
|
|
|
} else {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
- },
|
|
|
- modules() {
|
|
|
-
|
|
|
- },
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|