@@ -727,10 +727,19 @@ const timeoutAction = computed({
set: (value) => patchConfig({ timeoutAction: value })
})
+/** 那些下拉选的是路由名,同名出口并成一个选项就行:列两遍只会让人以为是两个动作。 */
+const uniqueRouteOptions = computed(() => {
+ const rows: { value: string; label: string }[] = []
+ props.routeOptions.forEach((item) => {
+ if (!rows.some((row) => row.value === item.value)) rows.push(item)
+ })
+ return rows
+})
+
/** 超时自动流转默认留空(服务端取第一条可用路由),这里给的是可选的显式指定。 */
const timeoutRouteOptions = computed(() => [
{ value: '', label: t('process.timeoutRouteAuto') },
- ...props.routeOptions
+ ...uniqueRouteOptions.value
])
const timeoutRoute = computed({
diff --git a/frontend/src/components/oa/design/RouteInspector.vue b/frontend/src/components/oa/design/RouteInspector.vue
index 919eb5b..0e137b0 100644
--- a/frontend/src/components/oa/design/RouteInspector.vue
+++ b/frontend/src/components/oa/design/RouteInspector.vue
@@ -18,6 +18,26 @@
+
+
+ {{ t('process.routeSameNameHint') }}
+
+
+
+
@@ -154,6 +174,16 @@ function nodeName(id: string): string {
return props.nodes.find((item) => item.value === id)?.label ?? id
}
+/** 同一环节上其他连线的名字:同名=待办上的同一个按钮,所以给一键复用。 */
+const siblingNames = computed(() => {
+ const rows: { name: string; to: string }[] = []
+ props.routes.forEach((item) => {
+ if (item.from_activity !== form.from_activity || item.id === form.id) return
+ if (!rows.some((row) => row.name === item.name)) rows.push({ name: item.name, to: item.to_activity })
+ })
+ return rows
+})
+
function blank() {
Object.assign(form, {
id: '',
diff --git a/frontend/src/i18n/locales/en.ts b/frontend/src/i18n/locales/en.ts
index 59090a7..5fc66de 100644
--- a/frontend/src/i18n/locales/en.ts
+++ b/frontend/src/i18n/locales/en.ts
@@ -918,6 +918,7 @@ export default {
routePrefix: 'Route ',
endHasNoOut: 'End activities cannot have an outbound route',
routeExists: 'These two activities are already connected',
+ routeSameNameHint: 'Routes sharing a name become one button on the approval card; each route\'s own condition picks which one runs. Click a name below to reuse it',
applyRoute: 'Apply to canvas',
addRouteToCanvas: 'Add to canvas',
routeApplied: 'Route applied to the canvas',
diff --git a/frontend/src/i18n/locales/zh.ts b/frontend/src/i18n/locales/zh.ts
index cd4e6e5..d2da862 100644
--- a/frontend/src/i18n/locales/zh.ts
+++ b/frontend/src/i18n/locales/zh.ts
@@ -914,6 +914,7 @@ export default {
routePrefix: '路由',
endHasNoOut: '结束类环节不能有出口',
routeExists: '这两个环节之间已经有连线',
+ routeSameNameHint: '同名连线在待办上就是同一个按钮,走哪一条由各自写的条件决定;点下面的名字可以直接复用',
applyRoute: '应用到画布',
addRouteToCanvas: '加到画布',
routeApplied: '路由已改到画布上',
diff --git a/frontend/src/views/oa/TodoListView.vue b/frontend/src/views/oa/TodoListView.vue
index dca5ab6..61c00ce 100644
--- a/frontend/src/views/oa/TodoListView.vue
+++ b/frontend/src/views/oa/TodoListView.vue
@@ -217,6 +217,8 @@ const batchRoutes = computed(() => {
.map((row) => row.route_name_list ?? [])
.reduce((acc, list) => acc.filter((name) => list.includes(name)))
.filter(Boolean)
+ // 一个环节上几条同名出口在待办的路由清单里会出现两次,下拉里它们是同一个动作
+ .filter((name, index, all) => all.indexOf(name) === index)
})
const batchRouteOptions = computed(() =>