index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <MpWebviewShell class="mp-dispatch-edge-to-edge" @ready="ready = true">
  3. <div class="mp-dispatch-tabs" :style="{ '--dispatch-header-height': `${headerHeight}px` }">
  4. <div ref="header" class="mp-dispatch-top">
  5. <MpBusinessHeader title="派车日历" back-label="返回工作台" @back="goToMiniWorkbench" />
  6. <van-tabs v-model:active="active" shrink color="#0a9f6d" title-active-color="#087f57">
  7. <van-tab title="酸派车日历" name="acid" />
  8. <van-tab title="碱派车日历" name="alkali" />
  9. <van-tab title="其他日历" name="other" />
  10. <van-tab title="实际派车信息" name="actual" />
  11. </van-tabs>
  12. </div>
  13. <template v-if="ready">
  14. <ManualCalendar v-if="active === 'acid'" calendar-kind="acid" title="酸派车日历" />
  15. <ManualCalendar v-else-if="active === 'alkali'" calendar-kind="alkali" title="碱派车日历" />
  16. <ManualCalendar v-else-if="active === 'other'" calendar-kind="other" title="其他日历" />
  17. <ActualCalendar v-else />
  18. </template>
  19. </div>
  20. </MpWebviewShell>
  21. </template>
  22. <script setup lang="ts">
  23. import MpWebviewShell from '@/layouts/MpWebviewShell.vue'
  24. import MpBusinessHeader from '@/components/mp/MpBusinessHeader.vue'
  25. import { goToMiniWorkbench } from '@/utils/mp-webview'
  26. import ManualCalendar from './ManualCalendar.vue'
  27. import ActualCalendar from './ActualCalendar.vue'
  28. defineOptions({ name: 'MpDispatchCalendar' })
  29. const header = ref<HTMLElement>()
  30. const { height: headerHeight } = useElementSize(header)
  31. const ready = ref(false)
  32. const active = ref('acid')
  33. </script>
  34. <style scoped>
  35. .mp-dispatch-edge-to-edge {
  36. max-width: none;
  37. padding-right: 0;
  38. padding-left: 0;
  39. }
  40. .mp-dispatch-tabs {
  41. min-width: 0;
  42. padding: 0 0 20px;
  43. }
  44. .mp-dispatch-top {
  45. position: sticky;
  46. top: 0;
  47. z-index: 60;
  48. background: #fff;
  49. }
  50. .mp-dispatch-top > :deep(.mp-wv-header) {
  51. position: static;
  52. margin: 0;
  53. }
  54. .mp-dispatch-tabs :deep(.mp-calendar-sticky) {
  55. top: var(--dispatch-header-height);
  56. }
  57. .mp-dispatch-tabs :deep(.van-tabs__nav) {
  58. padding-right: 8px;
  59. padding-left: 8px;
  60. }
  61. .mp-dispatch-tabs :deep(.van-tab) {
  62. padding: 0 10px;
  63. font-size: 14px;
  64. }
  65. </style>