@bit-sun/business-component 2.1.24 → 2.2.1
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
CHANGED
|
@@ -14298,7 +14298,7 @@ var handleBssulaColumnsSpecialParams = function handleBssulaColumnsSpecialParams
|
|
|
14298
14298
|
if (col.textOverflow) {
|
|
14299
14299
|
col.render = function (_ref3) {
|
|
14300
14300
|
var text = _ref3.text;
|
|
14301
|
-
return handleTextOverflow(text);
|
|
14301
|
+
return handleTextOverflow(text, col.width);
|
|
14302
14302
|
};
|
|
14303
14303
|
}
|
|
14304
14304
|
if (col.images) {
|
|
@@ -15483,7 +15483,7 @@ var SortableTable$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
15483
15483
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
15484
15484
|
key: item.key || item.dataIndex,
|
|
15485
15485
|
width: ((_innerItem$ = innerItem[0]) === null || _innerItem$ === void 0 ? void 0 : _innerItem$.width) || item.width,
|
|
15486
|
-
hidden: config.length
|
|
15486
|
+
hidden: config.length ? !innerItem.length : item.hidden
|
|
15487
15487
|
});
|
|
15488
15488
|
}),
|
|
15489
15489
|
defaultValue: datasource.map(function (item) {
|
|
@@ -15496,7 +15496,7 @@ var SortableTable$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
15496
15496
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
15497
15497
|
key: item.key || item.dataIndex,
|
|
15498
15498
|
width: ((_innerItem$2 = innerItem[0]) === null || _innerItem$2 === void 0 ? void 0 : _innerItem$2.width) || item.width,
|
|
15499
|
-
hidden: config.length
|
|
15499
|
+
hidden: config.length ? !innerItem.length : item.hidden
|
|
15500
15500
|
});
|
|
15501
15501
|
}),
|
|
15502
15502
|
sortDataSource: _toConsumableArray(showColumn)
|
|
@@ -15855,7 +15855,7 @@ var SortableTable$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
15855
15855
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
15856
15856
|
key: item.key || item.dataIndex,
|
|
15857
15857
|
width: ((_innerItem$3 = innerItem[0]) === null || _innerItem$3 === void 0 ? void 0 : _innerItem$3.width) || item.width,
|
|
15858
|
-
hidden: config.length
|
|
15858
|
+
hidden: config.length ? !innerItem.length : item.hidden
|
|
15859
15859
|
});
|
|
15860
15860
|
}),
|
|
15861
15861
|
defaultValue: datasource.map(function (item) {
|
|
@@ -15868,7 +15868,7 @@ var SortableTable$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
15868
15868
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
15869
15869
|
key: item.key || item.dataIndex,
|
|
15870
15870
|
width: ((_innerItem$4 = innerItem[0]) === null || _innerItem$4 === void 0 ? void 0 : _innerItem$4.width) || item.width,
|
|
15871
|
-
hidden: config.length
|
|
15871
|
+
hidden: config.length ? !innerItem.length : item.hidden
|
|
15872
15872
|
});
|
|
15873
15873
|
}),
|
|
15874
15874
|
sortDataSource: datasource.filter(function (item) {
|
|
@@ -16087,7 +16087,9 @@ var BsSulaQueryTable = (function (props) {
|
|
|
16087
16087
|
pagePath = _useState2[0],
|
|
16088
16088
|
setPagePath = _useState2[1];
|
|
16089
16089
|
// 获取 table columns中所有的 key 防止有的地方是 dataindex
|
|
16090
|
-
var _useState3 = useState(props.columns.
|
|
16090
|
+
var _useState3 = useState(props.columns.filter(function (col) {
|
|
16091
|
+
return !col.hidden;
|
|
16092
|
+
}).map(function (d) {
|
|
16091
16093
|
return Array.isArray(d.key || d.dataIndex) ? JSON.stringify(d.key || d.dataIndex) : d.key || d.dataIndex;
|
|
16092
16094
|
})),
|
|
16093
16095
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
@@ -16208,6 +16210,7 @@ var BsSulaQueryTable = (function (props) {
|
|
|
16208
16210
|
});
|
|
16209
16211
|
showColumns.forEach(function (item, index) {
|
|
16210
16212
|
item.width = item.width || getItemDefaultWidth(item);
|
|
16213
|
+
handleBssulaColumnsSpecialParams(item);
|
|
16211
16214
|
item.onHeaderCell = function (column) {
|
|
16212
16215
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16213
16216
|
width: typeof column.width === 'number' ? column.width : parseInt(column.width.replace('px', '')),
|
|
@@ -16408,6 +16411,9 @@ var BsSulaQueryTable = (function (props) {
|
|
|
16408
16411
|
newColumns[index] = _objectSpread2(_objectSpread2({}, newColumns[index]), {}, {
|
|
16409
16412
|
width: size.width
|
|
16410
16413
|
});
|
|
16414
|
+
newColumns.forEach(function (d) {
|
|
16415
|
+
handleBssulaColumnsSpecialParams(d);
|
|
16416
|
+
});
|
|
16411
16417
|
return _toConsumableArray(newColumns);
|
|
16412
16418
|
});
|
|
16413
16419
|
};
|
package/dist/index.js
CHANGED
|
@@ -14316,7 +14316,7 @@ var handleBssulaColumnsSpecialParams = function handleBssulaColumnsSpecialParams
|
|
|
14316
14316
|
if (col.textOverflow) {
|
|
14317
14317
|
col.render = function (_ref3) {
|
|
14318
14318
|
var text = _ref3.text;
|
|
14319
|
-
return handleTextOverflow(text);
|
|
14319
|
+
return handleTextOverflow(text, col.width);
|
|
14320
14320
|
};
|
|
14321
14321
|
}
|
|
14322
14322
|
if (col.images) {
|
|
@@ -15501,7 +15501,7 @@ var SortableTable$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
15501
15501
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
15502
15502
|
key: item.key || item.dataIndex,
|
|
15503
15503
|
width: ((_innerItem$ = innerItem[0]) === null || _innerItem$ === void 0 ? void 0 : _innerItem$.width) || item.width,
|
|
15504
|
-
hidden: config.length
|
|
15504
|
+
hidden: config.length ? !innerItem.length : item.hidden
|
|
15505
15505
|
});
|
|
15506
15506
|
}),
|
|
15507
15507
|
defaultValue: datasource.map(function (item) {
|
|
@@ -15514,7 +15514,7 @@ var SortableTable$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
15514
15514
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
15515
15515
|
key: item.key || item.dataIndex,
|
|
15516
15516
|
width: ((_innerItem$2 = innerItem[0]) === null || _innerItem$2 === void 0 ? void 0 : _innerItem$2.width) || item.width,
|
|
15517
|
-
hidden: config.length
|
|
15517
|
+
hidden: config.length ? !innerItem.length : item.hidden
|
|
15518
15518
|
});
|
|
15519
15519
|
}),
|
|
15520
15520
|
sortDataSource: _toConsumableArray(showColumn)
|
|
@@ -15873,7 +15873,7 @@ var SortableTable$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
15873
15873
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
15874
15874
|
key: item.key || item.dataIndex,
|
|
15875
15875
|
width: ((_innerItem$3 = innerItem[0]) === null || _innerItem$3 === void 0 ? void 0 : _innerItem$3.width) || item.width,
|
|
15876
|
-
hidden: config.length
|
|
15876
|
+
hidden: config.length ? !innerItem.length : item.hidden
|
|
15877
15877
|
});
|
|
15878
15878
|
}),
|
|
15879
15879
|
defaultValue: datasource.map(function (item) {
|
|
@@ -15886,7 +15886,7 @@ var SortableTable$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
15886
15886
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
15887
15887
|
key: item.key || item.dataIndex,
|
|
15888
15888
|
width: ((_innerItem$4 = innerItem[0]) === null || _innerItem$4 === void 0 ? void 0 : _innerItem$4.width) || item.width,
|
|
15889
|
-
hidden: config.length
|
|
15889
|
+
hidden: config.length ? !innerItem.length : item.hidden
|
|
15890
15890
|
});
|
|
15891
15891
|
}),
|
|
15892
15892
|
sortDataSource: datasource.filter(function (item) {
|
|
@@ -16105,7 +16105,9 @@ var BsSulaQueryTable = (function (props) {
|
|
|
16105
16105
|
pagePath = _useState2[0],
|
|
16106
16106
|
setPagePath = _useState2[1];
|
|
16107
16107
|
// 获取 table columns中所有的 key 防止有的地方是 dataindex
|
|
16108
|
-
var _useState3 = React.useState(props.columns.
|
|
16108
|
+
var _useState3 = React.useState(props.columns.filter(function (col) {
|
|
16109
|
+
return !col.hidden;
|
|
16110
|
+
}).map(function (d) {
|
|
16109
16111
|
return Array.isArray(d.key || d.dataIndex) ? JSON.stringify(d.key || d.dataIndex) : d.key || d.dataIndex;
|
|
16110
16112
|
})),
|
|
16111
16113
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
@@ -16226,6 +16228,7 @@ var BsSulaQueryTable = (function (props) {
|
|
|
16226
16228
|
});
|
|
16227
16229
|
showColumns.forEach(function (item, index) {
|
|
16228
16230
|
item.width = item.width || getItemDefaultWidth(item);
|
|
16231
|
+
handleBssulaColumnsSpecialParams(item);
|
|
16229
16232
|
item.onHeaderCell = function (column) {
|
|
16230
16233
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16231
16234
|
width: typeof column.width === 'number' ? column.width : parseInt(column.width.replace('px', '')),
|
|
@@ -16426,6 +16429,9 @@ var BsSulaQueryTable = (function (props) {
|
|
|
16426
16429
|
newColumns[index] = _objectSpread2(_objectSpread2({}, newColumns[index]), {}, {
|
|
16427
16430
|
width: size.width
|
|
16428
16431
|
});
|
|
16432
|
+
newColumns.forEach(function (d) {
|
|
16433
|
+
handleBssulaColumnsSpecialParams(d);
|
|
16434
|
+
});
|
|
16429
16435
|
return _toConsumableArray(newColumns);
|
|
16430
16436
|
});
|
|
16431
16437
|
};
|
package/package.json
CHANGED
|
@@ -43,7 +43,7 @@ export default (props: any) => {
|
|
|
43
43
|
const [pagePath, setPagePath] = useState('');
|
|
44
44
|
// 获取 table columns中所有的 key 防止有的地方是 dataindex
|
|
45
45
|
const [checkedList, setCheckedList] = useState(
|
|
46
|
-
props.columns.map((d: any) => Array.isArray(d.key || d.dataIndex) ? JSON.stringify(d.key || d.dataIndex) : (d.key || d.dataIndex)),
|
|
46
|
+
props.columns.filter((col: any) => !col.hidden).map((d: any) => Array.isArray(d.key || d.dataIndex) ? JSON.stringify(d.key || d.dataIndex) : (d.key || d.dataIndex)),
|
|
47
47
|
);
|
|
48
48
|
const { pathname } = useLocation();
|
|
49
49
|
const [id]: any = useState(
|
|
@@ -174,9 +174,10 @@ export default (props: any) => {
|
|
|
174
174
|
return column.notRegularCheckList || checkedList.indexOf(columnKey) > -1;
|
|
175
175
|
}
|
|
176
176
|
)
|
|
177
|
-
|
|
177
|
+
|
|
178
178
|
showColumns.forEach((item, index) => {
|
|
179
179
|
item.width = item.width || getItemDefaultWidth(item);
|
|
180
|
+
handleBssulaColumnsSpecialParams(item);
|
|
180
181
|
item.onHeaderCell = (column) => ({
|
|
181
182
|
...item,
|
|
182
183
|
width:
|
|
@@ -416,6 +417,9 @@ export default (props: any) => {
|
|
|
416
417
|
...newColumns[index],
|
|
417
418
|
width: size.width,
|
|
418
419
|
};
|
|
420
|
+
newColumns.forEach((d: any) => {
|
|
421
|
+
handleBssulaColumnsSpecialParams(d);
|
|
422
|
+
})
|
|
419
423
|
return [...newColumns];
|
|
420
424
|
});
|
|
421
425
|
};
|
|
@@ -126,7 +126,7 @@ class SortableTable extends React.Component {
|
|
|
126
126
|
...item,
|
|
127
127
|
key: item.key || item.dataIndex,
|
|
128
128
|
width: innerItem[0]?.width || item.width,
|
|
129
|
-
hidden: config.length
|
|
129
|
+
hidden: config.length ? !innerItem.length : item.hidden,
|
|
130
130
|
};
|
|
131
131
|
}),
|
|
132
132
|
defaultValue: datasource.map((item) => {
|
|
@@ -141,7 +141,7 @@ class SortableTable extends React.Component {
|
|
|
141
141
|
...item,
|
|
142
142
|
key: item.key || item.dataIndex,
|
|
143
143
|
width: innerItem[0]?.width || item.width,
|
|
144
|
-
hidden: config.length
|
|
144
|
+
hidden: config.length ? !innerItem.length : item.hidden,
|
|
145
145
|
};
|
|
146
146
|
}),
|
|
147
147
|
sortDataSource: [...showColumn]
|
|
@@ -166,7 +166,7 @@ class SortableTable extends React.Component {
|
|
|
166
166
|
...item,
|
|
167
167
|
key: item.key || item.dataIndex,
|
|
168
168
|
width: innerItem[0]?.width || item.width,
|
|
169
|
-
hidden: config.length
|
|
169
|
+
hidden: config.length ? !innerItem.length : item.hidden,
|
|
170
170
|
};
|
|
171
171
|
}),
|
|
172
172
|
defaultValue: datasource.map((item) => {
|
|
@@ -181,7 +181,7 @@ class SortableTable extends React.Component {
|
|
|
181
181
|
...item,
|
|
182
182
|
key: item.key || item.dataIndex,
|
|
183
183
|
width: innerItem[0]?.width || item.width,
|
|
184
|
-
hidden: config.length
|
|
184
|
+
hidden: config.length ? !innerItem.length : item.hidden,
|
|
185
185
|
};
|
|
186
186
|
}),
|
|
187
187
|
sortDataSource: datasource
|
package/src/utils/utils.ts
CHANGED
|
@@ -80,7 +80,7 @@ export const handleBssulaColumnsSpecialParams = (col: any) => {
|
|
|
80
80
|
}
|
|
81
81
|
// 处理文字太长
|
|
82
82
|
if (col.textOverflow) {
|
|
83
|
-
col.render = ({ text }: any) => handleTextOverflow(text);
|
|
83
|
+
col.render = ({ text }: any) => handleTextOverflow(text,col.width);
|
|
84
84
|
}
|
|
85
85
|
if (col.images) {
|
|
86
86
|
col.render = ({ text }: any) => tableColumnsImage(text);
|
|
@@ -180,4 +180,4 @@ export function uuid() {
|
|
|
180
180
|
|
|
181
181
|
const uuid = s.join('');
|
|
182
182
|
return uuid;
|
|
183
|
-
}
|
|
183
|
+
}
|