ronds-metadata 1.0.99 → 1.1.0
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/comps/Editable/index.js +36 -54
- package/package.json +1 -1
@@ -127,14 +127,12 @@ var Editable = function Editable(props) {
|
|
127
127
|
case 'editHeardCellKey':
|
128
128
|
setEditHeardCellkey(data.payload);
|
129
129
|
break;
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
processDeleteColumnsData(data.payload);
|
137
|
-
break;
|
130
|
+
// case 'onAddColumn':
|
131
|
+
// processAddColumnsData(data.payload);
|
132
|
+
// break;
|
133
|
+
// case 'onDeleteColumn':
|
134
|
+
// processDeleteColumnsData(data.payload);
|
135
|
+
// break;
|
138
136
|
|
139
137
|
case 'onSingleSave':
|
140
138
|
if (lastValueRef.current && lastValueRef.current.rowIdx === data.payload._rowKey_) {
|
@@ -202,52 +200,36 @@ var Editable = function Editable(props) {
|
|
202
200
|
}
|
203
201
|
}, [type]); // 集中处理数据流
|
204
202
|
|
205
|
-
useObservable(processStreamFactory, [editableStream]);
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
};
|
233
|
-
|
234
|
-
|
235
|
-
var _columns = addColumnsRef.current.length > 0 ? addColumnsRef.current : columns;
|
236
|
-
|
237
|
-
if (whiteColumn.findIndex(function (v) {
|
238
|
-
return v === data.dataIndex;
|
239
|
-
}) > -1) {
|
240
|
-
// message.warning(`${data.dataIndex}无法删除`);
|
241
|
-
return;
|
242
|
-
}
|
243
|
-
|
244
|
-
_columns = _columns.filter(function (v) {
|
245
|
-
return v.dataIndex != data.dataIndex;
|
246
|
-
});
|
247
|
-
setAddColumns(_toConsumableArray(_columns));
|
248
|
-
addColumnsRef.current = _columns; // editableStream.next({ type: 'editHeardCellKey', payload: undefined });
|
249
|
-
}; // 返回stream的实例
|
250
|
-
|
203
|
+
useObservable(processStreamFactory, [editableStream]); // const processAddColumnsData = (data: any) => {
|
204
|
+
// const _columns = addColumnsRef.current.length > 0 ? addColumnsRef.current : columns;
|
205
|
+
// // 判断key是否重复
|
206
|
+
// if (_columns.findIndex((v) => v.key === data.key) > -1) {
|
207
|
+
// // message.warning('表格的key不可以重复');
|
208
|
+
// return;
|
209
|
+
// }
|
210
|
+
// const idx = _columns.findIndex((v: any) => v.dataIndex === data.dataIndex);
|
211
|
+
// const obj = {
|
212
|
+
// title: data.title,
|
213
|
+
// key: data.key,
|
214
|
+
// dataIndex: data.key,
|
215
|
+
// };
|
216
|
+
// _columns.splice(idx + 1, 0, { ..._columns[0], ...obj });
|
217
|
+
// setAddColumns([..._columns]);
|
218
|
+
// addColumnsRef.current = _columns;
|
219
|
+
// // editableStream.next({ type: 'editHeardCellKey', payload: undefined });
|
220
|
+
// };
|
221
|
+
// const processDeleteColumnsData = (data: any) => {
|
222
|
+
// let _columns = addColumnsRef.current.length > 0 ? addColumnsRef.current : columns;
|
223
|
+
// if (whiteColumn.findIndex((v) => v === data.dataIndex) > -1) {
|
224
|
+
// // message.warning(`${data.dataIndex}无法删除`);
|
225
|
+
// return;
|
226
|
+
// }
|
227
|
+
// _columns = _columns.filter((v: any) => v.dataIndex != data.dataIndex);
|
228
|
+
// setAddColumns([..._columns]);
|
229
|
+
// addColumnsRef.current = _columns;
|
230
|
+
// // editableStream.next({ type: 'editHeardCellKey', payload: undefined });
|
231
|
+
// };
|
232
|
+
// 返回stream的实例
|
251
233
|
|
252
234
|
React.useEffect(function () {
|
253
235
|
if (firstLoadRef && editableStream) {
|