@duxweb/dvha-pro 1.0.21 → 1.0.23
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/card/card.cjs +1 -1
- package/dist/cjs/components/code/code.cjs +1 -1
- package/dist/cjs/components/drawer/drawer.cjs +1 -1
- package/dist/cjs/components/drawer/drawerPage.cjs +1 -1
- package/dist/cjs/components/form/drawerForm.cjs +1 -0
- package/dist/cjs/components/form/formItem.cjs +1 -1
- package/dist/cjs/components/form/formLayout.cjs +1 -1
- package/dist/cjs/components/form/modalForm.cjs +1 -1
- package/dist/cjs/components/form/pageForm.cjs +1 -1
- package/dist/cjs/components/media/media.cjs +1 -1
- package/dist/cjs/components/panel/setting.cjs +1 -1
- package/dist/cjs/components/status/listEmpty.cjs +1 -1
- package/dist/cjs/components/table/table.cjs +1 -1
- package/dist/cjs/components/table/tablePage.cjs +1 -1
- package/dist/cjs/components/tree/treeFilter.cjs +1 -1
- package/dist/cjs/hooks/action.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/theme/uno.css.cjs +3 -2
- package/dist/esm/component.js +3 -3
- package/dist/esm/components/card/card.js +1 -1
- package/dist/esm/components/code/code.js +6 -6
- package/dist/esm/components/drawer/drawer.js +11 -10
- package/dist/esm/components/drawer/drawerPage.js +10 -10
- package/dist/esm/components/form/drawerForm.js +149 -0
- package/dist/esm/components/form/formItem.js +44 -28
- package/dist/esm/components/form/formLayout.js +12 -7
- package/dist/esm/components/form/modalForm.js +1 -1
- package/dist/esm/components/form/pageForm.js +1 -1
- package/dist/esm/components/media/media.js +4 -4
- package/dist/esm/components/panel/setting.js +1 -1
- package/dist/esm/components/status/listEmpty.js +8 -6
- package/dist/esm/components/table/table.js +24 -23
- package/dist/esm/components/table/tablePage.js +16 -15
- package/dist/esm/components/tree/treeFilter.js +2 -1
- package/dist/esm/hooks/action.js +82 -82
- package/dist/esm/index.js +166 -164
- package/dist/esm/theme/uno.css.js +3 -2
- package/dist/types/components/drawer/drawerPage.d.ts +1 -1
- package/dist/types/components/form/drawerForm.d.ts +98 -0
- package/dist/types/components/form/formItem.d.ts +17 -1
- package/dist/types/components/form/formLayout.d.ts +9 -0
- package/dist/types/components/form/index.d.ts +1 -0
- package/dist/types/components/form/modalForm.d.ts +9 -0
- package/dist/types/hooks/table/media.d.ts +1 -1
- package/dist/types/hooks/table/types.d.ts +2 -2
- package/dist/types/main.d.ts +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { defineComponent as b, computed as C, toRef as F, createVNode as i, Fragment as x, mergeProps as D, isVNode as E } from "vue";
|
|
2
|
+
import { useI18n as N, useExtendForm as h } from "@duxweb/dvha-core";
|
|
3
|
+
import { useMessage as j, NButton as u, NScrollbar as v } from "naive-ui";
|
|
4
|
+
import "clsx";
|
|
5
|
+
import "vue-echarts";
|
|
6
|
+
import "vue-router";
|
|
7
|
+
import "@overlastic/vue";
|
|
8
|
+
import "dayjs";
|
|
9
|
+
import "mime";
|
|
10
|
+
import "lodash-es";
|
|
11
|
+
import "@tanstack/vue-query";
|
|
12
|
+
import "@duxweb/dvha-naiveui";
|
|
13
|
+
import "@vueuse/core";
|
|
14
|
+
import "pinia";
|
|
15
|
+
import "vue-cropper";
|
|
16
|
+
import "jinrishici";
|
|
17
|
+
import "vue-draggable-plus";
|
|
18
|
+
import { DuxDrawerPage as w } from "../drawer/drawerPage.js";
|
|
19
|
+
import "aieditor";
|
|
20
|
+
import { DuxFormLayout as l } from "./formLayout.js";
|
|
21
|
+
import "vee-validate";
|
|
22
|
+
import "@vee-validate/i18n";
|
|
23
|
+
import "colorizr";
|
|
24
|
+
import "echarts";
|
|
25
|
+
import "@ant-design/colors";
|
|
26
|
+
import "@unocss/preset-icons/browser";
|
|
27
|
+
import "@unocss/preset-typography";
|
|
28
|
+
import "unocss/preset-wind4";
|
|
29
|
+
import "@vee-validate/i18n/dist/locale/en.json";
|
|
30
|
+
import "@vee-validate/i18n/dist/locale/zh_CN.json";
|
|
31
|
+
import "vue-command-palette";
|
|
32
|
+
import "../../pages/page404.js";
|
|
33
|
+
import "@iconify-json/tabler/icons.json";
|
|
34
|
+
import "vue3-ace-editor";
|
|
35
|
+
import "ace-builds/src-noconflict/mode-vue";
|
|
36
|
+
import "ace-builds/src-noconflict/mode-javascript";
|
|
37
|
+
import "ace-builds/src-noconflict/mode-html";
|
|
38
|
+
import "ace-builds/src-noconflict/mode-json";
|
|
39
|
+
import "ace-builds/src-noconflict/mode-json5";
|
|
40
|
+
import "ace-builds/src-noconflict/theme-tomorrow_night";
|
|
41
|
+
import "ace-builds/src-noconflict/theme-tomorrow";
|
|
42
|
+
import "ace-builds/src-noconflict/ext-searchbox";
|
|
43
|
+
import "ace-builds/src-noconflict/ext-language_tools";
|
|
44
|
+
import "ace-builds/src-noconflict/mode-snippets";
|
|
45
|
+
function d(t) {
|
|
46
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !E(t);
|
|
47
|
+
}
|
|
48
|
+
const Nt = /* @__PURE__ */ b({
|
|
49
|
+
name: "DuxDrawerForm",
|
|
50
|
+
props: {
|
|
51
|
+
id: {
|
|
52
|
+
type: [String, Number]
|
|
53
|
+
},
|
|
54
|
+
action: {
|
|
55
|
+
type: String
|
|
56
|
+
},
|
|
57
|
+
path: {
|
|
58
|
+
type: String
|
|
59
|
+
},
|
|
60
|
+
data: {
|
|
61
|
+
type: Object
|
|
62
|
+
},
|
|
63
|
+
onClose: {
|
|
64
|
+
type: Function
|
|
65
|
+
},
|
|
66
|
+
title: {
|
|
67
|
+
type: String
|
|
68
|
+
},
|
|
69
|
+
onSuccess: {
|
|
70
|
+
type: Function
|
|
71
|
+
},
|
|
72
|
+
onError: {
|
|
73
|
+
type: Function
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
extends: l,
|
|
77
|
+
setup(t, {
|
|
78
|
+
slots: m
|
|
79
|
+
}) {
|
|
80
|
+
const {
|
|
81
|
+
t: r
|
|
82
|
+
} = N(), f = C(() => {
|
|
83
|
+
const {
|
|
84
|
+
onClose: o,
|
|
85
|
+
onSuccess: e,
|
|
86
|
+
onError: n,
|
|
87
|
+
action: O,
|
|
88
|
+
title: P,
|
|
89
|
+
id: _,
|
|
90
|
+
path: k,
|
|
91
|
+
data: L,
|
|
92
|
+
...S
|
|
93
|
+
} = t;
|
|
94
|
+
return S;
|
|
95
|
+
}), p = F(t, "data", {}), c = j(), {
|
|
96
|
+
isLoading: a,
|
|
97
|
+
onSubmit: g,
|
|
98
|
+
onReset: s,
|
|
99
|
+
isEdit: y
|
|
100
|
+
} = h({
|
|
101
|
+
id: t.id,
|
|
102
|
+
path: t.path,
|
|
103
|
+
form: p,
|
|
104
|
+
action: t.action,
|
|
105
|
+
onError: (o) => {
|
|
106
|
+
var e;
|
|
107
|
+
c.error(o.message || r("components.form.error")), (e = t.onError) == null || e.call(t, o);
|
|
108
|
+
},
|
|
109
|
+
onSuccess: (o) => {
|
|
110
|
+
var e, n;
|
|
111
|
+
c.success(r("components.form.success")), (e = t.onSuccess) == null || e.call(t, o), (n = t.onClose) == null || n.call(t);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
return () => i(w, {
|
|
115
|
+
scrollbar: !1,
|
|
116
|
+
title: (t == null ? void 0 : t.title) || (y.value ? r("components.form.edit") : r("components.form.create")),
|
|
117
|
+
onClose: t == null ? void 0 : t.onClose
|
|
118
|
+
}, {
|
|
119
|
+
default: () => i(v, null, {
|
|
120
|
+
default: () => [i(l, D({
|
|
121
|
+
class: "p-4"
|
|
122
|
+
}, f.value), {
|
|
123
|
+
default: () => {
|
|
124
|
+
var o;
|
|
125
|
+
return [(o = m == null ? void 0 : m.default) == null ? void 0 : o.call(m)];
|
|
126
|
+
}
|
|
127
|
+
})]
|
|
128
|
+
}),
|
|
129
|
+
footer: () => {
|
|
130
|
+
let o, e;
|
|
131
|
+
return i(x, null, [i(u, {
|
|
132
|
+
onClick: s,
|
|
133
|
+
loading: a.value
|
|
134
|
+
}, d(o = r("components.button.reset")) ? o : {
|
|
135
|
+
default: () => [o]
|
|
136
|
+
}), i(u, {
|
|
137
|
+
type: "primary",
|
|
138
|
+
loading: a.value,
|
|
139
|
+
onClick: () => g()
|
|
140
|
+
}, d(e = r("components.button.submit")) ? e : {
|
|
141
|
+
default: () => [e]
|
|
142
|
+
})]);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
export {
|
|
148
|
+
Nt as DuxDrawerForm
|
|
149
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { watchThrottled as
|
|
1
|
+
import { defineComponent as b, toRef as h, computed as a, watch as y, inject as q, createVNode as r, createTextVNode as j } from "vue";
|
|
2
|
+
import { watchThrottled as S } from "@vueuse/core";
|
|
3
3
|
import { useField as w } from "vee-validate";
|
|
4
|
-
const
|
|
4
|
+
const F = /* @__PURE__ */ b({
|
|
5
5
|
name: "DuxFormItem",
|
|
6
6
|
props: {
|
|
7
7
|
label: String,
|
|
@@ -10,68 +10,84 @@ const q = /* @__PURE__ */ x({
|
|
|
10
10
|
labelPlacement: {
|
|
11
11
|
type: String
|
|
12
12
|
},
|
|
13
|
+
labelAlign: {
|
|
14
|
+
type: String
|
|
15
|
+
},
|
|
13
16
|
labelWidth: {
|
|
14
17
|
type: Number
|
|
15
18
|
},
|
|
19
|
+
required: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: !1
|
|
22
|
+
},
|
|
16
23
|
rule: [String, Object],
|
|
17
24
|
message: [String, Object]
|
|
18
25
|
},
|
|
19
26
|
setup(e, {
|
|
20
27
|
slots: i
|
|
21
28
|
}) {
|
|
22
|
-
const c =
|
|
29
|
+
const c = h(e.message), f = a(() => {
|
|
30
|
+
var t;
|
|
31
|
+
return typeof e.rule == "object" ? {
|
|
32
|
+
...e.rule,
|
|
33
|
+
required: !!e.required
|
|
34
|
+
} : typeof e.rule == "string" ? (t = e.rule) != null && t.includes("required") ? e.rule : e.rule ? `${e.rule}|required` : "required" : e.rule;
|
|
35
|
+
}), {
|
|
23
36
|
errorMessage: d,
|
|
24
37
|
value: m,
|
|
25
|
-
setErrors:
|
|
38
|
+
setErrors: g,
|
|
26
39
|
validate: s
|
|
27
|
-
} = w(e.path || "",
|
|
40
|
+
} = w(e.path || "", f.value || {}, {
|
|
28
41
|
label: e.label
|
|
29
|
-
}),
|
|
30
|
-
|
|
31
|
-
t &&
|
|
42
|
+
}), v = a(() => e.required ? !0 : e.rule ? typeof e.rule == "string" ? e.rule.includes("required") : typeof e.rule == "object" ? "required" in e.rule : !1 : !1), n = a(() => d.value && (c.value || d.value));
|
|
43
|
+
y(n, (t) => {
|
|
44
|
+
t && g(t);
|
|
32
45
|
}, {
|
|
33
46
|
immediate: !0
|
|
34
|
-
}),
|
|
47
|
+
}), S(m, (t) => {
|
|
35
48
|
t && s();
|
|
36
49
|
}, {
|
|
37
50
|
throttle: 300,
|
|
38
51
|
deep: !0
|
|
39
52
|
});
|
|
40
|
-
const u =
|
|
53
|
+
const u = q("dux.form", {
|
|
41
54
|
labelPlacement: "left",
|
|
55
|
+
labelAlign: "left",
|
|
42
56
|
labelWidth: 70,
|
|
43
57
|
divider: !1
|
|
44
|
-
}),
|
|
58
|
+
}), l = a(() => e.labelPlacement || u.labelPlacement), o = a(() => {
|
|
45
59
|
let t = e.labelWidth || u.labelWidth || 70;
|
|
46
|
-
return typeof t == "number" && (t = `${t}px`),
|
|
47
|
-
}),
|
|
60
|
+
return typeof t == "number" && (t = `${t}px`), l.value !== "left" ? "auto" : t;
|
|
61
|
+
}), x = a(() => u.divider || l.value === "page");
|
|
48
62
|
return () => {
|
|
49
63
|
var t;
|
|
50
|
-
return
|
|
51
|
-
class: [
|
|
52
|
-
}, [
|
|
53
|
-
class: [
|
|
64
|
+
return r("div", {
|
|
65
|
+
class: [l.value !== "top" ? "md:flex-row gap-2 lg:items-center" : "gap-1", x.value ? "py-6" : "", l.value === "setting" ? "md:justify-between md:items-start md:gap-4" : "", l.value === "page" ? "grid grid-cols-1 lg:grid-cols-4 px-4" : "flex flex-col"]
|
|
66
|
+
}, [r("div", {
|
|
67
|
+
class: [l.value === "left" ? "flex lg:items-center" : "", l.value === "left" && u.labelAlign === "right" ? "justify-end" : ""],
|
|
54
68
|
style: {
|
|
55
|
-
width:
|
|
69
|
+
width: o.value
|
|
56
70
|
}
|
|
57
|
-
}, [
|
|
71
|
+
}, [r("div", {
|
|
58
72
|
class: "flex flex-col"
|
|
59
|
-
}, [
|
|
73
|
+
}, [r("div", null, [r("span", {
|
|
60
74
|
class: "relative flex items-center gap-1"
|
|
61
|
-
}, [e.label,
|
|
75
|
+
}, [e.label, v.value && r("span", {
|
|
62
76
|
class: "text-error font-mono text-xs"
|
|
63
|
-
}, [
|
|
77
|
+
}, [j("*")])])]), e.description && (l.value === "setting" || l.value === "page") && r("div", {
|
|
64
78
|
class: "text-sm text-muted"
|
|
65
|
-
}, [e.description])])]),
|
|
66
|
-
class: ["flex flex-col gap-1",
|
|
67
|
-
}, [
|
|
79
|
+
}, [e.description])])]), r("div", {
|
|
80
|
+
class: ["flex flex-col gap-1", l.value !== "left" ? "md:mt-1" : "", l.value === "setting" ? "flex-none md:w-40%" : "flex-1", l.value === "page" ? "col-span-3" : ""]
|
|
81
|
+
}, [r("div", {
|
|
82
|
+
class: l.value === "setting" ? "flex-1 lg:flex lg:justify-end" : ""
|
|
83
|
+
}, [(t = i == null ? void 0 : i.default) == null ? void 0 : t.call(i)]), e.description && l.value === "left" && r("div", {
|
|
68
84
|
class: "text-sm text-muted"
|
|
69
|
-
}, [e.description]), n.value &&
|
|
85
|
+
}, [e.description]), n.value && r("div", {
|
|
70
86
|
class: "text-error"
|
|
71
87
|
}, [n.value])])]);
|
|
72
88
|
};
|
|
73
89
|
}
|
|
74
90
|
});
|
|
75
91
|
export {
|
|
76
|
-
|
|
92
|
+
F as DuxFormItem
|
|
77
93
|
};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as i, provide as d, createVNode as t } from "vue";
|
|
2
|
+
const f = /* @__PURE__ */ i({
|
|
3
3
|
name: "DuxFormLayout",
|
|
4
4
|
props: {
|
|
5
5
|
labelPlacement: {
|
|
6
6
|
type: String,
|
|
7
7
|
default: "left"
|
|
8
8
|
},
|
|
9
|
+
labelAlign: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: "left"
|
|
12
|
+
},
|
|
9
13
|
labelWidth: {
|
|
10
14
|
type: Number
|
|
11
15
|
},
|
|
@@ -19,20 +23,21 @@ const m = /* @__PURE__ */ d({
|
|
|
19
23
|
}
|
|
20
24
|
},
|
|
21
25
|
setup(e, {
|
|
22
|
-
slots:
|
|
26
|
+
slots: l
|
|
23
27
|
}) {
|
|
24
|
-
return
|
|
28
|
+
return d("dux.form", {
|
|
25
29
|
labelPlacement: e.labelPlacement,
|
|
30
|
+
labelAlign: e.labelAlign,
|
|
26
31
|
labelWidth: e.labelWidth,
|
|
27
32
|
divider: e.divider
|
|
28
33
|
}), () => {
|
|
29
|
-
var
|
|
34
|
+
var a;
|
|
30
35
|
return t("div", {
|
|
31
36
|
class: ["flex ", e.divider || e.labelPlacement === "page" ? " divide-y divide-default dark:divide-gray-800" : "", e.inline ? "flex-row" : "flex-col", e.labelPlacement === "page" || e.labelPlacement === "setting" ? "container mx-auto" : "gap-4"]
|
|
32
|
-
}, [(
|
|
37
|
+
}, [(a = l == null ? void 0 : l.default) == null ? void 0 : a.call(l)]);
|
|
33
38
|
};
|
|
34
39
|
}
|
|
35
40
|
});
|
|
36
41
|
export {
|
|
37
|
-
|
|
42
|
+
f as DuxFormLayout
|
|
38
43
|
};
|
|
@@ -17,8 +17,8 @@ import D from "../modal/modalPage.js";
|
|
|
17
17
|
import "jinrishici";
|
|
18
18
|
import "vue-draggable-plus";
|
|
19
19
|
import "aieditor";
|
|
20
|
-
import "vee-validate";
|
|
21
20
|
import { DuxFormLayout as d } from "./formLayout.js";
|
|
21
|
+
import "vee-validate";
|
|
22
22
|
import "@vee-validate/i18n";
|
|
23
23
|
import "colorizr";
|
|
24
24
|
import "echarts";
|
|
@@ -12,8 +12,8 @@ import "jinrishici";
|
|
|
12
12
|
import "lodash-es";
|
|
13
13
|
import "vue-draggable-plus";
|
|
14
14
|
import "aieditor";
|
|
15
|
-
import "vee-validate";
|
|
16
15
|
import { DuxFormLayout as v } from "./formLayout.js";
|
|
16
|
+
import "vee-validate";
|
|
17
17
|
import "@iconify-json/tabler/icons.json";
|
|
18
18
|
import "mime";
|
|
19
19
|
import "vue3-ace-editor";
|
|
@@ -29,7 +29,7 @@ const I = /* @__PURE__ */ h({
|
|
|
29
29
|
}) {
|
|
30
30
|
const c = y(() => Array.isArray(e.image) ? e.image : e.image ? [e.image] : []), t = y(() => Array.isArray(e.desc) ? e.desc : e.desc ? [e.desc] : []);
|
|
31
31
|
return () => {
|
|
32
|
-
var u, d, g, x, f,
|
|
32
|
+
var u, d, g, x, f, v, l;
|
|
33
33
|
let r;
|
|
34
34
|
return i("div", {
|
|
35
35
|
class: "flex gap-2 items-center"
|
|
@@ -60,17 +60,17 @@ const I = /* @__PURE__ */ h({
|
|
|
60
60
|
var n;
|
|
61
61
|
return (n = e.onClick) == null ? void 0 : n.call(e);
|
|
62
62
|
},
|
|
63
|
-
class: b(["transition-all truncate
|
|
63
|
+
class: b(["transition-all truncate", (e == null ? void 0 : e.onClick) && "hover:text-primary cursor-pointer"])
|
|
64
64
|
}, [e.title || ((g = a.default) == null ? void 0 : g.call(a))])]), ((t == null ? void 0 : t.value.length) > 0 || a.desc) && i("div", {
|
|
65
65
|
class: "text-sm text-muted flex flex-col gap-0"
|
|
66
66
|
}, [(f = t == null ? void 0 : (x = t.value).map) == null ? void 0 : f.call(x, (n, m) => i("div", {
|
|
67
67
|
key: m,
|
|
68
68
|
class: "truncate"
|
|
69
|
-
}, [n])), (
|
|
69
|
+
}, [n])), (v = a.desc) == null ? void 0 : v.call(a)])]), (e == null ? void 0 : e.extend) && i("div", {
|
|
70
70
|
class: "flex-none flex items-center gap-2 text-gray-7"
|
|
71
71
|
}, [e == null ? void 0 : e.extend]), (a == null ? void 0 : a.extend) && i("div", {
|
|
72
72
|
class: "flex-none flex items-center gap-2 text-gray-7"
|
|
73
|
-
}, [(
|
|
73
|
+
}, [(l = a == null ? void 0 : a.extend) == null ? void 0 : l.call(a)])]);
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as
|
|
1
|
+
import { defineComponent as m, createVNode as e } from "vue";
|
|
2
|
+
import { useI18n as i } from "@duxweb/dvha-core";
|
|
3
3
|
import { DuxDrawEmptyForm as n } from "../draw/drawEmptyForm.js";
|
|
4
|
-
const
|
|
4
|
+
const s = /* @__PURE__ */ m({
|
|
5
5
|
name: "DuxListEmpty",
|
|
6
6
|
props: {
|
|
7
7
|
title: String,
|
|
@@ -11,10 +11,12 @@ const a = /* @__PURE__ */ i({
|
|
|
11
11
|
setup(t) {
|
|
12
12
|
const {
|
|
13
13
|
t: l
|
|
14
|
-
} =
|
|
14
|
+
} = i();
|
|
15
15
|
return () => e("div", {
|
|
16
16
|
class: "flex flex-col items-center justify-center gap-2 h-full"
|
|
17
|
-
}, [e(n,
|
|
17
|
+
}, [e(n, {
|
|
18
|
+
class: "max-h-120px"
|
|
19
|
+
}, null), e("div", {
|
|
18
20
|
class: "text-lg text-default font-bold"
|
|
19
21
|
}, [(t == null ? void 0 : t.title) || l("pages.empty.title")]), e("div", {
|
|
20
22
|
class: "text-muted"
|
|
@@ -22,5 +24,5 @@ const a = /* @__PURE__ */ i({
|
|
|
22
24
|
}
|
|
23
25
|
});
|
|
24
26
|
export {
|
|
25
|
-
|
|
27
|
+
s as DuxListEmpty
|
|
26
28
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as u, computed as f, toRef as
|
|
2
|
-
import { useI18n as
|
|
1
|
+
import { defineComponent as u, computed as f, toRef as d, createVNode as i, mergeProps as e } from "vue";
|
|
2
|
+
import { useI18n as c } from "@duxweb/dvha-core";
|
|
3
3
|
import { useWindowSize as b } from "@vueuse/core";
|
|
4
4
|
import { NDataTable as m, NPagination as g } from "naive-ui";
|
|
5
5
|
import "vue-router";
|
|
@@ -61,46 +61,47 @@ const ft = /* @__PURE__ */ u({
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
extends: m,
|
|
64
|
-
setup(
|
|
64
|
+
setup(o) {
|
|
65
65
|
const p = f(() => {
|
|
66
66
|
const {
|
|
67
|
-
path:
|
|
68
|
-
filter:
|
|
69
|
-
columns:
|
|
67
|
+
path: t,
|
|
68
|
+
filter: h,
|
|
69
|
+
columns: v,
|
|
70
70
|
pagination: D,
|
|
71
71
|
...s
|
|
72
|
-
} =
|
|
72
|
+
} = o;
|
|
73
73
|
return s;
|
|
74
|
-
}),
|
|
75
|
-
path:
|
|
76
|
-
filters:
|
|
77
|
-
columns:
|
|
78
|
-
pagination:
|
|
74
|
+
}), n = d(o.filter || {}), r = y({
|
|
75
|
+
path: o.path,
|
|
76
|
+
filters: n.value,
|
|
77
|
+
columns: o.columns || [],
|
|
78
|
+
pagination: o.pagination
|
|
79
79
|
}), {
|
|
80
80
|
width: l
|
|
81
81
|
} = b(), {
|
|
82
|
-
t:
|
|
83
|
-
} =
|
|
84
|
-
return () =>
|
|
82
|
+
t: a
|
|
83
|
+
} = c();
|
|
84
|
+
return () => i("div", {
|
|
85
85
|
class: "flex flex-col gap-2"
|
|
86
|
-
}, [
|
|
86
|
+
}, [i(m, e(p.value, r.table.value, {
|
|
87
87
|
class: "flex-1 min-h-0",
|
|
88
88
|
minHeight: 200,
|
|
89
89
|
tableLayout: "fixed",
|
|
90
90
|
flexHeight: !0,
|
|
91
|
-
rowKey: (
|
|
92
|
-
bordered: !1
|
|
91
|
+
rowKey: (t) => t.id,
|
|
92
|
+
bordered: !1,
|
|
93
|
+
renderCell: (t) => t == null || t === "" ? "-" : t
|
|
93
94
|
}), {
|
|
94
|
-
empty: () =>
|
|
95
|
+
empty: () => i(x, {
|
|
95
96
|
bordered: !1
|
|
96
97
|
}, null)
|
|
97
|
-
}),
|
|
98
|
+
}), o.pagination && i("div", {
|
|
98
99
|
class: "flex justify-end"
|
|
99
|
-
}, [
|
|
100
|
+
}, [i(g, e(r.tablePagination.value, {
|
|
100
101
|
simple: l.value < 768
|
|
101
102
|
}), {
|
|
102
|
-
prefix: () =>
|
|
103
|
-
total:
|
|
103
|
+
prefix: () => i("div", null, [a("components.list.total", {
|
|
104
|
+
total: r.total.value || 0
|
|
104
105
|
})])
|
|
105
106
|
})])]);
|
|
106
107
|
}
|
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { NDataTable as
|
|
3
|
-
import { DuxTableLayout as
|
|
1
|
+
import { defineComponent as n, computed as p, createVNode as a, mergeProps as b } from "vue";
|
|
2
|
+
import { NDataTable as o } from "naive-ui";
|
|
3
|
+
import { DuxTableLayout as d } from "../layout/table.js";
|
|
4
4
|
import "@duxweb/dvha-core";
|
|
5
5
|
import "clsx";
|
|
6
|
-
import { DuxListEmpty as
|
|
7
|
-
const y = /* @__PURE__ */
|
|
6
|
+
import { DuxListEmpty as u } from "../status/listEmpty.js";
|
|
7
|
+
const y = /* @__PURE__ */ n({
|
|
8
8
|
name: "DuxTablePage",
|
|
9
9
|
props: {
|
|
10
10
|
tableProps: {
|
|
11
11
|
type: Object
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
|
-
extends:
|
|
14
|
+
extends: d,
|
|
15
15
|
slots: Object,
|
|
16
16
|
setup(i, {
|
|
17
17
|
slots: e
|
|
18
18
|
}) {
|
|
19
|
-
const
|
|
19
|
+
const m = p(() => {
|
|
20
20
|
const {
|
|
21
|
-
tableProps:
|
|
22
|
-
...
|
|
21
|
+
tableProps: t,
|
|
22
|
+
...r
|
|
23
23
|
} = i;
|
|
24
|
-
return
|
|
24
|
+
return r;
|
|
25
25
|
});
|
|
26
|
-
return () =>
|
|
27
|
-
default: (
|
|
26
|
+
return () => a(d, m.value, {
|
|
27
|
+
default: (t) => a(o, b(t.table.value, i.tableProps, {
|
|
28
28
|
class: "h-full",
|
|
29
29
|
minHeight: 200,
|
|
30
30
|
tableLayout: "fixed",
|
|
31
31
|
flexHeight: !0,
|
|
32
|
-
rowKey: (
|
|
32
|
+
rowKey: (r) => r.id,
|
|
33
33
|
bordered: !1,
|
|
34
|
-
scrollX:
|
|
34
|
+
scrollX: t.width,
|
|
35
|
+
renderCell: (r) => r == null || r === "" ? "-" : r
|
|
35
36
|
}), {
|
|
36
|
-
empty: () =>
|
|
37
|
+
empty: () => a(u, {
|
|
37
38
|
bordered: !1
|
|
38
39
|
}, null)
|
|
39
40
|
}),
|
|
@@ -21,7 +21,7 @@ const oe = /* @__PURE__ */ Y({
|
|
|
21
21
|
draggable: Boolean,
|
|
22
22
|
bordered: {
|
|
23
23
|
type: Boolean,
|
|
24
|
-
default: !
|
|
24
|
+
default: !1
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
extends: T,
|
|
@@ -136,6 +136,7 @@ const oe = /* @__PURE__ */ Y({
|
|
|
136
136
|
});
|
|
137
137
|
return () => n(le, {
|
|
138
138
|
class: "h-full",
|
|
139
|
+
contentClass: "flex flex-col",
|
|
139
140
|
bordered: t.bordered
|
|
140
141
|
}, {
|
|
141
142
|
default: () => {
|