prodnum-FW01.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <view>
  3. <view style="height: 20px" />
  4. <basics ref="basics" />
  5. <pilotLamp ref="pilotLamp" itemW="21%" />
  6. <view class="control-title">设备参数</view>
  7. <preview ref="preview" />
  8. <control-panel ref="mpattern" />
  9. </view>
  10. </template>
  11. <script>
  12. import controlPanel from "../prodnum-YK01/modules/controlPanel.vue";
  13. import preview from "../prodnum-YK01/modules/preview.vue";
  14. import pilotLamp from "../prodnum-MT03/modules/pilotLamp.vue";
  15. import basics from "./modules/basics.vue";
  16. export default {
  17. name: "prodnum-FW01",
  18. components: { controlPanel, pilotLamp, preview, basics },
  19. props: {
  20. control: Object,
  21. },
  22. watch: {
  23. control: function (newVal) {
  24. if (newVal) {
  25. try {
  26. this.$refs.preview.list = [
  27. newVal.params["U002"],
  28. newVal.params["U003"],
  29. ];
  30. } catch (error) {
  31. console.error("FW01设备状态", error);
  32. }
  33. try {
  34. this.$refs.mpattern.itemList = this.__proto__.getControlItem(
  35. ["上传时间间隔", "开度变更提醒值"],
  36. newVal
  37. );
  38. } catch (error) {
  39. console.error("FW01控制面板", error);
  40. }
  41. try {
  42. this.$refs.pilotLamp.list = [
  43. {
  44. name: "开度变动提醒",
  45. value: getBoole("A005"),
  46. },
  47. {
  48. name: "低电量提醒",
  49. value: getBoole("A002"),
  50. },
  51. ];
  52. if (getBoole("A005")) {
  53. this.$refs.basics.ctrlModel = this.__proto__.getControlItem(
  54. ["开度提醒复位"],
  55. newVal
  56. )[0];
  57. console.log("ctrlModel",this.$refs.basics.ctrlModel);
  58. }
  59. function getBoole(name, expect = 1) {
  60. try {
  61. return newVal.paramvalues[name] == expect;
  62. } catch (error) {
  63. console.log("getBoole取值出错项", name);
  64. return false;
  65. }
  66. }
  67. } catch (error) {
  68. console.error("FW01指示灯", error);
  69. }
  70. try {
  71. this.$Http.openNetwork(newVal.params.U004.lastvalue);
  72. } catch (error) {
  73. setTimeout(this.$Http.openNetwork(newVal.params.U004.lastvalue), 100);
  74. console.error("06信号强度", error);
  75. }
  76. } else {
  77. }
  78. },
  79. },
  80. };
  81. </script>
  82. <style lang="scss" scoped>
  83. /deep/.pilotLamp .item {
  84. width: 21% !important;
  85. }
  86. </style>