This commit is contained in:
zlwu committed 2026-08-02 17:18:33 +08:00
1 parent c00f19f8bd
commit 272c68af4b
134 files changed
+930389 -38617

No files matched your search

+9 -3
View File
@@ -1,8 +1,12 @@
/**
* 全局包装 ElTag:默认插槽无有效内容时不渲染,避免空值时出现带背景色的空 tag。
* 通过 vite Components 自定义 resolver 替换自动导入的 ElTag。
* 全局包装 ElTag:
* 1) 默认插槽无有效内容时不渲染,避免空值时出现带背景色的空 tag
* 2) 默认 effect="dark"(深色底 + 白字),覆盖 Element Plus 默认 light(浅底彩字 / info=#909399)
* 通过 vite Components 自定义 resolver + main.ts 全局注册替换 ElTag。
*/
import { ElTag } from 'element-plus'
// 走 SCSS 源码,使 el-light.scss 中的语义色生效(info Tag 另由 el-ui 设为无背景+正文色)
import 'element-plus/es/components/tag/style/index'
import { Comment, Text, defineComponent, h, type VNode, type VNodeArrayChildren } from 'vue'
function hasVisibleDefaultContent(vnodes: VNode[] | undefined): boolean {
@@ -39,7 +43,9 @@ const EmptyAwareElTag = defineComponent({
if (!hasVisibleDefaultContent(slots.default?.())) {
return null
}
return h(ElTag, { ...props, ...attrs }, slots)
// ElTag 自身 default effect 为 light(浅底彩字);此处一律强制 dark(深色底白字)
// 注意:不能读 props.effect 再 ?? 'dark',因默认值已是 'light',永远不会落到 dark
return h(ElTag, { ...props, ...attrs, effect: 'dark' }, slots)
}
}
})
+3 -3
View File
@@ -22,7 +22,7 @@ export function isRequiredCertSlotComplete(
if (!cert) return false
if (!matchRequiredCertName(cert.certName, requiredName)) return false
if (!cert.expireDate) return false
if (!cert.attachmentUrls?.trim()) return false
// 证书附件非必填
return true
}
@@ -31,11 +31,11 @@ export function getMissingRequiredCertFieldLabels(
requiredName: string
): string[] {
if (!cert || !matchRequiredCertName(cert.certName, requiredName)) {
return ['有效期', '附件']
return ['有效期']
}
const missing: string[] = []
if (!cert.expireDate) missing.push('有效期')
if (!cert.attachmentUrls?.trim()) missing.push('附件')
// 证书附件非必填
return missing
}
+16 -9
View File
@@ -1,16 +1,23 @@
/**
* 三方车辆/人员客户文本粘贴解析
* 示例:
* 皖LB1405 皖LP359
* 核载:34 吨
* 驾驶员:徐孝军
* 手机号:18956652137
* 身份证:342921198602020031
* 押运员:汪海明
* 电话:13955522828
* 身份证:342829197009084019
* 标准格式见 `PL_PASTE_SAMPLE_TEXT`。
*/
/**
* 粘贴识别输入框预填示例(格式与解析规则一致,敏感字段已脱敏,供用户对照改写)
* 姓名保留姓、手机保留前 3 后 4、身份证保留前 6 后 4、车牌保留省份简称后打码
*/
export const PL_PASTE_SAMPLE_TEXT = [
'皖****** 皖******',
'核载:34 吨',
'驾驶员:张**',
'手机号:138****0000',
'身份证:340000********0000',
'押运员:李**',
'电话:139****0000',
'身份证:340000********0000'
].join('\n')
export interface PlPastePersonnelDraft {
personnelName: string
phoneNo?: string
+4 -8
View File
@@ -119,7 +119,7 @@ export function isPersonnelCertStrictComplete(
if (!cert?.certName?.trim()) return false
if (!matchRequiredCertName(cert.certName, requiredName)) return false
if (!cert.expireDate) return false
if (!cert.attachmentUrls?.trim()) return false
// 证书附件非必填
return true
}
@@ -136,11 +136,7 @@ export function matchRequiredCertName(
}
export function isPersonnelCertUploaded(cert?: Pick<CertRow, 'certName' | 'certNo' | 'expireDate' | 'attachmentUrls'>) {
return Boolean(
cert?.certName?.trim() &&
cert?.expireDate &&
cert?.attachmentUrls?.trim()
)
return Boolean(cert?.certName?.trim() && cert?.expireDate)
}
export function getRequiredPersonnelCertNames(role: PersonnelCertRole): readonly string[] {
@@ -215,11 +211,11 @@ function getPersonnelCertMissingFieldLabels(
requiredName: string
): string[] {
if (!cert || !matchRequiredCertName(cert.certName, requiredName)) {
return ['有效期', '附件']
return ['有效期']
}
const missing: string[] = []
if (!cert.expireDate) missing.push('有效期')
if (!cert.attachmentUrls?.trim()) missing.push('附件')
// 证书附件非必填
return missing
}
+3 -7
View File
@@ -77,11 +77,7 @@ export function mergeVehicleCertsByPart<T extends CertRow>(
}
export function isVehicleCertUploaded(cert?: Pick<CertRow, 'certName' | 'certNo' | 'expireDate' | 'attachmentUrls'>) {
return Boolean(
cert?.certName?.trim() &&
cert?.expireDate &&
cert?.attachmentUrls?.trim()
)
return Boolean(cert?.certName?.trim() && cert?.expireDate)
}
export function getVehicleHeadRequiredCertNames(
@@ -263,11 +259,11 @@ function getVehicleCertMissingFieldLabels(
requiredName: string
): string[] {
if (!cert || !matchVehicleRequiredCertName(cert.certName, requiredName)) {
return ['有效期', '附件']
return ['有效期']
}
const missing: string[] = []
if (!cert.expireDate) missing.push('有效期')
if (!cert.attachmentUrls?.trim()) missing.push('附件')
// 证书附件非必填
return missing
}