Browse Source

feat(approval-flow): localize approval flow UI and routes

pull/1568/head
colin 4 weeks ago
parent
commit
3bd0864516
  1. 25
      apps/vben5/apps/app-antd/src/locales/index.ts
  2. 11
      apps/vben5/apps/app-antd/src/locales/langs/en-US/page.json
  3. 11
      apps/vben5/apps/app-antd/src/locales/langs/zh-CN/page.json
  4. 30
      apps/vben5/packages/@abp/approval-flow/src/components/antflow/AddNode.vue
  5. 133
      apps/vben5/packages/@abp/approval-flow/src/components/antflow/ApprovalNodeDrawer.vue
  6. 99
      apps/vben5/packages/@abp/approval-flow/src/components/antflow/ApprovalWizard.vue
  7. 57
      apps/vben5/packages/@abp/approval-flow/src/components/antflow/BasicSetting.vue
  8. 26
      apps/vben5/packages/@abp/approval-flow/src/components/antflow/ButtonPerm.vue
  9. 109
      apps/vben5/packages/@abp/approval-flow/src/components/antflow/ConditionNodeDrawer.vue
  10. 22
      apps/vben5/packages/@abp/approval-flow/src/components/antflow/FlowDesign.vue
  11. 87
      apps/vben5/packages/@abp/approval-flow/src/components/antflow/NodeWarp.vue
  12. 76
      apps/vben5/packages/@abp/approval-flow/src/components/antflow/model.ts
  13. 32
      apps/vben5/packages/@abp/approval-flow/src/components/antflow/types.ts
  14. 6
      apps/vben5/packages/@abp/approval-flow/src/components/designer/AddNode.vue
  15. 114
      apps/vben5/packages/@abp/approval-flow/src/components/designer/ApprovalFlowDesigner.vue
  16. 138
      apps/vben5/packages/@abp/approval-flow/src/components/designer/ApprovalFlowWizard.vue
  17. 65
      apps/vben5/packages/@abp/approval-flow/src/components/designer/BranchConditionDrawer.vue
  18. 57
      apps/vben5/packages/@abp/approval-flow/src/components/designer/BranchConditionModal.vue
  19. 44
      apps/vben5/packages/@abp/approval-flow/src/components/designer/BranchFlow.vue
  20. 192
      apps/vben5/packages/@abp/approval-flow/src/components/designer/FormDesigner.vue
  21. 6
      apps/vben5/packages/@abp/approval-flow/src/components/designer/FormPreviewModal.vue
  22. 181
      apps/vben5/packages/@abp/approval-flow/src/components/designer/NodeConfigDrawer.vue
  23. 26
      apps/vben5/packages/@abp/approval-flow/src/components/designer/formula.ts
  24. 100
      apps/vben5/packages/@abp/approval-flow/src/components/designer/model.ts
  25. 246
      apps/vben5/packages/@abp/approval-flow/src/components/form-definitions/FormDefinitionTable.vue
  26. 5
      apps/vben5/packages/@abp/approval-flow/src/components/instances/ApprovalFlowViewer.vue
  27. 163
      apps/vben5/packages/@abp/approval-flow/src/components/instances/ApprovalInstanceDetailModal.vue
  28. 38
      apps/vben5/packages/@abp/approval-flow/src/components/instances/CarbonCopyApprovalTable.vue
  29. 44
      apps/vben5/packages/@abp/approval-flow/src/components/instances/DoneApprovalTable.vue
  30. 72
      apps/vben5/packages/@abp/approval-flow/src/components/instances/InitiatedApprovalTable.vue
  31. 30
      apps/vben5/packages/@abp/approval-flow/src/components/instances/PendingApprovalTable.vue
  32. 22
      apps/vben5/packages/@abp/approval-flow/src/components/instances/StatusFlow.vue
  33. 20
      apps/vben5/packages/@abp/approval-flow/src/components/instances/approval-table-utils.ts
  34. 62
      apps/vben5/packages/@abp/approval-flow/src/components/templates/ApprovalTemplateTable.vue
  35. 118
      apps/vben5/packages/@abp/approval-flow/src/components/templates/ApprovalTemplateViewModal.vue
  36. 41
      apps/vben5/packages/@abp/approval-flow/src/components/templates/StartApprovalModal.vue
  37. 1
      apps/vben5/packages/@abp/approval-flow/src/index.ts
  38. 20
      apps/vben5/packages/@abp/approval-flow/src/locales/index.ts
  39. 488
      apps/vben5/packages/@abp/approval-flow/src/locales/langs/en-US/antflow.json
  40. 488
      apps/vben5/packages/@abp/approval-flow/src/locales/langs/zh-CN/antflow.json
  41. 207
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.ApprovalFlow.Domain.Shared/LINGYUN/Abp/ElsaNext/ApprovalFlow/Localization/Domain/en.json
  42. 207
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.ApprovalFlow.Domain.Shared/LINGYUN/Abp/ElsaNext/ApprovalFlow/Localization/Domain/zh-Hans.json
  43. 18
      aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin5/LINGYUN/Abp/UI/Navigation/VueVbenAdmin5/AbpUINavigationVueVbenAdmin5NavigationDefinitionProvider.cs

25
apps/vben5/apps/app-antd/src/locales/index.ts

@ -13,6 +13,7 @@ import {
} from '@vben/locales';
import { preferences } from '@vben/preferences';
import { loadApprovalFlowMessages } from '@abp/approval-flow';
import { loadComponentMessages } from '@abp/components/locales';
import { useAbpStore } from '@abp/core';
import { useLocalizationsApi } from '@abp/localization';
@ -36,16 +37,24 @@ const localesMap = loadLocalesMapFromDir(
* @param lang
*/
async function loadMessages(lang: SupportedLanguagesType) {
const [appLocaleMessages, compLocales, platformLocales, _, abpLocales] =
await Promise.all([
localesMap[lang]?.(),
loadComponentMessages(lang),
loadPaltformMessages(lang),
loadThirdPartyMessage(lang),
loadAbpLocale(lang),
]);
const [
appLocaleMessages,
approvalFlowLocales,
compLocales,
platformLocales,
_,
abpLocales,
] = await Promise.all([
localesMap[lang]?.(),
loadApprovalFlowMessages(lang),
loadComponentMessages(lang),
loadPaltformMessages(lang),
loadThirdPartyMessage(lang),
loadAbpLocale(lang),
]);
return {
...appLocaleMessages?.default,
...approvalFlowLocales?.default,
...compLocales?.default,
...platformLocales?.default,
...abpLocales,

11
apps/vben5/apps/app-antd/src/locales/langs/en-US/page.json

@ -13,5 +13,16 @@
"title": "Dashboard",
"analytics": "Analytics",
"workspace": "Workspace"
},
"approvalFlow": {
"title": "Approval flow",
"templates": "Approval templates",
"myApprovals": "My approvals",
"pending": "Pending",
"initiated": "Initiated by me",
"done": "Handled",
"carbonCopy": "CC to me",
"formDefinitions": "Form design",
"designer": "Flow designer"
}
}

11
apps/vben5/apps/app-antd/src/locales/langs/zh-CN/page.json

@ -13,5 +13,16 @@
"title": "概览",
"analytics": "分析页",
"workspace": "工作台"
},
"approvalFlow": {
"title": "审批流程",
"templates": "审批模板",
"myApprovals": "我的审批",
"pending": "待办",
"initiated": "我发起的",
"done": "已办",
"carbonCopy": "抄送我的",
"formDefinitions": "表单设计",
"designer": "流程设计器"
}
}

30
apps/vben5/packages/@abp/approval-flow/src/components/antflow/AddNode.vue

