yh-report 2.4.20 → 2.4.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,447 +0,0 @@
1
- import { defineComponent as I, reactive as B, ref as N, onMounted as G, watch as L, openBlock as Q, createElementBlock as W, createElementVNode as c, createTextVNode as d, createVNode as n, unref as l, withCtx as i, withKeys as X } from "vue";
2
- import { useRouter as Z } from "vue-router";
3
- import { g as _, s as U, d as ee, a as te } from "./index-d6fb1d0f.mjs";
4
- import { ElButton as p, ElFormItem as C, ElInput as x, ElTable as oe, ElTableColumn as v, ElPagination as ne, ElDialog as le, ElForm as ie, ElMessage as g, ElLoading as ae, ElMessageBox as j } from "element-plus";
5
- import { l as re, u as se } from "./editorLock-afc375cb.mjs";
6
- import "@/libs/api.request.js";
7
- import "lodash-es";
8
- import "echarts";
9
- function de(w) {
10
- if (navigator.clipboard && window.isSecureContext)
11
- return navigator.clipboard.writeText(w), Promise.resolve();
12
- {
13
- let m = document.createElement("textarea");
14
- m.value = w, m.style.position = "absolute", m.style.opacity = "0", m.style.left = "-200%", m.style.top = "-200%", document.body.appendChild(m), m.focus(), m.select();
15
- let a = document.execCommand("copy");
16
- return m.remove(), a ? Promise.resolve() : Promise.reject(new Error("copy error"));
17
- }
18
- }
19
- const ue = { class: "statement-list-container" }, pe = { class: "actions" }, me = { class: "el-button is-text import-excel-button" }, ce = { class: "form-context" }, fe = { class: "dialog-footer" }, $e = /* @__PURE__ */ I({
20
- __name: "StatementList",
21
- setup(w) {
22
- const m = Z(), a = B({
23
- key: "",
24
- pageSize: 10,
25
- pageNumber: 1,
26
- total: 0
27
- }), z = N([]);
28
- async function f(o = !1) {
29
- o && (a.pageNumber = 1, a.total = 0);
30
- const e = await _({
31
- key: a.key,
32
- pageSize: a.pageSize,
33
- pageNumber: a.pageNumber
34
- });
35
- z.value = e.data.list, a.total = e.data.total;
36
- }
37
- function $(o, e) {
38
- let t = "", r = "链接";
39
- switch (e) {
40
- case "admin":
41
- t = `/admin/statement/detail/${o.id}`, r = "后台链接";
42
- break;
43
- case "inner":
44
- t = `innerStatementdetail/${o.id}`, r = "菜单链接";
45
- case "outside":
46
- t = `${window.location.origin}${window.location.pathname}#/statementdetail/${o.id}`, r = "外部链接";
47
- }
48
- de(t).then(() => {
49
- g.success(r + "复制成功");
50
- }).catch(() => {
51
- g.error(r + "复制遇到问题");
52
- });
53
- }
54
- const V = N([]), R = (o) => {
55
- V.value = o;
56
- }, F = async (o) => {
57
- const e = o.target.files[0];
58
- if (!e)
59
- return;
60
- const t = new FileReader();
61
- t.onload = async (r) => {
62
- o.target.value = "";
63
- try {
64
- if (r.target) {
65
- const y = JSON.parse(r.target.result);
66
- if (Array.isArray(y) && y.every((u) => typeof u == "object" && "code" in u && "config" in u && "description" in u && "name" in u)) {
67
- const u = ae.service({
68
- fullscreen: !0,
69
- text: `正在导入报表,共 ${y.length} 个,请稍候...`
70
- });
71
- for (let k = 0; k < y.length; k++) {
72
- u.setText(`正在保存第 ${k + 1} 个,共 ${y.length} 个,请稍候...`);
73
- const S = y[k];
74
- await U(S);
75
- }
76
- u.close(), f(!0);
77
- } else
78
- g.error("格式错误,请确保导入的文件未被修改过!");
79
- }
80
- } catch {
81
- g.error("文件解析失败,请检查文件是否为有效的 JSON 格式!");
82
- }
83
- }, t.readAsText(e);
84
- }, O = () => {
85
- if (V.value.length > 0) {
86
- const o = JSON.stringify(
87
- V.value.map(({ code: k, config: S, description: K, name: h }) => ({
88
- code: k,
89
- config: S,
90
- description: K,
91
- name: h
92
- })),
93
- null,
94
- 2
95
- ), e = new Blob([o], { type: "application/json" }), t = URL.createObjectURL(e), y = `报表导出-${ee().format("YYYYMMDDHHmm")}.json`, u = document.createElement("a");
96
- u.href = t, u.download = y, document.body.appendChild(u), u.click(), document.body.removeChild(u), URL.revokeObjectURL(t);
97
- } else
98
- g.warning("请选择要操作的报表!");
99
- }, D = async (o) => {
100
- await re(o.id) === "OK" ? m.push(`/admin/statement/design/${o.id}`) : await j.alert("报表正在被其他用户锁定,是否强制解锁?", "提示", {
101
- confirmButtonText: "解锁",
102
- cancelButtonText: "取消"
103
- }) === "confirm" && (await se(o.id) ? D(o) : g.error("解锁失败,请稍后再试!"));
104
- }, P = (o) => {
105
- m.push(`/admin/statement/detail/${o.id}`);
106
- };
107
- G(() => {
108
- f(!0);
109
- });
110
- const b = N(!1), s = B({
111
- id: void 0,
112
- name: "",
113
- code: "",
114
- description: ""
115
- }), A = () => {
116
- b.value = !0;
117
- }, M = (o) => {
118
- b.value = !0, s.id = o.id, s.name = o.name, s.code = o.code, s.description = o.description;
119
- }, Y = (o) => {
120
- j.confirm("当前操作会复制选定的报表,确认继续吗?", "提醒", {
121
- confirmButtonText: "复制",
122
- cancelButtonText: "取消",
123
- type: "warning"
124
- }).then(() => {
125
- let e = {
126
- name: `${o.name}-copy`,
127
- code: `${o.code}-copy`,
128
- description: `${o.description}-copy`,
129
- chartConfig: o.chartConfig,
130
- config: o.config,
131
- listData: o.listData
132
- };
133
- U(e).then(() => {
134
- g.success("复制成功"), f(!0);
135
- }).catch(() => {
136
- g.error("复制失败");
137
- });
138
- });
139
- }, q = (o) => {
140
- j.confirm("当前操作会删除选定的报表,确认继续吗?", "警告", {
141
- confirmButtonText: "删除",
142
- cancelButtonText: "取消",
143
- type: "warning"
144
- }).then(async () => {
145
- (await te(o.id)).data && f(!0);
146
- });
147
- }, E = () => {
148
- b.value = !1, s.id = void 0, s.name = "", s.code = "", s.description = "";
149
- }, H = async () => {
150
- await U(s), f(!0), E();
151
- }, T = (o) => {
152
- o && (o.preventDefault(), o.stopPropagation()), f(!1);
153
- }, J = () => {
154
- a.key = "", f(!0);
155
- };
156
- return L(
157
- () => a.pageNumber,
158
- () => {
159
- f();
160
- }
161
- ), L(
162
- () => a.pageSize,
163
- () => {
164
- f();
165
- }
166
- ), (o, e) => (Q(), W("section", ue, [
167
- c("div", pe, [
168
- c("div", me, [
169
- c("input", {
170
- class: "import-excel-input",
171
- type: "file",
172
- onChange: e[0] || (e[0] = (t) => F(t))
173
- }, null, 32),
174
- e[11] || (e[11] = d(" 导入 ", -1))
175
- ]),
176
- n(l(p), {
177
- text: "",
178
- onClick: O
179
- }, {
180
- default: i(() => [...e[12] || (e[12] = [
181
- d(" 导出 ", -1)
182
- ])]),
183
- _: 1
184
- }),
185
- n(l(p), {
186
- type: "primary",
187
- onClick: A
188
- }, {
189
- default: i(() => [...e[13] || (e[13] = [
190
- d(" 新增 ", -1)
191
- ])]),
192
- _: 1
193
- }),
194
- c("div", ce, [
195
- n(l(C), { label: "报表名称" }, {
196
- default: i(() => [
197
- n(l(x), {
198
- modelValue: a.key,
199
- "onUpdate:modelValue": e[1] || (e[1] = (t) => a.key = t),
200
- onKeyup: X(T, ["enter"]),
201
- placeholder: "键入关键字搜索报表"
202
- }, null, 8, ["modelValue"])
203
- ]),
204
- _: 1
205
- })
206
- ]),
207
- n(l(p), {
208
- type: "primary",
209
- onClick: e[2] || (e[2] = (t) => T())
210
- }, {
211
- default: i(() => [...e[14] || (e[14] = [
212
- d(" 搜索 ", -1)
213
- ])]),
214
- _: 1
215
- }),
216
- n(l(p), {
217
- onClick: e[3] || (e[3] = (t) => J())
218
- }, {
219
- default: i(() => [...e[15] || (e[15] = [
220
- d("重置", -1)
221
- ])]),
222
- _: 1
223
- })
224
- ]),
225
- n(l(oe), {
226
- data: z.value,
227
- "row-key": "id",
228
- onSelectionChange: R
229
- }, {
230
- default: i(() => [
231
- n(l(v), {
232
- type: "selection",
233
- width: "50"
234
- }),
235
- n(l(v), {
236
- label: "#",
237
- type: "index",
238
- width: "66",
239
- left: ""
240
- }),
241
- n(l(v), {
242
- label: "报表代码",
243
- "min-width": "100",
244
- prop: "code"
245
- }),
246
- n(l(v), {
247
- label: "报表名称",
248
- "min-width": "100",
249
- prop: "name"
250
- }),
251
- n(l(v), {
252
- label: "描述",
253
- "min-width": "200",
254
- prop: "description"
255
- }),
256
- n(l(v), {
257
- label: "操作",
258
- width: "490",
259
- fixed: "right"
260
- }, {
261
- default: i((t) => [
262
- n(l(p), {
263
- link: "",
264
- title: "本系统前台菜单地址",
265
- onClick: (r) => $(t.row, "inner")
266
- }, {
267
- default: i(() => [...e[16] || (e[16] = [
268
- d(" 菜单 ", -1)
269
- ])]),
270
- _: 1
271
- }, 8, ["onClick"]),
272
- n(l(p), {
273
- link: "",
274
- title: "后台测试",
275
- onClick: (r) => $(t.row, "admin")
276
- }, {
277
- default: i(() => [...e[17] || (e[17] = [
278
- d(" 后台 ", -1)
279
- ])]),
280
- _: 1
281
- }, 8, ["onClick"]),
282
- n(l(p), {
283
- link: "",
284
- title: "其他系统嵌入地址",
285
- onClick: (r) => $(t.row, "outside")
286
- }, {
287
- default: i(() => [...e[18] || (e[18] = [
288
- d(" 外嵌 ", -1)
289
- ])]),
290
- _: 1
291
- }, 8, ["onClick"]),
292
- n(l(p), {
293
- type: "primary",
294
- link: "",
295
- onClick: (r) => D(t.row)
296
- }, {
297
- default: i(() => [...e[19] || (e[19] = [
298
- c("i", { class: "yhreport-icon report-sheji" }, null, -1),
299
- d(" 设计 ", -1)
300
- ])]),
301
- _: 1
302
- }, 8, ["onClick"]),
303
- n(l(p), {
304
- type: "primary",
305
- link: "",
306
- onClick: (r) => P(t.row)
307
- }, {
308
- default: i(() => [...e[20] || (e[20] = [
309
- c("i", { class: "yhreport-icon report-preview" }, null, -1),
310
- d(" 查看 ", -1)
311
- ])]),
312
- _: 1
313
- }, 8, ["onClick"]),
314
- n(l(p), {
315
- type: "primary",
316
- link: "",
317
- onClick: (r) => M(t.row)
318
- }, {
319
- default: i(() => [...e[21] || (e[21] = [
320
- c("i", { class: "yhreport-icon report-bianji" }, null, -1),
321
- d(" 编辑 ", -1)
322
- ])]),
323
- _: 1
324
- }, 8, ["onClick"]),
325
- n(l(p), {
326
- type: "primary",
327
- link: "",
328
- onClick: (r) => Y(t.row)
329
- }, {
330
- default: i(() => [...e[22] || (e[22] = [
331
- c("i", { class: "yhreport-icon report-fuzhi" }, null, -1),
332
- d(" 复制 ", -1)
333
- ])]),
334
- _: 1
335
- }, 8, ["onClick"]),
336
- n(l(p), {
337
- type: "danger",
338
- link: "",
339
- onClick: (r) => q(t.row)
340
- }, {
341
- default: i(() => [...e[23] || (e[23] = [
342
- c("i", { class: "yhreport-icon report-shanchusekuai" }, null, -1),
343
- d(" 删除 ", -1)
344
- ])]),
345
- _: 1
346
- }, 8, ["onClick"])
347
- ]),
348
- _: 1
349
- })
350
- ]),
351
- _: 1
352
- }, 8, ["data"]),
353
- n(l(ne), {
354
- background: "",
355
- style: { "padding-top": "10px", "justify-content": "flex-end" },
356
- "page-sizes": [10, 20, 50, 100],
357
- "page-size": a.pageSize,
358
- "onUpdate:pageSize": e[4] || (e[4] = (t) => a.pageSize = t),
359
- total: a.total,
360
- "current-page": a.pageNumber,
361
- "onUpdate:currentPage": e[5] || (e[5] = (t) => a.pageNumber = t),
362
- layout: "sizes,prev,pager,next,total"
363
- }, null, 8, ["page-size", "total", "current-page"]),
364
- n(l(le), {
365
- modelValue: b.value,
366
- "onUpdate:modelValue": e[10] || (e[10] = (t) => b.value = t),
367
- onClose: E,
368
- title: s.id ? "编辑报表" : "新建报表"
369
- }, {
370
- footer: i(() => [
371
- c("span", fe, [
372
- n(l(p), { onClick: E }, {
373
- default: i(() => [...e[24] || (e[24] = [
374
- d("取消", -1)
375
- ])]),
376
- _: 1
377
- }),
378
- n(l(p), {
379
- type: "primary",
380
- onClick: e[9] || (e[9] = (t) => H())
381
- }, {
382
- default: i(() => [...e[25] || (e[25] = [
383
- d(" 保存 ", -1)
384
- ])]),
385
- _: 1
386
- })
387
- ])
388
- ]),
389
- default: i(() => [
390
- n(l(ie), {
391
- model: s,
392
- "label-width": "120"
393
- }, {
394
- default: i(() => [
395
- n(l(C), {
396
- label: "报表代码",
397
- required: ""
398
- }, {
399
- default: i(() => [
400
- n(l(x), {
401
- modelValue: s.code,
402
- "onUpdate:modelValue": e[6] || (e[6] = (t) => s.code = t),
403
- autocomplete: "off"
404
- }, null, 8, ["modelValue"])
405
- ]),
406
- _: 1
407
- }),
408
- n(l(C), {
409
- label: "报表名称",
410
- required: ""
411
- }, {
412
- default: i(() => [
413
- n(l(x), {
414
- modelValue: s.name,
415
- "onUpdate:modelValue": e[7] || (e[7] = (t) => s.name = t),
416
- autocomplete: "off"
417
- }, null, 8, ["modelValue"])
418
- ]),
419
- _: 1
420
- }),
421
- n(l(C), {
422
- label: "描述",
423
- required: ""
424
- }, {
425
- default: i(() => [
426
- n(l(x), {
427
- modelValue: s.description,
428
- "onUpdate:modelValue": e[8] || (e[8] = (t) => s.description = t),
429
- type: "textarea",
430
- autocomplete: "off"
431
- }, null, 8, ["modelValue"])
432
- ]),
433
- _: 1
434
- })
435
- ]),
436
- _: 1
437
- }, 8, ["model"])
438
- ]),
439
- _: 1
440
- }, 8, ["modelValue", "title"])
441
- ]));
442
- }
443
- });
444
- export {
445
- $e as default
446
- };
447
- //# sourceMappingURL=StatementList-f88e3cdf.mjs.map