@hkyhy/marsun-components-core 0.1.102 → 0.1.113

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.
Files changed (37) hide show
  1. package/dist/components/Filter/createKneFilterField.js +42 -39
  2. package/dist/components/Filter/createKneFilterField.js.map +1 -1
  3. package/dist/components/Form/SuperSelect.js +48 -45
  4. package/dist/components/Form/SuperSelect.js.map +1 -1
  5. package/dist/components/ReactFilter/fields/index.js +33 -26
  6. package/dist/components/ReactFilter/fields/index.js.map +1 -1
  7. package/dist/components/ReactFilter/renderSelectListItemContent.d.ts +8 -0
  8. package/dist/components/ReactFilter/renderSelectListItemContent.js +12 -0
  9. package/dist/components/ReactFilter/renderSelectListItemContent.js.map +1 -0
  10. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/MessageTemplateAdmin.d.ts +1 -1
  11. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/MessageTemplateAdmin.js +158 -137
  12. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/MessageTemplateAdmin.js.map +1 -1
  13. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/Modal/TemplateFormModal.js +218 -126
  14. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/Modal/TemplateFormModal.js.map +1 -1
  15. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/PushRulesPanel/index.d.ts +8 -1
  16. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/PushRulesPanel/index.js +310 -170
  17. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/PushRulesPanel/index.js.map +1 -1
  18. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/VariablesPanel/index.js +87 -76
  19. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/VariablesPanel/index.js.map +1 -1
  20. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/audienceSlots.d.ts +14 -0
  21. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/audienceSlots.js +31 -0
  22. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/audienceSlots.js.map +1 -0
  23. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/index.d.ts +3 -1
  24. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/style.module.scss.js +18 -6
  25. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/style.module.scss.js.map +1 -1
  26. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/types.d.ts +27 -0
  27. package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/types.js.map +1 -1
  28. package/dist/components/Tools/MessageCenter/index.d.ts +3 -1
  29. package/dist/components/Tools/MessageCenter/utils/audienceUserSelectOptions.d.ts +16 -0
  30. package/dist/components/Tools/MessageCenter/utils/audienceUserSelectOptions.js +33 -0
  31. package/dist/components/Tools/MessageCenter/utils/audienceUserSelectOptions.js.map +1 -0
  32. package/dist/components/Tools/MessageCenter/utils/templateCode.js +11 -17
  33. package/dist/components/Tools/MessageCenter/utils/templateCode.js.map +1 -1
  34. package/dist/components/Tools/index.d.ts +1 -1
  35. package/dist/marsun-components-core.css +1 -1
  36. package/dist/styles/global.css +1 -1
  37. package/package.json +8 -1
