yh-report 2.4.12 → 2.4.14

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