@fle-ui/plus-table 1.0.7 → 1.0.15

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 (42) hide show
  1. package/README.md +18 -18
  2. package/es/FormSearch/FormRender.d.ts +31 -0
  3. package/es/FormSearch/FormRender.js +2 -2
  4. package/es/FormSearch/index.d.ts +44 -0
  5. package/es/FormSearch/index.js +2 -2
  6. package/es/FormSearch/index.less +57 -57
  7. package/es/components/icon/index.d.ts +3 -0
  8. package/es/components/icon/index.js +7 -0
  9. package/es/index.d.ts +44 -0
  10. package/es/index.js +51 -46
  11. package/es/index.less +107 -107
  12. package/es/utils/api.d.ts +9 -0
  13. package/es/utils/common.d.ts +26 -0
  14. package/es/utils/common.js +2 -2
  15. package/es/utils/options.d.ts +25 -0
  16. package/es/utils/request.d.ts +26 -0
  17. package/es/utils/request.js +1 -1
  18. package/es/utils/serviceEnv.d.ts +6 -0
  19. package/es/utils/serviceEnv.js +12 -0
  20. package/lib/FormSearch/FormRender.d.ts +31 -0
  21. package/lib/FormSearch/FormRender.js +214 -0
  22. package/lib/FormSearch/index.d.ts +44 -0
  23. package/lib/FormSearch/index.js +194 -0
  24. package/lib/FormSearch/index.less +57 -57
  25. package/lib/components/icon/index.d.ts +3 -0
  26. package/lib/components/icon/index.js +13 -0
  27. package/lib/index.d.ts +44 -0
  28. package/lib/index.js +52 -48
  29. package/lib/index.less +107 -107
  30. package/lib/utils/api.d.ts +9 -0
  31. package/lib/utils/api.js +15 -0
  32. package/lib/utils/common.d.ts +26 -0
  33. package/lib/utils/common.js +38 -0
  34. package/lib/utils/options.d.ts +25 -0
  35. package/lib/utils/options.js +101 -0
  36. package/lib/utils/request.d.ts +26 -0
  37. package/lib/utils/request.js +180 -0
  38. package/lib/utils/serviceEnv.d.ts +6 -0
  39. package/lib/utils/serviceEnv.js +18 -0
  40. package/package.json +12 -15
  41. package/es/mock.js +0 -60
  42. package/lib/mock.js +0 -66
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.tabsSearchParamsMap = exports.tabs = exports.sortOptions = exports.profitRangeForPurchase = exports.profitRangeForOnce = exports.priceRangeForPurchase = exports.priceRangeForOnce = void 0;
7
+ var tabs = exports.tabs = [{
8
+ label: '京东商品',
9
+ key: 'jd'
10
+ }, {
11
+ label: '精选商品',
12
+ key: 'jx'
13
+ }, {
14
+ label: '自有商品',
15
+ key: 'zy'
16
+ }, {
17
+ label: '鲜花蛋糕',
18
+ key: 'xhdg'
19
+ }, {
20
+ label: '猫超商品',
21
+ key: 'mc'
22
+ }];
23
+ var tabsSearchParamsMap = exports.tabsSearchParamsMap = {
24
+ jd: {
25
+ thirdType: 10,
26
+ isSelf: 0
27
+ },
28
+ jx: {
29
+ thirdType: 0,
30
+ isSelf: 0
31
+ },
32
+ zy: {
33
+ isSelf: 1
34
+ },
35
+ xhdg: {
36
+ thirdType: 40,
37
+ isSelf: 0
38
+ },
39
+ mc: {
40
+ thirdType: 50,
41
+ isSelf: 0
42
+ }
43
+ };
44
+ // 一件代发价格筛选配置 - 非营销云
45
+ var priceRangeForOnce = exports.priceRangeForOnce = [{
46
+ label: '市场价',
47
+ value: 'onceMarketPrice'
48
+ }, {
49
+ label: '代发价',
50
+ value: 'onceSalePrice'
51
+ }, {
52
+ label: '销售价',
53
+ value: 'onceSitePrice'
54
+ }];
55
+ // 集采价格筛选配置 - 营销云
56
+ var priceRangeForPurchase = exports.priceRangeForPurchase = [{
57
+ label: '集采市场价',
58
+ value: 'purchaseMarketPrice'
59
+ }, {
60
+ label: '代发市场价',
61
+ value: 'onceMarketPrice'
62
+ }, {
63
+ label: '集采价',
64
+ value: 'purchaseSalePrice'
65
+ }, {
66
+ label: '代发价',
67
+ value: 'onceSalePrice'
68
+ }, {
69
+ label: '集采销售价',
70
+ value: 'purchaseSitePrice'
71
+ }, {
72
+ label: '代发销售价',
73
+ value: 'onceSitePrice'
74
+ }];
75
+ // 一件代发利润率筛选配置 - 非营销云
76
+ var profitRangeForOnce = exports.profitRangeForOnce = [{
77
+ label: '利润率',
78
+ value: 'onceSiteProfit'
79
+ }];
80
+ // 集采利润率筛选配置 - 营销云
81
+ var profitRangeForPurchase = exports.profitRangeForPurchase = [{
82
+ label: '集采利润率',
83
+ value: 'purchaseSiteProfit'
84
+ }, {
85
+ label: '代发利润率',
86
+ value: 'onceSiteProfit'
87
+ }];
88
+ // 排序规则
89
+ var sortOptions = exports.sortOptions = [{
90
+ label: '推荐',
91
+ value: 'pool_saas_search_site_profit_max' // 销售利润率(站点利润率)
92
+ }, {
93
+ label: '上架时间',
94
+ value: 'pool_saas_putaway_time'
95
+ }, {
96
+ label: '会员价',
97
+ value: 'search_sale_price_max'
98
+ }, {
99
+ label: '销售价',
100
+ value: 'pool_saas_search_site_price_max'
101
+ }];
@@ -0,0 +1,26 @@
1
+ import { AxiosRequestConfig } from 'axios';
2
+ interface RequestConfig extends AxiosRequestConfig {
3
+ notice?: boolean;
4
+ }
5
+ declare module 'axios' {
6
+ interface AxiosInstance {
7
+ (config: RequestConfig): Promise<any>;
8
+ }
9
+ }
10
+ interface AxiosConfig {
11
+ baseUrl?: string;
12
+ timeout?: number;
13
+ tokenKey?: string;
14
+ token?: string | undefined;
15
+ loginErrUrl?: string;
16
+ loginErrFn?: Function | undefined;
17
+ noNotificationCodes?: Array<string | number>;
18
+ errUrlFn?: Function | undefined;
19
+ formDataUrls?: Array<string>;
20
+ exceptionErrFn?: {
21
+ notification?: Function | undefined;
22
+ };
23
+ }
24
+ declare const Request: (configParams: AxiosConfig) => import("axios").AxiosInstance;
25
+ export declare const request: import("axios").AxiosInstance;
26
+ export default Request;
@@ -0,0 +1,180 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.request = exports.default = void 0;
7
+ var _jsCookie = _interopRequireDefault(require("js-cookie"));
8
+ var _axios = _interopRequireDefault(require("axios"));
9
+ var _antd = require("antd");
10
+ var _env = require("@fle-tools/env");
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
13
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
15
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
18
+ var DATA_CODE = new Map([['SUCCESS', '2000'], ['LOGIN_ERROR', '100003']]);
19
+ // 登录失效
20
+ var CancelToken = _axios.default.CancelToken;
21
+ var source = CancelToken.source();
22
+ var pending = [];
23
+ // 移除重复请求
24
+ var removePending = function removePending(config) {
25
+ for (var key in pending) {
26
+ var item = +key;
27
+ var list = pending[key];
28
+ // 当前请求在数组中存在时执行函数体
29
+ if (list.url === config.url && list.method === config.method && JSON.stringify(list.params) === JSON.stringify(config.params) && JSON.stringify(list.data) === JSON.stringify(config.data)) {
30
+ // 执行取消操作
31
+ list.cancel('操作太频繁,请稍后再试');
32
+ // 从数组中移除记录
33
+ pending.splice(item, 1);
34
+ }
35
+ }
36
+ };
37
+ // 默认配置
38
+ var initAxiosConfig = {
39
+ baseUrl: undefined,
40
+ timeout: 10000,
41
+ tokenKey: 'token',
42
+ token: undefined,
43
+ loginErrUrl: undefined,
44
+ loginErrFn: undefined,
45
+ noNotificationCodes: [],
46
+ errUrlFn: undefined,
47
+ formDataUrls: [] // 需要用formData提交的接口列表
48
+ };
49
+ var Request = function Request(configParams) {
50
+ configParams = _objectSpread(_objectSpread({}, initAxiosConfig), configParams);
51
+ // console.log(configParams, 'config')
52
+ var service = _axios.default.create({
53
+ baseURL: configParams.baseUrl,
54
+ timeout: configParams.timeout
55
+ });
56
+ service.interceptors.request.use(function (config) {
57
+ var _configParams$formDat;
58
+ removePending(config);
59
+ config.headers['authority_token'] = configParams.token || _jsCookie.default.get(configParams.tokenKey);
60
+ config.url = "".concat(config.url);
61
+ if ((_configParams$formDat = configParams.formDataUrls) === null || _configParams$formDat === void 0 ? void 0 : _configParams$formDat.includes(config.url)) {
62
+ config.headers['Content-Type'] = 'multipart/form-data';
63
+ config.headers['Accept'] = '*/*';
64
+ }
65
+ return _objectSpread(_objectSpread({}, config), {}, {
66
+ cancelToken: source.token
67
+ });
68
+ }, function (err) {
69
+ var _configParams$excepti;
70
+ if ((_configParams$excepti = configParams.exceptionErrFn) === null || _configParams$excepti === void 0 ? void 0 : _configParams$excepti.notification) {
71
+ var _configParams$excepti2;
72
+ (_configParams$excepti2 = configParams.exceptionErrFn) === null || _configParams$excepti2 === void 0 ? void 0 : _configParams$excepti2.notification('提示', err.toString());
73
+ } else {
74
+ _antd.notification.error({
75
+ message: '提示',
76
+ description: err.toString()
77
+ });
78
+ }
79
+ return Promise.reject(_objectSpread(_objectSpread({}, err), {}, {
80
+ data: null
81
+ }));
82
+ });
83
+ service.interceptors.response.use(function (res) {
84
+ var status = res.status,
85
+ data = res.data,
86
+ statusText = res.statusText,
87
+ config = res.config;
88
+ removePending(config);
89
+ return new Promise(function (resolve, reject) {
90
+ if (status < 200 || status > 300) {
91
+ var _configParams$excepti3;
92
+ if ((_configParams$excepti3 = configParams.exceptionErrFn) === null || _configParams$excepti3 === void 0 ? void 0 : _configParams$excepti3.notification) {
93
+ var _configParams$excepti4;
94
+ (_configParams$excepti4 = configParams.exceptionErrFn) === null || _configParams$excepti4 === void 0 ? void 0 : _configParams$excepti4.notification("\u8BF7\u6C42\u9519\u8BEF: ".concat(status), statusText);
95
+ } else {
96
+ _antd.notification.error({
97
+ message: "\u8BF7\u6C42\u9519\u8BEF: ".concat(status),
98
+ description: statusText
99
+ });
100
+ }
101
+ reject(data);
102
+ } else if (!data.success) {
103
+ if (data.code === DATA_CODE.get('LOGIN_ERROR')) {
104
+ // 登录失效后,取消后续的http请求
105
+ source.cancel('登录失效');
106
+ if (configParams.loginErrFn) {
107
+ configParams.loginErrFn();
108
+ } else if (configParams.loginErrUrl) {
109
+ _antd.Modal.warning({
110
+ title: '登录失效',
111
+ content: '点击确定重新登录',
112
+ okText: '确定',
113
+ onOk: function onOk() {
114
+ var _getAppInfo;
115
+ window.location.href = configParams.loginErrUrl || ((_getAppInfo = (0, _env.getAppInfo)()) === null || _getAppInfo === void 0 ? void 0 : _getAppInfo.__fle_loginErrUrl__);
116
+ }
117
+ });
118
+ }
119
+ } else {
120
+ var _configParams$noNotif;
121
+ if (!((_configParams$noNotif = configParams.noNotificationCodes) === null || _configParams$noNotif === void 0 ? void 0 : _configParams$noNotif.includes(data.code))) {
122
+ var _configParams$excepti5;
123
+ if ((_configParams$excepti5 = configParams.exceptionErrFn) === null || _configParams$excepti5 === void 0 ? void 0 : _configParams$excepti5.notification) {
124
+ var _configParams$excepti6;
125
+ (_configParams$excepti6 = configParams.exceptionErrFn) === null || _configParams$excepti6 === void 0 ? void 0 : _configParams$excepti6.notification('提示', data.message);
126
+ } else {
127
+ _antd.notification.error({
128
+ message: '提示',
129
+ description: data.message
130
+ });
131
+ }
132
+ }
133
+ }
134
+ reject(data);
135
+ } else {
136
+ resolve(data);
137
+ }
138
+ });
139
+ }, function (err) {
140
+ var _err$message;
141
+ if (err.message === 'Request failed with status code 404') {
142
+ if (configParams.errUrlFn) {
143
+ configParams.errUrlFn();
144
+ return;
145
+ }
146
+ }
147
+ if (err.message === '登录失效') {
148
+ return;
149
+ }
150
+ if ((_err$message = err.message) === null || _err$message === void 0 ? void 0 : _err$message.includes('timeout')) {
151
+ var _configParams$excepti7;
152
+ if ((_configParams$excepti7 = configParams.exceptionErrFn) === null || _configParams$excepti7 === void 0 ? void 0 : _configParams$excepti7.notification) {
153
+ var _configParams$excepti8;
154
+ (_configParams$excepti8 = configParams.exceptionErrFn) === null || _configParams$excepti8 === void 0 ? void 0 : _configParams$excepti8.notification('提示', '请求超时~');
155
+ } else {
156
+ _antd.notification.error({
157
+ message: '提示',
158
+ description: '请求超时~'
159
+ });
160
+ }
161
+ } else {
162
+ var _configParams$excepti9;
163
+ if ((_configParams$excepti9 = configParams.exceptionErrFn) === null || _configParams$excepti9 === void 0 ? void 0 : _configParams$excepti9.notification) {
164
+ var _configParams$excepti10;
165
+ (_configParams$excepti10 = configParams.exceptionErrFn) === null || _configParams$excepti10 === void 0 ? void 0 : _configParams$excepti10.notification('提示', err.toString());
166
+ } else {
167
+ _antd.notification.error({
168
+ message: '提示',
169
+ description: err.toString()
170
+ });
171
+ }
172
+ }
173
+ return Promise.reject(err);
174
+ });
175
+ return service;
176
+ };
177
+ var request = exports.request = Request({
178
+ baseUrl: (0, _env.getAePrefix)()
179
+ });
180
+ var _default = exports.default = Request;
@@ -0,0 +1,6 @@
1
+ export type EnvType = 'dev' | 'test' | 'qa' | 'prod';
2
+ export declare const baseURLMap: {
3
+ [key in EnvType]: string;
4
+ };
5
+ export declare const getApiHost: (env: EnvType) => string;
6
+ export declare const getApiUrl: (env: EnvType, url: string) => string;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getApiUrl = exports.getApiHost = exports.baseURLMap = void 0;
7
+ var baseURLMap = exports.baseURLMap = {
8
+ dev: 'https://dev-gateway.fxqifu.net/pangu',
9
+ test: 'https://qa-gateway.fxqifu.net/pangu',
10
+ qa: 'https://qa-gateway.fxqifu.net/pangu',
11
+ prod: 'https://gateway.fxqifu.net/pangu'
12
+ };
13
+ var getApiHost = exports.getApiHost = function getApiHost(env) {
14
+ return baseURLMap[env];
15
+ };
16
+ var getApiUrl = exports.getApiUrl = function getApiUrl(env, url) {
17
+ return baseURLMap[env] + url;
18
+ };
package/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "@fle-ui/plus-table",
3
- "version": "1.0.7",
4
- "private": false,
3
+ "version": "1.0.15",
5
4
  "description": "@fle-ui/plus-table",
