huangbin 4 år sedan
förälder
incheckning
843f1a4d03
2 ändrade filer med 17 tillägg och 14 borttagningar
  1. 12 0
      src/common/config/constrolBottom.ts
  2. 5 14
      src/layout/components/bottom.vue

+ 12 - 0
src/common/config/constrolBottom.ts

@@ -0,0 +1,12 @@
+import { Ref, ref } from "vue";
+
+// 控制显示单据底部显示全部还是部分
+const isShowBottom = ref<boolean>(true);
+
+export function handleShowBottom(): void {
+    isShowBottom.value = !isShowBottom.value
+}
+
+export function getShowBottomValue(): Ref<boolean> {
+    return isShowBottom
+}

+ 5 - 14
src/layout/components/bottom.vue

@@ -6,7 +6,7 @@
                  :value="'title'"
                  @selectMenu="selectMenu">
         <div class="conditionIcon icon iconfont icon-shouqi"
-             @click="openOrCloseBottom"></div>
+             @click="handleShowBottom"></div>
       </firstMenu>
       <div v-show="isShowBottom">
         <component :is="componentId"
@@ -25,15 +25,7 @@ import quoteTable from '@/common/components/quoteTable/index.vue';
 import { OperationTabMenu } from '@/services/go/commonService/interface';
 import { handleOrderData } from '@/common/setup/order/orderData';
 import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
-
-// 控制底部打开与关闭
-function handleBottom() {
-    const isShowBottom = ref<boolean>(true);
-    function openOrCloseBottom() {
-        isShowBottom.value = !isShowBottom.value;
-    }
-    return { isShowBottom, openOrCloseBottom };
-}
+import { handleShowBottom, getShowBottomValue } from '@/common/config/constrolBottom';
 
 export default defineComponent({
     name: 'layout-top',
@@ -48,8 +40,6 @@ export default defineComponent({
         [enumOrderComponents.pre_sale_warehouse_receipt]: defineAsyncComponent(() => import('@/views/order/pre_sale_warehouse_receipt/index.vue')),
     },
     setup() {
-        // 控制底部展开逻辑
-        const { isShowBottom, openOrCloseBottom } = handleBottom();
         const { orderList, componentId } = handleOrderData();
         // 切换组件
         function selectMenu(value: OperationTabMenu) {
@@ -59,8 +49,9 @@ export default defineComponent({
             selectMenu,
             componentId,
             orderList,
-            isShowBottom,
-            openOrCloseBottom,
+            isShowBottom: getShowBottomValue(),
+            getShowBottomValue,
+            handleShowBottom,
         };
     },
 });