@bit-sun/business-component 1.2.3 → 1.2.4-alpha.1

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 (169) hide show
  1. package/.fatherrc.ts +1 -0
  2. package/.umirc.ts +31 -16
  3. package/dist/components/Business/AddSelectBusiness/index.d.ts +1 -0
  4. package/dist/components/Business/BsLayouts/Components/AllFunc/drawContent.d.ts +4 -0
  5. package/dist/components/Business/BsLayouts/Components/AllFunc/index.d.ts +4 -0
  6. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.d.ts +4 -0
  7. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.d.ts +17 -0
  8. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.d.ts +30 -0
  9. package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.d.ts +3 -0
  10. package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.d.ts +2 -0
  11. package/dist/components/Business/BsLayouts/Components/CustomerMenu/index.d.ts +4 -0
  12. package/dist/components/Business/BsLayouts/Components/GlobalHeader/index.d.ts +4 -0
  13. package/dist/components/Business/BsLayouts/Components/RightContent/LoginModal.d.ts +2 -0
  14. package/dist/components/Business/BsLayouts/Components/RightContent/index.d.ts +8 -0
  15. package/dist/components/Business/BsLayouts/Components/SearchFunc/index.d.ts +8 -0
  16. package/dist/components/Business/BsLayouts/index.d.ts +18 -0
  17. package/dist/components/Business/BsLayouts/service.d.ts +1 -0
  18. package/dist/components/Business/BsLayouts/utils.d.ts +13 -0
  19. package/dist/components/Business/BsSulaQueryTable/index.d.ts +2 -0
  20. package/dist/components/Business/BsSulaQueryTable/setting.d.ts +58 -0
  21. package/dist/components/Business/BsSulaQueryTable/utils.d.ts +98 -0
  22. package/dist/components/Business/CommonAlert/index.d.ts +3 -0
  23. package/dist/components/Business/CommonGuideWrapper/index.d.ts +6 -0
  24. package/dist/components/Business/DetailPageWrapper/index.d.ts +9 -0
  25. package/dist/components/Business/DetailPageWrapper/utils.d.ts +8 -0
  26. package/dist/components/Business/HomePageWrapper/index.d.ts +3 -0
  27. package/dist/components/Business/SearchSelect/BusinessUtils.d.ts +1 -1
  28. package/dist/components/Business/SearchSelect/common.d.ts +5 -1
  29. package/dist/components/Business/SearchSelect/index.d.ts +1 -1
  30. package/dist/components/Business/SearchSelect/utils.d.ts +2 -1
  31. package/dist/components/Business/StateFlow/index.d.ts +3 -0
  32. package/dist/components/Business/TreeSearchSelect/index.d.ts +3 -0
  33. package/dist/components/Business/TreeSearchSelect/utils.d.ts +2 -0
  34. package/dist/components/Business/columnSettingTable/columnSetting.d.ts +54 -0
  35. package/dist/components/Business/columnSettingTable/index.d.ts +16 -0
  36. package/dist/components/Business/columnSettingTable/sulaSettingTable.d.ts +17 -0
  37. package/dist/components/Business/columnSettingTable/utils.d.ts +8 -0
  38. package/dist/components/Functional/AddSelect/index.d.ts +3 -0
  39. package/dist/components/Functional/BillEntry/index.d.ts +4 -0
  40. package/dist/components/Functional/ExportFunctions/ExportIcon/index.d.ts +12 -0
  41. package/dist/components/Functional/SearchSelect/index.d.ts +2 -1
  42. package/dist/components/Functional/TreeSearchSelect/index.d.ts +2 -0
  43. package/dist/index.d.ts +15 -0
  44. package/dist/index.esm.js +19420 -4457
  45. package/dist/index.js +19451 -4471
  46. package/dist/utils/CheckOneUser/index.d.ts +1 -1
  47. package/dist/utils/enumConfig.d.ts +10 -0
  48. package/dist/utils/requestUtils.d.ts +1 -0
  49. package/dist/utils/utils.d.ts +3 -0
  50. package/lib/assets/arrow_top.png +0 -0
  51. package/lib/assets/drag.svg +17 -0
  52. package/lib/assets/exportFail.svg +38 -0
  53. package/lib/assets/exportProcessing.svg +29 -0
  54. package/lib/assets/exportSuccess.svg +35 -0
  55. package/lib/assets/exportlogo.png +0 -0
  56. package/lib/assets/label_icon_bottom.svg +26 -0
  57. package/lib/assets/upExport.svg +23 -0
  58. package/package.json +26 -5
  59. package/src/assets/32.svg +28 -0
  60. package/src/assets/addIcon.svg +18 -0
  61. package/src/assets/allfunc.svg +28 -0
  62. package/src/assets/arrowRight.svg +25 -0
  63. package/src/assets/arrow_top.png +0 -0
  64. package/src/assets/btn-delete.svg +30 -0
  65. package/src/assets/btn-edit.svg +20 -0
  66. package/src/assets/btn-more.svg +18 -0
  67. package/src/assets/btn-submit.svg +20 -0
  68. package/src/assets/caidan.svg +12 -0
  69. package/src/assets/close.svg +26 -0
  70. package/src/assets/closeicon.png +0 -0
  71. package/src/assets/drag.svg +17 -0
  72. package/src/assets/exportFail.svg +38 -0
  73. package/src/assets/exportProcessing.svg +29 -0
  74. package/src/assets/exportSuccess.svg +35 -0
  75. package/src/assets/exportlogo.png +0 -0
  76. package/src/assets/fixed-left-active.svg +12 -0
  77. package/src/assets/fixed-left.svg +16 -0
  78. package/src/assets/fixed-right-active.svg +12 -0
  79. package/src/assets/fixed-right.svg +16 -0
  80. package/src/assets/guanbi.svg +16 -0
  81. package/src/assets/icon-quanping.svg +16 -0
  82. package/src/assets/icon-shezhi.svg +18 -0
  83. package/src/assets/label_icon_bottom.svg +26 -0
  84. package/src/assets/list-no-img.svg +22 -0
  85. package/src/assets/morentouxiang-32.svg +24 -0
  86. package/src/assets/right.png +0 -0
  87. package/src/assets/scanning.svg +25 -0
  88. package/src/assets/upExport.svg +23 -0
  89. package/src/assets/xinglan-icon-out.png +0 -0
  90. package/src/components/Business/AddSelectBusiness/index.md +41 -0
  91. package/src/components/Business/AddSelectBusiness/index.tsx +290 -0
  92. package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +112 -0
  93. package/src/components/Business/BsLayouts/Components/AllFunc/index.less +153 -0
  94. package/src/components/Business/BsLayouts/Components/AllFunc/index.tsx +70 -0
  95. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.less +90 -0
  96. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.tsx +38 -0
  97. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.tsx +243 -0
  98. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.tsx +385 -0
  99. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.tsx +286 -0
  100. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.tsx +75 -0
  101. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/drawContent.less +171 -0
  102. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.less +65 -0
  103. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.tsx +154 -0
  104. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +73 -0
  105. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +158 -0
  106. package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +85 -0
  107. package/src/components/Business/BsLayouts/Components/RightContent/home.less +218 -0
  108. package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +156 -0
  109. package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +161 -0
  110. package/src/components/Business/BsLayouts/Components/SearchFunc/index.tsx +76 -0
  111. package/src/components/Business/BsLayouts/index.less +80 -0
  112. package/src/components/Business/BsLayouts/index.tsx +1465 -0
  113. package/src/components/Business/BsLayouts/service.ts +11 -0
  114. package/src/components/Business/BsLayouts/utils.tsx +211 -0
  115. package/src/components/Business/BsSulaQueryTable/index.less +220 -0
  116. package/src/components/Business/BsSulaQueryTable/index.tsx +505 -0
  117. package/src/components/Business/BsSulaQueryTable/setting.tsx +799 -0
  118. package/src/components/Business/BsSulaQueryTable/utils.less +65 -0
  119. package/src/components/Business/BsSulaQueryTable/utils.tsx +688 -0
  120. package/src/components/Business/CommodityEntry/index.md +4 -3
  121. package/src/components/Business/CommodityEntry/index.tsx +7 -2
  122. package/src/components/Business/CommonAlert/index.less +0 -0
  123. package/src/components/Business/CommonAlert/index.tsx +23 -0
  124. package/src/components/Business/CommonGuideWrapper/index.less +112 -0
  125. package/src/components/Business/CommonGuideWrapper/index.md +39 -0
  126. package/src/components/Business/CommonGuideWrapper/index.tsx +84 -0
  127. package/src/components/Business/DetailPageWrapper/index.less +80 -0
  128. package/src/components/Business/DetailPageWrapper/index.tsx +335 -0
  129. package/src/components/Business/DetailPageWrapper/utils.tsx +101 -0
  130. package/src/components/Business/HomePageWrapper/index.less +33 -0
  131. package/src/components/Business/HomePageWrapper/index.md +45 -0
  132. package/src/components/Business/HomePageWrapper/index.tsx +162 -0
  133. package/src/components/Business/SearchSelect/BusinessUtils.ts +107 -14
  134. package/src/components/Business/SearchSelect/common.ts +20 -1
  135. package/src/components/Business/SearchSelect/index.md +60 -30
  136. package/src/components/Business/SearchSelect/index.tsx +21 -12
  137. package/src/components/Business/SearchSelect/utils.ts +30 -4
  138. package/src/components/Business/StateFlow/index.less +131 -0
  139. package/src/components/Business/StateFlow/index.md +60 -0
  140. package/src/components/Business/StateFlow/index.tsx +30 -0
  141. package/src/components/Business/TreeSearchSelect/index.md +126 -0
  142. package/src/components/Business/TreeSearchSelect/index.tsx +34 -0
  143. package/src/components/Business/TreeSearchSelect/utils.ts +60 -0
  144. package/src/components/Business/columnSettingTable/columnSetting.tsx +764 -0
  145. package/src/components/Business/columnSettingTable/index.less +247 -0
  146. package/src/components/Business/columnSettingTable/index.md +358 -0
  147. package/src/components/Business/columnSettingTable/index.tsx +233 -0
  148. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +241 -0
  149. package/src/components/Business/columnSettingTable/utils.tsx +69 -0
  150. package/src/components/Functional/AddSelect/index.less +367 -0
  151. package/src/components/Functional/AddSelect/index.md +122 -0
  152. package/src/components/Functional/AddSelect/index.tsx +962 -0
  153. package/src/components/Functional/BillEntry/index.less +371 -0
  154. package/src/components/Functional/BillEntry/index.md +39 -0
  155. package/src/components/Functional/BillEntry/index.tsx +613 -0
  156. package/src/components/Functional/DataImport/index.tsx +7 -2
  157. package/src/components/Functional/DataValidation/index.md +1 -0
  158. package/src/components/Functional/DataValidation/index.tsx +17 -2
  159. package/src/components/Functional/ExportFunctions/ExportIcon/index.md +37 -0
  160. package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +59 -0
  161. package/src/components/Functional/SearchSelect/index.tsx +218 -121
  162. package/src/components/Functional/TreeSearchSelect/index.md +47 -0
  163. package/src/components/Functional/TreeSearchSelect/index.tsx +149 -0
  164. package/src/index.ts +15 -6
  165. package/src/styles/bsDefault.less +1907 -0
  166. package/src/utils/enumConfig.ts +10 -0
  167. package/src/utils/requestUtils.ts +33 -0
  168. package/src/utils/utils.ts +52 -0
  169. package/typings.d.ts +3 -0
