sun-biz 0.0.4-beta.30 → 0.0.4-beta.31
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/components/index.js +34 -5
- package/dist/index.js +34 -5
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -2076,6 +2076,10 @@ const TableSettingButton_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(T
|
|
|
2076
2076
|
]
|
|
2077
2077
|
]);
|
|
2078
2078
|
/* ESM default export */ const TableSettingButton = TableSettingButton_exports_;
|
|
2079
|
+
const Tablevue_type_script_setup_true_lang_tsx_name_Table_hoisted_1 = {
|
|
2080
|
+
key: 1,
|
|
2081
|
+
class: "flex items-center justify-center bg-white bg-opacity-80 py-3"
|
|
2082
|
+
};
|
|
2079
2083
|
/* ESM default export */ const Tablevue_type_script_setup_true_lang_tsx_name_Table = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
|
|
2080
2084
|
__name: 'Table',
|
|
2081
2085
|
props: {
|
|
@@ -2102,6 +2106,9 @@ const TableSettingButton_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(T
|
|
|
2102
2106
|
Function,
|
|
2103
2107
|
String
|
|
2104
2108
|
]
|
|
2109
|
+
},
|
|
2110
|
+
scrollLoading: {
|
|
2111
|
+
type: Boolean
|
|
2105
2112
|
}
|
|
2106
2113
|
},
|
|
2107
2114
|
emits: [
|
|
@@ -2161,6 +2168,18 @@ const TableSettingButton_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(T
|
|
|
2161
2168
|
"row-class-name": rowClassNameAdapter,
|
|
2162
2169
|
border: ""
|
|
2163
2170
|
}, _ctx.$attrs), {
|
|
2171
|
+
append: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
|
|
2172
|
+
_ctx.$slots.append ? (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderSlot)(_ctx.$slots, "append", {
|
|
2173
|
+
key: 0
|
|
2174
|
+
}) : props.scrollLoading ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("div", Tablevue_type_script_setup_true_lang_tsx_name_Table_hoisted_1, _cache[1] || (_cache[1] = [
|
|
2175
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", {
|
|
2176
|
+
class: "text-sm text-gray-500"
|
|
2177
|
+
}, "加载中...", -1)
|
|
2178
|
+
]))) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true)
|
|
2179
|
+
]),
|
|
2180
|
+
empty: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
|
|
2181
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.renderSlot)(_ctx.$slots, "empty")
|
|
2182
|
+
]),
|
|
2164
2183
|
default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
|
|
2165
2184
|
((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(true), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderList)(props.tableColumns, (item, index)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(RenderColumn, {
|
|
2166
2185
|
"column-obj": item,
|
|
@@ -2304,6 +2323,12 @@ const SELECTION = 'selection';
|
|
|
2304
2323
|
pageInfo: {
|
|
2305
2324
|
default: void 0
|
|
2306
2325
|
},
|
|
2326
|
+
scrollLoading: {
|
|
2327
|
+
type: Boolean
|
|
2328
|
+
},
|
|
2329
|
+
scrollThreshold: {
|
|
2330
|
+
default: 80
|
|
2331
|
+
},
|
|
2307
2332
|
componentNo: {
|
|
2308
2333
|
default: ''
|
|
2309
2334
|
},
|
|
@@ -2416,6 +2441,7 @@ const SELECTION = 'selection';
|
|
|
2416
2441
|
// 新增:Sortable实例引用
|
|
2417
2442
|
let sortableInstance = null;
|
|
2418
2443
|
const refreshIndex = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(0);
|
|
2444
|
+
let oldScrollTop = 0;
|
|
2419
2445
|
// 定义 emit 事件
|
|
2420
2446
|
const emit = __emit;
|
|
2421
2447
|
const attrs = (0, __WEBPACK_EXTERNAL_MODULE_vue__.useAttrs)();
|
|
@@ -2792,11 +2818,12 @@ const SELECTION = 'selection';
|
|
|
2792
2818
|
// 获取表格容器元素
|
|
2793
2819
|
const clientHeight = document.querySelector(`#${uuid.value} .el-table__body-wrapper`)?.clientHeight;
|
|
2794
2820
|
const scrollHeight = document.querySelector(`#${uuid.value} .el-table__body`)?.scrollHeight;
|
|
2795
|
-
const threshold =
|
|
2796
|
-
if (scrollHeight - event.scrollTop - clientHeight < threshold) {
|
|
2821
|
+
const threshold = props.scrollThreshold; // 距离底部80px时触发加载
|
|
2822
|
+
if (scrollHeight - event.scrollTop - clientHeight < threshold && event.scrollTop > oldScrollTop) {
|
|
2797
2823
|
console.log('触发加载更多数据');
|
|
2798
2824
|
props.scrollLoad();
|
|
2799
2825
|
}
|
|
2826
|
+
oldScrollTop = event.scrollTop;
|
|
2800
2827
|
}
|
|
2801
2828
|
let debounceScroll = (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.debounce)(handleTableScroll, 500);
|
|
2802
2829
|
/**
|
|
@@ -2883,6 +2910,7 @@ const SELECTION = 'selection';
|
|
|
2883
2910
|
if (props.scrollLoad) (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(debounceScroll)(event);
|
|
2884
2911
|
emit('scroll', event);
|
|
2885
2912
|
}),
|
|
2913
|
+
"scroll-loading": props.scrollLoading,
|
|
2886
2914
|
"export-file-flag": exportFileFlag.value,
|
|
2887
2915
|
componentDesc: componentDesc.value,
|
|
2888
2916
|
key: refreshIndex.value,
|
|
@@ -2891,7 +2919,7 @@ const SELECTION = 'selection';
|
|
|
2891
2919
|
"show-setting": showSetting.value,
|
|
2892
2920
|
stripe: props.stripe,
|
|
2893
2921
|
"columns-setting": props.columnsSetting,
|
|
2894
|
-
loading: (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(state).loading || props.loading,
|
|
2922
|
+
loading: ((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(state).loading || props.loading) && !props.scrollLoading,
|
|
2895
2923
|
onSuccess: fetchDbgridComponent,
|
|
2896
2924
|
onSortChange: sortChange,
|
|
2897
2925
|
ref_key: "tableRef",
|
|
@@ -2913,6 +2941,7 @@ const SELECTION = 'selection';
|
|
|
2913
2941
|
}))
|
|
2914
2942
|
]), 1040, [
|
|
2915
2943
|
"id",
|
|
2944
|
+
"scroll-loading",
|
|
2916
2945
|
"export-file-flag",
|
|
2917
2946
|
"componentDesc",
|
|
2918
2947
|
"common-columns",
|
|
@@ -2953,7 +2982,7 @@ const SELECTION = 'selection';
|
|
|
2953
2982
|
});
|
|
2954
2983
|
const pro_table_exports_ = pro_tablevue_type_script_lang_ts_setup_true_name_ProTable;
|
|
2955
2984
|
/* ESM default export */ const pro_table = pro_table_exports_;
|
|
2956
|
-
const
|
|
2985
|
+
const composables_Tablevue_type_script_setup_true_lang_tsx_name_Table_hoisted_1 = {
|
|
2957
2986
|
class: "min-h-0 flex-1"
|
|
2958
2987
|
};
|
|
2959
2988
|
/* ESM default export */ const composables_Tablevue_type_script_setup_true_lang_tsx_name_Table = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
|
|
@@ -3010,7 +3039,7 @@ const Tablevue_type_script_setup_true_lang_tsx_name_Table_hoisted_1 = {
|
|
|
3010
3039
|
"columns-setting",
|
|
3011
3040
|
"columns"
|
|
3012
3041
|
])) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true),
|
|
3013
|
-
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div",
|
|
3042
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", composables_Tablevue_type_script_setup_true_lang_tsx_name_Table_hoisted_1, [
|
|
3014
3043
|
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElAutoResizer), null, {
|
|
3015
3044
|
default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(({ height, width })=>[
|
|
3016
3045
|
(0, __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives)((0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElTableV2), (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
|
package/dist/index.js
CHANGED
|
@@ -2112,6 +2112,10 @@ const TableSettingButton_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(T
|
|
|
2112
2112
|
]
|
|
2113
2113
|
]);
|
|
2114
2114
|
/* ESM default export */ const TableSettingButton = TableSettingButton_exports_;
|
|
2115
|
+
const Tablevue_type_script_setup_true_lang_tsx_name_Table_hoisted_1 = {
|
|
2116
|
+
key: 1,
|
|
2117
|
+
class: "flex items-center justify-center bg-white bg-opacity-80 py-3"
|
|
2118
|
+
};
|
|
2115
2119
|
/* ESM default export */ const Tablevue_type_script_setup_true_lang_tsx_name_Table = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
|
|
2116
2120
|
__name: 'Table',
|
|
2117
2121
|
props: {
|
|
@@ -2138,6 +2142,9 @@ const TableSettingButton_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(T
|
|
|
2138
2142
|
Function,
|
|
2139
2143
|
String
|
|
2140
2144
|
]
|
|
2145
|
+
},
|
|
2146
|
+
scrollLoading: {
|
|
2147
|
+
type: Boolean
|
|
2141
2148
|
}
|
|
2142
2149
|
},
|
|
2143
2150
|
emits: [
|
|
@@ -2197,6 +2204,18 @@ const TableSettingButton_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(T
|
|
|
2197
2204
|
"row-class-name": rowClassNameAdapter,
|
|
2198
2205
|
border: ""
|
|
2199
2206
|
}, _ctx.$attrs), {
|
|
2207
|
+
append: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
|
|
2208
|
+
_ctx.$slots.append ? (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderSlot)(_ctx.$slots, "append", {
|
|
2209
|
+
key: 0
|
|
2210
|
+
}) : props.scrollLoading ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("div", Tablevue_type_script_setup_true_lang_tsx_name_Table_hoisted_1, _cache[1] || (_cache[1] = [
|
|
2211
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", {
|
|
2212
|
+
class: "text-sm text-gray-500"
|
|
2213
|
+
}, "加载中...", -1)
|
|
2214
|
+
]))) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true)
|
|
2215
|
+
]),
|
|
2216
|
+
empty: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
|
|
2217
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.renderSlot)(_ctx.$slots, "empty")
|
|
2218
|
+
]),
|
|
2200
2219
|
default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
|
|
2201
2220
|
((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(true), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderList)(props.tableColumns, (item, index)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(RenderColumn, {
|
|
2202
2221
|
"column-obj": item,
|
|
@@ -2340,6 +2359,12 @@ const SELECTION = 'selection';
|
|
|
2340
2359
|
pageInfo: {
|
|
2341
2360
|
default: void 0
|
|
2342
2361
|
},
|
|
2362
|
+
scrollLoading: {
|
|
2363
|
+
type: Boolean
|
|
2364
|
+
},
|
|
2365
|
+
scrollThreshold: {
|
|
2366
|
+
default: 80
|
|
2367
|
+
},
|
|
2343
2368
|
componentNo: {
|
|
2344
2369
|
default: ''
|
|
2345
2370
|
},
|
|
@@ -2452,6 +2477,7 @@ const SELECTION = 'selection';
|
|
|
2452
2477
|
// 新增:Sortable实例引用
|
|
2453
2478
|
let sortableInstance = null;
|
|
2454
2479
|
const refreshIndex = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(0);
|
|
2480
|
+
let oldScrollTop = 0;
|
|
2455
2481
|
// 定义 emit 事件
|
|
2456
2482
|
const emit = __emit;
|
|
2457
2483
|
const attrs = (0, __WEBPACK_EXTERNAL_MODULE_vue__.useAttrs)();
|
|
@@ -2828,11 +2854,12 @@ const SELECTION = 'selection';
|
|
|
2828
2854
|
// 获取表格容器元素
|
|
2829
2855
|
const clientHeight = document.querySelector(`#${uuid.value} .el-table__body-wrapper`)?.clientHeight;
|
|
2830
2856
|
const scrollHeight = document.querySelector(`#${uuid.value} .el-table__body`)?.scrollHeight;
|
|
2831
|
-
const threshold =
|
|
2832
|
-
if (scrollHeight - event.scrollTop - clientHeight < threshold) {
|
|
2857
|
+
const threshold = props.scrollThreshold; // 距离底部80px时触发加载
|
|
2858
|
+
if (scrollHeight - event.scrollTop - clientHeight < threshold && event.scrollTop > oldScrollTop) {
|
|
2833
2859
|
console.log('触发加载更多数据');
|
|
2834
2860
|
props.scrollLoad();
|
|
2835
2861
|
}
|
|
2862
|
+
oldScrollTop = event.scrollTop;
|
|
2836
2863
|
}
|
|
2837
2864
|
let debounceScroll = (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.debounce)(handleTableScroll, 500);
|
|
2838
2865
|
/**
|
|
@@ -2919,6 +2946,7 @@ const SELECTION = 'selection';
|
|
|
2919
2946
|
if (props.scrollLoad) (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(debounceScroll)(event);
|
|
2920
2947
|
emit('scroll', event);
|
|
2921
2948
|
}),
|
|
2949
|
+
"scroll-loading": props.scrollLoading,
|
|
2922
2950
|
"export-file-flag": exportFileFlag.value,
|
|
2923
2951
|
componentDesc: componentDesc.value,
|
|
2924
2952
|
key: refreshIndex.value,
|
|
@@ -2927,7 +2955,7 @@ const SELECTION = 'selection';
|
|
|
2927
2955
|
"show-setting": showSetting.value,
|
|
2928
2956
|
stripe: props.stripe,
|
|
2929
2957
|
"columns-setting": props.columnsSetting,
|
|
2930
|
-
loading: (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(state).loading || props.loading,
|
|
2958
|
+
loading: ((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(state).loading || props.loading) && !props.scrollLoading,
|
|
2931
2959
|
onSuccess: fetchDbgridComponent,
|
|
2932
2960
|
onSortChange: sortChange,
|
|
2933
2961
|
ref_key: "tableRef",
|
|
@@ -2949,6 +2977,7 @@ const SELECTION = 'selection';
|
|
|
2949
2977
|
}))
|
|
2950
2978
|
]), 1040, [
|
|
2951
2979
|
"id",
|
|
2980
|
+
"scroll-loading",
|
|
2952
2981
|
"export-file-flag",
|
|
2953
2982
|
"componentDesc",
|
|
2954
2983
|
"common-columns",
|
|
@@ -2989,7 +3018,7 @@ const SELECTION = 'selection';
|
|
|
2989
3018
|
});
|
|
2990
3019
|
const pro_table_exports_ = pro_tablevue_type_script_lang_ts_setup_true_name_ProTable;
|
|
2991
3020
|
/* ESM default export */ const pro_table = pro_table_exports_;
|
|
2992
|
-
const
|
|
3021
|
+
const composables_Tablevue_type_script_setup_true_lang_tsx_name_Table_hoisted_1 = {
|
|
2993
3022
|
class: "min-h-0 flex-1"
|
|
2994
3023
|
};
|
|
2995
3024
|
/* ESM default export */ const composables_Tablevue_type_script_setup_true_lang_tsx_name_Table = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
|
|
@@ -3046,7 +3075,7 @@ const Tablevue_type_script_setup_true_lang_tsx_name_Table_hoisted_1 = {
|
|
|
3046
3075
|
"columns-setting",
|
|
3047
3076
|
"columns"
|
|
3048
3077
|
])) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true),
|
|
3049
|
-
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div",
|
|
3078
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", composables_Tablevue_type_script_setup_true_lang_tsx_name_Table_hoisted_1, [
|
|
3050
3079
|
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElAutoResizer), null, {
|
|
3051
3080
|
default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(({ height, width })=>[
|
|
3052
3081
|
(0, __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives)((0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElTableV2), (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
|