Archived
三面拆分⑬:触发确认链路 + 运营中心「工作流」区 —— 设计只管设计,运营管细节
**触发确认链路**(用户口述五步的第 4/5 步):
接收邮件 → 分类识别 → 命中 RFQ 事件 → ④(可选,运营勾)系统消息到指定人
工作台(带邮件内容)→ ⑤ 工作台点「确认起单」,流程才起。
· 命中不等于必起:勾了「需人工确认」,装配好的入参存成待确认单
(sys.trigger_pending,migration 0019),ConfirmDesk 端口把带来件内容的
系统消息送指定人(eventRef 挂票号,消息列表就地贴确认状态与那枚钮)。
· 先认领后起单:consumed_at 空才认得到 —— 两人同时点、一人点两次,都只起一条流;
起单失败退回认领,不留死票。确认人记进 source.by,留痕可查。
· 登记触发不走确认(登记那一下本身就是人在确认);勾了没指定人 = 配置错误入死信。
· 4 条单测 + 全链实测:投信 → triggersHit=1 且零直起 → AI 工作台收到确认消息
→ 确认起单 → 二次确认幂等回同一流号 → source.by = AI。
**运营中心重排**(区名即运行时:工作流是流程包的运行时,任务是活动的运行时):
· 新「工作流」区:在途看板(从任务区迁入)+ 运行配置 —— 每包的触发器
起单开关 / 确认打勾 / 确认人,和节点负责人(sys.node_owner)。
· 负责人三层:显式指派 > 运营配置 > 轮值 —— 合并点在 process.start,
复用既有派发链一行不改。
· 任务区瘦身成活动运行时(任务/审批/需处置);知识库区改名「数据」
(与设计中心的知识库解开同名);系统区只剩通道实例。
· 设计中心触发器详情页摘掉启停按钮 —— 设计只管设计,启停/确认全在运营。
· 旧深链有改嫁:tasks/board → runs/board,tasks/trg → runs/conf。
reset-runs 补 sys.trigger_pending(待确认单是运行痕 —— 和上回漏 trace_span 同类洞)。
邮件分类 Agent(第 ② 步)现由抽键正则 + S-FEEL 代位,升级路径记进 debt.md。
产品设计.md 运营章、trigger/process 两份 CONTRACT.md 同步。
五闸绿;契约快照随本提交入库。
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KeDBx2PHLavbURXB8LJJ7m
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
import { useState } from 'react';
|
||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
import type { FormField, ListMessagesOutput, SystemMessageView } from '@contracts';
|
||||
import { answerMessageRoute, listMessagesRoute, markMessageReadRoute } from '@contracts';
|
||||
import { answerMessageRoute, confirmTriggerPendingRoute, listMessagesRoute, markMessageReadRoute } from '@contracts';
|
||||
import { Ico } from '@web-shared/Ico.tsx';
|
||||
import ScrollArea from '@web-shared/ScrollArea.tsx';
|
||||
import { call } from '@web-shared/typed-fetch.ts';
|
||||
@@ -63,7 +63,7 @@ export function MessageDesk() {
|
||||
<ScrollArea className="jc-sa--fill" vpClassName="task-list">
|
||||
{visible.map((m) => {
|
||||
const meta = metaOf(m.kind);
|
||||
const pending = m.card !== undefined && !m.card.answered;
|
||||
const pending = (m.card !== undefined && !m.card.answered) || (m.confirm !== undefined && !m.confirm.consumed);
|
||||
return (
|
||||
<button
|
||||
key={m.id}
|
||||
@@ -77,7 +77,7 @@ export function MessageDesk() {
|
||||
<span className="jc-mcard-top">
|
||||
<em>{meta.kicker}</em>
|
||||
{pending ? (
|
||||
<Chip tone="todo" label="待作答" pulse />
|
||||
<Chip tone="todo" label={m.confirm !== undefined ? '待确认' : '待作答'} pulse />
|
||||
) : (
|
||||
<Chip tone={m.read ? 'done' : 'brand'} label={m.read ? '已读' : '未读'} pulse={!m.read} />
|
||||
)}
|
||||
@@ -122,6 +122,12 @@ export function MessageDesk() {
|
||||
<div className="jc-summary">{sel.body}</div>
|
||||
</Section>
|
||||
|
||||
{sel.confirm !== undefined && (
|
||||
<Section icon="zap" title="确认起单" extra="触发器命中,按运营配置须你点头才起单">
|
||||
<ConfirmFire confirm={sel.confirm} />
|
||||
</Section>
|
||||
)}
|
||||
|
||||
{sel.card !== undefined && (
|
||||
<Section icon="messages-square" title="就地作答" extra={`来源任务 ${sel.card.sourceTaskId.slice(0, 8)}`}>
|
||||
{sel.card.rejectedReason !== undefined && (
|
||||
@@ -228,3 +234,37 @@ function ElicitationForm({
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认起单(触发确认链路第 5 步)—— 点一下,那条流才真的起。
|
||||
* 幂等:已被确认过服务端回同一条流的号,这里如实显示,绝不催人再点。
|
||||
*/
|
||||
function ConfirmFire({ confirm }: { confirm: NonNullable<SystemMessageView['confirm']> }) {
|
||||
const queryClient = useQueryClient();
|
||||
const fire = useMutation({
|
||||
mutationFn: () => call<{ workflowId: string; alreadyStarted: boolean }>(confirmTriggerPendingRoute, { params: { id: confirm.pendingId } }),
|
||||
onSuccess: () => {
|
||||
void queryClient.invalidateQueries({ queryKey: ['desk'] });
|
||||
},
|
||||
});
|
||||
const done = confirm.consumed || fire.isSuccess;
|
||||
const wfId = fire.data?.workflowId ?? confirm.workflowId;
|
||||
if (done) {
|
||||
return (
|
||||
<div className="jc-mod-donehint">
|
||||
<Ico name="circle-check" s={15} />
|
||||
已确认起单{wfId === undefined ? '' : ` · 工作流 ${wfId.slice(0, 8)}`} —— 任务会按负责人配置落到各工作台
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<NoteBand>这封来件命中了触发器,但运营配置要求人工确认 —— 你点了,流程才起;不点,它就停在这儿。</NoteBand>
|
||||
<button className="jc-btn primary" disabled={fire.isPending} onClick={() => fire.mutate()}>
|
||||
<Ico name="play" s={13} />
|
||||
{fire.isPending ? '起单中…' : '确认起单'}
|
||||
</button>
|
||||
{fire.isError && <NoteBand>没起成:{(fire.error as { message?: string }).message ?? '未知原因'}</NoteBand>}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* feature `gov-runs` —— 运营中心 · 工作流:**流程包的运行时**。
|
||||
* 在途实例的监控,和每个包的运行配置(起单开关 / 人工确认 / 节点负责人)。
|
||||
*/
|
||||
export { RunsHome } from './internal/panel.tsx';
|
||||
@@ -0,0 +1,211 @@
|
||||
/**
|
||||
* 运营中心 · 工作流 —— **流程包的运行时**(设计中心只负责设计,运营中心管细节)。
|
||||
*
|
||||
* 两页签:
|
||||
* · 在途:工作流看板(从任务区迁入 —— 工作流一级归这儿,任务区只留活动一级);
|
||||
* · 运行配置:每个包**今天怎么跑**的细节,设计一个字不碰 ——
|
||||
* 触发器:起单开关 / 命中后要不要人工确认 / 谁来确认(触发确认链路第 4 步的配置面)
|
||||
* 节点负责人:流程包的哪个节点归谁 —— 显式指派 > 这里 > 轮值
|
||||
*/
|
||||
import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
|
||||
import type { TriggerConfig } from '@contracts';
|
||||
import {
|
||||
listNodeOwnersRoute,
|
||||
setNodeOwnerRoute,
|
||||
setTriggerConfirmRoute,
|
||||
toggleTriggerRoute,
|
||||
} from '@contracts';
|
||||
import { call } from '@web-shared/typed-fetch.ts';
|
||||
import { Ico } from '@web-shared/Ico.tsx';
|
||||
import { Card, Chip, Clear, QueryGate, St } from '@web-shared/gov/primitives.tsx';
|
||||
import type { Nav } from '@web-shared/gov/gov-route.ts';
|
||||
import { useGovPackages, useGovStaff, useGovTriggers } from '@web-shared/gov/gov-api.ts';
|
||||
import { WorkflowBoard } from '@features/gov-task';
|
||||
|
||||
export function RunsHome({ tab, nav }: { tab: string; nav: Nav }) {
|
||||
if (tab === 'conf') return <RunConfig />;
|
||||
return <WorkflowBoard nav={nav} />;
|
||||
}
|
||||
|
||||
/** 治理写动作统一入口:成功即失效相关查询,画面由服务端重投影 */
|
||||
function useGovAction<TInput>(mutate: (input: TInput) => Promise<unknown>, keys: readonly string[]) {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation({
|
||||
mutationFn: mutate,
|
||||
onSuccess: () => {
|
||||
for (const key of keys) void queryClient.invalidateQueries({ queryKey: ['gov', key] });
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/* ==================== 运行配置:一包一节 ==================== */
|
||||
|
||||
function RunConfig() {
|
||||
const pkgQ = useGovPackages();
|
||||
const trgQ = useGovTriggers();
|
||||
const staffQ = useGovStaff();
|
||||
const packages = (pkgQ.data?.packages ?? []).filter((p) => p.state === 'active');
|
||||
const triggers = trgQ.data?.triggers ?? [];
|
||||
const staff = (staffQ.data?.staff ?? []).filter((s) => s.state === 'active');
|
||||
|
||||
return (
|
||||
<QueryGate query={pkgQ}>
|
||||
{packages.length === 0 ? (
|
||||
<Clear>没有生效的流程包 —— 设计中心激活一版,这里就有它的运行配置。</Clear>
|
||||
) : (
|
||||
<>
|
||||
{packages.map((p) => (
|
||||
<PackageConfig
|
||||
key={p.id}
|
||||
packageId={p.id}
|
||||
name={p.name}
|
||||
nodes={p.nodes
|
||||
.filter((n) => n.kind === 'activity' || n.kind === 'approval')
|
||||
.map((n) => ({ id: n.id, label: n.label, kind: n.kind }))}
|
||||
triggers={triggers.filter((t) => t.processPackageId === p.id)}
|
||||
staff={staff.map((s) => ({ id: s.id, name: s.name, code: s.position.code }))}
|
||||
/>
|
||||
))}
|
||||
</>
|
||||
)}
|
||||
</QueryGate>
|
||||
);
|
||||
}
|
||||
|
||||
type StaffOpt = { id: string; name: string; code: string };
|
||||
|
||||
function PackageConfig({
|
||||
packageId,
|
||||
name,
|
||||
nodes,
|
||||
triggers,
|
||||
staff,
|
||||
}: {
|
||||
packageId: string;
|
||||
name: string;
|
||||
nodes: ReadonlyArray<{ id: string; label: string; kind: string }>;
|
||||
triggers: readonly TriggerConfig[];
|
||||
staff: readonly StaffOpt[];
|
||||
}) {
|
||||
const ownersQ = useQuery({
|
||||
queryKey: ['gov', 'node-owners', packageId],
|
||||
queryFn: () => call<{ owners: Array<{ nodeId: string; staffId: string }> }>(listNodeOwnersRoute, { params: { id: packageId } }),
|
||||
});
|
||||
const owners = new Map((ownersQ.data?.owners ?? []).map((o) => [o.nodeId, o.staffId]));
|
||||
|
||||
const toggle = useGovAction(
|
||||
(input: { id: string; enabled: boolean }) =>
|
||||
call(toggleTriggerRoute, { params: { id: input.id }, body: { enabled: input.enabled } }),
|
||||
['triggers'],
|
||||
);
|
||||
const confirm = useGovAction(
|
||||
(input: { id: string; required: boolean; staffId?: string }) =>
|
||||
call(setTriggerConfirmRoute, {
|
||||
params: { id: input.id },
|
||||
body: { required: input.required, ...(input.staffId === undefined ? {} : { staffId: input.staffId }) },
|
||||
}),
|
||||
['triggers'],
|
||||
);
|
||||
const setOwner = useGovAction(
|
||||
(input: { nodeId: string; staffId: string | null }) =>
|
||||
call(setNodeOwnerRoute, { params: { id: packageId, nodeId: input.nodeId }, body: { staffId: input.staffId } }),
|
||||
['node-owners'],
|
||||
);
|
||||
|
||||
return (
|
||||
<Card ico="workflow" title={name} extra={<span className="g-mono">{packageId}</span>}>
|
||||
{/* ── 触发器的运营面:开不开 · 要不要人点头 · 谁点头 —— 规则本身在设计中心改 ── */}
|
||||
<div className="g-runconf">
|
||||
<div className="g-runconf-h">
|
||||
<Ico name="zap" s={11} />
|
||||
触发器 —— 起单开关与人工确认
|
||||
</div>
|
||||
{triggers.length === 0 ? (
|
||||
<p className="g-runconf-none">这个包还没有调起规则 —— 去设计中心 · 触发器配一条。</p>
|
||||
) : (
|
||||
triggers.map((t) => {
|
||||
const confirmed = t.confirm.required;
|
||||
return (
|
||||
<div key={t.id} className="g-runconf-r">
|
||||
<St tone={t.enabled ? 'ok' : 'mute'} ico="zap">
|
||||
{t.name}
|
||||
</St>
|
||||
<label className="g-runconf-k">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={t.enabled}
|
||||
onChange={(e) => toggle.mutate({ id: t.id, enabled: e.target.checked })}
|
||||
/>
|
||||
起单
|
||||
</label>
|
||||
<label className="g-runconf-k" title="勾了:命中后先发系统消息到指定人工作台,他点「确认起单」流程才起">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={confirmed}
|
||||
onChange={(e) =>
|
||||
confirm.mutate({
|
||||
id: t.id,
|
||||
required: e.target.checked,
|
||||
// 勾上时没选过人就先落到第一位 —— 服务端要求勾必有人,界面不递交半份配置
|
||||
...(e.target.checked && (t.confirm.staffId ?? staff[0]?.id) !== undefined
|
||||
? { staffId: t.confirm.staffId ?? staff[0]!.id }
|
||||
: {}),
|
||||
})
|
||||
}
|
||||
/>
|
||||
命中后须人工确认
|
||||
</label>
|
||||
<select
|
||||
className="g-select"
|
||||
aria-label={`${t.name} 的确认人`}
|
||||
disabled={!confirmed}
|
||||
value={t.confirm.staffId ?? ''}
|
||||
onChange={(e) => confirm.mutate({ id: t.id, required: true, staffId: e.target.value })}
|
||||
>
|
||||
<option value="" disabled>
|
||||
确认人…
|
||||
</option>
|
||||
{staff.map((s) => (
|
||||
<option key={s.id} value={s.id}>
|
||||
{s.name} · {s.code}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
{confirmed && t.confirm.staffId === undefined && <Chip tone="warn">还没指定确认人</Chip>}
|
||||
</div>
|
||||
);
|
||||
})
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* ── 节点负责人:显式指派 > 这里 > 轮值 ── */}
|
||||
<div className="g-runconf">
|
||||
<div className="g-runconf-h">
|
||||
<Ico name="user-check" s={11} />
|
||||
节点负责人 —— 留空即轮值(有员工组按组轮,没有按全员最闲者先)
|
||||
</div>
|
||||
<div className="g-runconf-own">
|
||||
{nodes.map((n) => (
|
||||
<label key={n.id} className="g-runconf-node">
|
||||
<span className="nid">{n.id}</span>
|
||||
<span className="lb">{n.label}</span>
|
||||
{n.kind === 'approval' && <Chip tone="warn">审批</Chip>}
|
||||
<select
|
||||
className="g-select"
|
||||
value={owners.get(n.id) ?? ''}
|
||||
onChange={(e) => setOwner.mutate({ nodeId: n.id, staffId: e.target.value === '' ? null : e.target.value })}
|
||||
>
|
||||
<option value="">轮值</option>
|
||||
{staff.map((s) => (
|
||||
<option key={s.id} value={s.id}>
|
||||
{s.name} · {s.code}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
@@ -2,4 +2,4 @@
|
||||
* feature `gov-task` 唯一出口(编码规范 §9.1)。
|
||||
* 任务管理:在途监控、控制事件(暂停/叫停/终止)、恢复、改派、任务日志查看
|
||||
*/
|
||||
export { TasksHome, WfPage, TaskPage, TaskLogPage } from './internal/panel.tsx';
|
||||
export { TasksHome, WfPage, TaskPage, TaskLogPage, WorkflowBoard } from './internal/panel.tsx';
|
||||
|
||||
@@ -23,7 +23,6 @@ import { Ava, Card, Chip, Clear, Entry, Facts, Kpi, NList, NRow, Note, PageHead,
|
||||
import type { ActSpec } from '@web-shared/gov/primitives.tsx';
|
||||
import { APR_ST, PARA, RUNTIME_ST, TERMINAL_ST, WF_ST } from '@web-shared/gov/tone.ts';
|
||||
import type { Nav } from '@web-shared/gov/gov-route.ts';
|
||||
import { TriggerOpsTab } from '@features/gov-trigger';
|
||||
import { FlowFigure } from '@web-shared/gov/flow/FlowFigure.tsx';
|
||||
import {
|
||||
useGovApprovals,
|
||||
@@ -36,14 +35,15 @@ import {
|
||||
export type HomeProps = { tab: string; nav: Nav };
|
||||
|
||||
export function TasksHome({ tab, nav }: HomeProps) {
|
||||
// 起单开关 = 触发器的**处置面**:今天开不开是当班主管的事,规则怎么写在设计中心改
|
||||
if (tab === 'trg') return <TriggerOpsTab nav={nav} />;
|
||||
return <RuntimeHome tab={tab} nav={nav} />;
|
||||
}
|
||||
|
||||
function RuntimeHome({ tab, nav }: HomeProps) {
|
||||
/**
|
||||
* 在途工作流看板 —— **工作流是流程包的运行时**,一级看板归「运营中心 · 工作流」区;
|
||||
* 任务区(活动的运行时)不再摆它。
|
||||
*/
|
||||
export function WorkflowBoard({ nav }: { nav: Nav }) {
|
||||
const q = useGovTasks();
|
||||
const approvals = useGovApprovals();
|
||||
const tasks = q.data?.tasks ?? [];
|
||||
const workflows = q.data?.workflows ?? [];
|
||||
|
||||
@@ -55,7 +55,6 @@ function RuntimeHome({ tab, nav }: HomeProps) {
|
||||
return stuck ? { name: stuck.ownerName, label: '最后经手 · 待处置' } : undefined;
|
||||
};
|
||||
|
||||
if (tab === 'board') {
|
||||
const lanes = [
|
||||
{ k: 'running', tone: 'brand' },
|
||||
{ k: 'waiting', tone: 'warn' },
|
||||
@@ -122,8 +121,14 @@ function RuntimeHome({ tab, nav }: HomeProps) {
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function RuntimeHome({ tab, nav }: HomeProps) {
|
||||
const q = useGovTasks();
|
||||
const approvals = useGovApprovals();
|
||||
const tasks = q.data?.tasks ?? [];
|
||||
const workflows = q.data?.workflows ?? [];
|
||||
|
||||
if (tab === 'apr') {
|
||||
const rows = approvals.data?.approvals ?? [];
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
* feature `gov-trigger` 唯一出口(编码规范 §9.1)。
|
||||
* 触发器的两副面孔:规则定义在设计中心(流程包 - 调起规则),启停在运营中心(任务 - 起单开关)。
|
||||
*/
|
||||
export { TriggerOpsTab, TriggerPage, TriggerRulesHome } from './internal/panel.tsx';
|
||||
export { TriggerPage, TriggerRulesHome } from './internal/panel.tsx';
|
||||
|
||||
@@ -17,7 +17,6 @@ import type { TriggerConfig } from '@contracts';
|
||||
import {
|
||||
TRIGGER_KIND_LABEL,
|
||||
processPackageIdSchema,
|
||||
toggleTriggerRoute,
|
||||
triggerKindOf,
|
||||
upsertTriggerRoute,
|
||||
} from '@contracts';
|
||||
@@ -29,8 +28,6 @@ import {
|
||||
Clear,
|
||||
Field,
|
||||
ListEdit,
|
||||
NList,
|
||||
NRow,
|
||||
Note,
|
||||
PageHead,
|
||||
Prop,
|
||||
@@ -394,62 +391,9 @@ function TriggerForm({
|
||||
|
||||
/* ==================== 运营侧:起单开关(处置面) ==================== */
|
||||
|
||||
export function TriggerOpsTab({ nav }: { nav: Nav }) {
|
||||
const q = useGovTriggers();
|
||||
const triggers = q.data?.triggers ?? [];
|
||||
const toggle = useGovAction(
|
||||
(input: { id: string; enabled: boolean }) =>
|
||||
call(toggleTriggerRoute, { params: { id: input.id }, body: { enabled: input.enabled } }),
|
||||
['triggers'],
|
||||
);
|
||||
|
||||
return (
|
||||
<QueryGate query={q}>
|
||||
<>
|
||||
<Note>
|
||||
开关管的是<b>今天起不起单</b>,不是规则本身。停用后此后不再起新单,<b>已起的照常跑完</b>;
|
||||
规则怎么写在设计中心 · 流程包 - 调起规则里改。
|
||||
</Note>
|
||||
{triggers.length === 0 ? (
|
||||
<Clear>还没有调起规则 —— 设计中心配好之后,开关会出现在这里。</Clear>
|
||||
) : (
|
||||
<NList>
|
||||
{triggers.map((t) => (
|
||||
<NRow
|
||||
key={t.id}
|
||||
tone={t.enabled ? 'brand' : 'mute'}
|
||||
ico="zap"
|
||||
title={t.name}
|
||||
sub={ruleText(t)}
|
||||
cols={[
|
||||
{ k: '类别', v: <Chip tone="brand">{TRIGGER_KIND_LABEL[triggerKindOf(t.spec)]}</Chip> },
|
||||
{ k: '调起', v: t.processPackageId },
|
||||
]}
|
||||
right={
|
||||
<St tone={t.enabled ? 'ok' : 'mute'} ico={t.enabled ? 'circle-check' : 'power'}>
|
||||
{t.enabled ? '已启用' : '已停用'}
|
||||
</St>
|
||||
}
|
||||
onClick={() => nav.push({ k: 'trigger', id: t.id })}
|
||||
/>
|
||||
))}
|
||||
</NList>
|
||||
)}
|
||||
{toggle.isError && <Note tone="warn">切换失败,请重试。</Note>}
|
||||
</>
|
||||
</QueryGate>
|
||||
);
|
||||
}
|
||||
|
||||
/* ==================== 触发器详情(两面共用) ==================== */
|
||||
|
||||
export function TriggerPage({ id }: { id: string }) {
|
||||
const q = useGovTriggers();
|
||||
const t = (q.data?.triggers ?? []).find((x) => x.id === id);
|
||||
const toggle = useGovAction(
|
||||
(enabled: boolean) => call(toggleTriggerRoute, { params: { id }, body: { enabled } }),
|
||||
['triggers'],
|
||||
);
|
||||
if (t === undefined) return <Note>触发器不存在。</Note>;
|
||||
return (
|
||||
<>
|
||||
@@ -462,27 +406,13 @@ export function TriggerPage({ id }: { id: string }) {
|
||||
<>
|
||||
<Chip tone="brand">{TRIGGER_KIND_LABEL[triggerKindOf(t.spec)]}</Chip>
|
||||
<Chip ico="boxes">调起 {t.processPackageId}</Chip>
|
||||
<Chip tone={t.enabled ? 'ok' : 'mute'} ico="power">
|
||||
{t.enabled ? '起单中' : '已停用'}
|
||||
</Chip>
|
||||
{t.confirm.required && <Chip tone="warn">命中须人工确认</Chip>}
|
||||
</>
|
||||
}
|
||||
desc="触发器与流程包平级——不入包结构、不随包版本,增删启停不改任何版本。规则在设计中心改,开关在运营中心拨。"
|
||||
acts={[
|
||||
{
|
||||
label: t.enabled ? '停用' : '启用',
|
||||
ico: 'power',
|
||||
danger: t.enabled,
|
||||
ask: {
|
||||
title: `${t.enabled ? '停用' : '启用'}触发器:${t.name}`,
|
||||
note: <Note>启停不改任何版本;已起的单不受影响。</Note>,
|
||||
impact: {
|
||||
who: t.enabled ? '此后不再自动起单,已在途工作流不受影响' : '此后按规则自动起单',
|
||||
undo: '可随时反向切换',
|
||||
when: '确认后即时',
|
||||
},
|
||||
okLabel: t.enabled ? '确认停用' : '确认启用',
|
||||
onOk: () => toggle.mutate(!t.enabled),
|
||||
},
|
||||
},
|
||||
]}
|
||||
desc="设计中心只负责设计:这里改的是规则与装配。启停开关、要不要人工确认、谁来确认,在运营中心 · 工作流的运行配置里。"
|
||||
/>
|
||||
<Card ico="settings" title="起单规则">
|
||||
<Rows
|
||||
|
||||
Reference in New Issue
Block a user