jmash-region 0.1.4 → 0.2.0

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.
@@ -0,0 +1,411 @@
1
+ import { defineComponent as ie, ref as b, resolveComponent as a, resolveDirective as re, openBlock as m, createElementBlock as $, createElementVNode as R, createVNode as n, withCtx as l, withKeys as de, unref as r, createTextVNode as g, toDisplayString as s, withDirectives as h, createBlock as w, createCommentVNode as Q } from "vue";
2
+ import { useTableHooks as se } from "jmash-core";
3
+ import { d as T } from "./index-20SqsuLj.mjs";
4
+ import { D as B, _ as me, C as ue } from "./edit.vue_vue_type_script_setup_true_lang-Bl3mhGbV.mjs";
5
+ import { useI18n as pe } from "vue-i18n";
6
+ import { ElMessageBox as ce, ElMessage as ge } from "element-plus";
7
+ const fe = { class: "app-container" }, ve = { class: "search-container" }, _e = ["onClick"], ye = ["onClick"], be = ["onClick"], Ie = /* @__PURE__ */ ie({
8
+ __name: "index",
9
+ setup(he) {
10
+ const { t: d } = pe(), f = b({
11
+ likeRegionName: void 0,
12
+ enable: void 0,
13
+ parentId: void 0
14
+ }), V = b([
15
+ {
16
+ label: "dictRegion.regionName",
17
+ prop: "regionName",
18
+ isColumn: !0,
19
+ minWidth: "300"
20
+ },
21
+ {
22
+ label: "dictRegion.regionCode",
23
+ prop: "regionCode",
24
+ width: "100",
25
+ isColumn: !0
26
+ },
27
+ {
28
+ label: "dictRegion.regionType",
29
+ prop: "regionType",
30
+ slotName: "regionType",
31
+ columnType: "slot",
32
+ width: "100",
33
+ isColumn: !0
34
+ },
35
+ {
36
+ label: "dictRegion.regionCategory",
37
+ prop: "regionCategory",
38
+ slotName: "regionCategory",
39
+ columnType: "slot",
40
+ width: "100",
41
+ isColumn: !0
42
+ },
43
+ {
44
+ label: "dictRegion.enable",
45
+ prop: "enable",
46
+ slotName: "enable",
47
+ width: "100",
48
+ columnType: "slot",
49
+ isColumn: !0
50
+ },
51
+ {
52
+ label: "dictRegion.orderBy",
53
+ prop: "orderBy",
54
+ slotName: "orderBy",
55
+ columnType: "slot",
56
+ width: "70",
57
+ isColumn: !0
58
+ },
59
+ {
60
+ label: "common.operate",
61
+ width: "200",
62
+ slotName: "operation",
63
+ columnType: "slot",
64
+ fixed: "right",
65
+ isColumn: !0
66
+ }
67
+ ]), {
68
+ tableHooks: i,
69
+ multipleTableRef: L,
70
+ queryFormRef: S,
71
+ listLoading: q,
72
+ tableData: A,
73
+ total: Ce
74
+ } = se(d, T, f), u = b({
75
+ title: d("common.edit"),
76
+ visible: !1
77
+ }), I = b({}), N = b(""), U = (e) => {
78
+ I.value = {}, N.value = e, u.value.title = d("common.add"), u.value.visible = !0;
79
+ }, F = (e) => {
80
+ N.value = "", I.value = e, u.value.title = d("common.edit"), u.value.visible = !0;
81
+ }, C = b(!1), K = (e) => {
82
+ e.updateMask = "", i.importExcel(e).then((o) => {
83
+ C.value = !1;
84
+ });
85
+ }, H = () => {
86
+ C.value = !1;
87
+ }, W = (e) => {
88
+ i.handleSort(e.prop, e.order);
89
+ };
90
+ i.getList();
91
+ const D = /* @__PURE__ */ new Map(), j = (e, o, p) => {
92
+ D.set(e.regionId, { row: e, treeNode: o, resolve: p }), T.findList({ ...f.value, parentId: e.regionId }).then(({ data: c }) => {
93
+ if (p(c.results), !c.results.length) {
94
+ const { store: v } = L.value.refs();
95
+ v.states.lazyTreeNodeMap.value[e.regionId] = [];
96
+ }
97
+ });
98
+ }, G = (e) => {
99
+ e && i.getList();
100
+ }, x = (e, o) => {
101
+ T.move({ regionId: e.regionId }, o).then((p) => {
102
+ p.status === 200 && !E(e.parentId) && i.getList();
103
+ });
104
+ }, J = (e) => {
105
+ ce.confirm(d("common.confirmDelete"), d("common.delete"), {
106
+ cancelButtonText: d("common.cancel"),
107
+ confirmButtonText: d("common.confirm"),
108
+ type: "warning"
109
+ }).then(() => T.delete({ regionId: e.regionId })).then((o) => {
110
+ o.status === 200 && (ge({
111
+ message: d("common.deleteSuccess"),
112
+ type: "success"
113
+ }), !E(e.parentId) && i.handleQuery());
114
+ });
115
+ }, O = (e) => {
116
+ if (!e.parentId || e.parentId === ue.DEFAULT_ID) {
117
+ i.getList();
118
+ return;
119
+ }
120
+ E(e.parentId);
121
+ }, E = (e) => {
122
+ if (!D.has(e) || !e) return !1;
123
+ const { row: o, treeNode: p, resolve: c } = D.get(e);
124
+ return j(o, p, c), !0;
125
+ };
126
+ return (e, o) => {
127
+ const p = a("el-input"), c = a("el-form-item"), v = a("el-col"), X = a("jmash-select"), k = a("el-button"), M = a("el-row"), Y = a("el-form"), Z = a("jmash-column-select"), ee = a("el-switch"), oe = a("Bottom"), z = a("el-icon"), P = a("el-tooltip"), te = a("Top"), le = a("jmash-table"), ne = a("el-card"), ae = a("jmash-import-upload"), y = re("hasPerm");
128
+ return m(), $("div", fe, [
129
+ R("div", ve, [
130
+ n(Y, {
131
+ ref_key: "queryFormRef",
132
+ ref: S,
133
+ model: f.value,
134
+ inline: !0
135
+ }, {
136
+ default: l(() => [
137
+ n(M, null, {
138
+ default: l(() => [
139
+ n(v, { span: 6 }, {
140
+ default: l(() => [
141
+ n(c, {
142
+ label: e.$t("dictRegion.regionName"),
143
+ prop: "likeRegionName"
144
+ }, {
145
+ default: l(() => [
146
+ n(p, {
147
+ modelValue: f.value.likeRegionName,
148
+ "onUpdate:modelValue": o[0] || (o[0] = (t) => f.value.likeRegionName = t),
149
+ placeholder: e.$t("dictRegion.regionNamePlaceholder"),
150
+ onKeyup: o[1] || (o[1] = de((t) => r(i).handleQuery(), ["enter"])),
151
+ class: "!w-[203px]"
152
+ }, null, 8, ["modelValue", "placeholder"])
153
+ ]),
154
+ _: 1
155
+ }, 8, ["label"])
156
+ ]),
157
+ _: 1
158
+ }),
159
+ n(v, { span: 6 }, {
160
+ default: l(() => [
161
+ n(c, {
162
+ label: e.$t("dictRegion.enable"),
163
+ prop: "enable"
164
+ }, {
165
+ default: l(() => [
166
+ n(X, {
167
+ modelValue: f.value.enable,
168
+ "onUpdate:modelValue": o[2] || (o[2] = (t) => f.value.enable = t),
169
+ placeholder: e.$t("dictRegion.enablePlaceholder"),
170
+ data: r(B).enableDict.values,
171
+ clearable: "",
172
+ class: "!w-[203px]",
173
+ onChange: o[3] || (o[3] = (t) => r(i).handleQuery())
174
+ }, null, 8, ["modelValue", "placeholder", "data"])
175
+ ]),
176
+ _: 1
177
+ }, 8, ["label"])
178
+ ]),
179
+ _: 1
180
+ }),
181
+ n(v, {
182
+ span: 6,
183
+ style: { "margin-left": "auto" }
184
+ }, {
185
+ default: l(() => [
186
+ n(c, { class: "search-btn" }, {
187
+ default: l(() => [
188
+ n(k, {
189
+ type: "primary",
190
+ onClick: o[4] || (o[4] = (t) => r(i).handleQuery())
191
+ }, {
192
+ default: l(() => [
193
+ g(s(e.$t("common.search")), 1)
194
+ ]),
195
+ _: 1
196
+ }),
197
+ n(k, {
198
+ onClick: o[5] || (o[5] = (t) => r(i).resetQuery())
199
+ }, {
200
+ default: l(() => [
201
+ g(s(e.$t("common.reset")), 1)
202
+ ]),
203
+ _: 1
204
+ })
205
+ ]),
206
+ _: 1
207
+ })
208
+ ]),
209
+ _: 1
210
+ })
211
+ ]),
212
+ _: 1
213
+ })
214
+ ]),
215
+ _: 1
216
+ }, 8, ["model"]),
217
+ o[12] || (o[12] = R("div", { class: "clear" }, null, -1))
218
+ ]),
219
+ n(ne, {
220
+ shadow: "never",
221
+ class: "table-container"
222
+ }, {
223
+ header: l(() => [
224
+ n(M, null, {
225
+ default: l(() => [
226
+ n(v, { span: 17 }, {
227
+ default: l(() => [
228
+ h((m(), w(k, {
229
+ type: "primary",
230
+ onClick: o[6] || (o[6] = (t) => U())
231
+ }, {
232
+ default: l(() => [
233
+ g(s(e.$t("common.add")), 1)
234
+ ]),
235
+ _: 1
236
+ })), [
237
+ [y, ["region:dict_region:add"]]
238
+ ])
239
+ ]),
240
+ _: 1
241
+ }),
242
+ n(v, {
243
+ span: 7,
244
+ class: "container-float"
245
+ }, {
246
+ default: l(() => [
247
+ h((m(), w(k, {
248
+ plain: "",
249
+ type: "primary",
250
+ onClick: o[7] || (o[7] = (t) => C.value = !0)
251
+ }, {
252
+ default: l(() => [
253
+ g(s(e.$t("common.import")), 1)
254
+ ]),
255
+ _: 1
256
+ })), [
257
+ [y, ["region:dict_region:import"]]
258
+ ]),
259
+ h((m(), w(k, {
260
+ plain: "",
261
+ type: "primary",
262
+ onClick: o[8] || (o[8] = (t) => r(i).handleExport(r(d)("dictRegion.name")))
263
+ }, {
264
+ default: l(() => [
265
+ g(s(e.$t("common.export")), 1)
266
+ ]),
267
+ _: 1
268
+ })), [
269
+ [y, ["region:dict_region:export"]]
270
+ ]),
271
+ n(Z, {
272
+ modelValue: V.value,
273
+ "onUpdate:modelValue": o[9] || (o[9] = (t) => V.value = t),
274
+ "label-name": "region/os-dict-region"
275
+ }, null, 8, ["modelValue"])
276
+ ]),
277
+ _: 1
278
+ })
279
+ ]),
280
+ _: 1
281
+ })
282
+ ]),
283
+ footer: l(() => o[13] || (o[13] = [])),
284
+ default: l(() => [
285
+ n(le, {
286
+ ref_key: "multipleTableRef",
287
+ ref: L,
288
+ "row-key": "regionId",
289
+ lazy: "",
290
+ "list-loading": r(q),
291
+ data: r(A),
292
+ "table-label": V.value,
293
+ "tree-props": { children: "children", hasChildren: "hasChildren" },
294
+ "is-selection": !1,
295
+ load: j,
296
+ onSortChange: W
297
+ }, {
298
+ regionType: l((t) => [
299
+ R("span", null, s(r(B).regionTypeEnum.getEnumValue(t.data.row.regionType)), 1)
300
+ ]),
301
+ regionCategory: l((t) => [
302
+ R("span", null, s(r(B).regionCategoryEnum.getEnumValue(
303
+ t.data.row.regionCategory
304
+ )), 1)
305
+ ]),
306
+ enable: l((t) => [
307
+ n(ee, {
308
+ modelValue: t.data.row.enable,
309
+ "onUpdate:modelValue": (_) => t.data.row.enable = _,
310
+ onChange: (_) => r(i).enableRecord(t.data.row, t.data.row.enable)
311
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "onChange"])
312
+ ]),
313
+ orderBy: l((t) => [
314
+ n(P, {
315
+ class: "box-item",
316
+ effect: "dark",
317
+ content: "下移",
318
+ placement: "top"
319
+ }, {
320
+ default: l(() => [
321
+ n(z, {
322
+ style: { cursor: "pointer" },
323
+ size: "16",
324
+ onClick: (_) => x(t.data.row, !1)
325
+ }, {
326
+ default: l(() => [
327
+ n(oe)
328
+ ]),
329
+ _: 2
330
+ }, 1032, ["onClick"])
331
+ ]),
332
+ _: 2
333
+ }, 1024),
334
+ n(P, {
335
+ class: "box-item",
336
+ effect: "dark",
337
+ content: "上移",
338
+ placement: "top"
339
+ }, {
340
+ default: l(() => [
341
+ n(z, {
342
+ style: { cursor: "pointer" },
343
+ size: "16",
344
+ onClick: (_) => x(t.data.row, !0)
345
+ }, {
346
+ default: l(() => [
347
+ n(te)
348
+ ]),
349
+ _: 2
350
+ }, 1032, ["onClick"])
351
+ ]),
352
+ _: 2
353
+ }, 1024)
354
+ ]),
355
+ operation: l((t) => [
356
+ h((m(), $("span", {
357
+ class: "el-button-color",
358
+ onClick: (_) => U(t.data.row.regionId)
359
+ }, [
360
+ g(s(e.$t("dictRegion.addChild")), 1)
361
+ ], 8, _e)), [
362
+ [y, ["region:dict_region:add"]]
363
+ ]),
364
+ h((m(), $("span", {
365
+ class: "el-button-color dropdown-left",
366
+ onClick: (_) => F(t.data.row)
367
+ }, [
368
+ g(s(e.$t("common.edit")), 1)
369
+ ], 8, ye)), [
370
+ [y, ["region:dict_region:update"]]
371
+ ]),
372
+ h((m(), $("span", {
373
+ class: "el-button-color dropdown-left",
374
+ onClick: (_) => J(t.data.row)
375
+ }, [
376
+ g(s(e.$t("common.delete")), 1)
377
+ ], 8, be)), [
378
+ [y, ["region:dict_region:delete"]]
379
+ ])
380
+ ]),
381
+ _: 1
382
+ }, 8, ["list-loading", "data", "table-label"])
383
+ ]),
384
+ _: 1
385
+ }),
386
+ u.value.visible ? (m(), w(me, {
387
+ key: 0,
388
+ modelValue: u.value.visible,
389
+ "onUpdate:modelValue": o[10] || (o[10] = (t) => u.value.visible = t),
390
+ title: u.value.title,
391
+ "entity-key": I.value,
392
+ "parent-id": N.value,
393
+ onRefresh: G,
394
+ onReload: O,
395
+ width: "900px"
396
+ }, null, 8, ["modelValue", "title", "entity-key", "parent-id"])) : Q("", !0),
397
+ C.value ? (m(), w(ae, {
398
+ key: 1,
399
+ "upload-visible": C.value,
400
+ "template-title": e.$t("sysUser.templateDownload"),
401
+ onTemplateDown: o[11] || (o[11] = (t) => r(i).downloadTemplate(r(d)("dictRegion.name"))),
402
+ onImportEvents: K,
403
+ onUploadClosed: H
404
+ }, null, 8, ["upload-visible", "template-title"])) : Q("", !0)
405
+ ]);
406
+ };
407
+ }
408
+ });
409
+ export {
410
+ Ie as default
411
+ };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as m, ref as C, resolveComponent as i, openBlock as f, createElementBlock as _, createVNode as l, withCtx as a, createTextVNode as u, toDisplayString as t } from "vue";
2
- import { _ as p, a as g, b } from "./index-CsYjg_vi.mjs";
2
+ import { _ as p, a as g, b } from "./index-20SqsuLj.mjs";
3
3
  const v = { class: "app-container" }, y = /* @__PURE__ */ m({
4
4
  __name: "index",
5
5
  setup(V) {
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import "jmash-core";
2
- import { a as i, b as o, _ as r, c as d, d as m } from "./index-CsYjg_vi.mjs";
2
+ import { a as i, b as o, _ as r, c as d, d as m } from "./index-20SqsuLj.mjs";
3
3
  export {
4
4
  i as JmashRegionCascader,
5
5
  o as JmashRegionCascader2,
@@ -1,10 +1,10 @@
1
1
  import type { App } from "vue";
2
- import JmashRegionTree from "@/components/JmashRegionTree/index.vue";
3
- import JmashRegionCascader from "@/components/JmashRegionCascader/index.vue";
4
- import JmashRegionCascader2 from "@/components/JmashRegionCascader2/index.vue";
2
+ import JmashRegionTree from "./components/JmashRegionTree/index.vue";
3
+ import JmashRegionCascader from "./components/JmashRegionCascader/index.vue";
4
+ import JmashRegionCascader2 from "./components/JmashRegionCascader2/index.vue";
5
5
  export { JmashRegionTree, JmashRegionCascader, JmashRegionCascader2 };
6
- export { dictRegionApi } from "@/api/region/os-dict-region";
7
- export type { DictRegionApi, DictRegionReq, DictRegionModel, DictRegionList, DictRegionKey, DictRegionMoveKey, DictRegionEnableKey, DictRegionCreateReq, DictRegionUpdateReq, DictRegionExportReq, DictRegionImportReq, } from "@/api/region/os-dict-region/types";
6
+ export { dictRegionApi } from "./api/region/os-dict-region";
7
+ export type { DictRegionApi, DictRegionReq, DictRegionModel, DictRegionList, DictRegionKey, DictRegionMoveKey, DictRegionEnableKey, DictRegionCreateReq, DictRegionUpdateReq, DictRegionExportReq, DictRegionImportReq, } from "./api/region/os-dict-region/types";
8
8
  declare const dict: {
9
9
  install(app: App): void;
10
10
  };
package/dts/src/main.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  import "@/permission";
2
+ import "element-plus/dist/index.css";
2
3
  import "jmash-core/dist/style.css";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jmash-region",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
4
4
  "private": false,
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dts/src/index.d.ts",
@@ -15,9 +15,7 @@
15
15
  "vue": "^3.5.13",
16
16
  "vue-i18n": "^9.14.4",
17
17
  "vue-router": "^4.5.1",
18
- "jmash-core": "^0.1.0",
19
- "jmash-dict": "^0.1.1",
20
- "jmash-rbac": "^0.1.1"
18
+ "jmash-core": "^0.2.0"
21
19
  },
22
20
  "devDependencies": {
23
21
  "@eslint/js": "^9.14.0",
@@ -40,10 +38,8 @@
40
38
  },
41
39
  "dependencies": {
42
40
  "@vueuse/core": "^10.9.0",
43
- "file-saver": "^2.0.5",
44
- "nprogress": "^0.2.0",
45
41
  "pinyin-pro": "^3.25.0",
46
- "qs": "^6.14.0"
42
+ "nprogress": "^0.2.0"
47
43
  },
48
44
  "scripts": {
49
45
  "dev": "vite",