prodnum-06.vue 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <view class="container">
  3. <!-- 控制模式 -->
  4. <mpattern ref="mpattern" />
  5. <!-- 基础控制 -->
  6. <basics ref="basics" />
  7. <!-- 分时开关 -->
  8. <division ref="division" />
  9. </view>
  10. </template>
  11. <script>
  12. import mpattern from './modules/mpattern.vue'
  13. import basics from './modules/basics.vue'
  14. import division from './modules/division.vue'
  15. export default {
  16. name: "prodnum-06",
  17. components: { mpattern, basics, division },
  18. props: {
  19. control: Object
  20. },
  21. watch: {
  22. control: function (newVal) {
  23. if (newVal) {
  24. try {
  25. let nameList = ['Flow control', 'pressure control', 'Config', 'Sleep time', 'Pilot valve', 'Minimum', 'MOP']
  26. this.$refs.basics.itemList = this.__proto__.getControlItem(nameList, newVal)
  27. this.$refs.basics.preview = ['Batt4', 'Batt12', 'BatFlow'].map(v => {
  28. return newVal.params[v]
  29. })
  30. } catch (error) {
  31. console.error("06基础控制", error)
  32. }
  33. try {
  34. let division = this.$refs.division;
  35. division && division.loadData(newVal.function, newVal.paramcmdvalues, newVal.params, newVal.isfeedback)
  36. division.timeControl = this.__proto__.getControlItem(["TimeControl"], newVal)[0]
  37. } catch (error) {
  38. console.error("06分时控制", error)
  39. }
  40. try {
  41. let ctrlModel = this.__proto__.getControlItem(['Ctrl'], newVal, { Ctrl: "radio" })[0]
  42. this.$refs.mpattern.ctrlModel = ctrlModel;
  43. let lastvalue = ctrlModel.params.lastvalue - 0;
  44. this.$refs.mpattern.list = [{
  45. now: newVal.params['DownP'],
  46. tar: this.__proto__.getControlItem(['Downstream'], newVal)[0],
  47. current: lastvalue == 1
  48. }, {
  49. now: newVal.params['NowFlow'],
  50. tar: this.__proto__.getControlItem(['Constantflow'], newVal)[0],
  51. current: lastvalue == 2
  52. }, {
  53. now: newVal.params['MostBad'],
  54. tar: this.__proto__.getControlItem(['unfavorable'], newVal)[0],
  55. current: lastvalue == 3
  56. }];
  57. } catch (error) {
  58. console.error("06控制模式", error)
  59. }
  60. try {
  61. this.$Http.openNetwork(newVal.params.RSSI.lastvalue)
  62. } catch (error) {
  63. setTimeout(this.$Http.openNetwork(newVal.params.RSSI.lastvalue), 100)
  64. console.error("06信号强度", error)
  65. };
  66. } else {
  67. }
  68. }
  69. }
  70. }
  71. </script>