@qfei-design/make-app-approval 0.2.16 → 0.2.17

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.
package/dist/detail.mjs CHANGED
@@ -1,278 +1,281 @@
1
- import { jsx as i, jsxs as d, Fragment as Oe } from "react/jsx-runtime";
2
- import { useState as k, useRef as L, useEffect as x, useId as be } from "react";
3
- import { ApprovalStatus as ge } from "./react.mjs";
4
- import { isApprovalSystemField as Re } from "./index.mjs";
5
- const w = (e) => !!e && typeof e == "object" && !Array.isArray(e), E = (e) => typeof e == "string" && e.trim().length > 0, De = ["APPROVE", "REJECT", "RETURN", "SUBMIT"], B = (e) => {
1
+ import { jsx as l, jsxs as p, Fragment as De } from "react/jsx-runtime";
2
+ import { u as ge } from "./theme-qxOS-jIA.js";
3
+ import { useState as b, useRef as J, useEffect as M, useId as we } from "react";
4
+ import { ApprovalStatus as Ee } from "./react.mjs";
5
+ import { isApprovalSystemField as je } from "./index.mjs";
6
+ const I = (e) => !!e && typeof e == "object" && !Array.isArray(e), N = (e) => typeof e == "string" && e.trim().length > 0, qe = ["APPROVE", "REJECT", "RETURN", "SUBMIT"], K = (e) => {
6
7
  if (e === void 0) return [];
7
- if (!w(e)) throw new Error("审批字段权限格式无效");
8
+ if (!I(e)) throw new Error("审批字段权限格式无效");
8
9
  if (e.scope === "NONE" && e.fields === void 0) return [];
9
- if (e.scope !== "FIELDS" || !Array.isArray(e.fields) || !e.fields.every(E) || new Set(e.fields).size !== e.fields.length)
10
+ if (e.scope !== "FIELDS" || !Array.isArray(e.fields) || !e.fields.every(N) || new Set(e.fields).size !== e.fields.length)
10
11
  throw new Error("审批字段权限范围无效");
11
12
  return e.fields;
12
- }, ve = (e) => w(e) && E(e.key) && E(e.label) && (e.required === void 0 || typeof e.required == "boolean") && (e.fullWidth === void 0 || typeof e.fullWidth == "boolean") && (e.schema === void 0 || w(e.schema)), Pe = (e) => {
13
- if (!w(e) || !De.some((o) => o === e.actionType) || e.commentPolicy !== "REQUIRED" && e.commentPolicy !== "OPTIONAL")
13
+ }, Ie = (e) => I(e) && N(e.key) && N(e.label) && (e.required === void 0 || typeof e.required == "boolean") && (e.fullWidth === void 0 || typeof e.fullWidth == "boolean") && (e.schema === void 0 || I(e.schema)), Fe = (e) => {
14
+ if (!I(e) || !qe.some((a) => a === e.actionType) || e.commentPolicy !== "REQUIRED" && e.commentPolicy !== "OPTIONAL")
14
15
  return !1;
15
16
  const t = e.returnTargets;
16
- return t === void 0 || Array.isArray(t) && t.every((o) => w(o) && E(o.nodeKey) && E(o.nodeName)) && new Set(t.map((o) => o.nodeKey)).size === t.length;
17
- }, we = (e) => {
18
- if (!w(e) || !E(e.taskId) || !E(e.processInstanceId) || !E(e.taskName) || !E(e.processStatus) || !Array.isArray(e.fields) || !e.fields.every(ve) || !w(e.formData))
17
+ return t === void 0 || Array.isArray(t) && t.every((a) => I(a) && N(a.nodeKey) && N(a.nodeName)) && new Set(t.map((a) => a.nodeKey)).size === t.length;
18
+ }, Ne = (e) => {
19
+ if (!I(e) || !N(e.taskId) || !N(e.processInstanceId) || !N(e.taskName) || !N(e.processStatus) || !Array.isArray(e.fields) || !e.fields.every(Ie) || !I(e.formData))
19
20
  throw new Error("审批详情数据不完整");
20
- const t = e.fields.map((l) => l.key);
21
+ const t = e.fields.map((s) => s.key);
21
22
  if (new Set(t).size !== t.length) throw new Error("审批字段标识重复");
22
- if (e.fieldPermission !== void 0 && !w(e.fieldPermission))
23
+ if (e.fieldPermission !== void 0 && !I(e.fieldPermission))
23
24
  throw new Error("审批字段权限格式无效");
24
- const o = e.fieldPermission, a = B(o?.viewPermission), c = B(o?.editPermission);
25
- if (a.some((l) => !t.includes(l)) || c.some((l) => !a.includes(l)))
25
+ const a = e.fieldPermission, o = K(a?.viewPermission), i = K(a?.editPermission);
26
+ if (o.some((s) => !t.includes(s)) || i.some((s) => !o.includes(s)))
26
27
  throw new Error("审批字段元数据或权限不一致");
27
- const s = e.actions ?? [];
28
- if (!Array.isArray(s) || !s.every(Pe) || new Set(s.map((l) => l.actionType)).size !== s.length)
28
+ const n = e.actions ?? [];
29
+ if (!Array.isArray(n) || !n.every(Fe) || new Set(n.map((s) => s.actionType)).size !== n.length)
29
30
  throw new Error("审批操作配置无效");
30
- const h = e.summary;
31
+ const c = e.summary;
31
32
  return {
32
33
  taskId: e.taskId,
33
34
  processInstanceId: e.processInstanceId,
34
35
  taskName: e.taskName,
35
- ...w(h) && ["title", "applicantName", "applicationTime"].every((l) => typeof h[l] == "string") ? { summary: { title: String(h.title), applicantName: String(h.applicantName), applicationTime: String(h.applicationTime) } } : {},
36
+ ...I(c) && ["title", "applicantName", "applicationTime"].every((s) => typeof c[s] == "string") ? { summary: { title: String(c.title), applicantName: String(c.applicantName), applicationTime: String(c.applicationTime) } } : {},
36
37
  processStatus: e.processStatus,
37
38
  fields: e.fields,
38
39
  formData: e.formData,
39
- actions: s,
40
+ actions: n,
40
41
  fieldPermission: {
41
- viewPermission: { scope: "FIELDS", fields: a },
42
- editPermission: { scope: "FIELDS", fields: c }
42
+ viewPermission: { scope: "FIELDS", fields: o },
43
+ editPermission: { scope: "FIELDS", fields: i }
43
44
  }
44
45
  };
45
- }, K = (e) => {
46
+ }, x = (e) => {
46
47
  const t = new Set(
47
- B(e.fieldPermission?.viewPermission)
48
- ), o = new Set(
49
- B(e.fieldPermission?.editPermission)
48
+ K(e.fieldPermission?.viewPermission)
49
+ ), a = new Set(
50
+ K(e.fieldPermission?.editPermission)
50
51
  );
51
- return e.fields.filter((a) => t.has(a.key)).map((a) => ({
52
- ...a,
53
- editable: o.has(a.key) && !Re(a.key)
52
+ return e.fields.filter((o) => t.has(o.key)).map((o) => ({
53
+ ...o,
54
+ editable: a.has(o.key) && !je(o.key)
54
55
  }));
55
56
  };
56
- class v extends Error {
57
- constructor(t, o = {}, a) {
58
- super(t), this.fieldErrors = o, this.control = a, this.name = "ApprovalTaskValidationError";
57
+ class E extends Error {
58
+ constructor(t, a = {}, o) {
59
+ super(t), this.fieldErrors = a, this.control = o, this.name = "ApprovalTaskValidationError";
59
60
  }
60
61
  fieldErrors;
61
62
  control;
62
63
  }
63
- const H = (e) => e.actionType === "RETURN" || e.actionType === "REJECT" || e.actionType === "SUBMIT" && e.commentPolicy === "REQUIRED", je = (e, t) => Object.fromEntries(
64
- e.filter((o) => {
65
- const a = t[o.key];
66
- return a == null || typeof a == "string" && !a.trim() || Array.isArray(a) && a.length === 0;
67
- }).map((o) => [o.key, `请填写${o.label}`])
68
- ), fe = (e, t, o, a, c = "") => {
69
- const s = e.actions.find((p) => p.actionType === t);
70
- if (!s)
71
- throw new v("当前节点不允许此操作,请刷新详情");
72
- const h = t === "RETURN" ? {} : o, l = new Set(
73
- K(e).filter((p) => p.editable).map((p) => p.key)
64
+ const Y = (e) => e.actionType === "RETURN" || e.actionType === "REJECT" || e.actionType === "SUBMIT" && e.commentPolicy === "REQUIRED", Ce = (e, t) => Object.fromEntries(
65
+ e.filter((a) => {
66
+ const o = t[a.key];
67
+ return o == null || typeof o == "string" && !o.trim() || Array.isArray(o) && o.length === 0;
68
+ }).map((a) => [a.key, `请填写${a.label}`])
69
+ ), ke = (e, t, a, o, i = "") => {
70
+ const n = e.actions.find((h) => h.actionType === t);
71
+ if (!n)
72
+ throw new E("当前节点不允许此操作,请刷新详情");
73
+ const c = t === "RETURN" ? {} : a, s = new Set(
74
+ x(e).filter((h) => h.editable).map((h) => h.key)
74
75
  );
75
- if (Object.keys(h).some((p) => !l.has(p)))
76
- throw new v("字段权限已变化,请重新加载详情");
77
- if (H(s) && !a.trim())
78
- throw new v("请填写审批意见", {}, "comment");
79
- if (a.length > 1024)
80
- throw new v("审批意见不能超过 1024 个字符", {}, "comment");
81
- const n = t === "RETURN" && s.returnTargets?.length === 1 ? s.returnTargets[0] : void 0;
82
- if (t === "RETURN" && !n)
83
- throw new v(
84
- s.returnTargets?.length ? "退回目标配置不唯一,请联系管理员检查流程配置" : "退回目标配置缺失,请联系管理员检查流程配置"
76
+ if (Object.keys(c).some((h) => !s.has(h)))
77
+ throw new E("字段权限已变化,请重新加载详情");
78
+ if (Y(n) && !o.trim())
79
+ throw new E("请填写审批意见", {}, "comment");
80
+ if (o.length > 1024)
81
+ throw new E("审批意见不能超过 1024 个字符", {}, "comment");
82
+ const y = t === "RETURN" && n.returnTargets?.length === 1 ? n.returnTargets[0] : void 0;
83
+ if (t === "RETURN" && !y)
84
+ throw new E(
85
+ n.returnTargets?.length ? "退回目标配置不唯一,请联系管理员检查流程配置" : "退回目标配置缺失,请联系管理员检查流程配置"
85
86
  );
86
- if (n && c && c !== n.nodeKey)
87
- throw new v("退回目标与当前节点配置不一致,请重新加载详情");
87
+ if (y && i && i !== y.nodeKey)
88
+ throw new E("退回目标与当前节点配置不一致,请重新加载详情");
88
89
  return {
89
90
  taskId: e.taskId,
90
91
  processInstanceId: e.processInstanceId,
91
92
  actionType: t,
92
- comment: a.trim(),
93
- recordPatch: { ...h },
94
- ...n ? { targetNodeKey: n.nodeKey } : {}
93
+ comment: o.trim(),
94
+ recordPatch: { ...c },
95
+ ...y ? { targetNodeKey: y.nodeKey } : {}
95
96
  };
96
- }, f = (e, t) => {
97
+ }, u = (e, t) => {
97
98
  try {
98
99
  e ? e(t) : t.phase === "error" ? console.warn("[make-app-approval]", t) : console.info("[make-app-approval]", t);
99
100
  } catch {
100
101
  console.warn("[make-app-approval] diagnostic sink failed");
101
102
  }
102
- }, X = (e, t) => {
103
+ }, Z = (e, t) => {
103
104
  if (Object.is(e, t)) return !0;
104
105
  if (e instanceof Date && t instanceof Date)
105
106
  return Object.is(e.getTime(), t.getTime());
106
107
  if (Array.isArray(e) || Array.isArray(t))
107
- return Array.isArray(e) && Array.isArray(t) && e.length === t.length && e.every((c, s) => X(c, t[s]));
108
+ return Array.isArray(e) && Array.isArray(t) && e.length === t.length && e.every((i, n) => Z(i, t[n]));
108
109
  if (!e || !t || typeof e != "object" || typeof t != "object" || ![Object.prototype, null].includes(Object.getPrototypeOf(e)) || ![Object.prototype, null].includes(Object.getPrototypeOf(t))) return !1;
109
- const o = e, a = t;
110
- return Object.keys(o).length === Object.keys(a).length && Object.keys(o).every((c) => Object.hasOwn(a, c) && X(o[c], a[c]));
111
- }, G = {
110
+ const a = e, o = t;
111
+ return Object.keys(a).length === Object.keys(o).length && Object.keys(a).every((i) => Object.hasOwn(o, i) && Z(a[i], o[i]));
112
+ }, X = {
112
113
  APPROVE: "同意",
113
114
  REJECT: "拒绝",
114
115
  RETURN: "退回修改",
115
116
  SUBMIT: "继续提交"
116
- }, Y = (e, t) => e.taskId === t.reference.taskId && e.processInstanceId === t.reference.processInstanceId, qe = ({
117
+ }, _ = (e, t) => e.taskId === t.reference.taskId && e.processInstanceId === t.reference.processInstanceId, $e = ({
117
118
  title: e,
118
119
  actions: t,
119
- content: o,
120
- footer: a
121
- }) => /* @__PURE__ */ d("section", { className: "make-app-approval-detail", "aria-label": "审批详情", children: [
122
- /* @__PURE__ */ d("header", { className: "make-app-approval-detail-header", children: [
120
+ content: a,
121
+ footer: o,
122
+ themeStyle: i,
123
+ presentation: n
124
+ }) => /* @__PURE__ */ p("section", { className: "make-app-approval-detail", "aria-label": "审批详情", style: i, "data-make-approval-theme": i ? n : void 0, "data-make-approval-presentation": n === "mobile" ? "mobile" : void 0, children: [
125
+ /* @__PURE__ */ p("header", { className: "make-app-approval-detail-header", children: [
123
126
  e,
124
127
  t
125
128
  ] }),
126
- /* @__PURE__ */ i("div", { className: "make-app-approval-detail-content", children: o }),
127
- a && /* @__PURE__ */ i("footer", { className: "make-app-approval-detail-footer", children: a })
128
- ] }), ue = (e) => /* @__PURE__ */ d("div", { className: "make-app-approval-detail-title", children: [
129
- /* @__PURE__ */ i("h2", { children: "审批详情" }),
130
- e && /* @__PURE__ */ i(ge, { value: e })
131
- ] }), Fe = (e) => {
132
- const [t, o] = k(0), [a, c] = k(), s = L(e);
133
- s.current = e, x(() => {
134
- const l = new AbortController(), n = s.current;
135
- return f(n.logger, { operation: "detail", phase: "start" }), (async () => {
129
+ /* @__PURE__ */ l("div", { className: "make-app-approval-detail-content", children: a }),
130
+ o && /* @__PURE__ */ l("footer", { className: "make-app-approval-detail-footer", children: o })
131
+ ] }), be = (e, t, a) => /* @__PURE__ */ p("div", { className: "make-app-approval-detail-title", style: a, "data-make-approval-theme": a ? t : void 0, "data-make-approval-presentation": t === "mobile" ? "mobile" : void 0, children: [
132
+ /* @__PURE__ */ l("h2", { children: "审批详情" }),
133
+ e && /* @__PURE__ */ l(Ee, { value: e, presentation: t })
134
+ ] }), Be = (e) => {
135
+ const [t, a] = b(0), [o, i] = b(), n = J(e);
136
+ n.current = e, M(() => {
137
+ const s = new AbortController(), y = n.current;
138
+ return u(y.logger, { operation: "detail", phase: "start" }), (async () => {
136
139
  try {
137
- if (await Promise.resolve(), l.signal.aborted) return;
138
- const p = we(
139
- await n.provider.loadDetail(n.reference, {
140
- signal: l.signal
140
+ if (await Promise.resolve(), s.signal.aborted) return;
141
+ const h = Ne(
142
+ await y.provider.loadDetail(y.reference, {
143
+ signal: s.signal
141
144
  })
142
145
  );
143
- if (l.signal.aborted) return;
144
- if (!Y(p, n))
146
+ if (s.signal.aborted) return;
147
+ if (!_(h, y))
145
148
  throw new Error("Task identity mismatch");
146
- c({ revision: t, detail: p }), f(n.logger, { operation: "detail", phase: "success" });
147
- } catch (p) {
148
- if (l.signal.aborted) return;
149
- c({ revision: t, error: !0 }), f(n.logger, { operation: "detail", phase: "error" }), n.onRequestError?.(p, {
149
+ i({ revision: t, detail: h }), u(y.logger, { operation: "detail", phase: "success" });
150
+ } catch (h) {
151
+ if (s.signal.aborted) return;
152
+ i({ revision: t, error: !0 }), u(y.logger, { operation: "detail", phase: "error" }), y.onRequestError?.(h, {
150
153
  operation: "detail",
151
154
  resultUnknown: !1,
152
155
  message: "审批详情加载失败,请重新加载详情"
153
156
  });
154
157
  }
155
158
  })(), () => {
156
- l.abort(), f(n.logger, { operation: "detail", phase: "cancel" });
159
+ s.abort(), u(y.logger, { operation: "detail", phase: "cancel" });
157
160
  };
158
161
  }, [t]);
159
- const h = a?.revision === t ? a : void 0;
160
- return /* @__PURE__ */ i(
161
- Ce,
162
+ const c = o?.revision === t ? o : void 0;
163
+ return /* @__PURE__ */ l(
164
+ Ue,
162
165
  {
163
166
  ...e,
164
- data: h?.detail,
165
- loadError: h?.error === !0,
166
- reload: () => o((l) => l + 1)
167
+ data: c?.detail,
168
+ loadError: c?.error === !0,
169
+ reload: () => a((s) => s + 1)
167
170
  },
168
171
  t
169
172
  );
170
- }, Ce = (e) => {
173
+ }, Ue = (e) => {
171
174
  const {
172
- components: { Button: t, TextArea: o },
173
- renderField: a,
174
- reload: c
175
- } = e, s = be(), [h, l] = k(), n = h ?? e.data, [p, j] = k({}), [q, I] = k(), [F, y] = k(""), [b, T] = k({}), [C, S] = k(""), [Z, J] = k(""), [M, Ee] = k(), [O, _] = k(!1), [R, Ie] = k(!1), V = L(!1), z = L(new AbortController());
176
- x(() => (z.current = new AbortController(), () => z.current.abort()), []);
177
- const ee = n ? K(n) : [], te = n?.actions.find((r) => r.actionType === q), re = te ? H(te) : !1, ae = n?.actions.filter(H) ?? [], ne = O || R, oe = e.renderLayout ?? qe;
178
- x(() => {
179
- M && document.getElementById(`${s}-${M.key}`)?.focus();
180
- }, [M, s]);
181
- const se = async (r) => {
182
- if (!n || V.current || R) return;
183
- I(r), J(""), V.current = !0, _(!0), S(""), T({});
184
- const g = z.current.signal;
185
- let A = !1;
186
- f(e.logger, {
175
+ components: { Button: t, TextArea: a },
176
+ renderField: o,
177
+ reload: i
178
+ } = e, n = we(), c = ge(e.presentation ?? "desktop"), s = { style: c.style, "data-make-approval-theme": c.style ? c.presentation : void 0, "data-make-approval-presentation": c.presentation === "mobile" ? "mobile" : void 0 }, [y, h] = b(), d = y ?? e.data, [w, F] = b({}), [C, A] = b(), [$, f] = b(""), [v, O] = b({}), [B, R] = b(""), [ee, V] = b(""), [z, Ae] = b(), [P, te] = b(!1), [D, Te] = b(!1), W = J(!1), Q = J(new AbortController());
179
+ M(() => (Q.current = new AbortController(), () => Q.current.abort()), []);
180
+ const re = d ? x(d) : [], ae = d?.actions.find((r) => r.actionType === C), oe = ae ? Y(ae) : !1, ne = d?.actions.filter(Y) ?? [], se = P || D, ie = e.renderLayout ?? $e;
181
+ M(() => {
182
+ z && document.getElementById(`${n}-${z.key}`)?.focus();
183
+ }, [z, n]);
184
+ const le = async (r) => {
185
+ if (!d || W.current || D) return;
186
+ A(r), V(""), W.current = !0, te(!0), R(""), O({});
187
+ const g = Q.current.signal;
188
+ let T = !1;
189
+ u(e.logger, {
187
190
  operation: "action",
188
191
  phase: "start",
189
192
  actionType: r
190
193
  });
191
194
  try {
192
- fe(n, r, p, F);
193
- const m = we(
195
+ ke(d, r, w, $);
196
+ const m = Ne(
194
197
  await e.provider.loadDetail(e.reference, { signal: g })
195
198
  );
196
199
  if (g.aborted) return;
197
- if (!Y(m, e)) throw new Error("Task identity mismatch");
198
- const D = K(n), W = K(m);
199
- if (JSON.stringify(D) !== JSON.stringify(W) || JSON.stringify(n.actions) !== JSON.stringify(m.actions)) {
200
- l(m), j({}), I(void 0), y(""), S("当前节点的字段或操作权限已变化,请核对后重新操作"), f(e.logger, {
200
+ if (!_(m, e)) throw new Error("Task identity mismatch");
201
+ const j = x(d), G = x(m);
202
+ if (JSON.stringify(j) !== JSON.stringify(G) || JSON.stringify(d.actions) !== JSON.stringify(m.actions)) {
203
+ h(m), F({}), A(void 0), f(""), R("当前节点的字段或操作权限已变化,请核对后重新操作"), u(e.logger, {
201
204
  operation: "action",
202
205
  phase: "skip",
203
206
  actionType: r
204
207
  });
205
208
  return;
206
209
  }
207
- const pe = W.filter(
208
- (u) => !X(n.formData[u.key], m.formData[u.key])
210
+ const ye = G.filter(
211
+ (k) => !Z(d.formData[k.key], m.formData[k.key])
209
212
  );
210
- if (pe.length) {
211
- const u = new Set(pe.map((P) => P.key)), Q = Object.keys(p).some((P) => u.has(P));
212
- l(m), j(Object.fromEntries(Object.entries(p).filter(([P]) => !u.has(P)))), I(void 0), S(Q ? "申请内容已更新,冲突字段的本地修改已清除,其他修改已保留,请核对后重新操作" : "申请内容已更新,您的修改已保留,请核对后重新操作"), f(e.logger, { operation: "action", phase: "skip", actionType: r });
213
+ if (ye.length) {
214
+ const k = new Set(ye.map((q) => q.key)), H = Object.keys(w).some((q) => k.has(q));
215
+ h(m), F(Object.fromEntries(Object.entries(w).filter(([q]) => !k.has(q)))), A(void 0), R(H ? "申请内容已更新,冲突字段的本地修改已清除,其他修改已保留,请核对后重新操作" : "申请内容已更新,您的修改已保留,请核对后重新操作"), u(e.logger, { operation: "action", phase: "skip", actionType: r });
213
216
  return;
214
217
  }
215
- const $ = r === "RETURN" ? [] : W.filter(
216
- (u) => u.editable && u.required === !0
217
- ), me = Object.fromEntries(
218
- $.map((u) => [
219
- u.key,
220
- Object.hasOwn(p, u.key) ? p[u.key] : m.formData[u.key]
218
+ const U = r === "RETURN" ? [] : G.filter(
219
+ (k) => k.editable && k.required === !0
220
+ ), he = Object.fromEntries(
221
+ U.map((k) => [
222
+ k.key,
223
+ Object.hasOwn(w, k.key) ? w[k.key] : m.formData[k.key]
221
224
  ])
222
- ), he = je(
223
- $,
224
- me
225
+ ), fe = Ce(
226
+ U,
227
+ he
225
228
  );
226
- if (Object.keys(he).length)
227
- throw new v(
229
+ if (Object.keys(fe).length)
230
+ throw new E(
228
231
  "请检查表单中标红的字段",
229
- he
232
+ fe
230
233
  );
231
- const Te = $.length ? await e.validateFields({
232
- fields: $,
233
- values: me,
234
+ const Re = U.length ? await e.validateFields({
235
+ fields: U,
236
+ values: he,
234
237
  actionType: r,
235
238
  signal: g
236
239
  }) : {};
237
240
  if (g.aborted) return;
238
- const ye = Object.fromEntries(
239
- Object.entries(Te).filter(
240
- ([u, Q]) => $.some((P) => P.key === u) && !!Q
241
+ const ue = Object.fromEntries(
242
+ Object.entries(Re).filter(
243
+ ([k, H]) => U.some((q) => q.key === k) && !!H
241
244
  )
242
245
  );
243
- if (Object.keys(ye).length)
244
- throw new v(
246
+ if (Object.keys(ue).length)
247
+ throw new E(
245
248
  "请检查表单中标红的字段",
246
- ye
249
+ ue
247
250
  );
248
- const Se = fe(
251
+ const Pe = ke(
249
252
  m,
250
253
  r,
251
- p,
252
- F
254
+ w,
255
+ $
253
256
  );
254
- A = !0;
255
- const N = await e.provider.submitAction(Se, { signal: g });
257
+ T = !0;
258
+ const S = await e.provider.submitAction(Pe, { signal: g });
256
259
  if (g.aborted) return;
257
- if (!N || !Y(N, e) || N.actionType !== r || typeof N.processEnded != "boolean" || typeof N.processStatus != "string" || !N.processStatus.trim())
260
+ if (!S || !_(S, e) || S.actionType !== r || typeof S.processEnded != "boolean" || typeof S.processStatus != "string" || !S.processStatus.trim())
258
261
  throw new Error("Action result mismatch");
259
- Ie(!0), I(void 0), l({ ...m, processStatus: N.processStatus }), S("处理成功"), f(e.logger, {
262
+ Te(!0), A(void 0), h({ ...m, processStatus: S.processStatus }), R("处理成功"), u(e.logger, {
260
263
  operation: "action",
261
264
  phase: "success",
262
265
  actionType: r
263
- }), f(e.logger, {
266
+ }), u(e.logger, {
264
267
  operation: "notify",
265
268
  phase: "start",
266
269
  actionType: r
267
270
  });
268
271
  try {
269
- await e.onActionSuccess(N), f(e.logger, {
272
+ await e.onActionSuccess(S), u(e.logger, {
270
273
  operation: "notify",
271
274
  phase: "success",
272
275
  actionType: r
273
276
  });
274
277
  } catch {
275
- g.aborted || S("处理已成功,但页面刷新未完成,请刷新列表确认"), f(e.logger, {
278
+ g.aborted || R("处理已成功,但页面刷新未完成,请刷新列表确认"), u(e.logger, {
276
279
  operation: "notify",
277
280
  phase: "error",
278
281
  actionType: r
@@ -280,80 +283,83 @@ const H = (e) => e.actionType === "RETURN" || e.actionType === "REJECT" || e.act
280
283
  }
281
284
  } catch (m) {
282
285
  if (g.aborted) return;
283
- if (!A && m instanceof v) {
284
- T(m.fieldErrors);
285
- const D = m.control === "comment" ? "comment" : Object.keys(m.fieldErrors)[0];
286
- D && Ee({ key: D }), m.control === "comment" ? J(m.message) : Object.keys(m.fieldErrors).length || S(m.message);
286
+ if (!T && m instanceof E) {
287
+ O(m.fieldErrors);
288
+ const j = m.control === "comment" ? "comment" : Object.keys(m.fieldErrors)[0];
289
+ j && Ae({ key: j }), m.control === "comment" ? V(m.message) : Object.keys(m.fieldErrors).length || R(m.message);
287
290
  } else {
288
- I(void 0);
289
- const D = A ? "操作结果尚未确认,再次操作前将重新核查任务状态" : "审批信息或字段校验暂不可用,请稍后再次操作";
291
+ A(void 0);
292
+ const j = T ? "操作结果尚未确认,再次操作前将重新核查任务状态" : "审批信息或字段校验暂不可用,请稍后再次操作";
290
293
  e.onRequestError ? e.onRequestError(m, {
291
294
  operation: "action",
292
- resultUnknown: A,
293
- message: D
294
- }) : S(D);
295
+ resultUnknown: T,
296
+ message: j
297
+ }) : R(j);
295
298
  }
296
- f(e.logger, {
299
+ u(e.logger, {
297
300
  operation: "action",
298
301
  phase: "error",
299
302
  actionType: r
300
303
  });
301
304
  } finally {
302
- V.current = !1, g.aborted ? f(e.logger, {
305
+ W.current = !1, g.aborted ? u(e.logger, {
303
306
  operation: "action",
304
307
  phase: "cancel",
305
308
  actionType: r
306
- }) : _(!1);
309
+ }) : te(!1);
307
310
  }
308
311
  };
309
- if (!n)
310
- return oe({
311
- title: ue(),
312
+ if (!d)
313
+ return ie({
314
+ title: be(void 0, c.presentation, c.style),
315
+ themeStyle: c.style,
316
+ presentation: c.presentation,
312
317
  actions: null,
313
318
  footer: null,
314
- content: e.loadError ? /* @__PURE__ */ d("div", { className: "make-app-approval-detail-section", role: e.onRequestError ? void 0 : "alert", children: [
319
+ content: e.loadError ? /* @__PURE__ */ p("div", { ...s, className: "make-app-approval-detail-section", role: e.onRequestError ? void 0 : "alert", children: [
315
320
  !e.onRequestError && "审批详情加载失败,请重试",
316
- /* @__PURE__ */ i(t, { htmlType: "button", variant: "default", onClick: c, children: "重新加载详情" })
317
- ] }) : /* @__PURE__ */ d("div", { className: "make-app-approval-detail-loading", role: "status", children: [
318
- /* @__PURE__ */ i("span", { className: "make-app-approval-loading-spinner", "aria-hidden": "true" }),
319
- /* @__PURE__ */ i("span", { children: "正在加载审批详情…" })
321
+ /* @__PURE__ */ l(t, { htmlType: "button", variant: "default", onClick: i, children: "重新加载详情" })
322
+ ] }) : /* @__PURE__ */ p("div", { ...s, className: "make-app-approval-detail-loading", role: "status", children: [
323
+ /* @__PURE__ */ l("span", { className: "make-app-approval-loading-spinner", "aria-hidden": "true" }),
324
+ /* @__PURE__ */ l("span", { children: "正在加载审批详情…" })
320
325
  ] })
321
326
  });
322
- const Ae = !R && n.actions.length > 0 ? /* @__PURE__ */ i("div", { className: "make-app-approval-detail-actions", "aria-label": "审批操作", children: n.actions.map((r) => /* @__PURE__ */ i(
327
+ const Se = !D && d.actions.length > 0 ? /* @__PURE__ */ l("div", { ...s, className: "make-app-approval-detail-actions", "aria-label": "审批操作", children: d.actions.map((r) => /* @__PURE__ */ l(
323
328
  t,
324
329
  {
325
330
  actionType: r.actionType,
326
331
  htmlType: "button",
327
332
  variant: r.actionType === "APPROVE" || r.actionType === "SUBMIT" ? "primary" : "default",
328
- disabled: O,
329
- loading: O && q === r.actionType,
333
+ disabled: P,
334
+ loading: P && C === r.actionType,
330
335
  onClick: () => {
331
- se(r.actionType);
336
+ le(r.actionType);
332
337
  },
333
- children: G[r.actionType]
338
+ children: X[r.actionType]
334
339
  },
335
340
  r.actionType
336
- )) }) : null, ie = /* @__PURE__ */ d(
341
+ )) }) : null, ce = /* @__PURE__ */ p(
337
342
  "section",
338
343
  {
344
+ ...s,
339
345
  className: "make-app-approval-detail-section",
340
346
  "aria-label": "申请信息",
341
347
  "data-presentation": e.presentation === "mobile" ? "mobile" : void 0,
342
348
  children: [
343
- /* @__PURE__ */ i("h3", { children: "申请信息" }),
344
- /* @__PURE__ */ d("div", { className: "make-app-approval-detail-fields", children: [
345
- ee.length === 0 && /* @__PURE__ */ i("p", { children: "当前节点未配置可见字段" }),
346
- ee.map((r) => /* @__PURE__ */ d(
349
+ /* @__PURE__ */ l("h3", { children: "申请信息" }),
350
+ /* @__PURE__ */ p("div", { className: "make-app-approval-detail-fields", children: [
351
+ re.length === 0 && /* @__PURE__ */ l("p", { children: "当前节点未配置可见字段" }),
352
+ re.map((r) => /* @__PURE__ */ p(
347
353
  "div",
348
354
  {
349
355
  className: "make-app-approval-detail-field",
350
- "data-invalid": !!b[r.key],
356
+ "data-invalid": !!v[r.key],
351
357
  "data-readonly": !r.editable,
352
358
  "data-full-width": !!r.fullWidth,
353
359
  children: [
354
- /* @__PURE__ */ d("label", { htmlFor: `${s}-${r.key}`, children: [
360
+ /* @__PURE__ */ p("label", { htmlFor: `${n}-${r.key}`, children: [
355
361
  e.renderFieldLabel?.(r) ?? r.label,
356
- r.required && r.editable ? /* @__PURE__ */ d(
362
+ r.required && r.editable ? /* @__PURE__ */ p(
357
363
  "span",
358
364
  {
359
365
  className: "make-app-approval-required",
@@ -365,27 +371,27 @@ const H = (e) => e.actionType === "RETURN" || e.actionType === "REJECT" || e.act
365
371
  }
366
372
  ) : null
367
373
  ] }),
368
- /* @__PURE__ */ d("div", { className: "make-app-approval-detail-value", children: [
369
- a({
374
+ /* @__PURE__ */ p("div", { className: "make-app-approval-detail-value", children: [
375
+ o({
370
376
  field: r,
371
- id: `${s}-${r.key}`,
372
- value: Object.hasOwn(p, r.key) ? p[r.key] : n.formData[r.key],
377
+ id: `${n}-${r.key}`,
378
+ value: Object.hasOwn(w, r.key) ? w[r.key] : d.formData[r.key],
373
379
  readOnly: !r.editable,
374
- disabled: ne,
375
- error: b[r.key],
376
- ...r.editable && !ne ? {
380
+ disabled: se,
381
+ error: v[r.key],
382
+ ...r.editable && !se ? {
377
383
  onChange: (g) => {
378
- j((A) => ({
379
- ...A,
384
+ F((T) => ({
385
+ ...T,
380
386
  [r.key]: g
381
- })), T((A) => {
382
- const m = { ...A };
387
+ })), O((T) => {
388
+ const m = { ...T };
383
389
  return delete m[r.key], m;
384
390
  });
385
391
  }
386
392
  } : {}
387
393
  }),
388
- b[r.key] && /* @__PURE__ */ i("p", { role: "alert", className: "make-app-approval-detail-error", children: b[r.key] })
394
+ v[r.key] && /* @__PURE__ */ l("p", { role: "alert", className: "make-app-approval-detail-error", children: v[r.key] })
389
395
  ] })
390
396
  ]
391
397
  },
@@ -394,80 +400,84 @@ const H = (e) => e.actionType === "RETURN" || e.actionType === "REJECT" || e.act
394
400
  ] })
395
401
  ]
396
402
  }
397
- ), le = C && /* @__PURE__ */ i(
403
+ ), de = B && /* @__PURE__ */ l(
398
404
  "p",
399
405
  {
400
- role: R ? "status" : "alert",
401
- className: `make-app-approval-detail-message${R ? "" : " make-app-approval-detail-error"}`,
402
- children: C
406
+ ...s,
407
+ role: D ? "status" : "alert",
408
+ className: `make-app-approval-detail-message${D ? "" : " make-app-approval-detail-error"}`,
409
+ children: B
403
410
  }
404
- ), ce = e.history != null && /* @__PURE__ */ d(
411
+ ), pe = e.history != null && /* @__PURE__ */ p(
405
412
  "section",
406
413
  {
414
+ ...s,
407
415
  className: "make-app-approval-detail-section make-app-approval-detail-history",
408
416
  "aria-label": "审批流程",
409
417
  children: [
410
- /* @__PURE__ */ i("h3", { children: "审批流程" }),
418
+ /* @__PURE__ */ l("h3", { children: "审批流程" }),
411
419
  e.history
412
420
  ]
413
421
  }
414
- ), Ne = /* @__PURE__ */ d("div", { className: "make-app-approval-detail-content", "aria-busy": O, children: [
415
- ie,
416
- le,
417
- ce
418
- ] }), de = !R && n.actions.length > 0 ? /* @__PURE__ */ d("div", { className: "make-app-approval-detail-section make-app-approval-detail-opinion", children: [
419
- /* @__PURE__ */ d("label", { htmlFor: `${s}-comment`, children: [
422
+ ), Oe = /* @__PURE__ */ p("div", { ...s, className: "make-app-approval-detail-content", "aria-busy": P, children: [
423
+ ce,
424
+ de,
425
+ pe
426
+ ] }), me = !D && d.actions.length > 0 ? /* @__PURE__ */ p("div", { ...s, className: "make-app-approval-detail-section make-app-approval-detail-opinion", children: [
427
+ /* @__PURE__ */ p("label", { htmlFor: `${n}-comment`, children: [
420
428
  "审批意见",
421
- re && /* @__PURE__ */ d("span", { className: "make-app-approval-required", "aria-label": "必填", children: [
429
+ oe && /* @__PURE__ */ p("span", { className: "make-app-approval-required", "aria-label": "必填", children: [
422
430
  " ",
423
431
  "*"
424
432
  ] })
425
433
  ] }),
426
- /* @__PURE__ */ i(
427
- o,
434
+ /* @__PURE__ */ l(
435
+ a,
428
436
  {
429
- id: `${s}-comment`,
437
+ id: `${n}-comment`,
430
438
  ariaLabel: "审批意见",
431
- value: F,
439
+ value: $,
432
440
  onChange: (r) => {
433
- y(r), J("");
441
+ f(r), V("");
434
442
  },
435
- placeholder: ae.length ? `请输入审批意见,${ae.map((r) => G[r.actionType]).join("、")}时必填` : "请输入审批意见",
436
- disabled: O,
437
- required: re,
443
+ placeholder: ne.length ? `请输入审批意见,${ne.map((r) => X[r.actionType]).join("、")}时必填` : "请输入审批意见",
444
+ disabled: P,
445
+ required: oe,
438
446
  maxLength: 1024
439
447
  }
440
448
  ),
441
- Z && /* @__PURE__ */ i("p", { role: "alert", className: "make-app-approval-detail-error", children: Z })
449
+ ee && /* @__PURE__ */ l("p", { role: "alert", className: "make-app-approval-detail-error", children: ee })
442
450
  ] }) : null;
443
- return oe({
444
- title: ue(n.processStatus),
445
- detail: n,
446
- sections: { application: ie, history: ce, opinion: de, feedback: le },
447
- actionItems: R ? [] : n.actions.map((r) => ({
451
+ return ie({
452
+ title: be(d.processStatus, c.presentation, c.style),
453
+ themeStyle: c.style,
454
+ presentation: c.presentation,
455
+ detail: d,
456
+ sections: { application: ce, history: pe, opinion: me, feedback: de },
457
+ actionItems: D ? [] : d.actions.map((r) => ({
448
458
  actionType: r.actionType,
449
- label: G[r.actionType],
450
- disabled: O,
451
- loading: O && q === r.actionType,
459
+ label: X[r.actionType],
460
+ disabled: P,
461
+ loading: P && C === r.actionType,
452
462
  onClick: () => {
453
- se(r.actionType);
463
+ le(r.actionType);
454
464
  }
455
465
  })),
456
- actions: Ae,
457
- content: /* @__PURE__ */ d(Oe, { children: [
458
- Ne,
459
- de
466
+ actions: Se,
467
+ content: /* @__PURE__ */ p(De, { children: [
468
+ Oe,
469
+ me
460
470
  ] }),
461
471
  footer: null
462
472
  });
463
- }, Me = (e) => {
473
+ }, Qe = (e) => {
464
474
  if (!e.scopeKey.trim() || !e.reference.taskId.trim() || !e.reference.processInstanceId.trim())
465
475
  throw new Error("ApprovalTaskDetail requires scopeKey and task reference");
466
476
  for (const t of ["Button", "TextArea"])
467
477
  if (!e.components?.[t])
468
478
  throw new Error(`ApprovalTaskDetail requires components.${t}`);
469
- return /* @__PURE__ */ i(
470
- Fe,
479
+ return /* @__PURE__ */ l(
480
+ Be,
471
481
  {
472
482
  ...e
473
483
  },
@@ -477,81 +487,81 @@ const H = (e) => e.actionType === "RETURN" || e.actionType === "REJECT" || e.act
477
487
  e.reference.taskId
478
488
  ])
479
489
  );
480
- }, U = (e) => !!e && typeof e == "object" && !Array.isArray(e), ke = (e) => typeof e == "string" && !!e.trim(), $e = (e) => {
481
- if (!U(e) || !ke(e.processInstanceId) || !ke(e.processStatus) || !Array.isArray(e.fields) || !e.fields.every(ve) || !U(e.formData)) throw new Error("流程实例详情数据不完整");
482
- const t = e.fields, o = e.formData;
483
- if (new Set(t.map((s) => s.key)).size !== t.length) throw new Error("审批字段标识重复");
484
- if (e.fieldPermission !== void 0 && !U(e.fieldPermission)) throw new Error("审批字段权限格式无效");
485
- const a = B(e.fieldPermission?.viewPermission);
486
- if (a.some((s) => !t.some((h) => h.key === s))) throw new Error("审批字段元数据缺失");
487
- const c = e.summary;
490
+ }, L = (e) => !!e && typeof e == "object" && !Array.isArray(e), ve = (e) => typeof e == "string" && !!e.trim(), Ke = (e) => {
491
+ if (!L(e) || !ve(e.processInstanceId) || !ve(e.processStatus) || !Array.isArray(e.fields) || !e.fields.every(Ie) || !L(e.formData)) throw new Error("流程实例详情数据不完整");
492
+ const t = e.fields, a = e.formData;
493
+ if (new Set(t.map((n) => n.key)).size !== t.length) throw new Error("审批字段标识重复");
494
+ if (e.fieldPermission !== void 0 && !L(e.fieldPermission)) throw new Error("审批字段权限格式无效");
495
+ const o = K(e.fieldPermission?.viewPermission);
496
+ if (o.some((n) => !t.some((c) => c.key === n))) throw new Error("审批字段元数据缺失");
497
+ const i = e.summary;
488
498
  return {
489
499
  processInstanceId: e.processInstanceId,
490
500
  processStatus: e.processStatus,
491
- fields: t.filter((s) => a.includes(s.key)),
492
- formData: Object.fromEntries(a.map((s) => [s, o[s]])),
493
- fieldPermission: { viewPermission: { scope: "FIELDS", fields: a } },
494
- ...U(c) && ["title", "applicantName", "applicationTime"].every((s) => typeof c[s] == "string") ? { summary: { title: String(c.title), applicantName: String(c.applicantName), applicationTime: String(c.applicationTime) } } : {}
501
+ fields: t.filter((n) => o.includes(n.key)),
502
+ formData: Object.fromEntries(o.map((n) => [n, a[n]])),
503
+ fieldPermission: { viewPermission: { scope: "FIELDS", fields: o } },
504
+ ...L(i) && ["title", "applicantName", "applicationTime"].every((n) => typeof i[n] == "string") ? { summary: { title: String(i.title), applicantName: String(i.applicantName), applicationTime: String(i.applicationTime) } } : {}
495
505
  };
496
- }, Be = ({ title: e, content: t }) => /* @__PURE__ */ d("section", { className: "make-app-approval-detail", "aria-label": "流程详情", children: [
497
- /* @__PURE__ */ i("header", { className: "make-app-approval-detail-header", children: e }),
506
+ }, Le = ({ title: e, content: t, themeStyle: a, presentation: o }) => /* @__PURE__ */ p("section", { className: "make-app-approval-detail", "aria-label": "流程详情", style: a, "data-make-approval-theme": a ? o : void 0, "data-make-approval-presentation": o === "mobile" ? "mobile" : void 0, children: [
507
+ /* @__PURE__ */ l("header", { className: "make-app-approval-detail-header", children: e }),
498
508
  t
499
- ] }), Ue = (e) => {
500
- const t = be(), [o, a] = k(0), [c, s] = k(), h = L(e);
501
- h.current = e, x(() => {
502
- const y = new AbortController(), b = h.current;
503
- return f(b.logger, { operation: "detail", phase: "start" }), (async () => {
509
+ ] }), xe = (e) => {
510
+ const t = we(), a = ge(e.presentation ?? "desktop"), o = { style: a.style, "data-make-approval-theme": a.style ? a.presentation : void 0, "data-make-approval-presentation": a.presentation === "mobile" ? "mobile" : void 0 }, [i, n] = b(0), [c, s] = b(), y = J(e);
511
+ y.current = e, M(() => {
512
+ const f = new AbortController(), v = y.current;
513
+ return u(v.logger, { operation: "detail", phase: "start" }), (async () => {
504
514
  try {
505
- if (await Promise.resolve(), y.signal.aborted) return;
506
- const T = await b.provider.loadDetail(b.reference, { signal: y.signal });
507
- if (y.signal.aborted) return;
508
- const C = $e(T);
509
- if (C.processInstanceId !== b.reference.processInstanceId) throw new Error("流程实例标识不一致");
510
- s({ revision: o, detail: C }), f(b.logger, { operation: "detail", phase: "success" });
511
- } catch (T) {
512
- if (y.signal.aborted) return;
513
- s({ revision: o, error: !0 }), f(b.logger, { operation: "detail", phase: "error" }), b.onRequestError?.(T);
515
+ if (await Promise.resolve(), f.signal.aborted) return;
516
+ const O = await v.provider.loadDetail(v.reference, { signal: f.signal });
517
+ if (f.signal.aborted) return;
518
+ const B = Ke(O);
519
+ if (B.processInstanceId !== v.reference.processInstanceId) throw new Error("流程实例标识不一致");
520
+ s({ revision: i, detail: B }), u(v.logger, { operation: "detail", phase: "success" });
521
+ } catch (O) {
522
+ if (f.signal.aborted) return;
523
+ s({ revision: i, error: !0 }), u(v.logger, { operation: "detail", phase: "error" }), v.onRequestError?.(O);
514
524
  }
515
525
  })(), () => {
516
- y.abort(), f(b.logger, { operation: "detail", phase: "cancel" });
526
+ f.abort(), u(v.logger, { operation: "detail", phase: "cancel" });
517
527
  };
518
- }, [o]);
519
- const l = c?.revision === o ? c : void 0, n = l?.detail, { Button: p } = e.components, j = /* @__PURE__ */ d("div", { className: "make-app-approval-detail-title", children: [
520
- /* @__PURE__ */ i("h2", { children: "流程详情" }),
521
- n && /* @__PURE__ */ i(ge, { value: n.processStatus })
522
- ] }), q = e.renderLayout ?? Be;
523
- if (!n) return q({ title: j, content: l?.error ? /* @__PURE__ */ d("div", { children: [
524
- !e.onRequestError && /* @__PURE__ */ i("p", { role: "alert", children: "流程详情加载失败" }),
525
- /* @__PURE__ */ i(p, { htmlType: "button", variant: "default", onClick: () => a((y) => y + 1), children: "重新加载详情" })
526
- ] }) : /* @__PURE__ */ i("div", { role: "status", children: "正在加载审批详情…" }) });
527
- const I = /* @__PURE__ */ d("section", { className: "make-app-approval-detail-section", "aria-label": "申请信息", "data-presentation": e.presentation === "mobile" ? "mobile" : void 0, children: [
528
- /* @__PURE__ */ i("h3", { children: "申请信息" }),
529
- /* @__PURE__ */ d("div", { className: "make-app-approval-detail-fields", children: [
530
- !n.fields.length && /* @__PURE__ */ i("p", { children: "当前节点未配置可见字段" }),
531
- n.fields.map((y) => /* @__PURE__ */ d("div", { className: "make-app-approval-detail-field", "data-readonly": !0, "data-full-width": !!y.fullWidth, children: [
532
- /* @__PURE__ */ i("label", { htmlFor: `${t}-${y.key}`, children: y.label }),
533
- /* @__PURE__ */ i("div", { className: "make-app-approval-detail-value", children: e.renderField({ field: y, id: `${t}-${y.key}`, value: n.formData[y.key], readOnly: !0, disabled: !0 }) })
534
- ] }, y.key))
528
+ }, [i]);
529
+ const h = c?.revision === i ? c : void 0, d = h?.detail, { Button: w } = e.components, F = /* @__PURE__ */ p("div", { ...o, className: "make-app-approval-detail-title", children: [
530
+ /* @__PURE__ */ l("h2", { children: "流程详情" }),
531
+ d && /* @__PURE__ */ l(Ee, { value: d.processStatus, presentation: a.presentation })
532
+ ] }), C = e.renderLayout ?? Le;
533
+ if (!d) return C({ themeStyle: a.style, presentation: a.presentation, title: F, content: h?.error ? /* @__PURE__ */ p("div", { ...o, className: "make-app-approval-detail-request-state", children: [
534
+ !e.onRequestError && /* @__PURE__ */ l("p", { role: "alert", children: "流程详情加载失败" }),
535
+ /* @__PURE__ */ l(w, { htmlType: "button", variant: "default", onClick: () => n((f) => f + 1), children: "重新加载详情" })
536
+ ] }) : /* @__PURE__ */ l("div", { ...o, className: "make-app-approval-detail-request-state", role: "status", children: "正在加载审批详情…" }) });
537
+ const A = /* @__PURE__ */ p("section", { ...o, className: "make-app-approval-detail-section", "aria-label": "申请信息", "data-presentation": e.presentation === "mobile" ? "mobile" : void 0, children: [
538
+ /* @__PURE__ */ l("h3", { children: "申请信息" }),
539
+ /* @__PURE__ */ p("div", { className: "make-app-approval-detail-fields", children: [
540
+ !d.fields.length && /* @__PURE__ */ l("p", { children: "当前节点未配置可见字段" }),
541
+ d.fields.map((f) => /* @__PURE__ */ p("div", { className: "make-app-approval-detail-field", "data-readonly": !0, "data-full-width": !!f.fullWidth, children: [
542
+ /* @__PURE__ */ l("label", { htmlFor: `${t}-${f.key}`, children: f.label }),
543
+ /* @__PURE__ */ l("div", { className: "make-app-approval-detail-value", children: e.renderField({ field: f, id: `${t}-${f.key}`, value: d.formData[f.key], readOnly: !0, disabled: !0 }) })
544
+ ] }, f.key))
535
545
  ] })
536
- ] }), F = e.history != null ? /* @__PURE__ */ d("section", { className: "make-app-approval-detail-section make-app-approval-detail-history", "aria-label": "审批流程", children: [
537
- /* @__PURE__ */ i("h3", { children: "审批流程" }),
546
+ ] }), $ = e.history != null ? /* @__PURE__ */ p("section", { ...o, className: "make-app-approval-detail-section make-app-approval-detail-history", "aria-label": "审批流程", children: [
547
+ /* @__PURE__ */ l("h3", { children: "审批流程" }),
538
548
  e.history
539
549
  ] }) : null;
540
- return q({ title: j, detail: n, sections: { application: I, history: F, feedback: null }, content: /* @__PURE__ */ d("div", { className: "make-app-approval-detail-content", children: [
541
- I,
542
- F
550
+ return C({ themeStyle: a.style, presentation: a.presentation, title: F, detail: d, sections: { application: A, history: $, feedback: null }, content: /* @__PURE__ */ p("div", { ...o, className: "make-app-approval-detail-content", children: [
551
+ A,
552
+ $
543
553
  ] }) });
544
- }, Ve = (e) => {
554
+ }, Ge = (e) => {
545
555
  if (!e.scopeKey.trim() || !e.reference.processInstanceId.trim()) throw new Error("ApprovalInstanceDetail requires scopeKey and instance reference");
546
556
  if (!e.components?.Button) throw new Error("ApprovalInstanceDetail requires Button");
547
- return /* @__PURE__ */ i(Ue, { ...e }, JSON.stringify([e.scopeKey, e.reference.processInstanceId]));
557
+ return /* @__PURE__ */ l(xe, { ...e }, JSON.stringify([e.scopeKey, e.reference.processInstanceId]));
548
558
  };
549
559
  export {
550
- Ve as ApprovalInstanceDetail,
551
- Me as ApprovalTaskDetail,
552
- v as ApprovalTaskValidationError,
553
- fe as buildApprovalTaskAction,
554
- K as getApprovalTaskFields,
555
- $e as readApprovalInstanceDetail,
556
- we as readApprovalTaskDetail
560
+ Ge as ApprovalInstanceDetail,
561
+ Qe as ApprovalTaskDetail,
562
+ E as ApprovalTaskValidationError,
563
+ ke as buildApprovalTaskAction,
564
+ x as getApprovalTaskFields,
565
+ Ke as readApprovalInstanceDetail,
566
+ Ne as readApprovalTaskDetail
557
567
  };