ls-pro-common 3.0.97 → 3.0.99

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 (54) hide show
  1. package/dist/common.css +63 -0
  2. package/dist/common.js +1 -1
  3. package/dist/common.less +2 -1
  4. package/dist/common.min.css +63 -0
  5. package/dist/common.min.js +1 -1
  6. package/es/components/InputTable.js +59 -27
  7. package/es/components/ProButton/index.d.ts +10 -0
  8. package/es/components/ProButton/index.js +40 -0
  9. package/es/components/RecordLog/index.d.ts +16 -0
  10. package/es/components/RecordLog/index.js +114 -0
  11. package/es/components/RecordLog/index.less +71 -0
  12. package/es/hooks/useMdm.d.ts +7 -0
  13. package/es/hooks/useMdm.js +47 -0
  14. package/es/http/index.d.ts +2 -1
  15. package/es/http/index.js +2 -7
  16. package/es/http/mdmRequest.d.ts +184 -0
  17. package/es/http/mdmRequest.js +351 -0
  18. package/es/index.d.ts +6 -2
  19. package/es/index.js +6 -2
  20. package/es/utils/array.d.ts +26 -0
  21. package/es/utils/array.js +74 -0
  22. package/es/utils/format.d.ts +82 -0
  23. package/es/utils/format.js +148 -0
  24. package/es/utils/index.d.ts +6 -132
  25. package/es/utils/index.js +9 -511
  26. package/es/utils/modal.d.ts +43 -0
  27. package/es/utils/modal.js +225 -0
  28. package/es/utils/size.d.ts +9 -0
  29. package/es/utils/size.js +81 -0
  30. package/lib/components/InputTable.js +59 -27
  31. package/lib/components/ProButton/index.d.ts +10 -0
  32. package/lib/components/ProButton/index.js +40 -0
  33. package/lib/components/RecordLog/index.d.ts +16 -0
  34. package/lib/components/RecordLog/index.js +114 -0
  35. package/lib/components/RecordLog/index.less +71 -0
  36. package/lib/hooks/useMdm.d.ts +7 -0
  37. package/lib/hooks/useMdm.js +47 -0
  38. package/lib/http/index.d.ts +2 -1
  39. package/lib/http/index.js +2 -7
  40. package/lib/http/mdmRequest.d.ts +184 -0
  41. package/lib/http/mdmRequest.js +351 -0
  42. package/lib/index.d.ts +6 -2
  43. package/lib/index.js +6 -2
  44. package/lib/utils/array.d.ts +26 -0
  45. package/lib/utils/array.js +74 -0
  46. package/lib/utils/format.d.ts +82 -0
  47. package/lib/utils/format.js +148 -0
  48. package/lib/utils/index.d.ts +6 -132
  49. package/lib/utils/index.js +9 -511
  50. package/lib/utils/modal.d.ts +43 -0
  51. package/lib/utils/modal.js +225 -0
  52. package/lib/utils/size.d.ts +9 -0
  53. package/lib/utils/size.js +81 -0
  54. package/package.json +2 -1
