@duxweb/dvha-pro 1.0.46 → 1.0.48
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.
- package/dist/cjs/component.cjs +1 -1
- package/dist/cjs/components/layout/list.cjs +1 -1
- package/dist/cjs/components/layout/table.cjs +1 -1
- package/dist/cjs/components/layout/tools.cjs +1 -1
- package/dist/cjs/components/list/card.cjs +1 -1
- package/dist/cjs/components/list/list.cjs +1 -1
- package/dist/cjs/components/table/table.cjs +1 -1
- package/dist/cjs/components/table/tablePage.cjs +1 -1
- package/dist/cjs/dvha-pro.css +1 -1
- package/dist/cjs/hooks/table.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/langs/en-US.json.cjs +1 -1
- package/dist/cjs/langs/zh-CN.json.cjs +1 -1
- package/dist/cjs/pages/authLayout.cjs +1 -1
- package/dist/cjs/pages/layout/page.cjs +1 -1
- package/dist/cjs/pages/layout/tab.cjs +1 -1
- package/dist/cjs/pages/menu/avatar.cjs +1 -1
- package/dist/cjs/pages/menu/button.cjs +1 -1
- package/dist/cjs/pages/menu/dark.cjs +1 -0
- package/dist/cjs/pages/menu/menuApp.cjs +1 -0
- package/dist/cjs/pages/menu/menuMain.cjs +1 -0
- package/dist/cjs/pages/menu/mobile.cjs +1 -1
- package/dist/cjs/pages/menu/notice.cjs +1 -0
- package/dist/cjs/theme/uno.css.cjs +19 -9
- package/dist/esm/component.js +1 -1
- package/dist/esm/components/layout/list.js +95 -86
- package/dist/esm/components/layout/table.js +122 -117
- package/dist/esm/components/layout/tools.js +109 -32
- package/dist/esm/components/list/card.js +27 -22
- package/dist/esm/components/list/list.js +16 -11
- package/dist/esm/components/table/table.js +31 -27
- package/dist/esm/components/table/tablePage.js +17 -12
- package/dist/esm/dvha-pro.css +1 -1
- package/dist/esm/hooks/table.js +25 -19
- package/dist/esm/index.js +84 -78
- package/dist/esm/langs/en-US.json.js +1 -1
- package/dist/esm/langs/zh-CN.json.js +2 -2
- package/dist/esm/pages/authLayout.js +20 -17
- package/dist/esm/pages/layout/page.js +1 -1
- package/dist/esm/pages/layout/tab.js +2 -2
- package/dist/esm/pages/menu/avatar.js +83 -71
- package/dist/esm/pages/menu/button.js +12 -13
- package/dist/esm/pages/menu/dark.js +54 -0
- package/dist/esm/pages/menu/menuApp.js +207 -0
- package/dist/esm/pages/menu/{main.js → menuMain.js} +46 -41
- package/dist/esm/pages/menu/mobile.js +16 -13
- package/dist/esm/pages/menu/notice.js +205 -0
- package/dist/esm/theme/uno.css.js +19 -9
- package/dist/types/components/layout/list.d.ts +7 -0
- package/dist/types/components/layout/table.d.ts +7 -0
- package/dist/types/components/layout/tools.d.ts +28 -2
- package/dist/types/components/list/card.d.ts +6 -0
- package/dist/types/components/list/list.d.ts +6 -0
- package/dist/types/components/table/tablePage.d.ts +6 -0
- package/dist/types/main.d.ts +12 -0
- package/dist/types/pages/menu/avatar.d.ts +18 -0
- package/dist/types/pages/menu/button.d.ts +9 -9
- package/dist/types/pages/menu/dark.d.ts +2 -0
- package/dist/types/pages/menu/index.d.ts +4 -1
- package/dist/types/pages/menu/{main.d.ts → menuApp.d.ts} +1 -1
- package/dist/types/pages/menu/menuMain.d.ts +22 -0
- package/dist/types/pages/menu/notice.d.ts +14 -0
- package/package.json +3 -3
- package/dist/cjs/pages/menu/main.cjs +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as
|
|
3
|
-
import { useWindowSize as
|
|
4
|
-
import { NTooltip as f, NCheckbox as F, NTabs as
|
|
5
|
-
import { useAction as
|
|
1
|
+
import { defineComponent as Z, toRef as z, ref as P, computed as c, reactive as b, watch as $, onMounted as ee, createVNode as e, h as R, mergeProps as te, isVNode as le } from "vue";
|
|
2
|
+
import { useI18n as ie, useExtendList as ae, useJsonSchema as A } from "@duxweb/dvha-core";
|
|
3
|
+
import { useWindowSize as oe } from "@vueuse/core";
|
|
4
|
+
import { NTooltip as f, NCheckbox as F, NTabs as re, NTab as ne, NButton as s, NSpin as se, NProgress as ue, NPagination as ce, NModal as de, NDrawer as j } from "naive-ui";
|
|
5
|
+
import { useAction as pe } from "../../hooks/action.js";
|
|
6
6
|
import "@overlastic/vue";
|
|
7
7
|
import "clsx";
|
|
8
8
|
import "vue-echarts";
|
|
@@ -18,12 +18,12 @@ import "ace-builds/src-noconflict/ext-searchbox";
|
|
|
18
18
|
import "ace-builds/src-noconflict/ext-language_tools";
|
|
19
19
|
import "ace-builds/src-noconflict/mode-snippets";
|
|
20
20
|
import "vue-cropper";
|
|
21
|
-
import
|
|
21
|
+
import me from "../modal/modalPage.js";
|
|
22
22
|
import "jinrishici";
|
|
23
23
|
import "lodash-es";
|
|
24
24
|
import "vue-draggable-plus";
|
|
25
|
-
import { DuxTableFilter as
|
|
26
|
-
import { DuxFilterLayout as
|
|
25
|
+
import { DuxTableFilter as fe } from "./filter.js";
|
|
26
|
+
import { DuxFilterLayout as he } from "./filterLayout.js";
|
|
27
27
|
import "@vee-validate/i18n";
|
|
28
28
|
import "colorizr";
|
|
29
29
|
import "echarts";
|
|
@@ -53,9 +53,9 @@ import "vue-command-palette";
|
|
|
53
53
|
import "@duxweb/dvha-naiveui";
|
|
54
54
|
import { DuxPage as ge } from "../../pages/page.js";
|
|
55
55
|
import "../../pages/page404.js";
|
|
56
|
-
import { DuxPageEmpty as
|
|
56
|
+
import { DuxPageEmpty as ve } from "../../pages/pageEmpty.js";
|
|
57
57
|
import { DuxDrawerPage as N } from "../drawer/drawerPage.js";
|
|
58
|
-
import { DuxTableTools as
|
|
58
|
+
import { DuxTableTools as be } from "./tools.js";
|
|
59
59
|
import "short-unique-id";
|
|
60
60
|
import "aieditor";
|
|
61
61
|
import "@vue-flow/core";
|
|
@@ -68,10 +68,10 @@ import "fabric";
|
|
|
68
68
|
import "dayjs";
|
|
69
69
|
import "@tanstack/vue-query";
|
|
70
70
|
import "pinia";
|
|
71
|
-
function
|
|
72
|
-
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !
|
|
71
|
+
function xe(t) {
|
|
72
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !le(t);
|
|
73
73
|
}
|
|
74
|
-
const
|
|
74
|
+
const Ot = /* @__PURE__ */ Z({
|
|
75
75
|
name: "DuxListLayout",
|
|
76
76
|
props: {
|
|
77
77
|
rowKey: {
|
|
@@ -113,28 +113,34 @@ const Tt = /* @__PURE__ */ Y({
|
|
|
113
113
|
type: String,
|
|
114
114
|
default: ""
|
|
115
115
|
},
|
|
116
|
+
batchOptions: {
|
|
117
|
+
type: Array
|
|
118
|
+
},
|
|
116
119
|
hookListProps: {
|
|
117
120
|
type: Object
|
|
118
121
|
}
|
|
119
122
|
},
|
|
120
123
|
setup(t, {
|
|
121
|
-
slots: o
|
|
124
|
+
slots: o,
|
|
125
|
+
expose: D
|
|
122
126
|
}) {
|
|
123
|
-
const
|
|
127
|
+
const U = z(t.filter || {}), {
|
|
124
128
|
t: a
|
|
125
|
-
} =
|
|
126
|
-
renderAction:
|
|
127
|
-
} =
|
|
129
|
+
} = ie(), {
|
|
130
|
+
renderAction: T
|
|
131
|
+
} = pe(), O = z(t.pagination && typeof t.pagination == "object" ? t.pagination : {
|
|
128
132
|
page: 1,
|
|
129
133
|
pageSize: 20
|
|
130
|
-
}),
|
|
131
|
-
Object.assign(
|
|
132
|
-
},
|
|
134
|
+
}), h = P({}), B = () => {
|
|
135
|
+
Object.assign(h.value, U.value);
|
|
136
|
+
}, l = ae({
|
|
133
137
|
path: t.path,
|
|
134
|
-
filters:
|
|
135
|
-
pagination:
|
|
138
|
+
filters: h.value,
|
|
139
|
+
pagination: O.value,
|
|
136
140
|
...t.hookListProps
|
|
137
|
-
})
|
|
141
|
+
});
|
|
142
|
+
D(l);
|
|
143
|
+
const {
|
|
138
144
|
meta: E,
|
|
139
145
|
list: x,
|
|
140
146
|
isLoading: w,
|
|
@@ -145,16 +151,16 @@ const Tt = /* @__PURE__ */ Y({
|
|
|
145
151
|
isExportingRows: V,
|
|
146
152
|
isImporting: S,
|
|
147
153
|
onExport: W,
|
|
148
|
-
onExportRows:
|
|
149
|
-
onImport:
|
|
150
|
-
} =
|
|
151
|
-
page:
|
|
152
|
-
pageSize:
|
|
153
|
-
pageCount:
|
|
154
|
-
pageSizes:
|
|
154
|
+
onExportRows: J,
|
|
155
|
+
onImport: _
|
|
156
|
+
} = l, K = c(() => ({
|
|
157
|
+
page: l.page.value,
|
|
158
|
+
pageSize: l.pageSize.value,
|
|
159
|
+
pageCount: l.pageCount.value,
|
|
160
|
+
pageSizes: l.pageSizes,
|
|
155
161
|
pageSlot: 5,
|
|
156
|
-
onUpdatePage:
|
|
157
|
-
onUpdatePageSize:
|
|
162
|
+
onUpdatePage: l.onUpdatePage,
|
|
163
|
+
onUpdatePageSize: l.onUpdatePageSize,
|
|
158
164
|
showSizePicker: !0,
|
|
159
165
|
showQuickJumper: !0
|
|
160
166
|
})), d = b({
|
|
@@ -163,41 +169,41 @@ const Tt = /* @__PURE__ */ Y({
|
|
|
163
169
|
show: !1
|
|
164
170
|
}), m = b({
|
|
165
171
|
show: !1
|
|
166
|
-
}),
|
|
172
|
+
}), g = P(t.filterSchema?.length || 0), {
|
|
167
173
|
width: r
|
|
168
|
-
} =
|
|
174
|
+
} = oe(), k = () => {
|
|
169
175
|
if (!t.filterSchema?.length) return 0;
|
|
170
|
-
const
|
|
171
|
-
if (
|
|
172
|
-
return
|
|
176
|
+
const i = t.filterSchema.length;
|
|
177
|
+
if (i <= 3)
|
|
178
|
+
return i;
|
|
173
179
|
const n = r.value || 1024;
|
|
174
180
|
let u = 3;
|
|
175
|
-
return n >= 1280 ? u = 4 : n >= 1024 ? u = 3 : n >= 768 ? u = 2 : u = 1, Math.min(
|
|
181
|
+
return n >= 1280 ? u = 4 : n >= 1024 ? u = 3 : n >= 768 ? u = 2 : u = 1, Math.min(i, u);
|
|
176
182
|
};
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}),
|
|
180
|
-
|
|
183
|
+
$(r, () => {
|
|
184
|
+
g.value = k();
|
|
185
|
+
}), ee(() => {
|
|
186
|
+
g.value = k();
|
|
181
187
|
});
|
|
182
|
-
const
|
|
188
|
+
const Q = c(() => (t.filterSchema || []).slice(0, g.value)), C = c(() => (t.filterSchema || []).slice(g.value)), G = c(() => C.value.length > 0), L = (i) => i.map((n) => {
|
|
183
189
|
const {
|
|
184
190
|
title: u,
|
|
185
|
-
...
|
|
191
|
+
...Y
|
|
186
192
|
} = n;
|
|
187
193
|
return {
|
|
188
|
-
tag:
|
|
194
|
+
tag: fe,
|
|
189
195
|
attrs: {
|
|
190
196
|
label: u,
|
|
191
197
|
class: "flex-1 min-w-0"
|
|
192
198
|
},
|
|
193
|
-
children:
|
|
199
|
+
children: Y
|
|
194
200
|
};
|
|
195
201
|
}), {
|
|
196
|
-
render:
|
|
202
|
+
render: H
|
|
197
203
|
} = A({
|
|
198
|
-
data: c(() => L(
|
|
204
|
+
data: c(() => L(Q.value))
|
|
199
205
|
}), {
|
|
200
|
-
render:
|
|
206
|
+
render: X
|
|
201
207
|
} = A({
|
|
202
208
|
data: c(() => L(C.value))
|
|
203
209
|
}), v = c(() => ({
|
|
@@ -224,26 +230,26 @@ const Tt = /* @__PURE__ */ Y({
|
|
|
224
230
|
trigger: () => e("div", {
|
|
225
231
|
class: "flex items-center"
|
|
226
232
|
}, [e(F, {
|
|
227
|
-
checked:
|
|
228
|
-
indeterminate:
|
|
229
|
-
onUpdateChecked:
|
|
233
|
+
checked: l.isAllChecked.value,
|
|
234
|
+
indeterminate: l.isIndeterminate.value,
|
|
235
|
+
onUpdateChecked: l.toggleSelectAll
|
|
230
236
|
}, null)]),
|
|
231
237
|
default: () => a("components.list.selectAll")
|
|
232
|
-
})]), t.tabs && e("div", null, [e(
|
|
238
|
+
})]), t.tabs && e("div", null, [e(re, {
|
|
233
239
|
type: "segment",
|
|
234
240
|
size: "small",
|
|
235
241
|
style: {
|
|
236
242
|
"--n-tab-padding": "4px 10px"
|
|
237
243
|
},
|
|
238
244
|
"default-value": t.tabs?.[0]?.value,
|
|
239
|
-
value:
|
|
240
|
-
onUpdateValue: (
|
|
241
|
-
|
|
245
|
+
value: h.value?.tab,
|
|
246
|
+
onUpdateValue: (i) => {
|
|
247
|
+
h.value.tab = i;
|
|
242
248
|
}
|
|
243
249
|
}, {
|
|
244
|
-
default: () => [t.tabs?.map((
|
|
245
|
-
name:
|
|
246
|
-
tab:
|
|
250
|
+
default: () => [t.tabs?.map((i) => e(ne, {
|
|
251
|
+
name: i.value,
|
|
252
|
+
tab: i.label
|
|
247
253
|
}, null))]
|
|
248
254
|
})]), e("div", {
|
|
249
255
|
class: "flex gap-2"
|
|
@@ -259,10 +265,10 @@ const Tt = /* @__PURE__ */ Y({
|
|
|
259
265
|
}, null)
|
|
260
266
|
}), e("div", {
|
|
261
267
|
class: "flex flex-wrap gap-2 items-center flex-1 lg:flex-none"
|
|
262
|
-
}, [R(
|
|
268
|
+
}, [R(H)]), e(s, {
|
|
263
269
|
type: "primary",
|
|
264
270
|
secondary: !0,
|
|
265
|
-
onClick:
|
|
271
|
+
onClick: B
|
|
266
272
|
}, {
|
|
267
273
|
icon: () => e("div", {
|
|
268
274
|
class: "i-tabler:search size-4"
|
|
@@ -278,7 +284,7 @@ const Tt = /* @__PURE__ */ Y({
|
|
|
278
284
|
icon: () => e("div", {
|
|
279
285
|
class: "i-tabler:layout-sidebar-right-inactive size-4"
|
|
280
286
|
}, null)
|
|
281
|
-
}),
|
|
287
|
+
}), G.value && e(s, {
|
|
282
288
|
iconPlacement: "right",
|
|
283
289
|
onClick: () => {
|
|
284
290
|
d.show = !d.show;
|
|
@@ -290,11 +296,11 @@ const Tt = /* @__PURE__ */ Y({
|
|
|
290
296
|
}, null)
|
|
291
297
|
})])]), e("div", {
|
|
292
298
|
class: "flex gap-2"
|
|
293
|
-
}, [o.actions?.(), t.actions?.length > 0 &&
|
|
299
|
+
}, [o.actions?.(), t.actions?.length > 0 && T({
|
|
294
300
|
type: r.value < 1024 ? "dropdown" : "button",
|
|
295
301
|
text: r.value < 1024,
|
|
296
302
|
items: t.actions
|
|
297
|
-
})])]), e(
|
|
303
|
+
})])]), e(se, {
|
|
298
304
|
show: w.value,
|
|
299
305
|
class: "flex-1 min-h-0",
|
|
300
306
|
contentClass: "h-full"
|
|
@@ -303,7 +309,7 @@ const Tt = /* @__PURE__ */ Y({
|
|
|
303
309
|
class: ["h-full overflow-auto rounded-lg px-3"]
|
|
304
310
|
}, [!w.value && x.value.length === 0 && e("div", {
|
|
305
311
|
class: "flex justify-center items-center h-full"
|
|
306
|
-
}, [e(
|
|
312
|
+
}, [e(ve, null, null)]), x.value.length > 0 && o?.default?.(l)])]
|
|
307
313
|
}), e("div", {
|
|
308
314
|
class: "flex justify-between px-3 py-2 gap-2"
|
|
309
315
|
}, [e("div", null, [e("div", {
|
|
@@ -315,9 +321,9 @@ const Tt = /* @__PURE__ */ Y({
|
|
|
315
321
|
quaternary: !0
|
|
316
322
|
}, {
|
|
317
323
|
default: () => [e(F, {
|
|
318
|
-
checked:
|
|
319
|
-
indeterminate:
|
|
320
|
-
onUpdateChecked:
|
|
324
|
+
checked: l.isAllChecked.value,
|
|
325
|
+
indeterminate: l.isIndeterminate.value,
|
|
326
|
+
onUpdateChecked: l.toggleSelectAll
|
|
321
327
|
}, null)]
|
|
322
328
|
}),
|
|
323
329
|
default: () => a("components.list.selectAll")
|
|
@@ -336,7 +342,7 @@ const Tt = /* @__PURE__ */ Y({
|
|
|
336
342
|
}), v.value.import && e(f, null, {
|
|
337
343
|
trigger: () => e(s, {
|
|
338
344
|
loading: S.value,
|
|
339
|
-
onClick:
|
|
345
|
+
onClick: _,
|
|
340
346
|
circle: !0,
|
|
341
347
|
quaternary: !0
|
|
342
348
|
}, {
|
|
@@ -351,7 +357,7 @@ const Tt = /* @__PURE__ */ Y({
|
|
|
351
357
|
circle: !0,
|
|
352
358
|
quaternary: !0
|
|
353
359
|
}, {
|
|
354
|
-
icon: () => q.value ? e(
|
|
360
|
+
icon: () => q.value ? e(ue, {
|
|
355
361
|
class: "size-4",
|
|
356
362
|
type: "circle",
|
|
357
363
|
percentage: y.value * 10,
|
|
@@ -368,55 +374,58 @@ const Tt = /* @__PURE__ */ Y({
|
|
|
368
374
|
default: () => a("components.button.autoRefresh")
|
|
369
375
|
})])]), e("div", {
|
|
370
376
|
class: "flex items-center gap-2"
|
|
371
|
-
}, [o?.bottom?.(), t.pagination && e(
|
|
377
|
+
}, [o?.bottom?.(), t.pagination && e(ce, te(K.value, {
|
|
372
378
|
simple: r.value < 768
|
|
373
379
|
}), {
|
|
374
380
|
prefix: () => e("div", null, [a("components.list.total", {
|
|
375
381
|
total: E?.value?.total || 0
|
|
376
382
|
})])
|
|
377
|
-
})])]), e(
|
|
378
|
-
|
|
383
|
+
})])]), e(be, {
|
|
384
|
+
isLoading: l.isBatching.value,
|
|
385
|
+
onBatch: l.onBatch,
|
|
386
|
+
selecteds: l.checkeds.value,
|
|
387
|
+
number: l.checkeds.value.length,
|
|
379
388
|
group: [[{
|
|
380
389
|
icon: "i-tabler:x",
|
|
381
390
|
onClick: () => {
|
|
382
|
-
|
|
391
|
+
l.checkeds.value = [], l.onUpdateChecked?.([]);
|
|
383
392
|
}
|
|
384
393
|
}], [{
|
|
385
394
|
label: a("components.button.export"),
|
|
386
395
|
icon: "i-tabler:file-export",
|
|
387
396
|
loading: V.value,
|
|
388
|
-
onClick:
|
|
397
|
+
onClick: J
|
|
389
398
|
}, {
|
|
390
399
|
label: a("components.button.delete"),
|
|
391
400
|
type: "error",
|
|
392
401
|
icon: "i-tabler:trash"
|
|
393
402
|
}]]
|
|
394
|
-
}, null), e(
|
|
403
|
+
}, null), e(de, {
|
|
395
404
|
draggable: !0,
|
|
396
405
|
class: "bg-white rounded dark:shadow-gray-950/80 dark:bg-gray-800/60 backdrop-blur",
|
|
397
406
|
show: d.show,
|
|
398
|
-
onUpdateShow: (
|
|
407
|
+
onUpdateShow: (i) => d.show = i
|
|
399
408
|
}, {
|
|
400
409
|
default: ({
|
|
401
|
-
draggableClass:
|
|
410
|
+
draggableClass: i
|
|
402
411
|
}) => {
|
|
403
412
|
let n;
|
|
404
|
-
return e(
|
|
413
|
+
return e(me, {
|
|
405
414
|
title: a("components.button.filter"),
|
|
406
|
-
handle:
|
|
415
|
+
handle: i,
|
|
407
416
|
onClose: () => d.show = !1
|
|
408
417
|
}, {
|
|
409
|
-
default: () => [e(
|
|
418
|
+
default: () => [e(he, {
|
|
410
419
|
showLabel: !0,
|
|
411
420
|
labelPlacement: "top"
|
|
412
|
-
},
|
|
421
|
+
}, xe(n = R(X)) ? n : {
|
|
413
422
|
default: () => [n]
|
|
414
423
|
})]
|
|
415
424
|
});
|
|
416
425
|
}
|
|
417
426
|
}), e(j, {
|
|
418
427
|
show: p.show,
|
|
419
|
-
onUpdateShow: (
|
|
428
|
+
onUpdateShow: (i) => p.show = i,
|
|
420
429
|
autoFocus: !1,
|
|
421
430
|
placement: "left"
|
|
422
431
|
}, {
|
|
@@ -429,7 +438,7 @@ const Tt = /* @__PURE__ */ Y({
|
|
|
429
438
|
})]
|
|
430
439
|
}), e(j, {
|
|
431
440
|
show: m.show,
|
|
432
|
-
onUpdateShow: (
|
|
441
|
+
onUpdateShow: (i) => m.show = i,
|
|
433
442
|
autoFocus: !1,
|
|
434
443
|
placement: "right"
|
|
435
444
|
}, {
|
|
@@ -445,5 +454,5 @@ const Tt = /* @__PURE__ */ Y({
|
|
|
445
454
|
}
|
|
446
455
|
});
|
|
447
456
|
export {
|
|
448
|
-
|
|
457
|
+
Ot as DuxListLayout
|
|
449
458
|
};
|