@duxweb/dvha-pro 1.1.4 → 1.1.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.
- package/dist/cjs/components/editor/aiEditor.cjs +1 -1
- package/dist/cjs/components/form/drawerForm.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/form/pageTabForm.cjs +1 -1
- package/dist/cjs/components/form/settingForm.cjs +1 -1
- package/dist/cjs/components/tree/treeFilter.cjs +1 -1
- package/dist/cjs/components/upload/file.cjs +1 -1
- package/dist/cjs/components/upload/image.cjs +1 -1
- package/dist/cjs/hooks/table/input.cjs +1 -1
- package/dist/cjs/hooks/table/switch.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/theme/uno.css.cjs +4 -1
- package/dist/esm/components/editor/aiEditor.js +62 -61
- package/dist/esm/components/form/drawerForm.js +30 -22
- package/dist/esm/components/form/modalForm.js +18 -10
- package/dist/esm/components/form/pageForm.js +26 -18
- package/dist/esm/components/form/pageTabForm.js +32 -24
- package/dist/esm/components/form/settingForm.js +29 -21
- package/dist/esm/components/tree/treeFilter.js +50 -49
- package/dist/esm/components/upload/file.js +25 -26
- package/dist/esm/components/upload/image.js +60 -64
- package/dist/esm/hooks/table/input.js +74 -40
- package/dist/esm/hooks/table/switch.js +15 -15
- package/dist/esm/langs/en-US.json.js +1 -1
- package/dist/esm/langs/zh-CN.json.js +1 -1
- package/dist/esm/theme/uno.css.js +4 -1
- package/dist/types/components/form/drawerForm.d.ts +12 -0
- package/dist/types/components/form/modalForm.d.ts +12 -0
- package/dist/types/components/form/pageForm.d.ts +12 -0
- package/dist/types/components/form/pageTabForm.d.ts +12 -0
- package/dist/types/components/form/settingForm.d.ts +12 -0
- package/dist/types/hooks/table/input.d.ts +3 -0
- package/dist/types/hooks/table/switch.d.ts +1 -0
- package/package.json +3 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTheme as
|
|
3
|
-
import { useVModel as
|
|
4
|
-
import { AiEditor as
|
|
5
|
-
import { useMessage as
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as S, ref as k, computed as C, watch as c, onMounted as w, onUnmounted as x, createVNode as A } from "vue";
|
|
2
|
+
import { useTheme as E, useManage as M, useGetAuth as V, useI18n as D, useUpload as F } from "@duxweb/dvha-core";
|
|
3
|
+
import { useVModel as N } from "@vueuse/core";
|
|
4
|
+
import { AiEditor as O } from "aieditor";
|
|
5
|
+
import { useMessage as b } from "naive-ui";
|
|
6
|
+
const B = /* @__PURE__ */ S({
|
|
7
7
|
name: "DuxAiEditor",
|
|
8
8
|
props: {
|
|
9
9
|
value: String,
|
|
@@ -17,74 +17,75 @@ const T = /* @__PURE__ */ H({
|
|
|
17
17
|
},
|
|
18
18
|
onUpdateValue: Function
|
|
19
19
|
},
|
|
20
|
-
setup(
|
|
21
|
-
emit:
|
|
20
|
+
setup(t, {
|
|
21
|
+
emit: f
|
|
22
22
|
}) {
|
|
23
|
-
const
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
config:
|
|
27
|
-
} =
|
|
28
|
-
t:
|
|
29
|
-
} =
|
|
23
|
+
const a = k();
|
|
24
|
+
let o = null, i = !1;
|
|
25
|
+
const m = E(), {
|
|
26
|
+
config: h
|
|
27
|
+
} = M(), g = V(), {
|
|
28
|
+
t: v
|
|
29
|
+
} = D(), P = b(), U = t.value ?? t.defaultValue ?? "", r = N(t, "value", f, {
|
|
30
30
|
passive: !0
|
|
31
|
-
}),
|
|
32
|
-
path:
|
|
31
|
+
}), u = C(() => t.uploadPath || h.apiPath?.upload || "upload"), d = F({
|
|
32
|
+
path: u.value,
|
|
33
33
|
autoUpload: !1
|
|
34
34
|
});
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
c(r, (e) => {
|
|
36
|
+
!o || i || o.setContent(e || "");
|
|
37
37
|
}, {
|
|
38
|
-
immediate: !0
|
|
38
|
+
immediate: !0,
|
|
39
|
+
flush: "post"
|
|
39
40
|
});
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
41
|
+
const s = (e) => new Promise((l, H) => {
|
|
42
|
+
d.addFiles([e], "file").then(() => {
|
|
43
|
+
d.trigger().then((n) => {
|
|
44
|
+
n.forEach((p) => {
|
|
45
|
+
const y = p?.data?.data;
|
|
46
|
+
l({
|
|
46
47
|
errorCode: 0,
|
|
47
48
|
data: {
|
|
48
|
-
src:
|
|
49
|
-
alt:
|
|
49
|
+
src: y?.url,
|
|
50
|
+
alt: p?.filename
|
|
50
51
|
}
|
|
51
52
|
});
|
|
52
53
|
});
|
|
53
|
-
}).catch((
|
|
54
|
-
|
|
54
|
+
}).catch((n) => {
|
|
55
|
+
P.error(n.message), H(n);
|
|
55
56
|
}).finally(() => {
|
|
56
|
-
|
|
57
|
+
d.clearFiles();
|
|
57
58
|
});
|
|
58
59
|
});
|
|
59
60
|
});
|
|
60
|
-
return
|
|
61
|
-
|
|
62
|
-
theme:
|
|
63
|
-
element:
|
|
64
|
-
placeholder:
|
|
65
|
-
content:
|
|
61
|
+
return w(() => {
|
|
62
|
+
o = new O({
|
|
63
|
+
theme: m.isDark.value ? "dark" : "light",
|
|
64
|
+
element: a.value,
|
|
65
|
+
placeholder: v("components.editor.placeholder"),
|
|
66
|
+
content: U,
|
|
66
67
|
onBlur: (e) => {
|
|
67
|
-
|
|
68
|
+
i = !0, r.value = e.getHtml(), i = !1;
|
|
68
69
|
},
|
|
69
70
|
image: {
|
|
70
|
-
uploadUrl:
|
|
71
|
-
uploadHeaders:
|
|
72
|
-
uploader:
|
|
71
|
+
uploadUrl: u.value,
|
|
72
|
+
uploadHeaders: t.uploadHeaders || {},
|
|
73
|
+
uploader: s
|
|
73
74
|
},
|
|
74
75
|
video: {
|
|
75
|
-
uploadUrl:
|
|
76
|
-
uploadHeaders:
|
|
77
|
-
uploader:
|
|
76
|
+
uploadUrl: u.value,
|
|
77
|
+
uploadHeaders: t.uploadHeaders || {},
|
|
78
|
+
uploader: s
|
|
78
79
|
},
|
|
79
80
|
attachment: {
|
|
80
|
-
uploadUrl:
|
|
81
|
-
uploadHeaders:
|
|
82
|
-
uploader:
|
|
81
|
+
uploadUrl: u.value,
|
|
82
|
+
uploadHeaders: t.uploadHeaders || {},
|
|
83
|
+
uploader: s
|
|
83
84
|
},
|
|
84
85
|
ai: {
|
|
85
86
|
models: {
|
|
86
87
|
custom: {
|
|
87
|
-
url:
|
|
88
|
+
url: t.aiPath || h.apiPath?.ai || "ai",
|
|
88
89
|
headers: () => ({
|
|
89
90
|
"Content-Type": "application/json",
|
|
90
91
|
Authorization: g.token
|
|
@@ -93,31 +94,31 @@ const T = /* @__PURE__ */ H({
|
|
|
93
94
|
prompt: e
|
|
94
95
|
}),
|
|
95
96
|
parseMessage: (e) => {
|
|
96
|
-
const
|
|
97
|
+
const l = JSON.parse(e);
|
|
97
98
|
return {
|
|
98
99
|
role: "assistant",
|
|
99
|
-
content:
|
|
100
|
-
index:
|
|
101
|
-
status:
|
|
100
|
+
content: l.message,
|
|
101
|
+
index: l.number,
|
|
102
|
+
status: l.status
|
|
102
103
|
};
|
|
103
104
|
},
|
|
104
105
|
protocol: "sse"
|
|
105
106
|
}
|
|
106
107
|
}
|
|
107
108
|
}
|
|
108
|
-
});
|
|
109
|
-
}),
|
|
110
|
-
|
|
111
|
-
}),
|
|
112
|
-
|
|
109
|
+
}), r.value != null && o.setContent(r.value || "");
|
|
110
|
+
}), x(() => {
|
|
111
|
+
o?.destroy();
|
|
112
|
+
}), c(m.isDark, (e) => {
|
|
113
|
+
a.value && (a.value.classList.remove("aie-theme-dark", "aie-theme-light"), a.value.classList.add(e ? "aie-theme-dark" : "aie-theme-light"));
|
|
113
114
|
}, {
|
|
114
115
|
immediate: !0
|
|
115
|
-
}), () =>
|
|
116
|
-
ref:
|
|
117
|
-
style: `height: ${
|
|
116
|
+
}), () => A("div", {
|
|
117
|
+
ref: a,
|
|
118
|
+
style: `height: ${t.height}; width:100%`
|
|
118
119
|
}, null);
|
|
119
120
|
}
|
|
120
121
|
});
|
|
121
122
|
export {
|
|
122
|
-
|
|
123
|
+
B as DuxAiEditor
|
|
123
124
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as
|
|
3
|
-
import { useMessage as
|
|
1
|
+
import { defineComponent as S, computed as v, toRef as C, createVNode as i, Fragment as F, mergeProps as x, isVNode as D } from "vue";
|
|
2
|
+
import { useI18n as j, useInvalidate as E, useExtendForm as N } from "@duxweb/dvha-core";
|
|
3
|
+
import { useMessage as O, NButton as p, NScrollbar as h } from "naive-ui";
|
|
4
4
|
import "clsx";
|
|
5
5
|
import "vue-echarts";
|
|
6
6
|
import "vue-router";
|
|
@@ -52,7 +52,7 @@ import "@vee-validate/i18n/dist/locale/zh_CN.json";
|
|
|
52
52
|
import "vee-validate";
|
|
53
53
|
import "vue-command-palette";
|
|
54
54
|
import "../../pages/page404.js";
|
|
55
|
-
import { DuxDrawerPage as
|
|
55
|
+
import { DuxDrawerPage as w } from "../drawer/drawerPage.js";
|
|
56
56
|
import "short-unique-id";
|
|
57
57
|
import "aieditor";
|
|
58
58
|
import "@vue-flow/core";
|
|
@@ -62,10 +62,10 @@ import "@vue-flow/background";
|
|
|
62
62
|
import "@iconify-json/tabler/icons.json";
|
|
63
63
|
import "../posterEditor/elements/index.js";
|
|
64
64
|
import "fabric";
|
|
65
|
-
function
|
|
65
|
+
function c(t) {
|
|
66
66
|
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !D(t);
|
|
67
67
|
}
|
|
68
|
-
const Qt = /* @__PURE__ */
|
|
68
|
+
const Qt = /* @__PURE__ */ S({
|
|
69
69
|
name: "DuxDrawerForm",
|
|
70
70
|
props: {
|
|
71
71
|
id: {
|
|
@@ -80,6 +80,12 @@ const Qt = /* @__PURE__ */ b({
|
|
|
80
80
|
data: {
|
|
81
81
|
type: Object
|
|
82
82
|
},
|
|
83
|
+
meta: {
|
|
84
|
+
type: Object
|
|
85
|
+
},
|
|
86
|
+
params: {
|
|
87
|
+
type: Object
|
|
88
|
+
},
|
|
83
89
|
onClose: {
|
|
84
90
|
type: Function
|
|
85
91
|
},
|
|
@@ -98,11 +104,11 @@ const Qt = /* @__PURE__ */ b({
|
|
|
98
104
|
},
|
|
99
105
|
extends: a,
|
|
100
106
|
setup(t, {
|
|
101
|
-
slots:
|
|
107
|
+
slots: s
|
|
102
108
|
}) {
|
|
103
109
|
const {
|
|
104
110
|
t: r
|
|
105
|
-
} =
|
|
111
|
+
} = j(), l = v(() => {
|
|
106
112
|
const {
|
|
107
113
|
onClose: o,
|
|
108
114
|
onSuccess: e,
|
|
@@ -112,20 +118,22 @@ const Qt = /* @__PURE__ */ b({
|
|
|
112
118
|
id: I,
|
|
113
119
|
path: L,
|
|
114
120
|
data: R,
|
|
115
|
-
...
|
|
121
|
+
...b
|
|
116
122
|
} = t;
|
|
117
|
-
return
|
|
118
|
-
}), u = C(t, "data", {}), m =
|
|
123
|
+
return b;
|
|
124
|
+
}), u = C(t, "data", {}), m = O(), {
|
|
119
125
|
invalidate: d
|
|
120
|
-
} =
|
|
126
|
+
} = E(), {
|
|
121
127
|
isLoading: n,
|
|
122
128
|
onSubmit: f,
|
|
123
|
-
onReset:
|
|
124
|
-
isEdit:
|
|
125
|
-
} =
|
|
129
|
+
onReset: y,
|
|
130
|
+
isEdit: g
|
|
131
|
+
} = N({
|
|
126
132
|
id: t.id,
|
|
127
133
|
path: t.path,
|
|
128
134
|
form: u,
|
|
135
|
+
meta: t.meta,
|
|
136
|
+
params: t.params,
|
|
129
137
|
action: t.action,
|
|
130
138
|
onError: (o) => {
|
|
131
139
|
m.error(o.message || r("components.form.error")), t.onError?.(o);
|
|
@@ -134,30 +142,30 @@ const Qt = /* @__PURE__ */ b({
|
|
|
134
142
|
m.success(r("components.form.success")), t.onSuccess?.(o), t.onClose?.(), t.invalidate && d(t.invalidate);
|
|
135
143
|
}
|
|
136
144
|
});
|
|
137
|
-
return () => i(
|
|
145
|
+
return () => i(w, {
|
|
138
146
|
scrollbar: !1,
|
|
139
|
-
title: t?.title || (
|
|
147
|
+
title: t?.title || (g.value ? r("components.form.edit") : r("components.form.create")),
|
|
140
148
|
onClose: t?.onClose
|
|
141
149
|
}, {
|
|
142
|
-
default: () => i(
|
|
150
|
+
default: () => i(h, null, {
|
|
143
151
|
default: () => [i(a, x({
|
|
144
152
|
class: "p-4"
|
|
145
153
|
}, l.value), {
|
|
146
|
-
default: () => [
|
|
154
|
+
default: () => [s?.default?.()]
|
|
147
155
|
})]
|
|
148
156
|
}),
|
|
149
157
|
footer: () => {
|
|
150
158
|
let o, e;
|
|
151
159
|
return i(F, null, [i(p, {
|
|
152
|
-
onClick:
|
|
160
|
+
onClick: y,
|
|
153
161
|
loading: n.value
|
|
154
|
-
},
|
|
162
|
+
}, c(o = r("components.button.reset")) ? o : {
|
|
155
163
|
default: () => [o]
|
|
156
164
|
}), i(p, {
|
|
157
165
|
type: "primary",
|
|
158
166
|
loading: n.value,
|
|
159
167
|
onClick: () => f()
|
|
160
|
-
},
|
|
168
|
+
}, c(e = r("components.button.submit")) ? e : {
|
|
161
169
|
default: () => [e]
|
|
162
170
|
})]);
|
|
163
171
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as S, computed as b, toRef as C, createVNode as r, Fragment as v, isVNode as F } from "vue";
|
|
2
|
-
import { useI18n as x, useInvalidate as
|
|
3
|
-
import { useMessage as
|
|
2
|
+
import { useI18n as x, useInvalidate as j, useExtendForm as E } from "@duxweb/dvha-core";
|
|
3
|
+
import { useMessage as O, NButton as n } from "naive-ui";
|
|
4
4
|
import "clsx";
|
|
5
5
|
import "vue-echarts";
|
|
6
6
|
import "vue-router";
|
|
@@ -24,7 +24,7 @@ import "ace-builds/src-noconflict/ext-searchbox";
|
|
|
24
24
|
import "ace-builds/src-noconflict/ext-language_tools";
|
|
25
25
|
import "ace-builds/src-noconflict/mode-snippets";
|
|
26
26
|
import "vue-cropper";
|
|
27
|
-
import
|
|
27
|
+
import h from "../modal/modalPage.js";
|
|
28
28
|
import "jinrishici";
|
|
29
29
|
import "vue-draggable-plus";
|
|
30
30
|
import "@vee-validate/i18n";
|
|
@@ -80,6 +80,12 @@ const Ht = /* @__PURE__ */ S({
|
|
|
80
80
|
data: {
|
|
81
81
|
type: Object
|
|
82
82
|
},
|
|
83
|
+
meta: {
|
|
84
|
+
type: Object
|
|
85
|
+
},
|
|
86
|
+
params: {
|
|
87
|
+
type: Object
|
|
88
|
+
},
|
|
83
89
|
onClose: {
|
|
84
90
|
type: Function
|
|
85
91
|
},
|
|
@@ -106,25 +112,27 @@ const Ht = /* @__PURE__ */ S({
|
|
|
106
112
|
const {
|
|
107
113
|
onClose: o,
|
|
108
114
|
onSuccess: m,
|
|
109
|
-
onError:
|
|
110
|
-
action:
|
|
111
|
-
title:
|
|
115
|
+
onError: D,
|
|
116
|
+
action: M,
|
|
117
|
+
title: N,
|
|
112
118
|
id: _,
|
|
113
119
|
path: k,
|
|
114
120
|
data: I,
|
|
115
121
|
...g
|
|
116
122
|
} = t;
|
|
117
123
|
return g;
|
|
118
|
-
}), u = C(t, "data", {}), e =
|
|
124
|
+
}), u = C(t, "data", {}), e = O(), {
|
|
119
125
|
invalidate: l
|
|
120
|
-
} =
|
|
126
|
+
} = j(), {
|
|
121
127
|
isLoading: d,
|
|
122
128
|
onSubmit: f,
|
|
123
129
|
isEdit: y
|
|
124
|
-
} =
|
|
130
|
+
} = E({
|
|
125
131
|
id: t.id,
|
|
126
132
|
path: t.path,
|
|
127
133
|
form: u,
|
|
134
|
+
meta: t.meta,
|
|
135
|
+
params: t.params,
|
|
128
136
|
action: t.action,
|
|
129
137
|
onError: (o) => {
|
|
130
138
|
e.error(o.message || i("components.form.error")), t.onError?.(o);
|
|
@@ -133,7 +141,7 @@ const Ht = /* @__PURE__ */ S({
|
|
|
133
141
|
t.invalidate && l(t.invalidate), e.success(i("components.form.success")), t.onSuccess?.(o), t.onClose?.();
|
|
134
142
|
}
|
|
135
143
|
});
|
|
136
|
-
return () => r(
|
|
144
|
+
return () => r(h, {
|
|
137
145
|
title: t?.title || (y.value ? i("components.form.edit") : i("components.form.create")),
|
|
138
146
|
onClose: t?.onClose
|
|
139
147
|
}, {
|
|
@@ -63,7 +63,7 @@ import "@vee-validate/i18n/dist/locale/zh_CN.json";
|
|
|
63
63
|
import "vue-command-palette";
|
|
64
64
|
import { DuxPage as C } from "../../pages/page.js";
|
|
65
65
|
import "../../pages/page404.js";
|
|
66
|
-
const
|
|
66
|
+
const Mt = /* @__PURE__ */ f({
|
|
67
67
|
name: "DuxPageForm",
|
|
68
68
|
props: {
|
|
69
69
|
id: {
|
|
@@ -88,6 +88,12 @@ const Ot = /* @__PURE__ */ f({
|
|
|
88
88
|
data: {
|
|
89
89
|
type: Object
|
|
90
90
|
},
|
|
91
|
+
meta: {
|
|
92
|
+
type: Object
|
|
93
|
+
},
|
|
94
|
+
params: {
|
|
95
|
+
type: Object
|
|
96
|
+
},
|
|
91
97
|
onSuccess: {
|
|
92
98
|
type: Function
|
|
93
99
|
},
|
|
@@ -99,30 +105,32 @@ const Ot = /* @__PURE__ */ f({
|
|
|
99
105
|
}
|
|
100
106
|
},
|
|
101
107
|
setup(t, {
|
|
102
|
-
slots:
|
|
108
|
+
slots: a
|
|
103
109
|
}) {
|
|
104
110
|
const {
|
|
105
111
|
t: r
|
|
106
|
-
} = g(), l = b(t, "data", {}),
|
|
107
|
-
invalidate:
|
|
108
|
-
} = S(),
|
|
112
|
+
} = g(), l = b(t, "data", {}), n = v(), c = E(), m = y(), {
|
|
113
|
+
invalidate: s
|
|
114
|
+
} = S(), e = x({
|
|
109
115
|
id: t.id,
|
|
110
116
|
path: t.path,
|
|
111
117
|
form: l,
|
|
118
|
+
meta: t.meta,
|
|
119
|
+
params: t.params,
|
|
112
120
|
action: t.action,
|
|
113
|
-
onError: (
|
|
114
|
-
|
|
121
|
+
onError: (i) => {
|
|
122
|
+
n.error(i.message || r("components.form.error")), t.onError?.(i);
|
|
115
123
|
},
|
|
116
|
-
onSuccess: (
|
|
117
|
-
|
|
124
|
+
onSuccess: (i) => {
|
|
125
|
+
n.success(r("components.form.success")), t.onSuccess?.(i), !e.isEdit.value && m.current && m.delTab(m.current, (d) => c.push(d.path || "")), t.invalidate && s(t.invalidate);
|
|
118
126
|
}
|
|
119
|
-
}), u = m.tabs.find((
|
|
127
|
+
}), u = m.tabs.find((i) => i.path === m.current);
|
|
120
128
|
return () => o(C, {
|
|
121
129
|
card: !1,
|
|
122
130
|
scrollbar: !1
|
|
123
131
|
}, {
|
|
124
132
|
default: () => [o(F, {
|
|
125
|
-
title: t?.title || u?.label || (
|
|
133
|
+
title: t?.title || u?.label || (e.isEdit.value ? r("components.form.edit") : r("components.form.create")),
|
|
126
134
|
description: t?.description,
|
|
127
135
|
class: "h-full flex flex-col",
|
|
128
136
|
contentClass: "flex-1 min-h-0",
|
|
@@ -134,16 +142,16 @@ const Ot = /* @__PURE__ */ f({
|
|
|
134
142
|
labelPlacement: t.labelPlacement,
|
|
135
143
|
class: "p-4"
|
|
136
144
|
}, {
|
|
137
|
-
default: () => [
|
|
145
|
+
default: () => [a?.default?.(e)]
|
|
138
146
|
})]
|
|
139
147
|
}),
|
|
140
148
|
headerExtra: () => o("div", {
|
|
141
149
|
class: "flex gap-6 items-center"
|
|
142
|
-
}, [
|
|
150
|
+
}, [a?.actions?.(e), o("div", {
|
|
143
151
|
class: "flex gap-2"
|
|
144
152
|
}, [o(p, {
|
|
145
|
-
onClick: () =>
|
|
146
|
-
loading:
|
|
153
|
+
onClick: () => e.onReset(),
|
|
154
|
+
loading: e.isLoading.value
|
|
147
155
|
}, {
|
|
148
156
|
default: () => r("components.button.reset"),
|
|
149
157
|
icon: () => o("i", {
|
|
@@ -151,8 +159,8 @@ const Ot = /* @__PURE__ */ f({
|
|
|
151
159
|
}, null)
|
|
152
160
|
}), o(p, {
|
|
153
161
|
type: "primary",
|
|
154
|
-
onClick: () =>
|
|
155
|
-
loading:
|
|
162
|
+
onClick: () => e.onSubmit(),
|
|
163
|
+
loading: e.isLoading.value
|
|
156
164
|
}, {
|
|
157
165
|
default: () => r("components.button.submit"),
|
|
158
166
|
icon: () => o("i", {
|
|
@@ -164,5 +172,5 @@ const Ot = /* @__PURE__ */ f({
|
|
|
164
172
|
}
|
|
165
173
|
});
|
|
166
174
|
export {
|
|
167
|
-
|
|
175
|
+
Mt as DuxPageForm
|
|
168
176
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as d, toRef as f, createVNode as
|
|
2
|
-
import { useI18n as
|
|
1
|
+
import { defineComponent as d, toRef as f, createVNode as o } from "vue";
|
|
2
|
+
import { useI18n as b, useTabStore as g, useInvalidate as y, useExtendForm as v } from "@duxweb/dvha-core";
|
|
3
3
|
import { useMessage as x, NTabs as S, NButton as n } from "naive-ui";
|
|
4
4
|
import { useRouter as h } from "vue-router";
|
|
5
5
|
import "@overlastic/vue";
|
|
@@ -62,7 +62,7 @@ import "@vee-validate/i18n/dist/locale/zh_CN.json";
|
|
|
62
62
|
import "vue-command-palette";
|
|
63
63
|
import { DuxPage as E } from "../../pages/page.js";
|
|
64
64
|
import "../../pages/page404.js";
|
|
65
|
-
const
|
|
65
|
+
const Lt = /* @__PURE__ */ d({
|
|
66
66
|
name: "DuxPageTabForm",
|
|
67
67
|
props: {
|
|
68
68
|
id: {
|
|
@@ -80,6 +80,12 @@ const jt = /* @__PURE__ */ d({
|
|
|
80
80
|
data: {
|
|
81
81
|
type: Object
|
|
82
82
|
},
|
|
83
|
+
meta: {
|
|
84
|
+
type: Object
|
|
85
|
+
},
|
|
86
|
+
params: {
|
|
87
|
+
type: Object
|
|
88
|
+
},
|
|
83
89
|
onSuccess: {
|
|
84
90
|
type: Function
|
|
85
91
|
},
|
|
@@ -94,61 +100,63 @@ const jt = /* @__PURE__ */ d({
|
|
|
94
100
|
default: "0"
|
|
95
101
|
}
|
|
96
102
|
},
|
|
97
|
-
setup(
|
|
98
|
-
slots:
|
|
103
|
+
setup(t, {
|
|
104
|
+
slots: a
|
|
99
105
|
}) {
|
|
100
106
|
const {
|
|
101
107
|
t: r
|
|
102
|
-
} =
|
|
108
|
+
} = b(), s = f(t, "data", {}), p = x(), l = h(), m = g(), {
|
|
103
109
|
invalidate: u
|
|
104
110
|
} = y(), i = v({
|
|
105
|
-
id:
|
|
106
|
-
path:
|
|
111
|
+
id: t.id,
|
|
112
|
+
path: t.path,
|
|
107
113
|
form: s,
|
|
108
|
-
|
|
114
|
+
meta: t.meta,
|
|
115
|
+
params: t.params,
|
|
116
|
+
action: t.action,
|
|
109
117
|
onError: (e) => {
|
|
110
|
-
|
|
118
|
+
p.error(e.message || r("components.form.error")), t.onError?.(e);
|
|
111
119
|
},
|
|
112
120
|
onSuccess: (e) => {
|
|
113
|
-
|
|
121
|
+
p.success(r("components.form.success")), t.onSuccess?.(e), !i.isEdit.value && m.current && m.delTab(m.current, (c) => l.push(c.path || "")), t.invalidate && u(t.invalidate);
|
|
114
122
|
}
|
|
115
123
|
});
|
|
116
|
-
return () =>
|
|
124
|
+
return () => o(E, {
|
|
117
125
|
card: !1,
|
|
118
126
|
scrollbar: !1
|
|
119
127
|
}, {
|
|
120
|
-
default: () => [
|
|
128
|
+
default: () => [o(T, {
|
|
121
129
|
class: "h-full"
|
|
122
130
|
}, {
|
|
123
|
-
default: () => [
|
|
131
|
+
default: () => [o(S, {
|
|
124
132
|
class: "app-page-tabs",
|
|
125
133
|
type: "line",
|
|
126
134
|
size: "large",
|
|
127
|
-
defaultValue:
|
|
135
|
+
defaultValue: t.defaultTab
|
|
128
136
|
}, {
|
|
129
|
-
prefix: () =>
|
|
137
|
+
prefix: () => o("div", {
|
|
130
138
|
class: "w-1"
|
|
131
139
|
}, null),
|
|
132
|
-
default: () =>
|
|
133
|
-
suffix: () =>
|
|
140
|
+
default: () => a?.default?.(i),
|
|
141
|
+
suffix: () => o("div", {
|
|
134
142
|
class: "flex gap-6 items-center px-3"
|
|
135
|
-
}, [
|
|
143
|
+
}, [a?.actions?.(i), o("div", {
|
|
136
144
|
class: "flex gap-2"
|
|
137
|
-
}, [
|
|
145
|
+
}, [o(n, {
|
|
138
146
|
onClick: () => i.onReset(),
|
|
139
147
|
loading: i.isLoading.value
|
|
140
148
|
}, {
|
|
141
149
|
default: () => r("components.button.reset"),
|
|
142
|
-
icon: () =>
|
|
150
|
+
icon: () => o("i", {
|
|
143
151
|
class: "i-tabler:refresh"
|
|
144
152
|
}, null)
|
|
145
|
-
}),
|
|
153
|
+
}), o(n, {
|
|
146
154
|
type: "primary",
|
|
147
155
|
onClick: () => i.onSubmit(),
|
|
148
156
|
loading: i.isLoading.value
|
|
149
157
|
}, {
|
|
150
158
|
default: () => r("components.button.submit"),
|
|
151
|
-
icon: () =>
|
|
159
|
+
icon: () => o("i", {
|
|
152
160
|
class: "i-tabler:device-floppy"
|
|
153
161
|
}, null)
|
|
154
162
|
})])])
|
|
@@ -158,5 +166,5 @@ const jt = /* @__PURE__ */ d({
|
|
|
158
166
|
}
|
|
159
167
|
});
|
|
160
168
|
export {
|
|
161
|
-
|
|
169
|
+
Lt as DuxPageTabForm
|
|
162
170
|
};
|