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 b6e8df68
authored
Nov 18, 2026
by
liimin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
解决一些规则问题
1 parent
e941562e
Pipeline
#518
for
b6e8df68
failed
in 0 seconds
Changes
20
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
140 additions
and
31 deletions
apps/web/subapps/store/src/features/store/formatters.ts
apps/web/subapps/usedcar/src/pages/Assessment/assessment.css
apps/web/subapps/usedcar/src/pages/Delivery/index.tsx
apps/web/subapps/usedcar/src/pages/Handover/CreateHandoverModal.tsx
apps/web/subapps/usedcar/src/pages/Handover/HandoverDetailModal.tsx
apps/web/subapps/usedcar/src/pages/Leads/leads.css
apps/web/subapps/usedcar/src/pages/Ledger/VehicleLedger.tsx
apps/web/subapps/usedcar/src/pages/Operation/components/ImportContractModal.tsx
apps/web/subapps/usedcar/src/pages/Operation/contractDetail.css
apps/web/subapps/usedcar/src/pages/Vehicles/VehicleDetail.tsx
docs/PORT_CONVERSION.md
package.json
packages/contracts/src/download-center.ts
packages/design-tokens/src/palette.ts
packages/design-tokens/src/tokens.css
packages/download-center/src/deliver.ts
packages/download-center/src/handlers/simple.ts
packages/download-center/src/types.ts
scripts/audit-module.mjs
scripts/check-boundaries.mjs
apps/web/subapps/store/src/features/store/formatters.ts
View file @
b6e8df6
...
...
@@ -48,6 +48,10 @@ export function formatPolicyValue(value: unknown, unit?: string): string {
return
unit
===
'RATIO'
?
`
${
decimal
}
%`
:
decimal
;
}
/**
* §15.3② 刻意分叉:老接口返回的已是本地时间串,这里只做 `T→空格` 归一,绝不 new Date 换时区。
* biz 的 formatDateTime 是给确定 UTC ISO 的新接口用的,两者不可互相替换(见 PORT_CONVERSION.md)。
*/
export
function
formatDateTime
(
value
?:
string
|
null
):
string
{
return
value
?.
trim
().
replace
(
'T'
,
' '
)
||
EMPTY
;
}
...
...
apps/web/subapps/usedcar/src/pages/Assessment/assessment.css
View file @
b6e8df6
...
...
@@ -5,7 +5,7 @@
object-fit
:
cover
;
object-position
:
center
;
border-radius
:
4px
;
background
:
#f5f5f5
;
background
:
var
(
--uj-surface-3
)
;
}
.uc-assess-detail
{
display
:
grid
;
...
...
@@ -20,7 +20,7 @@
gap
:
12px
;
}
.uc-assess-history__item
{
border-left
:
2px
solid
#1677ff
;
border-left
:
2px
solid
var
(
--uj-primary
)
;
padding-left
:
14px
;
}
.uc-assess-history__head
{
...
...
@@ -34,7 +34,7 @@
gap
:
8px
;
}
.uc-assess-files
a
{
color
:
#1677ff
;
color
:
var
(
--uj-primary
)
;
}
.uc-assess-readonly-form__grid
{
display
:
grid
;
...
...
apps/web/subapps/usedcar/src/pages/Delivery/index.tsx
View file @
b6e8df6
...
...
@@ -8,6 +8,7 @@ import {
PageShell,
SearchForm,
type ActionSchema,
type DataTableColumn,
type FieldSchema,
type RowActionSchema,
} from '@/components';
...
...
@@ -178,7 +179,13 @@ export default function Delivery() {
['成交时间', 'transactionTime', 160],
['预约提车时间', 'scheduledTime', 160],
['实际交付时间', 'actualTime', 160],
].map(([title, dataIndex, width]) => ({ title, dataIndex, width, line: 1, render: txt }));
].map(([title, dataIndex, width]): DataTableColumn<Row> => ({
title,
dataIndex,
width,
line: 1,
render: txt,
}));
columns.push(
{
title: '交付状态',
...
...
apps/web/subapps/usedcar/src/pages/Handover/CreateHandoverModal.tsx
View file @
b6e8df6
import { useEffect, useState } from 'react';
import { useQuery, useQueryClient } from '@tanstack/react-query';
import { UButton, UCheckbox, UImage, UModal, UResult, USelect, UUpload, useUMessage } from '@uj/ui';
import { DataTable } from '@/components';
import { DataTable
, type DataTableColumn
} from '@/components';
import { staffHandoverApi } from '@/api';
import { errorDetail } from '@/utils/error';
import { uploadFileUrl } from '@/lib/ossUpload';
...
...
@@ -198,7 +198,7 @@ export default function CreateHandoverModal({
['车型', 'carModel'],
['车牌', 'licensePlate'],
]
.map(([title, dataIndex]) => ({
.map(([title, dataIndex])
: DataTableColumn<Asset>
=> ({
title,
dataIndex,
width: 180,
...
...
apps/web/subapps/usedcar/src/pages/Handover/HandoverDetailModal.tsx
View file @
b6e8df6
import { useState } from 'react';
import { useQuery } from '@tanstack/react-query';
import { UAlert, UButton, UImage, UModal } from '@uj/ui';
import { CombiForm, DataTable, type FieldSchema } from '@/components';
import { CombiForm, DataTable, type
DataTableColumn, type
FieldSchema } from '@/components';
import { staffHandoverApi } from '@/api';
import { errorDetail } from '@/utils/error';
import './handover.css';
...
...
@@ -31,7 +31,13 @@ export default function HandoverDetailModal({
['门店', 'sellerMerchantName'],
['车型', 'carModel'],
['车牌', 'licensePlate'],
].map(([title, dataIndex]) => ({ title, dataIndex, width: 160, line: 1, render: text }));
].map(([title, dataIndex]): DataTableColumn<Record<string, unknown>> => ({
title,
dataIndex,
width: 160,
line: 1,
render: text,
}));
columns.push(
{
title: '当时协议状态',
...
...
apps/web/subapps/usedcar/src/pages/Leads/leads.css
View file @
b6e8df6
.uc-lead-reminder
{
margin
:
0
0
12px
;
color
:
#d48806
;
}
.uc-lead-reminder
strong
{
color
:
#cf1322
;
font-weight
:
500
;
}
.uc-lead-reminder
{
margin
:
0
0
12px
;
color
:
var
(
--uj-warning
)
;
}
.uc-lead-reminder
strong
{
color
:
var
(
--uj-error
)
;
font-weight
:
500
;
}
.uc-lead-level
{
display
:
inline-flex
;
align-items
:
center
;
gap
:
7px
;
}
.uc-lead-level
b
{
display
:
inline-grid
;
place-items
:
center
;
width
:
22px
;
height
:
22px
;
border-radius
:
50%
;
color
:
#fff
;
background
:
#8c8c8c
;
}
.uc-lead-level--o
b
{
background
:
#c04dff
;
}
.uc-lead-level--h
b
{
background
:
#f7a900
;
}
.uc-lead-level--a
b
{
background
:
#55b896
;
}
.uc-lead-level--b
b
{
background
:
#5fbdff
;
}
.uc-lead-level--c
b
{
background
:
#54dfff
;
}
.uc-lead-detail
{
display
:
grid
;
gap
:
16px
;
}
.uc-lead-detail__top
{
display
:
grid
;
grid-template-columns
:
minmax
(
0
,
1
fr
)
300px
;
gap
:
16px
;
}
.uc-lead-detail__title
{
margin
:
0
0
14px
;
font-size
:
15px
;
}
.uc-lead-detail__empty
{
padding
:
28px
;
text-align
:
center
;
color
:
var
(
--uj-text-3
);
}
.uc-lead-follow
{
display
:
grid
;
gap
:
12px
;
}
.uc-lead-follow__item
{
border-left
:
2px
solid
#1677ff
;
padding-left
:
14px
;
}
.uc-lead-follow__head
{
display
:
flex
;
justify-content
:
space-between
;
margin-bottom
:
8px
;
}
.uc-lead-follow__body
{
background
:
#f5f7fa
;
padding
:
12px
;
border-radius
:
6px
;
display
:
grid
;
gap
:
6px
;
}
.uc-lead-follow__body
span
{
color
:
var
(
--uj-text-2
);
}
.uc-lead-follow__body
b
{
color
:
var
(
--uj-text-1
);
font-weight
:
400
;
}
.uc-lead-level
b
{
display
:
inline-grid
;
place-items
:
center
;
width
:
22px
;
height
:
22px
;
border-radius
:
50%
;
color
:
var
(
--uj-on-primary
);
background
:
var
(
--uj-lead-none
)
;
}
.uc-lead-level--o
b
{
background
:
var
(
--uj-lead-o
);
}
.uc-lead-level--h
b
{
background
:
var
(
--uj-lead-h
);
}
.uc-lead-level--a
b
{
background
:
var
(
--uj-lead-a
);
}
.uc-lead-level--b
b
{
background
:
var
(
--uj-lead-b
);
}
.uc-lead-level--c
b
{
background
:
var
(
--uj-lead-c
)
;
}
.uc-lead-detail
{
display
:
grid
;
gap
:
16px
;
}
.uc-lead-detail__top
{
display
:
grid
;
grid-template-columns
:
minmax
(
0
,
1
fr
)
300px
;
gap
:
16px
;
}
.uc-lead-detail__title
{
margin
:
0
0
14px
;
font-size
:
15px
;
}
.uc-lead-detail__empty
{
padding
:
28px
;
text-align
:
center
;
color
:
var
(
--uj-text-3
);
}
.uc-lead-follow
{
display
:
grid
;
gap
:
12px
;
}
.uc-lead-follow__item
{
border-left
:
2px
solid
var
(
--uj-primary
);
padding-left
:
14px
;
}
.uc-lead-follow__head
{
display
:
flex
;
justify-content
:
space-between
;
margin-bottom
:
8px
;
}
.uc-lead-follow__body
{
background
:
var
(
--uj-surface-3
)
;
padding
:
12px
;
border-radius
:
6px
;
display
:
grid
;
gap
:
6px
;
}
.uc-lead-follow__body
span
{
color
:
var
(
--uj-text-2
);
}
.uc-lead-follow__body
b
{
color
:
var
(
--uj-text-1
);
font-weight
:
400
;
}
@media
(
max-width
:
900px
)
{
.uc-lead-detail__top
{
grid-template-columns
:
1
fr
;
}
}
apps/web/subapps/usedcar/src/pages/Ledger/VehicleLedger.tsx
View file @
b6e8df6
import { useMemo, useState } from 'react';
import { useQuery } from '@tanstack/react-query';
import type { Dayjs } from 'dayjs';
import { UAlert, U
Button, U
Card, UTag } from '@uj/ui';
import { UAlert, UCard, UTag } from '@uj/ui';
import { downloadCenter } from '@uj/platform-sdk';
import { DataTable, SearchForm, type FieldSchema } from '@/components';
import { DataTable, SearchForm, type
DataTableColumn, type
FieldSchema } from '@/components';
import { vehicleLedgerApi } from '@/api';
import { useAccess } from '@/access';
import { UC } from '@/permissions/codes';
...
...
@@ -133,7 +133,7 @@ export default function VehicleLedger() {
['车辆类型', 'vehicleType'],
['是否对账', 'isReconciled'],
];
const columns = plain.map(([title, dataIndex]) => ({
const columns = plain.map(([title, dataIndex])
: DataTableColumn<Row>
=> ({
title,
dataIndex,
width: 150,
...
...
apps/web/subapps/usedcar/src/pages/Operation/components/ImportContractModal.tsx
View file @
b6e8df6
...
...
@@ -128,13 +128,22 @@ export default function ImportContractModal({
description={
<div>
<div>
成功记录 <span style={{ color: '
#2cca74
' }}>{result.succ ?? 0}</span>
{' '}失败记录 <span style={{ color: '
#eb4e4e
' }}>{result.fail ?? 0}</span>
成功记录 <span style={{ color: '
var(--uj-success)
' }}>{result.succ ?? 0}</span>
{' '}失败记录 <span style={{ color: '
var(--uj-error)
' }}>{result.fail ?? 0}</span>
</div>
{result.failDownloadUrl ? (
<UButton
type="link"
onClick={() => window.open(result.failDownloadUrl, '_blank')}
onClick={() =>
downloadCenter.url({
source: 'usedcar',
sourceLabel: '运营管理 / 合同管理 / 导入结果',
label: '合同导入失败记录',
url: result.failDownloadUrl!,
fileName: '合同导入失败记录.xlsx',
dedupeKey: `usedcar-contract-import-fail-${result.failDownloadUrl}`,
})
}
style={{ paddingLeft: 0 }}
>
导出失败记录
...
...
apps/web/subapps/usedcar/src/pages/Operation/contractDetail.css
View file @
b6e8df6
...
...
@@ -10,7 +10,7 @@
.uc-contract-detail__thumb
{
width
:
72px
;
height
:
72px
;
object-fit
:
cover
;
border-radius
:
6px
;
cursor
:
zoom-in
;
border
:
1px
solid
var
(
--uj-border
,
#e5e7eb
);
}
.uc-contract-detail__signer
+
.uc-contract-detail__signer
{
margin-top
:
8px
;
}
.uc-contract-detail__logs
{
display
:
grid
;
gap
:
10px
;
}
.uc-contract-detail__log
{
display
:
flex
;
gap
:
20px
;
align-items
:
center
;
border-left
:
2px
solid
#1677ff
;
padding-left
:
14px
;
color
:
var
(
--uj-text-2
);
}
.uc-contract-detail__log
{
display
:
flex
;
gap
:
20px
;
align-items
:
center
;
border-left
:
2px
solid
var
(
--uj-primary
)
;
padding-left
:
14px
;
color
:
var
(
--uj-text-2
);
}
.uc-contract-detail__log
b
{
color
:
var
(
--uj-text-1
);
font-weight
:
500
;
}
@media
(
max-width
:
900px
)
{
.uc-contract-detail__field
{
grid-template-columns
:
1
fr
;
}
...
...
apps/web/subapps/usedcar/src/pages/Vehicles/VehicleDetail.tsx
View file @
b6e8df6
...
...
@@ -2,6 +2,7 @@ import { useEffect, useMemo, useState } from 'react';
import { useQuery } from '@tanstack/react-query';
import dayjs, { type Dayjs } from 'dayjs';
import { UAlert, UButton, UCard, UDatePicker, UForm, UModal, UResult, useUMessage } from '@uj/ui';
import { downloadCenter } from '@uj/platform-sdk';
import { CombiForm, PageShell, type FieldSchema } from '@/components';
import { useAccess } from '@/access';
import { carManagementApi } from '@/api';
...
...
@@ -74,7 +75,17 @@ function FilePreview({ value }: { value: unknown }) {
<UButton
type="link"
size="small"
onClick={() => window.open(url, '_blank', 'noopener,noreferrer')}
onClick={() =>
downloadCenter.url({
source: 'usedcar',
sourceLabel: '二手车管理 / 车辆管理 / 附件预览',
label: name,
url,
preview: true,
silent: true,
dedupeKey: `usedcar-vehicle-preview-${url}`,
})
}
>
预览
</UButton>
...
...
docs/PORT_CONVERSION.md
View file @
b6e8df6
...
...
@@ -407,6 +407,8 @@ downloadCenter.register({ ... }); // 显式 kind / 自定义 kind 的统一登
公共字段(
`CommonDownloadInput`
):
`source`
、
`label`
、
`fileName`
、
`autoDownload`
(默认 true;false 只进面板供点击)、
`silent`
(默认 false)、
`dedupeKey`
(防连点去重)、
`channel`
(多网关,见 14.6)。
`async-export`
另可覆盖:
`submitMethod`
/
`queryMethod`
/
`pollInterval`
(默认 3000ms)/
`timeoutMs`
(默认 10 分钟)。
`url`
另可传
`preview: true`
:
**可见新标签预览,不落盘**
——给「看一眼附件」这类动作使用(对应 14.7 的纯外链预览场景)。
落地由主壳
`deliver.openPreview()`
统一执行,子应用只登记任务、不自己
`window.open`
。
**`url` kind 会在执行前归一明文地址**
:HTTPS 主壳 +
`http://`
直链时,
`packages/download-center/src/deliver.ts`
的
`upgradeInsecureUrl()`
把协议换成 https
**并丢掉原 HTTP 业务端口**
(回单
`http://qcimg01.glsx.com.cn:7060/...`
→
`https://qcimg01.glsx.com.cn/...`
,443 上返回同一份文件)。业务页只管把后端给的地址原样交给
`downloadCenter.url()`
,
**不要自己改协议**
。
...
...
package.json
View file @
b6e8df6
...
...
@@ -28,6 +28,7 @@
"boundaries"
:
"node scripts/check-boundaries.mjs"
,
"tokens"
:
"node scripts/check-tokens.mjs"
,
"reconcile"
:
"node scripts/reconcile.mjs"
,
"audit:module"
:
"node scripts/audit-module.mjs"
,
"release"
:
"node scripts/release/release.mjs"
,
"release:affected"
:
"node scripts/release/release-affected.mjs"
,
"release:gen"
:
"node scripts/release/release-gen.mjs"
,
...
...
packages/contracts/src/download-center.ts
View file @
b6e8df6
...
...
@@ -76,6 +76,11 @@ export interface UrlPayload {
url
:
string
;
/** 默认 true:新标签页打开,避免把主壳路由导航走。 */
openInNewTab
?:
boolean
;
/**
* 预览模式(默认 false):只开可见新标签,不落盘。
* 给「看一眼附件」这类动作用;下载仍由主壳统一执行,子应用不自己 window.open。
*/
preview
?:
boolean
;
}
/** 前端本地 Blob。Blob 不可序列化,仅主壳页面直调;不进持久化。 */
...
...
packages/design-tokens/src/palette.ts
View file @
b6e8df6
...
...
@@ -63,6 +63,18 @@ export const palette = {
info
:
'#D6E2FB'
,
neutral
:
'#E4E8EF'
,
},
/**
* 线索等级标识色:老系统 O/H/A/B/C 五档的业务分类色,不是语义色。
* 五档必须彼此可区分,不能拿 success/warning 之类替代,故单列一族。
*/
leadLevel
:
{
none
:
'#8C8C8C'
,
o
:
'#C04DFF'
,
h
:
'#F7A900'
,
a
:
'#55B896'
,
b
:
'#5FBDFF'
,
c
:
'#54DFFF'
,
},
}
as
const
;
export
const
radius
=
{
...
...
packages/design-tokens/src/tokens.css
View file @
b6e8df6
...
...
@@ -62,6 +62,14 @@
--uj-neutral-soft
:
#f2f4f8
;
--uj-neutral-border
:
#e4e8ef
;
/* ---- 线索等级标识色:老系统 O/H/A/B/C 五档,业务分类色,不随语义色切换 ---- */
--uj-lead-none
:
#8c8c8c
;
--uj-lead-o
:
#c04dff
;
--uj-lead-h
:
#f7a900
;
--uj-lead-a
:
#55b896
;
--uj-lead-b
:
#5fbdff
;
--uj-lead-c
:
#54dfff
;
/* ---- 高度:两级静置 + 一级抬起(hover)+ 浮层。短投射、低扩散,干脆不飘 ---- */
--uj-shadow-card
:
0
1px
2px
rgba
(
16
,
24
,
40
,
0.05
),
0
2px
6px
-2px
rgba
(
16
,
24
,
40
,
0.08
);
--uj-shadow-raise
:
0
2px
4px
rgba
(
16
,
24
,
40
,
0.06
),
0
8px
20px
-12px
rgba
(
16
,
24
,
40
,
0.18
);
...
...
packages/download-center/src/deliver.ts
View file @
b6e8df6
...
...
@@ -259,6 +259,27 @@ export function openUrl(url: string, openInNewTab = true): void {
link
.
remove
();
}
/**
* 可见新标签预览。与 openUrl 的隐藏 iframe 不同,这里必须真开一个用户看得见的标签页;
* 只在主壳内调用,子应用只经 downloadCenter.url({ preview: true }) 登记。
*/
export
function
openPreview
(
url
:
string
):
void
{
const
target
=
upgradeInsecureUrl
(
url
);
assertDownloadableUrl
(
target
);
const
win
=
window
.
open
(
target
,
'_blank'
,
'noopener,noreferrer'
);
if
(
!
win
)
{
// 被弹窗拦截器挡下:再试一次用户手势内的 <a target=_blank>,绝不退回当前标签跳转,
// 否则一次预览会把整个主壳导航走。
const
link
=
document
.
createElement
(
'a'
);
link
.
href
=
target
;
link
.
target
=
'_blank'
;
link
.
rel
=
'noopener,noreferrer'
;
document
.
body
.
appendChild
(
link
);
link
.
click
();
link
.
remove
();
}
}
export
function
blobFromArrayBuffer
(
buffer
:
ArrayBuffer
,
mime
:
string
):
Blob
{
return
new
Blob
([
buffer
],
{
type
:
mime
||
'application/octet-stream'
});
}
...
...
@@ -302,6 +323,7 @@ export function invalidDownload(payload: unknown): Error {
export
const
deliverTools
:
DeliverTools
=
{
saveBlob
,
openUrl
,
openPreview
,
parseFileName
,
sanitizeFileName
,
};
packages/download-center/src/handlers/simple.ts
View file @
b6e8df6
...
...
@@ -5,7 +5,12 @@ import type {
DownloadResult
,
UrlPayload
,
}
from
'../types'
;
import
{
assertDownloadableUrl
,
blobFromBase64
,
probeDownloadUrl
,
upgradeInsecureUrl
}
from
'../deliver'
;
import
{
assertDownloadableUrl
,
blobFromBase64
,
probeDownloadUrl
,
upgradeInsecureUrl
,
}
from
'../deliver'
;
/** 从 URL 路径末段推断文件名(预签名 URL 的 query 不参与)。 */
function
fileNameFromUrl
(
url
:
string
):
string
{
...
...
@@ -44,6 +49,10 @@ export const urlHandler: DownloadHandler = {
if
(
probe
.
kind
===
'error'
)
throw
new
Error
(
probe
.
message
);
if
(
probe
.
kind
===
'ok'
)
{
if
(
payload
.
preview
)
{
ctx
.
deliver
.
openPreview
(
url
);
return
{
fileUrl
:
url
,
fileName
:
probe
.
fileName
,
bytes
:
probe
.
bytes
,
note
:
'已打开预览'
};
}
// 探测成功即直接用响应体落盘,不再重复发一次 iframe 请求。
if
(
task
.
input
.
autoDownload
!==
false
)
{
ctx
.
deliver
.
saveBlob
(
probe
.
blob
,
probe
.
fileName
);
...
...
@@ -59,10 +68,16 @@ export const urlHandler: DownloadHandler = {
// opaque:跨域无 CORS 的 OSS 预签名地址,无法探测,退回原 iframe 行为。
// 这类地址的加载失败浏览器不让 JS 感知,是既定限制,不能因此误判为失败。
assertDownloadableUrl
(
url
);
if
(
task
.
input
.
autoDownload
!==
false
)
{
if
(
payload
.
preview
)
{
ctx
.
deliver
.
openPreview
(
url
);
}
else
if
(
task
.
input
.
autoDownload
!==
false
)
{
ctx
.
deliver
.
openUrl
(
url
,
payload
.
openInNewTab
??
true
);
}
return
{
fileUrl
:
url
,
fileName
,
note
:
'已打开下载地址'
};
return
{
fileUrl
:
url
,
fileName
,
note
:
payload
.
preview
?
'已打开预览'
:
'已打开下载地址'
,
};
},
};
...
...
@@ -91,8 +106,4 @@ export const base64Handler: DownloadHandler = {
},
};
export
const
builtinHandlers
:
DownloadHandler
[]
=
[
urlHandler
,
blobHandler
,
base64Handler
,
];
export
const
builtinHandlers
:
DownloadHandler
[]
=
[
urlHandler
,
blobHandler
,
base64Handler
];
packages/download-center/src/types.ts
View file @
b6e8df6
...
...
@@ -26,6 +26,8 @@ export interface DeliverTools {
saveBlob
(
blob
:
Blob
,
fileName
:
string
):
void
;
/** 打开自带鉴权的 URL(新标签页,避免主壳被导航走)。 */
openUrl
(
url
:
string
,
openInNewTab
?:
boolean
):
void
;
/** 可见新标签预览:与 openUrl 的隐藏 iframe 落盘不同,只给用户看,不触发下载。 */
openPreview
(
url
:
string
):
void
;
/** 从 content-disposition 解析并清洗文件名。 */
parseFileName
(
disposition
:
string
,
fallback
:
string
):
string
;
/** 清洗文件名中的非法字符与 C0 控制字符。 */
...
...
scripts/audit-module.mjs
0 → 100644
View file @
b6e8df6
This diff is collapsed.
Click to expand it.
scripts/check-boundaries.mjs
View file @
b6e8df6
...
...
@@ -102,11 +102,20 @@ for (const appDir of subappDirs) {
}
// CSS:裸 .ant-* 覆盖会改 antd 内部盒模型,项目约定一律走 ConfigProvider token。
//
旧仓迁过来的 CSS 里可能已有,先只告警,待样式归类中逐条清理
。
//
「.uj-xxx .ant-yyy」这类带自有类祖先的局部限定只动自己的样式,与新巡检脚本同口径放行
。
for (const file of collect(path.join(appDir, 'src'), ['.css'])) {
const text = fs.readFileSync(file, 'utf8');
const rel = path.relative(ROOT, file).split(path.sep).join('/');
if (/^\s*\.ant-/.test(text) || /\n\s*\.ant-/.test(text)) {
const bareAnt = [...text.matchAll(/(^|\n)\s*([^{}]+)\{/g)].some((m) =>
m[2].split(',').some((part) => {
const chain = part
.trim()
.split(/\s+|>|\+|~/)
.filter(Boolean);
return chain.length > 0 && chain.every((s) => /^\.ant-/.test(s));
}),
);
if (bareAnt) {
warnings.push(`[css] ${rel}: 含裸 .ant-* 选择器,确认未覆盖组件内部几何属性`);
}
}
...
...
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