@bit-sun/business-component 4.2.0-alpha.6.2 → 4.2.0-alpha.6.3
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/Business/SystemLog/index.d.ts +78 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +279 -51
- package/dist/index.js +280 -50
- package/dist/utils/utils.d.ts +41 -0
- package/package.json +1 -1
- package/src/components/Business/SystemLog/index.md +37 -0
- package/src/components/Business/SystemLog/index.tsx +87 -0
- package/src/components/Functional/AddSelect/index.tsx +92 -0
- package/src/index.ts +2 -0
- package/src/utils/utils.ts +41 -1
|
@@ -222,6 +222,98 @@ const AddSelect = (props: any) => {
|
|
|
222
222
|
acc[key] = typeof value === 'function' ? value?.(record) : value;
|
|
223
223
|
return acc;
|
|
224
224
|
}, {});
|
|
225
|
+
|
|
226
|
+
// 可输入非数字字符
|
|
227
|
+
if(item.canInputString) {
|
|
228
|
+
return (
|
|
229
|
+
<InputNumber
|
|
230
|
+
min={0}
|
|
231
|
+
precision={0}
|
|
232
|
+
controls={false}
|
|
233
|
+
{...inputProps}
|
|
234
|
+
value={text || ''}
|
|
235
|
+
keyboard={false}
|
|
236
|
+
onPressEnter={(e: any) => {
|
|
237
|
+
e.target.blur();
|
|
238
|
+
}}
|
|
239
|
+
onBlur={async (e: any) => {
|
|
240
|
+
const {
|
|
241
|
+
target: { value },
|
|
242
|
+
} = e;
|
|
243
|
+
record[item.dataIndex] = value
|
|
244
|
+
editRecord(record)
|
|
245
|
+
}}
|
|
246
|
+
onKeyDown={(e) => {
|
|
247
|
+
if(e.keyCode === 13 && e.ctrlKey) {
|
|
248
|
+
handleOk(true)
|
|
249
|
+
document.getElementById("first-query")?.focus()
|
|
250
|
+
}
|
|
251
|
+
if(e.keyCode === 8 && e.ctrlKey) {
|
|
252
|
+
message.success('删除当前行')
|
|
253
|
+
e.stopPropagation();
|
|
254
|
+
e.preventDefault();
|
|
255
|
+
let dom = e.nativeEvent.path[5].children[index + 2]?.getElementsByTagName('input')[currentIndex]
|
|
256
|
+
if (dom) {
|
|
257
|
+
dom.select();
|
|
258
|
+
dom.focus();
|
|
259
|
+
dom.scrollIntoView(false)
|
|
260
|
+
}
|
|
261
|
+
dom = null
|
|
262
|
+
deleteRecord(record, popvalue);
|
|
263
|
+
}
|
|
264
|
+
if (e.keyCode === 37 && e.shiftKey) { // 左滑动
|
|
265
|
+
e.stopPropagation();
|
|
266
|
+
e.preventDefault();
|
|
267
|
+
let dom = e.nativeEvent.path[5].children[index + 1]?.getElementsByTagName('input')[currentIndex - 1]
|
|
268
|
+
if (dom) {
|
|
269
|
+
dom.select();
|
|
270
|
+
dom.focus();
|
|
271
|
+
dom.scrollIntoView(false)
|
|
272
|
+
}
|
|
273
|
+
dom = null
|
|
274
|
+
}
|
|
275
|
+
if (e.keyCode === 39 && e.shiftKey) { // 右滑
|
|
276
|
+
e.stopPropagation();
|
|
277
|
+
e.preventDefault();
|
|
278
|
+
let dom = e.nativeEvent.path[5].children[index + 1]?.getElementsByTagName('input')[currentIndex + 1]
|
|
279
|
+
if (dom) {
|
|
280
|
+
dom.select();
|
|
281
|
+
dom.focus();
|
|
282
|
+
dom.scrollIntoView(false)
|
|
283
|
+
}
|
|
284
|
+
dom = null
|
|
285
|
+
}
|
|
286
|
+
if (e.keyCode === 40) {
|
|
287
|
+
e.stopPropagation();
|
|
288
|
+
e.preventDefault();
|
|
289
|
+
let dom = e.nativeEvent.path[5].children[index + 2]?.getElementsByTagName('input')[currentIndex]
|
|
290
|
+
if (dom) {
|
|
291
|
+
dom.select();
|
|
292
|
+
dom.focus();
|
|
293
|
+
dom.scrollIntoView(false)
|
|
294
|
+
}
|
|
295
|
+
dom = null
|
|
296
|
+
} else if (e.keyCode === 38) {
|
|
297
|
+
e.stopPropagation();
|
|
298
|
+
e.preventDefault();
|
|
299
|
+
let dom1 = e.nativeEvent.path[5].children[index]?.getElementsByTagName('input')[currentIndex]
|
|
300
|
+
if (dom1) {
|
|
301
|
+
// dom1.value=""
|
|
302
|
+
// dom1.setSelectionRange(100, 0);
|
|
303
|
+
dom1.select();
|
|
304
|
+
dom1.focus();
|
|
305
|
+
dom1.scrollIntoViewIfNeeded(false)
|
|
306
|
+
// dom1.value=record['count']
|
|
307
|
+
}
|
|
308
|
+
dom1 = null
|
|
309
|
+
} else if (e.keyCode === 9 && index === selectedRowKeys.length - 1 && currentIndex === inputLength - 1) {
|
|
310
|
+
e.stopPropagation();
|
|
311
|
+
e.preventDefault();
|
|
312
|
+
}
|
|
313
|
+
}}
|
|
314
|
+
/>
|
|
315
|
+
);
|
|
316
|
+
}
|
|
225
317
|
|
|
226
318
|
return (
|
|
227
319
|
<InputNumber
|
package/src/index.ts
CHANGED
|
@@ -48,3 +48,5 @@ export { default as RuleSetter} from './components/Solution/RuleSetter';
|
|
|
48
48
|
export { default as ExtendedCollapse } from './components/Common/ExtendedCollapse';
|
|
49
49
|
export { default as Section } from './components/Common/Section';
|
|
50
50
|
export { default as ParagraphCopier } from './components/Common/ParagraphCopier';
|
|
51
|
+
|
|
52
|
+
export { default as SystemLog } from './components/Business/SystemLog';
|
package/src/utils/utils.ts
CHANGED
|
@@ -267,4 +267,44 @@ export const handleConvertResponse = (items: any, total: number): object => {
|
|
|
267
267
|
|
|
268
268
|
export const noEmptyArray = (targetObj: any) => {
|
|
269
269
|
return Array.isArray(targetObj) && targetObj.length !== 0;
|
|
270
|
-
};
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
export const formContainerAndItemLayout = (type: string, title: any, name: string) => {
|
|
273
|
+
return type === 'form' ? {
|
|
274
|
+
container: {
|
|
275
|
+
type: 'card',
|
|
276
|
+
props: {
|
|
277
|
+
title,
|
|
278
|
+
id: Math.random(),
|
|
279
|
+
level: 1,
|
|
280
|
+
name
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
itemLayout: {
|
|
284
|
+
span: 8, // span表示每项所占的栅格数
|
|
285
|
+
labelCol: {
|
|
286
|
+
span: 8,
|
|
287
|
+
},
|
|
288
|
+
wrapperCol: {
|
|
289
|
+
span: 18,
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
} : {
|
|
293
|
+
container: {
|
|
294
|
+
type: 'card',
|
|
295
|
+
props: {
|
|
296
|
+
title,
|
|
297
|
+
id: Math.random(),
|
|
298
|
+
level: 1,
|
|
299
|
+
bordered: null,
|
|
300
|
+
isWhiteCard: true,
|
|
301
|
+
name
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
itemLayout: {
|
|
305
|
+
wrapperCol: {
|
|
306
|
+
span: 0,
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
}
|
|
310
|
+
}
|