@@ -0,0 +1,101 @@
1
+ // @ts-nocheck
2
+ import { request } from 'bssula';
3
+ import { Modal } from 'antd';
4
+ import { ExclamationCircleOutlined } from '@ant-design/icons';
5
+ import React from 'react';
6
+ import { history } from 'umi';
7
+
8
+ interface actionItem {
9
+ [propName: string]: any;
10
+ }
11
+
12
+ export const doDetailPageAction = (config: actionItem) => {
13
+ if (config?.type == 'modal') {
14
+ const { confirm } = Modal;
15
+ let requestConfig = {
16
+ url: config.url,
17
+ method: config.method,
18
+ params: config.params || {},
19
+ successMessage: config?.successMessage,
20
+ };
21
+
22
+
23
+ const onOk = () => {
24
+ request(requestConfig).then((res) => {
25
+ if (config.backPath) {
26
+ history.push({
27
+ pathname: config.backPath
28
+ })
29
+ }
30
+ // 是否执行成功之后的回调
31
+ if (typeof (config.successCb) === 'function') {
32
+ config.successCb();
33
+ }
34
+ });
35
+ };
36
+
37
+ if (config.noConfirm) {
38
+ onOk();
39
+ } else {
40
+ confirm({
41
+ title: config.title,
42
+ icon: <ExclamationCircleOutlined />,
43
+ content: config.content,
44
+ okText: '确定',
45
+ okType: 'danger',
46
+ cancelText: '取消',
47
+ onOk,
48
+ onCancel() {
49
+ console.log('Cancel');
50
+ },
51
+ });
52
+ }
53
+ }
54
+ }
55
+
56
+ export const getBreadcrumbNameMap = (menuData) => {
57
+ const routerMap = {};
58
+
59
+ const flattenMenuData = (data) => {
60
+ data.forEach((menuItem) => {
61
+ if (menuItem.children) {
62
+ flattenMenuData(menuItem.children);
63
+ }
64
+ // Reduce memory usage
65
+ routerMap[menuItem.path] = menuItem;
66
+ });
67
+ };
68
+ flattenMenuData(menuData);
69
+ return routerMap;
70
+ };
71
+
72
+ export const judgeIsEmpty = (value: any) => {
73
+ if (value == null || value == undefined || String(value).trim() == '') {
74
+ return true;
75
+ }
76
+ return false;
77
+ };
78
+
79
+ export const getMainCrumbNameMap = (menuData) => {
80
+ const routerMap = {};
81
+
82
+ const flattenMenuData = (data, parent) => {
83
+ let pNameMap = parent.nameMap ? [...parent.nameMap] : [];
84
+ data.forEach((menuItem) => {
85
+ let newMenuItem = {
86
+ ...menuItem,
87
+ nameMap: [...pNameMap, menuItem.name]
88
+ }
89
+ if (newMenuItem.children) {
90
+ flattenMenuData(newMenuItem.children, newMenuItem);
91
+ }
92
+
93
+ // Reduce memory usage
94
+ routerMap[menuItem.path] = {
95
+ ...newMenuItem,
96
+ };
97
+ });
98
+ };
99
+ flattenMenuData(menuData, {});
100
+ return routerMap;
101
+ }
@@ -0,0 +1,33 @@
1
+ .home_page_head {
2
+ height: 54px;
3
+ display: flex;
4
+ justify-content: space-between;
5
+ align-items: center;
6
+ background-color: #FFFFFF;
7
+ border-bottom: 1px solid #f0f0f0;
8
+ padding: 0 20px;
9
+ .home_page_title {
10
+ height: 20px;
11
+ font-family: PingFangSC-Medium;
12
+ font-weight: 600;
13
+ font-size: 16px;
14
+ color: #000000;
15
+ letter-spacing: 0;
16
+ line-height: 20px;
17
+ flex-grow: 1;
18
+ margin-top: 2px;
19
+ }
20
+ .ant-breadcrumb {
21
+ display: block !important;
22
+ .ant-breadcrumb-separator {
23
+ margin: 0 2px;
24
+ }
25
+ li .bread_name {
26
+
27
+ color: #8A8F8D;
28
+ font-size: 12px;
29
+ line-height: 16px;
30
+ cursor: pointer;
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,45 @@
1
+ ---
2
+ nav:
3
+ title: '组件'
4
+ order: 1
5
+ group:
6
+ title: 业务组件
7
+ order: 1
8
+ title: 标题组件
9
+ order: 1
10
+ ---
11
+
12
+ # HomePageWrapper
13
+
14
+
15
+ ## 首页标题组件
16
+
17
+ ```tsx
18
+ import { HomePageWrapper } from '../../../index.ts';
19
+ import React, { useState } from 'react';
20
+
21
+ export default () => {
22
+ const routes = [
23
+ {
24
+ path: '/',
25
+ name: 'welcome',
26
+ routes: [
27
+ {
28
+ path: '/components',
29
+ name: '组件',
30
+ routes: [
31
+ {
32
+ path: '/components/business/home-page-wrapper',
33
+ name: '标题组件',
34
+ component: 'aaa'
35
+ }
36
+ ]
37
+ }
38
+ ]
39
+ }
40
+ ]
41
+ return (
42
+ <HomePageWrapper routes={routes} />
43
+ );
44
+ };
45
+ ```
@@ -0,0 +1,162 @@
1
+ // @ts-nocheck
2
+ import React, { useEffect, useState, useMemo } from 'react';
3
+ import { getMainCrumbNameMap } from '../DetailPageWrapper/utils';
4
+ import { memoizeOneFormatter } from '@/utils/utils';
5
+ import { Breadcrumb, Space } from 'antd';
6
+ import './index.less';
7
+ import { useLocation, formatMessage } from 'umi';
8
+ import CommonAlert from '../CommonAlert';
9
+ import ENUM from '@/utils/enumConfig';
10
+
11
+ export default (props: any) => {
12
+ const { pathname } = useLocation();
13
+ const [id]: any = useState(pathname + 'id');
14
+ const { children, ...restProps} = props;
15
+
16
+ return (
17
+ <div id={id} className={'home_page_wrapper'}>
18
+ <HeaderWrapper
19
+ pathname={pathname}
20
+ {
21
+ ...restProps
22
+ }
23
+ />
24
+ {props.children}
25
+ </div>
26
+ );
27
+ };
28
+
29
+ const HeaderWrapper = React.memo(
30
+ ({
31
+ pathname,
32
+ routes=[],
33
+ itemPath,
34
+ alertProps,
35
+ extra,
36
+ title,
37
+ pathToRegexp, //改为从项目代码透传该方法
38
+ }: { pathname: string, routes: any[], itemPath: string, alertProps: any }) => {
39
+ const [breadcrumbArr, setBreadCrumbArr]: any = useState([]);
40
+ const basePath = window.top == window ? '' : `/${itemPath}`;
41
+ const menuRoutes =
42
+ window.top == window
43
+ ? routes.find((item) => item.path === '/')?.routes || []
44
+ : JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.LIMIT_MENU_DATA) || '[]');
45
+
46
+ const breadcrumbNameMap = getMainCrumbNameMap(
47
+ memoizeOneFormatter(menuRoutes, ''),
48
+ );
49
+
50
+ const matchParamsPath = (pathname: string, breadcrumbNameMap: object) => {
51
+ const pathKey: any = Object.keys(breadcrumbNameMap).find((key) =>
52
+ pathToRegexp ? pathToRegexp(key).test(pathname) : false
53
+ );
54
+
55
+ return pathKey ? breadcrumbNameMap[pathKey] : undefined;
56
+ };
57
+
58
+ const getPageTitle = (pathname: string) => {
59
+ const currRouterData = matchParamsPath(
60
+ `${basePath}${pathname}`,
61
+ breadcrumbNameMap,
62
+ );
63
+
64
+ if (!currRouterData) {
65
+ return '';
66
+ }
67
+
68
+ let breadcrumbArrs = currRouterData.nameMap || [];
69
+ if (breadcrumbArrs.length && title) {
70
+ breadcrumbArrs.pop();
71
+ breadcrumbArrs.push(title)
72
+ }
73
+ setBreadCrumbArr([...breadcrumbArrs])
74
+
75
+ const pageName = formatMessage({
76
+ id: currRouterData.locale || currRouterData.name,
77
+ defaultMessage: currRouterData.name,
78
+ });
79
+ return title ? title : window.top === window ? pageName : `${currRouterData.name}`;
80
+ };
81
+
82
+ const pageTitle = useMemo(() => getPageTitle(pathname), [pathname, title]);
83
+
84
+ useEffect(() => {}, [pathname]);
85
+
86
+ // const breadcrumbArr = `${basePath}${pathname}`
87
+ // .split('/')
88
+ // .slice(1)
89
+ // .map((_item, index, arr) =>
90
+ // matchParamsPath(
91
+ // `/${arr.slice(0, index + 1).join('/')}`,
92
+ // breadcrumbNameMap,
93
+ // ),
94
+ // )
95
+ // .filter((item) => item);
96
+
97
+
98
+ return (
99
+ <div>
100
+ <div className={'home_page_head'}>
101
+ <div>
102
+ <div className={'home_page_title'}>{pageTitle}</div>
103
+ <Breadcrumb>
104
+ {breadcrumbArr.map((item) => (
105
+ <Breadcrumb.Item
106
+ key={item}
107
+ onClick={() => {
108
+ // if (
109
+ // item.path &&
110
+ // !item.children &&
111
+ // !pathToRegexp(item.path).test(`${basePath}${pathname}`)
112
+ // ) {
113
+ // history.push({
114
+ // pathname: item.path.replace(basePath, ''),
115
+ // });
116
+ // }
117
+ }}
118
+ >
119
+ <span
120
+ style={{
121
+ // color: pathToRegexp(item.path).test(
122
+ // `${basePath}${pathname}`,
123
+ // )
124
+ // ? '#000000d9'
125
+ // : '',
126
+ }}
127
+ className="bread_name"
128
+ >
129
+ {item}
130
+ </span>
131
+ </Breadcrumb.Item>
132
+ ))}
133
+ </Breadcrumb>
134
+ </div>
135
+ {
136
+ extra ?
137
+ <Space>
138
+ {
139
+ extra
140
+ }
141
+ </Space> : ''
142
+ }
143
+ </div>
144
+ {
145
+ alertProps && (
146
+ <CommonAlert
147
+ {
148
+ ...alertProps
149
+ }
150
+ />
151
+ )
152
+ }
153
+ </div>
154
+ );
155
+ },
156
+ (prevProps, nextProps) => {
157
+ if (prevProps.title !== nextProps.title) {
158
+ return false;
159
+ }
160
+ return true;
161
+ },
162
+ );
@@ -1,7 +1,8 @@
1
1
  // 此文件用于 处理业务组件 所用到的公共方法
2
2
  // @ts-nocheck
3
- import { shopFileType, arrivalPaySupportList, sharingType } from './common';
3
+ import { shopFileType, arrivalPaySupportList, sharingType, shopFile2Type } from './common';
4
4
  import { getDictionarySource, getDictionaryTextByValue, loadSelectSource } from './utils';
5
+ import ENUM from '@/utils/enumConfig';
5
6
 
6
7
  const hasDictSharingType = getDictionarySource('UC000013')?.length;
7
8
  const sharingTypeDataList = hasDictSharingType && getDictionarySource('UC000013') || sharingType
@@ -27,7 +28,7 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
27
28
  * */
28
29
  const formatSource = (reData: any, position: number, changePosition: number,changeSearchForm: any,resKeyValue=['code', 'name']) => {
29
30
  const data = reData && reData[position]?.data;
30
- const list = Array.isArray(data) ? data :(data?.items || data?.list || []);
31
+ const list = Array.isArray(data) ? data :(data?.items || data?.list || data?.children || []);
31
32
  const formatData = list?.length ? list.map((v: any) => ({ text: v[resKeyValue[1]], value: v[resKeyValue[0]] })) : [];
32
33
  changeSearchForm[changePosition] = {...changeSearchForm[changePosition], initialSource: formatData}
33
34
  }
@@ -63,7 +64,7 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
63
64
  tableColumns: [],
64
65
  ...modalTableBusProps,
65
66
  }
