@fmdevui/fm-dev 1.0.7 → 1.0.8
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/es/core/index.d.ts +0 -1
- package/es/index.mjs +0 -1
- package/es/packages/core/index.mjs +0 -1
- package/index.js +182 -2345
- package/index.min.js +23 -23
- package/index.min.mjs +23 -23
- package/index.mjs +184 -2346
- package/lib/core/index.d.ts +0 -1
- package/lib/index.js +0 -2
- package/lib/packages/core/index.js +0 -2
- package/package.json +1 -1
- package/es/core/hook/useVxeTableOptionsHook.d.ts +0 -3362
- package/es/packages/core/hook/useVxeTableOptionsHook.mjs +0 -82
- package/lib/core/hook/useVxeTableOptionsHook.d.ts +0 -3362
- package/lib/packages/core/hook/useVxeTableOptionsHook.js +0 -84
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { reactive } from 'vue';
|
|
2
|
-
import { dayjs } from 'element-plus';
|
|
3
|
-
import '../stores/index.mjs';
|
|
4
|
-
import { merge } from 'lodash-es';
|
|
5
|
-
import { useThemeConfig } from '../stores/themeConfig.mjs';
|
|
6
|
-
|
|
7
|
-
const vxeSize = useThemeConfig().themeConfig.globalComponentSize == "small" ? "mini" : useThemeConfig().themeConfig.globalComponentSize == "default" ? "small" : "medium";
|
|
8
|
-
const useVxeTable = (opt, extras) => {
|
|
9
|
-
opt.id = opt.id ? opt.id : String((/* @__PURE__ */ new Date()).getTime());
|
|
10
|
-
const options = reactive({
|
|
11
|
-
id: opt.id,
|
|
12
|
-
height: "auto",
|
|
13
|
-
autoResize: true,
|
|
14
|
-
size: vxeSize,
|
|
15
|
-
loading: false,
|
|
16
|
-
align: "center",
|
|
17
|
-
// 自动监听父元素的变化去重新计算表格(对于父元素可能存在动态变化、显示隐藏的容器中、列宽异常等场景中的可能会用到)
|
|
18
|
-
// data: [] as Array<T>,
|
|
19
|
-
columns: opt.columns,
|
|
20
|
-
showFooter: opt.showFooter,
|
|
21
|
-
footerData: opt.footerData,
|
|
22
|
-
footerMethod: opt.footerMethod,
|
|
23
|
-
toolbarConfig: {
|
|
24
|
-
size: vxeSize,
|
|
25
|
-
slots: { buttons: "toolbar_buttons", tools: "toolbar_tools" },
|
|
26
|
-
refresh: {
|
|
27
|
-
code: "query"
|
|
28
|
-
},
|
|
29
|
-
export: true,
|
|
30
|
-
print: true,
|
|
31
|
-
zoom: true,
|
|
32
|
-
custom: true
|
|
33
|
-
},
|
|
34
|
-
checkboxConfig: { range: true },
|
|
35
|
-
// sortConfig: { trigger: 'cell', remote: true },
|
|
36
|
-
exportConfig: {
|
|
37
|
-
remote: false,
|
|
38
|
-
// 设置使用服务端导出
|
|
39
|
-
filename: `${opt.name}\u5BFC\u51FA_${dayjs().format("YYMMDDHHmmss")}`
|
|
40
|
-
},
|
|
41
|
-
pagerConfig: {
|
|
42
|
-
enabled: true,
|
|
43
|
-
size: vxeSize,
|
|
44
|
-
pageSize: 50
|
|
45
|
-
},
|
|
46
|
-
printConfig: { sheetName: "" },
|
|
47
|
-
customConfig: {
|
|
48
|
-
storage: {
|
|
49
|
-
// 是否启用 localStorage 本地保存,会将列操作状态保留在本地(需要有 id)
|
|
50
|
-
visible: true,
|
|
51
|
-
// 启用显示/隐藏列状态
|
|
52
|
-
resizable: true
|
|
53
|
-
// 启用列宽状态
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
if (opt.data) {
|
|
58
|
-
options.data = opt.data;
|
|
59
|
-
} else {
|
|
60
|
-
options.proxyConfig = {
|
|
61
|
-
enabled: true,
|
|
62
|
-
autoLoad: false,
|
|
63
|
-
sort: true,
|
|
64
|
-
props: {
|
|
65
|
-
list: "data.result",
|
|
66
|
-
// 全量
|
|
67
|
-
result: "data.result.items",
|
|
68
|
-
// 分页
|
|
69
|
-
total: "data.result.total",
|
|
70
|
-
message: "data.message"
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
if (opt.sortConfig) {
|
|
75
|
-
options.sortConfig = opt.sortConfig;
|
|
76
|
-
} else {
|
|
77
|
-
options.sortConfig = { remote: true };
|
|
78
|
-
}
|
|
79
|
-
return extras ? merge(options, extras) : options;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export { useVxeTable };
|