prodnum-MT02.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <view>
  3. <view class="control-title">控制面板</view>
  4. <basics ref="basics" />
  5. <division ref="division" />
  6. </view>
  7. </template>
  8. <script>
  9. import basics from "./modules/basics";
  10. import division from "./modules/division";
  11. export default {
  12. name: "prodnum-MT02",
  13. components: { basics, division },
  14. props: {
  15. control: Object,
  16. },
  17. watch: {
  18. control: function (newVal) {
  19. if (newVal) {
  20. try {
  21. let ctrlModel = this.__proto__.getControlItem(["Control"], newVal, {
  22. Control: "radioNum",
  23. })[0];
  24. ctrlModel.params.options = ctrlModel.params.options.filter(
  25. (v) => v.label != "恒压控制停止"
  26. );
  27. this.$refs.basics.ctrlModel = ctrlModel;
  28. console.log(
  29. "this.$refs.basics.ctrlModel",
  30. this.$refs.basics.ctrlModel
  31. );
  32. this.$refs.basics.list = [
  33. "MostBad",
  34. "FaWei",
  35. "NowFlow",
  36. "CumFlow",
  37. ].map((v) => newVal.params[v]);
  38. try {
  39. const replenish = {
  40. TimeConOFF: 1,
  41. TimeConON: 0,
  42. };
  43. const TimeConON = this.__proto__.getControlItem(
  44. ["TimeCon"],
  45. JSON.parse(JSON.stringify(newVal))
  46. )[0].paramName.TimeConON;
  47. if (TimeConON == 1) {
  48. this.$refs.basics.ctrlModel.showValue = "分时控制模式";
  49. // replenish.TimeConON = 1;
  50. } else {
  51. // replenish.TimeConOFF = 1;
  52. }
  53. this.$refs.basics.replenish = replenish;
  54. } catch (error) {
  55. console.log("获取分时补充字段失败", error);
  56. }
  57. console.log(this.$refs.basics.ctrlModel);
  58. switch (this.$refs.basics.ctrlModel.showValue) {
  59. case "远程不利点模式":
  60. this.$refs.basics.subcontrol = this.__proto__.getControlItem(
  61. ["Tarb"],
  62. newVal
  63. )[0];
  64. break;
  65. case "远程开关阀模式":
  66. this.$refs.basics.subcontrol = this.__proto__.getControlItem(
  67. ["RC"],
  68. newVal
  69. )[0];
  70. break;
  71. case "恒压控制启动":
  72. this.$refs.basics.subcontrol = this.__proto__.getControlItem(
  73. ["DownTar"],
  74. newVal
  75. )[0];
  76. break;
  77. default:
  78. this.$refs.basics.subcontrol = null;
  79. break;
  80. }
  81. } catch (error) {
  82. console.error("MT02控制模式", error);
  83. }
  84. try {
  85. let division = this.$refs.division;
  86. division && division.loadData(newVal);
  87. } catch (error) {
  88. console.error("MT02分时控制", error);
  89. }
  90. } else {
  91. }
  92. },
  93. },
  94. onUnload() {
  95. delete this.$Http.changeOptions;
  96. },
  97. };
  98. </script>
  99. <style></style>