@@ -0,0 +1,114 @@
1
+ import "antd/es/empty/style";
2
+ import _Empty from "antd/es/empty";
3
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
+ /**
5
+ * 记录变更日志
6
+ *
7
+ * @param recordKey 记录key
8
+ */
9
+ import React, { useEffect, useState, useMemo } from 'react';
10
+ import { EditOutlined, ArrowRightOutlined } from '@ant-design/icons';
11
+ import { httpGet } from '../../http';
12
+ import './index.less';
13
+ var OP_TYPE_MAP = {
14
+ A: '新增',
15
+ U: '编辑',
16
+ D: '删除'
17
+ };
18
+ var RecordLog = function RecordLog(props) {
19
+ var _useState = useState([]),
20
+ _useState2 = _slicedToArray(_useState, 2),
21
+ logData = _useState2[0],
22
+ setLogData = _useState2[1];
23
+ var _props$recordKey = props.recordKey,
24
+ recordKey = _props$recordKey === void 0 ? '' : _props$recordKey,
25
+ _props$fieldsMap = props.fieldsMap,
26
+ fieldsMap = _props$fieldsMap === void 0 ? {} : _props$fieldsMap,
27
+ _props$showResourceNa = props.showResourceName,
28
+ showResourceName = _props$showResourceNa === void 0 ? true : _props$showResourceNa,
29
+ style = props.style,
30
+ _props$className = props.className,
31
+ className = _props$className === void 0 ? '' : _props$className;
32
+ var getLogData = function getLogData() {
33
+ var url = '/lesoon-petrel-behaviour-api/behUserOperateLog/page';
34
+ var params = {
35
+ pageSize: 5000,
36
+ sort: 'createTime desc',
37
+ where: {
38
+ dataCode: recordKey
39
+ }
40
+ };
41
+ httpGet(url, params).then(function (res) {
42
+ var rows = (res === null || res === void 0 ? void 0 : res.rows) || [];
43
+ rows.forEach(function (row) {
44
+ try {
45
+ row.content = JSON.parse(row.content);
46
+ row.content.forEach(function (item) {
47
+ var o = item.oldValue || '';
48
+ item.oldValue = !o || o == '[]' || (o === null || o === void 0 ? void 0 : o.length) == 0 ? '空' : o + '';
49
+ var n = item.newValue || '';
50
+ item.newValue = !n || n == '[]' || (n === null || n === void 0 ? void 0 : n.length) == 0 ? '空' : n + '';
51
+ item.fieldDisPlayName = fieldsMap[item.fieldName] || item.fieldDisPlayName;
52
+ });
53
+ } catch (_unused) {
54
+ row.content = [];
55
+ }
56
+ });
57
+ setLogData(rows);
58
+ });
59
+ };
60
+ useEffect(function () {
61
+ if (!recordKey) return;
62
+ getLogData();
63
+ }, [recordKey]);
64
+ var renderFields = function renderFields(fields) {
65
+ if (!fields || !fields.length) return null;
66
+ return fields.map(function (field) {
67
+ return /*#__PURE__*/React.createElement("div", {
68
+ className: "log-item-field",
69
+ key: Math.random() + ''
70
+ }, /*#__PURE__*/React.createElement("span", {
71
+ className: "log-item-label"
72
+ }, field.fieldDisPlayName, " :"), /*#__PURE__*/React.createElement("span", {
73
+ className: "log-item-value"
74
+ }, field.oldValue), /*#__PURE__*/React.createElement(ArrowRightOutlined, {
75
+ style: {
76
+ fontSize: '14px',
77
+ margin: '0 10px'
78
+ }
79
+ }), /*#__PURE__*/React.createElement("span", {
80
+ className: "log-item-value"
81
+ }, field.newValue));
82
+ });
83
+ };
84
+ var LogDom = useMemo(function () {
85
+ return logData.map(function (item) {
86
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
87
+ className: "record-log-item"
88
+ }, /*#__PURE__*/React.createElement("div", {
89
+ className: "log-item-time"
90
+ }, item.createTime), /*#__PURE__*/React.createElement("div", {
91
+ className: "log-item-center"
92
+ }, /*#__PURE__*/React.createElement(EditOutlined, {
93
+ style: {
94
+ fontSize: '20px'
95
+ }
96
+ }), /*#__PURE__*/React.createElement("div", {
97
+ className: "log-item-line"
98
+ })), /*#__PURE__*/React.createElement("div", {
99
+ className: "log-item-box"
100
+ }, /*#__PURE__*/React.createElement("div", {
101
+ className: "log-item-header"
102
+ }, showResourceName && /*#__PURE__*/React.createElement("span", null, item.resourceName || ''), /*#__PURE__*/React.createElement("span", null, item.creator || ''), /*#__PURE__*/React.createElement("span", null, OP_TYPE_MAP[item.operateType] || OP_TYPE_MAP['U']), /*#__PURE__*/React.createElement("span", null, item.dataName || ''), /*#__PURE__*/React.createElement("span", null, item.dataCode || '')), /*#__PURE__*/React.createElement("div", {
103
+ className: "log-item-content"
104
+ }, renderFields(item.content)))));
105
+ });
106
+ }, [logData]);
107
+ return /*#__PURE__*/React.createElement("div", {
108
+ className: "record-log ".concat(className),
109
+ style: style
110
+ }, logData.length ? LogDom : /*#__PURE__*/React.createElement(_Empty, {
111
+ description: "\u6682\u65E0\u53D8\u66F4\u6570\u636E"
112
+ }));
113
+ };
114
+ export default RecordLog;
@@ -0,0 +1,71 @@
1
+ .record-log {
2
+ height: 100%;
3
+ padding: 8px;
4
+ overflow: auto;
5
+ border: 1px solid #f1f0f0;
6
+
7
+ .record-log-item {
8
+ display: flex;
9
+ margin-bottom: 8px;
10
+ }
11
+ .log-item-time {
12
+ flex-wrap: wrap;
13
+ color: #a1a0a1;
14
+ }
15
+
16
+ .log-item-center {
17
+ position: relative;
18
+ display: flex;
19
+ flex-direction: column;
20
+ margin: 0 10px;
21
+ .log-item-line {
22
+ position: relative;
23
+ flex: 1;
24
+ width: 0.5px;
25
+ margin: auto;
26
+ border: 1px dashed #dcdbdb;
27
+ }
28
+ }
29
+
30
+ .log-item-box {
31
+ margin-bottom: 5px;
32
+ border: 1px solid #eee;
33
+ border-radius: 6px;
34
+
35
+ &:hover {
36
+ box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.2);
37
+ }
38
+
39
+ .log-item-header {
40
+ padding: 8px 5px;
41
+ color: #000;
42
+ font-weight: 600;
43
+ background-color: #f3f7fc;
44
+ border-radius: 6px 6px 0 0;
45
+ span {
46
+ padding: 0 5px;
47
+ }
48
+ }
49
+
50
+ .log-item-content {
51
+ padding: 5px 0;
52
+ padding-left: 12px;
53
+ background: #fff;
54
+ border-bottom-right-radius: 6px;
55
+ border-bottom-left-radius: 6px;
56
+
57
+ .log-item-field {
58
+ padding: 3px 5px;
59
+
60
+ .log-item-label {
61
+ padding-right: 10px;
62
+ color: #a1a0a1;
63
+ }
64
+
65
+ .log-item-value {
66
+ color: #000;
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
@@ -0,0 +1,7 @@
1
+ import { type MdmType } from '../http/mdmRequest';
2
+ interface MdmParams {
3
+ type: MdmType;
4
+ params?: any;
5
+ }
6
+ export default function (props: MdmParams): [() => Promise<void>, any[], (list: any[]) => void, boolean];
7
+ export {};
@@ -0,0 +1,47 @@
1
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
+ import { useState } from 'react';
5
+ import { getMdmData } from '../http/mdmRequest';
6
+ export default function (props) {
7
+ var type = props.type,
8
+ _props$params = props.params,
9
+ params = _props$params === void 0 ? {} : _props$params;
10
+ var _useState = useState([]),
11
+ _useState2 = _slicedToArray(_useState, 2),
12
+ list = _useState2[0],
13
+ setList = _useState2[1];
14
+ var _useState3 = useState(false),
15
+ _useState4 = _slicedToArray(_useState3, 2),
16
+ loading = _useState4[0],
17
+ setLoading = _useState4[1];
18
+ var run = /*#__PURE__*/function () {
19
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
20
+ var res, rows;
21
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
22
+ while (1) switch (_context.prev = _context.next) {
23
+ case 0:
24
+ _context.prev = 0;
25
+ setLoading(true);
26
+ _context.next = 4;
27
+ return getMdmData(type, params);
28
+ case 4:
29
+ res = _context.sent;
30
+ rows = res.rows || [];
31
+ setList(rows);
32
+ case 7:
33
+ _context.prev = 7;
34
+ setLoading(false);
35
+ return _context.finish(7);
36
+ case 10:
37
+ case "end":
38
+ return _context.stop();
39
+ }
40
+ }, _callee, null, [[0,, 7, 10]]);
41
+ }));
42
+ return function run() {
43
+ return _ref.apply(this, arguments);
44
+ };
45
+ }();
46
+ return [run, list, setList, loading];
47
+ }
@@ -40,8 +40,9 @@ export declare function httpDelete(url: string, data: any, needGateWay?: boolean
40
40
  * 读取数据字典
41
41
  *
42
42
  * @param dictCode 字典编码
43
+ * @param showValue 是否显示值
43
44
  * @param needGateWay 是否需要网关 默认为true
44
- * @returns Promise<Record<string,string>>
45
+ * @returns Promise<Record<string,string>[]>
45
46
  */
46
47
  export declare function getDict(dictCode: string, showValue?: boolean, needGateWay?: boolean, timeout?: number): Promise<any>;
47
48
  /**
package/lib/http/index.js CHANGED
@@ -27,13 +27,7 @@ var browserId = '';
27
27
  /** 请求拦截器,统一添加token */
28
28
  request.interceptors.request.use(function (url, options) {
29
29
  var _options$params;
30
- var token = getCookie('token');
31
30
  options.headers = options.headers || {};
32
- // 处理 token
33
- if (token && url.indexOf('noToken=1') === -1) {
34
- // @ts-ignore
35
- options.headers['token'] = token;
36
- }
37
31
  // 处理浏览器指纹
38
32
  if (browserId) {
39
33
  // @ts-ignore
@@ -296,8 +290,9 @@ export function httpDelete(url, data) {
296
290
  * 读取数据字典
297
291
  *
298
292
  * @param dictCode 字典编码
293
+ * @param showValue 是否显示值
299
294
  * @param needGateWay 是否需要网关 默认为true
300
- * @returns Promise<Record<string,string>>
295
+ * @returns Promise<Record<string,string>[]>
301
296
  */
302
297
  export function getDict(dictCode) {
303
298
  var showValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
@@ -0,0 +1,184 @@
1
+ /**
2
+ * @param params 请求参数
3
+ * @name 获取主数据货主数据,调用接口/lesoon-mdm-center-api/bmOwner/findAll
4
+ * @returns
5
+ */
6
+ export declare const getOwner: (params?: any) => Promise<any>;
7
+ /**
8
+ * @param params 请求参数
9
+ * @name 获取主数据仓库数据,调用接口/lesoon-mdm-center-api/bmStore/findAll
10
+ * @returns
11
+ */
12
+ export declare const getStore: (params?: any) => Promise<any>;
13
+ /**
14
+ * @param params 请求参数
15
+ * @name 获取主数据品牌部数据,调用接口/lesoon-mdm-center-api/bmBrandDept/findAll
16
+ * @returns
17
+ */
18
+ export declare const getBrandDept: (params?: any) => Promise<any>;
19
+ /**
20
+ * @param params 请求参数
21
+ * @name 获取主数据物流大区数据,调用接口/lesoon-mdm-center-api/bmLogisticRegion/findAll
22
+ * @returns
23
+ */
24
+ export declare const getLogisticRegion: (params?: any) => Promise<any>;
25
+ /**
26
+ * @param where: {forwarderLevel: 1 // 承运商级别 1:一级 2:二级 , forwarderType: 1 // 承运商类型 0:货运公司 1:快递公司 }
27
+ * @name 获取快递/快运承运商,调用接口/lesoon-mdm-center-api/bmForwarder/findAll
28
+ * @returns
29
+ */
30
+ export declare const getExpressCompany: (params?: any) => Promise<any>;
31
+ /**
32
+ * @name 分页获取快递公司/承运商,调用接口/lesoon-mdm-center-api/bmForwarder/pageVo
33
+ * @returns
34
+ */
35
+ export declare const getExpressCompanyPage: (params?: any) => Promise<any>;
36
+ /**
37
+ * @name 实体仓,调用接口/lesoon-mdm-center-api/bmPhysicalStore/findAll
38
+ * @returns
39
+ */
40
+ export declare const getPhysicalStore: (params?: any) => Promise<any>;
41
+ /**
42
+ * @param params
43
+ * @name 结算大类,调用接口/lesoon-mdm-center-api/bmSettlementCate/findAll
44
+ * @returns
45
+ */
46
+ export declare const getSettleCategory: (params?: any) => Promise<any>;
47
+ /**
48
+ * @param param
49
+ * @name 获取损益主体,调用接口/lesoon-mdm-center-api/bmProfitLossMain/findAll
50
+ * @returns
51
+ */
52
+ export declare const getProfitLossMain: (param?: any) => Promise<any>;
53
+ /**
54
+ * @param params
55
+ * @name 结算公司,调用接口/lesoon-mdm-center-api/bmSettleCompany/findAll
56
+ * @returns
57
+ */
58
+ export declare const getSettleCompany: (params?: any) => Promise<any>;
59
+ /**
60
+ * @param params
61
+ * @name 货权,调用接口/lesoon-mdm-center-api/bmPowerUnit/findAll
62
+ * @returns
63
+ */
64
+ export declare const getPowerUnit: (params?: any) => Promise<any>;
65
+ /**
66
+ * @param params
67
+ * @name 结算账号,调用接口/lesoon-mdm-center-api/bmSettleAccount/findAll
68
+ * @returns
69
+ */
70
+ export declare const getSettleAccount: (params?: any) => Promise<any>;
71
+ /**
72
+ * @name 获取物流大类,调用接口/lesoon-mdm-center-api/bmLogisticCategory/findAll
73
+ * @returns
74
+ */
75
+ export declare const getLogisticCategory: (params?: any) => Promise<any>;
76
+ /**
77
+ * @param param
78
+ * @name 管理城市,调用接口/lesoon-mdm-center-api/bmManagingCity/findAll
79
+ * @returns
80
+ */
81
+ export declare const getManagingCity: (params?: any) => Promise<any>;
82
+ interface AreaParams {
83
+ where?: {
84
+ level?: 'province' | 'city' | 'district';
85
+ [key: string]: any;
86
+ };
87
+ [key: string]: any;
88
+ }
89
+ /**
90
+ * @param {where: {level:'province'}} level Province=省,city=市,district=区
91
+ * @name 获取省市区,调用接口/lesoon-mdm-center-api/sysAdministrativeDivision/findAll
92
+ * @returns
93
+ */
94
+ export declare const getArea: (params?: AreaParams) => Promise<any>;
95
+ /**
96
+ * @param param
97
+ * @name 获取集散中心,调用接口/lesoon-mdm-center-api/tmsTransportLocno/findAll
98
+ * @returns
99
+ */
100
+ export declare const getTransportLocno: (params?: any) => Promise<any>;
101
+ /**
102
+ * @param param
103
+ * @name 分页获取配送点,调用接口/lesoon-mdm-center-api/tmsTransportPoint/getTransportPointByPage
104
+ * @returns
105
+ */
106
+ export declare const getTransportPointPage: (params?: any) => Promise<any>;
107
+ /**
108
+ * @param param
109
+ * @name 分页获取卸货点,调用接口/lesoon-mdm-center-api/tmsUploadPoint/findTmpUploadPintList
110
+ * @returns
111
+ */
112
+ export declare const getUploadPointPage: (params?: any) => Promise<any>;
113
+ /**
114
+ * @param param
115
+ * @name 分页获取店铺,调用接口/lesoon-mdm-center-api/bmShop/pageVo
116
+ * @returns
117
+ */
118
+ export declare const getShopPage: (params?: any) => Promise<any>;
119
+ /**
120
+ * @param param
121
+ * @name 获取颜色,调用接口/lesoon-mdm-center-api/bmColor/findAll
122
+ * @returns
123
+ */
124
+ export declare const getColor: (params?: any) => Promise<any>;
125
+ /**
126
+ * @param param
127
+ * @name 获取尺码类型,调用接口/lesoon-mdm-center-api/bmSizeType/findAll
128
+ * @returns
129
+ */
130
+ export declare const getSizeType: (params?: any) => Promise<any>;
131
+ /**
132
+ * @param param
133
+ * @name 获取性别,调用接口/lesoon-mdm-center-api/bmGender/findAll
134
+ * @returns
135
+ */
136
+ export declare const getGender: (params?: any) => Promise<any>;
137
+ /**
138
+ * @param param
139
+ * @name 获取年份,调用接口/lesoon-mdm-center-api/bmYear/findAll
140
+ * @returns
141
+ */
142
+ export declare const getYear: (params?: any) => Promise<any>;
143
+ /**
144
+ * @param param
145
+ * @name 获取季节,调用接口/lesoon-mdm-center-api/bmSeason/findAll
146
+ * @returns
147
+ */
148
+ export declare const getSeason: (params?: any) => Promise<any>;
149
+ /**
150
+ * @param param
151
+ * @name 获取品类,调用接口/lesoon-mdm-center-api/bmCategory/findAll
152
+ * @returns
153
+ */
154
+ export declare const getCategory: (params?: any) => Promise<any>;
155
+ declare const mdmMap: {
156
+ owner: (params?: any) => Promise<any>;
157
+ store: (params?: any) => Promise<any>;
158
+ brandDept: (params?: any) => Promise<any>;
159
+ logisticRegion: (params?: any) => Promise<any>;
160
+ expressCompany: (params?: any) => Promise<any>;
161
+ expressCompanyPage: (params?: any) => Promise<any>;
162
+ physicalStore: (params?: any) => Promise<any>;
163
+ settleCategory: (params?: any) => Promise<any>;
164
+ profitLossMain: (param?: any) => Promise<any>;
165
+ settleCompany: (params?: any) => Promise<any>;
166
+ powerUnit: (params?: any) => Promise<any>;
167
+ settleAccount: (params?: any) => Promise<any>;
168
+ logisticCategory: (params?: any) => Promise<any>;
169
+ managingCity: (params?: any) => Promise<any>;
170
+ area: (params?: AreaParams) => Promise<any>;
171
+ transportLocno: (params?: any) => Promise<any>;
172
+ transportPointPage: (params?: any) => Promise<any>;
173
+ uploadPointPage: (params?: any) => Promise<any>;
174
+ shopPage: (params?: any) => Promise<any>;
175
+ color: (params?: any) => Promise<any>;
176
+ sizeType: (params?: any) => Promise<any>;
177
+ gender: (params?: any) => Promise<any>;
178
+ year: (params?: any) => Promise<any>;
179
+ season: (params?: any) => Promise<any>;
180
+ category: (params?: any) => Promise<any>;
181
+ };
182
+ export declare type MdmType = keyof typeof mdmMap;
183
+ export declare const getMdmData: (type: MdmType, params?: any) => Promise<any>;
184
+ export {};