huangbin 4 éve
szülő
commit
dbc5ee4cd3
2 módosított fájl, 61 hozzáadás és 7 törlés
  1. 1 1
      src/common/config/constrolBottom.ts
  2. 60 6
      src/layout/components/bottom.vue

+ 1 - 1
src/common/config/constrolBottom.ts

@@ -9,4 +9,4 @@ export function handleShowBottom(): void {
 
 export function getShowBottomValue(): Ref<boolean> {
     return isShowBottom
-}
+}

+ 60 - 6
src/layout/components/bottom.vue

@@ -1,12 +1,25 @@
 <template>
   <section :class="['layout-bottom', isShowBottom ? 'layout-bottom-all' : 'layout-bottom-hidden']">
-    <CapitalInfo class="capital-info-container"></CapitalInfo>
-    <main>
+    <CapitalInfo class="capital-info-container"
+                 v-if="isCapitalLeft"></CapitalInfo>
+    <main :class="[isCapitalLeft ? 'main-some' : 'main-all']">
       <firstMenu :list="orderList"
                  :value="'title'"
                  @selectMenu="selectMenu">
-        <div class="conditionIcon icon iconfont icon-shouqi"
-             @click="handleShowBottom"></div>
+        <div class="right-menu-content">
+          <!-- 资金信息 -->
+          <a-select class="capitalSelect"
+                    style="width: 180px"
+                    v-if="!isCapitalLeft"
+                    @change="accountChange"
+                    v-model:value="selectedAccountId">
+            <a-select-option v-for="item in getAllTaAccount()"
+                             :value="item.accountid"
+                             :key="item.accountid">{{item.accountid}}</a-select-option>
+          </a-select>
+          <div class="conditionIcon icon iconfont icon-shouqi"
+               @click="handleShowBottom"></div>
+        </div>
       </firstMenu>
       <div v-show="isShowBottom">
         <component :is="componentId"
@@ -16,7 +29,7 @@
   </section>
 </template>
 <script lang="ts">
-import { defineAsyncComponent, defineComponent, ref } from 'vue';
+import { defineAsyncComponent, defineComponent, reactive, ref } from 'vue';
 import CapitalInfo from '@/common/components/capitalInfo/index.vue';
 import firstMenu from '@/common/components/firstMenu/index.vue';
 import thirdMenu from '@/common/components/thirdMenu/index.vue';
@@ -25,6 +38,12 @@ import { OperationTabMenu } from '@/services/go/commonService/interface';
 import { handleOrderData } from '@/common/setup/order/orderData';
 import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
 import { handleShowBottom, getShowBottomValue } from '@/common/config/constrolBottom';
+import { getAllTaAccount, getCanUseMoney, getFreeze, getSelectedAccount, setSelectedAccount } from '@/services/bus/account';
+import { AccountListItem } from '@/services/dataCenter/interafce/account';
+import { getTaAccount } from '@/services/go/TaAccount';
+import Bus from '@/utils/eventBus/index';
+import { isOemByEnum, OemType } from '@/common/config/projectName';
+import { initData } from '@/common/methods';
 
 export default defineComponent({
     name: 'layout-top',
@@ -42,6 +61,25 @@ export default defineComponent({
     },
     setup() {
         const { orderList, componentId } = handleOrderData();
+        const selectedAccount = getSelectedAccount();
+        const selectedAccountId = ref<number>(selectedAccount.accountid);
+        function accountChange(id: number) {
+            const item = getAllTaAccount().find((e) => e.accountid === id) as AccountListItem;
+            setSelectedAccount(item);
+        }
+        // 资金变化,重新加载数据
+        Bus.$on('moneyChangedNtf_UI', () => {
+            getTaAccount().then(() => {
+                accountChange(selectedAccountId.value);
+            });
+        });
+        // 控制资金面板是否显示在左边
+        const isCapitalLeft = ref<boolean>(true);
+        initData(() => {
+            if (isOemByEnum(OemType.wrspot)) {
+                isCapitalLeft.value = false;
+            }
+        });
         // 切换组件
         function selectMenu(value: OperationTabMenu) {
             componentId.value = value.code as enumOrderComponents;
@@ -53,17 +91,34 @@ export default defineComponent({
             isShowBottom: getShowBottomValue(),
             getShowBottomValue,
             handleShowBottom,
+            getAllTaAccount,
+            selectedAccountId,
+            accountChange,
+            isCapitalLeft,
         };
     },
 });
 </script>
 <style lang="less">
+.right-menu-content {
+    display: flex;
+    .capitalSelect {
+        margin-top: 3px;
+        margin-right: 10px;
+    }
+}
 .layout-bottom-all {
     height: 330px;
 }
 .layout-bottom-hidden {
     height: 40px;
 }
+.main-all {
+    max-width: 100;
+}
+.main-some {
+    max-width: calc(100% - 180px);
+}
 .layout-bottom {
     display: flex;
     width: 100%;
@@ -74,7 +129,6 @@ export default defineComponent({
         border-right: 1px solid @m-black2;
     }
     main {
-        max-width: calc(100% - 180px);
         flex: 1;
         .flex;
         flex-direction: column;