6
5
  "keywords": [
7
6
  "fle-ui",
@@ -17,7 +16,7 @@
17
16
  },
18
17
  "repository": {
19
18
  "type": "git",
20
- "url": "git+https://github.com/ant-design/pro-components.git"
19
+ "url": "https://github.com/ant-design/pro-components"
21
20
  },
22
21
  "main": "lib/index.js",
23
22
  "module": "es/index.js",
@@ -27,27 +26,25 @@
27
26
  "es",
28
27
  "dist"
29
28
  ],
30
- "dependencies": {
31
- "@ant-design/icons": "^4.8.0"
32
- },
33
- "peerDependencies": {
34
- "antd": ">=4.23.0 || >=5.0.0",
35
- "react": ">=17.0.0"
36
- },
37
29
  "browserslist": [
38
30
  "last 2 versions",
39
31
  "Firefox ESR",
40
32
  "> 1%",
41
33
  "ie >= 11"
42
34
  ],
43
- "authors": [],
35
+ "peerDependencies": {
36
+ "@ant-design/pro-components": "^2.6.51",
37
+ "antd": ">=5.13.0",
38
+ "react": ">=17.0.0"
39
+ },
44
40
  "license": "MIT",
45
41
  "publishConfig": {
46
42
  "access": "public"
47
43
  },
