@funcho/ui 1.1.14 → 1.1.17
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/README.md +3 -0
- package/dist/cjs/business/DataTable/DataTable.vue.js +6 -0
- package/dist/cjs/business/EditFormCard/EditFormCard.vue.js +239 -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 +45 -8
- package/dist/cjs/business/SidebarMainLayout/SidebarMainLayout.vue.js +1 -0
- package/dist/cjs/business/TreeCheckFilter/TreeCheckFilter.vue.js +1 -0
- package/dist/cjs/business/TreeTransfer/TreeTransfer.vue.js +1 -0
- package/dist/cjs/business/index.js +4 -0
- package/dist/cjs/components/Button/DangerButton.vue.js +2 -2
- package/dist/cjs/components/Cascader/Cascader.vue.js +3 -1
- package/dist/cjs/components/CheckboxGroup/CheckboxGroup.vue.js +3 -1
- package/dist/cjs/components/Dropdown/Dropdown.vue.js +3 -1
- package/dist/cjs/components/LovText/LovText.vue.js +61 -0
- package/dist/cjs/components/LovText/LovText.vue3.js +10 -0
- package/dist/cjs/components/LovText/index.js +12 -0
- package/dist/cjs/components/Radio/Radio.vue.js +3 -1
- package/dist/cjs/components/Select/Select.vue.js +3 -1
- package/dist/cjs/components/index.js +2 -0
- package/dist/cjs/index.js +22 -16
- package/dist/cjs/packages/ui/package.json.js +1 -1
- package/dist/esm/business/DataTable/DataTable.vue.mjs +6 -0
- package/dist/esm/business/EditFormCard/EditFormCard.vue.mjs +235 -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 +46 -9
- package/dist/esm/business/SidebarMainLayout/SidebarMainLayout.vue.mjs +1 -0
- package/dist/esm/business/TreeCheckFilter/TreeCheckFilter.vue.mjs +1 -0
- package/dist/esm/business/TreeTransfer/TreeTransfer.vue.mjs +1 -0
- package/dist/esm/business/index.mjs +2 -0
- package/dist/esm/components/Button/DangerButton.vue.mjs +2 -2
- package/dist/esm/components/Cascader/Cascader.vue.mjs +3 -1
- package/dist/esm/components/CheckboxGroup/CheckboxGroup.vue.mjs +3 -1
- package/dist/esm/components/Dropdown/Dropdown.vue.mjs +3 -1
- package/dist/esm/components/LovText/LovText.vue.mjs +57 -0
- package/dist/esm/components/LovText/LovText.vue3.mjs +6 -0
- package/dist/esm/components/LovText/index.mjs +7 -0
- package/dist/esm/components/Radio/Radio.vue.mjs +3 -1
- package/dist/esm/components/Select/Select.vue.mjs +3 -1
- package/dist/esm/components/index.mjs +1 -0
- package/dist/esm/index.mjs +3 -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/Cascader/Cascader.vue.d.ts +2 -0
- package/dist/types/components/Cascader/CascaderCheck.vue.d.ts +16 -2
- package/dist/types/components/Cascader/CascaderEnd.vue.d.ts +16 -2
- package/dist/types/components/Cascader/CascaderMultiple.vue.d.ts +16 -2
- package/dist/types/components/Cascader/index.d.ts +60 -3
- package/dist/types/components/CheckboxGroup/CheckboxGroup.vue.d.ts +2 -0
- package/dist/types/components/CheckboxGroup/index.d.ts +6 -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/Dropdown/Dropdown.vue.d.ts +2 -0
- package/dist/types/components/Dropdown/index.d.ts +6 -0
- package/dist/types/components/LovText/LovText.types.d.ts +1 -0
- package/dist/types/components/LovText/LovText.vue.d.ts +13 -0
- package/dist/types/components/LovText/index.d.ts +45 -0
- 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/Radio/Radio.vue.d.ts +2 -0
- package/dist/types/components/Radio/index.d.ts +6 -0
- package/dist/types/components/Select/Select.vue.d.ts +2 -0
- package/dist/types/components/Select/SelectAllowCreateSelect.vue.d.ts +12 -2
- package/dist/types/components/Select/SelectMultiple.vue.d.ts +12 -2
- package/dist/types/components/Select/index.d.ts +18 -2
- 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/dist/types/components/index.d.ts +1 -0
- package/package.json +6 -4
|
@@ -21,6 +21,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
21
21
|
__name: "Dropdown",
|
|
22
22
|
props: /* @__PURE__ */ vue.mergeModels({
|
|
23
23
|
lovId: { default: "" },
|
|
24
|
+
isSql: { type: Boolean, default: false },
|
|
24
25
|
isUpdateLovOptions: { type: Boolean, default: false },
|
|
25
26
|
options: { default: () => [] },
|
|
26
27
|
maxHeight: { default: 320 },
|
|
@@ -60,7 +61,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
60
61
|
try {
|
|
61
62
|
const context = {
|
|
62
63
|
lovId: props.lovId,
|
|
63
|
-
isUpdateLovOptions: props.isUpdateLovOptions
|
|
64
|
+
isUpdateLovOptions: props.isUpdateLovOptions,
|
|
65
|
+
isSql: props.isSql
|
|
64
66
|
};
|
|
65
67
|
lovIdOptions.value = await config.requestHandler(context);
|
|
66
68
|
} catch (error) {
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const vue = require('vue');
|
|
6
|
+
const lovIdRequestProvide = require('../../config/lovId-request-provide.js');
|
|
7
|
+
|
|
8
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
9
|
+
...{
|
|
10
|
+
name: "FcLovText"
|
|
11
|
+
},
|
|
12
|
+
__name: "LovText",
|
|
13
|
+
props: {
|
|
14
|
+
lovId: { default: "" },
|
|
15
|
+
value: { default: null },
|
|
16
|
+
isSql: { type: Boolean, default: false },
|
|
17
|
+
isUpdateLovOptions: { type: Boolean, default: false }
|
|
18
|
+
},
|
|
19
|
+
setup(__props) {
|
|
20
|
+
const config = vue.inject(lovIdRequestProvide.FC_LOVID_REQUEST_CONFIG_KEY, {});
|
|
21
|
+
const props = __props;
|
|
22
|
+
const lovIdLoading = vue.ref(false);
|
|
23
|
+
const lovIdOptions = vue.ref([]);
|
|
24
|
+
const loadData = async () => {
|
|
25
|
+
if (!props.lovId || !config.requestHandler) return;
|
|
26
|
+
lovIdLoading.value = true;
|
|
27
|
+
try {
|
|
28
|
+
const context = {
|
|
29
|
+
lovId: props.lovId,
|
|
30
|
+
isUpdateLovOptions: props.isUpdateLovOptions,
|
|
31
|
+
isSql: props.isSql
|
|
32
|
+
};
|
|
33
|
+
lovIdOptions.value = await config.requestHandler(context);
|
|
34
|
+
} finally {
|
|
35
|
+
lovIdLoading.value = false;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
vue.watch(
|
|
39
|
+
() => props.lovId,
|
|
40
|
+
(newId) => {
|
|
41
|
+
lovIdOptions.value = [];
|
|
42
|
+
if (newId) {
|
|
43
|
+
loadData();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
vue.onMounted(() => {
|
|
48
|
+
if (props.lovId) loadData();
|
|
49
|
+
});
|
|
50
|
+
const displayText = vue.computed(() => {
|
|
51
|
+
if (!props.value) return "";
|
|
52
|
+
const matched = lovIdOptions.value.find((opt) => opt.value === props.value);
|
|
53
|
+
return matched ? matched.label : props.value;
|
|
54
|
+
});
|
|
55
|
+
return (_ctx, _cache) => {
|
|
56
|
+
return vue.openBlock(), vue.createElementBlock("span", null, vue.toDisplayString(displayText.value), 1);
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
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 LovText_vue_vue_type_script_setup_true_lang = require('./LovText.vue.js');
|
|
6
|
+
;/* empty css */
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.default = LovText_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 LovText_vue_vue_type_script_setup_true_lang = require('./LovText.vue.js');
|
|
6
|
+
;/* empty css */
|
|
7
|
+
const withInstall = require('../../_utils/with-install.js');
|
|
8
|
+
|
|
9
|
+
const FcLovText = withInstall.withInstall(LovText_vue_vue_type_script_setup_true_lang.default);
|
|
10
|
+
|
|
11
|
+
exports.FcLovText = FcLovText;
|
|
12
|
+
exports.default = FcLovText;
|
|
@@ -14,6 +14,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
14
14
|
__name: "Radio",
|
|
15
15
|
props: {
|
|
16
16
|
lovId: { default: "" },
|
|
17
|
+
isSql: { type: Boolean, default: false },
|
|
17
18
|
isUpdateLovOptions: { type: Boolean, default: false },
|
|
18
19
|
options: { default: () => [] }
|
|
19
20
|
},
|
|
@@ -29,7 +30,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
29
30
|
try {
|
|
30
31
|
const context = {
|
|
31
32
|
lovId: props.lovId,
|
|
32
|
-
isUpdateLovOptions: props.isUpdateLovOptions
|
|
33
|
+
isUpdateLovOptions: props.isUpdateLovOptions,
|
|
34
|
+
isSql: props.isSql
|
|
33
35
|
};
|
|
34
36
|
lovIdOptions.value = await config.requestHandler(context);
|
|
35
37
|
} catch (error) {
|
|
@@ -14,6 +14,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
14
14
|
__name: "Select",
|
|
15
15
|
props: {
|
|
16
16
|
lovId: { default: "" },
|
|
17
|
+
isSql: { type: Boolean, default: false },
|
|
17
18
|
loading: { type: Boolean, default: false },
|
|
18
19
|
isUpdateLovOptions: { type: Boolean, default: false },
|
|
19
20
|
options: { default: () => [] },
|
|
@@ -38,7 +39,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
38
39
|
try {
|
|
39
40
|
const context = {
|
|
40
41
|
lovId: props.lovId,
|
|
41
|
-
isUpdateLovOptions: props.isUpdateLovOptions
|
|
42
|
+
isUpdateLovOptions: props.isUpdateLovOptions,
|
|
43
|
+
isSql: props.isSql
|
|
42
44
|
};
|
|
43
45
|
lovIdOptions.value = await config.requestHandler(context);
|
|
44
46
|
} finally {
|
|
@@ -80,6 +80,7 @@ const index$1a = require('./CollapseItem/index.js');
|
|
|
80
80
|
const index$1b = require('./ContextMenu/index.js');
|
|
81
81
|
const index$1c = require('./CodeEditor/index.js');
|
|
82
82
|
const index$1d = require('./RichEditor/index.js');
|
|
83
|
+
const index$1e = require('./LovText/index.js');
|
|
83
84
|
const directive = require('../node_modules/.pnpm/element-plus@2.13.5_patch_hash_415fe9eaeb4c26121ef1304c7dfbfaa75441fcd0d7ca1a8beb1acd12_87ac520f28bb40f5a8b03aa48269c150/node_modules/element-plus/es/components/loading/src/directive.js');
|
|
84
85
|
const service = require('../node_modules/.pnpm/element-plus@2.13.5_patch_hash_415fe9eaeb4c26121ef1304c7dfbfaa75441fcd0d7ca1a8beb1acd12_87ac520f28bb40f5a8b03aa48269c150/node_modules/element-plus/es/components/loading/src/service.js');
|
|
85
86
|
|
|
@@ -190,6 +191,7 @@ exports.FcCodeEditor = index$1c.FcCodeEditor;
|
|
|
190
191
|
exports.FcCodeEditorInput = index$1c.FcCodeEditorInput;
|
|
191
192
|
exports.FcRichEditor = index$1d.FcRichEditor;
|
|
192
193
|
exports.FcRichEditorInput = index$1d.FcRichEditorInput;
|
|
194
|
+
exports.FcLovText = index$1e.FcLovText;
|
|
193
195
|
exports.FcLoadingDirective = directive.default;
|
|
194
196
|
exports.vLoading = directive.default;
|
|
195
197
|
exports.FcLoadingService = service.default;
|
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$1n = require('./components/index.js');
|
|
11
|
+
const index$1o = 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');
|
|
@@ -88,17 +88,20 @@ const index$1b = require('./components/CollapseItem/index.js');
|
|
|
88
88
|
const index$1c = require('./components/ContextMenu/index.js');
|
|
89
89
|
const index$1d = require('./components/CodeEditor/index.js');
|
|
90
90
|
const index$1e = require('./components/RichEditor/index.js');
|
|
91
|
-
const index$1f = require('./
|
|
92
|
-
const index$1g = require('./business/
|
|
93
|
-
const index$1h = require('./business/
|
|
94
|
-
const index$1i = require('./business/
|
|
95
|
-
const index$1j = require('./business/
|
|
91
|
+
const index$1f = require('./components/LovText/index.js');
|
|
92
|
+
const index$1g = require('./business/SidebarMainLayout/index.js');
|
|
93
|
+
const index$1h = require('./business/DataTable/index.js');
|
|
94
|
+
const index$1i = require('./business/ProForm/index.js');
|
|
95
|
+
const index$1j = require('./business/TreeCheckFilter/index.js');
|
|
96
|
+
const index$1k = require('./business/TreeTransfer/index.js');
|
|
97
|
+
const index$1l = require('./business/EditFormCard/index.js');
|
|
98
|
+
const index$1m = require('./business/FormDialog/index.js');
|
|
96
99
|
|
|
97
|
-
const components = Object.keys(index$
|
|
98
|
-
return index$
|
|
100
|
+
const components = Object.keys(index$1n).map((key) => {
|
|
101
|
+
return index$1n[key];
|
|
99
102
|
});
|
|
100
|
-
const proComponents = Object.keys(index$
|
|
101
|
-
return index$
|
|
103
|
+
const proComponents = Object.keys(index$1o).map((key) => {
|
|
104
|
+
return index$1o[key];
|
|
102
105
|
});
|
|
103
106
|
const installComponents = [...components, ...proComponents].filter((comp) => {
|
|
104
107
|
return typeof comp === "object" && comp.name && typeof comp.install === "function";
|
|
@@ -223,10 +226,13 @@ exports.FcCodeEditor = index$1d.FcCodeEditor;
|
|
|
223
226
|
exports.FcCodeEditorInput = index$1d.FcCodeEditorInput;
|
|
224
227
|
exports.FcRichEditor = index$1e.FcRichEditor;
|
|
225
228
|
exports.FcRichEditorInput = index$1e.FcRichEditorInput;
|
|
226
|
-
exports.
|
|
227
|
-
exports.
|
|
228
|
-
exports.
|
|
229
|
-
exports.
|
|
230
|
-
exports.
|
|
229
|
+
exports.FcLovText = index$1f.FcLovText;
|
|
230
|
+
exports.FcProSidebarMainLayout = index$1g.FcProSidebarMainLayout;
|
|
231
|
+
exports.FcProDataTable = index$1h.FcProDataTable;
|
|
232
|
+
exports.FcProForm = index$1i.FcProForm;
|
|
233
|
+
exports.FcProTreeCheckFilter = index$1j.FcProTreeCheckFilter;
|
|
234
|
+
exports.FcProTreeTransfer = index$1k.FcProTreeTransfer;
|
|
235
|
+
exports.FcProEditFormCard = index$1l.FcProEditFormCard;
|
|
236
|
+
exports.FcProFormDialog = index$1m.FcProFormDialog;
|
|
231
237
|
exports.default = index;
|
|
232
238
|
exports.install = install;
|
|
@@ -75,6 +75,7 @@ import '../../components/CollapseItem/index.mjs';
|
|
|
75
75
|
import '../../components/ContextMenu/index.mjs';
|
|
76
76
|
import '../../components/CodeEditor/index.mjs';
|
|
77
77
|
import '../../components/RichEditor/index.mjs';
|
|
78
|
+
import '../../components/LovText/index.mjs';
|
|
78
79
|
import _sfc_main$1 from '../ProForm/ProForm.vue.mjs';
|
|
79
80
|
/* empty css */
|
|
80
81
|
import { useElementSize } from '@vueuse/core';
|
|
@@ -175,6 +176,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
175
176
|
const { type, attrs = {} } = field;
|
|
176
177
|
if (!type || type === "" || type.includes("Input")) {
|
|
177
178
|
attrs.onClear = handleSearchClick;
|
|
179
|
+
attrs.onKeyup = (event) => {
|
|
180
|
+
if (event.key === "Enter") {
|
|
181
|
+
handleSearchClick();
|
|
182
|
+
}
|
|
183
|
+
};
|
|
178
184
|
}
|
|
179
185
|
if (type?.includes("Select") || type?.includes("Cascader") || type?.includes("DatePicker")) {
|
|
180
186
|
attrs.onClear = handleSearchClick;
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { defineComponent, ref, onMounted, resolveDirective, withDirectives, createBlock, openBlock, unref, createSlots, withCtx, createVNode, createElementBlock, createTextVNode, Fragment } from 'vue';
|
|
2
|
+
import { FcButton } from '../../components/Button/index.mjs';
|
|
3
|
+
import '../../components/Dialog/index.mjs';
|
|
4
|
+
import '../../components/ConfigProvider/index.mjs';
|
|
5
|
+
import '../../components/Input/index.mjs';
|
|
6
|
+
import '../../components/Tree/index.mjs';
|
|
7
|
+
import '../../components/Tabs/index.mjs';
|
|
8
|
+
import '../../components/TabPane/index.mjs';
|
|
9
|
+
import '../../components/Steps/index.mjs';
|
|
10
|
+
import '../../components/Step/index.mjs';
|
|
11
|
+
import '../../components/InputNumber/index.mjs';
|
|
12
|
+
import '../../components/Select/index.mjs';
|
|
13
|
+
import '../../components/Option/index.mjs';
|
|
14
|
+
import '../../components/DatePicker/index.mjs';
|
|
15
|
+
import '../../components/DatePickerPanel/index.mjs';
|
|
16
|
+
import '../../components/Tooltip/index.mjs';
|
|
17
|
+
import '../../components/Icon/index.mjs';
|
|
18
|
+
import { FcNotification } from '../../components/Notification/index.mjs';
|
|
19
|
+
import '../../components/Link/index.mjs';
|
|
20
|
+
import '../../components/Text/index.mjs';
|
|
21
|
+
import '../../components/Scrollbar/index.mjs';
|
|
22
|
+
import '../../components/Splitter/index.mjs';
|
|
23
|
+
import '../../components/SplitterPanel/index.mjs';
|
|
24
|
+
import '../../components/Autocomplete/index.mjs';
|
|
25
|
+
import '../../components/Cascader/index.mjs';
|
|
26
|
+
import '../../components/CascaderPanel/index.mjs';
|
|
27
|
+
import '../../components/Checkbox/index.mjs';
|
|
28
|
+
import '../../components/CheckboxGroup/index.mjs';
|
|
29
|
+
import '../../components/CheckboxButton/index.mjs';
|
|
30
|
+
import '../../components/Form/index.mjs';
|
|
31
|
+
import '../../components/FormItem/index.mjs';
|
|
32
|
+
import '../../components/InputTag/index.mjs';
|
|
33
|
+
import '../../components/Radio/index.mjs';
|
|
34
|
+
import '../../components/RadioGroup/index.mjs';
|
|
35
|
+
import '../../components/SelectV2/index.mjs';
|
|
36
|
+
import '../../components/Switch/index.mjs';
|
|
37
|
+
import '../../components/TimePicker/index.mjs';
|
|
38
|
+
import '../../components/TimeSelect/index.mjs';
|
|
39
|
+
import '../../components/TreeSelect/index.mjs';
|
|
40
|
+
import '../../components/Upload/index.mjs';
|
|
41
|
+
import '../../components/Avatar/index.mjs';
|
|
42
|
+
import '../../components/AvatarGroup/index.mjs';
|
|
43
|
+
import '../../components/Badge/index.mjs';
|
|
44
|
+
import { FcCard } from '../../components/Card/index.mjs';
|
|
45
|
+
import '../../components/Descriptions/index.mjs';
|
|
46
|
+
import '../../components/DescriptionsItem/index.mjs';
|
|
47
|
+
import '../../components/Empty/index.mjs';
|
|
48
|
+
import '../../components/Image/index.mjs';
|
|
49
|
+
import '../../components/ImageViewer/index.mjs';
|
|
50
|
+
import '../../components/Pagination/index.mjs';
|
|
51
|
+
import '../../components/Table/index.mjs';
|
|
52
|
+
import '../../components/TableColumn/index.mjs';
|
|
53
|
+
import '../../components/TableV2/index.mjs';
|
|
54
|
+
import '../../components/Tag/index.mjs';
|
|
55
|
+
import '../../components/Breadcrumb/index.mjs';
|
|
56
|
+
import '../../components/BreadcrumbItem/index.mjs';
|
|
57
|
+
import '../../components/Drawer/index.mjs';
|
|
58
|
+
import '../../components/Popconfirm/index.mjs';
|
|
59
|
+
import '../../components/IconComponent/index.mjs';
|
|
60
|
+
import '../../components/Popover/index.mjs';
|
|
61
|
+
import '../../components/Result/index.mjs';
|
|
62
|
+
import '../../components/Progress/index.mjs';
|
|
63
|
+
import '../../components/Divider/index.mjs';
|
|
64
|
+
import '../../components/Dropdown/index.mjs';
|
|
65
|
+
import '../../components/DropdownMenu/index.mjs';
|
|
66
|
+
import '../../components/DropdownItem/index.mjs';
|
|
67
|
+
import '../../components/Menu/index.mjs';
|
|
68
|
+
import '../../components/SubMenu/index.mjs';
|
|
69
|
+
import '../../components/MenuItem/index.mjs';
|
|
70
|
+
import '../../components/RadioButton/index.mjs';
|
|
71
|
+
import '../../components/MenuItemGroup/index.mjs';
|
|
72
|
+
import '../../components/Collapse/index.mjs';
|
|
73
|
+
import '../../components/CollapseItem/index.mjs';
|
|
74
|
+
import '../../components/ContextMenu/index.mjs';
|
|
75
|
+
import '../../components/CodeEditor/index.mjs';
|
|
76
|
+
import '../../components/RichEditor/index.mjs';
|
|
77
|
+
import '../../components/LovText/index.mjs';
|
|
78
|
+
import _sfc_main$1 from '../ProForm/ProForm.vue.mjs';
|
|
79
|
+
/* empty css */
|
|
80
|
+
import cloneDeep from '../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/cloneDeep.mjs';
|
|
81
|
+
|
|
82
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
83
|
+
...{
|
|
84
|
+
name: "FcProEditFormCard",
|
|
85
|
+
inheritAttrs: false
|
|
86
|
+
},
|
|
87
|
+
__name: "EditFormCard",
|
|
88
|
+
props: {
|
|
89
|
+
title: { default: "" },
|
|
90
|
+
showEditButton: { type: Boolean, default: true },
|
|
91
|
+
requestApi: { type: Function, default: void 0 },
|
|
92
|
+
submitApi: { type: Function, default: void 0 },
|
|
93
|
+
inline: { type: Boolean, default: true },
|
|
94
|
+
columns: {},
|
|
95
|
+
labelPosition: { default: "top" },
|
|
96
|
+
labelWidth: {},
|
|
97
|
+
fields: { default: () => [] },
|
|
98
|
+
rules: { default: () => ({}) }
|
|
99
|
+
},
|
|
100
|
+
emits: ["submit", "loaded"],
|
|
101
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
102
|
+
const isDisabled = ref(true);
|
|
103
|
+
const formRef = ref();
|
|
104
|
+
const props = __props;
|
|
105
|
+
let snapshot = {};
|
|
106
|
+
const loading = ref(false);
|
|
107
|
+
const submitting = ref(false);
|
|
108
|
+
const initData = async () => {
|
|
109
|
+
if (!props.requestApi) return;
|
|
110
|
+
try {
|
|
111
|
+
loading.value = true;
|
|
112
|
+
const res = await props.requestApi();
|
|
113
|
+
const data = res.data || res || {};
|
|
114
|
+
emits("loaded", data);
|
|
115
|
+
if (formRef.value) {
|
|
116
|
+
formRef.value.setValues(data);
|
|
117
|
+
}
|
|
118
|
+
} catch (err) {
|
|
119
|
+
console.error("获取详情失败", err);
|
|
120
|
+
} finally {
|
|
121
|
+
loading.value = false;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
onMounted(initData);
|
|
125
|
+
const handleEditClick = () => {
|
|
126
|
+
isDisabled.value = false;
|
|
127
|
+
const model = formRef.value?.model;
|
|
128
|
+
snapshot = cloneDeep(model);
|
|
129
|
+
};
|
|
130
|
+
const handleCancelClick = () => {
|
|
131
|
+
formRef.value?.clearValidate();
|
|
132
|
+
isDisabled.value = true;
|
|
133
|
+
formRef.value?.setValues(snapshot);
|
|
134
|
+
};
|
|
135
|
+
const emits = __emit;
|
|
136
|
+
const handleSaveClick = async () => {
|
|
137
|
+
if (!formRef.value) return;
|
|
138
|
+
try {
|
|
139
|
+
await formRef.value.validate();
|
|
140
|
+
const model = formRef.value?.model;
|
|
141
|
+
if (!props.submitApi) {
|
|
142
|
+
isDisabled.value = true;
|
|
143
|
+
emits("submit", model);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
submitting.value = true;
|
|
147
|
+
const res = await props.submitApi(model);
|
|
148
|
+
isDisabled.value = true;
|
|
149
|
+
emits("submit", model, res);
|
|
150
|
+
FcNotification.success({
|
|
151
|
+
message: "修改成功!"
|
|
152
|
+
});
|
|
153
|
+
initData();
|
|
154
|
+
} catch (err) {
|
|
155
|
+
console.error("提交失败", err);
|
|
156
|
+
} finally {
|
|
157
|
+
submitting.value = false;
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
__expose(
|
|
161
|
+
new Proxy(
|
|
162
|
+
{},
|
|
163
|
+
{
|
|
164
|
+
get(_, key) {
|
|
165
|
+
if (key === "refresh") {
|
|
166
|
+
return initData;
|
|
167
|
+
}
|
|
168
|
+
return formRef.value?.[key];
|
|
169
|
+
},
|
|
170
|
+
has(_, key) {
|
|
171
|
+
if (key === "refresh") {
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
return key in formRef.value;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
)
|
|
178
|
+
);
|
|
179
|
+
return (_ctx, _cache) => {
|
|
180
|
+
const _directive_loading = resolveDirective("loading");
|
|
181
|
+
return withDirectives((openBlock(), createBlock(unref(FcCard), { title: __props.title }, createSlots({
|
|
182
|
+
default: withCtx(() => [
|
|
183
|
+
createVNode(_sfc_main$1, {
|
|
184
|
+
ref_key: "formRef",
|
|
185
|
+
ref: formRef,
|
|
186
|
+
inline: __props.inline,
|
|
187
|
+
"label-position": __props.labelPosition,
|
|
188
|
+
fields: __props.fields,
|
|
189
|
+
disabled: isDisabled.value,
|
|
190
|
+
rules: __props.rules
|
|
191
|
+
}, null, 8, ["inline", "label-position", "fields", "disabled", "rules"])
|
|
192
|
+
]),
|
|
193
|
+
_: 2
|
|
194
|
+
}, [
|
|
195
|
+
__props.showEditButton ? {
|
|
196
|
+
name: "tools",
|
|
197
|
+
fn: withCtx(() => [
|
|
198
|
+
isDisabled.value ? (openBlock(), createBlock(unref(FcButton), {
|
|
199
|
+
key: 0,
|
|
200
|
+
type: "primary",
|
|
201
|
+
onClick: handleEditClick
|
|
202
|
+
}, {
|
|
203
|
+
default: withCtx(() => [..._cache[0] || (_cache[0] = [
|
|
204
|
+
createTextVNode("编辑", -1)
|
|
205
|
+
])]),
|
|
206
|
+
_: 1
|
|
207
|
+
})) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
208
|
+
createVNode(unref(FcButton), { onClick: handleCancelClick }, {
|
|
209
|
+
default: withCtx(() => [..._cache[1] || (_cache[1] = [
|
|
210
|
+
createTextVNode("取消", -1)
|
|
211
|
+
])]),
|
|
212
|
+
_: 1
|
|
213
|
+
}),
|
|
214
|
+
createVNode(unref(FcButton), {
|
|
215
|
+
type: "success",
|
|
216
|
+
loading: submitting.value,
|
|
217
|
+
onClick: handleSaveClick
|
|
218
|
+
}, {
|
|
219
|
+
default: withCtx(() => [..._cache[2] || (_cache[2] = [
|
|
220
|
+
createTextVNode("保存", -1)
|
|
221
|
+
])]),
|
|
222
|
+
_: 1
|
|
223
|
+
}, 8, ["loading"])
|
|
224
|
+
], 64))
|
|
225
|
+
]),
|
|
226
|
+
key: "0"
|
|
227
|
+
} : void 0
|
|
228
|
+
]), 1032, ["title"])), [
|
|
229
|
+
[_directive_loading, loading.value]
|
|
230
|
+
]);
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { defineComponent, ref, createBlock, openBlock, unref, withCtx, createVNode, mergeProps, createCommentVNode, createTextVNode, toDisplayString, nextTick } from 'vue';
|
|
2
|
+
import _sfc_main$3 from '../../components/Button/Button.vue.mjs';
|
|
3
|
+
/* empty css */
|
|
4
|
+
import _sfc_main$1 from '../../components/Dialog/Dialog.vue.mjs';
|
|
5
|
+
/* empty css */
|
|
6
|
+
import _sfc_main$2 from '../ProForm/ProForm.vue.mjs';
|
|
7
|
+
/* empty css */
|
|
8
|
+
import { FcNotification } from '../../components/Notification/index.mjs';
|
|
9
|
+
import { useNamespace } from '../../hooks/use-namespace.mjs';
|
|
10
|
+
|
|
11
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
+
...{
|
|
13
|
+
name: "FcProFormDialog",
|
|
14
|
+
inheritAttrs: false
|
|
15
|
+
},
|
|
16
|
+
__name: "FormDialog",
|
|
17
|
+
props: {
|
|
18
|
+
title: { default: "新增" },
|
|
19
|
+
width: { default: 400 },
|
|
20
|
+
cancelButtonText: { default: "取消" },
|
|
21
|
+
confirmButtonText: { default: "确定" },
|
|
22
|
+
showCancelButton: { type: Boolean, default: true },
|
|
23
|
+
submitApi: { type: Function, default: void 0 },
|
|
24
|
+
inline: { type: Boolean, default: false },
|
|
25
|
+
columns: {},
|
|
26
|
+
labelPosition: { default: "left" },
|
|
27
|
+
labelWidth: { default: "5em" },
|
|
28
|
+
fields: { default: () => [] },
|
|
29
|
+
rules: { default: () => ({}) }
|
|
30
|
+
},
|
|
31
|
+
emits: ["submit", "cancel"],
|
|
32
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
33
|
+
const ns = useNamespace("form-dialog");
|
|
34
|
+
const formRef = ref();
|
|
35
|
+
const props = __props;
|
|
36
|
+
const visible = ref(false);
|
|
37
|
+
const emits = __emit;
|
|
38
|
+
const submitting = ref(false);
|
|
39
|
+
const handleConfirmClick = async () => {
|
|
40
|
+
if (!formRef.value) return;
|
|
41
|
+
try {
|
|
42
|
+
await formRef.value.validate();
|
|
43
|
+
const model = formRef.value?.model;
|
|
44
|
+
if (!props.submitApi) {
|
|
45
|
+
emits("submit", model);
|
|
46
|
+
visible.value = false;
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
submitting.value = true;
|
|
50
|
+
const res = await props.submitApi(model);
|
|
51
|
+
emits("submit", model, res);
|
|
52
|
+
FcNotification.success({
|
|
53
|
+
message: "提交成功!"
|
|
54
|
+
});
|
|
55
|
+
visible.value = false;
|
|
56
|
+
} catch (err) {
|
|
57
|
+
console.error("提交失败", err);
|
|
58
|
+
} finally {
|
|
59
|
+
submitting.value = false;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const open = (data) => {
|
|
63
|
+
visible.value = true;
|
|
64
|
+
nextTick(() => {
|
|
65
|
+
formRef.value?.setValues(data || {});
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
const handleCancelClick = () => {
|
|
69
|
+
visible.value = false;
|
|
70
|
+
emits("cancel");
|
|
71
|
+
};
|
|
72
|
+
const close = () => {
|
|
73
|
+
visible.value = false;
|
|
74
|
+
};
|
|
75
|
+
__expose({
|
|
76
|
+
open,
|
|
77
|
+
close
|
|
78
|
+
});
|
|
79
|
+
return (_ctx, _cache) => {
|
|
80
|
+
return openBlock(), createBlock(_sfc_main$1, {
|
|
81
|
+
modelValue: visible.value,
|
|
82
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
|
|
83
|
+
title: __props.title,
|
|
84
|
+
width: __props.width,
|
|
85
|
+
"body-class": unref(ns).e("body")
|
|
86
|
+
}, {
|
|
87
|
+
footer: withCtx(() => [
|
|
88
|
+
__props.showCancelButton ? (openBlock(), createBlock(_sfc_main$3, {
|
|
89
|
+
key: 0,
|
|
90
|
+
onClick: handleCancelClick
|
|
91
|
+
}, {
|
|
92
|
+
default: withCtx(() => [
|
|
93
|
+
createTextVNode(toDisplayString(__props.cancelButtonText), 1)
|
|
94
|
+
]),
|
|
95
|
+
_: 1
|
|
96
|
+
})) : createCommentVNode("", true),
|
|
97
|
+
createVNode(_sfc_main$3, {
|
|
98
|
+
type: "primary",
|
|
99
|
+
loading: submitting.value,
|
|
100
|
+
onClick: handleConfirmClick
|
|
101
|
+
}, {
|
|
102
|
+
default: withCtx(() => [
|
|
103
|
+
createTextVNode(toDisplayString(__props.confirmButtonText), 1)
|
|
104
|
+
]),
|
|
105
|
+
_: 1
|
|
106
|
+
}, 8, ["loading"])
|
|
107
|
+
]),
|
|
108
|
+
default: withCtx(() => [
|
|
109
|
+
createVNode(_sfc_main$2, mergeProps({
|
|
110
|
+
ref_key: "formRef",
|
|
111
|
+
ref: formRef,
|
|
112
|
+
inline: __props.inline,
|
|
113
|
+
"label-position": __props.labelPosition,
|
|
114
|
+
"label-width": __props.labelWidth,
|
|
115
|
+
fields: __props.fields,
|
|
116
|
+
rules: __props.rules
|
|
117
|
+
}, _ctx.$attrs), null, 16, ["inline", "label-position", "label-width", "fields", "rules"])
|
|
118
|
+
]),
|
|
119
|
+
_: 1
|
|
120
|
+
}, 8, ["modelValue", "title", "width", "body-class"]);
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
export { _sfc_main as default };
|