yh-report 2.4.44 → 2.4.45

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