@fle-ui/plus-table 1.2.21-beta.0 → 1.2.22-beta.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.
- package/README.md +18 -18
- package/package.json +2 -2
- package/es/FormSearch/FormRender.d.ts +0 -31
- package/es/FormSearch/FormRender.js +0 -208
- package/es/FormSearch/index.d.ts +0 -44
- package/es/FormSearch/index.js +0 -186
- package/es/FormSearch/index.less +0 -59
- package/es/components/icon/index.d.ts +0 -3
- package/es/components/icon/index.js +0 -7
- package/es/index.d.ts +0 -80
- package/es/index.js +0 -527
- package/es/index.less +0 -107
- package/es/utils/api.d.ts +0 -9
- package/es/utils/api.js +0 -9
- package/es/utils/common.d.ts +0 -27
- package/es/utils/common.js +0 -36
- package/es/utils/options.d.ts +0 -25
- package/es/utils/options.js +0 -95
- package/es/utils/request.d.ts +0 -26
- package/es/utils/request.js +0 -176
- package/es/utils/serviceEnv.d.ts +0 -6
- package/es/utils/serviceEnv.js +0 -12
- package/lib/FormSearch/FormRender.d.ts +0 -31
- package/lib/FormSearch/FormRender.js +0 -214
- package/lib/FormSearch/index.d.ts +0 -44
- package/lib/FormSearch/index.js +0 -193
- package/lib/FormSearch/index.less +0 -59
- package/lib/components/icon/index.d.ts +0 -3
- package/lib/components/icon/index.js +0 -13
- package/lib/index.d.ts +0 -80
- package/lib/index.js +0 -527
- package/lib/index.less +0 -107
- package/lib/utils/api.d.ts +0 -9
- package/lib/utils/api.js +0 -15
- package/lib/utils/common.d.ts +0 -27
- package/lib/utils/common.js +0 -44
- package/lib/utils/options.d.ts +0 -25
- package/lib/utils/options.js +0 -101
- package/lib/utils/request.d.ts +0 -26
- package/lib/utils/request.js +0 -180
- package/lib/utils/serviceEnv.d.ts +0 -6
- package/lib/utils/serviceEnv.js +0 -18
package/es/index.less
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
@primar-color: #2c68ff;
|
|
2
|
-
|
|
3
|
-
.choose-site-goods-modal {
|
|
4
|
-
.ww-search {
|
|
5
|
-
background-color: #fafafa;
|
|
6
|
-
padding: 20px;
|
|
7
|
-
.ww-search-flex {
|
|
8
|
-
width: 100%;
|
|
9
|
-
display: flex;
|
|
10
|
-
align-items: center;
|
|
11
|
-
overflow: hidden;
|
|
12
|
-
.ww-search-range-input {
|
|
13
|
-
flex: 1;
|
|
14
|
-
display: flex;
|
|
15
|
-
align-items: center;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
.main-search {
|
|
20
|
-
display: flex;
|
|
21
|
-
justify-content: center;
|
|
22
|
-
margin-bottom: 16px;
|
|
23
|
-
position: relative;
|
|
24
|
-
.choose-more-btn {
|
|
25
|
-
position: absolute;
|
|
26
|
-
right: 0px;
|
|
27
|
-
top: 0px;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
.search-2 {
|
|
31
|
-
.sort-item {
|
|
32
|
-
display: flex;
|
|
33
|
-
align-items: center;
|
|
34
|
-
.sort-item-label {
|
|
35
|
-
font-size: 12px;
|
|
36
|
-
}
|
|
37
|
-
.sort-item-icon {
|
|
38
|
-
font-size: 10px;
|
|
39
|
-
margin-left: 4px;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
.ant-radio-button-wrapper {
|
|
43
|
-
padding: 0 10px !important;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
.table-goods-wrap {
|
|
47
|
-
display: flex;
|
|
48
|
-
|
|
49
|
-
.table-goods-img-wrap {
|
|
50
|
-
width: 60px;
|
|
51
|
-
height: 60px;
|
|
52
|
-
background: #ffffff;
|
|
53
|
-
border-radius: 1px;
|
|
54
|
-
border: 1px solid #cccccc;
|
|
55
|
-
box-sizing: border-box;
|
|
56
|
-
display: flex;
|
|
57
|
-
align-items: center;
|
|
58
|
-
overflow: hidden;
|
|
59
|
-
.pro-image {
|
|
60
|
-
width: 100%;
|
|
61
|
-
height: 100%;
|
|
62
|
-
object-fit: cover;
|
|
63
|
-
.ant-image {
|
|
64
|
-
width: 100%;
|
|
65
|
-
height: 100%;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.table-goods-content {
|
|
71
|
-
margin-left: 10px;
|
|
72
|
-
flex: 1;
|
|
73
|
-
|
|
74
|
-
.table-goods-content-title {
|
|
75
|
-
height: 34px;
|
|
76
|
-
font-size: 12px;
|
|
77
|
-
font-weight: 500;
|
|
78
|
-
color: #666666;
|
|
79
|
-
line-height: 17px;
|
|
80
|
-
text-overflow: -o-ellipsis-lastline;
|
|
81
|
-
overflow: hidden;
|
|
82
|
-
text-overflow: ellipsis;
|
|
83
|
-
display: -webkit-box;
|
|
84
|
-
-webkit-line-clamp: 2;
|
|
85
|
-
line-clamp: 2;
|
|
86
|
-
-webkit-box-orient: vertical;
|
|
87
|
-
text-align: left;
|
|
88
|
-
// color: @primary-color;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.table-goods-content-sub-title {
|
|
92
|
-
text-align: left;
|
|
93
|
-
height: 17px;
|
|
94
|
-
font-size: 12px;
|
|
95
|
-
font-weight: 400;
|
|
96
|
-
color: #666666;
|
|
97
|
-
overflow: hidden;
|
|
98
|
-
text-overflow: ellipsis;
|
|
99
|
-
white-space: nowrap;
|
|
100
|
-
margin-top: 9px;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
.ml-3 {
|
|
105
|
-
margin-left: 3px;
|
|
106
|
-
}
|
|
107
|
-
}
|
package/es/utils/api.d.ts
DELETED
package/es/utils/api.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
// getGoodsList: '/fleshopy/merchant/site/site-goods/pageList', // 查询站点商品
|
|
3
|
-
getJDGoodsStock: '/fleshopy/stock/getStockBatch',
|
|
4
|
-
getCategoryAllList: '/fleshopy/category/getTreeList',
|
|
5
|
-
getSelfGoodsFlag: '/fleshopy/goods/flag/allList',
|
|
6
|
-
getSelfGoodsFlagCategory: '/elebuys/goodsCategory/tree',
|
|
7
|
-
getDgssCityAllList: '/supplier/dgss/city/allList',
|
|
8
|
-
getGoodsList: '/bestgift/goods/goods/search/getMemberGoodsList'
|
|
9
|
-
};
|
package/es/utils/common.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 金额格式化
|
|
3
|
-
* @param data
|
|
4
|
-
*/
|
|
5
|
-
type moneyType = number | string;
|
|
6
|
-
interface ShowMoneyType {
|
|
7
|
-
(data: moneyType): string;
|
|
8
|
-
}
|
|
9
|
-
export declare const showMoney: ShowMoneyType;
|
|
10
|
-
/**
|
|
11
|
-
* 时间格式化
|
|
12
|
-
* @param data
|
|
13
|
-
* @param fmtType
|
|
14
|
-
*/
|
|
15
|
-
type timeType = Date | number | string;
|
|
16
|
-
interface ShowTimeType {
|
|
17
|
-
(data: timeType, fmtType: string): string;
|
|
18
|
-
}
|
|
19
|
-
export declare const showTime: ShowTimeType;
|
|
20
|
-
/**
|
|
21
|
-
* 格式化url参数
|
|
22
|
-
*/
|
|
23
|
-
export declare const parseQueryString: () => {
|
|
24
|
-
[key: string]: string;
|
|
25
|
-
};
|
|
26
|
-
export declare function simulateClick(): void;
|
|
27
|
-
export {};
|
package/es/utils/common.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
2
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
3
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
4
|
-
import dayjs from 'dayjs';
|
|
5
|
-
export var showMoney = function showMoney(data) {
|
|
6
|
-
return (+data / 100).toFixed(2);
|
|
7
|
-
};
|
|
8
|
-
export var showTime = function showTime(data) {
|
|
9
|
-
var fmtType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'YYYY-MM-DD HH:mm:ss';
|
|
10
|
-
return data ? dayjs(data).format(fmtType) : '';
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* 格式化url参数
|
|
14
|
-
*/
|
|
15
|
-
export var parseQueryString = function parseQueryString() {
|
|
16
|
-
var urlParams = new URLSearchParams(window.location.search);
|
|
17
|
-
var params = {};
|
|
18
|
-
var _iterator = _createForOfIteratorHelper(urlParams),
|
|
19
|
-
_step;
|
|
20
|
-
try {
|
|
21
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
22
|
-
var param = _step.value;
|
|
23
|
-
params[param[0]] = param[1];
|
|
24
|
-
}
|
|
25
|
-
} catch (err) {
|
|
26
|
-
_iterator.e(err);
|
|
27
|
-
} finally {
|
|
28
|
-
_iterator.f();
|
|
29
|
-
}
|
|
30
|
-
return params;
|
|
31
|
-
};
|
|
32
|
-
export function simulateClick() {
|
|
33
|
-
var element = document.elementFromPoint(0, 0);
|
|
34
|
-
var mouseEvent = new MouseEvent('mousedown');
|
|
35
|
-
element === null || element === void 0 ? void 0 : element.dispatchEvent(mouseEvent);
|
|
36
|
-
}
|
package/es/utils/options.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare const tabs: {
|
|
2
|
-
label: string;
|
|
3
|
-
key: string;
|
|
4
|
-
}[];
|
|
5
|
-
export declare const tabsSearchParamsMap: any;
|
|
6
|
-
export declare const priceRangeForOnce: {
|
|
7
|
-
label: string;
|
|
8
|
-
value: string;
|
|
9
|
-
}[];
|
|
10
|
-
export declare const priceRangeForPurchase: {
|
|
11
|
-
label: string;
|
|
12
|
-
value: string;
|
|
13
|
-
}[];
|
|
14
|
-
export declare const profitRangeForOnce: {
|
|
15
|
-
label: string;
|
|
16
|
-
value: string;
|
|
17
|
-
}[];
|
|
18
|
-
export declare const profitRangeForPurchase: {
|
|
19
|
-
label: string;
|
|
20
|
-
value: string;
|
|
21
|
-
}[];
|
|
22
|
-
export declare const sortOptions: {
|
|
23
|
-
label: string;
|
|
24
|
-
value: string;
|
|
25
|
-
}[];
|
package/es/utils/options.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
export var tabs = [{
|
|
2
|
-
label: '京东商品',
|
|
3
|
-
key: 'jd'
|
|
4
|
-
}, {
|
|
5
|
-
label: '精选商品',
|
|
6
|
-
key: 'jx'
|
|
7
|
-
}, {
|
|
8
|
-
label: '自有商品',
|
|
9
|
-
key: 'zy'
|
|
10
|
-
}, {
|
|
11
|
-
label: '鲜花蛋糕',
|
|
12
|
-
key: 'xhdg'
|
|
13
|
-
}, {
|
|
14
|
-
label: '猫超商品',
|
|
15
|
-
key: 'mc'
|
|
16
|
-
}];
|
|
17
|
-
export var tabsSearchParamsMap = {
|
|
18
|
-
jd: {
|
|
19
|
-
thirdType: 10,
|
|
20
|
-
isSelf: 0
|
|
21
|
-
},
|
|
22
|
-
jx: {
|
|
23
|
-
thirdType: 0,
|
|
24
|
-
isSelf: 0
|
|
25
|
-
},
|
|
26
|
-
zy: {
|
|
27
|
-
isSelf: 1
|
|
28
|
-
},
|
|
29
|
-
xhdg: {
|
|
30
|
-
thirdType: 40,
|
|
31
|
-
isSelf: 0
|
|
32
|
-
},
|
|
33
|
-
mc: {
|
|
34
|
-
thirdType: 50,
|
|
35
|
-
isSelf: 0
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
// 一件代发价格筛选配置 - 非营销云
|
|
39
|
-
export var priceRangeForOnce = [{
|
|
40
|
-
label: '市场价',
|
|
41
|
-
value: 'onceMarketPrice'
|
|
42
|
-
}, {
|
|
43
|
-
label: '代发价',
|
|
44
|
-
value: 'onceSalePrice'
|
|
45
|
-
}, {
|
|
46
|
-
label: '销售价',
|
|
47
|
-
value: 'onceSitePrice'
|
|
48
|
-
}];
|
|
49
|
-
// 集采价格筛选配置 - 营销云
|
|
50
|
-
export var priceRangeForPurchase = [{
|
|
51
|
-
label: '集采市场价',
|
|
52
|
-
value: 'purchaseMarketPrice'
|
|
53
|
-
}, {
|
|
54
|
-
label: '代发市场价',
|
|
55
|
-
value: 'onceMarketPrice'
|
|
56
|
-
}, {
|
|
57
|
-
label: '集采价',
|
|
58
|
-
value: 'purchaseSalePrice'
|
|
59
|
-
}, {
|
|
60
|
-
label: '代发价',
|
|
61
|
-
value: 'onceSalePrice'
|
|
62
|
-
}, {
|
|
63
|
-
label: '集采销售价',
|
|
64
|
-
value: 'purchaseSitePrice'
|
|
65
|
-
}, {
|
|
66
|
-
label: '代发销售价',
|
|
67
|
-
value: 'onceSitePrice'
|
|
68
|
-
}];
|
|
69
|
-
// 一件代发利润率筛选配置 - 非营销云
|
|
70
|
-
export var profitRangeForOnce = [{
|
|
71
|
-
label: '利润率',
|
|
72
|
-
value: 'onceSiteProfit'
|
|
73
|
-
}];
|
|
74
|
-
// 集采利润率筛选配置 - 营销云
|
|
75
|
-
export var profitRangeForPurchase = [{
|
|
76
|
-
label: '集采利润率',
|
|
77
|
-
value: 'purchaseSiteProfit'
|
|
78
|
-
}, {
|
|
79
|
-
label: '代发利润率',
|
|
80
|
-
value: 'onceSiteProfit'
|
|
81
|
-
}];
|
|
82
|
-
// 排序规则
|
|
83
|
-
export var sortOptions = [{
|
|
84
|
-
label: '推荐',
|
|
85
|
-
value: 'pool_saas_search_site_profit_max' // 销售利润率(站点利润率)
|
|
86
|
-
}, {
|
|
87
|
-
label: '上架时间',
|
|
88
|
-
value: 'pool_saas_putaway_time'
|
|
89
|
-
}, {
|
|
90
|
-
label: '会员价',
|
|
91
|
-
value: 'search_sale_price_max'
|
|
92
|
-
}, {
|
|
93
|
-
label: '销售价',
|
|
94
|
-
value: 'pool_saas_search_site_price_max'
|
|
95
|
-
}];
|
package/es/utils/request.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
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;
|
package/es/utils/request.js
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import "antd/es/modal/style";
|
|
2
|
-
import _Modal from "antd/es/modal";
|
|
3
|
-
import "antd/es/notification/style";
|
|
4
|
-
import _notification from "antd/es/notification";
|
|
5
|
-
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); }
|
|
6
|
-
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; }
|
|
7
|
-
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; }
|
|
8
|
-
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; }
|
|
9
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
10
|
-
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); }
|
|
11
|
-
import Cookies from 'js-cookie';
|
|
12
|
-
import axios from 'axios';
|
|
13
|
-
import { getAePrefix, getAppInfo } from '@fle-tools/env';
|
|
14
|
-
var DATA_CODE = new Map([['SUCCESS', '2000'], ['LOGIN_ERROR', '100003']]);
|
|
15
|
-
// 登录失效
|
|
16
|
-
var CancelToken = axios.CancelToken;
|
|
17
|
-
var source = CancelToken.source();
|
|
18
|
-
var pending = [];
|
|
19
|
-
// 移除重复请求
|
|
20
|
-
var removePending = function removePending(config) {
|
|
21
|
-
for (var key in pending) {
|
|
22
|
-
var item = +key;
|
|
23
|
-
var list = pending[key];
|
|
24
|
-
// 当前请求在数组中存在时执行函数体
|
|
25
|
-
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)) {
|
|
26
|
-
// 执行取消操作
|
|
27
|
-
list.cancel('操作太频繁,请稍后再试');
|
|
28
|
-
// 从数组中移除记录
|
|
29
|
-
pending.splice(item, 1);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
// 默认配置
|
|
34
|
-
var initAxiosConfig = {
|
|
35
|
-
baseUrl: undefined,
|
|
36
|
-
timeout: 10000,
|
|
37
|
-
tokenKey: 'token',
|
|
38
|
-
token: undefined,
|
|
39
|
-
loginErrUrl: undefined,
|
|
40
|
-
loginErrFn: undefined,
|
|
41
|
-
noNotificationCodes: [],
|
|
42
|
-
errUrlFn: undefined,
|
|
43
|
-
formDataUrls: [] // 需要用formData提交的接口列表
|
|
44
|
-
};
|
|
45
|
-
var Request = function Request(configParams) {
|
|
46
|
-
configParams = _objectSpread(_objectSpread({}, initAxiosConfig), configParams);
|
|
47
|
-
// console.log(configParams, 'config')
|
|
48
|
-
var service = axios.create({
|
|
49
|
-
baseURL: configParams.baseUrl,
|
|
50
|
-
timeout: configParams.timeout
|
|
51
|
-
});
|
|
52
|
-
service.interceptors.request.use(function (config) {
|
|
53
|
-
var _configParams$formDat;
|
|
54
|
-
removePending(config);
|
|
55
|
-
config.headers['authority_token'] = configParams.token || Cookies.get(configParams.tokenKey);
|
|
56
|
-
config.url = "".concat(config.url);
|
|
57
|
-
if ((_configParams$formDat = configParams.formDataUrls) === null || _configParams$formDat === void 0 ? void 0 : _configParams$formDat.includes(config.url)) {
|
|
58
|
-
config.headers['Content-Type'] = 'multipart/form-data';
|
|
59
|
-
config.headers['Accept'] = '*/*';
|
|
60
|
-
}
|
|
61
|
-
return _objectSpread(_objectSpread({}, config), {}, {
|
|
62
|
-
cancelToken: source.token
|
|
63
|
-
});
|
|
64
|
-
}, function (err) {
|
|
65
|
-
var _configParams$excepti;
|
|
66
|
-
if ((_configParams$excepti = configParams.exceptionErrFn) === null || _configParams$excepti === void 0 ? void 0 : _configParams$excepti.notification) {
|
|
67
|
-
var _configParams$excepti2;
|
|
68
|
-
(_configParams$excepti2 = configParams.exceptionErrFn) === null || _configParams$excepti2 === void 0 ? void 0 : _configParams$excepti2.notification('提示', err.toString());
|
|
69
|
-
} else {
|
|
70
|
-
_notification.error({
|
|
71
|
-
message: '提示',
|
|
72
|
-
description: err.toString()
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
return Promise.reject(_objectSpread(_objectSpread({}, err), {}, {
|
|
76
|
-
data: null
|
|
77
|
-
}));
|
|
78
|
-
});
|
|
79
|
-
service.interceptors.response.use(function (res) {
|
|
80
|
-
var status = res.status,
|
|
81
|
-
data = res.data,
|
|
82
|
-
statusText = res.statusText,
|
|
83
|
-
config = res.config;
|
|
84
|
-
removePending(config);
|
|
85
|
-
return new Promise(function (resolve, reject) {
|
|
86
|
-
if (status < 200 || status > 300) {
|
|
87
|
-
var _configParams$excepti3;
|
|
88
|
-
if ((_configParams$excepti3 = configParams.exceptionErrFn) === null || _configParams$excepti3 === void 0 ? void 0 : _configParams$excepti3.notification) {
|
|
89
|
-
var _configParams$excepti4;
|
|
90
|
-
(_configParams$excepti4 = configParams.exceptionErrFn) === null || _configParams$excepti4 === void 0 ? void 0 : _configParams$excepti4.notification("\u8BF7\u6C42\u9519\u8BEF: ".concat(status), statusText);
|
|
91
|
-
} else {
|
|
92
|
-
_notification.error({
|
|
93
|
-
message: "\u8BF7\u6C42\u9519\u8BEF: ".concat(status),
|
|
94
|
-
description: statusText
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
reject(data);
|
|
98
|
-
} else if (!data.success) {
|
|
99
|
-
if (data.code === DATA_CODE.get('LOGIN_ERROR')) {
|
|
100
|
-
// 登录失效后,取消后续的http请求
|
|
101
|
-
source.cancel('登录失效');
|
|
102
|
-
if (configParams.loginErrFn) {
|
|
103
|
-
configParams.loginErrFn();
|
|
104
|
-
} else if (configParams.loginErrUrl) {
|
|
105
|
-
_Modal.warning({
|
|
106
|
-
title: '登录失效',
|
|
107
|
-
content: '点击确定重新登录',
|
|
108
|
-
okText: '确定',
|
|
109
|
-
onOk: function onOk() {
|
|
110
|
-
var _getAppInfo;
|
|
111
|
-
window.location.href = configParams.loginErrUrl || ((_getAppInfo = getAppInfo()) === null || _getAppInfo === void 0 ? void 0 : _getAppInfo.__fle_loginErrUrl__);
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
} else {
|
|
116
|
-
var _configParams$noNotif;
|
|
117
|
-
if (!((_configParams$noNotif = configParams.noNotificationCodes) === null || _configParams$noNotif === void 0 ? void 0 : _configParams$noNotif.includes(data.code))) {
|
|
118
|
-
var _configParams$excepti5;
|
|
119
|
-
if ((_configParams$excepti5 = configParams.exceptionErrFn) === null || _configParams$excepti5 === void 0 ? void 0 : _configParams$excepti5.notification) {
|
|
120
|
-
var _configParams$excepti6;
|
|
121
|
-
(_configParams$excepti6 = configParams.exceptionErrFn) === null || _configParams$excepti6 === void 0 ? void 0 : _configParams$excepti6.notification('提示', data.message);
|
|
122
|
-
} else {
|
|
123
|
-
_notification.error({
|
|
124
|
-
message: '提示',
|
|
125
|
-
description: data.message
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
reject(data);
|
|
131
|
-
} else {
|
|
132
|
-
resolve(data);
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
}, function (err) {
|
|
136
|
-
var _err$message;
|
|
137
|
-
if (err.message === 'Request failed with status code 404') {
|
|
138
|
-
if (configParams.errUrlFn) {
|
|
139
|
-
configParams.errUrlFn();
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
if (err.message === '登录失效') {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
if ((_err$message = err.message) === null || _err$message === void 0 ? void 0 : _err$message.includes('timeout')) {
|
|
147
|
-
var _configParams$excepti7;
|
|
148
|
-
if ((_configParams$excepti7 = configParams.exceptionErrFn) === null || _configParams$excepti7 === void 0 ? void 0 : _configParams$excepti7.notification) {
|
|
149
|
-
var _configParams$excepti8;
|
|
150
|
-
(_configParams$excepti8 = configParams.exceptionErrFn) === null || _configParams$excepti8 === void 0 ? void 0 : _configParams$excepti8.notification('提示', '请求超时~');
|
|
151
|
-
} else {
|
|
152
|
-
_notification.error({
|
|
153
|
-
message: '提示',
|
|
154
|
-
description: '请求超时~'
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
} else {
|
|
158
|
-
var _configParams$excepti9;
|
|
159
|
-
if ((_configParams$excepti9 = configParams.exceptionErrFn) === null || _configParams$excepti9 === void 0 ? void 0 : _configParams$excepti9.notification) {
|
|
160
|
-
var _configParams$excepti10;
|
|
161
|
-
(_configParams$excepti10 = configParams.exceptionErrFn) === null || _configParams$excepti10 === void 0 ? void 0 : _configParams$excepti10.notification('提示', err.toString());
|
|
162
|
-
} else {
|
|
163
|
-
_notification.error({
|
|
164
|
-
message: '提示',
|
|
165
|
-
description: err.toString()
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
return Promise.reject(err);
|
|
170
|
-
});
|
|
171
|
-
return service;
|
|
172
|
-
};
|
|
173
|
-
export var request = Request({
|
|
174
|
-
baseUrl: getAePrefix()
|
|
175
|
-
});
|
|
176
|
-
export default Request;
|
package/es/utils/serviceEnv.d.ts
DELETED
package/es/utils/serviceEnv.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export var baseURLMap = {
|
|
2
|
-
dev: 'https://dev-gateway.fxqifu.net/pangu',
|
|
3
|
-
test: 'https://qa-gateway.fxqifu.net/pangu',
|
|
4
|
-
qa: 'https://qa-gateway.fxqifu.net/pangu',
|
|
5
|
-
prod: 'https://gateway.fxqifu.net/pangu'
|
|
6
|
-
};
|
|
7
|
-
export var getApiHost = function getApiHost(env) {
|
|
8
|
-
return baseURLMap[env];
|
|
9
|
-
};
|
|
10
|
-
export var getApiUrl = function getApiUrl(env, url) {
|
|
11
|
-
return baseURLMap[env] + url;
|
|
12
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { BaseQueryFilterProps, ProFormInstance, ProFormProps } from '@ant-design/pro-form';
|
|
2
|
-
import type { ProSchemaComponentTypes } from '@ant-design/pro-utils';
|
|
3
|
-
import type { FormItemProps } from 'antd';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import type { ActionType, ProColumns, ProTableProps } from '@ant-design/pro-components';
|
|
6
|
-
export type SearchConfig = BaseQueryFilterProps & {
|
|
7
|
-
filterType?: 'query' | 'light';
|
|
8
|
-
};
|
|
9
|
-
export type TableFormItem<T, U = any> = {
|
|
10
|
-
onSubmit?: (value: T, firstLoad: boolean) => void;
|
|
11
|
-
onReset?: (value: T) => void;
|
|
12
|
-
form?: Omit<ProFormProps, 'form'>;
|
|
13
|
-
type?: ProSchemaComponentTypes;
|
|
14
|
-
dateFormatter?: ProTableProps<T, U, any>['dateFormatter'];
|
|
15
|
-
search?: false | SearchConfig;
|
|
16
|
-
columns: ProColumns<U, any>[];
|
|
17
|
-
formRef: React.MutableRefObject<ProFormInstance | undefined>;
|
|
18
|
-
submitButtonLoading?: boolean;
|
|
19
|
-
manualRequest?: boolean;
|
|
20
|
-
bordered?: boolean;
|
|
21
|
-
action: React.MutableRefObject<ActionType | undefined>;
|
|
22
|
-
ghost?: boolean;
|
|
23
|
-
} & Omit<FormItemProps, 'children' | 'onReset'>;
|
|
24
|
-
/**
|
|
25
|
-
* 这里会把 列配置转化为 form 表单
|
|
26
|
-
*
|
|
27
|
-
* @param param0
|
|
28
|
-
* @returns
|
|
29
|
-
*/
|
|
30
|
-
declare const FormRender: <T, U = any>({ onSubmit, formRef, dateFormatter, type, columns, action, ghost, manualRequest, onReset, submitButtonLoading, search: searchConfig, form: formConfig, bordered, }: TableFormItem<T, U>) => React.JSX.Element;
|
|
31
|
-
export default FormRender;
|