@@ -1,102 +1,146 @@
1
- import { jsx as o, jsxs as w } from "react/jsx-runtime";
2
- import { message as r, Switch as J, Space as O, Button as N, Select as V } from "antd";
3
- import { useState as y, useCallback as M, useEffect as _, useMemo as C } from "react";
4
- import { resolveTemplateCodeAfterEventChange as X } from "../../utils/adminGuards.js";
5
- import Y from "../style.module.scss.js";
6
- import Z from "../../../../Alert/Alert.js";
7
- import R from "../../../../Layout/PageSpin/index.js";
8
- import j from "../../../../Empty/Empty.js";
9
- import P from "../../../../Table/Table.js";
10
- import ee from "../../../../FormInfo/FormModal.js";
11
- import ae from "../../../../FormInfo/FormInfo.js";
12
- import { Input as le, Select as oe, InputNumber as te } from "../../../../FormInfo/fields.js";
13
- const h = oe, ne = le, T = te, ke = ({
14
- crud: f,
1
+ import { jsx as t, jsxs as x } from "react/jsx-runtime";
2
+ import { message as r, Modal as te, Switch as ae, Space as oe, Button as q } from "antd";
3
+ import { useState as k, useCallback as W, useEffect as J, useMemo as p } from "react";
4
+ import { normalizeAudienceSlots as se, hasAudienceSelection as re, ORG_TENANT_SLOT as ie, AUDIENCE_SLOT_OPTIONS as ce } from "../audienceSlots.js";
5
+ import { resolveTemplateCodeAfterEventChange as de } from "../../utils/adminGuards.js";
6
+ import { buildAudienceUserSelectGroups as me } from "../../utils/audienceUserSelectOptions.js";
7
+ import ue from "../style.module.scss.js";
8
+ import F from "../../../../Alert/Alert.js";
9
+ import pe from "../../../../Layout/PageSpin/index.js";
10
+ import V from "../../../../Empty/Empty.js";
11
+ import be from "../../../../Table/Table.js";
12
+ import ye from "../../../../FormInfo/FormModal.js";
13
+ import fe from "../../../../FormInfo/FormInfo.js";
14
+ import { Select as ve, Input as he, InputNumber as Se } from "../../../../FormInfo/fields.js";
15
+ const b = ve, Ce = he, X = Se, y = {
16
+ getPopupContainer: () => document.body,
17
+ styles: { popup: { root: { zIndex: 2e3 } } }
18
+ }, Be = ({
19
+ crud: I,
15
20
  catalog: i,
16
- templates: u,
17
- roleOptions: Q,
18
- fetchPushRules: S,
19
- savePushRule: K,
20
- setPushRuleEnabled: d,
21
- deletePushRule: p,
22
- createNonce: L = 0
21
+ templates: K,
22
+ roleOptions: N,
23
+ userOptions: z = [],
24
+ audienceRolesError: f = "",
25
+ audienceUsersError: v = "",
26
+ fetchPushRules: A,
27
+ savePushRule: U,
28
+ setPushRuleEnabled: h,
29
+ deletePushRule: D,
30
+ createNonce: B = 0
23
31
  }) => {
24
- const v = f.create, s = f.update, I = f.delete, U = f.read, k = (e) => e ? v : s, [g, x] = y([]), [D, F] = y(!1), [E, H] = y(""), [a, b] = y(null), [c, z] = y(!1), m = M(async () => {
25
- F(!0), H("");
32
+ const T = I.create, c = I.update, H = I.delete, Y = I.read, m = (e) => e ? T : c, [_, $] = k([]), [M, O] = k(!1), [P, E] = k(""), [l, S] = k(null), [s, R] = k(!1), u = W(async () => {
33
+ O(!0), E("");
26
34
  try {
27
- const e = await S();
28
- x(Array.isArray(e) ? e : []);
35
+ const e = await A();
36
+ $(Array.isArray(e) ? e : []);
29
37
  } catch (e) {
30
- H(e instanceof Error ? e.message : String(e)), x([]);
38
+ E(e instanceof Error ? e.message : String(e)), $([]);
31
39
  } finally {
32
- F(!1);
40
+ O(!1);
33
41
  }
34
- }, [S]);
35
- _(() => {
36
- m();
37
- }, [m]), _(() => {
38
- if (!L || !v) return;
39
- const e = i[0], l = u.find((t) => t.eventKey === (e == null ? void 0 : e.eventKey));
40
- z(!0), b({
42
+ }, [A]);
43
+ J(() => {
44
+ u();
45
+ }, [u]), J(() => {
46
+ if (!B || !T) return;
47
+ const e = i[0], n = K.find((a) => a.eventKey === (e == null ? void 0 : e.eventKey));
48
+ R(!0), S({
41
49
  label: (e == null ? void 0 : e.label) || "新建推送规则",
42
50
  eventKey: (e == null ? void 0 : e.eventKey) || "",
43
- templateCode: (l == null ? void 0 : l.code) || "",
51
+ templateCode: (n == null ? void 0 : n.code) || "",
44
52
  levels: ["L2"],
45
53
  audienceRoles: [],
54
+ audienceUserIds: [],
55
+ audienceSlots: [],
46
56
  channels: ["in_app"],
47
57
  slaHours: 36,
48
58
  scanLookbackDays: 7,
49
59
  enabled: !0
50
60
  });
51
- }, [L, v, i, u]);
52
- const $ = M(
53
- (e) => u.filter((l) => !e || l.eventKey === e).map((l) => ({
54
- value: String(l.code || ""),
55
- label: `${l.label || l.code || ""}(${l.code || ""})`
56
- })).filter((l) => l.value),
57
- [u]
58
- ), A = C(
61
+ }, [B, T, i, K]);
62
+ const C = W(
63
+ (e) => K.filter((n) => !e || n.eventKey === e).map((n) => ({
64
+ value: String(n.code || ""),
65
+ label: `${n.label || n.code || ""}(${n.code || ""})`
66
+ })).filter((n) => n.value),
67
+ [K]
68
+ ), j = p(
69
+ () => C(l == null ? void 0 : l.eventKey),
70
+ [C, l == null ? void 0 : l.eventKey]
71
+ ), Z = p(() => {
72
+ var n;
73
+ const e = l == null ? void 0 : l.eventKey;
74
+ return ((n = i.find((a) => a.eventKey === e)) == null ? void 0 : n.label) || e || "当前场景";
75
+ }, [i, l == null ? void 0 : l.eventKey]), g = !!l && j.length === 0, ee = p(
76
+ () => me(z),
77
+ [z]
78
+ ), G = p(
59
79
  () => ({
60
- label: a == null ? void 0 : a.label,
61
- eventKey: a == null ? void 0 : a.eventKey,
62
- templateCode: a == null ? void 0 : a.templateCode,
63
- levels: (a == null ? void 0 : a.levels) || [],
64
- audienceRoles: (a == null ? void 0 : a.audienceRoles) || [],
65
- slaHours: (a == null ? void 0 : a.slaHours) ?? 0,
66
- scanLookbackDays: (a == null ? void 0 : a.scanLookbackDays) ?? 0
80
+ label: l == null ? void 0 : l.label,
81
+ eventKey: l == null ? void 0 : l.eventKey,
82
+ templateCode: l == null ? void 0 : l.templateCode,
83
+ levels: (l == null ? void 0 : l.levels) || [],
84
+ audienceRoles: (l == null ? void 0 : l.audienceRoles) || [],
85
+ audienceUserIds: (l == null ? void 0 : l.audienceUserIds) || [],
86
+ audienceSlots: (l == null ? void 0 : l.audienceSlots) || [],
87
+ slaHours: (l == null ? void 0 : l.slaHours) ?? 0,
88
+ scanLookbackDays: (l == null ? void 0 : l.scanLookbackDays) ?? 0
67
89
  }),
68
- [a]
69
- ), W = C(
90
+ [l]
91
+ ), le = p(
70
92
  () => ({
71
- data: A,
93
+ data: G,
72
94
  onSubmit: async (e) => {
73
- if (!k(c) || !a)
95
+ if (!m(s) || !l)
74
96
  return r.warning("当前为只读"), !1;
75
- const l = String(a.eventKey || e.eventKey || "").trim(), t = String(e.templateCode || "").trim();
76
- if (!l)
97
+ const n = String(l.eventKey || e.eventKey || "").trim(), a = String(e.templateCode || "").trim();
98
+ if (!n)
77
99
  return r.warning("请选择事件"), !1;
78
- if (!t)
100
+ if (!a)
79
101
  return r.warning("请关联模板编号"), !1;
102
+ if (C(n).length === 0)
103
+ return r.warning("该场景暂无消息模板,请先到「消息模板」新建后再关联"), !1;
104
+ const o = e.audienceRoles || [], d = e.audienceUserIds || [], w = se(e.audienceSlots || []);
105
+ if (!re({
106
+ roles: o,
107
+ slots: w,
108
+ userIds: d
109
+ }))
110
+ return r.warning("请选择受众角色、通知范围或例外抄送(至少一个)"), !1;
111
+ if (w.includes(ie) && !await new Promise((Q) => {
112
+ te.confirm({
113
+ title: "确认通知本租户全员?",
114
+ content: "已选「本租户(全公司)」:将向当前租户内用户展开(≠跨租户)。emit 时按页拉取,可能人数较多。确认保存?",
115
+ okText: "确认保存",
116
+ cancelText: "取消",
117
+ onOk: () => Q(!0),
118
+ onCancel: () => Q(!1)
119
+ });
120
+ }))
121
+ return !1;
80
122
  try {
81
- await K({
82
- ...a,
83
- label: String(e.label || a.label || "").trim() || l,
84
- eventKey: l,
85
- templateCode: t,
123
+ await U({
124
+ ...l,
125
+ label: String(e.label || l.label || "").trim() || n,
126
+ eventKey: n,
127
+ templateCode: a,
86
128
  levels: e.levels || [],
87
- audienceRoles: e.audienceRoles || [],
129
+ audienceRoles: o,
130
+ audienceUserIds: d,
131
+ audienceSlots: w,
88
132
  channels: ["in_app"],
89
133
  slaHours: Number(e.slaHours ?? 0),
90
134
  scanLookbackDays: Number(e.scanLookbackDays ?? 0),
91
- enabled: c ? !0 : a.enabled !== !1
92
- }), r.success("已保存"), b(null), await m();
93
- } catch (n) {
94
- return r.error(n instanceof Error ? n.message : String(n)), !1;
135
+ enabled: s ? !0 : l.enabled !== !1
136
+ }), r.success("已保存"), S(null), await u();
137
+ } catch (L) {
138
+ return r.error(L instanceof Error ? L.message : String(L)), !1;
95
139
  }
96
140
  }
97
141
  }),
98
- [v, s, a, A, c, m, K]
99
- ), q = C(
142
+ [T, c, l, G, s, u, U, C]
143
+ ), ne = p(
100
144
  () => [
101
145
  { title: "名称", dataIndex: "label", key: "label", ellipsis: !0 },
102
146
  {
@@ -104,8 +148,8 @@ const h = oe, ne = le, T = te, ke = ({
104
148
  dataIndex: "eventKey",
105
149
  key: "eventKey",
106
150
  render: (e) => {
107
- var l;
108
- return ((l = i.find((t) => t.eventKey === e)) == null ? void 0 : l.label) || e || "—";
151
+ var n;
152
+ return ((n = i.find((a) => a.eventKey === e)) == null ? void 0 : n.label) || e || "—";
109
153
  }
110
154
  },
111
155
  { title: "关联模板", dataIndex: "templateCode", key: "templateCode", width: 140 },
@@ -121,18 +165,18 @@ const h = oe, ne = le, T = te, ke = ({
121
165
  dataIndex: "enabled",
122
166
  key: "enabled",
123
167
  width: 80,
124
- render: (e, l) => /* @__PURE__ */ o(
125
- J,
168
+ render: (e, n) => /* @__PURE__ */ t(
169
+ ae,
126
170
  {
127
171
  size: "small",
128
- checked: l.enabled !== !1,
129
- disabled: !s || !d,
130
- onChange: (t) => {
172
+ checked: n.enabled !== !1,
173
+ disabled: !c || !h,
174
+ onChange: (a) => {
131
175
  (async () => {
132
176
  try {
133
- await (d == null ? void 0 : d(l, t)), r.success(t ? "已启用" : "已停用"), await m();
134
- } catch (n) {
135
- r.error(n instanceof Error ? n.message : String(n));
177
+ await (h == null ? void 0 : h(n, a)), await u();
178
+ } catch (o) {
179
+ r.error(o instanceof Error ? o.message : String(o));
136
180
  }
137
181
  })();
138
182
  }
@@ -143,172 +187,268 @@ const h = oe, ne = le, T = te, ke = ({
143
187
  title: "操作",
144
188
  key: "actions",
145
189
  width: 140,
146
- render: (e, l) => /* @__PURE__ */ w(O, { size: 4, children: [
147
- /* @__PURE__ */ o(
148
- N,
190
+ render: (e, n) => /* @__PURE__ */ x(oe, { size: "small", children: [
191
+ /* @__PURE__ */ t(
192
+ q,
149
193
  {
150
194
  type: "link",
151
195
  size: "small",
152
- disabled: !s,
196
+ disabled: !c,
153
197
  onClick: () => {
154
- z(!1), b({ ...l });
198
+ R(!1), S({
199
+ ...n,
200
+ audienceRoles: n.audienceRoles || [],
201
+ audienceUserIds: n.audienceUserIds || [],
202
+ audienceSlots: n.audienceSlots || []
203
+ });
155
204
  },
156
205
  children: "编辑"
157
206
  }
158
207
  ),
159
- /* @__PURE__ */ o(
160
- N,
208
+ H && D ? /* @__PURE__ */ t(
209
+ q,
161
210
  {
162
211
  type: "link",
163
212
  size: "small",
164
213
  danger: !0,
165
- disabled: !I || !p,
166
214
  onClick: () => {
167
215
  (async () => {
168
216
  try {
169
- await (p == null ? void 0 : p(l)), r.success("已删除"), await m();
170
- } catch (t) {
171
- r.error(t instanceof Error ? t.message : String(t));
217
+ await D(n), r.success("已删除"), await u();
218
+ } catch (a) {
219
+ r.error(a instanceof Error ? a.message : String(a));
172
220
  }
173
221
  })();
174
222
  },
175
223
  children: "删除"
176
224
  }
177
- )
225
+ ) : null
178
226
  ] })
179
227
  }
180
228
  ],
181
- [s, I, i, p, m, d]
229
+ [c, H, i, D, u, h]
182
230
  );
183
- return /* @__PURE__ */ w("div", { className: Y.pane, children: [
184
- E ? /* @__PURE__ */ o(Z, { type: "error", showIcon: !0, message: E, style: { marginBottom: 12 } }) : null,
185
- /* @__PURE__ */ o(R, { spinning: D, children: U ? g.length === 0 && !D ? /* @__PURE__ */ o(j, { description: "暂无推送规则" }) : /* @__PURE__ */ o(
186
- P,
231
+ return /* @__PURE__ */ x("div", { className: ue.pane, children: [
232
+ P ? /* @__PURE__ */ t(F, { type: "error", showIcon: !0, message: P, style: { marginBottom: 12 } }) : null,
233
+ /* @__PURE__ */ t(pe, { spinning: M, children: Y ? _.length === 0 && !M ? /* @__PURE__ */ t(V, { description: "暂无推送规则" }) : /* @__PURE__ */ t(
234
+ be,
187
235
  {
188
- rowKey: (e) => e.id || e.code || `${e.eventKey}-${e.templateCode}`,
236
+ rowKey: (e) => e.id || e.code || String(e.eventKey),
189
237
  tableName: "msg-center-push-rules",
190
238
  columnConfigEnabled: !1,
191
239
  columnResizeEnabled: !1,
192
- columns: q,
193
- dataSource: g,
240
+ columns: ne,
241
+ dataSource: _,
194
242
  pagination: !1,
195
243
  size: "small"
196
244
  }
197
- ) : /* @__PURE__ */ o(j, { description: "无推送规则读取权限" }) }),
198
- /* @__PURE__ */ w(
199
- ee,
245
+ ) : /* @__PURE__ */ t(V, { description: "无消息推送读取权限" }) }),
246
+ /* @__PURE__ */ x(
247
+ ye,
200
248
  {
201
- title: c ? "新建推送规则" : "编辑推送规则",
202
- open: !!a,
203
- onCancel: () => b(null),
249
+ title: s ? "新建推送规则" : "编辑推送规则",
250
+ open: !!l,
251
+ onCancel: () => S(null),
204
252
  width: 560,
253
+ size: "small",
254
+ className: "msg-center-form-modal",
205
255
  okText: "保存",
256
+ okButtonProps: { disabled: g || !m(s) },
206
257
  autoClose: !1,
207
- formProps: W,
258
+ formProps: le,
208
259
  children: [
209
- /* @__PURE__ */ w("div", { style: { marginBottom: 16 }, children: [
210
- /* @__PURE__ */ o("div", { style: { marginBottom: 8 }, children: "适用场景" }),
211
- /* @__PURE__ */ o(
212
- V,
213
- {
214
- style: { width: "100%" },
215
- disabled: !k(c),
216
- value: (a == null ? void 0 : a.eventKey) || void 0,
217
- placeholder: i.length ? "选择场景(中文)" : "暂无事件目录",
218
- options: i.map((e) => ({
219
- value: e.eventKey,
220
- label: e.label || e.eventKey
221
- })),
222
- onChange: (e) => {
223
- const l = String(e || ""), t = $(l);
224
- b(
225
- (n) => {
226
- var B;
227
- return n && {
228
- ...n,
229
- eventKey: l,
230
- templateCode: X(n.templateCode, t),
231
- label: ((B = i.find((G) => G.eventKey === l)) == null ? void 0 : B.label) || n.label
232
- };
233
- }
234
- );
235
- },
236
- showSearch: !0,
237
- optionFilterProp: "label"
238
- }
239
- )
240
- ] }),
241
- /* @__PURE__ */ o(
242
- ae,
260
+ g ? /* @__PURE__ */ t(
261
+ F,
262
+ {
263
+ type: "warning",
264
+ showIcon: !0,
265
+ style: { marginBottom: 12 },
266
+ message: `「${Z}」暂无消息模板`,
267
+ description: "请先到「消息模板」Tab 为该场景新建模板,再回来关联。当前无法保存推送规则。"
268
+ }
269
+ ) : null,
270
+ f ? /* @__PURE__ */ t(
271
+ F,
272
+ {
273
+ type: "warning",
274
+ showIcon: !0,
275
+ style: { marginBottom: 12 },
276
+ message: `受众角色加载失败:${f}`
277
+ }
278
+ ) : null,
279
+ v ? /* @__PURE__ */ t(
280
+ F,
281
+ {
282
+ type: "warning",
283
+ showIcon: !0,
284
+ style: { marginBottom: 12 },
285
+ message: `例外抄送人员加载失败:${v}`
286
+ }
287
+ ) : null,
288
+ /* @__PURE__ */ t(
289
+ fe,
243
290
  {
244
291
  column: 1,
245
292
  list: [
246
- /* @__PURE__ */ o(
247
- ne,
293
+ /* @__PURE__ */ t(
294
+ b,
295
+ {
296
+ name: "eventKey",
297
+ label: "适用场景",
298
+ rule: "REQ",
299
+ disabled: !m(s),
300
+ options: i.map((e) => ({
301
+ value: e.eventKey,
302
+ label: e.label || e.eventKey
303
+ })),
304
+ optionFilterProp: "label",
305
+ placeholder: i.length ? "点击下拉选择场景" : "暂无事件目录",
306
+ notFoundContent: "暂无场景",
307
+ onChange: (e) => {
308
+ const n = String(e || ""), a = C(n);
309
+ S(
310
+ (o) => {
311
+ var d;
312
+ return o && {
313
+ ...o,
314
+ eventKey: n,
315
+ templateCode: de(o.templateCode, a),
316
+ label: ((d = i.find((w) => w.eventKey === n)) == null ? void 0 : d.label) || o.label
317
+ };
318
+ }
319
+ );
320
+ },
321
+ ...y
322
+ },
323
+ "eventKey"
324
+ ),
325
+ /* @__PURE__ */ t(
326
+ Ce,
248
327
  {
249
328
  name: "label",
250
329
  label: "名称",
251
330
  rule: "REQ",
252
- disabled: !k(c)
331
+ disabled: !m(s)
253
332
  },
254
333
  "label"
255
334
  ),
256
- /* @__PURE__ */ o(
257
- h,
335
+ /* @__PURE__ */ t(
336
+ b,
258
337
  {
259
338
  name: "templateCode",
260
339
  label: "关联模板",
261
340
  rule: "REQ",
262
- disabled: !s,
263
- options: $(a == null ? void 0 : a.eventKey),
264
- showSearch: !0,
265
- optionFilterProp: "label"
341
+ disabled: !c && !s || g,
342
+ options: j,
343
+ optionFilterProp: "label",
344
+ placeholder: g ? "该场景暂无模板,请先新建消息模板" : "点击下拉选择本场景已有模板",
345
+ notFoundContent: "该场景暂无模板",
346
+ labelTips: "选项来自「消息模板」Tab 中与当前适用场景相同的模板(按模板编号关联)。",
347
+ ...y
266
348
  },
267
- `tpl-${(a == null ? void 0 : a.eventKey) || ""}`
349
+ `tpl-${(l == null ? void 0 : l.eventKey) || ""}`
268
350
  ),
269
- /* @__PURE__ */ o(
270
- h,
351
+ /* @__PURE__ */ t(
352
+ b,
271
353
  {
272
354
  name: "levels",
273
355
  label: "级别",
274
356
  mode: "multiple",
275
- disabled: !s,
276
- options: ["L1", "L2", "L3"].map((e) => ({ value: e, label: e }))
357
+ disabled: !c && !s,
358
+ options: ["L1", "L2", "L3"].map((e) => ({ value: e, label: e })),
359
+ placeholder: "点击下拉选择级别(可多选)",
360
+ notFoundContent: "无级别选项",
361
+ labelTips: "告警/任务级别档:L1 最高、L2 中、L3 较低。规则匹配 emit 时带 level 会对齐这些档。",
362
+ ...y
277
363
  },
278
364
  "levels"
279
365
  ),
280
- /* @__PURE__ */ o(
281
- h,
366
+ /* @__PURE__ */ t(
367
+ b,
282
368
  {
283
369
  name: "audienceRoles",
284
370
  label: "受众角色",
285
371
  mode: "multiple",
286
- disabled: !k(c),
287
- options: Q.map((e) => ({ value: e.code, label: e.name || e.code })),
372
+ disabled: !m(s),
373
+ options: N.map((e) => ({ value: e.code, label: e.name || e.code })),
288
374
  optionFilterProp: "label",
289
- placeholder: "下拉选择角色(可多选)"
375
+ placeholder: f ? "角色加载失败" : N.length ? "点击下拉选择角色(可多选)" : "暂无角色(请确认本系统已配置角色)",
376
+ notFoundContent: f ? `加载失败:${f}` : "暂无角色数据",
377
+ labelTips: "主路径:本系统 SSO 角色(这类事常驻通知谁)。可与「通知范围」「例外抄送」并存;emit 时与显式 userIds **并集**(不再互相覆盖)。至少填角色/槽位/例外抄送之一。",
378
+ ...y
290
379
  },
291
380
  "audienceRoles"
292
381
  ),
293
- /* @__PURE__ */ o(
294
- T,
382
+ /* @__PURE__ */ t(
383
+ b,
384
+ {
385
+ name: "audienceSlots",
386
+ label: "通知范围",
387
+ mode: "multiple",
388
+ disabled: !m(s),
389
+ options: ce.map((e) => ({
390
+ value: e.value,
391
+ label: e.label
392
+ })),
393
+ optionFilterProp: "label",
394
+ maxTagCount: "responsive",
395
+ placeholder: "可选:本人/领导/部门/分厂/租户或任务当事人",
396
+ notFoundContent: "暂无槽位",
397
+ labelTips: "相对关系与组织范围依赖业务 emit 的 audienceContext;无上下文的槽不会发出。选「本租户(全公司)」保存前会二次确认。与角色、例外抄送并集送达。",
398
+ ...y
399
+ },
400
+ "audienceSlots"
401
+ ),
402
+ /* @__PURE__ */ t(
403
+ b,
404
+ {
405
+ name: "audienceUserIds",
406
+ label: "例外抄送",
407
+ mode: "multiple",
408
+ disabled: !m(s),
409
+ options: ee,
410
+ optionFilterProp: "searchText",
411
+ optionLabelProp: "label",
412
+ filterOption: (e, n) => {
413
+ const a = String(e || "").trim().toLowerCase();
414
+ return a ? String((n == null ? void 0 : n.searchText) || (n == null ? void 0 : n.label) || "").toLowerCase().includes(a) : !0;
415
+ },
416
+ optionRender: (e) => {
417
+ var o, d;
418
+ const n = ((o = e.data) == null ? void 0 : o.label) ?? e.label, a = (d = e.data) == null ? void 0 : d.description;
419
+ return /* @__PURE__ */ x("div", { style: { lineHeight: 1.35, padding: "2px 0" }, children: [
420
+ /* @__PURE__ */ t("div", { children: n }),
421
+ a ? /* @__PURE__ */ t("div", { style: { fontSize: 12, color: "rgba(0,0,0,0.45)" }, children: a }) : null
422
+ ] });
423
+ },
424
+ placeholder: v ? "人员加载失败" : z.length ? "按部门选择例外抄送人(可多选,日常可留空)" : "暂无人员(请确认本租户有用户)",
425
+ notFoundContent: v ? `加载失败:${v}` : "暂无人员数据",
426
+ labelTips: "非常驻名单:仅管理员例外通知等场景。与角色、通知范围并集送达;任务当事人优先用槽位 + emit.audienceContext。",
427
+ ...y
428
+ },
429
+ "audienceUserIds"
430
+ ),
431
+ /* @__PURE__ */ t(
432
+ X,
295
433
  {
296
434
  name: "slaHours",
297
- label: "SLA(小时)",
298
- disabled: !s,
435
+ label: "处理时限(小时)",
436
+ disabled: !c && !s,
299
437
  min: 0,
300
- style: { width: "100%" }
438
+ style: { width: "100%" },
439
+ labelTips: "期望处理完成的时限(小时),默认 36。本期仅存配置,站内信推送暂不自动计时催办。"
301
440
  },
302
441
  "slaHours"
303
442
  ),
304
- /* @__PURE__ */ o(
305
- T,
443
+ /* @__PURE__ */ t(
444
+ X,
306
445
  {
307
446
  name: "scanLookbackDays",
308
- label: "回看(天)",
309
- disabled: !s,
447
+ label: "扫描回看(天)",
448
+ disabled: !c && !s,
310
449
  min: 0,
311
- style: { width: "100%" }
450
+ style: { width: "100%" },
451
+ labelTips: "巡检/匹配规则时往回看多少天的业务数据,默认 7。本期仅存配置,由后续巡检任务消费。"
312
452
  },
313
453
  "scanLookbackDays"
314
454
  )
@@ -321,6 +461,6 @@ const h = oe, ne = le, T = te, ke = ({
321
461
  ] });
322
462
  };
323
463
  export {
324
- ke as PushRulesPanel
464
+ Be as PushRulesPanel
325
465
  };
326
466
  //# sourceMappingURL=index.js.map