prodnum-MT03.vue 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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('自动信号', 0)
  30. }, {
  31. name: "远程",
  32. value: getBoole('自动信号')
  33. }, {
  34. name: "开到位",
  35. value: getBoole('开到位')
  36. }, {
  37. name: "关到位",
  38. value: getBoole('关到位')
  39. }, {
  40. name: "故障位",
  41. value: getBoole('故障灯')
  42. }]
  43. function getBoole(name, expect = 1) {
  44. try {
  45. return newVal.paramvalues[name].lastvalue == expect
  46. } catch (error) {
  47. console.log("getBoole取值出错项", name)
  48. return false
  49. }
  50. }
  51. } catch (error) {
  52. console.error("MT03指示灯", error)
  53. }
  54. try {
  55. this.$refs.控制方式.ctrlModel = this.__proto__.getControlItem(['控制方式'], newVal, { Ctrl: "radio" })[0];
  56. } catch (error) {
  57. console.error("MT03控制方式", error)
  58. }
  59. try {
  60. let division = this.$refs.division;
  61. division && division.loadData(newVal)
  62. } catch (error) {
  63. console.error("MT03分时控制", error)
  64. }
  65. } else {
  66. }
  67. }
  68. },
  69. data() {
  70. return {
  71. }
  72. },
  73. }
  74. </script>
  75. <style></style>