@funcho/ui 1.1.30 → 1.1.32
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 +2 -0
- package/dist/cjs/business/DataTable/DataTable.vue.js +16 -2
- package/dist/cjs/business/DataTableDialog/DataTableDialog.vue.js +135 -0
- package/dist/cjs/business/DataTableDialog/DataTableDialog.vue3.js +10 -0
- package/dist/cjs/business/DataTableDialog/index.js +12 -0
- package/dist/cjs/business/TreeTransfer/TreeTransfer.vue.js +2 -2
- package/dist/cjs/business/TreeTransferDialog/TreeTransferDialog.vue.js +121 -0
- package/dist/cjs/business/TreeTransferDialog/TreeTransferDialog.vue3.js +10 -0
- package/dist/cjs/business/TreeTransferDialog/index.js +12 -0
- package/dist/cjs/business/index.js +4 -0
- package/dist/cjs/components/TableV2/TableV2.vue.js +5 -0
- 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 +16 -2
- package/dist/esm/business/DataTableDialog/DataTableDialog.vue.mjs +131 -0
- package/dist/esm/business/DataTableDialog/DataTableDialog.vue3.mjs +6 -0
- package/dist/esm/business/DataTableDialog/index.mjs +7 -0
- package/dist/esm/business/TreeTransfer/TreeTransfer.vue.mjs +2 -2
- package/dist/esm/business/TreeTransferDialog/TreeTransferDialog.vue.mjs +117 -0
- package/dist/esm/business/TreeTransferDialog/TreeTransferDialog.vue3.mjs +6 -0
- package/dist/esm/business/TreeTransferDialog/index.mjs +7 -0
- package/dist/esm/business/index.mjs +2 -0
- package/dist/esm/components/TableV2/TableV2.vue.mjs +6 -1
- package/dist/esm/index.mjs +2 -0
- package/dist/esm/packages/ui/package.json.mjs +1 -1
- package/dist/style.css +3 -0
- package/dist/types/business/DataTable/DataTable.types.d.ts +33 -4
- package/dist/types/business/DataTable/DataTable.vue.d.ts +22 -52
- package/dist/types/business/DataTable/index.d.ts +15 -198
- package/dist/types/business/DataTableDialog/DataTableDialog.types.d.ts +1 -0
- package/dist/types/business/DataTableDialog/DataTableDialog.vue.d.ts +1605 -0
- package/dist/types/business/DataTableDialog/index.d.ts +1688 -0
- package/dist/types/business/TreeTransferDialog/TreeTransferDialog.types.d.ts +1 -0
- package/dist/types/business/TreeTransferDialog/TreeTransferDialog.vue.d.ts +10420 -0
- package/dist/types/business/TreeTransferDialog/index.d.ts +10488 -0
- package/dist/types/business/index.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -93,6 +93,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
93
93
|
__name: "DataTable",
|
|
94
94
|
props: {
|
|
95
95
|
hasIndex: { type: Boolean, default: true },
|
|
96
|
+
selectable: { type: Boolean, default: false },
|
|
96
97
|
height: { default: 0 },
|
|
97
98
|
columns: { default: () => [] },
|
|
98
99
|
isPagination: { type: Boolean, default: true },
|
|
@@ -187,14 +188,19 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
187
188
|
queryBoxRef.value?.resetFields();
|
|
188
189
|
handleResetClick();
|
|
189
190
|
};
|
|
191
|
+
const selectedRows = vue.ref([]);
|
|
192
|
+
const handleSelectionChange = (selection) => {
|
|
193
|
+
selectedRows.value = selection;
|
|
194
|
+
};
|
|
190
195
|
__expose({
|
|
191
196
|
loadData,
|
|
192
197
|
// 刷新当前页
|
|
193
198
|
tableData,
|
|
194
199
|
reload: handleResetClick,
|
|
195
200
|
// 不清空表单,回到第一页刷新
|
|
196
|
-
resetSearch
|
|
201
|
+
resetSearch,
|
|
197
202
|
// 清空表单,回到第一页刷新
|
|
203
|
+
selectedRows
|
|
198
204
|
});
|
|
199
205
|
return (_ctx, _cache) => {
|
|
200
206
|
const _component_FcProVerticalLayout = vue.resolveComponent("FcProVerticalLayout");
|
|
@@ -207,9 +213,17 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
207
213
|
vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(index.FcTable), vue.mergeProps(_ctx.$attrs, {
|
|
208
214
|
data: tableData.value,
|
|
209
215
|
border: "",
|
|
210
|
-
"max-height": bodyHeight
|
|
216
|
+
"max-height": bodyHeight,
|
|
217
|
+
onSelectionChange: handleSelectionChange
|
|
211
218
|
}), {
|
|
212
219
|
default: vue.withCtx(() => [
|
|
220
|
+
__props.selectable ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.FcTableColumn), {
|
|
221
|
+
key: 0,
|
|
222
|
+
type: "selection",
|
|
223
|
+
width: "50",
|
|
224
|
+
align: "center",
|
|
225
|
+
fixed: "left"
|
|
226
|
+
})) : vue.createCommentVNode("", true),
|
|
213
227
|
__props.hasIndex ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.FcTableColumn), {
|
|
214
228
|
key: "index",
|
|
215
229
|
label: "序号",
|
|
@@ -0,0 +1,135 @@
|
|
|
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 DataTable_vue_vue_type_script_setup_true_lang = require('../DataTable/DataTable.vue.js');
|
|
11
|
+
;/* empty css */
|
|
12
|
+
const index = require('../../components/Notification/index.js');
|
|
13
|
+
|
|
14
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
15
|
+
...{
|
|
16
|
+
name: "FcProDataTableDialog",
|
|
17
|
+
inheritAttrs: false
|
|
18
|
+
},
|
|
19
|
+
__name: "DataTableDialog",
|
|
20
|
+
props: {
|
|
21
|
+
title: { default: "新增" },
|
|
22
|
+
width: { default: 860 },
|
|
23
|
+
height: { default: "50vh" },
|
|
24
|
+
cancelButtonText: { default: "取消" },
|
|
25
|
+
confirmButtonText: { default: "确定" },
|
|
26
|
+
showCancelButton: { type: Boolean, default: true },
|
|
27
|
+
showConfirmButton: { type: Boolean, default: true },
|
|
28
|
+
isPagination: { type: Boolean, default: false },
|
|
29
|
+
submitApi: { type: Function, default: void 0 },
|
|
30
|
+
successMessage: { default: "提交成功!" },
|
|
31
|
+
showSuccessMessage: { type: Boolean, default: true }
|
|
32
|
+
},
|
|
33
|
+
emits: ["submit", "cancel"],
|
|
34
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
35
|
+
const tableRef = vue.ref();
|
|
36
|
+
const props = __props;
|
|
37
|
+
const containerHeight = vue.computed(() => {
|
|
38
|
+
if (typeof props.height === "number") {
|
|
39
|
+
return `${props.height}px`;
|
|
40
|
+
}
|
|
41
|
+
return props.height;
|
|
42
|
+
});
|
|
43
|
+
const visible = vue.ref(false);
|
|
44
|
+
const emits = __emit;
|
|
45
|
+
const submitting = vue.ref(false);
|
|
46
|
+
const handleConfirmClick = async () => {
|
|
47
|
+
try {
|
|
48
|
+
const tableData = tableRef.value?.tableData;
|
|
49
|
+
const selectedRows = tableRef.value?.selectedRows;
|
|
50
|
+
if (!props.submitApi) {
|
|
51
|
+
emits("submit", tableData, selectedRows);
|
|
52
|
+
visible.value = false;
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
submitting.value = true;
|
|
56
|
+
const res = await props.submitApi(tableData, selectedRows);
|
|
57
|
+
emits("submit", tableData, selectedRows, res);
|
|
58
|
+
if (props.showSuccessMessage) {
|
|
59
|
+
index.FcNotification.success({
|
|
60
|
+
message: props.successMessage
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
visible.value = false;
|
|
64
|
+
} catch (err) {
|
|
65
|
+
console.error("提交失败", err);
|
|
66
|
+
} finally {
|
|
67
|
+
submitting.value = false;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const open = () => {
|
|
71
|
+
tableRef.value?.resetSearch();
|
|
72
|
+
visible.value = true;
|
|
73
|
+
};
|
|
74
|
+
const handleCancelClick = () => {
|
|
75
|
+
visible.value = false;
|
|
76
|
+
emits("cancel");
|
|
77
|
+
};
|
|
78
|
+
const close = () => {
|
|
79
|
+
visible.value = false;
|
|
80
|
+
};
|
|
81
|
+
__expose({
|
|
82
|
+
open,
|
|
83
|
+
close
|
|
84
|
+
});
|
|
85
|
+
return (_ctx, _cache) => {
|
|
86
|
+
return vue.openBlock(), vue.createBlock(Dialog_vue_vue_type_script_setup_true_lang.default, {
|
|
87
|
+
modelValue: visible.value,
|
|
88
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
|
|
89
|
+
title: __props.title,
|
|
90
|
+
width: __props.width
|
|
91
|
+
}, vue.createSlots({
|
|
92
|
+
default: vue.withCtx(() => [
|
|
93
|
+
vue.createElementVNode("div", {
|
|
94
|
+
style: vue.normalizeStyle({ height: containerHeight.value })
|
|
95
|
+
}, [
|
|
96
|
+
vue.createVNode(DataTable_vue_vue_type_script_setup_true_lang.default, vue.mergeProps({
|
|
97
|
+
ref_key: "tableRef",
|
|
98
|
+
ref: tableRef
|
|
99
|
+
}, _ctx.$attrs, { "is-pagination": __props.isPagination }), null, 16, ["is-pagination"])
|
|
100
|
+
], 4)
|
|
101
|
+
]),
|
|
102
|
+
_: 2
|
|
103
|
+
}, [
|
|
104
|
+
__props.showCancelButton || __props.showConfirmButton ? {
|
|
105
|
+
name: "footer",
|
|
106
|
+
fn: vue.withCtx(() => [
|
|
107
|
+
__props.showCancelButton ? (vue.openBlock(), vue.createBlock(Button_vue_vue_type_script_setup_true_lang.default, {
|
|
108
|
+
key: 0,
|
|
109
|
+
onClick: handleCancelClick
|
|
110
|
+
}, {
|
|
111
|
+
default: vue.withCtx(() => [
|
|
112
|
+
vue.createTextVNode(vue.toDisplayString(__props.cancelButtonText), 1)
|
|
113
|
+
]),
|
|
114
|
+
_: 1
|
|
115
|
+
})) : vue.createCommentVNode("", true),
|
|
116
|
+
__props.showConfirmButton ? (vue.openBlock(), vue.createBlock(Button_vue_vue_type_script_setup_true_lang.default, {
|
|
117
|
+
key: 1,
|
|
118
|
+
type: "primary",
|
|
119
|
+
loading: submitting.value,
|
|
120
|
+
onClick: handleConfirmClick
|
|
121
|
+
}, {
|
|
122
|
+
default: vue.withCtx(() => [
|
|
123
|
+
vue.createTextVNode(vue.toDisplayString(__props.confirmButtonText), 1)
|
|
124
|
+
]),
|
|
125
|
+
_: 1
|
|
126
|
+
}, 8, ["loading"])) : vue.createCommentVNode("", true)
|
|
127
|
+
]),
|
|
128
|
+
key: "0"
|
|
129
|
+
} : void 0
|
|
130
|
+
]), 1032, ["modelValue", "title", "width"]);
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
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 DataTableDialog_vue_vue_type_script_setup_true_lang = require('./DataTableDialog.vue.js');
|
|
6
|
+
;/* empty css */
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.default = DataTableDialog_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 DataTableDialog_vue_vue_type_script_setup_true_lang = require('./DataTableDialog.vue.js');
|
|
6
|
+
;/* empty css */
|
|
7
|
+
const withInstall = require('../../_utils/with-install.js');
|
|
8
|
+
|
|
9
|
+
const FcProDataTableDialog = withInstall.withInstall(DataTableDialog_vue_vue_type_script_setup_true_lang.default);
|
|
10
|
+
|
|
11
|
+
exports.FcProDataTableDialog = FcProDataTableDialog;
|
|
12
|
+
exports.default = FcProDataTableDialog;
|
|
@@ -146,7 +146,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
146
146
|
!__props.leftProps.hiddenBtn ? (vue.openBlock(), vue.createBlock(vue.unref(index.FcTooltip), {
|
|
147
147
|
key: 0,
|
|
148
148
|
content: __props.leftProps.tooltip || "新增",
|
|
149
|
-
placement: "
|
|
149
|
+
placement: "right",
|
|
150
150
|
"fallback-placements": ["top", "bottom", "left", "right"]
|
|
151
151
|
}, {
|
|
152
152
|
default: vue.withCtx(() => [
|
|
@@ -166,7 +166,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
166
166
|
!__props.rightProps.hiddenBtn ? (vue.openBlock(), vue.createBlock(vue.unref(index.FcTooltip), {
|
|
167
167
|
key: 1,
|
|
168
168
|
content: __props.rightProps.tooltip || "删除",
|
|
169
|
-
placement: "
|
|
169
|
+
placement: "left",
|
|
170
170
|
"fallback-placements": ["top", "bottom", "left", "right"]
|
|
171
171
|
}, {
|
|
172
172
|
default: vue.withCtx(() => [
|
|
@@ -0,0 +1,121 @@
|
|
|
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 TreeTransfer_vue_vue_type_script_setup_true_lang = require('../TreeTransfer/TreeTransfer.vue.js');
|
|
11
|
+
;/* empty css */
|
|
12
|
+
|
|
13
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
14
|
+
...{
|
|
15
|
+
name: "FcProTreeTransferDialog",
|
|
16
|
+
inheritAttrs: false
|
|
17
|
+
},
|
|
18
|
+
__name: "TreeTransferDialog",
|
|
19
|
+
props: {
|
|
20
|
+
title: { default: "新增" },
|
|
21
|
+
width: { default: 936 },
|
|
22
|
+
height: { default: "50vh" },
|
|
23
|
+
cancelButtonText: { default: "取消" },
|
|
24
|
+
loading: { type: Boolean, default: false },
|
|
25
|
+
confirmButtonText: { default: "确定" },
|
|
26
|
+
showCancelButton: { type: Boolean, default: false },
|
|
27
|
+
showConfirmButton: { type: Boolean, default: false }
|
|
28
|
+
},
|
|
29
|
+
emits: ["submit", "cancel", "add", "remove"],
|
|
30
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
31
|
+
const treeTransferRef = vue.ref();
|
|
32
|
+
const props = __props;
|
|
33
|
+
const containerHeight = vue.computed(() => {
|
|
34
|
+
if (typeof props.height === "number") {
|
|
35
|
+
return `${props.height}px`;
|
|
36
|
+
}
|
|
37
|
+
return props.height;
|
|
38
|
+
});
|
|
39
|
+
const visible = vue.ref(false);
|
|
40
|
+
const emits = __emit;
|
|
41
|
+
const handleAddClick = (instance, nodes, keys) => {
|
|
42
|
+
emits("add", instance, nodes, keys);
|
|
43
|
+
};
|
|
44
|
+
const handleRemoveClick = (instance, nodes, keys) => {
|
|
45
|
+
emits("remove", instance, nodes, keys);
|
|
46
|
+
};
|
|
47
|
+
const submitting = vue.ref(false);
|
|
48
|
+
const handleConfirmClick = async () => {
|
|
49
|
+
emits("submit", treeTransferRef.value?.leftTreeRef, treeTransferRef.value.rightTreeRef);
|
|
50
|
+
};
|
|
51
|
+
const open = () => {
|
|
52
|
+
visible.value = true;
|
|
53
|
+
};
|
|
54
|
+
const handleCancelClick = () => {
|
|
55
|
+
visible.value = false;
|
|
56
|
+
emits("cancel");
|
|
57
|
+
};
|
|
58
|
+
const close = () => {
|
|
59
|
+
visible.value = false;
|
|
60
|
+
};
|
|
61
|
+
__expose({
|
|
62
|
+
open,
|
|
63
|
+
close
|
|
64
|
+
});
|
|
65
|
+
return (_ctx, _cache) => {
|
|
66
|
+
const _directive_loading = vue.resolveDirective("loading");
|
|
67
|
+
return vue.openBlock(), vue.createBlock(Dialog_vue_vue_type_script_setup_true_lang.default, {
|
|
68
|
+
modelValue: visible.value,
|
|
69
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
|
|
70
|
+
title: __props.title,
|
|
71
|
+
width: __props.width
|
|
72
|
+
}, vue.createSlots({
|
|
73
|
+
default: vue.withCtx(() => [
|
|
74
|
+
vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
|
|
75
|
+
style: vue.normalizeStyle({ height: containerHeight.value })
|
|
76
|
+
}, [
|
|
77
|
+
vue.createVNode(TreeTransfer_vue_vue_type_script_setup_true_lang.default, vue.mergeProps(_ctx.$attrs, {
|
|
78
|
+
ref_key: "treeTransferRef",
|
|
79
|
+
ref: treeTransferRef,
|
|
80
|
+
onAdd: handleAddClick,
|
|
81
|
+
onRemove: handleRemoveClick
|
|
82
|
+
}), null, 16)
|
|
83
|
+
], 4)), [
|
|
84
|
+
[_directive_loading, __props.loading]
|
|
85
|
+
])
|
|
86
|
+
]),
|
|
87
|
+
_: 2
|
|
88
|
+
}, [
|
|
89
|
+
__props.showCancelButton || __props.showConfirmButton ? {
|
|
90
|
+
name: "footer",
|
|
91
|
+
fn: 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
|
+
__props.showConfirmButton ? (vue.openBlock(), vue.createBlock(Button_vue_vue_type_script_setup_true_lang.default, {
|
|
102
|
+
key: 1,
|
|
103
|
+
type: "primary",
|
|
104
|
+
loading: submitting.value,
|
|
105
|
+
disabled: __props.loading,
|
|
106
|
+
onClick: handleConfirmClick
|
|
107
|
+
}, {
|
|
108
|
+
default: vue.withCtx(() => [
|
|
109
|
+
vue.createTextVNode(vue.toDisplayString(__props.confirmButtonText), 1)
|
|
110
|
+
]),
|
|
111
|
+
_: 1
|
|
112
|
+
}, 8, ["loading", "disabled"])) : vue.createCommentVNode("", true)
|
|
113
|
+
]),
|
|
114
|
+
key: "0"
|
|
115
|
+
} : void 0
|
|
116
|
+
]), 1032, ["modelValue", "title", "width"]);
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
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 TreeTransferDialog_vue_vue_type_script_setup_true_lang = require('./TreeTransferDialog.vue.js');
|
|
6
|
+
;/* empty css */
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.default = TreeTransferDialog_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 TreeTransferDialog_vue_vue_type_script_setup_true_lang = require('./TreeTransferDialog.vue.js');
|
|
6
|
+
;/* empty css */
|
|
7
|
+
const withInstall = require('../../_utils/with-install.js');
|
|
8
|
+
|
|
9
|
+
const FcProTreeTransferDialog = withInstall.withInstall(TreeTransferDialog_vue_vue_type_script_setup_true_lang.default);
|
|
10
|
+
|
|
11
|
+
exports.FcProTreeTransferDialog = FcProTreeTransferDialog;
|
|
12
|
+
exports.default = FcProTreeTransferDialog;
|
|
@@ -11,6 +11,8 @@ const index$5 = require('./EditFormCard/index.js');
|
|
|
11
11
|
const index$6 = require('./FormDialog/index.js');
|
|
12
12
|
const index$7 = require('./QueryForm/index.js');
|
|
13
13
|
const index$8 = require('./VerticalLayout/index.js');
|
|
14
|
+
const index$9 = require('./TreeTransferDialog/index.js');
|
|
15
|
+
const index$a = require('./DataTableDialog/index.js');
|
|
14
16
|
|
|
15
17
|
|
|
16
18
|
|
|
@@ -23,3 +25,5 @@ exports.FcProEditFormCard = index$5.FcProEditFormCard;
|
|
|
23
25
|
exports.FcProFormDialog = index$6.FcProFormDialog;
|
|
24
26
|
exports.FcProQueryForm = index$7.FcProQueryForm;
|
|
25
27
|
exports.FcProVerticalLayout = index$8.FcProVerticalLayout;
|
|
28
|
+
exports.FcProTreeTransferDialog = index$9.FcProTreeTransferDialog;
|
|
29
|
+
exports.FcProDataTableDialog = index$a.FcProDataTableDialog;
|
|
@@ -16,9 +16,14 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
16
16
|
headerHeight: { default: 40 }
|
|
17
17
|
},
|
|
18
18
|
setup(__props, { expose: __expose }) {
|
|
19
|
+
vue.useCssVars((_ctx) => ({
|
|
20
|
+
"v19afe189": rowHeightStyle.value
|
|
21
|
+
}));
|
|
19
22
|
const attrs = vue.useAttrs();
|
|
20
23
|
const tableBindProps = vue.computed(() => attrs);
|
|
24
|
+
const props = __props;
|
|
21
25
|
const elRef = vue.ref();
|
|
26
|
+
const rowHeightStyle = vue.computed(() => `${props.rowHeight - 2}px`);
|
|
22
27
|
__expose(
|
|
23
28
|
new Proxy(
|
|
24
29
|
{},
|
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$1s = require('./components/index.js');
|
|
11
|
+
const index$1t = 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');
|
|
@@ -99,12 +99,14 @@ const index$1m = require('./business/EditFormCard/index.js');
|
|
|
99
99
|
const index$1n = require('./business/FormDialog/index.js');
|
|
100
100
|
const index$1o = require('./business/QueryForm/index.js');
|
|
101
101
|
const index$1p = require('./business/VerticalLayout/index.js');
|
|
102
|
+
const index$1q = require('./business/TreeTransferDialog/index.js');
|
|
103
|
+
const index$1r = require('./business/DataTableDialog/index.js');
|
|
102
104
|
|
|
103
|
-
const components = Object.keys(index$
|
|
104
|
-
return index$
|
|
105
|
+
const components = Object.keys(index$1s).map((key) => {
|
|
106
|
+
return index$1s[key];
|
|
105
107
|
});
|
|
106
|
-
const proComponents = Object.keys(index$
|
|
107
|
-
return index$
|
|
108
|
+
const proComponents = Object.keys(index$1t).map((key) => {
|
|
109
|
+
return index$1t[key];
|
|
108
110
|
});
|
|
109
111
|
const installComponents = [...components, ...proComponents].filter((comp) => {
|
|
110
112
|
return typeof comp === "object" && comp.name && typeof comp.install === "function";
|
|
@@ -240,5 +242,7 @@ exports.FcProEditFormCard = index$1m.FcProEditFormCard;
|
|
|
240
242
|
exports.FcProFormDialog = index$1n.FcProFormDialog;
|
|
241
243
|
exports.FcProQueryForm = index$1o.FcProQueryForm;
|
|
242
244
|
exports.FcProVerticalLayout = index$1p.FcProVerticalLayout;
|
|
245
|
+
exports.FcProTreeTransferDialog = index$1q.FcProTreeTransferDialog;
|
|
246
|
+
exports.FcProDataTableDialog = index$1r.FcProDataTableDialog;
|
|
243
247
|
exports.default = index;
|
|
244
248
|
exports.install = install;
|
|
@@ -89,6 +89,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
89
89
|
__name: "DataTable",
|
|
90
90
|
props: {
|
|
91
91
|
hasIndex: { type: Boolean, default: true },
|
|
92
|
+
selectable: { type: Boolean, default: false },
|
|
92
93
|
height: { default: 0 },
|
|
93
94
|
columns: { default: () => [] },
|
|
94
95
|
isPagination: { type: Boolean, default: true },
|
|
@@ -183,14 +184,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
183
184
|
queryBoxRef.value?.resetFields();
|
|
184
185
|
handleResetClick();
|
|
185
186
|
};
|
|
187
|
+
const selectedRows = ref([]);
|
|
188
|
+
const handleSelectionChange = (selection) => {
|
|
189
|
+
selectedRows.value = selection;
|
|
190
|
+
};
|
|
186
191
|
__expose({
|
|
187
192
|
loadData,
|
|
188
193
|
// 刷新当前页
|
|
189
194
|
tableData,
|
|
190
195
|
reload: handleResetClick,
|
|
191
196
|
// 不清空表单,回到第一页刷新
|
|
192
|
-
resetSearch
|
|
197
|
+
resetSearch,
|
|
193
198
|
// 清空表单,回到第一页刷新
|
|
199
|
+
selectedRows
|
|
194
200
|
});
|
|
195
201
|
return (_ctx, _cache) => {
|
|
196
202
|
const _component_FcProVerticalLayout = resolveComponent("FcProVerticalLayout");
|
|
@@ -203,9 +209,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
203
209
|
withDirectives((openBlock(), createBlock(unref(FcTable), mergeProps(_ctx.$attrs, {
|
|
204
210
|
data: tableData.value,
|
|
205
211
|
border: "",
|
|
206
|
-
"max-height": bodyHeight
|
|
212
|
+
"max-height": bodyHeight,
|
|
213
|
+
onSelectionChange: handleSelectionChange
|
|
207
214
|
}), {
|
|
208
215
|
default: withCtx(() => [
|
|
216
|
+
__props.selectable ? (openBlock(), createBlock(unref(FcTableColumn), {
|
|
217
|
+
key: 0,
|
|
218
|
+
type: "selection",
|
|
219
|
+
width: "50",
|
|
220
|
+
align: "center",
|
|
221
|
+
fixed: "left"
|
|
222
|
+
})) : createCommentVNode("", true),
|
|
209
223
|
__props.hasIndex ? (openBlock(), createBlock(unref(FcTableColumn), {
|
|
210
224
|
key: "index",
|
|
211
225
|
label: "序号",
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, createBlock, openBlock, createSlots, withCtx, createElementVNode, normalizeStyle, createVNode, mergeProps, createCommentVNode, createTextVNode, toDisplayString } 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 '../DataTable/DataTable.vue.mjs';
|
|
7
|
+
/* empty css */
|
|
8
|
+
import { FcNotification } from '../../components/Notification/index.mjs';
|
|
9
|
+
|
|
10
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
|
+
...{
|
|
12
|
+
name: "FcProDataTableDialog",
|
|
13
|
+
inheritAttrs: false
|
|
14
|
+
},
|
|
15
|
+
__name: "DataTableDialog",
|
|
16
|
+
props: {
|
|
17
|
+
title: { default: "新增" },
|
|
18
|
+
width: { default: 860 },
|
|
19
|
+
height: { default: "50vh" },
|
|
20
|
+
cancelButtonText: { default: "取消" },
|
|
21
|
+
confirmButtonText: { default: "确定" },
|
|
22
|
+
showCancelButton: { type: Boolean, default: true },
|
|
23
|
+
showConfirmButton: { type: Boolean, default: true },
|
|
24
|
+
isPagination: { type: Boolean, default: false },
|
|
25
|
+
submitApi: { type: Function, default: void 0 },
|
|
26
|
+
successMessage: { default: "提交成功!" },
|
|
27
|
+
showSuccessMessage: { type: Boolean, default: true }
|
|
28
|
+
},
|
|
29
|
+
emits: ["submit", "cancel"],
|
|
30
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
31
|
+
const tableRef = ref();
|
|
32
|
+
const props = __props;
|
|
33
|
+
const containerHeight = computed(() => {
|
|
34
|
+
if (typeof props.height === "number") {
|
|
35
|
+
return `${props.height}px`;
|
|
36
|
+
}
|
|
37
|
+
return props.height;
|
|
38
|
+
});
|
|
39
|
+
const visible = ref(false);
|
|
40
|
+
const emits = __emit;
|
|
41
|
+
const submitting = ref(false);
|
|
42
|
+
const handleConfirmClick = async () => {
|
|
43
|
+
try {
|
|
44
|
+
const tableData = tableRef.value?.tableData;
|
|
45
|
+
const selectedRows = tableRef.value?.selectedRows;
|
|
46
|
+
if (!props.submitApi) {
|
|
47
|
+
emits("submit", tableData, selectedRows);
|
|
48
|
+
visible.value = false;
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
submitting.value = true;
|
|
52
|
+
const res = await props.submitApi(tableData, selectedRows);
|
|
53
|
+
emits("submit", tableData, selectedRows, res);
|
|
54
|
+
if (props.showSuccessMessage) {
|
|
55
|
+
FcNotification.success({
|
|
56
|
+
message: props.successMessage
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
visible.value = false;
|
|
60
|
+
} catch (err) {
|
|
61
|
+
console.error("提交失败", err);
|
|
62
|
+
} finally {
|
|
63
|
+
submitting.value = false;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const open = () => {
|
|
67
|
+
tableRef.value?.resetSearch();
|
|
68
|
+
visible.value = true;
|
|
69
|
+
};
|
|
70
|
+
const handleCancelClick = () => {
|
|
71
|
+
visible.value = false;
|
|
72
|
+
emits("cancel");
|
|
73
|
+
};
|
|
74
|
+
const close = () => {
|
|
75
|
+
visible.value = false;
|
|
76
|
+
};
|
|
77
|
+
__expose({
|
|
78
|
+
open,
|
|
79
|
+
close
|
|
80
|
+
});
|
|
81
|
+
return (_ctx, _cache) => {
|
|
82
|
+
return openBlock(), createBlock(_sfc_main$1, {
|
|
83
|
+
modelValue: visible.value,
|
|
84
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
|
|
85
|
+
title: __props.title,
|
|
86
|
+
width: __props.width
|
|
87
|
+
}, createSlots({
|
|
88
|
+
default: withCtx(() => [
|
|
89
|
+
createElementVNode("div", {
|
|
90
|
+
style: normalizeStyle({ height: containerHeight.value })
|
|
91
|
+
}, [
|
|
92
|
+
createVNode(_sfc_main$2, mergeProps({
|
|
93
|
+
ref_key: "tableRef",
|
|
94
|
+
ref: tableRef
|
|
95
|
+
}, _ctx.$attrs, { "is-pagination": __props.isPagination }), null, 16, ["is-pagination"])
|
|
96
|
+
], 4)
|
|
97
|
+
]),
|
|
98
|
+
_: 2
|
|
99
|
+
}, [
|
|
100
|
+
__props.showCancelButton || __props.showConfirmButton ? {
|
|
101
|
+
name: "footer",
|
|
102
|
+
fn: withCtx(() => [
|
|
103
|
+
__props.showCancelButton ? (openBlock(), createBlock(_sfc_main$3, {
|
|
104
|
+
key: 0,
|
|
105
|
+
onClick: handleCancelClick
|
|
106
|
+
}, {
|
|
107
|
+
default: withCtx(() => [
|
|
108
|
+
createTextVNode(toDisplayString(__props.cancelButtonText), 1)
|
|
109
|
+
]),
|
|
110
|
+
_: 1
|
|
111
|
+
})) : createCommentVNode("", true),
|
|
112
|
+
__props.showConfirmButton ? (openBlock(), createBlock(_sfc_main$3, {
|
|
113
|
+
key: 1,
|
|
114
|
+
type: "primary",
|
|
115
|
+
loading: submitting.value,
|
|
116
|
+
onClick: handleConfirmClick
|
|
117
|
+
}, {
|
|
118
|
+
default: withCtx(() => [
|
|
119
|
+
createTextVNode(toDisplayString(__props.confirmButtonText), 1)
|
|
120
|
+
]),
|
|
121
|
+
_: 1
|
|
122
|
+
}, 8, ["loading"])) : createCommentVNode("", true)
|
|
123
|
+
]),
|
|
124
|
+
key: "0"
|
|
125
|
+
} : void 0
|
|
126
|
+
]), 1032, ["modelValue", "title", "width"]);
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
export { _sfc_main as default };
|
|
@@ -142,7 +142,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
142
142
|
!__props.leftProps.hiddenBtn ? (openBlock(), createBlock(unref(FcTooltip), {
|
|
143
143
|
key: 0,
|
|
144
144
|
content: __props.leftProps.tooltip || "新增",
|
|
145
|
-
placement: "
|
|
145
|
+
placement: "right",
|
|
146
146
|
"fallback-placements": ["top", "bottom", "left", "right"]
|
|
147
147
|
}, {
|
|
148
148
|
default: withCtx(() => [
|
|
@@ -162,7 +162,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
162
162
|
!__props.rightProps.hiddenBtn ? (openBlock(), createBlock(unref(FcTooltip), {
|
|
163
163
|
key: 1,
|
|
164
164
|
content: __props.rightProps.tooltip || "删除",
|
|
165
|
-
placement: "
|
|
165
|
+
placement: "left",
|
|
166
166
|
"fallback-placements": ["top", "bottom", "left", "right"]
|
|
167
167
|
}, {
|
|
168
168
|
default: withCtx(() => [
|