提交
This commit is contained in:
1 parent
4a00f21bfb
commit
edf88dc016
1503 files changed
+329728
-41987
No files matched your search
@@ -21,4 +21,3 @@ export function formatCategoryPathLabel(categoryId: unknown, fallbackName?: unkn
|
||||
if (path) return path
|
||||
return fallback || '—'
|
||||
}
|
||||
|
||||
@@ -137,9 +137,7 @@ export const getFirstSecondLevelMenuPath = (menuList: AppRouteRecord[]): string
|
||||
continue
|
||||
}
|
||||
|
||||
const topPath = topItem.path!.startsWith('/')
|
||||
? topItem.path!
|
||||
: normalizePath(topItem.path!)
|
||||
const topPath = topItem.path!.startsWith('/') ? topItem.path! : normalizePath(topItem.path!)
|
||||
|
||||
const childPath = getFirstMenuPath(children, topPath)
|
||||
if (childPath) {
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
* 若某处需关闭:在模板上写 :filterable="false"。
|
||||
*/
|
||||
import { selectProps } from 'element-plus/es/components/select/src/select.mjs'
|
||||
|
||||
;(selectProps as { filterable?: unknown }).filterable = {
|
||||
type: Boolean,
|
||||
default: true
|
||||
|
||||
@@ -94,8 +94,7 @@ export function alignFqPaymentDetailsForDisplay(
|
||||
}
|
||||
result.push({
|
||||
installmentNo: no,
|
||||
installmentDueDate:
|
||||
startDate && interval ? addMonthsYmd(startDate, i * interval) : '',
|
||||
installmentDueDate: startDate && interval ? addMonthsYmd(startDate, i * interval) : '',
|
||||
dueAmount: amounts[i] ?? null,
|
||||
payStatus: 'dfj',
|
||||
transferType: '',
|
||||
|
||||
@@ -21,7 +21,7 @@ export async function fetchNextSortOrder(
|
||||
const lastPage = Math.ceil(total / pageSize)
|
||||
const res = lastPage <= 1 ? first : await fetchList({ page: lastPage, pageSize })
|
||||
const list = res.list ?? []
|
||||
const nums = list.map(r => {
|
||||
const nums = list.map((r) => {
|
||||
const n = Number(r.sortOrder)
|
||||
return Number.isFinite(n) ? n : 0
|
||||
})
|
||||
|
||||
@@ -150,7 +150,8 @@ export const qcBizTypeTagType = createTagTypeGetter(qcBizType)
|
||||
export const workOrderStatus: StatusRegistry = {
|
||||
dpz: { label: '待配置', tagType: 'info' },
|
||||
ypz: { label: '已配置', tagType: 'success' },
|
||||
ywc: { label: '已完成', tagType: 'success' }
|
||||
ywc: { label: '已完成', tagType: 'success' },
|
||||
yzf: { label: '已作废', tagType: 'danger' }
|
||||
}
|
||||
export const workOrderStatusLabel = createLabelGetter(workOrderStatus)
|
||||
export const workOrderStatusTagType = createTagTypeGetter(workOrderStatus)
|
||||
@@ -380,6 +381,7 @@ export const txnTypeLabel = (type: string): string => {
|
||||
refund: '退款',
|
||||
purchase: '购买产品',
|
||||
unsubscribe: '退订产品',
|
||||
settlement: '输注结算'
|
||||
}
|
||||
return map[type] || type
|
||||
}
|
||||
@@ -390,6 +392,7 @@ export const txnTypeTagType = (type: string): string => {
|
||||
refund: 'danger',
|
||||
purchase: 'success',
|
||||
unsubscribe: 'warning',
|
||||
settlement: 'primary'
|
||||
}
|
||||
return map[type] || 'info'
|
||||
}
|
||||
@@ -400,7 +403,7 @@ export const txnStatusLabel = (status: string): string => {
|
||||
dsx: '待生效',
|
||||
dqr: '待财务确认',
|
||||
yqr: '已确认',
|
||||
yzf: '已作废',
|
||||
yzf: '已作废'
|
||||
}
|
||||
return map[status] || status
|
||||
}
|
||||
@@ -410,7 +413,7 @@ export const txnStatusTagType = (status: string): string => {
|
||||
dsx: 'info',
|
||||
dqr: 'warning',
|
||||
yqr: 'success',
|
||||
yzf: 'danger',
|
||||
yzf: 'danger'
|
||||
}
|
||||
return map[status] || 'info'
|
||||
}
|
||||
@@ -420,9 +423,14 @@ export function applicationStatusLabel(status: string): string {
|
||||
const map: Record<string, string> = { dks: '待开始', jxz: '进行中', ywc: '已完成', yzf: '已作废' }
|
||||
return map[status] || status || '-'
|
||||
}
|
||||
export function applicationStatusTagType(status: string): '' | 'success' | 'warning' | 'danger' | 'info' {
|
||||
export function applicationStatusTagType(
|
||||
status: string
|
||||
): '' | 'success' | 'warning' | 'danger' | 'info' {
|
||||
const map: Record<string, '' | 'success' | 'warning' | 'danger' | 'info'> = {
|
||||
dks: 'info', jxz: '', ywc: 'success', yzf: 'danger'
|
||||
dks: 'info',
|
||||
jxz: 'warning',
|
||||
ywc: 'success',
|
||||
yzf: 'danger'
|
||||
}
|
||||
return map[status] || 'info'
|
||||
}
|
||||
@@ -431,7 +439,7 @@ export function applicationStatusTagType(status: string): '' | 'success' | 'warn
|
||||
export function checkupStatusLabel(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
dtj: '待体检',
|
||||
ytj: '已体检',
|
||||
ytj: '已体检'
|
||||
}
|
||||
return map[status] || status || '-'
|
||||
}
|
||||
@@ -439,7 +447,7 @@ export function checkupStatusLabel(status: string): string {
|
||||
export function checkupStatusTagType(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
dtj: 'warning',
|
||||
ytj: 'success',
|
||||
ytj: 'success'
|
||||
}
|
||||
return map[status] || 'info'
|
||||
}
|
||||
@@ -447,7 +455,7 @@ export function checkupStatusTagType(status: string): string {
|
||||
export function feeStatusLabel(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
wjs: '未结算',
|
||||
yjs: '已结算',
|
||||
yjs: '已结算'
|
||||
}
|
||||
return map[status] || status || '-'
|
||||
}
|
||||
@@ -455,7 +463,7 @@ export function feeStatusLabel(status: string): string {
|
||||
export function feeStatusTagType(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
wjs: 'info',
|
||||
yjs: 'success',
|
||||
yjs: 'success'
|
||||
}
|
||||
return map[status] || 'info'
|
||||
}
|
||||
@@ -466,20 +474,50 @@ export function scheduleStatusLabel(status: string): string {
|
||||
dsc: '待生产',
|
||||
ysc: '已生产',
|
||||
yjf: '已交付',
|
||||
yqx: '已取消',
|
||||
yqx: '已取消'
|
||||
}
|
||||
return map[status] || status || '-'
|
||||
}
|
||||
export function scheduleStatusTagType(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
dsc: 'info',
|
||||
ysc: '',
|
||||
ysc: 'primary',
|
||||
yjf: 'success',
|
||||
yqx: 'danger',
|
||||
yqx: 'danger'
|
||||
}
|
||||
return map[status] || 'info'
|
||||
}
|
||||
|
||||
// ========== 中试服务 - 输注状态 ==========
|
||||
export function infusionStatusLabel(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
dtz: '待输注',
|
||||
yrqr: '已用户确认',
|
||||
yqx: '已取消',
|
||||
ywc: '已完成'
|
||||
}
|
||||
return map[status] || status || '-'
|
||||
}
|
||||
export function infusionStatusTagType(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
dtz: 'info',
|
||||
yrqr: 'warning',
|
||||
yqx: 'danger',
|
||||
ywc: 'success'
|
||||
}
|
||||
return map[status] || 'info'
|
||||
}
|
||||
|
||||
// ========== 中试服务 - 质检状态 ==========
|
||||
export function qcStatusLabel(status: string): string {
|
||||
const map: Record<string, string> = { dzc: '待质检', yzj: '已质检', yqx: '已取消' }
|
||||
return map[status] || status || '-'
|
||||
}
|
||||
export function qcStatusTagType(status: string): string {
|
||||
const map: Record<string, string> = { dzc: 'info', yzj: 'success', yqx: 'danger' }
|
||||
return map[status] || 'info'
|
||||
}
|
||||
|
||||
// ========== 中试服务 - 放行审核结论 ==========
|
||||
export function releaseReviewConclusionLabel(conclusion: string): string {
|
||||
const map: Record<string, string> = { tg: '通过', btg: '不通过' }
|
||||
@@ -490,3 +528,38 @@ export function releaseReviewConclusionTagType(conclusion: string): string {
|
||||
return map[conclusion] || 'info'
|
||||
}
|
||||
|
||||
// ========== 中试服务 - 业务类型 ==========
|
||||
export function bizTypeLabel(type: string): string {
|
||||
const map: Record<string, string> = {
|
||||
pilot_service: '中试服务',
|
||||
clinical_application: '临床应用'
|
||||
}
|
||||
return map[type] || type || '-'
|
||||
}
|
||||
export function bizTypeTagType(type: string): string {
|
||||
const map: Record<string, string> = {
|
||||
pilot_service: 'primary',
|
||||
clinical_application: 'warning'
|
||||
}
|
||||
return map[type] || 'info'
|
||||
}
|
||||
|
||||
// ========== 中试服务 - 产品状态 ==========
|
||||
export function productStatusLabel(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
dtz: '待输注',
|
||||
yrqr: '已用户确认',
|
||||
yqx: '已取消',
|
||||
ywc: '已完成'
|
||||
}
|
||||
return map[status] || status || '-'
|
||||
}
|
||||
export function productStatusTagType(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
dtz: 'info',
|
||||
yrqr: 'warning',
|
||||
yqx: 'danger',
|
||||
ywc: 'success'
|
||||
}
|
||||
return map[status] || 'info'
|
||||
}
|
||||
@@ -6,8 +6,7 @@ import { buildTreePathLabelFromFlat } from '@/utils/tree-path'
|
||||
export type StorageSlotSelectOption = { id: string; name: string }
|
||||
|
||||
export function getStorageFacilityOrderNum(item: Record<string, unknown>): number {
|
||||
const raw =
|
||||
item?.orderNum ?? item?.order_num ?? item?.sortOrder ?? item?.sort_order ?? 0
|
||||
const raw = item?.orderNum ?? item?.order_num ?? item?.sortOrder ?? item?.sort_order ?? 0
|
||||
const parsed = Number(raw)
|
||||
return Number.isFinite(parsed) ? parsed : 0
|
||||
}
|
||||
@@ -19,9 +18,7 @@ export function getStorageSlotOrderNum(slot: Record<string, unknown>): number {
|
||||
}
|
||||
|
||||
/** 解析 slotCode「{prefix}{row}-{col}」 */
|
||||
export function parseStorageSlotCode(
|
||||
code: string
|
||||
): { row: number; col: number } | null {
|
||||
export function parseStorageSlotCode(code: string): { row: number; col: number } | null {
|
||||
const match = (code || '').trim().match(/^(.*?)(\d+)-(\d+)$/)
|
||||
if (!match) return null
|
||||
return { row: parseInt(match[2], 10), col: parseInt(match[3], 10) }
|
||||
@@ -48,9 +45,7 @@ export function compareStorageFacilitySlots(
|
||||
return String(a.id ?? '').localeCompare(String(b.id ?? ''))
|
||||
}
|
||||
|
||||
export function sortStorageFacilitySlots<T extends Record<string, unknown>>(
|
||||
slots: T[]
|
||||
): T[] {
|
||||
export function sortStorageFacilitySlots<T extends Record<string, unknown>>(slots: T[]): T[] {
|
||||
return [...slots].sort(compareStorageFacilitySlots)
|
||||
}
|
||||
|
||||
@@ -115,7 +110,7 @@ export function mapSlotsToSelectOptions(
|
||||
slots: Record<string, unknown>[]
|
||||
): StorageSlotSelectOption[] {
|
||||
const nodePath = buildTreePathLabelFromFlat(facilityNodeId, facilities, {
|
||||
nameKey: 'nodeName',
|
||||
nameKey: 'nodeName'
|
||||
})
|
||||
return sortStorageFacilitySlots(slots).map((slot) => {
|
||||
const id = String(slot.id ?? '').trim()
|
||||
|
||||
@@ -114,9 +114,7 @@ class VersionManager {
|
||||
const itemVersion = this.normalizeVersion(latestLog.version)
|
||||
|
||||
return (
|
||||
latestLog.requireReLogin &&
|
||||
itemVersion > normalizedStored &&
|
||||
itemVersion <= normalizedCurrent
|
||||
latestLog.requireReLogin && itemVersion > normalizedStored && itemVersion <= normalizedCurrent
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -16,11 +16,9 @@ export function buildTreePathLabelFromFlat(
|
||||
const separator =
|
||||
typeof separatorOrOpts === 'string'
|
||||
? separatorOrOpts
|
||||
: separatorOrOpts?.separator ?? DEFAULT_TREE_PATH_SEPARATOR
|
||||
: (separatorOrOpts?.separator ?? DEFAULT_TREE_PATH_SEPARATOR)
|
||||
const nameKey =
|
||||
typeof separatorOrOpts === 'string'
|
||||
? 'name'
|
||||
: separatorOrOpts?.nameKey ?? 'name'
|
||||
typeof separatorOrOpts === 'string' ? 'name' : (separatorOrOpts?.nameKey ?? 'name')
|
||||
const cid = String(nodeId ?? '').trim()
|
||||
if (!cid) return ''
|
||||
const byId = new Map<string, TreePathFlatNode>()
|
||||
@@ -81,11 +79,10 @@ export function resolveTreePathDisplay(
|
||||
emptyPlaceholder = '—',
|
||||
nameKey?: string
|
||||
): string {
|
||||
const path = buildTreePathLabelFromFlat(
|
||||
String(nodeId ?? '').trim() || undefined,
|
||||
flatList,
|
||||
{ separator, nameKey }
|
||||
)
|
||||
const path = buildTreePathLabelFromFlat(String(nodeId ?? '').trim() || undefined, flatList, {
|
||||
separator,
|
||||
nameKey
|
||||
})
|
||||
if (path) return path
|
||||
const fb = String(fallbackName ?? '').trim()
|
||||
if (fb) return fb
|
||||
|
||||
@@ -7,7 +7,10 @@ export function defaultAvatarPathByRole(_role: string | undefined): string {
|
||||
}
|
||||
|
||||
/** 展示用头像:`avatarUrl` 非空则用其值,否则用默认图 */
|
||||
export function resolveUserAvatarUrl(avatarUrl: string | null | undefined, role: string | undefined): string {
|
||||
export function resolveUserAvatarUrl(
|
||||
avatarUrl: string | null | undefined,
|
||||
role: string | undefined
|
||||
): string {
|
||||
const u = avatarUrl != null ? String(avatarUrl).trim() : ''
|
||||
if (u) return u
|
||||
return defaultAvatarPathByRole(role)
|
||||
|
||||
Reference in new issue
Block a user