提交
This commit is contained in:
1 parent
f3693be913
commit
3d645b4112
272 files changed
+950716
-27033
No files matched your search
@@ -66,8 +66,21 @@ export function getProductCertUrl(product: PlanProduct, key: HazardCertSlotKey):
|
||||
return typeof value === 'string' ? value.trim() : ''
|
||||
}
|
||||
|
||||
/** 危化证书字段支持逗号分隔多附件 */
|
||||
export function splitProductCertUrls(raw?: string): string[] {
|
||||
return String(raw || '')
|
||||
.split(',')
|
||||
.map(item => item.trim())
|
||||
.filter(Boolean)
|
||||
}
|
||||
|
||||
/** 列表缩略图等场景取首个附件 URL */
|
||||
export function getPrimaryProductCertUrl(product: PlanProduct, key: HazardCertSlotKey): string {
|
||||
return splitProductCertUrls(getProductCertUrl(product, key))[0] || ''
|
||||
}
|
||||
|
||||
export function isProductCertSlotFilled(product: PlanProduct, key: HazardCertSlotKey): boolean {
|
||||
return Boolean(getProductCertUrl(product, key))
|
||||
return Boolean(getPrimaryProductCertUrl(product, key))
|
||||
}
|
||||
|
||||
export function isProductCertComplete(product: PlanProduct): boolean {
|
||||
|
||||
Reference in new issue
Block a user