prodnum-MT02.vue 2.9 KB

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