index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <div
  3. class="operator-app-container"
  4. :style="{
  5. '--op-border-color': '#d9d9d9',
  6. '--op-text-color-fff': '#fff',
  7. }"
  8. >
  9. <a-layout class="operator-large-layout">
  10. <a-layout-header class="operator-header cover">
  11. <div class="shift-wrapper"> {{ shiftText }} </div>
  12. <div class="clock-wrapper">
  13. <div class="date">{{ clockObj.date }}</div>
  14. <div class="week">{{ clockObj.week }}</div>
  15. <div class="time">{{ clockObj.time }}</div>
  16. </div>
  17. </a-layout-header>
  18. <a-layout-content class="operator-content">
  19. <head-top @shiftChange="curShiftChange" ref="headTopRef" @lengthChange="(v) => ((lengthList = v), (lengthorgList = cloneDeep(v)))" />
  20. <div class="operator-content-wrapper flex">
  21. <div class="operator-content-left">
  22. <heat-list
  23. v-if="curShiftInfo.shift != undefined && curShiftInfo.shiftGroup != undefined"
  24. :ccmNo="ccmNo"
  25. :carRef="carRef"
  26. :lengthList="lengthList"
  27. :lengthOrgList="lengthorgList"
  28. @changeLengthSuccess="() => headTopRef && headTopRef.reload()"
  29. :curShiftInfo="curShiftInfo"
  30. />
  31. </div>
  32. <div class="operator-content-right">
  33. <car :ccmNo="ccmNo" ref="carRef" />
  34. </div>
  35. </div>
  36. </a-layout-content>
  37. </a-layout>
  38. </div>
  39. </template>
  40. <script setup lang="ts" name="OperatorRoom">
  41. import { onMounted, onUnmounted, ref } from 'vue';
  42. import { getDateTimeWeek } from '/@/utils/dateUtil';
  43. import { useTimeoutFn } from '/@/hooks/core/useTimeout';
  44. import headTop from './components/headTop.vue';
  45. import car from './components/car.vue';
  46. import heatList from './components/heatList.vue';
  47. import { getMachineNum } from '../hotDelivery/common.data';
  48. import { cloneDeep } from 'lodash-es';
  49. const ccmNo = getMachineNum();
  50. const carRef = ref();
  51. const headTopRef = ref();
  52. // 班次信息
  53. const shiftText = ref('');
  54. const curShiftInfo = ref({
  55. shift: undefined,
  56. shiftGroup: undefined,
  57. });
  58. // 时钟
  59. const clockObj = ref({
  60. date: '',
  61. week: '',
  62. time: '',
  63. });
  64. const lengthList = ref({
  65. '1': undefined,
  66. '2': undefined,
  67. '3': undefined,
  68. '4': undefined,
  69. '5': undefined,
  70. '6': undefined,
  71. '7': undefined,
  72. '8': undefined,
  73. });
  74. const lengthorgList = ref({
  75. '1': undefined,
  76. '2': undefined,
  77. '3': undefined,
  78. '4': undefined,
  79. '5': undefined,
  80. '6': undefined,
  81. '7': undefined,
  82. '8': undefined,
  83. });
  84. const clock = () => {
  85. try {
  86. const dateStr = getDateTimeWeek().split(' ');
  87. clockObj.value = {
  88. date: dateStr[0],
  89. time: dateStr[1],
  90. week: dateStr[2],
  91. };
  92. start();
  93. } catch (error) {}
  94. };
  95. const { start, stop } = useTimeoutFn(clock, 1000);
  96. // 获取班次信息
  97. const curShiftChange = (v, shiftInfo) => {
  98. shiftText.value = v;
  99. curShiftInfo.value = shiftInfo;
  100. };
  101. onMounted(() => {
  102. start();
  103. });
  104. onUnmounted(() => {
  105. stop();
  106. });
  107. </script>
  108. <style lang="less" scoped>
  109. @import '/@/assets/less/font.less';
  110. @import './index.less';
  111. </style>