| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <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('自动信号', 0)
- }, {
- name: "远程",
- value: getBoole('自动信号')
- }, {
- name: "开到位",
- value: getBoole('开到位')
- }, {
- name: "关到位",
- value: getBoole('关到位')
- }, {
- name: "故障位",
- value: getBoole('故障灯')
- }]
- function getBoole(name, expect = 1) {
- try {
- return newVal.paramvalues[name].lastvalue == expect
- } catch (error) {
- console.log("getBoole取值出错项", name)
- return false
- }
- }
- } 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>
|