66
- let needModalTable = true;
67
+ let needModalTable = modalTableBusProps?.needModalTable !== undefined ? modalTableBusProps?.needModalTable : true;
67
68
 
68
69
  // 供应商选择器
69
70
  if(type === 'supplier') {
@@ -242,8 +243,10 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
242
243
  mappingValueField: 'skuCode',
243
244
  mappingTextShowTextField: ['name', 'propertyNameAndValue'],
244
245
  otherParams: {
246
+ 'qp-combination-eq': false,
245
247
  'qp-approveStatus-eq': 1,
246
- 'qp-type-eq': 10, // 查唯一国际条码
248
+ 'qp-status-eq': 1,
249
+ // 'qp-type-eq': 10, // 查唯一国际条码【有些项目不需要必须要有国际条码,故注释,需要的项目自己定义otherParams补充上这个条件】
247
250
  sorter: 'desc-id'
248
251
  }, // 默认参数
249
252
  sourceName: 'skuCode',
@@ -251,7 +254,12 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
251
254
  }
252
255
  tableSearchForm = requestConfig.url.includes('v2') ? [
253
256
  requestConfig.url.includes('v2') ? { name: 'qp-skuName-like', label: 'SKU名称' } : { name: 'qp-name-like', label: 'SKU名称' },
254
- { name: 'qp-skuCode-like', label: 'SKU编码' },
257
+ { name: 'qp-skuCode-in', label: 'SKU编码', field: {
258
+ type: 'multipleQueryInput',
259
+ props: {
260
+ ...(requestConfigProp?.skuCodeValueRequestConfig || {}),
261
+ },
262
+ }},
255
263
  requestConfig.url.includes('v2') ? { name: 'qp-code-like', label: '国际条码' } : { name: 'qp-barCode-like', label: '国际条码'},
256
264
  { name: 'qp-itemName-like', label: '所属SPU名称' },
257
265
  { name: 'qp-itemCode-like', label: '所属SPU编码' },
@@ -316,7 +324,12 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
316
324
  } },
