huangbin 4 年 前
コミット
59ff08989c

+ 82 - 0
src/common/components/description/index.vue

@@ -0,0 +1,82 @@
+<template>
+  <!-- 明细 公共组件 -->
+  <a-drawer placement="bottom"
+            :closable="false"
+            :visible="show"
+            :get-container="false"
+            :wrap-style="{ position: 'absolute' }"
+            @close="close">
+    <div class="bottomTable">
+      <a-table :columns="columns"
+               class="topTable"
+               :pagination="false"
+               rowKey="key"
+               :data-source="tableList">
+      </a-table>
+      <ThridMenu :list="tabList"
+                 @selectMenu="changeTab" />
+    </div>
+  </a-drawer>
+</template>
+
+<script lang="ts">
+import { defineComponent, ref, watchEffect, PropType } from 'vue';
+import ThridMenu from '@/common/components/thirdMenu/index.vue';
+import { TabList } from './interface';
+import { ColumnType } from '@/common/methods/table/interface';
+
+export default defineComponent({
+    name: 'description',
+    components: {
+        ThridMenu,
+    },
+    props: {
+        tabList: {
+            // 按钮列表
+            default: [],
+            type: Array as PropType<TabList[]>,
+        },
+        tableList: {
+            // 表格数据
+            default: [],
+            type: Array as PropType<any[]>,
+        },
+        columns: {
+            // 表头数据
+            default: [],
+            type: Array as PropType<ColumnType[]>,
+        },
+        visible: {
+            // 是否显示
+            default: false,
+            type: Boolean,
+        },
+    },
+    setup(props, context) {
+        const show = ref<boolean>(true);
+        // 切换明细
+        function changeTab(index: number) {
+            context.emit('changeTab', index);
+        }
+        function close() {
+            show.value = false;
+            context.emit('close');
+        }
+        return { changeTab, show, close };
+    },
+});
+</script>
+
+<style lang="less">
+.bottomTable {
+    width: 100%;
+    .flex;
+    flex-direction: column;
+    .topTable {
+        height: calc(100% - 46px);
+        .ant-table {
+            background-color: transparent;
+        }
+    }
+}
+</style>;

+ 4 - 0
src/common/components/description/interface.ts

@@ -0,0 +1,4 @@
+export interface TabList {
+    lable: string,
+    code: string,
+}

+ 16 - 0
src/common/setup/control/index.ts

@@ -0,0 +1,16 @@
+import { ref } from "vue";
+
+/**
+ * 处理组件是否显示
+ * @returns
+ */
+export function handleControlComponentsIsShow() {
+    const visibleComponent = ref<boolean>(true)
+    function openComponent() {
+        visibleComponent.value = true
+    }
+    function closeComponent() {
+        visibleComponent.value = false
+    }
+    return { visibleComponent, openComponent, closeComponent }
+}

+ 1 - 1
src/common/setup/table/event.ts

