123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <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-MT03',
- components: { mpattern, tabs, pilotLamp, division },
- props: {
- control: Object
- },
- watch: {
- control: function (newVal) {
- if (newVal) {
- console.log('MT03', newVal)
- try {
- this.$refs.pilotLamp.list = [{
- name: "就地",
- value: getBoole('自动信号')
- }, {
- name: "远程",
- value: getBoole('自动信号', 0)
- }, {
- name: "开到位",
- value: getBoole('开到位')
- }, {
- name: "关到位",
- value: getBoole('关到位')
- }, {
- name: "故障位",
- value: getBoole('故障')
- }, {
- name: "失压警告",
- value: getBoole('失压警告')
- }, {
- name: "失压报警",
- value: getBoole('失压报警')
- }, {
- name: "超流量警告",
- value: getBoole('超流量警告')
- }, {
- name: "超流量报警",
- value: getBoole('超流量报警')
- }, {
- name: "强制关断",
- value: getBoole('强制关断')
- }, {
- name: "阀门故障",
- value: getBoole('阀门故障')
- }, {
- name: "PLC电量低报警",
- value: getBoole('PLC电量低报警')
- }]
- function getBoole(name, expect = 1) {
- try {
- return newVal.paramvalues[name] == expect
- } catch (error) {
- console.error("getBoole取值出错项", name)
- return false
- }
- }
- console.log(this.$refs.pilotLamp.list)
- } catch (error) {
- console.error("MT03指示灯", error)
- }
- try {
- this.$refs.控制方式.ctrlModel = this.__proto__.getControlItem(['控制方式'], newVal, { Ctrl: "radio" })[0];
- } catch (error) {
- console.error("MT03控制方式", error)
- }
- try {
- let division = this.$refs.division;
- division && division.loadData(newVal)
- } catch (error) {
- console.error("MT03分时控制", error)
- }
- } else {
- }
- }
- },
- data() {
- return {
- }
- },
- }
- </script>
- <style></style>
|