lanjianrong 4 سال پیش
والد
کامیت
01dd07d083

+ 8 - 4
src/pages/Customer/Client/components/ClientDetail/LowerList.tsx

@@ -7,6 +7,7 @@ import { isDevMode } from '@/utils/env'
 import { VList } from 'virtuallist-antd'
 import consts from '@/consts'
 import type { ProColumns } from '@ant-design/pro-table'
+import ProTable from '@ant-design/pro-table'
 const { TabPane } = Tabs
 
 export enum Servicelog {
@@ -95,13 +96,13 @@ export const renderServiceLogItem = (item: API.ServiceLogItem) => {
 }
 
 const ClientLowerList: React.FC<ClientLowerListProps> = ({ logList: { log: logs = [] }, serviceList }) => {
-  const tableHeight = (document.body.clientHeight - 48 - 92 - 64 - 120) / 2
+  const tableHeight = (document.body.clientHeight - 124 - 54 - 40 - 40 - 4) / 2
   const columns: ProColumns<API.LogItem>[] = [
     {
       title: '日期',
       dataIndex: 'createTime',
       key: 'createTime',
-      width: 100
+      width: 160
     },
     {
       title: '操作人',
@@ -135,7 +136,8 @@ const ClientLowerList: React.FC<ClientLowerListProps> = ({ logList: { log: logs
     {
       title: '操作内容',
       dataIndex: 'content',
-      key: 'content'
+      key: 'content',
+      ellipsis: true
     }
   ]
 
@@ -163,7 +165,9 @@ const ClientLowerList: React.FC<ClientLowerListProps> = ({ logList: { log: logs
           </TabPane>
           <TabPane tab="日志" key="日志">
             <div className="sheet-panel-record">
-              <Table<API.LogItem>
+              <ProTable<API.LogItem>
+                search={false}
+                toolBarRender={false}
                 rowKey="id"
                 size="small"
                 columns={columns}

+ 1 - 0
src/pages/Customer/Client/components/ClientDetail/TabList.jsx

@@ -209,6 +209,7 @@ const ClientTabList = ({ clientId, software, updatePayload }) => {
           <TabPane tab={<span>软件锁{renderBadge(software.total, true)}</span>} key="1">
             <ProTable
               className="sheet-right-panel"
+              size="small"
               columns={columns}
               search={false}
               toolBarRender={false}

+ 19 - 4
src/pages/Customer/Company/components/CompanyDetail/LowerList.tsx

@@ -1,9 +1,12 @@
-import { Tabs, Table } from 'antd'
+import { Tabs } from 'antd'
 import consts from '@/consts'
 import { isDevMode } from '@/utils/env'
 import TimeLineList from '@/components/TimeLineList'
 import { renderServiceLogItem } from '@/pages/Customer/Client/components/ClientDetail/LowerList'
+import { useMemo } from 'react'
+import { VList } from 'virtuallist-antd'
 import type { ProColumns } from '@ant-design/pro-table'
+import ProTable from '@ant-design/pro-table'
 const { TabPane } = Tabs
 type CompanyLowerListProps = {
   logList: {
@@ -13,12 +16,13 @@ type CompanyLowerListProps = {
 }
 
 const CompanyLowerList: React.FC<CompanyLowerListProps> = ({ logList: { log: logs = [] }, serviceList }) => {
+  const tableHeight = (document.body.clientHeight - 124 - 54 - 40 - 40 - 4) / 2
   const columns: ProColumns<API.LogItem>[] = [
     {
       title: '日期',
       dataIndex: 'createTime',
       key: 'createTime',
-      width: 100
+      width: 160
     },
     {
       title: '操作人',
@@ -52,9 +56,16 @@ const CompanyLowerList: React.FC<CompanyLowerListProps> = ({ logList: { log: log
     {
       title: '操作内容',
       dataIndex: 'content',
-      key: 'content'
+      key: 'content',
+      ellipsis: true
     }
   ]
+  const vList = useMemo(() => {
+    return VList({
+      height: tableHeight,
+      vid: 'company_log_list'
+    })
+  }, [])
   return (
     <div>
       <div className="pl-4">
@@ -72,12 +83,16 @@ const CompanyLowerList: React.FC<CompanyLowerListProps> = ({ logList: { log: log
           </TabPane>
           <TabPane tab="日志" key="日志">
             <div className="sheet-panel-record">
-              <Table<API.LogItem>
+              <ProTable<API.LogItem>
+                search={false}
+                toolBarRender={false}
                 rowKey="id"
                 columns={columns}
                 dataSource={logs}
                 pagination={false}
+                scroll={{ y: tableHeight }}
                 size="small"
+                components={vList}
               />
             </div>
           </TabPane>