@bit-sun/business-component 4.0.0-alpha.3 → 4.0.2
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/.editorconfig +16 -0
- package/.fatherrc.ts +5 -0
- package/.gitlab-ci.yml +179 -0
- package/.prettierignore +7 -0
- package/.prettierrc +11 -0
- package/.umirc.ts +74 -0
- package/dist/components/Business/BsSulaQueryTable/setting.d.ts +1 -1
- package/dist/components/Business/BsSulaQueryTable/utils.d.ts +1 -1
- package/dist/components/Business/columnSettingTable/columnSetting.d.ts +1 -1
- package/dist/components/Business/columnSettingTable/index.d.ts +1 -0
- package/dist/components/Common/ParagraphCopier/index.d.ts +8 -0
- package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/CustomSelectorModal.d.ts +3 -0
- package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/helps.d.ts +2 -0
- package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/index.d.ts +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +1901 -639
- package/dist/index.js +1903 -636
- package/dist/utils/requestUtils.d.ts +1 -0
- package/dist/utils/utils.d.ts +3 -0
- package/docs/index.md +21 -0
- package/package.json +9 -14
- package/src/assets/32.svg +28 -0
- package/src/assets/addIcon.svg +18 -0
- package/src/assets/allfunc.svg +28 -0
- package/src/assets/arrowRight.svg +25 -0
- package/src/assets/arrow_top.png +0 -0
- package/src/assets/arrow_top.svg +18 -0
- package/src/assets/btn-delete.svg +30 -0
- package/src/assets/btn-edit.svg +20 -0
- package/src/assets/btn-more.svg +18 -0
- package/src/assets/btn-submit.svg +20 -0
- package/src/assets/caidan.svg +12 -0
- package/src/assets/close.svg +26 -0
- package/src/assets/closeicon.png +0 -0
- package/src/assets/drag.svg +17 -0
- package/src/assets/exportFail.svg +38 -0
- package/src/assets/exportProcessing.svg +29 -0
- package/src/assets/exportSuccess.svg +35 -0
- package/src/assets/exportlogo.png +0 -0
- package/src/assets/fixed-left-active.svg +12 -0
- package/src/assets/fixed-left.svg +16 -0
- package/src/assets/fixed-right-active.svg +12 -0
- package/src/assets/fixed-right.svg +16 -0
- package/src/assets/guanbi.svg +16 -0
- package/src/assets/icon-quanping.svg +16 -0
- package/src/assets/icon-shezhi.svg +18 -0
- package/src/assets/label_icon_bottom.svg +26 -0
- package/src/assets/list-no-img.svg +22 -0
- package/src/assets/morentouxiang-32.svg +24 -0
- package/src/assets/right.png +0 -0
- package/src/assets/scanning.svg +25 -0
- package/src/assets/upExport.svg +23 -0
- package/src/assets/xinglan-icon-out.png +0 -0
- package/src/common/ENUM.ts +41 -0
- package/src/components/Business/AddSelectBusiness/index.md +398 -0
- package/src/components/Business/AddSelectBusiness/index.tsx +1116 -0
- package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +112 -0
- package/src/components/Business/BsLayouts/Components/AllFunc/index.less +153 -0
- package/src/components/Business/BsLayouts/Components/AllFunc/index.tsx +70 -0
- package/src/components/Business/BsLayouts/Components/ChooseStore/index.less +0 -0
- package/src/components/Business/BsLayouts/Components/ChooseStore/index.tsx +193 -0
- package/src/components/Business/BsLayouts/Components/ChooseStore/services.ts +10 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.less +90 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.tsx +38 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.tsx +243 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.tsx +385 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.tsx +286 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.tsx +75 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/drawContent.less +171 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/index.less +65 -0
- package/src/components/Business/BsLayouts/Components/CustomerMenu/index.tsx +154 -0
- package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +73 -0
- package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +163 -0
- package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +85 -0
- package/src/components/Business/BsLayouts/Components/RightContent/home.less +218 -0
- package/src/components/Business/BsLayouts/Components/RightContent/i18n.ts +9 -0
- package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +172 -0
- package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +161 -0
- package/src/components/Business/BsLayouts/Components/SearchFunc/index.tsx +76 -0
- package/src/components/Business/BsLayouts/index.less +80 -0
- package/src/components/Business/BsLayouts/index.tsx +1602 -0
- package/src/components/Business/BsLayouts/service.ts +11 -0
- package/src/components/Business/BsLayouts/utils.tsx +205 -0
- package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +566 -0
- package/src/components/Business/BsSulaQueryTable/bssulaquerytable.less +5 -0
- package/src/components/Business/BsSulaQueryTable/index.less +228 -0
- package/src/components/Business/BsSulaQueryTable/index.tsx +817 -0
- package/src/components/Business/BsSulaQueryTable/setting.tsx +937 -0
- package/src/components/Business/BsSulaQueryTable/utils.less +65 -0
- package/src/components/Business/BsSulaQueryTable/utils.tsx +709 -0
- package/src/components/Business/CommodityEntry/index.md +84 -0
- package/src/components/Business/CommodityEntry/index.tsx +82 -0
- package/src/components/Business/CommonAlert/index.less +0 -0
- package/src/components/Business/CommonAlert/index.tsx +23 -0
- package/src/components/Business/CommonGuideWrapper/index.less +156 -0
- package/src/components/Business/CommonGuideWrapper/index.md +61 -0
- package/src/components/Business/CommonGuideWrapper/index.tsx +108 -0
- package/src/components/Business/DetailPageWrapper/index.less +89 -0
- package/src/components/Business/DetailPageWrapper/index.tsx +306 -0
- package/src/components/Business/DetailPageWrapper/utils.tsx +166 -0
- package/src/components/Business/HomePageWrapper/index.less +36 -0
- package/src/components/Business/HomePageWrapper/index.md +45 -0
- package/src/components/Business/HomePageWrapper/index.tsx +130 -0
- package/src/components/Business/JsonQueryTable/components/FieldsModifyModal.tsx +823 -0
- package/src/components/Business/JsonQueryTable/components/FieldsSettingsTable.tsx +206 -0
- package/src/components/Business/JsonQueryTable/components/Formula.tsx +205 -0
- package/src/components/Business/JsonQueryTable/components/MaintainOptions.tsx +127 -0
- package/src/components/Business/JsonQueryTable/configButton/index.js +20 -0
- package/src/components/Business/JsonQueryTable/configTree/component/compactArrayView.js +25 -0
- package/src/components/Business/JsonQueryTable/configTree/component/compactObjectView.js +30 -0
- package/src/components/Business/JsonQueryTable/configTree/index.js +82 -0
- package/src/components/Business/JsonQueryTable/configTree/index.less +44 -0
- package/src/components/Business/JsonQueryTable/configTree/parser/highlight.js +57 -0
- package/src/components/Business/JsonQueryTable/configTree/parser/index.js +124 -0
- package/src/components/Business/JsonQueryTable/configTree/render/iconRender.js +29 -0
- package/src/components/Business/JsonQueryTable/configTree/render/nameRender.js +22 -0
- package/src/components/Business/JsonQueryTable/configTree/treeNode.js +116 -0
- package/src/components/Business/JsonQueryTable/drawer/index.tsx +12 -0
- package/src/components/Business/JsonQueryTable/function.ts +62 -0
- package/src/components/Business/JsonQueryTable/index.less +17 -0
- package/src/components/Business/JsonQueryTable/index.md +328 -0
- package/src/components/Business/JsonQueryTable/index.tsx +534 -0
- package/src/components/Business/JsonQueryTable/jsonEditor/index.js +346 -0
- package/src/components/Business/JsonQueryTable/jsonEditor/index.less +22 -0
- package/src/components/Business/JsonQueryTable/jsonEditor/lint/basicType.js +147 -0
- package/src/components/Business/JsonQueryTable/jsonEditor/lint/index.js +389 -0
- package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/actions.js +118 -0
- package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/dependency.js +22 -0
- package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/index.js +21 -0
- package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/request.js +65 -0
- package/src/components/Business/JsonQueryTable/static.ts +450 -0
- package/src/components/Business/SearchSelect/BusinessUtils.tsx +2207 -0
- package/src/components/Business/SearchSelect/common.ts +134 -0
- package/src/components/Business/SearchSelect/index.md +1570 -0
- package/src/components/Business/SearchSelect/index.tsx +55 -0
- package/src/components/Business/SearchSelect/utils.ts +125 -0
- package/src/components/Business/StateFlow/index.less +131 -0
- package/src/components/Business/StateFlow/index.md +60 -0
- package/src/components/Business/StateFlow/index.tsx +30 -0
- package/src/components/Business/TreeSearchSelect/index.md +239 -0
- package/src/components/Business/TreeSearchSelect/index.tsx +33 -0
- package/src/components/Business/TreeSearchSelect/utils.ts +115 -0
- package/src/components/Business/columnSettingTable/columnSetting.tsx +869 -0
- package/src/components/Business/columnSettingTable/index.less +253 -0
- package/src/components/Business/columnSettingTable/index.md +373 -0
- package/src/components/Business/columnSettingTable/index.tsx +235 -0
- package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +232 -0
- package/src/components/Business/columnSettingTable/utils.tsx +88 -0
- package/src/components/Business/moreTreeTable/FixedScrollBar.tsx +87 -0
- package/src/components/Business/moreTreeTable/hooks/useSticky.ts +21 -0
- package/src/components/Business/moreTreeTable/index.less +100 -0
- package/src/components/Business/moreTreeTable/index.md +448 -0
- package/src/components/Business/moreTreeTable/index.tsx +387 -0
- package/src/components/Business/moreTreeTable/utils.ts +127 -0
- package/src/components/Common/ExtendedCollapse/ExtendedPanel.tsx +51 -0
- package/src/components/Common/ExtendedCollapse/index.less +33 -0
- package/src/components/Common/ExtendedCollapse/index.md +136 -0
- package/src/components/Common/ExtendedCollapse/index.tsx +25 -0
- package/src/components/Common/ParagraphCopier/index.md +81 -0
- package/src/components/Common/ParagraphCopier/index.tsx +56 -0
- package/src/components/Common/Section/index.md +120 -0
- package/src/components/Common/Section/index.module.less +16 -0
- package/src/components/Common/Section/index.tsx +70 -0
- package/src/components/Functional/AccessWrapper/index.tsx +34 -0
- package/src/components/Functional/AddSelect/helps.ts +81 -0
- package/src/components/Functional/AddSelect/index.less +367 -0
- package/src/components/Functional/AddSelect/index.md +155 -0
- package/src/components/Functional/AddSelect/index.tsx +1072 -0
- package/src/components/Functional/AuthButton/index.tsx +15 -0
- package/src/components/Functional/BillEntry/index.less +371 -0
- package/src/components/Functional/BillEntry/index.md +39 -0
- package/src/components/Functional/BillEntry/index.tsx +771 -0
- package/src/components/Functional/BsAntdSula/BsCascader/index.md +62 -0
- package/src/components/Functional/BsAntdSula/BsCascader/index.tsx +178 -0
- package/src/components/Functional/BsAntdSula/index.ts +2 -0
- package/src/components/Functional/DataImport/index.less +63 -0
- package/src/components/Functional/DataImport/index.md +44 -0
- package/src/components/Functional/DataImport/index.tsx +782 -0
- package/src/components/Functional/DataValidation/index.less +63 -0
- package/src/components/Functional/DataValidation/index.md +52 -0
- package/src/components/Functional/DataValidation/index.tsx +788 -0
- package/src/components/Functional/EllipsisTooltip/index.d.ts +5 -0
- package/src/components/Functional/EllipsisTooltip/index.js +36 -0
- package/src/components/Functional/EllipsisTooltip/index.md +30 -0
- package/src/components/Functional/ExportFunctions/ExportIcon/index.md +37 -0
- package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +65 -0
- package/src/components/Functional/QueryMutipleInput/index.less +37 -0
- package/src/components/Functional/QueryMutipleInput/index.md +33 -0
- package/src/components/Functional/QueryMutipleInput/index.tsx +129 -0
- package/src/components/Functional/SearchSelect/index.less +121 -0
- package/src/components/Functional/SearchSelect/index.md +141 -0
- package/src/components/Functional/SearchSelect/index.tsx +1041 -0
- package/src/components/Functional/SearchSelect/utils.ts +3 -0
- package/src/components/Functional/TreeSearchSelect/index.md +47 -0
- package/src/components/Functional/TreeSearchSelect/index.tsx +224 -0
- package/src/components/Solution/RuleComponent/CustomPlugin/CustomSelector/CustomSelectorModal.tsx +358 -0
- package/src/components/Solution/RuleComponent/CustomPlugin/CustomSelector/function.js +255 -0
- package/src/components/Solution/RuleComponent/CustomPlugin/CustomSelector/helps.tsx +58 -0
- package/src/components/Solution/RuleComponent/CustomPlugin/CustomSelector/index.tsx +129 -0
- package/src/components/Solution/RuleComponent/Formula.tsx +335 -0
- package/src/components/Solution/RuleComponent/InnerSelect.tsx +62 -0
- package/src/components/Solution/RuleComponent/RenderCompItem.tsx +743 -0
- package/src/components/Solution/RuleComponent/index.d.ts +29 -0
- package/src/components/Solution/RuleComponent/index.js +1614 -0
- package/src/components/Solution/RuleComponent/index.less +247 -0
- package/src/components/Solution/RuleComponent/renderSpecificAction.js +99 -0
- package/src/components/Solution/RuleComponent/ruleFiled.js +2587 -0
- package/src/components/Solution/RuleComponent/services.ts +13 -0
- package/src/components/Solution/RuleComponent/util.js +143 -0
- package/src/components/Solution/RuleSetter/RuleInstance.tsx +6 -0
- package/src/components/Solution/RuleSetter/baseRule.tsx +394 -0
- package/src/components/Solution/RuleSetter/function.ts +437 -0
- package/src/components/Solution/RuleSetter/index.less +221 -0
- package/src/components/Solution/RuleSetter/index.tsx +208 -0
- package/src/components/Solution/RuleSetter/service.js +276 -0
- package/src/index.ts +46 -0
- package/src/plugin/TableColumnSetting/index.less +247 -0
- package/src/plugin/TableColumnSetting/index.md +50 -0
- package/src/plugin/TableColumnSetting/index.tsx +725 -0
- package/src/plugin/TableColumnSetting/utils.ts +19 -0
- package/src/styles/bsDefault.less +32 -12
- package/src/utils/CheckOneUser/index.md +39 -0
- package/src/utils/CheckOneUser/index.ts +52 -0
- package/src/utils/CustomLoginInfo.ts +55 -0
- package/src/utils/LocalstorageUtils.ts +134 -0
- package/src/utils/TableUtils.less +52 -0
- package/src/utils/TableUtils.tsx +691 -0
- package/src/utils/auth.ts +39 -0
- package/src/utils/businessUtils.ts +434 -0
- package/src/utils/checkUtils.ts +39 -0
- package/src/utils/constant.ts +38 -0
- package/src/utils/enumConfig.ts +17 -0
- package/src/utils/getFormMode.js +12 -0
- package/src/utils/index.ts +19 -0
- package/src/utils/request.ts +53 -0
- package/src/utils/requestUtils.ts +197 -0
- package/src/utils/serialize.js +7 -0
- package/src/utils/utils.ts +267 -0
- package/src/utils/xlsxUtil.tsx +146 -0
- package/tsconfig.json +29 -0
- package/typings.d.ts +5 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tooltip } from 'antd';
|
|
3
|
+
|
|
4
|
+
class EllipsisTooltip extends React.Component {
|
|
5
|
+
state = {
|
|
6
|
+
visible: false,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
handleVisibleChange = (visible) => {
|
|
10
|
+
if (this.props.title.length > this.props.maxLength) {
|
|
11
|
+
this.setState({
|
|
12
|
+
visible,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
render() {
|
|
18
|
+
const style = {
|
|
19
|
+
...this.props.style,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<Tooltip
|
|
24
|
+
visible={this.state.visible}
|
|
25
|
+
onVisibleChange={this.handleVisibleChange}
|
|
26
|
+
title={this.props.title}
|
|
27
|
+
>
|
|
28
|
+
<div className="customEllipse" style={style}>
|
|
29
|
+
{this.props.showInfo && this.props.showInfo ||
|
|
30
|
+
(this.props.title.length > this.props.maxLength ? `${this.props.title.substring(0, this.props.maxLength)}...` : this.props.title)}
|
|
31
|
+
</div>
|
|
32
|
+
</Tooltip>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export default EllipsisTooltip;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav:
|
|
3
|
+
title: '组件'
|
|
4
|
+
order: 1
|
|
5
|
+
group:
|
|
6
|
+
title: 功能组件
|
|
7
|
+
order: 0
|
|
8
|
+
title: 字符超长处理组件
|
|
9
|
+
order: 6
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## EllipsisTooltip
|
|
13
|
+
|
|
14
|
+
字符超长处理组件
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import React, { useRef } from 'react';
|
|
18
|
+
import { EllipsisTooltip } from '../../../index';
|
|
19
|
+
|
|
20
|
+
export default () => {
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<div>
|
|
24
|
+
<EllipsisTooltip maxLength={10} title={'一二三四五六七八九十十一十二十三'} />
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
More skills for writing demo: https://d.umijs.org/guide/demo-principle
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 导出按钮
|
|
3
|
+
order: 5
|
|
4
|
+
nav:
|
|
5
|
+
title: 组件
|
|
6
|
+
order: 1
|
|
7
|
+
group:
|
|
8
|
+
path: /components/functional
|
|
9
|
+
order: 0
|
|
10
|
+
title: 功能组件
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## ExportIcon
|
|
14
|
+
|
|
15
|
+
导出按钮demo
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import React, { useState, useRef } from 'react';
|
|
19
|
+
import {ExportIcon} from '../../../../index';
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
export default () => {
|
|
24
|
+
|
|
25
|
+
const tableRef = useRef()
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<div>
|
|
29
|
+
<ExportIcon request={{url:'abc'}} tableRef={tableRef}/>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
<API></API>
|
|
36
|
+
|
|
37
|
+
More skills for writing demo: https://d.umijs.org/guide/demo-principle
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import React, {Ref} from 'react'
|
|
3
|
+
import {message, Popconfirm, Tooltip} from "antd";
|
|
4
|
+
import request from '@/utils/request';
|
|
5
|
+
import exportlogo from '../../../../assets/exportlogo.png'
|
|
6
|
+
import {omit} from 'lodash'
|
|
7
|
+
import { judgeIsRequestError } from '@/utils/requestUtils';
|
|
8
|
+
interface exportIconType{
|
|
9
|
+
/** others选填,使用axios发请求,*/
|
|
10
|
+
request:{
|
|
11
|
+
url: string,
|
|
12
|
+
params: Function | Object,
|
|
13
|
+
others?: Object
|
|
14
|
+
},
|
|
15
|
+
/** BsSulaQueryTable的tableRef*/
|
|
16
|
+
tableRef: any,
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const ExportIcon = ({request:exportRequest, tableRef, allowSelect, columnsRowKey}: exportIconType) => {
|
|
20
|
+
const {url, params, others} = exportRequest
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<div style={{ cursor: 'pointer' }}>
|
|
24
|
+
<Tooltip title="导出数据">
|
|
25
|
+
<img width={32} src={exportlogo} onClick={() =>{
|
|
26
|
+
const convertedParams = tableRef?.current?.getExportParams()
|
|
27
|
+
let requestData: any
|
|
28
|
+
|
|
29
|
+
if(typeof params === 'function'){
|
|
30
|
+
requestData = {...omit(params(convertedParams),'selectedRows')}
|
|
31
|
+
requestData.pageSize=100000
|
|
32
|
+
}else if(typeof params === 'object'){
|
|
33
|
+
requestData = {...params}
|
|
34
|
+
}
|
|
35
|
+
if(!params){
|
|
36
|
+
requestData = omit(convertedParams, 'selectedRows')
|
|
37
|
+
requestData.pageSize=100000
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (allowSelect) {
|
|
41
|
+
let selectKey = allowSelect?.key || columnsRowKey;
|
|
42
|
+
requestData[`qp-${selectKey}-in`] = convertedParams?.selectedRows?.map((d: any) => d[selectKey])?.join(',')
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
request({
|
|
46
|
+
url,
|
|
47
|
+
method:'POST',
|
|
48
|
+
data:requestData,
|
|
49
|
+
...others,
|
|
50
|
+
})
|
|
51
|
+
.then((result: any) => {
|
|
52
|
+
result = result.data;
|
|
53
|
+
if (judgeIsRequestError(result)) {
|
|
54
|
+
message.error(result?.msg);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
message.success('任务已排入导出队列')
|
|
58
|
+
})
|
|
59
|
+
}} />
|
|
60
|
+
</Tooltip>
|
|
61
|
+
</div>
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export default ExportIcon
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
.query_input {
|
|
2
|
+
&_show {
|
|
3
|
+
display: flex;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
&_expand_button {
|
|
7
|
+
position: relative;
|
|
8
|
+
width: 30px;
|
|
9
|
+
color: #ffffff;
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
|
|
12
|
+
span {
|
|
13
|
+
position: absolute;
|
|
14
|
+
height: 20px;
|
|
15
|
+
line-height: 14px;
|
|
16
|
+
left: 50%;
|
|
17
|
+
top: 50%;
|
|
18
|
+
transform: translate(-50%, -50%);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&_wrapper {
|
|
23
|
+
display: flex;
|
|
24
|
+
|
|
25
|
+
&_left {
|
|
26
|
+
width: 100px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&_right {
|
|
30
|
+
color: #9e9e9e;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&_textArea {
|
|
35
|
+
margin-top: 15px;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav:
|
|
3
|
+
title: '组件'
|
|
4
|
+
order: 1
|
|
5
|
+
group:
|
|
6
|
+
title: 功能组件
|
|
7
|
+
order: 0
|
|
8
|
+
title: 批量查询组件
|
|
9
|
+
order: 2
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## QueryMutipleInput
|
|
13
|
+
|
|
14
|
+
Demo:
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import React, { useRef } from 'react';
|
|
18
|
+
import { QueryMutipleInput } from '../../../index';
|
|
19
|
+
|
|
20
|
+
export default () => {
|
|
21
|
+
const handleOnChange = (value) => {
|
|
22
|
+
console.log(value);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<div>
|
|
27
|
+
<QueryMutipleInput onValueChange={handleOnChange} />
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
More skills for writing demo: https://d.umijs.org/guide/demo-principle
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Description:
|
|
3
|
+
* @Author: rodchen
|
|
4
|
+
* @Date: 2021-12-01 10:52:08
|
|
5
|
+
* @LastEditTime: 2021-12-29 19:14:56
|
|
6
|
+
* @LastEditors: rodchen
|
|
7
|
+
*/
|
|
8
|
+
// @ts-nocheck
|
|
9
|
+
import React, { useState, useEffect } from 'react';
|
|
10
|
+
import { useDebounceFn } from 'ahooks';
|
|
11
|
+
import { Input, Button, Modal } from 'antd';
|
|
12
|
+
import './index.less';
|
|
13
|
+
|
|
14
|
+
const QueryMutipleInput = ({ onValueChange,onPressEnter }) => {
|
|
15
|
+
const [isModalVisible, setIsModalVisible] = useState(false);
|
|
16
|
+
const [value, setValue] = useState('');
|
|
17
|
+
const [popvalue, setPopValue] = useState('');
|
|
18
|
+
const { run } = useDebounceFn(
|
|
19
|
+
() => {
|
|
20
|
+
formaData(value);
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
wait: 1000,
|
|
24
|
+
},
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
setPopValue(value);
|
|
29
|
+
onValueChange(value);
|
|
30
|
+
}, [value]);
|
|
31
|
+
|
|
32
|
+
const showModal = () => {
|
|
33
|
+
setIsModalVisible(true);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const handleOk = () => {
|
|
37
|
+
formaData(popvalue);
|
|
38
|
+
setIsModalVisible(false);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const formaData = (value) => {
|
|
42
|
+
let formatValue = ToCDB(value)
|
|
43
|
+
.split(/[/\n/\s,;]/)
|
|
44
|
+
.filter((item) => item)
|
|
45
|
+
.join(',');
|
|
46
|
+
setValue(formatValue);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const handleCancel = () => {
|
|
50
|
+
setIsModalVisible(false);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const outerChange = (e) => {
|
|
54
|
+
setValue(e.target.value);
|
|
55
|
+
run();
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const onChange = (e) => {
|
|
59
|
+
setPopValue(e.target.value);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<div className={'query_input'}>
|
|
64
|
+
<div className="query_input_show">
|
|
65
|
+
<Input
|
|
66
|
+
value={value}
|
|
67
|
+
onChange={outerChange}
|
|
68
|
+
onBlur={(e) => {
|
|
69
|
+
formaData(e.target.value);
|
|
70
|
+
}}
|
|
71
|
+
onPaste={(e) => {
|
|
72
|
+
formaData(e.clipboardData.getData('text'));
|
|
73
|
+
e.preventDefault();
|
|
74
|
+
}}
|
|
75
|
+
style={{ width: 'calc(100% - 30px)' }}
|
|
76
|
+
placeholder="请输入(查询多个值请用 ; 或 , 分割)"
|
|
77
|
+
onPressEnter={()=>onPressEnter?.()}
|
|
78
|
+
/>
|
|
79
|
+
<Button style={{width: '30px', padding: '2px', height: 'auto'}} onClick={showModal} type="primary">...</Button>
|
|
80
|
+
</div>
|
|
81
|
+
<Modal
|
|
82
|
+
width={600}
|
|
83
|
+
title="多值录入"
|
|
84
|
+
visible={isModalVisible}
|
|
85
|
+
onOk={handleOk}
|
|
86
|
+
onCancel={handleCancel}
|
|
87
|
+
footer={[
|
|
88
|
+
<Button key="back" onClick={handleCancel}>
|
|
89
|
+
取消
|
|
90
|
+
</Button>,
|
|
91
|
+
<Button key="submit" type="primary" onClick={handleOk}>
|
|
92
|
+
录入
|
|
93
|
+
</Button>,
|
|
94
|
+
]}
|
|
95
|
+
>
|
|
96
|
+
<div className={'query_input_wrapper'}>
|
|
97
|
+
<div className={'query_input_wrapper_left'}>录入区:</div>
|
|
98
|
+
<div className={'query_input_wrapper_right'}>
|
|
99
|
+
<div>
|
|
100
|
+
如需同时使用多个值进行查询,请使用逗号、分号、空格或换行进行值的分隔,中英文格式的符号均支持
|
|
101
|
+
</div>
|
|
102
|
+
<div className={'query_input_textArea'}>
|
|
103
|
+
<Input.TextArea
|
|
104
|
+
value={popvalue}
|
|
105
|
+
onChange={onChange}
|
|
106
|
+
rows={6}
|
|
107
|
+
showCount
|
|
108
|
+
/>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
</Modal>
|
|
113
|
+
</div>
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
function ToCDB(str) {
|
|
118
|
+
var tmp = '';
|
|
119
|
+
for (var i = 0; i < str.length; i++) {
|
|
120
|
+
if (str.charCodeAt(i) > 65248 && str.charCodeAt(i) < 65375) {
|
|
121
|
+
tmp += String.fromCharCode(str.charCodeAt(i) - 65248);
|
|
122
|
+
} else {
|
|
123
|
+
tmp += String.fromCharCode(str.charCodeAt(i));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return tmp;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export default QueryMutipleInput;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
.search_select {
|
|
2
|
+
&_show {
|
|
3
|
+
display: flex;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
&_expand_button {
|
|
7
|
+
position: relative;
|
|
8
|
+
width: 30px;
|
|
9
|
+
color: #ffffff;
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
|
|
12
|
+
span {
|
|
13
|
+
position: absolute;
|
|
14
|
+
height: 20px;
|
|
15
|
+
line-height: 14px;
|
|
16
|
+
left: 50%;
|
|
17
|
+
top: 50%;
|
|
18
|
+
transform: translate(-50%, -50%);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&_wrapper {
|
|
23
|
+
position: relative;
|
|
24
|
+
display: flex;
|
|
25
|
+
min-height: 60vh;
|
|
26
|
+
max-height: 60vh;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
font-size: 14px;
|
|
29
|
+
|
|
30
|
+
&_click_flag {
|
|
31
|
+
position: absolute;
|
|
32
|
+
z-index: 10;
|
|
33
|
+
&_arrow {
|
|
34
|
+
transform: rotate(0deg);
|
|
35
|
+
transition: transform 0.5s;
|
|
36
|
+
}
|
|
37
|
+
&_arrow_1 {
|
|
38
|
+
transform: rotate(-180deg);
|
|
39
|
+
transition: transform 0.5s;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&_left {
|
|
44
|
+
width: 28%;
|
|
45
|
+
overflow-y: hidden;
|
|
46
|
+
//background-color: yellow;
|
|
47
|
+
transition: all 0.3s;
|
|
48
|
+
margin-left: 20px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&_left1 {
|
|
52
|
+
width: 0;
|
|
53
|
+
height: 0;
|
|
54
|
+
transition: all 0.3s;
|
|
55
|
+
display: none;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&_right {
|
|
59
|
+
width: 70%;
|
|
60
|
+
margin-left: 1%;
|
|
61
|
+
//background-color: pink;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&_right1 {
|
|
65
|
+
width: 100%;
|
|
66
|
+
margin-left: 20px;
|
|
67
|
+
//background-color: green;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&_right, &_right1 {
|
|
71
|
+
overflow-x: auto;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.select_list_columns {
|
|
75
|
+
width: 100%;
|
|
76
|
+
height: calc(60vh - 60px);
|
|
77
|
+
overflow-y: auto;
|
|
78
|
+
border: 1px solid #d8d8d8;
|
|
79
|
+
&_tips {
|
|
80
|
+
background: #eee;
|
|
81
|
+
padding: 6px 20px;
|
|
82
|
+
margin-bottom: 10px;
|
|
83
|
+
}
|
|
84
|
+
&_formItems {
|
|
85
|
+
padding: 0 20px;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
.select_list_searchButton {
|
|
89
|
+
display: flex;
|
|
90
|
+
margin: 10px 0px;
|
|
91
|
+
justify-content: flex-end;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.select_list_button_space {
|
|
95
|
+
margin-right: 10px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.select_list_selectTips {
|
|
99
|
+
display: flex;
|
|
100
|
+
justify-content: space-between;
|
|
101
|
+
height: 34px;
|
|
102
|
+
line-height: 32px;
|
|
103
|
+
background-color: #eee;
|
|
104
|
+
margin-bottom: 10px;
|
|
105
|
+
padding: 0 12px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.select_list_selectAll {
|
|
109
|
+
position: relative;
|
|
110
|
+
top: -40px;
|
|
111
|
+
left: 20px;
|
|
112
|
+
width: 160px;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.searchSelectSpin{
|
|
118
|
+
&>div{
|
|
119
|
+
height: 300px !important;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav:
|
|
3
|
+
title: '组件'
|
|
4
|
+
order: 1
|
|
5
|
+
group:
|
|
6
|
+
title: 功能组件
|
|
7
|
+
order: 0
|
|
8
|
+
title: 档案选择器
|
|
9
|
+
order: 3
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## SearchSelect
|
|
13
|
+
|
|
14
|
+
Demo:
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import React, { useState } from 'react';
|
|
18
|
+
import { SearchSelect } from '../../../index';
|
|
19
|
+
|
|
20
|
+
export default () => {
|
|
21
|
+
const selectProps = {
|
|
22
|
+
// mode: 'multiple',
|
|
23
|
+
// maxTagCount: 1,
|
|
24
|
+
}
|
|
25
|
+
const [value, setValue] = useState(selectProps?.mode ? [] : null);
|
|
26
|
+
const props = {
|
|
27
|
+
value,
|
|
28
|
+
// labelInValue: true, // 非必填 默认为false
|
|
29
|
+
requestConfig: {
|
|
30
|
+
url: `/bop/api/supplier`,
|
|
31
|
+
filter: 'qp-name-like', // 过滤参数 支持'qp-name-like'和['qp-name-like', 'qp-code-like']两种结构
|
|
32
|
+
otherParams: {}, // 默认参数
|
|
33
|
+
// mappingTextField: 'name',
|
|
34
|
+
// mappingValueField: 'code',
|
|
35
|
+
},
|
|
36
|
+
selectProps,
|
|
37
|
+
onChange: (value: any) => {
|
|
38
|
+
console.log(value)
|
|
39
|
+
setValue(value)
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const DictionaryUC000013 = [{ text: '共享', value: '10' }, { text: '私有', value: '20' }]
|
|
43
|
+
const modalTableProps = {
|
|
44
|
+
modalTableTitle: '选择供应商',
|
|
45
|
+
tableSearchForm: [
|
|
46
|
+
{ name: 'qp-name-like', label: '客户名称' }, // field: { type: 'input', props: { placeholder: '8888'}}
|
|
47
|
+
{ name: 'qp-code-like', label: '客户编码' },
|
|
48
|
+
{
|
|
49
|
+
name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
|
|
50
|
+
type: 'select',
|
|
51
|
+
props: {
|
|
52
|
+
mode: 'multiple',
|
|
53
|
+
notFoundContent: '暂无数据',
|
|
54
|
+
allowClear: true,
|
|
55
|
+
showSearch: true,
|
|
56
|
+
showArrow: true,
|
|
57
|
+
maxTagCount: 1,
|
|
58
|
+
optionFilterProp: 'children',
|
|
59
|
+
filterOption: (input: string, option: { props: { children: string } }) =>
|
|
60
|
+
option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
initialSource: [{ text: '英伦宝贝儿童用品有限公司', value: 'A0001' }]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
|
|
67
|
+
type: 'select',
|
|
68
|
+
props: {
|
|
69
|
+
mode: 'multiple',
|
|
70
|
+
notFoundContent: '暂无数据',
|
|
71
|
+
allowClear: true,
|
|
72
|
+
showSearch: true,
|
|
73
|
+
showArrow: true,
|
|
74
|
+
maxTagCount: 1,
|
|
75
|
+
optionFilterProp: 'children',
|
|
76
|
+
filterOption: (input: string, option: { props: { children: string } }) =>
|
|
77
|
+
option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
initialSource: [{ text: '上海哲雄母婴用品有限公司', value: 'F002' }, { text: '上海英伦宝贝儿童用品有限公司', value: 'F001' }]
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
|
|
84
|
+
type: 'select',
|
|
85
|
+
props: {
|
|
86
|
+
mode: 'multiple',
|
|
87
|
+
notFoundContent: '暂无数据',
|
|
88
|
+
allowClear: true,
|
|
89
|
+
showSearch: true,
|
|
90
|
+
showArrow: true,
|
|
91
|
+
maxTagCount: 1,
|
|
92
|
+
optionFilterProp: 'children',
|
|
93
|
+
filterOption: (input: string, option: { props: { children: string } }) =>
|
|
94
|
+
option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
initialSource: [{ text: '上海哲雄母婴用品有限公司', value: 'F002' }, { text: '上海英伦宝贝儿童用品有限公司', value: 'F001' }]
|
|
98
|
+
},
|
|
99
|
+
{ name: 'qp-sharingType-eq', type: 'select', label: '共享类型', initialSource: DictionaryUC000013 }, // 页面可以直接使用getDictionarySource('UC000013')
|
|
100
|
+
],
|
|
101
|
+
tableColumns: [
|
|
102
|
+
{
|
|
103
|
+
title: '客户编码',
|
|
104
|
+
dataIndex: 'code',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
title: '客户名称',
|
|
108
|
+
dataIndex: 'name',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
title: '归属集团',
|
|
112
|
+
dataIndex: 'conglomerateName',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
title: '归属法人公司',
|
|
116
|
+
dataIndex: 'legalCompanyName',
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
title: '归属核算主体',
|
|
120
|
+
dataIndex: 'accountingName',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
title: '共享类型',
|
|
124
|
+
dataIndex: 'sharingType',
|
|
125
|
+
render: (text) => DictionaryUC000013?.find((i) => i.value === text)?.text, // getDictionaryTextByValue('UC000013', text)
|
|
126
|
+
},
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return (
|
|
131
|
+
<div>
|
|
132
|
+
<SearchSelect
|
|
133
|
+
{...props}
|
|
134
|
+
modalTableProps={modalTableProps}
|
|
135
|
+
/>
|
|
136
|
+
</div>
|
|
137
|
+
);
|
|
138
|
+
};
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
More skills for writing demo: https://d.umijs.org/guide/demo-principle
|