Explorar el Código

Merge branch 'MT01' into 测试

# Conflicts:
#	control/modules/My_input.vue
xiaohaizhao hace 10 meses
padre
commit
c71bdf3374

+ 360 - 0
control/components/prodnum-MT01/modules/division.vue

@@ -0,0 +1,360 @@
+<template>
+  <view class="control">
+    <view class="control-title"> 分时控制 </view>
+
+    <view
+      class="item-box"
+      v-for="(item, index) in list"
+      :key="item.w_functionid"
+    >
+      <view
+        class="TR-state"
+        hover-class="navigator-hover"
+        @click.stop="changTR(index)"
+        >{{
+          (TRList[index].showValue.includes("投入") ? "切出" : "投入") ||
+          "暂未设置"
+        }}</view
+      >
+      <view class="item" hover-class="navigator-hover" @click="onClick(item)">
+        <view class="title">
+          <view>{{ item.funcname }}</view>
+          <view class="pilotLamp">
+            <pilotLamp :trItem="TRList[index]" />
+          </view>
+        </view>
+        <view class="row">
+          <view class="box">
+            <view class=""> 开始时间 </view>
+            <view class="content">
+              <view class="value">{{ item.showValue.begin || "--" }}</view>
+            </view>
+          </view>
+          <view class="box">
+            <view class=""> 结束时间 </view>
+            <view class="content">
+              <view class="value">{{ item.showValue.end || "--" }}</view>
+            </view>
+          </view>
+          <view class="box">
+            <view class=""> 压力设定 </view>
+            <view class="content">
+              <view class="value">{{ item.showValue.value || "--" }}</view>
+              <view class="unit">{{
+                item.params[item.funcname + "压力设定"].unit || ""
+              }}</view>
+            </view>
+          </view>
+        </view>
+        <view v-if="item.isfeedback" class="dot" />
+      </view>
+    </view>
+
+    <My_input ref="MyInput" @customMethod="customMethod">
+      <view class="change-item" v-if="changeItem.funcname">
+        <!-- :end="endTime"  -->
+        <!-- :start="changeItem.showValue.begin" -->
+        <picker
+          mode="time"
+          :value="changeItem.showValue.begin"
+          data-name="begin"
+          @change="timeChange"
+        >
+          <view class="row">
+            <view class="label"> 开始时间: </view>
+            <view class="value day-parting-row"
+              >{{ changeItem.showValue.begin || " --" }}
+            </view>
+          </view>
+        </picker>
+        <picker
+          mode="time"
+          :value="changeItem.showValue.end"
+          data-name="end"
+          @change="timeChange"
+        >
+          <view class="row">
+            <view class="label"> 结束时间: </view>
+            <view class="value day-parting-row">{{
+              changeItem.showValue.end || " --"
+            }}</view>
+          </view>
+        </picker>
+        <view class="row">
+          <view class="label"> 压力设定: </view>
+          <view class="value">
+            <u-input
+              :placeholder="changeItem.showValue.value || '压力设定'"
+              v-model="changeItem.showValue.value"
+              :type="
+                changeItem.params[changeItem.funcname1 + '压力设定']
+                  .num_scale == 0
+                  ? 'number'
+                  : 'digit'
+              "
+            >
+              <template slot="suffix">
+                {{
+                  changeItem.params[changeItem.funcname1 + "压力设定"].unit ||
+                  ""
+                }}
+              </template>
+            </u-input>
+          </view>
+        </view>
+      </view>
+    </My_input>
+  </view>
+</template>
+
+<script>
+import pilotLamp from "./pilotLamp";
+export default {
+  name: "division",
+  components: { pilotLamp },
+  data() {
+    return {
+      list: [],
+      TRList: [],
+      changeItem: {},
+      endTime: "",
+    };
+  },
+  methods: {
+    loadData(newVal, Chinese = false) {
+      let reg = /^时段\d{1,5}$/,
+        count = 0,
+        list = [];
+      for (const key in newVal.function) {
+        if (reg.test(key)) count++;
+      }
+      let Nzh = require("nzh");
+      let nzhcn = require("nzh/cn"); //直接使用简体中文
+      function formattingKey(num, prefix = "T") {
+        let res = "";
+        switch (String(num).length) {
+          case 1:
+            res = prefix + "00" + num;
+            break;
+          case 2:
+            res = prefix + "0" + num;
+            break;
+          case 3:
+            res = prefix + num;
+            break;
+        }
+        return res;
+      }
+      let key1 = 1,
+        key2 = 49,
+        TRList = [];
+
+      for (let i = 1; i <= count; i++) {
+        let name = Chinese ? nzhcn.encodeS(i) : i;
+        let obj = newVal.function[`时段${i}`],
+          keyList = [];
+        for (let index = 0; index < 4; index++) {
+          keyList.push(formattingKey(key1));
+          key1++;
+          if (index == 3) {
+            keyList.push(formattingKey(key2));
+            key2++;
+            TRList.push(
+              this.__proto__.getControlItem([`时间段${i}`], newVal)[0]
+            );
+          }
+        }
+        let item = {
+          keyList,
+          index: i,
+          inputType: "slot",
+          paramValue: {
+            begin:
+              newVal.paramcmdvalues[keyList[0]] +
+              ":" +
+              newVal.paramcmdvalues[keyList[2]],
+            end:
+              newVal.paramcmdvalues[keyList[1]] +
+              ":" +
+              newVal.paramcmdvalues[keyList[3]],
+            value: newVal.paramcmdvalues[keyList[4]],
+          },
+          showValue: {
+            begin:
+              newVal.paramvalues[keyList[0]] +
+              ":" +
+              newVal.paramvalues[keyList[2]],
+            end:
+              newVal.paramvalues[keyList[1]] +
+              ":" +
+              newVal.paramvalues[keyList[3]],
+            value: newVal.paramvalues[keyList[4]],
+          },
+          params: {},
+        };
+        keyList.forEach((key) => {
+          item.params[key] = newVal.params[key];
+        });
+        obj.funcname1 = "时段" + nzhcn.encodeS(i);
+        item.isfeedback =
+          newVal.isfeedback &&
+          (obj.paramValue.begin || obj.paramValue.end || obj.paramValue.value)
+            ? true
+            : false;
+        list.push(Object.assign(obj, item));
+      }
+      this.TRList = TRList;
+      this.list = list;
+    },
+    onClick(item) {
+      this.changeItem = JSON.parse(JSON.stringify(item));
+      this.endTime =
+        this.changeItem.showValue.end == "0:0"
+          ? ""
+          : this.changeItem.showValue.end;
+      let toBeUpdated = [];
+      if (item.paramValue.begin)
+        toBeUpdated.push(`开始时间:${item.paramValue.begin}`);
+      if (item.paramValue.end)
+        toBeUpdated.push(`结束时间:${item.paramValue.begin}`);
+      if (item.paramValue.value)
+        toBeUpdated.push(`压力设定:${item.paramValue.value}`);
+      if (toBeUpdated.length) {
+        item.toBeUpdated = "待更新记录:" + toBeUpdated.join(",");
+      }
+      this.$refs.MyInput.openInput(item, item.inputType != "switch");
+    },
+    changTR(index) {
+      this.$refs.MyInput.openInput(this.TRList[index]);
+    },
+    timeChange(e) {
+      const name = e.currentTarget.dataset.name;
+      this.changeItem.showValue[name] = e.detail.value;
+    },
+    customMethod() {
+      const { showValue, w_functionid, params, index } = this.changeItem,
+        MyInput = this.$refs.MyInput;
+      if (!showValue.begin) return MyInput.submitBreak("还未填写开始时间");
+      if (!showValue.end) return MyInput.submitBreak("还未填写结束时间");
+      if ((showValue.value + "").length == 0)
+        return MyInput.submitBreak("还未设定压力");
+      let item = this.list[index - 1];
+      showValue.value = (showValue.value - 0).toFixed(
+        params[item.keyList[4]].num_scale
+      );
+      let obj = {
+        [item.keyList[0]]: showValue.begin.split(":")[0],
+        [item.keyList[1]]: showValue.end.split(":")[0],
+        [item.keyList[2]]: showValue.begin.split(":")[1],
+        [item.keyList[3]]: showValue.end.split(":")[1],
+        [item.keyList[4]]: showValue.value,
+      };
+      console.log("发送请求", obj);
+      MyInput.submit(w_functionid, obj);
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+/* 边框 */
+.day-parting-row {
+  display: flex;
+  align-items: center;
+  flex: 1;
+  width: 0;
+  border: 1px solid #dadbde;
+  border-radius: 4px;
+  padding: 6px 9px;
+  height: 35px;
+  font-size: 14px;
+  box-sizing: border-box;
+}
+
+.item-box {
+  position: relative;
+  .TR-state {
+    position: absolute;
+    top: 4px;
+    right: 6px;
+    font-size: 12px;
+    background: #004a92;
+    color: #fff;
+    padding: 4px 6px;
+    border-radius: 4px;
+    z-index: 2;
+  }
+  .item {
+    position: relative;
+    padding: 4px 6px 6px;
+    box-sizing: border-box;
+    background: #fff;
+    border-radius: 4px;
+    margin-bottom: 5px;
+
+    .title {
+      display: flex;
+      margin-bottom: 6px;
+      font-weight: bold;
+      .pilotLamp {
+        margin-left: 10px;
+      }
+    }
+
+    .row {
+      display: flex;
+
+      .box {
+        width: 33.33%;
+
+        .content {
+          display: flex;
+          margin-top: 6px;
+          align-items: flex-end;
+
+          .value {
+            width: 0;
+            flex: 1;
+            color: #333;
+            font-size: 16px;
+            flex-shrink: 0;
+            font-weight: bold;
+          }
+
+          .unit {
+            font-size: 10px;
+            color: #666;
+            flex-shrink: 0;
+            max-width: 50px;
+          }
+        }
+      }
+    }
+
+    .dot {
+      position: absolute;
+      right: 2px;
+      top: 2px;
+      width: 10px;
+      height: 10px;
+      background: #d9001b;
+      border-radius: 50%;
+    }
+  }
+}
+
+.change-item {
+  .row {
+    display: flex;
+    align-items: center;
+    line-height: 35px;
+    width: 100%;
+    margin-top: 4px;
+
+    .label {
+      width: 80px;
+      flex-shrink: 0;
+    }
+  }
+}
+</style>

+ 129 - 0
control/components/prodnum-MT01/modules/mpattern.vue

@@ -0,0 +1,129 @@
+<template>
+  <view class="control">
+    <view class="update-line">
+      <view class="label" :style="{ color: fColor }">
+        {{ ctrlModel.funcname }}
+      </view>
+      <view class="content" :style="{ color: fColor }">
+        <block v-if="ctrlModel.inputType == 'switch'">
+          {{ switchRes(ctrlModel) }}
+        </block>
+        <block v-else>
+          {{ ctrlModel.showValue || "暂未设置" }}
+        </block>
+        <view
+          class="control-updata-but"
+          hover-class="navigator-hover"
+          @click="onClick(ctrlModel)"
+          >{{ ctrlModel.isfeedback ? "待更新" : "更新" }}</view
+        >
+      </view>
+    </view>
+
+    <view class="update-line" v-for="item in list" :key="item.paramName">
+      <view class="label" :style="{ color: fColor }">
+        {{ item.funcname }}
+      </view>
+      <view class="content" :style="{ color: fColor }">
+        <block v-if="item.inputType == 'switch'">
+          {{ switchRes(item) }}
+        </block>
+        <block v-else>
+          {{ item.paramValue || item.params.lastvalue || "暂未设置" }}
+        </block>
+        <view
+          class="control-updata-but"
+          hover-class="navigator-hover"
+          @click="onClick(item)"
+          >{{ item.isfeedback ? "待更新" : "更新" }}</view
+        >
+      </view>
+    </view>
+
+    <My_input ref="MyInput" />
+  </view>
+</template>
+
+<script>
+export default {
+  name: "mpattern",
+  props: {
+    fColor: {
+      type: String,
+      value: "#FFF",
+    },
+  },
+  data() {
+    return {
+      ctrlModel: {},
+      list: [],
+    };
+  },
+  computed: {
+    switchRes: function () {
+      return (item) => {
+        try {
+          if (item.showValue) return item.showValue;
+          let value = item.paramValue || item.params.lastvalue,
+            res = item.params.options.find((v) => v.value == value);
+          return res ? res.label : "暂未设置";
+        } catch (error) {}
+      };
+    },
+  },
+  methods: {
+    onClick(item) {
+      this.$refs.MyInput.openInput(item);
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.row {
+  position: relative;
+  display: flex;
+  padding: 4px 6px 0;
+  height: 60px;
+  box-sizing: border-box;
+  background: #fff;
+  border-radius: 4px;
+  margin-bottom: 5px;
+
+  .box {
+    width: 49%;
+
+    .content {
+      display: flex;
+      margin-top: 10px;
+      align-items: flex-end;
+
+      .value {
+        width: 0;
+        flex: 1;
+        color: #333;
+        font-size: 16px;
+        flex-shrink: 0;
+        font-weight: bold;
+      }
+
+      .unit {
+        font-size: 10px;
+        color: #666;
+        flex-shrink: 0;
+        max-width: 50px;
+      }
+    }
+  }
+
+  .dot {
+    position: absolute;
+    right: 2px;
+    top: 2px;
+    width: 10px;
+    height: 10px;
+    background: #d9001b;
+    border-radius: 50%;
+  }
+}
+</style>

+ 109 - 0
control/components/prodnum-MT01/modules/pilotLamp.vue

@@ -0,0 +1,109 @@
+<template>
+  <view class="pilotLamp">
+    <view class="item" v-for="item in list" :key="item.name">
+      <view class="image">
+        <image
+          style="height: 100%"
+          src="/static/img/pilot-lamp.png"
+          mode="heightFix"
+        />
+        <view
+          v-if="item.value || (item.params.lastvalue==1)"
+          class="bg"
+          :class="item.warn ? 'red' : 'green'"
+        />
+      </view>
+      <view class="name" v-if="item.name"> {{ item.name }} </view>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  name: "pilotLamp",
+  props: {
+    trItem: Object,
+  },
+  watch: {
+    trItem: {
+      handler(newV) {
+        this.list = [newV];
+      },
+      deep: true,
+      immediate: true,
+    },
+  },
+  data() {
+    return {
+      list: [],
+    };
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.pilotLamp {
+  display: flex;
+  flex-wrap: wrap;
+
+  .item {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    width: 20%;
+
+    .image {
+      position: relative;
+      height: 20px;
+
+      .bg {
+        width: 14px;
+        height: 14px;
+        border-radius: 50%;
+        background: #cccccc;
+        position: absolute;
+        top: 3px;
+        left: 3px;
+      }
+
+      .red {
+        animation: lampBackground 0.5s infinite alternate ease-in-out;
+      }
+
+      .green {
+        animation: lampBackground1 0.5s infinite alternate ease-in-out;
+      }
+
+      @keyframes lampBackground {
+        from {
+          background-color: #ff8f4a;
+        }
+
+        to {
+          background-color: red;
+        }
+      }
+
+      @keyframes lampBackground1 {
+        from {
+          background-color: rgb(0, 255, 0);
+        }
+
+        to {
+          background-color: green;
+        }
+      }
+    }
+
+    .name {
+      font-size: 12px;
+      color: #fff;
+      margin-top: 6px;
+    }
+  }
+
+  .item:nth-of-type(n + 6) {
+    margin-top: 10px;
+  }
+}
+</style>

+ 305 - 0
control/components/prodnum-MT01/modules/tabs.vue

@@ -0,0 +1,305 @@
+<template>
+  <view class="tabs">
+    <view class="box">
+      <u-tabs
+        :list="tabList"
+        @click="changeTab"
+        lineColor="#052E5D"
+        :activeStyle="{ color: '#052E5D', fontWeight: 'bold' }"
+        :inactiveStyle="{
+          color: '#BBBBBB',
+        }"
+        lineWidth="36"
+      />
+    </view>
+    <view class="content">
+      <view class="yblc" v-show="showPage == '报警设置'">
+        <control-item
+          v-show="showPage == '报警设置'"
+          v-for="item in bjszList"
+          :key="item.w_functionid"
+          :item="item"
+          @click.native="onClick(item)"
+        />
+      </view>
+      <view class="gdsz" v-show="showPage == 'PID设置'">
+        <view class="plcsz" style="margin-bottom: 4px">
+          <view class="label">PID调节</view>
+          <view class="value">
+            {{ PICTJ || "--" }}
+          </view>
+        </view>
+        <view class="yblc">
+          <control-item
+            v-show="showPage == 'PID设置'"
+            v-for="item in gdszList"
+            :key="item.w_functionid"
+            :item="item"
+            @click.native="onClick(item)"
+          />
+        </view>
+      </view>
+      <view class="yblc" v-show="showPage == '仪表量程'">
+        <control-item
+          v-show="showPage == '仪表量程'"
+          v-for="item in yclbList"
+          :key="item.w_functionid"
+          :item="item"
+          @click.native="onClick(item)"
+        />
+      </view>
+      <block v-if="showPage == 'PLC时钟'">
+        <view class="plcsz">
+          <view class="label"> 年月日时分秒 </view>
+          <view class="value" v-if="plc.funcname">
+            {{ plc.params.lastvalue || "--" }}
+            <view
+              class="plcsz-but"
+              hover-class="navigator-hover"
+              @click="datetimeShow = true"
+              >{{ plc.isfeedback ? "待更新" : "更新" }}</view
+            >
+            <u-datetime-picker
+              :show="datetimeShow"
+              title="PLC时钟"
+              v-model="plclastvalue"
+              @cancel="onCancel"
+              @confirm="onConfirm"
+              mode="datetime"
+            />
+          </view>
+        </view>
+        <view class="plcsz">
+          <view class="label"> 同步时间 </view>
+          <view class="value" v-if="TBSJ.funcname">
+            {{ TBSJ.params.options[0].label || "--" }}
+            <view
+              class="plcsz-but"
+              hover-class="navigator-hover"
+              @click="changeTBSJ"
+              >{{ TBSJ.isfeedback ? "待更新" : "更新" }}</view
+            >
+          </view>
+        </view>
+      </block>
+    </view>
+    <My_input ref="MyInput" />
+  </view>
+</template>
+
+<script>
+import mpattern from "./mpattern";
+import { formatTime } from "../../../../utils/getTime";
+
+export default {
+  name: "tabs",
+  components: { mpattern },
+  props: {
+    control: Object,
+  },
+  data() {
+    return {
+      tabList: [],
+      showPage: "报警设置",
+      bjszList: [],
+      yclbList: [],
+      gdszList: [],
+      PICTJ: "",
+      llcj: {},
+      plc: {},
+      TBSJ: {},
+      datetimeShow: false,
+      plclastvalue: "",
+    };
+  },
+  watch: {
+    control: function (newVal) {
+      if (newVal) {
+        this.tabList = [
+          {
+            name: "报警设置",
+          },
+          {
+            name: "仪表量程",
+          },
+          {
+            name: "PLC时钟",
+          },
+          {
+            name: "PID设置",
+          },
+        ];
+        try {
+          this.bjszList = this.__proto__.getControlItem(
+            ["失压警告", "失压警告设定", "失压报警", "失压报警设定"],
+            newVal
+          );
+          let s018 = newVal.params.S018;
+          this.PICTJ = s018.options.find(
+            (v) => v.value == s018.lastvalue
+          ).label;
+        } catch (error) {
+          console.error("报警设置", error);
+        }
+        try {
+          let nameList = ["压力量程高值", "压力量程低值"];
+          this.yclbList = this.__proto__.getControlItem(nameList, newVal);
+        } catch (error) {
+          console.error("仪表量程", error);
+        }
+        try {
+          this.plc = this.__proto__.getControlItem(["PLC时钟"], newVal, {
+            Ctrl: "datatime",
+          })[0];
+          let date = {
+            C006: null,
+            C007: null,
+            C008: null,
+            C009: null,
+            C010: null,
+            C011: null,
+          };
+          for (const key in date) {
+            let lastvalue = newVal.params[key].lastvalue;
+            date[key] = lastvalue > 10 ? lastvalue : "0" + (lastvalue - 0);
+          }
+          this.plclastvalue = `${date.C006}-${date.C007}-${date.C008} ${date.C009}:${date.C010}:${date.C011}`;
+          this.plc.params.lastvalue = this.plclastvalue;
+          this.TBSJ = this.__proto__.getControlItem(["同步时间"], newVal)[0];
+          console.log("TBSJ", this.TBSJ);
+        } catch (error) {
+          console.error("PLC时钟", error);
+        }
+        try {
+          let nameList = ["P设定", "I设定", "D设定"];
+          this.gdszList = this.__proto__.getControlItem(nameList, newVal);
+        } catch (error) {
+          console.error("PID设置", error);
+        }
+      }
+    },
+  },
+  methods: {
+    changeTBSJ() {
+      let that = this;
+      uni.showModal({
+        title: "提示",
+        content: "确定更新数据吗?",
+        success: function ({ confirm }) {
+          if (confirm)
+            that.$refs.MyInput.submit(
+              that.TBSJ.w_functionid,
+              that.TBSJ.paramName
+            );
+        },
+      });
+    },
+    changeTab(e) {
+      this.showPage = e.name;
+    },
+    onClick(item) {
+      console.log("修改", item);
+      this.$refs.MyInput.openInput(item);
+    },
+    onCancel(e) {
+      this.datetimeShow = false;
+    },
+    async onConfirm(e) {
+      let date = formatTime(new Date(e.value)).split(" "),
+        plc = this.plc;
+      date = date[0].split("-").concat(date[1].split(":"));
+      let res = await this.$Http.setControlItem(plc.w_functionid, {
+        C006: date[0],
+        C007: date[1],
+        C008: date[2],
+        C009: date[3],
+        C010: date[4],
+        C011: date[5],
+      });
+      this.datetimeShow = false;
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.tabs {
+  position: relative;
+  box-sizing: border-box;
+
+  .box {
+    background: #fff;
+    border: 4px;
+    border-radius: 4px;
+    box-sizing: border-box;
+  }
+
+  /deep/ .controlItem {
+    width: 160px !important;
+  }
+
+  /deep/ .uni-scroll-view,
+  /deep/.u-tabs__wrapper__nav__item {
+    height: 35px !important;
+  }
+
+  /deep/ .u-tabs__wrapper__nav__item__text {
+    font-size: 12px !important;
+  }
+
+  .content {
+    // padding: 0 10px 10px;
+    padding-bottom: 10px;
+    box-sizing: border-box;
+    width: 100%;
+
+    .gdsz {
+      .llcj {
+        display: flex;
+        align-items: center;
+        font-size: 3.2vw;
+
+        .unit {
+          font-size: 3.2vw;
+        }
+      }
+    }
+
+    .yblc {
+      display: flex;
+      flex-wrap: wrap;
+      justify-content: space-between;
+    }
+
+    .plcsz {
+      font-size: 14px;
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      box-sizing: border-box;
+      padding: 10px 10px 0;
+      line-height: 25px;
+      color: #fff;
+
+      .value {
+        display: flex;
+        color: #fff;
+
+        .plcsz-but {
+          background-color: #004a92;
+          font-size: 12px;
+          padding: 0 6px !important;
+          margin-right: 6px;
+          border-radius: 4px;
+          box-sizing: border-box;
+          margin-left: 20px;
+          color: #fff;
+          font-size: 10px;
+          height: 22px;
+          line-height: 22px;
+        }
+      }
+    }
+  }
+}
+</style>

+ 120 - 0
control/components/prodnum-MT01/prodnum-MT01.vue

@@ -0,0 +1,120 @@
+<template>
+  <view>
+    <view class="control-title">控制面板</view>
+    <pilotLamp ref="pilotLamp" />
+    <view style="height: 20px" />
+    <mpattern ref="阀门工作状态" />
+    <tabs :control="control" />
+    <division ref="division" />
+  </view>
+</template>
+
+<script>
+import mpattern from "./modules/mpattern";
+import tabs from "./modules/tabs";
+import pilotLamp from "./modules/pilotLamp";
+import division from "./modules/division";
+export default {
+  name: "prodnum-MT01",
+  components: { mpattern, tabs, pilotLamp, division },
+  props: {
+    control: Object,
+  },
+  watch: {
+    control: function (newVal) {
+      if (newVal) {
+        console.log("MT01", newVal);
+        try {
+          this.$refs.pilotLamp.list = [
+            {
+              name: "就地",
+              value: getBoole("S002", 0),
+            },
+            {
+              name: "远程",
+              value: getBoole("S002")
+            },
+            {
+              name: "开到位",
+              value: getBoole("S004"),
+            },
+            {
+              name: "关到位",
+              value: getBoole("S003"),
+            },
+            {
+              name: "过扭故障",
+              value: getBoole("A001"),
+              warn: true,
+            },
+            {
+              name: "失压警告",
+              value: getBoole("A003"),
+              warn: true,
+            },
+            {
+              name: "失压报警",
+              value: getBoole("A004"),
+              warn: true,
+            },
+            {
+              name: "电量低报警",
+              value: getBoole("A002"),
+              warn: true,
+            },
+          ];
+          function getBoole(name, expect = 1) {
+            try {
+              return newVal.paramvalues[name] == expect;
+            } catch (error) {
+              console.error("getBoole取值出错项", name);
+              return false;
+            }
+          }
+        } catch (error) {
+          console.error("MT01指示灯", error);
+        }
+        try {
+          this.$refs.阀门工作状态.ctrlModel = this.__proto__.getControlItem(
+            ["阀门工作状态"],
+            newVal,
+            { 阀门工作状态: "radio" }
+          )[0];
+          switch (this.$refs.阀门工作状态.ctrlModel.showValue) {
+            case "手动控制":
+              this.$refs.阀门工作状态.list = [
+                this.__proto__.getControlItem(["手动开度设置"], newVal)[0],
+              ];
+              break;
+            case "自动调节":
+              this.$refs.阀门工作状态.list = [
+                this.__proto__.getControlItem(["手动压力设置"], newVal)[0],
+              ];
+              break;
+            default:
+              this.$refs.阀门工作状态.list = [];
+              break;
+          }
+          console.log(
+            "this.$refs.阀门工作状态.list",
+            this.$refs.阀门工作状态.list
+          );
+        } catch (error) {
+          console.error("MT01阀门工作状态", error);
+        }
+        try {
+          let division = this.$refs.division;
+          division && division.loadData(newVal);
+        } catch (error) {
+          console.error("MT01分时控制", error);
+        }
+      }
+    },
+  },
+  data() {
+    return {};
+  },
+};
+</script>
+
+<style></style>

+ 2 - 2
control/components/prodnum-MT02/modules/division.vue

@@ -52,10 +52,10 @@
     </view>
     <My_input ref="MyInput" @customMethod="customMethod">
       <view class="change-item" v-if="changeItem.funcname">
+        <!-- :end="endTime" -->
         <picker
           mode="time"
           :value="changeItem.showValue.begin"
-          :end="endTime"
           data-name="begin"
           @change="timeChange"
         >
@@ -66,9 +66,9 @@
             </view>
           </view>
         </picker>
+        <!--  :start="changeItem.showValue.begin" -->
         <picker
           mode="time"
-          :start="changeItem.showValue.begin"
           :value="changeItem.showValue.end"
           data-name="end"
           @change="timeChange"

+ 276 - 238
control/components/prodnum-MT03/modules/division.vue

@@ -1,271 +1,309 @@
 <template>
-    <view class="control">
-        <view class="control-title">
-            分时控制
+  <view class="control">
+    <view class="control-title"> 分时控制 </view>
+    <view
+      class="item"
+      hover-class="navigator-hover"
+      v-for="item in list"
+      :key="item.index"
+      @click="onClick(item)"
+    >
+      <view class="title">
+        {{ item.funcname }}
+      </view>
+      <view class="row">
+        <view class="box">
+          <view class=""> 开始时间 </view>
+          <view class="content">
+            <view class="value">{{ item.showValue.begin || "--" }}</view>
+          </view>
         </view>
-        <view class="item" hover-class="navigator-hover" v-for="item in list" :key="item.index" @click="onClick(item)">
-            <view class="title">
-                {{ item.funcname }}
-            </view>
-            <view class="row">
-                <view class="box">
-                    <view class="">
-                        开始时间
-                    </view>
-                    <view class="content">
-                        <view class="value">{{ item.showValue.begin || '--' }}</view>
-                    </view>
-                </view>
-                <view class="box">
-                    <view class="">
-                        结束时间
-                    </view>
-                    <view class="content">
-                        <view class="value">{{ item.showValue.end || '--' }}</view>
-                    </view>
-                </view>
-                <view class="box">
-                    <view class="">
-                        流量设定
-                    </view>
-                    <view class="content">
-                        <view class="value">{{ item.showValue.value || '--' }}</view>
-                        <view class="unit">{{ item.params[item.funcname + "流量设定"].unit || '' }}</view>
-                    </view>
-                </view>
-            </view>
-            <view v-if="item.isfeedback" class="dot" />
+        <view class="box">
+          <view class=""> 结束时间 </view>
+          <view class="content">
+            <view class="value">{{ item.showValue.end || "--" }}</view>
+          </view>
         </view>
-        <My_input ref="MyInput" @customMethod="customMethod">
-            <view class="change-item" v-if="changeItem.funcname">
-                <picker mode="time" :value="changeItem.showValue.begin" :end="endTime" data-name="begin"
-                    @change="timeChange">
-                    <view class="row">
-                        <view class="label">
-                            开始时间:
-                        </view>
-                        <view class="value day-parting-row">{{ changeItem.showValue.begin || ' --' }}
-                        </view>
-                    </view>
-                </picker>
-                <picker mode="time" :start="changeItem.showValue.begin" :value="changeItem.showValue.end" data-name="end"
-                    @change="timeChange">
-                    <view class="row">
-                        <view class="label">
-                            结束时间:
-                        </view>
-                        <view class="value day-parting-row">{{ changeItem.showValue.end || ' --' }}</view>
-                    </view>
-                </picker>
-                <view class="row">
-                    <view class="label">
-                        流量设定:
-                    </view>
-                    <view class="value">
-                        <u-input :placeholder="changeItem.showValue.value || '流量设定'" v-model="changeItem.showValue.value"
-                            :type="changeItem.params[changeItem.funcname1 + '流量设定'].num_scale == 0 ? 'number' : 'digit'">
-                            <template slot="suffix">
-                                {{ changeItem.params[changeItem.funcname1 + '流量设定'].unit || '' }}
-                            </template>
-                        </u-input>
-                    </view>
-                </view>
-            </view>
-        </My_input>
+        <view class="box">
+          <view class=""> 流量设定 </view>
+          <view class="content">
+            <view class="value">{{ item.showValue.value || "--" }}</view>
+            <view class="unit">{{
+              item.params[item.funcname + "流量设定"].unit || ""
+            }}</view>
+          </view>
+        </view>
+      </view>
+      <view v-if="item.isfeedback" class="dot" />
     </view>
+    <My_input ref="MyInput" @customMethod="customMethod">
+      <view class="change-item" v-if="changeItem.funcname">
+        <!--  :end="endTime" data-name="begin" -->
+        <picker
+          mode="time"
+          :value="changeItem.showValue.begin"
+          @change="timeChange"
+        >
+          <view class="row">
+            <view class="label"> 开始时间: </view>
+            <view class="value day-parting-row"
+              >{{ changeItem.showValue.begin || " --" }}
+            </view>
+          </view>
+        </picker>
+        <!-- :start="changeItem.showValue.begin" -->
+        <picker
+          mode="time"
+          :value="changeItem.showValue.end"
+          data-name="end"
+          @change="timeChange"
+        >
+          <view class="row">
+            <view class="label"> 结束时间: </view>
+            <view class="value day-parting-row">{{
+              changeItem.showValue.end || " --"
+            }}</view>
+          </view>
+        </picker>
+        <view class="row">
+          <view class="label"> 流量设定: </view>
+          <view class="value">
+            <u-input
+              :placeholder="changeItem.showValue.value || '流量设定'"
+              v-model="changeItem.showValue.value"
+              :type="
+                changeItem.params[changeItem.funcname1 + '流量设定']
+                  .num_scale == 0
+                  ? 'number'
+                  : 'digit'
+              "
+            >
+              <template slot="suffix">
+                {{
+                  changeItem.params[changeItem.funcname1 + "流量设定"].unit ||
+                  ""
+                }}
+              </template>
+            </u-input>
+          </view>
+        </view>
+      </view>
+    </My_input>
+  </view>
 </template>
 
 <script>
 export default {
-    name: "division",
-    data() {
-        return {
-            list: [],
-            changeItem: {},
-            endTime: ""
-        }
+  name: "division",
+  data() {
+    return {
+      list: [],
+      changeItem: {},
+      endTime: "",
+    };
+  },
+  methods: {
+    loadData(newVal, Chinese = false) {
+      let reg = /^时段\d{1,5}$/,
+        count = 0,
+        list = [];
+      for (const key in newVal.function) {
+        if (reg.test(key)) count++;
+      }
+      let Nzh = require("nzh");
+      let nzhcn = require("nzh/cn"); //直接使用简体中文
+      for (let i = 1; i <= count; i++) {
+        let name = Chinese ? nzhcn.encodeS(i) : i;
+        let obj = newVal.function[`时段${i}`],
+          keyList = [
+            `时段${name}分钟开始`, //0
+            `时段${name}分钟结束`, //1
+            `时段${name}小时开始`, //2
+            `时段${name}小时结束`, //3
+            `时段${name}流量设定`, //4
+            `时间段${name}置位`, //5
+          ],
+          item = {
+            keyList,
+            index: i,
+            inputType: "slot",
+            paramValue: {
+              begin: newVal.paramcmdvalues[keyList[2]]
+                ? newVal.paramcmdvalues[keyList[2]] +
+                  ":" +
+                  newVal.paramcmdvalues[keyList[0]]
+                : "",
+              end: newVal.paramcmdvalues[keyList[3]]
+                ? newVal.paramcmdvalues[keyList[3]] +
+                  ":" +
+                  newVal.paramcmdvalues[keyList[1]]
+                : "",
+              value: newVal.paramcmdvalues[keyList[4]],
+            },
+            showValue: {
+              begin: newVal.paramvalues[keyList[2]]
+                ? newVal.paramvalues[keyList[2]] +
+                  ":" +
+                  newVal.paramvalues[keyList[0]]
+                : "",
+              end: newVal.paramvalues[keyList[3]]
+                ? newVal.paramvalues[keyList[3]] +
+                  ":" +
+                  newVal.paramvalues[keyList[1]]
+                : "",
+              value: newVal.paramvalues[keyList[4]],
+            },
+            params: {},
+          };
+        keyList.forEach((key) => {
+          item.params[key] = newVal.params[key];
+        });
+        obj.funcname1 = "时段" + nzhcn.encodeS(i);
+        item.isfeedback =
+          newVal.isfeedback &&
+          (obj.paramValue.begin || obj.paramValue.end || obj.paramValue.value)
+            ? true
+            : false;
+        list.push(Object.assign(obj, item));
+      }
+      this.list = list;
     },
-    methods: {
-        loadData(newVal, Chinese = false) {
-            let reg = /^时段\d{1,5}$/,
-                count = 0,
-                list = [];
-            for (const key in newVal.function) {
-                if (reg.test(key)) count++
-            }
-            let Nzh = require("nzh");
-            let nzhcn = require("nzh/cn"); //直接使用简体中文
-            for (let i = 1; i <= count; i++) {
-                let name = Chinese ? nzhcn.encodeS(i) : i;
-                let obj = newVal.function[`时段${i}`],
-                    keyList = [
-                        `时段${name}分钟开始`,//0
-                        `时段${name}分钟结束`,//1
-                        `时段${name}小时开始`,//2
-                        `时段${name}小时结束`,//3
-                        `时段${name}流量设定`,//4
-                        `时间段${name}置位`,//5
-                    ],
-                    item = {
-                        keyList,
-                        index: i,
-                        inputType: "slot",
-                        paramValue: {
-                            begin: newVal.paramcmdvalues[keyList[2]] ? newVal.paramcmdvalues[keyList[2]] + ":" + newVal.paramcmdvalues[keyList[0]] : "",
-                            end: newVal.paramcmdvalues[keyList[3]] ? newVal.paramcmdvalues[keyList[3]] + ":" + newVal.paramcmdvalues[keyList[1]] : "",
-                            value: newVal.paramcmdvalues[keyList[4]]
-                        },
-                        showValue: {
-                            begin: newVal.paramvalues[keyList[2]] ? newVal.paramvalues[keyList[2]] + ":" + newVal.paramvalues[keyList[0]] : "",
-                            end: newVal.paramvalues[keyList[3]] ? newVal.paramvalues[keyList[3]] + ":" + newVal.paramvalues[keyList[1]] : "",
-                            value: newVal.paramvalues[keyList[4]]
-                        },
-                        params: {}
-                    };
-                keyList.forEach(key => {
-                    item.params[key] = newVal.params[key];
-                });
-                obj.funcname1 = "时段" + nzhcn.encodeS(i);
-                item.isfeedback = (newVal.isfeedback && (obj.paramValue.begin || obj.paramValue.end || obj.paramValue.value)) ? true : false;
-                list.push(Object.assign(obj, item))
-            }
-            this.list = list;
-        },
-        onClick(item) {
-            this.changeItem = JSON.parse(JSON.stringify(item));
-            this.endTime = this.changeItem.showValue.end == '0:0' ? "" : this.changeItem.showValue.end;
-            let toBeUpdated = [];
-            if (item.paramValue.begin) toBeUpdated.push(`开始时间:${item.paramValue.begin}`);
-            if (item.paramValue.end) toBeUpdated.push(`结束时间:${item.paramValue.begin}`);
-            if (item.paramValue.value) toBeUpdated.push(`流量设定:${item.paramValue.value}`);
-            if (toBeUpdated.length) {
-                model.toBeUpdated = '待更新记录:' + toBeUpdated.join(",")
-            }
-            this.$refs.MyInput.openInput(item, item.inputType != "switch")
-            console.log("时段设置", item)
-        },
-        timeChange(e) {
-            const name = e.currentTarget.dataset.name;
-            this.changeItem.showValue[name] = e.detail.value;
-        },
-        customMethod() {
-            const {
-                showValue,
-                w_functionid,
-                params,
-                index,
-            } = this.changeItem,
-                MyInput = this.$refs.MyInput;
-            if (!showValue.begin) return MyInput.submitBreak("还未填写开始时间")
-            if (!showValue.end) return MyInput.submitBreak("还未填写结束时间")
-            if ((showValue.value + '').length == 0) return MyInput.submitBreak("还未设定流量")
-            let Nzh = require("nzh");
-            let nzhcn = require("nzh/cn"); //直接使用简体中文
-            let funcname = '时段' + nzhcn.encodeS(index)
-            console.log('输入值:', showValue.value)
-            showValue.value = (showValue.value - 0).toFixed(params[funcname + '流量设定'].num_scale)
-            console.log('流量设定:', params[funcname + '流量设定'])
-            console.log('发送值:', showValue.value)
-            let obj = {
-                [funcname + "分钟开始"]: showValue.begin.split(":")[1],
-                [funcname + "小时开始"]: showValue.begin.split(":")[0],
-                [funcname + "分钟结束"]: showValue.end.split(":")[1],
-                [funcname + "小时结束"]: showValue.end.split(":")[0],
-                [funcname + "流量设定"]: showValue.value,
-                [`时间段${nzhcn.encodeS(index)}置位`]: params[`时间段${nzhcn.encodeS(index)}置位`].lastvalue
-            }
-            console.log("发送请求", obj)
-            MyInput.submit(w_functionid, obj)
-        }
-    }
-}
+    onClick(item) {
+      this.changeItem = JSON.parse(JSON.stringify(item));
+      this.endTime =
+        this.changeItem.showValue.end == "0:0"
+          ? ""
+          : this.changeItem.showValue.end;
+      let toBeUpdated = [];
+      if (item.paramValue.begin)
+        toBeUpdated.push(`开始时间:${item.paramValue.begin}`);
+      if (item.paramValue.end)
+        toBeUpdated.push(`结束时间:${item.paramValue.begin}`);
+      if (item.paramValue.value)
+        toBeUpdated.push(`流量设定:${item.paramValue.value}`);
+      if (toBeUpdated.length) {
+        model.toBeUpdated = "待更新记录:" + toBeUpdated.join(",");
+      }
+      this.$refs.MyInput.openInput(item, item.inputType != "switch");
+      console.log("时段设置", item);
+    },
+    timeChange(e) {
+      const name = e.currentTarget.dataset.name;
+      this.changeItem.showValue[name] = e.detail.value;
+    },
+    customMethod() {
+      const { showValue, w_functionid, params, index } = this.changeItem,
+        MyInput = this.$refs.MyInput;
+      if (!showValue.begin) return MyInput.submitBreak("还未填写开始时间");
+      if (!showValue.end) return MyInput.submitBreak("还未填写结束时间");
+      if ((showValue.value + "").length == 0)
+        return MyInput.submitBreak("还未设定流量");
+      let Nzh = require("nzh");
+      let nzhcn = require("nzh/cn"); //直接使用简体中文
+      let funcname = "时段" + nzhcn.encodeS(index);
+      console.log("输入值:", showValue.value);
+      showValue.value = (showValue.value - 0).toFixed(
+        params[funcname + "流量设定"].num_scale
+      );
+      console.log("流量设定:", params[funcname + "流量设定"]);
+      console.log("发送值:", showValue.value);
+      let obj = {
+        [funcname + "分钟开始"]: showValue.begin.split(":")[1],
+        [funcname + "小时开始"]: showValue.begin.split(":")[0],
+        [funcname + "分钟结束"]: showValue.end.split(":")[1],
+        [funcname + "小时结束"]: showValue.end.split(":")[0],
+        [funcname + "流量设定"]: showValue.value,
+        [`时间段${nzhcn.encodeS(index)}置位`]:
+          params[`时间段${nzhcn.encodeS(index)}置位`].lastvalue,
+      };
+      console.log("发送请求", obj);
+      MyInput.submit(w_functionid, obj);
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
 /* 边框 */
 .day-parting-row {
-    display: flex;
-    align-items: center;
-    flex: 1;
-    width: 0;
-    border: 1px solid #dadbde;
-    border-radius: 4px;
-    padding: 6px 9px;
-    height: 35px;
-    font-size: 14px;
-    box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  flex: 1;
+  width: 0;
+  border: 1px solid #dadbde;
+  border-radius: 4px;
+  padding: 6px 9px;
+  height: 35px;
+  font-size: 14px;
+  box-sizing: border-box;
 }
 
 .item {
-    position: relative;
-    padding: 4px 6px 6px;
-    box-sizing: border-box;
-    background: #fff;
-    border-radius: 4px;
-    margin-bottom: 5px;
+  position: relative;
+  padding: 4px 6px 6px;
+  box-sizing: border-box;
+  background: #fff;
+  border-radius: 4px;
+  margin-bottom: 5px;
 
-    .title {
-        margin-bottom: 6px;
-        font-weight: bold;
-    }
-
-    .row {
-        display: flex;
+  .title {
+    margin-bottom: 6px;
+    font-weight: bold;
+  }
 
-        .box {
-            width: 33.33%;
+  .row {
+    display: flex;
 
-            .content {
-                display: flex;
-                margin-top: 6px;
-                align-items: flex-end;
+    .box {
+      width: 33.33%;
 
-                .value {
-                    width: 0;
-                    flex: 1;
-                    color: #333;
-                    font-size: 16px;
-                    flex-shrink: 0;
-                    font-weight: bold;
-                }
+      .content {
+        display: flex;
+        margin-top: 6px;
+        align-items: flex-end;
 
-                .unit {
-                    font-size: 10px;
-                    color: #666;
-                    flex-shrink: 0;
-                    max-width: 50px;
-                }
-            }
+        .value {
+          width: 0;
+          flex: 1;
+          color: #333;
+          font-size: 16px;
+          flex-shrink: 0;
+          font-weight: bold;
         }
 
-
+        .unit {
+          font-size: 10px;
+          color: #666;
+          flex-shrink: 0;
+          max-width: 50px;
+        }
+      }
     }
+  }
 
-    .dot {
-        position: absolute;
-        right: 2px;
-        top: 2px;
-        width: 10px;
-        height: 10px;
-        background: #D9001B;
-        border-radius: 50%;
-    }
+  .dot {
+    position: absolute;
+    right: 2px;
+    top: 2px;
+    width: 10px;
+    height: 10px;
+    background: #d9001b;
+    border-radius: 50%;
+  }
 }
 
 .change-item {
+  .row {
+    display: flex;
+    align-items: center;
+    line-height: 35px;
+    width: 100%;
+    margin-top: 4px;
 
-    .row {
-        display: flex;
-        align-items: center;
-        line-height: 35px;
-        width: 100%;
-        margin-top: 4px;
-
-        .label {
-            width: 80px;
-            flex-shrink: 0;
-        }
+    .label {
+      width: 80px;
+      flex-shrink: 0;
     }
-
+  }
 }
 </style>

+ 25 - 5
control/modules/My_input.vue

@@ -343,8 +343,15 @@ export default {
           precision: num_scale,
         }).format()
       ).value;
+<<<<<<< HEAD
       if (num_minvalue && this.value < num_minvalue) this.value = num_minvalue - 0;
       if (num_maxvalue && this.value > num_maxvalue) this.value = num_maxvalue - 0;
+=======
+      if (num_minvalue != "" && this.value < num_minvalue)
+        this.value = num_minvalue - 0;
+      if (num_maxvalue != "" && this.value > num_maxvalue)
+        this.value = num_maxvalue - 0;
+>>>>>>> MT01
       this.stepIsCalculate = false;
       if (this.stagingMethod) this.confirm();
     },
@@ -367,11 +374,15 @@ export default {
         value = "";
       if (item.inputType == "int" || item.inputType == "step") {
         value = this.value - 0;
+<<<<<<< HEAD
         // if (value == 0) return this.submitBreak("还未输入值");
+=======
+        if (String(value).length == 0) return this.submitBreak("还未输入值");
+>>>>>>> MT01
         if (params.num_scale != 0) value = value.toFixed(params.num_scale);
-        if (params.num_minvalue && value < params.num_minvalue)
+        if (params.num_minvalue && value - 0 < params.num_minvalue - 0)
           return this.submitBreak("输入值小于最低范围");
-        if (params.num_maxvalue && value > params.num_maxvalue)
+        if (params.num_maxvalue && value - 0 > params.num_maxvalue - 0)
           return this.submitBreak("输入值大于最大范围");
       } else if (item.inputType == "switch") {
         let value = item.paramName;
@@ -394,12 +405,16 @@ export default {
         return this.submit(item.w_functionid, value);
       } else if (item.inputType == "dayParting") {
         value = this.value - 0;
+<<<<<<< HEAD
         // if (value == 0) return this.submitBreak("还未输入值");
+=======
+        if (String(value).length == 0) return this.submitBreak("还未输入值");
+>>>>>>> MT01
         let p = item.params[item.key + "P"];
         if (p.num_scale != 0) value = value.toFixed(p.num_scale);
-        if (p.num_minvalue && value > p.num_minvalue)
+        if (p.num_minvalue && value - 0 > p.num_minvalue - 0)
           return this.submitBreak("输入值小于最低范围");
-        if (p.num_maxvalue && value < p.num_maxvalue)
+        if (p.num_maxvalue && value - 0 < p.num_maxvalue - 0)
           return this.submitBreak("输入值大于最大范围");
         return this.submit(item.w_functionid, {
           [item.key + "P"]: value,
@@ -430,7 +445,12 @@ export default {
         this.checkBeforeSending(w_functionid, params);
         return;
       }
-      if (this.stepIsCalculate) return (this.stagingMethod = true);
+      if (this.stepIsCalculate) {
+        this.stagingMethod = true;
+        return;
+      } else {
+        this.stagingMethod = false;
+      }
       this.loading = true;
       let res = await this.$Http.setControlItem(w_functionid, params);
       this.loading = false;

+ 1 - 0
control/pages.js

@@ -3,6 +3,7 @@ module.exports = {
         let obj = {
             "06": 'prodnum-06',
             "BT01": 'prodnum-06',
+            "MT01": "prodnum-MT01",
             "MT02": "prodnum-MT02",
             'MT03': "prodnum-MT03",
             'MT04': "prodnum-MT03",

+ 1 - 1
manifest.json

@@ -64,7 +64,7 @@
         "usingComponents" : true,
         "permission" : {
             "scope.userLocation" : {
-                "desc": "为了完善打卡签到信息,请确认获取当前所在位置"
+                "desc" : "为了完善打卡签到信息,请确认获取当前所在位置"
             }
         },
         "requiredPrivateInfos" : [ "getLocation" ]

+ 2 - 1
pages/facility/modules/control.vue

@@ -1,8 +1,9 @@
 <template>
     <view class="container" v-show="show">
         <prodnum-06 v-if="detail.miniapppath == 'prodnum-06'" :control="control" />
-        <prodnum-MT03 v-else-if="detail.miniapppath == 'prodnum-MT03'" :control="control" />
+        <prodnum-MT01 v-else-if="detail.miniapppath == 'prodnum-MT01'" :control="control" />
         <prodnum-MT02 v-else-if="detail.miniapppath == 'prodnum-MT02'" :control="control" />
+        <prodnum-MT03 v-else-if="detail.miniapppath == 'prodnum-MT03'" :control="control" />
         <prodnum-YK01 v-else-if="detail.miniapppath == 'prodnum-YK01'" :control="control" />
         <prodnum-FW01 v-else-if="detail.miniapppath == 'prodnum-FW01'" :control="control" />
         <block v-else>

+ 4 - 1
utils/tool.js

@@ -37,6 +37,7 @@ function mount() {
         return new Promise((resolve, reject) => {
             let that = this;
             handle()
+
             function handle() {
                 uni.getLocation({
                     altitude: true,
@@ -161,7 +162,9 @@ function mount() {
                     list[key].paramName = original;
                     list[key].inputType = 'switch';
                     list[key].showValue = "";
-                    if (list[key].params.lastvalue + '') list[key].showValue = list[key].params.options.find(v => v.value == list[key].params.lastvalue).label || ""
+                    try {
+                        if (list[key].params.lastvalue + '') list[key].showValue = list[key].params.options.find(v => v.value == list[key].params.lastvalue).label || ""
+                    } catch (error) {}
                 } else {
                     list[key].inputType = list[key].params.num_step ? 'step' : 'int';
                 }