@vue-start/element-pro 0.2.12 → 0.2.13
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/index.d.ts +66 -8
- package/dist/index.es.js +520 -336
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
2
|
import { ExtractPropTypes, PropType, VNode } from 'vue';
|
|
3
3
|
import * as element_plus from 'element-plus';
|
|
4
|
-
import { FormItemProps, DialogProps, IUseCheckboxGroupProps, ISelectProps } from 'element-plus';
|
|
4
|
+
import { FormItemProps, DialogProps, IUseCheckboxGroupProps, ISelectProps, MenuProps, UploadProps, UploadFile } from 'element-plus';
|
|
5
5
|
import * as element_plus_es_utils from 'element-plus/es/utils';
|
|
6
6
|
import { FilterMethods, Filters } from 'element-plus/es/components/table/src/table-column/defaults';
|
|
7
|
-
import { TOption } from '@vue-start/pro';
|
|
7
|
+
import { TOption, TFile } from '@vue-start/pro';
|
|
8
8
|
|
|
9
9
|
declare const proFormItemProps: () => {
|
|
10
10
|
name: {
|
|
@@ -921,14 +921,14 @@ declare const proModalProps: () => {
|
|
|
921
921
|
readonly circle: boolean;
|
|
922
922
|
readonly disabled: boolean;
|
|
923
923
|
readonly loading: boolean;
|
|
924
|
-
readonly icon: element_plus_es_utils.EpPropMergeType<(new (...args: any[]) => (string | vue.Component<any, any, any, vue.ComputedOptions, vue.MethodOptions>) & {}) | (() => string | vue.Component<any, any, any, vue.ComputedOptions, vue.MethodOptions>) | ((new (...args: any[]) => (string | vue.Component<any, any, any, vue.ComputedOptions, vue.MethodOptions>) & {}) | (() => string | vue.Component<any, any, any, vue.ComputedOptions, vue.MethodOptions>))[], unknown, unknown>;
|
|
925
924
|
readonly autofocus: boolean;
|
|
926
925
|
readonly loadingIcon: element_plus_es_utils.EpPropMergeType<(new (...args: any[]) => (string | vue.Component<any, any, any, vue.ComputedOptions, vue.MethodOptions>) & {}) | (() => string | vue.Component<any, any, any, vue.ComputedOptions, vue.MethodOptions>) | ((new (...args: any[]) => (string | vue.Component<any, any, any, vue.ComputedOptions, vue.MethodOptions>) & {}) | (() => string | vue.Component<any, any, any, vue.ComputedOptions, vue.MethodOptions>))[], unknown, unknown>;
|
|
927
926
|
readonly round: boolean;
|
|
927
|
+
readonly dark: boolean;
|
|
928
|
+
readonly icon: element_plus_es_utils.EpPropMergeType<(new (...args: any[]) => (string | vue.Component<any, any, any, vue.ComputedOptions, vue.MethodOptions>) & {}) | (() => string | vue.Component<any, any, any, vue.ComputedOptions, vue.MethodOptions>) | ((new (...args: any[]) => (string | vue.Component<any, any, any, vue.ComputedOptions, vue.MethodOptions>) & {}) | (() => string | vue.Component<any, any, any, vue.ComputedOptions, vue.MethodOptions>))[], unknown, unknown>;
|
|
928
929
|
readonly nativeType: element_plus_es_utils.EpPropMergeType<StringConstructor, "reset" | "submit" | "button", unknown>;
|
|
929
930
|
readonly plain: boolean;
|
|
930
931
|
readonly bg: boolean;
|
|
931
|
-
readonly dark: boolean;
|
|
932
932
|
} & {
|
|
933
933
|
readonly size?: element_plus_es_utils.EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never> | undefined;
|
|
934
934
|
readonly color?: string | undefined;
|
|
@@ -949,14 +949,14 @@ declare const proModalProps: () => {
|
|
|
949
949
|
readonly circle: boolean;
|
|
950
950
|
readonly disabled: boolean;
|
|
951
951
|
readonly loading: boolean;
|
|
952
|
-
readonly icon: element_plus_es_utils.EpPropMergeType<(new (...args: any[]) => (string | vue.Component<any, any, any, vue.ComputedOptions, vue.MethodOptions>) & {}) | (() => string | vue.Component<any, any, any, vue.ComputedOptions, vue.MethodOptions>) | ((new (...args: any[]) => (string | vue.Component<any, any, any, vue.ComputedOptions, vue.MethodOptions>) & {}) | (() => string | vue.Component<any, any, any, vue.ComputedOptions, vue.MethodOptions>))[], unknown, unknown>;
|
|
953
952
|
readonly autofocus: boolean;
|
|
954
953
|
readonly loadingIcon: element_plus_es_utils.EpPropMergeType<(new (...args: any[]) => (string | vue.Component<any, any, any, vue.ComputedOptions, vue.MethodOptions>) & {}) | (() => string | vue.Component<any, any, any, vue.ComputedOptions, vue.MethodOptions>) | ((new (...args: any[]) => (string | vue.Component<any, any, any, vue.ComputedOptions, vue.MethodOptions>) & {}) | (() => string | vue.Component<any, any, any, vue.ComputedOptions, vue.MethodOptions>))[], unknown, unknown>;
|
|
955
954
|
readonly round: boolean;
|
|
955
|
+
readonly dark: boolean;
|
|
956
|
+
readonly icon: element_plus_es_utils.EpPropMergeType<(new (...args: any[]) => (string | vue.Component<any, any, any, vue.ComputedOptions, vue.MethodOptions>) & {}) | (() => string | vue.Component<any, any, any, vue.ComputedOptions, vue.MethodOptions>) | ((new (...args: any[]) => (string | vue.Component<any, any, any, vue.ComputedOptions, vue.MethodOptions>) & {}) | (() => string | vue.Component<any, any, any, vue.ComputedOptions, vue.MethodOptions>))[], unknown, unknown>;
|
|
956
957
|
readonly nativeType: element_plus_es_utils.EpPropMergeType<StringConstructor, "reset" | "submit" | "button", unknown>;
|
|
957
958
|
readonly plain: boolean;
|
|
958
959
|
readonly bg: boolean;
|
|
959
|
-
readonly dark: boolean;
|
|
960
960
|
} & {
|
|
961
961
|
readonly size?: element_plus_es_utils.EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never> | undefined;
|
|
962
962
|
readonly color?: string | undefined;
|
|
@@ -998,9 +998,9 @@ declare const proCheckboxProps: () => {
|
|
|
998
998
|
name?: string | undefined;
|
|
999
999
|
id?: string | undefined;
|
|
1000
1000
|
size?: element_plus_es_utils.EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never> | undefined;
|
|
1001
|
+
modelValue?: string | number | boolean | undefined;
|
|
1001
1002
|
tabindex?: string | number | undefined;
|
|
1002
1003
|
controls?: string | undefined;
|
|
1003
|
-
modelValue?: string | number | boolean | undefined;
|
|
1004
1004
|
trueLabel?: string | number | undefined;
|
|
1005
1005
|
falseLabel?: string | number | undefined;
|
|
1006
1006
|
})[]>;
|
|
@@ -1070,4 +1070,62 @@ declare const ProTabs: vue.DefineComponent<any, () => JSX.Element, unknown, {},
|
|
|
1070
1070
|
[x: string]: any;
|
|
1071
1071
|
}>;
|
|
1072
1072
|
|
|
1073
|
-
|
|
1073
|
+
/******************************* Menus ************************************/
|
|
1074
|
+
declare const menuProps: () => {
|
|
1075
|
+
convertSubMenuProps: {
|
|
1076
|
+
type: FunctionConstructor;
|
|
1077
|
+
};
|
|
1078
|
+
convertMenuItemProps: {
|
|
1079
|
+
type: FunctionConstructor;
|
|
1080
|
+
};
|
|
1081
|
+
onMenuItemClick: {
|
|
1082
|
+
type: FunctionConstructor;
|
|
1083
|
+
};
|
|
1084
|
+
activeKey: {
|
|
1085
|
+
type: StringConstructor;
|
|
1086
|
+
};
|
|
1087
|
+
options: {
|
|
1088
|
+
type: PropType<Record<string, any>[]>;
|
|
1089
|
+
};
|
|
1090
|
+
fieldNames: {
|
|
1091
|
+
type: PropType<{
|
|
1092
|
+
children: string;
|
|
1093
|
+
value: string;
|
|
1094
|
+
label: string;
|
|
1095
|
+
}>;
|
|
1096
|
+
default: {
|
|
1097
|
+
children: string;
|
|
1098
|
+
value: string;
|
|
1099
|
+
label: string;
|
|
1100
|
+
};
|
|
1101
|
+
};
|
|
1102
|
+
};
|
|
1103
|
+
declare type ProMenusProps = Partial<ExtractPropTypes<ReturnType<typeof menuProps>>> & Omit<MenuProps, "defaultActive">;
|
|
1104
|
+
declare const ProMenus: vue.DefineComponent<ProMenusProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<ProMenusProps>, {}>;
|
|
1105
|
+
|
|
1106
|
+
declare const uploadProps: () => {
|
|
1107
|
+
modelValue: {
|
|
1108
|
+
type: PropType<TFile[]>;
|
|
1109
|
+
default: undefined;
|
|
1110
|
+
};
|
|
1111
|
+
maxSize: {
|
|
1112
|
+
type: NumberConstructor;
|
|
1113
|
+
};
|
|
1114
|
+
convertResponseData: {
|
|
1115
|
+
type: PropType<(res: any) => Record<string, any>>;
|
|
1116
|
+
};
|
|
1117
|
+
convertItemData: {
|
|
1118
|
+
type: PropType<(item: any) => UploadFile>;
|
|
1119
|
+
default: (item: any) => any;
|
|
1120
|
+
};
|
|
1121
|
+
onErrorMsg: PropType<(type: string, msg: string) => void>;
|
|
1122
|
+
onStart: PropType<(file: any) => void>;
|
|
1123
|
+
beforeUpload: {
|
|
1124
|
+
type: FunctionConstructor;
|
|
1125
|
+
};
|
|
1126
|
+
};
|
|
1127
|
+
declare type ProUploadProps = Partial<ExtractPropTypes<ReturnType<typeof uploadProps>>> & Omit<UploadProps, "fileList">;
|
|
1128
|
+
declare const UploadMethods: string[];
|
|
1129
|
+
declare const ProUploader: vue.DefineComponent<ProUploadProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<ProUploadProps>, {}>;
|
|
1130
|
+
|
|
1131
|
+
export { FormMethods, ProCheckbox, ProCheckboxProps, ProForm, ProFormCascader, ProFormCheckbox, ProFormDatePicker, ProFormItem, ProFormItemProps, ProFormRadio, ProFormSelect, ProFormSwitch, ProFormText, ProFormTextNumber, ProFormTimePicker, ProFormTreeSelect, ProLoading, ProLoadingProps, ProMenus, ProMenusProps, ProModal, ProModalProps, ProPagination, ProPopover, ProRadio, ProRadioProps, ProSelect, ProSelectProps, ProTable, ProTableColumn, ProTableColumnProps, ProTabs, ProUploadProps, ProUploader, TableMethods, UploadMethods, createFormItemComponent, createLoadingId };
|
package/dist/index.es.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { createExpose as
|
|
2
|
-
import { ElFormItem as
|
|
3
|
-
import { defineComponent as
|
|
4
|
-
import { keys as
|
|
5
|
-
import { useEffect as
|
|
6
|
-
const
|
|
1
|
+
import { createExpose as fe, createFormItemCompFn as he, createExposeObj as V, ProForm as R, ProSearchForm as D, ProFormList as j, ProTable as O, ProDesc as z, ProCurdDesc as w, ProCurdForm as q, ProCurdModal as $, ProUploaderText as G } from "@vue-start/pro";
|
|
2
|
+
import { ElFormItem as U, ElForm as A, ElLoading as Ce, ElDialog as _, ElButton as W, ElPagination as Z, ElPopover as H, ElCheckboxGroup as J, ElCheckboxButton as ke, ElCheckbox as Fe, ElRadioGroup as Q, ElRadioButton as Te, ElRadio as Ee, ElSelect as X, ElOption as xe, ElTabs as Y, ElTabPane as Ie, ElMenu as M, ElUpload as ee, useFormItem as Re, ElInput as Me, ElInputNumber as Be, ElDatePicker as Ve, ElTimePicker as se, ElTreeSelect as ze, ElSwitch as Ue, ElCascader as Ae, ElTableColumn as te, ElTable as ae, ElDescriptions as Ke } from "element-plus";
|
|
3
|
+
import { defineComponent as g, createVNode as d, mergeProps as i, reactive as Ne, ref as S, toRaw as Le, computed as me, isVNode as De } from "vue";
|
|
4
|
+
import { keys as F, omit as f, isBoolean as ye, isString as je, debounce as Oe, map as p, size as B, pick as N, get as K, isNumber as s, filter as ne, isArray as we } from "lodash";
|
|
5
|
+
import { useEffect as ve, generateId as qe, useWatch as x, convertTreeData as $e, isValidFileType as Ge, convertFileSize as _e } from "@vue-start/hooks";
|
|
6
|
+
const re = () => ({
|
|
7
7
|
name: {
|
|
8
8
|
type: [String, Array]
|
|
9
9
|
}
|
|
10
|
-
}),
|
|
10
|
+
}), We = g({
|
|
11
11
|
props: {
|
|
12
|
-
...
|
|
13
|
-
...
|
|
12
|
+
...U.props,
|
|
13
|
+
...re()
|
|
14
14
|
},
|
|
15
15
|
setup: (e, {
|
|
16
16
|
slots: t
|
|
17
17
|
}) => {
|
|
18
|
-
const
|
|
19
|
-
return () =>
|
|
18
|
+
const c = F(re());
|
|
19
|
+
return () => d(U, i(f(e, ...c, "name", "prop"), {
|
|
20
20
|
prop: e.prop || e.name
|
|
21
21
|
}), t);
|
|
22
22
|
}
|
|
23
|
-
}),
|
|
23
|
+
}), be = ["clearValidate", "resetFields", "scrollToField", "validate", "validateField", "submit"], it = g({
|
|
24
24
|
props: {
|
|
25
|
-
...
|
|
25
|
+
...A.props,
|
|
26
26
|
hideRequiredMark: {
|
|
27
27
|
type: [Boolean, Object],
|
|
28
28
|
default: void 0
|
|
@@ -30,30 +30,30 @@ const H = () => ({
|
|
|
30
30
|
},
|
|
31
31
|
setup: (e, {
|
|
32
32
|
slots: t,
|
|
33
|
-
emit:
|
|
34
|
-
expose:
|
|
33
|
+
emit: c,
|
|
34
|
+
expose: a
|
|
35
35
|
}) => {
|
|
36
|
-
const
|
|
37
|
-
return
|
|
38
|
-
!
|
|
39
|
-
var
|
|
40
|
-
(
|
|
41
|
-
|
|
36
|
+
const o = e.model || Ne({}), r = S();
|
|
37
|
+
return ve(() => {
|
|
38
|
+
!r.value || (r.value.submit = () => {
|
|
39
|
+
var n;
|
|
40
|
+
(n = r.value) == null || n.validate((u, l) => {
|
|
41
|
+
u ? c("finish", Le(o)) : c("finishFailed", l);
|
|
42
42
|
});
|
|
43
43
|
});
|
|
44
|
-
}, []),
|
|
45
|
-
ref:
|
|
46
|
-
},
|
|
47
|
-
hideRequiredAsterisk:
|
|
48
|
-
model:
|
|
44
|
+
}, []), a(fe(be, r)), () => d(A, i({
|
|
45
|
+
ref: r
|
|
46
|
+
}, f(e, "model"), {
|
|
47
|
+
hideRequiredAsterisk: ye(e.hideRequiredMark) ? e.hideRequiredMark : e.hideRequiredAsterisk,
|
|
48
|
+
model: o
|
|
49
49
|
}), t);
|
|
50
50
|
}
|
|
51
|
-
}),
|
|
51
|
+
}), h = he(We, (e, t, c) => ({
|
|
52
52
|
modelValue: e,
|
|
53
53
|
"onUpdate:modelValue": t,
|
|
54
54
|
clearable: !0,
|
|
55
|
-
disabled:
|
|
56
|
-
})),
|
|
55
|
+
disabled: c
|
|
56
|
+
})), ge = (e = "comp") => e + "-" + qe(), Ze = () => ({
|
|
57
57
|
loading: {
|
|
58
58
|
type: Boolean
|
|
59
59
|
},
|
|
@@ -81,22 +81,22 @@ const H = () => ({
|
|
|
81
81
|
customClass: {
|
|
82
82
|
type: String
|
|
83
83
|
}
|
|
84
|
-
}),
|
|
84
|
+
}), He = g({
|
|
85
85
|
props: {
|
|
86
|
-
...
|
|
86
|
+
...Ze()
|
|
87
87
|
},
|
|
88
88
|
setup: (e, {
|
|
89
89
|
slots: t
|
|
90
90
|
}) => {
|
|
91
|
-
const
|
|
92
|
-
return
|
|
91
|
+
const c = ge();
|
|
92
|
+
return ve(() => {
|
|
93
93
|
if (!e.loading)
|
|
94
94
|
return;
|
|
95
|
-
let
|
|
96
|
-
if (t.default ?
|
|
95
|
+
let a = e.target;
|
|
96
|
+
if (t.default ? a = document.getElementById(c) : e.target && je(e.target) && (a = document.querySelector("#" + e.target)), !a)
|
|
97
97
|
return;
|
|
98
|
-
const
|
|
99
|
-
target:
|
|
98
|
+
const o = Ce.service({
|
|
99
|
+
target: a,
|
|
100
100
|
body: e.body,
|
|
101
101
|
fullscreen: e.fullscreen,
|
|
102
102
|
lock: e.lock,
|
|
@@ -106,13 +106,13 @@ const H = () => ({
|
|
|
106
106
|
customClass: e.customClass
|
|
107
107
|
});
|
|
108
108
|
return () => {
|
|
109
|
-
|
|
109
|
+
o && o.close();
|
|
110
110
|
};
|
|
111
|
-
}, () => e.loading), () => t.default ?
|
|
112
|
-
id:
|
|
111
|
+
}, () => e.loading), () => t.default ? d("div", {
|
|
112
|
+
id: c
|
|
113
113
|
}, [t.default()]) : null;
|
|
114
114
|
}
|
|
115
|
-
}),
|
|
115
|
+
}), le = () => ({
|
|
116
116
|
clsName: {
|
|
117
117
|
type: String,
|
|
118
118
|
default: "pro-modal"
|
|
@@ -144,70 +144,70 @@ const H = () => ({
|
|
|
144
144
|
type: [Object, Boolean],
|
|
145
145
|
default: void 0
|
|
146
146
|
}
|
|
147
|
-
}),
|
|
147
|
+
}), Je = g({
|
|
148
148
|
props: {
|
|
149
|
-
...
|
|
149
|
+
..._.props,
|
|
150
150
|
appendToBody: {
|
|
151
151
|
type: Boolean,
|
|
152
152
|
default: !0
|
|
153
153
|
},
|
|
154
|
-
...
|
|
154
|
+
...le()
|
|
155
155
|
},
|
|
156
156
|
setup: (e, {
|
|
157
157
|
slots: t,
|
|
158
|
-
emit:
|
|
158
|
+
emit: c
|
|
159
159
|
}) => {
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
const a = S(e.visible);
|
|
161
|
+
x(() => {
|
|
162
|
+
a.value !== e.visible && (a.value = e.visible);
|
|
163
163
|
}, () => e.visible);
|
|
164
|
-
const
|
|
165
|
-
var
|
|
166
|
-
if ((
|
|
164
|
+
const o = () => {
|
|
165
|
+
var u;
|
|
166
|
+
if ((u = e.cancelButtonProps) != null && u.onClick) {
|
|
167
167
|
e.cancelButtonProps.onClick();
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
|
-
|
|
171
|
-
},
|
|
172
|
-
var
|
|
173
|
-
if ((
|
|
170
|
+
a.value = !1, c("update:visible", !1);
|
|
171
|
+
}, r = () => {
|
|
172
|
+
var u;
|
|
173
|
+
if ((u = e.okButtonProps) != null && u.onClick) {
|
|
174
174
|
e.okButtonProps.onClick();
|
|
175
175
|
return;
|
|
176
176
|
}
|
|
177
|
-
|
|
178
|
-
},
|
|
179
|
-
return () =>
|
|
177
|
+
c("ok");
|
|
178
|
+
}, n = F(le());
|
|
179
|
+
return () => d(_, i({
|
|
180
180
|
class: e.clsName
|
|
181
|
-
},
|
|
182
|
-
closeOnClickModal:
|
|
183
|
-
modelValue:
|
|
184
|
-
"onUpdate:modelValue": [(
|
|
185
|
-
|
|
181
|
+
}, f(e, ...n, "modelValue"), {
|
|
182
|
+
closeOnClickModal: ye(e.maskClosable) ? e.maskClosable : e.closeOnClickModal,
|
|
183
|
+
modelValue: a.value,
|
|
184
|
+
"onUpdate:modelValue": [(u) => a.value = u, (u) => {
|
|
185
|
+
c("update:visible", u);
|
|
186
186
|
}],
|
|
187
187
|
onClose: () => {
|
|
188
|
-
|
|
188
|
+
c("cancel");
|
|
189
189
|
}
|
|
190
190
|
}), {
|
|
191
|
-
footer: e.footer === !1 ? void 0 : () =>
|
|
191
|
+
footer: e.footer === !1 ? void 0 : () => d("div", {
|
|
192
192
|
class: `${e.clsName}-operate`
|
|
193
|
-
}, [
|
|
194
|
-
onClick:
|
|
193
|
+
}, [d(W, i(f(e.cancelButtonProps, "onClick"), {
|
|
194
|
+
onClick: o
|
|
195
195
|
}), {
|
|
196
196
|
default: () => [e.cancelText]
|
|
197
|
-
}),
|
|
197
|
+
}), d(W, i({
|
|
198
198
|
type: "primary",
|
|
199
199
|
loading: e.confirmLoading
|
|
200
|
-
},
|
|
201
|
-
onClick:
|
|
200
|
+
}, f(e.okButtonProps, "onClick"), {
|
|
201
|
+
onClick: r
|
|
202
202
|
}), {
|
|
203
203
|
default: () => [e.okText]
|
|
204
204
|
})]),
|
|
205
205
|
...t
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
|
-
}),
|
|
208
|
+
}), ft = g({
|
|
209
209
|
props: {
|
|
210
|
-
...
|
|
210
|
+
...Z.props,
|
|
211
211
|
page: {
|
|
212
212
|
type: Number,
|
|
213
213
|
default: 1
|
|
@@ -215,41 +215,41 @@ const H = () => ({
|
|
|
215
215
|
},
|
|
216
216
|
setup: (e, {
|
|
217
217
|
slots: t,
|
|
218
|
-
emit:
|
|
218
|
+
emit: c
|
|
219
219
|
}) => {
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}, () => e.page),
|
|
224
|
-
|
|
220
|
+
const a = S(e.page), o = S(e.pageSize);
|
|
221
|
+
x(() => {
|
|
222
|
+
a.value !== e.page && (a.value = e.page);
|
|
223
|
+
}, () => e.page), x(() => {
|
|
224
|
+
o.value !== e.pageSize && (o.value = e.pageSize);
|
|
225
225
|
}, () => e.pageSize);
|
|
226
|
-
const
|
|
227
|
-
|
|
228
|
-
}, 300),
|
|
229
|
-
|
|
230
|
-
},
|
|
231
|
-
|
|
226
|
+
const r = Oe(() => {
|
|
227
|
+
c("composeChange", a.value, o.value);
|
|
228
|
+
}, 300), n = () => {
|
|
229
|
+
r(), c("update:page", a.value);
|
|
230
|
+
}, u = () => {
|
|
231
|
+
r(), c("update:pageSize", o.value);
|
|
232
232
|
};
|
|
233
|
-
return () =>
|
|
234
|
-
currentPage:
|
|
235
|
-
"onUpdate:currentPage": (
|
|
236
|
-
pageSize:
|
|
237
|
-
"onUpdate:pageSize": (
|
|
238
|
-
onCurrentChange:
|
|
239
|
-
onSizeChange:
|
|
240
|
-
},
|
|
233
|
+
return () => d(Z, i({
|
|
234
|
+
currentPage: a.value,
|
|
235
|
+
"onUpdate:currentPage": (l) => a.value = l,
|
|
236
|
+
pageSize: o.value,
|
|
237
|
+
"onUpdate:pageSize": (l) => o.value = l,
|
|
238
|
+
onCurrentChange: n,
|
|
239
|
+
onSizeChange: u
|
|
240
|
+
}, f(e, "currentPage", "pageSize")), t);
|
|
241
241
|
}
|
|
242
|
-
}),
|
|
242
|
+
}), mt = g({
|
|
243
243
|
props: {
|
|
244
|
-
...
|
|
244
|
+
...H.props
|
|
245
245
|
},
|
|
246
246
|
setup: (e, {
|
|
247
247
|
slots: t
|
|
248
|
-
}) => () =>
|
|
248
|
+
}) => () => d(H, e, {
|
|
249
249
|
reference: t.default,
|
|
250
250
|
default: t.content
|
|
251
251
|
})
|
|
252
|
-
}),
|
|
252
|
+
}), oe = () => ({
|
|
253
253
|
options: Array,
|
|
254
254
|
buttonStyle: {
|
|
255
255
|
type: String,
|
|
@@ -259,49 +259,49 @@ const H = () => ({
|
|
|
259
259
|
type: String,
|
|
260
260
|
default: "default"
|
|
261
261
|
}
|
|
262
|
-
}),
|
|
262
|
+
}), Qe = g({
|
|
263
263
|
props: {
|
|
264
|
-
...
|
|
265
|
-
...
|
|
264
|
+
...J.props,
|
|
265
|
+
...oe()
|
|
266
266
|
},
|
|
267
267
|
setup: (e, {
|
|
268
268
|
slots: t,
|
|
269
|
-
emit:
|
|
270
|
-
expose:
|
|
269
|
+
emit: c,
|
|
270
|
+
expose: a
|
|
271
271
|
}) => {
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
const
|
|
275
|
-
return () =>
|
|
276
|
-
ref:
|
|
277
|
-
},
|
|
278
|
-
"onUpdate:modelValue": (
|
|
279
|
-
|
|
272
|
+
const o = S();
|
|
273
|
+
a(V(o));
|
|
274
|
+
const r = F(oe());
|
|
275
|
+
return () => d(J, i({
|
|
276
|
+
ref: o
|
|
277
|
+
}, f(e, r), {
|
|
278
|
+
"onUpdate:modelValue": (n) => {
|
|
279
|
+
c("update:modelValue", n || void 0);
|
|
280
280
|
}
|
|
281
281
|
}), {
|
|
282
282
|
default: () => {
|
|
283
|
-
var
|
|
284
|
-
return [(
|
|
285
|
-
var
|
|
286
|
-
const y = (
|
|
287
|
-
return e.optionType === "button" || e.buttonStyle === "button" ?
|
|
288
|
-
key:
|
|
289
|
-
},
|
|
290
|
-
label:
|
|
283
|
+
var n, u;
|
|
284
|
+
return [(n = t.start) == null ? void 0 : n.call(t), p(e.options, (l) => {
|
|
285
|
+
var v;
|
|
286
|
+
const y = (v = t.label) == null ? void 0 : v.call(t, l);
|
|
287
|
+
return e.optionType === "button" || e.buttonStyle === "button" ? d(ke, i({
|
|
288
|
+
key: l.value
|
|
289
|
+
}, f(l, "value"), {
|
|
290
|
+
label: l.value
|
|
291
291
|
}), {
|
|
292
|
-
default: () => [y ||
|
|
293
|
-
}) :
|
|
294
|
-
key:
|
|
295
|
-
},
|
|
296
|
-
label:
|
|
292
|
+
default: () => [y || l.label]
|
|
293
|
+
}) : d(Fe, i({
|
|
294
|
+
key: l.value
|
|
295
|
+
}, l, {
|
|
296
|
+
label: l.value
|
|
297
297
|
}), {
|
|
298
|
-
default: () => [y ||
|
|
298
|
+
default: () => [y || l.label]
|
|
299
299
|
});
|
|
300
|
-
}), (
|
|
300
|
+
}), (u = t.default) == null ? void 0 : u.call(t)];
|
|
301
301
|
}
|
|
302
302
|
});
|
|
303
303
|
}
|
|
304
|
-
}),
|
|
304
|
+
}), ue = () => ({
|
|
305
305
|
options: {
|
|
306
306
|
type: Array
|
|
307
307
|
},
|
|
@@ -313,157 +313,360 @@ const H = () => ({
|
|
|
313
313
|
type: String,
|
|
314
314
|
default: "default"
|
|
315
315
|
}
|
|
316
|
-
}),
|
|
316
|
+
}), Xe = g({
|
|
317
317
|
props: {
|
|
318
|
-
...
|
|
319
|
-
...
|
|
318
|
+
...Q.props,
|
|
319
|
+
...ue()
|
|
320
320
|
},
|
|
321
321
|
setup: (e, {
|
|
322
322
|
slots: t,
|
|
323
|
-
emit:
|
|
324
|
-
expose:
|
|
323
|
+
emit: c,
|
|
324
|
+
expose: a
|
|
325
325
|
}) => {
|
|
326
|
-
const
|
|
327
|
-
|
|
328
|
-
const
|
|
329
|
-
return () =>
|
|
330
|
-
ref:
|
|
331
|
-
},
|
|
332
|
-
"onUpdate:modelValue": (
|
|
333
|
-
|
|
326
|
+
const o = S();
|
|
327
|
+
a(V(o));
|
|
328
|
+
const r = F(ue());
|
|
329
|
+
return () => d(Q, i({
|
|
330
|
+
ref: o
|
|
331
|
+
}, f(e, r), {
|
|
332
|
+
"onUpdate:modelValue": (n) => {
|
|
333
|
+
c("update:modelValue", n);
|
|
334
334
|
}
|
|
335
335
|
}), {
|
|
336
336
|
default: () => {
|
|
337
|
-
var
|
|
338
|
-
return [(
|
|
339
|
-
var
|
|
340
|
-
const y = (
|
|
341
|
-
return e.optionType === "button" || e.buttonStyle === "button" ?
|
|
342
|
-
key:
|
|
343
|
-
},
|
|
344
|
-
label:
|
|
337
|
+
var n, u;
|
|
338
|
+
return [(n = t.start) == null ? void 0 : n.call(t), p(e.options, (l) => {
|
|
339
|
+
var v;
|
|
340
|
+
const y = (v = t.label) == null ? void 0 : v.call(t, l);
|
|
341
|
+
return e.optionType === "button" || e.buttonStyle === "button" ? d(Te, i({
|
|
342
|
+
key: l.value
|
|
343
|
+
}, f(l, "value"), {
|
|
344
|
+
label: l.value
|
|
345
345
|
}), {
|
|
346
|
-
default: () => [y ||
|
|
347
|
-
}) :
|
|
348
|
-
key:
|
|
349
|
-
},
|
|
350
|
-
label:
|
|
346
|
+
default: () => [y || l.label]
|
|
347
|
+
}) : d(Ee, i({
|
|
348
|
+
key: l.value
|
|
349
|
+
}, f(l, "value"), {
|
|
350
|
+
label: l.value
|
|
351
351
|
}), {
|
|
352
|
-
default: () => [y ||
|
|
352
|
+
default: () => [y || l.label]
|
|
353
353
|
});
|
|
354
|
-
}), (
|
|
354
|
+
}), (u = t.default) == null ? void 0 : u.call(t)];
|
|
355
355
|
}
|
|
356
356
|
});
|
|
357
357
|
}
|
|
358
|
-
}),
|
|
358
|
+
}), ce = () => ({
|
|
359
359
|
options: Array
|
|
360
|
-
}),
|
|
360
|
+
}), Ye = g({
|
|
361
361
|
props: {
|
|
362
|
-
...
|
|
363
|
-
...
|
|
362
|
+
...X.props,
|
|
363
|
+
...ce()
|
|
364
364
|
},
|
|
365
365
|
setup: (e, {
|
|
366
366
|
slots: t,
|
|
367
|
-
emit:
|
|
368
|
-
expose:
|
|
367
|
+
emit: c,
|
|
368
|
+
expose: a
|
|
369
369
|
}) => {
|
|
370
|
-
const
|
|
371
|
-
|
|
372
|
-
const
|
|
373
|
-
return () =>
|
|
374
|
-
ref:
|
|
375
|
-
},
|
|
376
|
-
"onUpdate:modelValue": (
|
|
377
|
-
|
|
370
|
+
const o = S();
|
|
371
|
+
a(V(o));
|
|
372
|
+
const r = F(ce());
|
|
373
|
+
return () => d(X, i({
|
|
374
|
+
ref: o
|
|
375
|
+
}, f(e, r), {
|
|
376
|
+
"onUpdate:modelValue": (n) => {
|
|
377
|
+
c("update:modelValue", n || void 0);
|
|
378
378
|
}
|
|
379
379
|
}), {
|
|
380
380
|
default: () => {
|
|
381
|
-
var
|
|
382
|
-
return [(
|
|
383
|
-
var
|
|
384
|
-
const y = (
|
|
385
|
-
return
|
|
386
|
-
key:
|
|
387
|
-
},
|
|
388
|
-
default: () => [y ||
|
|
381
|
+
var n, u;
|
|
382
|
+
return [(n = t.start) == null ? void 0 : n.call(t), p(e.options, (l) => {
|
|
383
|
+
var v;
|
|
384
|
+
const y = (v = t.label) == null ? void 0 : v.call(t, l);
|
|
385
|
+
return d(xe, i({
|
|
386
|
+
key: l.value
|
|
387
|
+
}, l), {
|
|
388
|
+
default: () => [y || l.label]
|
|
389
389
|
});
|
|
390
|
-
}), (
|
|
390
|
+
}), (u = t.default) == null ? void 0 : u.call(t)];
|
|
391
391
|
},
|
|
392
|
-
...
|
|
392
|
+
...f(t, "default")
|
|
393
393
|
});
|
|
394
394
|
}
|
|
395
|
-
}),
|
|
395
|
+
}), yt = g({
|
|
396
396
|
props: {
|
|
397
|
-
...
|
|
397
|
+
...Y.props,
|
|
398
398
|
options: {
|
|
399
399
|
type: Array
|
|
400
400
|
}
|
|
401
401
|
},
|
|
402
402
|
setup: (e, {
|
|
403
403
|
slots: t,
|
|
404
|
-
emit:
|
|
405
|
-
}) => () =>
|
|
406
|
-
"onUpdate:modelValue": (
|
|
407
|
-
|
|
404
|
+
emit: c
|
|
405
|
+
}) => () => d(Y, i(f(e, "options"), {
|
|
406
|
+
"onUpdate:modelValue": (a) => {
|
|
407
|
+
c("update:modelValue", a);
|
|
408
408
|
}
|
|
409
409
|
}), {
|
|
410
410
|
default: () => {
|
|
411
|
-
var
|
|
412
|
-
return [(
|
|
413
|
-
key:
|
|
414
|
-
},
|
|
415
|
-
name:
|
|
411
|
+
var a, o;
|
|
412
|
+
return [(a = t.start) == null ? void 0 : a.call(t), p(e.options, (r) => d(Ie, i({
|
|
413
|
+
key: r.value
|
|
414
|
+
}, f(r, "value"), {
|
|
415
|
+
name: r.value
|
|
416
416
|
}), {
|
|
417
417
|
label: () => {
|
|
418
|
-
var
|
|
419
|
-
return ((
|
|
418
|
+
var n;
|
|
419
|
+
return ((n = t.label) == null ? void 0 : n.call(t, r)) || r.label;
|
|
420
420
|
}
|
|
421
|
-
})), (
|
|
421
|
+
})), (o = t.default) == null ? void 0 : o.call(t)];
|
|
422
422
|
}
|
|
423
423
|
})
|
|
424
|
-
})
|
|
425
|
-
|
|
424
|
+
});
|
|
425
|
+
function et(e) {
|
|
426
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !De(e);
|
|
427
|
+
}
|
|
428
|
+
const L = {
|
|
429
|
+
convertSubMenuProps: {
|
|
430
|
+
type: Function
|
|
431
|
+
},
|
|
432
|
+
convertMenuItemProps: {
|
|
433
|
+
type: Function
|
|
434
|
+
},
|
|
435
|
+
onMenuItemClick: {
|
|
436
|
+
type: Function
|
|
437
|
+
}
|
|
438
|
+
}, Pe = F(L), Se = g({
|
|
439
|
+
inheritAttrs: !1,
|
|
440
|
+
props: {
|
|
441
|
+
menu: {
|
|
442
|
+
type: Object
|
|
443
|
+
},
|
|
444
|
+
...L
|
|
445
|
+
},
|
|
446
|
+
setup: (e, {
|
|
447
|
+
slots: t
|
|
448
|
+
}) => {
|
|
449
|
+
const c = () => {
|
|
450
|
+
var a;
|
|
451
|
+
(a = e.onMenuItemClick) == null || a.call(e, e.menu);
|
|
452
|
+
};
|
|
453
|
+
return () => {
|
|
454
|
+
var o, r;
|
|
455
|
+
const a = e.menu;
|
|
456
|
+
return (a == null ? void 0 : a.children) && B(a.children) > 0 ? d(M.SubMenu, i({
|
|
457
|
+
index: a == null ? void 0 : a.value
|
|
458
|
+
}, (o = e.convertSubMenuProps) == null ? void 0 : o.call(e, a)), {
|
|
459
|
+
default: () => [p(a.children, (n) => d(Se, i({
|
|
460
|
+
menu: n
|
|
461
|
+
}, N(e, Pe)), t))],
|
|
462
|
+
title: () => {
|
|
463
|
+
var n;
|
|
464
|
+
return ((n = t.title) == null ? void 0 : n.call(t, a)) || (a == null ? void 0 : a.label);
|
|
465
|
+
}
|
|
466
|
+
}) : d(M.MenuItem, i({
|
|
467
|
+
index: a == null ? void 0 : a.value
|
|
468
|
+
}, (r = e.convertMenuItemProps) == null ? void 0 : r.call(e, a), {
|
|
469
|
+
onClick: c
|
|
470
|
+
}), {
|
|
471
|
+
title: () => {
|
|
472
|
+
var n;
|
|
473
|
+
return ((n = t.title) == null ? void 0 : n.call(t, a)) || (a == null ? void 0 : a.label);
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
}), de = () => ({
|
|
479
|
+
activeKey: {
|
|
480
|
+
type: String
|
|
481
|
+
},
|
|
482
|
+
options: {
|
|
483
|
+
type: Array
|
|
484
|
+
},
|
|
485
|
+
fieldNames: {
|
|
486
|
+
type: Object,
|
|
487
|
+
default: {
|
|
488
|
+
children: "children",
|
|
489
|
+
value: "value",
|
|
490
|
+
label: "label"
|
|
491
|
+
}
|
|
492
|
+
},
|
|
493
|
+
...L
|
|
494
|
+
}), vt = g({
|
|
495
|
+
props: {
|
|
496
|
+
...f(M.props, "defaultActive"),
|
|
497
|
+
...de()
|
|
498
|
+
},
|
|
499
|
+
setup: (e, {
|
|
500
|
+
slots: t
|
|
501
|
+
}) => {
|
|
502
|
+
const c = S(e.activeKey);
|
|
503
|
+
x(() => {
|
|
504
|
+
e.activeKey !== c.value && (c.value = e.activeKey);
|
|
505
|
+
}, () => e.activeKey);
|
|
506
|
+
const a = me(() => {
|
|
507
|
+
var r;
|
|
508
|
+
return $e(e.options, (n) => {
|
|
509
|
+
var y, v;
|
|
510
|
+
const u = ((y = e.fieldNames) == null ? void 0 : y.value) || "value", l = ((v = e.fieldNames) == null ? void 0 : v.label) || "label";
|
|
511
|
+
return {
|
|
512
|
+
...f(n, u, l),
|
|
513
|
+
value: K(n, u),
|
|
514
|
+
label: K(n, l)
|
|
515
|
+
};
|
|
516
|
+
}, {
|
|
517
|
+
children: ((r = e.fieldNames) == null ? void 0 : r.children) || "children",
|
|
518
|
+
childrenName: "children"
|
|
519
|
+
});
|
|
520
|
+
}), o = F(de());
|
|
521
|
+
return () => {
|
|
522
|
+
let r;
|
|
523
|
+
return d(M, i({
|
|
524
|
+
defaultActive: c.value
|
|
525
|
+
}, f(e, o)), et(r = p(a.value, (n) => d(Se, i({
|
|
526
|
+
menu: n
|
|
527
|
+
}, N(e, Pe)), t))) ? r : {
|
|
528
|
+
default: () => [r]
|
|
529
|
+
});
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
}), ie = () => ({
|
|
533
|
+
modelValue: {
|
|
534
|
+
type: Array,
|
|
535
|
+
default: void 0
|
|
536
|
+
},
|
|
537
|
+
maxSize: {
|
|
538
|
+
type: Number
|
|
539
|
+
},
|
|
540
|
+
convertResponseData: {
|
|
541
|
+
type: Function
|
|
542
|
+
},
|
|
543
|
+
convertItemData: {
|
|
544
|
+
type: Function,
|
|
545
|
+
default: (e) => ({
|
|
546
|
+
...e,
|
|
547
|
+
status: e.status || "success"
|
|
548
|
+
})
|
|
549
|
+
},
|
|
550
|
+
onErrorMsg: Function,
|
|
551
|
+
onStart: Function,
|
|
552
|
+
beforeUpload: {
|
|
553
|
+
type: Function
|
|
554
|
+
}
|
|
555
|
+
}), tt = ["abort", "submit", "clearFiles", "handleStart", "handleRemove"], at = g({
|
|
556
|
+
props: {
|
|
557
|
+
...f(ee.props, "fileList"),
|
|
558
|
+
...ie()
|
|
559
|
+
},
|
|
560
|
+
setup: (e, {
|
|
561
|
+
slots: t,
|
|
562
|
+
expose: c,
|
|
563
|
+
emit: a
|
|
564
|
+
}) => {
|
|
565
|
+
const o = S();
|
|
566
|
+
c(V(o, tt));
|
|
567
|
+
const {
|
|
568
|
+
formItem: r
|
|
569
|
+
} = Re(), n = () => we(e.modelValue) ? p(e.modelValue, (b) => {
|
|
570
|
+
var P;
|
|
571
|
+
return ((P = e.convertItemData) == null ? void 0 : P.call(e, b)) || b;
|
|
572
|
+
}) : [], u = S(n());
|
|
573
|
+
let l = !1;
|
|
574
|
+
const y = () => {
|
|
575
|
+
var P;
|
|
576
|
+
l = !0;
|
|
577
|
+
const b = ne(u.value, (m) => m.status === "success");
|
|
578
|
+
a("update:modelValue", p(b, (m) => {
|
|
579
|
+
var k;
|
|
580
|
+
return ((k = e.convertResponseData) == null ? void 0 : k.call(e, m)) || m;
|
|
581
|
+
})), (P = r == null ? void 0 : r.validate) == null || P.call(r, "change");
|
|
582
|
+
};
|
|
583
|
+
x(() => {
|
|
584
|
+
l || (u.value = n(), l = !1);
|
|
585
|
+
}, () => e.modelValue);
|
|
586
|
+
const v = (b) => {
|
|
587
|
+
var P, m, k, T;
|
|
588
|
+
if (e.beforeUpload)
|
|
589
|
+
return e.beforeUpload(b);
|
|
590
|
+
if (e.accept && !Ge(e.accept, b.name))
|
|
591
|
+
return (P = e.onErrorMsg) == null || P.call(e, "FileTypeError", `\u8BF7\u4E0A\u4F20\u6B63\u786E\u683C\u5F0F\uFF08${e.accept.replace(/,/g, "\uFF0C")}\uFF09\u7684\u6587\u4EF6`), !1;
|
|
592
|
+
if (s(b.size)) {
|
|
593
|
+
if (b.size <= 0)
|
|
594
|
+
return (m = e.onErrorMsg) == null || m.call(e, "FileSizeError-Zero", "\u4E0A\u4F20\u6587\u4EF6\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A"), !1;
|
|
595
|
+
if (s(e.maxSize) && b.size > e.maxSize)
|
|
596
|
+
return (k = e.onErrorMsg) == null || k.call(e, "FileSizeError-MaxSize", `\u8BF7\u4E0A\u4F20\u5C0F\u4E8E${_e(e.maxSize)}\u7684\u6587\u4EF6`), !1;
|
|
597
|
+
}
|
|
598
|
+
return (T = e.onStart) == null || T.call(e, b), !0;
|
|
599
|
+
}, C = me(() => s(e.limit) ? e.limit > B(u.value) : !0), I = F(ie());
|
|
600
|
+
return () => {
|
|
601
|
+
var b, P;
|
|
602
|
+
return d("div", {
|
|
603
|
+
class: `pro-uploader ${C.value ? "" : "pro-uploader-limit"}`
|
|
604
|
+
}, [(b = t.start) == null ? void 0 : b.call(t), d(ee, i({
|
|
605
|
+
ref: o,
|
|
606
|
+
fileList: u.value,
|
|
607
|
+
"onUpdate:fileList": (m) => u.value = m
|
|
608
|
+
}, f(e, "fileList", "onSuccess", "onRemove", "beforeUpload", ...I), {
|
|
609
|
+
beforeUpload: v,
|
|
610
|
+
onSuccess: (m, k, T) => {
|
|
611
|
+
var E;
|
|
612
|
+
(E = e.onSuccess) == null || E.call(e, m, k, T), y();
|
|
613
|
+
},
|
|
614
|
+
onRemove: (m, k) => {
|
|
615
|
+
var T;
|
|
616
|
+
u.value = ne(u.value, (E) => !(m.uid === E.uid && m.name === E.name)), (T = e.onRemove) == null || T.call(e, m, k), y();
|
|
617
|
+
}
|
|
618
|
+
}), {
|
|
619
|
+
default: () => {
|
|
620
|
+
var m;
|
|
621
|
+
return [C.value && ((m = t.default) == null ? void 0 : m.call(t))];
|
|
622
|
+
},
|
|
623
|
+
...f(t, "default")
|
|
624
|
+
}), (P = t.end) == null ? void 0 : P.call(t)]);
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
}), bt = h({
|
|
628
|
+
InputComp: Me,
|
|
426
629
|
valueType: "text",
|
|
427
630
|
name: "PFromText"
|
|
428
|
-
}),
|
|
429
|
-
InputComp:
|
|
631
|
+
}), gt = h({
|
|
632
|
+
InputComp: Be,
|
|
430
633
|
valueType: "digit",
|
|
431
634
|
name: "PFormNumber"
|
|
432
|
-
}),
|
|
433
|
-
InputComp:
|
|
635
|
+
}), Pt = h({
|
|
636
|
+
InputComp: Ve,
|
|
434
637
|
valueType: "date",
|
|
435
638
|
name: "PFormDate"
|
|
436
|
-
}),
|
|
437
|
-
InputComp:
|
|
639
|
+
}), St = h({
|
|
640
|
+
InputComp: se,
|
|
438
641
|
valueType: "time",
|
|
439
642
|
name: "PFormTime"
|
|
440
|
-
}),
|
|
441
|
-
InputComp:
|
|
643
|
+
}), pt = h({
|
|
644
|
+
InputComp: Ye,
|
|
442
645
|
valueType: "select",
|
|
443
646
|
name: "PFormSelect"
|
|
444
|
-
}),
|
|
445
|
-
InputComp:
|
|
647
|
+
}), ht = h({
|
|
648
|
+
InputComp: ze,
|
|
446
649
|
valueType: "treeSelect",
|
|
447
650
|
name: "PFormTreeSelect"
|
|
448
|
-
}),
|
|
449
|
-
InputComp:
|
|
651
|
+
}), Ct = h({
|
|
652
|
+
InputComp: Qe,
|
|
450
653
|
valueType: "checkbox",
|
|
451
654
|
name: "PFromCheckbox"
|
|
452
|
-
}),
|
|
453
|
-
InputComp:
|
|
655
|
+
}), kt = h({
|
|
656
|
+
InputComp: Xe,
|
|
454
657
|
valueType: "radio",
|
|
455
658
|
name: "PFromRadio"
|
|
456
|
-
}),
|
|
457
|
-
InputComp:
|
|
659
|
+
}), Ft = h({
|
|
660
|
+
InputComp: Ue,
|
|
458
661
|
valueType: "switch",
|
|
459
662
|
name: "PFromSwitch"
|
|
460
|
-
}),
|
|
461
|
-
InputComp:
|
|
663
|
+
}), Tt = h({
|
|
664
|
+
InputComp: Ae,
|
|
462
665
|
valueType: "cascader",
|
|
463
666
|
name: "PFormCascader"
|
|
464
|
-
}),
|
|
667
|
+
}), pe = g({
|
|
465
668
|
props: {
|
|
466
|
-
...
|
|
669
|
+
...f(te.props, "label", "prop"),
|
|
467
670
|
title: {
|
|
468
671
|
type: String
|
|
469
672
|
},
|
|
@@ -480,55 +683,55 @@ const H = () => ({
|
|
|
480
683
|
setup: (e, {
|
|
481
684
|
slots: t
|
|
482
685
|
}) => {
|
|
483
|
-
const
|
|
484
|
-
row:
|
|
485
|
-
column:
|
|
486
|
-
$index:
|
|
686
|
+
const c = ({
|
|
687
|
+
row: r,
|
|
688
|
+
column: n,
|
|
689
|
+
$index: u
|
|
487
690
|
}) => {
|
|
488
|
-
var
|
|
489
|
-
const
|
|
490
|
-
...
|
|
491
|
-
title:
|
|
492
|
-
dataIndex:
|
|
493
|
-
},
|
|
494
|
-
value:
|
|
495
|
-
text:
|
|
496
|
-
record:
|
|
497
|
-
column:
|
|
691
|
+
var P;
|
|
692
|
+
const l = r, y = u, v = {
|
|
693
|
+
...n,
|
|
694
|
+
title: n.label,
|
|
695
|
+
dataIndex: n.property
|
|
696
|
+
}, C = K(r, v.dataIndex), I = {
|
|
697
|
+
value: C,
|
|
698
|
+
text: C,
|
|
699
|
+
record: l,
|
|
700
|
+
column: v,
|
|
498
701
|
index: y
|
|
499
|
-
},
|
|
500
|
-
return
|
|
501
|
-
},
|
|
702
|
+
}, b = (P = t.bodyCell) == null ? void 0 : P.call(t, I);
|
|
703
|
+
return b || (e.customRender ? e.customRender(I) : C);
|
|
704
|
+
}, o = {
|
|
502
705
|
header: ({
|
|
503
|
-
column:
|
|
504
|
-
$index:
|
|
706
|
+
column: r,
|
|
707
|
+
$index: n
|
|
505
708
|
}) => {
|
|
506
|
-
var
|
|
507
|
-
const
|
|
508
|
-
...
|
|
509
|
-
title:
|
|
510
|
-
dataIndex:
|
|
709
|
+
var C;
|
|
710
|
+
const u = n, l = r.label, y = {
|
|
711
|
+
...r,
|
|
712
|
+
title: l,
|
|
713
|
+
dataIndex: r.property
|
|
511
714
|
};
|
|
512
|
-
return ((
|
|
513
|
-
title:
|
|
715
|
+
return ((C = t.headerCell) == null ? void 0 : C.call(t, {
|
|
716
|
+
title: l,
|
|
514
717
|
column: y,
|
|
515
|
-
index:
|
|
516
|
-
})) ||
|
|
718
|
+
index: u
|
|
719
|
+
})) || l;
|
|
517
720
|
}
|
|
518
721
|
};
|
|
519
|
-
return (!e.children ||
|
|
722
|
+
return (!e.children || B(e.children) <= 0) && (o.default = c), () => d(te, i(f(e, "title", "dataIndex", "prop", "customRender", "children"), {
|
|
520
723
|
prop: e.dataIndex,
|
|
521
724
|
label: e.title
|
|
522
725
|
}), {
|
|
523
|
-
default: () => [
|
|
524
|
-
key:
|
|
525
|
-
},
|
|
526
|
-
...
|
|
726
|
+
default: () => [B(e.children) > 0 && p(e.children, (r) => d(pe, i({
|
|
727
|
+
key: r.dataIndex
|
|
728
|
+
}, r), t))],
|
|
729
|
+
...o
|
|
527
730
|
});
|
|
528
731
|
}
|
|
529
|
-
}),
|
|
732
|
+
}), nt = ["clearSelection", "getSelectionRows", "toggleRowSelection", "toggleAllSelection", "toggleRowExpansion", "setCurrentRow", "clearSort", "clearFilter", "doLayout", "sort", "scrollTo", "setScrollTop", "setScrollLeft"], rt = g({
|
|
530
733
|
props: {
|
|
531
|
-
...
|
|
734
|
+
...ae.props,
|
|
532
735
|
columns: {
|
|
533
736
|
type: Array
|
|
534
737
|
},
|
|
@@ -541,114 +744,95 @@ const H = () => ({
|
|
|
541
744
|
},
|
|
542
745
|
setup: (e, {
|
|
543
746
|
slots: t,
|
|
544
|
-
expose:
|
|
747
|
+
expose: c
|
|
545
748
|
}) => {
|
|
546
|
-
const
|
|
547
|
-
return
|
|
548
|
-
ref:
|
|
549
|
-
id:
|
|
550
|
-
},
|
|
749
|
+
const a = S(), o = ge("table");
|
|
750
|
+
return c(fe(nt, a)), () => d(ae, i({
|
|
751
|
+
ref: a,
|
|
752
|
+
id: o
|
|
753
|
+
}, f(e, "columns", "dataSource", "loading"), {
|
|
551
754
|
data: e.dataSource || e.data
|
|
552
755
|
}), {
|
|
553
756
|
default: () => {
|
|
554
|
-
var
|
|
555
|
-
return [(
|
|
556
|
-
key:
|
|
557
|
-
},
|
|
558
|
-
target:
|
|
757
|
+
var r, n;
|
|
758
|
+
return [(r = t.start) == null ? void 0 : r.call(t), p(e.columns, (u) => d(pe, i({
|
|
759
|
+
key: u.dataIndex
|
|
760
|
+
}, u), t)), (n = t.default) == null ? void 0 : n.call(t), e.loading && d(He, {
|
|
761
|
+
target: o,
|
|
559
762
|
loading: !0
|
|
560
763
|
}, null)];
|
|
561
764
|
},
|
|
562
|
-
...
|
|
765
|
+
...N(t, "append", "empty")
|
|
563
766
|
});
|
|
564
767
|
}
|
|
565
768
|
});
|
|
566
|
-
C.props = {
|
|
567
|
-
...h.props,
|
|
568
|
-
...C.props,
|
|
569
|
-
formMethods: { type: Array, default: te }
|
|
570
|
-
};
|
|
571
769
|
R.props = {
|
|
572
|
-
...
|
|
770
|
+
...A.props,
|
|
771
|
+
...R.props,
|
|
772
|
+
formMethods: { type: Array, default: be }
|
|
773
|
+
};
|
|
774
|
+
D.props = {
|
|
573
775
|
...R.props,
|
|
776
|
+
...D.props,
|
|
574
777
|
inline: { type: Boolean, default: !0 }
|
|
575
778
|
};
|
|
576
|
-
|
|
577
|
-
...
|
|
578
|
-
...
|
|
779
|
+
j.props = {
|
|
780
|
+
...U.props,
|
|
781
|
+
...j.props
|
|
579
782
|
};
|
|
580
|
-
|
|
581
|
-
...
|
|
582
|
-
...
|
|
783
|
+
O.props = {
|
|
784
|
+
...rt.props,
|
|
785
|
+
...O.props
|
|
583
786
|
};
|
|
584
|
-
|
|
585
|
-
...
|
|
586
|
-
...
|
|
787
|
+
z.props = {
|
|
788
|
+
...Ke.props,
|
|
789
|
+
...z.props
|
|
587
790
|
};
|
|
588
|
-
|
|
589
|
-
...
|
|
590
|
-
...
|
|
791
|
+
w.props = {
|
|
792
|
+
...z.props,
|
|
793
|
+
...w.props
|
|
591
794
|
};
|
|
592
|
-
|
|
593
|
-
...
|
|
594
|
-
...
|
|
795
|
+
q.props = {
|
|
796
|
+
...R.props,
|
|
797
|
+
...q.props
|
|
595
798
|
};
|
|
596
|
-
|
|
597
|
-
...
|
|
598
|
-
|
|
799
|
+
$.props = {
|
|
800
|
+
...Je.props,
|
|
801
|
+
...$.props
|
|
599
802
|
};
|
|
600
|
-
|
|
601
|
-
...
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
default: ({ mode: e, activeKey: t, openKeys: u }) => ({ mode: e, defaultActive: t })
|
|
605
|
-
},
|
|
606
|
-
convertSubMenuParams: {
|
|
607
|
-
type: Function,
|
|
608
|
-
default: (e) => ({ index: e.value })
|
|
609
|
-
},
|
|
610
|
-
convertMenuItemParams: {
|
|
611
|
-
type: Function,
|
|
612
|
-
default: (e) => ({ index: e.value })
|
|
613
|
-
},
|
|
614
|
-
subMenuSlots: {
|
|
615
|
-
type: Object,
|
|
616
|
-
default: {
|
|
617
|
-
title: (e) => e.label
|
|
618
|
-
}
|
|
619
|
-
},
|
|
620
|
-
menuItemSlots: {
|
|
621
|
-
type: Object,
|
|
622
|
-
default: {
|
|
623
|
-
title: (e) => e.label
|
|
624
|
-
}
|
|
625
|
-
}
|
|
803
|
+
G.props = {
|
|
804
|
+
...at.props,
|
|
805
|
+
...G.props,
|
|
806
|
+
modelValue: String
|
|
626
807
|
};
|
|
627
808
|
export {
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
809
|
+
be as FormMethods,
|
|
810
|
+
Qe as ProCheckbox,
|
|
811
|
+
it as ProForm,
|
|
812
|
+
Tt as ProFormCascader,
|
|
813
|
+
Ct as ProFormCheckbox,
|
|
814
|
+
Pt as ProFormDatePicker,
|
|
815
|
+
We as ProFormItem,
|
|
816
|
+
kt as ProFormRadio,
|
|
817
|
+
pt as ProFormSelect,
|
|
818
|
+
Ft as ProFormSwitch,
|
|
819
|
+
bt as ProFormText,
|
|
820
|
+
gt as ProFormTextNumber,
|
|
821
|
+
St as ProFormTimePicker,
|
|
822
|
+
ht as ProFormTreeSelect,
|
|
823
|
+
He as ProLoading,
|
|
824
|
+
vt as ProMenus,
|
|
825
|
+
Je as ProModal,
|
|
826
|
+
ft as ProPagination,
|
|
827
|
+
mt as ProPopover,
|
|
828
|
+
Xe as ProRadio,
|
|
829
|
+
Ye as ProSelect,
|
|
830
|
+
rt as ProTable,
|
|
831
|
+
pe as ProTableColumn,
|
|
832
|
+
yt as ProTabs,
|
|
833
|
+
at as ProUploader,
|
|
834
|
+
nt as TableMethods,
|
|
835
|
+
tt as UploadMethods,
|
|
836
|
+
h as createFormItemComponent,
|
|
837
|
+
ge as createLoadingId
|
|
654
838
|
};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("@vue-start/pro"),r=require("element-plus"),t=require("vue"),a=require("lodash"),b=require("@vue-start/hooks"),h=()=>({name:{type:[String,Array]}}),I=t.defineComponent({props:{...r.ElFormItem.props,...h()},setup:(e,{slots:o})=>{const i=a.keys(h());return()=>t.createVNode(r.ElFormItem,t.mergeProps(a.omit(e,...i,"name","prop"),{prop:e.prop||e.name}),o)}}),y=["clearValidate","resetFields","scrollToField","validate","validateField","submit"],D=t.defineComponent({props:{...r.ElForm.props,hideRequiredMark:{type:[Boolean,Object],default:void 0}},setup:(e,{slots:o,emit:i,expose:d})=>{const c=e.model||t.reactive({}),l=t.ref();return b.useEffect(()=>{!l.value||(l.value.submit=()=>{var u;(u=l.value)==null||u.validate((p,n)=>{p?i("finish",t.toRaw(c)):i("finishFailed",n)})})},[]),d(m.createExpose(y,l)),()=>t.createVNode(r.ElForm,t.mergeProps({ref:l},a.omit(e,"model"),{hideRequiredAsterisk:a.isBoolean(e.hideRequiredMark)?e.hideRequiredMark:e.hideRequiredAsterisk,model:c}),o)}}),g=m.createFormItemCompFn(I,(e,o,i)=>({modelValue:e,"onUpdate:modelValue":o,clearable:!0,disabled:i})),v=(e="comp")=>e+"-"+b.generateId(),j=()=>({loading:{type:Boolean},target:{type:[String,Object]},body:{type:Boolean},fullscreen:{type:Boolean},lock:{type:Boolean},text:{type:String},spinner:{type:String},background:{type:String},customClass:{type:String}}),N=t.defineComponent({props:{...j()},setup:(e,{slots:o})=>{const i=v();return b.useEffect(()=>{if(!e.loading)return;let d=e.target;if(o.default?d=document.getElementById(i):e.target&&a.isString(e.target)&&(d=document.querySelector("#"+e.target)),!d)return;const c=r.ElLoading.service({target:d,body:e.body,fullscreen:e.fullscreen,lock:e.lock,text:e.text,spinner:e.spinner,background:e.background,customClass:e.customClass});return()=>{c&&c.close()}},()=>e.loading),()=>o.default?t.createVNode("div",{id:i},[o.default()]):null}}),E=()=>({clsName:{type:String,default:"pro-modal"},visible:{type:Boolean,default:!1},cancelText:{type:String,default:"\u53D6\u6D88"},cancelButtonProps:{type:Object},okText:{type:String,default:"\u786E\u8BA4"},okButtonProps:{type:Object},confirmLoading:Boolean,footer:{type:Boolean,default:!0},maskClosable:{type:[Object,Boolean],default:void 0}}),R=t.defineComponent({props:{...r.ElDialog.props,appendToBody:{type:Boolean,default:!0},...E()},setup:(e,{slots:o,emit:i})=>{const d=t.ref(e.visible);b.useWatch(()=>{d.value!==e.visible&&(d.value=e.visible)},()=>e.visible);const c=()=>{var p;if((p=e.cancelButtonProps)!=null&&p.onClick){e.cancelButtonProps.onClick();return}d.value=!1,i("update:visible",!1)},l=()=>{var p;if((p=e.okButtonProps)!=null&&p.onClick){e.okButtonProps.onClick();return}i("ok")},u=a.keys(E());return()=>t.createVNode(r.ElDialog,t.mergeProps({class:e.clsName},a.omit(e,...u,"modelValue"),{closeOnClickModal:a.isBoolean(e.maskClosable)?e.maskClosable:e.closeOnClickModal,modelValue:d.value,"onUpdate:modelValue":[p=>d.value=p,p=>{i("update:visible",p)}],onClose:()=>{i("cancel")}}),{footer:e.footer===!1?void 0:()=>t.createVNode("div",{class:`${e.clsName}-operate`},[t.createVNode(r.ElButton,t.mergeProps(a.omit(e.cancelButtonProps,"onClick"),{onClick:c}),{default:()=>[e.cancelText]}),t.createVNode(r.ElButton,t.mergeProps({type:"primary",loading:e.confirmLoading},a.omit(e.okButtonProps,"onClick"),{onClick:l}),{default:()=>[e.okText]})]),...o})}}),q=t.defineComponent({props:{...r.ElPagination.props,page:{type:Number,default:1}},setup:(e,{slots:o,emit:i})=>{const d=t.ref(e.page),c=t.ref(e.pageSize);b.useWatch(()=>{d.value!==e.page&&(d.value=e.page)},()=>e.page),b.useWatch(()=>{c.value!==e.pageSize&&(c.value=e.pageSize)},()=>e.pageSize);const l=a.debounce(()=>{i("composeChange",d.value,c.value)},300),u=()=>{l(),i("update:page",d.value)},p=()=>{l(),i("update:pageSize",c.value)};return()=>t.createVNode(r.ElPagination,t.mergeProps({currentPage:d.value,"onUpdate:currentPage":n=>d.value=n,pageSize:c.value,"onUpdate:pageSize":n=>c.value=n,onCurrentChange:u,onSizeChange:p},a.omit(e,"currentPage","pageSize")),o)}}),O=t.defineComponent({props:{...r.ElPopover.props},setup:(e,{slots:o})=>()=>t.createVNode(r.ElPopover,e,{reference:o.default,default:o.content})}),T=()=>({options:Array,buttonStyle:{type:String,default:"default"},optionType:{type:String,default:"default"}}),B=t.defineComponent({props:{...r.ElCheckboxGroup.props,...T()},setup:(e,{slots:o,emit:i,expose:d})=>{const c=t.ref();d(m.createExposeObj(c));const l=a.keys(T());return()=>t.createVNode(r.ElCheckboxGroup,t.mergeProps({ref:c},a.omit(e,l),{"onUpdate:modelValue":u=>{i("update:modelValue",u||void 0)}}),{default:()=>{var u,p;return[(u=o.start)==null?void 0:u.call(o),a.map(e.options,n=>{var P;const f=(P=o.label)==null?void 0:P.call(o,n);return e.optionType==="button"||e.buttonStyle==="button"?t.createVNode(r.ElCheckboxButton,t.mergeProps({key:n.value},a.omit(n,"value"),{label:n.value}),{default:()=>[f||n.label]}):t.createVNode(r.ElCheckbox,t.mergeProps({key:n.value},n,{label:n.value}),{default:()=>[f||n.label]})}),(p=o.default)==null?void 0:p.call(o)]}})}}),x=()=>({options:{type:Array},buttonStyle:{type:String,default:"default"},optionType:{type:String,default:"default"}}),M=t.defineComponent({props:{...r.ElRadioGroup.props,...x()},setup:(e,{slots:o,emit:i,expose:d})=>{const c=t.ref();d(m.createExposeObj(c));const l=a.keys(x());return()=>t.createVNode(r.ElRadioGroup,t.mergeProps({ref:c},a.omit(e,l),{"onUpdate:modelValue":u=>{i("update:modelValue",u)}}),{default:()=>{var u,p;return[(u=o.start)==null?void 0:u.call(o),a.map(e.options,n=>{var P;const f=(P=o.label)==null?void 0:P.call(o,n);return e.optionType==="button"||e.buttonStyle==="button"?t.createVNode(r.ElRadioButton,t.mergeProps({key:n.value},a.omit(n,"value"),{label:n.value}),{default:()=>[f||n.label]}):t.createVNode(r.ElRadio,t.mergeProps({key:n.value},a.omit(n,"value"),{label:n.value}),{default:()=>[f||n.label]})}),(p=o.default)==null?void 0:p.call(o)]}})}}),V=()=>({options:Array}),L=t.defineComponent({props:{...r.ElSelect.props,...V()},setup:(e,{slots:o,emit:i,expose:d})=>{const c=t.ref();d(m.createExposeObj(c));const l=a.keys(V());return()=>t.createVNode(r.ElSelect,t.mergeProps({ref:c},a.omit(e,l),{"onUpdate:modelValue":u=>{i("update:modelValue",u||void 0)}}),{default:()=>{var u,p;return[(u=o.start)==null?void 0:u.call(o),a.map(e.options,n=>{var P;const f=(P=o.label)==null?void 0:P.call(o,n);return t.createVNode(r.ElOption,t.mergeProps({key:n.value},n),{default:()=>[f||n.label]})}),(p=o.default)==null?void 0:p.call(o)]},...a.omit(o,"default")})}}),w=t.defineComponent({props:{...r.ElTabs.props,options:{type:Array}},setup:(e,{slots:o,emit:i})=>()=>t.createVNode(r.ElTabs,t.mergeProps(a.omit(e,"options"),{"onUpdate:modelValue":d=>{i("update:modelValue",d)}}),{default:()=>{var d,c;return[(d=o.start)==null?void 0:d.call(o),a.map(e.options,l=>t.createVNode(r.ElTabPane,t.mergeProps({key:l.value},a.omit(l,"value"),{name:l.value}),{label:()=>{var u;return((u=o.label)==null?void 0:u.call(o,l))||l.label}})),(c=o.default)==null?void 0:c.call(o)]}})}),U=g({InputComp:r.ElInput,valueType:"text",name:"PFromText"}),K=g({InputComp:r.ElInputNumber,valueType:"digit",name:"PFormNumber"}),G=g({InputComp:r.ElDatePicker,valueType:"date",name:"PFormDate"}),W=g({InputComp:r.ElTimePicker,valueType:"time",name:"PFormTime"}),_=g({InputComp:L,valueType:"select",name:"PFormSelect"}),$=g({InputComp:r.ElTreeSelect,valueType:"treeSelect",name:"PFormTreeSelect"}),H=g({InputComp:B,valueType:"checkbox",name:"PFromCheckbox"}),J=g({InputComp:M,valueType:"radio",name:"PFromRadio"}),Q=g({InputComp:r.ElSwitch,valueType:"switch",name:"PFromSwitch"}),X=g({InputComp:r.ElCascader,valueType:"cascader",name:"PFormCascader"}),C=t.defineComponent({props:{...a.omit(r.ElTableColumn.props,"label","prop"),title:{type:String},dataIndex:{type:String},children:{type:Array},customRender:{type:Function}},setup:(e,{slots:o})=>{const i=({row:l,column:u,$index:p})=>{var k;const n=l,f=p,P={...u,title:u.label,dataIndex:u.property},s=a.get(l,P.dataIndex),S={value:s,text:s,record:n,column:P,index:f},F=(k=o.bodyCell)==null?void 0:k.call(o,S);return F||(e.customRender?e.customRender(S):s)},c={header:({column:l,$index:u})=>{var s;const p=u,n=l.label,f={...l,title:n,dataIndex:l.property};return((s=o.headerCell)==null?void 0:s.call(o,{title:n,column:f,index:p}))||n}};return(!e.children||a.size(e.children)<=0)&&(c.default=i),()=>t.createVNode(r.ElTableColumn,t.mergeProps(a.omit(e,"title","dataIndex","prop","customRender","children"),{prop:e.dataIndex,label:e.title}),{default:()=>[a.size(e.children)>0&&a.map(e.children,l=>t.createVNode(C,t.mergeProps({key:l.dataIndex},l),o))],...c})}}),z=["clearSelection","getSelectionRows","toggleRowSelection","toggleAllSelection","toggleRowExpansion","setCurrentRow","clearSort","clearFilter","doLayout","sort","scrollTo","setScrollTop","setScrollLeft"],A=t.defineComponent({props:{...r.ElTable.props,columns:{type:Array},dataSource:{type:Array},loading:{type:Boolean}},setup:(e,{slots:o,expose:i})=>{const d=t.ref(),c=v("table");return i(m.createExpose(z,d)),()=>t.createVNode(r.ElTable,t.mergeProps({ref:d,id:c},a.omit(e,"columns","dataSource","loading"),{data:e.dataSource||e.data}),{default:()=>{var l,u;return[(l=o.start)==null?void 0:l.call(o),a.map(e.columns,p=>t.createVNode(C,t.mergeProps({key:p.dataIndex},p),o)),(u=o.default)==null?void 0:u.call(o),e.loading&&t.createVNode(N,{target:c,loading:!0},null)]},...a.pick(o,"append","empty")})}});m.ProForm.props={...r.ElForm.props,...m.ProForm.props,formMethods:{type:Array,default:y}};m.ProSearchForm.props={...m.ProForm.props,...m.ProSearchForm.props,inline:{type:Boolean,default:!0}};m.ProFormList.props={...r.ElFormItem.props,...m.ProFormList.props};m.ProTable.props={...A.props,...m.ProTable.props};m.ProDesc.props={...r.ElDescriptions.props,...m.ProDesc.props};m.ProCurdDesc.props={...m.ProDesc.props,...m.ProCurdDesc.props};m.ProCurdForm.props={...m.ProForm.props,...m.ProCurdForm.props};m.ProCurdModal.props={...R.props,...m.ProCurdModal.props};m.ProLayout.props={...m.ProLayout.props,convertMenuParams:{type:Function,default:({mode:e,activeKey:o,openKeys:i})=>({mode:e,defaultActive:o})},convertSubMenuParams:{type:Function,default:e=>({index:e.value})},convertMenuItemParams:{type:Function,default:e=>({index:e.value})},subMenuSlots:{type:Object,default:{title:e=>e.label}},menuItemSlots:{type:Object,default:{title:e=>e.label}}};exports.FormMethods=y;exports.ProCheckbox=B;exports.ProForm=D;exports.ProFormCascader=X;exports.ProFormCheckbox=H;exports.ProFormDatePicker=G;exports.ProFormItem=I;exports.ProFormRadio=J;exports.ProFormSelect=_;exports.ProFormSwitch=Q;exports.ProFormText=U;exports.ProFormTextNumber=K;exports.ProFormTimePicker=W;exports.ProFormTreeSelect=$;exports.ProLoading=N;exports.ProModal=R;exports.ProPagination=q;exports.ProPopover=O;exports.ProRadio=M;exports.ProSelect=L;exports.ProTable=A;exports.ProTableColumn=C;exports.ProTabs=w;exports.TableMethods=z;exports.createFormItemComponent=g;exports.createLoadingId=v;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("@vue-start/pro"),u=require("element-plus"),r=require("vue"),o=require("lodash"),g=require("@vue-start/hooks"),N=()=>({name:{type:[String,Array]}}),A=r.defineComponent({props:{...u.ElFormItem.props,...N()},setup:(e,{slots:t})=>{const m=o.keys(N());return()=>r.createVNode(u.ElFormItem,r.mergeProps(o.omit(e,...m,"name","prop"),{prop:e.prop||e.name}),t)}}),E=["clearValidate","resetFields","scrollToField","validate","validateField","submit"],Z=r.defineComponent({props:{...u.ElForm.props,hideRequiredMark:{type:[Boolean,Object],default:void 0}},setup:(e,{slots:t,emit:m,expose:a})=>{const d=e.model||r.reactive({}),l=r.ref();return g.useEffect(()=>{!l.value||(l.value.submit=()=>{var n;(n=l.value)==null||n.validate((i,c)=>{i?m("finish",r.toRaw(d)):m("finishFailed",c)})})},[]),a(f.createExpose(E,l)),()=>r.createVNode(u.ElForm,r.mergeProps({ref:l},o.omit(e,"model"),{hideRequiredAsterisk:o.isBoolean(e.hideRequiredMark)?e.hideRequiredMark:e.hideRequiredAsterisk,model:d}),t)}}),s=f.createFormItemCompFn(A,(e,t,m)=>({modelValue:e,"onUpdate:modelValue":t,clearable:!0,disabled:m})),T=(e="comp")=>e+"-"+g.generateId(),H=()=>({loading:{type:Boolean},target:{type:[String,Object]},body:{type:Boolean},fullscreen:{type:Boolean},lock:{type:Boolean},text:{type:String},spinner:{type:String},background:{type:String},customClass:{type:String}}),D=r.defineComponent({props:{...H()},setup:(e,{slots:t})=>{const m=T();return g.useEffect(()=>{if(!e.loading)return;let a=e.target;if(t.default?a=document.getElementById(m):e.target&&o.isString(e.target)&&(a=document.querySelector("#"+e.target)),!a)return;const d=u.ElLoading.service({target:a,body:e.body,fullscreen:e.fullscreen,lock:e.lock,text:e.text,spinner:e.spinner,background:e.background,customClass:e.customClass});return()=>{d&&d.close()}},()=>e.loading),()=>t.default?r.createVNode("div",{id:m},[t.default()]):null}}),I=()=>({clsName:{type:String,default:"pro-modal"},visible:{type:Boolean,default:!1},cancelText:{type:String,default:"\u53D6\u6D88"},cancelButtonProps:{type:Object},okText:{type:String,default:"\u786E\u8BA4"},okButtonProps:{type:Object},confirmLoading:Boolean,footer:{type:Boolean,default:!0},maskClosable:{type:[Object,Boolean],default:void 0}}),L=r.defineComponent({props:{...u.ElDialog.props,appendToBody:{type:Boolean,default:!0},...I()},setup:(e,{slots:t,emit:m})=>{const a=r.ref(e.visible);g.useWatch(()=>{a.value!==e.visible&&(a.value=e.visible)},()=>e.visible);const d=()=>{var i;if((i=e.cancelButtonProps)!=null&&i.onClick){e.cancelButtonProps.onClick();return}a.value=!1,m("update:visible",!1)},l=()=>{var i;if((i=e.okButtonProps)!=null&&i.onClick){e.okButtonProps.onClick();return}m("ok")},n=o.keys(I());return()=>r.createVNode(u.ElDialog,r.mergeProps({class:e.clsName},o.omit(e,...n,"modelValue"),{closeOnClickModal:o.isBoolean(e.maskClosable)?e.maskClosable:e.closeOnClickModal,modelValue:a.value,"onUpdate:modelValue":[i=>a.value=i,i=>{m("update:visible",i)}],onClose:()=>{m("cancel")}}),{footer:e.footer===!1?void 0:()=>r.createVNode("div",{class:`${e.clsName}-operate`},[r.createVNode(u.ElButton,r.mergeProps(o.omit(e.cancelButtonProps,"onClick"),{onClick:d}),{default:()=>[e.cancelText]}),r.createVNode(u.ElButton,r.mergeProps({type:"primary",loading:e.confirmLoading},o.omit(e.okButtonProps,"onClick"),{onClick:l}),{default:()=>[e.okText]})]),...t})}}),J=r.defineComponent({props:{...u.ElPagination.props,page:{type:Number,default:1}},setup:(e,{slots:t,emit:m})=>{const a=r.ref(e.page),d=r.ref(e.pageSize);g.useWatch(()=>{a.value!==e.page&&(a.value=e.page)},()=>e.page),g.useWatch(()=>{d.value!==e.pageSize&&(d.value=e.pageSize)},()=>e.pageSize);const l=o.debounce(()=>{m("composeChange",a.value,d.value)},300),n=()=>{l(),m("update:page",a.value)},i=()=>{l(),m("update:pageSize",d.value)};return()=>r.createVNode(u.ElPagination,r.mergeProps({currentPage:a.value,"onUpdate:currentPage":c=>a.value=c,pageSize:d.value,"onUpdate:pageSize":c=>d.value=c,onCurrentChange:n,onSizeChange:i},o.omit(e,"currentPage","pageSize")),t)}}),Q=r.defineComponent({props:{...u.ElPopover.props},setup:(e,{slots:t})=>()=>r.createVNode(u.ElPopover,e,{reference:t.default,default:t.content})}),M=()=>({options:Array,buttonStyle:{type:String,default:"default"},optionType:{type:String,default:"default"}}),K=r.defineComponent({props:{...u.ElCheckboxGroup.props,...M()},setup:(e,{slots:t,emit:m,expose:a})=>{const d=r.ref();a(f.createExposeObj(d));const l=o.keys(M());return()=>r.createVNode(u.ElCheckboxGroup,r.mergeProps({ref:d},o.omit(e,l),{"onUpdate:modelValue":n=>{m("update:modelValue",n||void 0)}}),{default:()=>{var n,i;return[(n=t.start)==null?void 0:n.call(t),o.map(e.options,c=>{var y;const p=(y=t.label)==null?void 0:y.call(t,c);return e.optionType==="button"||e.buttonStyle==="button"?r.createVNode(u.ElCheckboxButton,r.mergeProps({key:c.value},o.omit(c,"value"),{label:c.value}),{default:()=>[p||c.label]}):r.createVNode(u.ElCheckbox,r.mergeProps({key:c.value},c,{label:c.value}),{default:()=>[p||c.label]})}),(i=t.default)==null?void 0:i.call(t)]}})}}),R=()=>({options:{type:Array},buttonStyle:{type:String,default:"default"},optionType:{type:String,default:"default"}}),j=r.defineComponent({props:{...u.ElRadioGroup.props,...R()},setup:(e,{slots:t,emit:m,expose:a})=>{const d=r.ref();a(f.createExposeObj(d));const l=o.keys(R());return()=>r.createVNode(u.ElRadioGroup,r.mergeProps({ref:d},o.omit(e,l),{"onUpdate:modelValue":n=>{m("update:modelValue",n)}}),{default:()=>{var n,i;return[(n=t.start)==null?void 0:n.call(t),o.map(e.options,c=>{var y;const p=(y=t.label)==null?void 0:y.call(t,c);return e.optionType==="button"||e.buttonStyle==="button"?r.createVNode(u.ElRadioButton,r.mergeProps({key:c.value},o.omit(c,"value"),{label:c.value}),{default:()=>[p||c.label]}):r.createVNode(u.ElRadio,r.mergeProps({key:c.value},o.omit(c,"value"),{label:c.value}),{default:()=>[p||c.label]})}),(i=t.default)==null?void 0:i.call(t)]}})}}),B=()=>({options:Array}),O=r.defineComponent({props:{...u.ElSelect.props,...B()},setup:(e,{slots:t,emit:m,expose:a})=>{const d=r.ref();a(f.createExposeObj(d));const l=o.keys(B());return()=>r.createVNode(u.ElSelect,r.mergeProps({ref:d},o.omit(e,l),{"onUpdate:modelValue":n=>{m("update:modelValue",n||void 0)}}),{default:()=>{var n,i;return[(n=t.start)==null?void 0:n.call(t),o.map(e.options,c=>{var y;const p=(y=t.label)==null?void 0:y.call(t,c);return r.createVNode(u.ElOption,r.mergeProps({key:c.value},c),{default:()=>[p||c.label]})}),(i=t.default)==null?void 0:i.call(t)]},...o.omit(t,"default")})}}),X=r.defineComponent({props:{...u.ElTabs.props,options:{type:Array}},setup:(e,{slots:t,emit:m})=>()=>r.createVNode(u.ElTabs,r.mergeProps(o.omit(e,"options"),{"onUpdate:modelValue":a=>{m("update:modelValue",a)}}),{default:()=>{var a,d;return[(a=t.start)==null?void 0:a.call(t),o.map(e.options,l=>r.createVNode(u.ElTabPane,r.mergeProps({key:l.value},o.omit(l,"value"),{name:l.value}),{label:()=>{var n;return((n=t.label)==null?void 0:n.call(t,l))||l.label}})),(d=t.default)==null?void 0:d.call(t)]}})});function Y(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!r.isVNode(e)}const V={convertSubMenuProps:{type:Function},convertMenuItemProps:{type:Function},onMenuItemClick:{type:Function}},q=o.keys(V),w=r.defineComponent({inheritAttrs:!1,props:{menu:{type:Object},...V},setup:(e,{slots:t})=>{const m=()=>{var a;(a=e.onMenuItemClick)==null||a.call(e,e.menu)};return()=>{var d,l;const a=e.menu;return(a==null?void 0:a.children)&&o.size(a.children)>0?r.createVNode(u.ElMenu.SubMenu,r.mergeProps({index:a==null?void 0:a.value},(d=e.convertSubMenuProps)==null?void 0:d.call(e,a)),{default:()=>[o.map(a.children,n=>r.createVNode(w,r.mergeProps({menu:n},o.pick(e,q)),t))],title:()=>{var n;return((n=t.title)==null?void 0:n.call(t,a))||(a==null?void 0:a.label)}}):r.createVNode(u.ElMenu.MenuItem,r.mergeProps({index:a==null?void 0:a.value},(l=e.convertMenuItemProps)==null?void 0:l.call(e,a),{onClick:m}),{title:()=>{var n;return((n=t.title)==null?void 0:n.call(t,a))||(a==null?void 0:a.label)}})}}}),z=()=>({activeKey:{type:String},options:{type:Array},fieldNames:{type:Object,default:{children:"children",value:"value",label:"label"}},...V}),ee=r.defineComponent({props:{...o.omit(u.ElMenu.props,"defaultActive"),...z()},setup:(e,{slots:t})=>{const m=r.ref(e.activeKey);g.useWatch(()=>{e.activeKey!==m.value&&(m.value=e.activeKey)},()=>e.activeKey);const a=r.computed(()=>{var l;return g.convertTreeData(e.options,n=>{var p,y;const i=((p=e.fieldNames)==null?void 0:p.value)||"value",c=((y=e.fieldNames)==null?void 0:y.label)||"label";return{...o.omit(n,i,c),value:o.get(n,i),label:o.get(n,c)}},{children:((l=e.fieldNames)==null?void 0:l.children)||"children",childrenName:"children"})}),d=o.keys(z());return()=>{let l;return r.createVNode(u.ElMenu,r.mergeProps({defaultActive:m.value},o.omit(e,d)),Y(l=o.map(a.value,n=>r.createVNode(w,r.mergeProps({menu:n},o.pick(e,q)),t)))?l:{default:()=>[l]})}}}),U=()=>({modelValue:{type:Array,default:void 0},maxSize:{type:Number},convertResponseData:{type:Function},convertItemData:{type:Function,default:e=>({...e,status:e.status||"success"})},onErrorMsg:Function,onStart:Function,beforeUpload:{type:Function}}),W=["abort","submit","clearFiles","handleStart","handleRemove"],G=r.defineComponent({props:{...o.omit(u.ElUpload.props,"fileList"),...U()},setup:(e,{slots:t,expose:m,emit:a})=>{const d=r.ref();m(f.createExposeObj(d,W));const{formItem:l}=u.useFormItem(),n=()=>o.isArray(e.modelValue)?o.map(e.modelValue,b=>{var v;return((v=e.convertItemData)==null?void 0:v.call(e,b))||b}):[],i=r.ref(n());let c=!1;const p=()=>{var v;c=!0;const b=o.filter(i.value,P=>P.status==="success");a("update:modelValue",o.map(b,P=>{var C;return((C=e.convertResponseData)==null?void 0:C.call(e,P))||P})),(v=l==null?void 0:l.validate)==null||v.call(l,"change")};g.useWatch(()=>{c||(i.value=n(),c=!1)},()=>e.modelValue);const y=b=>{var v,P,C,h;if(e.beforeUpload)return e.beforeUpload(b);if(e.accept&&!g.isValidFileType(e.accept,b.name))return(v=e.onErrorMsg)==null||v.call(e,"FileTypeError",`\u8BF7\u4E0A\u4F20\u6B63\u786E\u683C\u5F0F\uFF08${e.accept.replace(/,/g,"\uFF0C")}\uFF09\u7684\u6587\u4EF6`),!1;if(o.isNumber(b.size)){if(b.size<=0)return(P=e.onErrorMsg)==null||P.call(e,"FileSizeError-Zero","\u4E0A\u4F20\u6587\u4EF6\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A"),!1;if(o.isNumber(e.maxSize)&&b.size>e.maxSize)return(C=e.onErrorMsg)==null||C.call(e,"FileSizeError-MaxSize",`\u8BF7\u4E0A\u4F20\u5C0F\u4E8E${g.convertFileSize(e.maxSize)}\u7684\u6587\u4EF6`),!1}return(h=e.onStart)==null||h.call(e,b),!0},S=r.computed(()=>o.isNumber(e.limit)?e.limit>o.size(i.value):!0),k=o.keys(U());return()=>{var b,v;return r.createVNode("div",{class:`pro-uploader ${S.value?"":"pro-uploader-limit"}`},[(b=t.start)==null?void 0:b.call(t),r.createVNode(u.ElUpload,r.mergeProps({ref:d,fileList:i.value,"onUpdate:fileList":P=>i.value=P},o.omit(e,"fileList","onSuccess","onRemove","beforeUpload",...k),{beforeUpload:y,onSuccess:(P,C,h)=>{var F;(F=e.onSuccess)==null||F.call(e,P,C,h),p()},onRemove:(P,C)=>{var h;i.value=o.filter(i.value,F=>!(P.uid===F.uid&&P.name===F.name)),(h=e.onRemove)==null||h.call(e,P,C),p()}}),{default:()=>{var P;return[S.value&&((P=t.default)==null?void 0:P.call(t))]},...o.omit(t,"default")}),(v=t.end)==null?void 0:v.call(t)])}}}),te=s({InputComp:u.ElInput,valueType:"text",name:"PFromText"}),re=s({InputComp:u.ElInputNumber,valueType:"digit",name:"PFormNumber"}),ae=s({InputComp:u.ElDatePicker,valueType:"date",name:"PFormDate"}),oe=s({InputComp:u.ElTimePicker,valueType:"time",name:"PFormTime"}),ne=s({InputComp:O,valueType:"select",name:"PFormSelect"}),le=s({InputComp:u.ElTreeSelect,valueType:"treeSelect",name:"PFormTreeSelect"}),ue=s({InputComp:K,valueType:"checkbox",name:"PFromCheckbox"}),ce=s({InputComp:j,valueType:"radio",name:"PFromRadio"}),de=s({InputComp:u.ElSwitch,valueType:"switch",name:"PFromSwitch"}),ie=s({InputComp:u.ElCascader,valueType:"cascader",name:"PFormCascader"}),x=r.defineComponent({props:{...o.omit(u.ElTableColumn.props,"label","prop"),title:{type:String},dataIndex:{type:String},children:{type:Array},customRender:{type:Function}},setup:(e,{slots:t})=>{const m=({row:l,column:n,$index:i})=>{var v;const c=l,p=i,y={...n,title:n.label,dataIndex:n.property},S=o.get(l,y.dataIndex),k={value:S,text:S,record:c,column:y,index:p},b=(v=t.bodyCell)==null?void 0:v.call(t,k);return b||(e.customRender?e.customRender(k):S)},d={header:({column:l,$index:n})=>{var S;const i=n,c=l.label,p={...l,title:c,dataIndex:l.property};return((S=t.headerCell)==null?void 0:S.call(t,{title:c,column:p,index:i}))||c}};return(!e.children||o.size(e.children)<=0)&&(d.default=m),()=>r.createVNode(u.ElTableColumn,r.mergeProps(o.omit(e,"title","dataIndex","prop","customRender","children"),{prop:e.dataIndex,label:e.title}),{default:()=>[o.size(e.children)>0&&o.map(e.children,l=>r.createVNode(x,r.mergeProps({key:l.dataIndex},l),t))],...d})}}),_=["clearSelection","getSelectionRows","toggleRowSelection","toggleAllSelection","toggleRowExpansion","setCurrentRow","clearSort","clearFilter","doLayout","sort","scrollTo","setScrollTop","setScrollLeft"],$=r.defineComponent({props:{...u.ElTable.props,columns:{type:Array},dataSource:{type:Array},loading:{type:Boolean}},setup:(e,{slots:t,expose:m})=>{const a=r.ref(),d=T("table");return m(f.createExpose(_,a)),()=>r.createVNode(u.ElTable,r.mergeProps({ref:a,id:d},o.omit(e,"columns","dataSource","loading"),{data:e.dataSource||e.data}),{default:()=>{var l,n;return[(l=t.start)==null?void 0:l.call(t),o.map(e.columns,i=>r.createVNode(x,r.mergeProps({key:i.dataIndex},i),t)),(n=t.default)==null?void 0:n.call(t),e.loading&&r.createVNode(D,{target:d,loading:!0},null)]},...o.pick(t,"append","empty")})}});f.ProForm.props={...u.ElForm.props,...f.ProForm.props,formMethods:{type:Array,default:E}};f.ProSearchForm.props={...f.ProForm.props,...f.ProSearchForm.props,inline:{type:Boolean,default:!0}};f.ProFormList.props={...u.ElFormItem.props,...f.ProFormList.props};f.ProTable.props={...$.props,...f.ProTable.props};f.ProDesc.props={...u.ElDescriptions.props,...f.ProDesc.props};f.ProCurdDesc.props={...f.ProDesc.props,...f.ProCurdDesc.props};f.ProCurdForm.props={...f.ProForm.props,...f.ProCurdForm.props};f.ProCurdModal.props={...L.props,...f.ProCurdModal.props};f.ProUploaderText.props={...G.props,...f.ProUploaderText.props,modelValue:String};exports.FormMethods=E;exports.ProCheckbox=K;exports.ProForm=Z;exports.ProFormCascader=ie;exports.ProFormCheckbox=ue;exports.ProFormDatePicker=ae;exports.ProFormItem=A;exports.ProFormRadio=ce;exports.ProFormSelect=ne;exports.ProFormSwitch=de;exports.ProFormText=te;exports.ProFormTextNumber=re;exports.ProFormTimePicker=oe;exports.ProFormTreeSelect=le;exports.ProLoading=D;exports.ProMenus=ee;exports.ProModal=L;exports.ProPagination=J;exports.ProPopover=Q;exports.ProRadio=j;exports.ProSelect=O;exports.ProTable=$;exports.ProTableColumn=x;exports.ProTabs=X;exports.ProUploader=G;exports.TableMethods=_;exports.UploadMethods=W;exports.createFormItemComponent=s;exports.createLoadingId=T;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-start/element-pro",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.13",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "zx <zxpstudy@163.com>",
|
|
6
6
|
"homepage": "https://github.com/zxeryu/vue-start#readme",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"rxjs": ">=7.x",
|
|
33
33
|
"vue": ">= 3.x"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "64fed5fe1cb2723207cd4596e6adc968e43e277a"
|
|
36
36
|
}
|