prodnum-MT02.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. this.$refs.basics.ctrlModel = this.__proto__.getControlItem(['Control'], newVal, { Control: "radioNum" })[0];
  22. this.$refs.basics.list = ["MostBad", "FaWei", "NowFlow", "CumFlow"].map(v => newVal.params[v])
  23. try {
  24. const replenish = {
  25. TimeConOFF: 0,
  26. TimeConON: 0,
  27. };
  28. let lastvalue = this.__proto__.getControlItem(["TimeCon"], JSON.parse(JSON.stringify(newVal)))[0].params.options.lastvalue
  29. if (lastvalue == 1) {
  30. replenish.TimeConON = 1;
  31. } else {
  32. replenish.TimeConOFF = 1;
  33. }
  34. this.$refs.basics.replenish = replenish;
  35. } catch (error) {
  36. console.log('获取分时补充字段失败', error)
  37. }
  38. console.log(this.$refs.basics.ctrlModel)
  39. switch (this.$refs.basics.ctrlModel.showValue) {
  40. case '远程不利点模式':
  41. this.$refs.basics.subcontrol = this.__proto__.getControlItem(['Tarb'], newVal)[0];
  42. break;
  43. case '远程开关阀模式':
  44. this.$refs.basics.subcontrol = this.__proto__.getControlItem(['RC'], newVal)[0];
  45. break;
  46. case '恒压控制启动':
  47. this.$refs.basics.subcontrol = this.__proto__.getControlItem(['DownTar'], newVal)[0];
  48. break;
  49. default:
  50. this.$refs.basics.subcontrol = null;
  51. break;
  52. }
  53. } catch (error) {
  54. console.error("MT02控制模式", error)
  55. }
  56. try {
  57. let division = this.$refs.division;
  58. division && division.loadData(newVal)
  59. } catch (error) {
  60. console.error("MT02分时控制", error)
  61. }
  62. } else {
  63. }
  64. }
  65. },
  66. data() {
  67. return {
  68. }
  69. },
  70. }
  71. </script>
  72. <style></style>