@@ -4,7 +4,7 @@ import { TableEventCB } from './interface';
 /**
  * 表格事件
  * @param param TableEventCB
- * @returns 
+ * @returns
  */
 export function getTableEvent<T>(param: TableEventCB) {
     // 表格展开行

+ 8 - 59
src/views/business/exposure/list/history/index.vue

@@ -2,75 +2,24 @@
   <!-- 采购: 历史敞口-->
   <div class="purchase-history">
     采购:历史敞口
+    <iframe :src="url"></iframe>
   </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
-import { QueryCustomInfo } from '@/services/go/ermcp/customInfo/index';
-import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
-import { message } from 'ant-design-vue';
+import { defineComponent } from 'vue';
 import { initData } from '@/common/methods';
-
-// 查询客户资料列表
-function getCustomList() {
-    // const filteredInfo = ref();
-    // const sortedInfo = ref();
-    // const columns = computed(() => {
-    //     const filtered = filteredInfo.value || {};
-    //     const sorted = sortedInfo.value || {};
-    //     return [
-    //         {
-    //             title: '序号',
-    //             dataIndex: 'index',
-    //             key: 'index',
-    //             align: 'center',
-    //             width: 50,
-    //             customRender: (param: any) => `${param.index + 1}`,
-    //         },
-    //         {
-    //             title: 'Age',
-    //             dataIndex: 'age',
-    //             key: 'age',
-    //             sorter: (a: DataItem, b: DataItem) => a.age - b.age,
-    //             sortOrder: sorted.columnKey === 'age' && sorted.order,
-    //         },
-    //         {
-    //             title: 'Address',
-    //             dataIndex: 'address',
-    //             key: 'address',
-    //             filters: [
-    //                 { text: 'London', value: 'London' },
-    //                 { text: 'New York', value: 'New York' },
-    //             ],
-    //             filteredValue: filtered.address || null,
-    //             onFilter: (value: string, record: DataItem) => record.address.includes(value),
-    //             sorter: (a: DataItem, b: DataItem) => a.address.length - b.address.length,
-    //             sortOrder: sorted.columnKey === 'address' && sorted.order,
-    //             ellipsis: true,
-    //         },
-    //     ];
-    // });
-    const customList = ref<QueryCustomInfoType[]>([]);
-    function actionQuery() {
-        QueryCustomInfo(4)
-            .then((res) => {})
-            .catch((err) => message.error(err));
-    }
-
-    return { customList, actionQuery };
-}
+import { getToken } from '@/services/bus/token';
+import { serviceURL } from '@/services/request/serviceURL';
 
 export default defineComponent({
     name: 'purchase-history',
     components: {},
     setup() {
-        const { customList, actionQuery } = getCustomList();
-        initData(() => {
-            actionQuery();
-            // 加载数据在这里
-        });
-        return { customList };
+        const token = getToken();
+        const url = 'http://192.168.31.171:5035/pcmanage/';
+        initData(() => {});
+        return { url };
     },
 });
 </script>

+ 35 - 12
src/views/business/exposure/list/realTime/index.vue

@@ -2,7 +2,7 @@
   <!-- 实时敞口-->
   <div class="exposure-real-time table-height"
        :loading="loading">
-    <filterCustomTable @search="search">
+    <filterCustomTable @search="updateColumn">
       <BtnList :btnList="commonBtn" />
     </filterCustomTable>
     <contextMenu :contextMenuList="forDataBtn">
@@ -15,9 +15,12 @@
                :data-source="tableList">
       </a-table>
     </contextMenu>
-    <a-drawer placement="bottom"
+    <Description v-if="visibleComponent"
+                 @close="closeComponent"
+                 :tabList="tabList" />
+    <!-- <a-drawer placement="bottom"
               :closable="false"
-              :visible="visible"
+              :visible="true"
               :get-container="false"
               :wrap-style="{ position: 'absolute' }"
               @close="closeDrawer">
@@ -31,7 +34,7 @@
         <ThridMenu :list="tabList"
                    @selectMenu="selectMenu" />
       </div>
-    </a-drawer>
+    </a-drawer> -->
   </div>
 </template>
 
@@ -50,6 +53,10 @@ import ThridMenu from '@/common/components/thirdMenu/index.vue';
 import { ColumnType } from '@/common/methods/table';
 import { TableKey } from '@/common/methods/table/interface';
 import BtnList from '@/common/components/buttonList/index.vue';
+import Description from '@/common/components/description/index.vue';
+import { handleControlComponentsIsShow } from '@/common/setup/control';
+import { getTableColumns, getTableEvent, queryTableList } from '@/common/setup/table';
+import { TableEventCB } from '@/common/setup/table/interface';
 
 // 获取表格数据
 function getExposure() {
@@ -74,7 +81,7 @@ function getExposure() {
 
 // 控制是否打开明细
 function handleDrawer() {
-    const visible = ref<boolean>(false);
+    const visible = ref<boolean>(true);
     function closeDrawer() {
         visible.value = !visible.value;
     }
@@ -137,28 +144,44 @@ function handleDeatil(loading: Ref<boolean>, selectedRow: ErmcpRealExposureModel
     }
     return { tabList, selectMenu, detailTableList, detailColumns };
 }
-
+interface Value extends ErmcpRealExposureModel {
+    key: string;
+}
 export default defineComponent({
     name: 'exposure-real-time',
     components: {
+        Description,
         contextMenu,
         filterCustomTable,
         ThridMenu,
         BtnList,
     },
     setup() {
+        // 控制是否加载组件
+        const { visibleComponent, openComponent, closeComponent } = handleControlComponentsIsShow();
         const { visible, closeDrawer } = handleDrawer();
-        const { columns, search, getColumns } = getColumsAndSearch('table_pcweb_exposure', true);
+        // 表头数据
+        const { columns, registerColumn, updateColumn } = getTableColumns();
+        // const { columns, search, getColumns } = getColumsAndSearch('table_pcweb_exposure', true);
 
-        const { expandedRowKeys, selectedRow, Rowclick } = handleTableEvent<ErmcpRealExposureModel>(closeDrawer);
-        const { loading, tableList, queryList } = getExposure();
+        // const { expandedRowKeys, selectedRow, Rowclick } = handleTableEvent<ErmcpRealExposureModel>(closeDrawer);
+        const events: TableEventCB = {
+            clickCB: (value: Value) => {
+                openComponent();
+            },
+        };
+        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<ErmcpRealExposureModel>(events);
+        // 表格列表数据
+        const { loading, tableList, queryTable } = queryTableList<ErmcpRealExposureModel>();
+        // const { loading, tableList, queryList } = getExposure();
         const { commonBtn, forDataBtn } = getBtnList('exposure_realtime', false);
 
         initData(() => {
-            queryList();
-            getColumns();
+            queryTable(QueryActualExposure);
+            registerColumn('table_pcweb_exposure', []);
+            // getColumns();
         });
-        return { commonBtn, forDataBtn, loading, tableList, visible, closeDrawer, columns, search, expandedRowKeys, selectedRow, Rowclick, ...handleDeatil(loading, (selectedRow as unknown) as ErmcpRealExposureModel) };
+        return { commonBtn, forDataBtn, loading, tableList, visible, closeDrawer, columns, updateColumn, closeComponent, expandedRowKeys, visibleComponent, selectedRow, Rowclick, ...handleDeatil(loading, (selectedRow as unknown) as ErmcpRealExposureModel) };
     },
 });
 </script>

+ 1 - 2
src/views/report/finance-report/list/finance_report_finance/index.vue

@@ -38,14 +38,13 @@ export default defineComponent({
         // 表头数据
         const { columns, registerColumn, updateColumn } = getTableColumns();
         // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick, btnClick } = getTableEvent<any>({});
+        const { expandedRowKeys, selectedRow, Rowclick, btnClick } = getTableEvent<Ermcp3FinanceReport>({});
         // // 表格操作按钮列表
         // const { commonBtn, forDataBtn } = getBtnList('warehouse_info_normal', true);
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList<Ermcp3FinanceReport>(qryFinanceReport);
         initData(() => {
             const { getInitTime, getInitType } = handleInitTypeAndTime();
-            console.log('getAoletype_string', getAoletype_string());
 
             // 获取列表数据
             queryTable({ cycletype: getInitType(), cycletime: getInitTime() });