@bit-sun/business-component 2.1.1-alpha.19 → 2.1.1-alpha.20
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/index.esm.js +1 -6
- package/dist/index.js +1 -6
- package/package.json +1 -1
- package/src/components/Business/BsSulaQueryTable/index.tsx +2 -2
- package/src/components/Business/columnSettingTable/index.tsx +3 -3
- package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +3 -3
- package/src/utils/utils.ts +40 -2
package/dist/index.esm.js
CHANGED
|
@@ -15974,8 +15974,6 @@ var ColumnSettingSulaTable = /*#__PURE__*/function (_React$Component) {
|
|
|
15974
15974
|
}),
|
|
15975
15975
|
summary: showSummary
|
|
15976
15976
|
});
|
|
15977
|
-
console.log('重新加载');
|
|
15978
|
-
console.log("\uD83D\uDE80 => render => showCol", showCol);
|
|
15979
15977
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
15980
15978
|
style: {
|
|
15981
15979
|
overflow: 'hidden',
|
|
@@ -16239,6 +16237,7 @@ var ColumnSettingTable = /*#__PURE__*/function (_React$Component) {
|
|
|
16239
16237
|
};
|
|
16240
16238
|
|
|
16241
16239
|
var showCol = this.state.showColumns.map(function (item) {
|
|
16240
|
+
handleColumnsSpecialParams(item);
|
|
16242
16241
|
return _objectSpread2({}, item);
|
|
16243
16242
|
});
|
|
16244
16243
|
handleColumns(showCol, []);
|
|
@@ -18005,10 +18004,6 @@ var index$5 = (function (props) {
|
|
|
18005
18004
|
JSON.stringify(newKeys) !== JSON.stringify(oldKeys) && setInitialTableInfo();
|
|
18006
18005
|
}
|
|
18007
18006
|
}, [props === null || props === void 0 ? void 0 : props.columns]);
|
|
18008
|
-
useEffect(function () {
|
|
18009
|
-
setInitialTableInfo();
|
|
18010
|
-
console.log('columns 重新加载');
|
|
18011
|
-
}, [props === null || props === void 0 ? void 0 : props.refreshParams]);
|
|
18012
18007
|
var watchWinResize = debounce(function () {
|
|
18013
18008
|
getTableHeight();
|
|
18014
18009
|
|
package/dist/index.js
CHANGED
|
@@ -15988,8 +15988,6 @@ var ColumnSettingSulaTable = /*#__PURE__*/function (_React$Component) {
|
|
|
15988
15988
|
}),
|
|
15989
15989
|
summary: showSummary
|
|
15990
15990
|
});
|
|
15991
|
-
console.log('重新加载');
|
|
15992
|
-
console.log("\uD83D\uDE80 => render => showCol", showCol);
|
|
15993
15991
|
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
15994
15992
|
style: {
|
|
15995
15993
|
overflow: 'hidden',
|
|
@@ -16253,6 +16251,7 @@ var ColumnSettingTable = /*#__PURE__*/function (_React$Component) {
|
|
|
16253
16251
|
};
|
|
16254
16252
|
|
|
16255
16253
|
var showCol = this.state.showColumns.map(function (item) {
|
|
16254
|
+
handleColumnsSpecialParams(item);
|
|
16256
16255
|
return _objectSpread2({}, item);
|
|
16257
16256
|
});
|
|
16258
16257
|
handleColumns(showCol, []);
|
|
@@ -18019,10 +18018,6 @@ var index$5 = (function (props) {
|
|
|
18019
18018
|
JSON.stringify(newKeys) !== JSON.stringify(oldKeys) && setInitialTableInfo();
|
|
18020
18019
|
}
|
|
18021
18020
|
}, [props === null || props === void 0 ? void 0 : props.columns]);
|
|
18022
|
-
React.useEffect(function () {
|
|
18023
|
-
setInitialTableInfo();
|
|
18024
|
-
console.log('columns 重新加载');
|
|
18025
|
-
}, [props === null || props === void 0 ? void 0 : props.refreshParams]);
|
|
18026
18021
|
var watchWinResize = _.debounce(function () {
|
|
18027
18022
|
getTableHeight();
|
|
18028
18023
|
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@ import scanning from '../../../assets/scanning.svg';
|
|
|
16
16
|
import { debounce } from 'lodash';
|
|
17
17
|
import ExportIcon from '@/components/Functional/ExportFunctions/ExportIcon';
|
|
18
18
|
import ENUM from '@/utils/enumConfig';
|
|
19
|
-
import {
|
|
19
|
+
import { handleBssulaColumnsSpecialParams } from '@/utils/utils';
|
|
20
20
|
|
|
21
21
|
const MemoQueryTable = React.memo(QueryTable);
|
|
22
22
|
|
|
@@ -132,7 +132,7 @@ export default (props: any) => {
|
|
|
132
132
|
}
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
|
-
|
|
135
|
+
handleBssulaColumnsSpecialParams(d);
|
|
136
136
|
});
|
|
137
137
|
setCommonRenderFn(props.columns);
|
|
138
138
|
const authButton = localStorage.getItem(ENUM.BROWSER_CACHE.MAIN_AUTH_CODES)
|
|
@@ -5,7 +5,7 @@ import ColumnSetting from './columnSetting';
|
|
|
5
5
|
import { getItemDefaultWidth, handleTextOverflow } from './utils';
|
|
6
6
|
import { noEmptyArray } from './utils';
|
|
7
7
|
import ENUM from '@/utils/enumConfig';
|
|
8
|
-
import {
|
|
8
|
+
import { handleAntdColumnsSpecialParams } from '@/utils/utils';
|
|
9
9
|
const { Text } = Typography;
|
|
10
10
|
export default class ColumnSettingTable extends React.Component {
|
|
11
11
|
state: any;
|
|
@@ -118,7 +118,7 @@ export default class ColumnSettingTable extends React.Component {
|
|
|
118
118
|
...arr[i],
|
|
119
119
|
width: size.width,
|
|
120
120
|
};
|
|
121
|
-
|
|
121
|
+
handleAntdColumnsSpecialParams(arr[i]);
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
124
|
handleIndex(newColumns, [...index]);
|
|
@@ -186,7 +186,7 @@ export default class ColumnSettingTable extends React.Component {
|
|
|
186
186
|
})
|
|
187
187
|
};
|
|
188
188
|
let showCol = this.state.showColumns.map((item: any) => {
|
|
189
|
-
|
|
189
|
+
handleAntdColumnsSpecialParams(item);
|
|
190
190
|
return ({ ...item })
|
|
191
191
|
})
|
|
192
192
|
handleColumns(showCol, []);
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
Typography,
|
|
10
10
|
} from 'antd';
|
|
11
11
|
import ENUM from '@/utils/enumConfig';
|
|
12
|
-
import {
|
|
12
|
+
import { handleBssulaColumnsSpecialParams } from '@/utils/utils';
|
|
13
13
|
const { Text } = Typography;
|
|
14
14
|
export default class ColumnSettingSulaTable extends React.Component {
|
|
15
15
|
sulaTableRef: React.RefObject<unknown>;
|
|
@@ -124,7 +124,7 @@ export default class ColumnSettingSulaTable extends React.Component {
|
|
|
124
124
|
...arr[i],
|
|
125
125
|
width: size.width,
|
|
126
126
|
};
|
|
127
|
-
|
|
127
|
+
handleBssulaColumnsSpecialParams(arr[i]);
|
|
128
128
|
}
|
|
129
129
|
};
|
|
130
130
|
handleIndex(newColumns, [...index]);
|
|
@@ -192,7 +192,7 @@ export default class ColumnSettingSulaTable extends React.Component {
|
|
|
192
192
|
})
|
|
193
193
|
};
|
|
194
194
|
let showCol = this.state.showColumns.map((item: any) => {
|
|
195
|
-
|
|
195
|
+
handleBssulaColumnsSpecialParams(item);
|
|
196
196
|
return ({ ...item })
|
|
197
197
|
})
|
|
198
198
|
handleColumns(showCol, []);
|
package/src/utils/utils.ts
CHANGED
|
@@ -66,10 +66,10 @@ export const go2BackAndClose = () => {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
|
-
* 处理
|
|
69
|
+
* 处理bssulaTable的公共回显样式
|
|
70
70
|
* @param col 每一具体行
|
|
71
71
|
*/
|
|
72
|
-
export const
|
|
72
|
+
export const handleBssulaColumnsSpecialParams = (col: any) => {
|
|
73
73
|
if (col.timeRenderHour) {
|
|
74
74
|
col.render = ({ text }: any) =>
|
|
75
75
|
handleTooltipHours(text, col.timeRenderHour);
|
|
@@ -102,4 +102,42 @@ export const handleColumnsSpecialParams = (col: any) => {
|
|
|
102
102
|
// col.render = ({ text }: any) => text || '- -';
|
|
103
103
|
col.render = ({ text }: any) => text || '-/-';
|
|
104
104
|
}
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* 处理antdTable的公共回显样式
|
|
108
|
+
* @param col 每一具体行
|
|
109
|
+
*/
|
|
110
|
+
export const handleAntdColumnsSpecialParams = (col: any) => {
|
|
111
|
+
if (col.timeRenderHour) {
|
|
112
|
+
col.render = (text: any) =>
|
|
113
|
+
handleTooltipHours(text, col.timeRenderHour);
|
|
114
|
+
}
|
|
115
|
+
// 处理不显示 时分秒的时间
|
|
116
|
+
if (col.timeRender) {
|
|
117
|
+
col.render = (text: any) => handleTooltip(text, col.timeRender);
|
|
118
|
+
}
|
|
119
|
+
// 处理文字太长
|
|
120
|
+
if (col.textOverflow) {
|
|
121
|
+
col.render = (text: any) => handleTextOverflow(text);
|
|
122
|
+
}
|
|
123
|
+
if (col.images) {
|
|
124
|
+
col.render = (text: any) => tableColumnsImage(text);
|
|
125
|
+
}
|
|
126
|
+
if (col.double) {
|
|
127
|
+
col.render = (_: any, record: any) =>
|
|
128
|
+
handleTextDouble(record[col.textOne], record[col.textTwo]);
|
|
129
|
+
}
|
|
130
|
+
if (col.lineFeed) {
|
|
131
|
+
col.render = (text: any) => handleTextLineFeed(text);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// 处理序号
|
|
135
|
+
if (col.indexNumber) {
|
|
136
|
+
col.render = (_: any, __: any, index: any) => index + 1;
|
|
137
|
+
}
|
|
138
|
+
// 没有值默认显示 - -
|
|
139
|
+
if (!col.render) {
|
|
140
|
+
// col.render = ({ text }: any) => text || '- -';
|
|
141
|
+
col.render = (text: any) => text || '-/-';
|
|
142
|
+
}
|
|
105
143
|
}
|