Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
ujia
/
uj-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit db9f05ed
authored
Nov 17, 2026
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat: 添加车辆详情页面及相关样式,优化车辆管理功能
1 parent
05f66fda
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
2 deletions
apps/web/subapps/usedcar/src/App.tsx
apps/web/subapps/usedcar/src/pages/Vehicles/VehicleDetail.tsx
apps/web/subapps/usedcar/src/pages/Vehicles/index.tsx
apps/web/subapps/usedcar/src/pages/Vehicles/vehicles.css
packages/biz/src/components/CombiForm/index.tsx
apps/web/subapps/usedcar/src/App.tsx
View file @
db9f05e
...
...
@@ -9,6 +9,7 @@ import Assessment from './pages/Assessment';
import AssessmentDetail from './pages/Assessment/AssessmentDetail';
import Operation from './pages/Operation';
import Vehicles from './pages/Vehicles';
import VehicleDetail from './pages/Vehicles/VehicleDetail';
import Delivery from './pages/Delivery';
import Ledger from './pages/Ledger';
import Handover from './pages/Handover';
...
...
@@ -32,6 +33,8 @@ const ROUTES: RouteDef[] = [
{ path: 'assessment/:evalOrderNo', Page: AssessmentDetail },
{ path: 'operation', Page: Operation },
{ path: 'vehicles', Page: Vehicles },
{ path: 'vehicles/:id', Page: VehicleDetail },
{ path: 'vehicles/:id/:mode', Page: VehicleDetail },
{ path: 'delivery', Page: Delivery },
{ path: 'ledger', Page: Ledger },
{ path: 'handover', Page: Handover },
...
...
apps/web/subapps/usedcar/src/pages/Vehicles/VehicleDetail.tsx
0 → 100644
View file @
db9f05e
This diff is collapsed.
Click to expand it.
apps/web/subapps/usedcar/src/pages/Vehicles/index.tsx
View file @
db9f05e
This diff is collapsed.
Click to expand it.
apps/web/subapps/usedcar/src/pages/Vehicles/vehicles.css
0 → 100644
View file @
db9f05e
.uc-vehicle-cover
{
display
:
block
;
width
:
88px
;
height
:
64px
;
object-fit
:
contain
;
border-radius
:
4px
;
background
:
var
(
--ant-color-fill-quaternary
);
}
.uc-vehicle-detail
{
display
:
grid
;
gap
:
16px
;
}
.uc-vehicle-detail
.ant-descriptions-view
>
table
{
width
:
100%
;
table-layout
:
fixed
;
}
.uc-vehicle-detail
.ant-descriptions-item-label
{
width
:
128px
;
min-width
:
128px
;
white-space
:
nowrap
;
}
.uc-vehicle-detail-actions
{
display
:
flex
;
justify-content
:
center
;
gap
:
12px
;
margin-top
:
16px
;
}
.uc-vehicle-detail__section-title
{
margin
:
0
0
16px
;
padding-bottom
:
12px
;
border-bottom
:
1px
solid
var
(
--ant-color-border-secondary
);
font-size
:
16px
;
}
.uc-vehicle-file
{
display
:
flex
;
align-items
:
center
;
width
:
240px
;
min-width
:
0
;
}
.uc-vehicle-file__name
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
}
.uc-vehicle-file
.ant-btn-link
{
flex
:
0
0
auto
;
padding-inline
:
6px
0
;
}
packages/biz/src/components/CombiForm/index.tsx
View file @
db9f05e
...
...
@@ -13,6 +13,12 @@ export interface CombiFormProps<T extends Record<string, unknown>> {
formStyle?: CSSProperties;
sectionContentStyle?: CSSProperties;
renderSectionTitle?: (title: string) => ReactNode;
/** 详情信息每行列数,默认单列。 */
detailColumns?: number;
/** 标签固定宽度,表单和详情均右对齐。 */
labelWidth?: number;
/** 标签对齐方式,默认右对齐。 */
labelAlign?: 'left' | 'right';
renderControl?: (
field: FieldSchema<T>,
form: FormInstance<T>,
...
...
@@ -30,18 +36,27 @@ export function CombiForm<T extends Record<string, unknown>>({
sectionContentStyle,
renderSectionTitle,
renderControl,
detailColumns = 1,
labelWidth,
labelAlign = 'right',
}: CombiFormProps<T>) {
const [innerForm] = UForm.useForm<T>();
const form = externalForm ?? innerForm;
const values = UForm.useWatch([], form) as T | undefined;
const data = (values ?? initialValues ?? {}) as T;
// 详情模式只展示调用方传入的数据;空的内部表单状态不能覆盖接口返回的详情值。
const data = (mode === 'detail' ? initialValues : (values ?? initialValues ?? {})) as T;
const visible = fields.filter(
(field) => !(typeof field.hidden === 'function' ? field.hidden(data) : field.hidden),
);
if (mode === 'detail')
return (
<UDescriptions
column={1}
column={detailColumns}
styles={
labelWidth === undefined
? undefined
: { label: { width: labelWidth, justifyContent: labelAlign, whiteSpace: 'nowrap' } }
}
items={visible.map((field) => ({
key: field.name,
label: field.label,
...
...
@@ -103,6 +118,9 @@ export function CombiForm<T extends Record<string, unknown>>({
form={form}
initialValues={initialValues}
layout={layout}
labelAlign={labelAlign}
labelCol={labelWidth === undefined ? undefined : { flex: `${labelWidth}px` }}
wrapperCol={labelWidth === undefined ? undefined : { flex: 'auto' }}
style={formStyle}
onFinish={(next) => onSubmit?.(next as T)}
>
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment