@yuku123/z-team-component 0.2.30 → 0.2.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,41 +1,41 @@
1
- import { jsx as e, jsxs as r, Fragment as Le } from "react/jsx-runtime";
2
- import { lazy as xt, Suspense as wt, useState as m, useEffect as U, useRef as st } from "react";
3
- import { useLocation as It, useNavigate as xe, useParams as ot, Routes as ct, Route as ne, Navigate as dt, useSearchParams as St } from "react-router-dom";
4
- import { Row as Y, Col as z, Typography as le, Alert as V, Card as M, Space as P, Button as _, Table as Q, Drawer as we, Descriptions as R, Tag as w, Tooltip as pe, message as b, Modal as me, Statistic as K, Input as B, Select as X, Tabs as Ie, Form as E, Upload as kt, Popconfirm as je, Spin as Ae, Radio as re, InputNumber as Oe, Empty as Ct } from "antd";
5
- import { SettingOutlined as Tt, ProjectOutlined as Ee, UserOutlined as ut, AuditOutlined as $e, RobotOutlined as Ne, ApiOutlined as Fe, AppstoreOutlined as vt, ThunderboltOutlined as be, BarChartOutlined as _t, ScheduleOutlined as At, FileTextOutlined as Ke, ReloadOutlined as ee, ExperimentOutlined as Et, PlayCircleOutlined as Pe, CopyOutlined as ht, GlobalOutlined as pt, NodeIndexOutlined as Pt, UndoOutlined as Rt, FileSearchOutlined as Ot, VideoCameraOutlined as Je, SearchOutlined as mt, EyeOutlined as zt, CodeOutlined as fe, InfoCircleOutlined as Mt, FunctionOutlined as ke, ImportOutlined as De, CloudUploadOutlined as Xe, FileAddOutlined as Lt, PlusOutlined as yt, EditOutlined as $t, PauseCircleOutlined as Nt, CheckCircleOutlined as Ue, DeleteOutlined as Dt, ExclamationCircleOutlined as Bt, SaveOutlined as gt, ArrowLeftOutlined as ft, SendOutlined as qt } from "@ant-design/icons";
1
+ import { jsx as e, jsxs as n, Fragment as Me } from "react/jsx-runtime";
2
+ import { lazy as xt, Suspense as wt, useState as m, useEffect as F, useRef as it } from "react";
3
+ import { useLocation as kt, useNavigate as xe, useParams as ot, Routes as ct, Route as re, Navigate as dt, useSearchParams as It } from "react-router-dom";
4
+ import { Row as Y, Col as O, Typography as ae, Alert as Z, Card as L, Space as E, Button as A, Table as Q, Drawer as we, Descriptions as z, Tag as w, Tooltip as he, message as b, Modal as me, Statistic as K, Input as B, Select as V, Tabs as ke, Form as P, Upload as St, Popconfirm as Ue, Spin as _e, Radio as ne, InputNumber as Re, Empty as Tt } from "antd";
5
+ import { SettingOutlined as Ct, ProjectOutlined as Pe, UserOutlined as ut, AuditOutlined as De, RobotOutlined as $e, ApiOutlined as qe, AppstoreOutlined as vt, ThunderboltOutlined as be, BarChartOutlined as At, ScheduleOutlined as _t, FileTextOutlined as Ke, ReloadOutlined as ee, ExperimentOutlined as Pt, PlayCircleOutlined as Ee, CopyOutlined as pt, GlobalOutlined as ht, NodeIndexOutlined as Et, UndoOutlined as zt, FileSearchOutlined as Rt, VideoCameraOutlined as Je, SearchOutlined as mt, EyeOutlined as Ot, CodeOutlined as fe, InfoCircleOutlined as Lt, FunctionOutlined as Se, ImportOutlined as Ne, CloudUploadOutlined as Ve, FileAddOutlined as Mt, PlusOutlined as yt, EditOutlined as Dt, PauseCircleOutlined as $t, CheckCircleOutlined as Fe, DeleteOutlined as Nt, ExclamationCircleOutlined as Bt, SaveOutlined as gt, ArrowLeftOutlined as ft, SendOutlined as jt } from "@ant-design/icons";
6
6
  import "@yuku123/z-frontend-common";
7
- import { PageHeader as ye, GradientStatCard as Ce, SectionHeader as jt, FeatureCard as Ft, DarkBanner as Kt, ListTable as ie, TableToolbar as Ut, ErrorState as Ht } from "@yuku123/z-frontend-common/ui";
7
+ import { PageHeader as ye, GradientStatCard as Te, SectionHeader as Ut, FeatureCard as qt, DarkBanner as Kt, ListTable as se, TableToolbar as Ft, ErrorState as Ht, ComponentDoc as Gt } from "@yuku123/z-frontend-common/ui";
8
8
  import He from "axios";
