@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.
Files changed (241) hide show
  1. package/.editorconfig +16 -0
  2. package/.fatherrc.ts +5 -0
  3. package/.gitlab-ci.yml +179 -0
  4. package/.prettierignore +7 -0
  5. package/.prettierrc +11 -0
  6. package/.umirc.ts +74 -0
  7. package/dist/components/Business/BsSulaQueryTable/setting.d.ts +1 -1
  8. package/dist/components/Business/BsSulaQueryTable/utils.d.ts +1 -1
  9. package/dist/components/Business/columnSettingTable/columnSetting.d.ts +1 -1
  10. package/dist/components/Business/columnSettingTable/index.d.ts +1 -0
  11. package/dist/components/Common/ParagraphCopier/index.d.ts +8 -0
  12. package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/CustomSelectorModal.d.ts +3 -0
  13. package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/helps.d.ts +2 -0
  14. package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/index.d.ts +3 -0
  15. package/dist/index.d.ts +1 -0
  16. package/dist/index.esm.js +1901 -639
  17. package/dist/index.js +1903 -636
  18. package/dist/utils/requestUtils.d.ts +1 -0
  19. package/dist/utils/utils.d.ts +3 -0
  20. package/docs/index.md +21 -0
  21. package/package.json +9 -14
  22. package/src/assets/32.svg +28 -0
  23. package/src/assets/addIcon.svg +18 -0
  24. package/src/assets/allfunc.svg +28 -0
  25. package/src/assets/arrowRight.svg +25 -0
  26. package/src/assets/arrow_top.png +0 -0
  27. package/src/assets/arrow_top.svg +18 -0
  28. package/src/assets/btn-delete.svg +30 -0
  29. package/src/assets/btn-edit.svg +20 -0
  30. package/src/assets/btn-more.svg +18 -0
  31. package/src/assets/btn-submit.svg +20 -0
  32. package/src/assets/caidan.svg +12 -0
  33. package/src/assets/close.svg +26 -0
  34. package/src/assets/closeicon.png +0 -0
  35. package/src/assets/drag.svg +17 -0
  36. package/src/assets/exportFail.svg +38 -0
  37. package/src/assets/exportProcessing.svg +29 -0
  38. package/src/assets/exportSuccess.svg +35 -0
  39. package/src/assets/exportlogo.png +0 -0
  40. package/src/assets/fixed-left-active.svg +12 -0
  41. package/src/assets/fixed-left.svg +16 -0
  42. package/src/assets/fixed-right-active.svg +12 -0
  43. package/src/assets/fixed-right.svg +16 -0
  44. package/src/assets/guanbi.svg +16 -0
  45. package/src/assets/icon-quanping.svg +16 -0
  46. package/src/assets/icon-shezhi.svg +18 -0
  47. package/src/assets/label_icon_bottom.svg +26 -0
  48. package/src/assets/list-no-img.svg +22 -0
  49. package/src/assets/morentouxiang-32.svg +24 -0
  50. package/src/assets/right.png +0 -0
  51. package/src/assets/scanning.svg +25 -0
  52. package/src/assets/upExport.svg +23 -0
  53. package/src/assets/xinglan-icon-out.png +0 -0
  54. package/src/common/ENUM.ts +41 -0
  55. package/src/components/Business/AddSelectBusiness/index.md +398 -0
  56. package/src/components/Business/AddSelectBusiness/index.tsx +1116 -0
  57. package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +112 -0
  58. package/src/components/Business/BsLayouts/Components/AllFunc/index.less +153 -0
  59. package/src/components/Business/BsLayouts/Components/AllFunc/index.tsx +70 -0
  60. package/src/components/Business/BsLayouts/Components/ChooseStore/index.less +0 -0
  61. package/src/components/Business/BsLayouts/Components/ChooseStore/index.tsx +193 -0
  62. package/src/components/Business/BsLayouts/Components/ChooseStore/services.ts +10 -0
  63. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.less +90 -0
  64. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.tsx +38 -0
  65. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.tsx +243 -0
  66. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.tsx +385 -0
  67. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.tsx +286 -0
  68. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.tsx +75 -0
  69. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/drawContent.less +171 -0
  70. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.less +65 -0
  71. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.tsx +154 -0
  72. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +73 -0
  73. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +163 -0
  74. package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +85 -0
  75. package/src/components/Business/BsLayouts/Components/RightContent/home.less +218 -0
  76. package/src/components/Business/BsLayouts/Components/RightContent/i18n.ts +9 -0
  77. package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +172 -0
  78. package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +161 -0
  79. package/src/components/Business/BsLayouts/Components/SearchFunc/index.tsx +76 -0
  80. package/src/components/Business/BsLayouts/index.less +80 -0
  81. package/src/components/Business/BsLayouts/index.tsx +1602 -0
  82. package/src/components/Business/BsLayouts/service.ts +11 -0
  83. package/src/components/Business/BsLayouts/utils.tsx +205 -0
  84. package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +566 -0
  85. package/src/components/Business/BsSulaQueryTable/bssulaquerytable.less +5 -0
  86. package/src/components/Business/BsSulaQueryTable/index.less +228 -0
  87. package/src/components/Business/BsSulaQueryTable/index.tsx +817 -0
  88. package/src/components/Business/BsSulaQueryTable/setting.tsx +937 -0
  89. package/src/components/Business/BsSulaQueryTable/utils.less +65 -0
  90. package/src/components/Business/BsSulaQueryTable/utils.tsx +709 -0
  91. package/src/components/Business/CommodityEntry/index.md +84 -0
  92. package/src/components/Business/CommodityEntry/index.tsx +82 -0
  93. package/src/components/Business/CommonAlert/index.less +0 -0
  94. package/src/components/Business/CommonAlert/index.tsx +23 -0
  95. package/src/components/Business/CommonGuideWrapper/index.less +156 -0
  96. package/src/components/Business/CommonGuideWrapper/index.md +61 -0
  97. package/src/components/Business/CommonGuideWrapper/index.tsx +108 -0
  98. package/src/components/Business/DetailPageWrapper/index.less +89 -0
  99. package/src/components/Business/DetailPageWrapper/index.tsx +306 -0
  100. package/src/components/Business/DetailPageWrapper/utils.tsx +166 -0
  101. package/src/components/Business/HomePageWrapper/index.less +36 -0
  102. package/src/components/Business/HomePageWrapper/index.md +45 -0
  103. package/src/components/Business/HomePageWrapper/index.tsx +130 -0
  104. package/src/components/Business/JsonQueryTable/components/FieldsModifyModal.tsx +823 -0
  105. package/src/components/Business/JsonQueryTable/components/FieldsSettingsTable.tsx +206 -0
  106. package/src/components/Business/JsonQueryTable/components/Formula.tsx +205 -0
  107. package/src/components/Business/JsonQueryTable/components/MaintainOptions.tsx +127 -0
  108. package/src/components/Business/JsonQueryTable/configButton/index.js +20 -0
  109. package/src/components/Business/JsonQueryTable/configTree/component/compactArrayView.js +25 -0
  110. package/src/components/Business/JsonQueryTable/configTree/component/compactObjectView.js +30 -0
  111. package/src/components/Business/JsonQueryTable/configTree/index.js +82 -0
  112. package/src/components/Business/JsonQueryTable/configTree/index.less +44 -0
  113. package/src/components/Business/JsonQueryTable/configTree/parser/highlight.js +57 -0
  114. package/src/components/Business/JsonQueryTable/configTree/parser/index.js +124 -0
  115. package/src/components/Business/JsonQueryTable/configTree/render/iconRender.js +29 -0
  116. package/src/components/Business/JsonQueryTable/configTree/render/nameRender.js +22 -0
  117. package/src/components/Business/JsonQueryTable/configTree/treeNode.js +116 -0
  118. package/src/components/Business/JsonQueryTable/drawer/index.tsx +12 -0
  119. package/src/components/Business/JsonQueryTable/function.ts +62 -0
  120. package/src/components/Business/JsonQueryTable/index.less +17 -0
  121. package/src/components/Business/JsonQueryTable/index.md +328 -0
  122. package/src/components/Business/JsonQueryTable/index.tsx +534 -0
  123. package/src/components/Business/JsonQueryTable/jsonEditor/index.js +346 -0
  124. package/src/components/Business/JsonQueryTable/jsonEditor/index.less +22 -0
  125. package/src/components/Business/JsonQueryTable/jsonEditor/lint/basicType.js +147 -0
  126. package/src/components/Business/JsonQueryTable/jsonEditor/lint/index.js +389 -0
  127. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/actions.js +118 -0
  128. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/dependency.js +22 -0
  129. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/index.js +21 -0
  130. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/request.js +65 -0
  131. package/src/components/Business/JsonQueryTable/static.ts +450 -0
  132. package/src/components/Business/SearchSelect/BusinessUtils.tsx +2207 -0
  133. package/src/components/Business/SearchSelect/common.ts +134 -0
  134. package/src/components/Business/SearchSelect/index.md +1570 -0
  135. package/src/components/Business/SearchSelect/index.tsx +55 -0
  136. package/src/components/Business/SearchSelect/utils.ts +125 -0
  137. package/src/components/Business/StateFlow/index.less +131 -0
  138. package/src/components/Business/StateFlow/index.md +60 -0
  139. package/src/components/Business/StateFlow/index.tsx +30 -0
  140. package/src/components/Business/TreeSearchSelect/index.md +239 -0
  141. package/src/components/Business/TreeSearchSelect/index.tsx +33 -0
  142. package/src/components/Business/TreeSearchSelect/utils.ts +115 -0
  143. package/src/components/Business/columnSettingTable/columnSetting.tsx +869 -0
  144. package/src/components/Business/columnSettingTable/index.less +253 -0
  145. package/src/components/Business/columnSettingTable/index.md +373 -0
  146. package/src/components/Business/columnSettingTable/index.tsx +235 -0
  147. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +232 -0
  148. package/src/components/Business/columnSettingTable/utils.tsx +88 -0
  149. package/src/components/Business/moreTreeTable/FixedScrollBar.tsx +87 -0
  150. package/src/components/Business/moreTreeTable/hooks/useSticky.ts +21 -0
  151. package/src/components/Business/moreTreeTable/index.less +100 -0
  152. package/src/components/Business/moreTreeTable/index.md +448 -0
  153. package/src/components/Business/moreTreeTable/index.tsx +387 -0
  154. package/src/components/Business/moreTreeTable/utils.ts +127 -0
  155. package/src/components/Common/ExtendedCollapse/ExtendedPanel.tsx +51 -0
  156. package/src/components/Common/ExtendedCollapse/index.less +33 -0
  157. package/src/components/Common/ExtendedCollapse/index.md +136 -0
  158. package/src/components/Common/ExtendedCollapse/index.tsx +25 -0
  159. package/src/components/Common/ParagraphCopier/index.md +81 -0
  160. package/src/components/Common/ParagraphCopier/index.tsx +56 -0
  161. package/src/components/Common/Section/index.md +120 -0
  162. package/src/components/Common/Section/index.module.less +16 -0
  163. package/src/components/Common/Section/index.tsx +70 -0
  164. package/src/components/Functional/AccessWrapper/index.tsx +34 -0
  165. package/src/components/Functional/AddSelect/helps.ts +81 -0
  166. package/src/components/Functional/AddSelect/index.less +367 -0
  167. package/src/components/Functional/AddSelect/index.md +155 -0
  168. package/src/components/Functional/AddSelect/index.tsx +1072 -0
  169. package/src/components/Functional/AuthButton/index.tsx +15 -0
  170. package/src/components/Functional/BillEntry/index.less +371 -0
  171. package/src/components/Functional/BillEntry/index.md +39 -0
  172. package/src/components/Functional/BillEntry/index.tsx +771 -0
  173. package/src/components/Functional/BsAntdSula/BsCascader/index.md +62 -0
  174. package/src/components/Functional/BsAntdSula/BsCascader/index.tsx +178 -0
  175. package/src/components/Functional/BsAntdSula/index.ts +2 -0
  176. package/src/components/Functional/DataImport/index.less +63 -0
  177. package/src/components/Functional/DataImport/index.md +44 -0
  178. package/src/components/Functional/DataImport/index.tsx +782 -0
  179. package/src/components/Functional/DataValidation/index.less +63 -0
  180. package/src/components/Functional/DataValidation/index.md +52 -0
  181. package/src/components/Functional/DataValidation/index.tsx +788 -0
  182. package/src/components/Functional/EllipsisTooltip/index.d.ts +5 -0
  183. package/src/components/Functional/EllipsisTooltip/index.js +36 -0
  184. package/src/components/Functional/EllipsisTooltip/index.md +30 -0
  185. package/src/components/Functional/ExportFunctions/ExportIcon/index.md +37 -0
  186. package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +65 -0
  187. package/src/components/Functional/QueryMutipleInput/index.less +37 -0
  188. package/src/components/Functional/QueryMutipleInput/index.md +33 -0
  189. package/src/components/Functional/QueryMutipleInput/index.tsx +129 -0
  190. package/src/components/Functional/SearchSelect/index.less +121 -0
  191. package/src/components/Functional/SearchSelect/index.md +141 -0
  192. package/src/components/Functional/SearchSelect/index.tsx +1041 -0
  193. package/src/components/Functional/SearchSelect/utils.ts +3 -0
  194. package/src/components/Functional/TreeSearchSelect/index.md +47 -0
  195. package/src/components/Functional/TreeSearchSelect/index.tsx +224 -0
  196. package/src/components/Solution/RuleComponent/CustomPlugin/CustomSelector/CustomSelectorModal.tsx +358 -0
  197. package/src/components/Solution/RuleComponent/CustomPlugin/CustomSelector/function.js +255 -0
  198. package/src/components/Solution/RuleComponent/CustomPlugin/CustomSelector/helps.tsx +58 -0
  199. package/src/components/Solution/RuleComponent/CustomPlugin/CustomSelector/index.tsx +129 -0
  200. package/src/components/Solution/RuleComponent/Formula.tsx +335 -0
  201. package/src/components/Solution/RuleComponent/InnerSelect.tsx +62 -0
  202. package/src/components/Solution/RuleComponent/RenderCompItem.tsx +743 -0
  203. package/src/components/Solution/RuleComponent/index.d.ts +29 -0
  204. package/src/components/Solution/RuleComponent/index.js +1614 -0
  205. package/src/components/Solution/RuleComponent/index.less +247 -0
  206. package/src/components/Solution/RuleComponent/renderSpecificAction.js +99 -0
  207. package/src/components/Solution/RuleComponent/ruleFiled.js +2587 -0
  208. package/src/components/Solution/RuleComponent/services.ts +13 -0
  209. package/src/components/Solution/RuleComponent/util.js +143 -0
  210. package/src/components/Solution/RuleSetter/RuleInstance.tsx +6 -0
  211. package/src/components/Solution/RuleSetter/baseRule.tsx +394 -0
  212. package/src/components/Solution/RuleSetter/function.ts +437 -0
  213. package/src/components/Solution/RuleSetter/index.less +221 -0
  214. package/src/components/Solution/RuleSetter/index.tsx +208 -0
  215. package/src/components/Solution/RuleSetter/service.js +276 -0
  216. package/src/index.ts +46 -0
  217. package/src/plugin/TableColumnSetting/index.less +247 -0
  218. package/src/plugin/TableColumnSetting/index.md +50 -0
  219. package/src/plugin/TableColumnSetting/index.tsx +725 -0
  220. package/src/plugin/TableColumnSetting/utils.ts +19 -0
  221. package/src/styles/bsDefault.less +32 -12
  222. package/src/utils/CheckOneUser/index.md +39 -0
  223. package/src/utils/CheckOneUser/index.ts +52 -0
  224. package/src/utils/CustomLoginInfo.ts +55 -0
  225. package/src/utils/LocalstorageUtils.ts +134 -0
  226. package/src/utils/TableUtils.less +52 -0
  227. package/src/utils/TableUtils.tsx +691 -0
  228. package/src/utils/auth.ts +39 -0
  229. package/src/utils/businessUtils.ts +434 -0
  230. package/src/utils/checkUtils.ts +39 -0
  231. package/src/utils/constant.ts +38 -0
  232. package/src/utils/enumConfig.ts +17 -0
  233. package/src/utils/getFormMode.js +12 -0
  234. package/src/utils/index.ts +19 -0
  235. package/src/utils/request.ts +53 -0
  236. package/src/utils/requestUtils.ts +197 -0
  237. package/src/utils/serialize.js +7 -0
  238. package/src/utils/utils.ts +267 -0
  239. package/src/utils/xlsxUtil.tsx +146 -0
  240. package/tsconfig.json +29 -0
  241. package/typings.d.ts +5 -0
