xyvcard-npc 0.0.1 → 0.0.3
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/{index-Cnbbw65d.mjs → _plugin-vue_export-helper-Cv0caQpX.mjs} +7 -0
- package/dist/edit-CQhkMihp.mjs +315 -0
- package/dist/{edit.vue_vue_type_script_setup_true_lang-DY3AI0IZ.mjs → edit-DKbHar4T.mjs} +107 -91
- package/dist/{index-Cx4t71w3.mjs → index-CgLI5mY7.mjs} +66 -63
- package/dist/index-DCfP-zJc.mjs +194 -0
- package/dist/index.mjs +3 -3
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/edit-C5w0BRo0.mjs +0 -4
- package/dist/edit-DhLeWJvB.mjs +0 -467
- package/dist/index-yL4MC1AG.mjs +0 -207
|
@@ -4647,8 +4647,15 @@ Xe(ca, "replyTypeEnum", new Wi(
|
|
|
4647
4647
|
Qt.MODULE_NPC,
|
|
4648
4648
|
Qt.REPLY_TYPE_TEXT
|
|
4649
4649
|
));
|
|
4650
|
+
const Vv = (e, t) => {
|
|
4651
|
+
const r = e.__vccOpts || e;
|
|
4652
|
+
for (const [n, o] of t)
|
|
4653
|
+
r[n] = o;
|
|
4654
|
+
return r;
|
|
4655
|
+
};
|
|
4650
4656
|
export {
|
|
4651
4657
|
ca as D,
|
|
4652
4658
|
Bv as U,
|
|
4659
|
+
Vv as _,
|
|
4653
4660
|
Kv as q
|
|
4654
4661
|
};
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { defineComponent as A, mergeModels as D, ref as B, reactive as E, useModel as P, resolveComponent as i, createBlock as M, openBlock as g, withCtx as s, createVNode as c, unref as f, createElementBlock as G, Fragment as H, renderList as J, createElementVNode as Q, createTextVNode as T, toDisplayString as F } from "vue";
|
|
2
|
+
import { ElMessage as L } from "element-plus";
|
|
3
|
+
import { useI18n as W } from "vue-i18n";
|
|
4
|
+
import { useUserStore as n, clearEmpty as l, request as r } from "jmash-core";
|
|
5
|
+
import { q as S, U as X, D as Y, _ as Z } from "./_plugin-vue_export-helper-Cv0caQpX.mjs";
|
|
6
|
+
import { useRoute as ee } from "vue-router";
|
|
7
|
+
class te {
|
|
8
|
+
getKey(e) {
|
|
9
|
+
return {
|
|
10
|
+
robotId: e.robotId
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
// 查询翻页信息话题机器人
|
|
14
|
+
findPage(e) {
|
|
15
|
+
const o = n().user.tenant;
|
|
16
|
+
return l(e), r({
|
|
17
|
+
url: "/v1/npc/topic_robot/page/" + o,
|
|
18
|
+
method: "get",
|
|
19
|
+
params: e
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
// 查询列表信息话题机器人
|
|
23
|
+
findList(e) {
|
|
24
|
+
const o = n().user.tenant;
|
|
25
|
+
return l(e), r({
|
|
26
|
+
url: "/v1/npc/topic_robot/list/" + o,
|
|
27
|
+
method: "get",
|
|
28
|
+
params: e
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
// 查询话题机器人
|
|
32
|
+
findById(e) {
|
|
33
|
+
const o = n().user.tenant;
|
|
34
|
+
return l(e), r({
|
|
35
|
+
url: "/v1/npc/topic_robot/id/" + o + "/" + e.robotId,
|
|
36
|
+
method: "get"
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
// 创建实体话题机器人
|
|
40
|
+
create(e) {
|
|
41
|
+
return e.tenant = n().user.tenant, l(e), r({
|
|
42
|
+
url: "/v1/npc/topic_robot",
|
|
43
|
+
method: "post",
|
|
44
|
+
data: e
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
// 修改实体话题机器人
|
|
48
|
+
update(e) {
|
|
49
|
+
return e.tenant = n().user.tenant, l(e), r({
|
|
50
|
+
url: "/v1/npc/topic_robot",
|
|
51
|
+
method: "patch",
|
|
52
|
+
data: e
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
// 上移下移
|
|
56
|
+
move(e, o) {
|
|
57
|
+
let t = { ...e };
|
|
58
|
+
return t.tenant = n().user.tenant, t.up = o, l(t), r({
|
|
59
|
+
url: "/v1/npc/topic_robot/move",
|
|
60
|
+
method: "put",
|
|
61
|
+
data: t
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
// 启用/禁用
|
|
65
|
+
enable(e, o) {
|
|
66
|
+
let t = { ...e };
|
|
67
|
+
return t.tenant = n().user.tenant, t.enable = o, l(t), r({
|
|
68
|
+
url: "/v1/npc/topic_robot/enable",
|
|
69
|
+
method: "put",
|
|
70
|
+
data: t
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
// 删除话题机器人
|
|
74
|
+
delete(e) {
|
|
75
|
+
return e.tenant = n().user.tenant, l(e), r({
|
|
76
|
+
url: "/v1/npc/topic_robot/id",
|
|
77
|
+
method: "delete",
|
|
78
|
+
params: e
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
// 批量删除话题机器人
|
|
82
|
+
batchDelete(e) {
|
|
83
|
+
const o = e.map((v) => v.robotId), t = {
|
|
84
|
+
tenant: n().user.tenant,
|
|
85
|
+
robotId: o
|
|
86
|
+
};
|
|
87
|
+
return l(t), r({
|
|
88
|
+
url: "/v1/npc/topic_robot/batch",
|
|
89
|
+
method: "put",
|
|
90
|
+
data: t
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
// 下载导入模板话题机器人
|
|
94
|
+
downloadTemplate() {
|
|
95
|
+
const e = n().user.tenant;
|
|
96
|
+
return r({
|
|
97
|
+
url: "/v1/npc/topic_robot/" + e + "/template.xlsx",
|
|
98
|
+
method: "get",
|
|
99
|
+
responseType: "blob",
|
|
100
|
+
params: {
|
|
101
|
+
tenant: n().user.tenant
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
// 导入话题机器人
|
|
106
|
+
importExcel(e) {
|
|
107
|
+
return e.tenant = n().user.tenant, l(e), r({
|
|
108
|
+
url: "/v1/npc/topic_robot/import",
|
|
109
|
+
method: "patch",
|
|
110
|
+
data: e
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
// 导出话题机器人Excel文件
|
|
114
|
+
exportExcel(e) {
|
|
115
|
+
const o = n().user.tenant;
|
|
116
|
+
l(e);
|
|
117
|
+
const t = S.stringify(e, {
|
|
118
|
+
arrayFormat: "brackets",
|
|
119
|
+
allowDots: !0
|
|
120
|
+
});
|
|
121
|
+
return r({
|
|
122
|
+
url: "/v1/npc/topic_robot/" + o + "/topic_robots.xlsx?" + t,
|
|
123
|
+
method: "get",
|
|
124
|
+
responseType: "blob"
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
// 打印话题机器人PDF文件
|
|
128
|
+
exportPdf(e) {
|
|
129
|
+
const o = n().user.tenant;
|
|
130
|
+
l(e);
|
|
131
|
+
const t = S.stringify(e, {
|
|
132
|
+
arrayFormat: "brackets",
|
|
133
|
+
allowDots: !0
|
|
134
|
+
});
|
|
135
|
+
return r({
|
|
136
|
+
url: "/v1/npc/topic_robot/" + o + "/topic_robots.pdf?" + t,
|
|
137
|
+
method: "get",
|
|
138
|
+
responseType: "blob"
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
const h = new te(), oe = { class: "dialog-footer" }, ne = /* @__PURE__ */ A({
|
|
143
|
+
__name: "edit",
|
|
144
|
+
props: /* @__PURE__ */ D({
|
|
145
|
+
entityKey: {
|
|
146
|
+
type: Object,
|
|
147
|
+
default: () => {
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}, {
|
|
151
|
+
modelValue: { type: Boolean },
|
|
152
|
+
modelModifiers: {}
|
|
153
|
+
}),
|
|
154
|
+
emits: /* @__PURE__ */ D(["refresh"], ["update:modelValue"]),
|
|
155
|
+
setup(_, { emit: e }) {
|
|
156
|
+
const o = new X({
|
|
157
|
+
roleCode: "npc"
|
|
158
|
+
});
|
|
159
|
+
o.useValues();
|
|
160
|
+
const { t } = W(), v = ee(), y = B();
|
|
161
|
+
console.log(Y.userListBizDict.values, "=> userListBizDict");
|
|
162
|
+
let d = E({
|
|
163
|
+
requestId: Math.random() * 10 + "",
|
|
164
|
+
updateMask: "userId,robotContent",
|
|
165
|
+
topicId: v.query.topicId
|
|
166
|
+
});
|
|
167
|
+
const U = E({
|
|
168
|
+
// nickName: [
|
|
169
|
+
// {
|
|
170
|
+
// required: true,
|
|
171
|
+
// message: t("topicRobot.nickNameRequired"),
|
|
172
|
+
// trigger: "change",
|
|
173
|
+
// },
|
|
174
|
+
// ],
|
|
175
|
+
robotContent: [
|
|
176
|
+
{
|
|
177
|
+
required: !0,
|
|
178
|
+
message: t("topicRobot.robotContentRequired"),
|
|
179
|
+
trigger: "change"
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
}), m = P(_, "modelValue"), I = _, R = e, $ = Object.keys(I.entityKey), V = B($.length >= 1);
|
|
183
|
+
V.value && h.findById(I.entityKey).then(({ data: a }) => {
|
|
184
|
+
Object.assign(d, a);
|
|
185
|
+
});
|
|
186
|
+
const j = async () => {
|
|
187
|
+
var a;
|
|
188
|
+
await ((a = y.value) == null ? void 0 : a.validate((b) => {
|
|
189
|
+
b && (V.value ? h.update(d).then((u) => {
|
|
190
|
+
console.log(u), u.status === 200 && (L({
|
|
191
|
+
message: t("common.submitSuccess"),
|
|
192
|
+
type: "success"
|
|
193
|
+
}), m.value && (m.value = !1), R("refresh", u.status === 200));
|
|
194
|
+
}) : h.create(d).then((u) => {
|
|
195
|
+
console.log(u), u.status === 200 && (L({
|
|
196
|
+
message: t("common.submitSuccess"),
|
|
197
|
+
type: "success"
|
|
198
|
+
}), m.value && (m.value = !1), R("refresh", u.status === 200));
|
|
199
|
+
}));
|
|
200
|
+
}));
|
|
201
|
+
};
|
|
202
|
+
function k() {
|
|
203
|
+
m.value && (m.value = !1);
|
|
204
|
+
}
|
|
205
|
+
return (a, b) => {
|
|
206
|
+
const u = i("el-option"), O = i("el-select"), C = i("el-form-item"), w = i("el-col"), q = i("el-input"), z = i("el-row"), K = i("el-form"), x = i("el-button"), N = i("el-dialog");
|
|
207
|
+
return g(), M(N, {
|
|
208
|
+
modelValue: m.value,
|
|
209
|
+
"onUpdate:modelValue": b[2] || (b[2] = (p) => m.value = p),
|
|
210
|
+
onClose: k
|
|
211
|
+
}, {
|
|
212
|
+
footer: s(() => [
|
|
213
|
+
Q("div", oe, [
|
|
214
|
+
c(x, { onClick: k }, {
|
|
215
|
+
default: s(() => [
|
|
216
|
+
T(F(a.$t("common.cancel")), 1)
|
|
217
|
+
]),
|
|
218
|
+
_: 1
|
|
219
|
+
}),
|
|
220
|
+
c(x, {
|
|
221
|
+
type: "primary",
|
|
222
|
+
onClick: j
|
|
223
|
+
}, {
|
|
224
|
+
default: s(() => [
|
|
225
|
+
T(F(a.$t("common.confirm")), 1)
|
|
226
|
+
]),
|
|
227
|
+
_: 1
|
|
228
|
+
})
|
|
229
|
+
])
|
|
230
|
+
]),
|
|
231
|
+
default: s(() => [
|
|
232
|
+
c(K, {
|
|
233
|
+
ref_key: "topicRobotFormRef",
|
|
234
|
+
ref: y,
|
|
235
|
+
model: f(d),
|
|
236
|
+
"label-width": "120px",
|
|
237
|
+
rules: U
|
|
238
|
+
}, {
|
|
239
|
+
default: s(() => [
|
|
240
|
+
c(z, null, {
|
|
241
|
+
default: s(() => [
|
|
242
|
+
c(w, { span: 24 }, {
|
|
243
|
+
default: s(() => [
|
|
244
|
+
c(C, {
|
|
245
|
+
label: a.$t("topicRobot.userId"),
|
|
246
|
+
prop: "userId"
|
|
247
|
+
}, {
|
|
248
|
+
default: s(() => [
|
|
249
|
+
c(O, {
|
|
250
|
+
modelValue: f(d).userId,
|
|
251
|
+
"onUpdate:modelValue": b[0] || (b[0] = (p) => f(d).userId = p),
|
|
252
|
+
placeholder: a.$t("topicRobot.userIdRequired"),
|
|
253
|
+
clearable: "",
|
|
254
|
+
filterable: "",
|
|
255
|
+
"check-strictly": "",
|
|
256
|
+
"render-after-expand": !1,
|
|
257
|
+
"allow-create": ""
|
|
258
|
+
}, {
|
|
259
|
+
default: s(() => [
|
|
260
|
+
(g(!0), G(H, null, J(f(o).values, (p) => (g(), M(u, {
|
|
261
|
+
key: p.key,
|
|
262
|
+
label: p.value,
|
|
263
|
+
value: p.key
|
|
264
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
265
|
+
]),
|
|
266
|
+
_: 1
|
|
267
|
+
}, 8, ["modelValue", "placeholder"])
|
|
268
|
+
]),
|
|
269
|
+
_: 1
|
|
270
|
+
}, 8, ["label"])
|
|
271
|
+
]),
|
|
272
|
+
_: 1
|
|
273
|
+
}),
|
|
274
|
+
c(w, { span: 24 }, {
|
|
275
|
+
default: s(() => [
|
|
276
|
+
c(C, {
|
|
277
|
+
label: a.$t("topicRobot.robotContent"),
|
|
278
|
+
prop: "robotContent"
|
|
279
|
+
}, {
|
|
280
|
+
default: s(() => [
|
|
281
|
+
c(q, {
|
|
282
|
+
modelValue: f(d).robotContent,
|
|
283
|
+
"onUpdate:modelValue": b[1] || (b[1] = (p) => f(d).robotContent = p),
|
|
284
|
+
placeholder: a.$t("topicRobot.robotContentRequired"),
|
|
285
|
+
maxlength: "120",
|
|
286
|
+
"show-word-limit": "",
|
|
287
|
+
type: "textarea",
|
|
288
|
+
clearable: ""
|
|
289
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
290
|
+
]),
|
|
291
|
+
_: 1
|
|
292
|
+
}, 8, ["label"])
|
|
293
|
+
]),
|
|
294
|
+
_: 1
|
|
295
|
+
})
|
|
296
|
+
]),
|
|
297
|
+
_: 1
|
|
298
|
+
})
|
|
299
|
+
]),
|
|
300
|
+
_: 1
|
|
301
|
+
}, 8, ["model", "rules"])
|
|
302
|
+
]),
|
|
303
|
+
_: 1
|
|
304
|
+
}, 8, ["modelValue"]);
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
}), re = /* @__PURE__ */ Z(ne, [["__scopeId", "data-v-88db7c72"]]), ie = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
308
|
+
__proto__: null,
|
|
309
|
+
default: re
|
|
310
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
311
|
+
export {
|
|
312
|
+
re as a,
|
|
313
|
+
ie as e,
|
|
314
|
+
h as t
|
|
315
|
+
};
|