@bit-sun/business-component 2.4.19 → 3.0.0-alpha.0

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 (58) hide show
  1. package/dist/components/Business/BsLayouts/Components/ChooseStore/index.d.ts +3 -0
  2. package/dist/components/Business/BsLayouts/Components/ChooseStore/services.d.ts +1 -0
  3. package/dist/components/Business/BsLayouts/Components/RightContent/i18n.d.ts +9 -0
  4. package/dist/components/Business/BsLayouts/service.d.ts +1 -1
  5. package/dist/components/Business/BsSulaQueryTable/index.d.ts +1 -0
  6. package/dist/components/Business/BsSulaQueryTable/setting.d.ts +1 -1
  7. package/dist/components/Business/BsSulaQueryTable/utils.d.ts +1 -0
  8. package/dist/components/Business/SearchSelect/common.d.ts +1 -5
  9. package/dist/components/Business/columnSettingTable/columnSetting.d.ts +1 -0
  10. package/dist/components/Functional/ExportFunctions/ExportIcon/index.d.ts +1 -1
  11. package/dist/components/Functional/QueryMutipleInput/index.d.ts +2 -1
  12. package/dist/components/Solution/RuleComponent/RenderCompItem.d.ts +2 -0
  13. package/dist/components/Solution/RuleComponent/services.d.ts +1 -1
  14. package/dist/index.esm.js +1566 -1131
  15. package/dist/index.js +1551 -1114
  16. package/dist/utils/request.d.ts +2 -0
  17. package/dist/utils/utils.d.ts +6 -0
  18. package/package.json +6 -4
  19. package/src/assets/arrow_top.svg +18 -0
  20. package/src/components/Business/AddSelectBusiness/index.tsx +38 -19
  21. package/src/components/Business/BsLayouts/Components/ChooseStore/index.less +0 -0
  22. package/src/components/Business/BsLayouts/Components/ChooseStore/index.tsx +193 -0
  23. package/src/components/Business/BsLayouts/Components/ChooseStore/services.ts +10 -0
  24. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +7 -1
  25. package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +3 -3
  26. package/src/components/Business/BsLayouts/Components/RightContent/i18n.ts +9 -0
  27. package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +19 -2
  28. package/src/components/Business/BsLayouts/index.tsx +44 -34
  29. package/src/components/Business/BsLayouts/service.ts +2 -2
  30. package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +9 -9
  31. package/src/components/Business/BsSulaQueryTable/bssulaquerytable.less +5 -0
  32. package/src/components/Business/BsSulaQueryTable/index.tsx +346 -175
  33. package/src/components/Business/BsSulaQueryTable/setting.tsx +125 -87
  34. package/src/components/Business/BsSulaQueryTable/utils.tsx +57 -34
  35. package/src/components/Business/CommonGuideWrapper/index.tsx +11 -2
  36. package/src/components/Business/JsonQueryTable/index.tsx +10 -12
  37. package/src/components/Business/SearchSelect/BusinessUtils.ts +4 -49
  38. package/src/components/Business/SearchSelect/common.ts +1 -16
  39. package/src/components/Business/SearchSelect/index.md +1 -58
  40. package/src/components/Business/SearchSelect/utils.ts +4 -4
  41. package/src/components/Business/columnSettingTable/columnSetting.tsx +10 -8
  42. package/src/components/Business/columnSettingTable/utils.tsx +29 -29
  43. package/src/components/Functional/AddSelect/helps.ts +4 -3
  44. package/src/components/Functional/AddSelect/index.tsx +79 -33
  45. package/src/components/Functional/BillEntry/index.tsx +3 -3
  46. package/src/components/Functional/DataImport/index.tsx +3 -3
  47. package/src/components/Functional/DataValidation/index.tsx +3 -3
  48. package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +10 -5
  49. package/src/components/Functional/QueryMutipleInput/index.tsx +2 -1
  50. package/src/components/Functional/SearchSelect/index.less +6 -0
  51. package/src/components/Functional/SearchSelect/index.tsx +152 -45
  52. package/src/components/Functional/TreeSearchSelect/index.tsx +24 -22
  53. package/src/components/Solution/RuleComponent/RenderCompItem.tsx +641 -0
  54. package/src/components/Solution/RuleComponent/index.js +7 -652
  55. package/src/components/Solution/RuleComponent/services.ts +2 -2
  56. package/src/plugin/TableColumnSetting/index.tsx +2 -2
  57. package/src/utils/request.ts +53 -0
  58. package/src/utils/utils.ts +37 -21