48
- "scripts": {
49
- "test": "echo \"Error: no test specified\" && exit 1"
50
- },
51
44
  "author": "",
52
- "gitHead": "5e46a6849a7404cc72a30145d6560c56e1e550c2"
45
+ "dependencies": {
46
+ "@ant-design/pro-components": "^2.7.0",
47
+ "dayjs": "^1.11.10"
48
+ },
49
+ "gitHead": "ceed5aee479a4c01f421ea188635efa2dcbccb29"
53
50
  }
package/es/mock.js DELETED
@@ -1,60 +0,0 @@
1
- export var data = {
2
- admissionNo: {
3
- show: true
4
- },
5
- supplierName: {
6
- show: true
7
- },
8
- supplierShortName: {
9
- show: true
10
- },
11
- approveState: {
12
- show: true
13
- },
14
- supplierCategoryName: {
15
- show: true
16
- },
17
- supplierGradeName: {
18
- show: true
19
- },
20
- tags: {
21
- show: true
22
- },
23
- developmentPlanNo: {
24
- show: true
25
- },
26
- documentLink: {
27
- show: true
28
- },
29
- cooperateModeName: {
30
- show: true
31
- },
32
- settlementMode: {
33
- show: true
34
- },
35
- taxNumber: {
36
- show: true
37
- },
38
- principalName: {
39
- show: true
40
- },
41
- principalMobile: {
42
- show: true
43
- },
44
- purchasePrincipalName: {
45
- show: true
46
- },
47
- address: {
48
- show: true
49
- },
50
- createTime: {
51
- show: true
52
- },
53
- remark: {
54
- show: true
55
- },
56
- createUserName: {
57
- show: true,
58
- fixed: 'right'
59
- }
60
- };
package/lib/mock.js DELETED
@@ -1,66 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.data = void 0;
7
- var data = exports.data = {
8
- admissionNo: {
9
- show: true
10
- },
11
- supplierName: {
12
- show: true
13
- },
14
- supplierShortName: {
15
- show: true
16
- },
17
- approveState: {
18
- show: true
19
- },
20
- supplierCategoryName: {
21
- show: true
22
- },
23
- supplierGradeName: {
24
- show: true
25
- },
26
- tags: {
27
- show: true
28
- },
29
- developmentPlanNo: {
30
- show: true
31
- },
32
- documentLink: {
33
- show: true
34
- },
35
- cooperateModeName: {
36
- show: true
37
- },
38
- settlementMode: {
39
- show: true
40
- },
41
- taxNumber: {
42
- show: true
43
- },
44
- principalName: {
45
- show: true
46
- },
47
- principalMobile: {
48
- show: true
49
- },
50
- purchasePrincipalName: {
51
- show: true
52
- },
53
- address: {
54
- show: true
55
- },
56
- createTime: {
57
- show: true
58
- },
59
- remark: {
60
- show: true
61
- },
62
- createUserName: {
63
- show: true,
64
- fixed: 'right'
65
- }
66
- };