317
325
  ] : [
318
326
  { name: 'qp-name-like', label: 'SKU名称' },
319
- { name: 'qp-skuCode-like', label: 'SKU编码' },
327
+ { name: 'qp-skuCode-in', label: 'SKU编码', field: {
328
+ type: 'multipleQueryInput',
329
+ props: {
330
+ ...(requestConfigProp?.skuCodeValueRequestConfig || {}),
331
+ },
332
+ }},
320
333
  { name: 'qp-barCode-like', label: '国际条码'},
321
334
  { name: 'qp-itemName-like', label: '所属SPU名称' },
322
335
  { name: 'qp-itemCode-like', label: '所属SPU编码' },
@@ -371,6 +384,7 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
371
384
  loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
372
385
  pageSize: 5000,
373
386
  currentPage: 1,
387
+ 'ctl-withAuth': true
374
388
  }),
375
389
  loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
376
390
  pageSize: 5000,
@@ -539,6 +553,7 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
539
553
  loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
540
554
  pageSize: 5000,
541
555
  currentPage: 1,
556
+ 'ctl-withAuth': true
542
557
  }),
543
558
  loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
544
559
  pageSize: 5000,
@@ -750,6 +765,7 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
750
765
  mappingTextField: 'name',
751
766
  mappingValueField: 'code',
