sun-biz 0.0.4-beta.32 → 0.0.4-beta.34
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 +32 -23
- package/dist/components/static/css/index.css +3 -3
- package/dist/index.js +32 -23
- package/dist/static/css/index.css +3 -3
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -1845,7 +1845,7 @@ function dbgrid_component_settingvue_type_script_setup_true_lang_tsx_isSlot(s) {
|
|
|
1845
1845
|
const dbgrid_component_setting_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(dbgrid_component_settingvue_type_script_setup_true_lang_tsx, [
|
|
1846
1846
|
[
|
|
1847
1847
|
'__scopeId',
|
|
1848
|
-
"data-v-
|
|
1848
|
+
"data-v-00469ccc"
|
|
1849
1849
|
]
|
|
1850
1850
|
]);
|
|
1851
1851
|
/* ESM default export */ const dbgrid_component_setting = dbgrid_component_setting_exports_;
|
|
@@ -1878,11 +1878,11 @@ const tableColumnSetting = (options)=>{
|
|
|
1878
1878
|
createColumnSetting(options, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_micro_app__.app?._context);
|
|
1879
1879
|
};
|
|
1880
1880
|
const TableSettingButtonvue_type_script_setup_true_lang_tsx_hoisted_1 = {
|
|
1881
|
-
class: "el-dropdown-link absolute left-
|
|
1881
|
+
class: "el-dropdown-link absolute left-1 top-2 z-50 cursor-pointer text-primary"
|
|
1882
1882
|
};
|
|
1883
|
-
const FILE_TYPE_CODE =
|
|
1884
|
-
const COLUMN_SETTING =
|
|
1885
|
-
const EXPORT_FILE =
|
|
1883
|
+
const FILE_TYPE_CODE = "FILE_TYPE_CODE";
|
|
1884
|
+
const COLUMN_SETTING = "column-setting";
|
|
1885
|
+
const EXPORT_FILE = "export-file";
|
|
1886
1886
|
/* ESM default export */ const TableSettingButtonvue_type_script_setup_true_lang_tsx = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
|
|
1887
1887
|
__name: 'TableSettingButton',
|
|
1888
1888
|
props: {
|
|
@@ -1894,7 +1894,7 @@ const EXPORT_FILE = 'export-file';
|
|
|
1894
1894
|
componentDesc: {}
|
|
1895
1895
|
},
|
|
1896
1896
|
emits: [
|
|
1897
|
-
|
|
1897
|
+
"success"
|
|
1898
1898
|
],
|
|
1899
1899
|
setup (__props, { emit: __emit }) {
|
|
1900
1900
|
const dataSetList = use_fetch_dataset([
|
|
@@ -1907,7 +1907,7 @@ const EXPORT_FILE = 'export-file';
|
|
|
1907
1907
|
let result = [
|
|
1908
1908
|
{
|
|
1909
1909
|
value: COLUMN_SETTING,
|
|
1910
|
-
label:
|
|
1910
|
+
label: "表格设置",
|
|
1911
1911
|
children: []
|
|
1912
1912
|
}
|
|
1913
1913
|
];
|
|
@@ -1915,13 +1915,13 @@ const EXPORT_FILE = 'export-file';
|
|
|
1915
1915
|
let list = dataSetList.value?.[FILE_TYPE_CODE] || [];
|
|
1916
1916
|
if (1 === list.length) result.push({
|
|
1917
1917
|
value: list[0]?.dataValueNo,
|
|
1918
|
-
label:
|
|
1918
|
+
label: "导出文件",
|
|
1919
1919
|
disabled: !props.tableData.length,
|
|
1920
1920
|
children: []
|
|
1921
1921
|
});
|
|
1922
1922
|
if (list.length > 1) result.push({
|
|
1923
1923
|
value: EXPORT_FILE,
|
|
1924
|
-
label:
|
|
1924
|
+
label: "导出文件",
|
|
1925
1925
|
disabled: !props.tableData.length,
|
|
1926
1926
|
children: list.map((item)=>({
|
|
1927
1927
|
value: item?.dataValueNo,
|
|
@@ -1932,15 +1932,15 @@ const EXPORT_FILE = 'export-file';
|
|
|
1932
1932
|
return result;
|
|
1933
1933
|
});
|
|
1934
1934
|
const getRenderedContent = (render, row, index)=>{
|
|
1935
|
-
const tempDiv = document.createElement(
|
|
1935
|
+
const tempDiv = document.createElement("div");
|
|
1936
1936
|
const app = (0, __WEBPACK_EXTERNAL_MODULE_vue__.createApp)({
|
|
1937
1937
|
render () {
|
|
1938
|
-
return (0, __WEBPACK_EXTERNAL_MODULE_vue__.h)(
|
|
1938
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_vue__.h)("div", {}, render(row, index));
|
|
1939
1939
|
}
|
|
1940
1940
|
});
|
|
1941
1941
|
app.use(__WEBPACK_EXTERNAL_MODULE_element_sun__["default"]);
|
|
1942
1942
|
app.mount(tempDiv);
|
|
1943
|
-
const content = tempDiv.textContent ||
|
|
1943
|
+
const content = tempDiv.textContent || "";
|
|
1944
1944
|
app.unmount();
|
|
1945
1945
|
return content;
|
|
1946
1946
|
};
|
|
@@ -1956,7 +1956,7 @@ const EXPORT_FILE = 'export-file';
|
|
|
1956
1956
|
rowSequenceNo: index,
|
|
1957
1957
|
rowRecordList: props.columns.filter((col)=>col.prop && col.displayFlag === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.ENABLED_FLAG.YES && col.prop !== OPERATION).map((col)=>{
|
|
1958
1958
|
let value = item[col.prop];
|
|
1959
|
-
if (
|
|
1959
|
+
if ("function" == typeof col.render) try {
|
|
1960
1960
|
value = getRenderedContent(col.render, item, index) || value;
|
|
1961
1961
|
} catch (error) {
|
|
1962
1962
|
console.warn(`Render function error for column ${col.prop}:`, error);
|
|
@@ -1974,7 +1974,7 @@ const EXPORT_FILE = 'export-file';
|
|
|
1974
1974
|
fileName: `${props.componentDesc}.xlsx`,
|
|
1975
1975
|
data: res?.data?.fileString
|
|
1976
1976
|
});
|
|
1977
|
-
__WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.success(
|
|
1977
|
+
__WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.success("导出成功");
|
|
1978
1978
|
}
|
|
1979
1979
|
}
|
|
1980
1980
|
function hide() {
|
|
@@ -1987,7 +1987,7 @@ const EXPORT_FILE = 'export-file';
|
|
|
1987
1987
|
componentNo: props.componentNo,
|
|
1988
1988
|
columnsSetting: props.columnsSetting,
|
|
1989
1989
|
success: ()=>{
|
|
1990
|
-
emit(
|
|
1990
|
+
emit("success");
|
|
1991
1991
|
}
|
|
1992
1992
|
});
|
|
1993
1993
|
}
|
|
@@ -2072,7 +2072,7 @@ const EXPORT_FILE = 'export-file';
|
|
|
2072
2072
|
})) : ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("span", {
|
|
2073
2073
|
key: 1,
|
|
2074
2074
|
onClick: openColumnSetting,
|
|
2075
|
-
class: (0, __WEBPACK_EXTERNAL_MODULE_vue__.normalizeClass)(`el-dropdown-link absolute left-
|
|
2075
|
+
class: (0, __WEBPACK_EXTERNAL_MODULE_vue__.normalizeClass)(`el-dropdown-link absolute left-1 top-2 z-50 ${props.columnsSetting?.disabled ? 'cursor-not-allowed text-primary' : 'cursor-pointer text-primary-dark'}`)
|
|
2076
2076
|
}, [
|
|
2077
2077
|
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElIcon), null, {
|
|
2078
2078
|
default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
|
|
@@ -2087,7 +2087,7 @@ const EXPORT_FILE = 'export-file';
|
|
|
2087
2087
|
const TableSettingButton_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(TableSettingButtonvue_type_script_setup_true_lang_tsx, [
|
|
2088
2088
|
[
|
|
2089
2089
|
'__scopeId',
|
|
2090
|
-
"data-v-
|
|
2090
|
+
"data-v-0aa25cee"
|
|
2091
2091
|
]
|
|
2092
2092
|
]);
|
|
2093
2093
|
/* ESM default export */ const TableSettingButton = TableSettingButton_exports_;
|
|
@@ -2417,6 +2417,12 @@ const SELECTION = 'selection';
|
|
|
2417
2417
|
dragTipsClassName: {
|
|
2418
2418
|
default: ''
|
|
2419
2419
|
},
|
|
2420
|
+
settingIconWidth: {
|
|
2421
|
+
default: 36
|
|
2422
|
+
},
|
|
2423
|
+
columnsConfig: {
|
|
2424
|
+
default: ()=>[]
|
|
2425
|
+
},
|
|
2420
2426
|
scrollLoad: {
|
|
2421
2427
|
type: Function,
|
|
2422
2428
|
default: void 0
|
|
@@ -2428,7 +2434,7 @@ const SELECTION = 'selection';
|
|
|
2428
2434
|
"current-page-change",
|
|
2429
2435
|
"sort-change",
|
|
2430
2436
|
"scroll",
|
|
2431
|
-
"columns-change"
|
|
2437
|
+
"columns-config-change"
|
|
2432
2438
|
],
|
|
2433
2439
|
setup (__props, { expose: __expose, emit: __emit }) {
|
|
2434
2440
|
const props = __props;
|
|
@@ -2673,6 +2679,7 @@ const SELECTION = 'selection';
|
|
|
2673
2679
|
}));
|
|
2674
2680
|
proTableRef.value?.clearSort();
|
|
2675
2681
|
serveColumns.value = column;
|
|
2682
|
+
emit('columns-config-change', column);
|
|
2676
2683
|
} catch (error) {
|
|
2677
2684
|
console.log(error);
|
|
2678
2685
|
}
|
|
@@ -2801,7 +2808,7 @@ const SELECTION = 'selection';
|
|
|
2801
2808
|
...item
|
|
2802
2809
|
};
|
|
2803
2810
|
});
|
|
2804
|
-
if (!props.componentNo) return propsColumns;
|
|
2811
|
+
if (!(props.componentNo || serveColumns.value?.length)) return propsColumns;
|
|
2805
2812
|
{
|
|
2806
2813
|
let result = propsColumns.map((cur)=>({
|
|
2807
2814
|
displayFlag: cur.isHidden || cur.defaultDisplayFlag === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.ENABLED_FLAG.NO ? __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.ENABLED_FLAG.NO : __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.ENABLED_FLAG.YES,
|
|
@@ -2835,7 +2842,9 @@ const SELECTION = 'selection';
|
|
|
2835
2842
|
const clientHeight = document.querySelector(`#${uuid.value} .el-table__body-wrapper`)?.clientHeight;
|
|
2836
2843
|
const scrollHeight = document.querySelector(`#${uuid.value} .el-table__body`)?.scrollHeight;
|
|
2837
2844
|
const threshold = props.scrollThreshold; // 距离底部80px时触发加载
|
|
2838
|
-
|
|
2845
|
+
const bottomOffset = scrollHeight - event.scrollTop - clientHeight;
|
|
2846
|
+
if (event.scrollTop < oldScrollTop && 0 === bottomOffset) proTableRef.value.setScrollTop(0);
|
|
2847
|
+
if (bottomOffset < threshold && event.scrollTop > oldScrollTop) {
|
|
2839
2848
|
console.log('触发加载更多数据');
|
|
2840
2849
|
props.scrollLoad();
|
|
2841
2850
|
}
|
|
@@ -2851,7 +2860,7 @@ const SELECTION = 'selection';
|
|
|
2851
2860
|
if (props.componentNo) {
|
|
2852
2861
|
result = result.map((item, index)=>({
|
|
2853
2862
|
...item,
|
|
2854
|
-
minWidth: 0 === index ? (item.minWidth ||
|
|
2863
|
+
minWidth: 0 === index ? (item.minWidth || props.settingIconWidth) + props.settingIconWidth : item.minWidth
|
|
2855
2864
|
}));
|
|
2856
2865
|
if (exportFileFlag.value && !result.find((cur)=>cur.type === SELECTION)) result = [
|
|
2857
2866
|
{
|
|
@@ -2866,8 +2875,8 @@ const SELECTION = 'selection';
|
|
|
2866
2875
|
return result.filter((item)=>!item.isHidden && !(props.componentNo && !serveColumns.value?.length && item.defaultDisplayFlag === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.ENABLED_FLAG.NO));
|
|
2867
2876
|
});
|
|
2868
2877
|
// 当 componentNo 存在时,监听 tableColumns 变化,触发 columns-change 事件
|
|
2869
|
-
|
|
2870
|
-
|
|
2878
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.watch)(()=>props.columnsConfig, (newColumnsConfig)=>{
|
|
2879
|
+
if (!props.componentNo && newColumnsConfig?.length) serveColumns.value = newColumnsConfig;
|
|
2871
2880
|
}, {
|
|
2872
2881
|
immediate: true
|
|
2873
2882
|
});
|
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
[data-v-
|
|
9
|
+
[data-v-0aa25cee] .el-menu-item {
|
|
10
10
|
height: 48px;
|
|
11
11
|
line-height: 48px;
|
|
12
12
|
}
|
|
13
|
-
[data-v-
|
|
13
|
+
[data-v-0aa25cee] .el-sub-menu__title {
|
|
14
14
|
height: 48px;
|
|
15
15
|
line-height: 48px;
|
|
16
16
|
}
|
|
17
|
-
[data-v-
|
|
17
|
+
[data-v-0aa25cee] .el-menu-item.is-active {
|
|
18
18
|
color: inherit !important;
|
|
19
19
|
background-color: #0000 !important;
|
|
20
20
|
}
|
package/dist/index.js
CHANGED
|
@@ -1881,7 +1881,7 @@ function dbgrid_component_settingvue_type_script_setup_true_lang_tsx_isSlot(s) {
|
|
|
1881
1881
|
const dbgrid_component_setting_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(dbgrid_component_settingvue_type_script_setup_true_lang_tsx, [
|
|
1882
1882
|
[
|
|
1883
1883
|
'__scopeId',
|
|
1884
|
-
"data-v-
|
|
1884
|
+
"data-v-00469ccc"
|
|
1885
1885
|
]
|
|
1886
1886
|
]);
|
|
1887
1887
|
/* ESM default export */ const dbgrid_component_setting = dbgrid_component_setting_exports_;
|
|
@@ -1914,11 +1914,11 @@ const tableColumnSetting = (options)=>{
|
|
|
1914
1914
|
createColumnSetting(options, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_micro_app__.app?._context);
|
|
1915
1915
|
};
|
|
1916
1916
|
const TableSettingButtonvue_type_script_setup_true_lang_tsx_hoisted_1 = {
|
|
1917
|
-
class: "el-dropdown-link absolute left-
|
|
1917
|
+
class: "el-dropdown-link absolute left-1 top-2 z-50 cursor-pointer text-primary"
|
|
1918
1918
|
};
|
|
1919
|
-
const FILE_TYPE_CODE =
|
|
1920
|
-
const COLUMN_SETTING =
|
|
1921
|
-
const EXPORT_FILE =
|
|
1919
|
+
const FILE_TYPE_CODE = "FILE_TYPE_CODE";
|
|
1920
|
+
const COLUMN_SETTING = "column-setting";
|
|
1921
|
+
const EXPORT_FILE = "export-file";
|
|
1922
1922
|
/* ESM default export */ const TableSettingButtonvue_type_script_setup_true_lang_tsx = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
|
|
1923
1923
|
__name: 'TableSettingButton',
|
|
1924
1924
|
props: {
|
|
@@ -1930,7 +1930,7 @@ const EXPORT_FILE = 'export-file';
|
|
|
1930
1930
|
componentDesc: {}
|
|
1931
1931
|
},
|
|
1932
1932
|
emits: [
|
|
1933
|
-
|
|
1933
|
+
"success"
|
|
1934
1934
|
],
|
|
1935
1935
|
setup (__props, { emit: __emit }) {
|
|
1936
1936
|
const dataSetList = use_fetch_dataset([
|
|
@@ -1943,7 +1943,7 @@ const EXPORT_FILE = 'export-file';
|
|
|
1943
1943
|
let result = [
|
|
1944
1944
|
{
|
|
1945
1945
|
value: COLUMN_SETTING,
|
|
1946
|
-
label:
|
|
1946
|
+
label: "表格设置",
|
|
1947
1947
|
children: []
|
|
1948
1948
|
}
|
|
1949
1949
|
];
|
|
@@ -1951,13 +1951,13 @@ const EXPORT_FILE = 'export-file';
|
|
|
1951
1951
|
let list = dataSetList.value?.[FILE_TYPE_CODE] || [];
|
|
1952
1952
|
if (1 === list.length) result.push({
|
|
1953
1953
|
value: list[0]?.dataValueNo,
|
|
1954
|
-
label:
|
|
1954
|
+
label: "导出文件",
|
|
1955
1955
|
disabled: !props.tableData.length,
|
|
1956
1956
|
children: []
|
|
1957
1957
|
});
|
|
1958
1958
|
if (list.length > 1) result.push({
|
|
1959
1959
|
value: EXPORT_FILE,
|
|
1960
|
-
label:
|
|
1960
|
+
label: "导出文件",
|
|
1961
1961
|
disabled: !props.tableData.length,
|
|
1962
1962
|
children: list.map((item)=>({
|
|
1963
1963
|
value: item?.dataValueNo,
|
|
@@ -1968,15 +1968,15 @@ const EXPORT_FILE = 'export-file';
|
|
|
1968
1968
|
return result;
|
|
1969
1969
|
});
|
|
1970
1970
|
const getRenderedContent = (render, row, index)=>{
|
|
1971
|
-
const tempDiv = document.createElement(
|
|
1971
|
+
const tempDiv = document.createElement("div");
|
|
1972
1972
|
const app = (0, __WEBPACK_EXTERNAL_MODULE_vue__.createApp)({
|
|
1973
1973
|
render () {
|
|
1974
|
-
return (0, __WEBPACK_EXTERNAL_MODULE_vue__.h)(
|
|
1974
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_vue__.h)("div", {}, render(row, index));
|
|
1975
1975
|
}
|
|
1976
1976
|
});
|
|
1977
1977
|
app.use(__WEBPACK_EXTERNAL_MODULE_element_sun__["default"]);
|
|
1978
1978
|
app.mount(tempDiv);
|
|
1979
|
-
const content = tempDiv.textContent ||
|
|
1979
|
+
const content = tempDiv.textContent || "";
|
|
1980
1980
|
app.unmount();
|
|
1981
1981
|
return content;
|
|
1982
1982
|
};
|
|
@@ -1992,7 +1992,7 @@ const EXPORT_FILE = 'export-file';
|
|
|
1992
1992
|
rowSequenceNo: index,
|
|
1993
1993
|
rowRecordList: props.columns.filter((col)=>col.prop && col.displayFlag === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.ENABLED_FLAG.YES && col.prop !== OPERATION).map((col)=>{
|
|
1994
1994
|
let value = item[col.prop];
|
|
1995
|
-
if (
|
|
1995
|
+
if ("function" == typeof col.render) try {
|
|
1996
1996
|
value = getRenderedContent(col.render, item, index) || value;
|
|
1997
1997
|
} catch (error) {
|
|
1998
1998
|
console.warn(`Render function error for column ${col.prop}:`, error);
|
|
@@ -2010,7 +2010,7 @@ const EXPORT_FILE = 'export-file';
|
|
|
2010
2010
|
fileName: `${props.componentDesc}.xlsx`,
|
|
2011
2011
|
data: res?.data?.fileString
|
|
2012
2012
|
});
|
|
2013
|
-
__WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.success(
|
|
2013
|
+
__WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.success("导出成功");
|
|
2014
2014
|
}
|
|
2015
2015
|
}
|
|
2016
2016
|
function hide() {
|
|
@@ -2023,7 +2023,7 @@ const EXPORT_FILE = 'export-file';
|
|
|
2023
2023
|
componentNo: props.componentNo,
|
|
2024
2024
|
columnsSetting: props.columnsSetting,
|
|
2025
2025
|
success: ()=>{
|
|
2026
|
-
emit(
|
|
2026
|
+
emit("success");
|
|
2027
2027
|
}
|
|
2028
2028
|
});
|
|
2029
2029
|
}
|
|
@@ -2108,7 +2108,7 @@ const EXPORT_FILE = 'export-file';
|
|
|
2108
2108
|
})) : ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("span", {
|
|
2109
2109
|
key: 1,
|
|
2110
2110
|
onClick: openColumnSetting,
|
|
2111
|
-
class: (0, __WEBPACK_EXTERNAL_MODULE_vue__.normalizeClass)(`el-dropdown-link absolute left-
|
|
2111
|
+
class: (0, __WEBPACK_EXTERNAL_MODULE_vue__.normalizeClass)(`el-dropdown-link absolute left-1 top-2 z-50 ${props.columnsSetting?.disabled ? 'cursor-not-allowed text-primary' : 'cursor-pointer text-primary-dark'}`)
|
|
2112
2112
|
}, [
|
|
2113
2113
|
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElIcon), null, {
|
|
2114
2114
|
default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
|
|
@@ -2123,7 +2123,7 @@ const EXPORT_FILE = 'export-file';
|
|
|
2123
2123
|
const TableSettingButton_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(TableSettingButtonvue_type_script_setup_true_lang_tsx, [
|
|
2124
2124
|
[
|
|
2125
2125
|
'__scopeId',
|
|
2126
|
-
"data-v-
|
|
2126
|
+
"data-v-0aa25cee"
|
|
2127
2127
|
]
|
|
2128
2128
|
]);
|
|
2129
2129
|
/* ESM default export */ const TableSettingButton = TableSettingButton_exports_;
|
|
@@ -2453,6 +2453,12 @@ const SELECTION = 'selection';
|
|
|
2453
2453
|
dragTipsClassName: {
|
|
2454
2454
|
default: ''
|
|
2455
2455
|
},
|
|
2456
|
+
settingIconWidth: {
|
|
2457
|
+
default: 36
|
|
2458
|
+
},
|
|
2459
|
+
columnsConfig: {
|
|
2460
|
+
default: ()=>[]
|
|
2461
|
+
},
|
|
2456
2462
|
scrollLoad: {
|
|
2457
2463
|
type: Function,
|
|
2458
2464
|
default: void 0
|
|
@@ -2464,7 +2470,7 @@ const SELECTION = 'selection';
|
|
|
2464
2470
|
"current-page-change",
|
|
2465
2471
|
"sort-change",
|
|
2466
2472
|
"scroll",
|
|
2467
|
-
"columns-change"
|
|
2473
|
+
"columns-config-change"
|
|
2468
2474
|
],
|
|
2469
2475
|
setup (__props, { expose: __expose, emit: __emit }) {
|
|
2470
2476
|
const props = __props;
|
|
@@ -2709,6 +2715,7 @@ const SELECTION = 'selection';
|
|
|
2709
2715
|
}));
|
|
2710
2716
|
proTableRef.value?.clearSort();
|
|
2711
2717
|
serveColumns.value = column;
|
|
2718
|
+
emit('columns-config-change', column);
|
|
2712
2719
|
} catch (error) {
|
|
2713
2720
|
console.log(error);
|
|
2714
2721
|
}
|
|
@@ -2837,7 +2844,7 @@ const SELECTION = 'selection';
|
|
|
2837
2844
|
...item
|
|
2838
2845
|
};
|
|
2839
2846
|
});
|
|
2840
|
-
if (!props.componentNo) return propsColumns;
|
|
2847
|
+
if (!(props.componentNo || serveColumns.value?.length)) return propsColumns;
|
|
2841
2848
|
{
|
|
2842
2849
|
let result = propsColumns.map((cur)=>({
|
|
2843
2850
|
displayFlag: cur.isHidden || cur.defaultDisplayFlag === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.ENABLED_FLAG.NO ? __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.ENABLED_FLAG.NO : __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.ENABLED_FLAG.YES,
|
|
@@ -2871,7 +2878,9 @@ const SELECTION = 'selection';
|
|
|
2871
2878
|
const clientHeight = document.querySelector(`#${uuid.value} .el-table__body-wrapper`)?.clientHeight;
|
|
2872
2879
|
const scrollHeight = document.querySelector(`#${uuid.value} .el-table__body`)?.scrollHeight;
|
|
2873
2880
|
const threshold = props.scrollThreshold; // 距离底部80px时触发加载
|
|
2874
|
-
|
|
2881
|
+
const bottomOffset = scrollHeight - event.scrollTop - clientHeight;
|
|
2882
|
+
if (event.scrollTop < oldScrollTop && 0 === bottomOffset) proTableRef.value.setScrollTop(0);
|
|
2883
|
+
if (bottomOffset < threshold && event.scrollTop > oldScrollTop) {
|
|
2875
2884
|
console.log('触发加载更多数据');
|
|
2876
2885
|
props.scrollLoad();
|
|
2877
2886
|
}
|
|
@@ -2887,7 +2896,7 @@ const SELECTION = 'selection';
|
|
|
2887
2896
|
if (props.componentNo) {
|
|
2888
2897
|
result = result.map((item, index)=>({
|
|
2889
2898
|
...item,
|
|
2890
|
-
minWidth: 0 === index ? (item.minWidth ||
|
|
2899
|
+
minWidth: 0 === index ? (item.minWidth || props.settingIconWidth) + props.settingIconWidth : item.minWidth
|
|
2891
2900
|
}));
|
|
2892
2901
|
if (exportFileFlag.value && !result.find((cur)=>cur.type === SELECTION)) result = [
|
|
2893
2902
|
{
|
|
@@ -2902,8 +2911,8 @@ const SELECTION = 'selection';
|
|
|
2902
2911
|
return result.filter((item)=>!item.isHidden && !(props.componentNo && !serveColumns.value?.length && item.defaultDisplayFlag === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.ENABLED_FLAG.NO));
|
|
2903
2912
|
});
|
|
2904
2913
|
// 当 componentNo 存在时,监听 tableColumns 变化,触发 columns-change 事件
|
|
2905
|
-
|
|
2906
|
-
|
|
2914
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.watch)(()=>props.columnsConfig, (newColumnsConfig)=>{
|
|
2915
|
+
if (!props.componentNo && newColumnsConfig?.length) serveColumns.value = newColumnsConfig;
|
|
2907
2916
|
}, {
|
|
2908
2917
|
immediate: true
|
|
2909
2918
|
});
|
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
[data-v-
|
|
9
|
+
[data-v-0aa25cee] .el-menu-item {
|
|
10
10
|
height: 48px;
|
|
11
11
|
line-height: 48px;
|
|
12
12
|
}
|
|
13
|
-
[data-v-
|
|
13
|
+
[data-v-0aa25cee] .el-sub-menu__title {
|
|
14
14
|
height: 48px;
|
|
15
15
|
line-height: 48px;
|
|
16
16
|
}
|
|
17
|
-
[data-v-
|
|
17
|
+
[data-v-0aa25cee] .el-menu-item.is-active {
|
|
18
18
|
color: inherit !important;
|
|
19
19
|
background-color: #0000 !important;
|
|
20
20
|
}
|