feat: 归档L03与L09审批发布能力
- 新增统一审批中心与审批管理页面,支持流程配置、审批详情与角色/用户审批对象 - 接入聊天助手、知识库、工作流的发布与删除审批,并补齐发布态校验与快照展示
This commit is contained in:
@@ -23,7 +23,7 @@ export type ActionTone = 'danger' | 'default';
|
||||
|
||||
export interface ActionButton {
|
||||
icon?: any;
|
||||
text: string;
|
||||
text: ((row: any) => string) | string;
|
||||
className?: string;
|
||||
permission?: string;
|
||||
placement?: ActionPlacement;
|
||||
@@ -135,6 +135,10 @@ function handleActionClick(event: Event, action: ActionButton, item: any) {
|
||||
event.stopPropagation();
|
||||
action.onClick(item);
|
||||
}
|
||||
|
||||
function resolveActionText(action: ActionButton, item: any) {
|
||||
return typeof action.text === 'function' ? action.text(item) : action.text;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -215,8 +219,8 @@ function handleActionClick(event: Event, action: ActionButton, item: any) {
|
||||
@click.stop
|
||||
>
|
||||
<ElButton
|
||||
v-for="action in inlineActions"
|
||||
:key="action.text"
|
||||
v-for="(action, actionIndex) in inlineActions"
|
||||
:key="`${item.id ?? index}-inline-${actionIndex}`"
|
||||
:icon="typeof action.icon === 'string' ? undefined : action.icon"
|
||||
size="small"
|
||||
class="card-action-btn"
|
||||
@@ -227,7 +231,7 @@ function handleActionClick(event: Event, action: ActionButton, item: any) {
|
||||
<template v-if="typeof action.icon === 'string'" #icon>
|
||||
<IconifyIcon :icon="action.icon" />
|
||||
</template>
|
||||
{{ action.text }}
|
||||
{{ resolveActionText(action, item) }}
|
||||
</ElButton>
|
||||
|
||||
<ElDropdown
|
||||
@@ -244,8 +248,8 @@ function handleActionClick(event: Event, action: ActionButton, item: any) {
|
||||
<template #dropdown>
|
||||
<ElDropdownMenu>
|
||||
<ElDropdownItem
|
||||
v-for="action in menuActions"
|
||||
:key="action.text"
|
||||
v-for="(action, actionIndex) in menuActions"
|
||||
:key="`${item.id ?? index}-menu-${actionIndex}`"
|
||||
:class="{
|
||||
'card-menu-item--danger': action.tone === 'danger',
|
||||
}"
|
||||
@@ -259,7 +263,7 @@ function handleActionClick(event: Event, action: ActionButton, item: any) {
|
||||
/>
|
||||
<component v-else :is="action.icon" />
|
||||
</ElIcon>
|
||||
<span>{{ action.text }}</span>
|
||||
<span>{{ resolveActionText(action, item) }}</span>
|
||||
</div>
|
||||
</ElDropdownItem>
|
||||
</ElDropdownMenu>
|
||||
|
||||
Reference in New Issue
Block a user