@king-one/antdv 2.0.4 → 2.1.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.
- package/CHANGELOG.md +6 -0
- package/dist/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
- package/dist/es/components/index.mjs +24 -22
- package/dist/es/components/pro-form-render/index.mjs +11 -0
- package/dist/es/components/pro-form-render/src/index.vue.mjs +107 -0
- package/dist/es/components/pro-form-render/src/index.vue2.mjs +4 -0
- package/dist/es/components/pro-form-render/src/module/AioDatePicker.vue.mjs +28 -0
- package/dist/es/components/pro-form-render/src/module/AioDatePicker.vue2.mjs +4 -0
- package/dist/es/components/pro-form-render/src/module/AioInput.vue.mjs +25 -0
- package/dist/es/components/pro-form-render/src/module/AioInput.vue2.mjs +4 -0
- package/dist/es/components/pro-form-render/src/module/AioInputNumber.vue.mjs +25 -0
- package/dist/es/components/pro-form-render/src/module/AioInputNumber.vue2.mjs +4 -0
- package/dist/es/components/pro-form-render/src/module/AioListInput.css +1 -0
- package/dist/es/components/pro-form-render/src/module/AioListInput.vue.mjs +7 -0
- package/dist/es/components/pro-form-render/src/module/AioListInput.vue2.mjs +84 -0
- package/dist/es/components/pro-form-render/src/module/AioSelect.vue.mjs +53 -0
- package/dist/es/components/pro-form-render/src/module/AioSelect.vue2.mjs +4 -0
- package/dist/es/components/pro-form-render/src/module/AioSwitch.vue.mjs +24 -0
- package/dist/es/components/pro-form-render/src/module/AioSwitch.vue2.mjs +4 -0
- package/dist/es/components/pro-form-render/src/module/AioTextarea.vue.mjs +31 -0
- package/dist/es/components/pro-form-render/src/module/AioTextarea.vue2.mjs +4 -0
- package/dist/es/components/pro-form-render/src/module/AioTimePicker.vue.mjs +26 -0
- package/dist/es/components/pro-form-render/src/module/AioTimePicker.vue2.mjs +4 -0
- package/dist/es/components/pro-form-render/src/module/index.mjs +11 -0
- package/dist/es/components/pro-form-render/src/types.mjs +15 -0
- package/dist/es/components/pro-form-render/src/utils.mjs +17 -0
- package/dist/es/index.mjs +63 -56
- package/dist/lib/_virtual/_plugin-vue_export-helper.js +1 -0
- package/dist/lib/components/index.js +1 -1
- package/dist/lib/components/pro-form-render/index.js +1 -0
- package/dist/lib/components/pro-form-render/src/index.vue.js +1 -0
- package/dist/lib/components/pro-form-render/src/index.vue2.js +1 -0
- package/dist/lib/components/pro-form-render/src/module/AioDatePicker.vue.js +1 -0
- package/dist/lib/components/pro-form-render/src/module/AioDatePicker.vue2.js +1 -0
- package/dist/lib/components/pro-form-render/src/module/AioInput.vue.js +1 -0
- package/dist/lib/components/pro-form-render/src/module/AioInput.vue2.js +1 -0
- package/dist/lib/components/pro-form-render/src/module/AioInputNumber.vue.js +1 -0
- package/dist/lib/components/pro-form-render/src/module/AioInputNumber.vue2.js +1 -0
- package/dist/lib/components/pro-form-render/src/module/AioListInput.css +1 -0
- package/dist/lib/components/pro-form-render/src/module/AioListInput.vue.js +1 -0
- package/dist/lib/components/pro-form-render/src/module/AioListInput.vue2.js +1 -0
- package/dist/lib/components/pro-form-render/src/module/AioSelect.vue.js +1 -0
- package/dist/lib/components/pro-form-render/src/module/AioSelect.vue2.js +1 -0
- package/dist/lib/components/pro-form-render/src/module/AioSwitch.vue.js +1 -0
- package/dist/lib/components/pro-form-render/src/module/AioSwitch.vue2.js +1 -0
- package/dist/lib/components/pro-form-render/src/module/AioTextarea.vue.js +1 -0
- package/dist/lib/components/pro-form-render/src/module/AioTextarea.vue2.js +1 -0
- package/dist/lib/components/pro-form-render/src/module/AioTimePicker.vue.js +1 -0
- package/dist/lib/components/pro-form-render/src/module/AioTimePicker.vue2.js +1 -0
- package/dist/lib/components/pro-form-render/src/module/index.js +1 -0
- package/dist/lib/components/pro-form-render/src/types.js +1 -0
- package/dist/lib/components/pro-form-render/src/utils.js +1 -0
- package/dist/lib/index.js +1 -1
- package/dist/theme-chalk/fonts/iconfont.ttf +0 -0
- package/dist/theme-chalk/fonts/iconfont.woff +0 -0
- package/dist/theme-chalk/fonts/iconfont.woff2 +0 -0
- package/dist/theme-chalk/icon.css +1 -1
- package/dist/theme-chalk/index.css +1 -1
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/pro-form-render/index.d.ts +26 -0
- package/dist/types/components/pro-form-render/src/index.vue.d.ts +25 -0
- package/dist/types/components/pro-form-render/src/module/AioDatePicker.vue.d.ts +26 -0
- package/dist/types/components/pro-form-render/src/module/AioInput.vue.d.ts +26 -0
- package/dist/types/components/pro-form-render/src/module/AioInputNumber.vue.d.ts +26 -0
- package/dist/types/components/pro-form-render/src/module/AioListInput.vue.d.ts +26 -0
- package/dist/types/components/pro-form-render/src/module/AioSelect.vue.d.ts +26 -0
- package/dist/types/components/pro-form-render/src/module/AioSwitch.vue.d.ts +26 -0
- package/dist/types/components/pro-form-render/src/module/AioTextarea.vue.d.ts +26 -0
- package/dist/types/components/pro-form-render/src/module/AioTimePicker.vue.d.ts +26 -0
- package/dist/types/components/pro-form-render/src/module/index.d.ts +8 -0
- package/dist/types/components/pro-form-render/src/types.d.ts +42 -0
- package/dist/types/components/pro-form-render/src/utils.d.ts +13 -0
- package/global.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,49 +1,51 @@
|
|
|
1
1
|
import { KCollapseTranstion as t } from "./collapse-transtion/index.mjs";
|
|
2
|
-
import { KProModal as
|
|
2
|
+
import { KProModal as m } from "./pro-modal/index.mjs";
|
|
3
3
|
import { KProTitle as f } from "./pro-title/index.mjs";
|
|
4
4
|
import { KScrollBar as l } from "./scroll-bar/index.mjs";
|
|
5
5
|
import { KCoverScrollBar as P } from "./cover-scroll-bar/index.mjs";
|
|
6
6
|
import { KScaleVirtualList as i } from "./scale-virtual-list/index.mjs";
|
|
7
|
-
import { KProTag as
|
|
7
|
+
import { KProTag as n } from "./pro-tag/index.mjs";
|
|
8
8
|
import { KProPicker as T } from "./pro-picker/index.mjs";
|
|
9
|
-
import { KProArea as
|
|
10
|
-
import { KProSignature as
|
|
9
|
+
import { KProArea as d } from "./pro-area/index.mjs";
|
|
10
|
+
import { KProSignature as u } from "./pro-signature/index.mjs";
|
|
11
11
|
import { KProTable as A } from "./pro-table/index.mjs";
|
|
12
|
-
import { KIcon as
|
|
12
|
+
import { KIcon as R } from "./icon/index.mjs";
|
|
13
13
|
import { KProUpload as V } from "./pro-upload/index.mjs";
|
|
14
14
|
import { KProContractView as k } from "./pro-contract-view/index.mjs";
|
|
15
15
|
import "./pro-loading/index.mjs";
|
|
16
16
|
import { KPlusUpload as y } from "./plus-upload/index.mjs";
|
|
17
|
-
import { KProOverlay as
|
|
18
|
-
import { KProSign as
|
|
19
|
-
import { KUserSelector as
|
|
20
|
-
import { KProUserAvatar as
|
|
21
|
-
import { KProRoleSelector as
|
|
17
|
+
import { KProOverlay as F } from "./pro-overlay/index.mjs";
|
|
18
|
+
import { KProSign as I } from "./pro-sign/index.mjs";
|
|
19
|
+
import { KUserSelector as M } from "./pro-selector/index.mjs";
|
|
20
|
+
import { KProUserAvatar as h, KUserAvatar as j } from "./pro-user-avatar/index.mjs";
|
|
21
|
+
import { KProRoleSelector as z, KRoleSelector as E } from "./role-selector/index.mjs";
|
|
22
22
|
import { KDeptSelector as J } from "./dept-selector/index.mjs";
|
|
23
23
|
import { KProTagGroup as Q } from "./pro-tag-group/index.mjs";
|
|
24
|
+
import { KFormRender as X } from "./pro-form-render/index.mjs";
|
|
24
25
|
export {
|
|
25
26
|
t as KCollapseTranstion,
|
|
26
27
|
P as KCoverScrollBar,
|
|
27
28
|
J as KDeptSelector,
|
|
28
|
-
|
|
29
|
+
X as KFormRender,
|
|
30
|
+
R as KIcon,
|
|
29
31
|
y as KPlusUpload,
|
|
30
|
-
|
|
32
|
+
d as KProArea,
|
|
31
33
|
k as KProContractView,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
m as KProModal,
|
|
35
|
+
F as KProOverlay,
|
|
34
36
|
T as KProPicker,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
z as KProRoleSelector,
|
|
38
|
+
I as KProSign,
|
|
39
|
+
u as KProSignature,
|
|
38
40
|
A as KProTable,
|
|
39
|
-
|
|
41
|
+
n as KProTag,
|
|
40
42
|
Q as KProTagGroup,
|
|
41
43
|
f as KProTitle,
|
|
42
44
|
V as KProUpload,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
h as KProUserAvatar,
|
|
46
|
+
E as KRoleSelector,
|
|
45
47
|
i as KScaleVirtualList,
|
|
46
48
|
l as KScrollBar,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
j as KUserAvatar,
|
|
50
|
+
M as KUserSelector
|
|
49
51
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { withInstall as r } from "../utils/install.mjs";
|
|
2
|
+
import "./src/index.vue2.mjs";
|
|
3
|
+
import { FormItemProps as i, FormRenderProps as f } from "./src/types.mjs";
|
|
4
|
+
import o from "./src/index.vue.mjs";
|
|
5
|
+
const p = r(o);
|
|
6
|
+
export {
|
|
7
|
+
i as FormItemProps,
|
|
8
|
+
o as FormRender,
|
|
9
|
+
f as FormRenderProps,
|
|
10
|
+
p as KFormRender
|
|
11
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { defineComponent as A, ref as s, computed as I, watch as b, watchEffect as $, createBlock as u, openBlock as n, unref as c, withCtx as i, createElementBlock as F, Fragment as R, renderList as w, resolveDynamicComponent as q } from "vue";
|
|
2
|
+
import { Form as D, FormItem as E } from "ant-design-vue";
|
|
3
|
+
import { FormRenderProps as L } from "./types.mjs";
|
|
4
|
+
import "./module/index.mjs";
|
|
5
|
+
import { formatFormItems as P, getMesg as V } from "./utils.mjs";
|
|
6
|
+
import B from "./module/AioDatePicker.vue.mjs";
|
|
7
|
+
import C from "./module/AioListInput.vue.mjs";
|
|
8
|
+
import M from "./module/AioTimePicker.vue.mjs";
|
|
9
|
+
import S from "./module/AioTextarea.vue.mjs";
|
|
10
|
+
import T from "./module/AioSelect.vue.mjs";
|
|
11
|
+
import U from "./module/AioInputNumber.vue.mjs";
|
|
12
|
+
import N from "./module/AioSwitch.vue.mjs";
|
|
13
|
+
import j from "./module/AioInput.vue.mjs";
|
|
14
|
+
const te = /* @__PURE__ */ A({
|
|
15
|
+
name: "ProFormRender",
|
|
16
|
+
__name: "index",
|
|
17
|
+
props: L,
|
|
18
|
+
emits: ["change"],
|
|
19
|
+
setup(p, { expose: d, emit: g }) {
|
|
20
|
+
const a = p, _ = g, h = {
|
|
21
|
+
AioInput: j,
|
|
22
|
+
AioSwitch: N,
|
|
23
|
+
AioInputNumber: U,
|
|
24
|
+
AioSelect: T,
|
|
25
|
+
AioTextarea: S,
|
|
26
|
+
AioTimePicker: M,
|
|
27
|
+
AioListInput: C,
|
|
28
|
+
AioDatePicker: B
|
|
29
|
+
}, o = s({}), l = s(), f = I(() => a.formItems ? Array.isArray(a.formItems) ? P(a.formItems) : [] : []);
|
|
30
|
+
b(() => a.formItems, (e) => {
|
|
31
|
+
e && _("change", e);
|
|
32
|
+
}, { deep: !0 }), $(() => {
|
|
33
|
+
f.value.forEach((e) => {
|
|
34
|
+
e.key in o.value || (o.value[e.key] = e.defaultValue);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
function y(e) {
|
|
38
|
+
var m;
|
|
39
|
+
if (e.type === "AioListInput")
|
|
40
|
+
return [{ required: e.required ?? !1, message: "", trigger: ["blur", "change"] }];
|
|
41
|
+
const t = V(e), r = [
|
|
42
|
+
{ required: e.required ?? !1, message: t, trigger: ["blur", "change"] }
|
|
43
|
+
];
|
|
44
|
+
if ((m = e.properties) != null && m.regex) {
|
|
45
|
+
const x = new RegExp(e.properties.regex);
|
|
46
|
+
r.push({
|
|
47
|
+
pattern: x,
|
|
48
|
+
message: e.properties.regexMessage || "格式不正确",
|
|
49
|
+
trigger: ["blur", "change"]
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return r;
|
|
53
|
+
}
|
|
54
|
+
function k(e) {
|
|
55
|
+
l.value.validate().then(() => {
|
|
56
|
+
var t;
|
|
57
|
+
(t = e.success) == null || t.call(e, o.value);
|
|
58
|
+
}).catch((t) => {
|
|
59
|
+
var r;
|
|
60
|
+
console.log("表单校验失败:", t), (r = e.error) == null || r.call(e, t);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function v() {
|
|
64
|
+
return o.value;
|
|
65
|
+
}
|
|
66
|
+
return d({
|
|
67
|
+
submit: k,
|
|
68
|
+
getFormData: v
|
|
69
|
+
}), (e, t) => (n(), u(c(D), {
|
|
70
|
+
ref_key: "formRef",
|
|
71
|
+
ref: l,
|
|
72
|
+
model: o.value,
|
|
73
|
+
"label-col": { span: 8 },
|
|
74
|
+
style: { width: "360px" }
|
|
75
|
+
}, {
|
|
76
|
+
default: i(() => [
|
|
77
|
+
(n(!0), F(
|
|
78
|
+
R,
|
|
79
|
+
null,
|
|
80
|
+
w(f.value, (r) => (n(), u(c(E), {
|
|
81
|
+
key: r.key,
|
|
82
|
+
label: r.label,
|
|
83
|
+
name: r.key,
|
|
84
|
+
rules: y(r)
|
|
85
|
+
}, {
|
|
86
|
+
default: i(() => [
|
|
87
|
+
(n(), u(q(h[r.type]), {
|
|
88
|
+
modelValue: o.value[r.key],
|
|
89
|
+
"onUpdate:modelValue": (m) => o.value[r.key] = m,
|
|
90
|
+
"form-item": r
|
|
91
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "form-item"]))
|
|
92
|
+
]),
|
|
93
|
+
_: 2
|
|
94
|
+
/* DYNAMIC */
|
|
95
|
+
}, 1032, ["label", "name", "rules"]))),
|
|
96
|
+
128
|
|
97
|
+
/* KEYED_FRAGMENT */
|
|
98
|
+
))
|
|
99
|
+
]),
|
|
100
|
+
_: 1
|
|
101
|
+
/* STABLE */
|
|
102
|
+
}, 8, ["model"]));
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
export {
|
|
106
|
+
te as default
|
|
107
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineComponent as a, useModel as m, createBlock as u, openBlock as p, unref as d, mergeProps as n, mergeModels as s } from "vue";
|
|
2
|
+
import { DatePicker as i } from "ant-design-vue";
|
|
3
|
+
import { FormItemProps as f } from "../types.mjs";
|
|
4
|
+
const c = "YYYY-MM-DD", D = /* @__PURE__ */ a({
|
|
5
|
+
__name: "AioDatePicker",
|
|
6
|
+
props: /* @__PURE__ */ s(f, {
|
|
7
|
+
modelValue: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: ""
|
|
10
|
+
},
|
|
11
|
+
modelModifiers: {}
|
|
12
|
+
}),
|
|
13
|
+
emits: ["update:modelValue"],
|
|
14
|
+
setup(l) {
|
|
15
|
+
const e = m(l, "modelValue");
|
|
16
|
+
return (o, r) => (p(), u(d(i), n({
|
|
17
|
+
value: e.value,
|
|
18
|
+
"onUpdate:value": r[0] || (r[0] = (t) => e.value = t),
|
|
19
|
+
placeholder: o.formItem.placeholder
|
|
20
|
+
}, o.formItem.properties || {}, {
|
|
21
|
+
"value-format": c,
|
|
22
|
+
style: { width: "100%" }
|
|
23
|
+
}), null, 16, ["value", "placeholder"]));
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
export {
|
|
27
|
+
D as default
|
|
28
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineComponent as t, useModel as p, createBlock as u, openBlock as a, unref as d, mergeProps as n, mergeModels as s } from "vue";
|
|
2
|
+
import { Input as f } from "ant-design-vue";
|
|
3
|
+
import { FormItemProps as i } from "../types.mjs";
|
|
4
|
+
const V = /* @__PURE__ */ t({
|
|
5
|
+
__name: "AioInput",
|
|
6
|
+
props: /* @__PURE__ */ s(i, {
|
|
7
|
+
modelValue: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: ""
|
|
10
|
+
},
|
|
11
|
+
modelModifiers: {}
|
|
12
|
+
}),
|
|
13
|
+
emits: ["update:modelValue"],
|
|
14
|
+
setup(r) {
|
|
15
|
+
const e = p(r, "modelValue");
|
|
16
|
+
return (o, l) => (a(), u(d(f), n({
|
|
17
|
+
value: e.value,
|
|
18
|
+
"onUpdate:value": l[0] || (l[0] = (m) => e.value = m),
|
|
19
|
+
placeholder: o.formItem.placeholder
|
|
20
|
+
}, o.formItem.properties || {}), null, 16, ["value", "placeholder"]));
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
export {
|
|
24
|
+
V as default
|
|
25
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineComponent as t, useModel as u, createBlock as p, openBlock as a, unref as d, mergeProps as n, mergeModels as s } from "vue";
|
|
2
|
+
import { InputNumber as f } from "ant-design-vue";
|
|
3
|
+
import { FormItemProps as i } from "../types.mjs";
|
|
4
|
+
const V = /* @__PURE__ */ t({
|
|
5
|
+
__name: "AioInputNumber",
|
|
6
|
+
props: /* @__PURE__ */ s(i, {
|
|
7
|
+
modelValue: {
|
|
8
|
+
type: Number,
|
|
9
|
+
default: 0
|
|
10
|
+
},
|
|
11
|
+
modelModifiers: {}
|
|
12
|
+
}),
|
|
13
|
+
emits: ["update:modelValue"],
|
|
14
|
+
setup(l) {
|
|
15
|
+
const e = u(l, "modelValue");
|
|
16
|
+
return (o, r) => (a(), p(d(f), n({
|
|
17
|
+
value: e.value,
|
|
18
|
+
"onUpdate:value": r[0] || (r[0] = (m) => e.value = m),
|
|
19
|
+
placeholder: o.formItem.placeholder
|
|
20
|
+
}, o.formItem.properties || {}, { style: { width: "100%" } }), null, 16, ["value", "placeholder"]));
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
export {
|
|
24
|
+
V as default
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.aio-list-input .aio-list-input-item[data-v-14a96bc2]{display:flex;align-items:center;justify-content:space-between}.aio-list-input .aio-list-input-item .aio-list-input-icon[data-v-14a96bc2]{display:flex;margin-left:12px}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { pushScopeId as v, popScopeId as h, createElementVNode as i, defineComponent as I, useModel as _, createElementBlock as p, openBlock as u, createVNode as s, Fragment as g, renderList as k, createBlock as y, unref as t, withCtx as m, mergeProps as V, mergeModels as C } from "vue";
|
|
2
|
+
import { FormItem as b, Input as B, Button as w } from "ant-design-vue";
|
|
3
|
+
import { KIcon as F } from "../../../icon/index.mjs";
|
|
4
|
+
import { FormItemProps as M } from "../types.mjs";
|
|
5
|
+
const S = (o) => (v("data-v-14a96bc2"), o = o(), h(), o), q = { class: "aio-list-input" }, z = { class: "aio-list-input-item" }, A = { class: "aio-list-input-icon" }, E = /* @__PURE__ */ S(() => /* @__PURE__ */ i(
|
|
6
|
+
"div",
|
|
7
|
+
{ style: { "font-size": "14px", "padding-left": "6px" } },
|
|
8
|
+
" +新增 ",
|
|
9
|
+
-1
|
|
10
|
+
/* HOISTED */
|
|
11
|
+
)), $ = /* @__PURE__ */ I({
|
|
12
|
+
__name: "AioListInput",
|
|
13
|
+
props: /* @__PURE__ */ C(M, {
|
|
14
|
+
modelValue: {
|
|
15
|
+
type: Array,
|
|
16
|
+
default: () => []
|
|
17
|
+
},
|
|
18
|
+
modelModifiers: {}
|
|
19
|
+
}),
|
|
20
|
+
emits: ["update:modelValue"],
|
|
21
|
+
setup(o) {
|
|
22
|
+
const l = _(o, "modelValue");
|
|
23
|
+
function c() {
|
|
24
|
+
l.value.push({ value: "" });
|
|
25
|
+
}
|
|
26
|
+
function f(e) {
|
|
27
|
+
e !== 0 && l.value.splice(e, 1);
|
|
28
|
+
}
|
|
29
|
+
return (e, n) => (u(), p("div", q, [
|
|
30
|
+
(u(!0), p(
|
|
31
|
+
g,
|
|
32
|
+
null,
|
|
33
|
+
k(l.value, (r, a) => (u(), y(t(b), {
|
|
34
|
+
key: a,
|
|
35
|
+
label: "",
|
|
36
|
+
name: [e.formItem.key, a, "value"],
|
|
37
|
+
rules: {
|
|
38
|
+
required: e.formItem.required ?? !1,
|
|
39
|
+
message: "请输入内容",
|
|
40
|
+
trigger: "blur"
|
|
41
|
+
}
|
|
42
|
+
}, {
|
|
43
|
+
default: m(() => [
|
|
44
|
+
i("div", z, [
|
|
45
|
+
s(t(B), V({
|
|
46
|
+
value: r.value,
|
|
47
|
+
"onUpdate:value": (d) => r.value = d,
|
|
48
|
+
placeholder: e.formItem.placeholder,
|
|
49
|
+
ref_for: !0
|
|
50
|
+
}, e.formItem.properties || {}), null, 16, ["value", "onUpdate:value", "placeholder"]),
|
|
51
|
+
i("div", A, [
|
|
52
|
+
s(t(F), {
|
|
53
|
+
name: "guanbi",
|
|
54
|
+
color: "#f56c6c",
|
|
55
|
+
size: 24,
|
|
56
|
+
style: { cursor: "pointer" },
|
|
57
|
+
onClick: (d) => f(a)
|
|
58
|
+
}, null, 8, ["onClick"])
|
|
59
|
+
])
|
|
60
|
+
])
|
|
61
|
+
]),
|
|
62
|
+
_: 2
|
|
63
|
+
/* DYNAMIC */
|
|
64
|
+
}, 1032, ["name", "rules"]))),
|
|
65
|
+
128
|
|
66
|
+
/* KEYED_FRAGMENT */
|
|
67
|
+
)),
|
|
68
|
+
s(t(w), {
|
|
69
|
+
type: "dashed",
|
|
70
|
+
style: { width: "100%" },
|
|
71
|
+
onClick: n[0] || (n[0] = (r) => c())
|
|
72
|
+
}, {
|
|
73
|
+
default: m(() => [
|
|
74
|
+
E
|
|
75
|
+
]),
|
|
76
|
+
_: 1
|
|
77
|
+
/* STABLE */
|
|
78
|
+
})
|
|
79
|
+
]));
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
export {
|
|
83
|
+
$ as default
|
|
84
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { defineComponent as s, useModel as i, computed as c, createBlock as u, openBlock as o, unref as m, mergeProps as f, withCtx as n, createElementBlock as v, Fragment as g, renderList as S, createTextVNode as V, toDisplayString as h, mergeModels as k } from "vue";
|
|
2
|
+
import { Select as y, SelectOption as I } from "ant-design-vue";
|
|
3
|
+
import { FormItemProps as B } from "../types.mjs";
|
|
4
|
+
const C = /* @__PURE__ */ s({
|
|
5
|
+
__name: "AioSelect",
|
|
6
|
+
props: /* @__PURE__ */ k(B, {
|
|
7
|
+
modelValue: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: ""
|
|
10
|
+
},
|
|
11
|
+
modelModifiers: {}
|
|
12
|
+
}),
|
|
13
|
+
emits: ["update:modelValue"],
|
|
14
|
+
setup(l) {
|
|
15
|
+
const p = l, r = i(l, "modelValue"), d = c(() => {
|
|
16
|
+
var e;
|
|
17
|
+
return ((e = p.formItem.properties) == null ? void 0 : e.options) || [];
|
|
18
|
+
});
|
|
19
|
+
return (e, a) => (o(), u(m(y), f({
|
|
20
|
+
value: r.value,
|
|
21
|
+
"onUpdate:value": a[0] || (a[0] = (t) => r.value = t),
|
|
22
|
+
placeholder: e.formItem.placeholder
|
|
23
|
+
}, e.formItem.properties || {}, { style: { width: "100%" } }), {
|
|
24
|
+
default: n(() => [
|
|
25
|
+
(o(!0), v(
|
|
26
|
+
g,
|
|
27
|
+
null,
|
|
28
|
+
S(d.value, (t) => (o(), u(m(I), {
|
|
29
|
+
key: t.value,
|
|
30
|
+
value: t.value
|
|
31
|
+
}, {
|
|
32
|
+
default: n(() => [
|
|
33
|
+
V(
|
|
34
|
+
h(t.label),
|
|
35
|
+
1
|
|
36
|
+
/* TEXT */
|
|
37
|
+
)
|
|
38
|
+
]),
|
|
39
|
+
_: 2
|
|
40
|
+
/* DYNAMIC */
|
|
41
|
+
}, 1032, ["value"]))),
|
|
42
|
+
128
|
|
43
|
+
/* KEYED_FRAGMENT */
|
|
44
|
+
))
|
|
45
|
+
]),
|
|
46
|
+
_: 1
|
|
47
|
+
/* STABLE */
|
|
48
|
+
}, 16, ["value", "placeholder"]));
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
export {
|
|
52
|
+
C as default
|
|
53
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineComponent as m, useModel as d, createBlock as p, openBlock as a, unref as u, mergeProps as n, mergeModels as s } from "vue";
|
|
2
|
+
import { Switch as c } from "ant-design-vue";
|
|
3
|
+
import { FormItemProps as i } from "../types.mjs";
|
|
4
|
+
const V = /* @__PURE__ */ m({
|
|
5
|
+
__name: "AioSwitch",
|
|
6
|
+
props: /* @__PURE__ */ s(i, {
|
|
7
|
+
modelValue: {
|
|
8
|
+
type: Boolean,
|
|
9
|
+
default: !1
|
|
10
|
+
},
|
|
11
|
+
modelModifiers: {}
|
|
12
|
+
}),
|
|
13
|
+
emits: ["update:modelValue"],
|
|
14
|
+
setup(r) {
|
|
15
|
+
const e = d(r, "modelValue");
|
|
16
|
+
return (t, o) => (a(), p(u(c), n({
|
|
17
|
+
checked: e.value,
|
|
18
|
+
"onUpdate:checked": o[0] || (o[0] = (l) => e.value = l)
|
|
19
|
+
}, t.formItem.properties || {}), null, 16, ["checked"]));
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
export {
|
|
23
|
+
V as default
|
|
24
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { defineComponent as s, useModel as u, computed as p, createBlock as n, openBlock as d, unref as i, mergeProps as f, mergeModels as c } from "vue";
|
|
2
|
+
import { Textarea as v } from "ant-design-vue";
|
|
3
|
+
import { FormItemProps as w } from "../types.mjs";
|
|
4
|
+
const M = /* @__PURE__ */ s({
|
|
5
|
+
__name: "AioTextarea",
|
|
6
|
+
props: /* @__PURE__ */ c(w, {
|
|
7
|
+
modelValue: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: ""
|
|
10
|
+
},
|
|
11
|
+
modelModifiers: {}
|
|
12
|
+
}),
|
|
13
|
+
emits: ["update:modelValue"],
|
|
14
|
+
setup(r) {
|
|
15
|
+
const m = r, t = u(r, "modelValue"), a = p(() => {
|
|
16
|
+
var o;
|
|
17
|
+
const e = (o = m.formItem.properties) == null ? void 0 : o.rows;
|
|
18
|
+
return Number.isInteger(e) && e > 0 ? Math.max(e, 2) : 2;
|
|
19
|
+
});
|
|
20
|
+
return (e, o) => (d(), n(i(v), f({
|
|
21
|
+
value: t.value,
|
|
22
|
+
"onUpdate:value": o[0] || (o[0] = (l) => t.value = l),
|
|
23
|
+
placeholder: e.formItem.placeholder
|
|
24
|
+
}, e.formItem.properties || {}, {
|
|
25
|
+
"auto-size": { minRows: a.value, maxRows: 20 }
|
|
26
|
+
}), null, 16, ["value", "placeholder", "auto-size"]));
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
export {
|
|
30
|
+
M as default
|
|
31
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineComponent as t, useModel as a, createBlock as u, openBlock as p, unref as d, mergeProps as s, mergeModels as i } from "vue";
|
|
2
|
+
import { TimePicker as n } from "ant-design-vue";
|
|
3
|
+
import { FormItemProps as f } from "../types.mjs";
|
|
4
|
+
const c = "HH:mm:ss", V = /* @__PURE__ */ t({
|
|
5
|
+
__name: "AioTimePicker",
|
|
6
|
+
props: /* @__PURE__ */ i(f, {
|
|
7
|
+
modelValue: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: ""
|
|
10
|
+
},
|
|
11
|
+
modelModifiers: {}
|
|
12
|
+
}),
|
|
13
|
+
emits: ["update:modelValue"],
|
|
14
|
+
setup(l) {
|
|
15
|
+
const e = a(l, "modelValue");
|
|
16
|
+
return (o, r) => (p(), u(d(n), s({
|
|
17
|
+
value: e.value,
|
|
18
|
+
"onUpdate:value": r[0] || (r[0] = (m) => e.value = m),
|
|
19
|
+
"value-format": c,
|
|
20
|
+
placeholder: o.formItem.placeholder
|
|
21
|
+
}, o.formItem.properties || {}, { style: { width: "100%" } }), null, 16, ["value", "placeholder"]));
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
export {
|
|
25
|
+
V as default
|
|
26
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "./AioInput.vue2.mjs";
|
|
2
|
+
import "./AioSwitch.vue2.mjs";
|
|
3
|
+
import "./AioInputNumber.vue2.mjs";
|
|
4
|
+
import "./AioSelect.vue2.mjs";
|
|
5
|
+
import "./AioTextarea.vue2.mjs";
|
|
6
|
+
import "./AioTimePicker.vue2.mjs";
|
|
7
|
+
import { default as s } from "./AioListInput.vue.mjs";
|
|
8
|
+
import "./AioDatePicker.vue2.mjs";
|
|
9
|
+
export {
|
|
10
|
+
s as AioListInput
|
|
11
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function a(e) {
|
|
2
|
+
return e.map((u) => ({
|
|
3
|
+
...u,
|
|
4
|
+
defaultValue: r(u),
|
|
5
|
+
required: u.required ?? !1
|
|
6
|
+
}));
|
|
7
|
+
}
|
|
8
|
+
function l(e) {
|
|
9
|
+
return e.type === "AioDatePicker" || e.type === "AioSelect" || e.type === "AioTimePicker" ? `请选择${e.label}` : `请输入${e.label}`;
|
|
10
|
+
}
|
|
11
|
+
function r(e) {
|
|
12
|
+
return e.type === "AioSwitch" ? e.defaultValue === void 0 || e.defaultValue === null ? !1 : e.defaultValue : e.type === "AioListInput" ? Array.isArray(e.defaultValue) ? e.defaultValue : [] : e.defaultValue === "AioInputNumber" ? Number(e.defaultValue) : e.defaultValue;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
a as formatFormItems,
|
|
16
|
+
l as getMesg
|
|
17
|
+
};
|