752
767
  otherParams: {
768
+ 'qp-status-eq': 10,
753
769
  sorter: 'desc-id'
754
770
  }, // 默认参数
755
771
  sourceName: 'customCode',
@@ -1069,6 +1085,71 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
1069
1085
  ...modalTableBusProps
1070
1086
  }
1071
1087
  }
1088
+ if(type === 'shopFile2') {
1089
+ requestConfig = {
1090
+ url: `${prefixUrl.selectPrefix}/store/page`,
1091
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1092
+ mappingTextField: 'name',
1093
+ mappingValueField: 'code',
1094
+ otherParams: {
1095
+ sorter: 'desc-id'
1096
+ }, // 默认参数
1097
+ sourceName: 'code',
1098
+ ...requestConfigProp,
1099
+ }
1100
+ tableSearchForm = [
1101
+ { name: 'qp-name-like', label: '商店名称' },
1102
+ { name: 'qp-code-like', label: '商店编码' },
1103
+ { name: 'qp-type-in', type: 'select', label: '商店类型', initialSource: shopFile2Type },
1104
+ { name: 'qp-orgCode-in', type: 'select', label: '所属销售组织', field: {
1105
+ type: 'select',
1106
+ props: {
1107
+ mode: 'multiple',
1108
+ notFoundContent: '暂无数据',
1109
+ allowClear: true,
1110
+ showSearch: true,
1111
+ showArrow: true,
1112
+ maxTagCount: 1,
1113
+ optionFilterProp: 'children',
1114
+ filterOption: (input: string, option: { props: { children: string } }) =>
1115
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1116
+ },
1117
+ } },
1118
+ ]
1119
+ Promise.all([
1120
+ loadSelectSource(`${prefixUrl.formSelectFix}/orgView/getTree/sales-organizational-view`, {
1121
+ 'qp-employeeCode-eq': JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.USER_INFO) || '{}')?.employeeResVo?.employeeNumber,
1122
+ 'qp-realOrg-eq': true,
1123
+ 'qp-status-eq': 10
1124
+ }),
1125
+ ]).then((x: any)=>{
1126
+ formatSource(x,0, 3, tableSearchForm);
1127
+ })
1128
+ modalTableProps = {
1129
+ modalTableTitle: '选择商店',
1130
+ tableSearchForm,
1131
+ tableColumns: [
1132
+ {
1133
+ title: '商店编码',
1134
+ dataIndex: 'code',
1135
+ },
1136
+ {
1137
+ title: '商店名称',
1138
+ dataIndex: 'name',
1139
+ },
1140
+ {
1141
+ title: '商店类型',
1142
+ dataIndex: 'type',
1143
+ render: (text: number) => shopFile2Type.find((i: any) => i.value === text)?.text,
1144
+ },
1145
+ {
1146
+ title: '所属销售组织',
1147
+ dataIndex: 'orgName',
1148
+ },
1149
+ ],
1150
+ ...modalTableBusProps
1151
+ }
1152
+ }
1072
1153
 
