@bit-sun/business-component 2.4.24 → 2.4.26-beta01
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/BsLayouts/service.d.ts +1 -1
- package/dist/components/Business/BsSulaQueryTable/index.d.ts +0 -1
- package/dist/components/Business/BsSulaQueryTable/setting.d.ts +1 -1
- package/dist/components/Business/BsSulaQueryTable/utils.d.ts +0 -1
- package/dist/components/Business/columnSettingTable/columnSetting.d.ts +0 -1
- package/dist/components/Functional/ExportFunctions/ExportIcon/index.d.ts +1 -1
- package/dist/components/Functional/QueryMutipleInput/index.d.ts +1 -2
- package/dist/components/Solution/RuleComponent/services.d.ts +1 -1
- package/dist/index.esm.js +1185 -1739
- package/dist/index.js +1179 -1735
- package/dist/utils/TableUtils.d.ts +2 -93
- package/dist/utils/index.d.ts +4 -6
- package/dist/utils/utils.d.ts +0 -13
- package/package.json +4 -7
- package/src/assets/32.svg +27 -27
- package/src/assets/addIcon.svg +17 -17
- package/src/assets/allfunc.svg +27 -27
- package/src/assets/arrowRight.svg +24 -24
- package/src/assets/btn-delete.svg +29 -29
- package/src/assets/btn-edit.svg +19 -19
- package/src/assets/btn-more.svg +17 -17
- package/src/assets/btn-submit.svg +19 -19
- package/src/assets/close.svg +26 -26
- package/src/assets/drag.svg +17 -17
- package/src/assets/fixed-left.svg +15 -15
- package/src/assets/fixed-right.svg +15 -15
- package/src/assets/guanbi.svg +15 -15
- package/src/assets/icon-quanping.svg +15 -15
- package/src/assets/icon-shezhi.svg +17 -17
- package/src/assets/label_icon_bottom.svg +25 -25
- package/src/assets/list-no-img.svg +21 -21
- package/src/assets/morentouxiang-32.svg +23 -23
- package/src/assets/scanning.svg +24 -24
- package/src/assets/upExport.svg +22 -22
- package/src/common/ENUM.ts +41 -41
- package/src/components/Business/AddSelectBusiness/index.tsx +22 -40
- package/src/components/Business/BsLayouts/Components/AllFunc/index.less +153 -153
- package/src/components/Business/BsLayouts/Components/AllFunc/index.tsx +70 -70
- package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.less +90 -90
- package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.tsx +37 -37
- package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.tsx +242 -242
- package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.tsx +384 -384
- package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.tsx +74 -74
- package/src/components/Business/BsLayouts/Components/CustomerMenu/index.less +64 -64
- package/src/components/Business/BsLayouts/Components/CustomerMenu/index.tsx +153 -153
- package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +157 -163
- package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +85 -85
- package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +2 -19
- package/src/components/Business/BsLayouts/Components/SearchFunc/index.tsx +75 -75
- package/src/components/Business/BsLayouts/index.less +79 -79
- package/src/components/Business/BsLayouts/index.tsx +1484 -1494
- package/src/components/Business/BsLayouts/service.ts +2 -2
- package/src/components/Business/BsLayouts/utils.tsx +203 -203
- package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +9 -9
- package/src/components/Business/BsSulaQueryTable/index.less +221 -221
- package/src/components/Business/BsSulaQueryTable/index.tsx +175 -346
- package/src/components/Business/BsSulaQueryTable/setting.tsx +87 -125
- package/src/components/Business/BsSulaQueryTable/utils.tsx +34 -57
- package/src/components/Business/CommodityEntry/index.md +70 -70
- package/src/components/Business/CommodityEntry/index.tsx +81 -80
- package/src/components/Business/CommonGuideWrapper/index.less +112 -121
- package/src/components/Business/CommonGuideWrapper/index.md +39 -39
- package/src/components/Business/CommonGuideWrapper/index.tsx +84 -94
- package/src/components/Business/DetailPageWrapper/index.less +1 -9
- package/src/components/Business/DetailPageWrapper/index.tsx +110 -121
- package/src/components/Business/HomePageWrapper/index.md +45 -45
- package/src/components/Business/HomePageWrapper/index.tsx +162 -162
- package/src/components/Business/JsonQueryTable/configButton/index.js +20 -20
- package/src/components/Business/JsonQueryTable/configTree/component/compactArrayView.js +25 -25
- package/src/components/Business/JsonQueryTable/configTree/component/compactObjectView.js +30 -30
- package/src/components/Business/JsonQueryTable/configTree/index.js +82 -82
- package/src/components/Business/JsonQueryTable/configTree/index.less +44 -44
- package/src/components/Business/JsonQueryTable/configTree/parser/highlight.js +57 -57
- package/src/components/Business/JsonQueryTable/configTree/parser/index.js +124 -124
- package/src/components/Business/JsonQueryTable/configTree/render/iconRender.js +29 -29
- package/src/components/Business/JsonQueryTable/configTree/render/nameRender.js +22 -22
- package/src/components/Business/JsonQueryTable/configTree/treeNode.js +116 -116
- package/src/components/Business/JsonQueryTable/drawer/index.tsx +12 -12
- package/src/components/Business/JsonQueryTable/index.less +16 -16
- package/src/components/Business/JsonQueryTable/index.md +328 -328
- package/src/components/Business/JsonQueryTable/index.tsx +537 -535
- package/src/components/Business/JsonQueryTable/jsonEditor/index.js +346 -346
- package/src/components/Business/JsonQueryTable/jsonEditor/index.less +22 -22
- package/src/components/Business/JsonQueryTable/jsonEditor/lint/basicType.js +147 -147
- package/src/components/Business/JsonQueryTable/jsonEditor/lint/index.js +389 -389
- package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/actions.js +118 -118
- package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/dependency.js +22 -22
- package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/index.js +21 -21
- package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/request.js +65 -65
- package/src/components/Business/SearchSelect/utils.ts +3 -3
- package/src/components/Business/StateFlow/index.md +60 -60
- package/src/components/Business/StateFlow/index.tsx +29 -29
- package/src/components/Business/columnSettingTable/columnSetting.tsx +8 -10
- package/src/components/Business/columnSettingTable/index.less +247 -247
- package/src/components/Business/columnSettingTable/index.md +357 -357
- package/src/components/Business/columnSettingTable/utils.tsx +71 -71
- package/src/components/Business/moreTreeTable/FixedScrollBar.tsx +87 -87
- package/src/components/Business/moreTreeTable/hooks/useSticky.ts +21 -21
- package/src/components/Business/moreTreeTable/index.less +99 -99
- package/src/components/Business/moreTreeTable/index.tsx +387 -387
- package/src/components/Business/moreTreeTable/utils.ts +126 -126
- package/src/components/Functional/AddSelect/helps.ts +3 -4
- package/src/components/Functional/AddSelect/index.less +367 -367
- package/src/components/Functional/AddSelect/index.tsx +33 -79
- package/src/components/Functional/BillEntry/index.less +371 -371
- package/src/components/Functional/BillEntry/index.tsx +3 -3
- package/src/components/Functional/BsAntdSula/index.ts +2 -2
- package/src/components/Functional/DataImport/index.less +63 -63
- package/src/components/Functional/DataImport/index.tsx +3 -3
- package/src/components/Functional/DataValidation/index.less +63 -63
- package/src/components/Functional/DataValidation/index.tsx +3 -3
- package/src/components/Functional/EllipsisTooltip/index.d.ts +5 -5
- package/src/components/Functional/EllipsisTooltip/index.js +36 -36
- package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +5 -10
- package/src/components/Functional/QueryMutipleInput/index.less +37 -37
- package/src/components/Functional/QueryMutipleInput/index.tsx +1 -2
- package/src/components/Functional/SearchSelect/index.less +0 -6
- package/src/components/Functional/SearchSelect/index.tsx +45 -152
- package/src/components/Functional/SearchSelect/utils.ts +3 -3
- package/src/components/Functional/TreeSearchSelect/index.tsx +22 -24
- package/src/components/Solution/RuleComponent/Formula.tsx +335 -335
- package/src/components/Solution/RuleComponent/index.d.ts +29 -29
- package/src/components/Solution/RuleComponent/index.js +652 -7
- package/src/components/Solution/RuleComponent/index.less +230 -230
- package/src/components/Solution/RuleComponent/renderSpecificAction.js +99 -99
- package/src/components/Solution/RuleComponent/services.ts +13 -13
- package/src/plugin/TableColumnSetting/index.less +247 -247
- package/src/plugin/TableColumnSetting/index.md +50 -50
- package/src/plugin/TableColumnSetting/index.tsx +2 -2
- package/src/plugin/TableColumnSetting/utils.ts +19 -19
- package/src/utils/CheckOneUser/index.md +39 -39
- package/src/utils/CheckOneUser/index.ts +51 -51
- package/src/utils/LocalstorageUtils.ts +95 -95
- package/src/utils/TableUtils.tsx +18 -691
- package/src/utils/checkUtils.ts +39 -39
- package/src/utils/enumConfig.ts +11 -11
- package/src/utils/getFormMode.js +12 -12
- package/src/utils/index.ts +4 -6
- package/src/utils/requestUtils.ts +2 -29
- package/src/utils/serialize.js +7 -7
- package/src/utils/utils.ts +21 -64
- package/dist/components/Business/BsLayouts/Components/ChooseStore/index.d.ts +0 -3
- package/dist/components/Business/BsLayouts/Components/ChooseStore/services.d.ts +0 -1
- package/dist/components/Business/BsLayouts/Components/RightContent/i18n.d.ts +0 -9
- package/dist/components/Solution/RuleComponent/RenderCompItem.d.ts +0 -2
- package/dist/utils/businessUtils.d.ts +0 -27
- package/dist/utils/constant.d.ts +0 -37
- package/dist/utils/request.d.ts +0 -2
- package/src/assets/arrow_top.svg +0 -18
- package/src/components/Business/BsLayouts/Components/ChooseStore/index.less +0 -0
- package/src/components/Business/BsLayouts/Components/ChooseStore/index.tsx +0 -193
- package/src/components/Business/BsLayouts/Components/ChooseStore/services.ts +0 -10
- package/src/components/Business/BsLayouts/Components/RightContent/i18n.ts +0 -9
- package/src/components/Business/BsSulaQueryTable/bssulaquerytable.less +0 -5
- package/src/components/Solution/RuleComponent/RenderCompItem.tsx +0 -637
- package/src/utils/TableUtils.less +0 -52
- package/src/utils/businessUtils.ts +0 -441
- package/src/utils/constant.ts +0 -39
- package/src/utils/request.ts +0 -53
|
@@ -3,9 +3,9 @@ import React, { useState, useEffect, forwardRef, useImperativeHandle } from 'rea
|
|
|
3
3
|
import { useDebounceFn } from 'ahooks';
|
|
4
4
|
import { Input, Button, Modal, Select, Divider, message, Spin, Form, Table, Checkbox, TreeSelect, Tooltip, Tag } from 'antd';
|
|
5
5
|
import { SearchOutlined, CopyOutlined, CaretLeftOutlined } from '@ant-design/icons';
|
|
6
|
-
import
|
|
6
|
+
import axios from 'axios';
|
|
7
7
|
import { stringify } from 'querystring';
|
|
8
|
-
import _
|
|
8
|
+
import _ from "lodash"
|
|
9
9
|
import './index.less';
|
|
10
10
|
import { BusinessSearchSelect, QueryMutipleInput } from '@/index';
|
|
11
11
|
import { handleSourceName } from './utils';
|
|
@@ -239,17 +239,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
239
239
|
}
|
|
240
240
|
});
|
|
241
241
|
delete params[key];
|
|
242
|
-
} else if (element && key.indexOf('*multiInput') >= 0) {
|
|
243
|
-
let name = '',
|
|
244
|
-
value = element['value'];
|
|
245
|
-
if (value.indexOf(',') >= 0) {
|
|
246
|
-
name = `qp-${element['name']}-in`;
|
|
247
|
-
} else {
|
|
248
|
-
name = `qp-${element['name']}-like`;
|
|
249
242
|
}
|
|
250
|
-
params[name] = value;
|
|
251
|
-
delete params[key];
|
|
252
|
-
}
|
|
253
243
|
else if (element && key.indexOf('*') >= 0) {
|
|
254
244
|
const dataParams = key.split('*');
|
|
255
245
|
dataParams.forEach((value, index) => {
|
|
@@ -283,11 +273,9 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
283
273
|
...otherParams, // 默认参数
|
|
284
274
|
...fixedParam,
|
|
285
275
|
...params,
|
|
286
|
-
};
|
|
287
|
-
if (isNil(queryParams[selectParamsKey])) {
|
|
288
|
-
queryParams[selectParamsKey] = searchValue;
|
|
289
276
|
}
|
|
290
|
-
|
|
277
|
+
|
|
278
|
+
axios
|
|
291
279
|
.get(
|
|
292
280
|
`${url}?${stringify(queryParams)}`,
|
|
293
281
|
{
|
|
@@ -448,7 +436,6 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
448
436
|
setPopValue(labelInValue ? value.map(i => ({ value: i.key, text: i.label })) : value.map(i => ({ value: i })));
|
|
449
437
|
setIndeterminate(!!value.length && value.length < itemsTotal);
|
|
450
438
|
setCheckedAll(itemsTotal && value.length === itemsTotal);
|
|
451
|
-
|
|
452
439
|
} else {
|
|
453
440
|
setSelectedRowKeys(labelInValue ? [value.key] : [value])
|
|
454
441
|
setSelectedRows(labelInValue ? [{ [mappingValueField]: value.key, value: value.key, text: value.label }] : [{ [mappingValueField]: value, value: value }])
|
|
@@ -560,7 +547,6 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
560
547
|
setSelectedRows(currentItemsData)
|
|
561
548
|
})
|
|
562
549
|
}
|
|
563
|
-
|
|
564
550
|
const onChangeCheckAll = (e) => {
|
|
565
551
|
if (e.target.checked) {
|
|
566
552
|
// 如果下拉框有所有数据就处理选中所有【items.length === itemsTotal】(最多可选100条)
|
|
@@ -592,9 +578,8 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
592
578
|
if (heightTxt === '') {
|
|
593
579
|
return text
|
|
594
580
|
}
|
|
595
|
-
const searchString = escapeRegExp(heightTxt);
|
|
596
581
|
// 前面filterOption 不区分大小写,这里用i
|
|
597
|
-
const regexp = new RegExp(
|
|
582
|
+
const regexp = new RegExp(heightTxt, 'gi')
|
|
598
583
|
return text.replace(regexp, `<span style="color:red">${heightTxt}</span>`)
|
|
599
584
|
}
|
|
600
585
|
return (
|
|
@@ -777,37 +762,29 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
777
762
|
|
|
778
763
|
return (
|
|
779
764
|
<div className={'search_select'}>
|
|
780
|
-
{fieldComponent ?
|
|
781
|
-
<div
|
|
782
|
-
onClick
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
>
|
|
787
|
-
{fieldComponent}
|
|
788
|
-
</div>
|
|
789
|
-
) : (
|
|
790
|
-
<div
|
|
791
|
-
className="search_select_show"
|
|
792
|
-
id={`search_select_div_${uniqueValue}`}
|
|
793
|
-
>
|
|
765
|
+
{fieldComponent ?
|
|
766
|
+
(<div onClick={() => {
|
|
767
|
+
fieldComponent.props?.onClick?.()
|
|
768
|
+
showModal()
|
|
769
|
+
}}>{fieldComponent}</div>) :
|
|
770
|
+
(<div className="search_select_show" id={`search_select_div_${uniqueValue}`}>
|
|
794
771
|
<Select
|
|
795
772
|
virtual
|
|
796
773
|
labelInValue={labelInValue}
|
|
797
774
|
value={value}
|
|
798
775
|
onChange={onChange}
|
|
799
776
|
disabled={props.disabled}
|
|
800
|
-
dropdownRender={
|
|
777
|
+
dropdownRender={menu => (
|
|
801
778
|
<>
|
|
802
779
|
<Input
|
|
803
780
|
value={searchValue}
|
|
804
781
|
style={{ width: '98%', marginLeft: '1%' }}
|
|
805
782
|
placeholder="请输入"
|
|
806
|
-
onChange={
|
|
783
|
+
onChange={e => onSearchChange(e)}
|
|
807
784
|
onBlur={onSearchBlur}
|
|
808
785
|
onKeyDown={(e) => {
|
|
809
786
|
// 阻止多选的冒泡
|
|
810
|
-
e.stopPropagation()
|
|
787
|
+
e.stopPropagation()
|
|
811
788
|
}}
|
|
812
789
|
/>
|
|
813
790
|
<Divider style={{ margin: '8px 0' }} />
|
|
@@ -815,16 +792,13 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
815
792
|
</>
|
|
816
793
|
)}
|
|
817
794
|
notFoundContent={
|
|
818
|
-
fetching ?
|
|
819
|
-
<Spin size="small" className='searchSelectSpin' />
|
|
820
|
-
) : (
|
|
795
|
+
fetching ? <Spin size="small" /> :
|
|
821
796
|
<div style={{ textAlign: 'center' }}>
|
|
822
797
|
<div style={{ marginBottom: 16 }}>
|
|
823
798
|
<CopyOutlined style={{ fontSize: '50px' }} />
|
|
824
799
|
</div>
|
|
825
800
|
<div>无匹配结果,请更换其他内容再试</div>
|
|
826
801
|
</div>
|
|
827
|
-
)
|
|
828
802
|
}
|
|
829
803
|
onPopupScroll={SelectScroll}
|
|
830
804
|
style={{ width: needModalTable ? 'calc(100% - 30px)' : 'calc(100%)' }}
|
|
@@ -843,154 +817,73 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
843
817
|
))}
|
|
844
818
|
</Select>
|
|
845
819
|
{needModalTable && (
|
|
846
|
-
<Button
|
|
847
|
-
style={{ width: '30px', padding: '2px', height: 'auto' }}
|
|
848
|
-
onClick={showModal}
|
|
849
|
-
type="primary"
|
|
850
|
-
>
|
|
820
|
+
<Button style={{ width: '30px', padding: '2px', height: 'auto' }} onClick={showModal} type="primary">
|
|
851
821
|
<SearchOutlined />
|
|
852
822
|
</Button>
|
|
853
823
|
)}
|
|
854
|
-
</div>
|
|
855
|
-
)}
|
|
824
|
+
</div>)}
|
|
856
825
|
{needModalTable && isModalVisible && (
|
|
857
826
|
<Modal
|
|
858
|
-
width=
|
|
827
|
+
width='80%'
|
|
859
828
|
title={modalTableProps?.modalTableTitle}
|
|
860
829
|
visible={isModalVisible}
|
|
861
830
|
onOk={handleOk}
|
|
862
831
|
onCancel={handleCancel}
|
|
863
|
-
footer={
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
props?.disabled
|
|
877
|
-
}
|
|
878
|
-
>
|
|
879
|
-
确定
|
|
880
|
-
</Button>,
|
|
881
|
-
]
|
|
882
|
-
: null
|
|
883
|
-
}
|
|
832
|
+
footer={(selectMode || modalTableProps?.modalRadioNeedFooter) ? [
|
|
833
|
+
<Button key="back" onClick={handleCancel}>
|
|
834
|
+
取消
|
|
835
|
+
</Button>,
|
|
836
|
+
<Button
|
|
837
|
+
key="submit"
|
|
838
|
+
type="primary"
|
|
839
|
+
onClick={handleOk}
|
|
840
|
+
disabled={!tableData.length || (selectProps?.disabled || props?.disabled)}
|
|
841
|
+
>
|
|
842
|
+
确定
|
|
843
|
+
</Button>,
|
|
844
|
+
] : null}
|
|
884
845
|
{...(modalTableProps?.modalProps || {})}
|
|
885
846
|
>
|
|
886
847
|
<div className={'search_select_wrapper'}>
|
|
887
|
-
<div
|
|
888
|
-
className={'
|
|
889
|
-
onClick={() => setCaretLeftFlag(!caretLeftFlag)}
|
|
890
|
-
>
|
|
891
|
-
<CaretLeftOutlined
|
|
892
|
-
className={
|
|
893
|
-
caretLeftFlag
|
|
894
|
-
? 'search_select_wrapper_click_flag_arrow'
|
|
895
|
-
: 'search_select_wrapper_click_flag_arrow_1'
|
|
896
|
-
}
|
|
897
|
-
/>
|
|
848
|
+
<div className={'search_select_wrapper_click_flag'} onClick={() => setCaretLeftFlag(!caretLeftFlag)}>
|
|
849
|
+
<CaretLeftOutlined className={caretLeftFlag ? 'search_select_wrapper_click_flag_arrow' : 'search_select_wrapper_click_flag_arrow_1'} />
|
|
898
850
|
</div>
|
|
899
|
-
<div
|
|
900
|
-
className={
|
|
901
|
-
caretLeftFlag
|
|
902
|
-
? 'search_select_wrapper_left'
|
|
903
|
-
: 'search_select_wrapper_left1'
|
|
904
|
-
}
|
|
905
|
-
>
|
|
851
|
+
<div className={caretLeftFlag ? 'search_select_wrapper_left' : 'search_select_wrapper_left1'}>
|
|
906
852
|
<div className={'select_list_columns'}>
|
|
907
853
|
<div className={'select_list_columns_tips'}>搜索</div>
|
|
908
854
|
<div className={'select_list_columns_formItems'}>
|
|
909
|
-
<Form form={form} layout=
|
|
855
|
+
<Form form={form} layout='vertical' key='modalForm'>
|
|
910
856
|
{formItem(modalTableProps?.tableSearchForm)}
|
|
911
857
|
</Form>
|
|
912
858
|
</div>
|
|
913
859
|
</div>
|
|
914
860
|
<div className={'select_list_searchButton'}>
|
|
915
|
-
<Button
|
|
916
|
-
|
|
917
|
-
className={'select_list_button_space'}
|
|
918
|
-
onClick={onResetTable}
|
|
919
|
-
>
|
|
920
|
-
重置
|
|
921
|
-
</Button>
|
|
922
|
-
<Button key="search" type="primary" onClick={onSearchTable}>
|
|
923
|
-
查询
|
|
924
|
-
</Button>
|
|
861
|
+
<Button key='reset' className={'select_list_button_space'} onClick={onResetTable}>重置</Button>
|
|
862
|
+
<Button key='search' type="primary" onClick={onSearchTable}>查询</Button>
|
|
925
863
|
</div>
|
|
926
864
|
</div>
|
|
927
|
-
<div
|
|
928
|
-
className={
|
|
929
|
-
caretLeftFlag
|
|
930
|
-
? 'search_select_wrapper_right'
|
|
931
|
-
: 'search_select_wrapper_right1'
|
|
932
|
-
}
|
|
933
|
-
>
|
|
865
|
+
<div className={caretLeftFlag ? 'search_select_wrapper_right' : 'search_select_wrapper_right1'}>
|
|
934
866
|
<div>
|
|
935
867
|
<div className={'select_list_selectTips'}>
|
|
936
|
-
<div style={{ marginLeft: 8 }}>
|
|
937
|
-
|
|
938
|
-
<span style={themeColor}>
|
|
939
|
-
{tablePagination?.total || 0}
|
|
940
|
-
</span>
|
|
941
|
-
项
|
|
942
|
-
{selectMode ? (
|
|
943
|
-
<span>
|
|
944
|
-
, 本次已选
|
|
945
|
-
<span style={themeColor}>
|
|
946
|
-
{selectedRowKeys?.length || 0}
|
|
947
|
-
</span>
|
|
948
|
-
项
|
|
949
|
-
</span>
|
|
950
|
-
) : (
|
|
951
|
-
''
|
|
952
|
-
)}
|
|
953
|
-
</div>
|
|
954
|
-
<div
|
|
955
|
-
style={{ color: 'rgba(127, 127, 127, 0.6470588235294118)' }}
|
|
956
|
-
>
|
|
957
|
-
{selectMode
|
|
958
|
-
? '勾选后点击确定按钮完成选择'
|
|
959
|
-
: '双击数据行或点击单选图标完成选择'}
|
|
960
|
-
</div>
|
|
868
|
+
<div style={{ marginLeft: 8 }}>搜索结果共<span style={themeColor}>{tablePagination?.total || 0}</span>项{selectMode ? <span>, 本次已选<span style={themeColor}>{selectedRowKeys?.length || 0}</span>项</span> : ''}</div>
|
|
869
|
+
<div style={{ color: 'rgba(127, 127, 127, 0.6470588235294118)' }}>{selectMode ? '勾选后点击确定按钮完成选择' : '双击数据行或点击单选图标完成选择'}</div>
|
|
961
870
|
</div>
|
|
962
871
|
<Table
|
|
963
|
-
size=
|
|
872
|
+
size='small'
|
|
964
873
|
rowSelection={rowSelection}
|
|
965
874
|
columns={modalTableProps?.tableColumns}
|
|
966
875
|
dataSource={tableData}
|
|
967
876
|
pagination={tablePagination}
|
|
968
877
|
onChange={handleTableChange}
|
|
969
878
|
rowKey={mappingValueField}
|
|
970
|
-
scroll={{
|
|
971
|
-
|
|
972
|
-
y: modalTableProps.overScrollY || null,
|
|
973
|
-
}}
|
|
974
|
-
onRow={(record) => {
|
|
879
|
+
scroll={{ x: modalTableProps.overScrollX || 'max-content', y: modalTableProps.overScrollY || null }}
|
|
880
|
+
onRow={record => {
|
|
975
881
|
return {
|
|
976
|
-
onDoubleClick: (event)
|
|
977
|
-
onDoubleClickSelect(event, record),
|
|
882
|
+
onDoubleClick: event => onDoubleClickSelect(event, record),
|
|
978
883
|
};
|
|
979
884
|
}}
|
|
980
885
|
/>
|
|
981
|
-
{selectMode ?
|
|
982
|
-
<div className={'select_list_selectAll'}>
|
|
983
|
-
<Checkbox
|
|
984
|
-
indeterminate={indeterminate}
|
|
985
|
-
checked={checkedAll}
|
|
986
|
-
onChange={onChangeCheckAll}
|
|
987
|
-
disabled={selectProps?.disabled || props?.disabled}
|
|
988
|
-
/>{' '}
|
|
989
|
-
全选所有页面
|
|
990
|
-
</div>
|
|
991
|
-
) : (
|
|
992
|
-
''
|
|
993
|
-
)}
|
|
886
|
+
{selectMode ? <div className={'select_list_selectAll'}><Checkbox indeterminate={indeterminate} checked={checkedAll} onChange={onChangeCheckAll} disabled={selectProps?.disabled || props?.disabled} /> 全选所有页面</div> : ''}
|
|
994
887
|
</div>
|
|
995
888
|
</div>
|
|
996
889
|
</div>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const handleSourceName = (sName: any) => {
|
|
2
|
-
return sName
|
|
3
|
-
}
|
|
1
|
+
export const handleSourceName = (sName: any) => {
|
|
2
|
+
return sName
|
|
3
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import { TreeSelect, Tooltip, Tag } from 'antd';
|
|
3
|
-
import
|
|
3
|
+
import axios from 'axios';
|
|
4
4
|
import { stringify } from 'querystring';
|
|
5
5
|
import _ from "lodash"
|
|
6
6
|
import { judgeIsRequestSuccess } from '@/utils/requestUtils';
|
|
@@ -77,7 +77,7 @@ const TreeSearchSelect = (props: any) => {
|
|
|
77
77
|
[`${paramsKey}`]: q,
|
|
78
78
|
...initialParams,
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
axios.get(`${url}?${stringify(paramsData)}`, { headers }).then(async (res: any) => {
|
|
81
81
|
const resData = res?.data || [];
|
|
82
82
|
let coverData;
|
|
83
83
|
|
|
@@ -100,15 +100,14 @@ const TreeSearchSelect = (props: any) => {
|
|
|
100
100
|
|
|
101
101
|
const formatData = (value: any) => {
|
|
102
102
|
if (labelInValue) {
|
|
103
|
-
const formatResult = multiple||treeCheckable ? value.map((i: any) => ({...i, key: i.value})) : { ...value, key: value?.value };
|
|
103
|
+
const formatResult = multiple || treeCheckable ? value.map((i: any) => ({ ...i, key: i.value })) : { ...value, key: value?.value };
|
|
104
104
|
return formatResult
|
|
105
105
|
} else {
|
|
106
|
-
const formatResult = multiple||treeCheckable ? value.map((i: any) => (i?.value || i)) : (_.get(value?.[0], 'value') || value)
|
|
106
|
+
const formatResult = multiple || treeCheckable ? value.map((i: any) => (i?.value || i)) : (_.get(value?.[0], 'value') || value)
|
|
107
107
|
return formatResult
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
|
|
111
|
-
const parallelData = (data: any,result: any) => {
|
|
110
|
+
const parallelData = (data: any, result: any) => {
|
|
112
111
|
data.forEach((i: any) => {
|
|
113
112
|
result.push(i);
|
|
114
113
|
if (i[treeChildrenRoom]) {
|
|
@@ -117,32 +116,31 @@ const TreeSearchSelect = (props: any) => {
|
|
|
117
116
|
});
|
|
118
117
|
return result;
|
|
119
118
|
}
|
|
120
|
-
const getSelectItem = (tData: any,selectValue: any) => {
|
|
121
|
-
const handleList = tData||[];
|
|
119
|
+
const getSelectItem = (tData: any, selectValue: any) => {
|
|
120
|
+
const handleList = tData || [];
|
|
122
121
|
let result = [];
|
|
123
|
-
if(labelInValue) {
|
|
124
|
-
result = multiple||treeCheckable ? (selectValue?.map((i: any) => {
|
|
125
|
-
if(handleList.some((s: any) => s.key == i.value)){
|
|
122
|
+
if (labelInValue) {
|
|
123
|
+
result = multiple || treeCheckable ? (selectValue?.map((i: any) => {
|
|
124
|
+
if (handleList.some((s: any) => s.key == i.value)) {
|
|
126
125
|
return handleList.find((s: any) => s.key == i.value)
|
|
127
126
|
}
|
|
128
|
-
}) || []) : (handleList?.find((s: any) => s.key == selectValue?.value)||{})
|
|
127
|
+
}) || []) : (handleList?.find((s: any) => s.key == selectValue?.value) || {})
|
|
129
128
|
} else {
|
|
130
129
|
const cValue = _.get(selectValue?.[0], 'value', selectValue);
|
|
131
|
-
result = multiple||treeCheckable ? (selectValue?.map((i: any) => {
|
|
132
|
-
if(handleList.some((s: any) => s.key == i)){
|
|
130
|
+
result = multiple || treeCheckable ? (selectValue?.map((i: any) => {
|
|
131
|
+
if (handleList.some((s: any) => s.key == i)) {
|
|
133
132
|
return handleList.find((s: any) => s.key == i)
|
|
134
133
|
}
|
|
135
|
-
}) || []) : (handleList?.find((s: any) => s.key == cValue)||{})
|
|
134
|
+
}) || []) : (handleList?.find((s: any) => s.key == cValue) || {})
|
|
136
135
|
}
|
|
137
136
|
return result;
|
|
138
137
|
}
|
|
139
|
-
|
|
140
138
|
const handleChange = (data: any, dataName: any) => {
|
|
141
139
|
const handleData = formatData(data);
|
|
142
140
|
// 获取选中树节点当条数据,并返回给调用业务
|
|
143
|
-
const parallelTreeData = parallelData(treeData,[])
|
|
144
|
-
const currentItem = getSelectItem(parallelTreeData,data)
|
|
145
|
-
onChange(handleData,data,currentItem,parallelTreeData);
|
|
141
|
+
const parallelTreeData = parallelData(treeData, [])
|
|
142
|
+
const currentItem = getSelectItem(parallelTreeData, data)
|
|
143
|
+
onChange(handleData, data, currentItem, parallelTreeData);
|
|
146
144
|
onChangeName && onChangeName(dataName);
|
|
147
145
|
getTreeData && getTreeData(treeData); // 把树节点暴露出去
|
|
148
146
|
ctx?.form?.setFieldValue(ctx.name, handleData);
|
|
@@ -153,17 +151,17 @@ const TreeSearchSelect = (props: any) => {
|
|
|
153
151
|
}, []);
|
|
154
152
|
|
|
155
153
|
const maxTagPlaceholder = (selectedValues: any) => {
|
|
156
|
-
const onClose = (e: any,item: any) => {
|
|
154
|
+
const onClose = (e: any, item: any) => {
|
|
157
155
|
e.preventDefault();
|
|
158
|
-
const newValue = labelInValue ? JSON.parse(JSON.stringify(value)).filter((i: any) => i.value !== item.value): JSON.parse(JSON.stringify(value)).filter((i: any) => i !== item.value)
|
|
159
|
-
const newValueName = labelInValue ? null: JSON.parse(JSON.stringify(valueName)).filter((i: any) => i !== item.label)
|
|
156
|
+
const newValue = labelInValue ? JSON.parse(JSON.stringify(value)).filter((i: any) => i.value !== item.value) : JSON.parse(JSON.stringify(value)).filter((i: any) => i !== item.value)
|
|
157
|
+
const newValueName = labelInValue ? null : JSON.parse(JSON.stringify(valueName)).filter((i: any) => i !== item.label)
|
|
160
158
|
handleChange(newValue, newValueName);
|
|
161
159
|
}
|
|
162
160
|
return (
|
|
163
161
|
<Tooltip title={selectedValues.map((i: any) => (
|
|
164
162
|
<Tag
|
|
165
163
|
closable={true}
|
|
166
|
-
onClose={(e) => onClose(e,i)}
|
|
164
|
+
onClose={(e) => onClose(e, i)}
|
|
167
165
|
style={{ marginRight: 3, background: '#f5f5f5', height: '24px', border: '1px solid #f0f0f0' }}
|
|
168
166
|
>
|
|
169
167
|
{i.label}
|
|
@@ -195,7 +193,7 @@ const TreeSearchSelect = (props: any) => {
|
|
|
195
193
|
multiple={multiple} // 支持多选(当设置 treeCheckable 时自动变为 true)
|
|
196
194
|
maxTagPlaceholder={maxTagPlaceholder}
|
|
197
195
|
onChange={handleChange}
|
|
198
|
-
disabled={disabled || mode==='view' || ctx?.mode === 'view'}
|
|
196
|
+
disabled={disabled || mode === 'view' || ctx?.mode === 'view'}
|
|
199
197
|
getPopupContainer={(triggerNode) => (getPopupContainer && getPopupContainer(triggerNode)) || document.body}
|
|
200
198
|
>
|
|
201
199
|
</TreeSelect>
|