提交
This commit is contained in:
1 parent
299609706c
commit
e46c0480d4
87 files changed
+11975
-15543
No files matched your search
@@ -14,7 +14,7 @@ type RetryableConfig = InternalAxiosRequestConfig & {
|
||||
}
|
||||
|
||||
/** 地磅集合根路径(后端 @router.get("/") 注册,须带尾斜杠,否则 307 重定向会丢 Authorization) */
|
||||
const DB_COLLECTION_ROOT = /^\/(plans|inventory|weighing|master-data\/vehicles)$/
|
||||
const DB_COLLECTION_ROOT = /^\/(plans|inventory|weighing)$/
|
||||
|
||||
function normalizeDbUrl(url?: string): string | undefined {
|
||||
if (!url || url.endsWith('/')) return url
|
||||
|
||||
@@ -43,7 +43,6 @@ export const SIDEBAR_MENU_ICON_MAP: Record<string, string> = {
|
||||
DbPlans: 'ri:calendar-schedule-line',
|
||||
DbInventory: 'ri:archive-line',
|
||||
DbWeighing: 'ri:scales-line',
|
||||
DbVehicles: 'ri:car-line',
|
||||
|
||||
// ── 工作流 ──
|
||||
Workflow: 'workflow',
|
||||
@@ -101,7 +100,6 @@ export const SIDEBAR_MENU_ICON_BY_CODE: Record<string, string> = {
|
||||
'db:plan:list': 'ri:calendar-schedule-line',
|
||||
'db:inventory:list': 'ri:archive-line',
|
||||
'db:weighing:list': 'ri:scales-line',
|
||||
'db:vehicle:list': 'ri:car-line',
|
||||
'workflow:process': 'workflow',
|
||||
'workflow:pending': 'ri:inbox-line',
|
||||
'workflow:completed': 'ri:checkbox-circle-line',
|
||||
|
||||
@@ -123,3 +123,36 @@ export function buildViewKvTableTripleRows(
|
||||
}
|
||||
return rows
|
||||
}
|
||||
|
||||
export type ViewKvTableQuadRow =
|
||||
| { type: 'long'; field: ViewField }
|
||||
| { type: 'quad'; fields: ViewField[] }
|
||||
|
||||
/** KV 表格模式(四组八列):长字段独占行,短字段最多四个一组 */
|
||||
export function buildViewKvTableQuadRows(
|
||||
fields: ViewField[],
|
||||
formatValue: (val: unknown) => string
|
||||
): ViewKvTableQuadRow[] {
|
||||
const rows: ViewKvTableQuadRow[] = []
|
||||
let i = 0
|
||||
while (i < fields.length) {
|
||||
const field = fields[i]
|
||||
const text = getViewFieldDisplayText(field, formatValue)
|
||||
if (isViewFieldLong(field, text) || isViewFieldFullSpan(field, text)) {
|
||||
rows.push({ type: 'long', field })
|
||||
i += 1
|
||||
continue
|
||||
}
|
||||
const group: ViewField[] = [field]
|
||||
i += 1
|
||||
while (i < fields.length && group.length < 4) {
|
||||
const next = fields[i]
|
||||
const nextText = getViewFieldDisplayText(next, formatValue)
|
||||
if (isViewFieldLong(next, nextText) || isViewFieldFullSpan(next, nextText)) break
|
||||
group.push(next)
|
||||
i += 1
|
||||
}
|
||||
rows.push({ type: 'quad', fields: group })
|
||||
}
|
||||
return rows
|
||||
}
|
||||
Reference in new issue
Block a user