diff --git a/src/views/flow/admin/Routers.vue b/src/views/flow/admin/Routers.vue index 6847c40..396caed 100644 --- a/src/views/flow/admin/Routers.vue +++ b/src/views/flow/admin/Routers.vue @@ -5,6 +5,7 @@ import { ref, onMounted } from "vue"; import { Message, Tag } from "view-ui-plus"; import MyConfirm from "@/components/MyConfirm"; +import ExprEvalModal from "@/views/flow/components/ExprEvalModal.vue"; import { flowApi } from "@/api/module/flow"; import { actionColumn } from "@/utils/tableActions"; import { useElementHeight } from "@/utils/hook/useElementHeight"; @@ -20,6 +21,12 @@ const columns = [ { title: "注册键", key: "routerKey", width: 220 }, { title: "名称", key: "name", width: 160 }, { title: "服务目录键", key: "serviceKey", width: 110 }, + { + // 2026-10-12 SERVICE 收口:reg_app_key 非空=yh-flow-route starter 自注册行(归属应用) + title: "来源", + width: 160, + render: (h: any, p: any) => h("span", p.row.regAppKey ? `自注册 · ${p.row.regAppKey}` : "手工"), + }, { title: "判断端点", key: "path", minWidth: 300 }, { title: "basePath", @@ -129,33 +136,11 @@ function onEnable(row: any) { }); } -// ---- 表达式调试(2026-10-10 四议题):与运行时同一求值核心(/admin/router/eval) ---- -const evalVisible = ref(false); -const evaluating = ref(false); -const evalForm = ref<{ expression: string; variablesJson: string }>({ expression: "", variablesJson: "" }); -const evalResult = ref<{ result: boolean; value?: string; error?: string } | null>(null); +// ---- 表达式调试(2026-10-10 四议题;2026-10-12 议题三改为三模式共享弹窗 ExprEvalModal)---- +const exprVisible = ref(false); function onEval() { - evalForm.value = { expression: "", variablesJson: "" }; - evalResult.value = null; - evalVisible.value = true; -} - -async function doEval() { - if (!evalForm.value.expression.trim()) { - Message.warning("请填写表达式"); - return; - } - evaluating.value = true; - evalResult.value = null; - try { - evalResult.value = (await flowApi.routerEval({ - expression: evalForm.value.expression.trim(), - variablesJson: evalForm.value.variablesJson.trim(), - }).send()) || null; - } finally { - evaluating.value = false; - } + exprVisible.value = true; } onMounted(load); @@ -208,34 +193,7 @@ onMounted(load); - -

- 与 CONDITION 节点 EXPRESSION 模式同一套求值(AviatorScript 沙箱)。变量 = 样例 JSON 的 - 键 + 线上另注入 schId/bizType/bizId/submitterId/instanceId/instanceVersion/nodeId/nodeName - (调试时请在样例里自行提供内置变量取值)。变量未提供会报错——线上同口径(宁挂起不误放行) -

- - -
- - -
- -
+ diff --git a/src/views/flow/admin/def-editor/components/ConditionBox.vue b/src/views/flow/admin/def-editor/components/ConditionBox.vue index c3247fa..24c025a 100644 --- a/src/views/flow/admin/def-editor/components/ConditionBox.vue +++ b/src/views/flow/admin/def-editor/components/ConditionBox.vue @@ -3,9 +3,10 @@ // 分支按出口名互斥选路(运行时调判断服务/表达式求值),分支尾隐式汇合到容器后继。 // 分支头部的出口名 Input 即 contentJson 里 CONDITION 命名出边的 name(判断接口 outlets 契约); // EXPRESSION 模式(2026-10-10)下分支头部再就地编辑出边 condition,序号即求值优先级。 -import { computed, inject } from "vue"; +import { computed, inject, ref } from "vue"; import { BRANCH_LABELS, EDITOR_CTX, MAX_BRANCHES, MIN_BRANCHES, ConditionNode } from "../model"; import NodeList from "./NodeList.vue"; +import ExprEvalModal from "@/views/flow/components/ExprEvalModal.vue"; const props = defineProps<{ node: ConditionNode }>(); @@ -35,6 +36,15 @@ function editCondition(i: number, v: string): void { while (props.node.conditions.length <= i) props.node.conditions.push(""); props.node.conditions[i] = v; } + +// B5 内联试算:把该出口表达式带进共享调试弹窗(ExprEvalModal) +const tryVisible = ref(false); +const tryExpr = ref(""); + +function openTry(i: number): void { + tryExpr.value = (props.node.conditions || [])[i] || ""; + tryVisible.value = true; +} @@ -192,6 +206,31 @@ function editCondition(i: number, v: string): void { .cb-cond::placeholder { color: #c5b3e8; } +.cb-cond-row { + display: flex; + align-items: center; + gap: 6px; +} +.cb-cond-row .cb-cond { + flex: 1; + width: auto; + margin-bottom: 8px; +} +.cb-try { + flex: none; + cursor: pointer; + font-size: 12px; + color: #0b7d72; + border: 1px solid #b7e3dc; + border-radius: 10px; + padding: 0 8px; + line-height: 18px; + user-select: none; +} +.cb-try:hover { + background: #f2fbf9; + border-color: #0b7d72; +} .cb-col-del { flex: none; cursor: pointer; diff --git a/src/views/flow/components/ExprEvalModal.vue b/src/views/flow/components/ExprEvalModal.vue new file mode 100644 index 0000000..e3903ec --- /dev/null +++ b/src/views/flow/components/ExprEvalModal.vue @@ -0,0 +1,410 @@ + + + + +