@bit-sun/business-component 2.0.7 → 2.0.8
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (storageKeyString: string, seconds?: number, tipsCallFunction?: (
|
|
1
|
+
declare const _default: (storageKeyString: string, seconds?: number, tipsCallFunction?: () => {}) => void;
|
|
2
2
|
export default _default;
|
package/package.json
CHANGED
|
@@ -234,11 +234,11 @@ const InputElement = ({
|
|
|
234
234
|
message.success('删除当前行')
|
|
235
235
|
e.stopPropagation();
|
|
236
236
|
e.preventDefault();
|
|
237
|
-
let dom = e.nativeEvent.path[3].children[index
|
|
237
|
+
let dom = e.nativeEvent.path[3].children[index]?.getElementsByTagName('input')[currentIndex]
|
|
238
238
|
if (dom) {
|
|
239
239
|
dom.select();
|
|
240
240
|
dom.focus();
|
|
241
|
-
dom.
|
|
241
|
+
dom.scrollIntoViewIfNeeded(false)
|
|
242
242
|
}
|
|
243
243
|
dom = null
|
|
244
244
|
setData(data.filter((item, innerIndex) => innerIndex !== index))
|
|
@@ -256,39 +256,40 @@ const InputElement = ({
|
|
|
256
256
|
if (e.keyCode === 37 && e.shiftKey) { // 左滑动
|
|
257
257
|
e.stopPropagation();
|
|
258
258
|
e.preventDefault();
|
|
259
|
-
let dom = e.nativeEvent.path[3].children[index]?.getElementsByTagName('input')[currentIndex - 1]
|
|
259
|
+
let dom = e.nativeEvent.path[3].children[index + 1]?.getElementsByTagName('input')[currentIndex - 1]
|
|
260
260
|
if (dom) {
|
|
261
261
|
dom.select();
|
|
262
262
|
dom.focus();
|
|
263
|
-
dom.
|
|
263
|
+
dom.scrollIntoViewIfNeeded(false)
|
|
264
264
|
}
|
|
265
265
|
dom = null
|
|
266
266
|
}
|
|
267
267
|
if (e.keyCode === 39 && e.shiftKey) { // 右滑
|
|
268
268
|
e.stopPropagation();
|
|
269
269
|
e.preventDefault();
|
|
270
|
-
let dom = e.nativeEvent.path[3].children[index]?.getElementsByTagName('input')[currentIndex + 1]
|
|
270
|
+
let dom = e.nativeEvent.path[3].children[index + 1]?.getElementsByTagName('input')[currentIndex + 1]
|
|
271
271
|
if (dom) {
|
|
272
272
|
dom.select();
|
|
273
273
|
dom.focus();
|
|
274
|
-
dom.
|
|
274
|
+
dom.scrollIntoViewIfNeeded(false)
|
|
275
275
|
}
|
|
276
276
|
dom = null
|
|
277
277
|
}
|
|
278
278
|
if (e.keyCode === 40) { // 向下
|
|
279
|
+
debugger
|
|
279
280
|
e.stopPropagation();
|
|
280
281
|
e.preventDefault();
|
|
281
|
-
let dom = e.nativeEvent.path[3].children[index +
|
|
282
|
+
let dom = e.nativeEvent.path[3].children[index + 2]?.getElementsByTagName('input')[currentIndex]
|
|
282
283
|
if (dom) {
|
|
283
284
|
dom.select();
|
|
284
285
|
dom.focus();
|
|
285
|
-
dom.
|
|
286
|
+
dom.scrollIntoViewIfNeeded(false)
|
|
286
287
|
}
|
|
287
288
|
dom = null
|
|
288
289
|
} else if (e.keyCode === 38) {
|
|
289
290
|
e.stopPropagation();
|
|
290
291
|
e.preventDefault();
|
|
291
|
-
let dom1 = e.nativeEvent.path[3].children[index
|
|
292
|
+
let dom1 = e.nativeEvent.path[3].children[index]?.getElementsByTagName('input')[currentIndex]
|
|
292
293
|
if (dom1) {
|
|
293
294
|
// dom1.value=""
|
|
294
295
|
// dom1.setSelectionRange(100, 0);
|
|
@@ -321,11 +322,11 @@ const InputElement = ({
|
|
|
321
322
|
message.success('删除当前行')
|
|
322
323
|
e.stopPropagation();
|
|
323
324
|
e.preventDefault();
|
|
324
|
-
let dom = e.nativeEvent.path[5].children[index
|
|
325
|
+
let dom = e.nativeEvent.path[5].children[index]?.getElementsByTagName('input')[currentIndex]
|
|
325
326
|
if (dom) {
|
|
326
327
|
dom.select();
|
|
327
328
|
dom.focus();
|
|
328
|
-
dom.
|
|
329
|
+
dom.scrollIntoViewIfNeeded(false)
|
|
329
330
|
}
|
|
330
331
|
dom = null
|
|
331
332
|
setData(data.filter((item, innerIndex) => innerIndex !== index))
|
|
@@ -333,39 +334,39 @@ const InputElement = ({
|
|
|
333
334
|
if (e.keyCode === 37 && e.shiftKey) { // 左滑动
|
|
334
335
|
e.stopPropagation();
|
|
335
336
|
e.preventDefault();
|
|
336
|
-
let dom = e.nativeEvent.path[5].children[index]?.getElementsByTagName('input')[currentIndex - 1]
|
|
337
|
+
let dom = e.nativeEvent.path[5].children[index + 1]?.getElementsByTagName('input')[currentIndex - 1]
|
|
337
338
|
if (dom) {
|
|
338
339
|
dom.select();
|
|
339
340
|
dom.focus();
|
|
340
|
-
dom.
|
|
341
|
+
dom.scrollIntoViewIfNeeded(false)
|
|
341
342
|
}
|
|
342
343
|
dom = null
|
|
343
344
|
}
|
|
344
345
|
if (e.keyCode === 39 && e.shiftKey) { // 右滑
|
|
345
346
|
e.stopPropagation();
|
|
346
347
|
e.preventDefault();
|
|
347
|
-
let dom = e.nativeEvent.path[5].children[index]?.getElementsByTagName('input')[currentIndex + 1]
|
|
348
|
+
let dom = e.nativeEvent.path[5].children[index + 1]?.getElementsByTagName('input')[currentIndex + 1]
|
|
348
349
|
if (dom) {
|
|
349
350
|
dom.select();
|
|
350
351
|
dom.focus();
|
|
351
|
-
dom.
|
|
352
|
+
dom.scrollIntoViewIfNeeded(false)
|
|
352
353
|
}
|
|
353
354
|
dom = null
|
|
354
355
|
}
|
|
355
356
|
if (e.keyCode === 40) { // 向下
|
|
356
357
|
e.stopPropagation();
|
|
357
358
|
e.preventDefault();
|
|
358
|
-
let dom = e.nativeEvent.path[5].children[index +
|
|
359
|
+
let dom = e.nativeEvent.path[5].children[index + 2]?.getElementsByTagName('input')[currentIndex]
|
|
359
360
|
if (dom) {
|
|
360
361
|
dom.select();
|
|
361
362
|
dom.focus();
|
|
362
|
-
dom.
|
|
363
|
+
dom.scrollIntoViewIfNeeded(false)
|
|
363
364
|
}
|
|
364
365
|
dom = null
|
|
365
366
|
} else if (e.keyCode === 38) {
|
|
366
367
|
e.stopPropagation();
|
|
367
368
|
e.preventDefault();
|
|
368
|
-
let dom1 = e.nativeEvent.path[5].children[index
|
|
369
|
+
let dom1 = e.nativeEvent.path[5].children[index]?.getElementsByTagName('input')[currentIndex]
|
|
369
370
|
if (dom1) {
|
|
370
371
|
// dom1.value=""
|
|
371
372
|
// dom1.setSelectionRange(100, 0);
|
|
@@ -418,23 +419,27 @@ const BillEntry: React.FC = ({ onSaveCallback }) => {
|
|
|
418
419
|
isSelectItem: true,
|
|
419
420
|
render: (text: any, record: any) => {
|
|
420
421
|
let baseUnitCode = '';
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
422
|
+
if (record?.packingUnitList) {
|
|
423
|
+
let base = record.packingUnitList.filter((item: any) => item.unitCode)
|
|
424
|
+
if (base.length) {
|
|
425
|
+
baseUnitCode = base[0].unitCode
|
|
426
|
+
record.selectUnitCode = base[0].unitCode
|
|
427
|
+
record.selectedScale = base[0]?.baseUnitScale || 1
|
|
428
|
+
}
|
|
426
429
|
}
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
record.packingUnitList = record.packingUnitList || []
|
|
430
430
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
431
|
+
if (baseUnitCode) {
|
|
432
|
+
return <>
|
|
433
|
+
<Select defaultValue={baseUnitCode} onChange={(value) => {
|
|
434
|
+
record.selectUnitCode = value;record.selectedScale = record?.packingUnitList?.find((item: any) => item.unitCode === value)?.baseUnitScale || 1}
|
|
435
|
+
} style={{width: '60px'}}>
|
|
436
|
+
{record.packingUnitList && record.packingUnitList.map((item: any) => {
|
|
437
|
+
return <Select.Option value={item.unitCode}>{item.name}</Select.Option>
|
|
438
|
+
})}
|
|
439
|
+
</Select>
|
|
440
|
+
</>
|
|
441
|
+
}
|
|
442
|
+
return <></>
|
|
438
443
|
},
|
|
439
444
|
},
|
|
440
445
|
{
|
|
@@ -515,7 +520,6 @@ const BillEntry: React.FC = ({ onSaveCallback }) => {
|
|
|
515
520
|
}), {
|
|
516
521
|
title: '操作',
|
|
517
522
|
width: 50,
|
|
518
|
-
fixed: 'right',
|
|
519
523
|
render: (text, record, index) => {
|
|
520
524
|
if (index !== 0) {
|
|
521
525
|
return (
|
|
@@ -531,7 +535,9 @@ const BillEntry: React.FC = ({ onSaveCallback }) => {
|
|
|
531
535
|
return (
|
|
532
536
|
<div className='add_select'>
|
|
533
537
|
<div className='add_select_quick_header'>
|
|
534
|
-
<div className='add_select_quick_header_title'><div>快速录入</div><Button type="primary" onClick={() => {
|
|
538
|
+
<div className='add_select_quick_header_title'><div>快速录入</div><Button type="primary" onClick={() => {
|
|
539
|
+
onSaveCallback(data)
|
|
540
|
+
}}>提交</Button></div>
|
|
535
541
|
<span><span>*</span> 快捷键:【Tab】-跳格切换;【Shift+←、→】-当前行左、右移动;【 ↑、↓】-当前列上、下移动;【ctrl+Delete】-删除当前行;</span>
|
|
536
542
|
</div>
|
|
537
543
|
<div className={'add_select_wrapper_select add_select_wrapper_select_quick'}>
|
|
@@ -26,7 +26,8 @@ const TreeSearchSelect = (props: any) => {
|
|
|
26
26
|
allowClear = true,
|
|
27
27
|
showCheckedStrategy = TreeSelect.SHOW_PARENT,
|
|
28
28
|
style = { width: '100%' },
|
|
29
|
-
getTreeData
|
|
29
|
+
getTreeData,
|
|
30
|
+
disabled
|
|
30
31
|
} = props;
|
|
31
32
|
|
|
32
33
|
const {
|
|
@@ -137,7 +138,7 @@ const TreeSearchSelect = (props: any) => {
|
|
|
137
138
|
multiple={multiple} // 支持多选(当设置 treeCheckable 时自动变为 true)
|
|
138
139
|
maxTagPlaceholder={maxTagPlaceholder}
|
|
139
140
|
onChange={handleChange}
|
|
140
|
-
disabled={mode==='view' || ctx?.mode === 'view'}
|
|
141
|
+
disabled={disabled || mode==='view' || ctx?.mode === 'view'}
|
|
141
142
|
getPopupContainer={() => (getPopupContainer && getPopupContainer()) || document.body}
|
|
142
143
|
>
|
|
143
144
|
</TreeSelect>
|