@funcho/ui 1.1.14 → 1.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/business/DataTable/DataTable.vue.js +5 -0
- package/dist/cjs/business/EditFormCard/EditFormCard.vue.js +238 -0
- package/dist/cjs/business/EditFormCard/EditFormCard.vue3.js +10 -0
- package/dist/cjs/business/EditFormCard/index.js +12 -0
- package/dist/cjs/business/FormDialog/FormDialog.vue.js +129 -0
- package/dist/cjs/business/FormDialog/FormDialog.vue3.js +10 -0
- package/dist/cjs/business/FormDialog/index.js +12 -0
- package/dist/cjs/business/ProForm/ProForm.vue.js +44 -8
- package/dist/cjs/business/index.js +4 -0
- package/dist/cjs/components/Button/DangerButton.vue.js +2 -2
- package/dist/cjs/index.js +10 -6
- package/dist/cjs/packages/ui/package.json.js +1 -1
- package/dist/esm/business/DataTable/DataTable.vue.mjs +5 -0
- package/dist/esm/business/EditFormCard/EditFormCard.vue.mjs +234 -0
- package/dist/esm/business/EditFormCard/EditFormCard.vue3.mjs +6 -0
- package/dist/esm/business/EditFormCard/index.mjs +7 -0
- package/dist/esm/business/FormDialog/FormDialog.vue.mjs +125 -0
- package/dist/esm/business/FormDialog/FormDialog.vue3.mjs +6 -0
- package/dist/esm/business/FormDialog/index.mjs +7 -0
- package/dist/esm/business/ProForm/ProForm.vue.mjs +45 -9
- package/dist/esm/business/index.mjs +2 -0
- package/dist/esm/components/Button/DangerButton.vue.mjs +2 -2
- package/dist/esm/index.mjs +2 -0
- package/dist/esm/packages/ui/package.json.mjs +1 -1
- package/dist/style.css +14 -3
- package/dist/types/business/DataTable/DataTable.vue.d.ts +438 -1208
- package/dist/types/business/DataTable/index.d.ts +438 -1208
- package/dist/types/business/EditFormCard/EditFormCard.types.d.ts +1 -0
- package/dist/types/business/EditFormCard/EditFormCard.vue.d.ts +1169 -0
- package/dist/types/business/EditFormCard/index.d.ts +1569 -0
- package/dist/types/business/FormDialog/FormDialog.types.d.ts +1 -0
- package/dist/types/business/FormDialog/FormDialog.vue.d.ts +1006 -0
- package/dist/types/business/FormDialog/index.d.ts +1077 -0
- package/dist/types/business/ProForm/ProForm.types.d.ts +9 -0
- package/dist/types/business/ProForm/ProForm.vue.d.ts +37 -422
- package/dist/types/business/ProForm/index.d.ts +236 -1391
- package/dist/types/business/index.d.ts +2 -0
- package/dist/types/components/DatePicker/BzDatePicker.vue.d.ts +9 -1
- package/dist/types/components/DatePicker/DatePicker.vue.d.ts +4 -0
- package/dist/types/components/DatePicker/DatePickerRanger.vue.d.ts +27 -3
- package/dist/types/components/DatePicker/DateTimePicker.vue.d.ts +26 -2
- package/dist/types/components/DatePicker/DateTimePickerRanger.vue.d.ts +27 -3
- package/dist/types/components/DatePicker/index.d.ts +126 -10
- package/dist/types/components/Menu/Menu.vue.d.ts +4 -0
- package/dist/types/components/Menu/index.d.ts +12 -0
- package/dist/types/components/Table/Table.vue.d.ts +6 -6
- package/dist/types/components/Text/Text.vue.d.ts +1 -81
- package/dist/types/components/Text/index.d.ts +3 -243
- package/dist/types/components/TimePicker/TimePicker.vue.d.ts +4 -0
- package/dist/types/components/TimePicker/index.d.ts +12 -0
- package/dist/types/components/TreeSelect/TreeSelect.vue.d.ts +2 -500
- package/dist/types/components/TreeSelect/index.d.ts +27 -1521
- package/package.json +4 -2
|
@@ -179,6 +179,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
179
179
|
const { type, attrs = {} } = field;
|
|
180
180
|
if (!type || type === "" || type.includes("Input")) {
|
|
181
181
|
attrs.onClear = handleSearchClick;
|
|
182
|
+
attrs.onKeyup = (event) => {
|
|
183
|
+
if (event.key === "Enter") {
|
|
184
|
+
handleSearchClick();
|
|
185
|
+
}
|
|
186
|
+
};
|
|
182
187
|
}
|
|
183
188
|
if (type?.includes("Select") || type?.includes("Cascader") || type?.includes("DatePicker")) {
|
|
184
189
|
attrs.onClear = handleSearchClick;
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const vue = require('vue');
|
|
6
|
+
const index$1 = require('../../components/Button/index.js');
|
|
7
|
+
require('../../components/Dialog/index.js');
|
|
8
|
+
require('../../components/ConfigProvider/index.js');
|
|
9
|
+
require('../../components/Input/index.js');
|
|
10
|
+
require('../../components/Tree/index.js');
|
|
11
|
+
require('../../components/Tabs/index.js');
|
|
12
|
+
require('../../components/TabPane/index.js');
|
|
13
|
+
require('../../components/Steps/index.js');
|
|
14
|
+
require('../../components/Step/index.js');
|
|
15
|
+
require('../../components/InputNumber/index.js');
|
|
16
|
+
require('../../components/Select/index.js');
|
|
17
|
+
require('../../components/Option/index.js');
|
|
18
|
+
require('../../components/DatePicker/index.js');
|
|
19
|
+
require('../../components/DatePickerPanel/index.js');
|
|
20
|
+
require('../../components/Tooltip/index.js');
|
|
21
|
+
require('../../components/Icon/index.js');
|
|
22
|
+
const index$2 = require('../../components/Notification/index.js');
|
|
23
|
+
require('../../components/Link/index.js');
|
|
24
|
+
require('../../components/Text/index.js');
|
|
25
|
+
require('../../components/Scrollbar/index.js');
|
|
26
|
+
require('../../components/Splitter/index.js');
|
|
27
|
+
require('../../components/SplitterPanel/index.js');
|
|
28
|
+
require('../../components/Autocomplete/index.js');
|
|
29
|
+
require('../../components/Cascader/index.js');
|
|
30
|
+
require('../../components/CascaderPanel/index.js');
|
|
31
|
+
require('../../components/Checkbox/index.js');
|
|
32
|
+
require('../../components/CheckboxGroup/index.js');
|
|
33
|
+
require('../../components/CheckboxButton/index.js');
|
|
34
|
+
require('../../components/Form/index.js');
|
|
35
|
+
require('../../components/FormItem/index.js');
|
|
36
|
+
require('../../components/InputTag/index.js');
|
|
37
|
+
require('../../components/Radio/index.js');
|
|
38
|
+
require('../../components/RadioGroup/index.js');
|
|
39
|
+
require('../../components/SelectV2/index.js');
|
|
40
|
+
require('../../components/Switch/index.js');
|
|
41
|
+
require('../../components/TimePicker/index.js');
|
|
42
|
+
require('../../components/TimeSelect/index.js');
|
|
43
|
+
require('../../components/TreeSelect/index.js');
|
|
44
|
+
require('../../components/Upload/index.js');
|
|
45
|
+
require('../../components/Avatar/index.js');
|
|
46
|
+
require('../../components/AvatarGroup/index.js');
|
|
47
|
+
require('../../components/Badge/index.js');
|
|
48
|
+
const index = require('../../components/Card/index.js');
|
|
49
|
+
require('../../components/Descriptions/index.js');
|
|
50
|
+
require('../../components/DescriptionsItem/index.js');
|
|
51
|
+
require('../../components/Empty/index.js');
|
|
52
|
+
require('../../components/Image/index.js');
|
|
53
|
+
require('../../components/ImageViewer/index.js');
|
|
54
|
+
require('../../components/Pagination/index.js');
|
|
55
|
+
require('../../components/Table/index.js');
|
|
56
|
+
require('../../components/TableColumn/index.js');
|
|
57
|
+
require('../../components/TableV2/index.js');
|
|
58
|
+
require('../../components/Tag/index.js');
|
|
59
|
+
require('../../components/Breadcrumb/index.js');
|
|
60
|
+
require('../../components/BreadcrumbItem/index.js');
|
|
61
|
+
require('../../components/Drawer/index.js');
|
|
62
|
+
require('../../components/Popconfirm/index.js');
|
|
63
|
+
require('../../components/IconComponent/index.js');
|
|
64
|
+
require('../../components/Popover/index.js');
|
|
65
|
+
require('../../components/Result/index.js');
|
|
66
|
+
require('../../components/Progress/index.js');
|
|
67
|
+
require('../../components/Divider/index.js');
|
|
68
|
+
require('../../components/Dropdown/index.js');
|
|
69
|
+
require('../../components/DropdownMenu/index.js');
|
|
70
|
+
require('../../components/DropdownItem/index.js');
|
|
71
|
+
require('../../components/Menu/index.js');
|
|
72
|
+
require('../../components/SubMenu/index.js');
|
|
73
|
+
require('../../components/MenuItem/index.js');
|
|
74
|
+
require('../../components/RadioButton/index.js');
|
|
75
|
+
require('../../components/MenuItemGroup/index.js');
|
|
76
|
+
require('../../components/Collapse/index.js');
|
|
77
|
+
require('../../components/CollapseItem/index.js');
|
|
78
|
+
require('../../components/ContextMenu/index.js');
|
|
79
|
+
require('../../components/CodeEditor/index.js');
|
|
80
|
+
require('../../components/RichEditor/index.js');
|
|
81
|
+
const ProForm_vue_vue_type_script_setup_true_lang = require('../ProForm/ProForm.vue.js');
|
|
82
|
+
;/* empty css */
|
|
83
|
+
const cloneDeep = require('../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/cloneDeep.js');
|
|
84
|
+
|
|
85
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
86
|
+
...{
|
|
87
|
+
name: "FcProEditFormCard",
|
|
88
|
+
inheritAttrs: false
|
|
89
|
+
},
|
|
90
|
+
__name: "EditFormCard",
|
|
91
|
+
props: {
|
|
92
|
+
title: { default: "" },
|
|
93
|
+
showEditButton: { type: Boolean, default: true },
|
|
94
|
+
requestApi: { type: Function, default: void 0 },
|
|
95
|
+
submitApi: { type: Function, default: void 0 },
|
|
96
|
+
inline: { type: Boolean, default: true },
|
|
97
|
+
columns: {},
|
|
98
|
+
labelPosition: { default: "top" },
|
|
99
|
+
labelWidth: {},
|
|
100
|
+
fields: { default: () => [] },
|
|
101
|
+
rules: { default: () => ({}) }
|
|
102
|
+
},
|
|
103
|
+
emits: ["submit", "loaded"],
|
|
104
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
105
|
+
const isDisabled = vue.ref(true);
|
|
106
|
+
const formRef = vue.ref();
|
|
107
|
+
const props = __props;
|
|
108
|
+
let snapshot = {};
|
|
109
|
+
const loading = vue.ref(false);
|
|
110
|
+
const submitting = vue.ref(false);
|
|
111
|
+
const initData = async () => {
|
|
112
|
+
if (!props.requestApi) return;
|
|
113
|
+
try {
|
|
114
|
+
loading.value = true;
|
|
115
|
+
const res = await props.requestApi();
|
|
116
|
+
const data = res.data || res || {};
|
|
117
|
+
emits("loaded", data);
|
|
118
|
+
if (formRef.value) {
|
|
119
|
+
formRef.value.setValues(data);
|
|
120
|
+
}
|
|
121
|
+
} catch (err) {
|
|
122
|
+
console.error("获取详情失败", err);
|
|
123
|
+
} finally {
|
|
124
|
+
loading.value = false;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
vue.onMounted(initData);
|
|
128
|
+
const handleEditClick = () => {
|
|
129
|
+
isDisabled.value = false;
|
|
130
|
+
const model = formRef.value?.model;
|
|
131
|
+
snapshot = cloneDeep.default(model);
|
|
132
|
+
};
|
|
133
|
+
const handleCancelClick = () => {
|
|
134
|
+
formRef.value?.clearValidate();
|
|
135
|
+
isDisabled.value = true;
|
|
136
|
+
formRef.value?.setValues(snapshot);
|
|
137
|
+
};
|
|
138
|
+
const emits = __emit;
|
|
139
|
+
const handleSaveClick = async () => {
|
|
140
|
+
if (!formRef.value) return;
|
|
141
|
+
try {
|
|
142
|
+
await formRef.value.validate();
|
|
143
|
+
const model = formRef.value?.model;
|
|
144
|
+
if (!props.submitApi) {
|
|
145
|
+
isDisabled.value = true;
|
|
146
|
+
emits("submit", model);
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
submitting.value = true;
|
|
150
|
+
const res = await props.submitApi(model);
|
|
151
|
+
isDisabled.value = true;
|
|
152
|
+
emits("submit", model, res);
|
|
153
|
+
index$2.FcNotification.success({
|
|
154
|
+
message: "修改成功!"
|
|
155
|
+
});
|
|
156
|
+
initData();
|
|
157
|
+
} catch (err) {
|
|
158
|
+
console.error("提交失败", err);
|
|
159
|
+
} finally {
|
|
160
|
+
submitting.value = false;
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
__expose(
|
|
164
|
+
new Proxy(
|
|
165
|
+
{},
|
|
166
|
+
{
|
|
167
|
+
get(_, key) {
|
|
168
|
+
if (key === "refresh") {
|
|
169
|
+
return initData;
|
|
170
|
+
}
|
|
171
|
+
return formRef.value?.[key];
|
|
172
|
+
},
|
|
173
|
+
has(_, key) {
|
|
174
|
+
if (key === "refresh") {
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
return key in formRef.value;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
);
|
|
182
|
+
return (_ctx, _cache) => {
|
|
183
|
+
const _directive_loading = vue.resolveDirective("loading");
|
|
184
|
+
return vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(index.FcCard), { title: __props.title }, vue.createSlots({
|
|
185
|
+
default: vue.withCtx(() => [
|
|
186
|
+
vue.createVNode(ProForm_vue_vue_type_script_setup_true_lang.default, {
|
|
187
|
+
ref_key: "formRef",
|
|
188
|
+
ref: formRef,
|
|
189
|
+
inline: __props.inline,
|
|
190
|
+
"label-position": __props.labelPosition,
|
|
191
|
+
fields: __props.fields,
|
|
192
|
+
disabled: isDisabled.value,
|
|
193
|
+
rules: __props.rules
|
|
194
|
+
}, null, 8, ["inline", "label-position", "fields", "disabled", "rules"])
|
|
195
|
+
]),
|
|
196
|
+
_: 2
|
|
197
|
+
}, [
|
|
198
|
+
__props.showEditButton ? {
|
|
199
|
+
name: "tools",
|
|
200
|
+
fn: vue.withCtx(() => [
|
|
201
|
+
isDisabled.value ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.FcButton), {
|
|
202
|
+
key: 0,
|
|
203
|
+
type: "primary",
|
|
204
|
+
onClick: handleEditClick
|
|
205
|
+
}, {
|
|
206
|
+
default: vue.withCtx(() => [..._cache[0] || (_cache[0] = [
|
|
207
|
+
vue.createTextVNode("编辑", -1)
|
|
208
|
+
])]),
|
|
209
|
+
_: 1
|
|
210
|
+
})) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
211
|
+
vue.createVNode(vue.unref(index$1.FcButton), { onClick: handleCancelClick }, {
|
|
212
|
+
default: vue.withCtx(() => [..._cache[1] || (_cache[1] = [
|
|
213
|
+
vue.createTextVNode("取消", -1)
|
|
214
|
+
])]),
|
|
215
|
+
_: 1
|
|
216
|
+
}),
|
|
217
|
+
vue.createVNode(vue.unref(index$1.FcButton), {
|
|
218
|
+
type: "success",
|
|
219
|
+
loading: submitting.value,
|
|
220
|
+
onClick: handleSaveClick
|
|
221
|
+
}, {
|
|
222
|
+
default: vue.withCtx(() => [..._cache[2] || (_cache[2] = [
|
|
223
|
+
vue.createTextVNode("保存", -1)
|
|
224
|
+
])]),
|
|
225
|
+
_: 1
|
|
226
|
+
}, 8, ["loading"])
|
|
227
|
+
], 64))
|
|
228
|
+
]),
|
|
229
|
+
key: "0"
|
|
230
|
+
} : void 0
|
|
231
|
+
]), 1032, ["title"])), [
|
|
232
|
+
[_directive_loading, loading.value]
|
|
233
|
+
]);
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const EditFormCard_vue_vue_type_script_setup_true_lang = require('./EditFormCard.vue.js');
|
|
6
|
+
;/* empty css */
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.default = EditFormCard_vue_vue_type_script_setup_true_lang.default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const EditFormCard_vue_vue_type_script_setup_true_lang = require('./EditFormCard.vue.js');
|
|
6
|
+
;/* empty css */
|
|
7
|
+
const withInstall = require('../../_utils/with-install.js');
|
|
8
|
+
|
|
9
|
+
const FcProEditFormCard = withInstall.withInstall(EditFormCard_vue_vue_type_script_setup_true_lang.default);
|
|
10
|
+
|
|
11
|
+
exports.FcProEditFormCard = FcProEditFormCard;
|
|
12
|
+
exports.default = FcProEditFormCard;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const vue = require('vue');
|
|
6
|
+
const Button_vue_vue_type_script_setup_true_lang = require('../../components/Button/Button.vue.js');
|
|
7
|
+
;/* empty css */
|
|
8
|
+
const Dialog_vue_vue_type_script_setup_true_lang = require('../../components/Dialog/Dialog.vue.js');
|
|
9
|
+
;/* empty css */
|
|
10
|
+
const ProForm_vue_vue_type_script_setup_true_lang = require('../ProForm/ProForm.vue.js');
|
|
11
|
+
;/* empty css */
|
|
12
|
+
const index = require('../../components/Notification/index.js');
|
|
13
|
+
const useNamespace = require('../../hooks/use-namespace.js');
|
|
14
|
+
|
|
15
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
16
|
+
...{
|
|
17
|
+
name: "FcProFormDialog",
|
|
18
|
+
inheritAttrs: false
|
|
19
|
+
},
|
|
20
|
+
__name: "FormDialog",
|
|
21
|
+
props: {
|
|
22
|
+
title: { default: "新增" },
|
|
23
|
+
width: { default: 400 },
|
|
24
|
+
cancelButtonText: { default: "取消" },
|
|
25
|
+
confirmButtonText: { default: "确定" },
|
|
26
|
+
showCancelButton: { type: Boolean, default: true },
|
|
27
|
+
submitApi: { type: Function, default: void 0 },
|
|
28
|
+
inline: { type: Boolean, default: false },
|
|
29
|
+
columns: {},
|
|
30
|
+
labelPosition: { default: "left" },
|
|
31
|
+
labelWidth: { default: "5em" },
|
|
32
|
+
fields: { default: () => [] },
|
|
33
|
+
rules: { default: () => ({}) }
|
|
34
|
+
},
|
|
35
|
+
emits: ["submit", "cancel"],
|
|
36
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
37
|
+
const ns = useNamespace.useNamespace("form-dialog");
|
|
38
|
+
const formRef = vue.ref();
|
|
39
|
+
const props = __props;
|
|
40
|
+
const visible = vue.ref(false);
|
|
41
|
+
const emits = __emit;
|
|
42
|
+
const submitting = vue.ref(false);
|
|
43
|
+
const handleConfirmClick = async () => {
|
|
44
|
+
if (!formRef.value) return;
|
|
45
|
+
try {
|
|
46
|
+
await formRef.value.validate();
|
|
47
|
+
const model = formRef.value?.model;
|
|
48
|
+
if (!props.submitApi) {
|
|
49
|
+
emits("submit", model);
|
|
50
|
+
visible.value = false;
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
submitting.value = true;
|
|
54
|
+
const res = await props.submitApi(model);
|
|
55
|
+
emits("submit", model, res);
|
|
56
|
+
index.FcNotification.success({
|
|
57
|
+
message: "提交成功!"
|
|
58
|
+
});
|
|
59
|
+
visible.value = false;
|
|
60
|
+
} catch (err) {
|
|
61
|
+
console.error("提交失败", err);
|
|
62
|
+
} finally {
|
|
63
|
+
submitting.value = false;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const open = (data) => {
|
|
67
|
+
visible.value = true;
|
|
68
|
+
vue.nextTick(() => {
|
|
69
|
+
formRef.value?.setValues(data || {});
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
const handleCancelClick = () => {
|
|
73
|
+
visible.value = false;
|
|
74
|
+
emits("cancel");
|
|
75
|
+
};
|
|
76
|
+
const close = () => {
|
|
77
|
+
visible.value = false;
|
|
78
|
+
};
|
|
79
|
+
__expose({
|
|
80
|
+
open,
|
|
81
|
+
close
|
|
82
|
+
});
|
|
83
|
+
return (_ctx, _cache) => {
|
|
84
|
+
return vue.openBlock(), vue.createBlock(Dialog_vue_vue_type_script_setup_true_lang.default, {
|
|
85
|
+
modelValue: visible.value,
|
|
86
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
|
|
87
|
+
title: __props.title,
|
|
88
|
+
width: __props.width,
|
|
89
|
+
"body-class": vue.unref(ns).e("body")
|
|
90
|
+
}, {
|
|
91
|
+
footer: vue.withCtx(() => [
|
|
92
|
+
__props.showCancelButton ? (vue.openBlock(), vue.createBlock(Button_vue_vue_type_script_setup_true_lang.default, {
|
|
93
|
+
key: 0,
|
|
94
|
+
onClick: handleCancelClick
|
|
95
|
+
}, {
|
|
96
|
+
default: vue.withCtx(() => [
|
|
97
|
+
vue.createTextVNode(vue.toDisplayString(__props.cancelButtonText), 1)
|
|
98
|
+
]),
|
|
99
|
+
_: 1
|
|
100
|
+
})) : vue.createCommentVNode("", true),
|
|
101
|
+
vue.createVNode(Button_vue_vue_type_script_setup_true_lang.default, {
|
|
102
|
+
type: "primary",
|
|
103
|
+
loading: submitting.value,
|
|
104
|
+
onClick: handleConfirmClick
|
|
105
|
+
}, {
|
|
106
|
+
default: vue.withCtx(() => [
|
|
107
|
+
vue.createTextVNode(vue.toDisplayString(__props.confirmButtonText), 1)
|
|
108
|
+
]),
|
|
109
|
+
_: 1
|
|
110
|
+
}, 8, ["loading"])
|
|
111
|
+
]),
|
|
112
|
+
default: vue.withCtx(() => [
|
|
113
|
+
vue.createVNode(ProForm_vue_vue_type_script_setup_true_lang.default, vue.mergeProps({
|
|
114
|
+
ref_key: "formRef",
|
|
115
|
+
ref: formRef,
|
|
116
|
+
inline: __props.inline,
|
|
117
|
+
"label-position": __props.labelPosition,
|
|
118
|
+
"label-width": __props.labelWidth,
|
|
119
|
+
fields: __props.fields,
|
|
120
|
+
rules: __props.rules
|
|
121
|
+
}, _ctx.$attrs), null, 16, ["inline", "label-position", "label-width", "fields", "rules"])
|
|
122
|
+
]),
|
|
123
|
+
_: 1
|
|
124
|
+
}, 8, ["modelValue", "title", "width", "body-class"]);
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const FormDialog_vue_vue_type_script_setup_true_lang = require('./FormDialog.vue.js');
|
|
6
|
+
;/* empty css */
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.default = FormDialog_vue_vue_type_script_setup_true_lang.default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const FormDialog_vue_vue_type_script_setup_true_lang = require('./FormDialog.vue.js');
|
|
6
|
+
;/* empty css */
|
|
7
|
+
const withInstall = require('../../_utils/with-install.js');
|
|
8
|
+
|
|
9
|
+
const FcProFormDialog = withInstall.withInstall(FormDialog_vue_vue_type_script_setup_true_lang.default);
|
|
10
|
+
|
|
11
|
+
exports.FcProFormDialog = FcProFormDialog;
|
|
12
|
+
exports.default = FcProFormDialog;
|
|
@@ -18,7 +18,7 @@ require('../../components/Select/index.js');
|
|
|
18
18
|
require('../../components/Option/index.js');
|
|
19
19
|
require('../../components/DatePicker/index.js');
|
|
20
20
|
require('../../components/DatePickerPanel/index.js');
|
|
21
|
-
require('../../components/Tooltip/index.js');
|
|
21
|
+
const index$2 = require('../../components/Tooltip/index.js');
|
|
22
22
|
require('../../components/Icon/index.js');
|
|
23
23
|
require('../../components/Notification/index.js');
|
|
24
24
|
require('../../components/Link/index.js');
|
|
@@ -61,7 +61,7 @@ require('../../components/Breadcrumb/index.js');
|
|
|
61
61
|
require('../../components/BreadcrumbItem/index.js');
|
|
62
62
|
require('../../components/Drawer/index.js');
|
|
63
63
|
require('../../components/Popconfirm/index.js');
|
|
64
|
-
require('../../components/IconComponent/index.js');
|
|
64
|
+
const index$3 = require('../../components/IconComponent/index.js');
|
|
65
65
|
require('../../components/Popover/index.js');
|
|
66
66
|
require('../../components/Result/index.js');
|
|
67
67
|
require('../../components/Progress/index.js');
|
|
@@ -80,6 +80,8 @@ require('../../components/ContextMenu/index.js');
|
|
|
80
80
|
require('../../components/CodeEditor/index.js');
|
|
81
81
|
require('../../components/RichEditor/index.js');
|
|
82
82
|
const componentsMap = require('./componentsMap.js');
|
|
83
|
+
const isPlainObject = require('../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isPlainObject.js');
|
|
84
|
+
const cloneDeep = require('../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/cloneDeep.js');
|
|
83
85
|
|
|
84
86
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
85
87
|
...{
|
|
@@ -88,14 +90,21 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
88
90
|
__name: "ProForm",
|
|
89
91
|
props: {
|
|
90
92
|
inline: { type: Boolean, default: false },
|
|
93
|
+
columns: { default: "auto-fill" },
|
|
91
94
|
labelPosition: { default: "top" },
|
|
92
|
-
|
|
95
|
+
labelWidth: { default: "" },
|
|
96
|
+
fields: { default: () => [] },
|
|
97
|
+
rules: { default: () => ({}) }
|
|
93
98
|
},
|
|
94
99
|
setup(__props, { expose: __expose }) {
|
|
95
100
|
const ns = useNamespace.useNamespace("pro-form");
|
|
96
101
|
const formModel = vue.ref({});
|
|
97
102
|
const setValues = (data) => {
|
|
98
|
-
|
|
103
|
+
if (isPlainObject.default(data)) {
|
|
104
|
+
formModel.value = cloneDeep.default(data || {});
|
|
105
|
+
} else {
|
|
106
|
+
console.warn("setValues 只能接受一个对象");
|
|
107
|
+
}
|
|
99
108
|
};
|
|
100
109
|
const getGridItemStyle = (item) => {
|
|
101
110
|
if (item.span === "full") {
|
|
@@ -151,7 +160,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
151
160
|
model: formModel.value,
|
|
152
161
|
class: { [vue.unref(ns).e("container")]: true, [vue.unref(ns).is("inline")]: __props.inline },
|
|
153
162
|
inline: __props.inline,
|
|
154
|
-
"label-position": __props.labelPosition
|
|
163
|
+
"label-position": __props.labelPosition,
|
|
164
|
+
"label-width": __props.labelWidth,
|
|
165
|
+
style: { "--grid-columns": __props.columns },
|
|
166
|
+
rules: __props.rules
|
|
155
167
|
}), {
|
|
156
168
|
default: vue.withCtx(() => [
|
|
157
169
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.fields, (item) => {
|
|
@@ -160,7 +172,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
160
172
|
label: item.label,
|
|
161
173
|
prop: item.prop,
|
|
162
174
|
style: vue.normalizeStyle(getGridItemStyle(item))
|
|
163
|
-
}, {
|
|
175
|
+
}, vue.createSlots({
|
|
164
176
|
default: vue.withCtx(() => [
|
|
165
177
|
item.render ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(item.render(formModel.value, item.prop, item.label)), vue.mergeProps({
|
|
166
178
|
key: 0,
|
|
@@ -183,11 +195,35 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
183
195
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder"]))
|
|
184
196
|
]),
|
|
185
197
|
_: 2
|
|
186
|
-
},
|
|
198
|
+
}, [
|
|
199
|
+
item.tooltip ? {
|
|
200
|
+
name: "label",
|
|
201
|
+
fn: vue.withCtx(() => [
|
|
202
|
+
vue.createElementVNode("div", {
|
|
203
|
+
class: vue.normalizeClass(vue.unref(ns).e("label-with-tooltip"))
|
|
204
|
+
}, [
|
|
205
|
+
vue.createElementVNode("span", null, vue.toDisplayString(item.label), 1),
|
|
206
|
+
vue.createVNode(vue.unref(index$2.FcTooltip), {
|
|
207
|
+
content: item.tooltip,
|
|
208
|
+
placement: "top"
|
|
209
|
+
}, {
|
|
210
|
+
default: vue.withCtx(() => [
|
|
211
|
+
vue.createVNode(vue.unref(index$3.FcIconComponent), {
|
|
212
|
+
name: "QuestionFilled",
|
|
213
|
+
size: 14
|
|
214
|
+
})
|
|
215
|
+
]),
|
|
216
|
+
_: 1
|
|
217
|
+
}, 8, ["content"])
|
|
218
|
+
], 2)
|
|
219
|
+
]),
|
|
220
|
+
key: "0"
|
|
221
|
+
} : void 0
|
|
222
|
+
]), 1032, ["label", "prop", "style"]);
|
|
187
223
|
}), 128))
|
|
188
224
|
]),
|
|
189
225
|
_: 1
|
|
190
|
-
}, 16, ["model", "class", "inline", "label-position"]);
|
|
226
|
+
}, 16, ["model", "class", "inline", "label-position", "label-width", "style", "rules"]);
|
|
191
227
|
};
|
|
192
228
|
}
|
|
193
229
|
});
|
|
@@ -7,6 +7,8 @@ const index$1 = require('./DataTable/index.js');
|
|
|
7
7
|
const index$2 = require('./ProForm/index.js');
|
|
8
8
|
const index$3 = require('./TreeCheckFilter/index.js');
|
|
9
9
|
const index$4 = require('./TreeTransfer/index.js');
|
|
10
|
+
const index$5 = require('./EditFormCard/index.js');
|
|
11
|
+
const index$6 = require('./FormDialog/index.js');
|
|
10
12
|
|
|
11
13
|
|
|
12
14
|
|
|
@@ -15,3 +17,5 @@ exports.FcProDataTable = index$1.FcProDataTable;
|
|
|
15
17
|
exports.FcProForm = index$2.FcProForm;
|
|
16
18
|
exports.FcProTreeCheckFilter = index$3.FcProTreeCheckFilter;
|
|
17
19
|
exports.FcProTreeTransfer = index$4.FcProTreeTransfer;
|
|
20
|
+
exports.FcProEditFormCard = index$5.FcProEditFormCard;
|
|
21
|
+
exports.FcProFormDialog = index$6.FcProFormDialog;
|
|
@@ -42,7 +42,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
42
42
|
vue.createVNode(Button_vue_vue_type_script_setup_true_lang.default, vue.mergeProps(_ctx.$attrs, {
|
|
43
43
|
ref: "elRef",
|
|
44
44
|
type: "danger",
|
|
45
|
-
link:
|
|
45
|
+
link: __props.link
|
|
46
46
|
}), vue.createSlots({ _: 2 }, [
|
|
47
47
|
vue.renderList(_ctx.$slots, (_, name) => {
|
|
48
48
|
return {
|
|
@@ -52,7 +52,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
52
52
|
])
|
|
53
53
|
};
|
|
54
54
|
})
|
|
55
|
-
]), 1040)
|
|
55
|
+
]), 1040, ["link"])
|
|
56
56
|
]),
|
|
57
57
|
_: 3
|
|
58
58
|
}, 8, ["title"])
|
package/dist/cjs/index.js
CHANGED
|
@@ -7,8 +7,8 @@ const directive = require('./node_modules/.pnpm/element-plus@2.13.5_patch_hash_4
|
|
|
7
7
|
const dayjs_min = require('./_virtual/dayjs.min.js');
|
|
8
8
|
;/* empty css */
|
|
9
9
|
const lovIdRequestProvide = require('./config/lovId-request-provide.js');
|
|
10
|
-
const index$
|
|
11
|
-
const index$
|
|
10
|
+
const index$1m = require('./components/index.js');
|
|
11
|
+
const index$1n = require('./business/index.js');
|
|
12
12
|
const version = require('./version.js');
|
|
13
13
|
const index$1 = require('./components/Button/index.js');
|
|
14
14
|
const index$2 = require('./components/Dialog/index.js');
|
|
@@ -93,12 +93,14 @@ const index$1g = require('./business/DataTable/index.js');
|
|
|
93
93
|
const index$1h = require('./business/ProForm/index.js');
|
|
94
94
|
const index$1i = require('./business/TreeCheckFilter/index.js');
|
|
95
95
|
const index$1j = require('./business/TreeTransfer/index.js');
|
|
96
|
+
const index$1k = require('./business/EditFormCard/index.js');
|
|
97
|
+
const index$1l = require('./business/FormDialog/index.js');
|
|
96
98
|
|
|
97
|
-
const components = Object.keys(index$
|
|
98
|
-
return index$
|
|
99
|
+
const components = Object.keys(index$1m).map((key) => {
|
|
100
|
+
return index$1m[key];
|
|
99
101
|
});
|
|
100
|
-
const proComponents = Object.keys(index$
|
|
101
|
-
return index$
|
|
102
|
+
const proComponents = Object.keys(index$1n).map((key) => {
|
|
103
|
+
return index$1n[key];
|
|
102
104
|
});
|
|
103
105
|
const installComponents = [...components, ...proComponents].filter((comp) => {
|
|
104
106
|
return typeof comp === "object" && comp.name && typeof comp.install === "function";
|
|
@@ -228,5 +230,7 @@ exports.FcProDataTable = index$1g.FcProDataTable;
|
|
|
228
230
|
exports.FcProForm = index$1h.FcProForm;
|
|
229
231
|
exports.FcProTreeCheckFilter = index$1i.FcProTreeCheckFilter;
|
|
230
232
|
exports.FcProTreeTransfer = index$1j.FcProTreeTransfer;
|
|
233
|
+
exports.FcProEditFormCard = index$1k.FcProEditFormCard;
|
|
234
|
+
exports.FcProFormDialog = index$1l.FcProFormDialog;
|
|
231
235
|
exports.default = index;
|
|
232
236
|
exports.install = install;
|
|
@@ -175,6 +175,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
175
175
|
const { type, attrs = {} } = field;
|
|
176
176
|
if (!type || type === "" || type.includes("Input")) {
|
|
177
177
|
attrs.onClear = handleSearchClick;
|
|
178
|
+
attrs.onKeyup = (event) => {
|
|
179
|
+
if (event.key === "Enter") {
|
|
180
|
+
handleSearchClick();
|
|
181
|
+
}
|
|
182
|
+
};
|
|
178
183
|
}
|
|
179
184
|
if (type?.includes("Select") || type?.includes("Cascader") || type?.includes("DatePicker")) {
|
|
180
185
|
attrs.onClear = handleSearchClick;
|