bottom.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <section :class="['layout-bottom', isShowBottom ? 'layout-bottom-all' : 'layout-bottom-hidden']">
  3. <CapitalInfo class="capital-info-container"
  4. v-if="isCapitalLeft"></CapitalInfo>
  5. <main :class="[isCapitalLeft ? 'main-some' : 'main-all']">
  6. <firstMenu :list="orderList"
  7. :value="'title'"
  8. @selectMenu="selectMenu">
  9. <div class="right-menu-content">
  10. <!-- 资金信息 -->
  11. <a-select class="capitalSelect"
  12. style="width: 180px"
  13. v-if="!isCapitalLeft"
  14. @change="accountChange"
  15. v-model:value="selectedAccountId">
  16. <a-select-option v-for="item in getAllTaAccount()"
  17. :value="item.accountid"
  18. :key="item.accountid">{{item.accountid}}</a-select-option>
  19. </a-select>
  20. <div class="conditionIcon icon iconfont icon-shouqi"
  21. @click="handleShowBottom"></div>
  22. </div>
  23. </firstMenu>
  24. <div v-show="isShowBottom">
  25. <component :is="componentId"
  26. v-if="componentId"></component>
  27. </div>
  28. </main>
  29. </section>
  30. </template>
  31. <script lang="ts">
  32. import { defineAsyncComponent, defineComponent, reactive, ref } from 'vue';
  33. import CapitalInfo from '@/common/components/capitalInfo/index.vue';
  34. import firstMenu from '@/common/components/firstMenu/index.vue';
  35. import thirdMenu from '@/common/components/thirdMenu/index.vue';
  36. import quoteTable from '@/common/components/quoteTable/index.vue';
  37. import { OperationTabMenu } from '@/services/go/commonService/interface';
  38. import { handleOrderData } from '@/common/setup/order/orderData';
  39. import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
  40. import { handleShowBottom, getShowBottomValue } from '@/common/config/constrolBottom';
  41. import { getAllTaAccount, getCanUseMoney, getFreeze, getSelectedAccount, setSelectedAccount } from '@/services/bus/account';
  42. import { AccountListItem } from '@/services/dataCenter/interafce/account';
  43. import { getTaAccount } from '@/services/go/TaAccount';
  44. import Bus from '@/utils/eventBus/index';
  45. import { isOemByEnum, OemType } from '@/common/config/projectName';
  46. import { initData } from '@/common/methods';
  47. export default defineComponent({
  48. name: 'layout-top',
  49. components: {
  50. CapitalInfo,
  51. firstMenu,
  52. quoteTable,
  53. thirdMenu,
  54. [enumOrderComponents.spot_warrant]: defineAsyncComponent(() => import('@/views/order/spot_warran/index.vue')),
  55. [enumOrderComponents.funding_information]: defineAsyncComponent(() => import('@/views/order/funding_information/index.vue')),
  56. [enumOrderComponents.performance_information]: defineAsyncComponent(() => import('@/views/order/performance_information/index.vue')),
  57. [enumOrderComponents.pre_sale_warehouse_receipt]: defineAsyncComponent(() => import('@/views/order/pre_sale_warehouse_receipt/index.vue')),
  58. [enumOrderComponents.financing_manager]: defineAsyncComponent(() => import('@/views/order/financing_manager/index.vue')),
  59. [enumOrderComponents.commodity_contract]: defineAsyncComponent(() => import('@/views/order/commodity_contract/index.vue')),
  60. },
  61. setup() {
  62. const { orderList, componentId } = handleOrderData();
  63. const selectedAccount = getSelectedAccount();
  64. const selectedAccountId = ref<number>(selectedAccount.accountid);
  65. function accountChange(id: number) {
  66. const item = getAllTaAccount().find((e) => e.accountid === id) as AccountListItem;
  67. setSelectedAccount(item);
  68. }
  69. // 资金变化,重新加载数据
  70. Bus.$on('moneyChangedNtf_UI', () => {
  71. getTaAccount().then(() => {
  72. accountChange(selectedAccountId.value);
  73. });
  74. });
  75. // 控制资金面板是否显示在左边
  76. const isCapitalLeft = ref<boolean>(true);
  77. initData(() => {
  78. if (isOemByEnum(OemType.wrspot)) {
  79. isCapitalLeft.value = false;
  80. }
  81. });
  82. // 切换组件
  83. function selectMenu(value: OperationTabMenu) {
  84. componentId.value = value.code as enumOrderComponents;
  85. }
  86. return {
  87. selectMenu,
  88. componentId,
  89. orderList,
  90. isShowBottom: getShowBottomValue(),
  91. getShowBottomValue,
  92. handleShowBottom,
  93. getAllTaAccount,
  94. selectedAccountId,
  95. accountChange,
  96. isCapitalLeft,
  97. };
  98. },
  99. });
  100. </script>
  101. <style lang="less">
  102. .right-menu-content {
  103. display: flex;
  104. .capitalSelect {
  105. margin-top: 3px;
  106. margin-right: 10px;
  107. .ant-select-selector{
  108. background-color: @m-grey6;
  109. border:none
  110. }
  111. }
  112. }
  113. .layout-bottom-all {
  114. height: 330px;
  115. }
  116. .layout-bottom-hidden {
  117. height: 40px;
  118. }
  119. .main-all {
  120. max-width: 100;
  121. }
  122. .main-some {
  123. max-width: calc(100% - 180px);
  124. }
  125. .layout-bottom {
  126. display: flex;
  127. width: 100%;
  128. transition: height 0.5s;
  129. overflow: hidden;
  130. .capital-info-container {
  131. width: 180px;
  132. border-right: 1px solid @m-black2;
  133. }
  134. main {
  135. flex: 1;
  136. .flex;
  137. flex-direction: column;
  138. background: @m-black1;
  139. position: relative;
  140. .conditionIcon {
  141. font-size: 16px;
  142. color: @m-grey1;
  143. width: 16px;
  144. cursor: pointer;
  145. height: 40px;
  146. line-height: 40px;
  147. margin-right: 10px;
  148. &:hover {
  149. color: rgba(@m-grey1, 0.8);
  150. }
  151. }
  152. }
  153. }
  154. </style>