1073
1154
  // 核算主体选择器(无弹窗)
1074
1155
  if(type === 'accountingSubject') {
@@ -1102,6 +1183,7 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
1102
1183
  }
1103
1184
  needModalTable = false
1104
1185
  }
1186
+
1105
1187
  // 法人公司选择器(无弹窗)
1106
1188
  if(type === 'corporationCompany') {
1107
1189
  requestConfig = {
@@ -1129,6 +1211,7 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
1129
1211
  mappingValueField: 'employeeNumber',
1130
1212
  otherParams: {
1131
1213
  'qp-enable-eq': 10, // 启用状态 10-启用,20-禁用
1214
+ 'qp-employmentType-eq': 20,
1132
1215
  sorter: 'desc-id'
1133
1216
  }, // 默认参数
1134
1217
  sourceName: 'employeeNumber',
@@ -1195,20 +1278,22 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
1195
1278
  // 版本2
1196
1279
  requestConfig = {
1197
1280
  url: `${prefixUrl.selectPrefix}/employee/pageList/v2`,
1198
- filter: 'qp-employeeNumber,name-orGroup,like', // 过滤参数
1281
+ filter: 'qp-username,name-orGroup,like', // 过滤参数
1199
1282
  mappingTextField: 'name',
1200
- mappingTextShowKeyField: 'employeeNumber',
1283
+ mappingTextShowKeyField: 'username',
1201
1284
  mappingValueField: 'id',
1202
1285
  otherParams: {
1203
1286
  'qp-enable-eq': 10, // 启用状态 10-启用,20-禁用
1287
+ 'qp-employmentType-eq': 20,
1204
1288
  sorter: 'desc-id'
1205
1289
  }, // 默认参数
1206
1290
  sourceName: 'employeeNumber',
1207
1291
  ...requestConfigProp,
1208
1292
  }
1209
1293
  tableSearchForm = [
1210
- { name: 'qp-name-like', label: '员工名称' },
1211
- { name: 'qp-employeeNumber-like', label: '员工编码' },
1294
+ { name: 'qp-username-like', label: '账户名称' },
1295
+ { name: 'qp-name-like', label: '显示名称' },
1296
+ // { name: 'qp-employeeNumber-like', label: '员工编码' },
1212
1297
  { name: 'qp-directOrgCode-in', type: 'select', label: '所属组织机构', field: {
1213
1298
  type: 'select',
1214
1299
  props: {
@@ -1232,17 +1317,25 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
1232
1317
  formatSource(x,0, 2, tableSearchForm);
1233
1318
  })
1234
1319
  modalTableProps = {
1235
- modalTableTitle: '选择员工',
1320
+ modalTableTitle: '添加员工',
1236
1321
  tableSearchForm,
1237
1322
  tableColumns: [
1238
1323
  {
1239
- title: '员工编码',
1240
- dataIndex: 'employeeNumber',
1324
+ title: '账户名称',
1325
+ dataIndex: 'username',
1241
1326
  },
1242
1327
  {
1243
- title: '员工名称',
1328
+ title: '显示名称',
1244
1329
  dataIndex: 'name',
1245
1330
  },
1331
+ // {
1332
+ // title: '员工编码',
1333
+ // dataIndex: 'employeeNumber',
1334
+ // },
1335
+ // {
1336
+ // title: '员工名称',
1337
+ // dataIndex: 'name',
1338
+ // },
1246
1339
  {
1247
1340
  title: '所属组织机构',
1248
1341
  dataIndex: 'directOrgName',
@@ -9,6 +9,25 @@ const shopFileType = [
9
9
  }
10
10
  ]
11
11
 
12
+ const shopFile2Type = [
13
+ {
14
+ text: "第三方线上",
15
+ value: 'online',
16
+ },
17
+ {
18
+ text: "线下",
19
+ value: 'offline',
20
+ },
21
+ {
22
+ text: "自营B2B",
23
+ value: 'B2B',
24
+ },
25
+ {
26
+ text: "自营B2C",
27
+ value: 'B2C',
28
+ }
29
+ ]
30
+
12
31
  const arrivalPaySupportList = [
13
32
  {
14
33
  text: "支持",
@@ -31,4 +50,4 @@ const sharingType = [
31
50
  }
32
51
  ]
33
52
 
34
- export { shopFileType, arrivalPaySupportList, sharingType }
53
+ export { shopFileType, arrivalPaySupportList, sharingType, shopFile2Type }