Commit 8d6af315 authored by drigle's avatar drigle

fix: stabilize data table layout and update app configuration

Adjust initial table sizing, switch the development API proxy to localhost, update the application manifest, and simplify subject documentation while retaining field summaries.
parent b392438e
...@@ -76,7 +76,8 @@ export default defineConfig({ ...@@ -76,7 +76,8 @@ export default defineConfig({
npmClient: 'pnpm', npmClient: 'pnpm',
proxy: { proxy: {
'/api': { '/api': {
target: 'https://xy.streams7.com/api', // target: 'https://xy.streams7.com/api',
target: 'http://127.0.0.1:3000/',
changeOrigin: true, changeOrigin: true,
pathRewrite: { '^/api': '' }, pathRewrite: { '^/api': '' },
secure: false, secure: false,
......
{ {
"name": "audit_project_manager", "name": "audit_project_manager",
"version": "1.0.7", "version": "1.0.2",
"build": "abc", "build": "abc",
"description": "merge master", "description": "审计项目管理",
"date": "2025-07-14 19:27:20", "date": "2025-07-14 19:27:20",
"author": "yang" "author": "yang",
"spa": true
} }
...@@ -135,6 +135,7 @@ export function DataTable({ ...@@ -135,6 +135,7 @@ export function DataTable({
const selectedKeys = selectionEnabled ? new Set(selectedRowKeys) : undefined; const selectedKeys = selectionEnabled ? new Set(selectedRowKeys) : undefined;
const gridViewportRef = useRef(null); const gridViewportRef = useRef(null);
const [hasHorizontalOverflow, setHasHorizontalOverflow] = useState(false); const [hasHorizontalOverflow, setHasHorizontalOverflow] = useState(false);
const [isInitialLayoutReady, setIsInitialLayoutReady] = useState(false);
const firstBusinessColumnIndex = columns.findIndex( const firstBusinessColumnIndex = columns.findIndex(
(column) => (column) =>
!column.isSelection && !column.isSelection &&
...@@ -177,7 +178,22 @@ export function DataTable({ ...@@ -177,7 +178,22 @@ export function DataTable({
return () => resizeObserver.disconnect(); return () => resizeObserver.disconnect();
}, [columns, isWide, rows]); }, [columns, isWide, rows]);
const wide = typeof isWide === 'boolean' ? isWide : hasHorizontalOverflow; useLayoutEffect(() => {
if (typeof isWide === 'boolean') {
setIsInitialLayoutReady(true);
return undefined;
}
const timeout = window.setTimeout(() => {
setIsInitialLayoutReady(true);
}, 0);
return () => window.clearTimeout(timeout);
}, [isWide]);
const wide = typeof isWide === 'boolean'
? isWide
: !isInitialLayoutReady || hasHorizontalOverflow;
const gridColumns = columns.map((column, index) => { const gridColumns = columns.map((column, index) => {
const isActions = column.isActions || column.key === 'actions'; const isActions = column.isActions || column.key === 'actions';
const isPrimary = const isPrimary =
...@@ -275,7 +291,7 @@ export function DataTable({ ...@@ -275,7 +291,7 @@ export function DataTable({
allowsColumnResize={allowsColumnResize} allowsColumnResize={allowsColumnResize}
aria-label={ariaLabel} aria-label={ariaLabel}
columns={gridColumns} columns={gridColumns}
contentClassName={wide ? 'min-w-max' : 'min-w-full'} contentClassName={wide ? 'min-w-max w-max' : 'min-w-full w-full'}
data={rows} data={rows}
disabledKeys={disabledRowKeys} disabledKeys={disabledRowKeys}
getRowId={(row) => resolveRowKey(row, rows.indexOf(row), getRowKey)} getRowId={(row) => resolveRowKey(row, rows.indexOf(row), getRowKey)}
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment