截图里的毛病很具体:**「账号」列被撑到 1000+px**,中间空出一大块, 而「状态」列只有 150px,把「检测 2026-10-01 19:07:25」挤成了两行。 根因是我前面把 ID 合并进「账号」列时,顺手把它的 `width` 去掉了 —— 于是它成了唯一的弹性列,把剩余空间全吃了。 修法: - **账号列定宽 200 + `ellipsis`**,用户名过长就省略(`title` 保留全文) - **CK 时间改用 `formatTimeShort`**(`10-01 19:07`),状态列加宽到 180, 一句话能放下,不再折行 - 其余列宽按内容重新配比:绑定 190→150、积分 110→120、标签 170→190、操作 80→90(居中) - **`tableLayout="fixed"`**:列宽按比例分配、剩余空间**均匀摊开**, 而不是像 auto 布局那样全塞给内容最宽的那一列 —— 这才不会再出现「一列独大」 顺带清掉因此失效的 `formatTime` 导入(导入时间列上轮已删,它没有其它调用点)。 验证:pytest 500 passed / 6 skipped;ruff 全绿;build 通过、lint 0 errors。
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Oxc
- @vitejs/plugin-react-swc uses SWC
React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])