123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- <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>
|