| | |
| | | * 业务申请主表列:固定列 + formConfig 动态列 + 审批状态 + 操作 |
| | | */ |
| | | export function buildInstanceTableColumns(tableDataRef, buildTableActions, options = {}) { |
| | | const { moduleKey, excludeKeys = DEFAULT_EXCLUDE_KEYS, beforeFormColumns = [], extraColumns = [], afterFormColumns = [], actionWidth = 260 } = options; |
| | | const { moduleKey, excludeKeys = DEFAULT_EXCLUDE_KEYS, beforeFormColumns = [], extraColumns = [], afterFormColumns = [], actionWidth = 260, showCreateTime = true } = options; |
| | | |
| | | const leadingCols = moduleKey && INSTANCE_NO_SEARCH_MODULE_KEYS.has(moduleKey) ? [INSTANCE_NO_TABLE_COLUMN] : []; |
| | | |
| | | return computed(() => { |
| | | const formCols = getFormConfigFieldColumns(tableDataRef.value?.[0], { excludeKeys }); |
| | | return [ |
| | | const cols = [ |
| | | ...leadingCols, |
| | | ...beforeFormColumns, |
| | | ...formCols, |
| | | ...extraColumns, |
| | | ...afterFormColumns, |
| | | { label: "创建时间", prop: "createTime", width: 170 }, |
| | | ]; |
| | | if (showCreateTime !== false) { |
| | | cols.push({ label: "创建时间", prop: "createTime", width: 170 }); |
| | | } |
| | | cols.push( |
| | | { |
| | | label: "审批状态", |
| | | prop: "approvalStatus", |
| | |
| | | width: actionWidth, |
| | | operation: buildTableActions(), |
| | | }, |
| | | ]; |
| | | ); |
| | | return cols; |
| | | }); |
| | | } |