@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.
- package/dist/components/Filter/createKneFilterField.js +42 -39
- package/dist/components/Filter/createKneFilterField.js.map +1 -1
- package/dist/components/Form/SuperSelect.js +48 -45
- package/dist/components/Form/SuperSelect.js.map +1 -1
- package/dist/components/ReactFilter/fields/index.js +33 -26
- package/dist/components/ReactFilter/fields/index.js.map +1 -1
- package/dist/components/ReactFilter/renderSelectListItemContent.d.ts +8 -0
- package/dist/components/ReactFilter/renderSelectListItemContent.js +12 -0
- package/dist/components/ReactFilter/renderSelectListItemContent.js.map +1 -0
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/MessageTemplateAdmin.d.ts +1 -1
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/MessageTemplateAdmin.js +158 -137
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/MessageTemplateAdmin.js.map +1 -1
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/Modal/TemplateFormModal.js +218 -126
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/Modal/TemplateFormModal.js.map +1 -1
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/PushRulesPanel/index.d.ts +8 -1
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/PushRulesPanel/index.js +310 -170
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/PushRulesPanel/index.js.map +1 -1
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/VariablesPanel/index.js +87 -76
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/VariablesPanel/index.js.map +1 -1
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/audienceSlots.d.ts +14 -0
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/audienceSlots.js +31 -0
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/audienceSlots.js.map +1 -0
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/index.d.ts +3 -1
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/style.module.scss.js +18 -6
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/style.module.scss.js.map +1 -1
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/types.d.ts +27 -0
- package/dist/components/Tools/MessageCenter/MessageTemplateAdmin/types.js.map +1 -1
- package/dist/components/Tools/MessageCenter/index.d.ts +3 -1
- package/dist/components/Tools/MessageCenter/utils/audienceUserSelectOptions.d.ts +16 -0
- package/dist/components/Tools/MessageCenter/utils/audienceUserSelectOptions.js +33 -0
- package/dist/components/Tools/MessageCenter/utils/audienceUserSelectOptions.js.map +1 -0
- package/dist/components/Tools/MessageCenter/utils/templateCode.js +11 -17
- package/dist/components/Tools/MessageCenter/utils/templateCode.js.map +1 -1
- package/dist/components/Tools/index.d.ts +1 -1
- package/dist/marsun-components-core.css +1 -1
- package/dist/styles/global.css +1 -1
- package/package.json +8 -1
|
@@ -1,102 +1,146 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { message as r,
|
|
3
|
-
import { useState as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
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:
|
|
17
|
-
roleOptions:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
|
25
|
-
|
|
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
|
|
28
|
-
|
|
35
|
+
const e = await A();
|
|
36
|
+
$(Array.isArray(e) ? e : []);
|
|
29
37
|
} catch (e) {
|
|
30
|
-
|
|
38
|
+
E(e instanceof Error ? e.message : String(e)), $([]);
|
|
31
39
|
} finally {
|
|
32
|
-
|
|
40
|
+
O(!1);
|
|
33
41
|
}
|
|
34
|
-
}, [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}, [
|
|
38
|
-
if (!
|
|
39
|
-
const e = i[0],
|
|
40
|
-
|
|
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: (
|
|
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
|
-
}, [
|
|
52
|
-
const
|
|
53
|
-
(e) =>
|
|
54
|
-
value: String(
|
|
55
|
-
label: `${
|
|
56
|
-
})).filter((
|
|
57
|
-
[
|
|
58
|
-
),
|
|
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:
|
|
61
|
-
eventKey:
|
|
62
|
-
templateCode:
|
|
63
|
-
levels: (
|
|
64
|
-
audienceRoles: (
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
[
|
|
69
|
-
),
|
|
90
|
+
[l]
|
|
91
|
+
), le = p(
|
|
70
92
|
() => ({
|
|
71
|
-
data:
|
|
93
|
+
data: G,
|
|
72
94
|
onSubmit: async (e) => {
|
|
73
|
-
if (!
|
|
95
|
+
if (!m(s) || !l)
|
|
74
96
|
return r.warning("当前为只读"), !1;
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
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 (!
|
|
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
|
|
82
|
-
...
|
|
83
|
-
label: String(e.label ||
|
|
84
|
-
eventKey:
|
|
85
|
-
templateCode:
|
|
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:
|
|
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:
|
|
92
|
-
}), r.success("已保存"),
|
|
93
|
-
} catch (
|
|
94
|
-
return r.error(
|
|
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
|
-
[
|
|
99
|
-
),
|
|
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
|
|
108
|
-
return ((
|
|
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,
|
|
125
|
-
|
|
168
|
+
render: (e, n) => /* @__PURE__ */ t(
|
|
169
|
+
ae,
|
|
126
170
|
{
|
|
127
171
|
size: "small",
|
|
128
|
-
checked:
|
|
129
|
-
disabled: !
|
|
130
|
-
onChange: (
|
|
172
|
+
checked: n.enabled !== !1,
|
|
173
|
+
disabled: !c || !h,
|
|
174
|
+
onChange: (a) => {
|
|
131
175
|
(async () => {
|
|
132
176
|
try {
|
|
133
|
-
await (
|
|
134
|
-
} catch (
|
|
135
|
-
r.error(
|
|
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,
|
|
147
|
-
/* @__PURE__ */
|
|
148
|
-
|
|
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: !
|
|
196
|
+
disabled: !c,
|
|
153
197
|
onClick: () => {
|
|
154
|
-
|
|
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__ */
|
|
160
|
-
|
|
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 (
|
|
170
|
-
} catch (
|
|
171
|
-
r.error(
|
|
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
|
-
[
|
|
229
|
+
[c, H, i, D, u, h]
|
|
182
230
|
);
|
|
183
|
-
return /* @__PURE__ */
|
|
184
|
-
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
|
|
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 ||
|
|
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:
|
|
193
|
-
dataSource:
|
|
240
|
+
columns: ne,
|
|
241
|
+
dataSource: _,
|
|
194
242
|
pagination: !1,
|
|
195
243
|
size: "small"
|
|
196
244
|
}
|
|
197
|
-
) : /* @__PURE__ */
|
|
198
|
-
/* @__PURE__ */
|
|
199
|
-
|
|
245
|
+
) : /* @__PURE__ */ t(V, { description: "无消息推送读取权限" }) }),
|
|
246
|
+
/* @__PURE__ */ x(
|
|
247
|
+
ye,
|
|
200
248
|
{
|
|
201
|
-
title:
|
|
202
|
-
open: !!
|
|
203
|
-
onCancel: () =>
|
|
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:
|
|
258
|
+
formProps: le,
|
|
208
259
|
children: [
|
|
209
|
-
/* @__PURE__ */
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
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__ */
|
|
247
|
-
|
|
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: !
|
|
331
|
+
disabled: !m(s)
|
|
253
332
|
},
|
|
254
333
|
"label"
|
|
255
334
|
),
|
|
256
|
-
/* @__PURE__ */
|
|
257
|
-
|
|
335
|
+
/* @__PURE__ */ t(
|
|
336
|
+
b,
|
|
258
337
|
{
|
|
259
338
|
name: "templateCode",
|
|
260
339
|
label: "关联模板",
|
|
261
340
|
rule: "REQ",
|
|
262
|
-
disabled: !s,
|
|
263
|
-
options:
|
|
264
|
-
|
|
265
|
-
|
|
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-${(
|
|
349
|
+
`tpl-${(l == null ? void 0 : l.eventKey) || ""}`
|
|
268
350
|
),
|
|
269
|
-
/* @__PURE__ */
|
|
270
|
-
|
|
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__ */
|
|
281
|
-
|
|
366
|
+
/* @__PURE__ */ t(
|
|
367
|
+
b,
|
|
282
368
|
{
|
|
283
369
|
name: "audienceRoles",
|
|
284
370
|
label: "受众角色",
|
|
285
371
|
mode: "multiple",
|
|
286
|
-
disabled: !
|
|
287
|
-
options:
|
|
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__ */
|
|
294
|
-
|
|
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: "
|
|
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__ */
|
|
305
|
-
|
|
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
|
-
|
|
464
|
+
Be as PushRulesPanel
|
|
325
465
|
};
|
|
326
466
|
//# sourceMappingURL=index.js.map
|