prodnum-MT03.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <view>
  3. <view class="control-title">控制面板</view>
  4. <pilotLamp ref="pilotLamp" />
  5. <view style="height: 20px;" />
  6. <mpattern ref="控制方式" />
  7. <tabs :control="control" />
  8. <division ref="division" />
  9. </view>
  10. </template>
  11. <script>
  12. import mpattern from "./modules/mpattern"
  13. import tabs from "./modules/tabs"
  14. import pilotLamp from "./modules/pilotLamp"
  15. import division from "./modules/division"
  16. export default {
  17. name: 'prodnum-MT03',
  18. components: { mpattern, tabs, pilotLamp, division },
  19. props: {
  20. control: Object
  21. },
  22. watch: {
  23. control: function (newVal) {
  24. if (newVal) {
  25. console.log('MT03', newVal)
  26. try {
  27. this.$refs.pilotLamp.list = [{
  28. name: "就地",
  29. value: getBoole('自动信号')
  30. }, {
  31. name: "远程",
  32. value: getBoole('自动信号', 0)
  33. }, {
  34. name: "开到位",
  35. value: getBoole('开到位')
  36. }, {
  37. name: "关到位",
  38. value: getBoole('关到位')
  39. }, {
  40. name: "故障位",
  41. value: getBoole('故障')
  42. }, {
  43. name: "失压警告",
  44. value: getBoole('失压警告')
  45. }, {
  46. name: "失压报警",
  47. value: getBoole('失压报警')
  48. }, {
  49. name: "超流量警告",
  50. value: getBoole('超流量警告')
  51. }, {
  52. name: "超流量报警",
  53. value: getBoole('超流量报警')
  54. }, {
  55. name: "强制关断",
  56. value: getBoole('强制关断')
  57. }, {
  58. name: "阀门故障",
  59. value: getBoole('阀门故障')
  60. }, {
  61. name: "PLC电量低报警",
  62. value: getBoole('PLC电量低报警')
  63. }]
  64. function getBoole(name, expect = 1) {
  65. try {
  66. return newVal.paramvalues[name] == expect
  67. } catch (error) {
  68. console.error("getBoole取值出错项", name)
  69. return false
  70. }
  71. }
  72. console.log(this.$refs.pilotLamp.list)
  73. } catch (error) {
  74. console.error("MT03指示灯", error)
  75. }
  76. try {
  77. this.$refs.控制方式.ctrlModel = this.__proto__.getControlItem(['控制方式'], newVal, { Ctrl: "radio" })[0];
  78. } catch (error) {
  79. console.error("MT03控制方式", error)
  80. }
  81. try {
  82. let division = this.$refs.division;
  83. division && division.loadData(newVal)
  84. } catch (error) {
  85. console.error("MT03分时控制", error)
  86. }
  87. } else {
  88. }
  89. }
  90. },
  91. data() {
  92. return {
  93. }
  94. },
  95. }
  96. </script>
  97. <style></style>