123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <template>
- <view class="container">
- <!-- 控制模式 -->
- <mpattern ref="mpattern" />
- <!-- 基础控制 -->
- <basics ref="basics" />
- <!-- 分时开关 -->
- <division ref="division" />
- </view>
- </template>
- <script>
- import mpattern from './modules/mpattern.vue'
- import basics from './modules/basics.vue'
- import division from './modules/division.vue'
- export default {
- name: "prodnum-06",
- components: { mpattern, basics, division },
- props: {
- control: Object
- },
- watch: {
- control: function (newVal) {
- if (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]
- })
- } catch (error) {
- console.error("06基础控制", error)
- }
- try {
- let division = this.$refs.division;
- division && division.loadData(newVal.function, newVal.paramcmdvalues, newVal.params)
- } catch (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 {
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .container {
- width: 355px;
- margin: 0 auto;
- }
- </style>
|