9
- const Z = (t) => {
10
- const s = xt(t);
11
- return (n) => /* @__PURE__ */ e(wt, { fallback: null, children: /* @__PURE__ */ e(s, { ...n }) });
12
- }, oe = Z(() => import("./index-DR_FCf71.js").then((t) => t.H)), Gt = Z(() => import("./index-DOPkM2W8.js")), Vt = Z(() => import("./index-BTLD5gUt.js")), Jt = Z(() => import("./index-DYgD6BuB.js")), Xt = Z(() => import("./index-x4-W5ClM.js")), Wt = Z(() => import("./index-BIJnjJd5.js"));
13
- Z(() => import("./index-BpuJ9Njb.js"));
14
- const Zt = Z(() => import("./index-C815hPWS.js")), Yt = Z(() => import("./index-UsGqMo11.js")), Qt = Z(() => import("./index-BkX0I2aB.js")), er = Z(() => import("./index-B_EBV24V.js")), tr = Z(() => import("./index-Bd57t_yF.js")), rr = Z(() => import("./index-BjqYiZpC.js"));
15
- function Wr({ forcedMode: t }) {
16
- const { pathname: s } = It(), n = s.replace(/\/+$/, "") || "/";
17
- return t === "system" ? /* @__PURE__ */ e(oe, { forcedChatMode: "system" }) : t === "rpa" ? /* @__PURE__ */ e(oe, { forcedChatMode: "rpa" }) : t === "dev" ? /* @__PURE__ */ e(oe, { forcedChatMode: "dev" }) : n === "/workspace" ? /* @__PURE__ */ e(oe, {}) : n === "/workspace/phone" ? /* @__PURE__ */ e(Gt, {}) : n === "/workspace/from-ticket" ? /* @__PURE__ */ e(Vt, {}) : n === "/workspace/from-scenario" ? /* @__PURE__ */ e(Jt, {}) : n === "/workspace/build-by-form" ? /* @__PURE__ */ e(Xt, {}) : n === "/scenario" ? /* @__PURE__ */ e(Wt, {}) : n === "/admin" ? /* @__PURE__ */ e(oe, {}) : n === "/welcome" ? /* @__PURE__ */ e(Yt, {}) : n === "/portal" ? /* @__PURE__ */ e(Qt, {}) : n === "/chatdemo" ? /* @__PURE__ */ e(Zt, {}) : n === "/embed/chat" || n.startsWith("/embed/chat/") ? /* @__PURE__ */ e(rr, {}) : n === "/change-log" ? /* @__PURE__ */ e(er, {}) : n === "/docs" ? /* @__PURE__ */ e(tr, {}) : /* @__PURE__ */ e(oe, {});
9
+ const X = (t) => {
10
+ const i = xt(t);
11
+ return (r) => /* @__PURE__ */ e(wt, { fallback: null, children: /* @__PURE__ */ e(i, { ...r }) });
12
+ }, oe = X(() => import("./index-BtuWPnZD.js").then((t) => t.H)), Zt = X(() => import("./index-DOPkM2W8.js")), Jt = X(() => import("./index-BTLD5gUt.js")), Vt = X(() => import("./index-DYgD6BuB.js")), Wt = X(() => import("./index-x4-W5ClM.js")), Xt = X(() => import("./index-BIJnjJd5.js"));
13
+ X(() => import("./index-BpuJ9Njb.js"));
14
+ const Yt = X(() => import("./index-C815hPWS.js")), Qt = X(() => import("./index-UsGqMo11.js")), en = X(() => import("./index-BkX0I2aB.js")), tn = X(() => import("./index-B_EBV24V.js")), nn = X(() => import("./index-Bd57t_yF.js")), rn = X(() => import("./index-BjqYiZpC.js"));
15
+ function Qn({ forcedMode: t }) {
16
+ const { pathname: i } = kt(), r = i.replace(/\/+$/, "") || "/";
17
+ return t === "system" ? /* @__PURE__ */ e(oe, { forcedChatMode: "system" }) : t === "rpa" ? /* @__PURE__ */ e(oe, { forcedChatMode: "rpa" }) : t === "dev" ? /* @__PURE__ */ e(oe, { forcedChatMode: "dev" }) : r === "/workspace" ? /* @__PURE__ */ e(oe, {}) : r === "/workspace/phone" ? /* @__PURE__ */ e(Zt, {}) : r === "/workspace/from-ticket" ? /* @__PURE__ */ e(Jt, {}) : r === "/workspace/from-scenario" ? /* @__PURE__ */ e(Vt, {}) : r === "/workspace/build-by-form" ? /* @__PURE__ */ e(Wt, {}) : r === "/scenario" ? /* @__PURE__ */ e(Xt, {}) : r === "/admin" ? /* @__PURE__ */ e(oe, {}) : r === "/welcome" ? /* @__PURE__ */ e(Qt, {}) : r === "/portal" ? /* @__PURE__ */ e(en, {}) : r === "/chatdemo" ? /* @__PURE__ */ e(Yt, {}) : r === "/embed/chat" || r.startsWith("/embed/chat/") ? /* @__PURE__ */ e(rn, {}) : r === "/change-log" ? /* @__PURE__ */ e(tn, {}) : r === "/docs" ? /* @__PURE__ */ e(nn, {}) : /* @__PURE__ */ e(oe, {});
18
18
  }
19
- function nr(t) {
19
+ function an(t) {
20
20
  if (!t || typeof t != "string") return null;
21
- const s = t.split(".");
22
- if (s.length !== 3) return null;
21
+ const i = t.split(".");
22
+ if (i.length !== 3) return null;
23
23
  try {
24
- let n = s[1].replace(/-/g, "+").replace(/_/g, "/");
25
- const k = n.length % 4;
26
- k && (n += "=".repeat(4 - k));
27
- const a = atob(n), y = Uint8Array.from(a, (x) => x.charCodeAt(0)), c = new TextDecoder().decode(y), f = JSON.parse(c);
24
+ let r = i[1].replace(/-/g, "+").replace(/_/g, "/");
25
+ const S = r.length % 4;
26
+ S && (r += "=".repeat(4 - S));
27
+ const l = atob(r), y = Uint8Array.from(l, (x) => x.charCodeAt(0)), c = new TextDecoder().decode(y), f = JSON.parse(c);
28
28
  return f && typeof f == "object" && !Array.isArray(f) ? f : null;
29
29
  } catch {
30
30
  return null;
31
31
  }
32
32
  }
33
- function lr(t, s = 30) {
34
- const n = nr(t);
35
- return !n || typeof n.exp != "number" ? !0 : Date.now() / 1e3 > n.exp - s;
33
+ function ln(t, i = 30) {
34
+ const r = an(t);
35
+ return !r || typeof r.exp != "number" ? !0 : Date.now() / 1e3 > r.exp - i;
36
36
  }
37
37
  let We = !1;
38
- const ar = [
38
+ const sn = [
39
39
  "/ctc/authn/login",
40
40
  "/ctc/authn/register",
41
41
  "/ctc/authn/send-code",
@@ -53,10 +53,10 @@ const ar = [
53
53
  "/sso/login",
54
54
  "/sso/callback"
55
55
  ];
56
- function ir(t) {
57
- return ar.some((s) => t.includes(s));
56
+ function on(t) {
57
+ return sn.some((i) => t.includes(i));
58
58
  }
59
- function Ze(t) {
59
+ function Xe(t) {
60
60
  if (We || typeof window > "u" || window.location.pathname.startsWith("/login")) return;
61
61
  We = !0;
62
62
  try {
@@ -64,68 +64,68 @@ function Ze(t) {
64
64
  } catch {
65
65
  }
66
66
  console.warn(`[Auth] ${t}, 跳转到 /login`);
67
- const s = window.location.pathname + window.location.search, n = encodeURIComponent(s);
68
- window.location.href = `/login?redirect=${n}`;
67
+ const i = window.location.pathname + window.location.search, r = encodeURIComponent(i);
68
+ window.location.href = `/login?redirect=${r}`;
69
69
  }
70
- function sr(t) {
70
+ function cn(t) {
71
71
  if (t && typeof t == "object" && "code" in t && "data" in t) {
72
- const s = t;
73
- return (typeof s.success == "boolean" ? s.success : typeof s.code == "number" && s.code >= 200 && s.code < 300) ? s.data : Promise.reject(new Error(s.message || "请求失败"));
72
+ const i = t;
73
+ return (typeof i.success == "boolean" ? i.success : typeof i.code == "number" && i.code >= 200 && i.code < 300) ? i.data : Promise.reject(new Error(i.message || "请求失败"));
74
74
  }
75
75
  return t;
76
76
  }
77
- function or(t, s = {}) {
78
- const { tokenKey: n = "token", userInfoKey: k = "userInfo" } = s;
79
- t.interceptors.request.use((a) => {
80
- const y = localStorage.getItem(n);
81
- if (y && lr(y))
82
- return Ze(`请求前检测到 token 已过期 (${a.url || ""})`), Promise.reject(new He.CanceledError("token expired"));
77
+ function dn(t, i = {}) {
78
+ const { tokenKey: r = "token", userInfoKey: S = "userInfo" } = i;
79
+ t.interceptors.request.use((l) => {
80
+ const y = localStorage.getItem(r);
81
+ if (y && ln(y))
82
+ return Xe(`请求前检测到 token 已过期 (${l.url || ""})`), Promise.reject(new He.CanceledError("token expired"));
83
83
  try {
84
- const c = localStorage.getItem(k);
84
+ const c = localStorage.getItem(S);
85
85
  if (c) {
86
- const f = JSON.parse(c), x = f.tenantCode || "default", T = f.domainCode || "default", A = f.id ?? f.userId, p = (a.method || "get").toLowerCase();
87
- if (typeof a.url == "string" && a.url.includes("/ctc/ac/") && (a.params = { ...a.params || {} }, a.params.tenantCode || (a.params.tenantCode = x), a.params.domainCode || (a.params.domainCode = T)), A != null && (a.headers["X-User-Id"] = String(A)), p !== "get" && p !== "delete" && a.data && typeof a.data == "object") {
88
- const l = a.data;
89
- l.tenantCode == null && (l.tenantCode = x), l.domainCode == null && (l.domainCode = T);
86
+ const f = JSON.parse(c), x = f.tenantCode || "default", C = f.domainCode || "default", _ = f.id ?? f.userId, h = (l.method || "get").toLowerCase();
87
+ if (typeof l.url == "string" && l.url.includes("/ctc/ac/") && (l.params = { ...l.params || {} }, l.params.tenantCode || (l.params.tenantCode = x), l.params.domainCode || (l.params.domainCode = C)), _ != null && (l.headers["X-User-Id"] = String(_)), h !== "get" && h !== "delete" && l.data && typeof l.data == "object") {
88
+ const a = l.data;
89
+ a.tenantCode == null && (a.tenantCode = x), a.domainCode == null && (a.domainCode = C);
90
90
  }
91
91
  }
92
92
  } catch {
93
93
  }
94
- return a;
94
+ return l;
95
95
  }), t.interceptors.response.use(
96
- (a) => sr(a.data),
97
- (a) => {
96
+ (l) => cn(l.data),
97
+ (l) => {
98
98
  var f, x;
99
- const y = (f = a.response) == null ? void 0 : f.status, c = ((x = a.config) == null ? void 0 : x.url) || "";
100
- return y === 401 ? ir(c) ? console.warn(`[401] 公开接口返回 401 (不是 token 问题): ${c}`) : Ze(`接口 ${c} 返回 401`) : y === 403 ? console.warn("[403] 没有权限访问该资源:", c) : y === 404 ? console.warn("[404] 接口不存在:", c) : y === 500 && console.error("[500] 服务器内部错误:", c), Promise.reject(a);
99
+ const y = (f = l.response) == null ? void 0 : f.status, c = ((x = l.config) == null ? void 0 : x.url) || "";
100
+ return y === 401 ? on(c) ? console.warn(`[401] 公开接口返回 401 (不是 token 问题): ${c}`) : Xe(`接口 ${c} 返回 401`) : y === 403 ? console.warn("[403] 没有权限访问该资源:", c) : y === 404 ? console.warn("[404] 接口不存在:", c) : y === 500 && console.error("[500] 服务器内部错误:", c), Promise.reject(l);
101
101
  }
102
102
  );
103
103
  }
104
104
  function Ge(t = {}) {
105
- const s = He.create({
105
+ const i = He.create({
106
106
  baseURL: t.baseURL ?? "/api",
107
107
  timeout: t.timeout ?? 1e4,
108
108
  withCredentials: !0
109
109
  // Cookie 模式:浏览器自动携带 Cookie
110
110
  });
111
- return or(s, {
111
+ return dn(i, {
112
112
  tokenKey: t.tokenKey,
113
113
  userInfoKey: t.userInfoKey
114
- }), s;
114
+ }), i;
115
115
  }
116
- const N = Ge(), Zr = Ge(), Te = Ge({ baseURL: "/api", timeout: 1e4 }), ve = (t) => t ? typeof t.total == "number" ? t.total : Array.isArray(t) ? t.length : Array.isArray(t.records) ? t.records.length : Array.isArray(t.data) ? t.data.length : 0 : 0, cr = [
116
+ const $ = Ge(), er = Ge(), Ce = Ge({ baseURL: "/api", timeout: 1e4 }), ve = (t) => t ? typeof t.total == "number" ? t.total : Array.isArray(t) ? t.length : Array.isArray(t.records) ? t.records.length : Array.isArray(t.data) ? t.data.length : 0 : 0, un = [
117
117
  {
118
118
  key: "ai",
119
119
  color: "violet",
120
120
  title: "智能中心",
121
121
  subtitle: "Agent · 模型 · MCP · 技能",
122
- icon: /* @__PURE__ */ e(Ne, {}),
122
+ icon: /* @__PURE__ */ e($e, {}),
123
123
  href: "/ai/agent/app",
124
124
  items: [
125
125
  {
126
126
  title: "Agent 应用",
127
127
  description: "创建和管理 AI Agent 应用, 支持多种 LLM 模型",
128
- icon: /* @__PURE__ */ e(Ne, {}),
128
+ icon: /* @__PURE__ */ e($e, {}),
129
129
  color: "violet",
130
130
  tags: [{ label: "AI", color: "violet" }, { label: "推荐", color: "orange" }],
131
131
  meta: "12 个应用"
@@ -133,7 +133,7 @@ const N = Ge(), Zr = Ge(), Te = Ge({ baseURL: "/api", timeout: 1e4 }), ve = (t)
133
133
  {
134
134
  title: "多 Agent 实例",
135
135
  description: "多 Agent 协同执行, 支持 ZBOT / Hermes / Claude Code / OpenCode",
136
- icon: /* @__PURE__ */ e(Fe, {}),
136
+ icon: /* @__PURE__ */ e(qe, {}),
137
137
  color: "blue",
138
138
  tags: [{ label: "AI", color: "blue" }],
139
139
  meta: "5 种引擎"
@@ -161,27 +161,27 @@ const N = Ge(), Zr = Ge(), Te = Ge({ baseURL: "/api", timeout: 1e4 }), ve = (t)
161
161
  color: "green",
162
162
  title: "任务中心",
163
163
  subtitle: "仪表盘 · 任务 · 项目",
164
- icon: /* @__PURE__ */ e(Ee, {}),
164
+ icon: /* @__PURE__ */ e(Pe, {}),
165
165
  href: "/task/dashboard",
166
166
  items: [
167
167
  {
168
168
  title: "任务仪表盘",
169
169
  description: "实时任务执行情况, 成功率与时长统计",
170
- icon: /* @__PURE__ */ e(_t, {}),
170
+ icon: /* @__PURE__ */ e(At, {}),
171
171
  color: "green",
172
172
  tags: [{ label: "看板", color: "green" }]
173
173
  },
174
174
  {
175
175
  title: "任务列表",
176
176
  description: "所有定时/手动任务, 支持 Cron 表达式",
177
- icon: /* @__PURE__ */ e(At, {}),
177
+ icon: /* @__PURE__ */ e(_t, {}),
178
178
  color: "blue",
179
179
  tags: [{ label: "调度", color: "blue" }]
180
180
  },
181
181
  {
182
182
  title: "项目管理",
183
183
  description: "项目维度组织任务, 支持里程碑",
184
- icon: /* @__PURE__ */ e(Ee, {}),
184
+ icon: /* @__PURE__ */ e(Pe, {}),
185
185
  color: "violet",
186
186
  tags: [{ label: "项目", color: "violet" }]
187
187
  }
@@ -192,13 +192,13 @@ const N = Ge(), Zr = Ge(), Te = Ge({ baseURL: "/api", timeout: 1e4 }), ve = (t)
192
192
  color: "orange",
193
193
  title: "流程中心",
194
194
  subtitle: "审批 · 待办 · 我的",
195
- icon: /* @__PURE__ */ e($e, {}),
195
+ icon: /* @__PURE__ */ e(De, {}),
196
196
  href: "/workflow/dashboard",
197
197
  items: [
198
198
  {
199
199
  title: "流程仪表盘",
200
200
  description: "流程实例统计与效率分析",
201
- icon: /* @__PURE__ */ e($e, {}),
201
+ icon: /* @__PURE__ */ e(De, {}),
202
202
  color: "orange",
203
203
  tags: [{ label: "审批", color: "orange" }]
204
204
  },
@@ -211,29 +211,29 @@ const N = Ge(), Zr = Ge(), Te = Ge({ baseURL: "/api", timeout: 1e4 }), ve = (t)
211
211
  }
212
212
  ]
213
213
  }
214
- ], Yr = () => {
215
- const [t, s] = m({
214
+ ], tr = () => {
215
+ const [t, i] = m({
216
216
  configCount: null,
217
217
  projectCount: null,
218
218
  userCount: null,
219
219
  roleCount: null
220
220
  });
221
- return U(() => {
222
- let n = !0;
223
- const k = [
224
- Te.get("/config/list", { params: { pageSize: 1 } }).then((a) => ve(a)).then((a) => n && s((y) => ({ ...y, configCount: a }))).catch(() => n && s((a) => ({ ...a, configCount: 0 }))),
225
- Te.get("/project/user/list").then((a) => ve(a)).then((a) => n && s((y) => ({ ...y, projectCount: a }))).catch(() => n && s((a) => ({ ...a, projectCount: 0 }))),
226
- Te.get("/ctc/ac/accounts", { params: { pageSize: 1 } }).then((a) => ve(a)).then((a) => n && s((y) => ({ ...y, userCount: a }))).catch(() => n && s((a) => ({ ...a, userCount: 0 }))),
227
- Te.get("/ctc/authz/roles/list").then((a) => ve(a)).then((a) => n && s((y) => ({ ...y, roleCount: a }))).catch(() => n && s((a) => ({ ...a, roleCount: 0 })))
221
+ return F(() => {
222
+ let r = !0;
223
+ const S = [
224
+ Ce.get("/config/list", { params: { pageSize: 1 } }).then((l) => ve(l)).then((l) => r && i((y) => ({ ...y, configCount: l }))).catch(() => r && i((l) => ({ ...l, configCount: 0 }))),
225
+ Ce.get("/project/user/list").then((l) => ve(l)).then((l) => r && i((y) => ({ ...y, projectCount: l }))).catch(() => r && i((l) => ({ ...l, projectCount: 0 }))),
226
+ Ce.get("/ctc/ac/accounts", { params: { pageSize: 1 } }).then((l) => ve(l)).then((l) => r && i((y) => ({ ...y, userCount: l }))).catch(() => r && i((l) => ({ ...l, userCount: 0 }))),
227
+ Ce.get("/ctc/authz/roles/list").then((l) => ve(l)).then((l) => r && i((y) => ({ ...y, roleCount: l }))).catch(() => r && i((l) => ({ ...l, roleCount: 0 })))
228
228
  ];
229
229
  return () => {
230
- n = !1, k.forEach((a) => {
230
+ r = !1, S.forEach((l) => {
231
231
  var y;
232
- return (y = a == null ? void 0 : a.catch) == null ? void 0 : y.call(a, () => {
232
+ return (y = l == null ? void 0 : l.catch) == null ? void 0 : y.call(l, () => {
233
233
  });
234
234
  });
235
235
  };
236
- }, []), /* @__PURE__ */ r("div", { children: [
236
+ }, []), /* @__PURE__ */ n("div", { children: [
237
237
  /* @__PURE__ */ e(
238
238
  ye,
239
239
  {
@@ -242,11 +242,11 @@ const N = Ge(), Zr = Ge(), Te = Ge({ baseURL: "/api", timeout: 1e4 }), ve = (t)
242
242
  breadcrumb: [{ label: "首页" }]
243
243
  }
244
244
  ),
245
- /* @__PURE__ */ r(Y, { gutter: [16, 16], children: [
246
- /* @__PURE__ */ e(z, { xs: 24, sm: 12, md: 12, lg: 6, children: /* @__PURE__ */ e(
247
- Ce,
245
+ /* @__PURE__ */ n(Y, { gutter: [16, 16], children: [
246
+ /* @__PURE__ */ e(O, { xs: 24, sm: 12, md: 12, lg: 6, children: /* @__PURE__ */ e(
247
+ Te,
248
248
  {
249
- icon: /* @__PURE__ */ e(Tt, {}),
249
+ icon: /* @__PURE__ */ e(Ct, {}),
250
250
  label: "配置中心",
251
251
  value: t.configCount,
252
252
  suffix: "条",
@@ -255,10 +255,10 @@ const N = Ge(), Zr = Ge(), Te = Ge({ baseURL: "/api", timeout: 1e4 }), ve = (t)
255
255
  href: "/config/list"
256
256
  }
257
257
  ) }),
258
- /* @__PURE__ */ e(z, { xs: 24, sm: 12, md: 12, lg: 6, children: /* @__PURE__ */ e(
259
- Ce,
258
+ /* @__PURE__ */ e(O, { xs: 24, sm: 12, md: 12, lg: 6, children: /* @__PURE__ */ e(
259
+ Te,
260
260
  {
261
- icon: /* @__PURE__ */ e(Ee, {}),
261
+ icon: /* @__PURE__ */ e(Pe, {}),
262
262
  label: "我的项目",
263
263
  value: t.projectCount,
264
264
  suffix: "个",
@@ -267,8 +267,8 @@ const N = Ge(), Zr = Ge(), Te = Ge({ baseURL: "/api", timeout: 1e4 }), ve = (t)
267
267
  href: "/project/list"
268
268
  }
269
269
  ) }),
270
- /* @__PURE__ */ e(z, { xs: 24, sm: 12, md: 12, lg: 6, children: /* @__PURE__ */ e(
271
- Ce,
270
+ /* @__PURE__ */ e(O, { xs: 24, sm: 12, md: 12, lg: 6, children: /* @__PURE__ */ e(
271
+ Te,
272
272
  {
273
273
  icon: /* @__PURE__ */ e(ut, {}),
274
274
  label: "账号数",
@@ -279,10 +279,10 @@ const N = Ge(), Zr = Ge(), Te = Ge({ baseURL: "/api", timeout: 1e4 }), ve = (t)
279
279
  href: "/ctc/4a/account"
280
280
  }
281
281
  ) }),
282
- /* @__PURE__ */ e(z, { xs: 24, sm: 12, md: 12, lg: 6, children: /* @__PURE__ */ e(
283
- Ce,
282
+ /* @__PURE__ */ e(O, { xs: 24, sm: 12, md: 12, lg: 6, children: /* @__PURE__ */ e(
283
+ Te,
284
284
  {
285
- icon: /* @__PURE__ */ e($e, {}),
285
+ icon: /* @__PURE__ */ e(De, {}),
286
286
  label: "角色数",
287
287
  value: t.roleCount,
288
288
  suffix: "个",
@@ -292,18 +292,18 @@ const N = Ge(), Zr = Ge(), Te = Ge({ baseURL: "/api", timeout: 1e4 }), ve = (t)
292
292
  }
293
293
  ) })
294
294
  ] }),
295
- cr.map((n) => /* @__PURE__ */ r("div", { style: { marginBottom: 32 }, children: [
295
+ un.map((r) => /* @__PURE__ */ n("div", { style: { marginBottom: 32 }, children: [
296
296
  /* @__PURE__ */ e(
297
- jt,
297
+ Ut,
298
298
  {
299
- color: n.color,
300
- title: n.title,
301
- subtitle: n.subtitle,
302
- moreHref: n.href
299
+ color: r.color,
300
+ title: r.title,
301
+ subtitle: r.subtitle,
302
+ moreHref: r.href
303
303
  }
304
304
  ),
305
- /* @__PURE__ */ e(Y, { gutter: [16, 16], children: n.items.map((k, a) => /* @__PURE__ */ e(
306
- z,
305
+ /* @__PURE__ */ e(Y, { gutter: [16, 16], children: r.items.map((S, l) => /* @__PURE__ */ e(
306
+ O,
307
307
  {
308
308
  xs: 24,
309
309
  sm: 12,
@@ -312,21 +312,21 @@ const N = Ge(), Zr = Ge(), Te = Ge({ baseURL: "/api", timeout: 1e4 }), ve = (t)
312
312
  xl: 6,
313
313
  xxl: 6,
314
314
  children: /* @__PURE__ */ e(
315
- Ft,
315
+ qt,
316
316
  {
317
- title: k.title,
318
- description: k.description,
319
- icon: k.icon,
320
- color: k.color,
321
- tags: k.tags,
322
- meta: k.meta,
323
- href: n.href
317
+ title: S.title,
318
+ description: S.description,
319
+ icon: S.icon,
320
+ color: S.color,
321
+ tags: S.tags,
322
+ meta: S.meta,
323
+ href: r.href
324
324
  }
325
325
  )
326
326
  },
327
- a
327
+ l
328
328
  )) })
329
- ] }, n.key)),
329
+ ] }, r.key)),
330
330
  /* @__PURE__ */ e(
331
331
  Kt,
332
332
  {
@@ -339,60 +339,60 @@ const N = Ge(), Zr = Ge(), Te = Ge({ baseURL: "/api", timeout: 1e4 }), ve = (t)
339
339
  )
340
340
  ] });
341
341
  };
342
- let dr = "/api";
342
+ let pn = "/api";
343
343
  function bt() {
344
- return He.create({ baseURL: dr, timeout: 15e3, withCredentials: !0 });
344
+ return He.create({ baseURL: pn, timeout: 15e3, withCredentials: !0 });
345
345
  }
346
- const Se = bt(), ur = bt();
347
- ur.interceptors.request.use((t) => t);
348
- Se.interceptors.request.use((t) => t);
349
- const Re = "/mock-platform", G = (t, s) => Se.get(`${Re}${t}`, { params: s }).then((n) => n.data), F = (t, s, n) => Se.post(`${Re}${t}`, s, { params: n }).then((k) => k.data), _e = (t, s, n) => Se.put(`${Re}${t}`, s, { params: n }).then((k) => k.data), ce = (t, s) => Se.delete(`${Re}${t}`, { params: s }).then((n) => n.data), q = {
346
+ const Ie = bt(), hn = bt();
347
+ hn.interceptors.request.use((t) => t);
348
+ Ie.interceptors.request.use((t) => t);
349
+ const ze = "/mock-platform", G = (t, i) => Ie.get(`${ze}${t}`, { params: i }).then((r) => r.data), q = (t, i, r) => Ie.post(`${ze}${t}`, i, { params: r }).then((S) => S.data), Ae = (t, i, r) => Ie.put(`${ze}${t}`, i, { params: r }).then((S) => S.data), ce = (t, i) => Ie.delete(`${ze}${t}`, { params: i }).then((r) => r.data), j = {
350
350
  stats: () => G("/stats"),
351
351
  environments: {
352
352
  list: () => G("/environments/list"),
353
- create: (t) => F("/environments", t),
354
- update: (t, s) => _e("/environments", s, { envCode: t }),
353
+ create: (t) => q("/environments", t),
354
+ update: (t, i) => Ae("/environments", i, { envCode: t }),
355
355
  delete: (t) => ce("/environments", { envCode: t })
356
356
  },
357
357
  endpoints: {
358
- list: (t, s, n) => G("/endpoints/list", { envCode: t, scenarioCode: s, status: n }),
358
+ list: (t, i, r) => G("/endpoints/list", { envCode: t, scenarioCode: i, status: r }),
359
359
  get: (t) => G("/endpoints/byCode", { mockCode: t }),
360
- create: (t) => F("/endpoints", t),
361
- update: (t, s) => _e("/endpoints", s, { mockCode: t }),
360
+ create: (t) => q("/endpoints", t),
361
+ update: (t, i) => Ae("/endpoints", i, { mockCode: t }),
362
362
  delete: (t) => ce("/endpoints", { mockCode: t }),
363
- toggle: (t, s) => F("/endpoints/toggle", null, { mockCode: t, status: s })
363
+ toggle: (t, i) => q("/endpoints/toggle", null, { mockCode: t, status: i })
364
364
  },
365
365
  scenarios: {
366
366
  list: () => G("/scenarios/list"),
367
367
  get: (t) => G("/scenarios/byCode", { scenarioCode: t }),
368
- create: (t) => F("/scenarios", t),
369
- update: (t, s) => _e("/scenarios", s, { scenarioCode: t }),
368
+ create: (t) => q("/scenarios", t),
369
+ update: (t, i) => Ae("/scenarios", i, { scenarioCode: t }),
370
370
  delete: (t) => ce("/scenarios", { scenarioCode: t }),
371
- reset: (t) => F("/scenarios/reset", null, { scenarioCode: t }),
371
+ reset: (t) => q("/scenarios/reset", null, { scenarioCode: t }),
372
372
  instances: (t) => G("/scenarios/instances", { scenarioCode: t })
373
373
  },
374
374
  cases: {
375
375
  list: () => G("/cases/list"),
376
376
  get: (t) => G("/cases/byCode", { caseCode: t }),
377
- create: (t) => F("/cases", t),
378
- update: (t, s) => _e("/cases", s, { caseCode: t }),
377
+ create: (t) => q("/cases", t),
378
+ update: (t, i) => Ae("/cases", i, { caseCode: t }),
379
379
  delete: (t) => ce("/cases", { caseCode: t }),
380
- run: (t) => F("/cases/run", null, { caseCode: t }),
381
- runBatch: (t) => F("/cases/run-batch", { caseCodes: t })
380
+ run: (t) => q("/cases/run", null, { caseCode: t }),
381
+ runBatch: (t) => q("/cases/run-batch", { caseCodes: t })
382
382
  },
383
383
  recordings: {
384
384
  list: () => G("/recordings/list"),
385
385
  get: (t) => G("/recordings/byCode", { recordingCode: t }),
386
386
  requests: (t) => G("/recordings/requests", { recordingCode: t }),
387
- start: (t, s, n) => F("/recordings/start", {
387
+ start: (t, i, r) => q("/recordings/start", {
388
388
  recordingCode: t,
389
- recordingName: s,
390
- targetUrl: n
389
+ recordingName: i,
390
+ targetUrl: r
391
391
  }),
392
- stop: (t) => F("/recordings/stop", null, { recordingCode: t }),
393
- export: (t, s) => F("/recordings/export", { recordingCode: t, projectCode: s }),
394
- import: (t, s) => F("/recordings/import", { recordingCode: t, projectCode: s }),
395
- playback: (t, s) => F("/recordings/playback", { recordingCode: t, targetUrl: s }),
392
+ stop: (t) => q("/recordings/stop", null, { recordingCode: t }),
393
+ export: (t, i) => q("/recordings/export", { recordingCode: t, projectCode: i }),
394
+ import: (t, i) => q("/recordings/import", { recordingCode: t, projectCode: i }),
395
+ playback: (t, i) => q("/recordings/playback", { recordingCode: t, targetUrl: i }),
396
396
  delete: (t) => ce("/recordings", { recordingCode: t })
397
397
  },
398
398
  requestLogs: {
@@ -401,41 +401,41 @@ const Re = "/mock-platform", G = (t, s) => Se.get(`${Re}${t}`, { params: s }).th
401
401
  clear: (t) => ce("/request-logs/clear", { limit: t })
402
402
  },
403
403
  curl: {
404
- parse: (t) => F("/curl/parse", { curlText: t }),
405
- run: (t) => F("/curl/run", { curlText: t }),
406
- importAsCase: (t) => F("/curl/import-as-case", t),
407
- importAsEndpoint: (t) => F("/curl/import-as-endpoint", t)
404
+ parse: (t) => q("/curl/parse", { curlText: t }),
405
+ run: (t) => q("/curl/run", { curlText: t }),
406
+ importAsCase: (t) => q("/curl/import-as-case", t),
407
+ importAsEndpoint: (t) => q("/curl/import-as-endpoint", t)
408
408
  },
409
409
  openapi: {
410
- parse: (t) => F("/openapi/parse", { content: t }),
411
- importBatch: (t) => F("/openapi/import-batch", t),
410
+ parse: (t) => q("/openapi/parse", { content: t }),
411
+ importBatch: (t) => q("/openapi/import-batch", t),
412
412
  sample: (t) => G("/openapi/sample", { format: t })
413
413
  }
414
- }, { Text: ae, Paragraph: hr } = le, Ye = { GET: "green", POST: "blue", PUT: "orange", DELETE: "red", PATCH: "purple" };
414
+ }, { Text: le, Paragraph: mn } = ae, Ye = { GET: "green", POST: "blue", PUT: "orange", DELETE: "red", PATCH: "purple" };
415
415
  function Be({ activeEnvCode: t }) {
416
- const [s, n] = m([]), [k, a] = m(!1), [y, c] = m(null), [f, x] = m(!1), [T, A] = m(null);
417
- U(() => {
418
- p();
416
+ const [i, r] = m([]), [S, l] = m(!1), [y, c] = m(null), [f, x] = m(!1), [C, _] = m(null);
417
+ F(() => {
418
+ h();
419
419
  }, [t]);
420
- const p = async () => {
421
- a(!0), c(null);
420
+ const h = async () => {
421
+ l(!0), c(null);
422
422
  try {
423
- const g = await q.endpoints.list(t);
424
- n(Array.isArray(g) ? g : []);
423
+ const g = await j.endpoints.list(t);
424
+ r(Array.isArray(g) ? g : []);
425
425
  } catch (g) {
426
- c((g == null ? void 0 : g.message) || "API unavailable"), n([]);
426
+ c((g == null ? void 0 : g.message) || "API unavailable"), r([]);
427
427
  } finally {
428
- a(!1);
428
+ l(!1);
429
429
  }
430
- }, l = (g) => `${window.location.origin}/api/mock/${g.env_code || t || "default"}${g.path || ""}`, d = [
430
+ }, a = (g) => `${window.location.origin}/api/mock/${g.env_code || t || "default"}${g.path || ""}`, d = [
431
431
  {
432
432
  title: "路径",
433
433
  dataIndex: "path",
434
434
  key: "path",
435
435
  width: 280,
436
- render: (g, v) => /* @__PURE__ */ r(P, { children: [
436
+ render: (g, v) => /* @__PURE__ */ n(E, { children: [
437
437
  /* @__PURE__ */ e(w, { color: Ye[v.method] || "default", children: v.method }),
438
- /* @__PURE__ */ e(ae, { code: !0, copyable: { text: g }, children: g })
438
+ /* @__PURE__ */ e(le, { code: !0, copyable: { text: g }, children: g })
439
439
  ] })
440
440
  },
441
441
  { title: "编码", dataIndex: "mock_code", key: "mock_code", width: 160 },
@@ -445,7 +445,7 @@ function Be({ activeEnvCode: t }) {
445
445
  key: "priority",
446
446
  width: 80,
447
447
  align: "center",
448
- render: (g) => /* @__PURE__ */ r(w, { color: "blue", children: [
448
+ render: (g) => /* @__PURE__ */ n(w, { color: "blue", children: [
449
449
  "P",
450
450
  g || 5
451
451
  ] })
@@ -457,24 +457,24 @@ function Be({ activeEnvCode: t }) {
457
457
  key: "delay_ms",
458
458
  width: 80,
459
459
  align: "center",
460
- render: (g) => g > 0 ? /* @__PURE__ */ r(ae, { type: "warning", children: [
460
+ render: (g) => g > 0 ? /* @__PURE__ */ n(le, { type: "warning", children: [
461
461
  g,
462
462
  "ms"
463
- ] }) : /* @__PURE__ */ e(ae, { type: "secondary", children: "-" })
463
+ ] }) : /* @__PURE__ */ e(le, { type: "secondary", children: "-" })
464
464
  },
465
465
  {
466
466
  title: "故障",
467
467
  dataIndex: "fault_type",
468
468
  key: "fault_type",
469
469
  width: 110,
470
- render: (g) => g && g !== "NONE" ? /* @__PURE__ */ e(w, { color: "red", children: g }) : /* @__PURE__ */ e(ae, { type: "secondary", children: "-" })
470
+ render: (g) => g && g !== "NONE" ? /* @__PURE__ */ e(w, { color: "red", children: g }) : /* @__PURE__ */ e(le, { type: "secondary", children: "-" })
471
471
  },
472
472
  {
473
473
  title: "场景",
474
474
  dataIndex: "scenario_code",
475
475
  key: "scenario_code",
476
476
  width: 130,
477
- render: (g) => g ? /* @__PURE__ */ e(w, { color: "purple", children: g }) : /* @__PURE__ */ e(ae, { type: "secondary", children: "-" })
477
+ render: (g) => g ? /* @__PURE__ */ e(w, { color: "purple", children: g }) : /* @__PURE__ */ e(le, { type: "secondary", children: "-" })
478
478
  },
479
479
  {
480
480
  title: "命中",
@@ -482,7 +482,7 @@ function Be({ activeEnvCode: t }) {
482
482
  key: "hit_count",
483
483
  width: 80,
484
484
  align: "center",
485
- render: (g) => /* @__PURE__ */ e(ae, { strong: !0, children: g || 0 })
485
+ render: (g) => /* @__PURE__ */ e(le, { strong: !0, children: g || 0 })
486
486
  },
487
487
  {
488
488
  title: "状态",
@@ -497,36 +497,36 @@ function Be({ activeEnvCode: t }) {
497
497
  key: "action",
498
498
  width: 160,
499
499
  fixed: "right",
500
- render: (g, v) => /* @__PURE__ */ r(P, { size: "small", children: [
501
- /* @__PURE__ */ e(pe, { title: "预览响应", children: /* @__PURE__ */ e(
502
- _,
500
+ render: (g, v) => /* @__PURE__ */ n(E, { size: "small", children: [
501
+ /* @__PURE__ */ e(he, { title: "预览响应", children: /* @__PURE__ */ e(
502
+ A,
503
503
  {
504
504
  size: "small",
505
505
  type: "link",
506
- icon: /* @__PURE__ */ e(Pe, {}),
506
+ icon: /* @__PURE__ */ e(Ee, {}),
507
507
  onClick: () => {
508
- A(v), x(!0);
508
+ _(v), x(!0);
509
509
  },
510
510
  children: "预览"
511
511
  }
512
512
  ) }),
513
- /* @__PURE__ */ e(pe, { title: "复制URL", children: /* @__PURE__ */ e(
514
- _,
513
+ /* @__PURE__ */ e(he, { title: "复制URL", children: /* @__PURE__ */ e(
514
+ A,
515
515
  {
516
516
  size: "small",
517
517
  type: "link",
518
- icon: /* @__PURE__ */ e(ht, {}),
518
+ icon: /* @__PURE__ */ e(pt, {}),
519
519
  onClick: () => {
520
- navigator.clipboard.writeText(l(v)), b.success("已复制");
520
+ navigator.clipboard.writeText(a(v)), b.success("已复制");
521
521
  }
522
522
  }
523
523
  ) })
524
524
  ] })
525
525
  }
526
526
  ];
527
- return /* @__PURE__ */ r("div", { children: [
527
+ return /* @__PURE__ */ n("div", { children: [
528
528
  y && /* @__PURE__ */ e(
529
- V,
529
+ Z,
530
530
  {
531
531
  type: "warning",
532
532
  showIcon: !0,
@@ -535,35 +535,35 @@ function Be({ activeEnvCode: t }) {
535
535
  description: y
536
536
  }
537
537
  ),
538
- /* @__PURE__ */ r(Y, { gutter: 16, style: { marginBottom: 16 }, children: [
539
- /* @__PURE__ */ e(z, { span: 6, children: /* @__PURE__ */ r(M, { children: [
538
+ /* @__PURE__ */ n(Y, { gutter: 16, style: { marginBottom: 16 }, children: [
539
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ n(L, { children: [
540
540
  /* @__PURE__ */ e("strong", { children: "总端点" }),
541
- /* @__PURE__ */ e("div", { style: { fontSize: 22 }, children: s.length })
541
+ /* @__PURE__ */ e("div", { style: { fontSize: 22 }, children: i.length })
542
542
  ] }) }),
543
- /* @__PURE__ */ e(z, { span: 6, children: /* @__PURE__ */ r(M, { children: [
543
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ n(L, { children: [
544
544
  /* @__PURE__ */ e("strong", { children: "已启用" }),
545
- /* @__PURE__ */ e("div", { style: { fontSize: 22, color: "#52c41a" }, children: s.filter((g) => g.status === 1).length })
545
+ /* @__PURE__ */ e("div", { style: { fontSize: 22, color: "#52c41a" }, children: i.filter((g) => g.status === 1).length })
546
546
  ] }) }),
547
- /* @__PURE__ */ e(z, { span: 6, children: /* @__PURE__ */ r(M, { children: [
547
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ n(L, { children: [
548
548
  /* @__PURE__ */ e("strong", { children: "已禁用" }),
549
- /* @__PURE__ */ e("div", { style: { fontSize: 22, color: "#ff4d4f" }, children: s.filter((g) => g.status === 0).length })
549
+ /* @__PURE__ */ e("div", { style: { fontSize: 22, color: "#ff4d4f" }, children: i.filter((g) => g.status === 0).length })
550
550
  ] }) }),
551
- /* @__PURE__ */ e(z, { span: 6, children: /* @__PURE__ */ r(M, { children: [
551
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ n(L, { children: [
552
552
  /* @__PURE__ */ e("strong", { children: "总命中" }),
553
553
  /* @__PURE__ */ e("div", { style: {
554
554
  fontSize: 22,
555
555
  color: "#1890ff"
556
- }, children: s.reduce((g, v) => g + (v.hit_count || 0), 0) })
556
+ }, children: i.reduce((g, v) => g + (v.hit_count || 0), 0) })
557
557
  ] }) })
558
558
  ] }),
559
- /* @__PURE__ */ e(P, { style: { marginBottom: 16 }, children: /* @__PURE__ */ e(_, { icon: /* @__PURE__ */ e(ee, {}), onClick: p, children: "刷新" }) }),
559
+ /* @__PURE__ */ e(E, { style: { marginBottom: 16 }, children: /* @__PURE__ */ e(A, { icon: /* @__PURE__ */ e(ee, {}), onClick: h, children: "刷新" }) }),
560
560
  /* @__PURE__ */ e(
561
561
  Q,
562
562
  {
563
- dataSource: s,
563
+ dataSource: i,
564
564
  columns: d,
565
565
  rowKey: "id",
566
- loading: k,
566
+ loading: S,
567
567
  pagination: { pageSize: 10 },
568
568
  scroll: { x: 1300 },
569
569
  size: "small"
@@ -572,37 +572,37 @@ function Be({ activeEnvCode: t }) {
572
572
  /* @__PURE__ */ e(
573
573
  we,
574
574
  {
575
- title: /* @__PURE__ */ r(P, { children: [
576
- /* @__PURE__ */ e(Et, {}),
575
+ title: /* @__PURE__ */ n(E, { children: [
576
+ /* @__PURE__ */ e(Pt, {}),
577
577
  "端点详情: ",
578
- T == null ? void 0 : T.mock_code
578
+ C == null ? void 0 : C.mock_code
579
579
  ] }),
580
580
  open: f,
581
581
  onClose: () => x(!1),
582
582
  size: "large",
583
- children: T && /* @__PURE__ */ r("div", { children: [
584
- /* @__PURE__ */ r(R, { column: 2, size: "small", bordered: !0, style: { marginBottom: 16 }, children: [
585
- /* @__PURE__ */ e(R.Item, { label: "编码", children: T.mock_code }),
586
- /* @__PURE__ */ e(R.Item, { label: "名称", children: T.mock_name }),
587
- /* @__PURE__ */ e(R.Item, { label: "方法", children: /* @__PURE__ */ e(w, { color: Ye[T.method], children: T.method }) }),
588
- /* @__PURE__ */ e(R.Item, { label: "环境", children: T.env_code }),
589
- /* @__PURE__ */ e(R.Item, { label: "路径", span: 2, children: T.path }),
590
- /* @__PURE__ */ e(R.Item, { label: "状态码", children: T.status_code }),
591
- /* @__PURE__ */ r(R.Item, { label: "延迟", children: [
592
- T.delay_ms,
583
+ children: C && /* @__PURE__ */ n("div", { children: [
584
+ /* @__PURE__ */ n(z, { column: 2, size: "small", bordered: !0, style: { marginBottom: 16 }, children: [
585
+ /* @__PURE__ */ e(z.Item, { label: "编码", children: C.mock_code }),
586
+ /* @__PURE__ */ e(z.Item, { label: "名称", children: C.mock_name }),
587
+ /* @__PURE__ */ e(z.Item, { label: "方法", children: /* @__PURE__ */ e(w, { color: Ye[C.method], children: C.method }) }),
588
+ /* @__PURE__ */ e(z.Item, { label: "环境", children: C.env_code }),
589
+ /* @__PURE__ */ e(z.Item, { label: "路径", span: 2, children: C.path }),
590
+ /* @__PURE__ */ e(z.Item, { label: "状态码", children: C.status_code }),
591
+ /* @__PURE__ */ n(z.Item, { label: "延迟", children: [
592
+ C.delay_ms,
593
593
  "ms"
594
594
  ] }),
595
- /* @__PURE__ */ r(R.Item, { label: "优先级", children: [
595
+ /* @__PURE__ */ n(z.Item, { label: "优先级", children: [
596
596
  "P",
597
- T.priority
597
+ C.priority
598
598
  ] }),
599
- /* @__PURE__ */ e(R.Item, { label: "命中", children: T.hit_count || 0 }),
600
- /* @__PURE__ */ e(R.Item, { label: "故障", children: T.fault_type && T.fault_type !== "NONE" ? /* @__PURE__ */ e(w, { color: "red", children: T.fault_type }) : /* @__PURE__ */ e(ae, { type: "secondary", children: "-" }) }),
601
- /* @__PURE__ */ e(R.Item, { label: "场景", children: T.scenario_code || "-" }),
602
- /* @__PURE__ */ e(R.Item, { label: "状态", span: 2, children: T.status === 1 ? /* @__PURE__ */ e(w, { color: "green", children: "启用" }) : /* @__PURE__ */ e(w, { children: "禁用" }) }),
603
- /* @__PURE__ */ e(R.Item, { label: "完整 URL", span: 2, children: /* @__PURE__ */ e(ae, { copyable: !0, children: l(T) }) })
599
+ /* @__PURE__ */ e(z.Item, { label: "命中", children: C.hit_count || 0 }),
600
+ /* @__PURE__ */ e(z.Item, { label: "故障", children: C.fault_type && C.fault_type !== "NONE" ? /* @__PURE__ */ e(w, { color: "red", children: C.fault_type }) : /* @__PURE__ */ e(le, { type: "secondary", children: "-" }) }),
601
+ /* @__PURE__ */ e(z.Item, { label: "场景", children: C.scenario_code || "-" }),
602
+ /* @__PURE__ */ e(z.Item, { label: "状态", span: 2, children: C.status === 1 ? /* @__PURE__ */ e(w, { color: "green", children: "启用" }) : /* @__PURE__ */ e(w, { children: "禁用" }) }),
603
+ /* @__PURE__ */ e(z.Item, { label: "完整 URL", span: 2, children: /* @__PURE__ */ e(le, { copyable: !0, children: a(C) }) })
604
604
  ] }),
605
- /* @__PURE__ */ e(hr, { strong: !0, children: "响应模板:" }),
605
+ /* @__PURE__ */ e(mn, { strong: !0, children: "响应模板:" }),
606
606
  /* @__PURE__ */ e("pre", { style: {
607
607
  background: "#f5f5f5",
608
608
  padding: 12,
@@ -613,65 +613,65 @@ function Be({ activeEnvCode: t }) {
613
613
  fontFamily: "monospace",
614
614
  whiteSpace: "pre-wrap",
615
615
  wordBreak: "break-all"
616
- }, children: T.response_template })
616
+ }, children: C.response_template })
617
617
  ] })
618
618
  }
619
619
  )
620
620
  ] });
621
621
  }
622
- const { Text: ze } = le, pr = { MOCK: "green", REAL: "blue", MIXED: "orange" };
623
- function qe({ onEnvChange: t }) {
624
- const [s, n] = m([]), [k, a] = m(!1);
625
- U(() => {
622
+ const { Text: Oe } = ae, yn = { MOCK: "green", REAL: "blue", MIXED: "orange" };
623
+ function je({ onEnvChange: t }) {
624
+ const [i, r] = m([]), [S, l] = m(!1);
625
+ F(() => {
626
626
  y();
627
627
  }, []);
628
628
  const y = async () => {
629
- a(!0);
629
+ l(!0);
630
630
  try {
631
- const f = await q.environments.list();
632
- n(Array.isArray(f) ? f : []);
631
+ const f = await j.environments.list();
632
+ r(Array.isArray(f) ? f : []);
633
633
  } catch (f) {
634
634
  b.warning("加载环境列表失败: " + (f == null ? void 0 : f.message));
635
635
  } finally {
636
- a(!1);
636
+ l(!1);
637
637
  }
638
638
  };
639
- return /* @__PURE__ */ r("div", { children: [
639
+ return /* @__PURE__ */ n("div", { children: [
640
640
  /* @__PURE__ */ e(
641
- V,
641
+ Z,
642
642
  {
643
643
  type: "info",
644
644
  showIcon: !0,
645
645
  style: { marginBottom: 16 },
646
646
  message: "环境隔离 - 控制 Mock 与真实服务的切换",
647
- description: /* @__PURE__ */ r("div", { children: [
648
- /* @__PURE__ */ r("div", { children: [
647
+ description: /* @__PURE__ */ n("div", { children: [
648
+ /* @__PURE__ */ n("div", { children: [
649
649
  /* @__PURE__ */ e(w, { color: "green", children: "MOCK" }),
650
650
  " 完全拦截,仅返回 Mock 数据"
651
651
  ] }),
652
- /* @__PURE__ */ r("div", { children: [
652
+ /* @__PURE__ */ n("div", { children: [
653
653
  /* @__PURE__ */ e(w, { color: "blue", children: "REAL" }),
654
654
  " 全部代理到 base_url(适合压测、回归测试)"
655
655
  ] }),
656
- /* @__PURE__ */ r("div", { children: [
656
+ /* @__PURE__ */ n("div", { children: [
657
657
  /* @__PURE__ */ e(w, { color: "orange", children: "MIXED" }),
658
658
  " Mock 优先,未匹配时转发到 base_url(开发联调)"
659
659
  ] })
660
660
  ] })
661
661
  }
662
662
  ),
663
- /* @__PURE__ */ e(P, { style: { marginBottom: 16 }, children: /* @__PURE__ */ e(_, { icon: /* @__PURE__ */ e(ee, {}), onClick: y, children: "刷新" }) }),
663
+ /* @__PURE__ */ e(E, { style: { marginBottom: 16 }, children: /* @__PURE__ */ e(A, { icon: /* @__PURE__ */ e(ee, {}), onClick: y, children: "刷新" }) }),
664
664
  /* @__PURE__ */ e(
665
665
  Q,
666
666
  {
667
- dataSource: s,
667
+ dataSource: i,
668
668
  columns: [
669
669
  {
670
670
  title: "环境编码",
671
671
  dataIndex: "env_code",
672
672
  key: "env_code",
673
673
  width: 140,
674
- render: (f) => /* @__PURE__ */ e(ze, { code: !0, children: f })
674
+ render: (f) => /* @__PURE__ */ e(Oe, { code: !0, children: f })
675
675
  },
676
676
  { title: "环境名称", dataIndex: "env_name", key: "env_name", width: 160 },
677
677
  {
@@ -679,13 +679,13 @@ function qe({ onEnvChange: t }) {
679
679
  dataIndex: "env_type",
680
680
  key: "env_type",
681
681
  width: 240,
682
- render: (f) => /* @__PURE__ */ e(w, { color: pr[f] || "default", children: f })
682
+ render: (f) => /* @__PURE__ */ e(w, { color: yn[f] || "default", children: f })
683
683
  },
684
684
  {
685
685
  title: "真实服务地址",
686
686
  dataIndex: "base_url",
687
687
  key: "base_url",
688
- render: (f) => f ? /* @__PURE__ */ e(ze, { copyable: !0, children: f }) : /* @__PURE__ */ e(ze, { type: "secondary", children: "-" })
688
+ render: (f) => f ? /* @__PURE__ */ e(Oe, { copyable: !0, children: f }) : /* @__PURE__ */ e(Oe, { type: "secondary", children: "-" })
689
689
  },
690
690
  {
691
691
  title: "默认",
@@ -706,12 +706,12 @@ function qe({ onEnvChange: t }) {
706
706
  title: "操作",
707
707
  key: "action",
708
708
  width: 120,
709
- render: (f, x) => /* @__PURE__ */ e(P, { size: "small", children: /* @__PURE__ */ e(
710
- _,
709
+ render: (f, x) => /* @__PURE__ */ e(E, { size: "small", children: /* @__PURE__ */ e(
710
+ A,
711
711
  {
712
712
  size: "small",
713
713
  type: "link",
714
- icon: /* @__PURE__ */ e(pt, {}),
714
+ icon: /* @__PURE__ */ e(ht, {}),
715
715
  onClick: () => {
716
716
  t && t(x.env_code);
717
717
  },
@@ -721,46 +721,46 @@ function qe({ onEnvChange: t }) {
721
721
  }
722
722
  ],
723
723
  rowKey: "id",
724
- loading: k,
724
+ loading: S,
725
725
  pagination: { pageSize: 10 },
726
726
  size: "small"
727
727
  }
728
728
  )
729
729
  ] });
730
730
  }
731
- const { Text: mr } = le;
732
- function yr() {
733
- const [t, s] = m([]), [n, k] = m(!1), [a, y] = m(!1), [c, f] = m(null);
734
- U(() => {
731
+ const { Text: gn } = ae;
732
+ function fn() {
733
+ const [t, i] = m([]), [r, S] = m(!1), [l, y] = m(!1), [c, f] = m(null);
734
+ F(() => {
735
735
  x();
736
736
  }, []);
737
737
  const x = async () => {
738
- k(!0);
738
+ S(!0);
739
739
  try {
740
- const l = await q.scenarios.list();
741
- s(Array.isArray(l) ? l : []);
740
+ const a = await j.scenarios.list();
741
+ i(Array.isArray(a) ? a : []);
742
742
  } catch {
743
743
  b.warning("加载场景列表失败");
744
744
  } finally {
745
- k(!1);
745
+ S(!1);
746
746
  }
747
- }, T = async (l) => {
747
+ }, C = async (a) => {
748
748
  try {
749
- await q.scenarios.reset(l), b.success("已重置所有实例状态");
749
+ await j.scenarios.reset(a), b.success("已重置所有实例状态");
750
750
  } catch {
751
751
  b.error("重置失败");
752
752
  }
753
- }, A = async (l) => {
753
+ }, _ = async (a) => {
754
754
  try {
755
- const d = await q.scenarios.instances(l);
756
- f({ code: l, list: d }), y(!0);
755
+ const d = await j.scenarios.instances(a);
756
+ f({ code: a, list: d }), y(!0);
757
757
  } catch {
758
758
  b.error("加载失败");
759
759
  }
760
760
  };
761
- return /* @__PURE__ */ r("div", { children: [
761
+ return /* @__PURE__ */ n("div", { children: [
762
762
  /* @__PURE__ */ e(
763
- V,
763
+ Z,
764
764
  {
765
765
  type: "info",
766
766
  showIcon: !0,
@@ -769,7 +769,7 @@ function yr() {
769
769
  description: "用状态机驱动 Mock 集合,模拟完整业务流程(如:未登录→登录中→已登录→下单→已支付→完成)。实例通过 X-Session-Id 或 X-Trace-Id 区分,每个实例独立维护当前状态。"
770
770
  }
771
771
  ),
772
- /* @__PURE__ */ e(P, { style: { marginBottom: 16 }, children: /* @__PURE__ */ e(_, { icon: /* @__PURE__ */ e(ee, {}), onClick: x, children: "刷新" }) }),
772
+ /* @__PURE__ */ e(E, { style: { marginBottom: 16 }, children: /* @__PURE__ */ e(A, { icon: /* @__PURE__ */ e(ee, {}), onClick: x, children: "刷新" }) }),
773
773
  /* @__PURE__ */ e(
774
774
  Q,
775
775
  {
@@ -780,7 +780,7 @@ function yr() {
780
780
  dataIndex: "scenario_code",
781
781
  key: "scenario_code",
782
782
  width: 160,
783
- render: (l) => /* @__PURE__ */ e(mr, { code: !0, children: l })
783
+ render: (a) => /* @__PURE__ */ e(gn, { code: !0, children: a })
784
784
  },
785
785
  { title: "场景名称", dataIndex: "scenario_name", key: "scenario_name", width: 200 },
786
786
  {
@@ -788,38 +788,38 @@ function yr() {
788
788
  dataIndex: "initial_state",
789
789
  key: "initial_state",
790
790
  width: 140,
791
- render: (l) => /* @__PURE__ */ e(w, { color: "blue", children: l })
791
+ render: (a) => /* @__PURE__ */ e(w, { color: "blue", children: a })
792
792
  },
793
793
  {
794
794
  title: "描述",
795
795
  dataIndex: "description",
796
796
  key: "description",
797
797
  width: 240,
798
- render: (l) => l || "-"
798
+ render: (a) => a || "-"
799
799
  },
800
800
  {
801
801
  title: "操作",
802
802
  key: "action",
803
803
  width: 200,
804
804
  fixed: "right",
805
- render: (l, d) => /* @__PURE__ */ r(P, { size: "small", children: [
805
+ render: (a, d) => /* @__PURE__ */ n(E, { size: "small", children: [
806
806
  /* @__PURE__ */ e(
807
- _,
807
+ A,
808
808
  {
809
809
  size: "small",
810
810
  type: "link",
811
- icon: /* @__PURE__ */ e(Pt, {}),
812
- onClick: () => A(d.scenario_code),
811
+ icon: /* @__PURE__ */ e(Et, {}),
812
+ onClick: () => _(d.scenario_code),
813
813
  children: "实例"
814
814
  }
815
815
  ),
816
816
  /* @__PURE__ */ e(
817
- _,
817
+ A,
818
818
  {
819
819
  size: "small",
820
820
  type: "link",
821
- icon: /* @__PURE__ */ e(Rt, {}),
822
- onClick: () => T(d.scenario_code),
821
+ icon: /* @__PURE__ */ e(zt, {}),
822
+ onClick: () => C(d.scenario_code),
823
823
  children: "重置"
824
824
  }
825
825
  )
@@ -827,7 +827,7 @@ function yr() {
827
827
  }
828
828
  ],
829
829
  rowKey: "id",
830
- loading: n,
830
+ loading: r,
831
831
  pagination: { pageSize: 10 },
832
832
  scroll: { x: 1100 },
833
833
  size: "small"
@@ -837,9 +837,9 @@ function yr() {
837
837
  me,
838
838
  {
839
839
  title: `场景实例: ${c == null ? void 0 : c.code}`,
840
- open: a,
840
+ open: l,
841
841
  onCancel: () => y(!1),
842
- footer: /* @__PURE__ */ e(_, { onClick: () => y(!1), children: "关闭" }),
842
+ footer: /* @__PURE__ */ e(A, { onClick: () => y(!1), children: "关闭" }),
843
843
  size: "large",
844
844
  children: c && /* @__PURE__ */ e(
845
845
  Q,
@@ -851,11 +851,11 @@ function yr() {
851
851
  title: "当前状态",
852
852
  dataIndex: "current_state",
853
853
  key: "current_state",
854
- render: (l) => /* @__PURE__ */ e(w, { color: "blue", children: l })
854
+ render: (a) => /* @__PURE__ */ e(w, { color: "blue", children: a })
855
855
  },
856
856
  { title: "最后变更", dataIndex: "update_time", key: "update_time" }
857
857
  ],
858
- rowKey: (l, d) => l.instance_key || d,
858
+ rowKey: (a, d) => a.instance_key || d,
859
859
  pagination: !1,
860
860
  size: "small"
861
861
  }
@@ -864,47 +864,47 @@ function yr() {
864
864
  )
865
865
  ] });
866
866
  }
867
- const { Text: se } = le, Me = { PASS: "green", FAIL: "red", SKIP: "default" }, gr = { P0: "red", P1: "orange", P2: "blue", P3: "default" };
868
- function fr() {
869
- const [t, s] = m([]), [n, k] = m(!1), [a, y] = m([]), [c, f] = m(!1), [x, T] = m(null), [A, p] = m(null), [l, d] = m(!1);
870
- U(() => {
867
+ const { Text: ie } = ae, Le = { PASS: "green", FAIL: "red", SKIP: "default" }, bn = { P0: "red", P1: "orange", P2: "blue", P3: "default" };
868
+ function xn() {
869
+ const [t, i] = m([]), [r, S] = m(!1), [l, y] = m([]), [c, f] = m(!1), [x, C] = m(null), [_, h] = m(null), [a, d] = m(!1);
870
+ F(() => {
871
871
  g();
872
872
  }, []);
873
873
  const g = async () => {
874
- k(!0);
874
+ S(!0);
875
875
  try {
876
- const u = await q.cases.list();
877
- s(Array.isArray(u) ? u : []);
876
+ const u = await j.cases.list();
877
+ i(Array.isArray(u) ? u : []);
878
878
  } catch {
879
879
  b.warning("加载用例列表失败");
880
880
  } finally {
881
- k(!1);
881
+ S(!1);
882
882
  }
883
883
  }, v = async (u) => {
884
884
  try {
885
- const i = await q.cases.run(u.case_code);
886
- T(i), f(!0), (i == null ? void 0 : i.status) === "PASS" ? b.success("用例通过") : b.error("用例失败: " + ((i == null ? void 0 : i.error) || (i == null ? void 0 : i.actualStatus))), g();
887
- } catch (i) {
888
- b.error("执行失败: " + (i == null ? void 0 : i.message));
885
+ const s = await j.cases.run(u.case_code);
886
+ C(s), f(!0), (s == null ? void 0 : s.status) === "PASS" ? b.success("用例通过") : b.error("用例失败: " + ((s == null ? void 0 : s.error) || (s == null ? void 0 : s.actualStatus))), g();
887
+ } catch (s) {
888
+ b.error("执行失败: " + (s == null ? void 0 : s.message));
889
889
  }
890
- }, $ = async () => {
891
- if (a.length === 0) {
890
+ }, D = async () => {
891
+ if (l.length === 0) {
892
892
  b.warning("请先选择用例");
893
893
  return;
894
894
  }
895
895
  try {
896
- const u = await q.cases.runBatch(a);
897
- p(u), d(!0), b.success(`批量执行完成: ${u == null ? void 0 : u.pass} 通过, ${u == null ? void 0 : u.fail} 失败`), g();
896
+ const u = await j.cases.runBatch(l);
897
+ h(u), d(!0), b.success(`批量执行完成: ${u == null ? void 0 : u.pass} 通过, ${u == null ? void 0 : u.fail} 失败`), g();
898
898
  } catch {
899
899
  b.error("批量执行失败");
900
900
  }
901
- }, C = [
901
+ }, T = [
902
902
  {
903
903
  title: "用例编码",
904
904
  dataIndex: "case_code",
905
905
  key: "case_code",
906
906
  width: 180,
907
- render: (u) => /* @__PURE__ */ e(se, { code: !0, children: u })
907
+ render: (u) => /* @__PURE__ */ e(ie, { code: !0, children: u })
908
908
  },
909
909
  { title: "名称", dataIndex: "case_name", key: "case_name", width: 220 },
910
910
  {
@@ -926,7 +926,7 @@ function fr() {
926
926
  dataIndex: "request_url",
927
927
  key: "request_url",
928
928
  ellipsis: !0,
929
- render: (u) => /* @__PURE__ */ e(se, { code: !0, children: u })
929
+ render: (u) => /* @__PURE__ */ e(ie, { code: !0, children: u })
930
930
  },
931
931
  {
932
932
  title: "优先级",
@@ -934,7 +934,7 @@ function fr() {
934
934
  key: "priority",
935
935
  width: 80,
936
936
  align: "center",
937
- render: (u) => /* @__PURE__ */ e(w, { color: gr[u], children: u || "P1" })
937
+ render: (u) => /* @__PURE__ */ e(w, { color: bn[u], children: u || "P1" })
938
938
  },
939
939
  {
940
940
  title: "上次结果",
@@ -942,20 +942,20 @@ function fr() {
942
942
  key: "last_run_result",
943
943
  width: 100,
944
944
  align: "center",
945
- render: (u) => u ? /* @__PURE__ */ e(w, { color: Me[u], children: u }) : "-"
945
+ render: (u) => u ? /* @__PURE__ */ e(w, { color: Le[u], children: u }) : "-"
946
946
  },
947
947
  {
948
948
  title: "统计",
949
949
  key: "stats",
950
950
  width: 130,
951
951
  align: "center",
952
- render: (u, i) => /* @__PURE__ */ r(P, { size: "small", children: [
953
- /* @__PURE__ */ e(se, { type: "success", children: i.pass_count || 0 }),
952
+ render: (u, s) => /* @__PURE__ */ n(E, { size: "small", children: [
953
+ /* @__PURE__ */ e(ie, { type: "success", children: s.pass_count || 0 }),
954
954
  "/",
955
- /* @__PURE__ */ e(se, { type: "danger", children: i.fail_count || 0 }),
956
- /* @__PURE__ */ r(se, { type: "secondary", children: [
955
+ /* @__PURE__ */ e(ie, { type: "danger", children: s.fail_count || 0 }),
956
+ /* @__PURE__ */ n(ie, { type: "secondary", children: [
957
957
  "(",
958
- i.run_count || 0,
958
+ s.run_count || 0,
959
959
  ")"
960
960
  ] })
961
961
  ] })
@@ -965,21 +965,21 @@ function fr() {
965
965
  key: "action",
966
966
  width: 120,
967
967
  fixed: "right",
968
- render: (u, i) => /* @__PURE__ */ e(P, { size: "small", children: /* @__PURE__ */ e(
969
- _,
968
+ render: (u, s) => /* @__PURE__ */ e(E, { size: "small", children: /* @__PURE__ */ e(
969
+ A,
970
970
  {
971
971
  size: "small",
972
972
  type: "link",
973
- icon: /* @__PURE__ */ e(Pe, {}),
974
- onClick: () => v(i),
973
+ icon: /* @__PURE__ */ e(Ee, {}),
974
+ onClick: () => v(s),
975
975
  children: "运行"
976
976
  }
977
977
  ) })
978
978
  }
979
979
  ];
980
- return /* @__PURE__ */ r("div", { children: [
980
+ return /* @__PURE__ */ n("div", { children: [
981
981
  /* @__PURE__ */ e(
982
- V,
982
+ Z,
983
983
  {
984
984
  type: "info",
985
985
  showIcon: !0,
@@ -988,18 +988,18 @@ function fr() {
988
988
  description: "对 Mock 接口进行断言验证。支持 7 种断言类型:STATUS / HEADER / BODY / JSON_PATH / REGEX / SCHEMA / RESPONSE_TIME。支持单条运行与批量运行,自动统计通过/失败次数。"
989
989
  }
990
990
  ),
991
- /* @__PURE__ */ r(P, { style: { marginBottom: 16 }, children: [
992
- /* @__PURE__ */ e(_, { icon: /* @__PURE__ */ e(ee, {}), onClick: g, children: "刷新" }),
993
- /* @__PURE__ */ r(
994
- _,
991
+ /* @__PURE__ */ n(E, { style: { marginBottom: 16 }, children: [
992
+ /* @__PURE__ */ e(A, { icon: /* @__PURE__ */ e(ee, {}), onClick: g, children: "刷新" }),
993
+ /* @__PURE__ */ n(
994
+ A,
995
995
  {
996
996
  type: "primary",
997
- icon: /* @__PURE__ */ e(Pe, {}),
998
- onClick: $,
999
- disabled: a.length === 0,
997
+ icon: /* @__PURE__ */ e(Ee, {}),
998
+ onClick: D,
999
+ disabled: l.length === 0,
1000
1000
  children: [
1001
1001
  "批量运行 (",
1002
- a.length,
1002
+ l.length,
1003
1003
  ")"
1004
1004
  ]
1005
1005
  }
@@ -1009,14 +1009,14 @@ function fr() {
1009
1009
  Q,
1010
1010
  {
1011
1011
  dataSource: t,
1012
- columns: C,
1012
+ columns: T,
1013
1013
  rowKey: "id",
1014
- loading: n,
1014
+ loading: r,
1015
1015
  rowSelection: {
1016
- selectedRowKeys: a,
1016
+ selectedRowKeys: l,
1017
1017
  // 批量执行收的是 **case_code 列表**(后端按 case_code 查行),
1018
1018
  // 原来这里存的是 rowKey(=id) ⇒ 批量执行永远查不到行。
1019
- onChange: (u, i) => y(i.map((S) => S.case_code))
1019
+ onChange: (u, s) => y(s.map((I) => I.case_code))
1020
1020
  },
1021
1021
  pagination: { pageSize: 10 },
1022
1022
  scroll: { x: 1300 },
@@ -1026,33 +1026,33 @@ function fr() {
1026
1026
  /* @__PURE__ */ e(
1027
1027
  we,
1028
1028
  {
1029
- title: /* @__PURE__ */ r(P, { children: [
1030
- /* @__PURE__ */ e(Ot, {}),
1029
+ title: /* @__PURE__ */ n(E, { children: [
1030
+ /* @__PURE__ */ e(Rt, {}),
1031
1031
  "用例执行结果"
1032
1032
  ] }),
1033
1033
  open: c,
1034
1034
  onClose: () => f(!1),
1035
1035
  size: "large",
1036
- children: x && /* @__PURE__ */ r("div", { children: [
1037
- /* @__PURE__ */ r(Y, { gutter: 16, style: { marginBottom: 16 }, children: [
1038
- /* @__PURE__ */ e(z, { span: 8, children: /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(
1036
+ children: x && /* @__PURE__ */ n("div", { children: [
1037
+ /* @__PURE__ */ n(Y, { gutter: 16, style: { marginBottom: 16 }, children: [
1038
+ /* @__PURE__ */ e(O, { span: 8, children: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(
1039
1039
  K,
1040
1040
  {
1041
1041
  title: "结果",
1042
1042
  value: x.status,
1043
- styles: { content: { color: Me[x.status] === "green" ? "#52c41a" : "#ff4d4f" } }
1043
+ styles: { content: { color: Le[x.status] === "green" ? "#52c41a" : "#ff4d4f" } }
1044
1044
  }
1045
1045
  ) }) }),
1046
- /* @__PURE__ */ e(z, { span: 8, children: /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(K, { title: "实际状态码", value: x.actualStatus || "-" }) }) }),
1047
- /* @__PURE__ */ e(z, { span: 8, children: /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(K, { title: "耗时(ms)", value: x.durationMs || 0 }) }) })
1046
+ /* @__PURE__ */ e(O, { span: 8, children: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(K, { title: "实际状态码", value: x.actualStatus || "-" }) }) }),
1047
+ /* @__PURE__ */ e(O, { span: 8, children: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(K, { title: "耗时(ms)", value: x.durationMs || 0 }) }) })
1048
1048
  ] }),
1049
- /* @__PURE__ */ r(R, { column: 1, size: "small", bordered: !0, style: { marginBottom: 16 }, children: [
1050
- /* @__PURE__ */ e(R.Item, { label: "用例编码", children: x.caseCode }),
1051
- /* @__PURE__ */ e(R.Item, { label: "用例名称", children: x.caseName }),
1052
- /* @__PURE__ */ e(R.Item, { label: "错误信息", children: x.error || "-" })
1049
+ /* @__PURE__ */ n(z, { column: 1, size: "small", bordered: !0, style: { marginBottom: 16 }, children: [
1050
+ /* @__PURE__ */ e(z.Item, { label: "用例编码", children: x.caseCode }),
1051
+ /* @__PURE__ */ e(z.Item, { label: "用例名称", children: x.caseName }),
1052
+ /* @__PURE__ */ e(z.Item, { label: "错误信息", children: x.error || "-" })
1053
1053
  ] }),
1054
- x.assertionResults && /* @__PURE__ */ r(Le, { children: [
1055
- /* @__PURE__ */ e(se, { strong: !0, children: "断言详情:" }),
1054
+ x.assertionResults && /* @__PURE__ */ n(Me, { children: [
1055
+ /* @__PURE__ */ e(ie, { strong: !0, children: "断言详情:" }),
1056
1056
  /* @__PURE__ */ e(
1057
1057
  Q,
1058
1058
  {
@@ -1076,7 +1076,7 @@ function fr() {
1076
1076
  }
1077
1077
  )
1078
1078
  ] }),
1079
- /* @__PURE__ */ e(se, { strong: !0, style: { marginTop: 16, display: "block" }, children: "响应体:" }),
1079
+ /* @__PURE__ */ e(ie, { strong: !0, style: { marginTop: 16, display: "block" }, children: "响应体:" }),
1080
1080
  /* @__PURE__ */ e("pre", { style: {
1081
1081
  background: "#f5f5f5",
1082
1082
  padding: 12,
@@ -1094,42 +1094,42 @@ function fr() {
1094
1094
  /* @__PURE__ */ e(
1095
1095
  me,
1096
1096
  {
1097
- title: `批量执行结果 (${(A == null ? void 0 : A.total) || 0} 条)`,
1098
- open: l,
1097
+ title: `批量执行结果 (${(_ == null ? void 0 : _.total) || 0} 条)`,
1098
+ open: a,
1099
1099
  onCancel: () => d(!1),
1100
- footer: /* @__PURE__ */ e(_, { onClick: () => d(!1), children: "关闭" }),
1100
+ footer: /* @__PURE__ */ e(A, { onClick: () => d(!1), children: "关闭" }),
1101
1101
  size: "large",
1102
- children: A && /* @__PURE__ */ r(Le, { children: [
1103
- /* @__PURE__ */ r(Y, { gutter: 16, style: { marginBottom: 16 }, children: [
1104
- /* @__PURE__ */ e(z, { span: 6, children: /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(K, { title: "总数", value: A.total }) }) }),
1105
- /* @__PURE__ */ e(z, { span: 6, children: /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(
1102
+ children: _ && /* @__PURE__ */ n(Me, { children: [
1103
+ /* @__PURE__ */ n(Y, { gutter: 16, style: { marginBottom: 16 }, children: [
1104
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(K, { title: "总数", value: _.total }) }) }),
1105
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(
1106
1106
  K,
1107
1107
  {
1108
1108
  title: "通过",
1109
- value: A.pass,
1109
+ value: _.pass,
1110
1110
  styles: { content: { color: "#52c41a" } }
1111
1111
  }
1112
1112
  ) }) }),
1113
- /* @__PURE__ */ e(z, { span: 6, children: /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(
1113
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(
1114
1114
  K,
1115
1115
  {
1116
1116
  title: "失败",
1117
- value: A.fail,
1117
+ value: _.fail,
1118
1118
  styles: { content: { color: "#ff4d4f" } }
1119
1119
  }
1120
1120
  ) }) }),
1121
- /* @__PURE__ */ e(z, { span: 6, children: /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(
1121
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(
1122
1122
  K,
1123
1123
  {
1124
1124
  title: "通过率",
1125
- value: `${A.total > 0 ? Math.round(A.pass / A.total * 100) : 0}%`
1125
+ value: `${_.total > 0 ? Math.round(_.pass / _.total * 100) : 0}%`
1126
1126
  }
1127
1127
  ) }) })
1128
1128
  ] }),
1129
1129
  /* @__PURE__ */ e(
1130
1130
  Q,
1131
1131
  {
1132
- dataSource: A.results || [],
1132
+ dataSource: _.results || [],
1133
1133
  columns: [
1134
1134
  { title: "编码", dataIndex: "caseCode", key: "caseCode", width: 180 },
1135
1135
  { title: "名称", dataIndex: "caseName", key: "caseName" },
@@ -1138,7 +1138,7 @@ function fr() {
1138
1138
  dataIndex: "status",
1139
1139
  key: "status",
1140
1140
  width: 80,
1141
- render: (u) => /* @__PURE__ */ e(w, { color: Me[u], children: u })
1141
+ render: (u) => /* @__PURE__ */ e(w, { color: Le[u], children: u })
1142
1142
  },
1143
1143
  { title: "耗时", dataIndex: "durationMs", key: "durationMs", width: 80, align: "center" },
1144
1144
  { title: "错误", dataIndex: "error", key: "error", ellipsis: !0 }
@@ -1153,45 +1153,45 @@ function fr() {
1153
1153
  )
1154
1154
  ] });
1155
1155
  }
1156
- const { Text: de } = le, Qe = {
1156
+ const { Text: de } = ae, Qe = {
1157
1157
  IDLE: "default",
1158
1158
  RECORDING: "red",
1159
1159
  STOPPED: "green",
1160
1160
  EXPIRED: "gray"
1161
1161
  };
1162
- function br() {
1163
- const [t, s] = m([]), [n, k] = m(!1), [a, y] = m(!1), [c, f] = m(null), [x, T] = m([]);
1164
- U(() => {
1165
- A();
1162
+ function wn() {
1163
+ const [t, i] = m([]), [r, S] = m(!1), [l, y] = m(!1), [c, f] = m(null), [x, C] = m([]);
1164
+ F(() => {
1165
+ _();
1166
1166
  }, []);
1167
- const A = async () => {
1168
- k(!0);
1167
+ const _ = async () => {
1168
+ S(!0);
1169
1169
  try {
1170
- const d = await q.recordings.list();
1171
- s(Array.isArray(d) ? d : []);
1170
+ const d = await j.recordings.list();
1171
+ i(Array.isArray(d) ? d : []);
1172
1172
  } catch {
1173
1173
  b.warning("加载录制列表失败");
1174
1174
  } finally {
1175
- k(!1);
1175
+ S(!1);
1176
1176
  }
1177
- }, p = async (d) => {
1177
+ }, h = async (d) => {
1178
1178
  try {
1179
- const g = await q.recordings.requests(d.recording_code);
1180
- f(d), T(Array.isArray(g) ? g : []), y(!0);
1179
+ const g = await j.recordings.requests(d.recording_code);
1180
+ f(d), C(Array.isArray(g) ? g : []), y(!0);
1181
1181
  } catch {
1182
1182
  b.error("加载失败");
1183
1183
  }
1184
1184
  };
1185
- return /* @__PURE__ */ r("div", { children: [
1185
+ return /* @__PURE__ */ n("div", { children: [
1186
1186
  /* @__PURE__ */ e(
1187
- V,
1187
+ Z,
1188
1188
  {
1189
1189
  type: "info",
1190
1190
  showIcon: !0,
1191
1191
  style: { marginBottom: 16 },
1192
1192
  message: "流量录制与回放",
1193
- description: /* @__PURE__ */ r("div", { children: [
1194
- /* @__PURE__ */ r("div", { children: [
1193
+ description: /* @__PURE__ */ n("div", { children: [
1194
+ /* @__PURE__ */ n("div", { children: [
1195
1195
  "• 开启录制后,所有 ",
1196
1196
  /* @__PURE__ */ e(de, { code: !0, children: "/api/mock/{envCode}/**" }),
1197
1197
  " 请求会被捕获到数据库"
@@ -1201,7 +1201,7 @@ function br() {
1201
1201
  ] })
1202
1202
  }
1203
1203
  ),
1204
- /* @__PURE__ */ e(P, { style: { marginBottom: 16 }, children: /* @__PURE__ */ e(_, { icon: /* @__PURE__ */ e(ee, {}), onClick: A, children: "刷新" }) }),
1204
+ /* @__PURE__ */ e(E, { style: { marginBottom: 16 }, children: /* @__PURE__ */ e(A, { icon: /* @__PURE__ */ e(ee, {}), onClick: _, children: "刷新" }) }),
1205
1205
  /* @__PURE__ */ e(
1206
1206
  Q,
1207
1207
  {
@@ -1243,20 +1243,20 @@ function br() {
1243
1243
  key: "action",
1244
1244
  width: 120,
1245
1245
  fixed: "right",
1246
- render: (d, g) => /* @__PURE__ */ e(P, { size: "small", children: /* @__PURE__ */ e(
1247
- _,
1246
+ render: (d, g) => /* @__PURE__ */ e(E, { size: "small", children: /* @__PURE__ */ e(
1247
+ A,
1248
1248
  {
1249
1249
  size: "small",
1250
1250
  type: "link",
1251
1251
  icon: /* @__PURE__ */ e(Je, {}),
1252
- onClick: () => p(g),
1252
+ onClick: () => h(g),
1253
1253
  children: "详情"
1254
1254
  }
1255
1255
  ) })
1256
1256
  }
1257
1257
  ],
1258
1258
  rowKey: "id",
1259
- loading: n,
1259
+ loading: r,
1260
1260
  pagination: { pageSize: 10 },
1261
1261
  scroll: { x: 1300 },
1262
1262
  size: "small"
@@ -1265,25 +1265,25 @@ function br() {
1265
1265
  /* @__PURE__ */ e(
1266
1266
  we,
1267
1267
  {
1268
- title: /* @__PURE__ */ r(P, { children: [
1268
+ title: /* @__PURE__ */ n(E, { children: [
1269
1269
  /* @__PURE__ */ e(Je, {}),
1270
1270
  "录制详情: ",
1271
1271
  c == null ? void 0 : c.recording_code
1272
1272
  ] }),
1273
- open: a,
1273
+ open: l,
1274
1274
  onClose: () => y(!1),
1275
1275
  size: "large",
1276
- children: c && /* @__PURE__ */ r("div", { children: [
1277
- /* @__PURE__ */ r(R, { column: 2, size: "small", bordered: !0, style: { marginBottom: 16 }, children: [
1278
- /* @__PURE__ */ e(R.Item, { label: "编码", children: c.recording_code }),
1279
- /* @__PURE__ */ e(R.Item, { label: "名称", children: c.recording_name }),
1280
- /* @__PURE__ */ e(R.Item, { label: "状态", children: /* @__PURE__ */ e(w, { color: Qe[c.record_status], children: c.record_status }) }),
1281
- /* @__PURE__ */ e(R.Item, { label: "请求数", children: c.total_requests }),
1282
- /* @__PURE__ */ e(R.Item, { label: "目标 URL", span: 2, children: /* @__PURE__ */ e(de, { copyable: !0, children: c.target_url }) }),
1283
- /* @__PURE__ */ e(R.Item, { label: "开始", children: c.start_time }),
1284
- /* @__PURE__ */ e(R.Item, { label: "结束", children: c.end_time || "(录制中)" })
1276
+ children: c && /* @__PURE__ */ n("div", { children: [
1277
+ /* @__PURE__ */ n(z, { column: 2, size: "small", bordered: !0, style: { marginBottom: 16 }, children: [
1278
+ /* @__PURE__ */ e(z.Item, { label: "编码", children: c.recording_code }),
1279
+ /* @__PURE__ */ e(z.Item, { label: "名称", children: c.recording_name }),
1280
+ /* @__PURE__ */ e(z.Item, { label: "状态", children: /* @__PURE__ */ e(w, { color: Qe[c.record_status], children: c.record_status }) }),
1281
+ /* @__PURE__ */ e(z.Item, { label: "请求数", children: c.total_requests }),
1282
+ /* @__PURE__ */ e(z.Item, { label: "目标 URL", span: 2, children: /* @__PURE__ */ e(de, { copyable: !0, children: c.target_url }) }),
1283
+ /* @__PURE__ */ e(z.Item, { label: "开始", children: c.start_time }),
1284
+ /* @__PURE__ */ e(z.Item, { label: "结束", children: c.end_time || "(录制中)" })
1285
1285
  ] }),
1286
- /* @__PURE__ */ r(de, { strong: !0, children: [
1286
+ /* @__PURE__ */ n(de, { strong: !0, children: [
1287
1287
  "请求列表 (共 ",
1288
1288
  x.length,
1289
1289
  " 条):"
@@ -1334,59 +1334,59 @@ function br() {
1334
1334
  )
1335
1335
  ] });
1336
1336
  }
1337
- const { Text: ue } = le, xr = { MOCK: "green", PROXY: "blue", 404: "red", 502: "orange" };
1338
- function wr() {
1339
- const [t, s] = m([]), [n, k] = m(null), [a, y] = m(!1), [c, f] = m(null), [x, T] = m(!1), [A, p] = m(""), [l, d] = m();
1340
- U(() => {
1337
+ const { Text: ue } = ae, kn = { MOCK: "green", PROXY: "blue", 404: "red", 502: "orange" };
1338
+ function In() {
1339
+ const [t, i] = m([]), [r, S] = m(null), [l, y] = m(!1), [c, f] = m(null), [x, C] = m(!1), [_, h] = m(""), [a, d] = m();
1340
+ F(() => {
1341
1341
  g();
1342
1342
  }, []);
1343
1343
  const g = async () => {
1344
1344
  y(!0);
1345
1345
  try {
1346
- const [C, u] = await Promise.all([
1347
- q.requestLogs.list({
1348
- path: A || void 0,
1349
- matched: l,
1346
+ const [T, u] = await Promise.all([
1347
+ j.requestLogs.list({
1348
+ path: _ || void 0,
1349
+ matched: a,
1350
1350
  limit: 100
1351
1351
  }),
1352
- q.requestLogs.stats().catch(() => null)
1352
+ j.requestLogs.stats().catch(() => null)
1353
1353
  ]);
1354
- s(Array.isArray(C) ? C : []), k(u);
1354
+ i(Array.isArray(T) ? T : []), S(u);
1355
1355
  } catch {
1356
1356
  b.warning("加载失败");
1357
1357
  } finally {
1358
1358
  y(!1);
1359
1359
  }
1360
- }, v = (C) => {
1361
- f(C), T(!0);
1362
- }, $ = [
1360
+ }, v = (T) => {
1361
+ f(T), C(!0);
1362
+ }, D = [
1363
1363
  {
1364
1364
  title: "时间",
1365
1365
  dataIndex: "create_time",
1366
1366
  key: "create_time",
1367
1367
  width: 170,
1368
- render: (C) => C ? new Date(C).toLocaleString() : "-"
1368
+ render: (T) => T ? new Date(T).toLocaleString() : "-"
1369
1369
  },
1370
1370
  {
1371
1371
  title: "环境",
1372
1372
  dataIndex: "env_code",
1373
1373
  key: "env_code",
1374
1374
  width: 100,
1375
- render: (C) => /* @__PURE__ */ e(w, { children: C })
1375
+ render: (T) => /* @__PURE__ */ e(w, { children: T })
1376
1376
  },
1377
1377
  {
1378
1378
  title: "方法",
1379
1379
  dataIndex: "request_method",
1380
1380
  key: "request_method",
1381
1381
  width: 80,
1382
- render: (C) => /* @__PURE__ */ e(w, { color: "blue", children: C })
1382
+ render: (T) => /* @__PURE__ */ e(w, { color: "blue", children: T })
1383
1383
  },
1384
1384
  {
1385
1385
  title: "路径",
1386
1386
  dataIndex: "request_path",
1387
1387
  key: "request_path",
1388
1388
  ellipsis: !0,
1389
- render: (C) => /* @__PURE__ */ e(ue, { code: !0, children: C })
1389
+ render: (T) => /* @__PURE__ */ e(ue, { code: !0, children: T })
1390
1390
  },
1391
1391
  {
1392
1392
  title: "状态",
@@ -1394,7 +1394,7 @@ function wr() {
1394
1394
  key: "response_status",
1395
1395
  width: 90,
1396
1396
  align: "center",
1397
- render: (C) => C ? /* @__PURE__ */ e(w, { color: C >= 400 ? "red" : "green", children: C }) : "-"
1397
+ render: (T) => T ? /* @__PURE__ */ e(w, { color: T >= 400 ? "red" : "green", children: T }) : "-"
1398
1398
  },
1399
1399
  {
1400
1400
  title: "匹配",
@@ -1402,14 +1402,14 @@ function wr() {
1402
1402
  key: "matched",
1403
1403
  width: 90,
1404
1404
  align: "center",
1405
- render: (C) => C === 1 ? /* @__PURE__ */ e(w, { color: "green", children: "命中" }) : /* @__PURE__ */ e(w, { color: "red", children: "未匹配" })
1405
+ render: (T) => T === 1 ? /* @__PURE__ */ e(w, { color: "green", children: "命中" }) : /* @__PURE__ */ e(w, { color: "red", children: "未匹配" })
1406
1406
  },
1407
1407
  {
1408
1408
  title: "回退",
1409
1409
  dataIndex: "fallback_type",
1410
1410
  key: "fallback_type",
1411
1411
  width: 100,
1412
- render: (C) => C ? /* @__PURE__ */ e(w, { color: xr[C], children: C }) : "-"
1412
+ render: (T) => T ? /* @__PURE__ */ e(w, { color: kn[T], children: T }) : "-"
1413
1413
  },
1414
1414
  {
1415
1415
  title: "耗时",
@@ -1417,7 +1417,7 @@ function wr() {
1417
1417
  key: "duration_ms",
1418
1418
  width: 80,
1419
1419
  align: "center",
1420
- render: (C) => `${C || 0}ms`
1420
+ render: (T) => `${T || 0}ms`
1421
1421
  },
1422
1422
  {
1423
1423
  title: "Mock",
@@ -1425,27 +1425,27 @@ function wr() {
1425
1425
  key: "mock_code",
1426
1426
  width: 160,
1427
1427
  ellipsis: !0,
1428
- render: (C) => C ? /* @__PURE__ */ e(ue, { code: !0, children: C }) : "-"
1428
+ render: (T) => T ? /* @__PURE__ */ e(ue, { code: !0, children: T }) : "-"
1429
1429
  },
1430
1430
  {
1431
1431
  title: "操作",
1432
1432
  key: "action",
1433
1433
  width: 80,
1434
- render: (C, u) => /* @__PURE__ */ e(
1435
- _,
1434
+ render: (T, u) => /* @__PURE__ */ e(
1435
+ A,
1436
1436
  {
1437
1437
  size: "small",
1438
1438
  type: "link",
1439
- icon: /* @__PURE__ */ e(zt, {}),
1439
+ icon: /* @__PURE__ */ e(Ot, {}),
1440
1440
  onClick: () => v(u),
1441
1441
  children: "详情"
1442
1442
  }
1443
1443
  )
1444
1444
  }
1445
1445
  ];
1446
- return /* @__PURE__ */ r("div", { children: [
1446
+ return /* @__PURE__ */ n("div", { children: [
1447
1447
  /* @__PURE__ */ e(
1448
- V,
1448
+ Z,
1449
1449
  {
1450
1450
  type: "info",
1451
1451
  showIcon: !0,
@@ -1454,33 +1454,33 @@ function wr() {
1454
1454
  description: "每一次请求都会留痕。包括请求/响应体、是否匹配 Mock、回退类型、耗时、场景状态等。便于排查“为什么这个请求没有 Mock 命中”问题。"
1455
1455
  }
1456
1456
  ),
1457
- n && /* @__PURE__ */ r(Y, { gutter: 16, style: { marginBottom: 16 }, children: [
1458
- /* @__PURE__ */ e(z, { span: 6, children: /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(K, { title: "总请求数", value: n.total || 0 }) }) }),
1459
- /* @__PURE__ */ e(z, { span: 6, children: /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(
1457
+ r && /* @__PURE__ */ n(Y, { gutter: 16, style: { marginBottom: 16 }, children: [
1458
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(K, { title: "总请求数", value: r.total || 0 }) }) }),
1459
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(
1460
1460
  K,
1461
1461
  {
1462
1462
  title: "Mock 命中",
1463
- value: n.matched || 0,
1463
+ value: r.matched || 0,
1464
1464
  styles: { content: { color: "#52c41a" } }
1465
1465
  }
1466
1466
  ) }) }),
1467
- /* @__PURE__ */ e(z, { span: 6, children: /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(
1467
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(
1468
1468
  K,
1469
1469
  {
1470
1470
  title: "未匹配",
1471
- value: n.unmatched || 0,
1471
+ value: r.unmatched || 0,
1472
1472
  styles: { content: { color: "#ff4d4f" } }
1473
1473
  }
1474
1474
  ) }) }),
1475
- /* @__PURE__ */ e(z, { span: 6, children: /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(
1475
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(
1476
1476
  K,
1477
1477
  {
1478
1478
  title: "命中率",
1479
- value: `${n.total > 0 ? Math.round(n.matched / n.total * 100) : 0}%`
1479
+ value: `${r.total > 0 ? Math.round(r.matched / r.total * 100) : 0}%`
1480
1480
  }
1481
1481
  ) }) })
1482
1482
  ] }),
1483
- /* @__PURE__ */ r(P, { style: { marginBottom: 16 }, children: [
1483
+ /* @__PURE__ */ n(E, { style: { marginBottom: 16 }, children: [
1484
1484
  /* @__PURE__ */ e(
1485
1485
  B,
1486
1486
  {
@@ -1488,18 +1488,18 @@ function wr() {
1488
1488
  prefix: /* @__PURE__ */ e(mt, {}),
1489
1489
  allowClear: !0,
1490
1490
  style: { width: 240 },
1491
- value: A,
1492
- onChange: (C) => p(C.target.value),
1491
+ value: _,
1492
+ onChange: (T) => h(T.target.value),
1493
1493
  onPressEnter: g
1494
1494
  }
1495
1495
  ),
1496
1496
  /* @__PURE__ */ e(
1497
- X,
1497
+ V,
1498
1498
  {
1499
1499
  placeholder: "匹配状态",
1500
1500
  allowClear: !0,
1501
1501
  style: { width: 140 },
1502
- value: l,
1502
+ value: a,
1503
1503
  onChange: d,
1504
1504
  options: [
1505
1505
  { value: 1, label: "已命中" },
@@ -1507,15 +1507,15 @@ function wr() {
1507
1507
  ]
1508
1508
  }
1509
1509
  ),
1510
- /* @__PURE__ */ e(_, { icon: /* @__PURE__ */ e(ee, {}), onClick: g, children: "查询" })
1510
+ /* @__PURE__ */ e(A, { icon: /* @__PURE__ */ e(ee, {}), onClick: g, children: "查询" })
1511
1511
  ] }),
1512
1512
  /* @__PURE__ */ e(
1513
1513
  Q,
1514
1514
  {
1515
1515
  dataSource: t,
1516
- columns: $,
1516
+ columns: D,
1517
1517
  rowKey: "id",
1518
- loading: a,
1518
+ loading: l,
1519
1519
  pagination: { pageSize: 20 },
1520
1520
  scroll: { x: 1300 },
1521
1521
  size: "small"
@@ -1526,50 +1526,50 @@ function wr() {
1526
1526
  {
1527
1527
  title: "请求详情",
1528
1528
  open: x,
1529
- onClose: () => T(!1),
1529
+ onClose: () => C(!1),
1530
1530
  size: "large",
1531
- children: c && /* @__PURE__ */ r("div", { children: [
1532
- /* @__PURE__ */ r(R, { column: 2, size: "small", bordered: !0, style: { marginBottom: 16 }, children: [
1533
- /* @__PURE__ */ e(R.Item, { label: "环境", children: c.env_code }),
1534
- /* @__PURE__ */ e(R.Item, { label: "方法", children: /* @__PURE__ */ e(
1531
+ children: c && /* @__PURE__ */ n("div", { children: [
1532
+ /* @__PURE__ */ n(z, { column: 2, size: "small", bordered: !0, style: { marginBottom: 16 }, children: [
1533
+ /* @__PURE__ */ e(z.Item, { label: "环境", children: c.env_code }),
1534
+ /* @__PURE__ */ e(z.Item, { label: "方法", children: /* @__PURE__ */ e(
1535
1535
  w,
1536
1536
  {
1537
1537
  color: "blue",
1538
1538
  children: c.request_method
1539
1539
  }
1540
1540
  ) }),
1541
- /* @__PURE__ */ e(R.Item, { label: "路径", span: 2, children: /* @__PURE__ */ e(
1541
+ /* @__PURE__ */ e(z.Item, { label: "路径", span: 2, children: /* @__PURE__ */ e(
1542
1542
  ue,
1543
1543
  {
1544
1544
  code: !0,
1545
1545
  children: c.request_path
1546
1546
  }
1547
1547
  ) }),
1548
- /* @__PURE__ */ e(R.Item, { label: "状态码", children: /* @__PURE__ */ e(
1548
+ /* @__PURE__ */ e(z.Item, { label: "状态码", children: /* @__PURE__ */ e(
1549
1549
  w,
1550
1550
  {
1551
1551
  color: c.response_status >= 400 ? "red" : "green",
1552
1552
  children: c.response_status
1553
1553
  }
1554
1554
  ) }),
1555
- /* @__PURE__ */ r(R.Item, { label: "耗时", children: [
1555
+ /* @__PURE__ */ n(z.Item, { label: "耗时", children: [
1556
1556
  c.duration_ms,
1557
1557
  "ms"
1558
1558
  ] }),
1559
- /* @__PURE__ */ e(R.Item, { label: "匹配", children: c.matched === 1 ? /* @__PURE__ */ e(w, { color: "green", children: "命中" }) : /* @__PURE__ */ e(w, { color: "red", children: "未匹配" }) }),
1560
- /* @__PURE__ */ e(R.Item, { label: "回退", children: c.fallback_type || "-" }),
1561
- /* @__PURE__ */ e(R.Item, { label: "Mock", span: 2, children: c.mock_code || "-" }),
1559
+ /* @__PURE__ */ e(z.Item, { label: "匹配", children: c.matched === 1 ? /* @__PURE__ */ e(w, { color: "green", children: "命中" }) : /* @__PURE__ */ e(w, { color: "red", children: "未匹配" }) }),
1560
+ /* @__PURE__ */ e(z.Item, { label: "回退", children: c.fallback_type || "-" }),
1561
+ /* @__PURE__ */ e(z.Item, { label: "Mock", span: 2, children: c.mock_code || "-" }),
1562
1562
  /* @__PURE__ */ e(
1563
- R.Item,
1563
+ z.Item,
1564
1564
  {
1565
1565
  label: "场景状态",
1566
1566
  span: 2,
1567
1567
  children: c.scenario_state || "-"
1568
1568
  }
1569
1569
  ),
1570
- /* @__PURE__ */ e(R.Item, { label: "客户端 IP", children: c.client_ip || "-" }),
1571
- /* @__PURE__ */ e(R.Item, { label: "User-Agent", ellipsis: !0, children: c.user_agent || "-" }),
1572
- /* @__PURE__ */ e(R.Item, { label: "时间", span: 2, children: c.create_time ? new Date(c.create_time).toLocaleString() : "-" })
1570
+ /* @__PURE__ */ e(z.Item, { label: "客户端 IP", children: c.client_ip || "-" }),
1571
+ /* @__PURE__ */ e(z.Item, { label: "User-Agent", ellipsis: !0, children: c.user_agent || "-" }),
1572
+ /* @__PURE__ */ e(z.Item, { label: "时间", span: 2, children: c.create_time ? new Date(c.create_time).toLocaleString() : "-" })
1573
1573
  ] }),
1574
1574
  /* @__PURE__ */ e(ue, { strong: !0, children: "请求头:" }),
1575
1575
  /* @__PURE__ */ e("pre", { style: {
@@ -1611,37 +1611,37 @@ function wr() {
1611
1611
  )
1612
1612
  ] });
1613
1613
  }
1614
- const { Text: te } = le, et = [
1614
+ const { Text: te } = ae, et = [
1615
1615
  { key: "endpoints", label: "Mock 端点", component: Be },
1616
- { key: "environments", label: "环境 (MOCK/REAL/MIXED)", component: qe },
1617
- { key: "scenarios", label: "场景状态机", component: yr },
1618
- { key: "cases", label: "测试用例", component: fr },
1619
- { key: "recordings", label: "录制回放", component: br },
1620
- { key: "request-logs", label: "请求日志", component: wr }
1616
+ { key: "environments", label: "环境 (MOCK/REAL/MIXED)", component: je },
1617
+ { key: "scenarios", label: "场景状态机", component: fn },
1618
+ { key: "cases", label: "测试用例", component: xn },
1619
+ { key: "recordings", label: "录制回放", component: wn },
1620
+ { key: "request-logs", label: "请求日志", component: In }
1621
1621
  ];
1622
- function Ir() {
1623
- var A;
1624
- const [t, s] = m("endpoints"), [n, k] = m([]), [a, y] = m("default"), [c, f] = m(null);
1625
- U(() => {
1626
- x(), T();
1622
+ function Sn() {
1623
+ var _;
1624
+ const [t, i] = m("endpoints"), [r, S] = m([]), [l, y] = m("default"), [c, f] = m(null);
1625
+ F(() => {
1626
+ x(), C();
1627
1627
  }, []);
1628
1628
  const x = async () => {
1629
1629
  try {
1630
- const p = await q.environments.list(), l = Array.isArray(p) ? p : [];
1631
- if (k(l), l.length > 0 && !l.find((d) => d.env_code === a)) {
1632
- const d = l.find((g) => g.is_default === 1) || l[0];
1630
+ const h = await j.environments.list(), a = Array.isArray(h) ? h : [];
1631
+ if (S(a), a.length > 0 && !a.find((d) => d.env_code === l)) {
1632
+ const d = a.find((g) => g.is_default === 1) || a[0];
1633
1633
  y(d.env_code);
1634
1634
  }
1635
1635
  } catch {
1636
1636
  }
1637
- }, T = async () => {
1637
+ }, C = async () => {
1638
1638
  try {
1639
- const p = await q.stats();
1640
- f(p);
1639
+ const h = await j.stats();
1640
+ f(h);
1641
1641
  } catch {
1642
1642
  }
1643
1643
  };
1644
- return (A = et.find((p) => p.key === t)) == null || A.component, /* @__PURE__ */ r("div", { children: [
1644
+ return (_ = et.find((h) => h.key === t)) == null || _.component, /* @__PURE__ */ n("div", { children: [
1645
1645
  /* @__PURE__ */ e(
1646
1646
  ye,
1647
1647
  {
@@ -1650,34 +1650,34 @@ function Ir() {
1650
1650
  }
1651
1651
  ),
1652
1652
  /* @__PURE__ */ e(
1653
- Ie,
1653
+ ke,
1654
1654
  {
1655
1655
  activeKey: t,
1656
- onChange: s,
1656
+ onChange: i,
1657
1657
  type: "card",
1658
- tabBarExtraContent: /* @__PURE__ */ r(P, { size: "large", wrap: !0, children: [
1659
- /* @__PURE__ */ r(P, { children: [
1660
- /* @__PURE__ */ e(pt, {}),
1658
+ tabBarExtraContent: /* @__PURE__ */ n(E, { size: "large", wrap: !0, children: [
1659
+ /* @__PURE__ */ n(E, { children: [
1660
+ /* @__PURE__ */ e(ht, {}),
1661
1661
  /* @__PURE__ */ e(te, { children: "当前环境:" }),
1662
1662
  /* @__PURE__ */ e(
1663
- X,
1663
+ V,
1664
1664
  {
1665
- value: a,
1665
+ value: l,
1666
1666
  onChange: y,
1667
1667
  style: { width: 200 },
1668
- options: n.map((p) => ({
1669
- value: p.env_code,
1670
- label: `${p.env_name || p.env_code} (${p.env_type})`
1668
+ options: r.map((h) => ({
1669
+ value: h.env_code,
1670
+ label: `${h.env_name || h.env_code} (${h.env_type})`
1671
1671
  }))
1672
1672
  }
1673
1673
  )
1674
1674
  ] }),
1675
- c && /* @__PURE__ */ r(P, { size: "large", children: [
1676
- /* @__PURE__ */ r(te, { type: "secondary", children: [
1675
+ c && /* @__PURE__ */ n(E, { size: "large", children: [
1676
+ /* @__PURE__ */ n(te, { type: "secondary", children: [
1677
1677
  "端点: ",
1678
1678
  /* @__PURE__ */ e(te, { strong: !0, children: c.totalEndpoints })
1679
1679
  ] }),
1680
- /* @__PURE__ */ r(te, { type: "secondary", children: [
1680
+ /* @__PURE__ */ n(te, { type: "secondary", children: [
1681
1681
  "启用: ",
1682
1682
  /* @__PURE__ */ e(
1683
1683
  te,
@@ -1688,34 +1688,34 @@ function Ir() {
1688
1688
  }
1689
1689
  )
1690
1690
  ] }),
1691
- /* @__PURE__ */ r(te, { type: "secondary", children: [
1691
+ /* @__PURE__ */ n(te, { type: "secondary", children: [
1692
1692
  "场景: ",
1693
1693
  /* @__PURE__ */ e(te, { strong: !0, children: c.totalScenarios })
1694
1694
  ] }),
1695
- /* @__PURE__ */ r(te, { type: "secondary", children: [
1695
+ /* @__PURE__ */ n(te, { type: "secondary", children: [
1696
1696
  "用例: ",
1697
1697
  /* @__PURE__ */ e(te, { strong: !0, children: c.totalCases })
1698
1698
  ] })
1699
1699
  ] }),
1700
- /* @__PURE__ */ e(_, { icon: /* @__PURE__ */ e(ee, {}), onClick: () => {
1701
- x(), T();
1700
+ /* @__PURE__ */ e(A, { icon: /* @__PURE__ */ e(ee, {}), onClick: () => {
1701
+ x(), C();
1702
1702
  }, children: "刷新" })
1703
1703
  ] }),
1704
- items: et.map((p) => ({
1705
- key: p.key,
1706
- label: p.label,
1707
- children: p.component === Be ? /* @__PURE__ */ e(Be, { activeEnvCode: a }) : p.component === qe ? /* @__PURE__ */ e(qe, { onEnvChange: (l) => {
1708
- y(l), b.success(`已切换到环境: ${l}`);
1709
- } }) : /* @__PURE__ */ e(p.component, {})
1704
+ items: et.map((h) => ({
1705
+ key: h.key,
1706
+ label: h.label,
1707
+ children: h.component === Be ? /* @__PURE__ */ e(Be, { activeEnvCode: l }) : h.component === je ? /* @__PURE__ */ e(je, { onEnvChange: (a) => {
1708
+ y(a), b.success(`已切换到环境: ${a}`);
1709
+ } }) : /* @__PURE__ */ e(h.component, {})
1710
1710
  }))
1711
1711
  }
1712
1712
  )
1713
1713
  ] });
1714
1714
  }
1715
- const Qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1715
+ const nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1716
1716
  __proto__: null,
1717
- default: Ir
1718
- }, Symbol.toStringTag, { value: "Module" })), { Text: ge, Paragraph: en } = le, tt = [
1717
+ default: Sn
1718
+ }, Symbol.toStringTag, { value: "Module" })), { Text: ge, Paragraph: rr } = ae, tt = [
1719
1719
  {
1720
1720
  group: "基础数据",
1721
1721
  icon: /* @__PURE__ */ e(fe, {}),
@@ -1729,7 +1729,7 @@ const Qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1729
1729
  },
1730
1730
  {
1731
1731
  group: "时间相关",
1732
- icon: /* @__PURE__ */ e(ke, {}),
1732
+ icon: /* @__PURE__ */ e(Se, {}),
1733
1733
  items: [
1734
1734
  { syntax: "@datetime", desc: "当前时间 (yyyy-MM-dd HH:mm:ss)", example: "2026-06-17 22:30:15" },
1735
1735
  { syntax: "@date", desc: "当前日期 (yyyy-MM-dd)", example: "2026-06-17" },
@@ -1739,7 +1739,7 @@ const Qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1739
1739
  },
1740
1740
  {
1741
1741
  group: "文本生成",
1742
- icon: /* @__PURE__ */ e(ke, {}),
1742
+ icon: /* @__PURE__ */ e(Se, {}),
1743
1743
  items: [
1744
1744
  { syntax: "@name", desc: "随机中文姓名", example: "张伟" },
1745
1745
  { syntax: "@firstName", desc: "随机名", example: "伟" },
@@ -1754,7 +1754,7 @@ const Qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1754
1754
  },
1755
1755
  {
1756
1756
  group: "序列与状态",
1757
- icon: /* @__PURE__ */ e(ke, {}),
1757
+ icon: /* @__PURE__ */ e(Se, {}),
1758
1758
  items: [
1759
1759
  { syntax: "@sequence(1)", desc: "自增序号(每次调用 +1,1 起始)", example: "1, 2, 3, ..." },
1760
1760
  { syntax: "@sequence(100, 5)", desc: "自增序号(100 起始,步长 5)", example: "100, 105, 110, ..." }
@@ -1762,7 +1762,7 @@ const Qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1762
1762
  },
1763
1763
  {
1764
1764
  group: "请求上下文",
1765
- icon: /* @__PURE__ */ e(ke, {}),
1765
+ icon: /* @__PURE__ */ e(Se, {}),
1766
1766
  items: [
1767
1767
  { syntax: "#path.id", desc: "从 URL 路径取值 /users/123 → 123", example: "123" },
1768
1768
  { syntax: "#query.page", desc: "从 query string 取值 ?page=2", example: "2" },
@@ -1771,47 +1771,47 @@ const Qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1771
1771
  ]
1772
1772
  }
1773
1773
  ];
1774
- function tn({ onInsert: t, form: s, formField: n = "responseTemplate" }) {
1775
- const [k, a] = m(""), y = (p) => {
1776
- var l;
1774
+ function ar({ onInsert: t, form: i, formField: r = "responseTemplate" }) {
1775
+ const [S, l] = m(""), y = (h) => {
1776
+ var a;
1777
1777
  try {
1778
- (l = navigator.clipboard) == null || l.writeText(p);
1778
+ (a = navigator.clipboard) == null || a.writeText(h);
1779
1779
  } catch {
1780
1780
  }
1781
1781
  if (t)
1782
- t(p);
1783
- else if (s) {
1784
- const d = s.getFieldValue(n) || "";
1785
- s.setFieldsValue({ [n]: d + (d.endsWith(`
1786
- `) || !d ? "" : " ") + p });
1787
- }
1788
- b.success(`已插入: ${p}`);
1789
- }, c = (p) => {
1790
- var l;
1782
+ t(h);
1783
+ else if (i) {
1784
+ const d = i.getFieldValue(r) || "";
1785
+ i.setFieldsValue({ [r]: d + (d.endsWith(`
1786
+ `) || !d ? "" : " ") + h });
1787
+ }
1788
+ b.success(`已插入: ${h}`);
1789
+ }, c = (h) => {
1790
+ var a;
1791
1791
  try {
1792
- (l = navigator.clipboard) == null || l.writeText(p), b.success("已复制到剪贴板");
1792
+ (a = navigator.clipboard) == null || a.writeText(h), b.success("已复制到剪贴板");
1793
1793
  } catch {
1794
1794
  b.warning("复制失败,请手动选择");
1795
1795
  }
1796
- }, f = k.toLowerCase(), x = tt.map((p) => ({
1797
- ...p,
1798
- items: p.items.filter(
1799
- (l) => !f || l.syntax.toLowerCase().includes(f) || l.desc.toLowerCase().includes(f) || l.example.toLowerCase().includes(f)
1796
+ }, f = S.toLowerCase(), x = tt.map((h) => ({
1797
+ ...h,
1798
+ items: h.items.filter(
1799
+ (a) => !f || a.syntax.toLowerCase().includes(f) || a.desc.toLowerCase().includes(f) || a.example.toLowerCase().includes(f)
1800
1800
  )
1801
- })).filter((p) => p.items.length > 0), T = tt.reduce((p, l) => p + l.items.length, 0), A = x.reduce((p, l) => p + l.items.length, 0);
1802
- return /* @__PURE__ */ r(
1803
- M,
1801
+ })).filter((h) => h.items.length > 0), C = tt.reduce((h, a) => h + a.items.length, 0), _ = x.reduce((h, a) => h + a.items.length, 0);
1802
+ return /* @__PURE__ */ n(
1803
+ L,
1804
1804
  {
1805
1805
  size: "small",
1806
- title: /* @__PURE__ */ r(P, { children: [
1806
+ title: /* @__PURE__ */ n(E, { children: [
1807
1807
  /* @__PURE__ */ e(fe, {}),
1808
1808
  /* @__PURE__ */ e(ge, { strong: !0, children: "模板表达式" }),
1809
- /* @__PURE__ */ r(w, { color: "blue", children: [
1810
- A,
1809
+ /* @__PURE__ */ n(w, { color: "blue", children: [
1810
+ _,
1811
1811
  "/",
1812
- T
1812
+ C
1813
1813
  ] }),
1814
- /* @__PURE__ */ e(pe, { title: "点击按钮即可插入到上方响应模板;点击 syntax 文本可复制", children: /* @__PURE__ */ e(Mt, { style: { color: "#999" } }) })
1814
+ /* @__PURE__ */ e(he, { title: "点击按钮即可插入到上方响应模板;点击 syntax 文本可复制", children: /* @__PURE__ */ e(Lt, { style: { color: "#999" } }) })
1815
1815
  ] }),
1816
1816
  extra: /* @__PURE__ */ e(
1817
1817
  B,
@@ -1819,8 +1819,8 @@ function tn({ onInsert: t, form: s, formField: n = "responseTemplate" }) {
1819
1819
  size: "small",
1820
1820
  placeholder: "搜索 @ 表达式",
1821
1821
  prefix: /* @__PURE__ */ e(mt, {}),
1822
- value: k,
1823
- onChange: (p) => a(p.target.value),
1822
+ value: S,
1823
+ onChange: (h) => l(h.target.value),
1824
1824
  style: { width: 180 },
1825
1825
  allowClear: !0
1826
1826
  }
@@ -1829,13 +1829,13 @@ function tn({ onInsert: t, form: s, formField: n = "responseTemplate" }) {
1829
1829
  styles: { body: { padding: 12, maxHeight: 320, overflow: "auto" } },
1830
1830
  children: [
1831
1831
  x.length === 0 && /* @__PURE__ */ e(ge, { type: "secondary", style: { display: "block", textAlign: "center", padding: 16 }, children: "没有匹配的表达式" }),
1832
- x.map((p) => /* @__PURE__ */ r("div", { style: { marginBottom: 12 }, children: [
1833
- /* @__PURE__ */ r(P, { size: 4, style: { marginBottom: 6 }, children: [
1834
- p.icon,
1835
- /* @__PURE__ */ e(ge, { strong: !0, style: { fontSize: 13 }, children: p.group }),
1836
- /* @__PURE__ */ e(w, { children: p.items.length })
1832
+ x.map((h) => /* @__PURE__ */ n("div", { style: { marginBottom: 12 }, children: [
1833
+ /* @__PURE__ */ n(E, { size: 4, style: { marginBottom: 6 }, children: [
1834
+ h.icon,
1835
+ /* @__PURE__ */ e(ge, { strong: !0, style: { fontSize: 13 }, children: h.group }),
1836
+ /* @__PURE__ */ e(w, { children: h.items.length })
1837
1837
  ] }),
1838
- /* @__PURE__ */ e(Y, { gutter: [8, 8], children: p.items.map((l) => /* @__PURE__ */ e(z, { span: 24, children: /* @__PURE__ */ r(
1838
+ /* @__PURE__ */ e(Y, { gutter: [8, 8], children: h.items.map((a) => /* @__PURE__ */ e(O, { span: 24, children: /* @__PURE__ */ n(
1839
1839
  "div",
1840
1840
  {
1841
1841
  style: {
@@ -1848,102 +1848,102 @@ function tn({ onInsert: t, form: s, formField: n = "responseTemplate" }) {
1848
1848
  gap: 8
1849
1849
  },
1850
1850
  children: [
1851
- /* @__PURE__ */ e(pe, { title: "点击复制", children: /* @__PURE__ */ e(
1851
+ /* @__PURE__ */ e(he, { title: "点击复制", children: /* @__PURE__ */ e(
1852
1852
  ge,
1853
1853
  {
1854
1854
  code: !0,
1855
1855
  style: { cursor: "pointer", minWidth: 140, fontSize: 12 },
1856
- onClick: () => c(l.syntax),
1857
- children: l.syntax
1856
+ onClick: () => c(a.syntax),
1857
+ children: a.syntax
1858
1858
  }
1859
1859
  ) }),
1860
- /* @__PURE__ */ e(ge, { type: "secondary", style: { fontSize: 12, flex: 1 }, children: l.desc }),
1861
- /* @__PURE__ */ e(w, { color: "default", style: { margin: 0, fontFamily: "monospace" }, children: l.example }),
1862
- /* @__PURE__ */ e(pe, { title: "插入到响应模板", children: /* @__PURE__ */ e(
1863
- _,
1860
+ /* @__PURE__ */ e(ge, { type: "secondary", style: { fontSize: 12, flex: 1 }, children: a.desc }),
1861
+ /* @__PURE__ */ e(w, { color: "default", style: { margin: 0, fontFamily: "monospace" }, children: a.example }),
1862
+ /* @__PURE__ */ e(he, { title: "插入到响应模板", children: /* @__PURE__ */ e(
1863
+ A,
1864
1864
  {
1865
1865
  size: "small",
1866
1866
  type: "text",
1867
- icon: /* @__PURE__ */ e(ht, {}),
1868
- onClick: () => y(l.syntax)
1867
+ icon: /* @__PURE__ */ e(pt, {}),
1868
+ onClick: () => y(a.syntax)
1869
1869
  }
1870
1870
  ) })
1871
1871
  ]
1872
1872
  }
1873
- ) }, l.syntax)) })
1874
- ] }, p.group))
1873
+ ) }, a.syntax)) })
1874
+ ] }, h.group))
1875
1875
  ]
1876
1876
  }
1877
1877
  );
1878
1878
  }
1879
- const { TextArea: rt } = B, { Text: he, Paragraph: Sr } = le;
1880
- function rn({ open: t, onClose: s, onSuccess: n, envOptions: k = [] }) {
1881
- const [a, y] = m(""), [c, f] = m(null), [x, T] = m(null), [A, p] = m(!1), [l, d] = m(null), [g, v] = m(!1), [$, C] = m("import"), [u] = E.useForm(), [i] = E.useForm(), S = () => {
1882
- y(""), f(null), T(null), d(null), u.resetFields(), i.resetFields();
1883
- }, L = () => {
1884
- S(), s();
1879
+ const { TextArea: nt } = B, { Text: pe, Paragraph: Tn } = ae;
1880
+ function lr({ open: t, onClose: i, onSuccess: r, envOptions: S = [] }) {
1881
+ const [l, y] = m(""), [c, f] = m(null), [x, C] = m(null), [_, h] = m(!1), [a, d] = m(null), [g, v] = m(!1), [D, T] = m("import"), [u] = P.useForm(), [s] = P.useForm(), I = () => {
1882
+ y(""), f(null), C(null), d(null), u.resetFields(), s.resetFields();
1883
+ }, M = () => {
1884
+ I(), i();
1885
1885
  }, J = async () => {
1886
- var O, I, D, W;
1887
- if (!a.trim()) {
1886
+ var R, k, N, W;
1887
+ if (!l.trim()) {
1888
1888
  b.warning("请先粘贴 curl 命令");
1889
1889
  return;
1890
1890
  }
1891
- T(null), f(null), d(null);
1891
+ C(null), f(null), d(null);
1892
1892
  try {
1893
- const j = await q.curl.parse(a);
1894
- j.success ? (f(j.data), u.setFieldsValue({
1895
- caseName: `from-curl-${((O = j.data) == null ? void 0 : O.method) || "GET"}-${(((I = j.data) == null ? void 0 : I.path) || "").replace(/\W+/g, "-")}`,
1893
+ const U = await j.curl.parse(l);
1894
+ U.success ? (f(U.data), u.setFieldsValue({
1895
+ caseName: `from-curl-${((R = U.data) == null ? void 0 : R.method) || "GET"}-${(((k = U.data) == null ? void 0 : k.path) || "").replace(/\W+/g, "-")}`,
1896
1896
  caseGroup: "imported",
1897
- envCode: k[0] || "default"
1898
- }), i.setFieldsValue({
1899
- mockName: `mock-${((D = j.data) == null ? void 0 : D.method) || "GET"}-${(((W = j.data) == null ? void 0 : W.path) || "").replace(/\W+/g, "-")}`,
1900
- envCode: k[0] || "default",
1897
+ envCode: S[0] || "default"
1898
+ }), s.setFieldsValue({
1899
+ mockName: `mock-${((N = U.data) == null ? void 0 : N.method) || "GET"}-${(((W = U.data) == null ? void 0 : W.path) || "").replace(/\W+/g, "-")}`,
1900
+ envCode: S[0] || "default",
1901
1901
  projectCode: "default",
1902
1902
  responseTemplate: `{
1903
1903
  "code": 0,
1904
1904
  "message": "ok",
1905
1905
  "data": {}
1906
1906
  }`
1907
- })) : T(j.message || "解析失败");
1908
- } catch (j) {
1909
- T(String((j == null ? void 0 : j.message) || j));
1907
+ })) : C(U.message || "解析失败");
1908
+ } catch (U) {
1909
+ C(String((U == null ? void 0 : U.message) || U));
1910
1910
  }
1911
1911
  }, H = async () => {
1912
- if (!a.trim()) {
1912
+ if (!l.trim()) {
1913
1913
  b.warning("请先粘贴 curl 命令");
1914
1914
  return;
1915
1915
  }
1916
- p(!0), d(null);
1916
+ h(!0), d(null);
1917
1917
  try {
1918
- const O = await q.curl.run(a);
1919
- d(O);
1920
- } catch (O) {
1921
- d({ success: !1, error: String((O == null ? void 0 : O.message) || O) });
1918
+ const R = await j.curl.run(l);
1919
+ d(R);
1920
+ } catch (R) {
1921
+ d({ success: !1, error: String((R == null ? void 0 : R.message) || R) });
1922
1922
  } finally {
1923
- p(!1);
1923
+ h(!1);
1924
1924
  }
1925
- }, h = async () => {
1925
+ }, p = async () => {
1926
1926
  if (!c) {
1927
1927
  b.warning("请先解析");
1928
1928
  return;
1929
1929
  }
1930
- let O;
1930
+ let R;
1931
1931
  try {
1932
- O = await u.validateFields();
1932
+ R = await u.validateFields();
1933
1933
  } catch {
1934
1934
  return;
1935
1935
  }
1936
1936
  v(!0);
1937
1937
  try {
1938
- const I = await q.curl.importAsCase({
1939
- curl: a,
1940
- caseName: O.caseName,
1941
- caseGroup: O.caseGroup,
1942
- envCode: O.envCode
1938
+ const k = await j.curl.importAsCase({
1939
+ curl: l,
1940
+ caseName: R.caseName,
1941
+ caseGroup: R.caseGroup,
1942
+ envCode: R.envCode
1943
1943
  });
1944
- I.success ? (b.success(`已导入测试用例: ${I.caseCode}`), n && n("case", I), L()) : b.error(I.message || "导入失败");
1945
- } catch (I) {
1946
- b.error(String((I == null ? void 0 : I.message) || I));
1944
+ k.success ? (b.success(`已导入测试用例: ${k.caseCode}`), r && r("case", k), M()) : b.error(k.message || "导入失败");
1945
+ } catch (k) {
1946
+ b.error(String((k == null ? void 0 : k.message) || k));
1947
1947
  } finally {
1948
1948
  v(!1);
1949
1949
  }
@@ -1952,47 +1952,47 @@ function rn({ open: t, onClose: s, onSuccess: n, envOptions: k = [] }) {
1952
1952
  b.warning("请先解析");
1953
1953
  return;
1954
1954
  }
1955
- let O;
1955
+ let R;
1956
1956
  try {
1957
- O = await i.validateFields();
1957
+ R = await s.validateFields();
1958
1958
  } catch {
1959
1959
  return;
1960
1960
  }
1961
1961
  v(!0);
1962
1962
  try {
1963
- const I = await q.curl.importAsEndpoint({
1964
- curl: a,
1965
- mockName: O.mockName,
1966
- envCode: O.envCode,
1967
- projectCode: O.projectCode,
1968
- responseTemplate: O.responseTemplate
1963
+ const k = await j.curl.importAsEndpoint({
1964
+ curl: l,
1965
+ mockName: R.mockName,
1966
+ envCode: R.envCode,
1967
+ projectCode: R.projectCode,
1968
+ responseTemplate: R.responseTemplate
1969
1969
  });
1970
- I.success ? (b.success(`已导入 Mock 端点: ${I.mockCode}`), n && n("endpoint", I), L()) : b.error(I.message || "导入失败");
1971
- } catch (I) {
1972
- b.error(String((I == null ? void 0 : I.message) || I));
1970
+ k.success ? (b.success(`已导入 Mock 端点: ${k.mockCode}`), r && r("endpoint", k), M()) : b.error(k.message || "导入失败");
1971
+ } catch (k) {
1972
+ b.error(String((k == null ? void 0 : k.message) || k));
1973
1973
  } finally {
1974
1974
  v(!1);
1975
1975
  }
1976
1976
  };
1977
- return /* @__PURE__ */ r(
1977
+ return /* @__PURE__ */ n(
1978
1978
  me,
1979
1979
  {
1980
- title: /* @__PURE__ */ r(P, { children: [
1980
+ title: /* @__PURE__ */ n(E, { children: [
1981
1981
  /* @__PURE__ */ e(fe, {}),
1982
1982
  " 粘贴 curl 一键导入"
1983
1983
  ] }),
1984
1984
  open: t,
1985
- onCancel: L,
1985
+ onCancel: M,
1986
1986
  footer: null,
1987
1987
  size: "large",
1988
1988
  destroyOnHidden: !0,
1989
1989
  children: [
1990
- /* @__PURE__ */ e(Sr, { type: "secondary", style: { marginBottom: 12 }, children: "从浏览器 DevTools / Postman / 终端复制 curl 命令,粘贴到下方即可解析、试跑、入库。" }),
1990
+ /* @__PURE__ */ e(Tn, { type: "secondary", style: { marginBottom: 12 }, children: "从浏览器 DevTools / Postman / 终端复制 curl 命令,粘贴到下方即可解析、试跑、入库。" }),
1991
1991
  /* @__PURE__ */ e(
1992
- rt,
1992
+ nt,
1993
1993
  {
1994
- value: a,
1995
- onChange: (O) => y(O.target.value),
1994
+ value: l,
1995
+ onChange: (R) => y(R.target.value),
1996
1996
  placeholder: `curl -X POST 'https://api.example.com/v1/users/login' \\
1997
1997
  -H 'Content-Type: application/json' \\
1998
1998
  -H 'Authorization: Bearer xxx' \\
@@ -2001,25 +2001,25 @@ function rn({ open: t, onClose: s, onSuccess: n, envOptions: k = [] }) {
2001
2001
  style: { fontFamily: "Menlo, Monaco, monospace", fontSize: 12 }
2002
2002
  }
2003
2003
  ),
2004
- /* @__PURE__ */ r(P, { style: { marginTop: 12 }, children: [
2005
- /* @__PURE__ */ e(_, { icon: /* @__PURE__ */ e(Ke, {}), onClick: J, type: "primary", ghost: !0, children: "解析" }),
2006
- /* @__PURE__ */ e(_, { icon: /* @__PURE__ */ e(be, {}), onClick: H, loading: A, children: "直接执行(试跑)" })
2004
+ /* @__PURE__ */ n(E, { style: { marginTop: 12 }, children: [
2005
+ /* @__PURE__ */ e(A, { icon: /* @__PURE__ */ e(Ke, {}), onClick: J, type: "primary", ghost: !0, children: "解析" }),
2006
+ /* @__PURE__ */ e(A, { icon: /* @__PURE__ */ e(be, {}), onClick: H, loading: _, children: "直接执行(试跑)" })
2007
2007
  ] }),
2008
- x && /* @__PURE__ */ e(V, { type: "error", showIcon: !0, style: { marginTop: 12 }, title: "解析失败", description: x }),
2009
- c && /* @__PURE__ */ e(M, { size: "small", style: { marginTop: 16 }, title: "解析结果", children: /* @__PURE__ */ r(R, { column: 1, size: "small", bordered: !0, children: [
2010
- /* @__PURE__ */ e(R.Item, { label: "Method", children: /* @__PURE__ */ e(w, { color: kr(c.method), children: c.method }) }),
2011
- /* @__PURE__ */ e(R.Item, { label: "URL", children: /* @__PURE__ */ e(he, { code: !0, copyable: !0, children: c.url }) }),
2012
- /* @__PURE__ */ e(R.Item, { label: "Path", children: /* @__PURE__ */ e(he, { code: !0, children: c.path }) }),
2013
- c.query && /* @__PURE__ */ e(R.Item, { label: "Query", children: /* @__PURE__ */ e(he, { code: !0, children: c.query }) }),
2014
- /* @__PURE__ */ e(R.Item, { label: "Headers", children: Object.keys(c.headers || {}).length === 0 ? /* @__PURE__ */ e(he, { type: "secondary", children: "(无)" }) : /* @__PURE__ */ e("div", { children: Object.entries(c.headers).map(([O, I]) => /* @__PURE__ */ r("div", { children: [
2015
- /* @__PURE__ */ r(he, { strong: !0, children: [
2016
- O,
2008
+ x && /* @__PURE__ */ e(Z, { type: "error", showIcon: !0, style: { marginTop: 12 }, title: "解析失败", description: x }),
2009
+ c && /* @__PURE__ */ e(L, { size: "small", style: { marginTop: 16 }, title: "解析结果", children: /* @__PURE__ */ n(z, { column: 1, size: "small", bordered: !0, children: [
2010
+ /* @__PURE__ */ e(z.Item, { label: "Method", children: /* @__PURE__ */ e(w, { color: Cn(c.method), children: c.method }) }),
2011
+ /* @__PURE__ */ e(z.Item, { label: "URL", children: /* @__PURE__ */ e(pe, { code: !0, copyable: !0, children: c.url }) }),
2012
+ /* @__PURE__ */ e(z.Item, { label: "Path", children: /* @__PURE__ */ e(pe, { code: !0, children: c.path }) }),
2013
+ c.query && /* @__PURE__ */ e(z.Item, { label: "Query", children: /* @__PURE__ */ e(pe, { code: !0, children: c.query }) }),
2014
+ /* @__PURE__ */ e(z.Item, { label: "Headers", children: Object.keys(c.headers || {}).length === 0 ? /* @__PURE__ */ e(pe, { type: "secondary", children: "(无)" }) : /* @__PURE__ */ e("div", { children: Object.entries(c.headers).map(([R, k]) => /* @__PURE__ */ n("div", { children: [
2015
+ /* @__PURE__ */ n(pe, { strong: !0, children: [
2016
+ R,
2017
2017
  ":"
2018
2018
  ] }),
2019
2019
  " ",
2020
- /* @__PURE__ */ e(he, { code: !0, children: I })
2021
- ] }, O)) }) }),
2022
- c.body && /* @__PURE__ */ e(R.Item, { label: "Body", children: /* @__PURE__ */ e("pre", { style: {
2020
+ /* @__PURE__ */ e(pe, { code: !0, children: k })
2021
+ ] }, R)) }) }),
2022
+ c.body && /* @__PURE__ */ e(z.Item, { label: "Body", children: /* @__PURE__ */ e("pre", { style: {
2023
2023
  background: "#f5f5f5",
2024
2024
  padding: 8,
2025
2025
  margin: 0,
@@ -2028,54 +2028,54 @@ function rn({ open: t, onClose: s, onSuccess: n, envOptions: k = [] }) {
2028
2028
  overflow: "auto"
2029
2029
  }, children: c.body }) })
2030
2030
  ] }) }),
2031
- l && /* @__PURE__ */ r(M, { size: "small", style: { marginTop: 16 }, title: /* @__PURE__ */ r(P, { children: [
2031
+ a && /* @__PURE__ */ n(L, { size: "small", style: { marginTop: 16 }, title: /* @__PURE__ */ n(E, { children: [
2032
2032
  /* @__PURE__ */ e(be, {}),
2033
2033
  /* @__PURE__ */ e("span", { children: "试跑结果" }),
2034
- l.success ? /* @__PURE__ */ r(w, { color: "green", children: [
2035
- l.status,
2034
+ a.success ? /* @__PURE__ */ n(w, { color: "green", children: [
2035
+ a.status,
2036
2036
  " · ",
2037
- l.durationMs,
2037
+ a.durationMs,
2038
2038
  "ms · ",
2039
- l.bodySize,
2039
+ a.bodySize,
2040
2040
  "B"
2041
2041
  ] }) : /* @__PURE__ */ e(w, { color: "red", children: "FAILED" })
2042
2042
  ] }), children: [
2043
- l.error && /* @__PURE__ */ e(V, { type: "error", showIcon: !0, title: l.error }),
2044
- l.body != null && /* @__PURE__ */ e("pre", { style: {
2043
+ a.error && /* @__PURE__ */ e(Z, { type: "error", showIcon: !0, title: a.error }),
2044
+ a.body != null && /* @__PURE__ */ e("pre", { style: {
2045
2045
  background: "#f5f5f5",
2046
2046
  padding: 8,
2047
2047
  margin: 0,
2048
2048
  fontSize: 12,
2049
2049
  maxHeight: 240,
2050
2050
  overflow: "auto"
2051
- }, children: l.body })
2051
+ }, children: a.body })
2052
2052
  ] }),
2053
2053
  c && /* @__PURE__ */ e(
2054
- Ie,
2054
+ ke,
2055
2055
  {
2056
- activeKey: $,
2057
- onChange: C,
2056
+ activeKey: D,
2057
+ onChange: T,
2058
2058
  style: { marginTop: 16 },
2059
2059
  items: [
2060
2060
  {
2061
2061
  key: "import",
2062
- label: /* @__PURE__ */ r("span", { children: [
2063
- /* @__PURE__ */ e(De, {}),
2062
+ label: /* @__PURE__ */ n("span", { children: [
2063
+ /* @__PURE__ */ e(Ne, {}),
2064
2064
  " 导入为测试用例"
2065
2065
  ] }),
2066
- children: /* @__PURE__ */ r(E, { form: u, layout: "vertical", children: [
2067
- /* @__PURE__ */ r(Y, { gutter: 16, children: [
2068
- /* @__PURE__ */ e(z, { span: 12, children: /* @__PURE__ */ e(E.Item, { name: "caseName", label: "用例名称", rules: [{ required: !0 }], children: /* @__PURE__ */ e(B, {}) }) }),
2069
- /* @__PURE__ */ e(z, { span: 6, children: /* @__PURE__ */ e(E.Item, { name: "caseGroup", label: "用例分组", children: /* @__PURE__ */ e(B, {}) }) }),
2070
- /* @__PURE__ */ e(z, { span: 6, children: /* @__PURE__ */ e(E.Item, { name: "envCode", label: "环境", children: k.length > 0 ? /* @__PURE__ */ e(X, { options: k.map((O) => ({ value: O, label: O })) }) : /* @__PURE__ */ e(B, {}) }) })
2066
+ children: /* @__PURE__ */ n(P, { form: u, layout: "vertical", children: [
2067
+ /* @__PURE__ */ n(Y, { gutter: 16, children: [
2068
+ /* @__PURE__ */ e(O, { span: 12, children: /* @__PURE__ */ e(P.Item, { name: "caseName", label: "用例名称", rules: [{ required: !0 }], children: /* @__PURE__ */ e(B, {}) }) }),
2069
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ e(P.Item, { name: "caseGroup", label: "用例分组", children: /* @__PURE__ */ e(B, {}) }) }),
2070
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ e(P.Item, { name: "envCode", label: "环境", children: S.length > 0 ? /* @__PURE__ */ e(V, { options: S.map((R) => ({ value: R, label: R })) }) : /* @__PURE__ */ e(B, {}) }) })
2071
2071
  ] }),
2072
2072
  /* @__PURE__ */ e(
2073
- _,
2073
+ A,
2074
2074
  {
2075
2075
  type: "primary",
2076
- onClick: h,
2076
+ onClick: p,
2077
2077
  loading: g,
2078
- icon: /* @__PURE__ */ e(De, {}),
2078
+ icon: /* @__PURE__ */ e(Ne, {}),
2079
2079
  children: "保存为测试用例"
2080
2080
  }
2081
2081
  )
@@ -2083,25 +2083,25 @@ function rn({ open: t, onClose: s, onSuccess: n, envOptions: k = [] }) {
2083
2083
  },
2084
2084
  {
2085
2085
  key: "mock",
2086
- label: /* @__PURE__ */ r("span", { children: [
2086
+ label: /* @__PURE__ */ n("span", { children: [
2087
2087
  /* @__PURE__ */ e(fe, {}),
2088
2088
  " 导入为 Mock 端点"
2089
2089
  ] }),
2090
- children: /* @__PURE__ */ r(E, { form: i, layout: "vertical", children: [
2091
- /* @__PURE__ */ r(Y, { gutter: 16, children: [
2092
- /* @__PURE__ */ e(z, { span: 12, children: /* @__PURE__ */ e(E.Item, { name: "mockName", label: "Mock 名称", rules: [{ required: !0 }], children: /* @__PURE__ */ e(B, {}) }) }),
2093
- /* @__PURE__ */ e(z, { span: 6, children: /* @__PURE__ */ e(E.Item, { name: "envCode", label: "环境", children: k.length > 0 ? /* @__PURE__ */ e(X, { options: k.map((O) => ({ value: O, label: O })) }) : /* @__PURE__ */ e(B, {}) }) }),
2094
- /* @__PURE__ */ e(z, { span: 6, children: /* @__PURE__ */ e(E.Item, { name: "projectCode", label: "项目", children: /* @__PURE__ */ e(B, {}) }) })
2090
+ children: /* @__PURE__ */ n(P, { form: s, layout: "vertical", children: [
2091
+ /* @__PURE__ */ n(Y, { gutter: 16, children: [
2092
+ /* @__PURE__ */ e(O, { span: 12, children: /* @__PURE__ */ e(P.Item, { name: "mockName", label: "Mock 名称", rules: [{ required: !0 }], children: /* @__PURE__ */ e(B, {}) }) }),
2093
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ e(P.Item, { name: "envCode", label: "环境", children: S.length > 0 ? /* @__PURE__ */ e(V, { options: S.map((R) => ({ value: R, label: R })) }) : /* @__PURE__ */ e(B, {}) }) }),
2094
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ e(P.Item, { name: "projectCode", label: "项目", children: /* @__PURE__ */ e(B, {}) }) })
2095
2095
  ] }),
2096
- /* @__PURE__ */ e(E.Item, { name: "responseTemplate", label: "响应模板 (JSON)", children: /* @__PURE__ */ e(
2097
- rt,
2096
+ /* @__PURE__ */ e(P.Item, { name: "responseTemplate", label: "响应模板 (JSON)", children: /* @__PURE__ */ e(
2097
+ nt,
2098
2098
  {
2099
2099
  autoSize: { minRows: 3, maxRows: 8 },
2100
2100
  style: { fontFamily: "Menlo, Monaco, monospace" }
2101
2101
  }
2102
2102
  ) }),
2103
2103
  /* @__PURE__ */ e(
2104
- _,
2104
+ A,
2105
2105
  {
2106
2106
  type: "primary",
2107
2107
  onClick: o,
@@ -2119,25 +2119,25 @@ function rn({ open: t, onClose: s, onSuccess: n, envOptions: k = [] }) {
2119
2119
  }
2120
2120
  );
2121
2121
  }
2122
- function kr(t) {
2122
+ function Cn(t) {
2123
2123
  return { GET: "blue", POST: "green", PUT: "orange", DELETE: "red", PATCH: "purple" }[t] || "default";
2124
2124
  }
2125
- const { TextArea: nt } = B;
2126
- function nn({ open: t, onClose: s, onSuccess: n, envOptions: k = [] }) {
2127
- const [a, y] = m("paste"), [c, f] = m(""), [x, T] = m(null), [A, p] = m(null), [l, d] = m(!1), [g, v] = m([]), [$, C] = m(!1), [u] = E.useForm(), i = st(null), S = () => {
2128
- f(""), T(null), p(null), v([]), u.resetFields();
2129
- }, L = () => {
2130
- S(), s();
2125
+ const { TextArea: rt } = B;
2126
+ function sr({ open: t, onClose: i, onSuccess: r, envOptions: S = [] }) {
2127
+ const [l, y] = m("paste"), [c, f] = m(""), [x, C] = m(null), [_, h] = m(null), [a, d] = m(!1), [g, v] = m([]), [D, T] = m(!1), [u] = P.useForm(), s = it(null), I = () => {
2128
+ f(""), C(null), h(null), v([]), u.resetFields();
2129
+ }, M = () => {
2130
+ I(), i();
2131
2131
  }, J = async () => {
2132
2132
  if (!c.trim()) {
2133
2133
  b.warning("请先粘贴或上传 API 规约");
2134
2134
  return;
2135
2135
  }
2136
- p(null), d(!0);
2136
+ h(null), d(!0);
2137
2137
  try {
2138
- const I = await q.openapi.parse(c);
2139
- I.success ? (T(I), v((I.endpoints || []).map((D, W) => W)), u.setFieldsValue({
2140
- envCode: k[0] || "default",
2138
+ const k = await j.openapi.parse(c);
2139
+ k.success ? (C(k), v((k.endpoints || []).map((N, W) => W)), u.setFieldsValue({
2140
+ envCode: S[0] || "default",
2141
2141
  projectCode: "default",
2142
2142
  defaultResponse: `{
2143
2143
  "code": 0,
@@ -2147,63 +2147,63 @@ function nn({ open: t, onClose: s, onSuccess: n, envOptions: k = [] }) {
2147
2147
  defaultStatus: 200,
2148
2148
  priority: 5,
2149
2149
  tagPrefix: "openapi-import"
2150
- }), b.success(`识别为 ${I.format},共 ${I.count} 个端点`)) : p(I.message || "解析失败");
2151
- } catch (I) {
2152
- p(String((I == null ? void 0 : I.message) || I));
2150
+ }), b.success(`识别为 ${k.format},共 ${k.count} 个端点`)) : h(k.message || "解析失败");
2151
+ } catch (k) {
2152
+ h(String((k == null ? void 0 : k.message) || k));
2153
2153
  } finally {
2154
2154
  d(!1);
2155
2155
  }
2156
- }, H = async (I) => {
2156
+ }, H = async (k) => {
2157
2157
  try {
2158
- const D = await q.openapi.sample(I);
2159
- D.success && (f(D.content), b.success(`已加载 ${D.format} 示例`));
2160
- } catch (D) {
2161
- b.error("加载示例失败: " + D.message);
2162
- }
2163
- }, h = (I) => {
2164
- const D = new FileReader();
2165
- return D.onload = (W) => {
2166
- var j;
2167
- f(String(((j = W.target) == null ? void 0 : j.result) || "")), b.success(`已读取 ${I.name}(${(I.size / 1024).toFixed(1)}KB)`);
2168
- }, D.onerror = () => b.error("文件读取失败"), D.readAsText(I), !1;
2158
+ const N = await j.openapi.sample(k);
2159
+ N.success && (f(N.content), b.success(`已加载 ${N.format} 示例`));
2160
+ } catch (N) {
2161
+ b.error("加载示例失败: " + N.message);
2162
+ }
2163
+ }, p = (k) => {
2164
+ const N = new FileReader();
2165
+ return N.onload = (W) => {
2166
+ var U;
2167
+ f(String(((U = W.target) == null ? void 0 : U.result) || "")), b.success(`已读取 ${k.name}(${(k.size / 1024).toFixed(1)}KB)`);
2168
+ }, N.onerror = () => b.error("文件读取失败"), N.readAsText(k), !1;
2169
2169
  }, o = async () => {
2170
2170
  if (!x) {
2171
2171
  b.warning("请先解析");
2172
2172
  return;
2173
2173
  }
2174
- let I;
2174
+ let k;
2175
2175
  try {
2176
- I = await u.validateFields();
2176
+ k = await u.validateFields();
2177
2177
  } catch {
2178
2178
  return;
2179
2179
  }
2180
- C(!0);
2180
+ T(!0);
2181
2181
  try {
2182
- const D = (x.endpoints || []).map((j, Ve) => ({
2183
- method: j.method,
2184
- path: j.path
2185
- })).filter((j, Ve) => g.includes(Ve)), W = await q.openapi.importBatch({
2182
+ const N = (x.endpoints || []).map((U, Ze) => ({
2183
+ method: U.method,
2184
+ path: U.path
2185
+ })).filter((U, Ze) => g.includes(Ze)), W = await j.openapi.importBatch({
2186
2186
  content: c,
2187
- selected: D,
2188
- envCode: I.envCode,
2189
- projectCode: I.projectCode,
2190
- defaultResponse: I.defaultResponse,
2191
- defaultStatus: I.defaultStatus,
2192
- priority: I.priority,
2193
- tagPrefix: I.tagPrefix
2187
+ selected: N,
2188
+ envCode: k.envCode,
2189
+ projectCode: k.projectCode,
2190
+ defaultResponse: k.defaultResponse,
2191
+ defaultStatus: k.defaultStatus,
2192
+ priority: k.priority,
2193
+ tagPrefix: k.tagPrefix
2194
2194
  });
2195
- W.success ? (b.success(`已导入 ${W.imported} 个 Mock 端点${W.failed > 0 ? `,失败 ${W.failed}` : ""}`), n && n(W), L()) : b.error(W.message || "导入失败");
2196
- } catch (D) {
2197
- b.error(String((D == null ? void 0 : D.message) || D));
2195
+ W.success ? (b.success(`已导入 ${W.imported} 个 Mock 端点${W.failed > 0 ? `,失败 ${W.failed}` : ""}`), r && r(W), M()) : b.error(W.message || "导入失败");
2196
+ } catch (N) {
2197
+ b.error(String((N == null ? void 0 : N.message) || N));
2198
2198
  } finally {
2199
- C(!1);
2199
+ T(!1);
2200
2200
  }
2201
- }, O = [
2201
+ }, R = [
2202
2202
  {
2203
2203
  title: "Method",
2204
2204
  dataIndex: "method",
2205
2205
  width: 90,
2206
- render: (I) => /* @__PURE__ */ e(w, { color: Cr(I), children: I })
2206
+ render: (k) => /* @__PURE__ */ e(w, { color: vn(k), children: k })
2207
2207
  },
2208
2208
  { title: "Path", dataIndex: "path", width: 240, ellipsis: !0 },
2209
2209
  { title: "Summary", dataIndex: "summary", ellipsis: !0 },
@@ -2211,13 +2211,13 @@ function nn({ open: t, onClose: s, onSuccess: n, envOptions: k = [] }) {
2211
2211
  title: "Tags",
2212
2212
  dataIndex: "tags",
2213
2213
  width: 160,
2214
- render: (I) => (I || []).map((D) => /* @__PURE__ */ e(w, { children: D }, D))
2214
+ render: (k) => (k || []).map((N) => /* @__PURE__ */ e(w, { children: N }, N))
2215
2215
  },
2216
2216
  {
2217
2217
  title: "Params",
2218
2218
  dataIndex: "parameters",
2219
2219
  width: 80,
2220
- render: (I) => (I == null ? void 0 : I.length) || 0,
2220
+ render: (k) => (k == null ? void 0 : k.length) || 0,
2221
2221
  align: "center"
2222
2222
  },
2223
2223
  {
@@ -2225,68 +2225,68 @@ function nn({ open: t, onClose: s, onSuccess: n, envOptions: k = [] }) {
2225
2225
  title: "示例",
2226
2226
  dataIndex: "response_example",
2227
2227
  width: 80,
2228
- render: (I) => I ? /* @__PURE__ */ e(w, { color: "green", children: "有" }) : /* @__PURE__ */ e(w, { children: "无" })
2228
+ render: (k) => k ? /* @__PURE__ */ e(w, { color: "green", children: "有" }) : /* @__PURE__ */ e(w, { children: "无" })
2229
2229
  }
2230
2230
  ];
2231
- return /* @__PURE__ */ r(
2231
+ return /* @__PURE__ */ n(
2232
2232
  me,
2233
2233
  {
2234
- title: /* @__PURE__ */ r(P, { children: [
2235
- /* @__PURE__ */ e(Xe, {}),
2234
+ title: /* @__PURE__ */ n(E, { children: [
2235
+ /* @__PURE__ */ e(Ve, {}),
2236
2236
  " 批量导入 API 规约"
2237
2237
  ] }),
2238
2238
  open: t,
2239
- onCancel: L,
2239
+ onCancel: M,
2240
2240
  footer: null,
2241
2241
  size: "large",
2242
2242
  destroyOnHidden: !0,
2243
2243
  children: [
2244
2244
  /* @__PURE__ */ e(
2245
- Ie,
2245
+ ke,
2246
2246
  {
2247
- activeKey: a,
2247
+ activeKey: l,
2248
2248
  onChange: y,
2249
2249
  items: [
2250
2250
  {
2251
2251
  key: "paste",
2252
- label: /* @__PURE__ */ r("span", { children: [
2252
+ label: /* @__PURE__ */ n("span", { children: [
2253
2253
  /* @__PURE__ */ e(Ke, {}),
2254
2254
  " 粘贴 JSON"
2255
2255
  ] }),
2256
- children: /* @__PURE__ */ r("div", { children: [
2256
+ children: /* @__PURE__ */ n("div", { children: [
2257
2257
  /* @__PURE__ */ e(
2258
- nt,
2258
+ rt,
2259
2259
  {
2260
2260
  value: c,
2261
- onChange: (I) => f(I.target.value),
2261
+ onChange: (k) => f(k.target.value),
2262
2262
  placeholder: "粘贴 OpenAPI 3.x / Swagger 2.0 / Postman v2.1 JSON 内容…",
2263
2263
  autoSize: { minRows: 6, maxRows: 16 },
2264
2264
  style: { fontFamily: "Menlo, Monaco, monospace", fontSize: 12 }
2265
2265
  }
2266
2266
  ),
2267
- /* @__PURE__ */ r(P, { style: { marginTop: 8 }, children: [
2268
- /* @__PURE__ */ e(_, { size: "small", onClick: () => H("openapi3"), children: "加载 OpenAPI 3 示例" }),
2269
- /* @__PURE__ */ e(_, { size: "small", onClick: () => H("swagger2"), children: "加载 Swagger 2 示例" }),
2270
- /* @__PURE__ */ e(_, { size: "small", onClick: () => H("postman"), children: "加载 Postman 示例" })
2267
+ /* @__PURE__ */ n(E, { style: { marginTop: 8 }, children: [
2268
+ /* @__PURE__ */ e(A, { size: "small", onClick: () => H("openapi3"), children: "加载 OpenAPI 3 示例" }),
2269
+ /* @__PURE__ */ e(A, { size: "small", onClick: () => H("swagger2"), children: "加载 Swagger 2 示例" }),
2270
+ /* @__PURE__ */ e(A, { size: "small", onClick: () => H("postman"), children: "加载 Postman 示例" })
2271
2271
  ] })
2272
2272
  ] })
2273
2273
  },
2274
2274
  {
2275
2275
  key: "upload",
2276
- label: /* @__PURE__ */ r("span", { children: [
2277
- /* @__PURE__ */ e(Lt, {}),
2276
+ label: /* @__PURE__ */ n("span", { children: [
2277
+ /* @__PURE__ */ e(Mt, {}),
2278
2278
  " 上传文件"
2279
2279
  ] }),
2280
- children: /* @__PURE__ */ r(
2281
- kt.Dragger,
2280
+ children: /* @__PURE__ */ n(
2281
+ St.Dragger,
2282
2282
  {
2283
- ref: i,
2283
+ ref: s,
2284
2284
  accept: ".json,.yaml,.yml,application/json,text/yaml",
2285
- beforeUpload: h,
2285
+ beforeUpload: p,
2286
2286
  showUploadList: !1,
2287
2287
  style: { padding: 24 },
2288
2288
  children: [
2289
- /* @__PURE__ */ e("p", { className: "ant-upload-drag-icon", children: /* @__PURE__ */ e(Xe, { style: { fontSize: 48, color: "#1890ff" } }) }),
2289
+ /* @__PURE__ */ e("p", { className: "ant-upload-drag-icon", children: /* @__PURE__ */ e(Ve, { style: { fontSize: 48, color: "#1890ff" } }) }),
2290
2290
  /* @__PURE__ */ e("p", { className: "ant-upload-text", children: "点击或拖拽 JSON / YAML 文件到此处" }),
2291
2291
  /* @__PURE__ */ e("p", { className: "ant-upload-hint", children: "支持 OpenAPI 3.x / Swagger 2.0 / Postman v2.1" })
2292
2292
  ]
@@ -2296,28 +2296,28 @@ function nn({ open: t, onClose: s, onSuccess: n, envOptions: k = [] }) {
2296
2296
  ]
2297
2297
  }
2298
2298
  ),
2299
- /* @__PURE__ */ r(P, { style: { marginTop: 12 }, children: [
2300
- /* @__PURE__ */ e(_, { type: "primary", icon: /* @__PURE__ */ e(be, {}), onClick: J, loading: l, children: "解析" }),
2299
+ /* @__PURE__ */ n(E, { style: { marginTop: 12 }, children: [
2300
+ /* @__PURE__ */ e(A, { type: "primary", icon: /* @__PURE__ */ e(be, {}), onClick: J, loading: a, children: "解析" }),
2301
2301
  x && /* @__PURE__ */ e(w, { color: "blue", children: x.format }),
2302
- x && /* @__PURE__ */ r(w, { children: [
2302
+ x && /* @__PURE__ */ n(w, { children: [
2303
2303
  "共 ",
2304
2304
  x.count,
2305
2305
  " 个端点,已选 ",
2306
2306
  g.length
2307
2307
  ] })
2308
2308
  ] }),
2309
- A && /* @__PURE__ */ e(V, { type: "error", showIcon: !0, style: { marginTop: 12 }, title: "解析失败", description: A }),
2309
+ _ && /* @__PURE__ */ e(Z, { type: "error", showIcon: !0, style: { marginTop: 12 }, title: "解析失败", description: _ }),
2310
2310
  x && /* 端点预览 —— 走基座 ListTable(lead 008 §2 三件套):
2311
2311
  标准分页 + 端侧过滤 + EmptyState。
2312
2312
  原来那层 <Card size="small" title="预览(可勾选要导入的)"> 已去掉,
2313
2313
  标题落到 ListTable 的 cardTitle,避免卡片套卡片。 */
2314
2314
  /* @__PURE__ */ e(
2315
- ie,
2315
+ se,
2316
2316
  {
2317
2317
  cardTitle: "预览(可勾选要导入的)",
2318
2318
  rows: x.endpoints || [],
2319
- columns: O,
2320
- rowKey: (I, D) => D,
2319
+ columns: R,
2320
+ rowKey: (k, N) => N,
2321
2321
  rowSelection: {
2322
2322
  selectedRowKeys: g,
2323
2323
  onChange: v
@@ -2330,29 +2330,29 @@ function nn({ open: t, onClose: s, onSuccess: n, envOptions: k = [] }) {
2330
2330
  cardProps: { size: "small", style: { marginTop: 16 } }
2331
2331
  }
2332
2332
  ),
2333
- x && /* @__PURE__ */ e(M, { size: "small", style: { marginTop: 16 }, title: "导入配置", children: /* @__PURE__ */ r(E, { form: u, layout: "vertical", children: [
2334
- /* @__PURE__ */ r(Y, { gutter: 16, children: [
2335
- /* @__PURE__ */ e(z, { span: 6, children: /* @__PURE__ */ e(E.Item, { name: "envCode", label: "环境", rules: [{ required: !0 }], children: k.length > 0 ? /* @__PURE__ */ e(X, { options: k.map((I) => ({ value: I, label: I })) }) : /* @__PURE__ */ e(B, {}) }) }),
2336
- /* @__PURE__ */ e(z, { span: 6, children: /* @__PURE__ */ e(E.Item, { name: "projectCode", label: "项目", children: /* @__PURE__ */ e(B, {}) }) }),
2337
- /* @__PURE__ */ e(z, { span: 4, children: /* @__PURE__ */ e(E.Item, { name: "defaultStatus", label: "默认状态码", children: /* @__PURE__ */ e(B, { type: "number" }) }) }),
2338
- /* @__PURE__ */ e(z, { span: 4, children: /* @__PURE__ */ e(E.Item, { name: "priority", label: "优先级", children: /* @__PURE__ */ e(B, { type: "number" }) }) }),
2339
- /* @__PURE__ */ e(z, { span: 4, children: /* @__PURE__ */ e(E.Item, { name: "tagPrefix", label: "Tag 前缀", children: /* @__PURE__ */ e(B, {}) }) })
2333
+ x && /* @__PURE__ */ e(L, { size: "small", style: { marginTop: 16 }, title: "导入配置", children: /* @__PURE__ */ n(P, { form: u, layout: "vertical", children: [
2334
+ /* @__PURE__ */ n(Y, { gutter: 16, children: [
2335
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ e(P.Item, { name: "envCode", label: "环境", rules: [{ required: !0 }], children: S.length > 0 ? /* @__PURE__ */ e(V, { options: S.map((k) => ({ value: k, label: k })) }) : /* @__PURE__ */ e(B, {}) }) }),
2336
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ e(P.Item, { name: "projectCode", label: "项目", children: /* @__PURE__ */ e(B, {}) }) }),
2337
+ /* @__PURE__ */ e(O, { span: 4, children: /* @__PURE__ */ e(P.Item, { name: "defaultStatus", label: "默认状态码", children: /* @__PURE__ */ e(B, { type: "number" }) }) }),
2338
+ /* @__PURE__ */ e(O, { span: 4, children: /* @__PURE__ */ e(P.Item, { name: "priority", label: "优先级", children: /* @__PURE__ */ e(B, { type: "number" }) }) }),
2339
+ /* @__PURE__ */ e(O, { span: 4, children: /* @__PURE__ */ e(P.Item, { name: "tagPrefix", label: "Tag 前缀", children: /* @__PURE__ */ e(B, {}) }) })
2340
2340
  ] }),
2341
- /* @__PURE__ */ e(E.Item, { name: "defaultResponse", label: "默认响应(无 example 时使用)", children: /* @__PURE__ */ e(
2342
- nt,
2341
+ /* @__PURE__ */ e(P.Item, { name: "defaultResponse", label: "默认响应(无 example 时使用)", children: /* @__PURE__ */ e(
2342
+ rt,
2343
2343
  {
2344
2344
  autoSize: { minRows: 3, maxRows: 6 },
2345
2345
  style: { fontFamily: "Menlo, Monaco, monospace" }
2346
2346
  }
2347
2347
  ) }),
2348
- /* @__PURE__ */ r(
2349
- _,
2348
+ /* @__PURE__ */ n(
2349
+ A,
2350
2350
  {
2351
2351
  type: "primary",
2352
2352
  size: "large",
2353
- icon: /* @__PURE__ */ e(De, {}),
2353
+ icon: /* @__PURE__ */ e(Ne, {}),
2354
2354
  onClick: o,
2355
- loading: $,
2355
+ loading: D,
2356
2356
  disabled: g.length === 0,
2357
2357
  children: [
2358
2358
  "批量导入 ",
@@ -2366,22 +2366,22 @@ function nn({ open: t, onClose: s, onSuccess: n, envOptions: k = [] }) {
2366
2366
  }
2367
2367
  );
2368
2368
  }
2369
- function Cr(t) {
2369
+ function vn(t) {
2370
2370
  return { GET: "blue", POST: "green", PUT: "orange", DELETE: "red", PATCH: "purple" }[t] || "default";
2371
2371
  }
2372
- const Tr = {
2372
+ const An = {
2373
2373
  STANDARD_JSON: { label: "标准 JSON", color: "blue" },
2374
2374
  RSS_XML: { label: "RSS 2.0", color: "orange" },
2375
2375
  ATOM_XML: { label: "Atom 1.0", color: "gold" },
2376
2376
  CUSTOM_SCRIPT: { label: "自定义脚本", color: "purple" },
2377
2377
  INTERNAL_BEAN: { label: "内部 Bean", color: "cyan" }
2378
- }, vr = {
2378
+ }, _n = {
2379
2379
  PENDING_VERIFY: { color: "default", text: "待验证" },
2380
2380
  VERIFIED: { color: "green", text: "已验证" },
2381
2381
  INVALID_AUTH: { color: "red", text: "鉴权失败" },
2382
2382
  FATAL: { color: "red", text: "永久失败" },
2383
2383
  DISABLED: { color: "default", text: "已停用" }
2384
- }, lt = {
2384
+ }, at = {
2385
2385
  PENDING: { color: "default" },
2386
2386
  RUNNING: { color: "processing" },
2387
2387
  SUCCESS: { color: "green" },
@@ -2389,59 +2389,59 @@ const Tr = {
2389
2389
  FAILED: { color: "red" },
2390
2390
  FATAL: { color: "red" }
2391
2391
  };
2392
- function _r() {
2393
- const t = xe(), [s, n] = m([]), [k, a] = m(!1), [y, c] = m(null), [f, x] = m([]), [T, A] = m({}), [p, l] = m(null), [d, g] = m([]), v = async () => {
2394
- a(!0);
2392
+ function Pn() {
2393
+ const t = xe(), [i, r] = m([]), [S, l] = m(!1), [y, c] = m(null), [f, x] = m([]), [C, _] = m({}), [h, a] = m(null), [d, g] = m([]), v = async () => {
2394
+ l(!0);
2395
2395
  try {
2396
- const h = await N.get("/subscribe/subscription/list");
2397
- h && h.success !== !1 && n(Array.isArray(h.data) ? h.data : Array.isArray(h) ? h : []);
2398
- } catch (h) {
2399
- b.error("获取订阅列表失败: " + ((h == null ? void 0 : h.message) || ""));
2396
+ const p = await $.get("/subscribe/subscription/list");
2397
+ p && p.success !== !1 && r(Array.isArray(p.data) ? p.data : Array.isArray(p) ? p : []);
2398
+ } catch (p) {
2399
+ b.error("获取订阅列表失败: " + ((p == null ? void 0 : p.message) || ""));
2400
2400
  } finally {
2401
- a(!1);
2401
+ l(!1);
2402
2402
  }
2403
2403
  };
2404
- U(() => {
2404
+ F(() => {
2405
2405
  v();
2406
2406
  }, []);
2407
- const $ = (h) => {
2407
+ const D = (p) => {
2408
2408
  me.confirm({
2409
2409
  title: "确认删除",
2410
2410
  icon: /* @__PURE__ */ e(Bt, {}),
2411
- content: `确定要删除订阅 "${h.name}" 吗? 运行历史会保留.`,
2411
+ content: `确定要删除订阅 "${p.name}" 吗? 运行历史会保留.`,
2412
2412
  onOk: async () => {
2413
2413
  try {
2414
- const o = await N.delete(`/subscribe/subscription/${h.id}`);
2414
+ const o = await $.delete(`/subscribe/subscription/${p.id}`);
2415
2415
  o && o.success !== !1 ? (b.success("删除成功"), v()) : b.error((o == null ? void 0 : o.message) || "删除失败");
2416
2416
  } catch (o) {
2417
2417
  b.error("删除失败: " + ((o == null ? void 0 : o.message) || ""));
2418
2418
  }
2419
2419
  }
2420
2420
  });
2421
- }, C = async (h) => {
2421
+ }, T = async (p) => {
2422
2422
  try {
2423
- const o = await N.post(`/subscribe/subscription/${h}/enable`);
2423
+ const o = await $.post(`/subscribe/subscription/${p}/enable`);
2424
2424
  o && o.success !== !1 ? (b.success("已启用"), v()) : b.error((o == null ? void 0 : o.message) || "启用失败");
2425
2425
  } catch (o) {
2426
2426
  b.error("启用失败: " + ((o == null ? void 0 : o.message) || ""));
2427
2427
  }
2428
- }, u = async (h) => {
2428
+ }, u = async (p) => {
2429
2429
  try {
2430
- const o = await N.post(`/subscribe/subscription/${h}/disable`);
2430
+ const o = await $.post(`/subscribe/subscription/${p}/disable`);
2431
2431
  o && o.success !== !1 ? (b.success("已停用"), v()) : b.error((o == null ? void 0 : o.message) || "停用失败");
2432
2432
  } catch (o) {
2433
2433
  b.error("停用失败: " + ((o == null ? void 0 : o.message) || ""));
2434
2434
  }
2435
- }, i = async (h) => {
2435
+ }, s = async (p) => {
2436
2436
  me.confirm({
2437
2437
  title: "手动触发",
2438
- content: `将立即执行一次 "${h.name}" 的抽取, 同步返回 runId.`,
2438
+ content: `将立即执行一次 "${p.name}" 的抽取, 同步返回 runId.`,
2439
2439
  onOk: async () => {
2440
2440
  try {
2441
- const o = await N.post(`/subscribe/subscription/${h.id}/trigger?triggerBy=ceo`);
2441
+ const o = await $.post(`/subscribe/subscription/${p.id}/trigger?triggerBy=ceo`);
2442
2442
  if (o && (o.data !== void 0 || o.success !== !1)) {
2443
- const O = o.data ?? o;
2444
- b.success(`已触发, runId = ${O}`), L(h);
2443
+ const R = o.data ?? o;
2444
+ b.success(`已触发, runId = ${R}`), M(p);
2445
2445
  } else
2446
2446
  b.error((o == null ? void 0 : o.message) || "触发失败");
2447
2447
  } catch (o) {
@@ -2449,33 +2449,33 @@ function _r() {
2449
2449
  }
2450
2450
  }
2451
2451
  });
2452
- }, S = async (h) => {
2452
+ }, I = async (p) => {
2453
2453
  try {
2454
- const o = await N.post(`/subscribe/subscription/${h.id}/dry-run`);
2455
- c({ sub: h, result: (o == null ? void 0 : o.data) ?? o });
2454
+ const o = await $.post(`/subscribe/subscription/${p.id}/dry-run`);
2455
+ c({ sub: p, result: (o == null ? void 0 : o.data) ?? o });
2456
2456
  } catch (o) {
2457
- c({ sub: h, result: { success: !1, errorMessage: (o == null ? void 0 : o.message) || "请求失败" } });
2457
+ c({ sub: p, result: { success: !1, errorMessage: (o == null ? void 0 : o.message) || "请求失败" } });
2458
2458
  }
2459
- }, L = async (h) => {
2459
+ }, M = async (p) => {
2460
2460
  try {
2461
- const o = await N.get(`/subscribe/run/list?subscriptionId=${h.id}&limit=20`), O = (o == null ? void 0 : o.data) ?? o ?? [];
2462
- x(Array.isArray(O) ? O : []), l(null), A({}), g([]), c({ sub: h, tab: "runs" });
2461
+ const o = await $.get(`/subscribe/run/list?subscriptionId=${p.id}&limit=20`), R = (o == null ? void 0 : o.data) ?? o ?? [];
2462
+ x(Array.isArray(R) ? R : []), a(null), _({}), g([]), c({ sub: p, tab: "runs" });
2463
2463
  } catch {
2464
2464
  b.error("获取运行历史失败");
2465
2465
  }
2466
- }, J = async (h) => {
2467
- if (T[h]) {
2468
- l(h);
2466
+ }, J = async (p) => {
2467
+ if (C[p]) {
2468
+ a(p);
2469
2469
  return;
2470
2470
  }
2471
2471
  try {
2472
- const o = await N.get(`/subscribe/run/${h}/items?limit=200`), O = (o == null ? void 0 : o.data) ?? o ?? [];
2473
- A((I) => ({ ...I, [h]: Array.isArray(O) ? O : [] })), l(h);
2472
+ const o = await $.get(`/subscribe/run/${p}/items?limit=200`), R = (o == null ? void 0 : o.data) ?? o ?? [];
2473
+ _((k) => ({ ...k, [p]: Array.isArray(R) ? R : [] })), a(p);
2474
2474
  } catch {
2475
2475
  b.error("获取抽取项失败");
2476
2476
  }
2477
2477
  };
2478
- return /* @__PURE__ */ r("div", { children: [
2478
+ return /* @__PURE__ */ n("div", { children: [
2479
2479
  /* @__PURE__ */ e(
2480
2480
  ye,
2481
2481
  {
@@ -2484,7 +2484,7 @@ function _r() {
2484
2484
  }
2485
2485
  ),
2486
2486
  /* @__PURE__ */ e(
2487
- V,
2487
+ Z,
2488
2488
  {
2489
2489
  type: "info",
2490
2490
  showIcon: !0,
@@ -2493,9 +2493,9 @@ function _r() {
2493
2493
  }
2494
2494
  ),
2495
2495
  /* @__PURE__ */ e(
2496
- ie,
2496
+ se,
2497
2497
  {
2498
- rows: s,
2498
+ rows: i,
2499
2499
  columns: [
2500
2500
  {
2501
2501
  title: "ID",
@@ -2505,8 +2505,8 @@ function _r() {
2505
2505
  {
2506
2506
  title: "名称",
2507
2507
  dataIndex: "name",
2508
- render: (h, o) => /* @__PURE__ */ r(P, { orientation: "vertical", size: 0, children: [
2509
- /* @__PURE__ */ e("span", { style: { fontWeight: 500 }, children: h }),
2508
+ render: (p, o) => /* @__PURE__ */ n(E, { orientation: "vertical", size: 0, children: [
2509
+ /* @__PURE__ */ e("span", { style: { fontWeight: 500 }, children: p }),
2510
2510
  o.description && /* @__PURE__ */ e("span", { style: { color: "#999", fontSize: 12 }, children: o.description })
2511
2511
  ] })
2512
2512
  },
@@ -2514,14 +2514,14 @@ function _r() {
2514
2514
  title: "数据源",
2515
2515
  dataIndex: "sourceType",
2516
2516
  width: 90,
2517
- render: (h) => /* @__PURE__ */ e(w, { children: h })
2517
+ render: (p) => /* @__PURE__ */ e(w, { children: p })
2518
2518
  },
2519
2519
  {
2520
2520
  title: "抽取器",
2521
2521
  dataIndex: "extractorType",
2522
2522
  width: 140,
2523
- render: (h) => {
2524
- const o = Tr[h] || { label: h, color: "default" };
2523
+ render: (p) => {
2524
+ const o = An[p] || { label: p, color: "default" };
2525
2525
  return /* @__PURE__ */ e(w, { color: o.color, children: o.label });
2526
2526
  }
2527
2527
  },
@@ -2529,14 +2529,14 @@ function _r() {
2529
2529
  title: "Cron",
2530
2530
  dataIndex: "cronExpr",
2531
2531
  width: 150,
2532
- render: (h) => /* @__PURE__ */ e("code", { style: { fontSize: 12 }, children: h })
2532
+ render: (p) => /* @__PURE__ */ e("code", { style: { fontSize: 12 }, children: p })
2533
2533
  },
2534
2534
  {
2535
2535
  title: "状态",
2536
2536
  dataIndex: "status",
2537
2537
  width: 110,
2538
- render: (h) => {
2539
- const o = vr[h] || { color: "default", text: h };
2538
+ render: (p) => {
2539
+ const o = _n[p] || { color: "default", text: p };
2540
2540
  return /* @__PURE__ */ e(w, { color: o.color, children: o.text });
2541
2541
  }
2542
2542
  },
@@ -2544,26 +2544,26 @@ function _r() {
2544
2544
  title: "启用",
2545
2545
  dataIndex: "enabled",
2546
2546
  width: 80,
2547
- render: (h, o) => h ? /* @__PURE__ */ e(w, { color: "green", children: "是" }) : /* @__PURE__ */ e(w, { children: "否" })
2547
+ render: (p, o) => p ? /* @__PURE__ */ e(w, { color: "green", children: "是" }) : /* @__PURE__ */ e(w, { children: "否" })
2548
2548
  },
2549
2549
  {
2550
2550
  title: "最近 run",
2551
2551
  dataIndex: "lastStatus",
2552
2552
  width: 110,
2553
- render: (h, o) => {
2554
- var O;
2555
- return h ? /* @__PURE__ */ e(pe, { title: o.lastError || "", children: /* @__PURE__ */ e(w, { color: ((O = lt[h]) == null ? void 0 : O.color) || "default", children: h }) }) : /* @__PURE__ */ e("span", { style: { color: "#ccc" }, children: "-" });
2553
+ render: (p, o) => {
2554
+ var R;
2555
+ return p ? /* @__PURE__ */ e(he, { title: o.lastError || "", children: /* @__PURE__ */ e(w, { color: ((R = at[p]) == null ? void 0 : R.color) || "default", children: p }) }) : /* @__PURE__ */ e("span", { style: { color: "#ccc" }, children: "-" });
2556
2556
  }
2557
2557
  },
2558
2558
  {
2559
2559
  title: "累计",
2560
2560
  width: 130,
2561
- render: (h, o) => /* @__PURE__ */ r(P, { size: 4, children: [
2562
- /* @__PURE__ */ r(w, { color: "green", children: [
2561
+ render: (p, o) => /* @__PURE__ */ n(E, { size: 4, children: [
2562
+ /* @__PURE__ */ n(w, { color: "green", children: [
2563
2563
  "✓ ",
2564
2564
  o.successCountTotal || 0
2565
2565
  ] }),
2566
- /* @__PURE__ */ r(w, { color: "red", children: [
2566
+ /* @__PURE__ */ n(w, { color: "red", children: [
2567
2567
  "✗ ",
2568
2568
  o.failCountTotal || 0
2569
2569
  ] })
@@ -2573,81 +2573,81 @@ function _r() {
2573
2573
  title: "操作",
2574
2574
  width: 280,
2575
2575
  fixed: "right",
2576
- render: (h, o) => /* @__PURE__ */ r(P, { size: 4, wrap: !0, children: [
2576
+ render: (p, o) => /* @__PURE__ */ n(E, { size: 4, wrap: !0, children: [
2577
2577
  /* @__PURE__ */ e(
2578
- _,
2578
+ A,
2579
2579
  {
2580
2580
  type: "link",
2581
2581
  size: "small",
2582
- icon: /* @__PURE__ */ e($t, {}),
2582
+ icon: /* @__PURE__ */ e(Dt, {}),
2583
2583
  onClick: () => t(`/subscribe/edit/${o.id}`),
2584
2584
  children: "编辑"
2585
2585
  }
2586
2586
  ),
2587
2587
  /* @__PURE__ */ e(
2588
- _,
2588
+ A,
2589
2589
  {
2590
2590
  type: "link",
2591
2591
  size: "small",
2592
2592
  icon: /* @__PURE__ */ e(be, {}),
2593
- onClick: () => S(o),
2593
+ onClick: () => I(o),
2594
2594
  children: "试运行"
2595
2595
  }
2596
2596
  ),
2597
2597
  /* @__PURE__ */ e(
2598
- _,
2598
+ A,
2599
2599
  {
2600
2600
  type: "link",
2601
2601
  size: "small",
2602
- icon: /* @__PURE__ */ e(Pe, {}),
2603
- onClick: () => i(o),
2602
+ icon: /* @__PURE__ */ e(Ee, {}),
2603
+ onClick: () => s(o),
2604
2604
  children: "触发"
2605
2605
  }
2606
2606
  ),
2607
2607
  /* @__PURE__ */ e(
2608
- _,
2608
+ A,
2609
2609
  {
2610
2610
  type: "link",
2611
2611
  size: "small",
2612
- onClick: () => L(o),
2612
+ onClick: () => M(o),
2613
2613
  children: "历史"
2614
2614
  }
2615
2615
  ),
2616
2616
  o.enabled ? /* @__PURE__ */ e(
2617
- _,
2617
+ A,
2618
2618
  {
2619
2619
  type: "link",
2620
2620
  size: "small",
2621
- icon: /* @__PURE__ */ e(Nt, {}),
2621
+ icon: /* @__PURE__ */ e($t, {}),
2622
2622
  onClick: () => u(o.id),
2623
2623
  children: "停用"
2624
2624
  }
2625
2625
  ) : /* @__PURE__ */ e(
2626
- _,
2626
+ A,
2627
2627
  {
2628
2628
  type: "link",
2629
2629
  size: "small",
2630
- icon: /* @__PURE__ */ e(Ue, {}),
2631
- onClick: () => C(o.id),
2630
+ icon: /* @__PURE__ */ e(Fe, {}),
2631
+ onClick: () => T(o.id),
2632
2632
  children: "启用"
2633
2633
  }
2634
2634
  ),
2635
- /* @__PURE__ */ e(je, { title: "确认删除?", onConfirm: () => $(o), okText: "删除", cancelText: "取消", children: /* @__PURE__ */ e(_, { type: "link", size: "small", danger: !0, icon: /* @__PURE__ */ e(Dt, {}), children: "删除" }) })
2635
+ /* @__PURE__ */ e(Ue, { title: "确认删除?", onConfirm: () => D(o), okText: "删除", cancelText: "取消", children: /* @__PURE__ */ e(A, { type: "link", size: "small", danger: !0, icon: /* @__PURE__ */ e(Nt, {}), children: "删除" }) })
2636
2636
  ] })
2637
2637
  }
2638
2638
  ],
2639
2639
  rowKey: "id",
2640
- loading: k,
2640
+ loading: S,
2641
2641
  scroll: { x: 1400 },
2642
2642
  tableProps: { size: "middle" },
2643
2643
  searchKeys: ["name", "id", "sourceType"],
2644
2644
  searchPlaceholder: "按订阅名称 / ID / 数据源类型过滤",
2645
2645
  emptyTitle: "暂无订阅",
2646
2646
  emptyDescription: "订阅负责把三方数据源按 Cron 定时抽取归一化,先建一个订阅试试。",
2647
- cardExtra: /* @__PURE__ */ r(P, { children: [
2648
- /* @__PURE__ */ e(_, { icon: /* @__PURE__ */ e(ee, {}), onClick: v, children: "刷新" }),
2647
+ cardExtra: /* @__PURE__ */ n(E, { children: [
2648
+ /* @__PURE__ */ e(A, { icon: /* @__PURE__ */ e(ee, {}), onClick: v, children: "刷新" }),
2649
2649
  /* @__PURE__ */ e(
2650
- _,
2650
+ A,
2651
2651
  {
2652
2652
  type: "primary",
2653
2653
  icon: /* @__PURE__ */ e(yt, {}),
@@ -2666,10 +2666,10 @@ function _r() {
2666
2666
  onClose: () => c(null),
2667
2667
  size: "large",
2668
2668
  children: (y == null ? void 0 : y.tab) === "runs" ? /* @__PURE__ */ e(
2669
- Ie,
2669
+ ke,
2670
2670
  {
2671
- activeKey: p ? "items" : "list",
2672
- onChange: (h) => h === "list" && l(null),
2671
+ activeKey: h ? "items" : "list",
2672
+ onChange: (p) => p === "list" && a(null),
2673
2673
  items: [
2674
2674
  {
2675
2675
  key: "list",
@@ -2680,7 +2680,7 @@ function _r() {
2680
2680
  行数由订阅的运行次数决定,会增长,不适合按「≤10 且不变」豁免。
2681
2681
  Drawer 里没有外层卡片,故用 borderless 让它与抽屉融成一块。 */
2682
2682
  /* @__PURE__ */ e(
2683
- ie,
2683
+ se,
2684
2684
  {
2685
2685
  rows: f,
2686
2686
  rowKey: "id",
@@ -2689,34 +2689,34 @@ function _r() {
2689
2689
  emptyTitle: "暂无运行记录",
2690
2690
  emptyDescription: "该订阅还没有运行过。",
2691
2691
  cardProps: { variant: "borderless", styles: { body: { padding: 0 } } },
2692
- onRow: (h) => ({ onClick: () => J(h.id) }),
2692
+ onRow: (p) => ({ onClick: () => J(p.id) }),
2693
2693
  columns: [
2694
2694
  { title: "runId", dataIndex: "id", width: 70 },
2695
2695
  {
2696
2696
  title: "计划",
2697
2697
  dataIndex: "scheduledAt",
2698
2698
  width: 160,
2699
- render: (h) => h ? new Date(h).toLocaleString() : "-"
2699
+ render: (p) => p ? new Date(p).toLocaleString() : "-"
2700
2700
  },
2701
2701
  { title: "耗时(ms)", dataIndex: "durationMs", width: 90 },
2702
2702
  {
2703
2703
  title: "状态",
2704
2704
  dataIndex: "status",
2705
2705
  width: 90,
2706
- render: (h) => {
2706
+ render: (p) => {
2707
2707
  var o;
2708
- return /* @__PURE__ */ e(w, { color: (o = lt[h]) == null ? void 0 : o.color, children: h });
2708
+ return /* @__PURE__ */ e(w, { color: (o = at[p]) == null ? void 0 : o.color, children: p });
2709
2709
  }
2710
2710
  },
2711
2711
  {
2712
2712
  title: "拉取/成功/重复/死信",
2713
2713
  width: 200,
2714
- render: (h, o) => `${o.fetchedCount} / ${o.successCount} / ${o.duplicateCount || 0} / ${o.deadLetterCount}`
2714
+ render: (p, o) => `${o.fetchedCount} / ${o.successCount} / ${o.duplicateCount || 0} / ${o.deadLetterCount}`
2715
2715
  },
2716
2716
  {
2717
2717
  title: "错误",
2718
2718
  dataIndex: "errorMessage",
2719
- render: (h) => h ? /* @__PURE__ */ e("span", { style: { color: "#cf1322", fontSize: 12 }, children: h }) : "-"
2719
+ render: (p) => p ? /* @__PURE__ */ e("span", { style: { color: "#cf1322", fontSize: 12 }, children: p }) : "-"
2720
2720
  }
2721
2721
  ]
2722
2722
  }
@@ -2725,25 +2725,25 @@ function _r() {
2725
2725
  },
2726
2726
  {
2727
2727
  key: "items",
2728
- label: p ? `run#${p} 抽取项` : "抽取项",
2729
- disabled: !p,
2730
- children: /* @__PURE__ */ r(P, { orientation: "vertical", style: { width: "100%" }, children: [
2731
- /* @__PURE__ */ r(P, { children: [
2732
- /* @__PURE__ */ r(w, { color: "blue", children: [
2728
+ label: h ? `run#${h} 抽取项` : "抽取项",
2729
+ disabled: !h,
2730
+ children: /* @__PURE__ */ n(E, { orientation: "vertical", style: { width: "100%" }, children: [
2731
+ /* @__PURE__ */ n(E, { children: [
2732
+ /* @__PURE__ */ n(w, { color: "blue", children: [
2733
2733
  "已选 ",
2734
2734
  d.length,
2735
2735
  " 条"
2736
2736
  ] }),
2737
- /* @__PURE__ */ r(
2738
- _,
2737
+ /* @__PURE__ */ n(
2738
+ A,
2739
2739
  {
2740
2740
  size: "small",
2741
2741
  type: "primary",
2742
- icon: /* @__PURE__ */ e(Ee, {}),
2742
+ icon: /* @__PURE__ */ e(Pe, {}),
2743
2743
  disabled: d.length === 0,
2744
2744
  onClick: () => {
2745
- const h = d.join(",");
2746
- t(`/project/new?subscriptionId=${y.sub.id}&itemIds=${h}`);
2745
+ const p = d.join(",");
2746
+ t(`/project/new?subscriptionId=${y.sub.id}&itemIds=${p}`);
2747
2747
  },
2748
2748
  children: [
2749
2749
  "用所选 ",
@@ -2754,9 +2754,9 @@ function _r() {
2754
2754
  )
2755
2755
  ] }),
2756
2756
  /* @__PURE__ */ e(
2757
- ie,
2757
+ se,
2758
2758
  {
2759
- rows: T[p] || [],
2759
+ rows: C[h] || [],
2760
2760
  rowKey: "id",
2761
2761
  rowSelection: {
2762
2762
  selectedRowKeys: d,
@@ -2772,20 +2772,20 @@ function _r() {
2772
2772
  {
2773
2773
  title: "title",
2774
2774
  dataIndex: "normalized",
2775
- render: (h) => {
2775
+ render: (p) => {
2776
2776
  try {
2777
- return JSON.parse(h).title || "(无标题)";
2777
+ return JSON.parse(p).title || "(无标题)";
2778
2778
  } catch {
2779
- return h;
2779
+ return p;
2780
2780
  }
2781
2781
  }
2782
2782
  },
2783
2783
  {
2784
2784
  title: "link",
2785
2785
  dataIndex: "normalized",
2786
- render: (h) => {
2786
+ render: (p) => {
2787
2787
  try {
2788
- const o = JSON.parse(h);
2788
+ const o = JSON.parse(p);
2789
2789
  return o.link ? /* @__PURE__ */ e("a", { href: o.link, target: "_blank", children: "↗" }) : "-";
2790
2790
  } catch {
2791
2791
  return "-";
@@ -2796,7 +2796,7 @@ function _r() {
2796
2796
  title: "状态",
2797
2797
  dataIndex: "status",
2798
2798
  width: 110,
2799
- render: (h) => /* @__PURE__ */ e(w, { children: h })
2799
+ render: (p) => /* @__PURE__ */ e(w, { children: p })
2800
2800
  }
2801
2801
  ]
2802
2802
  }
@@ -2805,46 +2805,46 @@ function _r() {
2805
2805
  }
2806
2806
  ]
2807
2807
  }
2808
- ) : /* @__PURE__ */ e(Ar, { result: y == null ? void 0 : y.result })
2808
+ ) : /* @__PURE__ */ e(En, { result: y == null ? void 0 : y.result })
2809
2809
  }
2810
2810
  )
2811
2811
  ] });
2812
2812
  }
2813
- function Ar({ result: t }) {
2814
- return t ? t.success ? /* @__PURE__ */ r(P, { orientation: "vertical", style: { width: "100%" }, size: "middle", children: [
2815
- /* @__PURE__ */ e(M, { size: "small", title: "调用结果", children: /* @__PURE__ */ r(P, { size: "large", wrap: !0, children: [
2816
- /* @__PURE__ */ r("span", { children: [
2813
+ function En({ result: t }) {
2814
+ return t ? t.success ? /* @__PURE__ */ n(E, { orientation: "vertical", style: { width: "100%" }, size: "middle", children: [
2815
+ /* @__PURE__ */ e(L, { size: "small", title: "调用结果", children: /* @__PURE__ */ n(E, { size: "large", wrap: !0, children: [
2816
+ /* @__PURE__ */ n("span", { children: [
2817
2817
  /* @__PURE__ */ e("b", { children: "HTTP:" }),
2818
2818
  " ",
2819
2819
  t.httpStatus || "-"
2820
2820
  ] }),
2821
- /* @__PURE__ */ r("span", { children: [
2821
+ /* @__PURE__ */ n("span", { children: [
2822
2822
  /* @__PURE__ */ e("b", { children: "耗时:" }),
2823
2823
  " ",
2824
2824
  t.latencyMs,
2825
2825
  "ms"
2826
2826
  ] }),
2827
- /* @__PURE__ */ r("span", { children: [
2827
+ /* @__PURE__ */ n("span", { children: [
2828
2828
  /* @__PURE__ */ e("b", { children: "大小:" }),
2829
2829
  " ",
2830
2830
  t.responseSize,
2831
2831
  "B"
2832
2832
  ] }),
2833
- /* @__PURE__ */ r("span", { children: [
2833
+ /* @__PURE__ */ n("span", { children: [
2834
2834
  /* @__PURE__ */ e("b", { children: "样本:" }),
2835
2835
  " ",
2836
2836
  t.sampleCount,
2837
2837
  " 条"
2838
2838
  ] })
2839
2839
  ] }) }),
2840
- t.firstItem && /* @__PURE__ */ e(M, { size: "small", title: "第一条样本 (归一化后)", children: /* @__PURE__ */ e(
2840
+ t.firstItem && /* @__PURE__ */ e(L, { size: "small", title: "第一条样本 (归一化后)", children: /* @__PURE__ */ e(
2841
2841
  "pre",
2842
2842
  {
2843
2843
  style: { background: "#f5f5f5", padding: 12, borderRadius: 4, maxHeight: 300, overflow: "auto" },
2844
2844
  children: JSON.stringify(t.firstItem, null, 2)
2845
2845
  }
2846
2846
  ) }),
2847
- t.responsePreview && /* @__PURE__ */ e(M, { size: "small", title: "响应预览 (前 4KB)", children: /* @__PURE__ */ e("pre", { style: {
2847
+ t.responsePreview && /* @__PURE__ */ e(L, { size: "small", title: "响应预览 (前 4KB)", children: /* @__PURE__ */ e("pre", { style: {
2848
2848
  background: "#f5f5f5",
2849
2849
  padding: 12,
2850
2850
  borderRadius: 4,
@@ -2852,94 +2852,94 @@ function Ar({ result: t }) {
2852
2852
  overflow: "auto",
2853
2853
  fontSize: 12
2854
2854
  }, children: t.responsePreview }) }),
2855
- t.fieldErrors && t.fieldErrors.length > 0 && /* @__PURE__ */ e(V, { type: "warning", showIcon: !0, message: "字段问题", description: /* @__PURE__ */ e("ul", { children: t.fieldErrors.map((s, n) => /* @__PURE__ */ e("li", { children: s }, n)) }) })
2856
- ] }) : /* @__PURE__ */ e(V, { type: "error", showIcon: !0, title: "试运行失败", description: t.errorMessage || "未知错误" }) : null;
2855
+ t.fieldErrors && t.fieldErrors.length > 0 && /* @__PURE__ */ e(Z, { type: "warning", showIcon: !0, message: "字段问题", description: /* @__PURE__ */ e("ul", { children: t.fieldErrors.map((i, r) => /* @__PURE__ */ e("li", { children: i }, r)) }) })
2856
+ ] }) : /* @__PURE__ */ e(Z, { type: "error", showIcon: !0, title: "试运行失败", description: t.errorMessage || "未知错误" }) : null;
2857
2857
  }
2858
- const Er = [
2858
+ const zn = [
2859
2859
  { value: "STANDARD_JSON", label: "标准 JSON (按统一契约返回的 JSON)" },
2860
2860
  { value: "RSS_XML", label: "RSS 2.0 (XML feed)" },
2861
2861
  { value: "ATOM_XML", label: "Atom 1.0 (XML feed)" },
2862
2862
  { value: "CUSTOM_SCRIPT", label: "自定义脚本 (z-script 平台)" },
2863
2863
  { value: "INTERNAL_BEAN", label: "内部 Bean (我们自己的模块, 暂未启用)" }
2864
- ], Pr = [
2864
+ ], Rn = [
2865
2865
  { value: "NONE", label: "无鉴权" },
2866
2866
  { value: "BEARER", label: "Bearer (Authorization: Bearer xxx)" },
2867
2867
  { value: "API_KEY", label: "API Key (Authorization: xxx)" },
2868
2868
  { value: "BASIC", label: "Basic (user:password base64)" }
2869
- ], Rr = [
2869
+ ], On = [
2870
2870
  { label: "每 5 分钟", value: "0 */5 * * * ?" },
2871
2871
  { label: "每 15 分钟", value: "0 */15 * * * ?" },
2872
2872
  { label: "每小时", value: "0 0 * * * ?" },
2873
2873
  { label: "每 6 小时", value: "0 0 */6 * * ?" },
2874
2874
  { label: "每天 8 点", value: "0 0 8 * * ?" }
2875
2875
  ];
2876
- function at() {
2877
- const { id: t } = ot(), s = xe(), n = !!t, [k] = E.useForm(), [a, y] = m(!1), [c, f] = m(!1), [x, T] = m([]), [A, p] = m([]), l = E.useWatch("sourceType", k), d = E.useWatch("extractorType", k), g = E.useWatch("authType", k);
2878
- U(() => {
2879
- v(), $(), n && C();
2876
+ function lt() {
2877
+ const { id: t } = ot(), i = xe(), r = !!t, [S] = P.useForm(), [l, y] = m(!1), [c, f] = m(!1), [x, C] = m([]), [_, h] = m([]), a = P.useWatch("sourceType", S), d = P.useWatch("extractorType", S), g = P.useWatch("authType", S);
2878
+ F(() => {
2879
+ v(), D(), r && T();
2880
2880
  }, [t]);
2881
2881
  const v = async () => {
2882
2882
  try {
2883
- const i = await N.get("/secret/list"), S = (i == null ? void 0 : i.data) ?? i ?? [];
2884
- T(Array.isArray(S) ? S : []);
2883
+ const s = await $.get("/secret/list"), I = (s == null ? void 0 : s.data) ?? s ?? [];
2884
+ C(Array.isArray(I) ? I : []);
2885
2885
  } catch {
2886
2886
  }
2887
- }, $ = async () => {
2887
+ }, D = async () => {
2888
2888
  try {
2889
- const i = await N.get("/script/list"), S = (i == null ? void 0 : i.data) ?? i ?? [];
2890
- p(Array.isArray(S) ? S.filter((L) => L.status === 1) : []);
2889
+ const s = await $.get("/script/list"), I = (s == null ? void 0 : s.data) ?? s ?? [];
2890
+ h(Array.isArray(I) ? I.filter((M) => M.status === 1) : []);
2891
2891
  } catch {
2892
2892
  }
2893
- }, C = async () => {
2893
+ }, T = async () => {
2894
2894
  y(!0);
2895
2895
  try {
2896
- const i = await N.get(`/subscribe/subscription/${t}`), S = (i == null ? void 0 : i.data) ?? i;
2897
- S && k.setFieldsValue({
2898
- ...S,
2899
- enabled: S.enabled === 1 || S.enabled === !0
2896
+ const s = await $.get(`/subscribe/subscription/${t}`), I = (s == null ? void 0 : s.data) ?? s;
2897
+ I && S.setFieldsValue({
2898
+ ...I,
2899
+ enabled: I.enabled === 1 || I.enabled === !0
2900
2900
  });
2901
- } catch (i) {
2902
- b.error("加载订阅失败: " + ((i == null ? void 0 : i.message) || ""));
2901
+ } catch (s) {
2902
+ b.error("加载订阅失败: " + ((s == null ? void 0 : s.message) || ""));
2903
2903
  } finally {
2904
2904
  y(!1);
2905
2905
  }
2906
2906
  }, u = async () => {
2907
2907
  try {
2908
- const i = await k.validateFields();
2908
+ const s = await S.validateFields();
2909
2909
  f(!0);
2910
- const S = {
2911
- ...i,
2912
- enabled: i.enabled ? 1 : 0
2910
+ const I = {
2911
+ ...s,
2912
+ enabled: s.enabled ? 1 : 0
2913
2913
  };
2914
- let L;
2915
- if (n ? L = await N.put("/subscribe/subscription", S) : L = await N.post("/subscribe/subscription", S), L && L.success === !1) {
2916
- b.error(L.message || "保存失败");
2914
+ let M;
2915
+ if (r ? M = await $.put("/subscribe/subscription", I) : M = await $.post("/subscribe/subscription", I), M && M.success === !1) {
2916
+ b.error(M.message || "保存失败");
2917
2917
  return;
2918
2918
  }
2919
- b.success(n ? "已更新 (注意: 修改 cron / url / 抽取器后会自动重置为 PENDING_VERIFY)" : "已创建, 已自动验证"), s("/subscribe/list");
2920
- } catch (i) {
2921
- i != null && i.errorFields ? b.warning("请检查表单") : b.error("保存失败: " + ((i == null ? void 0 : i.message) || ""));
2919
+ b.success(r ? "已更新 (注意: 修改 cron / url / 抽取器后会自动重置为 PENDING_VERIFY)" : "已创建, 已自动验证"), i("/subscribe/list");
2920
+ } catch (s) {
2921
+ s != null && s.errorFields ? b.warning("请检查表单") : b.error("保存失败: " + ((s == null ? void 0 : s.message) || ""));
2922
2922
  } finally {
2923
2923
  f(!1);
2924
2924
  }
2925
2925
  };
2926
- return /* @__PURE__ */ r("div", { style: { padding: 24 }, children: [
2926
+ return /* @__PURE__ */ n("div", { style: { padding: 24 }, children: [
2927
2927
  /* @__PURE__ */ e(
2928
2928
  ye,
2929
2929
  {
2930
- title: n ? `编辑订阅 #${t}` : "新建订阅",
2930
+ title: r ? `编辑订阅 #${t}` : "新建订阅",
2931
2931
  subtitle: "配置数据源、抽取器、鉴权与调度策略",
2932
2932
  back: !0,
2933
- extra: /* @__PURE__ */ r(P, { children: [
2934
- /* @__PURE__ */ e(_, { onClick: () => s("/subscribe/list"), children: "取消" }),
2935
- /* @__PURE__ */ e(_, { type: "primary", icon: /* @__PURE__ */ e(gt, {}), loading: c, onClick: u, children: "保存 (自动验证)" })
2933
+ extra: /* @__PURE__ */ n(E, { children: [
2934
+ /* @__PURE__ */ e(A, { onClick: () => i("/subscribe/list"), children: "取消" }),
2935
+ /* @__PURE__ */ e(A, { type: "primary", icon: /* @__PURE__ */ e(gt, {}), loading: c, onClick: u, children: "保存 (自动验证)" })
2936
2936
  ] })
2937
2937
  }
2938
2938
  ),
2939
- /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(Ae, { spinning: a, children: /* @__PURE__ */ r(
2940
- E,
2939
+ /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(_e, { spinning: l, children: /* @__PURE__ */ n(
2940
+ P,
2941
2941
  {
2942
- form: k,
2942
+ form: S,
2943
2943
  layout: "vertical",
2944
2944
  initialValues: {
2945
2945
  sourceType: "HTTP",
@@ -2952,18 +2952,18 @@ function at() {
2952
2952
  timeoutMs: 15e3
2953
2953
  },
2954
2954
  children: [
2955
- /* @__PURE__ */ r(M, { type: "inner", title: "基本信息", style: { marginBottom: 16 }, children: [
2956
- /* @__PURE__ */ e(E.Item, { label: "名称", name: "name", rules: [{ required: !0, message: "请输入名称" }], children: /* @__PURE__ */ e(B, { placeholder: "例如: GitHub PR 通知" }) }),
2957
- /* @__PURE__ */ e(E.Item, { label: "说明", name: "description", children: /* @__PURE__ */ e(B.TextArea, { rows: 2, placeholder: "(可选)" }) })
2955
+ /* @__PURE__ */ n(L, { type: "inner", title: "基本信息", style: { marginBottom: 16 }, children: [
2956
+ /* @__PURE__ */ e(P.Item, { label: "名称", name: "name", rules: [{ required: !0, message: "请输入名称" }], children: /* @__PURE__ */ e(B, { placeholder: "例如: GitHub PR 通知" }) }),
2957
+ /* @__PURE__ */ e(P.Item, { label: "说明", name: "description", children: /* @__PURE__ */ e(B.TextArea, { rows: 2, placeholder: "(可选)" }) })
2958
2958
  ] }),
2959
- /* @__PURE__ */ r(M, { type: "inner", title: "数据源", style: { marginBottom: 16 }, children: [
2960
- /* @__PURE__ */ e(E.Item, { label: "数据源形态", name: "sourceType", rules: [{ required: !0 }], children: /* @__PURE__ */ r(re.Group, { children: [
2961
- /* @__PURE__ */ e(re.Button, { value: "HTTP", children: "HTTP / HTTPS" }),
2962
- /* @__PURE__ */ e(re.Button, { value: "INTERNAL", disabled: !0, children: "内部 Bean" })
2959
+ /* @__PURE__ */ n(L, { type: "inner", title: "数据源", style: { marginBottom: 16 }, children: [
2960
+ /* @__PURE__ */ e(P.Item, { label: "数据源形态", name: "sourceType", rules: [{ required: !0 }], children: /* @__PURE__ */ n(ne.Group, { children: [
2961
+ /* @__PURE__ */ e(ne.Button, { value: "HTTP", children: "HTTP / HTTPS" }),
2962
+ /* @__PURE__ */ e(ne.Button, { value: "INTERNAL", disabled: !0, children: "内部 Bean" })
2963
2963
  ] }) }),
2964
- l === "HTTP" && /* @__PURE__ */ r(Le, { children: [
2964
+ a === "HTTP" && /* @__PURE__ */ n(Me, { children: [
2965
2965
  /* @__PURE__ */ e(
2966
- E.Item,
2966
+ P.Item,
2967
2967
  {
2968
2968
  label: "目标 URL",
2969
2969
  name: "targetUrl",
@@ -2971,112 +2971,112 @@ function at() {
2971
2971
  children: /* @__PURE__ */ e(B, { placeholder: "https://api.github.com/repos/.../pulls?state=open" })
2972
2972
  }
2973
2973
  ),
2974
- /* @__PURE__ */ r(P, { size: "large", style: { width: "100%" }, children: [
2975
- /* @__PURE__ */ e(E.Item, { label: "HTTP 方法", name: "httpMethod", children: /* @__PURE__ */ e(X, { style: { width: 120 }, options: [
2974
+ /* @__PURE__ */ n(E, { size: "large", style: { width: "100%" }, children: [
2975
+ /* @__PURE__ */ e(P.Item, { label: "HTTP 方法", name: "httpMethod", children: /* @__PURE__ */ e(V, { style: { width: 120 }, options: [
2976
2976
  { value: "GET", label: "GET" },
2977
2977
  { value: "POST", label: "POST" },
2978
2978
  { value: "PUT", label: "PUT" }
2979
2979
  ] }) }),
2980
- /* @__PURE__ */ e(E.Item, { label: "超时 (ms)", name: "timeoutMs", children: /* @__PURE__ */ e(Oe, { min: 1e3, max: 12e4, step: 1e3 }) })
2980
+ /* @__PURE__ */ e(P.Item, { label: "超时 (ms)", name: "timeoutMs", children: /* @__PURE__ */ e(Re, { min: 1e3, max: 12e4, step: 1e3 }) })
2981
2981
  ] }),
2982
- /* @__PURE__ */ e(E.Item, { label: "自定义 HTTP 头 (JSON)", name: "httpHeaders", children: /* @__PURE__ */ e(B.TextArea, { rows: 2, placeholder: '{"X-Trace-Id":"abc"}' }) }),
2983
- /* @__PURE__ */ e(E.Item, { label: "请求体 (POST/PUT)", name: "requestBody", children: /* @__PURE__ */ e(B.TextArea, { rows: 3, placeholder: "(可选)" }) })
2982
+ /* @__PURE__ */ e(P.Item, { label: "自定义 HTTP 头 (JSON)", name: "httpHeaders", children: /* @__PURE__ */ e(B.TextArea, { rows: 2, placeholder: '{"X-Trace-Id":"abc"}' }) }),
2983
+ /* @__PURE__ */ e(P.Item, { label: "请求体 (POST/PUT)", name: "requestBody", children: /* @__PURE__ */ e(B.TextArea, { rows: 3, placeholder: "(可选)" }) })
2984
2984
  ] })
2985
2985
  ] }),
2986
- /* @__PURE__ */ r(M, { type: "inner", title: "鉴权 (从 z-mist 拉取 secret)", style: { marginBottom: 16 }, children: [
2987
- /* @__PURE__ */ e(E.Item, { label: "鉴权方式", name: "authType", children: /* @__PURE__ */ e(X, { options: Pr }) }),
2986
+ /* @__PURE__ */ n(L, { type: "inner", title: "鉴权 (从 z-mist 拉取 secret)", style: { marginBottom: 16 }, children: [
2987
+ /* @__PURE__ */ e(P.Item, { label: "鉴权方式", name: "authType", children: /* @__PURE__ */ e(V, { options: Rn }) }),
2988
2988
  g && g !== "NONE" && /* @__PURE__ */ e(
2989
- E.Item,
2989
+ P.Item,
2990
2990
  {
2991
2991
  label: "z-mist 凭据引用",
2992
2992
  name: "authSecretKey",
2993
2993
  extra: "从密钥中心 (z-mist) 选一个 secret; secret 的解密值会作为 secret 注入",
2994
2994
  children: /* @__PURE__ */ e(
2995
- X,
2995
+ V,
2996
2996
  {
2997
2997
  showSearch: !0,
2998
2998
  allowClear: !0,
2999
2999
  placeholder: "选择 secret (key)",
3000
- options: x.map((i) => ({
3001
- value: i.secretKey,
3002
- label: `${i.secretKey}${i.secretName ? " (" + i.secretName + ")" : ""}`
3000
+ options: x.map((s) => ({
3001
+ value: s.secretKey,
3002
+ label: `${s.secretKey}${s.secretName ? " (" + s.secretName + ")" : ""}`
3003
3003
  }))
3004
3004
  }
3005
3005
  )
3006
3006
  }
3007
3007
  )
3008
3008
  ] }),
3009
- /* @__PURE__ */ r(M, { type: "inner", title: "抽取器", style: { marginBottom: 16 }, children: [
3009
+ /* @__PURE__ */ n(L, { type: "inner", title: "抽取器", style: { marginBottom: 16 }, children: [
3010
3010
  /* @__PURE__ */ e(
3011
- E.Item,
3011
+ P.Item,
3012
3012
  {
3013
3013
  label: "抽取器类型",
3014
3014
  name: "extractorType",
3015
3015
  rules: [{ required: !0 }],
3016
3016
  extra: "STANDARD_JSON/RSS_XML/ATOM_XML 直接解析; CUSTOM_SCRIPT 调 z-script 平台",
3017
- children: /* @__PURE__ */ e(X, { options: Er })
3017
+ children: /* @__PURE__ */ e(V, { options: zn })
3018
3018
  }
3019
3019
  ),
3020
3020
  d === "CUSTOM_SCRIPT" && /* @__PURE__ */ e(
3021
- E.Item,
3021
+ P.Item,
3022
3022
  {
3023
3023
  label: "z-script 脚本",
3024
3024
  name: "extractorScriptCode",
3025
3025
  rules: [{ required: !0, message: "请选择脚本" }],
3026
3026
  extra: "在 智能中心 > 脚本中心 维护脚本. 脚本返回 { items: [...], nextCursor: '...' }",
3027
3027
  children: /* @__PURE__ */ e(
3028
- X,
3028
+ V,
3029
3029
  {
3030
3030
  showSearch: !0,
3031
3031
  placeholder: "选择已启用的脚本",
3032
- options: A.map((i) => ({
3033
- value: i.scriptCode,
3034
- label: `${i.scriptCode} (${i.dslType})${i.scriptName ? " - " + i.scriptName : ""}`
3032
+ options: _.map((s) => ({
3033
+ value: s.scriptCode,
3034
+ label: `${s.scriptCode} (${s.dslType})${s.scriptName ? " - " + s.scriptName : ""}`
3035
3035
  }))
3036
3036
  }
3037
3037
  )
3038
3038
  }
3039
3039
  )
3040
3040
  ] }),
3041
- /* @__PURE__ */ r(M, { type: "inner", title: "调度", style: { marginBottom: 16 }, children: [
3041
+ /* @__PURE__ */ n(L, { type: "inner", title: "调度", style: { marginBottom: 16 }, children: [
3042
3042
  /* @__PURE__ */ e(
3043
- E.Item,
3043
+ P.Item,
3044
3044
  {
3045
3045
  label: "Cron 表达式",
3046
3046
  name: "cronExpr",
3047
3047
  rules: [{ required: !0, message: "请输入 Cron" }],
3048
3048
  extra: "Quartz 兼容, 例如 0 */5 * * * ? = 每 5 分钟",
3049
3049
  children: /* @__PURE__ */ e(B, { addonAfter: /* @__PURE__ */ e(
3050
- X,
3050
+ V,
3051
3051
  {
3052
3052
  style: { width: 140 },
3053
3053
  placeholder: "常用",
3054
- options: Rr,
3055
- onChange: (i) => k.setFieldValue("cronExpr", i),
3054
+ options: On,
3055
+ onChange: (s) => S.setFieldValue("cronExpr", s),
3056
3056
  value: null
3057
3057
  }
3058
3058
  ) })
3059
3059
  }
3060
3060
  ),
3061
- /* @__PURE__ */ r(P, { size: "large", children: [
3062
- /* @__PURE__ */ e(E.Item, { label: "启用", name: "enabled", valuePropName: "checked", children: /* @__PURE__ */ r(re.Group, { children: [
3063
- /* @__PURE__ */ e(re.Button, { value: !0, children: "启用" }),
3064
- /* @__PURE__ */ e(re.Button, { value: !1, children: "停用" })
3061
+ /* @__PURE__ */ n(E, { size: "large", children: [
3062
+ /* @__PURE__ */ e(P.Item, { label: "启用", name: "enabled", valuePropName: "checked", children: /* @__PURE__ */ n(ne.Group, { children: [
3063
+ /* @__PURE__ */ e(ne.Button, { value: !0, children: "启用" }),
3064
+ /* @__PURE__ */ e(ne.Button, { value: !1, children: "停用" })
3065
3065
  ] }) }),
3066
3066
  /* @__PURE__ */ e(
3067
- E.Item,
3067
+ P.Item,
3068
3068
  {
3069
3069
  label: "最小间隔 (秒)",
3070
3070
  name: "minIntervalSec",
3071
3071
  extra: "距上次 run 至少 N 秒",
3072
- children: /* @__PURE__ */ e(Oe, { min: 0, max: 3600 })
3072
+ children: /* @__PURE__ */ e(Re, { min: 0, max: 3600 })
3073
3073
  }
3074
3074
  ),
3075
- /* @__PURE__ */ e(E.Item, { label: "单次最多条数", name: "maxItemsPerRun", children: /* @__PURE__ */ e(Oe, { min: 1, max: 1e4 }) })
3075
+ /* @__PURE__ */ e(P.Item, { label: "单次最多条数", name: "maxItemsPerRun", children: /* @__PURE__ */ e(Re, { min: 1, max: 1e4 }) })
3076
3076
  ] })
3077
3077
  ] }),
3078
3078
  /* @__PURE__ */ e(
3079
- V,
3079
+ Z,
3080
3080
  {
3081
3081
  type: "success",
3082
3082
  showIcon: !0,
@@ -3088,7 +3088,7 @@ function at() {
3088
3088
  ) }) })
3089
3089
  ] });
3090
3090
  }
3091
- const Or = {
3091
+ const Ln = {
3092
3092
  PENDING: "default",
3093
3093
  RUNNING: "processing",
3094
3094
  SUCCESS: "green",
@@ -3096,40 +3096,40 @@ const Or = {
3096
3096
  FAILED: "red",
3097
3097
  FATAL: "red"
3098
3098
  };
3099
- function zr() {
3100
- const [t, s] = m([]), [n, k] = m(null), [a, y] = m([]), [c, f] = m([]), [x, T] = m(null), [A, p] = m(!1);
3101
- U(() => {
3102
- l();
3103
- }, []), U(() => {
3104
- n && d(n);
3105
- }, [n]);
3106
- const l = async () => {
3099
+ function Mn() {
3100
+ const [t, i] = m([]), [r, S] = m(null), [l, y] = m([]), [c, f] = m([]), [x, C] = m(null), [_, h] = m(!1);
3101
+ F(() => {
3102
+ a();
3103
+ }, []), F(() => {
3104
+ r && d(r);
3105
+ }, [r]);
3106
+ const a = async () => {
3107
3107
  try {
3108
- const u = await N.get("/subscribe/subscription/list"), i = (u == null ? void 0 : u.data) ?? u ?? [];
3109
- s(Array.isArray(i) ? i : []), Array.isArray(i) && i.length > 0 && k(i[0].id);
3108
+ const u = await $.get("/subscribe/subscription/list"), s = (u == null ? void 0 : u.data) ?? u ?? [];
3109
+ i(Array.isArray(s) ? s : []), Array.isArray(s) && s.length > 0 && S(s[0].id);
3110
3110
  } catch {
3111
3111
  b.error("加载订阅列表失败");
3112
3112
  }
3113
3113
  }, d = async (u) => {
3114
- p(!0);
3114
+ h(!0);
3115
3115
  try {
3116
- const i = await N.get(`/subscribe/run/list?subscriptionId=${u}&limit=50`), S = (i == null ? void 0 : i.data) ?? i ?? [];
3117
- y(Array.isArray(S) ? S : []);
3116
+ const s = await $.get(`/subscribe/run/list?subscriptionId=${u}&limit=50`), I = (s == null ? void 0 : s.data) ?? s ?? [];
3117
+ y(Array.isArray(I) ? I : []);
3118
3118
  } catch {
3119
3119
  b.error("加载运行历史失败");
3120
3120
  } finally {
3121
- p(!1);
3121
+ h(!1);
3122
3122
  }
3123
3123
  }, g = async (u) => {
3124
- T(u);
3124
+ C(u);
3125
3125
  try {
3126
- const i = await N.get(`/subscribe/run/${u}/items?limit=200`), S = (i == null ? void 0 : i.data) ?? i ?? [];
3127
- f(Array.isArray(S) ? S : []);
3126
+ const s = await $.get(`/subscribe/run/${u}/items?limit=200`), I = (s == null ? void 0 : s.data) ?? s ?? [];
3127
+ f(Array.isArray(I) ? I : []);
3128
3128
  } catch {
3129
3129
  b.error("加载抽取项失败");
3130
3130
  }
3131
- }, v = a.reduce((u, i) => u + (i.successCount || 0), 0), $ = a.reduce((u, i) => u + (i.deadLetterCount || 0), 0), C = a.reduce((u, i) => u + (i.duplicateCount || 0), 0);
3132
- return /* @__PURE__ */ r("div", { children: [
3131
+ }, v = l.reduce((u, s) => u + (s.successCount || 0), 0), D = l.reduce((u, s) => u + (s.deadLetterCount || 0), 0), T = l.reduce((u, s) => u + (s.duplicateCount || 0), 0);
3132
+ return /* @__PURE__ */ n("div", { children: [
3133
3133
  /* @__PURE__ */ e(
3134
3134
  ye,
3135
3135
  {
@@ -3138,29 +3138,29 @@ function zr() {
3138
3138
  }
3139
3139
  ),
3140
3140
  /* @__PURE__ */ e(
3141
- Ut,
3141
+ Ft,
3142
3142
  {
3143
3143
  left: /* @__PURE__ */ e(
3144
- X,
3144
+ V,
3145
3145
  {
3146
3146
  style: { width: 280 },
3147
3147
  placeholder: "选择订阅",
3148
- value: n,
3149
- onChange: k,
3148
+ value: r,
3149
+ onChange: S,
3150
3150
  options: t.map((u) => ({ value: u.id, label: u.name })),
3151
3151
  showSearch: !0,
3152
3152
  optionFilterProp: "label"
3153
3153
  }
3154
3154
  ),
3155
- right: /* @__PURE__ */ r("a", { onClick: () => n && d(n), children: [
3155
+ right: /* @__PURE__ */ n("a", { onClick: () => r && d(r), children: [
3156
3156
  /* @__PURE__ */ e(ee, {}),
3157
3157
  " 刷新"
3158
3158
  ] })
3159
3159
  }
3160
3160
  ),
3161
- /* @__PURE__ */ r(Y, { gutter: 16, style: { marginBottom: 16 }, children: [
3162
- /* @__PURE__ */ e(z, { span: 6, children: /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(K, { title: "run 总数", value: a.length }) }) }),
3163
- /* @__PURE__ */ e(z, { span: 6, children: /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(
3161
+ /* @__PURE__ */ n(Y, { gutter: 16, style: { marginBottom: 16 }, children: [
3162
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(K, { title: "run 总数", value: l.length }) }) }),
3163
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(
3164
3164
  K,
3165
3165
  {
3166
3166
  title: "成功条数",
@@ -3168,24 +3168,24 @@ function zr() {
3168
3168
  styles: { content: { color: "#3f8600" } }
3169
3169
  }
3170
3170
  ) }) }),
3171
- /* @__PURE__ */ e(z, { span: 6, children: /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(
3171
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(
3172
3172
  K,
3173
3173
  {
3174
3174
  title: "死信条数",
3175
- value: $,
3175
+ value: D,
3176
3176
  styles: { content: { color: "#cf1322" } }
3177
3177
  }
3178
3178
  ) }) }),
3179
- /* @__PURE__ */ e(z, { span: 6, children: /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(K, { title: "重复跳过", value: C }) }) })
3179
+ /* @__PURE__ */ e(O, { span: 6, children: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(K, { title: "重复跳过", value: T }) }) })
3180
3180
  ] }),
3181
- /* @__PURE__ */ r(Y, { gutter: 16, children: [
3182
- /* @__PURE__ */ e(z, { span: 12, children: /* @__PURE__ */ e(
3183
- ie,
3181
+ /* @__PURE__ */ n(Y, { gutter: 16, children: [
3182
+ /* @__PURE__ */ e(O, { span: 12, children: /* @__PURE__ */ e(
3183
+ se,
3184
3184
  {
3185
- cardTitle: `运行列表 (${a.length})`,
3186
- rows: a,
3185
+ cardTitle: `运行列表 (${l.length})`,
3186
+ rows: l,
3187
3187
  rowKey: "id",
3188
- loading: A,
3188
+ loading: _,
3189
3189
  searchKeys: ["id", "status"],
3190
3190
  searchPlaceholder: "按 run ID / 状态过滤",
3191
3191
  emptyTitle: "暂无运行记录",
@@ -3208,18 +3208,18 @@ function zr() {
3208
3208
  title: "状态",
3209
3209
  dataIndex: "status",
3210
3210
  width: 80,
3211
- render: (u) => /* @__PURE__ */ e(w, { color: Or[u], children: u })
3211
+ render: (u) => /* @__PURE__ */ e(w, { color: Ln[u], children: u })
3212
3212
  },
3213
3213
  {
3214
3214
  title: "拉取/成功/死信",
3215
3215
  width: 150,
3216
- render: (u, i) => `${i.fetchedCount} / ${i.successCount} / ${i.deadLetterCount}`
3216
+ render: (u, s) => `${s.fetchedCount} / ${s.successCount} / ${s.deadLetterCount}`
3217
3217
  }
3218
3218
  ]
3219
3219
  }
3220
3220
  ) }),
3221
- /* @__PURE__ */ e(z, { span: 12, children: /* @__PURE__ */ e(
3222
- ie,
3221
+ /* @__PURE__ */ e(O, { span: 12, children: /* @__PURE__ */ e(
3222
+ se,
3223
3223
  {
3224
3224
  cardTitle: x ? `run#${x} 抽取项 (${c.length})` : "抽取项",
3225
3225
  rows: c,
@@ -3248,8 +3248,8 @@ function zr() {
3248
3248
  width: 60,
3249
3249
  render: (u) => {
3250
3250
  try {
3251
- const i = JSON.parse(u);
3252
- return i.link ? /* @__PURE__ */ e("a", { href: i.link, target: "_blank", children: "↗" }) : "-";
3251
+ const s = JSON.parse(u);
3252
+ return s.link ? /* @__PURE__ */ e("a", { href: s.link, target: "_blank", children: "↗" }) : "-";
3253
3253
  } catch {
3254
3254
  return "-";
3255
3255
  }
@@ -3267,48 +3267,48 @@ function zr() {
3267
3267
  ] })
3268
3268
  ] });
3269
3269
  }
3270
- function Mr() {
3271
- return /* @__PURE__ */ r(ct, { children: [
3272
- /* @__PURE__ */ e(ne, { index: !0, element: /* @__PURE__ */ e(dt, { to: "list", replace: !0 }) }),
3273
- /* @__PURE__ */ e(ne, { path: "list", element: /* @__PURE__ */ e(_r, {}) }),
3274
- /* @__PURE__ */ e(ne, { path: "new", element: /* @__PURE__ */ e(at, {}) }),
3275
- /* @__PURE__ */ e(ne, { path: "edit/:id", element: /* @__PURE__ */ e(at, {}) }),
3276
- /* @__PURE__ */ e(ne, { path: "runs", element: /* @__PURE__ */ e(zr, {}) })
3270
+ function Dn() {
3271
+ return /* @__PURE__ */ n(ct, { children: [
3272
+ /* @__PURE__ */ e(re, { index: !0, element: /* @__PURE__ */ e(dt, { to: "list", replace: !0 }) }),
3273
+ /* @__PURE__ */ e(re, { path: "list", element: /* @__PURE__ */ e(Pn, {}) }),
3274
+ /* @__PURE__ */ e(re, { path: "new", element: /* @__PURE__ */ e(lt, {}) }),
3275
+ /* @__PURE__ */ e(re, { path: "edit/:id", element: /* @__PURE__ */ e(lt, {}) }),
3276
+ /* @__PURE__ */ e(re, { path: "runs", element: /* @__PURE__ */ e(Mn, {}) })
3277
3277
  ] });
3278
3278
  }
3279
- const ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3279
+ const ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3280
3280
  __proto__: null,
3281
- default: Mr
3282
- }, Symbol.toStringTag, { value: "Module" })), Lr = {
3281
+ default: Dn
3282
+ }, Symbol.toStringTag, { value: "Module" })), $n = {
3283
3283
  OPEN: { color: "blue", text: "待开始" },
3284
3284
  IN_PROGRESS: { color: "green", text: "进行中" },
3285
3285
  COMPLETED: { color: "default", text: "已完成" },
3286
3286
  ARCHIVED: { color: "default", text: "已归档" }
3287
3287
  };
3288
- function $r() {
3289
- const t = xe(), [s, n] = m("mine"), [k, a] = m([]), [y, c] = m(!1), [f, x] = m(null), T = async () => {
3288
+ function Nn() {
3289
+ const t = xe(), [i, r] = m("mine"), [S, l] = m([]), [y, c] = m(!1), [f, x] = m(null), C = async () => {
3290
3290
  c(!0), x(null);
3291
3291
  try {
3292
- const l = s === "mine" ? "/project/list/mine?limit=100" : `/project/list/by-status?status=${s}&limit=100`, d = await N.get(l), g = (d == null ? void 0 : d.data) ?? d ?? [];
3293
- a(Array.isArray(g) ? g : []);
3294
- } catch (l) {
3295
- x((l == null ? void 0 : l.message) || (l == null ? void 0 : l.msg) || "加载失败");
3292
+ const a = i === "mine" ? "/project/list/mine?limit=100" : `/project/list/by-status?status=${i}&limit=100`, d = await $.get(a), g = (d == null ? void 0 : d.data) ?? d ?? [];
3293
+ l(Array.isArray(g) ? g : []);
3294
+ } catch (a) {
3295
+ x((a == null ? void 0 : a.message) || (a == null ? void 0 : a.msg) || "加载失败");
3296
3296
  } finally {
3297
3297
  c(!1);
3298
3298
  }
3299
3299
  };
3300
- U(() => {
3301
- T();
3302
- }, [s]);
3303
- const A = async (l) => {
3300
+ F(() => {
3301
+ C();
3302
+ }, [i]);
3303
+ const _ = async (a) => {
3304
3304
  try {
3305
- const d = await N.post(`/project/${l}/status?status=COMPLETED`);
3306
- d && d.success !== !1 && (b.success("已标记完成"), T());
3305
+ const d = await $.post(`/project/${a}/status?status=COMPLETED`);
3306
+ d && d.success !== !1 && (b.success("已标记完成"), C());
3307
3307
  } catch (d) {
3308
3308
  b.error("操作失败: " + ((d == null ? void 0 : d.message) || ""));
3309
3309
  }
3310
3310
  };
3311
- return /* @__PURE__ */ r("div", { children: [
3311
+ return /* @__PURE__ */ n("div", { children: [
3312
3312
  /* @__PURE__ */ e(
3313
3313
  ye,
3314
3314
  {
@@ -3317,22 +3317,22 @@ function $r() {
3317
3317
  breadcrumb: [{ label: "项目中心" }]
3318
3318
  }
3319
3319
  ),
3320
- f && !y && /* @__PURE__ */ e("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ e(Ht, { error: f, onRetry: T }) }),
3321
- /* @__PURE__ */ r("div", { style: {
3320
+ f && !y && /* @__PURE__ */ e("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ e(Ht, { error: f, onRetry: C }) }),
3321
+ /* @__PURE__ */ n("div", { style: {
3322
3322
  background: "#ffffff",
3323
3323
  borderRadius: 16,
3324
3324
  padding: 20,
3325
3325
  boxShadow: "0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.06)"
3326
3326
  }, children: [
3327
3327
  /* @__PURE__ */ e(
3328
- Ie,
3328
+ ke,
3329
3329
  {
3330
- activeKey: s,
3331
- onChange: n,
3332
- tabBarExtraContent: /* @__PURE__ */ r(P, { children: [
3333
- /* @__PURE__ */ e(_, { icon: /* @__PURE__ */ e(ee, {}), onClick: T, loading: y, children: "刷新" }),
3330
+ activeKey: i,
3331
+ onChange: r,
3332
+ tabBarExtraContent: /* @__PURE__ */ n(E, { children: [
3333
+ /* @__PURE__ */ e(A, { icon: /* @__PURE__ */ e(ee, {}), onClick: C, loading: y, children: "刷新" }),
3334
3334
  /* @__PURE__ */ e(
3335
- _,
3335
+ A,
3336
3336
  {
3337
3337
  type: "primary",
3338
3338
  icon: /* @__PURE__ */ e(yt, {}),
@@ -3350,32 +3350,32 @@ function $r() {
3350
3350
  }
3351
3351
  ),
3352
3352
  /* @__PURE__ */ e(
3353
- ie,
3353
+ se,
3354
3354
  {
3355
- rows: k,
3355
+ rows: S,
3356
3356
  columns: [
3357
3357
  { title: "ID", dataIndex: "id", width: 60 },
3358
3358
  {
3359
3359
  title: "名称",
3360
3360
  dataIndex: "name",
3361
- render: (l, d) => /* @__PURE__ */ r(P, { orientation: "vertical", size: 0, children: [
3362
- /* @__PURE__ */ e("a", { onClick: () => t(`/project/${d.id}`), style: { fontWeight: 500 }, children: l }),
3361
+ render: (a, d) => /* @__PURE__ */ n(E, { orientation: "vertical", size: 0, children: [
3362
+ /* @__PURE__ */ e("a", { onClick: () => t(`/project/${d.id}`), style: { fontWeight: 500 }, children: a }),
3363
3363
  d.description && /* @__PURE__ */ e("span", { style: { color: "#999", fontSize: 12 }, children: d.description })
3364
3364
  ] })
3365
3365
  },
3366
- { title: "来源", dataIndex: "sourceType", width: 100, render: (l) => /* @__PURE__ */ e(w, { children: l }) },
3366
+ { title: "来源", dataIndex: "sourceType", width: 100, render: (a) => /* @__PURE__ */ e(w, { children: a }) },
3367
3367
  {
3368
3368
  title: "订阅",
3369
3369
  dataIndex: "sourceSubscriptionId",
3370
3370
  width: 80,
3371
- render: (l) => l ? `#${l}` : /* @__PURE__ */ e("span", { style: { color: "#ccc" }, children: "-" })
3371
+ render: (a) => a ? `#${a}` : /* @__PURE__ */ e("span", { style: { color: "#ccc" }, children: "-" })
3372
3372
  },
3373
3373
  {
3374
3374
  title: "状态",
3375
3375
  dataIndex: "status",
3376
3376
  width: 100,
3377
- render: (l) => {
3378
- const d = Lr[l] || { color: "default", text: l };
3377
+ render: (a) => {
3378
+ const d = $n[a] || { color: "default", text: a };
3379
3379
  return /* @__PURE__ */ e(w, { color: d.color, children: d.text });
3380
3380
  }
3381
3381
  },
@@ -3383,7 +3383,7 @@ function $r() {
3383
3383
  {
3384
3384
  title: "上下文",
3385
3385
  width: 130,
3386
- render: (l, d) => /* @__PURE__ */ r(w, { color: "blue", children: [
3386
+ render: (a, d) => /* @__PURE__ */ n(w, { color: "blue", children: [
3387
3387
  d.contextSize || 0,
3388
3388
  "B"
3389
3389
  ] })
@@ -3392,20 +3392,20 @@ function $r() {
3392
3392
  title: "最近活动",
3393
3393
  dataIndex: "lastMessageAt",
3394
3394
  width: 150,
3395
- render: (l) => l ? new Date(l).toLocaleString() : /* @__PURE__ */ e("span", { style: { color: "#ccc" }, children: "-" })
3395
+ render: (a) => a ? new Date(a).toLocaleString() : /* @__PURE__ */ e("span", { style: { color: "#ccc" }, children: "-" })
3396
3396
  },
3397
3397
  {
3398
3398
  title: "操作",
3399
3399
  width: 160,
3400
- render: (l, d) => /* @__PURE__ */ r(P, { size: 4, children: [
3401
- /* @__PURE__ */ e(_, { type: "link", size: "small", onClick: () => t(`/project/${d.id}`), children: "对话" }),
3400
+ render: (a, d) => /* @__PURE__ */ n(E, { size: 4, children: [
3401
+ /* @__PURE__ */ e(A, { type: "link", size: "small", onClick: () => t(`/project/${d.id}`), children: "对话" }),
3402
3402
  d.status !== "COMPLETED" && d.status !== "ARCHIVED" && /* @__PURE__ */ e(
3403
- je,
3403
+ Ue,
3404
3404
  {
3405
3405
  title: "标记为已完成?",
3406
- onConfirm: () => A(d.id),
3406
+ onConfirm: () => _(d.id),
3407
3407
  okButtonProps: { danger: !0 },
3408
- children: /* @__PURE__ */ e(_, { type: "link", size: "small", icon: /* @__PURE__ */ e(Ue, {}), children: "完成" })
3408
+ children: /* @__PURE__ */ e(A, { type: "link", size: "small", icon: /* @__PURE__ */ e(Fe, {}), children: "完成" })
3409
3409
  }
3410
3410
  )
3411
3411
  ] })
@@ -3426,130 +3426,130 @@ function $r() {
3426
3426
  ] })
3427
3427
  ] });
3428
3428
  }
3429
- const Nr = [
3429
+ const Bn = [
3430
3430
  { value: "general", label: "通用助手" },
3431
3431
  { value: "analyst", label: "分析师" },
3432
3432
  { value: "writer", label: "写手" },
3433
3433
  { value: "pm", label: "产品经理" },
3434
3434
  { value: "ops", label: "运营" }
3435
3435
  ];
3436
- function Dr() {
3437
- const t = xe(), [s] = St(), [n] = E.useForm(), [k, a] = m(!1), [y, c] = m("from-subscribe"), [f, x] = m([]), [T, A] = m([]), [p, l] = m(!1), [d, g] = m([]), [v, $] = m(null);
3438
- U(() => {
3439
- const S = s.get("subscriptionId"), L = s.get("itemIds");
3440
- S && ($(Number(S)), n.setFieldValue("sourceSubscriptionId", Number(S)), u(S)), L && g(L.split(",").map(Number).filter(Boolean));
3441
- }, [s]), U(() => {
3442
- C();
3436
+ function jn() {
3437
+ const t = xe(), [i] = It(), [r] = P.useForm(), [S, l] = m(!1), [y, c] = m("from-subscribe"), [f, x] = m([]), [C, _] = m([]), [h, a] = m(!1), [d, g] = m([]), [v, D] = m(null);
3438
+ F(() => {
3439
+ const I = i.get("subscriptionId"), M = i.get("itemIds");
3440
+ I && (D(Number(I)), r.setFieldValue("sourceSubscriptionId", Number(I)), u(I)), M && g(M.split(",").map(Number).filter(Boolean));
3441
+ }, [i]), F(() => {
3442
+ T();
3443
3443
  }, []);
3444
- const C = async () => {
3444
+ const T = async () => {
3445
3445
  try {
3446
- const S = await N.get("/subscribe/subscription/list"), L = (S == null ? void 0 : S.data) ?? S ?? [];
3447
- x(Array.isArray(L) ? L.filter((J) => J.status === "VERIFIED") : []);
3446
+ const I = await $.get("/subscribe/subscription/list"), M = (I == null ? void 0 : I.data) ?? I ?? [];
3447
+ x(Array.isArray(M) ? M.filter((J) => J.status === "VERIFIED") : []);
3448
3448
  } catch {
3449
3449
  }
3450
- }, u = async (S) => {
3451
- l(!0);
3450
+ }, u = async (I) => {
3451
+ a(!0);
3452
3452
  try {
3453
- const L = await N.get(`/subscribe/run/list?subscriptionId=${S}&limit=1`), J = (L == null ? void 0 : L.data) ?? L ?? [];
3453
+ const M = await $.get(`/subscribe/run/list?subscriptionId=${I}&limit=1`), J = (M == null ? void 0 : M.data) ?? M ?? [];
3454
3454
  if (J.length === 0) {
3455
- A([]);
3455
+ _([]);
3456
3456
  return;
3457
3457
  }
3458
- const H = J[0], h = await N.get(`/subscribe/run/${H.id}/items?limit=100`), o = (h == null ? void 0 : h.data) ?? h ?? [];
3459
- A(Array.isArray(o) ? o : []);
3458
+ const H = J[0], p = await $.get(`/subscribe/run/${H.id}/items?limit=100`), o = (p == null ? void 0 : p.data) ?? p ?? [];
3459
+ _(Array.isArray(o) ? o : []);
3460
3460
  } catch {
3461
3461
  b.error("加载抽取项失败");
3462
3462
  } finally {
3463
- l(!1);
3463
+ a(!1);
3464
3464
  }
3465
3465
  };
3466
3466
  return /* @__PURE__ */ e("div", { style: { padding: 24 }, children: /* @__PURE__ */ e(
3467
- M,
3467
+ L,
3468
3468
  {
3469
- title: /* @__PURE__ */ r(P, { children: [
3470
- /* @__PURE__ */ e(_, { type: "text", icon: /* @__PURE__ */ e(ft, {}), onClick: () => t("/project/list") }),
3471
- /* @__PURE__ */ e(Fe, {}),
3469
+ title: /* @__PURE__ */ n(E, { children: [
3470
+ /* @__PURE__ */ e(A, { type: "text", icon: /* @__PURE__ */ e(ft, {}), onClick: () => t("/project/list") }),
3471
+ /* @__PURE__ */ e(qe, {}),
3472
3472
  "新建项目 (立项)"
3473
3473
  ] }),
3474
- extra: /* @__PURE__ */ r(P, { children: [
3475
- /* @__PURE__ */ e(_, { onClick: () => t("/project/list"), children: "取消" }),
3474
+ extra: /* @__PURE__ */ n(E, { children: [
3475
+ /* @__PURE__ */ e(A, { onClick: () => t("/project/list"), children: "取消" }),
3476
3476
  /* @__PURE__ */ e(
3477
- _,
3477
+ A,
3478
3478
  {
3479
3479
  type: "primary",
3480
3480
  icon: /* @__PURE__ */ e(gt, {}),
3481
- loading: k,
3481
+ loading: S,
3482
3482
  onClick: async () => {
3483
3483
  try {
3484
- const S = await n.validateFields();
3484
+ const I = await r.validateFields();
3485
3485
  if (y === "from-subscribe" && d.length === 0) {
3486
3486
  b.warning("请至少选 1 个 item");
3487
3487
  return;
3488
3488
  }
3489
- a(!0);
3490
- const L = {
3491
- ...S,
3489
+ l(!0);
3490
+ const M = {
3491
+ ...I,
3492
3492
  sourceItemIds: y === "from-subscribe" ? d.map(String) : null
3493
- }, J = y === "from-subscribe" ? "/project/create-from-items" : "/project/create-manual", H = await N.post(J, L);
3493
+ }, J = y === "from-subscribe" ? "/project/create-from-items" : "/project/create-manual", H = await $.post(J, M);
3494
3494
  if (H && H.success !== !1) {
3495
- const h = H.data ?? H;
3496
- b.success("立项成功"), t(`/project/${h.id}`);
3495
+ const p = H.data ?? H;
3496
+ b.success("立项成功"), t(`/project/${p.id}`);
3497
3497
  } else
3498
3498
  b.error((H == null ? void 0 : H.message) || "立项失败");
3499
- } catch (S) {
3500
- S != null && S.errorFields || b.error("立项失败: " + ((S == null ? void 0 : S.message) || ""));
3499
+ } catch (I) {
3500
+ I != null && I.errorFields || b.error("立项失败: " + ((I == null ? void 0 : I.message) || ""));
3501
3501
  } finally {
3502
- a(!1);
3502
+ l(!1);
3503
3503
  }
3504
3504
  },
3505
3505
  children: "立项"
3506
3506
  }
3507
3507
  )
3508
3508
  ] }),
3509
- children: /* @__PURE__ */ r(E, { form: n, layout: "vertical", initialValues: { agentRole: "general" }, children: [
3510
- /* @__PURE__ */ e(E.Item, { label: "来源", children: /* @__PURE__ */ r(re.Group, { value: y, onChange: (S) => c(S.target.value), children: [
3511
- /* @__PURE__ */ e(re.Button, { value: "from-subscribe", children: "从订阅线索立项 (主路径)" }),
3512
- /* @__PURE__ */ e(re.Button, { value: "manual", children: "手动立项 (无源数据)" })
3509
+ children: /* @__PURE__ */ n(P, { form: r, layout: "vertical", initialValues: { agentRole: "general" }, children: [
3510
+ /* @__PURE__ */ e(P.Item, { label: "来源", children: /* @__PURE__ */ n(ne.Group, { value: y, onChange: (I) => c(I.target.value), children: [
3511
+ /* @__PURE__ */ e(ne.Button, { value: "from-subscribe", children: "从订阅线索立项 (主路径)" }),
3512
+ /* @__PURE__ */ e(ne.Button, { value: "manual", children: "手动立项 (无源数据)" })
3513
3513
  ] }) }),
3514
- /* @__PURE__ */ e(E.Item, { label: "项目名称", name: "name", rules: [{ required: !0, message: "请输入名称" }], children: /* @__PURE__ */ e(B, { placeholder: "例如: 跟进 GitHub 高优 Issue" }) }),
3515
- /* @__PURE__ */ e(E.Item, { label: "项目描述", name: "description", children: /* @__PURE__ */ e(B.TextArea, { rows: 2, placeholder: "(可选) 这个项目要解决什么?" }) }),
3516
- y === "from-subscribe" && /* @__PURE__ */ r(M, { type: "inner", title: "源数据", style: { marginBottom: 16 }, children: [
3514
+ /* @__PURE__ */ e(P.Item, { label: "项目名称", name: "name", rules: [{ required: !0, message: "请输入名称" }], children: /* @__PURE__ */ e(B, { placeholder: "例如: 跟进 GitHub 高优 Issue" }) }),
3515
+ /* @__PURE__ */ e(P.Item, { label: "项目描述", name: "description", children: /* @__PURE__ */ e(B.TextArea, { rows: 2, placeholder: "(可选) 这个项目要解决什么?" }) }),
3516
+ y === "from-subscribe" && /* @__PURE__ */ n(L, { type: "inner", title: "源数据", style: { marginBottom: 16 }, children: [
3517
3517
  /* @__PURE__ */ e(
3518
- E.Item,
3518
+ P.Item,
3519
3519
  {
3520
3520
  label: "选择订阅",
3521
3521
  name: "sourceSubscriptionId",
3522
3522
  rules: [{ required: !0, message: "请选订阅" }],
3523
3523
  children: /* @__PURE__ */ e(
3524
- X,
3524
+ V,
3525
3525
  {
3526
3526
  placeholder: "选择订阅 (拉取最近一次 run 的 items)",
3527
- options: f.map((S) => ({ value: S.id, label: `#${S.id} ${S.name}` })),
3528
- onChange: (S) => {
3529
- $(S), u(S), g([]);
3527
+ options: f.map((I) => ({ value: I.id, label: `#${I.id} ${I.name}` })),
3528
+ onChange: (I) => {
3529
+ D(I), u(I), g([]);
3530
3530
  }
3531
3531
  }
3532
3532
  )
3533
3533
  }
3534
3534
  ),
3535
- v && /* @__PURE__ */ r(Ae, { spinning: p, children: [
3536
- /* @__PURE__ */ r("div", { style: { marginBottom: 8 }, children: [
3537
- /* @__PURE__ */ r(w, { color: "blue", children: [
3535
+ v && /* @__PURE__ */ n(_e, { spinning: h, children: [
3536
+ /* @__PURE__ */ n("div", { style: { marginBottom: 8 }, children: [
3537
+ /* @__PURE__ */ n(w, { color: "blue", children: [
3538
3538
  "已选 ",
3539
3539
  d.length,
3540
3540
  " / ",
3541
- T.length
3541
+ C.length
3542
3542
  ] }),
3543
3543
  /* @__PURE__ */ e(
3544
- _,
3544
+ A,
3545
3545
  {
3546
3546
  size: "small",
3547
- onClick: () => g(T.map((S) => S.id)),
3547
+ onClick: () => g(C.map((I) => I.id)),
3548
3548
  children: "全选"
3549
3549
  }
3550
3550
  ),
3551
3551
  /* @__PURE__ */ e(
3552
- _,
3552
+ A,
3553
3553
  {
3554
3554
  size: "small",
3555
3555
  onClick: () => g([]),
@@ -3559,9 +3559,9 @@ function Dr() {
3559
3559
  )
3560
3560
  ] }),
3561
3561
  /* @__PURE__ */ e(
3562
- ie,
3562
+ se,
3563
3563
  {
3564
- rows: T,
3564
+ rows: C,
3565
3565
  rowKey: "id",
3566
3566
  rowSelection: {
3567
3567
  selectedRowKeys: d,
@@ -3577,11 +3577,11 @@ function Dr() {
3577
3577
  {
3578
3578
  title: "title",
3579
3579
  dataIndex: "normalized",
3580
- render: (S) => {
3580
+ render: (I) => {
3581
3581
  try {
3582
- return JSON.parse(S).title || "(无)";
3582
+ return JSON.parse(I).title || "(无)";
3583
3583
  } catch {
3584
- return S;
3584
+ return I;
3585
3585
  }
3586
3586
  }
3587
3587
  },
@@ -3589,17 +3589,17 @@ function Dr() {
3589
3589
  title: "fetched",
3590
3590
  dataIndex: "fetchedAt",
3591
3591
  width: 150,
3592
- render: (S) => S ? new Date(S).toLocaleString() : "-"
3592
+ render: (I) => I ? new Date(I).toLocaleString() : "-"
3593
3593
  }
3594
3594
  ]
3595
3595
  }
3596
3596
  )
3597
3597
  ] })
3598
3598
  ] }),
3599
- /* @__PURE__ */ r(M, { type: "inner", title: "Agent 配置", style: { marginBottom: 16 }, children: [
3600
- /* @__PURE__ */ e(E.Item, { label: "Agent 角色", name: "agentRole", extra: "决定 system prompt 的语气 / 视角", children: /* @__PURE__ */ e(X, { options: Nr }) }),
3599
+ /* @__PURE__ */ n(L, { type: "inner", title: "Agent 配置", style: { marginBottom: 16 }, children: [
3600
+ /* @__PURE__ */ e(P.Item, { label: "Agent 角色", name: "agentRole", extra: "决定 system prompt 的语气 / 视角", children: /* @__PURE__ */ e(V, { options: Bn }) }),
3601
3601
  /* @__PURE__ */ e(
3602
- E.Item,
3602
+ P.Item,
3603
3603
  {
3604
3604
  label: "模型 (可选)",
3605
3605
  name: "modelCode",
@@ -3609,7 +3609,7 @@ function Dr() {
3609
3609
  )
3610
3610
  ] }),
3611
3611
  /* @__PURE__ */ e(
3612
- V,
3612
+ Z,
3613
3613
  {
3614
3614
  type: "info",
3615
3615
  showIcon: !0,
@@ -3620,131 +3620,131 @@ function Dr() {
3620
3620
  }
3621
3621
  ) });
3622
3622
  }
3623
- const it = {
3623
+ const st = {
3624
3624
  USER: { color: "blue", icon: /* @__PURE__ */ e(ut, {}), label: "CEO" },
3625
- ASSISTANT: { color: "purple", icon: /* @__PURE__ */ e(Ne, {}), label: "Agent" },
3625
+ ASSISTANT: { color: "purple", icon: /* @__PURE__ */ e($e, {}), label: "Agent" },
3626
3626
  SYSTEM: { color: "default", icon: null, label: "系统" }
3627
- }, Br = {
3627
+ }, Un = {
3628
3628
  OPEN: { color: "blue", text: "待开始" },
3629
3629
  IN_PROGRESS: { color: "green", text: "进行中" },
3630
3630
  COMPLETED: { color: "default", text: "已完成" },
3631
3631
  ARCHIVED: { color: "default", text: "已归档" }
3632
3632
  };
3633
- function qr() {
3634
- const { id: t } = ot(), s = xe(), [n, k] = m(null), [a, y] = m([]), [c, f] = m(""), [x, T] = m(!1), A = st(null);
3635
- U(() => {
3636
- t && p();
3637
- }, [t]), U(() => {
3638
- A.current && (A.current.scrollTop = A.current.scrollHeight);
3639
- }, [a]);
3640
- const p = async () => {
3633
+ function qn() {
3634
+ const { id: t } = ot(), i = xe(), [r, S] = m(null), [l, y] = m([]), [c, f] = m(""), [x, C] = m(!1), _ = it(null);
3635
+ F(() => {
3636
+ t && h();
3637
+ }, [t]), F(() => {
3638
+ _.current && (_.current.scrollTop = _.current.scrollHeight);
3639
+ }, [l]);
3640
+ const h = async () => {
3641
3641
  try {
3642
- const [v, $] = await Promise.all([
3643
- N.get(`/project/${t}`),
3644
- N.get(`/project/${t}/messages`)
3642
+ const [v, D] = await Promise.all([
3643
+ $.get(`/project/${t}`),
3644
+ $.get(`/project/${t}/messages`)
3645
3645
  ]);
3646
- k((v == null ? void 0 : v.data) ?? v), y(Array.isArray(($ == null ? void 0 : $.data) ?? $) ? ($ == null ? void 0 : $.data) ?? $ : []);
3646
+ S((v == null ? void 0 : v.data) ?? v), y(Array.isArray((D == null ? void 0 : D.data) ?? D) ? (D == null ? void 0 : D.data) ?? D : []);
3647
3647
  } catch {
3648
3648
  b.error("加载项目失败");
3649
3649
  }
3650
- }, l = async () => {
3650
+ }, a = async () => {
3651
3651
  if (!c.trim()) return;
3652
3652
  const v = c.trim();
3653
- f(""), T(!0);
3654
- const $ = { seq: -1, role: "USER", content: v, createdAt: (/* @__PURE__ */ new Date()).toISOString() };
3655
- y((C) => [...C, $]);
3653
+ f(""), C(!0);
3654
+ const D = { seq: -1, role: "USER", content: v, createdAt: (/* @__PURE__ */ new Date()).toISOString() };
3655
+ y((T) => [...T, D]);
3656
3656
  try {
3657
- const C = await N.post(`/project/${t}/chat`, { message: v });
3658
- if (C && C.success !== !1) {
3659
- const i = (C.data ?? C).message;
3660
- y((S) => [...S.filter((J) => J.seq !== -1), ...i ? [i] : []]), setTimeout(p, 100);
3657
+ const T = await $.post(`/project/${t}/chat`, { message: v });
3658
+ if (T && T.success !== !1) {
3659
+ const s = (T.data ?? T).message;
3660
+ y((I) => [...I.filter((J) => J.seq !== -1), ...s ? [s] : []]), setTimeout(h, 100);
3661
3661
  } else
3662
- b.error((C == null ? void 0 : C.message) || "发送失败");
3663
- } catch (C) {
3664
- b.error("发送失败: " + ((C == null ? void 0 : C.message) || ""));
3662
+ b.error((T == null ? void 0 : T.message) || "发送失败");
3663
+ } catch (T) {
3664
+ b.error("发送失败: " + ((T == null ? void 0 : T.message) || ""));
3665
3665
  } finally {
3666
- T(!1);
3666
+ C(!1);
3667
3667
  }
3668
3668
  }, d = async () => {
3669
3669
  try {
3670
- const v = await N.post(`/project/${t}/status?status=COMPLETED`);
3671
- v && v.success !== !1 && (b.success("已标记完成"), p());
3670
+ const v = await $.post(`/project/${t}/status?status=COMPLETED`);
3671
+ v && v.success !== !1 && (b.success("已标记完成"), h());
3672
3672
  } catch {
3673
3673
  b.error("操作失败");
3674
3674
  }
3675
3675
  };
3676
- if (!n) return /* @__PURE__ */ e("div", { style: { padding: 24 }, children: /* @__PURE__ */ e(Ae, {}) });
3677
- const g = Br[n.status] || { color: "default", text: n.status };
3678
- return /* @__PURE__ */ r("div", { style: { padding: 24, height: "calc(100vh - 64px)", display: "flex", flexDirection: "column", gap: 16 }, children: [
3679
- /* @__PURE__ */ r(
3680
- M,
3676
+ if (!r) return /* @__PURE__ */ e("div", { style: { padding: 24 }, children: /* @__PURE__ */ e(_e, {}) });
3677
+ const g = Un[r.status] || { color: "default", text: r.status };
3678
+ return /* @__PURE__ */ n("div", { style: { padding: 24, height: "calc(100vh - 64px)", display: "flex", flexDirection: "column", gap: 16 }, children: [
3679
+ /* @__PURE__ */ n(
3680
+ L,
3681
3681
  {
3682
- title: /* @__PURE__ */ r(P, { children: [
3683
- /* @__PURE__ */ e(_, { type: "text", icon: /* @__PURE__ */ e(ft, {}), onClick: () => s("/project/list") }),
3684
- /* @__PURE__ */ e(Fe, {}),
3685
- /* @__PURE__ */ e("span", { style: { fontWeight: 500 }, children: n.name }),
3682
+ title: /* @__PURE__ */ n(E, { children: [
3683
+ /* @__PURE__ */ e(A, { type: "text", icon: /* @__PURE__ */ e(ft, {}), onClick: () => i("/project/list") }),
3684
+ /* @__PURE__ */ e(qe, {}),
3685
+ /* @__PURE__ */ e("span", { style: { fontWeight: 500 }, children: r.name }),
3686
3686
  /* @__PURE__ */ e(w, { color: g.color, children: g.text })
3687
3687
  ] }),
3688
- extra: /* @__PURE__ */ r(P, { children: [
3689
- n.contextSize > 0 && /* @__PURE__ */ r(w, { color: "blue", children: [
3688
+ extra: /* @__PURE__ */ n(E, { children: [
3689
+ r.contextSize > 0 && /* @__PURE__ */ n(w, { color: "blue", children: [
3690
3690
  "上下文 ",
3691
- n.contextSize,
3691
+ r.contextSize,
3692
3692
  " B"
3693
3693
  ] }),
3694
- /* @__PURE__ */ e(w, { children: n.agentRole }),
3695
- n.modelCode && /* @__PURE__ */ e(w, { color: "purple", children: n.modelCode }),
3696
- n.status !== "COMPLETED" && n.status !== "ARCHIVED" && /* @__PURE__ */ e(je, { title: "标记完成?", onConfirm: d, children: /* @__PURE__ */ e(_, { icon: /* @__PURE__ */ e(Ue, {}), children: "标记完成" }) })
3694
+ /* @__PURE__ */ e(w, { children: r.agentRole }),
3695
+ r.modelCode && /* @__PURE__ */ e(w, { color: "purple", children: r.modelCode }),
3696
+ r.status !== "COMPLETED" && r.status !== "ARCHIVED" && /* @__PURE__ */ e(Ue, { title: "标记完成?", onConfirm: d, children: /* @__PURE__ */ e(A, { icon: /* @__PURE__ */ e(Fe, {}), children: "标记完成" }) })
3697
3697
  ] }),
3698
3698
  children: [
3699
- n.description && /* @__PURE__ */ e("div", { style: { color: "#666", marginBottom: 8 }, children: n.description }),
3700
- /* @__PURE__ */ r(P, { size: "large", children: [
3701
- /* @__PURE__ */ e(K, { title: "消息数", value: n.messageCount || 0 }),
3702
- n.sourceSubscriptionId && /* @__PURE__ */ e(K, { title: "来源订阅", value: `#${n.sourceSubscriptionId}` }),
3699
+ r.description && /* @__PURE__ */ e("div", { style: { color: "#666", marginBottom: 8 }, children: r.description }),
3700
+ /* @__PURE__ */ n(E, { size: "large", children: [
3701
+ /* @__PURE__ */ e(K, { title: "消息数", value: r.messageCount || 0 }),
3702
+ r.sourceSubscriptionId && /* @__PURE__ */ e(K, { title: "来源订阅", value: `#${r.sourceSubscriptionId}` }),
3703
3703
  /* @__PURE__ */ e(
3704
3704
  K,
3705
3705
  {
3706
3706
  title: "立项",
3707
- value: n.createdAt ? new Date(n.createdAt).toLocaleString() : "-"
3707
+ value: r.createdAt ? new Date(r.createdAt).toLocaleString() : "-"
3708
3708
  }
3709
3709
  )
3710
3710
  ] })
3711
3711
  ]
3712
3712
  }
3713
3713
  ),
3714
- /* @__PURE__ */ r(
3715
- M,
3714
+ /* @__PURE__ */ n(
3715
+ L,
3716
3716
  {
3717
3717
  style: { flex: 1, display: "flex", flexDirection: "column" },
3718
3718
  styles: { body: { flex: 1, display: "flex", flexDirection: "column", padding: 0 } },
3719
3719
  children: [
3720
- /* @__PURE__ */ e("div", { ref: A, style: { flex: 1, overflow: "auto", padding: 16, background: "#fafafa" }, children: a.length === 0 ? /* @__PURE__ */ e(Ct, { description: "还没有消息, 跟 Agent 说点什么?" }) : /* @__PURE__ */ r(P, { orientation: "vertical", style: { width: "100%" }, size: "middle", children: [
3721
- a.map((v) => {
3722
- const $ = it[v.role] || it.SYSTEM, C = v.role === "USER";
3720
+ /* @__PURE__ */ e("div", { ref: _, style: { flex: 1, overflow: "auto", padding: 16, background: "#fafafa" }, children: l.length === 0 ? /* @__PURE__ */ e(Tt, { description: "还没有消息, 跟 Agent 说点什么?" }) : /* @__PURE__ */ n(E, { orientation: "vertical", style: { width: "100%" }, size: "middle", children: [
3721
+ l.map((v) => {
3722
+ const D = st[v.role] || st.SYSTEM, T = v.role === "USER";
3723
3723
  return /* @__PURE__ */ e("div", { style: {
3724
3724
  display: "flex",
3725
- justifyContent: C ? "flex-end" : "flex-start"
3726
- }, children: /* @__PURE__ */ r("div", { style: {
3725
+ justifyContent: T ? "flex-end" : "flex-start"
3726
+ }, children: /* @__PURE__ */ n("div", { style: {
3727
3727
  maxWidth: "70%",
3728
- background: C ? "#1677ff" : "#fff",
3729
- color: C ? "#fff" : "#000",
3730
- border: C ? "none" : "1px solid #e8e8e8",
3728
+ background: T ? "#1677ff" : "#fff",
3729
+ color: T ? "#fff" : "#000",
3730
+ border: T ? "none" : "1px solid #e8e8e8",
3731
3731
  borderRadius: 8,
3732
3732
  padding: "10px 14px",
3733
3733
  boxShadow: "0 1px 2px rgba(0,0,0,0.04)"
3734
3734
  }, children: [
3735
- /* @__PURE__ */ e("div", { style: { fontSize: 12, opacity: 0.7, marginBottom: 4 }, children: /* @__PURE__ */ r(P, { size: 4, children: [
3736
- $.icon,
3737
- $.label,
3738
- v.seq > 0 && /* @__PURE__ */ r("span", { children: [
3735
+ /* @__PURE__ */ e("div", { style: { fontSize: 12, opacity: 0.7, marginBottom: 4 }, children: /* @__PURE__ */ n(E, { size: 4, children: [
3736
+ D.icon,
3737
+ D.label,
3738
+ v.seq > 0 && /* @__PURE__ */ n("span", { children: [
3739
3739
  "#",
3740
3740
  v.seq
3741
3741
  ] }),
3742
- v.latencyMs > 0 && /* @__PURE__ */ r("span", { children: [
3742
+ v.latencyMs > 0 && /* @__PURE__ */ n("span", { children: [
3743
3743
  "· ",
3744
3744
  v.latencyMs,
3745
3745
  "ms"
3746
3746
  ] }),
3747
- v.modelCode && /* @__PURE__ */ r("span", { children: [
3747
+ v.modelCode && /* @__PURE__ */ n("span", { children: [
3748
3748
  "· ",
3749
3749
  v.modelCode
3750
3750
  ] })
@@ -3752,32 +3752,32 @@ function qr() {
3752
3752
  /* @__PURE__ */ e("div", { style: { whiteSpace: "pre-wrap", wordBreak: "break-word" }, children: v.content })
3753
3753
  ] }) }, v.id || v.seq);
3754
3754
  }),
3755
- x && /* @__PURE__ */ e("div", { style: { display: "flex", justifyContent: "flex-start" }, children: /* @__PURE__ */ r("div", { style: {
3755
+ x && /* @__PURE__ */ e("div", { style: { display: "flex", justifyContent: "flex-start" }, children: /* @__PURE__ */ n("div", { style: {
3756
3756
  background: "#fff",
3757
3757
  border: "1px solid #e8e8e8",
3758
3758
  borderRadius: 8,
3759
3759
  padding: "10px 14px"
3760
3760
  }, children: [
3761
- /* @__PURE__ */ e(Ae, { size: "small" }),
3761
+ /* @__PURE__ */ e(_e, { size: "small" }),
3762
3762
  " 思考中..."
3763
3763
  ] }) })
3764
3764
  ] }) }),
3765
- n.status === "COMPLETED" || n.status === "ARCHIVED" ? /* @__PURE__ */ e(
3766
- V,
3765
+ r.status === "COMPLETED" || r.status === "ARCHIVED" ? /* @__PURE__ */ e(
3766
+ Z,
3767
3767
  {
3768
3768
  style: { margin: 12, marginBottom: 0 },
3769
3769
  type: "info",
3770
3770
  title: "项目已完成 / 归档, 不再接受新消息",
3771
3771
  showIcon: !0
3772
3772
  }
3773
- ) : /* @__PURE__ */ r("div", { style: { borderTop: "1px solid #f0f0f0", padding: 12, display: "flex", gap: 8 }, children: [
3773
+ ) : /* @__PURE__ */ n("div", { style: { borderTop: "1px solid #f0f0f0", padding: 12, display: "flex", gap: 8 }, children: [
3774
3774
  /* @__PURE__ */ e(
3775
3775
  B.TextArea,
3776
3776
  {
3777
3777
  value: c,
3778
3778
  onChange: (v) => f(v.target.value),
3779
3779
  onPressEnter: (v) => {
3780
- v.shiftKey || (v.preventDefault(), l());
3780
+ v.shiftKey || (v.preventDefault(), a());
3781
3781
  },
3782
3782
  placeholder: "输入消息, Enter 发送 (Shift+Enter 换行)",
3783
3783
  autoSize: { minRows: 1, maxRows: 6 },
@@ -3785,12 +3785,12 @@ function qr() {
3785
3785
  }
3786
3786
  ),
3787
3787
  /* @__PURE__ */ e(
3788
- _,
3788
+ A,
3789
3789
  {
3790
3790
  type: "primary",
3791
- icon: /* @__PURE__ */ e(qt, {}),
3791
+ icon: /* @__PURE__ */ e(jt, {}),
3792
3792
  loading: x,
3793
- onClick: l,
3793
+ onClick: a,
3794
3794
  disabled: !c.trim(),
3795
3795
  children: "发送"
3796
3796
  }
@@ -3801,39 +3801,43 @@ function qr() {
3801
3801
  )
3802
3802
  ] });
3803
3803
  }
3804
- function jr() {
3805
- return /* @__PURE__ */ r(ct, { children: [
3806
- /* @__PURE__ */ e(ne, { index: !0, element: /* @__PURE__ */ e(dt, { to: "list", replace: !0 }) }),
3807
- /* @__PURE__ */ e(ne, { path: "list", element: /* @__PURE__ */ e($r, {}) }),
3808
- /* @__PURE__ */ e(ne, { path: "new", element: /* @__PURE__ */ e(Dr, {}) }),
3809
- /* @__PURE__ */ e(ne, { path: ":id", element: /* @__PURE__ */ e(qr, {}) })
3804
+ function Kn() {
3805
+ return /* @__PURE__ */ n(ct, { children: [
3806
+ /* @__PURE__ */ e(re, { index: !0, element: /* @__PURE__ */ e(dt, { to: "list", replace: !0 }) }),
3807
+ /* @__PURE__ */ e(re, { path: "list", element: /* @__PURE__ */ e(Nn, {}) }),
3808
+ /* @__PURE__ */ e(re, { path: "new", element: /* @__PURE__ */ e(jn, {}) }),
3809
+ /* @__PURE__ */ e(re, { path: ":id", element: /* @__PURE__ */ e(qn, {}) })
3810
3810
  ] });
3811
3811
  }
3812
- const an = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3812
+ const or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3813
3813
  __proto__: null,
3814
- default: jr
3815
- }, Symbol.toStringTag, { value: "Module" }));
3814
+ default: Kn
3815
+ }, Symbol.toStringTag, { value: "Module" })), Fn = "# z-team-component\n\nz-team(团队工作台)的**跨仓唯一前端面**:把「多模式工作台 / 模式切换 / z-opc 业务套件聚合 / 订阅域 / 项目域」\n这一整套团队工作台页面收敛成一个可复用的 React 组件包,由主壳(z-opc 主前端)挂载。\n\n- **npm 包名**:`@yuku123/z-team-component`\n- **宿主接入**:双入口 —— `.`(`ZTeamApp` / `SubscribeApp` / `ProjectApp`)与 `./pages`(`routes` / `appMeta` / `menuItems`)\n- **后端**:与 z-opc 主壳同源的 `/api/**`(axios `baseURL = '/api'`,Cookie 模式 `withCredentials`)\n- **技术栈**:React 19 + antd 6 + react-router-dom 7 + vite(**library mode**,双入口 `index` / `pages`,\n 基座与全部 `@yuku123/*` 一律 **external**,由消费方用自己的 node_modules 解析)\n\n> ⚠ z-team 是**主壳的总控包**:它自己不承载某个业务域,而是把 z-opc 的业务套件(`/ctc/*`、`/ai/*`、`/config/*` …)\n> 聚合进工作台外壳里渲染。所以本文档描述的是 **z-team 自身的能力**(工作台 / 模式切换 / 套件聚合 / 订阅 / 项目)。\n\n---\n\n## 一、能力概览\n\n### 1.1 顶层路由(`src/pages-manifest.ts` 的 `routes`)\n\n| 路由 | 组件 | 能力 |\n|------|------|------|\n| `/team/subscribe` | `SubscribeApp` | 订阅域:订阅列表 / 编辑 / 运行历史 |\n| `/team/project` | `ProjectApp` | 项目域:项目列表 / 创建 / 详情 |\n| `/team/docs` | `ComponentDocPage` | 本文件渲染页(左侧 240px TOC + 右侧正文) |\n| `/team/:rest*` | `ZTeamApp` | **兜底**:`ZTeamApp` 内部按 `useLocation().pathname` 懒加载分发到下面 15 个域 |\n\n`menuItems`:`/team/subscribe`(订阅)/ `/team/project`(项目)/ `/team/workspace`(工作台)/ `/team/docs`(组件文档,末项)。\n\n### 1.2 `ZTeamApp` 顶层分发(`src/zteam-adapter/App.tsx`)\n\n| pathname | 渲染的域 | 源文件 |\n|----------|----------|--------|\n| `/workspace` | 工作台 | `src/zteam/pages/workspace/index.tsx` |\n| `/workspace/phone` | 移动端工作台 | `src/zteam/pages/workspace/phone/index.tsx` |\n| `/workspace/from-ticket` | 从工单进入 | `src/zteam/pages/workspace/from-ticket.tsx` |\n| `/workspace/from-scenario` | 从场景进入 | `src/zteam/pages/workspace/from-scenario.tsx` |\n| `/workspace/build-by-form` | 表单构建 | `src/zteam/pages/workspace/build-by-form.tsx` |\n| `/scenario` | 场景 | `src/zteam/pages/scenario/index.tsx` |\n| `/admin` | 管理后台(走工作台外壳的 admin 分支) | `src/zteam/pages/admin/index.tsx` |\n| `/welcome` | 产品介绍 | `src/zteam/pages/welcome/index.tsx` |\n| `/portal` | 场景入口 | `src/zteam/pages/portal/index.tsx` |\n| `/chatdemo` | 聊天演示 | `src/zteam/pages/chatdemo/index.tsx` |\n| `/embed/chat` | 嵌入式聊天 | `src/zteam/pages/embed/chat/index.tsx` |\n| `/change-log` | 变更记录 | `src/zteam/pages/change-log/index.tsx` |\n| `/docs` | **操作手册页**(52KB 手写暗色主题页,**与本文件的组件文档页不是一回事**) | `src/zteam/pages/docs/index.tsx` |\n\n`src/zteam/pages/` 下共 **15 个域目录**:`admin` / `agenthub-digital-brain-test` / `change-log` / `chatdemo` /\n`docs` / `download` / `embed` / `login` / `note` / `phone` / `portal` / `rpa` / `scenario` / `welcome` / `workspace`。\n其中 `agenthub-digital-brain-test` / `download` / `login` / `note` / `rpa` **没有** `ZTeamApp` 顶层分支,\n由域内路由或别的入口进入。\n\n### 1.3 工作台模式切换(`src/zteam/pages/workspace/utils/chatMode.ts`)\n\n`ChatMode` 共 13 种:`personal` / `collaboration` / `smart` / `product` / `dev` / `test` / `ops` / `admin` /\n`system` / `life` / `training` / `rpa` / `knowledge`(默认 `collaboration`)。\n\n模式切换统一走 `history.push` 到对应顶层路由(`Layout/index.tsx` 的 `handleModeSwitch`):\n\n| 模式 | 落点 |\n|------|------|\n| `system` | `/ctc/4a/account`(z-opc 业务路径;已在业务路径上时不重复跳) |\n| `test` | `/test/qa/dashboard` |\n| `admin` | `/admin?mode=admin` |\n| `rpa` | `/rpa/dashboard` |\n| 其余模式 | `/workspace?mode=xxx`(必须带 `?desktop=1`,否则窄视口会被重定向到移动端工作台) |\n\n模式持久化在 URL query 上(`?mode=xxx`,`replaceState` 不污染历史记录);\n`/admin*` → `admin`、`/ops/*` → `ops`、`/lc/*` → `dev` 由 `readModeFromUrl()` 自动识别。\n\n### 1.4 套件聚合(`src/zteam/pages/workspace/components/Layout/SystemShell.tsx`)\n\n`SystemShell` 用一张 `SYSTEM_ROUTES` 表把 **z-opc 的业务套件**接进工作台的右侧内容区,\n用 `matchSystemPath()` 做 pathname 匹配(精确 → 通配 `*` / 参数 `:param`),支持 `/ctc/*`、`/ai/*`、`/config/*`、\n`/task/*`、`/workflow/*`、`/schedule/*`、`/mist/*`、`/meta/*`、`/msg/*`、`/rpc/*`、`/kb/*`、`/product/*`、`/ops/*` 等前缀。\n\n## 二、导出面\n\n```js\n// 主入口(. 桶):工作台主壳 + 订阅 / 项目域 + 公共设施\nimport ZTeamApp, {SubscribeApp, ProjectApp, history, isTokenExpired, ComponentDocPage}\n from '@yuku123/z-team-component'\n\n// 宿主组装面(./pages 桶):路由清单 + 菜单\nimport {routes, appMeta, menuItems, ComponentDocPage} from '@yuku123/z-team-component/pages'\n```\n\n- `routes`:`/team/subscribe`、`/team/project`、`/team/docs`、`/team/:rest*`(兜底)。\n- `appMeta`:`{ title: 'z-team 团队工作台', short: 'team' }`。\n- `ComponentDocPage`:组件文档页,**主入口与 `./pages` 桶都具名导出**(名字全仓统一,主壳按这个名字取)。\n\n## 三、API 端点\n\n请求实例由 `src/common/services/api.js` 的 axios 工厂创建:`baseURL = '/api'`(可用 `configureBaseURL()` 改),\n`timeout = 15000`,`withCredentials = true`(**Cookie 模式,不设 Authorization Header**)。\n下表路径是 `src/common/services/`、`src/services/`、`src/subscribe/services/`、`src/project/services/` 里\n**实际调用**的路径(已补上 `/api` 前缀)。\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| POST | `/api/ctc/authn/login` | 登录 |\n| GET | `/api/ctc/authn/my-tenants` | 我的租户 |\n| POST | `/api/ctc/authn/select-tenant` | 选择租户 |\n| POST | `/api/ctc/authn/switch-tenant` | 切换租户 |\n| GET | `/api/ctc/app-menu/tree` | 应用菜单树 |\n| GET/POST | `/api/ctc/ac/invitations`、`/accept`、`/redeem`、`/leave` | 邀请(加入 / 兑换 / 退出) |\n| GET/POST | `/api/ctc/ac/invitations/members`、`/members/{memberId}/remove`、`/{id}/revoke` | 邀请成员管理 |\n| GET/POST/PUT/DELETE | `/api/agent/team/workspace`、`/workspace/{id}` | Agent 团队工作区 |\n| GET | `/api/agent/team/workspace/list`、`/file-tree-by-path`、`/file-content` | 工作区列表 / 文件树 / 文件内容 |\n| GET/POST/PUT/DELETE | `/api/agent/team/work-item`、`/work-item/{id}` | 工作项 |\n| GET | `/api/agent/team/conversation/{conversationId}/work-items` | 会话下的工作项 |\n| POST | `/api/agent/skill/register`、`/heartbeat`、`/pull`、`/sync-logs` | 技能注册 / 心跳 / 拉取 / 日志回传 |\n| POST/GET | `/api/agent/skill/bind`、`/unbind`、`/bindings` | 技能绑定 |\n| GET/POST/DELETE | `/api/agent/instance/list`、`/get`、`/create`、`/create-container`、`/create-external`、`/destroy-container`、`/destroy-local-process`、`/agent-types`、`/health`、`/status` | Agent 实例(容器 / 外部 / 本地进程) |\n| POST/GET | `/api/bot/feedback`、`/feedback/recent`、`/feedback/score` | Bot 反馈 |\n| GET | `/api/skill/get`、`/api/skill/page` | 技能查询 |\n| GET/POST | `/api/task`、`/task/list`、`/task/complete`、`/task/move`、`/task/project/list` | 任务 |\n| GET/POST | `/api/project`、`/api/project/archive`、`/api/project/user/list` | 项目 |\n| GET/POST/PUT/DELETE | `/api/mock-platform/{environments,endpoints,scenarios,cases,recordings,...}` | Mock 平台(`z-script-web` 的 `MockPlatformController`) |\n| GET | `/api/{name}/list`、`/api/{name}/page`、`/api/{name}/byId` | 通用 CRUD 工厂(`makeApi(name)`,`src/common/services/api.js`) |\n\n各服务模块另有自己的探活端点(`/api/agentTeam/health`、`/api/ctcAc/health`、`/api/ctcAcDomain/health`、\n`/api/ctcSurl/health`、`/api/ctcUser/health`、`/api/job/health`、`/api/metaApp/health`、\n`/api/privateConfig/health`、`/api/webide/health`)。\n\n## 四、页面说明\n\n### 4.1 工作台(`src/zteam/pages/workspace/`)\n\n工作台是本包最大的域,含 `Layout`(顶栏 + 模式切换 + 内容区)、`ProductWorkbench` / `SmartWorkbench` /\n`DevWorkbench` / `OpsWorkbench` 等工作台壳,以及聊天、笔记、代码编辑、知识图谱等通用组件。\n\n### 4.2 套件聚合壳(`SystemShell`)\n\n工作台的「系统」模式用它把 z-opc 业务页面(账号 / 角色 / 应用 / 租户 / 组织 / 权限 / 短链 / 字典 / 审计 /\nwebide / Agent / LLM / MCP / 技能 / OSS / 任务 / 流程 / 调度 / 密钥 / 运维 等)渲染进工作台右侧内容区,\n而不是回到 z-opc 旧 Layout。\n\n### 4.3 订阅域(`src/subscribe/pages/`)\n\n`SubscribeApp` + `SubscriptionList` / `SubscriptionEdit` / `RunHistory`:订阅的列表、编辑与运行历史。\n\n### 4.4 项目域(`src/project/pages/`)\n\n`ProjectApp` + `ProjectList` / `ProjectCreate` / `ProjectDetail`:项目的列表、创建与详情。\n\n### 4.5 组件文档\n\n本文件。内容以 `?raw` 在编译期内联,零额外请求;左侧 240px TOC 随滚动联动。\n渲染用基座的 `ComponentDoc`(`@yuku123/z-frontend-common/ui`),不在本包重写 TOC / 两栏 / 滚动联动。\n\n## 五、配置\n\n| 配置项 | 默认值 | 说明 |\n|---|---|---|\n| `configureBaseURL(baseURL)` | `'/api'` | 改写 axios `baseURL`(`src/common/services/api.js`) |\n| 请求 `timeout` | `15000` | axios 实例默认值 |\n| `withCredentials` | `true` | Cookie 模式;**不设 Authorization Header** |\n| vite `external` | 25 个精确包 + 4 条前缀规则 | `react` / `react-dom` / `antd` / `@ant-design/icons` / `@yuku123/*` / `@zopc-mock/*` / `echarts/*` / `highlight.js/*` 等一律 external,**消费方必须自备** |\n| vite alias | `@` → `src/`、`@zteam` → `src/zteam/` | 仅 standalone 构建用;打包后路径已解析 |\n| 模式 URL 参数 | `?mode=xxx` | 持久化在 query 上;`collaboration` 是默认值,不写入 URL |\n| `?desktop=1` | — | 强制桌面版工作台(窄视口默认跳 `/workspace/phone`) |\n\n## 六、已知限制\n\n- **`/team/docs` 目前没有可达路径**:主壳 `z-opc-main-starter-frontend/src/domainRoutes.ts` 的 `DOMAINS` 数组里\n **没有注册 z-team 域**(截至 2026-10-23),所以 z-team 的 `routes` 清单还没有被主壳消费。\n ⇒ 需要主控决定是否接线(注册 z-team 域,或在主壳里显式挂 `ComponentDocPage`)。\n- **`ZTeamApp` 内部没有 `/team/docs` 分支**:它按**绝对 pathname** 分发(`/workspace`、`/scenario`、`/docs` …),\n 未知路径兜底渲染工作台。所以即使走了 `/team/:rest*` 兜底路由,`/team/docs` 也会落进工作台而不是文档页。\n (`ZTeamApp` 不在本批次的改动范围内,需要单独接线。)\n- **已有另一个「文档页」**:`src/zteam/pages/docs/index.tsx` 是 52KB 的手写暗色主题**操作手册**页,\n 路由是 `/docs`。它与本 §7 的**组件文档页**不是一回事(内容、样式、来源都不同),别混淆。\n- **本仓没有 `tsconfig.json`,构建不做类型检查**(`npm run build` = `vite build` + 产物守卫脚本)。\n 基座只发 JS 不发 `.d.ts`,`src/z-frontend-common-ui.d.ts` 是手写的最小声明;\n 新增基座组件时要同步补声明(当前该声明文件里**还没有** `ComponentDoc`,因为本包的文档页走的是 `.jsx`,不参与类型检查)。\n- **组件包必须 external 基座**:`@yuku123/z-frontend-common/ui` 在 dist 里保持裸 import,\n 消费方(主壳)必须自己装基座,否则会出现两份 UI 主题。\n- **工作台下的部分工作台壳仍在改造中**(`ProductWorkbench` / `SmartWorkbench` 等),页面结构可能继续变,\n 本文档只描述到「域 + 顶层路由 + 模式」这一层,域内二级页面未逐页展开。\n- **请求是 Cookie 模式**:后端 `SsoInterceptor` 靠 `Accept` / `Content-Type` 判断「是不是 API 请求」,\n 裸 `fetch` 不带 `Accept` 会被当成页面访问而 302 跳登录页(构建产物有 `guard-fetch-accept.mjs` 守卫)。\n\n## 七、变更记录\n\n| 版本 | 变更 |\n|---|---|\n| 0.2.30(未发布) | 新增组件文档页 `ComponentDocPage`(lead 008 §7):`src/DOC.md` + 基座 `ComponentDoc` 薄包装 + 菜单末项 `/team/docs` |\n| 0.2.30 | 工作台模式体系(13 种 `ChatMode`)+ `SystemShell` 套件聚合 + 订阅 / 项目双域 |\n";
3816
+ function cr() {
3817
+ return /* @__PURE__ */ e(Gt, { markdown: Fn, title: "组件文档 — z-team" });
3818
+ }
3816
3819
  export {
3817
- rn as C,
3820
+ cr as C,
3818
3821
  Be as E,
3819
- Ir as M,
3820
- nn as O,
3821
- jr as P,
3822
- br as R,
3823
- Mr as S,
3824
- fr as T,
3825
- Wr as Z,
3826
- Zr as a,
3827
- qe as b,
3828
- tn as c,
3829
- Yr as d,
3830
- wr as e,
3831
- yr as f,
3832
- Ge as g,
3833
- Qr as h,
3834
- lr as i,
3835
- ln as j,
3836
- an as k,
3837
- N as r,
3838
- or as s
3822
+ Sn as M,
3823
+ sr as O,
3824
+ Kn as P,
3825
+ wn as R,
3826
+ Dn as S,
3827
+ xn as T,
3828
+ Qn as Z,
3829
+ er as a,
3830
+ lr as b,
3831
+ je as c,
3832
+ ar as d,
3833
+ tr as e,
3834
+ In as f,
3835
+ fn as g,
3836
+ Ge as h,
3837
+ ln as i,
3838
+ nr as j,
3839
+ ir as k,
3840
+ or as l,
3841
+ $ as r,
3842
+ dn as s
3839
3843
  };