@@ -0,0 +1,112 @@
1
+ // @ts-nocheck
2
+ import { List, Tooltip } from 'antd';
3
+ import React, { useEffect, useState, } from 'react';
4
+ import { Link, formatMessage } from 'umi';
5
+ import './index.less';
6
+ import classNames from 'classnames';
7
+ import right from '../../../../../assets/right.png';
8
+ import { getMenuAuthDataKey } from '@/utils/LocalstorageUtils';
9
+ export type SiderTheme = 'light' | 'dark';
10
+
11
+ const DrawContent = ({onClose, itemPath}: any) => {
12
+ const routes = JSON.parse(localStorage.getItem(`customerMenu_${itemPath}_front`) || '[]');
13
+ const btnAuth = JSON.parse(localStorage.getItem(getMenuAuthDataKey()) || '[]');
14
+ const [homepageData, sethomepageData]: any = useState([]);
15
+ const [routesData, setroutesData]: any = useState([]);
16
+
17
+ useEffect(() => {
18
+ const homepageDataList: any[] = []; //不含子集的菜单
19
+ const routesDataList: any[] = []; //含子集的菜单
20
+ routes.forEach(item => {
21
+ if (btnAuth.find((d: any) => d === item.code)) {
22
+ }
23
+ if (item.children) {
24
+ routesDataList.push(item);
25
+ } else {
26
+ homepageDataList.push(item);
27
+ }
28
+ })
29
+ sethomepageData(homepageDataList)
30
+ setroutesData(routesDataList)
31
+ }, []);
32
+
33
+ const renderChildItem = (child) => {
34
+ if (!child.hideInMenu && child.children) {
35
+ return (
36
+ <>
37
+ <List.Item style={{color: '#000', fontWeight: 'bold' }}>
38
+ {formatMessage({ id: `${child.locale}` })}
39
+ </List.Item>
40
+ {child.children.map((menuItem: any) => {
41
+ return renderChildItem(menuItem)
42
+ })}
43
+ </>
44
+ );
45
+ } else if (!child.hideInMenu && child.path) {
46
+ return (
47
+ <List.Item style={{ fontSize: '12px' }} className="allFuncOnMouserover">
48
+ <Link to={child.path} onClick={onClose}>
49
+ <Tooltip
50
+ title={formatMessage({ id: `${child.locale}` })}
51
+ >
52
+ {formatMessage({ id: `${child.locale}` }).length > 10
53
+ ? `${formatMessage({
54
+ id: `${child.name}`,
55
+ }).slice(0, 10)}...`
56
+ : formatMessage({ id: `${child.locale}` })}
57
+ </Tooltip>
58
+ <img className="allFuncOnMouseroverImg" src={right}></img>
59
+ </Link>
60
+ </List.Item>
61
+ );
62
+ }
63
+ }
64
+
65
+
66
+ return (
67
+ <div className='allfunc_drawcontent'>
68
+ <p className={'drawerWarp_p'}>您的当前权限可以使用以下功能:</p>
69
+ <div className={'drawerWarp'}>
70
+ {homepageData && homepageData.filter((d) => !d.hideInMenu).length > 0 && (
71
+ <List
72
+ className={classNames('allFunsList', 'allFunsListWarp')}
73
+ dataSource={homepageData}
74
+ renderItem={(child: any) => {
75
+ if (!child.hideInMenu && child.path) {
76
+ return (
77
+ <div className={classNames('allFunsListWarp')}>
78
+ <List.Item
79
+ className={classNames('allFuncOnMouserover')}
80
+ style={{ padding: '12px 24px' }}
81
+ >
82
+ <Link to={child.path} onClick={onClose}>
83
+ {formatMessage({ id: `${child.name}` })}
84
+ <img className="allFuncOnMouseroverImg" src={right}></img>
85
+ </Link>
86
+ </List.Item>
87
+ </div>
88
+ );
89
+ }
90
+ }}
91
+ />
92
+ )}
93
+ {routesData.map((item, index) => {
94
+ return (
95
+ <List
96
+ className={classNames('allFunsList', 'allFunsListWarp')}
97
+ style={{color: '#005CFF'}}
98
+ header={<b>{formatMessage({ id: `${item.name}` })}</b>}
99
+ bordered
100
+ dataSource={item.children}
101
+ renderItem={(child: any) => {
102
+ return renderChildItem(child)
103
+ }}
104
+ />
105
+ );
106
+ })}
107
+ </div>
108
+ </div>
109
+ )
110
+ }
111
+
112
+ export default DrawContent;
@@ -0,0 +1,153 @@
1
+
2
+
3
+ .menu {
4
+ .anticon {
5
+ margin-right: 8px;
6
+ }
7
+ .ant-dropdown-menu-item {
8
+ min-width: 160px;
9
+ }
10
+ }
11
+
12
+ .right {
13
+ display: flex;
14
+ float: right;
15
+ height: 48px;
16
+ margin-left: auto;
17
+ overflow: hidden;
18
+ .action {
19
+ display: flex;
20
+ align-items: center;
21
+ height: 48px;
22
+ padding: 0 12px;
23
+ cursor: pointer;
24
+ transition: all 0.3s;
25
+ > span {
26
+ vertical-align: middle;
27
+ }
28
+ &:hover {
29
+ background: rgba(0, 0, 0, 0.025);
30
+ }
31
+ .opened {
32
+ background: rgba(0, 0, 0, 0.025);
33
+ }
34
+ }
35
+ .search {
36
+ padding: 0 12px;
37
+ &:hover {
38
+ background: transparent;
39
+ }
40
+ }
41
+ .account {
42
+ .avatar {
43
+ margin-right: 8px;
44
+ color: #005cff;
45
+ vertical-align: top;
46
+ background: rgba(255, 255, 255, 0.85);
47
+ }
48
+ }
49
+ }
50
+
51
+ .dark {
52
+ .action {
53
+ &:hover {
54
+ background: #252a3d;
55
+ }
56
+ .opened {
57
+ background: #252a3d;
58
+ }
59
+ }
60
+ }
61
+
62
+ .warp_allfunc {
63
+ z-index: 100;
64
+
65
+
66
+ .drawerWarp {
67
+ column-count: 4;
68
+ }
69
+
70
+ .drawer_header_warp {
71
+ .ant-list-header {
72
+ padding: 0 0 0 10px !important;
73
+ line-height: 40px;
74
+ border: 0px !important;
75
+ b {
76
+ width: 100%;
77
+ display: inline-block;
78
+ border-bottom: 1px solid #f0f0f0;
79
+ }
80
+ }
81
+ .ant-list-item {
82
+ padding: 0 0 0 10px !important;
83
+ line-height: 30px !important;
84
+ }
85
+
86
+ .ant-drawer-close {
87
+ position: absolute;
88
+ right: 0;
89
+ }
90
+ }
91
+
92
+
93
+
94
+ .p {
95
+ color: #b1bad4;
96
+ font-weight: 400;
97
+ font-size: 12px;
98
+ margin-bottom: 10px;
99
+ font-family: PingFangSC, PingFangSC-Regular;
100
+ line-height: 16px;
101
+ text-align: left;
102
+ opacity: 0.8;
103
+ user-select: none;
104
+ text-align: center;
105
+ margin-left: 8px;
106
+ }
107
+
108
+ .btn {
109
+ display: flex;
110
+ align-items: center;
111
+ height: 44px;
112
+ color: #b1bad4;
113
+ background: #10234c;
114
+ border-radius: 8px;
115
+ width: 130px;
116
+ user-select: none;
117
+ }
118
+ .btn:hover,
119
+ .btnSpan1:hover,
120
+ .btnSpan2:hover {
121
+ cursor: pointer;
122
+ color: #b1bad4;
123
+ }
124
+
125
+ .btnSpan1 {
126
+ margin: 0 7px;
127
+ }
128
+ }
129
+
130
+ .allfunc_drawcontent {
131
+ .allFunsList {
132
+ margin-bottom: 10px;
133
+ }
134
+
135
+ .allFunsListWarp {
136
+ width: 200px;
137
+ margin-right: 10px;
138
+ border-radius: 4px;
139
+
140
+ break-inside: avoid;
141
+ }
142
+
143
+ .drawerWarp_p {
144
+ color: #8c8c8c;
145
+ font-weight: 400;
146
+ font-size: 14px;
147
+ font-family: PingFangSC, PingFangSC-Regular;
148
+ line-height: 20px;
149
+ text-align: left;
150
+ }
151
+ }
152
+
153
+
@@ -0,0 +1,70 @@
1
+
2
+ // @ts-nocheck
3
+ import { Drawer } from 'antd';
4
+ import React, { useEffect, useState, forwardRef, useImperativeHandle } from 'react';
5
+ import './index.less';
6
+ import allfunc from '../../../../../assets/allfunc.svg';
7
+ import DrawContent from './drawContent';
8
+ export type SiderTheme = 'light' | 'dark';
9
+
10
+ const AllFunc: any = forwardRef(({ isCollapse, handleClose, itemPath }: any, ref) => {
11
+ const [isDrawer, setIsDrawer]: any = useState(false);
12
+ useImperativeHandle(ref, () => ({
13
+ close: () => {
14
+ setIsDrawer(false)
15
+ }
16
+ }));
17
+
18
+ useEffect(() => {
19
+ if (isCollapse) {
20
+ setIsDrawer(false);
21
+ }
22
+ }, [isCollapse]);
23
+ const showDrawer = (e) => {
24
+ if (isCollapse) {
25
+ return;
26
+ }
27
+ handleClose()
28
+ e.stopPropagation();
29
+ setIsDrawer(!isDrawer);
30
+ };
31
+ const onClose = () => {
32
+ setIsDrawer(!isDrawer);
33
+ };
34
+
35
+
36
+ return (
37
+ <div
38
+ className={'warp_allfunc'}
39
+ onClick={(e: any) => {
40
+ e.stopPropagation();
41
+ }}
42
+ style={{ opacity: isCollapse ? '0' : '1' }}
43
+ >
44
+ <p className={'p'}>没有找到想要的功能?</p>
45
+
46
+ <p className={'btn'} onClick={showDrawer}>
47
+ <span className={'btnSpan1'}>
48
+ <img style={{marginTop: '-2px'}} width={18} src={allfunc} />
49
+ </span>
50
+ <span className={'btnSpan2'}>查看全部功能</span>
51
+ </p>
52
+ {!isCollapse && (
53
+ <Drawer
54
+ style={{ left: isDrawer ? 140 : 0, top:50 }}
55
+ destroyOnClose
56
+ title={<span style={{ fontWeight: 'bold', fontSize: 18 }}>全部功能</span>}
57
+ zIndex={19}
58
+ width={850}
59
+ className={'drawer_header_warp'}
60
+ placement="left"
61
+ onClose={onClose}
62
+ visible={isDrawer}
63
+ >
64
+ <DrawContent itemPath={itemPath} onClose={onClose} />
65
+ </Drawer>
66
+ )}
67
+ </div>
68
+ );
69
+ });
70
+ export default AllFunc;
@@ -0,0 +1,193 @@
1
+ import React, { useEffect, useRef, useState, useMemo } from 'react';
2
+ import { Select, Form, Modal, Input, Radio, List } from 'antd';
3
+ import { getStoreByName } from './services';
4
+ import debounce from 'lodash/debounce';
5
+
6
+ const debounceTimeout = 800;
7
+
8
+ const ChooseStore = (props: any) => {
9
+ const { employeeCode } = props;
10
+ const plainOptions = ['UR', '本来'];
11
+ const name: any = localStorage.getItem('WARE_HOUSE_NAME');
12
+ const code: any = localStorage.getItem('WARE_HOUSE_CODE');
13
+
14
+ const fetchRef = useRef(0);
15
+
16
+
17
+ const [index, setIndex] = useState(-1);
18
+ const [value, setValue] = useState([{ label: name, value: code }]);
19
+ // const [ key, setKey ] = useState(undefined);
20
+ const [key, setKey] = useState<'UR' | 'BL' | undefined>(undefined);
21
+ const [openSelect, setOpenSelect] = useState(false);
22
+ const [options, setOptions] = useState<any[]>([]);
23
+ const [rescouse, setRescouse] = useState([]);
24
+ const [searchValue, setSearchValue] = useState('');
25
+ const [store, setStore] = useState([{ label: name, value: code }]);
26
+
27
+ async function fetchUserList(storeName: any, init?: boolean) {
28
+ return getStoreByName({
29
+ orgName: storeName ? storeName : undefined,
30
+ platCompanyCode: init ? undefined : key,
31
+ 'qp-employeeCode-eq': employeeCode || 'EMP231011000002',
32
+ 'qp-orgViewCode-eq': 'business-organizational-view',
33
+ }).then((res) => {
34
+ const { data } = res;
35
+ if (data.code != '000000') {
36
+ return;
37
+ }
38
+ return data.data.map((item: any) => {
39
+ return {
40
+ label: item.orgName,
41
+ value: item.orgCode,
42
+ defaultOrg: item.defaultOrg,
43
+ platCompanyCode: item.platCompanyCode,
44
+ };
45
+ });
46
+ });
47
+ }
48
+
49
+ const debounceFetcher = useMemo(() => {
50
+ const loadOptions = (str: string) => {
51
+ fetchRef.current += 1;
52
+ const fetchId = fetchRef.current;
53
+ setOptions([]);
54
+ setRescouse([]);
55
+ fetchUserList(str).then((newOptions) => {
56
+ if (fetchId !== fetchRef.current) {
57
+ return;
58
+ }
59
+ setOptions(newOptions);
60
+ setRescouse(newOptions);
61
+ });
62
+ };
63
+
64
+ return debounce(loadOptions, debounceTimeout);
65
+ }, [debounceTimeout, key]);
66
+
67
+ const changeInput = async (str: string) => {
68
+ const res: any = await debounceFetcher(str);
69
+ setOptions(res);
70
+ setRescouse(res);
71
+ };
72
+
73
+ useEffect(() => {
74
+ (async () => {
75
+ const res: any = await fetchUserList(undefined, true);
76
+ res.map((item: any, indexNumber: number) => {
77
+ if (item.label === name) {
78
+ setIndex(indexNumber);
79
+ }
80
+ if (item.defaultOrg) {
81
+ if (name) {
82
+ return;
83
+ }
84
+ localStorage.setItem('WARE_HOUSE_NAME', item?.label);
85
+ localStorage.setItem('WARE_HOUSE_CODE', item?.value);
86
+ setValue([item]);
87
+ }
88
+ });
89
+ setOptions(res);
90
+ setRescouse(res);
91
+ })();
92
+ }, []);
93
+
94
+ return (
95
+ <div>
96
+ <Select
97
+ value={value}
98
+ style={{ width: 280, marginRight: 20 }}
99
+ open={false}
100
+ onClick={() => {
101
+ setOpenSelect(true);
102
+ }}
103
+ />
104
+
105
+ <Modal
106
+ open={openSelect}
107
+ onCancel={() => {
108
+ setOpenSelect(false);
109
+ }}
110
+ onOk={() => {
111
+ localStorage.setItem('WARE_HOUSE_NAME', store[0]?.label);
112
+ localStorage.setItem('WARE_HOUSE_CODE', store[0]?.value);
113
+ window.location.reload();
114
+ }}
115
+ >
116
+ <Form
117
+ style={{ height: 300, marginTop: 20 }}
118
+ labelCol={{ span: 3 }}
119
+ wrapperCol={{ span: 16 }}
120
+ >
121
+ <Form.Item label="品牌" name="brand">
122
+ <Radio.Group
123
+ options={plainOptions}
124
+ onChange={(item: any) => {
125
+ const str = item?.target?.value;
126
+ setKey(str === 'UR' ? 'UR' : 'BL');
127
+ if (str === 'UR') {
128
+ const res: any = rescouse?.filter((current: any) => {
129
+ return current.platCompanyCode === 'UR';
130
+ });
131
+ setOptions(res);
132
+ setSearchValue('');
133
+ } else {
134
+ const res: any = rescouse?.filter((current: any) => {
135
+ return current.platCompanyCode === 'BL';
136
+ });
137
+ setOptions(res);
138
+ setSearchValue('');
139
+ }
140
+ }}
141
+ optionType="button"
142
+ buttonStyle="solid"
143
+ />
144
+ </Form.Item>
145
+ <Form.Item
146
+ label="门店"
147
+ name="store"
148
+ rules={[{ required: true, message: '请选择门店' }]}
149
+ >
150
+ <Input
151
+ placeholder="输入门店名称"
152
+ value={searchValue}
153
+ onChange={(e) => {
154
+ changeInput(e.target.value);
155
+ setSearchValue(e.target.value);
156
+ }}
157
+ />
158
+ <div
159
+ style={{
160
+ height: 220,
161
+ overflowY: 'scroll',
162
+ }}
163
+ >
164
+ <List
165
+ dataSource={options}
166
+ bordered
167
+ renderItem={(item, indexNumber) => (
168
+ <List.Item
169
+ style={
170
+ indexNumber === index ? {
171
+ // opacity
172
+ color: '#0047bb',
173
+ } : {}
174
+ }
175
+ onClick={(current: any) => {
176
+ // setValue([item]);
177
+ setStore([item]);
178
+ setIndex(indexNumber);
179
+ }}
180
+ >
181
+ {item.label}
182
+ </List.Item>
183
+ )}
184
+ />
185
+ </div>
186
+ </Form.Item>
187
+ </Form>
188
+ </Modal>
189
+ </div>
190
+ );
191
+ };
192
+
193
+ export default ChooseStore;
@@ -0,0 +1,10 @@
1
+ import request from '@/utils/request';
2
+
3
+ // -- 查询店铺 --
4
+ export async function getStoreByName(params: any) {
5
+ return request({
6
+ url: '/store-house/orgViewNode/listNoPage',
7
+ method: 'GET',
8
+ params: { ...params },
9
+ })
10
+ }
@@ -0,0 +1,90 @@
1
+ .setting_content>div {
2
+ width: 50%;
3
+ box-sizing: border-box;
4
+ // float: left;
5
+ margin: 0 10px;
6
+ }
7
+
8
+ .setting_content {
9
+ display: flex;
10
+ }
11
+
12
+
13
+ .tree_title {
14
+ height: 50px;
15
+ }
16
+
17
+ .tree_content {
18
+ height: 400px;
19
+ overflow: auto;
20
+ border: 1px solid #d9d9d9;
21
+ padding: 5px;
22
+ }
23
+
24
+ .setting_content::after {
25
+ clear: both;
26
+ display: block;
27
+ content: '';
28
+ }
29
+
30
+ .choosed_label_color {
31
+ color: #f50;
32
+ }
33
+
34
+ .left_tree_content {
35
+ .ant-tree .ant-tree-node-content-wrapper {
36
+ flex-grow: 1;
37
+ .ant-tree-title {
38
+ width: 100%;
39
+ }
40
+ }
41
+ .ant-tree .ant-tree-treenode {
42
+ width: 100%;
43
+ }
44
+ }
45
+
46
+ .right_tree_content, .left_tree_content {
47
+ .ant-tree .ant-tree-node-content-wrapper {
48
+ display: flex;
49
+ margin-left: -3px;
50
+ }
51
+ .ant-tree-checkbox {
52
+ top: auto;
53
+ top: initial;
54
+ // margin: 4px 3px 0 0 !important;
55
+ }
56
+ }
57
+
58
+ .node_title_content:hover {
59
+ .right_arrow {
60
+ display: block !important;
61
+ }
62
+ }
63
+
64
+ .right_arrow {
65
+ float: right;
66
+ display: none;
67
+ color: #999999;
68
+ margin-right: 10px;
69
+ }
70
+
71
+
72
+
73
+ .right_tree_content {
74
+ .ant-tree-title {
75
+ width: 100%;
76
+ display: inline-block;
77
+ padding-right: 10px;
78
+ }
79
+ .ant-dropdown-trigger {
80
+ color: gray !important;
81
+ }
82
+ .tree_node_title {
83
+ font-size: 20px;
84
+ color: #d9d9d9;
85
+ float: right;
86
+ span {
87
+ margin-right: 5px;
88
+ }
89
+ }
90
+ }
@@ -0,0 +1,38 @@
1
+ import React, {
2
+ useState,
3
+ forwardRef,
4
+ useImperativeHandle
5
+ } from "react";
6
+ import './index.less';
7
+ import LeftTree from "./leftTree";
8
+ import RightTree from "./rightTree";
9
+
10
+ const MenuSetting = forwardRef(({actionRef, originRoutes, itemPath}: any, ref) => {
11
+
12
+ const [customerMenuData, setCustomerMenuData] = useState(
13
+ JSON.parse( localStorage.getItem(`customerMenu_${itemPath}_front`) || '[]')
14
+ );
15
+
16
+ useImperativeHandle(ref, () => ({
17
+ saveMenuData: () => {
18
+ localStorage.setItem(`customerMenu_${itemPath}_front`, JSON.stringify(customerMenuData));
19
+ actionRef.current?.reload();
20
+ },
21
+ }));
22
+
23
+ return (
24
+ <div className={'setting_content'}>
25
+ <LeftTree
26
+ originRoutes={originRoutes}
27
+ customerMenuData={customerMenuData}
28
+ setCustomerMenuData={setCustomerMenuData}
29
+ />
30
+ <RightTree
31
+ customerMenuData={customerMenuData}
32
+ setCustomerMenuData={setCustomerMenuData}
33
+ />
34
+ </div>
35
+ )
36
+ })
37
+
38
+ export default MenuSetting;