diff --git a/package.json b/package.json index 4049975a..fa40b0de 100644 --- a/package.json +++ b/package.json @@ -145,7 +145,6 @@ "typescript": "4.8.4", "umi-request": "^1.4.0", "vh-check": "^2.0.5", - "virtuallist-antd": "^0.7.6", "webpack": "^5.70.0", "yorkie": "^2.0.0" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f6f44873..779c3a02 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -89,7 +89,6 @@ specifiers: umi-request: ^1.4.0 uuid: ^8.3.2 vh-check: ^2.0.5 - virtuallist-antd: ^0.7.6 webpack: ^5.70.0 winston: ^3.6.0 yargs: ^17.3.1 @@ -188,7 +187,6 @@ devDependencies: typescript: 4.8.4 umi-request: 1.4.0 vh-check: 2.0.5 - virtuallist-antd: 0.7.6_antd@4.24.7+react@18.2.0 webpack: 5.75.0 yorkie: 2.0.0 @@ -14837,22 +14835,6 @@ packages: resolution: {integrity: sha512-vHtIYWt9uLl2P2tLlatVpMwv9+ezuJCtMNjUVIpzd5Pa/dJXN8AtqkKmVRcNSlmXyCjkCkbMQX/Vs9axmdlfgg==} dev: true - /virtuallist-antd/0.7.6_antd@4.24.7+react@18.2.0: - resolution: {integrity: sha512-mVlxseQBpdJ4o0KRu1UTIewKQlz44VWAJfN382sjG+OKB5nbCMuJO1U9kODgLVrjD03uxKcE6bUEAeTfdxjkXA==} - engines: {node: '>=8', npm: '>=5'} - peerDependencies: - antd: ^4.1.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 || 18 - peerDependenciesMeta: - antd: - optional: true - react: - optional: true - dependencies: - antd: 4.24.7_biqbaboplfbrettd7655fr4n2y - react: 18.2.0 - dev: true - /vite/3.2.5_f2wittb4cajzb7wm3nryx4tf2e: resolution: {integrity: sha512-4mVEpXpSOgrssFZAOmGIr85wPHKvaDAcXqxVxVRZhljkJOMZi1ibLibzjLHzJvcok8BMguLc7g1W6W/GqZbLdQ==} engines: {node: ^14.18.0 || >=16.0.0} diff --git a/src/layouts/index.less b/src/layouts/index.less index df628b4a..29d5058a 100644 --- a/src/layouts/index.less +++ b/src/layouts/index.less @@ -377,3 +377,12 @@ pre { .ant-table-bordered .virtuallist > table > .ant-table-tbody > tr > td { border-right: 1px solid #f0f0f0; } + +.ant-table-column-title { + flex: unset; +} + +.ant-table-column-sorters, +.ant-table-filter-column { + justify-content: unset; +} diff --git a/src/pages/crontab/index.tsx b/src/pages/crontab/index.tsx index af974b2d..aa7567ae 100644 --- a/src/pages/crontab/index.tsx +++ b/src/pages/crontab/index.tsx @@ -107,7 +107,6 @@ const Crontab = () => { dataIndex: 'name', key: 'name', width: 150, - align: 'center' as const, render: (text: string, record: any) => ( <> { dataIndex: 'command', key: 'command', width: 300, - align: 'center' as const, render: (text, record) => { return ( @@ -193,14 +190,12 @@ const Crontab = () => { dataIndex: 'schedule', key: 'schedule', width: 110, - align: 'center' as const, sorter: { compare: (a, b) => a.schedule.localeCompare(b.schedule), }, }, { title: '最后运行时间', - align: 'center' as const, dataIndex: 'last_execution_time', key: 'last_execution_time', width: 150, @@ -230,7 +225,6 @@ const Crontab = () => { }, { title: '最后运行时长', - align: 'center' as const, width: 120, dataIndex: 'last_running_time', key: 'last_running_time', @@ -247,7 +241,6 @@ const Crontab = () => { }, { title: '下次运行时间', - align: 'center' as const, width: 150, sorter: { compare: (a: any, b: any) => { @@ -267,7 +260,6 @@ const Crontab = () => { title: '状态', key: 'status', dataIndex: 'status', - align: 'center' as const, width: 88, filters: [ { @@ -329,7 +321,6 @@ const Crontab = () => { { title: '操作', key: 'action', - align: 'center' as const, width: 100, render: (text, record, index) => { const isPc = !isPhone; diff --git a/src/pages/crontab/viewManageModal.tsx b/src/pages/crontab/viewManageModal.tsx index 191167f1..0ec02a3a 100644 --- a/src/pages/crontab/viewManageModal.tsx +++ b/src/pages/crontab/viewManageModal.tsx @@ -80,23 +80,17 @@ const ViewManageModal = ({ title: '名称', dataIndex: 'name', key: 'name', - align: 'center' as const, - render: (text) => ( -
{text}
- ), }, { title: '类型', dataIndex: 'type', key: 'type', - align: 'center' as const, render: (v) => (v === 1 ? '系统' : '个人'), }, { title: '显示', key: 'isDisabled', dataIndex: 'isDisabled', - align: 'center' as const, width: 100, render: (text: string, record: any, index: number) => { return ( @@ -111,7 +105,6 @@ const ViewManageModal = ({ title: '操作', key: 'action', width: 100, - align: 'center' as const, render: (text: string, record: any, index: number) => { return record.type !== 1 ? ( diff --git a/src/pages/dependence/index.tsx b/src/pages/dependence/index.tsx index 15e2a2b2..ddc86ff6 100644 --- a/src/pages/dependence/index.tsx +++ b/src/pages/dependence/index.tsx @@ -32,7 +32,6 @@ import { useOutletContext } from '@umijs/max'; import { SharedContext } from '@/layouts'; import useTableScrollHeight from '@/hooks/useTableScrollHeight'; - const { Text } = Typography; const { Search } = Input; @@ -57,7 +56,6 @@ const Dependence = () => { const columns: any = [ { title: '序号', - align: 'center' as const, width: 50, render: (text: string, record: any, index: number) => { return {index + 1} ; @@ -67,13 +65,11 @@ const Dependence = () => { title: '名称', dataIndex: 'name', key: 'name', - align: 'center' as const, }, { title: '状态', key: 'status', dataIndex: 'status', - align: 'center' as const, render: (text: string, record: any, index: number) => { return ( @@ -91,13 +87,11 @@ const Dependence = () => { title: '备注', dataIndex: 'remark', key: 'remark', - align: 'center' as const, }, { title: '创建时间', key: 'timestamp', dataIndex: 'timestamp', - align: 'center' as const, render: (text: string, record: any) => { const language = navigator.language || navigator.languages[0]; const time = record.createdAt || record.timestamp; @@ -120,7 +114,6 @@ const Dependence = () => { { title: '操作', key: 'action', - align: 'center' as const, render: (text: string, record: any, index: number) => { const isPc = !isPhone; return ( @@ -169,7 +162,7 @@ const Dependence = () => { const [isLogModalVisible, setIsLogModalVisible] = useState(false); const [type, setType] = useState('nodejs'); const tableRef = useRef(); - const tableScrollHeight = useTableScrollHeight(tableRef, 59) + const tableScrollHeight = useTableScrollHeight(tableRef, 59); const getDependencies = () => { setLoading(true); diff --git a/src/pages/env/index.tsx b/src/pages/env/index.tsx index 44efa314..b9778dfd 100644 --- a/src/pages/env/index.tsx +++ b/src/pages/env/index.tsx @@ -71,7 +71,6 @@ const Env = () => { const columns: any = [ { title: '序号', - align: 'center' as const, width: 60, render: (text: string, record: any, index: number) => { return {index + 1} ; @@ -81,14 +80,12 @@ const Env = () => { title: '名称', dataIndex: 'name', key: 'name', - align: 'center' as const, sorter: (a: any, b: any) => a.name.localeCompare(b.name), }, { title: '值', dataIndex: 'value', key: 'value', - align: 'center' as const, width: '35%', render: (text: string, record: any) => { return ( @@ -105,7 +102,6 @@ const Env = () => { title: '备注', dataIndex: 'remarks', key: 'remarks', - align: 'center' as const, render: (text: string, record: any) => { return ( @@ -118,7 +114,6 @@ const Env = () => { title: '更新时间', dataIndex: 'timestamp', key: 'timestamp', - align: 'center' as const, width: 165, ellipsis: { showTitle: false, @@ -153,7 +148,6 @@ const Env = () => { title: '状态', key: 'status', dataIndex: 'status', - align: 'center' as const, width: 70, filters: [ { @@ -180,7 +174,6 @@ const Env = () => { title: '操作', key: 'action', width: 120, - align: 'center' as const, render: (text: string, record: any, index: number) => { const isPc = !isPhone; return ( diff --git a/src/pages/setting/index.tsx b/src/pages/setting/index.tsx index 40f904f0..40440d10 100644 --- a/src/pages/setting/index.tsx +++ b/src/pages/setting/index.tsx @@ -49,13 +49,11 @@ const Setting = () => { title: '名称', dataIndex: 'name', key: 'name', - align: 'center' as const, }, { title: 'Client ID', dataIndex: 'client_id', key: 'client_id', - align: 'center' as const, render: (text: string, record: any) => { return {record.client_id}; }, @@ -64,7 +62,6 @@ const Setting = () => { title: 'Client Secret', dataIndex: 'client_secret', key: 'client_secret', - align: 'center' as const, render: (text: string, record: any) => { return *******; }, @@ -73,22 +70,16 @@ const Setting = () => { title: '权限', dataIndex: 'scopes', key: 'scopes', - align: 'center' as const, width: '40%', render: (text: string, record: any) => { - return ( -
- {record.scopes.map((scope: any) => { - return {(config.scopesMap as any)[scope]}; - })} -
- ); + return record.scopes.map((scope: any) => { + return {(config.scopesMap as any)[scope]}; + }); }, }, { title: '操作', key: 'action', - align: 'center' as const, render: (text: string, record: any, index: number) => { const isPc = !isPhone; return ( diff --git a/src/pages/setting/loginLog.tsx b/src/pages/setting/loginLog.tsx index 5d742ca1..936997c6 100644 --- a/src/pages/setting/loginLog.tsx +++ b/src/pages/setting/loginLog.tsx @@ -18,7 +18,6 @@ enum LoginStatusColor { const columns = [ { title: '序号', - align: 'center' as const, width: 50, render: (text: string, record: any, index: number) => { return index + 1; @@ -28,7 +27,6 @@ const columns = [ title: '登录时间', dataIndex: 'timestamp', key: 'timestamp', - align: 'center' as const, render: (text: string, record: any) => { return new Date(record.timestamp).toLocaleString(); }, @@ -37,25 +35,21 @@ const columns = [ title: '登录地址', dataIndex: 'address', key: 'address', - align: 'center' as const, }, { title: '登录IP', dataIndex: 'ip', key: 'ip', - align: 'center' as const, }, { title: '登录设备', dataIndex: 'platform', key: 'platform', - align: 'center' as const, }, { title: '登录状态', dataIndex: 'status', key: 'status', - align: 'center' as const, render: (text: string, record: any) => { return ( diff --git a/src/pages/subscription/index.tsx b/src/pages/subscription/index.tsx index afd69770..b0a23cce 100644 --- a/src/pages/subscription/index.tsx +++ b/src/pages/subscription/index.tsx @@ -68,7 +68,6 @@ const Subscription = () => { dataIndex: 'name', key: 'name', width: 150, - align: 'center' as const, sorter: { compare: (a: any, b: any) => a.name.localeCompare(b.name), multiple: 2, @@ -78,7 +77,6 @@ const Subscription = () => { title: '链接', dataIndex: 'url', key: 'url', - align: 'center' as const, sorter: { compare: (a: any, b: any) => a.name.localeCompare(b.name), multiple: 2, @@ -89,7 +87,6 @@ const Subscription = () => { style={{ wordBreak: 'break-all', marginBottom: 0, - textAlign: 'left', }} ellipsis={{ tooltip: text, rows: 2 }} > @@ -103,7 +100,6 @@ const Subscription = () => { dataIndex: 'type', key: 'type', width: 130, - align: 'center' as const, render: (text: string, record: any) => { return (SubscriptionType as any)[record.type]; }, @@ -113,7 +109,6 @@ const Subscription = () => { dataIndex: 'branch', key: 'branch', width: 130, - align: 'center' as const, render: (text: string, record: any) => { return record.branch || '-'; }, @@ -121,7 +116,6 @@ const Subscription = () => { { title: '定时规则', width: 180, - align: 'center' as const, render: (text: string, record: any) => { if (record.schedule_type === 'interval') { const { type, value } = record.interval_schedule; @@ -134,7 +128,6 @@ const Subscription = () => { title: '状态', key: 'status', dataIndex: 'status', - align: 'center' as const, width: 110, filters: [ { @@ -189,7 +182,6 @@ const Subscription = () => { { title: '操作', key: 'action', - align: 'center' as const, width: 130, render: (text: string, record: any, index: number) => { const isPc = !isPhone;