index.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <div class="layout">
  3. <LayoutTop @chooseMenu="chooseMenu" />
  4. <template v-if="true">
  5. <div class="sliderLayout">
  6. <div class="shortLine"></div>
  7. </div>
  8. <LayoutBottom />
  9. </template>
  10. </div>
  11. </template>
  12. <script lang="ts">
  13. import LayoutTop from './components/top.vue';
  14. import LayoutBottom from './components/bottom.vue';
  15. import { defineComponent, ref } from 'vue';
  16. import APP from '@/services';
  17. import { OperationTabMenu } from '@/services/go/commonService/interface';
  18. import { initData } from '@/common/methods';
  19. // 控制下半部分是否显示
  20. function submitBottomIsShow() {
  21. const isShowBottomPart = ref<boolean>(true);
  22. function chooseMenu(value: boolean) {
  23. isShowBottomPart.value = value;
  24. }
  25. return { isShowBottomPart, chooseMenu };
  26. }
  27. export default defineComponent({
  28. name: 'layout',
  29. components: {
  30. LayoutTop,
  31. LayoutBottom,
  32. },
  33. setup() {
  34. const menuList = APP.getRef('menus');
  35. const { isShowBottomPart, chooseMenu } = submitBottomIsShow();
  36. initData(() => {
  37. // 判断是否有单据
  38. if (menuList.value.find((e: OperationTabMenu) => e.code === 'bottom')) {
  39. isShowBottomPart.value = true;
  40. }
  41. isShowBottomPart.value = true;
  42. });
  43. return { isShowBottomPart, chooseMenu };
  44. },
  45. });
  46. </script>
  47. <style lang="less">
  48. .layout {
  49. .flex;
  50. width: 100%;
  51. height: 100%;
  52. flex-direction: column;
  53. .sliderLayout {
  54. width: 100%;
  55. height: 4px;
  56. background: #242a2e;
  57. border-top: 1px solid @m-grey5;
  58. border-bottom: 1px solid @m-grey5;
  59. position: relative;
  60. .shortLine {
  61. width: 30px;
  62. height: 2px;
  63. background: #4b5861;
  64. border-radius: 1px;
  65. .position(absolute, 50%, auto, auto, 50%);
  66. transform: translate(-50%, -50%);
  67. }
  68. }
  69. }
  70. </style>