jmash-region 0.0.3 → 0.0.6

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,550 +0,0 @@
1
- import { defineComponent as H, ref as w, resolveComponent as p, openBlock as m, createBlock as f, unref as u, withCtx as a, createCommentVNode as T, createElementBlock as $, Fragment as K, renderList as ue, renderSlot as pe, resolveDirective as me, createElementVNode as N, createVNode as i, withKeys as ce, createTextVNode as _, toDisplayString as g, withDirectives as R, isRef as ge } from "vue";
2
- import { useTableHooks as fe } from "jmash-core";
3
- import { d as E } from "./index-C1Hml01a.mjs";
4
- import { D as P, _ as ve, C as be } from "./edit.vue_vue_type_script_setup_true_lang-DIB1Rij-.mjs";
5
- import { ElTable as ye, ElMessageBox as _e, ElMessage as he } from "element-plus";
6
- import { useI18n as Ce } from "vue-i18n";
7
- const we = /* @__PURE__ */ H({
8
- __name: "index",
9
- props: {
10
- // 表头
11
- tableLabel: {
12
- type: Array,
13
- default: () => []
14
- },
15
- // 是否显示复选框
16
- isSelection: {
17
- type: Boolean,
18
- default: !0
19
- }
20
- },
21
- setup(L, { expose: c }) {
22
- const r = w();
23
- return c({
24
- clearSelection: () => {
25
- var t;
26
- return (t = r.value) == null ? void 0 : t.clearSelection();
27
- },
28
- getSelectionRows: () => {
29
- var t;
30
- return (t = r.value) == null ? void 0 : t.getSelectionRows();
31
- },
32
- toggleRowSelection: (t, n) => {
33
- var d;
34
- return (d = r.value) == null ? void 0 : d.toggleRowSelection(t, n);
35
- },
36
- toggleAllSelection: () => {
37
- var t;
38
- return (t = r.value) == null ? void 0 : t.toggleAllSelection();
39
- },
40
- toggleRowExpansion: (t, n) => {
41
- var d;
42
- return (d = r.value) == null ? void 0 : d.toggleRowExpansion(t, n);
43
- },
44
- setCurrentRow: (t) => {
45
- var n;
46
- return (n = r.value) == null ? void 0 : n.setCurrentRow(t);
47
- },
48
- clearSort: () => {
49
- var t;
50
- return (t = r.value) == null ? void 0 : t.clearSort();
51
- },
52
- clearFilter: (t) => {
53
- var n;
54
- return (n = r.value) == null ? void 0 : n.clearFilter(t);
55
- },
56
- doLayout: () => {
57
- var t;
58
- return (t = r.value) == null ? void 0 : t.doLayout();
59
- },
60
- sort: (t, n) => {
61
- var d;
62
- return (d = r.value) == null ? void 0 : d.sort(t, n);
63
- },
64
- scrollTo: (t, n) => {
65
- var d;
66
- return (d = r.value) == null ? void 0 : d.scrollTo(t, n);
67
- },
68
- setScrollTop: (t) => {
69
- var n;
70
- return (n = r.value) == null ? void 0 : n.setScrollTop(t);
71
- },
72
- setScrollLeft: (t) => {
73
- var n;
74
- return (n = r.value) == null ? void 0 : n.setScrollLeft(t);
75
- },
76
- refs: () => r.value
77
- }), (t, n) => {
78
- const d = p("el-table-column");
79
- return m(), f(u(ye), {
80
- ref_key: "tableRef",
81
- ref: r,
82
- "tree-props": { children: "children", hasChildren: "hasChildren" },
83
- fit: "",
84
- border: !0,
85
- "highlight-current-row": "",
86
- style: { width: "100%" }
87
- }, {
88
- default: a(() => [
89
- L.isSelection ? (m(), f(d, {
90
- key: 0,
91
- type: "selection",
92
- align: "center",
93
- "reserve-selection": !0,
94
- fixed: ""
95
- })) : T("", !0),
96
- (m(!0), $(K, null, ue(L.tableLabel, (s) => (m(), $(K, {
97
- key: s.prop
98
- }, [
99
- s.columnType === "slot" && s.isColumn ? (m(), f(d, {
100
- key: 0,
101
- label: t.$t(s.label),
102
- prop: s.prop,
103
- width: s.width,
104
- "show-overflow-tooltip": !0,
105
- fixed: s.fixed,
106
- sortable: s.sortable,
107
- type: s.type
108
- }, {
109
- default: a((x) => [
110
- pe(t.$slots, s.slotName, { data: x })
111
- ]),
112
- _: 2
113
- }, 1032, ["label", "prop", "width", "fixed", "sortable", "type"])) : T("", !0),
114
- s.columnType !== "slot" && s.isColumn ? (m(), f(d, {
115
- key: 1,
116
- label: t.$t(s.label),
117
- prop: s.prop,
118
- width: s.width,
119
- "show-overflow-tooltip": !0,
120
- fixed: s.fixed,
121
- sortable: s.sortable,
122
- type: s.type
123
- }, null, 8, ["label", "prop", "width", "fixed", "sortable", "type"])) : T("", !0)
124
- ], 64))), 128))
125
- ]),
126
- _: 3
127
- }, 512);
128
- };
129
- }
130
- }), ke = { class: "app-container" }, Re = { class: "search-container" }, $e = ["onClick"], Te = ["onClick"], Se = ["onClick"], De = /* @__PURE__ */ H({
131
- __name: "index",
132
- setup(L) {
133
- const { t: c } = Ce(), r = w({
134
- likeRegionName: void 0,
135
- enable: void 0,
136
- parentId: void 0
137
- }), t = w([
138
- {
139
- label: "dictRegion.regionName",
140
- prop: "regionName",
141
- sortable: "custom",
142
- isColumn: !0
143
- },
144
- {
145
- label: "dictRegion.regionCode",
146
- prop: "regionCode",
147
- width: "150",
148
- sortable: "custom",
149
- isColumn: !0
150
- },
151
- {
152
- label: "dictRegion.regionType",
153
- prop: "regionType",
154
- slotName: "regionType",
155
- columnType: "slot",
156
- sortable: "custom",
157
- width: "120",
158
- isColumn: !0
159
- },
160
- {
161
- label: "dictRegion.regionCategory",
162
- prop: "regionCategory",
163
- slotName: "regionCategory",
164
- columnType: "slot",
165
- sortable: "custom",
166
- width: "120",
167
- isColumn: !0
168
- },
169
- {
170
- label: "dictRegion.enable",
171
- prop: "enable",
172
- slotName: "enable",
173
- sortable: "custom",
174
- width: "120",
175
- columnType: "slot",
176
- isColumn: !0
177
- },
178
- {
179
- label: "dictRegion.orderBy",
180
- prop: "orderBy",
181
- slotName: "orderBy",
182
- columnType: "slot",
183
- sortable: "custom",
184
- width: "120",
185
- isColumn: !0
186
- },
187
- {
188
- label: "common.operate",
189
- width: "200",
190
- slotName: "operation",
191
- columnType: "slot",
192
- fixed: "right",
193
- isColumn: !0
194
- }
195
- ]), {
196
- tableHooks: n,
197
- multipleTableRef: d,
198
- queryFormRef: s,
199
- listLoading: x,
200
- tableData: G,
201
- total: I
202
- } = fe(c, E, r), v = w({
203
- title: c("common.edit"),
204
- visible: !1
205
- }), D = w({}), B = w(""), j = (e) => {
206
- D.value = {}, B.value = e, v.value.title = c("common.add"), v.value.visible = !0;
207
- }, J = (e) => {
208
- B.value = "", D.value = e, v.value.title = c("common.edit"), v.value.visible = !0;
209
- }, S = w(!1), O = (e) => {
210
- e.updateMask = "", n.importExcel(e).then((o) => {
211
- S.value = !1;
212
- });
213
- }, W = () => {
214
- S.value = !1;
215
- }, X = (e) => {
216
- n.handleSort(e.prop, e.order);
217
- };
218
- n.getList();
219
- const U = /* @__PURE__ */ new Map(), A = (e, o, b) => {
220
- U.set(e.regionId, { row: e, treeNode: o, resolve: b }), E.findList({ parentId: e.regionId }).then(({ data: y }) => {
221
- if (b(y.results), !y.results.length) {
222
- const { store: h } = d.value.refs();
223
- h.states.lazyTreeNodeMap.value[e.regionId] = [];
224
- }
225
- });
226
- }, Y = (e) => {
227
- e && n.getList();
228
- }, F = (e, o) => {
229
- E.move({ regionId: e.regionId }, o).then((b) => {
230
- b.status === 200 && !z(e.parentId) && n.getList();
231
- });
232
- }, Z = (e) => {
233
- _e.confirm(c("common.confirmDelete"), c("common.delete"), {
234
- cancelButtonText: c("common.cancel"),
235
- confirmButtonText: c("common.confirm"),
236
- type: "warning"
237
- }).then(() => E.delete({ regionId: e.regionId })).then((o) => {
238
- o.status === 200 && (he({
239
- message: c("common.deleteSuccess"),
240
- type: "success"
241
- }), !z(e.parentId) && n.handleQuery());
242
- });
243
- }, ee = (e) => {
244
- if (!e.parentId || e.parentId === be.DEFAULT_ID) {
245
- n.getList();
246
- return;
247
- }
248
- z(e.parentId);
249
- }, z = (e) => {
250
- if (!U.has(e) || !e) return !1;
251
- const { row: o, treeNode: b, resolve: y } = U.get(e);
252
- return A(o, b, y), !0;
253
- };
254
- return (e, o) => {
255
- const b = p("el-input"), y = p("el-form-item"), h = p("el-col"), oe = p("jmash-select"), V = p("el-button"), M = p("el-row"), te = p("el-form"), le = p("jmash-column-select"), ne = p("el-switch"), ae = p("Bottom"), Q = p("el-icon"), q = p("el-tooltip"), re = p("Top"), ie = p("jmash-pagination"), se = p("el-card"), de = p("jmash-import-upload"), k = me("hasPerm");
256
- return m(), $("div", ke, [
257
- N("div", Re, [
258
- i(te, {
259
- ref_key: "queryFormRef",
260
- ref: s,
261
- model: r.value,
262
- inline: !0
263
- }, {
264
- default: a(() => [
265
- i(M, null, {
266
- default: a(() => [
267
- i(h, { span: 6 }, {
268
- default: a(() => [
269
- i(y, {
270
- label: e.$t("dictRegion.regionName"),
271
- prop: "likeRegionName"
272
- }, {
273
- default: a(() => [
274
- i(b, {
275
- modelValue: r.value.likeRegionName,
276
- "onUpdate:modelValue": o[0] || (o[0] = (l) => r.value.likeRegionName = l),
277
- placeholder: e.$t("dictRegion.regionNamePlaceholder"),
278
- onKeyup: o[1] || (o[1] = ce((l) => u(n).handleQuery(), ["enter"])),
279
- class: "!w-[203px]"
280
- }, null, 8, ["modelValue", "placeholder"])
281
- ]),
282
- _: 1
283
- }, 8, ["label"])
284
- ]),
285
- _: 1
286
- }),
287
- i(h, { span: 6 }, {
288
- default: a(() => [
289
- i(y, {
290
- label: e.$t("dictRegion.enable"),
291
- prop: "enable"
292
- }, {
293
- default: a(() => [
294
- i(oe, {
295
- modelValue: r.value.enable,
296
- "onUpdate:modelValue": o[2] || (o[2] = (l) => r.value.enable = l),
297
- placeholder: e.$t("dictRegion.enablePlaceholder"),
298
- data: u(P).enableDict.values,
299
- clearable: "",
300
- class: "!w-[203px]",
301
- onChange: o[3] || (o[3] = (l) => u(n).handleQuery())
302
- }, null, 8, ["modelValue", "placeholder", "data"])
303
- ]),
304
- _: 1
305
- }, 8, ["label"])
306
- ]),
307
- _: 1
308
- }),
309
- i(h, {
310
- span: 6,
311
- style: { "margin-left": "auto" }
312
- }, {
313
- default: a(() => [
314
- i(y, { class: "search-btn" }, {
315
- default: a(() => [
316
- i(V, {
317
- type: "primary",
318
- onClick: o[4] || (o[4] = (l) => u(n).handleQuery())
319
- }, {
320
- default: a(() => [
321
- _(g(e.$t("common.search")), 1)
322
- ]),
323
- _: 1
324
- }),
325
- i(V, {
326
- onClick: o[5] || (o[5] = (l) => u(n).resetQuery())
327
- }, {
328
- default: a(() => [
329
- _(g(e.$t("common.reset")), 1)
330
- ]),
331
- _: 1
332
- })
333
- ]),
334
- _: 1
335
- })
336
- ]),
337
- _: 1
338
- })
339
- ]),
340
- _: 1
341
- })
342
- ]),
343
- _: 1
344
- }, 8, ["model"]),
345
- o[16] || (o[16] = N("div", { class: "clear" }, null, -1))
346
- ]),
347
- i(se, {
348
- shadow: "never",
349
- class: "table-container"
350
- }, {
351
- header: a(() => [
352
- i(M, null, {
353
- default: a(() => [
354
- i(h, { span: 17 }, {
355
- default: a(() => [
356
- R((m(), f(V, {
357
- type: "primary",
358
- onClick: o[6] || (o[6] = (l) => j())
359
- }, {
360
- default: a(() => [
361
- _(g(e.$t("common.add")), 1)
362
- ]),
363
- _: 1
364
- })), [
365
- [k, ["region:dict_region:add"]]
366
- ])
367
- ]),
368
- _: 1
369
- }),
370
- i(h, {
371
- span: 7,
372
- class: "container-float"
373
- }, {
374
- default: a(() => [
375
- R((m(), f(V, {
376
- plain: "",
377
- type: "primary",
378
- onClick: o[7] || (o[7] = (l) => S.value = !0)
379
- }, {
380
- default: a(() => [
381
- _(g(e.$t("common.import")), 1)
382
- ]),
383
- _: 1
384
- })), [
385
- [k, ["region:dict_region:import"]]
386
- ]),
387
- R((m(), f(V, {
388
- plain: "",
389
- type: "primary",
390
- onClick: o[8] || (o[8] = (l) => u(n).handleExport(u(c)("dictRegion.name")))
391
- }, {
392
- default: a(() => [
393
- _(g(e.$t("common.export")), 1)
394
- ]),
395
- _: 1
396
- })), [
397
- [k, ["region:dict_region:export"]]
398
- ]),
399
- i(le, {
400
- modelValue: t.value,
401
- "onUpdate:modelValue": o[9] || (o[9] = (l) => t.value = l),
402
- "label-name": "region/os-dict-region"
403
- }, null, 8, ["modelValue"])
404
- ]),
405
- _: 1
406
- })
407
- ]),
408
- _: 1
409
- })
410
- ]),
411
- footer: a(() => [
412
- u(I) > 0 ? (m(), f(ie, {
413
- key: 0,
414
- total: u(I),
415
- "onUpdate:total": o[10] || (o[10] = (l) => ge(I) ? I.value = l : null),
416
- "current-page": r.value.curPage,
417
- "onUpdate:currentPage": o[11] || (o[11] = (l) => r.value.curPage = l),
418
- "page-size": r.value.pageSize,
419
- "onUpdate:pageSize": o[12] || (o[12] = (l) => r.value.pageSize = l),
420
- onPagination: o[13] || (o[13] = (l) => u(n).getList())
421
- }, null, 8, ["total", "current-page", "page-size"])) : T("", !0)
422
- ]),
423
- default: a(() => [
424
- i(we, {
425
- ref_key: "multipleTableRef",
426
- ref: d,
427
- "row-key": "regionId",
428
- lazy: "",
429
- "list-loading": u(x),
430
- data: u(G),
431
- "table-label": t.value,
432
- "tree-props": { children: "children", hasChildren: "hasChildren" },
433
- "is-selection": !1,
434
- load: A,
435
- onSortChange: X
436
- }, {
437
- regionType: a((l) => [
438
- N("span", null, g(u(P).regionTypeEnum.getEnumValue(l.data.row.regionType)), 1)
439
- ]),
440
- regionCategory: a((l) => [
441
- N("span", null, g(u(P).regionCategoryEnum.getEnumValue(
442
- l.data.row.regionCategory
443
- )), 1)
444
- ]),
445
- enable: a((l) => [
446
- i(ne, {
447
- modelValue: l.data.row.enable,
448
- "onUpdate:modelValue": (C) => l.data.row.enable = C,
449
- onChange: (C) => u(n).enableRecord(l.data.row, l.data.row.enable)
450
- }, null, 8, ["modelValue", "onUpdate:modelValue", "onChange"])
451
- ]),
452
- orderBy: a((l) => [
453
- i(q, {
454
- class: "box-item",
455
- effect: "dark",
456
- content: "下移",
457
- placement: "top"
458
- }, {
459
- default: a(() => [
460
- i(Q, {
461
- style: { cursor: "pointer" },
462
- size: "16",
463
- onClick: (C) => F(l.data.row, !1)
464
- }, {
465
- default: a(() => [
466
- i(ae)
467
- ]),
468
- _: 2
469
- }, 1032, ["onClick"])
470
- ]),
471
- _: 2
472
- }, 1024),
473
- i(q, {
474
- class: "box-item",
475
- effect: "dark",
476
- content: "上移",
477
- placement: "top"
478
- }, {
479
- default: a(() => [
480
- i(Q, {
481
- style: { cursor: "pointer" },
482
- size: "16",
483
- onClick: (C) => F(l.data.row, !0)
484
- }, {
485
- default: a(() => [
486
- i(re)
487
- ]),
488
- _: 2
489
- }, 1032, ["onClick"])
490
- ]),
491
- _: 2
492
- }, 1024)
493
- ]),
494
- operation: a((l) => [
495
- R((m(), $("span", {
496
- class: "el-button-color",
497
- onClick: (C) => j(l.data.row.regionId)
498
- }, [
499
- _(g(e.$t("dictRegion.addChild")), 1)
500
- ], 8, $e)), [
501
- [k, ["region:dict_region:add"]]
502
- ]),
503
- R((m(), $("span", {
504
- class: "el-button-color dropdown-left",
505
- onClick: (C) => J(l.data.row)
506
- }, [
507
- _(g(e.$t("common.edit")), 1)
508
- ], 8, Te)), [
509
- [k, ["region:dict_region:update"]]
510
- ]),
511
- R((m(), $("span", {
512
- class: "el-button-color dropdown-left",
513
- onClick: (C) => Z(l.data.row)
514
- }, [
515
- _(g(e.$t("common.delete")), 1)
516
- ], 8, Se)), [
517
- [k, ["region:dict_region:delete"]]
518
- ])
519
- ]),
520
- _: 1
521
- }, 8, ["list-loading", "data", "table-label"])
522
- ]),
523
- _: 1
524
- }),
525
- v.value.visible ? (m(), f(ve, {
526
- key: 0,
527
- modelValue: v.value.visible,
528
- "onUpdate:modelValue": o[14] || (o[14] = (l) => v.value.visible = l),
529
- title: v.value.title,
530
- "entity-key": D.value,
531
- "parent-id": B.value,
532
- onRefresh: Y,
533
- onReload: ee,
534
- width: "900px"
535
- }, null, 8, ["modelValue", "title", "entity-key", "parent-id"])) : T("", !0),
536
- S.value ? (m(), f(de, {
537
- key: 1,
538
- "upload-visible": S.value,
539
- "template-title": e.$t("sysUser.templateDownload"),
540
- onTemplateDown: o[15] || (o[15] = (l) => u(n).downloadTemplate(u(c)("dictRegion.name"))),
541
- onImportEvents: O,
542
- onUploadClosed: W
543
- }, null, 8, ["upload-visible", "template-title"])) : T("", !0)
544
- ]);
545
- };
546
- }
547
- });
548
- export {
549
- De as default
550
- };
@@ -1,47 +0,0 @@
1
- import { type PropType } from "vue";
2
- import type { TableColumn } from "jmash-core";
3
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<globalThis.ExtractPropTypes<{
4
- tableLabel: {
5
- type: PropType<TableColumn[]>;
6
- default: () => never[];
7
- };
8
- isSelection: {
9
- type: BooleanConstructor;
10
- default: boolean;
11
- };
12
- }>, {
13
- clearSelection: () => any;
14
- getSelectionRows: () => any;
15
- toggleRowSelection: (row: any, selected: boolean) => any;
16
- toggleAllSelection: () => any;
17
- toggleRowExpansion: (row: any, expanded?: boolean | undefined) => any;
18
- setCurrentRow: (row: any) => any;
19
- clearSort: () => any;
20
- clearFilter: (columnKeys?: string[] | undefined) => any;
21
- doLayout: () => any;
22
- sort: (prop: string, order: string) => any;
23
- scrollTo: (options: number | ScrollToOptions, yCoord?: number | undefined) => any;
24
- setScrollTop: (top?: number | undefined) => any;
25
- setScrollLeft: (left?: number | undefined) => any;
26
- refs: () => any;
27
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
28
- tableLabel: {
29
- type: PropType<TableColumn[]>;
30
- default: () => never[];
31
- };
32
- isSelection: {
33
- type: BooleanConstructor;
34
- default: boolean;
35
- };
36
- }>> & Readonly<{}>, {
37
- tableLabel: TableColumn[];
38
- isSelection: boolean;
39
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, Partial<Record<string, (_: {
40
- data: any;
41
- }) => any>>>;
42
- export default _default;
43
- type __VLS_WithTemplateSlots<T, S> = T & {
44
- new (): {
45
- $slots: S;
46
- };
47
- };