@ -3,6 +3,8 @@ import type { AntFlowAddKind } from './types';
import { ref } from 'vue';
import { $t } from '@vben/locales';
interface AddAction {
color?: string;
icon?: string;
@ -17,9 +19,24 @@ const props = withDefaults(
}>(),
{
actions: () => [
{ key: 'approval', label: '审批人', icon: '审', color: '#f2994a' },
{ key: 'cc', label: '抄送人', icon: '抄', color: '#2f80ed' },
{ key: 'condition', label: '条件网关', icon: '条', color: '#27ae60' },
{
key: 'approval',
label: $t('antflow.addNode.approval'),
icon: '✓',
color: '#f2994a',
},
{
key: 'cc',
label: $t('antflow.addNode.cc'),
icon: 'CC',
color: '#2f80ed',
},
{
key: 'condition',
label: $t('antflow.addNode.condition'),
icon: '◇',
color: '#27ae60',
},
],
readonly: false,
},
@ -48,7 +65,12 @@ function handleAdd(kind: AntFlowAddKind) {
@mouseenter="menuOpen = true"
@mouseleave="menuOpen = false"
>
<div class="add-btn" role="button" tabindex="0" title="添加节点">
<div
class="add-btn"
role="button"
tabindex="0"
:title="$t('antflow.addNode.add')"
>
<span class="add-plus">+</span>
</div>
<div class="add-menu" :class="{ 'is-open': menuOpen }" @click.stop>

133
apps/vben5/packages/@abp/approval-flow/src/components/antflow/ApprovalNodeDrawer.vue

@ -4,6 +4,8 @@ import type { AntFlowNode } from './types';
import { computed, reactive, ref, watch } from 'vue';
import { $t } from '@vben/locales';
import {
Alert,
Button,
@ -75,19 +77,25 @@ const pickerOpen = ref(false);
const pickerSelected = ref<string[]>([]);
const signTypeOptions = [
{ label: '或签(只需一名审批人同意或拒绝即可)', value: 1 },
{ label: '会签(需所有审批人同意,不限顺序)', value: 2 },
{ label: '顺序会签(需要所有审批人同意,根据前端传入的顺序)', value: 3 },
{ label: $t('antflow.approvalNode.orSign'), value: 1 },
{ label: $t('antflow.approvalNode.countersign'), value: 2 },
{ label: $t('antflow.approvalNode.sequentialCountersign'), value: 3 },
];
const noHeaderActionOptions = [
{ label: '不允许发起', value: 0 },
{ label: '跳过', value: 1 },
{ label: '转交给审核管理员', value: 2 },
{ label: $t('antflow.approvalNode.noHeaderActionNone'), value: 0 },
{ label: $t('antflow.approvalNode.noHeaderActionSkip'), value: 1 },
{ label: $t('antflow.approvalNode.noHeaderActionAdmin'), value: 2 },
];
const directorLevelOptions = Array.from({ length: 5 }, (_, index) => ({
label: index === 0 ? '直接主管' : `第${index + 1}级主管`,
label:
index === 0
? $t('antflow.approvalNode.directSupervisor')
: $t('antflow.approvalNode.levelSupervisor').replace(
'{0}',
String(index + 1),
),
value: index + 1,
}));
@ -111,29 +119,29 @@ const isApprove = computed(
const isCopy = computed(() => draft.nodeType === NodeType.CopyNode);
const drawerTitle = computed(() => {
if (isCopy.value) {
return '抄送人';
return $t('antflow.approvalNode.ccPerson');
}
if (draft.nodeType === NodeType.ParallelApproveNode) {
return '并行审批人';
return $t('antflow.approvalNode.parallelApprover');
}
return '审批人';
return $t('antflow.approvalNode.approver');
});
const assigneeTypeOptions = computed(() => {
if (isCopy.value) {
return [
{ label: '指定成员', value: 1 },
{ label: '指定角色', value: 2 },
{ label: $t('antflow.approvalNode.assigneeMember'), value: 1 },
{ label: $t('antflow.approvalNode.assigneeRole'), value: 2 },
];
}
return [
{ label: '指定成员', value: 1 },
{ label: '指定角色', value: 2 },
{ label: '直属领导', value: 3 },
{ label: '发起人自己', value: 5 },
{ label: '指定层级', value: 6 },
{ label: '层层审批', value: 7 },
{ label: '发起人自选审批人', value: 8 },
{ label: $t('antflow.approvalNode.assigneeMember'), value: 1 },
{ label: $t('antflow.approvalNode.assigneeRole'), value: 2 },
{ label: $t('antflow.approvalNode.assigneeLeader'), value: 3 },
{ label: $t('antflow.approvalNode.assigneeInitiator'), value: 5 },
{ label: $t('antflow.approvalNode.assigneeLevel'), value: 6 },
{ label: $t('antflow.approvalNode.assigneeChain'), value: 7 },
{ label: $t('antflow.approvalNode.assigneeSelfSelect'), value: 8 },
];
});
@ -158,15 +166,25 @@ const pickerOptions = computed(() => {
});
const personLabel = computed(() =>
draft.assigneeType === 2 ? '添加/修改角色' : '添加/修改人员',
draft.assigneeType === 2
? $t('antflow.approvalNode.addRole')
: $t('antflow.approvalNode.addPerson'),
);
const tabs = computed(() => {
const items = [
{ key: 'approver', label: isCopy.value ? '抄送人设置' : '审批人设置' },
{
key: 'approver',
label: isCopy.value
? $t('antflow.approvalNode.ccSetting')
: $t('antflow.approvalNode.approverSetting'),
},
];
if (isApprove.value) {
items.push({ key: 'button', label: '按钮权限设置' });
items.push({
key: 'button',
label: $t('antflow.approvalNode.buttonPermission'),
});
}
return items;
});
@ -273,15 +291,22 @@ function generateDisplayName(): string {
if ([1, 2].includes(draft.assigneeType) && names.length > 0) {
if (draft.signType === 2) {
return `${names.length}人(${names.join(',')})会签`;
return $t('antflow.approvalNode.signSummary')
.replace('{0}', String(names.length))
.replace('{1}', names.join(','));
}
if (draft.signType === 3) {
return `${names.length}人(${names.join(',')})顺序会签`;
return $t('antflow.approvalNode.sequentialSignSummary')
.replace('{0}', String(names.length))
.replace('{1}', names.join(','));
}
return names.join(',');
}
if (draft.assigneeType === 6) {
return `第 ${draft.directorLevel} 级主管`;
return $t('antflow.approvalNode.levelSummary').replace(
'{0}',
String(draft.directorLevel),
);
}
return (
assigneeTypeOptions.value.find((item) => item.value === draft.assigneeType)
@ -291,12 +316,14 @@ function generateDisplayName(): string {
function validate(): boolean {
if (!draft.nodeName.trim()) {
message.warning('请输入节点名称');
message.warning($t('antflow.approvalNode.nodeNameRequired'));
return false;
}
if ([1, 2].includes(draft.assigneeType) && draft.assigneeList.length === 0) {
message.warning(
draft.assigneeType === 2 ? '请选择角色' : '请选择审批人/抄送人',
draft.assigneeType === 2
? $t('antflow.approvalNode.selectRole')
: $t('antflow.approvalNode.selectApprover'),
);
return false;
}
@ -365,12 +392,14 @@ function confirm() {
<section v-if="activeTab === 'approver'" class="approver-panel">
<div class="form-item">
<label class="form-label">节点名称</label>
<label class="form-label">{{
$t('antflow.approvalNode.nodeName')
}}</label>
<Input
v-model:value="draft.nodeName"
:disabled="readonly"
:maxlength="50"
placeholder="请输入节点名称"
:placeholder="$t('antflow.approvalNode.nodeNamePlaceholder')"
/>
</div>
@ -411,46 +440,46 @@ function confirm() {
<Alert
v-else-if="draft.assigneeType === 3"
description="系统将自动选择流程发起人的直属领导作为审批人"
:description="$t('antflow.approvalNode.directLeaderDesc')"
show-icon
title="直属领导"
:title="$t('antflow.approvalNode.directLeaderTitle')"
type="warning"
/>
<Alert
v-else-if="draft.assigneeType === 5"
description="系统将自动选择流程发起人自己作为审批人"
:description="$t('antflow.approvalNode.initiatorDesc')"
show-icon
title="发起人自己"
:title="$t('antflow.approvalNode.initiatorTitle')"
type="warning"
/>
<div v-else-if="draft.assigneeType === 6" class="director-line">
<span>发起人的:</span>
<span>{{ $t('antflow.approvalNode.initiatorPrefix') }}</span>
<Select
v-model:value="draft.directorLevel"
:disabled="readonly"
:options="directorLevelOptions"
style="width: 220px"
/>
<p class="director-tip">找不到主管时,由直属领导代审批</p>
<p class="director-tip">{{ $t('antflow.approvalNode.directorTip') }}</p>
</div>
<Alert
v-else-if="draft.assigneeType === 7"
description="按照组织架构的上下级关系,从低到高、一级一级往上审批,每一级的直属领导都要依次审批"
:description="$t('antflow.approvalNode.chainDesc')"
show-icon
title="层层审批"
:title="$t('antflow.approvalNode.chainTitle')"
type="warning"
/>
<Alert
v-else-if="draft.assigneeType === 8"
description="用户可以在流程发起时选择该节点的审批人"
:description="$t('antflow.approvalNode.selfSelectDesc')"
show-icon
title="发起人自选审批人"
:title="$t('antflow.approvalNode.selfSelectTitle')"
type="warning"
/>
<template v-if="isApprove">
<div class="section-block">
<h3>✍多人审批时采用的审批方式</h3>
<h3>✍{{ $t('antflow.approvalNode.multiApprovalMode') }}</h3>
<RadioGroup
v-model:value="draft.signType"
class="radio-stack"
@ -467,7 +496,7 @@ function confirm() {
</div>
<div class="section-block">
<h3>✍审批人为空时</h3>
<h3>✍{{ $t('antflow.approvalNode.emptyApprover') }}</h3>
<RadioGroup
v-model:value="draft.noHeaderAction"
class="radio-stack"
@ -496,8 +525,16 @@ function confirm() {
<template #footer>
<div class="drawer-footer">
<Space>
<Button @click="close">{{ readonly ? '关闭' : '取消' }}</Button>
<Button v-if="!readonly" type="primary" @click="confirm">确定</Button>
<Button @click="close">
{{
readonly
? $t('antflow.approvalNode.close')
: $t('antflow.approvalNode.cancel')
}}
</Button>
<Button v-if="!readonly" type="primary" @click="confirm">
{{ $t('antflow.approvalNode.confirm') }}
</Button>
</Space>
</div>
</template>
@ -505,7 +542,11 @@ function confirm() {
<Modal
v-model:open="pickerOpen"
:title="draft.assigneeType === 2 ? '选择角色' : '选择人员'"
:title="
draft.assigneeType === 2
? $t('antflow.approvalNode.selectRoleTitle')
: $t('antflow.approvalNode.selectPersonTitle')
"
@ok="confirmPicker"
>
<CheckboxGroup v-model:value="pickerSelected" class="picker-list">
@ -517,7 +558,9 @@ function confirm() {
{{ item.label }}
</Checkbox>
</CheckboxGroup>
<div v-if="pickerOptions.length === 0" class="muted">暂无可选数据</div>
<div v-if="pickerOptions.length === 0" class="muted">
{{ $t('antflow.common.noData') }}
</div>
</Modal>
</template>

99
apps/vben5/packages/@abp/approval-flow/src/components/antflow/ApprovalWizard.vue

@ -12,6 +12,8 @@ import {
watch,
} from 'vue';
import { $t } from '@vben/locales';
import {
Button,
Card,
@ -78,9 +80,9 @@ const templatesApi = useApprovalTemplatesApi();
const formsApi = useApprovalFormsApi();
const steps = [
{ title: '基础设置' },
{ title: '表单设计' },
{ title: '流程设计' },
{ title: $t('antflow.wizard.basicSettings') },
{ title: $t('antflow.wizard.formDesign') },
{ title: $t('antflow.wizard.flowDesign') },
];
const currentStep = ref(0);
@ -109,11 +111,13 @@ const basic = reactive<BasicDraft>({
});
const formOptions = computed(() => [
{ label: '新建表单', value: '' },
{ label: $t('antflow.wizard.newForm'), value: '' },
...forms.value,
]);
const pageTitle = computed(() => basic.displayName || '新建审批流程');
const pageTitle = computed(
() => basic.displayName || $t('antflow.wizard.newFlow'),
);
const boundFormLabel = computed(
() => forms.value.find((item) => item.value === formId.value)?.label ?? '',
@ -182,7 +186,7 @@ async function loadTemplate() {
await nextTick();
formDesignerRef.value?.loadForm?.(formId.value, true);
} catch {
message.error('审批模板加载失败');
message.error($t('antflow.wizard.loadFailed'));
} finally {
loading.value = false;
}
@ -225,7 +229,7 @@ function goStep(target: number) {
async function saveBasic(): Promise<boolean> {
if (!basic.displayName.trim()) {
message.warning('请填写审批名称');
message.warning($t('antflow.wizard.nameRequired'));
return false;
}
@ -240,7 +244,7 @@ async function saveBasic(): Promise<boolean> {
});
} else {
if (!basic.name.trim()) {
message.warning('请填写流程编号');
message.warning($t('antflow.wizard.codeRequired'));
return false;
}
@ -264,7 +268,7 @@ async function saveBasic(): Promise<boolean> {
}
return true;
} catch {
message.error('基础信息保存失败');
message.error($t('antflow.wizard.basicSaveFailed'));
return false;
}
}
@ -323,7 +327,7 @@ async function saveDesign(): Promise<boolean> {
const root = getFlowRoot();
if (!root) {
currentStep.value = 2;
message.warning('请先完成流程设计');
message.warning($t('antflow.wizard.designRequired'));
return false;
}
@ -334,7 +338,7 @@ async function saveDesign(): Promise<boolean> {
});
return true;
} catch {
message.error('流程设计保存失败');
message.error($t('antflow.wizard.designSaveFailed'));
return false;
}
}
@ -355,7 +359,7 @@ async function save() {
if (!(await saveDesign())) {
return;
}
message.success('审批流程已保存');
message.success($t('antflow.wizard.saved'));
} finally {
saving.value = false;
}
@ -378,7 +382,12 @@ async function publish() {
const errors = flowDesignRef.value?.validatePublish?.() ?? [];
if (errors.length > 0) {
currentStep.value = 2;
message.warning(`流程设计还有 ${errors.length} 个节点未完善`);
message.warning(
$t('antflow.wizard.incompleteNodes').replace(
'{0}',
String(errors.length),
),
);
return;
}
@ -395,10 +404,10 @@ async function publish() {
formDefinitionId: useForm.value ? formId.value : null,
});
published.value = true;
message.success('审批模板已发布');
message.success($t('antflow.wizard.published'));
emit('done', templateId);
} catch {
message.error('发布失败');
message.error($t('antflow.wizard.publishFailed'));
} finally {
publishing.value = false;
}
@ -424,14 +433,18 @@ function cancel() {
<header class="top-nav">
<div class="nav-left">
<span class="process-title" :title="pageTitle">{{ pageTitle }}</span>
<Tag v-if="published" color="green">已发布</Tag>
<Tag v-if="readonly" color="blue">只读</Tag>
<Tag v-if="published" color="green">
{{ $t('antflow.wizard.publishedTag') }}
</Tag>
<Tag v-if="readonly" color="blue">
{{ $t('antflow.wizard.readonlyTag') }}
</Tag>
</div>
<div
class="nav-steps"
:class="`step-${currentStep}`"
aria-label="审批流程步骤"
:aria-label="$t('antflow.wizard.stepsAria')"
role="list"
>
<div aria-hidden="true" class="step-active-bg"></div>
@ -453,11 +466,15 @@ function cancel() {
<div class="nav-right">
<Button class="ghost-btn" @click="cancel">
{{ readonly ? '关闭' : '取消' }}
{{
readonly
? $t('antflow.wizard.close')
: $t('antflow.wizard.cancel')
}}
</Button>
<template v-if="!readonly">
<Button class="ghost-btn" :loading="saving" @click="save">
保存
{{ $t('antflow.wizard.save') }}
</Button>
<Button
class="publish-btn"
@ -465,7 +482,7 @@ function cancel() {
type="primary"
@click="publish"
>
发布
{{ $t('antflow.wizard.publish') }}
</Button>
</template>
</div>
@ -486,11 +503,15 @@ function cancel() {
<Card class="form-step" :bordered="false">
<div class="form-toolbar">
<Space>
<span class="toolbar-label">启用表单</span>
<span class="toolbar-label">{{
$t('antflow.wizard.enableForm')
}}</span>
<Switch v-model:checked="useForm" :disabled="readonly" />
</Space>
<Space>
<span class="toolbar-label">选择已有表单</span>
<span class="toolbar-label">{{
$t('antflow.wizard.selectExistingForm')
}}</span>
<Select
class="form-select"
:disabled="readonly || !useForm"
@ -499,8 +520,12 @@ function cancel() {
@change="onFormChange"
/>
</Space>
<Tag v-if="formId" color="green">已绑定表单</Tag>
<Tag v-else-if="useForm" color="orange">未保存</Tag>
<Tag v-if="formId" color="green">
{{ $t('antflow.wizard.boundForm') }}
</Tag>
<Tag v-else-if="useForm" color="orange">
{{ $t('antflow.wizard.unsaved') }}
</Tag>
</div>
<template v-if="useForm">
@ -512,16 +537,24 @@ function cancel() {
v-model:form-id="formId"
v-model:name="formName"
/>
<Card v-else size="small" title="表单信息">
<Card
v-else
size="small"
:title="$t('antflow.wizard.formInfo')"
>
<Descriptions bordered :column="1" size="small">
<DescriptionsItem label="表单名称">
{{ formName || boundFormLabel || '未命名表单' }}
<DescriptionsItem :label="$t('antflow.wizard.formName')">
{{
formName ||
boundFormLabel ||
$t('antflow.wizard.unnamedForm')
}}
</DescriptionsItem>
<DescriptionsItem label="表单编码">
<DescriptionsItem :label="$t('antflow.wizard.formCode')">
{{ formCode || '-' }}
</DescriptionsItem>
<DescriptionsItem label="表单 ID">
{{ formId || '未绑定' }}
<DescriptionsItem :label="$t('antflow.wizard.formId')">
{{ formId || $t('antflow.wizard.unbound') }}
</DescriptionsItem>
</Descriptions>
</Card>
@ -529,8 +562,8 @@ function cancel() {
<Result
v-else
status="info"
sub-title="本审批不需要填写表单,将直接进入流程。"
title="未启用表单"
:sub-title="$t('antflow.wizard.noFormDesc')"
:title="$t('antflow.wizard.noFormTitle')"
/>
</Card>
</div>

57
apps/vben5/packages/@abp/approval-flow/src/components/antflow/BasicSetting.vue

@ -4,6 +4,8 @@ import type { RuleObject } from 'ant-design-vue/es/form';
import { computed, reactive, ref, watch } from 'vue';
import { $t } from '@vben/locales';
import { AutoComplete, Form, FormItem, Input } from 'ant-design-vue';
/**
@ -57,8 +59,20 @@ const formRef = ref<FormInstance | null>(null);
const form = reactive<BasicSettingModel>(createEmpty());
const rules: Record<string, RuleObject[]> = {
displayName: [{ message: '请输入审批名称', required: true, trigger: 'blur' }],
name: [{ message: '请输入流程编号', required: true, trigger: 'blur' }],
displayName: [
{
message: $t('antflow.basic.nameRequired'),
required: true,
trigger: 'blur',
},
],
name: [
{
message: $t('antflow.basic.codeRequired'),
required: true,
trigger: 'blur',
},
],
};
const categoryOptions = computed(() =>
@ -155,44 +169,48 @@ defineExpose({ getModel, reset, validate });
:rules="rules"
:wrapper-col="{ span: 19 }"
>
<FormItem label="流程编号" name="name">
<FormItem :label="$t('antflow.basic.codeLabel')" name="name">
<Input
v-model:value="form.name"
:disabled="codeDisabled"
:maxlength="50"
placeholder="例如:leave-approval"
:placeholder="$t('antflow.basic.codePlaceholder')"
>
<template #suffix>
<span class="field-suffix">{{
codeDisabled ? '已固定' : '唯一标识'
codeDisabled
? $t('antflow.basic.fixed')
: $t('antflow.basic.unique')
}}</span>
</template>
</Input>
</FormItem>
<FormItem label="审批名称" name="displayName">
<FormItem :label="$t('antflow.basic.nameLabel')" name="displayName">
<Input
v-model:value="form.displayName"
:disabled="isReadonly"
:maxlength="20"
placeholder="例如:请假审批"
:placeholder="$t('antflow.basic.namePlaceholder')"
/>
</FormItem>
<FormItem label="分组" name="category">
<FormItem :label="$t('antflow.basic.categoryLabel')" name="category">
<AutoComplete
v-model:value="form.category"
:disabled="isReadonly"
:options="categoryOptions"
placeholder="例如:人事 / 财务"
:placeholder="$t('antflow.basic.categoryPlaceholder')"
>
<template #notFoundContent>
<span class="empty-tip">直接输入分组名称</span>
<span class="empty-tip">{{
$t('antflow.basic.categoryTip')
}}</span>
</template>
</AutoComplete>
</FormItem>
<FormItem label="模板图标" name="icon">
<FormItem :label="$t('antflow.basic.iconLabel')" name="icon">
<div class="icon-row">
<span class="icon-preview">{{ iconPreview }}</span>
<Input
@ -200,27 +218,34 @@ defineExpose({ getModel, reset, validate });
class="icon-input"
:disabled="isReadonly"
:maxlength="64"
placeholder="图标名称或表情,例如:📄 / file-text"
:placeholder="$t('antflow.basic.iconPlaceholder')"
/>
</div>
</FormItem>
<FormItem label="业务键提示" name="businessKeyHint">
<FormItem
:label="$t('antflow.basic.businessKeyLabel')"
name="businessKeyHint"
>
<Input
v-model:value="form.businessKeyHint"
:disabled="isReadonly"
:maxlength="100"
placeholder="发起审批时业务键的填写提示"
:placeholder="$t('antflow.basic.businessKeyPlaceholder')"
/>
</FormItem>
<FormItem class="is-textarea" label="审批说明" name="description">
<FormItem
class="is-textarea"
:label="$t('antflow.basic.descriptionLabel')"
name="description"
>
<Input.TextArea
v-model:value="form.description"
:disabled="isReadonly"
:maxlength="200"
:rows="4"
placeholder="请输入审批说明"
:placeholder="$t('antflow.basic.descriptionPlaceholder')"
show-count
/>
</FormItem>

26
apps/vben5/packages/@abp/approval-flow/src/components/antflow/ButtonPerm.vue

@ -1,6 +1,8 @@
<script setup lang="ts">
import { computed, ref, watch } from 'vue';
import { $t } from '@vben/locales';
import { Checkbox, CheckboxGroup } from 'ant-design-vue';
interface ButtonOption {
@ -27,30 +29,30 @@ const emit = defineEmits<{
const options: ButtonOption[] = [
{
description: '审批通过,流转到下一个节点',
label: '同意',
description: $t('antflow.buttonPerm.approveDesc'),
label: $t('antflow.buttonPerm.approveLabel'),
locked: true,
value: 3,
},
{
description: '当不同意任务时,当前任务被终止,并结束整个流程',
label: '不同意',
description: $t('antflow.buttonPerm.rejectDesc'),
label: $t('antflow.buttonPerm.rejectLabel'),
locked: true,
value: 4,
},
{
description: '退回到发起人或任意节点,流程重新开始或者回到当前审批人',
label: '退回',
description: $t('antflow.buttonPerm.returnDesc'),
label: $t('antflow.buttonPerm.returnLabel'),
value: 18,
},
{
description: '转办选择审批人,转办后自己将不再进行审批',
label: '转办',
description: $t('antflow.buttonPerm.transferDesc'),
label: $t('antflow.buttonPerm.transferLabel'),
value: 21,
},
{
description: '在当前任务上额外添加新人员,处理相关事项或提供审批意见',
label: '加批',
description: $t('antflow.buttonPerm.addApprovalDesc'),
label: $t('antflow.buttonPerm.addApprovalLabel'),
value: 19,
},
];
@ -84,8 +86,8 @@ function update(value: Array<boolean | number | string>) {
<template>
<section class="button-perm">
<header class="panel-head">
<h3>【审批页面】按钮权限显示控制</h3>
<p>可控制审批节点中按钮的显示权限,默认按钮不可取消。</p>
<h3>{{ $t('antflow.buttonPerm.title') }}</h3>
<p>{{ $t('antflow.buttonPerm.description') }}</p>
</header>
<CheckboxGroup

109
apps/vben5/packages/@abp/approval-flow/src/components/antflow/ConditionNodeDrawer.vue

@ -3,6 +3,8 @@ import type { AntFlowNode } from './types';
import { computed, reactive, toRaw, watch } from 'vue';
import { $t } from '@vben/locales';
import {
Alert,
Button,
@ -101,12 +103,12 @@ const emit = defineEmits<{
const visible = computed(() => props.open || props.modelValue);
const operatorOptions = [
{ label: '等于', value: '=' },
{ label: '不等于', value: '!=' },
{ label: '大于', value: '>' },
{ label: '大于等于', value: '>=' },
{ label: '小于', value: '<' },
{ label: '小于等于', value: '<=' },
{ label: $t('antflow.condition.equal'), value: '=' },
{ label: $t('antflow.condition.notEqual'), value: '!=' },
{ label: $t('antflow.condition.gt'), value: '>' },
{ label: $t('antflow.condition.gte'), value: '>=' },
{ label: $t('antflow.condition.lt'), value: '<' },
{ label: $t('antflow.condition.lte'), value: '<=' },
];
const legacyOperatorMap: Record<string, string> = {
@ -254,7 +256,9 @@ function createGroup(
return {
condRelation: toBoolean(item?.condRelation, true),
groupId: item?.groupId ?? nextUid('group'),
groupName: item?.groupName ?? `条件组 ${index + 1}`,
groupName:
item?.groupName ??
$t('antflow.condition.groupName').replace('{0}', String(index + 1)),
rows: conditionList.map((condition) => createRow(condition)),
uid: nextUid('group-row'),
};
@ -342,7 +346,7 @@ function confirm() {
if (!draft.isDefault) {
if (conditionCount.value === 0) {
message.warning('请至少配置一个条件');
message.warning($t('antflow.condition.validation'));
return;
}
@ -352,7 +356,7 @@ function confirm() {
),
);
if (invalidGroup) {
message.warning('请选择条件字段');
message.warning($t('antflow.condition.fieldRequired'));
return;
}
@ -362,7 +366,7 @@ function confirm() {
),
);
if (missingValue) {
message.warning('请填写条件值');
message.warning($t('antflow.condition.valueRequired'));
return;
}
}
@ -387,7 +391,12 @@ function confirm() {
.filter((row) => row.key.trim().length > 0)
.map((row) => buildConditionItem(row)),
groupId: group.groupId || `group-${index + 1}`,
groupName: group.groupName || `条件组 ${index + 1}`,
groupName:
group.groupName ||
$t('antflow.condition.groupName').replace(
'{0}',
String(index + 1),
),
sort: index,
}))
.filter((group) => group.conditionList.length > 0),
@ -408,26 +417,28 @@ function confirm() {
<Drawer
:open="visible"
placement="right"
title="条件设置"
:title="$t('antflow.condition.title')"
:width="620"
@close="close"
>
<div class="condition-drawer">
<div class="form-item">
<label class="form-label">分支名称</label>
<label class="form-label">{{
$t('antflow.condition.branchName')
}}</label>
<Input
v-model:value="draft.nodeName"
:disabled="locked"
:maxlength="50"
placeholder="请输入条件分支名称"
:placeholder="$t('antflow.condition.branchPlaceholder')"
/>
</div>
<template v-if="draft.isDefault">
<Alert
class="hint-alert"
description="默认条件分支不允许设置条件,它是兜底分支:其它条件都未命中时进入该分支。如需添加条件,请先添加普通条件分支,再删除默认分支。"
message="默认条件分支"
:description="$t('antflow.condition.defaultDesc')"
:message="$t('antflow.condition.defaultLabel')"
show-icon
type="warning"
/>
@ -435,13 +446,17 @@ function confirm() {
<template v-else>
<div class="global-relation">
<span class="relation-tip">当审批单满足以下条件时进入此流程</span>
<span class="relation-label">条件组关系:</span>
<span class="relation-tip">{{
$t('antflow.condition.relationTip')
}}</span>
<span class="relation-label">{{
$t('antflow.condition.groupRelation')
}}</span>
<Switch
v-model:checked="draft.groupRelation"
checked-children="且"
:checked-children="$t('antflow.condition.and')"
:disabled="readonly"
un-checked-children="或"
:un-checked-children="$t('antflow.condition.or')"
/>
</div>
@ -460,13 +475,15 @@ function confirm() {
:maxlength="30"
size="small"
/>
<span class="relation-label">组内关系:</span>
<span class="relation-label">{{
$t('antflow.condition.innerRelation')
}}</span>
<Switch
v-model:checked="group.condRelation"
checked-children="且"
:checked-children="$t('antflow.condition.and')"
:disabled="readonly"
size="small"
un-checked-children="或"
:un-checked-children="$t('antflow.condition.or')"
/>
</div>
</template>
@ -478,14 +495,14 @@ function confirm() {
type="text"
@click="removeGroup(group)"
>
删除条件组
{{ $t('antflow.condition.deleteGroup') }}
</Button>
</template>
<div class="rows">
<Empty
v-if="group.rows.length === 0"
description="该条件组还没有条件"
:description="$t('antflow.condition.emptyGroup')"
/>
<div v-for="row in group.rows" :key="row.uid" class="condition-row">
<Select
@ -495,7 +512,7 @@ function confirm() {
:disabled="readonly"
option-filter-prop="label"
:options="fieldOptions"
placeholder="选择字段"
:placeholder="$t('antflow.condition.selectField')"
show-search
/>
<Input
@ -503,7 +520,7 @@ function confirm() {
v-model:value="row.key"
class="field-key"
:disabled="readonly"
placeholder="字段 key,例如 amount"
:placeholder="$t('antflow.condition.fieldKeyPlaceholder')"
/>
<Select
@ -517,7 +534,7 @@ function confirm() {
v-model:value="row.value"
class="field-value"
:disabled="readonly"
placeholder="请输入比较值"
:placeholder="$t('antflow.condition.valuePlaceholder')"
/>
<Button
@ -527,7 +544,7 @@ function confirm() {
type="text"
@click="removeCondition(group, row)"
>
删除
{{ $t('antflow.condition.delete') }}
</Button>
</div>
</div>
@ -539,14 +556,18 @@ function confirm() {
type="dashed"
@click="addCondition(group)"
>
+ 添加条件
{{ $t('antflow.condition.addCondition') }}
</Button>
<div
v-if="groupIndex < draft.groups.length - 1"
class="between-relation"
>
{{ draft.groupRelation ? '且满足' : '或满足' }}
{{
draft.groupRelation
? $t('antflow.condition.relationSatisfied')
: $t('antflow.condition.relationAny')
}}
</div>
</Card>
@ -556,24 +577,38 @@ function confirm() {
type="dashed"
@click="addGroup"
>
+ 添加条件组
{{ $t('antflow.condition.addGroup') }}
</Button>
<div class="condition-summary">
共 {{ draft.groups.length }} 个条件组 / {{ conditionCount }} 条条件
<Tag v-if="draft.isDefault" color="orange">默认分支</Tag>
{{
$t('antflow.condition.summary')
.replace('{0}', String(draft.groups.length))
.replace('{1}', String(conditionCount))
}}
<Tag v-if="draft.isDefault" color="orange">
{{ $t('antflow.condition.defaultBranch') }}
</Tag>
</div>
</template>
<div v-if="readonly && !draft.isDefault" class="readonly-tip">
当前为只读模式,无法修改条件配置。
{{ $t('antflow.condition.readonly') }}
</div>
</div>
<template #footer>
<div class="drawer-footer">
<Button @click="close">{{ locked ? '关闭' : '取消' }}</Button>
<Button v-if="!locked" type="primary" @click="confirm">确定</Button>
<Button @click="close">
{{
locked
? $t('antflow.condition.close')
: $t('antflow.condition.cancel')
}}
</Button>
<Button v-if="!locked" type="primary" @click="confirm">
{{ $t('antflow.condition.confirm') }}
</Button>
</div>
</template>
</Drawer>

22
apps/vben5/packages/@abp/approval-flow/src/components/antflow/FlowDesign.vue

@ -4,6 +4,8 @@ import type { AntFlowNode } from './types';
import { computed, onMounted, onUnmounted, ref, watch } from 'vue';
import { $t } from '@vben/locales';
import { useApprovalParticipantsApi } from '../../api/useApprovalParticipantsApi';
import ApprovalNodeDrawer from './ApprovalNodeDrawer.vue';
import ConditionNodeDrawer from './ConditionNodeDrawer.vue';
@ -272,8 +274,11 @@ function collectErrors(
if (node.error && node.nodeType !== NodeType.StartNode) {
errors.push({
key: node.nodeId,
label: node.nodeName || node.nodeDisplayName || '流程设计',
message: `请完善:${node.nodeDisplayName || node.nodeName || '节点'}`,
label: node.nodeName || node.nodeDisplayName || $t('antflow.flow.design'),
message: $t('antflow.flow.completeNode').replace(
'{0}',
node.nodeDisplayName || node.nodeName || $t('antflow.common.node'),
),
});
}
@ -336,7 +341,7 @@ defineExpose({
<button
class="zoom-btn"
type="button"
title="缩小"
:title="$t('antflow.flow.zoomOut')"
:disabled="!canZoomOut"
@click="zoomOut"
>
@ -346,13 +351,18 @@ defineExpose({
<button
class="zoom-btn"
type="button"
title="放大"
:title="$t('antflow.flow.zoomIn')"
:disabled="!canZoomIn"
@click="zoomIn"
>
+
</button>
<button class="zoom-btn" type="button" title="重置" @click="resetView">
<button
class="zoom-btn"
type="button"
:title="$t('antflow.flow.reset')"
@click="resetView"
>
⟳
</button>
</div>
@ -367,7 +377,7 @@ defineExpose({
@select="handleSelect"
@update:node="handleUpdate"
/>
<div v-else class="empty-state">暂无流程数据</div>
<div v-else class="empty-state">{{ $t('antflow.flow.empty') }}</div>
</div>
</div>
</div>

87
apps/vben5/packages/@abp/approval-flow/src/components/antflow/NodeWarp.vue

@ -9,6 +9,8 @@ import type {
import { computed, ref } from 'vue';
import { $t } from '@vben/locales';
import AddNode from './AddNode.vue';
import {
createApproveNode,
@ -25,7 +27,7 @@ defineOptions({
const props = withDefaults(
defineProps<{
/** Render the terminal "流程结束" marker for the main chain. */
/** Render the terminal flow-end marker for the main chain. */
endNode?: boolean;
node?: AntFlowNode | null;
readonly?: boolean;
@ -69,8 +71,8 @@ const canDelete = computed(
const defaultText = computed(() => {
const nodeType = props.node?.nodeType;
return nodeType === undefined
? '节点'
: (placeholderList[nodeType] ?? '节点');
? $t('antflow.nodeWarp.node')
: $t(placeholderList[nodeType] ?? 'antflow.nodeWarp.node');
});
const conditionNodes = computed<AntFlowNode[]>(() => {
const nodes = props.node?.nodeProperty?.conditionNodes;
@ -85,19 +87,19 @@ function iconOf(node: AntFlowNode): string {
switch (node.nodeType) {
case NodeType.ApproveNode:
case NodeType.ParallelApproveNode: {
return '审';
return '✓';
}
case NodeType.ConditionNode: {
return '条';
return '◇';
}
case NodeType.CopyNode: {
return '抄';
return 'CC';
}
case NodeType.StartNode: {
return '发';
return '▶';
}
default: {
return '节';
return '•';
}
}
}
@ -152,16 +154,16 @@ function statusOf(node: AntFlowNode): '' | AntFlowNodeStatus {
function statusLabelOf(node: AntFlowNode): string {
switch (statusOf(node)) {
case 'approved': {
return '已通过';
return $t('antflow.nodeWarp.statusApproved');
}
case 'current': {
return '进行中';
return $t('antflow.nodeWarp.statusRunning');
}
case 'pending': {
return '未执行';
return $t('antflow.nodeWarp.statusNotStarted');
}
case 'rejected': {
return '已拒绝';
return $t('antflow.nodeWarp.statusRejected');
}
default: {
return '';
@ -234,7 +236,10 @@ function handleAddCondition() {
? ([...updated.nodeProperty.conditionNodes] as AntFlowNode[])
: [];
const created = createConditionNode(
`条件${nodes.length + 1}`,
$t('antflow.nodeWarp.conditionName').replace(
'{0}',
String(nodes.length + 1),
),
null,
nodes.length + 1,
0,
@ -377,7 +382,9 @@ function commitBranchEdit(index: number) {
return;
}
const name = branchDraftName.value.trim() || `条件${index + 1}`;
const name =
branchDraftName.value.trim() ||
$t('antflow.nodeWarp.conditionName').replace('{0}', String(index + 1));
nodes[index] = {
...(nodes[index] as AntFlowNode),
nodeDisplayName: name,
@ -394,25 +401,30 @@ function cancelBranchEdit() {
<template>
<div class="node-warp">
<!-- 1. 普通节点 -->
<!-- 1. Regular node -->
<template v-if="node && !isGateway">
<div class="node-card-wrap">
<span
v-if="node.error"
class="node-error-badge"
aria-label="节点配置错误"
:aria-label="$t('antflow.nodeWarp.configError')"
>
!
</span>
<div :class="cardClass(node)">
<span v-if="isCondition" class="node-priority">
优先级{{ node.nodeWeight }}
{{
$t('antflow.nodeWarp.priority').replace(
'{0}',
String(node.nodeWeight),
)
}}
</span>
<button
v-if="canDelete"
class="node-delete"
type="button"
aria-label="删除节点"
:aria-label="$t('antflow.nodeWarp.deleteNode')"
@click.stop="handleDelete"
>
×
@ -438,7 +450,12 @@ function cancelBranchEdit() {
</div>
<div class="node-content" @click.stop="handleSelect(node)">
<span v-if="node.error" class="placeholder">
请选择{{ defaultText }}
{{
$t('antflow.nodeWarp.selectPlaceholder').replace(
'{0}',
defaultText,
)
}}
</span>
<span v-else class="content">{{ node.nodeDisplayName }}</span>
<span
@ -474,11 +491,11 @@ function cancelBranchEdit() {
/>
<div v-else-if="endNode" class="end-node">
<div class="circle"></div>
<span class="text">流程结束</span>
<span class="text">{{ $t('antflow.nodeWarp.flowEnd') }}</span>
</div>
</template>
<!-- 2. 条件网关 -->
<!-- 2. Condition gateway -->
<template v-if="node && isGateway">
<div class="parallel-branches-container">
<div
@ -486,9 +503,11 @@ function cancelBranchEdit() {
class="branch-label condition-branch-label"
@click.stop="handleAddCondition"
>
添加条件
{{ $t('antflow.nodeWarp.addCondition') }}
</div>
<div v-else class="branch-label">
{{ $t('antflow.nodeWarp.conditionBranch') }}
</div>
<div v-else class="branch-label">条件分支</div>
<div class="branches-wrapper">
<div
@ -500,19 +519,24 @@ function cancelBranchEdit() {
<span
v-if="branch.error"
class="node-error-badge"
aria-label="节点配置错误"
:aria-label="$t('antflow.nodeWarp.configError')"
>
!
</span>
<div :class="cardClass(branch)">
<span class="node-priority">
优先级{{ branch.nodeWeight }}
{{
$t('antflow.nodeWarp.priority').replace(
'{0}',
String(branch.nodeWeight),
)
}}
</span>
<button
v-if="!readonly"
class="node-delete"
type="button"
aria-label="删除条件"
:aria-label="$t('antflow.nodeWarp.deleteCondition')"
@click.stop="handleDeleteBranch(branch)"
>
×
@ -542,7 +566,12 @@ function cancelBranchEdit() {
</div>
<div class="node-content" @click.stop="handleSelect(branch)">
<span v-if="branch.error" class="placeholder">
请选择{{ defaultText }}
{{
$t('antflow.nodeWarp.selectPlaceholder').replace(
'{0}',
defaultText,
)
}}
</span>
<span v-else class="content">
{{ branch.nodeDisplayName }}
@ -614,13 +643,13 @@ function cancelBranchEdit() {
/>
<div v-else-if="endNode" class="end-node">
<div class="circle"></div>
<span class="text">流程结束</span>
<span class="text">{{ $t('antflow.nodeWarp.flowEnd') }}</span>
</div>
</template>
<div v-if="!node && endNode" class="end-node">
<div class="circle"></div>
<span class="text">流程结束</span>
<span class="text">{{ $t('antflow.nodeWarp.flowEnd') }}</span>
</div>
</div>
</template>

76
apps/vben5/packages/@abp/approval-flow/src/components/antflow/model.ts

@ -1,4 +1,3 @@
/* eslint-disable prettier/prettier */
import type {
ApprovalAction,
ApprovalFlowBranch,
@ -10,6 +9,7 @@ import type {
ApproverRule,
ParticipantRef,
} from '../../types/approval-flow';
/* eslint-disable prettier/prettier */
import type {
AntFlowApproveNodeProperty,
AntFlowAssignee,
@ -19,11 +19,13 @@ import type {
AntFlowNode,
} from './types';
import { $t } from '@vben/locales';
import {
createBranch,
createId,
createNode,
defaultApproveRejectActions,
getDefaultApproveRejectActions,
parseModel,
} from '../designer/model';
import { NodeType } from './types';
@ -140,7 +142,7 @@ export function createConditionProperty(
/** Start node. `child` is linked to keep the AntFlow single-linked structure. */
export function createStartNode(child: AntFlowNode | null = null): AntFlowNode {
return createBaseNode({
nodeName: '发起人',
nodeName: $t('antflow.model.start'),
nodeType: NodeType.StartNode,
nodeWeight: 0,
childNode: child,
@ -153,7 +155,7 @@ export function createApproveNode(
child: AntFlowNode | null = null,
): AntFlowNode {
const node = createBaseNode({
nodeName: '审核人',
nodeName: $t('antflow.model.reviewer'),
nodeType: NodeType.ApproveNode,
childNode: child,
error: true,
@ -165,7 +167,7 @@ export function createApproveNode(
/** Copy (CC) node. */
export function createCopyNode(child: AntFlowNode | null = null): AntFlowNode {
const node = createBaseNode({
nodeName: '抄送人',
nodeName: $t('antflow.model.cc'),
nodeType: NodeType.CopyNode,
childNode: child,
error: true,
@ -182,8 +184,8 @@ export function createConditionNode(
isDefault = 0,
): AntFlowNode {
const node = createBaseNode({
nodeName: name || '条件1',
nodeDisplayName: name || '条件1',
nodeName: name || $t('antflow.model.conditionName').replace('{0}', '1'),
nodeDisplayName: name || $t('antflow.model.conditionName').replace('{0}', '1'),
nodeType: NodeType.ConditionNode,
nodeWeight: weight,
childNode: child,
@ -204,7 +206,7 @@ export function createGatewayNode(
child: AntFlowNode | null = null,
): AntFlowNode {
const node = createBaseNode({
nodeName: '网关',
nodeName: $t('antflow.model.gateway'),
nodeType: NodeType.GatewayNode,
nodeWeight: 1,
childNode: null,
@ -215,8 +217,8 @@ export function createGatewayNode(
isDefault: 0,
sort: 0,
conditionNodes: [
createConditionNode('条件1', child, 1, 0),
createConditionNode('默认条件分支', null, 2, 1),
createConditionNode($t('antflow.model.conditionName').replace('{0}', '1'), child, 1, 0),
createConditionNode($t('antflow.model.defaultBranch'), null, 2, 1),
],
};
return node;
@ -348,37 +350,37 @@ function buildApproveDisplayName(
if (names.length > 0 && (assigneeType === 1 || assigneeType === 2)) {
if (kind === 'approval' && signType === 2) {
return `${names.length}人(${names.join(',')})会签`;
return $t('antflow.model.signSummary').replace('{0}', String(names.length)).replace('{1}', names.join(','));
}
if (kind === 'approval' && signType === 3) {
return `${names.length}人(${names.join(',')})顺序会签`;
return $t('antflow.model.sequentialSignSummary').replace('{0}', String(names.length)).replace('{1}', names.join(','));
}
return names.join('、');
}
if (property.ruleKind === 'FormField') {
return `表单字段:${property.formFieldKey || '-'}`;
return $t('antflow.model.formField').replace('{0}', property.formFieldKey || '-');
}
if (property.ruleKind === 'OrganizationUnit') {
return '部门成员';
return $t('antflow.model.departmentMember');
}
if (assigneeType === 3) {
return '直属领导';
return $t('antflow.model.directLeader');
}
if (assigneeType === 5) {
return '发起人自己';
return $t('antflow.model.initiator');
}
if (assigneeType === 6) {
return `第 ${property.directorLevel || 0} 级主管`;
return $t('antflow.model.levelSupervisor').replace('{0}', String(property.directorLevel || 0));
}
if (assigneeType === 7) {
return '层层审批';
return $t('antflow.model.chainApproval');
}
if (assigneeType === 8) {
return '发起人自选审批人';
return $t('antflow.model.selfSelect');
}
return kind === 'cc' ? '待选择抄送人' : '待配置审批人';
return kind === 'cc' ? $t('antflow.model.pendingCc') : $t('antflow.model.pendingApprover');
}
function toConditionItem(source: ApprovalFlowCondition): AntFlowConditionItem {
@ -454,7 +456,7 @@ function conditionBranchesOf(node: ApprovalFlowNode): ApprovalFlowBranch[] {
if (condition && (condition.fieldKey || condition.expression)) {
fallback.push({
id: createId('branch'),
name: '条件1',
name: $t('antflow.model.conditionName').replace('{0}', '1'),
fieldKey: condition.fieldKey ?? null,
operator: condition.operator ?? '=',
compareValue: condition.compareValue ?? null,
@ -466,7 +468,7 @@ function conditionBranchesOf(node: ApprovalFlowNode): ApprovalFlowBranch[] {
} else {
fallback.push({
id: createId('branch'),
name: '条件1',
name: $t('antflow.model.conditionName').replace('{0}', '1'),
fieldKey: null,
operator: '=',
compareValue: null,
@ -478,7 +480,7 @@ function conditionBranchesOf(node: ApprovalFlowNode): ApprovalFlowBranch[] {
}
fallback.push({
id: createId('branch'),
name: '其他条件',
name: $t('antflow.model.otherCondition'),
fieldKey: null,
operator: '=',
compareValue: null,
@ -499,7 +501,7 @@ function branchToConditionNode(
const isDefault = index === total - 1 ? 1 : 0;
const child = convertChain(branch.nodes ?? [], 0);
const node = createConditionNode(
branch.name || (isDefault === 1 ? '其他条件' : `条件${index + 1}`),
branch.name || (isDefault === 1 ? $t('antflow.model.otherCondition') : $t('antflow.model.conditionName').replace('{0}', String(index + 1))),
child,
index + 1,
isDefault,
@ -528,7 +530,7 @@ function conditionToGateway(
const gateway = createGatewayNode(null);
gateway.nodeId = node.id || gateway.nodeId;
gateway.nodeName = node.name || '条件分支';
gateway.nodeName = node.name || $t('antflow.model.conditionBranch');
gateway.nodeDisplayName = gateway.nodeName;
gateway.childNode = next;
gateway.error = false;
@ -823,7 +825,7 @@ function conditionNodeToOldBranch(
return {
id: node.nodeId || createId('branch'),
name: node.nodeName || (isDefault ? '其他条件' : `条件${index + 1}`),
name: node.nodeName || (isDefault ? $t('antflow.model.otherCondition') : $t('antflow.model.conditionName').replace('{0}', String(index + 1))),
fieldKey: first?.fieldKey ?? null,
operator: first?.operator ?? '=',
compareValue: first?.compareValue ?? null,
@ -838,14 +840,14 @@ function conditionNodeToOldBranch(
}
function startToOld(node: AntFlowNode): ApprovalFlowNode {
const oldNode = createNode('start', node.nodeName || '发起人');
const oldNode = createNode('start', node.nodeName || $t('antflow.model.start'));
oldNode.id = node.nodeId || oldNode.id;
return oldNode;
}
function approveToOld(node: AntFlowNode): ApprovalFlowNode {
const property = node.nodeProperty ?? {};
const oldNode = createNode('approval', node.nodeName || '审批人');
const oldNode = createNode('approval', node.nodeName || $t('antflow.model.reviewer'));
oldNode.id = node.nodeId || oldNode.id;
oldNode.signMode = signModeFromSignType(property.signType);
oldNode.rules = rulesFromAntFlow(property);
@ -856,13 +858,13 @@ function approveToOld(node: AntFlowNode): ApprovalFlowNode {
? (property.actions as ApprovalAction[])
: [];
oldNode.actions =
actions.length > 0 ? actions : [...defaultApproveRejectActions];
actions.length > 0 ? actions : getDefaultApproveRejectActions();
return oldNode;
}
function copyToOld(node: AntFlowNode): ApprovalFlowNode {
const oldNode = createNode('cc', node.nodeName || '抄送人');
const oldNode = createNode('cc', node.nodeName || $t('antflow.model.cc'));
oldNode.id = node.nodeId || oldNode.id;
oldNode.signMode = 'Any';
oldNode.rules = rulesFromAntFlow(node.nodeProperty ?? {});
@ -871,7 +873,7 @@ function copyToOld(node: AntFlowNode): ApprovalFlowNode {
}
function gatewayToOld(gateway: AntFlowNode): ApprovalFlowNode {
const oldNode = createNode('condition', gateway.nodeName || '条件分支');
const oldNode = createNode('condition', gateway.nodeName || $t('antflow.model.conditionBranch'));
oldNode.id = gateway.nodeId || oldNode.id;
const conditionNodes: AntFlowNode[] = Array.isArray(
@ -889,7 +891,7 @@ function gatewayToOld(gateway: AntFlowNode): ApprovalFlowNode {
? conditionNodes.map((node, index) =>
conditionNodeToOldBranch(node, index, lastIndex, hasExplicitDefault),
)
: [createBranch(0, '条件1'), createBranch(1, '其他条件')];
: [createBranch(0, $t('antflow.model.conditionName').replace('{0}', '1')), createBranch(1, $t('antflow.model.otherCondition'))];
oldNode.branches = branches;
@ -917,13 +919,13 @@ function gatewayToOld(gateway: AntFlowNode): ApprovalFlowNode {
* condition node.
*/
function standaloneConditionToOld(node: AntFlowNode): ApprovalFlowNode {
const oldNode = createNode('condition', node.nodeName || '条件分支');
const oldNode = createNode('condition', node.nodeName || $t('antflow.model.conditionBranch'));
oldNode.id = node.nodeId || oldNode.id;
const branch = conditionNodeToOldBranch(node, 0, 1, false);
branch.nodes = [];
branch.name = node.nodeName || '条件1';
oldNode.branches = [branch, createBranch(1, '其他条件')];
branch.name = node.nodeName || $t('antflow.model.conditionName').replace('{0}', '1');
oldNode.branches = [branch, createBranch(1, $t('antflow.model.otherCondition'))];
oldNode.condition = {
fieldKey: branch.fieldKey ?? null,
operator: branch.operator ?? '=',
@ -1010,9 +1012,9 @@ export function antFlowToOld(
}
if (!hasStart) {
nodes.unshift(createNode('start', '发起人'));
nodes.unshift(createNode('start', $t('antflow.model.start')));
}
nodes.push(createNode('end', '结束'));
nodes.push(createNode('end', $t('antflow.model.end')));
return {
version: options.version ?? 1,

32
apps/vben5/packages/@abp/approval-flow/src/components/antflow/types.ts

@ -6,19 +6,19 @@
* consumed from plain JavaScript / JSON definitions.
*/
export const NodeType = {
/** 开始节点 */
/** Start node */
StartNode: 1,
/** 条件网关 */
/** Condition gateway */
GatewayNode: 2,
/** 条件节点(网关内的分支) */
/** Condition node (branch inside a gateway) */
ConditionNode: 3,
/** 审批人 */
/** Approver */
ApproveNode: 4,
/** 并行审批网关 */
/** Parallel approval gateway */
ParallelApproveWayNode: 5,
/** 抄送人 */
/** CC recipient */
CopyNode: 6,
/** 并行审批人 */
/** Parallel approver */
ParallelApproveNode: 7,
} as const;
@ -26,13 +26,13 @@ export type NodeType = (typeof NodeType)[keyof typeof NodeType];
/** Placeholder used by the node card when a node has no display name yet. */
export const placeholderList: Record<number, string> = {
[NodeType.StartNode]: '发起人',
[NodeType.GatewayNode]: '条件',
[NodeType.ConditionNode]: '条件',
[NodeType.ApproveNode]: '审核人',
[NodeType.ParallelApproveWayNode]: '并行审核人',
[NodeType.CopyNode]: '抄送人',
[NodeType.ParallelApproveNode]: '并行审核人',
[NodeType.StartNode]: 'antflow.model.start',
[NodeType.GatewayNode]: 'antflow.model.conditionBranch',
[NodeType.ConditionNode]: 'antflow.model.conditionBranch',
[NodeType.ApproveNode]: 'antflow.model.reviewer',
[NodeType.ParallelApproveWayNode]: 'antflow.model.reviewer',
[NodeType.CopyNode]: 'antflow.model.cc',
[NodeType.ParallelApproveNode]: 'antflow.model.reviewer',
};
/** Actions exposed by the hover "add node" menu. */
@ -98,7 +98,7 @@ export interface AntFlowConditionItem {
export interface AntFlowConditionGroup {
conditionList: AntFlowConditionItem[];
/** true = 且, false = 或 */
/** true = AND, false = OR */
condRelation: boolean;
groupId: string;
sort?: number;
@ -107,7 +107,7 @@ export interface AntFlowConditionGroup {
export interface AntFlowConditionNodeProperty {
expression?: null | string;
groupConditions: AntFlowConditionGroup[];
/** true = 且, false = 或 (relation between groups). */
/** true = AND, false = OR (relation between groups). */
groupRelation: boolean;
isDefault: number;
logic?: 'and' | 'or';

6
apps/vben5/packages/@abp/approval-flow/src/components/designer/AddNode.vue

@ -1,6 +1,8 @@
<script setup lang="ts">
import type { ApprovalFlowNodeKind } from '../../types/approval-flow';
import { $t } from '@vben/locales';
defineProps<{
actions: Array<{ color?: string; key: ApprovalFlowNodeKind; label: string }>;
readonly?: boolean;
@ -13,7 +15,9 @@ const emit = defineEmits<{
<template>
<div v-if="!readonly" class="add-node">
<div class="add-btn" title="添加节点">+</div>
<div class="add-btn" :title="$t('antflow.designer.common.addCondition')">
+
</div>
<div class="add-menu">
<div
v-for="action in actions"

114
apps/vben5/packages/@abp/approval-flow/src/components/designer/ApprovalFlowDesigner.vue

@ -9,6 +9,8 @@ import type {
import { computed, onMounted, ref } from 'vue';
import { $t } from '@vben/locales';
import { Button, Empty, message, Modal, Space } from 'ant-design-vue';
import { useApprovalFormsApi } from '../../api/useApprovalFormsApi';
@ -69,9 +71,17 @@ const addActions: Array<{
key: ApprovalFlowNodeKind;
label: string;
}> = [
{ key: 'approval', label: '审批人', color: '#f2994a' },
{ key: 'cc', label: '抄送人', color: '#2f80ed' },
{ key: 'condition', label: '条件分支', color: '#27ae60' },
{
key: 'approval',
label: $t('antflow.designer.common.approval'),
color: '#f2994a',
},
{ key: 'cc', label: $t('antflow.designer.common.cc'), color: '#2f80ed' },
{
key: 'condition',
label: $t('antflow.designer.common.condition'),
color: '#27ae60',
},
];
async function loadTemplate() {
@ -97,7 +107,7 @@ async function loadTemplate() {
}
}
} catch {
message.error('审批模板加载失败');
message.error($t('antflow.designer.common.loadFailed'));
} finally {
loading.value = false;
}
@ -128,7 +138,13 @@ function addConditionBranch(node: ApprovalFlowNode) {
branch.nodes = [];
branches.splice(insertAt, 0, branch);
branches.forEach((item, index) => {
item.name = index === branches.length - 1 ? '其他条件' : `条件${index + 1}`;
item.name =
index === branches.length - 1
? $t('antflow.designer.common.otherCondition')
: $t('antflow.designer.common.conditionWithIndex').replace(
'{0}',
String(index + 1),
);
if (index === branches.length - 1) {
item.expression = null;
}
@ -272,13 +288,13 @@ function addBranchNode(nodes: ApprovalFlowNode[], kind: ApprovalFlowNodeKind) {
function nodeIcon(kind: ApprovalFlowNodeKind): string {
switch (kind) {
case 'approval': {
return '审';
return $t('antflow.designer.common.approval');
}
case 'cc': {
return '抄';
return $t('antflow.designer.common.cc');
}
case 'condition': {
return '条';
return $t('antflow.designer.common.condition');
}
default: {
return '•';
@ -298,25 +314,31 @@ function statusClass(id: string): string {
function statusText(id: string): string {
switch (statusOf(id)) {
case 'approved': {
return '已通过';
return $t('antflow.designer.common.statusApproved');
}
case 'rejected': {
return '已拒绝';
return $t('antflow.designer.common.statusRejected');
}
case 'running': {
return '进行中';
return $t('antflow.designer.common.statusRunning');
}
default: {
return '未执行';
return $t('antflow.designer.common.statusNotStarted');
}
}
}
function conditionTitle(index: number): string {
return `条件${index + 1}`;
return $t('antflow.designer.common.conditionWithIndex').replace(
'{0}',
String(index + 1),
);
}
function conditionPriority(index: number): string {
return `优先级${index + 1}`;
return $t('antflow.designer.common.priority').replace(
'{0}',
String(index + 1),
);
}
function conditionExpression(
@ -333,7 +355,9 @@ function conditionExpression(
.replaceAll('!==', '≠')
.replaceAll('==', '=');
}
return index === total - 1 ? '其他条件进入此流程' : '请设置条件';
return index === total - 1
? $t('antflow.designer.common.otherConditionFlow')
: $t('antflow.designer.common.setCondition');
}
function zoomIn() {
zoom.value = Math.min(1.5, Math.round((zoom.value + 0.1) * 10) / 10);
@ -349,7 +373,7 @@ function resetZoom() {
async function saveDesign(): Promise<null | string> {
if (!props.templateId) {
message.warning('请先保存模板');
message.warning($t('antflow.designer.common.saveFirst'));
return null;
}
@ -361,10 +385,10 @@ async function saveDesign(): Promise<null | string> {
await templatesApi.saveDesignApi(props.templateId, {
flowDefinitionJson: json,
});
message.success('审批流设计已保存');
message.success($t('antflow.designer.common.saveSuccess'));
return json;
} catch {
message.error('保存失败');
message.error($t('antflow.designer.common.saveFailed'));
return null;
} finally {
saving.value = false;
@ -381,9 +405,9 @@ async function publish() {
await templatesApi.publishApi(props.templateId, {
formDefinitionId: model.value.formDefinitionId ?? null,
});
message.success('发布成功');
message.success($t('antflow.designer.common.publishSuccess'));
} catch {
message.error('发布失败');
message.error($t('antflow.designer.common.publishFailed'));
} finally {
saving.value = false;
}
@ -391,15 +415,14 @@ async function publish() {
function confirmPublish() {
if (!props.templateId) {
message.warning('请先保存模板');
message.warning($t('antflow.designer.common.saveFirst'));
return;
}
Modal.confirm({
content:
'发布后将根据当前流程设计自动生成并发布 Elsa 工作流定义,确定继续吗?',
content: $t('antflow.designer.common.publishConfirm'),
onOk: publish,
title: '发布审批模板',
title: $t('antflow.designer.common.publishTitle'),
});
}
@ -424,13 +447,19 @@ onMounted(() => {
:class="{ 'is-embedded': embedded, 'is-readonly': readonly }"
>
<div v-if="!embedded" class="designer-header">
<span class="designer-title">{{ templateName || '审批流设计' }}</span>
<span class="designer-title">{{
templateName || $t('antflow.designer.common.flowDesign')
}}</span>
<Space>
<Button :disabled="formFields.length === 0" @click="previewOpen = true">
预览表单
{{ $t('antflow.designer.common.previewForm') }}
</Button>
<Button :loading="saving" @click="saveDesign">
{{ $t('antflow.designer.common.saveDesign') }}
</Button>
<Button type="primary" @click="confirmPublish">
{{ $t('antflow.designer.common.publishTemplate') }}
</Button>
<Button :loading="saving" @click="saveDesign">保存设计</Button>
<Button type="primary" @click="confirmPublish">发布模板</Button>
</Space>
</div>
@ -439,7 +468,7 @@ onMounted(() => {
<button
class="zoom-btn"
:disabled="zoom <= 0.5"
title="缩小"
:title="$t('antflow.designer.common.zoomOut')"
@click="zoomOut"
>
−
@ -448,12 +477,18 @@ onMounted(() => {
<button
class="zoom-btn"
:disabled="zoom >= 1.5"
title="放大"
:title="$t('antflow.designer.common.zoomIn')"
@click="zoomIn"
>
+
</button>
<button class="zoom-btn" title="重置" @click="resetZoom">↺</button>
<button
class="zoom-btn"
:title="$t('antflow.designer.common.reset')"
@click="resetZoom"
>
↺
</button>
</div>
<div class="flow-container" :style="{ transform: `scale(${zoom})` }">
@ -464,13 +499,13 @@ onMounted(() => {
@click="selectNode(startNode.id)"
>
<div class="start-card-header">
<span>发起人</span>
<span>{{ $t('antflow.designer.common.initiator') }}</span>
<span v-if="readonly" class="status-chip">{{
statusText(startNode.id)
}}</span>
</div>
<div class="start-card-body">
<span>所有人</span>
<span>{{ $t('antflow.designer.common.everyone') }}</span>
<span class="node-arrow">›</span>
</div>
</div>
@ -494,7 +529,7 @@ onMounted(() => {
class="condition-pill"
@click="addConditionBranch(node)"
>
添加条件
{{ $t('antflow.designer.common.addCondition') }}
</div>
<div class="condition-branches">
<div
@ -610,7 +645,10 @@ onMounted(() => {
</div>
<div class="node-content">
<span class="node-summary">
{{ summarizeNode(node) || '请点击配置节点' }}
{{
summarizeNode(node) ||
$t('antflow.designer.common.selectCondition')
}}
</span>
<span class="node-arrow">›</span>
</div>
@ -630,13 +668,15 @@ onMounted(() => {
<div v-if="endNode" class="end-node" :class="statusClass(endNode.id)">
<div class="end-circle"></div>
<span class="end-text">流程结束</span>
<span class="end-text">{{
$t('antflow.designer.common.flowEnd')
}}</span>
</div>
<Empty
v-if="editableNodes.length === 0"
class="mt-4"
description="点击 + 添加审批人、抄送人或条件分支"
:description="$t('antflow.designer.common.configHint')"
/>
</div>
</div>

138
apps/vben5/packages/@abp/approval-flow/src/components/designer/ApprovalFlowWizard.vue

@ -3,6 +3,8 @@ import type { ApprovalFlowModel } from '../../types/approval-flow';
import { computed, onMounted, reactive, ref } from 'vue';
import { $t } from '@vben/locales';
import {
Button,
Card,
@ -62,15 +64,15 @@ const basic = reactive({
});
const formOptions = computed(() => [
{ label: '新建表单', value: '' },
{ label: $t('antflow.designer.wizard.newForm'), value: '' },
...forms.value,
]);
const steps = [
{ title: '基础设置' },
{ title: '表单设计' },
{ title: '流程设计' },
{ title: '发布' },
{ title: $t('antflow.designer.wizard.basic') },
{ title: $t('antflow.designer.wizard.form') },
{ title: $t('antflow.designer.wizard.flow') },
{ title: $t('antflow.designer.wizard.publish') },
];
onMounted(async () => {
@ -111,7 +113,7 @@ async function loadTemplate() {
}
published.value = template.isPublished;
} catch {
message.error('审批模板加载失败');
message.error($t('antflow.designer.wizard.loadFailed'));
} finally {
loading.value = false;
}
@ -119,7 +121,7 @@ async function loadTemplate() {
async function saveBasic(): Promise<boolean> {
if (!basic.displayName.trim()) {
message.warning('请填写模板名称');
message.warning($t('antflow.designer.wizard.nameRequired'));
return false;
}
@ -135,7 +137,7 @@ async function saveBasic(): Promise<boolean> {
});
} else {
if (!basic.name.trim()) {
message.warning('请填写模板编码');
message.warning($t('antflow.designer.wizard.codeRequired'));
return false;
}
const created = await templatesApi.createApi({
@ -153,7 +155,7 @@ async function saveBasic(): Promise<boolean> {
}
return true;
} catch {
message.error('基础信息保存失败');
message.error($t('antflow.designer.wizard.basicSaveFailed'));
return false;
} finally {
saving.value = false;
@ -178,7 +180,7 @@ async function saveFlow(): Promise<boolean> {
const templateId = currentTemplateId.value;
const json = flowDesigner.value?.getModelJson();
if (!templateId || !json) {
message.warning('流程设计尚未准备好');
message.warning($t('antflow.designer.wizard.designNotReady'));
return false;
}
@ -197,7 +199,7 @@ async function saveFlow(): Promise<boolean> {
summary.cc = model.nodes.filter((node) => node.kind === 'cc').length;
return true;
} catch {
message.error('流程设计保存失败');
message.error($t('antflow.designer.wizard.designSaveFailed'));
return false;
} finally {
saving.value = false;
@ -255,9 +257,9 @@ async function publish() {
formDefinitionId: useForm.value ? formId.value : null,
});
published.value = true;
message.success('审批模板已发布');
message.success($t('antflow.designer.wizard.published'));
} catch {
message.error('发布失败');
message.error($t('antflow.designer.wizard.publishFailed'));
} finally {
saving.value = false;
}
@ -280,9 +282,11 @@ function finish() {
<header class="top-nav">
<div class="nav-left">
<span class="process-title">{{
basic.displayName || '新建审批流程'
basic.displayName || $t('antflow.designer.wizard.newFlow')
}}</span>
<Tag v-if="published" color="green">已发布</Tag>
<Tag v-if="published" color="green">
{{ $t('antflow.designer.wizard.publishedTag') }}
</Tag>
</div>
<div class="nav-steps" :class="`step-${step}`">
@ -300,24 +304,26 @@ function finish() {
</div>
<div class="nav-right">
<Button @click="cancel">取消</Button>
<Button @click="cancel">
{{ $t('antflow.designer.wizard.cancel') }}
</Button>
<Button
v-if="step === 3 && !published"
:loading="saving"
type="primary"
@click="publish"
>
确认发布
{{ $t('antflow.designer.wizard.confirmPublish') }}
</Button>
<Button
v-else-if="published && step === 3"
type="primary"
@click="finish"
>
完成
{{ $t('antflow.designer.wizard.finish') }}
</Button>
<Button v-else :loading="saving" type="primary" @click="next">
下一步
{{ $t('antflow.designer.wizard.next') }}
</Button>
</div>
</header>
@ -326,11 +332,13 @@ function finish() {
<div v-if="published" class="result-wrap">
<Result
status="success"
sub-title="审批模板已发布,可在审批模板列表中直接发起审批。"
title="发布成功"
:sub-title="$t('antflow.designer.wizard.publishSuccessDesc')"
:title="$t('antflow.designer.wizard.publishSuccessTitle')"
>
<template #extra>
<Button type="primary" @click="finish">完成</Button>
<Button type="primary" @click="finish">
{{ $t('antflow.designer.wizard.finish') }}
</Button>
</template>
</Result>
</div>
@ -340,40 +348,47 @@ function finish() {
<div class="basic-setting-wrap" :class="{ 'is-loading': loading }">
<div class="setting-form">
<div class="setting-item">
<label>流程编号</label>
<label>{{ $t('antflow.designer.wizard.code') }}</label>
<Input
v-model:value="basic.name"
:disabled="!!currentTemplateId"
placeholder="例如:leave-approval"
:placeholder="$t('antflow.designer.wizard.codePlaceholder')"
/>
</div>
<div class="setting-item">
<label>审批名称</label>
<label>{{ $t('antflow.designer.wizard.name') }}</label>
<Input
v-model:value="basic.displayName"
placeholder="例如:请假审批"
:placeholder="$t('antflow.designer.wizard.namePlaceholder')"
/>
</div>
<div class="setting-item">
<label>选择分组</label>
<label>{{ $t('antflow.designer.wizard.category') }}</label>
<Input
v-model:value="basic.category"
placeholder="例如:人事"
:placeholder="
$t('antflow.designer.wizard.categoryPlaceholder')
"
/>
</div>
<div class="setting-item">
<label>模板图标</label>
<Input v-model:value="basic.icon" placeholder="可选" />
<label>{{ $t('antflow.designer.wizard.icon') }}</label>
<Input
v-model:value="basic.icon"
:placeholder="$t('antflow.designer.wizard.iconPlaceholder')"
/>
</div>
<div class="setting-item">
<label>业务键提示</label>
<label>{{ $t('antflow.designer.wizard.businessKey') }}</label>
<Input
v-model:value="basic.businessKeyHint"
placeholder="发起时业务键的填写提示"
:placeholder="
$t('antflow.designer.wizard.businessKeyPlaceholder')
"
/>
</div>
<div class="setting-item is-textarea">
<label>审批说明</label>
<label>{{ $t('antflow.designer.wizard.description') }}</label>
<Input.TextArea v-model:value="basic.description" :rows="4" />
</div>
</div>
@ -383,11 +398,15 @@ function finish() {
<div v-else-if="step === 1" class="form-step">
<div class="mb-3 flex flex-wrap items-center gap-4">
<Space>
<span class="text-sm text-gray-600">启用表单</span>
<span class="text-sm text-gray-600">{{
$t('antflow.designer.wizard.enableForm')
}}</span>
<Switch v-model:checked="useForm" />
</Space>
<Space>
<span class="text-sm text-gray-600">选择已有表单</span>
<span class="text-sm text-gray-600">{{
$t('antflow.designer.wizard.selectExistingForm')
}}</span>
<Select
:disabled="!useForm"
:options="formOptions"
@ -396,7 +415,9 @@ function finish() {
@update:value="onExistingFormChange"
/>
</Space>
<Tag v-if="formId" color="green">已绑定表单</Tag>
<Tag v-if="formId" color="green">
{{ $t('antflow.designer.wizard.boundForm') }}
</Tag>
</div>
<FormDesigner
@ -409,8 +430,8 @@ function finish() {
<Result
v-else
status="info"
sub-title="本审批不需要填写表单,将直接进入流程。"
title="未启用表单"
:sub-title="$t('antflow.designer.wizard.noFormDesc')"
:title="$t('antflow.designer.wizard.noFormTitle')"
/>
</div>
@ -422,32 +443,49 @@ function finish() {
:template-id="currentTemplateId"
/>
<Card v-else class="setting-card" title="发布确认">
<Card
v-else
class="setting-card"
:title="$t('antflow.designer.wizard.publishConfirmTitle')"
>
<Descriptions bordered :column="2" size="small">
<DescriptionsItem label="模板">
<DescriptionsItem :label="$t('antflow.designer.wizard.template')">
{{ basic.displayName }}
</DescriptionsItem>
<DescriptionsItem label="编码">{{ basic.name }}</DescriptionsItem>
<DescriptionsItem label="分类">
<DescriptionsItem :label="$t('antflow.designer.wizard.codeLabel')">
{{ basic.name }}
</DescriptionsItem>
<DescriptionsItem
:label="$t('antflow.designer.wizard.categoryLabel')"
>
{{ basic.category || '-' }}
</DescriptionsItem>
<DescriptionsItem label="表单">
{{ useForm ? (formId ? '已配置' : '未保存') : '未启用' }}
<DescriptionsItem :label="$t('antflow.designer.wizard.formLabel')">
{{
useForm
? formId
? $t('antflow.designer.wizard.configured')
: $t('antflow.designer.wizard.unsaved')
: $t('antflow.designer.wizard.disabled')
}}
</DescriptionsItem>
<DescriptionsItem label="节点数">
<DescriptionsItem :label="$t('antflow.designer.wizard.nodeCount')">
{{ summary.nodes }}
</DescriptionsItem>
<DescriptionsItem label="审批节点">
<DescriptionsItem
:label="$t('antflow.designer.wizard.approvalNodes')"
>
{{ summary.approvals }}
</DescriptionsItem>
<DescriptionsItem label="抄送节点">
<DescriptionsItem :label="$t('antflow.designer.wizard.ccNodes')">
{{ summary.cc }}
</DescriptionsItem>
<DescriptionsItem label="状态">待发布</DescriptionsItem>
<DescriptionsItem :label="$t('antflow.designer.wizard.status')">
{{ $t('antflow.designer.wizard.pendingPublish') }}
</DescriptionsItem>
</Descriptions>
<div class="publish-tip">
点击右上角「确认发布」后,系统会根据当前流程设计自动生成并发布 Elsa
工作流定义,无需手动填写定义版本 Id。
{{ $t('antflow.designer.wizard.publishHint') }}
</div>
</Card>
</div>

65
apps/vben5/packages/@abp/approval-flow/src/components/designer/BranchConditionDrawer.vue

@ -7,6 +7,8 @@ import type {
import { ref, watch } from 'vue';
import { $t } from '@vben/locales';
import { Button, Drawer, Input, message, Select, Space } from 'ant-design-vue';
const props = defineProps<{
@ -21,21 +23,21 @@ const emit = defineEmits<{
}>();
const conditionOperators = [
{ label: '等于', value: '=' },
{ label: '不等于', value: '!=' },
{ label: '大于', value: '>' },
{ label: '大于等于', value: '>=' },
{ label: '小于', value: '<' },
{ label: '小于等于', value: '<=' },
{ label: '包含', value: 'contains' },
{ label: '不包含', value: 'notcontains' },
{ label: '为空', value: 'empty' },
{ label: '不为空', value: 'notempty' },
{ label: $t('antflow.designer.branch.equal'), value: '=' },
{ label: $t('antflow.designer.branch.notEqual'), value: '!=' },
{ label: $t('antflow.designer.branch.gt'), value: '>' },
{ label: $t('antflow.designer.branch.gte'), value: '>=' },
{ label: $t('antflow.designer.branch.lt'), value: '<' },
{ label: $t('antflow.designer.branch.lte'), value: '<=' },
{ label: $t('antflow.designer.branch.contains'), value: 'contains' },
{ label: $t('antflow.designer.branch.notContains'), value: 'notcontains' },
{ label: $t('antflow.designer.branch.empty'), value: 'empty' },
{ label: $t('antflow.designer.branch.notEmpty'), value: 'notempty' },
];
const logicOptions = [
{ label: '同时满足(AND)', value: 'and' },
{ label: '满足任一(OR)', value: 'or' },
{ label: $t('antflow.designer.branch.and'), value: 'and' },
{ label: $t('antflow.designer.branch.or'), value: 'or' },
];
const conditions = ref<ApprovalFlowCondition[]>([]);
@ -141,7 +143,7 @@ function save() {
.filter((expression): expression is string => !!expression);
if (expressions.length !== conditions.value.length) {
message.warning('请填写完整的条件字段、运算符和比较值');
message.warning($t('antflow.designer.branch.validation'));
return;
}
@ -169,21 +171,30 @@ function save() {
<template>
<Drawer
:open="open"
:title="branch?.name ? `设置${branch.name}` : '设置条件'"
:title="
branch?.name
? $t('antflow.designer.branch.setNamedTitle').replace(
'{0}',
branch.name,
)
: $t('antflow.designer.branch.setTitle')
"
:width="460"
@close="emit('update:open', false)"
>
<div class="condition-form">
<div v-if="conditions.length > 1" class="logic-row">
<span class="condition-label">条件关系</span>
<span class="condition-label">{{
$t('antflow.designer.branch.relation')
}}</span>
<Select v-model:value="logic" :options="logicOptions" class="w-full" />
</div>
<div class="condition-table">
<div class="condition-table-head">
<span>条件字段</span>
<span>运算符</span>
<span>比较值</span>
<span>{{ $t('antflow.designer.branch.field') }}</span>
<span>{{ $t('antflow.designer.branch.operator') }}</span>
<span>{{ $t('antflow.designer.branch.value') }}</span>
<span></span>
</div>
@ -196,7 +207,7 @@ function save() {
:options="fieldOptions()"
:value="condition.fieldKey ?? undefined"
class="w-full"
placeholder="选择字段"
:placeholder="$t('antflow.designer.branch.selectField')"
@update:value="
(value) => (condition.fieldKey = value ? String(value) : null)
"
@ -213,7 +224,7 @@ function save() {
v-if="!isValueHidden(condition.operator)"
:value="condition.compareValue ?? ''"
class="w-full"
placeholder="比较值"
:placeholder="$t('antflow.designer.branch.compareValue')"
@update:value="(value) => (condition.compareValue = value)"
/>
<span v-else class="empty-value">—</span>
@ -224,16 +235,22 @@ function save() {
type="text"
@click="removeCondition(index)"
>
删除
{{ $t('antflow.designer.branch.delete') }}
</Button>
</div>
</div>
<Button block type="dashed" @click="addCondition">+ 添加条件</Button>
<Button block type="dashed" @click="addCondition">
{{ $t('antflow.designer.branch.addCondition') }}
</Button>
<Space class="drawer-actions">
<Button @click="emit('update:open', false)">取消</Button>
<Button type="primary" @click="save">确定</Button>
<Button @click="emit('update:open', false)">
{{ $t('antflow.designer.branch.cancel') }}
</Button>
<Button type="primary" @click="save">
{{ $t('antflow.designer.branch.confirm') }}
</Button>
</Space>
</div>
</Drawer>

57
apps/vben5/packages/@abp/approval-flow/src/components/designer/BranchConditionModal.vue

@ -7,6 +7,8 @@ import type {
import { ref, watch } from 'vue';
import { $t } from '@vben/locales';
import { Button, Input, message, Modal, Select } from 'ant-design-vue';
const props = defineProps<{
@ -21,21 +23,21 @@ const emit = defineEmits<{
}>();
const conditionOperators = [
{ label: '等于', value: '=' },
{ label: '不等于', value: '!=' },
{ label: '大于', value: '>' },
{ label: '大于等于', value: '>=' },
{ label: '小于', value: '<' },
{ label: '小于等于', value: '<=' },
{ label: '包含', value: 'contains' },
{ label: '不包含', value: 'notcontains' },
{ label: '为空', value: 'empty' },
{ label: '不为空', value: 'notempty' },
{ label: $t('antflow.designer.branch.equal'), value: '=' },
{ label: $t('antflow.designer.branch.notEqual'), value: '!=' },
{ label: $t('antflow.designer.branch.gt'), value: '>' },
{ label: $t('antflow.designer.branch.gte'), value: '>=' },
{ label: $t('antflow.designer.branch.lt'), value: '<' },
{ label: $t('antflow.designer.branch.lte'), value: '<=' },
{ label: $t('antflow.designer.branch.contains'), value: 'contains' },
{ label: $t('antflow.designer.branch.notContains'), value: 'notcontains' },
{ label: $t('antflow.designer.branch.empty'), value: 'empty' },
{ label: $t('antflow.designer.branch.notEmpty'), value: 'notempty' },
];
const logicOptions = [
{ label: '同时满足(AND)', value: 'and' },
{ label: '满足任一(OR)', value: 'or' },
{ label: $t('antflow.designer.branch.and'), value: 'and' },
{ label: $t('antflow.designer.branch.or'), value: 'or' },
];
const conditions = ref<ApprovalFlowCondition[]>([]);
@ -141,7 +143,7 @@ function save() {
.filter((expression): expression is string => !!expression);
if (expressions.length !== conditions.value.length) {
message.warning('请填写完整的条件字段、运算符和比较值');
message.warning($t('antflow.designer.branch.validation'));
return;
}
@ -169,22 +171,31 @@ function save() {
<template>
<Modal
:open="open"
:title="branch?.name ? `设置${branch.name}` : '设置条件'"
:title="
branch?.name
? $t('antflow.designer.branch.setNamedTitle').replace(
'{0}',
branch.name,
)
: $t('antflow.designer.branch.setTitle')
"
:width="680"
@cancel="emit('update:open', false)"
@ok="save"
>
<div class="condition-form">
<div v-if="conditions.length > 1" class="logic-row">
<span class="condition-label">条件关系</span>
<span class="condition-label">{{
$t('antflow.designer.branch.relation')
}}</span>
<Select v-model:value="logic" :options="logicOptions" class="w-full" />
</div>
<div class="condition-table">
<div class="condition-table-head">
<span>条件字段</span>
<span>运算符</span>
<span>比较值</span>
<span>{{ $t('antflow.designer.branch.field') }}</span>
<span>{{ $t('antflow.designer.branch.operator') }}</span>
<span>{{ $t('antflow.designer.branch.value') }}</span>
<span></span>
</div>
@ -197,7 +208,7 @@ function save() {
:options="fieldOptions()"
:value="condition.fieldKey ?? undefined"
class="w-full"
placeholder="选择字段"
:placeholder="$t('antflow.designer.branch.selectField')"
@update:value="
(value) => (condition.fieldKey = value ? String(value) : null)
"
@ -214,7 +225,7 @@ function save() {
v-if="!isValueHidden(condition.operator)"
:value="condition.compareValue ?? ''"
class="w-full"
placeholder="比较值"
:placeholder="$t('antflow.designer.branch.compareValue')"
@update:value="(value) => (condition.compareValue = value)"
/>
<span v-else class="empty-value">—</span>
@ -225,12 +236,14 @@ function save() {
type="text"
@click="removeCondition(index)"
>
删除
{{ $t('antflow.designer.branch.delete') }}
</Button>
</div>
</div>
<Button block type="dashed" @click="addCondition">+ 添加条件</Button>
<Button block type="dashed" @click="addCondition">
{{ $t('antflow.designer.branch.addCondition') }}
</Button>
</div>
</Modal>
</template>

44
apps/vben5/packages/@abp/approval-flow/src/components/designer/BranchFlow.vue

@ -6,6 +6,8 @@ import type {
FormFieldDto,
} from '../../types/approval-flow';
import { $t } from '@vben/locales';
import AddNode from './AddNode.vue';
import { summarizeNode } from './model';
@ -30,21 +32,29 @@ const addActions: Array<{
key: ApprovalFlowNodeKind;
label: string;
}> = [
{ key: 'approval', label: '审批人', color: '#f2994a' },
{ key: 'cc', label: '抄送人', color: '#2f80ed' },
{ key: 'condition', label: '条件分支', color: '#27ae60' },
{
key: 'approval',
label: $t('antflow.designer.common.approval'),
color: '#f2994a',
},
{ key: 'cc', label: $t('antflow.designer.common.cc'), color: '#2f80ed' },
{
key: 'condition',
label: $t('antflow.designer.common.condition'),
color: '#27ae60',
},
];
function nodeIcon(kind: ApprovalFlowNodeKind): string {
switch (kind) {
case 'approval': {
return '审';
return $t('antflow.designer.common.approval');
}
case 'cc': {
return '抄';
return $t('antflow.designer.common.cc');
}
case 'condition': {
return '条';
return $t('antflow.designer.common.condition');
}
default: {
return '•';
@ -55,7 +65,9 @@ function nodeIcon(kind: ApprovalFlowNodeKind): string {
function summary(node: ApprovalFlowNode): string {
return (
summarizeNode(node) ||
(node.kind === 'cc' ? '待选择抄送人' : '待配置审批人')
(node.kind === 'cc'
? $t('antflow.designer.branch.pendingCc')
: $t('antflow.designer.branch.pendingApprover'))
);
}
@ -65,7 +77,10 @@ function statusClass(id: string): string {
}
function conditionTitle(index: number): string {
return `条件${index + 1}`;
return $t('antflow.designer.common.conditionWithIndex').replace(
'{0}',
String(index + 1),
);
}
function conditionExpression(
@ -82,7 +97,9 @@ function conditionExpression(
.replaceAll('!==', '≠')
.replaceAll('==', '=');
}
return index === total - 1 ? '其他条件进入此流程' : '请设置条件';
return index === total - 1
? $t('antflow.designer.common.otherConditionFlow')
: $t('antflow.designer.common.setCondition');
}
function onAddCondition(node: ApprovalFlowNode) {
@ -125,7 +142,7 @@ function onRemove(node: ApprovalFlowNode) {
class="nested-add-condition"
@click="onAddCondition(node)"
>
添加条件
{{ $t('antflow.designer.branch.add') }}
</div>
<div class="nested-branches">
<div
@ -141,7 +158,12 @@ function onRemove(node: ApprovalFlowNode) {
onEditBranch(node, branch)
"
>
<span class="node-priority">优先级{{ index + 1 }}</span>
<span class="node-priority">{{
$t('antflow.designer.branch.priority').replace(
'{0}',
String(index + 1),
)
}}</span>
<button
v-if="!readonly"
class="node-delete"

192
apps/vben5/packages/@abp/approval-flow/src/components/designer/FormDesigner.vue

@ -4,6 +4,8 @@ import type { FormulaConfig } from './formula';
import { computed, ref, watch } from 'vue';
import { $t, useI18n } from '@vben/locales';
import {
Button,
Card,
@ -18,9 +20,9 @@ import {
import { useApprovalFormsApi } from '../../api/useApprovalFormsApi';
import {
formulaModeOptions,
formulaOperatorOptions,
formulaUnitOptions,
formulaModeOptions as formulaModeOptionDefs,
formulaOperatorOptions as formulaOperatorOptionDefs,
formulaUnitOptions as formulaUnitOptionDefs,
parseFormula,
serializeFormula,
} from './formula';
@ -50,26 +52,79 @@ const emit = defineEmits<{
}>();
const formsApi = useApprovalFormsApi();
const { locale, t } = useI18n();
const formulaModeOptions = computed(() => {
void locale.value;
return formulaModeOptionDefs.map((option) => ({
label: t(option.labelKey),
value: option.value,
}));
});
const formulaOperatorOptions = computed(() => {
void locale.value;
return formulaOperatorOptionDefs.map((option) => ({
label: t(option.labelKey),
value: option.value,
}));
});
const formulaUnitOptions = computed(() => {
void locale.value;
return formulaUnitOptionDefs.map((option) => ({
label: t(option.labelKey),
value: option.value,
}));
});
const palette = [
{ icon: 'T', label: '单行文本', type: 'single-line-text' },
{ icon: '¶', label: '多行文本', type: 'multi-line-text' },
{ icon: '#', label: '数字', type: 'number' },
{ icon: '▦', label: '日期', type: 'date' },
{ icon: '▤', label: '日期区间', type: 'date-range' },
{ icon: '▾', label: '下拉选择', type: 'select' },
{ icon: '●', label: '单选', type: 'radio' },
{ icon: '☑', label: '多选', type: 'multiple-select' },
{ icon: '◐', label: '开关', type: 'switch' },
{ icon: '📎', label: '附件', type: 'attachment' },
{ icon: '∑', label: '计算', type: 'calculated' },
{ icon: 'ℹ', label: '说明', type: 'description' },
{
icon: 'T',
label: $t('antflow.designer.form.singleLineText'),
type: 'single-line-text',
},
{
icon: '¶',
label: $t('antflow.designer.form.multiLineText'),
type: 'multi-line-text',
},
{ icon: '#', label: $t('antflow.designer.form.number'), type: 'number' },
{ icon: '▦', label: $t('antflow.designer.form.date'), type: 'date' },
{
icon: '▤',
label: $t('antflow.designer.form.dateRange'),
type: 'date-range',
},
{ icon: '▾', label: $t('antflow.designer.form.select'), type: 'select' },
{ icon: '●', label: $t('antflow.designer.form.radio'), type: 'radio' },
{
icon: '☑',
label: $t('antflow.designer.form.multipleSelect'),
type: 'multiple-select',
},
{ icon: '◐', label: $t('antflow.designer.form.switch'), type: 'switch' },
{
icon: '📎',
label: $t('antflow.designer.form.attachment'),
type: 'attachment',
},
{
icon: '∑',
label: $t('antflow.designer.form.calculated'),
type: 'calculated',
},
{
icon: 'ℹ',
label: $t('antflow.designer.form.description'),
type: 'description',
},
];
const permissions = [
{ label: '可编辑', value: 'E' },
{ label: '只读', value: 'R' },
{ label: '隐藏', value: 'H' },
{ label: $t('antflow.designer.form.editable'), value: 'E' },
{ label: $t('antflow.designer.form.readOnly'), value: 'R' },
{ label: $t('antflow.designer.form.hidden'), value: 'H' },
];
const formName = ref(props.name ?? '');
@ -105,7 +160,7 @@ async function loadForm(formId: null | string, force = false) {
formPublished.value = !!definition.isPublished;
selectedIndex.value = fields.value.length > 0 ? 0 : null;
} catch {
message.error('表单加载失败');
message.error($t('antflow.designer.form.loadFailed'));
} finally {
loading.value = false;
}
@ -334,11 +389,11 @@ async function save(publishForm = true): Promise<null | string> {
}
if (!formCode.value.trim()) {
message.warning('请填写表单编码');
message.warning($t('antflow.designer.form.codeRequired'));
return null;
}
if (fields.value.length === 0) {
message.warning('请至少添加一个字段');
message.warning($t('antflow.designer.form.fieldRequired'));
return null;
}
@ -382,10 +437,10 @@ async function save(publishForm = true): Promise<null | string> {
await formsApi.publishApi(formId);
dirty.value = false;
message.success('表单已保存并发布');
message.success($t('antflow.designer.form.saved'));
return formId;
} catch {
message.error('表单保存失败');
message.error($t('antflow.designer.form.saveFailed'));
return null;
} finally {
saving.value = false;
@ -414,23 +469,31 @@ defineExpose({ getFields, loadForm, save });
<div class="flex flex-wrap items-center gap-3">
<Input
v-model:value="formName"
addon-before="表单名称"
:addon-before="$t('antflow.designer.form.formName')"
class="w-64"
placeholder="例如:请假申请"
:placeholder="$t('antflow.designer.form.formNamePlaceholder')"
/>
<Input
v-model:value="formCode"
addon-before="编码"
:addon-before="$t('antflow.designer.form.formCode')"
class="w-64"
placeholder="例如:leave-request"
:placeholder="$t('antflow.designer.form.formCodePlaceholder')"
/>
<Tag v-if="formId" color="green">已保存</Tag>
<Tag v-else color="orange">未保存</Tag>
<Tag v-if="formId" color="green">
{{ $t('antflow.designer.form.savedTag') }}
</Tag>
<Tag v-else color="orange">
{{ $t('antflow.designer.form.unsavedTag') }}
</Tag>
</div>
</Card>
<div class="mt-3 flex gap-3">
<Card class="w-40 shrink-0" size="small" title="控件">
<Card
class="w-40 shrink-0"
size="small"
:title="$t('antflow.designer.form.controls')"
>
<div class="flex flex-col gap-2">
<div
v-for="item in palette"
@ -446,11 +509,15 @@ defineExpose({ getFields, loadForm, save });
</div>
</Card>
<Card class="min-h-72 flex-1" size="small" title="表单画布">
<Card
class="min-h-72 flex-1"
size="small"
:title="$t('antflow.designer.form.canvas')"
>
<div class="drop-canvas" @dragover.prevent @drop="onDrop">
<Empty
v-if="fields.length === 0"
description="从左侧拖动控件到此处"
:description="$t('antflow.designer.form.dragHint')"
/>
<div
v-for="(field, index) in fields"
@ -464,7 +531,9 @@ defineExpose({ getFields, loadForm, save });
<div class="flex items-center gap-2">
<Tag color="blue">{{ typeLabel(field.type) }}</Tag>
<span class="truncate font-medium">{{ field.label }}</span>
<Tag v-if="field.isRequired" color="red">必填</Tag>
<Tag v-if="field.isRequired" color="red">
{{ $t('antflow.designer.form.required') }}
</Tag>
</div>
<div class="mt-1 text-xs text-gray-500">{{ field.key }}</div>
</div>
@ -489,7 +558,7 @@ defineExpose({ getFields, loadForm, save });
type="text"
@click.stop="removeField(index)"
>
删除
{{ $t('antflow.designer.form.delete') }}
</Button>
</Space>
</div>
@ -497,12 +566,21 @@ defineExpose({ getFields, loadForm, save });
</div>
</Card>
<Card class="w-64 shrink-0" size="small" title="字段属性">
<Empty v-if="!selectedField" description="选择一个字段" />
<Card
class="w-64 shrink-0"
size="small"
:title="$t('antflow.designer.form.fieldProperties')"
>
<Empty
v-if="!selectedField"
:description="$t('antflow.designer.form.selectField')"
/>
<template v-else>
<div class="flex flex-col gap-3">
<div>
<div class="mb-1 text-xs text-gray-500">显示名</div>
<div class="mb-1 text-xs text-gray-500">
{{ $t('antflow.designer.form.displayName') }}
</div>
<Input
:value="selectedField.label"
@update:value="
@ -511,7 +589,9 @@ defineExpose({ getFields, loadForm, save });
/>
</div>
<div>
<div class="mb-1 text-xs text-gray-500">字段键</div>
<div class="mb-1 text-xs text-gray-500">
{{ $t('antflow.designer.form.fieldKey') }}
</div>
<Input
:disabled="!!selectedField.id"
:value="selectedField.key"
@ -521,7 +601,9 @@ defineExpose({ getFields, loadForm, save });
/>
</div>
<div class="flex items-center justify-between">
<span class="text-xs text-gray-500">必填</span>
<span class="text-xs text-gray-500">{{
$t('antflow.designer.form.required')
}}</span>
<Switch
:checked="selectedField.isRequired"
@update:checked="
@ -530,7 +612,9 @@ defineExpose({ getFields, loadForm, save });
/>
</div>
<div>
<div class="mb-1 text-xs text-gray-500">权限</div>
<div class="mb-1 text-xs text-gray-500">
{{ $t('antflow.designer.form.permission') }}
</div>
<Select
:options="permissions"
:value="selectedField.permission"
@ -541,7 +625,9 @@ defineExpose({ getFields, loadForm, save });
/>
</div>
<div>
<div class="mb-1 text-xs text-gray-500">提示</div>
<div class="mb-1 text-xs text-gray-500">
{{ $t('antflow.designer.form.hint') }}
</div>
<Input
:value="selectedField.hint ?? ''"
@update:value="
@ -550,7 +636,9 @@ defineExpose({ getFields, loadForm, save });
/>
</div>
<div v-if="supportsOptions">
<div class="mb-1 text-xs text-gray-500">选项(每行一个)</div>
<div class="mb-1 text-xs text-gray-500">
{{ $t('antflow.designer.form.options') }}
</div>
<Input.TextArea
:rows="4"
:value="selectedField.optionsText ?? ''"
@ -561,7 +649,9 @@ defineExpose({ getFields, loadForm, save });
</div>
<template v-if="supportsFormula">
<div>
<div class="mb-1 text-xs text-gray-500">计算类型</div>
<div class="mb-1 text-xs text-gray-500">
{{ $t('antflow.designer.form.calcType') }}
</div>
<Select
:options="formulaModeOptions"
:value="selectedField.formula?.mode ?? 'number'"
@ -573,8 +663,8 @@ defineExpose({ getFields, loadForm, save });
<div class="mb-1 text-xs text-gray-500">
{{
selectedField.formula?.mode === 'date-range'
? '日期区间'
: '字段A'
? $t('antflow.designer.form.dateRange')
: $t('antflow.designer.form.fieldA')
}}
</div>
<Select
@ -587,7 +677,9 @@ defineExpose({ getFields, loadForm, save });
/>
</div>
<div v-if="selectedField.formula?.mode === 'number'">
<div class="mb-1 text-xs text-gray-500">运算符</div>
<div class="mb-1 text-xs text-gray-500">
{{ $t('antflow.designer.branch.operator') }}
</div>
<Select
:options="formulaOperatorOptions"
:value="selectedField.formula?.operator ?? '+'"
@ -598,7 +690,9 @@ defineExpose({ getFields, loadForm, save });
/>
</div>
<div v-if="selectedField.formula?.mode !== 'date-range'">
<div class="mb-1 text-xs text-gray-500">字段B</div>
<div class="mb-1 text-xs text-gray-500">
{{ $t('antflow.designer.form.fieldB') }}
</div>
<Select
:options="formulaFieldOptions"
:value="selectedField.formula?.right ?? ''"
@ -609,7 +703,9 @@ defineExpose({ getFields, loadForm, save });
/>
</div>
<div v-if="selectedField.formula?.mode !== 'number'">
<div class="mb-1 text-xs text-gray-500">结果单位</div>
<div class="mb-1 text-xs text-gray-500">
{{ $t('antflow.designer.form.resultUnit') }}
</div>
<Select
:options="formulaUnitOptions"
:value="selectedField.formula?.unit ?? 'day'"

6
apps/vben5/packages/@abp/approval-flow/src/components/designer/FormPreviewModal.vue

@ -3,6 +3,8 @@ import type { FormFieldDto } from '../../types/approval-flow';
import { computed, reactive, watch } from 'vue';
import { $t } from '@vben/locales';
import {
DatePicker,
Form,
@ -93,7 +95,7 @@ function onOpenChange(value: boolean) {
<Modal
:open="open"
:footer="null"
title="表单预览"
:title="$t('antflow.designer.form.previewTitle')"
width="680px"
@cancel="onOpenChange(false)"
>
@ -162,7 +164,7 @@ function onOpenChange(value: boolean) {
<Input
v-else-if="field.type === 'attachment'"
disabled
placeholder="附件字段(需接入文件上传组件)"
:placeholder="$t('antflow.designer.form.attachmentPlaceholder')"
/>
<span v-else-if="field.type === 'description'" class="text-gray-500">
{{ field.hint ?? field.label }}

181
apps/vben5/packages/@abp/approval-flow/src/components/designer/NodeConfigDrawer.vue

@ -12,6 +12,8 @@ import type {
import { computed, ref, watch } from 'vue';
import { $t } from '@vben/locales';
import {
Button,
DatePicker,
@ -49,13 +51,22 @@ const organizationUnits = ref<ParticipantRef[]>([]);
const roles = ref<ParticipantRef[]>([]);
const ruleKindOptions = [
{ label: '指定人员/部门', value: 'Participant' },
{ label: '发起人', value: 'Initiator' },
{ label: '发起人自选', value: 'InitiatorSelection' },
{ label: '角色', value: 'Role' },
{ label: '部门主管', value: 'Supervisor' },
{ label: '部门成员', value: 'OrganizationUnit' },
{ label: '表单字段', value: 'FormField' },
{
label: $t('antflow.designer.nodeConfig.participant'),
value: 'Participant',
},
{ label: $t('antflow.designer.nodeConfig.initiator'), value: 'Initiator' },
{
label: $t('antflow.designer.nodeConfig.initiatorSelection'),
value: 'InitiatorSelection',
},
{ label: $t('antflow.designer.nodeConfig.role'), value: 'Role' },
{ label: $t('antflow.designer.nodeConfig.supervisor'), value: 'Supervisor' },
{
label: $t('antflow.designer.nodeConfig.organizationUnit'),
value: 'OrganizationUnit',
},
{ label: $t('antflow.designer.nodeConfig.formField'), value: 'FormField' },
];
const participantOptions = computed(() => {
@ -74,9 +85,9 @@ const roleOptions = computed(() =>
);
const signModeOptions = [
{ label: '或签(一人通过即可)', value: 'Any' },
{ label: '会签(全部通过)', value: 'All' },
{ label: '顺签(依次审批)', value: 'Sequential' },
{ label: $t('antflow.designer.nodeConfig.any'), value: 'Any' },
{ label: $t('antflow.designer.nodeConfig.all'), value: 'All' },
{ label: $t('antflow.designer.nodeConfig.sequential'), value: 'Sequential' },
];
watch(
@ -136,7 +147,7 @@ async function searchUsers(filter: string) {
try {
users.value = (await participantsApi.searchUsersAsync(filter)) ?? [];
} catch {
message.warning('人员检索失败');
message.warning($t('antflow.designer.nodeConfig.searchFailed'));
}
}
@ -150,16 +161,16 @@ function patch(partial: Partial<ApprovalFlowNode>) {
}
const conditionOperators = [
{ label: '等于', value: '=' },
{ label: '不等于', value: '!=' },
{ label: '大于', value: '>' },
{ label: '大于等于', value: '>=' },
{ label: '小于', value: '<' },
{ label: '小于等于', value: '<=' },
{ label: '包含', value: 'contains' },
{ label: '不包含', value: 'notcontains' },
{ label: '为空', value: 'empty' },
{ label: '不为空', value: 'notempty' },
{ label: $t('antflow.designer.branch.equal'), value: '=' },
{ label: $t('antflow.designer.branch.notEqual'), value: '!=' },
{ label: $t('antflow.designer.branch.gt'), value: '>' },
{ label: $t('antflow.designer.branch.gte'), value: '>=' },
{ label: $t('antflow.designer.branch.lt'), value: '<' },
{ label: $t('antflow.designer.branch.lte'), value: '<=' },
{ label: $t('antflow.designer.branch.contains'), value: 'contains' },
{ label: $t('antflow.designer.branch.notContains'), value: 'notcontains' },
{ label: $t('antflow.designer.branch.empty'), value: 'empty' },
{ label: $t('antflow.designer.branch.notEmpty'), value: 'notempty' },
];
const formFieldOptions = computed(() =>
@ -206,8 +217,8 @@ function valueOptions(): { label: string; value: string }[] {
}
if (field.type === 'switch') {
return [
{ label: '是', value: 'true' },
{ label: '否', value: 'false' },
{ label: $t('antflow.designer.nodeConfig.yes'), value: 'true' },
{ label: $t('antflow.designer.nodeConfig.no'), value: 'false' },
];
}
if (!field.optionsJson) {
@ -379,7 +390,7 @@ function addAction() {
...local.value.actions,
{
key: `Action${local.value.actions.length + 1}`,
label: '同意',
label: $t('antflow.designer.nodeConfig.agree'),
effect: 'Approve',
},
],
@ -414,21 +425,25 @@ loadParticipants();
<template>
<Drawer
:open="open"
:title="local ? `节点设置 - ${local.name}` : '节点设置'"
:title="
local
? $t('antflow.designer.nodeConfig.nodeLabel').replace('{0}', local.name)
: $t('antflow.designer.nodeConfig.title')
"
width="460"
@close="onOpenChange(false)"
>
<Form v-if="local" layout="vertical">
<FormItem label="节点名称">
<FormItem :label="$t('antflow.designer.nodeConfig.nodeName')">
<Input
:value="local.name"
placeholder="请输入节点名称"
:placeholder="$t('antflow.designer.nodeConfig.nodeNamePlaceholder')"
@update:value="(value) => patch({ name: value })"
/>
</FormItem>
<template v-if="local.kind === 'approval'">
<FormItem label="审批方式">
<FormItem :label="$t('antflow.designer.nodeConfig.approvalMode')">
<RadioGroup
:value="local.signMode"
:options="signModeOptions"
@ -436,7 +451,9 @@ loadParticipants();
/>
</FormItem>
<Divider orientation="left">审批人规则</Divider>
<Divider orientation="left">
{{ $t('antflow.designer.nodeConfig.approverRules') }}
</Divider>
<div
v-for="(rule, index) in local.rules"
@ -464,7 +481,7 @@ loadParticipants();
)
"
class="w-full"
placeholder="搜索并选择人员或部门"
:placeholder="$t('antflow.designer.nodeConfig.searchParticipant')"
@search="searchUsers"
@update:value="
(values: any) => onParticipantsChange(index, values as string[])
@ -480,7 +497,7 @@ loadParticipants();
)
"
class="w-full"
placeholder="选择角色"
:placeholder="$t('antflow.designer.nodeConfig.selectRole')"
@update:value="
(values: any) => onParticipantsChange(index, values as string[])
"
@ -489,9 +506,18 @@ loadParticipants();
<Select
:value="rule.supervisorLevel ?? 'Nearest'"
:options="[
{ label: '最近一级主管', value: 'Nearest' },
{ label: '指定层级', value: 'LevelN' },
{ label: '最高层级', value: 'TopMost' },
{
label: $t('antflow.designer.nodeConfig.nearestSupervisor'),
value: 'Nearest',
},
{
label: $t('antflow.designer.nodeConfig.specifiedLevel'),
value: 'LevelN',
},
{
label: $t('antflow.designer.nodeConfig.topMost'),
value: 'TopMost',
},
]"
class="flex-1"
@update:value="
@ -522,7 +548,7 @@ loadParticipants();
}))
"
class="w-full"
placeholder="选择表单字段"
:placeholder="$t('antflow.designer.nodeConfig.selectFormField')"
@update:value="
(value: any) =>
updateRule(index, { formFieldKey: String(value ?? '') })
@ -530,18 +556,28 @@ loadParticipants();
/>
</Space>
<Button danger size="small" type="link" @click="removeRule(index)">
删除规则
{{ $t('antflow.designer.nodeConfig.deleteRule') }}
</Button>
</div>
<Button block type="dashed" @click="addRule">添加审批人规则</Button>
<Button block type="dashed" @click="addRule">
{{ $t('antflow.designer.nodeConfig.addApproverRule') }}
</Button>
<Divider orientation="left">空审批人处理</Divider>
<Divider orientation="left">
{{ $t('antflow.designer.nodeConfig.emptyApprover') }}
</Divider>
<Select
:value="local.onEmpty"
:options="[
{ label: '跳过该节点', value: 'Skip' },
{ label: '升级到部门主管', value: 'EscalateToManager' },
{
label: $t('antflow.designer.nodeConfig.skipNode'),
value: 'Skip',
},
{
label: $t('antflow.designer.nodeConfig.escalate'),
value: 'EscalateToManager',
},
]"
class="w-full"
@update:value="
@ -549,7 +585,9 @@ loadParticipants();
"
/>
<Divider orientation="left">审批动作</Divider>
<Divider orientation="left">
{{ $t('antflow.designer.nodeConfig.approvalActions') }}
</Divider>
<Space
v-for="(action, index) in local.actions"
:key="action.key"
@ -562,14 +600,18 @@ loadParticipants();
@update:value="(value) => updateActionLabel(index, value)"
/>
<Button danger size="small" type="link" @click="removeAction(index)">
删除
{{ $t('antflow.designer.nodeConfig.deleteAction') }}
</Button>
</Space>
<Button block type="dashed" @click="addAction">添加动作</Button>
<Button block type="dashed" @click="addAction">
{{ $t('antflow.designer.nodeConfig.addAction') }}
</Button>
</template>
<template v-if="local.kind === 'cc'">
<Divider orientation="left">抄送人</Divider>
<Divider orientation="left">
{{ $t('antflow.designer.nodeConfig.ccRecipients') }}
</Divider>
<div
v-for="(rule, index) in local.rules"
:key="index"
@ -585,26 +627,30 @@ loadParticipants();
)
"
class="w-full"
placeholder="搜索并选择人员或部门"
:placeholder="$t('antflow.designer.nodeConfig.searchParticipant')"
@search="searchUsers"
@update:value="
(values: any) => onParticipantsChange(index, values as string[])
"
/>
<Button danger size="small" type="link" @click="removeRule(index)">
删除抄送
{{ $t('antflow.designer.nodeConfig.deleteCc') }}
</Button>
</div>
<Button block type="dashed" @click="addRule">添加抄送人</Button>
<Button block type="dashed" @click="addRule">
{{ $t('antflow.designer.nodeConfig.addCc') }}
</Button>
</template>
<template v-if="local.kind === 'condition'">
<Divider orientation="left">条件设置</Divider>
<Divider orientation="left">
{{ $t('antflow.designer.nodeConfig.conditionSettings') }}
</Divider>
<Space class="w-full" direction="vertical">
<Select
:options="formFieldOptions"
:value="local.condition?.fieldKey ?? undefined"
placeholder="选择表单字段"
:placeholder="$t('antflow.designer.nodeConfig.selectFormField')"
@update:value="(value: any) => setConditionField(value)"
/>
<Space class="w-full">
@ -621,7 +667,9 @@ loadParticipants();
"
:options="valueOptions()"
:value="local.condition?.compareValue ?? undefined"
placeholder="选择比较值"
:placeholder="
$t('antflow.designer.nodeConfig.selectCompareValue')
"
@update:value="(value: any) => setConditionValue(value)"
/>
<InputNumber
@ -635,7 +683,7 @@ loadParticipants();
: undefined
"
class="flex-1"
placeholder="输入数字"
:placeholder="$t('antflow.designer.nodeConfig.numberPlaceholder')"
@update:value="(value: any) => setConditionValue(value)"
/>
<DatePicker
@ -645,33 +693,49 @@ loadParticipants();
"
:value="local.condition?.compareValue ?? undefined"
class="flex-1"
placeholder="选择日期"
:placeholder="$t('antflow.designer.nodeConfig.datePlaceholder')"
value-format="YYYY-MM-DD"
@update:value="(value: any) => setConditionValue(value)"
/>
<Input
v-else-if="!isEmptyOperator(local.condition?.operator)"
:value="local.condition?.compareValue ?? ''"
placeholder="输入比较内容"
:placeholder="
$t('antflow.designer.nodeConfig.contentPlaceholder')
"
@update:value="(value: any) => setConditionValue(value)"
/>
</Space>
<div class="rounded bg-gray-50 p-2 text-xs text-gray-500">
{{ local.condition?.expression || '请选择字段并设置条件' }}
{{
local.condition?.expression ||
$t('antflow.designer.nodeConfig.conditionHint')
}}
</div>
</Space>
<Divider orientation="left">分支</Divider>
<Divider orientation="left">
{{ $t('antflow.designer.nodeConfig.branches') }}
</Divider>
<div
v-for="(branch, index) in local.branches ?? []"
:key="branch.id"
class="mb-2 rounded-md border border-gray-200 p-3"
>
<Tag :color="index === 0 ? 'green' : 'default'">
{{ index === 0 ? '符合条件(true)' : '不符合条件(false)' }}
{{
index === 0
? $t('antflow.designer.nodeConfig.trueBranch')
: $t('antflow.designer.nodeConfig.falseBranch')
}}
</Tag>
<span class="ml-2 text-xs text-gray-500">
{{ branch.nodes.length }} 个节点
{{
$t('antflow.designer.nodeConfig.nodeCount').replace(
'{0}',
String(branch.nodes.length),
)
}}
</span>
<div
v-for="child in branch.nodes"
@ -682,8 +746,7 @@ loadParticipants();
</div>
</div>
<div class="mt-2 text-xs text-gray-400">
条件成立进入「符合条件」分支,否则进入「不符合条件」分支;两个分支创建时已各带一个默认审批人节点,
可在画布中继续添加节点。
{{ $t('antflow.designer.nodeConfig.branchHint') }}
</div>
</template>
</Form>

26
apps/vben5/packages/@abp/approval-flow/src/components/designer/formula.ts

@ -11,25 +11,25 @@ export interface FormulaConfig {
}
export const formulaModeOptions = [
{ label: '两个数字字段运算', value: 'number' },
{ label: '两个日期字段运算', value: 'date-diff' },
{ label: '日期区间运算', value: 'date-range' },
{ labelKey: 'antflow.formula.numberOperation', value: 'number' },
{ labelKey: 'antflow.formula.dateOperation', value: 'date-diff' },
{ labelKey: 'antflow.formula.dateRangeOperation', value: 'date-range' },
];
export const formulaOperatorOptions = [
{ label: '加 +', value: '+' },
{ label: '减 -', value: '-' },
{ label: '乘 ×', value: '*' },
{ label: '除 ÷', value: '/' },
{ labelKey: 'antflow.formula.add', value: '+' },
{ labelKey: 'antflow.formula.subtract', value: '-' },
{ labelKey: 'antflow.formula.multiply', value: '*' },
{ labelKey: 'antflow.formula.divide', value: '/' },
];
export const formulaUnitOptions = [
{ label: '年', value: 'year' },
{ label: '月', value: 'month' },
{ label: '日', value: 'day' },
{ label: '时', value: 'hour' },
{ label: '分', value: 'minute' },
{ label: '秒', value: 'second' },
{ labelKey: 'antflow.formula.year', value: 'year' },
{ labelKey: 'antflow.formula.month', value: 'month' },
{ labelKey: 'antflow.formula.day', value: 'day' },
{ labelKey: 'antflow.formula.hour', value: 'hour' },
{ labelKey: 'antflow.formula.minute', value: 'minute' },
{ labelKey: 'antflow.formula.second', value: 'second' },
];
export function isFormulaMode(value: unknown): value is FormulaMode {

100
apps/vben5/packages/@abp/approval-flow/src/components/designer/model.ts

@ -8,10 +8,14 @@ import type {
ApproverRule,
} from '../../types/approval-flow';
export const defaultApproveRejectActions: ApprovalAction[] = [
{ key: 'Approve', label: '同意', effect: 'Approve' },
{ key: 'Reject', label: '拒绝', effect: 'Reject' },
];
import { $t } from '@vben/locales';
export function getDefaultApproveRejectActions(): ApprovalAction[] {
return [
{ key: 'Approve', label: $t('antflow.model.approve'), effect: 'Approve' },
{ key: 'Reject', label: $t('antflow.model.reject'), effect: 'Reject' },
];
}
let sequence = 0;
@ -31,7 +35,7 @@ export function createNode(
signMode: 'Any',
rules: kind === 'approval' || kind === 'cc' ? [createRule()] : [],
onEmpty: 'Skip',
actions: kind === 'approval' ? [...defaultApproveRejectActions] : [],
actions: kind === 'approval' ? [...getDefaultApproveRejectActions()] : [],
conditionExpression: null,
expression: null,
condition:
@ -46,8 +50,17 @@ export function createNode(
branches:
kind === 'condition'
? [
{ ...createBranch(0, '条件1'), nodes: [] },
{ ...createBranch(1, '其他条件'), nodes: [] },
{
...createBranch(
0,
$t('antflow.model.conditionName').replace('{0}', '1'),
),
nodes: [],
},
{
...createBranch(1, $t('antflow.model.otherCondition')),
nodes: [],
},
]
: undefined,
};
@ -56,7 +69,9 @@ export function createNode(
export function createBranch(index: number, name?: string): ApprovalFlowBranch {
return {
id: createId('branch'),
name: name ?? `条件${index + 1}`,
name:
name ??
$t('antflow.model.conditionName').replace('{0}', String(index + 1)),
fieldKey: null,
operator: '=',
compareValue: null,
@ -78,22 +93,22 @@ export function createRule(): ApproverRule {
export function nodeDefaultName(kind: ApprovalFlowNodeKind): string {
switch (kind) {
case 'approval': {
return '审批人';
return $t('antflow.model.reviewer');
}
case 'cc': {
return '抄送人';
return $t('antflow.model.cc');
}
case 'condition': {
return '条件分支';
return $t('antflow.model.conditionBranch');
}
case 'end': {
return '结束';
return $t('antflow.model.end');
}
case 'start': {
return '发起人';
return $t('antflow.model.start');
}
default: {
return '节点';
return $t('antflow.model.notSelected');
}
}
}
@ -103,7 +118,7 @@ export function createDefaultModel(): ApprovalFlowModel {
version: 1,
formDefinitionId: null,
nodes: [
{ ...createNode('start', '发起人'), rules: [] },
{ ...createNode('start', $t('antflow.model.start')), rules: [] },
createNode('approval'),
{ ...createNode('end'), rules: [] },
],
@ -134,17 +149,24 @@ function normalizeNode(node: ApprovalFlowNode): ApprovalFlowNode {
let branches = node.branches ?? [];
if (branches.length === 0) {
branches = [createBranch(0, '条件1')];
branches = [
createBranch(0, $t('antflow.model.conditionName').replace('{0}', '1')),
];
}
while (branches.length < 2) {
branches = [...branches, createBranch(branches.length, '其他条件')];
branches = [
...branches,
createBranch(branches.length, $t('antflow.model.otherCondition')),
];
}
normalized.branches = branches.map((branch, index) => {
const isDefault = index === branches.length - 1;
return {
...branch,
name: isDefault ? '其他条件' : `条件${index + 1}`,
name: isDefault
? $t('antflow.model.otherCondition')
: $t('antflow.model.conditionName').replace('{0}', String(index + 1)),
expression: isDefault
? null
: (branch.expression ?? (index === 0 ? condition.expression : null)),
@ -157,7 +179,7 @@ function normalizeNode(node: ApprovalFlowNode): ApprovalFlowNode {
const onlyNode = defaultBranch.nodes[0];
const isAutoDefault =
onlyNode?.kind === 'approval' &&
onlyNode.name === '审批人' &&
onlyNode.name === $t('antflow.model.reviewer') &&
onlyNode.rules.every(
(rule) =>
rule.kind === 'Participant' && rule.participants.length === 0,
@ -210,14 +232,18 @@ export function summarizeNode(node: ApprovalFlowNode): string {
node.signMode === 'All' &&
names.length > 1
) {
return `${names.length}人(${names.join(',')})会签`;
return $t('antflow.model.signSummary')
.replace('{0}', String(names.length))
.replace('{1}', names.join(','));
}
if (
node.kind === 'approval' &&
node.signMode === 'Sequential' &&
names.length > 1
) {
return `${names.length}人(${names.join('→')})依次审批`;
return $t('antflow.model.sequentialSignSummary')
.replace('{0}', String(names.length))
.replace('{1}', names.join('→'));
}
return names.join('、');
}
@ -228,13 +254,18 @@ export function summarizeNode(node: ApprovalFlowNode): string {
if (summaries.length > 0) {
return summaries.join(' / ');
}
return node.kind === 'cc' ? '待选择抄送人' : '待配置审批人';
return node.kind === 'cc'
? $t('antflow.model.pendingCc')
: $t('antflow.model.pendingApprover');
}
if (node.kind === 'condition') {
return node.condition?.expression
? `条件:${node.condition.expression}`
: '未设置条件';
? $t('antflow.model.conditionPrefix').replace(
'{0}',
node.condition.expression,
)
: $t('antflow.model.noCondition');
}
return '';
@ -243,33 +274,38 @@ export function summarizeNode(node: ApprovalFlowNode): string {
export function summarizeRule(rule: ApproverRule): string {
switch (rule.kind) {
case 'FormField': {
return `表单字段:${rule.formFieldKey ?? '-'}`;
return $t('antflow.model.formField').replace(
'{0}',
rule.formFieldKey ?? '-',
);
}
case 'Initiator': {
return '发起人';
return $t('antflow.model.initiator');
}
case 'InitiatorSelection': {
return '发起人自选';
return $t('antflow.model.selfSelect');
}
case 'OrganizationUnit': {
return '部门成员';
return $t('antflow.model.departmentMember');
}
case 'Participant': {
const names = rule.participants
.map((participant) => participant.displayName ?? participant.id)
.filter(Boolean);
return names.length > 0 ? names.join(',') : '未选择人员';
return names.length > 0 ? names.join(',') : $t('antflow.model.noPerson');
}
case 'Role': {
const roleNames = rule.participants
.map((participant) => participant.displayName ?? participant.id)
.filter(Boolean);
return roleNames.length > 0
? `角色:${roleNames.join(',')}`
: '未选择角色';
? $t('antflow.model.rolePrefix').replace('{0}', roleNames.join(','))
: $t('antflow.model.noRole');
}
case 'Supervisor': {
return rule.supervisorLevel === 'TopMost' ? '最高层级主管' : '部门主管';
return rule.supervisorLevel === 'TopMost'
? $t('antflow.model.topMostSupervisor')
: $t('antflow.model.supervisor');
}
default: {
return '';

246
apps/vben5/packages/@abp/approval-flow/src/components/form-definitions/FormDefinitionTable.vue

@ -10,6 +10,8 @@ import type {
import { reactive, ref } from 'vue';
import { $t } from '@vben/locales';
import { useVbenVxeGrid } from '@abp/ui';
import {
Button,
@ -31,23 +33,65 @@ import { VxeGrid } from 'vxe-table';
import { useApprovalFormsApi } from '../../api/useApprovalFormsApi';
const formFieldTypes = [
{ label: '单行文本', value: 'single-line-text' },
{ label: '多行文本', value: 'multi-line-text' },
{ label: '数字', value: 'number' },
{ label: '日期', value: 'date' },
{ label: '日期区间', value: 'date-range' },
{ label: '下拉选择', value: 'select' },
{ label: '单选', value: 'radio' },
{ label: '多选', value: 'multiple-select' },
{ label: '开关', value: 'switch' },
{ label: '附件', value: 'attachment' },
{ label: '说明', value: 'description' },
{
label: $t('ElsaNextApprovalFlow.FormDefinitions:FieldType:SingleLineText'),
value: 'single-line-text',
},
{
label: $t('ElsaNextApprovalFlow.FormDefinitions:FieldType:MultiLineText'),
value: 'multi-line-text',
},
{
label: $t('ElsaNextApprovalFlow.FormDefinitions:FieldType:Number'),
value: 'number',
},
{
label: $t('ElsaNextApprovalFlow.FormDefinitions:FieldType:Date'),
value: 'date',
},
{
label: $t('ElsaNextApprovalFlow.FormDefinitions:FieldType:DateRange'),
value: 'date-range',
},
{
label: $t('ElsaNextApprovalFlow.FormDefinitions:FieldType:Select'),
value: 'select',
},
{
label: $t('ElsaNextApprovalFlow.FormDefinitions:FieldType:Radio'),
value: 'radio',
},
{
label: $t('ElsaNextApprovalFlow.FormDefinitions:FieldType:MultipleSelect'),
value: 'multiple-select',
},
{
label: $t('ElsaNextApprovalFlow.FormDefinitions:FieldType:Switch'),
value: 'switch',
},
{
label: $t('ElsaNextApprovalFlow.FormDefinitions:FieldType:Attachment'),
value: 'attachment',
},
{
label: $t('ElsaNextApprovalFlow.FormDefinitions:FieldType:Description'),
value: 'description',
},
] as const;
const formFieldPermissions = [
{ label: '可编辑', value: 'E' },
{ label: '只读', value: 'R' },
{ label: '隐藏', value: 'H' },
{
label: $t('ElsaNextApprovalFlow.FormDefinitions:FieldPermission:Editable'),
value: 'E',
},
{
label: $t('ElsaNextApprovalFlow.FormDefinitions:FieldPermission:ReadOnly'),
value: 'R',
},
{
label: $t('ElsaNextApprovalFlow.FormDefinitions:FieldPermission:Hidden'),
value: 'H',
},
] as const;
const formsApi = useApprovalFormsApi();
@ -80,15 +124,32 @@ const fieldForm = reactive({
});
const columns: VxeGridProps<FormDefinitionDto>['columns'] = [
{ field: 'name', minWidth: 220, title: '表单名称' },
{ field: 'code', minWidth: 180, title: '编码' },
{ field: 'version', title: '版本', width: 80 },
{ field: 'status', slots: { default: 'status' }, title: '状态', width: 100 },
{
field: 'name',
minWidth: 220,
title: $t('ElsaNextApprovalFlow.FormDefinitions:Name'),
},
{
field: 'code',
minWidth: 180,
title: $t('ElsaNextApprovalFlow.FormDefinitions:Code'),
},
{
field: 'version',
title: $t('ElsaNextApprovalFlow.FormDefinitions:Version'),
width: 80,
},
{
field: 'status',
slots: { default: 'status' },
title: $t('ElsaNextApprovalFlow.FormDefinitions:Status'),
width: 100,
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
title: $t('ElsaNextApprovalFlow.FormDefinitions:Actions'),
width: 260,
},
];
@ -100,7 +161,7 @@ const formOptions: VbenFormProps = {
component: 'Input',
fieldName: 'filter',
formItemClass: 'col-span-2 items-baseline',
label: '搜索',
label: $t('ElsaNextApprovalFlow.FormDefinitions:Search'),
},
],
showCollapseButton: true,
@ -148,26 +209,39 @@ const [Grid, gridApi] = useVbenVxeGrid({
});
const fieldColumns: VxeGridProps<FormFieldDto>['columns'] = [
{ field: 'label', minWidth: 180, title: '显示名' },
{ field: 'key', minWidth: 160, title: '字段键' },
{ field: 'type', slots: { default: 'type' }, title: '类型', width: 120 },
{
field: 'label',
minWidth: 180,
title: $t('ElsaNextApprovalFlow.FormDefinitions:DisplayName'),
},
{
field: 'key',
minWidth: 160,
title: $t('ElsaNextApprovalFlow.FormDefinitions:FieldKey'),
},
{
field: 'type',
slots: { default: 'type' },
title: $t('ElsaNextApprovalFlow.FormDefinitions:Type'),
width: 120,
},
{
field: 'permission',
slots: { default: 'permission' },
title: '权限',
title: $t('ElsaNextApprovalFlow.FormDefinitions:Permission'),
width: 90,
},
{
field: 'required',
slots: { default: 'required' },
title: '必填',
title: $t('ElsaNextApprovalFlow.FormDefinitions:Required'),
width: 80,
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
title: $t('ElsaNextApprovalFlow.FormDefinitions:Actions'),
width: 150,
},
];
@ -195,7 +269,7 @@ function openEdit(target: FormDefinitionDto) {
async function submitEdit() {
if (!form.name || !form.code) {
message.warning('请填写表单名称和编码');
message.warning($t('ElsaNextApprovalFlow.FormDefinitions:NameRequired'));
return;
}
@ -216,7 +290,7 @@ async function submitEdit() {
editOpen.value = false;
await load();
} catch {
message.error('保存失败');
message.error($t('ElsaNextApprovalFlow.FormDefinitions:SaveFailed'));
} finally {
saving.value = false;
}
@ -225,21 +299,24 @@ async function submitEdit() {
async function publish(target: FormDefinitionDto) {
try {
await formsApi.publishApi(target.id);
message.success('发布成功');
message.success($t('ElsaNextApprovalFlow.FormDefinitions:PublishSuccess'));
await load();
} catch {
message.error('发布失败');
message.error($t('ElsaNextApprovalFlow.FormDefinitions:PublishFailed'));
}
}
async function remove(target: FormDefinitionDto) {
Modal.confirm({
content: `确定删除表单「${target.name}」吗?`,
content: $t('ElsaNextApprovalFlow.FormDefinitions:DeleteConfirm').replace(
'{0}',
target.name,
),
onOk: async () => {
await formsApi.deleteApi(target.id);
await load();
},
title: '删除确认',
title: $t('ElsaNextApprovalFlow.FormDefinitions:DeleteTitle'),
});
}
@ -285,7 +362,7 @@ async function submitField() {
return;
}
if (!fieldForm.key || !fieldForm.label) {
message.warning('请填写字段键和显示名');
message.warning($t('ElsaNextApprovalFlow.FormDefinitions:FieldRequired'));
return;
}
@ -322,7 +399,7 @@ async function submitField() {
fieldOpen.value = false;
await load();
} catch {
message.error('字段保存失败');
message.error($t('ElsaNextApprovalFlow.FormDefinitions:FieldSaveFailed'));
} finally {
saving.value = false;
}
@ -341,7 +418,7 @@ async function removeField(field: FormFieldDto) {
fields.value = detail.fields ?? [];
await load();
} catch {
message.error('字段删除失败');
message.error($t('ElsaNextApprovalFlow.FormDefinitions:FieldDeleteFailed'));
}
}
@ -358,16 +435,21 @@ function permissionLabel(permission: string): string {
</script>
<template>
<Card size="small" title="表单管理">
<Grid table-title="表单定义">
<Card
size="small"
:title="$t('ElsaNextApprovalFlow.FormDefinitions:ManageTitle')"
>
<Grid :table-title="$t('ElsaNextApprovalFlow.FormDefinitions:Title')">
<template #toolbar-tools>
<Button type="primary" @click="openCreate">新建表单</Button>
<Button type="primary" @click="openCreate">
{{ $t('ElsaNextApprovalFlow.FormDefinitions:NewForm') }}
</Button>
</template>
<template #status="{ row }">
<Tag v-if="(row as FormDefinitionDto).isPublished" color="green">
已发布
{{ $t('ElsaNextApprovalFlow.FormDefinitions:Published') }}
</Tag>
<Tag v-else>草稿</Tag>
<Tag v-else>{{ $t('ElsaNextApprovalFlow.FormDefinitions:Draft') }}</Tag>
</template>
<template #action="{ row }">
<Space>
@ -376,21 +458,21 @@ function permissionLabel(permission: string): string {
type="link"
@click="openFields(row as FormDefinitionDto)"
>
字段
{{ $t('ElsaNextApprovalFlow.FormDefinitions:Field') }}
</Button>
<Button
size="small"
type="link"
@click="publish(row as FormDefinitionDto)"
>
发布
{{ $t('ElsaNextApprovalFlow.FormDefinitions:Publish') }}
</Button>
<Button
size="small"
type="link"
@click="openEdit(row as FormDefinitionDto)"
>
编辑
{{ $t('ElsaNextApprovalFlow.FormDefinitions:Edit') }}
</Button>
<Button
danger
@ -398,7 +480,7 @@ function permissionLabel(permission: string): string {
type="link"
@click="remove(row as FormDefinitionDto)"
>
删除
{{ $t('ElsaNextApprovalFlow.FormDefinitions:Delete') }}
</Button>
</Space>
</template>
@ -407,20 +489,35 @@ function permissionLabel(permission: string): string {
<Modal
v-model:open="editOpen"
:confirm-loading="saving"
:title="editTarget ? '编辑表单' : '新建表单'"
:title="
editTarget
? $t('ElsaNextApprovalFlow.FormDefinitions:EditForm')
: $t('ElsaNextApprovalFlow.FormDefinitions:CreateForm')
"
@ok="submitEdit"
>
<Form layout="vertical">
<FormItem label="表单名称" required>
<FormItem
:label="$t('ElsaNextApprovalFlow.FormDefinitions:FormName')"
required
>
<Input v-model:value="form.name" />
</FormItem>
<FormItem label="表单编码" required>
<FormItem
:label="$t('ElsaNextApprovalFlow.FormDefinitions:FormCode')"
required
>
<Input v-model:value="form.code" :disabled="!!editTarget" />
</FormItem>
<FormItem v-if="!editTarget" label="版本">
<FormItem
v-if="!editTarget"
:label="$t('ElsaNextApprovalFlow.FormDefinitions:Version')"
>
<InputNumber v-model:value="form.version" :min="1" />
</FormItem>
<FormItem label="描述">
<FormItem
:label="$t('ElsaNextApprovalFlow.FormDefinitions:Description')"
>
<Input.TextArea v-model:value="form.description" :rows="2" />
</FormItem>
</Form>
@ -428,11 +525,18 @@ function permissionLabel(permission: string): string {
<Drawer
v-model:open="fieldsOpen"
:title="`字段管理 - ${fieldsTarget?.name ?? ''}`"
:title="
$t('ElsaNextApprovalFlow.FormDefinitions:FieldManage').replace(
'{0}',
fieldsTarget?.name ?? '',
)
"
:width="720"
>
<template #extra>
<Button type="primary" @click="openAddField">添加字段</Button>
<Button type="primary" @click="openAddField">
{{ $t('ElsaNextApprovalFlow.FormDefinitions:AddField') }}
</Button>
</template>
<VxeGrid
@ -449,7 +553,9 @@ function permissionLabel(permission: string): string {
{{ permissionLabel((row as FormFieldDto).permission) }}
</template>
<template #required="{ row }">
<Tag v-if="(row as FormFieldDto).isRequired" color="red">必填</Tag>
<Tag v-if="(row as FormFieldDto).isRequired" color="red">
{{ $t('ElsaNextApprovalFlow.FormDefinitions:Required') }}
</Tag>
</template>
<template #action="{ row }">
<Space>
@ -458,7 +564,7 @@ function permissionLabel(permission: string): string {
type="link"
@click="openEditField(row as FormFieldDto)"
>
编辑
{{ $t('ElsaNextApprovalFlow.FormDefinitions:Edit') }}
</Button>
<Button
danger
@ -466,7 +572,7 @@ function permissionLabel(permission: string): string {
type="link"
@click="removeField(row as FormFieldDto)"
>
删除
{{ $t('ElsaNextApprovalFlow.FormDefinitions:Delete') }}
</Button>
</Space>
</template>
@ -476,39 +582,53 @@ function permissionLabel(permission: string): string {
<Modal
v-model:open="fieldOpen"
:confirm-loading="saving"
:title="fieldTarget ? '编辑字段' : '添加字段'"
:title="
fieldTarget
? $t('ElsaNextApprovalFlow.FormDefinitions:EditField')
: $t('ElsaNextApprovalFlow.FormDefinitions:AddField')
"
@ok="submitField"
>
<Form layout="vertical">
<FormItem label="字段键" required>
<FormItem
:label="$t('ElsaNextApprovalFlow.FormDefinitions:FieldKey')"
required
>
<Input v-model:value="fieldForm.key" :disabled="!!fieldTarget" />
</FormItem>
<FormItem label="显示名" required>
<FormItem
:label="$t('ElsaNextApprovalFlow.FormDefinitions:DisplayName')"
required
>
<Input v-model:value="fieldForm.label" />
</FormItem>
<FormItem label="字段类型">
<FormItem :label="$t('ElsaNextApprovalFlow.FormDefinitions:FieldType')">
<Select
v-model:value="fieldForm.type"
:options="formFieldTypes as any"
:disabled="!!fieldTarget"
/>
</FormItem>
<FormItem label="字段权限">
<FormItem
:label="$t('ElsaNextApprovalFlow.FormDefinitions:FieldPermission')"
>
<Select
v-model:value="fieldForm.permission"
:options="formFieldPermissions as any"
/>
</FormItem>
<FormItem label="排序">
<FormItem :label="$t('ElsaNextApprovalFlow.FormDefinitions:Sort')">
<InputNumber v-model:value="fieldForm.order" :min="0" />
</FormItem>
<FormItem label="必填">
<FormItem :label="$t('ElsaNextApprovalFlow.FormDefinitions:Required')">
<Switch v-model:checked="fieldForm.isRequired" />
</FormItem>
<FormItem label="说明">
<FormItem :label="$t('ElsaNextApprovalFlow.FormDefinitions:Hint')">
<Input v-model:value="fieldForm.hint" />
</FormItem>
<FormItem label="选项 JSON">
<FormItem
:label="$t('ElsaNextApprovalFlow.FormDefinitions:OptionsJson')"
>
<Input.TextArea v-model:value="fieldForm.optionsJson" :rows="2" />
</FormItem>
</Form>

5
apps/vben5/packages/@abp/approval-flow/src/components/instances/ApprovalFlowViewer.vue

@ -137,7 +137,10 @@ const statusMap = computed<Record<string, string>>(() => {
<template>
<div class="flow-viewer">
<Empty v-if="!model" description="没有可展示的流程设计" />
<Empty
v-if="!model"
:description="$t('ElsaNextApprovalFlow.ApprovalFlow:Viewer:Empty')"
/>
<FlowDesign v-else :status-map="statusMap" :value="antFlowRoot" readonly />
</div>
</template>

163
apps/vben5/packages/@abp/approval-flow/src/components/instances/ApprovalInstanceDetailModal.vue

@ -61,11 +61,11 @@ const participantId = ref<string | undefined>(undefined);
const participants = ref<Array<{ label: string; value: string }>>([]);
const actionLabels: Record<string, string> = {
AddApproval: '加批',
Approve: '同意',
Reject: '不同意',
Return: '退回',
Transfer: '转办',
AddApproval: $t('ElsaNextApprovalFlow.ApprovalFlow:Action:AddApproval'),
Approve: $t('ElsaNextApprovalFlow.ApprovalFlow:Action:Approve'),
Reject: $t('ElsaNextApprovalFlow.ApprovalFlow:Action:Reject'),
Return: $t('ElsaNextApprovalFlow.ApprovalFlow:Action:Return'),
Transfer: $t('ElsaNextApprovalFlow.ApprovalFlow:Action:Transfer'),
};
const actionOptions = computed(() => {
@ -121,7 +121,9 @@ watch(
await loadParticipants();
}
} catch {
message.error('审批详情加载失败');
message.error(
$t('ElsaNextApprovalFlow.ApprovalFlow:Instance:LoadFailed'),
);
} finally {
loading.value = false;
}
@ -176,7 +178,9 @@ async function submit() {
}
if (needsParticipant.value && !participantId.value) {
message.warning(
actionKey.value === 'Transfer' ? '请选择转办人' : '请选择加批人员',
actionKey.value === 'Transfer'
? $t('ElsaNextApprovalFlow.ApprovalFlow:Instance:SelectTransferee')
: $t('ElsaNextApprovalFlow.ApprovalFlow:Instance:SelectAddApprover'),
);
return;
}
@ -223,11 +227,13 @@ async function submit() {
}
}
message.success('审批已提交');
message.success($t('ElsaNextApprovalFlow.ApprovalFlow:Instance:Submitted'));
emit('decided');
emit('update:open', false);
} catch {
message.error('审批提交失败');
message.error(
$t('ElsaNextApprovalFlow.ApprovalFlow:Instance:SubmitFailed'),
);
} finally {
submitting.value = false;
}
@ -271,22 +277,22 @@ function statusColor(status?: string): string {
function statusText(status?: string): string {
switch (status) {
case 'Approved': {
return '已通过';
return $t('ElsaNextApprovalFlow.ApprovalFlow:Status:Approved');
}
case 'Cancelled': {
return '已取消';
return $t('ElsaNextApprovalFlow.ApprovalFlow:Status:Cancelled');
}
case 'Rejected': {
return '已拒绝';
return $t('ElsaNextApprovalFlow.ApprovalFlow:Status:Rejected');
}
case 'Returned': {
return '已退回';
return $t('ElsaNextApprovalFlow.ApprovalFlow:Status:Returned');
}
case 'Running': {
return '审批中';
return $t('ElsaNextApprovalFlow.ApprovalFlow:Status:Running');
}
case 'Withdrawn': {
return '已撤回';
return $t('ElsaNextApprovalFlow.ApprovalFlow:Status:Withdrawn');
}
default: {
return status ?? '-';
@ -325,15 +331,23 @@ function format(value?: null | string): string {
:footer="null"
:open="open"
:width="1120"
title="审批详情"
:title="$t('ElsaNextApprovalFlow.ApprovalFlow:Instance:Title')"
@cancel="emit('update:open', false)"
>
<Spin :spinning="loading">
<Tabs v-if="detail" v-model:active-key="activeTab" size="small">
<Tabs.TabPane v-if="task" key="action" tab="审批">
<Tabs.TabPane
v-if="task"
key="action"
:tab="$t('ElsaNextApprovalFlow.ApprovalFlow:Instance:Approval')"
>
<div class="approval-layout">
<section class="form-side">
<div class="side-title">流程表单</div>
<div class="side-title">
{{
$t('ElsaNextApprovalFlow.ApprovalFlow:Instance:ProcessForm')
}}
</div>
<Descriptions :column="1" bordered size="small">
<DescriptionsItem
v-for="field in formFields"
@ -344,12 +358,19 @@ function format(value?: null | string): string {
</DescriptionsItem>
</Descriptions>
<pre v-if="formFields.length === 0" class="form-json">{{
detail.instance.formDataJson || '暂无表单内容'
detail.instance.formDataJson ||
$t('ElsaNextApprovalFlow.ApprovalFlow:Instance:NoFormContent')
}}</pre>
</section>
<section class="action-side">
<div class="side-title">审批操作</div>
<div class="side-title">
{{
$t(
'ElsaNextApprovalFlow.ApprovalFlow:Instance:ApprovalAction',
)
}}
</div>
<div class="action-block">
<RadioGroup v-model:value="actionKey" class="action-radio">
@ -368,7 +389,13 @@ function format(value?: null | string): string {
v-model:value="participantId"
:options="participants"
:placeholder="
actionKey === 'Transfer' ? '请选择转办人' : '请选择加批人员'
actionKey === 'Transfer'
? $t(
'ElsaNextApprovalFlow.ApprovalFlow:Instance:SelectTransferee',
)
: $t(
'ElsaNextApprovalFlow.ApprovalFlow:Instance:SelectAddApprover',
)
"
show-search
style="width: 100%"
@ -379,15 +406,21 @@ function format(value?: null | string): string {
<Input.TextArea
v-model:value="comment"
:rows="5"
placeholder="审批意见"
:placeholder="
$t(
'ElsaNextApprovalFlow.ApprovalFlow:Instance:CommentPlaceholder',
)
"
/>
</div>
<div class="action-footer">
<Space>
<Button :disabled="submitting" @click="cancel">取消</Button>
<Button :disabled="submitting" @click="cancel">
{{ $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Cancel') }}
</Button>
<Button :loading="submitting" type="primary" @click="submit">
提交
{{ $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Submit') }}
</Button>
</Space>
</div>
@ -395,7 +428,10 @@ function format(value?: null | string): string {
</div>
</Tabs.TabPane>
<Tabs.TabPane key="form" tab="表单">
<Tabs.TabPane
key="form"
:tab="$t('ElsaNextApprovalFlow.ApprovalFlow:Instance:Form')"
>
<section class="form-side">
<Descriptions :column="1" bordered size="small">
<DescriptionsItem
@ -406,7 +442,14 @@ function format(value?: null | string): string {
{{ fieldValue(field) }}
</DescriptionsItem>
</Descriptions>
<Empty v-if="formFields.length === 0" description="暂无表单定义" />
<Empty
v-if="formFields.length === 0"
:description="
$t(
'ElsaNextApprovalFlow.ApprovalFlow:Instance:NoFormDefinition',
)
"
/>
<pre
v-if="formFields.length === 0 && detail.instance.formDataJson"
class="form-json"
@ -414,7 +457,10 @@ function format(value?: null | string): string {
</section>
</Tabs.TabPane>
<Tabs.TabPane key="flow" tab="流程图">
<Tabs.TabPane
key="flow"
:tab="$t('ElsaNextApprovalFlow.ApprovalFlow:Instance:Flow')"
>
<ApprovalFlowViewer
:flow-json="detail.flowDefinitionJson"
:instance-status="detail.instance.status"
@ -423,32 +469,52 @@ function format(value?: null | string): string {
/>
</Tabs.TabPane>
<Tabs.TabPane key="detail" tab="详情">
<Tabs.TabPane
key="detail"
:tab="$t('ElsaNextApprovalFlow.ApprovalFlow:Instance:Details')"
>
<Descriptions bordered :column="2" size="small">
<DescriptionsItem label="标题">
<DescriptionsItem
:label="$t('ElsaNextApprovalFlow.ApprovalFlow:Common:Title')"
>
{{ detail.instance.title }}
</DescriptionsItem>
<DescriptionsItem label="模板">
<DescriptionsItem
:label="$t('ElsaNextApprovalFlow.ApprovalFlow:Common:Template')"
>
{{ detail.instance.templateName }}
</DescriptionsItem>
<DescriptionsItem label="状态">
<DescriptionsItem
:label="$t('ElsaNextApprovalFlow.ApprovalFlow:Common:Status')"
>
<Tag :color="statusColor(detail.instance.status)">
{{ statusText(detail.instance.status) }}
</Tag>
</DescriptionsItem>
<DescriptionsItem label="发起人">
<DescriptionsItem
:label="$t('ElsaNextApprovalFlow.ApprovalFlow:Common:Initiator')"
>
{{ detail.instance.initiatorDisplayName || '-' }}
</DescriptionsItem>
<DescriptionsItem label="发起时间">
<DescriptionsItem
:label="$t('ElsaNextApprovalFlow.ApprovalFlow:Common:StartedAt')"
>
{{ format(detail.instance.startedAt) }}
</DescriptionsItem>
<DescriptionsItem label="完成时间">
<DescriptionsItem
:label="
$t('ElsaNextApprovalFlow.ApprovalFlow:Instance:FinishedAt')
"
>
{{ format(detail.instance.finishedAt) }}
</DescriptionsItem>
</Descriptions>
</Tabs.TabPane>
<Tabs.TabPane key="records" tab="执行记录">
<Tabs.TabPane
key="records"
:tab="$t('ElsaNextApprovalFlow.ApprovalFlow:Instance:Records')"
>
<Timeline>
<Timeline.Item
v-for="record in detail.records"
@ -460,7 +526,10 @@ function format(value?: null | string): string {
actionText(record.actionKey)
}}</span>
<span class="ml-2 text-gray-500">
{{ record.actorDisplayName || '系统' }}
{{
record.actorDisplayName ||
$t('ElsaNextApprovalFlow.ApprovalFlow:Common:System')
}}
</span>
<span class="ml-2 text-xs text-gray-400">
{{ format(record.occurredAt) }}
@ -471,28 +540,40 @@ function format(value?: null | string): string {
class="mt-1 text-xs text-gray-500"
>
<span v-if="record.firstViewedAt">
首次查看:{{ format(record.firstViewedAt) }}
{{
$t(
'ElsaNextApprovalFlow.ApprovalFlow:Instance:FirstViewed',
)
}}:{{ format(record.firstViewedAt) }}
</span>
<span v-if="record.completedAt" class="ml-3">
办理时间:{{ format(record.completedAt) }}
{{
$t('ElsaNextApprovalFlow.ApprovalFlow:Instance:Completed')
}}:{{ format(record.completedAt) }}
</span>
<span
v-if="record.firstViewedAt && record.completedAt"
class="ml-3"
>
办理时长:{{
{{
$t('ElsaNextApprovalFlow.ApprovalFlow:Instance:Duration')
}}:{{
formatDuration(record.firstViewedAt, record.completedAt)
}}
</span>
</div>
<div v-if="record.comment" class="mt-1 text-xs text-gray-500">
审批意见:{{ record.comment }}
{{
$t('ElsaNextApprovalFlow.ApprovalFlow:Instance:Comment')
}}:{{ record.comment }}
</div>
</Timeline.Item>
</Timeline>
<Empty
v-if="detail.records.length === 0"
description="暂无执行记录"
:description="
$t('ElsaNextApprovalFlow.ApprovalFlow:Instance:NoRecords')
"
/>
</Tabs.TabPane>
</Tabs>

38
apps/vben5/packages/@abp/approval-flow/src/components/instances/CarbonCopyApprovalTable.vue

@ -7,6 +7,8 @@ import type { CarbonCopyDto } from '../../types/carbon-copies';
import { ref } from 'vue';
import { $t } from '@vben/locales';
import { useVbenVxeGrid } from '@abp/ui';
import { Button, Tag } from 'ant-design-vue';
@ -26,7 +28,7 @@ const formOptions: VbenFormProps = {
component: 'Input',
fieldName: 'filter',
formItemClass: 'col-span-2 items-baseline',
label: '搜索',
label: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Search'),
},
],
showCollapseButton: true,
@ -35,26 +37,38 @@ const formOptions: VbenFormProps = {
const gridOptions: VxeGridProps<CarbonCopyDto> = {
columns: [
{ field: 'title', minWidth: 240, title: '标题' },
{ field: 'summary', minWidth: 200, title: '摘要' },
{ field: 'senderDisplayName', minWidth: 140, title: '发起人' },
{
field: 'title',
minWidth: 240,
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Title'),
},
{
field: 'summary',
minWidth: 200,
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Summary'),
},
{
field: 'senderDisplayName',
minWidth: 140,
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Initiator'),
},
{
field: 'notifiedAt',
slots: { default: 'notifiedAt' },
title: '抄送时间',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:CarbonCopy:CopiedAt'),
width: 180,
},
{
field: 'isRead',
slots: { default: 'readState' },
title: '状态',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Status'),
width: 90,
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Actions'),
width: 100,
},
],
@ -107,13 +121,17 @@ async function openCarbonCopy(item: CarbonCopyDto) {
</script>
<template>
<Grid table-title="抄送我的">
<Grid :table-title="$t('ElsaNextApprovalFlow.ApprovalFlow:CarbonCopy:Title')">
<template #notifiedAt="{ row }">
{{ formatDateTime(row.notifiedAt) }}
</template>
<template #readState="{ row }">
<Tag :color="row.isRead ? 'default' : 'warning'">
{{ row.isRead ? '已读' : '未读' }}
{{
row.isRead
? $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Read')
: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Unread')
}}
</Tag>
</template>
<template #action="{ row }">
@ -122,7 +140,7 @@ async function openCarbonCopy(item: CarbonCopyDto) {
type="link"
@click="openCarbonCopy(row as CarbonCopyDto)"
>
查看
{{ $t('ElsaNextApprovalFlow.ApprovalFlow:Common:View') }}
</Button>
</template>
</Grid>

44
apps/vben5/packages/@abp/approval-flow/src/components/instances/DoneApprovalTable.vue

@ -7,6 +7,8 @@ import type { DoneDto } from '../../types/done';
import { ref } from 'vue';
import { $t } from '@vben/locales';
import { useVbenVxeGrid } from '@abp/ui';
import { Button } from 'ant-design-vue';
@ -30,7 +32,7 @@ const formOptions: VbenFormProps = {
component: 'Input',
fieldName: 'filter',
formItemClass: 'col-span-2 items-baseline',
label: '搜索',
label: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Search'),
},
],
showCollapseButton: true,
@ -39,45 +41,61 @@ const formOptions: VbenFormProps = {
const gridOptions: VxeGridProps<DoneDto> = {
columns: [
{ field: 'instanceTitle', minWidth: 240, title: '审批标题' },
{ field: 'nodeName', minWidth: 160, title: '节点' },
{
field: 'instanceTitle',
minWidth: 240,
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Pending:InstanceTitle'),
},
{
field: 'nodeName',
minWidth: 160,
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Pending:Node'),
},
{
field: 'actionKey',
slots: { default: 'actionKey' },
title: '动作',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Action'),
width: 120,
},
{ field: 'actorDisplayName', title: '处理人', width: 120 },
{ field: 'comment', minWidth: 180, title: '审批意见' },
{
field: 'actorDisplayName',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Actor'),
width: 120,
},
{
field: 'comment',
minWidth: 180,
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Comment'),
},
{
field: 'firstViewedAt',
slots: { default: 'firstViewedAt' },
title: '首次查看时间',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:FirstViewedAt'),
width: 180,
},
{
field: 'completedAt',
slots: { default: 'completedAt' },
title: '办理时间',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:CompletedAt'),
width: 180,
},
{
field: 'decidedAt',
slots: { default: 'decidedAt' },
title: '处理时间',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Done:HandleTime'),
width: 180,
},
{
field: 'duration',
slots: { default: 'duration' },
title: '办理时长',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Duration'),
width: 160,
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Actions'),
width: 100,
},
],
@ -119,7 +137,7 @@ function openDetail(row: DoneDto) {
</script>
<template>
<Grid table-title="已办审批">
<Grid :table-title="$t('ElsaNextApprovalFlow.ApprovalFlow:Done:Title')">
<template #actionKey="{ row }">{{ actionText(row.actionKey) }}</template>
<template #firstViewedAt="{ row }">
{{ formatDateTime(row.firstViewedAt) }}
@ -135,7 +153,7 @@ function openDetail(row: DoneDto) {
</template>
<template #action="{ row }">
<Button size="small" type="link" @click="openDetail(row as DoneDto)">
查看
{{ $t('ElsaNextApprovalFlow.ApprovalFlow:Common:View') }}
</Button>
</template>
</Grid>

72
apps/vben5/packages/@abp/approval-flow/src/components/instances/InitiatedApprovalTable.vue

@ -11,6 +11,8 @@ import type {
import { ref } from 'vue';
import { $t } from '@vben/locales';
import { useVbenVxeGrid } from '@abp/ui';
import { Button, message, Modal, Space, Tag } from 'ant-design-vue';
import { VxeGrid } from 'vxe-table';
@ -45,7 +47,7 @@ const formOptions: VbenFormProps = {
component: 'Input',
fieldName: 'filter',
formItemClass: 'col-span-2 items-baseline',
label: '搜索',
label: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Search'),
},
],
showCollapseButton: true,
@ -54,25 +56,33 @@ const formOptions: VbenFormProps = {
const gridOptions: VxeGridProps<ApprovalInstanceDto> = {
columns: [
{ field: 'title', minWidth: 220, title: '标题' },
{ field: 'templateName', minWidth: 160, title: '模板' },
{
field: 'title',
minWidth: 220,
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Title'),
},
{
field: 'templateName',
minWidth: 160,
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Template'),
},
{
field: 'status',
slots: { default: 'status' },
title: '状态',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Status'),
width: 110,
},
{
field: 'startedAt',
slots: { default: 'startedAt' },
title: '发起时间',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:StartedAt'),
width: 180,
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Actions'),
width: 220,
},
],
@ -112,35 +122,43 @@ const recordColumns: VxeGridProps<ApprovalRecordDto>['columns'] = [
{
field: 'occurredAt',
slots: { default: 'occurredAt' },
title: '时间',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Time'),
width: 180,
},
{
field: 'actionKey',
slots: { default: 'actionKey' },
title: '动作',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Action'),
width: 120,
},
{
field: 'actorDisplayName',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Actor'),
width: 120,
},
{ field: 'actorDisplayName', title: '处理人', width: 120 },
{
field: 'firstViewedAt',
slots: { default: 'firstViewedAt' },
title: '首次查看时间',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:FirstViewedAt'),
width: 180,
},
{
field: 'completedAt',
slots: { default: 'completedAt' },
title: '办理时间',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:CompletedAt'),
width: 180,
},
{
field: 'duration',
slots: { default: 'duration' },
title: '办理时长',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Duration'),
width: 160,
},
{ field: 'comment', title: '审批意见', width: 200 },
{
field: 'comment',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Comment'),
width: 200,
},
];
function openDetail(instance: ApprovalInstanceDto) {
@ -165,19 +183,23 @@ async function openRestart(instance: ApprovalInstanceDto) {
restartData.value = parseFormData(instance.formDataJson);
restartOpen.value = true;
} catch {
message.error('审批模板加载失败');
message.error(
$t('ElsaNextApprovalFlow.ApprovalFlow:Initiated:TemplateLoadFailed'),
);
}
}
function withdraw(instance: ApprovalInstanceDto) {
Modal.confirm({
content: '撤销后该审批流程将终止,确定继续吗?',
content: $t('ElsaNextApprovalFlow.ApprovalFlow:Initiated:WithdrawConfirm'),
onOk: async () => {
await instancesApi.withdrawApi(instance.id);
message.success('审批已撤销');
message.success(
$t('ElsaNextApprovalFlow.ApprovalFlow:Initiated:Withdrawn'),
);
await gridApi.query();
},
title: '撤销审批',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Initiated:WithdrawTitle'),
});
}
@ -191,13 +213,15 @@ async function openRecords(instance: ApprovalInstanceDto) {
records.value = result?.items ?? [];
recordsOpen.value = true;
} catch {
message.error('审批记录加载失败');
message.error(
$t('ElsaNextApprovalFlow.ApprovalFlow:Initiated:RecordsLoadFailed'),
);
}
}
</script>
<template>
<Grid table-title="我发起的">
<Grid :table-title="$t('ElsaNextApprovalFlow.ApprovalFlow:Initiated:Title')">
<template #status="{ row }">
<Tag :color="statusColor(row.status)">{{ statusText(row.status) }}</Tag>
</template>
@ -211,14 +235,14 @@ async function openRecords(instance: ApprovalInstanceDto) {
type="link"
@click="openDetail(row as ApprovalInstanceDto)"
>
详情
{{ $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Detail') }}
</Button>
<Button
size="small"
type="link"
@click="openRecords(row as ApprovalInstanceDto)"
>
审批记录
{{ $t('ElsaNextApprovalFlow.ApprovalFlow:Initiated:Records') }}
</Button>
<Button
v-if="row.status === 'Running'"
@ -227,7 +251,7 @@ async function openRecords(instance: ApprovalInstanceDto) {
type="link"
@click="withdraw(row as ApprovalInstanceDto)"
>
撤销
{{ $t('ElsaNextApprovalFlow.ApprovalFlow:Initiated:Withdraw') }}
</Button>
<Button
v-if="row.status === 'Returned'"
@ -235,7 +259,7 @@ async function openRecords(instance: ApprovalInstanceDto) {
type="link"
@click="openRestart(row as ApprovalInstanceDto)"
>
重新发起
{{ $t('ElsaNextApprovalFlow.ApprovalFlow:Initiated:Restart') }}
</Button>
</Space>
</template>
@ -244,7 +268,7 @@ async function openRecords(instance: ApprovalInstanceDto) {
<Modal
v-model:open="recordsOpen"
:footer="null"
title="审批记录"
:title="$t('ElsaNextApprovalFlow.ApprovalFlow:Initiated:Records')"
width="720px"
>
<VxeGrid

30
apps/vben5/packages/@abp/approval-flow/src/components/instances/PendingApprovalTable.vue

@ -5,6 +5,8 @@ import type { ApprovalPendingTaskDto } from '../../types/approval-flow';
import { onMounted, ref } from 'vue';
import { $t } from '@vben/locales';
import { useVbenVxeGrid } from '@abp/ui';
import { Button, message } from 'ant-design-vue';
@ -21,20 +23,32 @@ const detailTask = ref<ApprovalPendingTaskDto | null>(null);
const gridOptions: VxeGridProps<ApprovalPendingTaskDto> = {
columns: [
{ field: 'instanceTitle', minWidth: 220, title: '审批标题' },
{ field: 'title', minWidth: 180, title: '任务' },
{ field: 'nodeName', minWidth: 140, title: '节点' },
{
field: 'instanceTitle',
minWidth: 220,
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Pending:InstanceTitle'),
},
{
field: 'title',
minWidth: 180,
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Pending:Task'),
},
{
field: 'nodeName',
minWidth: 140,
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Pending:Node'),
},
{
field: 'createdAt',
slots: { default: 'createdAt' },
title: '到达时间',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Pending:ArrivedAt'),
width: 180,
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Actions'),
width: 100,
},
],
@ -79,7 +93,7 @@ async function loadTasks() {
allTasks.value = result.items ?? [];
await gridApi.query();
} catch {
message.error('待办加载失败');
message.error($t('ElsaNextApprovalFlow.ApprovalFlow:Pending:LoadFailed'));
}
}
@ -103,7 +117,7 @@ onMounted(loadTasks);
</script>
<template>
<Grid table-title="待办审批">
<Grid :table-title="$t('ElsaNextApprovalFlow.ApprovalFlow:Pending:Title')">
<template #createdAt="{ row }">
{{ formatDateTime(row.createdAt) }}
</template>
@ -113,7 +127,7 @@ onMounted(loadTasks);
type="link"
@click="openDetail(row as ApprovalPendingTaskDto)"
>
查看
{{ $t('ElsaNextApprovalFlow.ApprovalFlow:Common:View') }}
</Button>
</template>
</Grid>

22
apps/vben5/packages/@abp/approval-flow/src/components/instances/StatusFlow.vue

@ -50,16 +50,16 @@ function actionText(actionKey?: null | string): string {
function statusText(node: ApprovalFlowNode): string {
switch (props.statusMap[node.id]) {
case 'approved': {
return '已通过';
return $t('ElsaNextApprovalFlow.ApprovalFlow:Status:Approved');
}
case 'rejected': {
return '已拒绝';
return $t('ElsaNextApprovalFlow.ApprovalFlow:Status:Rejected');
}
case 'running': {
return '进行中';
return $t('ElsaNextApprovalFlow.ApprovalFlow:Status:Running');
}
default: {
return '未执行';
return $t('ElsaNextApprovalFlow.ApprovalFlow:Status:NotExecuted');
}
}
}
@ -117,26 +117,32 @@ function onChildSelect() {
<div v-else class="status-card" :class="statusClass(node)">
<div class="status-card-header">
<span class="status-icon">{{
node.kind === 'approval' ? '审' : '抄'
node.kind === 'approval'
? $t('ElsaNextApprovalFlow.ApprovalFlow:StatusFlow:ApprovalBadge')
: $t('ElsaNextApprovalFlow.ApprovalFlow:StatusFlow:CopyBadge')
}}</span>
<span class="status-name">{{ node.name }}</span>
<Tag class="status-tag">{{ statusText(node) }}</Tag>
</div>
<div class="status-card-body">
<div v-if="approverNames(node.id)" class="status-line">
审批人:{{ approverNames(node.id) }}
{{ $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Approver') }}:{{
approverNames(node.id)
}}
</div>
<div v-if="latestRecord(node.id)" class="status-line">
{{ actionText(latestRecord(node.id)?.actionKey) }}
<span v-if="latestRecord(node.id)?.comment">
· 审批意见:{{ latestRecord(node.id)?.comment }}
· {{ $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Comment') }}:{{
latestRecord(node.id)?.comment
}}
</span>
<span v-if="latestRecord(node.id)?.occurredAt" class="status-time">
{{ new Date(latestRecord(node.id)!.occurredAt).toLocaleString() }}
</span>
</div>
<div v-if="node.kind === 'cc'" class="status-line status-muted">
抄送节点
{{ $t('ElsaNextApprovalFlow.ApprovalFlow:StatusFlow:CopyNode') }}
</div>
</div>
</div>

20
apps/vben5/packages/@abp/approval-flow/src/components/instances/approval-table-utils.ts

@ -31,22 +31,22 @@ export function statusColor(status: string): string {
export function statusText(status: string): string {
switch (status) {
case 'Approved': {
return '已通过';
return $t('ElsaNextApprovalFlow.ApprovalFlow:Status:Approved');
}
case 'Cancelled': {
return '已取消';
return $t('ElsaNextApprovalFlow.ApprovalFlow:Status:Cancelled');
}
case 'Rejected': {
return '已拒绝';
return $t('ElsaNextApprovalFlow.ApprovalFlow:Status:Rejected');
}
case 'Returned': {
return '已退回';
return $t('ElsaNextApprovalFlow.ApprovalFlow:Status:Returned');
}
case 'Running': {
return '审批中';
return $t('ElsaNextApprovalFlow.ApprovalFlow:Status:Running');
}
case 'Withdrawn': {
return '已撤回';
return $t('ElsaNextApprovalFlow.ApprovalFlow:Status:Withdrawn');
}
default: {
return status;
@ -77,16 +77,16 @@ export function formatDuration(
const parts: string[] = [];
if (days > 0) {
parts.push(`${days}天`);
parts.push($t('antflow.duration.days').replace('{0}', String(days)));
}
if (hours > 0) {
parts.push(`${hours}时`);
parts.push($t('antflow.duration.hours').replace('{0}', String(hours)));
}
if (minutes > 0) {
parts.push(`${minutes}分`);
parts.push($t('antflow.duration.minutes').replace('{0}', String(minutes)));
}
if (seconds > 0 || parts.length === 0) {
parts.push(`${seconds}秒`);
parts.push($t('antflow.duration.seconds').replace('{0}', String(seconds)));
}
return parts.join('');
}

62
apps/vben5/packages/@abp/approval-flow/src/components/templates/ApprovalTemplateTable.vue

@ -7,6 +7,8 @@ import type { ApprovalTemplateDto } from '../../types/approval-flow';
import { ref } from 'vue';
import { $t } from '@vben/locales';
import { useVbenVxeGrid } from '@abp/ui';
import { Button, message, Modal, Space, Tag } from 'ant-design-vue';
@ -28,7 +30,7 @@ const formOptions: VbenFormProps = {
component: 'Input',
fieldName: 'filter',
formItemClass: 'col-span-2 items-baseline',
label: '搜索',
label: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Search'),
},
],
showCollapseButton: true,
@ -37,26 +39,38 @@ const formOptions: VbenFormProps = {
const gridOptions: VxeGridProps<ApprovalTemplateDto> = {
columns: [
{ field: 'displayName', minWidth: 220, title: '名称' },
{ field: 'name', minWidth: 180, title: '编码' },
{ field: 'category', title: '分类', width: 120 },
{
field: 'displayName',
minWidth: 220,
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Name'),
},
{
field: 'name',
minWidth: 180,
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Code'),
},
{
field: 'category',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Category'),
width: 120,
},
{
field: 'status',
slots: { default: 'status' },
title: '状态',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Status'),
width: 110,
},
{
field: 'form',
slots: { default: 'boundForm' },
title: '表单',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Form'),
width: 90,
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Actions'),
width: 300,
},
],
@ -119,35 +133,47 @@ function openStart(template: ApprovalTemplateDto) {
}
function onStarted() {
message.success('已发起审批,可在「我的审批」中查看进度');
message.success($t('ElsaNextApprovalFlow.ApprovalFlow:Templates:Started'));
}
async function removeTemplate(template: ApprovalTemplateDto) {
Modal.confirm({
content: `确定删除模板「${template.displayName}」吗?`,
content: $t(
'ElsaNextApprovalFlow.ApprovalFlow:Templates:DeleteConfirm',
).replace('{0}', template.displayName),
onOk: async () => {
await templatesApi.deleteApi(template.id);
message.success('已删除');
message.success(
$t('ElsaNextApprovalFlow.ApprovalFlow:Templates:Deleted'),
);
await gridApi.query();
},
title: '删除审批模板',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Templates:DeleteTitle'),
});
}
</script>
<template>
<Grid table-title="审批模板">
<Grid :table-title="$t('ElsaNextApprovalFlow.ApprovalFlow:Templates:Title')">
<template #toolbar-tools>
<Button type="primary" @click="openWizard()">新建审批</Button>
<Button type="primary" @click="openWizard()">
{{ $t('ElsaNextApprovalFlow.ApprovalFlow:Templates:Create') }}
</Button>
</template>
<template #status="{ row }">
<Tag :color="row.isPublished ? 'green' : 'orange'">
{{ row.isPublished ? '已发布' : '草稿' }}
{{
row.isPublished
? $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Published')
: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Draft')
}}
</Tag>
</template>
<template #boundForm="{ row }">
<Tag v-if="row.formDefinitionId" color="blue">已绑定</Tag>
<Tag v-if="row.formDefinitionId" color="blue">
{{ $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Bound') }}
</Tag>
<span v-else class="text-gray-400">-</span>
</template>
<template #action="{ row }">
@ -158,14 +184,14 @@ async function removeTemplate(template: ApprovalTemplateDto) {
type="link"
@click="openStart(row as ApprovalTemplateDto)"
>
发起
{{ $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Start') }}
</Button>
<Button
size="small"
type="link"
@click="openWizard(row as ApprovalTemplateDto)"
>
设计
{{ $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Design') }}
</Button>
<Button
danger
@ -173,7 +199,7 @@ async function removeTemplate(template: ApprovalTemplateDto) {
type="link"
@click="removeTemplate(row as ApprovalTemplateDto)"
>
删除
{{ $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Delete') }}
</Button>
</Space>
</template>

118
apps/vben5/packages/@abp/approval-flow/src/components/templates/ApprovalTemplateViewModal.vue

@ -8,6 +8,8 @@ import type {
import { ref, watch } from 'vue';
import { $t } from '@vben/locales';
import {
Descriptions,
DescriptionsItem,
@ -37,19 +39,31 @@ const fields = ref<FormFieldDto[]>([]);
const activeTab = ref('basic');
const fieldColumns: VxeGridProps<FormFieldDto>['columns'] = [
{ field: 'label', minWidth: 200, title: '字段名称' },
{ field: 'key', minWidth: 160, title: '字段编码' },
{ field: 'type', title: '类型', width: 140 },
{
field: 'label',
minWidth: 200,
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Form:FieldName'),
},
{
field: 'key',
minWidth: 160,
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Form:FieldCode'),
},
{
field: 'type',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Form:Type'),
width: 140,
},
{
field: 'permission',
slots: { default: 'permission' },
title: '权限',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Form:Permission'),
width: 90,
},
{
field: 'isRequired',
slots: { default: 'isRequired' },
title: '必填',
title: $t('ElsaNextApprovalFlow.ApprovalFlow:Form:Required'),
width: 80,
},
];
@ -72,7 +86,9 @@ watch(
const form = await formsApi.getApi(template.formDefinitionId);
fields.value = form.fields ?? [];
} catch {
message.error('表单信息加载失败');
message.error(
$t('ElsaNextApprovalFlow.ApprovalFlow:TemplateView:FormLoadFailed'),
);
} finally {
loading.value = false;
}
@ -85,19 +101,21 @@ function statusColor(isPublished: boolean): string {
}
function statusText(isPublished: boolean): string {
return isPublished ? '已发布' : '草稿';
return isPublished
? $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Published')
: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Draft');
}
function permissionText(permission: string): string {
switch (permission) {
case 'E': {
return '可编辑';
return $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Editable');
}
case 'H': {
return '隐藏';
return $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Hidden');
}
case 'R': {
return '只读';
return $t('ElsaNextApprovalFlow.ApprovalFlow:Common:ReadOnly');
}
default: {
return permission;
@ -111,41 +129,84 @@ function permissionText(permission: string): string {
:footer="null"
:open="open"
:width="1000"
title="审批模板详情"
:title="$t('ElsaNextApprovalFlow.ApprovalFlow:TemplateView:Title')"
@cancel="emit('update:open', false)"
>
<Spin :spinning="loading">
<template v-if="template">
<Tabs v-model:active-key="activeTab" size="small">
<Tabs.TabPane key="basic" tab="基础信息">
<Tabs.TabPane
key="basic"
:tab="$t('ElsaNextApprovalFlow.ApprovalFlow:TemplateView:Basic')"
>
<Descriptions bordered :column="2" size="small">
<DescriptionsItem label="模板名称">
<DescriptionsItem
:label="
$t(
'ElsaNextApprovalFlow.ApprovalFlow:TemplateView:TemplateName',
)
"
>
{{ template.displayName }}
</DescriptionsItem>
<DescriptionsItem label="模板编码">
<DescriptionsItem
:label="
$t(
'ElsaNextApprovalFlow.ApprovalFlow:TemplateView:TemplateCode',
)
"
>
{{ template.name }}
</DescriptionsItem>
<DescriptionsItem label="分类">
<DescriptionsItem
:label="$t('ElsaNextApprovalFlow.ApprovalFlow:Common:Category')"
>
{{ template.category || '-' }}
</DescriptionsItem>
<DescriptionsItem label="状态">
<DescriptionsItem
:label="$t('ElsaNextApprovalFlow.ApprovalFlow:Common:Status')"
>
<Tag :color="statusColor(template.isPublished)">
{{ statusText(template.isPublished) }}
</Tag>
</DescriptionsItem>
<DescriptionsItem label="业务键提示">
<DescriptionsItem
:label="
$t(
'ElsaNextApprovalFlow.ApprovalFlow:TemplateView:BusinessKeyHint',
)
"
>
{{ template.businessKeyHint || '-' }}
</DescriptionsItem>
<DescriptionsItem label="表单">
{{ template.formDefinitionId ? '已绑定' : '未绑定' }}
<DescriptionsItem
:label="$t('ElsaNextApprovalFlow.ApprovalFlow:Common:Form')"
>
{{
template.formDefinitionId
? $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Bound')
: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Unbound')
}}
</DescriptionsItem>
<DescriptionsItem label="说明" :span="2">
<DescriptionsItem
:label="
$t(
'ElsaNextApprovalFlow.ApprovalFlow:TemplateView:Description',
)
"
:span="2"
>
{{ template.description || '-' }}
</DescriptionsItem>
</Descriptions>
</Tabs.TabPane>
<Tabs.TabPane key="form" tab="表单设计">
<Tabs.TabPane
key="form"
:tab="
$t('ElsaNextApprovalFlow.ApprovalFlow:TemplateView:FormDesign')
"
>
<VxeGrid
:columns="fieldColumns"
:data="fields"
@ -157,15 +218,24 @@ function permissionText(permission: string): string {
{{ permissionText(row.permission) }}
</template>
<template #isRequired="{ row }">
{{ row.isRequired ? '是' : '否' }}
{{
row.isRequired
? $t('ElsaNextApprovalFlow.ApprovalFlow:Common:Yes')
: $t('ElsaNextApprovalFlow.ApprovalFlow:Common:No')
}}
</template>
</VxeGrid>
<div v-if="fields.length === 0" class="empty-tip">
该模板未绑定表单或表单没有字段
{{ $t('ElsaNextApprovalFlow.ApprovalFlow:TemplateView:NoForm') }}
</div>
</Tabs.TabPane>
<Tabs.TabPane key="flow" tab="流程设计">
<Tabs.TabPane
key="flow"
:tab="
$t('ElsaNextApprovalFlow.ApprovalFlow:TemplateView:FlowDesign')
"
>
<div class="flow-view">
<ApprovalFlowDesigner
:flow-json="template.flowDefinitionJson"

41
apps/vben5/packages/@abp/approval-flow/src/components/templates/StartApprovalModal.vue

@ -7,6 +7,8 @@ import type {
import { computed, reactive, ref, watch } from 'vue';
import { $t } from '@vben/locales';
import {
DatePicker,
Form,
@ -89,7 +91,7 @@ watch(
: initial;
}
} catch {
message.error('表单加载失败');
message.error($t('ElsaNextApprovalFlow.ApprovalFlow:Start:FormLoadFailed'));
} finally {
loading.value = false;
}
@ -130,7 +132,7 @@ async function submit() {
return;
}
if (!title.value.trim()) {
message.warning('请填写审批标题');
message.warning($t('ElsaNextApprovalFlow.ApprovalFlow:Start:TitleRequired'));
return;
}
@ -146,7 +148,7 @@ async function submit() {
field.isRequired &&
(value === undefined || value === null || value === '')
) {
message.warning(`请填写「${field.label}」`);
message.warning($t('ElsaNextApprovalFlow.ApprovalFlow:Start:FieldRequired').replace('{0}', field.label));
return;
}
}
@ -171,11 +173,11 @@ async function submit() {
templateId: props.template.id,
title: title.value.trim(),
});
message.success('审批已发起');
message.success($t('ElsaNextApprovalFlow.ApprovalFlow:Start:Started'));
emit('started');
emit('update:open', false);
} catch {
message.error('发起审批失败');
message.error($t('ElsaNextApprovalFlow.ApprovalFlow:Start:Failed'));
} finally {
submitting.value = false;
}
@ -186,21 +188,36 @@ async function submit() {
<Modal
:confirm-loading="submitting"
:open="open"
:title="`发起审批:${template?.displayName ?? ''}`"
ok-text="发起"
:title="`${$t('ElsaNextApprovalFlow.ApprovalFlow:Start:Title')}: ${template?.displayName ?? ''}`"
:ok-text="$t('ElsaNextApprovalFlow.ApprovalFlow:Common:Start')"
width="680px"
@cancel="emit('update:open', false)"
@ok="submit"
>
<Form layout="vertical">
<FormItem label="审批标题" required>
<Input v-model:value="title" placeholder="例如:张三的请假申请" />
<FormItem
:label="$t('ElsaNextApprovalFlow.ApprovalFlow:Start:ApprovalTitle')"
required
>
<Input
v-model:value="title"
:placeholder="
$t(
'ElsaNextApprovalFlow.ApprovalFlow:Start:ApprovalTitlePlaceholder',
)
"
/>
</FormItem>
<FormItem
v-if="template?.businessKeyHint"
:label="template.businessKeyHint"
>
<Input v-model:value="businessKey" placeholder="可选" />
<Input
v-model:value="businessKey"
:placeholder="
$t('ElsaNextApprovalFlow.ApprovalFlow:Start:BusinessKeyPlaceholder')
"
/>
</FormItem>
<template v-if="useForm">
@ -278,7 +295,9 @@ async function submit() {
</FormItem>
</template>
</template>
<div v-else class="text-sm text-gray-500">该审批无需填写表单。</div>
<div v-else class="text-sm text-gray-500">
{{ $t('ElsaNextApprovalFlow.ApprovalFlow:Start:NoForm') }}
</div>
</Form>
</Modal>
</template>

1
apps/vben5/packages/@abp/approval-flow/src/index.ts

@ -1,3 +1,4 @@
export * from './api';
export * from './components';
export * from './locales';
export * from './types';

20
apps/vben5/packages/@abp/approval-flow/src/locales/index.ts

@ -0,0 +1,20 @@
import type { SupportedLanguagesType } from '@vben/locales';
import { loadLocalesMapFromDir } from '@vben/locales';
const modules = import.meta.glob('./langs/**/*.json');
const localesMap = loadLocalesMapFromDir(
/\.\/langs\/([^/]+)\/(.*)\.json$/,
modules,
);
/**
* Load approval-flow designer localization resources.
* @param lang Current language.
* @returns Localization resources.
*/
export function loadApprovalFlowMessages(lang: SupportedLanguagesType) {
const locales = localesMap[lang]?.();
return locales;
}

488
apps/vben5/packages/@abp/approval-flow/src/locales/langs/en-US/antflow.json

@ -0,0 +1,488 @@
{
"common": {
"close": "Close",
"cancel": "Cancel",
"confirm": "OK",
"delete": "Delete",
"add": "Add",
"select": "Select",
"node": "Node",
"condition": "Condition",
"approval": "Approval",
"cc": "CC",
"noData": "No data available"
},
"addNode": {
"approval": "Approver",
"cc": "CC recipient",
"condition": "Condition gateway",
"add": "Add node"
},
"approvalNode": {
"orSign": "Any approver (one approval or rejection is enough)",
"countersign": "Countersign (all approvers must approve, any order)",
"sequentialCountersign": "Sequential countersign (all approvers must approve in order)",
"noHeaderActionNone": "Do not allow starting",
"noHeaderActionSkip": "Skip",
"noHeaderActionAdmin": "Transfer to approval administrator",
"directSupervisor": "Direct supervisor",
"levelSupervisor": "Level {0} supervisor",
"ccPerson": "CC recipient",
"parallelApprover": "Parallel approver",
"approver": "Approver",
"assigneeMember": "Specified members",
"assigneeRole": "Specified roles",
"assigneeLeader": "Direct supervisor",
"assigneeInitiator": "Initiator",
"assigneeLevel": "Specified level",
"assigneeChain": "Level-by-level approval",
"assigneeSelfSelect": "Initiator selects approvers",
"addRole": "Add/edit role",
"addPerson": "Add/edit person",
"ccSetting": "CC settings",
"approverSetting": "Approver settings",
"buttonPermission": "Button permissions",
"signSummary": "{0} approvers ({1}) countersign",
"sequentialSignSummary": "{0} approvers ({1}) sequential countersign",
"levelSummary": "Level {0} supervisor",
"nodeName": "Node name",
"nodeNamePlaceholder": "Enter node name",
"selectRole": "Select a role",
"selectApprover": "Select approver/CC recipient",
"directLeaderDesc": "The initiator's direct supervisor will be used as the approver.",
"directLeaderTitle": "Direct supervisor",
"initiatorDesc": "The initiator will be used as the approver.",
"initiatorTitle": "Initiator",
"initiatorPrefix": "Initiator's:",
"directorTip": "If no supervisor is found, the direct supervisor approves instead.",
"chainDesc": "Approve level by level from the lowest to the highest supervisor in the organization hierarchy.",
"chainTitle": "Level-by-level approval",
"selfSelectDesc": "The user can select the approver for this node when starting the workflow.",
"selfSelectTitle": "Initiator selects approvers",
"multiApprovalMode": "Approval mode for multiple approvers",
"emptyApprover": "When there is no approver",
"selectRoleTitle": "Select role",
"selectPersonTitle": "Select person",
"nodeNameRequired": "Enter a node name",
"approverRequired": "Select an approver/CC recipient",
"close": "Close",
"cancel": "Cancel",
"confirm": "OK"
},
"wizard": {
"basicSettings": "Basic settings",
"formDesign": "Form design",
"flowDesign": "Flow design",
"newForm": "New form",
"newFlow": "New approval flow",
"loadFailed": "Failed to load approval template",
"nameRequired": "Enter an approval name",
"codeRequired": "Enter a flow code",
"basicSaveFailed": "Failed to save basic information",
"designRequired": "Complete the flow design first",
"designSaveFailed": "Failed to save flow design",
"saved": "Approval flow saved",
"incompleteNodes": "{0} nodes in the flow design are incomplete",
"published": "Approval template published",
"publishFailed": "Publish failed",
"publishedTag": "Published",
"readonlyTag": "Read only",
"stepsAria": "Approval flow steps",
"close": "Close",
"cancel": "Cancel",
"save": "Save",
"publish": "Publish",
"enableForm": "Enable form",
"selectExistingForm": "Select an existing form",
"boundForm": "Form bound",
"unsaved": "Unsaved",
"formInfo": "Form information",
"formName": "Form name",
"formCode": "Form code",
"formId": "Form ID",
"unnamedForm": "Unnamed form",
"unbound": "Not bound",
"noFormTitle": "Form is not enabled",
"noFormDesc": "This approval does not require a form and will go directly to the flow."
},
"basic": {
"codeLabel": "Flow code",
"codePlaceholder": "For example: leave-approval",
"fixed": "Fixed",
"unique": "Unique identifier",
"nameLabel": "Approval name",
"namePlaceholder": "For example: Leave approval",
"categoryLabel": "Category",
"categoryPlaceholder": "For example: HR / Finance",
"categoryTip": "Enter the category name directly",
"iconLabel": "Template icon",
"iconPlaceholder": "Icon name or emoji, e.g. 📄 / file-text",
"businessKeyLabel": "Business key hint",
"businessKeyPlaceholder": "Hint for entering the business key when starting",
"descriptionLabel": "Approval description",
"descriptionPlaceholder": "Enter approval description",
"nameRequired": "Enter an approval name",
"codeRequired": "Enter a flow code"
},
"buttonPerm": {
"approveLabel": "Approve",
"approveDesc": "Approve and move to the next node",
"rejectLabel": "Reject",
"rejectDesc": "Rejecting terminates the current task and ends the flow",
"returnLabel": "Return",
"returnDesc": "Return to the initiator or any node and restart the flow or return to the current approver",
"transferLabel": "Transfer",
"transferDesc": "Select another approver; the current approver will no longer handle it",
"addApprovalLabel": "Add approval",
"addApprovalDesc": "Add another person to this task to handle related matters or provide comments",
"title": "Approval page button permission",
"description": "Controls button visibility for approval nodes. Default buttons cannot be disabled."
},
"condition": {
"equal": "Equals",
"notEqual": "Not equals",
"gt": "Greater than",
"gte": "Greater than or equal",
"lt": "Less than",
"lte": "Less than or equal",
"and": "AND",
"or": "OR",
"groupName": "Condition group {0}",
"validation": "Configure at least one condition",
"fieldRequired": "Select a condition field",
"valueRequired": "Enter a condition value",
"title": "Condition settings",
"branchName": "Branch name",
"branchPlaceholder": "Enter condition branch name",
"defaultDesc": "The default branch cannot have conditions. It is the fallback branch used when no other condition matches. To add conditions, add a normal branch first and delete the default branch.",
"defaultLabel": "Default condition branch",
"relationTip": "Enter this flow when the approval meets the following conditions",
"groupRelation": "Group relation:",
"innerRelation": "Inner relation:",
"deleteGroup": "Delete condition group",
"emptyGroup": "This condition group has no conditions",
"selectField": "Select field",
"fieldKeyPlaceholder": "Field key, e.g. amount",
"valuePlaceholder": "Enter comparison value",
"addCondition": "+ Add condition",
"relationSatisfied": "All satisfied",
"relationAny": "Any satisfied",
"addGroup": "+ Add condition group",
"summary": "{0} condition groups / {1} conditions",
"defaultBranch": "Default branch",
"readonly": "Read-only mode. Condition settings cannot be changed.",
"close": "Close",
"cancel": "Cancel",
"confirm": "OK",
"delete": "Delete"
},
"flow": {
"design": "Flow design",
"completeNode": "Complete: {0}",
"zoomOut": "Zoom out",
"zoomIn": "Zoom in",
"reset": "Reset",
"empty": "No flow data"
},
"nodeWarp": {
"node": "Node",
"approver": "Approver",
"condition": "Condition",
"cc": "CC",
"start": "S",
"nodeBadge": "N",
"statusRunning": "Running",
"statusApproved": "Approved",
"statusRejected": "Rejected",
"statusNotStarted": "Not started",
"conditionName": "Condition {0}",
"conditionBranch": "Condition branch",
"flowEnd": "Flow end",
"addCondition": "Add condition",
"configError": "Node configuration error",
"priority": "Priority {0}",
"deleteNode": "Delete node",
"deleteCondition": "Delete condition",
"selectPlaceholder": "Select {0}"
},
"designer": {
"common": {
"approval": "Approver",
"cc": "CC recipient",
"condition": "Condition branch",
"conditionWithIndex": "Condition {0}",
"otherCondition": "Other conditions",
"otherConditionFlow": "Other conditions enter this flow",
"setCondition": "Set condition",
"selectCondition": "Click to configure this node",
"flowEnd": "Flow end",
"initiator": "Initiator",
"everyone": "Everyone",
"save": "Save",
"saveDesign": "Save design",
"publish": "Publish",
"publishTemplate": "Publish template",
"previewForm": "Preview form",
"cancel": "Cancel",
"confirm": "OK",
"delete": "Delete",
"addCondition": "Add condition",
"statusApproved": "Approved",
"statusRejected": "Rejected",
"statusRunning": "Running",
"statusNotStarted": "Not started",
"priority": "Priority {0}",
"zoomIn": "Zoom in",
"zoomOut": "Zoom out",
"reset": "Reset",
"configHint": "Click + to add an approver, CC recipient, or condition branch",
"flowDesign": "Approval flow design",
"loadFailed": "Failed to load approval template",
"saveFailed": "Save failed",
"saveSuccess": "Approval flow design saved",
"publishSuccess": "Published",
"publishFailed": "Publish failed",
"saveFirst": "Save the template first",
"publishConfirm": "Publishing will generate and publish the Elsa workflow definition from the current design. Continue?",
"publishTitle": "Publish approval template",
"designSaved": "Approval flow design saved"
},
"wizard": {
"basic": "Basic settings",
"form": "Form design",
"flow": "Flow design",
"publish": "Publish",
"newForm": "New form",
"newFlow": "New approval flow",
"loadFailed": "Failed to load approval template",
"nameRequired": "Enter a template name",
"codeRequired": "Enter a template code",
"basicSaveFailed": "Failed to save basic information",
"designNotReady": "Flow design is not ready",
"designSaveFailed": "Failed to save flow design",
"published": "Approval template published",
"publishFailed": "Publish failed",
"publishedTag": "Published",
"cancel": "Cancel",
"confirmPublish": "Confirm publish",
"finish": "Finish",
"next": "Next",
"publishSuccessTitle": "Published successfully",
"publishSuccessDesc": "The approval template has been published. You can start approvals from the template list.",
"code": "Flow code",
"codePlaceholder": "For example: leave-approval",
"name": "Approval name",
"namePlaceholder": "For example: Leave approval",
"category": "Category",
"categoryPlaceholder": "For example: HR",
"icon": "Template icon",
"iconPlaceholder": "Optional",
"businessKey": "Business key hint",
"businessKeyPlaceholder": "Hint for entering the business key when starting",
"description": "Approval description",
"enableForm": "Enable form",
"selectExistingForm": "Select an existing form",
"boundForm": "Form bound",
"noFormTitle": "Form is not enabled",
"noFormDesc": "This approval does not require a form and will go directly to the flow.",
"publishConfirmTitle": "Publish confirmation",
"template": "Template",
"codeLabel": "Code",
"categoryLabel": "Category",
"formLabel": "Form",
"configured": "Configured",
"unsaved": "Unsaved",
"disabled": "Disabled",
"nodeCount": "Nodes",
"approvalNodes": "Approval nodes",
"ccNodes": "CC nodes",
"status": "Status",
"pendingPublish": "Pending publish",
"publishHint": "After clicking Confirm publish, the Elsa workflow definition will be generated and published from the current flow design. You do not need to enter a definition version ID."
},
"branch": {
"equal": "Equals",
"notEqual": "Not equals",
"gt": "Greater than",
"gte": "Greater than or equal",
"lt": "Less than",
"lte": "Less than or equal",
"contains": "Contains",
"notContains": "Does not contain",
"empty": "Is empty",
"notEmpty": "Is not empty",
"and": "All conditions (AND)",
"or": "Any condition (OR)",
"validation": "Fill in the field, operator, and comparison value",
"setTitle": "Set condition",
"setNamedTitle": "Set {0}",
"relation": "Condition relation",
"field": "Condition field",
"operator": "Operator",
"value": "Comparison value",
"selectField": "Select field",
"compareValue": "Comparison value",
"delete": "Delete",
"addCondition": "+ Add condition",
"cancel": "Cancel",
"confirm": "OK",
"conditionBranch": "Condition branch",
"otherCondition": "Other conditions",
"pendingCc": "CC recipient not selected",
"pendingApprover": "Approver not configured",
"selectCondition": "Set condition",
"otherConditionFlow": "Other conditions enter this flow",
"add": "Add condition",
"priority": "Priority {0}"
},
"nodeConfig": {
"participant": "Specified person/department",
"initiator": "Initiator",
"initiatorSelection": "Initiator selection",
"role": "Role",
"supervisor": "Department supervisor",
"organizationUnit": "Department member",
"formField": "Form field",
"any": "Any approver (one approval is enough)",
"all": "Countersign (all must approve)",
"sequential": "Sequential approval",
"searchFailed": "Failed to search people",
"title": "Node settings",
"nodeName": "Node name",
"nodeNamePlaceholder": "Enter node name",
"approvalMode": "Approval mode",
"approverRules": "Approver rules",
"searchParticipant": "Search and select people or departments",
"selectRole": "Select role",
"nearestSupervisor": "Nearest supervisor",
"specifiedLevel": "Specified level",
"topMost": "Top level",
"selectFormField": "Select form field",
"deleteRule": "Delete rule",
"addApproverRule": "Add approver rule",
"emptyApprover": "Empty approver handling",
"skipNode": "Skip this node",
"escalate": "Escalate to department supervisor",
"approvalActions": "Approval actions",
"deleteAction": "Delete",
"addAction": "Add action",
"ccRecipients": "CC recipients",
"deleteCc": "Delete CC",
"addCc": "Add CC recipient",
"conditionSettings": "Condition settings",
"selectCompareValue": "Select comparison value",
"numberPlaceholder": "Enter a number",
"datePlaceholder": "Select date",
"contentPlaceholder": "Enter comparison content",
"conditionHint": "Select a field and set conditions",
"branches": "Branches",
"trueBranch": "Condition matched (true)",
"falseBranch": "Condition not matched (false)",
"nodeCount": "{0} nodes",
"branchHint": "When the condition matches, enter the \"matched\" branch; otherwise enter the \"not matched\" branch. Both branches already contain a default approver node and can be extended on the canvas.",
"nodeLabel": "Node settings - {0}",
"yes": "Yes",
"no": "No",
"agree": "Agree"
},
"form": {
"singleLineText": "Single-line text",
"multiLineText": "Multi-line text",
"number": "Number",
"date": "Date",
"dateRange": "Date range",
"select": "Select",
"radio": "Radio",
"multipleSelect": "Multiple select",
"switch": "Switch",
"attachment": "Attachment",
"calculated": "Calculated",
"description": "Description",
"editable": "Editable",
"readOnly": "Read only",
"hidden": "Hidden",
"loadFailed": "Failed to load form",
"codeRequired": "Enter a form code",
"fieldRequired": "Add at least one field",
"saved": "Form saved and published",
"saveFailed": "Failed to save form",
"formName": "Form name",
"formNamePlaceholder": "For example: Leave request",
"formCode": "Code",
"formCodePlaceholder": "For example: leave-request",
"savedTag": "Saved",
"unsavedTag": "Unsaved",
"controls": "Controls",
"canvas": "Form canvas",
"dragHint": "Drag controls here from the left",
"required": "Required",
"delete": "Delete",
"fieldProperties": "Field properties",
"selectField": "Select a field",
"displayName": "Display name",
"fieldKey": "Field key",
"permission": "Permission",
"hint": "Hint",
"options": "Options (one per line)",
"calcType": "Calculation type",
"fieldA": "Field A",
"fieldB": "Field B",
"resultUnit": "Result unit",
"previewTitle": "Form preview",
"attachmentPlaceholder": "Attachment field (file upload component required)"
}
},
"model": {
"start": "Initiator",
"reviewer": "Reviewer",
"cc": "CC recipient",
"conditionName": "Condition {0}",
"gateway": "Gateway",
"defaultBranch": "Default condition branch",
"conditionBranch": "Condition branch",
"otherCondition": "Other conditions",
"end": "End",
"formField": "Form field: {0}",
"departmentMember": "Department member",
"directLeader": "Direct supervisor",
"initiator": "Initiator",
"levelSupervisor": "Level {0} supervisor",
"chainApproval": "Level-by-level approval",
"selfSelect": "Initiator selects approvers",
"pendingCc": "CC recipient not selected",
"pendingApprover": "Approver not configured",
"signSummary": "{0} approvers ({1}) countersign",
"sequentialSignSummary": "{0} approvers ({1}) sequential countersign",
"approve": "Approve",
"reject": "Reject",
"conditionPrefix": "Condition: {0}",
"noCondition": "Condition not set",
"noPerson": "No person selected",
"rolePrefix": "Role: {0}",
"noRole": "No role selected",
"topMostSupervisor": "Top-level supervisor",
"supervisor": "Department supervisor",
"notSelected": "Not selected"
},
"duration": {
"days": "{0}d",
"hours": "{0}h",
"minutes": "{0}m",
"seconds": "{0}s"
},
"formula": {
"numberOperation": "Operation on two number fields",
"dateOperation": "Operation on two date fields",
"dateRangeOperation": "Date range operation",
"add": "Add +",
"subtract": "Subtract -",
"multiply": "Multiply ×",
"divide": "Divide ÷",
"year": "Year",
"month": "Month",
"day": "Day",
"hour": "Hour",
"minute": "Minute",
"second": "Second"
}
}

488
apps/vben5/packages/@abp/approval-flow/src/locales/langs/zh-CN/antflow.json

@ -0,0 +1,488 @@
{
"common": {
"close": "关闭",
"cancel": "取消",
"confirm": "确定",
"delete": "删除",
"add": "添加",
"select": "选择",
"node": "节点",
"condition": "条件",
"approval": "审批",
"cc": "抄送",
"noData": "暂无可选数据"
},
"addNode": {
"approval": "审批人",
"cc": "抄送人",
"condition": "条件网关",
"add": "添加节点"
},
"approvalNode": {
"orSign": "或签(只需一名审批人同意或拒绝即可)",
"countersign": "会签(需所有审批人同意,不限顺序)",
"sequentialCountersign": "顺序会签(需要所有审批人同意,根据前端传入的顺序)",
"noHeaderActionNone": "不允许发起",
"noHeaderActionSkip": "跳过",
"noHeaderActionAdmin": "转交给审核管理员",
"directSupervisor": "直接主管",
"levelSupervisor": "第{0}级主管",
"ccPerson": "抄送人",
"parallelApprover": "并行审批人",
"approver": "审批人",
"assigneeMember": "指定成员",
"assigneeRole": "指定角色",
"assigneeLeader": "直属领导",
"assigneeInitiator": "发起人自己",
"assigneeLevel": "指定层级",
"assigneeChain": "层层审批",
"assigneeSelfSelect": "发起人自选审批人",
"addRole": "添加/修改角色",
"addPerson": "添加/修改人员",
"ccSetting": "抄送人设置",
"approverSetting": "审批人设置",
"buttonPermission": "按钮权限设置",
"signSummary": "{0}人({1})会签",
"sequentialSignSummary": "{0}人({1})顺序会签",
"levelSummary": "第 {0} 级主管",
"nodeName": "节点名称",
"nodeNamePlaceholder": "请输入节点名称",
"selectRole": "请选择角色",
"selectApprover": "请选择审批人/抄送人",
"directLeaderDesc": "系统将自动选择流程发起人的直属领导作为审批人",
"directLeaderTitle": "直属领导",
"initiatorDesc": "系统将自动选择流程发起人自己作为审批人",
"initiatorTitle": "发起人自己",
"initiatorPrefix": "发起人的:",
"directorTip": "找不到主管时,由直属领导代审批",
"chainDesc": "按照组织架构的上下级关系,从低到高、一级一级往上审批,每一级的直属领导都要依次审批",
"chainTitle": "层层审批",
"selfSelectDesc": "用户可以在流程发起时选择该节点的审批人",
"selfSelectTitle": "发起人自选审批人",
"multiApprovalMode": "多人审批时采用的审批方式",
"emptyApprover": "审批人为空时",
"selectRoleTitle": "选择角色",
"selectPersonTitle": "选择人员",
"nodeNameRequired": "请输入节点名称",
"approverRequired": "请选择审批人/抄送人",
"close": "关闭",
"cancel": "取消",
"confirm": "确定"
},
"wizard": {
"basicSettings": "基础设置",
"formDesign": "表单设计",
"flowDesign": "流程设计",
"newForm": "新建表单",
"newFlow": "新建审批流程",
"loadFailed": "审批模板加载失败",
"nameRequired": "请填写审批名称",
"codeRequired": "请填写流程编号",
"basicSaveFailed": "基础信息保存失败",
"designRequired": "请先完成流程设计",
"designSaveFailed": "流程设计保存失败",
"saved": "审批流程已保存",
"incompleteNodes": "流程设计还有 {0} 个节点未完善",
"published": "审批模板已发布",
"publishFailed": "发布失败",
"publishedTag": "已发布",
"readonlyTag": "只读",
"stepsAria": "审批流程步骤",
"close": "关闭",
"cancel": "取消",
"save": "保存",
"publish": "发布",
"enableForm": "启用表单",
"selectExistingForm": "选择已有表单",
"boundForm": "已绑定表单",
"unsaved": "未保存",
"formInfo": "表单信息",
"formName": "表单名称",
"formCode": "表单编码",
"formId": "表单 ID",
"unnamedForm": "未命名表单",
"unbound": "未绑定",
"noFormTitle": "未启用表单",
"noFormDesc": "本审批不需要填写表单,将直接进入流程。"
},
"basic": {
"codeLabel": "流程编号",
"codePlaceholder": "例如:leave-approval",
"fixed": "已固定",
"unique": "唯一标识",
"nameLabel": "审批名称",
"namePlaceholder": "例如:请假审批",
"categoryLabel": "分组",
"categoryPlaceholder": "例如:人事 / 财务",
"categoryTip": "直接输入分组名称",
"iconLabel": "模板图标",
"iconPlaceholder": "图标名称或表情,例如:📄 / file-text",
"businessKeyLabel": "业务键提示",
"businessKeyPlaceholder": "发起审批时业务键的填写提示",
"descriptionLabel": "审批说明",
"descriptionPlaceholder": "请输入审批说明",
"nameRequired": "请输入审批名称",
"codeRequired": "请输入流程编号"
},
"buttonPerm": {
"approveLabel": "同意",
"approveDesc": "审批通过,流转到下一个节点",
"rejectLabel": "不同意",
"rejectDesc": "当不同意任务时,当前任务被终止,并结束整个流程",
"returnLabel": "退回",
"returnDesc": "退回到发起人或任意节点,流程重新开始或者回到当前审批人",
"transferLabel": "转办",
"transferDesc": "转办选择审批人,转办后自己将不再进行审批",
"addApprovalLabel": "加批",
"addApprovalDesc": "在当前任务上额外添加新人员,处理相关事项或提供审批意见",
"title": "【审批页面】按钮权限显示控制",
"description": "可控制审批节点中按钮的显示权限,默认按钮不可取消。"
},
"condition": {
"equal": "等于",
"notEqual": "不等于",
"gt": "大于",
"gte": "大于等于",
"lt": "小于",
"lte": "小于等于",
"and": "且",
"or": "或",
"groupName": "条件组 {0}",
"validation": "请至少配置一个条件",
"fieldRequired": "请选择条件字段",
"valueRequired": "请填写条件值",
"title": "条件设置",
"branchName": "分支名称",
"branchPlaceholder": "请输入条件分支名称",
"defaultDesc": "默认条件分支不允许设置条件,它是兜底分支:其它条件都未命中时进入该分支。如需添加条件,请先添加普通条件分支,再删除默认分支。",
"defaultLabel": "默认条件分支",
"relationTip": "当审批单满足以下条件时进入此流程",
"groupRelation": "条件组关系:",
"innerRelation": "组内关系:",
"deleteGroup": "删除条件组",
"emptyGroup": "该条件组还没有条件",
"selectField": "选择字段",
"fieldKeyPlaceholder": "字段 key,例如 amount",
"valuePlaceholder": "请输入比较值",
"addCondition": "+ 添加条件",
"relationSatisfied": "且满足",
"relationAny": "或满足",
"addGroup": "+ 添加条件组",
"summary": "共 {0} 个条件组 / {1} 条条件",
"defaultBranch": "默认分支",
"readonly": "当前为只读模式,无法修改条件配置。",
"close": "关闭",
"cancel": "取消",
"confirm": "确定",
"delete": "删除"
},
"flow": {
"design": "流程设计",
"completeNode": "请完善:{0}",
"zoomOut": "缩小",
"zoomIn": "放大",
"reset": "重置",
"empty": "暂无流程数据"
},
"nodeWarp": {
"node": "节点",
"approver": "审批人",
"condition": "条件",
"cc": "抄送",
"start": "发",
"nodeBadge": "节",
"statusRunning": "进行中",
"statusApproved": "已通过",
"statusRejected": "已拒绝",
"statusNotStarted": "未执行",
"conditionName": "条件{0}",
"conditionBranch": "条件分支",
"flowEnd": "流程结束",
"addCondition": "添加条件",
"configError": "节点配置错误",
"priority": "优先级{0}",
"deleteNode": "删除节点",
"deleteCondition": "删除条件",
"selectPlaceholder": "请选择{0}"
},
"designer": {
"common": {
"approval": "审批人",
"cc": "抄送人",
"condition": "条件分支",
"conditionWithIndex": "条件{0}",
"otherCondition": "其他条件",
"otherConditionFlow": "其他条件进入此流程",
"setCondition": "请设置条件",
"selectCondition": "请点击配置节点",
"flowEnd": "流程结束",
"initiator": "发起人",
"everyone": "所有人",
"save": "保存",
"saveDesign": "保存设计",
"publish": "发布",
"publishTemplate": "发布模板",
"previewForm": "预览表单",
"cancel": "取消",
"confirm": "确定",
"delete": "删除",
"addCondition": "添加条件",
"statusApproved": "已通过",
"statusRejected": "已拒绝",
"statusRunning": "进行中",
"statusNotStarted": "未执行",
"priority": "优先级{0}",
"zoomIn": "放大",
"zoomOut": "缩小",
"reset": "重置",
"configHint": "点击 + 添加审批人、抄送人或条件分支",
"flowDesign": "审批流设计",
"loadFailed": "审批模板加载失败",
"saveFailed": "保存失败",
"saveSuccess": "审批流设计已保存",
"publishSuccess": "发布成功",
"publishFailed": "发布失败",
"saveFirst": "请先保存模板",
"publishConfirm": "发布后将根据当前流程设计自动生成并发布 Elsa 工作流定义,确定继续吗?",
"publishTitle": "发布审批模板",
"designSaved": "审批流设计已保存"
},
"wizard": {
"basic": "基础设置",
"form": "表单设计",
"flow": "流程设计",
"publish": "发布",
"newForm": "新建表单",
"newFlow": "新建审批流程",
"loadFailed": "审批模板加载失败",
"nameRequired": "请填写模板名称",
"codeRequired": "请填写模板编码",
"basicSaveFailed": "基础信息保存失败",
"designNotReady": "流程设计尚未准备好",
"designSaveFailed": "流程设计保存失败",
"published": "审批模板已发布",
"publishFailed": "发布失败",
"publishedTag": "已发布",
"cancel": "取消",
"confirmPublish": "确认发布",
"finish": "完成",
"next": "下一步",
"publishSuccessTitle": "发布成功",
"publishSuccessDesc": "审批模板已发布,可在审批模板列表中直接发起审批。",
"code": "流程编号",
"codePlaceholder": "例如:leave-approval",
"name": "审批名称",
"namePlaceholder": "例如:请假审批",
"category": "选择分组",
"categoryPlaceholder": "例如:人事",
"icon": "模板图标",
"iconPlaceholder": "可选",
"businessKey": "业务键提示",
"businessKeyPlaceholder": "发起时业务键的填写提示",
"description": "审批说明",
"enableForm": "启用表单",
"selectExistingForm": "选择已有表单",
"boundForm": "已绑定表单",
"noFormTitle": "未启用表单",
"noFormDesc": "本审批不需要填写表单,将直接进入流程。",
"publishConfirmTitle": "发布确认",
"template": "模板",
"codeLabel": "编码",
"categoryLabel": "分类",
"formLabel": "表单",
"configured": "已配置",
"unsaved": "未保存",
"disabled": "未启用",
"nodeCount": "节点数",
"approvalNodes": "审批节点",
"ccNodes": "抄送节点",
"status": "状态",
"pendingPublish": "待发布",
"publishHint": "点击右上角「确认发布」后,系统会根据当前流程设计自动生成并发布 Elsa 工作流定义,无需手动填写定义版本 Id。"
},
"branch": {
"equal": "等于",
"notEqual": "不等于",
"gt": "大于",
"gte": "大于等于",
"lt": "小于",
"lte": "小于等于",
"contains": "包含",
"notContains": "不包含",
"empty": "为空",
"notEmpty": "不为空",
"and": "同时满足(AND)",
"or": "满足任一(OR)",
"validation": "请填写完整的条件字段、运算符和比较值",
"setTitle": "设置条件",
"setNamedTitle": "设置{0}",
"relation": "条件关系",
"field": "条件字段",
"operator": "运算符",
"value": "比较值",
"selectField": "选择字段",
"compareValue": "比较值",
"delete": "删除",
"addCondition": "+ 添加条件",
"cancel": "取消",
"confirm": "确定",
"conditionBranch": "条件分支",
"otherCondition": "其他条件",
"pendingCc": "待选择抄送人",
"pendingApprover": "待配置审批人",
"selectCondition": "请设置条件",
"otherConditionFlow": "其他条件进入此流程",
"add": "添加条件",
"priority": "优先级{0}"
},
"nodeConfig": {
"participant": "指定人员/部门",
"initiator": "发起人",
"initiatorSelection": "发起人自选",
"role": "角色",
"supervisor": "部门主管",
"organizationUnit": "部门成员",
"formField": "表单字段",
"any": "或签(一人通过即可)",
"all": "会签(全部通过)",
"sequential": "顺签(依次审批)",
"searchFailed": "人员检索失败",
"title": "节点设置",
"nodeName": "节点名称",
"nodeNamePlaceholder": "请输入节点名称",
"approvalMode": "审批方式",
"approverRules": "审批人规则",
"searchParticipant": "搜索并选择人员或部门",
"selectRole": "选择角色",
"nearestSupervisor": "最近一级主管",
"specifiedLevel": "指定层级",
"topMost": "最高层级",
"selectFormField": "选择表单字段",
"deleteRule": "删除规则",
"addApproverRule": "添加审批人规则",
"emptyApprover": "空审批人处理",
"skipNode": "跳过该节点",
"escalate": "升级到部门主管",
"approvalActions": "审批动作",
"deleteAction": "删除",
"addAction": "添加动作",
"ccRecipients": "抄送人",
"deleteCc": "删除抄送",
"addCc": "添加抄送人",
"conditionSettings": "条件设置",
"selectCompareValue": "选择比较值",
"numberPlaceholder": "输入数字",
"datePlaceholder": "选择日期",
"contentPlaceholder": "输入比较内容",
"conditionHint": "请选择字段并设置条件",
"branches": "分支",
"trueBranch": "符合条件(true)",
"falseBranch": "不符合条件(false)",
"nodeCount": "{0} 个节点",
"branchHint": "条件成立进入「符合条件」分支,否则进入「不符合条件」分支;两个分支创建时已各带一个默认审批人节点,可在画布中继续添加节点。",
"nodeLabel": "节点设置 - {0}",
"yes": "是",
"no": "否",
"agree": "同意"
},
"form": {
"singleLineText": "单行文本",
"multiLineText": "多行文本",
"number": "数字",
"date": "日期",
"dateRange": "日期区间",
"select": "下拉选择",
"radio": "单选",
"multipleSelect": "多选",
"switch": "开关",
"attachment": "附件",
"calculated": "计算",
"description": "说明",
"editable": "可编辑",
"readOnly": "只读",
"hidden": "隐藏",
"loadFailed": "表单加载失败",
"codeRequired": "请填写表单编码",
"fieldRequired": "请至少添加一个字段",
"saved": "表单已保存并发布",
"saveFailed": "表单保存失败",
"formName": "表单名称",
"formNamePlaceholder": "例如:请假申请",
"formCode": "编码",
"formCodePlaceholder": "例如:leave-request",
"savedTag": "已保存",
"unsavedTag": "未保存",
"controls": "控件",
"canvas": "表单画布",
"dragHint": "从左侧拖动控件到此处",
"required": "必填",
"delete": "删除",
"fieldProperties": "字段属性",
"selectField": "选择一个字段",
"displayName": "显示名",
"fieldKey": "字段键",
"permission": "权限",
"hint": "提示",
"options": "选项(每行一个)",
"calcType": "计算类型",
"fieldA": "字段A",
"fieldB": "字段B",
"resultUnit": "结果单位",
"previewTitle": "表单预览",
"attachmentPlaceholder": "附件字段(需接入文件上传组件)"
}
},
"model": {
"start": "发起人",
"reviewer": "审核人",
"cc": "抄送人",
"conditionName": "条件{0}",
"gateway": "网关",
"defaultBranch": "默认条件分支",
"conditionBranch": "条件分支",
"otherCondition": "其他条件",
"end": "结束",
"formField": "表单字段:{0}",
"departmentMember": "部门成员",
"directLeader": "直属领导",
"initiator": "发起人自己",
"levelSupervisor": "第 {0} 级主管",
"chainApproval": "层层审批",
"selfSelect": "发起人自选审批人",
"pendingCc": "待选择抄送人",
"pendingApprover": "待配置审批人",
"signSummary": "{0}人({1})会签",
"sequentialSignSummary": "{0}人({1})顺序会签",
"approve": "同意",
"reject": "拒绝",
"conditionPrefix": "条件:{0}",
"noCondition": "未设置条件",
"noPerson": "未选择人员",
"rolePrefix": "角色:{0}",
"noRole": "未选择角色",
"topMostSupervisor": "最高层级主管",
"supervisor": "部门主管",
"notSelected": "未选择"
},
"duration": {
"days": "{0}天",
"hours": "{0}时",
"minutes": "{0}分",
"seconds": "{0}秒"
},
"formula": {
"numberOperation": "两个数字字段运算",
"dateOperation": "两个日期字段运算",
"dateRangeOperation": "日期区间运算",
"add": "加 +",
"subtract": "减 -",
"multiply": "乘 ×",
"divide": "除 ÷",
"year": "年",
"month": "月",
"day": "日",
"hour": "时",
"minute": "分",
"second": "秒"
}
}

207
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.ApprovalFlow.Domain.Shared/LINGYUN/Abp/ElsaNext/ApprovalFlow/Localization/Domain/en.json

@ -1,4 +1,4 @@
{
{
"culture": "en",
"texts": {
"Permission:ApprovalFlow": "Approval flow",
@ -12,6 +12,14 @@
"Permission:Instances.Decide": "Decide approvals",
"Permission:Instances.Withdraw": "Withdraw approvals",
"Permission:Instances.Manage": "Manage approval instances",
"Permission:FormDefinitions": "Form definitions",
"Permission:FormDefinitions.Definitions": "Form definitions",
"Permission:FormDefinitions.Definitions.Create": "Create form definitions",
"Permission:FormDefinitions.Definitions.Update": "Update form definitions",
"Permission:FormDefinitions.Definitions.Delete": "Delete form definitions",
"Permission:FormDefinitions.Definitions.Publish": "Publish form definitions",
"Permission:FormDefinitions.Data": "Form data",
"Permission:FormDefinitions.Data.Edit": "Edit form data",
"ElsaNextApprovalFlow:010001": "An approval template with this name already exists.",
"ElsaNextApprovalFlow:010002": "The approval template does not exist.",
"ElsaNextApprovalFlow:010003": "The approval template is not published.",
@ -47,14 +55,6 @@
"ElsaNextApprovalFlow:080002": "The workflow instance id is required.",
"ElsaNextApprovalFlow:100001": "The approval node resolved too many approvers.",
"ElsaNextApprovalFlow:100002": "The approval node resolved no approvers.",
"Permission:FormDefinitions": "Form definitions",
"Permission:FormDefinitions.Definitions": "Form definitions",
"Permission:FormDefinitions.Definitions.Create": "Create form definitions",
"Permission:FormDefinitions.Definitions.Update": "Update form definitions",
"Permission:FormDefinitions.Definitions.Delete": "Delete form definitions",
"Permission:FormDefinitions.Definitions.Publish": "Publish form definitions",
"Permission:FormDefinitions.Data": "Form data",
"Permission:FormDefinitions.Data.Edit": "Edit form data",
"ElsaNextApprovalFlow:101001": "The user is already a manager of this department.",
"ElsaNextApprovalFlow:101002": "The department manager assignment does not exist.",
"ElsaNextApprovalFlow:101003": "The department does not exist.",
@ -70,6 +70,193 @@
"ApprovalRecordAction:RemoveSign": "Remove signer",
"ApprovalRecordAction:AddApproval": "Add approval",
"ApprovalRecordAction:Withdraw": "Withdraw",
"ApprovalRecordAction:TimeoutReminder": "Timeout reminder"
"ApprovalRecordAction:TimeoutReminder": "Timeout reminder",
"ApprovalFlow:Common:Search": "Search",
"ApprovalFlow:Common:Name": "Name",
"ApprovalFlow:Common:Code": "Code",
"ApprovalFlow:Common:Category": "Category",
"ApprovalFlow:Common:Status": "Status",
"ApprovalFlow:Common:Form": "Form",
"ApprovalFlow:Common:Actions": "Actions",
"ApprovalFlow:Common:Title": "Title",
"ApprovalFlow:Common:Template": "Template",
"ApprovalFlow:Common:StartedAt": "Started at",
"ApprovalFlow:Common:Time": "Time",
"ApprovalFlow:Common:Action": "Action",
"ApprovalFlow:Common:Actor": "Handler",
"ApprovalFlow:Common:FirstViewedAt": "First viewed at",
"ApprovalFlow:Common:CompletedAt": "Completed at",
"ApprovalFlow:Common:Duration": "Duration",
"ApprovalFlow:Common:Comment": "Comment",
"ApprovalFlow:Common:Summary": "Summary",
"ApprovalFlow:Common:Initiator": "Initiator",
"ApprovalFlow:Common:Published": "Published",
"ApprovalFlow:Common:Draft": "Draft",
"ApprovalFlow:Common:Bound": "Bound",
"ApprovalFlow:Common:Unbound": "Not bound",
"ApprovalFlow:Common:Yes": "Yes",
"ApprovalFlow:Common:No": "No",
"ApprovalFlow:Common:View": "View",
"ApprovalFlow:Common:Detail": "Details",
"ApprovalFlow:Common:Cancel": "Cancel",
"ApprovalFlow:Common:Confirm": "Confirm",
"ApprovalFlow:Common:Delete": "Delete",
"ApprovalFlow:Common:Design": "Design",
"ApprovalFlow:Common:Start": "Start",
"ApprovalFlow:Common:Submit": "Submit",
"ApprovalFlow:Common:System": "System",
"ApprovalFlow:Common:Read": "Read",
"ApprovalFlow:Common:Unread": "Unread",
"ApprovalFlow:Common:Editable": "Editable",
"ApprovalFlow:Common:Hidden": "Hidden",
"ApprovalFlow:Common:ReadOnly": "Read only",
"ApprovalFlow:Common:NoData": "No data",
"ApprovalFlow:Templates:Title": "Approval templates",
"ApprovalFlow:Templates:Create": "New approval",
"ApprovalFlow:Templates:DeleteTitle": "Delete approval template",
"ApprovalFlow:Templates:DeleteConfirm": "Delete template \"{0}\"?",
"ApprovalFlow:Templates:Deleted": "Deleted",
"ApprovalFlow:Templates:Started": "Approval submitted. Follow its progress in My approvals.",
"ApprovalFlow:Templates:LoadFailed": "Failed to load approval templates",
"ApprovalFlow:Pending:Title": "Pending approvals",
"ApprovalFlow:Pending:InstanceTitle": "Approval",
"ApprovalFlow:Pending:Task": "Task",
"ApprovalFlow:Pending:Node": "Node",
"ApprovalFlow:Pending:ArrivedAt": "Arrived at",
"ApprovalFlow:Pending:LoadFailed": "Failed to load pending approvals",
"ApprovalFlow:Initiated:Title": "My initiated approvals",
"ApprovalFlow:Initiated:TemplateLoadFailed": "Failed to load approval templates",
"ApprovalFlow:Initiated:WithdrawTitle": "Withdraw approval",
"ApprovalFlow:Initiated:WithdrawConfirm": "Withdrawing will terminate this approval. Continue?",
"ApprovalFlow:Initiated:Withdrawn": "Approval withdrawn",
"ApprovalFlow:Initiated:RecordsLoadFailed": "Failed to load approval records",
"ApprovalFlow:Initiated:Records": "Approval records",
"ApprovalFlow:Initiated:Withdraw": "Withdraw",
"ApprovalFlow:Initiated:Restart": "Restart",
"ApprovalFlow:Done:Title": "Handled approvals",
"ApprovalFlow:Done:HandleTime": "Handled at",
"ApprovalFlow:CarbonCopy:Title": "CC to me",
"ApprovalFlow:CarbonCopy:CopiedAt": "Copied at",
"ApprovalFlow:Instance:Title": "Approval details",
"ApprovalFlow:Instance:Approval": "Approval",
"ApprovalFlow:Instance:Form": "Form",
"ApprovalFlow:Instance:Flow": "Flow",
"ApprovalFlow:Instance:Details": "Details",
"ApprovalFlow:Instance:Records": "Execution records",
"ApprovalFlow:Instance:ProcessForm": "Process form",
"ApprovalFlow:Instance:ApprovalAction": "Approval action",
"ApprovalFlow:Instance:NoFormContent": "No form content",
"ApprovalFlow:Instance:NoFormDefinition": "No form definition",
"ApprovalFlow:Instance:NoRecords": "No execution records",
"ApprovalFlow:Instance:CommentPlaceholder": "Approval comment",
"ApprovalFlow:Instance:SelectTransferee": "Select transferee",
"ApprovalFlow:Instance:SelectAddApprover": "Select additional approver",
"ApprovalFlow:Instance:Submitted": "Approval submitted",
"ApprovalFlow:Instance:SubmitFailed": "Failed to submit approval",
"ApprovalFlow:Instance:LoadFailed": "Failed to load approval details",
"ApprovalFlow:Instance:FinishedAt": "Finished at",
"ApprovalFlow:Instance:FirstViewed": "First viewed",
"ApprovalFlow:Instance:Completed": "Completed",
"ApprovalFlow:Instance:Duration": "Duration",
"ApprovalFlow:Instance:Comment": "Comment",
"ApprovalFlow:Status:Approved": "Approved",
"ApprovalFlow:Status:Cancelled": "Cancelled",
"ApprovalFlow:Status:Rejected": "Rejected",
"ApprovalFlow:Status:Returned": "Returned",
"ApprovalFlow:Status:Running": "Running",
"ApprovalFlow:Status:Withdrawn": "Withdrawn",
"ApprovalFlow:Status:NotExecuted": "Not executed",
"ApprovalFlow:TemplateView:Title": "Approval template details",
"ApprovalFlow:TemplateView:Basic": "Basic information",
"ApprovalFlow:TemplateView:FormDesign": "Form design",
"ApprovalFlow:TemplateView:FlowDesign": "Flow design",
"ApprovalFlow:TemplateView:TemplateName": "Template name",
"ApprovalFlow:TemplateView:TemplateCode": "Template code",
"ApprovalFlow:TemplateView:BusinessKeyHint": "Business key hint",
"ApprovalFlow:TemplateView:Description": "Description",
"ApprovalFlow:TemplateView:NoForm": "The template has no bound form or the form has no fields",
"ApprovalFlow:TemplateView:FormLoadFailed": "Failed to load form information",
"ApprovalFlow:Form:FieldName": "Field name",
"ApprovalFlow:Form:FieldCode": "Field code",
"ApprovalFlow:Form:Type": "Type",
"ApprovalFlow:Form:Permission": "Permission",
"ApprovalFlow:Form:Required": "Required",
"ApprovalFlow:Start:Title": "Start approval",
"ApprovalFlow:Start:ApprovalTitle": "Approval title",
"ApprovalFlow:Start:ApprovalTitlePlaceholder": "For example: Leave request for John",
"ApprovalFlow:Start:BusinessKeyPlaceholder": "Optional",
"ApprovalFlow:Start:NoForm": "This approval does not require a form.",
"ApprovalFlow:Start:TitleRequired": "Please enter an approval title",
"ApprovalFlow:Start:FieldRequired": "Please enter \"{0}\"",
"ApprovalFlow:Start:Started": "Approval submitted",
"ApprovalFlow:Start:Failed": "Failed to start approval",
"ApprovalFlow:Start:FormLoadFailed": "Failed to load form",
"ApprovalFlow:Action:AddApproval": "Add approval",
"ApprovalFlow:Action:Approve": "Approve",
"ApprovalFlow:Action:Reject": "Reject",
"ApprovalFlow:Action:Return": "Return",
"ApprovalFlow:Action:Transfer": "Transfer",
"ApprovalFlow:Common:Approver": "Approver",
"ApprovalFlow:StatusFlow:ApprovalBadge": "A",
"ApprovalFlow:StatusFlow:CopyBadge": "CC",
"ApprovalFlow:StatusFlow:CopyNode": "CC node",
"ApprovalFlow:Viewer:Empty": "No flow design to display",
"FormDefinitions:Name": "Form name",
"FormDefinitions:Code": "Code",
"FormDefinitions:Version": "Version",
"FormDefinitions:Status": "Status",
"FormDefinitions:Actions": "Actions",
"FormDefinitions:Search": "Search",
"FormDefinitions:DisplayName": "Display name",
"FormDefinitions:FieldKey": "Field key",
"FormDefinitions:Type": "Type",
"FormDefinitions:Permission": "Permission",
"FormDefinitions:Required": "Required",
"FormDefinitions:NameRequired": "Enter the form name and code",
"FormDefinitions:SaveFailed": "Save failed",
"FormDefinitions:PublishSuccess": "Published successfully",
"FormDefinitions:PublishFailed": "Publish failed",
"FormDefinitions:DeleteConfirm": "Delete form \"{0}\"?",
"FormDefinitions:DeleteTitle": "Delete confirmation",
"FormDefinitions:FieldRequired": "Enter the field key and display name",
"FormDefinitions:FieldSaveFailed": "Failed to save field",
"FormDefinitions:FieldDeleteFailed": "Failed to delete field",
"FormDefinitions:ManageTitle": "Form management",
"FormDefinitions:Title": "Form definitions",
"FormDefinitions:NewForm": "New form",
"FormDefinitions:Published": "Published",
"FormDefinitions:Draft": "Draft",
"FormDefinitions:Field": "Field",
"FormDefinitions:Publish": "Publish",
"FormDefinitions:Edit": "Edit",
"FormDefinitions:Delete": "Delete",
"FormDefinitions:EditForm": "Edit form",
"FormDefinitions:CreateForm": "New form",
"FormDefinitions:FormName": "Form name",
"FormDefinitions:FormCode": "Form code",
"FormDefinitions:Description": "Description",
"FormDefinitions:FieldManage": "Field management - {0}",
"FormDefinitions:AddField": "Add field",
"FormDefinitions:EditField": "Edit field",
"FormDefinitions:FieldType": "Field type",
"FormDefinitions:FieldPermission": "Field permission",
"FormDefinitions:Sort": "Sort",
"FormDefinitions:Hint": "Hint",
"FormDefinitions:OptionsJson": "Options JSON",
"FormDefinitions:SelectField": "Select a field",
"FormDefinitions:FieldType:SingleLineText": "Single-line text",
"FormDefinitions:FieldType:MultiLineText": "Multi-line text",
"FormDefinitions:FieldType:Number": "Number",
"FormDefinitions:FieldType:Date": "Date",
"FormDefinitions:FieldType:DateRange": "Date range",
"FormDefinitions:FieldType:Select": "Select",
"FormDefinitions:FieldType:Radio": "Radio",
"FormDefinitions:FieldType:MultipleSelect": "Multiple select",
"FormDefinitions:FieldType:Switch": "Switch",
"FormDefinitions:FieldType:Attachment": "Attachment",
"FormDefinitions:FieldType:Description": "Description",
"FormDefinitions:FieldPermission:Editable": "Editable",
"FormDefinitions:FieldPermission:ReadOnly": "Read only",
"FormDefinitions:FieldPermission:Hidden": "Hidden"
}
}

207
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.ApprovalFlow.Domain.Shared/LINGYUN/Abp/ElsaNext/ApprovalFlow/Localization/Domain/zh-Hans.json

@ -1,4 +1,4 @@
{
{
"culture": "zh-Hans",
"texts": {
"Permission:ApprovalFlow": "审批流",
@ -12,6 +12,14 @@
"Permission:Instances.Decide": "审批处理",
"Permission:Instances.Withdraw": "撤回审批",
"Permission:Instances.Manage": "管理审批实例",
"Permission:FormDefinitions": "表单定义",
"Permission:FormDefinitions.Definitions": "表单定义",
"Permission:FormDefinitions.Definitions.Create": "创建表单定义",
"Permission:FormDefinitions.Definitions.Update": "编辑表单定义",
"Permission:FormDefinitions.Definitions.Delete": "删除表单定义",
"Permission:FormDefinitions.Definitions.Publish": "发布表单定义",
"Permission:FormDefinitions.Data": "表单数据",
"Permission:FormDefinitions.Data.Edit": "编辑表单数据",
"ElsaNextApprovalFlow:010001": "已存在同名的审批模板。",
"ElsaNextApprovalFlow:010002": "审批模板不存在。",
"ElsaNextApprovalFlow:010003": "审批模板尚未发布。",
@ -47,14 +55,6 @@
"ElsaNextApprovalFlow:080002": "工作流实例标识不能为空。",
"ElsaNextApprovalFlow:100001": "审批节点解析出的审批人数量超过上限。",
"ElsaNextApprovalFlow:100002": "审批节点没有解析出任何审批人。",
"Permission:FormDefinitions": "表单定义",
"Permission:FormDefinitions.Definitions": "表单定义",
"Permission:FormDefinitions.Definitions.Create": "创建表单定义",
"Permission:FormDefinitions.Definitions.Update": "编辑表单定义",
"Permission:FormDefinitions.Definitions.Delete": "删除表单定义",
"Permission:FormDefinitions.Definitions.Publish": "发布表单定义",
"Permission:FormDefinitions.Data": "表单数据",
"Permission:FormDefinitions.Data.Edit": "编辑表单数据",
"ElsaNextApprovalFlow:101001": "该用户已经是此部门的责任人。",
"ElsaNextApprovalFlow:101002": "部门责任人记录不存在。",
"ElsaNextApprovalFlow:101003": "部门不存在。",
@ -70,6 +70,193 @@
"ApprovalRecordAction:RemoveSign": "减签",
"ApprovalRecordAction:AddApproval": "加批",
"ApprovalRecordAction:Withdraw": "撤回",
"ApprovalRecordAction:TimeoutReminder": "超时提醒"
"ApprovalRecordAction:TimeoutReminder": "超时提醒",
"ApprovalFlow:Common:Search": "搜索",
"ApprovalFlow:Common:Name": "名称",
"ApprovalFlow:Common:Code": "编码",
"ApprovalFlow:Common:Category": "分类",
"ApprovalFlow:Common:Status": "状态",
"ApprovalFlow:Common:Form": "表单",
"ApprovalFlow:Common:Actions": "操作",
"ApprovalFlow:Common:Title": "标题",
"ApprovalFlow:Common:Template": "模板",
"ApprovalFlow:Common:StartedAt": "发起时间",
"ApprovalFlow:Common:Time": "时间",
"ApprovalFlow:Common:Action": "动作",
"ApprovalFlow:Common:Actor": "处理人",
"ApprovalFlow:Common:FirstViewedAt": "首次查看时间",
"ApprovalFlow:Common:CompletedAt": "办理时间",
"ApprovalFlow:Common:Duration": "办理时长",
"ApprovalFlow:Common:Comment": "审批意见",
"ApprovalFlow:Common:Summary": "摘要",
"ApprovalFlow:Common:Initiator": "发起人",
"ApprovalFlow:Common:Published": "已发布",
"ApprovalFlow:Common:Draft": "草稿",
"ApprovalFlow:Common:Bound": "已绑定",
"ApprovalFlow:Common:Unbound": "未绑定",
"ApprovalFlow:Common:Yes": "是",
"ApprovalFlow:Common:No": "否",
"ApprovalFlow:Common:View": "查看",
"ApprovalFlow:Common:Detail": "详情",
"ApprovalFlow:Common:Cancel": "取消",
"ApprovalFlow:Common:Confirm": "确定",
"ApprovalFlow:Common:Delete": "删除",
"ApprovalFlow:Common:Design": "设计",
"ApprovalFlow:Common:Start": "发起",
"ApprovalFlow:Common:Submit": "提交",
"ApprovalFlow:Common:System": "系统",
"ApprovalFlow:Common:Read": "已读",
"ApprovalFlow:Common:Unread": "未读",
"ApprovalFlow:Common:Editable": "可编辑",
"ApprovalFlow:Common:Hidden": "隐藏",
"ApprovalFlow:Common:ReadOnly": "只读",
"ApprovalFlow:Common:NoData": "暂无数据",
"ApprovalFlow:Templates:Title": "审批模板",
"ApprovalFlow:Templates:Create": "新建审批",
"ApprovalFlow:Templates:DeleteTitle": "删除审批模板",
"ApprovalFlow:Templates:DeleteConfirm": "确定删除模板「{0}」吗?",
"ApprovalFlow:Templates:Deleted": "已删除",
"ApprovalFlow:Templates:Started": "已发起审批,可在「我的审批」中查看进度",
"ApprovalFlow:Templates:LoadFailed": "审批模板加载失败",
"ApprovalFlow:Pending:Title": "待办审批",
"ApprovalFlow:Pending:InstanceTitle": "审批标题",
"ApprovalFlow:Pending:Task": "任务",
"ApprovalFlow:Pending:Node": "节点",
"ApprovalFlow:Pending:ArrivedAt": "到达时间",
"ApprovalFlow:Pending:LoadFailed": "待办加载失败",
"ApprovalFlow:Initiated:Title": "我发起的",
"ApprovalFlow:Initiated:TemplateLoadFailed": "审批模板加载失败",
"ApprovalFlow:Initiated:WithdrawTitle": "撤销审批",
"ApprovalFlow:Initiated:WithdrawConfirm": "撤销后该审批流程将终止,确定继续吗?",
"ApprovalFlow:Initiated:Withdrawn": "审批已撤销",
"ApprovalFlow:Initiated:RecordsLoadFailed": "审批记录加载失败",
"ApprovalFlow:Initiated:Records": "审批记录",
"ApprovalFlow:Initiated:Withdraw": "撤销",
"ApprovalFlow:Initiated:Restart": "重新发起",
"ApprovalFlow:Done:Title": "已办审批",
"ApprovalFlow:Done:HandleTime": "处理时间",
"ApprovalFlow:CarbonCopy:Title": "抄送我的",
"ApprovalFlow:CarbonCopy:CopiedAt": "抄送时间",
"ApprovalFlow:Instance:Title": "审批详情",
"ApprovalFlow:Instance:Approval": "审批",
"ApprovalFlow:Instance:Form": "表单",
"ApprovalFlow:Instance:Flow": "流程图",
"ApprovalFlow:Instance:Details": "详情",
"ApprovalFlow:Instance:Records": "执行记录",
"ApprovalFlow:Instance:ProcessForm": "流程表单",
"ApprovalFlow:Instance:ApprovalAction": "审批操作",
"ApprovalFlow:Instance:NoFormContent": "暂无表单内容",
"ApprovalFlow:Instance:NoFormDefinition": "暂无表单定义",
"ApprovalFlow:Instance:NoRecords": "暂无执行记录",
"ApprovalFlow:Instance:CommentPlaceholder": "审批意见",
"ApprovalFlow:Instance:SelectTransferee": "请选择转办人",
"ApprovalFlow:Instance:SelectAddApprover": "请选择加批人员",
"ApprovalFlow:Instance:Submitted": "审批已提交",
"ApprovalFlow:Instance:SubmitFailed": "审批提交失败",
"ApprovalFlow:Instance:LoadFailed": "审批详情加载失败",
"ApprovalFlow:Instance:FinishedAt": "完成时间",
"ApprovalFlow:Instance:FirstViewed": "首次查看",
"ApprovalFlow:Instance:Completed": "办理时间",
"ApprovalFlow:Instance:Duration": "办理时长",
"ApprovalFlow:Instance:Comment": "审批意见",
"ApprovalFlow:Status:Approved": "已通过",
"ApprovalFlow:Status:Cancelled": "已取消",
"ApprovalFlow:Status:Rejected": "已拒绝",
"ApprovalFlow:Status:Returned": "已退回",
"ApprovalFlow:Status:Running": "审批中",
"ApprovalFlow:Status:Withdrawn": "已撤回",
"ApprovalFlow:Status:NotExecuted": "未执行",
"ApprovalFlow:TemplateView:Title": "审批模板详情",
"ApprovalFlow:TemplateView:Basic": "基础信息",
"ApprovalFlow:TemplateView:FormDesign": "表单设计",
"ApprovalFlow:TemplateView:FlowDesign": "流程设计",
"ApprovalFlow:TemplateView:TemplateName": "模板名称",
"ApprovalFlow:TemplateView:TemplateCode": "模板编码",
"ApprovalFlow:TemplateView:BusinessKeyHint": "业务键提示",
"ApprovalFlow:TemplateView:Description": "说明",
"ApprovalFlow:TemplateView:NoForm": "该模板未绑定表单或表单没有字段",
"ApprovalFlow:TemplateView:FormLoadFailed": "表单信息加载失败",
"ApprovalFlow:Form:FieldName": "字段名称",
"ApprovalFlow:Form:FieldCode": "字段编码",
"ApprovalFlow:Form:Type": "类型",
"ApprovalFlow:Form:Permission": "权限",
"ApprovalFlow:Form:Required": "必填",
"ApprovalFlow:Start:Title": "发起审批",
"ApprovalFlow:Start:ApprovalTitle": "审批标题",
"ApprovalFlow:Start:ApprovalTitlePlaceholder": "例如:张三的请假申请",
"ApprovalFlow:Start:BusinessKeyPlaceholder": "可选",
"ApprovalFlow:Start:NoForm": "该审批无需填写表单。",
"ApprovalFlow:Start:TitleRequired": "请填写审批标题",
"ApprovalFlow:Start:FieldRequired": "请填写「{0}」",
"ApprovalFlow:Start:Started": "审批已发起",
"ApprovalFlow:Start:Failed": "发起审批失败",
"ApprovalFlow:Start:FormLoadFailed": "表单加载失败",
"ApprovalFlow:Action:AddApproval": "加批",
"ApprovalFlow:Action:Approve": "同意",
"ApprovalFlow:Action:Reject": "不同意",
"ApprovalFlow:Action:Return": "退回",
"ApprovalFlow:Action:Transfer": "转办",
"ApprovalFlow:Common:Approver": "审批人",
"ApprovalFlow:StatusFlow:ApprovalBadge": "审",
"ApprovalFlow:StatusFlow:CopyBadge": "抄",
"ApprovalFlow:StatusFlow:CopyNode": "抄送节点",
"ApprovalFlow:Viewer:Empty": "没有可展示的流程设计",
"FormDefinitions:Name": "表单名称",
"FormDefinitions:Code": "编码",
"FormDefinitions:Version": "版本",
"FormDefinitions:Status": "状态",
"FormDefinitions:Actions": "操作",
"FormDefinitions:Search": "搜索",
"FormDefinitions:DisplayName": "显示名",
"FormDefinitions:FieldKey": "字段键",
"FormDefinitions:Type": "类型",
"FormDefinitions:Permission": "权限",
"FormDefinitions:Required": "必填",
"FormDefinitions:NameRequired": "请填写表单名称和编码",
"FormDefinitions:SaveFailed": "保存失败",
"FormDefinitions:PublishSuccess": "发布成功",
"FormDefinitions:PublishFailed": "发布失败",
"FormDefinitions:DeleteConfirm": "确定删除表单「{0}」吗?",
"FormDefinitions:DeleteTitle": "删除确认",
"FormDefinitions:FieldRequired": "请填写字段键和显示名",
"FormDefinitions:FieldSaveFailed": "字段保存失败",
"FormDefinitions:FieldDeleteFailed": "字段删除失败",
"FormDefinitions:ManageTitle": "表单管理",
"FormDefinitions:Title": "表单定义",
"FormDefinitions:NewForm": "新建表单",
"FormDefinitions:Published": "已发布",
"FormDefinitions:Draft": "草稿",
"FormDefinitions:Field": "字段",
"FormDefinitions:Publish": "发布",
"FormDefinitions:Edit": "编辑",
"FormDefinitions:Delete": "删除",
"FormDefinitions:EditForm": "编辑表单",
"FormDefinitions:CreateForm": "新建表单",
"FormDefinitions:FormName": "表单名称",
"FormDefinitions:FormCode": "表单编码",
"FormDefinitions:Description": "描述",
"FormDefinitions:FieldManage": "字段管理 - {0}",
"FormDefinitions:AddField": "添加字段",
"FormDefinitions:EditField": "编辑字段",
"FormDefinitions:FieldType": "字段类型",
"FormDefinitions:FieldPermission": "字段权限",
"FormDefinitions:Sort": "排序",
"FormDefinitions:Hint": "说明",
"FormDefinitions:OptionsJson": "选项 JSON",
"FormDefinitions:SelectField": "选择一个字段",
"FormDefinitions:FieldType:SingleLineText": "单行文本",
"FormDefinitions:FieldType:MultiLineText": "多行文本",
"FormDefinitions:FieldType:Number": "数字",
"FormDefinitions:FieldType:Date": "日期",
"FormDefinitions:FieldType:DateRange": "日期区间",
"FormDefinitions:FieldType:Select": "下拉选择",
"FormDefinitions:FieldType:Radio": "单选",
"FormDefinitions:FieldType:MultipleSelect": "多选",
"FormDefinitions:FieldType:Switch": "开关",
"FormDefinitions:FieldType:Attachment": "附件",
"FormDefinitions:FieldType:Description": "说明",
"FormDefinitions:FieldPermission:Editable": "可编辑",
"FormDefinitions:FieldPermission:ReadOnly": "只读",
"FormDefinitions:FieldPermission:Hidden": "隐藏"
}
}

18
aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin5/LINGYUN/Abp/UI/Navigation/VueVbenAdmin5/AbpUINavigationVueVbenAdmin5NavigationDefinitionProvider.cs

@ -33,7 +33,7 @@ public class AbpUINavigationVueVbenAdmin5NavigationDefinitionProvider : Navigati
order: 12,
icon: "lucide:workflow")
.WithRoles(["Users"])
.SetProperty("title", "审批流程");
.SetProperty("title", "page.approvalFlow.title");
approvalFlow.AddItem(
new ApplicationMenu(
@ -44,7 +44,7 @@ public class AbpUINavigationVueVbenAdmin5NavigationDefinitionProvider : Navigati
icon: "lucide:file-text",
description: "审批模板")
.WithRoles(["Users"])
.SetProperty("title", "审批模板")
.SetProperty("title", "page.approvalFlow.templates")
);
var myApprovals = new ApplicationMenu(
@ -55,7 +55,7 @@ public class AbpUINavigationVueVbenAdmin5NavigationDefinitionProvider : Navigati
icon: "lucide:clipboard-check",
description: "我的审批")
.WithRoles(["Users"])
.SetProperty("title", "我的审批");
.SetProperty("title", "page.approvalFlow.myApprovals");
myApprovals.AddItem(
new ApplicationMenu(
@ -65,7 +65,7 @@ public class AbpUINavigationVueVbenAdmin5NavigationDefinitionProvider : Navigati
component: "/approval-flow/my-approvals/pending/index",
description: "待办审批")
.WithRoles(["Users"])
.SetProperty("title", "待办")
.SetProperty("title", "page.approvalFlow.pending")
);
myApprovals.AddItem(
new ApplicationMenu(
@ -75,7 +75,7 @@ public class AbpUINavigationVueVbenAdmin5NavigationDefinitionProvider : Navigati
component: "/approval-flow/my-approvals/initiated/index",
description: "我发起的审批")
.WithRoles(["Users"])
.SetProperty("title", "我发起的")
.SetProperty("title", "page.approvalFlow.initiated")
);
myApprovals.AddItem(
new ApplicationMenu(
@ -85,7 +85,7 @@ public class AbpUINavigationVueVbenAdmin5NavigationDefinitionProvider : Navigati
component: "/approval-flow/my-approvals/done/index",
description: "已办审批")
.WithRoles(["Users"])
.SetProperty("title", "已办")
.SetProperty("title", "page.approvalFlow.done")
);
myApprovals.AddItem(
new ApplicationMenu(
@ -95,7 +95,7 @@ public class AbpUINavigationVueVbenAdmin5NavigationDefinitionProvider : Navigati
component: "/approval-flow/my-approvals/carbon-copy/index",
description: "抄送我的审批")
.WithRoles(["Users"])
.SetProperty("title", "抄送我的")
.SetProperty("title", "page.approvalFlow.carbonCopy")
);
approvalFlow.AddItem(myApprovals);
@ -109,7 +109,7 @@ public class AbpUINavigationVueVbenAdmin5NavigationDefinitionProvider : Navigati
icon: "lucide:form-input",
description: "表单设计")
.WithRoles(["Users"])
.SetProperty("title", "表单设计")
.SetProperty("title", "page.approvalFlow.formDefinitions")
);
approvalFlow.AddItem(
@ -122,7 +122,7 @@ public class AbpUINavigationVueVbenAdmin5NavigationDefinitionProvider : Navigati
description: "流程设计器")
.WithRoles(["Users"])
.SetProperty("hideInMenu", "true")
.SetProperty("title", "流程设计器")
.SetProperty("title", "page.approvalFlow.designer")
);
return new NavigationDefinition(approvalFlow);

Loading…
Cancel
Save