@zgfe/business-lib 1.1.55-beta.2 → 1.1.55-beta.4

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.
@@ -5,7 +5,8 @@ export default (function () {
5
5
  return /*#__PURE__*/React.createElement(BizChart, {
6
6
  data: pieData,
7
7
  type: "pie",
8
- showAll: true,
8
+ showAll: false,
9
+ showList: ['搜索商品', '查看商品详情', 'pv', 'scroll'],
9
10
  radius: ['30%', '75%']
10
11
  });
11
12
  });
@@ -2,6 +2,9 @@ import { ChartTypes } from '../types';
2
2
  export declare const formatPieData: (data: ChartTypes.Value, showAll?: boolean, showList?: Array<any>) => {
3
3
  name: string;
4
4
  value: number;
5
+ itemStyle: {
6
+ color: string;
7
+ };
5
8
  }[];
6
9
  export declare const formatChartData: (data: ChartTypes.Value, showAll?: boolean, showList?: Array<any>, reverseXAxis?: boolean, color?: string[]) => {
7
10
  x_axis: string[];
@@ -5,7 +5,10 @@ export var formatPieData = function formatPieData(data, showAll, showList) {
5
5
  var list = [];
6
6
  var other = {
7
7
  name: '其它',
8
- value: 0
8
+ value: 0,
9
+ itemStyle: {
10
+ color: '#ccd0d4'
11
+ }
9
12
  };
10
13
  data.series.forEach(function (item) {
11
14
  var series = {
package/es/utils/ajax.js CHANGED
@@ -77,10 +77,11 @@ export function responseErrorHandler(url, apiResult, errorTitle, notifyType) {
77
77
  if (new RegExp("".concat(ResponseStatus.success, "$")).test(apiResult.code)) {
78
78
  flag = true;
79
79
  } else if (new RegExp("".concat(ResponseStatus.notLogin)).test(apiResult.code)) {
80
- msg = '账户未登录或登录已失效';
80
+ message.error('账户未登录或登录已失效');
81
+ flag = true;
81
82
  } else if (new RegExp("".concat(ResponseStatus.noPermission)).test(apiResult.code)) {
82
- msg = '账户没有权限';
83
- throw new Error(apiResult.msg);
83
+ message.error('账户没有权限');
84
+ flag = true;
84
85
  }
85
86
  if (!flag) {
86
87
  msg = apiResult.msg || msg;
@@ -139,28 +140,40 @@ function _request() {
139
140
  return req(params.url, params.options);
140
141
  case 14:
141
142
  res = _context.sent;
143
+ if (res) {
144
+ _context.next = 17;
145
+ break;
146
+ }
147
+ throw new Error('Request Interruption');
148
+ case 17:
142
149
  if (!(((_params$options2 = params.options) === null || _params$options2 === void 0 ? void 0 : _params$options2.responseType) === 'blob')) {
143
- _context.next = 21;
150
+ _context.next = 23;
144
151
  break;
145
152
  }
146
153
  if (!util.isBlob(res.data)) {
147
- _context.next = 20;
154
+ _context.next = 22;
148
155
  break;
149
156
  }
150
157
  return _context.abrupt("return", downloadFile(res, params.options.fileName));
151
- case 20:
158
+ case 22:
152
159
  res = res.data;
153
- case 21:
160
+ case 23:
154
161
  return _context.abrupt("return", responseWrapper ? responseWrapper(url, responseErrorHandler(url, res, options === null || options === void 0 ? void 0 : options.errorTitle, options === null || options === void 0 ? void 0 : options.notifyType)) : responseErrorHandler(url, res, options === null || options === void 0 ? void 0 : options.errorTitle, options === null || options === void 0 ? void 0 : options.notifyType));
155
- case 24:
156
- _context.prev = 24;
162
+ case 26:
163
+ _context.prev = 26;
157
164
  _context.t0 = _context["catch"](0);
165
+ if (!(_context.t0.message === 'Request Interruption')) {
166
+ _context.next = 30;
167
+ break;
168
+ }
169
+ throw new Error('Request Interruption');
170
+ case 30:
158
171
  return _context.abrupt("return", null);
159
- case 27:
172
+ case 31:
160
173
  case "end":
161
174
  return _context.stop();
162
175
  }
163
- }, _callee, null, [[0, 24]]);
176
+ }, _callee, null, [[0, 26]]);
164
177
  }));
165
178
  return _request.apply(this, arguments);
166
179
  }
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,38 @@
1
+ import { Button, message } from 'antd';
2
+ import React from 'react';
3
+ import { ajax } from '@zgfe/business-lib';
4
+ import Request from 'umi-request';
5
+ var CancelToken = Request.CancelToken;
6
+ var cancel;
7
+ export default (function () {
8
+ var getPanels = function getPanels() {
9
+ if (typeof cancel === 'function') {
10
+ cancel();
11
+ }
12
+ ajax('/zg/web/v2/apppanel/panels', {
13
+ method: 'post',
14
+ data: {
15
+ appId: 501648,
16
+ platform: 0
17
+ },
18
+ cancelToken: new CancelToken(function executor(c) {
19
+ cancel = c;
20
+ }),
21
+ responseWrapper: function responseWrapper(_url, res) {
22
+ if (/07$/.test(res.code)) {
23
+ console.log('reLogin-----');
24
+ throw new Error('reLogin');
25
+ }
26
+ return res;
27
+ }
28
+ }).then(function (res) {
29
+ if (!res) return;
30
+ message.success('请求成功');
31
+ }).catch(function (e) {
32
+ console.log(e);
33
+ });
34
+ };
35
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
36
+ onClick: getPanels
37
+ }, "\u8BF7\u6C42\u63A5\u53E3"));
38
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.1.55-beta.2",
3
+ "version": "1.1.55-beta.4",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -60,5 +60,5 @@
60
60
  "react": "^16.12.0 || ^17.0.0",
61
61
  "yorkie": "^2.0.0"
62
62
  },
63
- "gitHead": "cf0536417852436598e08a1bb2f79e8db51f422d"
63
+ "gitHead": "f213f4bf925948491d308265aab6f69e8531d58d"
64
64
  }