yh-report 2.1.16 → 2.2.1

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,6 +1,6 @@
1
1
  import { defineComponent as n, ref as a, onActivated as i, onDeactivated as r, onMounted as m, openBlock as s, createElementBlock as c, createVNode as d } from "vue";
2
2
  import { useRoute as l } from "vue-router";
3
- import { o as u } from "./index-b3cd5062.mjs";
3
+ import { o as u } from "./index-fde3483a.mjs";
4
4
  import "element-plus";
5
5
  import "@/libs/api.request.js";
6
6
  import "lodash-es";
@@ -25,4 +25,4 @@ const p = { class: "statement-detail-container" }, y = /* @__PURE__ */ n({
25
25
  export {
26
26
  y as default
27
27
  };
28
- //# sourceMappingURL=StatementDetail-91b3f9c1.mjs.map
28
+ //# sourceMappingURL=StatementDetail-865222ad.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"StatementDetail-91b3f9c1.mjs","sources":["../StatementDetail.vue"],"sourcesContent":["<template>\n <section class=\"statement-detail-container\">\n <report-run :id=\"id\"></report-run>\n </section>\n</template>\n<script setup lang=\"ts\">\nimport {ref, onMounted, onActivated, onDeactivated} from 'vue';\nimport {useRoute} from 'vue-router';\nimport reportRun from './component/reportRun.vue';\nconst route = useRoute();\nconst id = ref();\n\nonActivated(() => {\n document.querySelector('.main-container')?.classList.add('statement-design-main');\n});\n\nonDeactivated(() => {\n document.querySelector('.main-container')?.classList.remove('statement-design-main');\n});\n\nonMounted(() => {\n id.value = route.params.id;\n});\n</script>\n"],"names":["route","useRoute","id","ref","onActivated","_a","onDeactivated","onMounted"],"mappings":";;;;;;;;;;AASA,UAAMA,IAAQC,KACRC,IAAKC;AAEX,WAAAC,EAAY,MAAM;;AAChB,OAAAC,IAAA,SAAS,cAAc,iBAAiB,MAAxC,QAAAA,EAA2C,UAAU,IAAI;AAAA,IAAuB,CACjF,GAEDC,EAAc,MAAM;;AAClB,OAAAD,IAAA,SAAS,cAAc,iBAAiB,MAAxC,QAAAA,EAA2C,UAAU,OAAO;AAAA,IAAuB,CACpF,GAEDE,EAAU,MAAM;AACX,MAAAL,EAAA,QAAQF,EAAM,OAAO;AAAA,IAAA,CACzB;;;;;"}
1
+ {"version":3,"file":"StatementDetail-865222ad.mjs","sources":["../StatementDetail.vue"],"sourcesContent":["<template>\n <section class=\"statement-detail-container\">\n <report-run :id=\"id\"></report-run>\n </section>\n</template>\n<script setup lang=\"ts\">\nimport {ref, onMounted, onActivated, onDeactivated} from 'vue';\nimport {useRoute} from 'vue-router';\nimport reportRun from './component/reportRun.vue';\nconst route = useRoute();\nconst id = ref();\n\nonActivated(() => {\n document.querySelector('.main-container')?.classList.add('statement-design-main');\n});\n\nonDeactivated(() => {\n document.querySelector('.main-container')?.classList.remove('statement-design-main');\n});\n\nonMounted(() => {\n id.value = route.params.id;\n});\n</script>\n"],"names":["route","useRoute","id","ref","onActivated","_a","onDeactivated","onMounted"],"mappings":";;;;;;;;;;AASA,UAAMA,IAAQC,KACRC,IAAKC;AAEX,WAAAC,EAAY,MAAM;;AAChB,OAAAC,IAAA,SAAS,cAAc,iBAAiB,MAAxC,QAAAA,EAA2C,UAAU,IAAI;AAAA,IAAuB,CACjF,GAEDC,EAAc,MAAM;;AAClB,OAAAD,IAAA,SAAS,cAAc,iBAAiB,MAAxC,QAAAA,EAA2C,UAAU,OAAO;AAAA,IAAuB,CACpF,GAEDE,EAAU,MAAM;AACX,MAAAL,EAAA,QAAQF,EAAM,OAAO;AAAA,IAAA,CACzB;;;;;"}
@@ -1,22 +1,22 @@
1
- import { defineComponent as J, reactive as N, ref as V, onMounted as K, watch as z, openBlock as P, createElementBlock as I, createElementVNode as f, createTextVNode as u, createVNode as n, unref as o, withCtx as a, withKeys as G } from "vue";
2
- import { useRouter as Q } from "vue-router";
3
- import { g as W, c as X, s as U, d as Z, a as ee } from "./index-b3cd5062.mjs";
4
- import { ElButton as c, ElForm as D, ElFormItem as b, ElInput as _, ElTable as te, ElTableColumn as y, ElPagination as ne, ElDialog as oe, ElMessage as v, ElLoading as le, ElMessageBox as ae } from "element-plus";
1
+ import { defineComponent as H, reactive as N, ref as h, onMounted as J, watch as z, openBlock as K, createElementBlock as P, createElementVNode as m, createTextVNode as u, createVNode as o, unref as n, withCtx as a, withKeys as I } from "vue";
2
+ import { useRouter as G } from "vue-router";
3
+ import { g as Q, c as W, s as U, d as X, a as Z } from "./index-fde3483a.mjs";
4
+ import { ElButton as c, ElFormItem as b, ElInput as _, ElTable as ee, ElTableColumn as y, ElPagination as te, ElDialog as oe, ElForm as ne, ElMessage as v, ElLoading as le, ElMessageBox as ae } from "element-plus";
5
5
  import "@/libs/api.request.js";
6
6
  import "lodash-es";
7
7
  import "echarts";
8
- const ie = { class: "statement-list-container" }, re = { class: "actions" }, de = { class: "el-button is-text import-excel-button" }, se = /* @__PURE__ */ f("i", { class: "iconfont icon-antdesign" }, null, -1), ue = /* @__PURE__ */ f("i", { class: "iconfont icon-view" }, null, -1), ce = /* @__PURE__ */ f("i", { class: "iconfont icon-edit-outline" }, null, -1), pe = /* @__PURE__ */ f("i", { class: "iconfont icon-delete" }, null, -1), me = { class: "dialog-footer" }, Ce = /* @__PURE__ */ J({
8
+ const ie = { class: "statement-list-container" }, re = { class: "actions" }, de = { class: "el-button is-text import-excel-button" }, se = { class: "form-context" }, ue = /* @__PURE__ */ m("i", { class: "iconfont icon-antdesign" }, null, -1), ce = /* @__PURE__ */ m("i", { class: "iconfont icon-view" }, null, -1), pe = /* @__PURE__ */ m("i", { class: "iconfont icon-edit-outline" }, null, -1), me = /* @__PURE__ */ m("i", { class: "iconfont icon-delete" }, null, -1), fe = { class: "dialog-footer" }, xe = /* @__PURE__ */ H({
9
9
  __name: "StatementList",
10
- setup(fe) {
11
- const h = Q(), r = N({
10
+ setup(ge) {
11
+ const V = G(), r = N({
12
12
  key: "",
13
13
  pageSize: 10,
14
14
  pageNumber: 1,
15
15
  total: 0
16
- }), $ = V([]);
17
- async function m(l = !1) {
16
+ }), $ = h([]);
17
+ async function f(l = !1) {
18
18
  l && (r.pageNumber = 1, r.total = 0);
19
- const t = await W({
19
+ const t = await Q({
20
20
  key: r.key,
21
21
  pageSize: r.pageSize,
22
22
  pageNumber: r.pageNumber
@@ -25,15 +25,15 @@ const ie = { class: "statement-list-container" }, re = { class: "actions" }, de
25
25
  }
26
26
  function S(l, t) {
27
27
  let e = "", d = "链接";
28
- t === "inner" ? (e = `innerStatementdetail/${l.id}`, d = "内部链接") : (e = `${window.location.origin}${window.location.pathname}#/statementdetail/${l.id}`, d = "外部链接"), X(e).then(() => {
28
+ t === "inner" ? (e = `innerStatementdetail/${l.id}`, d = "内部链接") : (e = `${window.location.origin}${window.location.pathname}#/statementdetail/${l.id}`, d = "外部链接"), W(e).then(() => {
29
29
  v.success(d + "复制成功");
30
30
  }).catch(() => {
31
31
  v.error(d + "复制遇到问题");
32
32
  });
33
33
  }
34
- const w = V([]), L = (l) => {
34
+ const w = h([]), D = (l) => {
35
35
  w.value = l;
36
- }, j = async (l) => {
36
+ }, L = async (l) => {
37
37
  const t = l.target.files[0];
38
38
  if (!t)
39
39
  return;
@@ -53,7 +53,7 @@ const ie = { class: "statement-list-container" }, re = { class: "actions" }, de
53
53
  const x = p[g];
54
54
  await U(x);
55
55
  }
56
- s.close(), m(!0);
56
+ s.close(), f(!0);
57
57
  } else
58
58
  v.error("格式错误,请确保导入的文件未被修改过!");
59
59
  }
@@ -61,119 +61,116 @@ const ie = { class: "statement-list-container" }, re = { class: "actions" }, de
61
61
  v.error("文件解析失败,请检查文件是否为有效的 JSON 格式!");
62
62
  }
63
63
  }, e.readAsText(t);
64
- }, R = () => {
64
+ }, j = () => {
65
65
  if (w.value.length > 0) {
66
66
  const l = JSON.stringify(
67
- w.value.map(({ code: g, config: x, description: q, name: H }) => ({
67
+ w.value.map(({ code: g, config: x, description: Y, name: q }) => ({
68
68
  code: g,
69
69
  config: x,
70
- description: q,
71
- name: H
70
+ description: Y,
71
+ name: q
72
72
  })),
73
73
  null,
74
74
  2
75
- ), t = new Blob([l], { type: "application/json" }), e = URL.createObjectURL(t), p = `报表导出-${Z().format("YYYYMMDDHHmm")}.json`, s = document.createElement("a");
75
+ ), t = new Blob([l], { type: "application/json" }), e = URL.createObjectURL(t), p = `报表导出-${X().format("YYYYMMDDHHmm")}.json`, s = document.createElement("a");
76
76
  s.href = e, s.download = p, document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(e);
77
77
  } else
78
78
  v.warning("请选择要操作的报表!");
79
79
  };
80
- function F(l) {
81
- h.push(`/admin/statement/design/${l.id}`);
80
+ function R(l) {
81
+ V.push(`/admin/statement/design/${l.id}`);
82
82
  }
83
- function B(l) {
84
- h.push(`/admin/statement/detail/${l.id}`);
83
+ function F(l) {
84
+ V.push(`/admin/statement/detail/${l.id}`);
85
85
  }
86
- K(() => {
87
- m(!0);
86
+ J(() => {
87
+ f(!0);
88
88
  });
89
- const k = V(!1), i = N({
89
+ const k = h(!1), i = N({
90
90
  id: void 0,
91
91
  name: "",
92
92
  code: "",
93
93
  description: ""
94
94
  });
95
- function T() {
95
+ function B() {
96
96
  k.value = !0;
97
97
  }
98
- function M(l) {
98
+ function T(l) {
99
99
  k.value = !0, i.id = l.id, i.name = l.name, i.code = l.code, i.description = l.description;
100
100
  }
101
- function O(l) {
101
+ function M(l) {
102
102
  ae.confirm("当前操作会删除选定的报表,确认继续吗?", "警告", {
103
103
  confirmButtonText: "删除",
104
104
  cancelButtonText: "取消",
105
105
  type: "warning"
106
106
  }).then(async () => {
107
- (await ee(l.id)).data && m(!0);
107
+ (await Z(l.id)).data && f(!0);
108
108
  });
109
109
  }
110
110
  function C() {
111
111
  k.value = !1, i.id = void 0, i.name = "", i.code = "", i.description = "";
112
112
  }
113
- async function A() {
114
- await U(i), m(!0), C();
113
+ async function O() {
114
+ await U(i), f(!0), C();
115
115
  }
116
116
  function E(l) {
117
- l && (l.preventDefault(), l.stopPropagation()), m(!1);
117
+ l && (l.preventDefault(), l.stopPropagation()), f(!1);
118
118
  }
119
- function Y() {
120
- r.key = "", m(!0);
119
+ function A() {
120
+ r.key = "", f(!0);
121
121
  }
122
122
  return z(
123
123
  () => r.pageNumber,
124
124
  () => {
125
- m();
125
+ f();
126
126
  }
127
127
  ), z(
128
128
  () => r.pageSize,
129
129
  () => {
130
- m();
130
+ f();
131
131
  }
132
- ), (l, t) => (P(), I("section", ie, [
133
- f("div", re, [
134
- f("div", de, [
135
- f("input", {
132
+ ), (l, t) => (K(), P("section", ie, [
133
+ m("div", re, [
134
+ m("div", de, [
135
+ m("input", {
136
136
  class: "import-excel-input",
137
137
  type: "file",
138
- onChange: t[0] || (t[0] = (e) => j(e))
138
+ onChange: t[0] || (t[0] = (e) => L(e))
139
139
  }, null, 32),
140
140
  u(" 导入 ")
141
141
  ]),
142
- n(o(c), {
142
+ o(n(c), {
143
143
  text: "",
144
- onClick: R
144
+ onClick: j
145
145
  }, {
146
146
  default: a(() => [
147
147
  u(" 导出 ")
148
148
  ]),
149
149
  _: 1
150
150
  }),
151
- n(o(c), {
151
+ o(n(c), {
152
152
  type: "primary",
153
- onClick: T
153
+ onClick: B
154
154
  }, {
155
155
  default: a(() => [
156
156
  u(" 新增 ")
157
157
  ]),
158
158
  _: 1
159
159
  }),
160
- n(o(D), { inline: "" }, {
161
- default: a(() => [
162
- n(o(b), { label: "报表名称" }, {
163
- default: a(() => [
164
- n(o(_), {
165
- modelValue: r.key,
166
- "onUpdate:modelValue": t[1] || (t[1] = (e) => r.key = e),
167
- onKeyup: G(E, ["enter"]),
168
- placeholder: "键入关键字搜索报表"
169
- }, null, 8, ["modelValue", "onKeyup"])
170
- ]),
171
- _: 1
172
- })
173
- ]),
174
- _: 1
175
- }),
176
- n(o(c), {
160
+ m("div", se, [
161
+ o(n(b), { label: "报表名称" }, {
162
+ default: a(() => [
163
+ o(n(_), {
164
+ modelValue: r.key,
165
+ "onUpdate:modelValue": t[1] || (t[1] = (e) => r.key = e),
166
+ onKeyup: I(E, ["enter"]),
167
+ placeholder: "键入关键字搜索报表"
168
+ }, null, 8, ["modelValue", "onKeyup"])
169
+ ]),
170
+ _: 1
171
+ })
172
+ ]),
173
+ o(n(c), {
177
174
  type: "primary",
178
175
  onClick: t[2] || (t[2] = (e) => E())
179
176
  }, {
@@ -182,8 +179,8 @@ const ie = { class: "statement-list-container" }, re = { class: "actions" }, de
182
179
  ]),
183
180
  _: 1
184
181
  }),
185
- n(o(c), {
186
- onClick: t[3] || (t[3] = (e) => Y())
182
+ o(n(c), {
183
+ onClick: t[3] || (t[3] = (e) => A())
187
184
  }, {
188
185
  default: a(() => [
189
186
  u("重置")
@@ -191,44 +188,44 @@ const ie = { class: "statement-list-container" }, re = { class: "actions" }, de
191
188
  _: 1
192
189
  })
193
190
  ]),
194
- n(o(te), {
191
+ o(n(ee), {
195
192
  data: $.value,
196
193
  "row-key": "id",
197
- onSelectionChange: L
194
+ onSelectionChange: D
198
195
  }, {
199
196
  default: a(() => [
200
- n(o(y), {
197
+ o(n(y), {
201
198
  type: "selection",
202
199
  width: "50"
203
200
  }),
204
- n(o(y), {
201
+ o(n(y), {
205
202
  label: "#",
206
203
  type: "index",
207
204
  width: "66",
208
205
  left: ""
209
206
  }),
210
- n(o(y), {
207
+ o(n(y), {
211
208
  label: "表单编码",
212
209
  "min-width": "100",
213
210
  prop: "code"
214
211
  }),
215
- n(o(y), {
212
+ o(n(y), {
216
213
  label: "表单名称",
217
214
  "min-width": "100",
218
215
  prop: "name"
219
216
  }),
220
- n(o(y), {
217
+ o(n(y), {
221
218
  label: "描述",
222
219
  "min-width": "200",
223
220
  prop: "description"
224
221
  }),
225
- n(o(y), {
222
+ o(n(y), {
226
223
  label: "操作",
227
224
  width: "500",
228
225
  fixed: "right"
229
226
  }, {
230
227
  default: a((e) => [
231
- n(o(c), {
228
+ o(n(c), {
232
229
  link: "",
233
230
  title: "本系统前台页面嵌入地址",
234
231
  onClick: (d) => S(e.row, "inner")
@@ -238,7 +235,7 @@ const ie = { class: "statement-list-container" }, re = { class: "actions" }, de
238
235
  ]),
239
236
  _: 2
240
237
  }, 1032, ["onClick"]),
241
- n(o(c), {
238
+ o(n(c), {
242
239
  link: "",
243
240
  title: "其他系统嵌入地址",
244
241
  onClick: (d) => S(e.row, "outside")
@@ -248,46 +245,46 @@ const ie = { class: "statement-list-container" }, re = { class: "actions" }, de
248
245
  ]),
249
246
  _: 2
250
247
  }, 1032, ["onClick"]),
251
- n(o(c), {
248
+ o(n(c), {
252
249
  type: "primary",
253
250
  link: "",
254
- onClick: (d) => F(e.row)
251
+ onClick: (d) => R(e.row)
255
252
  }, {
256
253
  default: a(() => [
257
- se,
254
+ ue,
258
255
  u(" 设计 ")
259
256
  ]),
260
257
  _: 2
261
258
  }, 1032, ["onClick"]),
262
- n(o(c), {
259
+ o(n(c), {
263
260
  type: "primary",
264
261
  link: "",
265
- onClick: (d) => B(e.row)
262
+ onClick: (d) => F(e.row)
266
263
  }, {
267
264
  default: a(() => [
268
- ue,
265
+ ce,
269
266
  u(" 查看 ")
270
267
  ]),
271
268
  _: 2
272
269
  }, 1032, ["onClick"]),
273
- n(o(c), {
270
+ o(n(c), {
274
271
  type: "primary",
275
272
  link: "",
276
- onClick: (d) => M(e.row)
273
+ onClick: (d) => T(e.row)
277
274
  }, {
278
275
  default: a(() => [
279
- ce,
276
+ pe,
280
277
  u(" 编辑 ")
281
278
  ]),
282
279
  _: 2
283
280
  }, 1032, ["onClick"]),
284
- n(o(c), {
281
+ o(n(c), {
285
282
  type: "danger",
286
283
  link: "",
287
- onClick: (d) => O(e.row)
284
+ onClick: (d) => M(e.row)
288
285
  }, {
289
286
  default: a(() => [
290
- pe,
287
+ me,
291
288
  u(" 删除 ")
292
289
  ]),
293
290
  _: 2
@@ -298,7 +295,7 @@ const ie = { class: "statement-list-container" }, re = { class: "actions" }, de
298
295
  ]),
299
296
  _: 1
300
297
  }, 8, ["data"]),
301
- n(o(ne), {
298
+ o(n(te), {
302
299
  background: "",
303
300
  style: { "padding-top": "10px", "justify-content": "flex-end" },
304
301
  "page-sizes": [10, 20, 50, 100],
@@ -309,23 +306,23 @@ const ie = { class: "statement-list-container" }, re = { class: "actions" }, de
309
306
  "onUpdate:currentPage": t[5] || (t[5] = (e) => r.pageNumber = e),
310
307
  layout: "sizes,prev,pager,next,total"
311
308
  }, null, 8, ["page-size", "total", "current-page"]),
312
- n(o(oe), {
309
+ o(n(oe), {
313
310
  modelValue: k.value,
314
311
  "onUpdate:modelValue": t[10] || (t[10] = (e) => k.value = e),
315
312
  onClose: C,
316
313
  title: i.id ? "编辑报表" : "新建报表"
317
314
  }, {
318
315
  footer: a(() => [
319
- f("span", me, [
320
- n(o(c), { onClick: C }, {
316
+ m("span", fe, [
317
+ o(n(c), { onClick: C }, {
321
318
  default: a(() => [
322
319
  u("取消")
323
320
  ]),
324
321
  _: 1
325
322
  }),
326
- n(o(c), {
323
+ o(n(c), {
327
324
  type: "primary",
328
- onClick: t[9] || (t[9] = (e) => A())
325
+ onClick: t[9] || (t[9] = (e) => O())
329
326
  }, {
330
327
  default: a(() => [
331
328
  u(" 保存 ")
@@ -335,17 +332,17 @@ const ie = { class: "statement-list-container" }, re = { class: "actions" }, de
335
332
  ])
336
333
  ]),
337
334
  default: a(() => [
338
- n(o(D), {
335
+ o(n(ne), {
339
336
  model: i,
340
337
  "label-width": "120"
341
338
  }, {
342
339
  default: a(() => [
343
- n(o(b), {
340
+ o(n(b), {
344
341
  label: "报表代码",
345
342
  required: ""
346
343
  }, {
347
344
  default: a(() => [
348
- n(o(_), {
345
+ o(n(_), {
349
346
  modelValue: i.code,
350
347
  "onUpdate:modelValue": t[6] || (t[6] = (e) => i.code = e),
351
348
  autocomplete: "off"
@@ -353,12 +350,12 @@ const ie = { class: "statement-list-container" }, re = { class: "actions" }, de
353
350
  ]),
354
351
  _: 1
355
352
  }),
356
- n(o(b), {
353
+ o(n(b), {
357
354
  label: "报表名称",
358
355
  required: ""
359
356
  }, {
360
357
  default: a(() => [
361
- n(o(_), {
358
+ o(n(_), {
362
359
  modelValue: i.name,
363
360
  "onUpdate:modelValue": t[7] || (t[7] = (e) => i.name = e),
364
361
  autocomplete: "off"
@@ -366,12 +363,12 @@ const ie = { class: "statement-list-container" }, re = { class: "actions" }, de
366
363
  ]),
367
364
  _: 1
368
365
  }),
369
- n(o(b), {
366
+ o(n(b), {
370
367
  label: "描述",
371
368
  required: ""
372
369
  }, {
373
370
  default: a(() => [
374
- n(o(_), {
371
+ o(n(_), {
375
372
  modelValue: i.description,
376
373
  "onUpdate:modelValue": t[8] || (t[8] = (e) => i.description = e),
377
374
  type: "textarea",
@@ -390,6 +387,6 @@ const ie = { class: "statement-list-container" }, re = { class: "actions" }, de
390
387
  }
391
388
  });
392
389
  export {
393
- Ce as default
390
+ xe as default
394
391
  };
395
- //# sourceMappingURL=StatementList-dd0b2c3e.mjs.map
392
+ //# sourceMappingURL=StatementList-47f6f95e.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatementList-47f6f95e.mjs","sources":["../StatementList.vue"],"sourcesContent":["<template>\n <section class=\"statement-list-container\">\n <div class=\"actions\">\n <div class=\"el-button is-text import-excel-button\">\n <input\n class=\"import-excel-input\"\n type=\"file\"\n @change=\"importReport($event)\" />\n 导入\n </div>\n <el-button\n text\n @click=\"exportReport\">\n 导出\n </el-button>\n <el-button\n type=\"primary\"\n @click=\"toAddForm\">\n 新增\n </el-button>\n <div class=\"form-context\">\n <el-form-item label=\"报表名称\">\n <el-input\n v-model=\"listForm.key\"\n @keyup.enter=\"onSearch\"\n placeholder=\"键入关键字搜索报表\"></el-input>\n </el-form-item>\n </div>\n <el-button\n type=\"primary\"\n @click=\"onSearch()\">\n 搜索\n </el-button>\n <el-button @click=\"onReset()\">重置</el-button>\n </div>\n <el-table\n :data=\"data\"\n row-key=\"id\"\n @selection-change=\"selectionChangeHandle\">\n <el-table-column\n type=\"selection\"\n width=\"50\"></el-table-column>\n <el-table-column\n label=\"#\"\n type=\"index\"\n width=\"66\"\n left></el-table-column>\n <el-table-column\n label=\"表单编码\"\n min-width=\"100\"\n prop=\"code\"></el-table-column>\n <el-table-column\n label=\"表单名称\"\n min-width=\"100\"\n prop=\"name\"></el-table-column>\n <el-table-column\n label=\"描述\"\n min-width=\"200\"\n prop=\"description\"></el-table-column>\n <el-table-column\n label=\"操作\"\n width=\"500\"\n fixed=\"right\">\n <template #default=\"scope\">\n <el-button\n link\n title=\"本系统前台页面嵌入地址\"\n @click=\"copyLink(scope.row, 'inner')\">\n 内部链接\n </el-button>\n <el-button\n link\n title=\"其他系统嵌入地址\"\n @click=\"copyLink(scope.row, 'outside')\">\n 外部链接\n </el-button>\n <el-button\n type=\"primary\"\n link\n @click=\"toDesign(scope.row)\">\n <i class=\"iconfont icon-antdesign\"></i>\n 设计\n </el-button>\n <el-button\n type=\"primary\"\n link\n @click=\"toView(scope.row)\">\n <i class=\"iconfont icon-view\"></i>\n 查看\n </el-button>\n <el-button\n type=\"primary\"\n link\n @click=\"toEditor(scope.row)\">\n <i class=\"iconfont icon-edit-outline\"></i>\n 编辑\n </el-button>\n <el-button\n type=\"danger\"\n link\n @click=\"toDelete(scope.row)\">\n <i class=\"iconfont icon-delete\"></i>\n 删除\n </el-button>\n </template>\n </el-table-column>\n </el-table>\n <el-pagination\n background\n style=\"padding-top: 10px; justify-content: flex-end\"\n :page-sizes=\"[10, 20, 50, 100]\"\n v-model:page-size=\"listForm.pageSize\"\n :total=\"listForm.total\"\n v-model:current-page=\"listForm.pageNumber\"\n layout=\"sizes,prev,pager,next,total\"></el-pagination>\n <!-- 新增报表对话框 -->\n <el-dialog\n v-model=\"dialogFormVisible\"\n @close=\"cancelForm\"\n :title=\"form.id ? '编辑报表' : '新建报表'\">\n <el-form\n :model=\"form\"\n label-width=\"120\">\n <el-form-item\n label=\"报表代码\"\n required>\n <el-input\n v-model=\"form.code\"\n autocomplete=\"off\" />\n </el-form-item>\n <el-form-item\n label=\"报表名称\"\n required>\n <el-input\n v-model=\"form.name\"\n autocomplete=\"off\" />\n </el-form-item>\n <el-form-item\n label=\"描述\"\n required>\n <el-input\n v-model=\"form.description\"\n type=\"textarea\"\n autocomplete=\"off\" />\n </el-form-item>\n </el-form>\n <template #footer>\n <span class=\"dialog-footer\">\n <el-button @click=\"cancelForm\">取消</el-button>\n <el-button\n type=\"primary\"\n @click=\"saveForm()\">\n 保存\n </el-button>\n </span>\n </template>\n </el-dialog>\n </section>\n</template>\n<script setup lang=\"ts\">\nimport {ref, reactive, computed, watch, onMounted} from 'vue';\nimport {useRouter} from 'vue-router';\nimport {Statement} from './types';\nimport {getList, save, del} from './api/form';\nimport {ElMessageBox, ElMessage, ElButton, ElForm, ElFormItem, ElInput, ElTable, ElTableColumn, ElPagination, ElDialog, ElLoading} from 'element-plus';\nimport {copyString} from './libs/util';\nimport dayjs from 'dayjs';\n\nconst router = useRouter();\n\n// @ts-ignore\nconst listForm = reactive({\n key: '',\n pageSize: 10,\n pageNumber: 1,\n total: 0,\n});\nconst data = ref<Statement[]>([]);\n\n//获取报表列表\nasync function getStatementList(flag = false) {\n if (flag) {\n listForm.pageNumber = 1;\n listForm.total = 0;\n }\n const res = await getList({\n key: listForm.key,\n pageSize: listForm.pageSize,\n pageNumber: listForm.pageNumber,\n });\n data.value = res.data.list;\n listForm.total = res.data.total;\n}\n\nfunction copyLink(row, type) {\n let href = '';\n let hrefName = '链接';\n if (type === 'inner') {\n href = `innerStatementdetail/${row.id}`;\n hrefName = '内部链接';\n } else {\n href = `${window.location.origin}${window.location.pathname}#/statementdetail/${row.id}`;\n hrefName = '外部链接';\n }\n copyString(href)\n .then(() => {\n ElMessage.success(hrefName + '复制成功');\n })\n .catch(() => {\n ElMessage.error(hrefName + '复制遇到问题');\n });\n}\n\nconst tableSelections = ref([]);\nconst selectionChangeHandle = (selections) => {\n tableSelections.value = selections;\n};\nconst importReport = async (e) => {\n const file = e.target.files[0];\n if (!file) return;\n\n const reader = new FileReader();\n reader.onload = async (event) => {\n e.target.value = '';\n try {\n if (event.target) {\n const jsonData = JSON.parse(event.target.result as string);\n if (Array.isArray(jsonData) && jsonData.every((item) => typeof item === 'object' && 'code' in item && 'config' in item && 'description' in item && 'name' in item)) {\n const loading = ElLoading.service({\n fullscreen: true,\n text: `正在导入报表,共 ${jsonData.length} 个,请稍候...`,\n });\n for (let i = 0; i < jsonData.length; i++) {\n loading.setText(`正在保存第 ${i + 1} 个,共 ${jsonData.length} 个,请稍候...`);\n const item = jsonData[i];\n await save(item);\n }\n loading.close();\n getStatementList(true);\n } else {\n ElMessage.error('格式错误,请确保导入的文件未被修改过!');\n }\n }\n } catch (error) {\n ElMessage.error('文件解析失败,请检查文件是否为有效的 JSON 格式!');\n }\n };\n reader.readAsText(file);\n};\n\nconst exportReport = () => {\n if (tableSelections.value.length > 0) {\n const jsonData = JSON.stringify(\n tableSelections.value.map(({code, config, description, name}) => {\n return {\n code,\n config,\n description,\n name,\n };\n }),\n null,\n 2\n );\n const blob = new Blob([jsonData], {type: 'application/json'});\n\n const url = URL.createObjectURL(blob);\n\n const formattedDate = dayjs().format('YYYYMMDDHHmm');\n const fileName = `报表导出-${formattedDate}.json`;\n\n const a = document.createElement('a');\n a.href = url;\n a.download = fileName;\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n\n URL.revokeObjectURL(url);\n } else {\n ElMessage.warning('请选择要操作的报表!');\n }\n};\n\nfunction toDesign(row) {\n router.push(`/admin/statement/design/${row.id}`);\n}\n\nfunction toView(row) {\n router.push(`/admin/statement/detail/${row.id}`);\n}\n\nonMounted(() => {\n getStatementList(true);\n});\n\n//新增报表\nconst dialogFormVisible = ref(false);\nconst form = reactive({\n id: undefined,\n name: '',\n code: '',\n description: '',\n});\n\nfunction toAddForm() {\n dialogFormVisible.value = true;\n}\n\nfunction toEditor(row) {\n dialogFormVisible.value = true;\n form.id = row.id;\n form.name = row.name;\n form.code = row.code;\n form.description = row.description;\n}\n\nfunction toDelete(row) {\n ElMessageBox.confirm('当前操作会删除选定的报表,确认继续吗?', '警告', {\n confirmButtonText: '删除',\n cancelButtonText: '取消',\n type: 'warning',\n }).then(async () => {\n let res = await del(row.id);\n if (res.data) {\n getStatementList(true);\n }\n });\n}\n\nfunction cancelForm() {\n dialogFormVisible.value = false;\n form.id = undefined;\n form.name = '';\n form.code = '';\n form.description = '';\n}\nasync function saveForm() {\n await save(form);\n getStatementList(true);\n cancelForm();\n}\n\n//搜索报表\nfunction onSearch(e?) {\n if (e) {\n e.preventDefault();\n e.stopPropagation();\n }\n getStatementList(false);\n}\n\n//重置\nfunction onReset() {\n listForm.key = '';\n getStatementList(true);\n}\n\n//分页功能\nwatch(\n () => listForm.pageNumber,\n () => {\n getStatementList();\n }\n);\nwatch(\n () => listForm.pageSize,\n () => {\n getStatementList();\n }\n);\n</script>\n\n<style lang=\"scss\">\n.statement-list-container {\n width: 100%;\n height: 100%;\n padding: 10px 0 0;\n box-sizing: border-box;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n\n .actions {\n display: flex;\n align-items: center;\n\n .form-context {\n flex: 1;\n margin: 0 10px;\n display: flex;\n }\n\n .el-form-item {\n margin-bottom: 0;\n margin-right: 10px;\n }\n }\n\n .el-table {\n flex: 1;\n }\n\n .el-dialog {\n .el-button--text {\n margin-right: 15px;\n }\n\n .el-form-item {\n width: 100%;\n }\n\n .el-select {\n width: 100%;\n }\n\n .el-input {\n width: 100%;\n }\n\n .dialog-footer button:first-child {\n margin-right: 10px;\n }\n }\n .import-excel-button {\n position: relative;\n .import-excel-input {\n position: absolute;\n left: 0;\n top: 0;\n opacity: 0;\n width: 100%;\n height: 100%;\n z-index: 10;\n }\n }\n}\n</style>\n"],"names":["router","useRouter","listForm","reactive","data","ref","getStatementList","flag","res","getList","copyLink","row","type","href","hrefName","copyString","ElMessage","tableSelections","selectionChangeHandle","selections","importReport","e","file","reader","event","jsonData","item","loading","ElLoading","i","save","exportReport","code","config","description","name","blob","url","fileName","dayjs","a","toDesign","toView","onMounted","dialogFormVisible","form","toAddForm","toEditor","toDelete","ElMessageBox","del","cancelForm","saveForm","onSearch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