@@ -0,0 +1,2 @@
1
+ declare const requestUtil: any;
2
+ export default requestUtil;
@@ -15,3 +15,9 @@ export declare const handleAntdColumnsSpecialParams: (col: any) => void;
15
15
  export declare const getDictionarySource: (dicCode: string, needConvertInterger?: boolean) => any;
16
16
  export declare function uuid(): string;
17
17
  export declare const judgeIsEmpty: (value: any) => boolean;
18
+ /**
19
+ * 处理错误请求
20
+ * @param {*} response 返回结果
21
+ * @param {*} needBackError 是否需要将错误回传到页面单独处理
22
+ */
23
+ export declare function handleError(response: object, needBackError?: boolean): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "2.4.19",
3
+ "version": "3.0.0-alpha.0",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -28,8 +28,8 @@
28
28
  },
29
29
  "peerDependencies": {
30
30
  "antd": "^4.17.2",
31
- "bssula": "^2.0.0",
32
- "umi-plugin-bssula": "1.0.13",
31
+ "bssula": "3.0.0-alpha.1",
32
+ "umi-plugin-bssula": "3.0.0-alpha.1",
33
33
  "umi": "^3.5.20",
34
34
  "@ant-design/pro-layout": "^6.5.0",
35
35
  "react-dnd": "^16.0.1",
@@ -47,11 +47,13 @@
47
47
  "classnames": "^2.3.1",
48
48
  "lodash": "^4.17.21",
49
49
  "moment": "^2.25.3",
50
+ "qs": "^6.11.2",
50
51
  "querystring": "^0.2.1",
51
52
  "react": "^16.12.0",
52
53
  "react-beautiful-dnd": "10.0.0",
53
54
  "react-resizable": "^3.0.4",
54
55
  "react-sortable-hoc": "^2.0.0",
56
+ "umi-request": "^1.4.0",
55
57
  "warning": "^4.0.3",
56
58
  "ast-types": "^0.13.3",
57
59
  "js-cookie": "^3.0.1"
@@ -63,7 +65,7 @@
63
65
  "acorn": "^7.2.0",
64
66
  "acorn-walk": "^7.1.1",
65
67
  "antd": "^4.17.2",
66
- "bssula": "^2.1.29",
68
+ "bssula": "3.0.0-alpha.1",
67
69
  "dumi": "^1.0.14",
68
70
  "father-build": "^1.17.2",
69
71
  "gh-pages": "^3.0.0",
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>arrow_icon_up</title>
4
+ <g id="零售【单据详情】改造" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <g transform="translate(-462.000000, -1828.000000)" id="编组-5">
6
+ <g transform="translate(372.000000, 1534.000000)">
7
+ <g id="编组-2" transform="translate(10.000000, 286.000000)">
8
+ <g id="编组-17" transform="translate(80.000000, 8.000000)">
9
+ <rect id="arrow_icon_up" fill="#D8D8D8" opacity="0" x="0" y="0" width="20" height="20"></rect>
10
+ <g id="编组" transform="translate(2.500000, 2.500000)" fill="#B6B6B6" fill-rule="nonzero">
11
+ <path d="M7.5,0 C11.6422059,0 15,3.35779411 15,7.5 C15,11.6422059 11.6422059,15 7.5,15 C3.35779411,15 0,11.6422059 0,7.5 C0,3.35779411 3.35779411,0 7.5,0 Z M7.61029411,4.79955883 L3.58632353,8.82352941 L4.52205883,9.7592647 L7.61029411,6.67102942 L10.6985294,9.7592647 L11.6342647,8.82352941 L7.61029411,4.79955883 Z" id="形状"></path>
12
+ </g>
13
+ </g>
14
+ </g>
15
+ </g>
16
+ </g>
17
+ </g>
18
+ </svg>
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import React, { useState, useEffect } from 'react';
9
9
  import { Tooltip, Select, message } from 'antd';
10
- import axios from 'axios';
10
+ import request from '@/utils/request';
11
11
  import { AddSelect } from '../../../index';
12
12
  import { tableColumnsImage } from '@/components/Business/BsSulaQueryTable/utils';
13
13
  import { getSkuImg } from '@/utils/TableUtils';
@@ -22,24 +22,28 @@ function handleSelectColumn(c: any, parentProps: any) {
22
22
  const coverColumns = parentProps?.coverColumns || [];
23
23
  const additionColumns = parentProps?.additionColumns || [];
24
24
  // 仅展示内容
25
- if(showColumns?.length) {
26
- result = result.filter((i: any) => showColumns.includes(i.dataIndex))
25
+ // FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115617
26
+ if (showColumns?.length) {
27
+ result = result.filter((i: any) => showColumns.includes(i.dataIndex));
27
28
  }
28
29
  // 过滤不需要展示内容
29
- if(exceptColumns?.length) {
30
- result = result.filter((i: any) => !exceptColumns.includes(i.dataIndex))
30
+ // FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115617
31
+ if (exceptColumns?.length) {
32
+ result = result.filter((i: any) => !exceptColumns.includes(i.dataIndex));
31
33
  }
32
34
  // 追加(最好不用这个,当组件不固定时候会有影响)
33
- if(additionColumns?.length) {
35
+ // FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115617
36
+ if (additionColumns?.length) {
34
37
  additionColumns.forEach((i: any) => {
35
- result.splice(i.position,0,i.column)
36
- })
38
+ result.splice(i.position, 0, i.column);
39
+ });
37
40
  }
38
41
  // 覆盖内容
39
- if(coverColumns?.length) {
42
+ // FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115617
43
+ if (coverColumns?.length) {
40
44
  result = coverColumns;
41
45
  }
42
- return result
46
+ return result;
43
47
  }
44
48
  function handleSearchForm(c: any, parentProps: any) {
45
49
  let result = c;
@@ -47,14 +51,17 @@ function handleSearchForm(c: any, parentProps: any) {
47
51
  const exceptTableSearchForm= parentProps?.exceptTableSearchForm|| [];
48
52
  const coverTableSearchForm = parentProps?.coverTableSearchForm || [];
49
53
  // 仅展示内容
54
+ // FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115617
50
55
  if(showTableSearchForm?.length) {
51
56
  result = result.filter((i: any) => showTableSearchForm.includes(i.name))
52
57
  }
53
58
  // 过滤不需要展示内容
59
+ // FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115617
54
60
  if(exceptTableSearchForm?.length) {
55
61
  result = result.filter((i: any) => !exceptTableSearchForm.includes(i.name))
56
62
  }
57
63
  // 覆盖内容
64
+ // FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115617
58
65
  if(coverTableSearchForm?.length) {
59
66
  result = coverTableSearchForm;
60
67
  }
@@ -67,14 +74,17 @@ function handleFormSearchSourceLoad(c: any, parentProps: any) {
67
74
  const coverTableFormSearchSourceLoad = parentProps?.coverTableFormSearchSourceLoad || [];
68
75
  const noNeedTableFormSearchSourceLoad = parentProps?.noNeedTableFormSearchSourceLoad
69
76
  // 仅展示内容
77
+ // FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115617
70
78
  if(showTableFormSearchSourceLoad?.length) {
71
79
  result = result.filter((i: any) => showTableFormSearchSourceLoad.includes(i.url))
72
80
  }
73
81
  // 过滤不需要展示内容
82
+ // FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115617
74
83
  if(exceptTableFormSearchSourceLoad?.length) {
75
84
  result = result.filter((i: any) => !exceptTableFormSearchSourceLoad.includes(i.url))
76
85
  }
77
86
  // 覆盖内容
87
+ // FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115617
78
88
  if(coverTableFormSearchSourceLoad?.length) {
79
89
  result = coverTableFormSearchSourceLoad;
80
90
  }
@@ -106,6 +116,7 @@ export const AddSkuSelect = (parProps: any) => {
106
116
  showTitle: false,
107
117
  },
108
118
  dataIndex: 'itemEancode',
119
+ // FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115627
109
120
  render: (text: any) => (
110
121
  <Tooltip placement="topLeft" title={text}>
111
122
  {text}
@@ -153,6 +164,7 @@ export const AddSkuSelect = (parProps: any) => {
153
164
  showTitle: false,
154
165
  },
155
166
  render: (text: any, record: any) => {
167
+ // FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115636
156
168
  if (record?.packingUnitList?.length) {
157
169
  const basePackUnit = record?.packingUnitList[0]
158
170
  record.selectUnitCode = basePackUnit.unitCode
@@ -238,6 +250,11 @@ export const AddSkuSelect = (parProps: any) => {
238
250
  ),
239
251
  }
240
252
  ]),
253
+ {
254
+ title: 'SKC编码',
255
+ width: 150,
256
+ dataIndex: 'skcCode',
257
+ },
241
258
  {
242
259
  title: '所属SPU名称',
243
260
  width: 100,
@@ -333,9 +350,11 @@ export const AddSkuSelect = (parProps: any) => {
333
350
  const mTpTableColumn = handleSelectColumn(initialTableColumn, parProps);
334
351
  const initialTableSearchForm = [
335
352
  {
336
- name: 'qp-skuCode-like', label: 'SKU编码'
353
+ name: 'qp-skuCode-like', label: 'SKU编码',type:'multipleQueryInput'
337
354
  },
338
355
  { name: 'qp-skuName-like', label: 'SKU名称' },
356
+ { name: 'qp-skcCode-like', label: 'SKC编码',type:'multipleQueryInput' },
357
+ { name: 'qp-itemCode-like', label: 'SPU编码',type:'multipleQueryInput' },
339
358
  ...(isNoUseItemBarcode ? []: [
340
359
  { name: 'qp-code-in', label: '商品条码', field: {
341
360
  type: 'multipleQueryInput',
@@ -355,7 +374,7 @@ export const AddSkuSelect = (parProps: any) => {
355
374
  maxTagCount: 1,
356
375
  optionFilterProp: 'children',
357
376
  filterOption: (input: string, option: { props: { children: string } }) =>
358
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
377
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
359
378
  },
360
379
  } },
361
380
  { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
@@ -459,7 +478,7 @@ export const AddSkcSelect = (parProps: any) => {
459
478
 
460
479
  useEffect(() => {
461
480
  // type: 1 尺码组; 2 配码组
462
- axios.get(`/items/itemPropertyValueGroup/listNoPage?qp-type-eq=2&qp-status-eq=1`).then((result: any) => {
481
+ request.get(`/items/itemPropertyValueGroup/listNoPage?qp-type-eq=2&qp-status-eq=1`).then((result: any) => {
463
482
  result = result.data;
464
483
  if (judgeIsRequestError(result)) {
465
484
  message.error(result.msg);
@@ -467,7 +486,7 @@ export const AddSkcSelect = (parProps: any) => {
467
486
  }
468
487
  const data = result.data || [];
469
488
  setPropertyList(data)
470
- }).catch((err) => {});
489
+ }).catch((err:any) => {});
471
490
  },[])
472
491
 
473
492
  //注⚠️:自定义过表头的请记得传tableCodeList参数
@@ -522,7 +541,7 @@ export const AddSkcSelect = (parProps: any) => {
522
541
  {
523
542
  url: `/items/item/propertyValue/sizeBySkcConfig`,
524
543
  params: {
525
- pageSize: 10000,
544
+ pageSize: 50,
526
545
  currentPage: 1,
527
546
  type: 2, // 类型:1尺码;2颜色
528
547
  },
@@ -533,7 +552,7 @@ export const AddSkcSelect = (parProps: any) => {
533
552
  {
534
553
  url: `/items/category/queryCategoryTree`,
535
554
  params: {
536
- pageSize: 5000,
555
+ pageSize: 50,
537
556
  currentPage: 1,
538
557
  },
539
558
  resType: 'treeList',
@@ -764,7 +783,7 @@ export const AddSpuSelect = (parProps: any) => {
764
783
  useEffect(() => {
765
784
  if(parProps?.isSingleColor) {
766
785
  // type: 1 尺码组; 2 配码组
767
- axios.get(`/items/itemPropertyValueGroup/listNoPage?qp-type-eq=2&qp-status-eq=1`).then((result: any) => {
786
+ request.get(`/items/itemPropertyValueGroup/listNoPage?qp-type-eq=2&qp-status-eq=1`).then((result: any) => {
768
787
  result = result.data;
769
788
  if (judgeIsRequestError(result)) {
770
789
  message.error(result.msg);
@@ -772,7 +791,7 @@ export const AddSpuSelect = (parProps: any) => {
772
791
  }
773
792
  const data = result.data || [];
774
793
  setPropertyList(data)
775
- }).catch((err) => {});
794
+ }).catch((err: any) => {});
776
795
  }
777
796
  },[])
778
797
 
@@ -862,7 +881,7 @@ export const AddSpuSelect = (parProps: any) => {
862
881
  {
863
882
  url: `/items/category/queryCategoryTree`,
864
883
  params: {
865
- pageSize: 5000,
884
+ pageSize: 50,
866
885
  currentPage: 1,
867
886
  },
868
887
  resType: 'treeList',
@@ -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
+ }
@@ -1,6 +1,7 @@
1
1
  // @ts-nocheck
2
2
  import React, { useState } from "react";
3
3
  import RightContent from '../RightContent';
4
+ import ChooseStore from '../ChooseStore';
4
5
  import { Input } from 'antd';
5
6
  import { SearchOutlined } from '@ant-design/icons';
6
7
  import { debounce, cloneDeep } from 'lodash';
@@ -17,7 +18,7 @@ export const judgeIsEmpty = (value: any) => {
17
18
  };
18
19
 
19
20
  const GlobalHeaderCom = (props: any) => {
20
- const { route: {routes=[]}} = props;
21
+ const { route: {routes=[]}, showSelectStore = false, employeeCode = "EMP231011000002", } = props;
21
22
  const [keyWord, setKeyWord] = useState('');
22
23
  const [routeList, setroutesData] = useState<any[]>([]);
23
24
 
@@ -150,6 +151,11 @@ const GlobalHeaderCom = (props: any) => {
150
151
  </div>
151
152
  </div>
152
153
  </div>
154
+ {
155
+ showSelectStore && (
156
+ <ChooseStore employeeCode={employeeCode} />
157
+ )
158
+ }
153
159
  <RightContent />
154
160
  </div>
155
161
  )
@@ -2,7 +2,7 @@
2
2
  import React from 'react';
3
3
  import { Form, Input, Button, Modal } from 'antd';
4
4
  import { getAccountID, getUserId } from '@/utils/LocalstorageUtils';
5
- import axios from 'axios';
5
+ import request from '@/utils/request';
6
6
 
7
7
  export default (props: any) => {
8
8
  const { loginOut } = props;
@@ -20,11 +20,11 @@ export default (props: any) => {
20
20
  <Button
21
21
  onClick={() => {
22
22
  form.validateFields().then((res) => {
23
- axios({
23
+ request({
24
24
  url: `/bop/api/account/changePassWord/${getAccountID()}`,
25
25
  method: 'patch',
26
26
  params: res,
27
- }).then(res => {
27
+ }).then(() => {
28
28
  loginOut();
29
29
  })
30
30
  });
@@ -0,0 +1,9 @@
1
+ export default {
2
+ 'zh-CN': {
3
+ lang: '中文',
4
+ },
5
+
6
+ 'en-US': {
7
+ lang: 'English',
8
+ },
9
+ }
@@ -1,8 +1,9 @@
1
1
 
2
2
  // @ts-nocheck
3
- import { Dropdown, message, Modal } from 'antd';
3
+ import { Dropdown, message, Modal, Button } from 'antd';
4
+ import i18n from './i18n';
4
5
  import React, { useState } from 'react';
5
- import { history, useModel } from 'umi';
6
+ import { history, useModel, setLocale } from 'umi';
6
7
  import './home.less';
7
8
  import Morentouxiang from '../../../../../assets/morentouxiang-32.svg';
8
9
  import Morentouxiang32 from '../../../../../assets/32.svg';
@@ -113,9 +114,25 @@ const GlobalHeaderRight: React.FC<GlobalHeaderRightProps> = ({ menu }) => {
113
114
  </div>
114
115
  );
115
116
 
117
+ const changeLanguage = (lang: string) => {
118
+ localStorage.setItem('umi_locale', lang || "zh-CN");
119
+ setLocale(lang || "zh-CN");
120
+ window.location.reload();
121
+ }
122
+
123
+ const language = localStorage.getItem('umi_locale') || 'zh-CN';
124
+
116
125
  return (
117
126
  <div className={className} style={divStyle()}>
118
127
  <div className={'rcom_imgWap'}>
128
+ <Button
129
+ style={{
130
+ marginRight: '20px'
131
+ }}
132
+ onClick={() => {
133
+ changeLanguage(language === 'zh-CN' ? 'en-US' : 'zh-CN')
134
+ }}>{i18n[language]?.lang || "English"}
135
+ </Button>
119
136
  {/* <Tooltip placement="bottom" title={'全局控制台'}>
120
137
  <img
121
138
  className={'rcom_img'}
@@ -408,7 +408,7 @@ class BasicLayout extends React.PureComponent {
408
408
 
409
409
  if (!istParent) {
410
410
  if (route.pathname === '/') return;
411
- window.$wujie?.bus.$emit('sub-route-change', itemPath, currentKey);
411
+ window.$wujie?.bus.$emit('sub-route-change', itemPath, currentKey, route?.state);
412
412
  // window.parent.postMessage(`/parent/${itemPath}${currentKey}`, '*');
413
413
  }
414
414
 
@@ -454,43 +454,53 @@ class BasicLayout extends React.PureComponent {
454
454
  }
455
455
  }
456
456
 
457
- // 处理hideMenu页面自动关闭
457
+ // -------------------处理页签关闭----------------------------
458
458
  lastTwoRouterArray.push(route.pathname);
459
459
  lastTwoRouterArray.shift();
460
- if (
461
- !localStorage.getItem('isTabChange') &&
462
- !localStorage.getItem('isMenuClick')
463
- ) {
464
- if (
465
- lastTwoRouterArray[0] &&
466
- typeof lastTwoRouterArray[0] === 'string'
467
- ) {
468
- let needRemoveKeyArray = hideMenuArray.filter((itemRoute) =>
469
- pathToRegexp(itemRoute.path || '').test(lastTwoRouterArray[0]),
470
- );
471
- // lastTwoRouterArray[0] != lastTwoRouterArray[1] 该判断条件用于判断是否是tab删除操作,如果是tab页删除操作,删除的是不是最后一个打开的tab页,执行history.push会导致错误的将最后打开的那个tab页也删除掉
472
- if (
473
- needRemoveKeyArray.length &&
474
- lastTwoRouterArray[0] != lastTwoRouterArray[1] && !route.state?.thisHideInMenuDoNotClose
475
- ) {
476
- newListenRouterState = newListenRouterState.filter((item) => {
477
- const [pathname] = item.key ? item.key.split('?') : [];
478
- return pathname && pathname !== lastTwoRouterArray[0];
479
- });
480
- newListenRouterKey = newListenRouterKey.filter((item) => {
481
- const [pathname] = item ? item.split('?') : [];
482
- return pathname && pathname !== lastTwoRouterArray[0];
483
- });
484
- }
485
- }
486
- // refs?.tableRef?.current?.refreshTable();
460
+
461
+ const {
462
+ thisHideInMenuDoNotClose = false,
463
+ closePrevPage = false,
464
+ updateCurrentPage = false,
465
+ } = route?.state || {};
466
+
467
+ let needRemoveKey = '';
468
+
469
+ // lastTwoRouterArray[0] != lastTwoRouterArray[1] 该判断条件用于判断是否是tab删除操作,如果是tab页删除操作,删除的是不是最后一个打开的tab页,执行history.push会导致错误的将最后打开的那个tab页也删除掉
470
+ let notSamePageFlag = lastTwoRouterArray[0] != lastTwoRouterArray[1];
471
+
472
+ // 满足包含closePrevPage标识则直接删除上一页
473
+ if (closePrevPage) {
474
+ needRemoveKey = lastTwoRouterArray[0] && typeof lastTwoRouterArray[0] === 'string' && notSamePageFlag ? lastTwoRouterArray[0] : '';
487
475
  } else {
488
- setTimeout(() => {
489
- // 处理页面刷新两面
490
- localStorage.removeItem('isTabChange');
491
- localStorage.removeItem('isMenuClick');
492
- }, 0);
476
+ // 满足非tabclick或者menuClick的hideInMenu类型菜单自动关闭
477
+ const shouldClosePrev = (!localStorage.getItem('isTabChange') && !localStorage.getItem('isMenuClick'));
478
+ const needRemoveKeyArray = lastTwoRouterArray[0] && typeof lastTwoRouterArray[0] === 'string' && shouldClosePrev ?
479
+ hideMenuArray.filter((itemRoute) =>
480
+ pathToRegexp(itemRoute.path || '').test(lastTwoRouterArray[0]),
481
+ ) : [];
482
+ needRemoveKey = needRemoveKeyArray.length && notSamePageFlag && !thisHideInMenuDoNotClose ? needRemoveKeyArray[0] : '';
483
+ }
484
+
485
+ if (needRemoveKey) {
486
+ newListenRouterState = newListenRouterState.filter((item) => {
487
+ const [pathname] = item.key ? item.key.split('?') : [];
488
+ return pathname && pathname !== lastTwoRouterArray[0];
489
+ });
490
+ newListenRouterKey = newListenRouterKey.filter((item) => {
491
+ const [pathname] = item ? item.split('?') : [];
492
+ return pathname && pathname !== lastTwoRouterArray[0];
493
+ });
493
494
  }
495
+
496
+ setTimeout(() => {
497
+ // 处理页面刷新两面
498
+ localStorage.removeItem('isTabChange');
499
+ localStorage.removeItem('isMenuClick');
500
+ }, 0);
501
+
502
+ // -------------------处理页签关闭 end----------------------------
503
+
494
504
  this.setState(
495
505
  {
496
506
  //路由监听函数最后执行setState,避免处理hideMenu类型页面自动关闭的逻辑块内获取不到最新state的listenRouterState和listenRouterKey