@zgfe/business-lib 1.1.74 → 1.1.76-bugfix.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.
@@ -119,7 +119,8 @@ var BizAddToPanel = function BizAddToPanel(props) {
119
119
  }
120
120
  request(url, {
121
121
  method: 'post',
122
- data: data
122
+ data: data,
123
+ isTransform: true
123
124
  }).then(function (res) {
124
125
  setLoading(false);
125
126
  var result = res;
@@ -7,7 +7,6 @@
7
7
  align-items: center;
8
8
  width: fit-content;
9
9
  min-width: 208px;
10
- max-width: calc(100% - 56px);
11
10
  .__select-handle();
12
11
  &.error {
13
12
  border-color: @error-color;
@@ -31,6 +30,9 @@
31
30
  line-height: 30px;
32
31
  }
33
32
  }
33
+ .biz-select-handle-content-label {
34
+ max-width: 450px;
35
+ }
34
36
  }
35
37
 
36
38
  &-drowdown {
@@ -141,11 +141,13 @@ var SelectHandle = /*#__PURE__*/React.forwardRef(function (props, ref) {
141
141
  title: props.label || props.value && props.value[labelField]
142
142
  }, /*#__PURE__*/React.createElement("span", {
143
143
  className: "".concat(classPrefix, "-content")
144
+ }, /*#__PURE__*/React.createElement("span", {
145
+ className: "".concat(classPrefix, "-content-label")
144
146
  }, showSelectIcon && ((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.icon) && /*#__PURE__*/React.createElement("span", {
145
147
  className: "".concat(classPrefix, "-icon")
146
148
  }, props.value.icon), props.children || props.label || props.value && props.value[labelField] || /*#__PURE__*/React.createElement("span", {
147
149
  className: "".concat(classPrefix, "-holder")
148
- }, placeholder || '请选择')), /*#__PURE__*/React.createElement(IconFont, {
150
+ }, placeholder || '请选择'))), /*#__PURE__*/React.createElement(IconFont, {
149
151
  className: "".concat(classPrefix, "-expand-icon"),
150
152
  type: 'xiangxia'
151
153
  }));
@@ -121,7 +121,9 @@
121
121
  display: flex;
122
122
  flex: 1;
123
123
  align-items: center;
124
- .__default-overflow();
124
+ &-label {
125
+ .__default-overflow();
126
+ }
125
127
  }
126
128
  &-expand-icon {
127
129
  width: 14px;
@@ -6,7 +6,6 @@
6
6
  align-items: center;
7
7
  width: fit-content;
8
8
  min-width: 208px;
9
- max-width: calc(100% - 56px);
10
9
  .__select-handle();
11
10
  .biz-select-handle {
12
11
  flex: 1;
@@ -24,6 +23,9 @@
24
23
  box-shadow: none;
25
24
  }
26
25
  }
26
+ .biz-select-handle-content-label {
27
+ max-width: 450px;
28
+ }
27
29
  }
28
30
 
29
31
  &:hover {
package/es/utils/ajax.js CHANGED
@@ -7,6 +7,7 @@ import { notification, message } from 'antd';
7
7
  import { globalConfig } from '../config';
8
8
  import { ResponseStatus } from './type';
9
9
  import util from './util';
10
+ import _ from 'lodash';
10
11
  var codeMessage = {
11
12
  200: '服务器成功返回请求的数据。',
12
13
  201: '新建或修改数据成功。',
@@ -107,17 +108,27 @@ function _request() {
107
108
  while (1) switch (_context.prev = _context.next) {
108
109
  case 0:
109
110
  _context.prev = 0;
111
+ if (options === null || options === void 0 ? void 0 : options.isTransform) {
112
+ options.transformRequest = function (params) {
113
+ var arr = [];
114
+ for (var key in params) {
115
+ var value = _.isString(params[key]) ? params[key] : JSON.stringify(params[key]);
116
+ arr.push("".concat(key, "=").concat(encodeURIComponent(value)));
117
+ }
118
+ return arr.join('&');
119
+ };
120
+ }
110
121
  if (!/{{\S*}}/.test(url)) {
111
- _context.next = 8;
122
+ _context.next = 9;
112
123
  break;
113
124
  }
114
125
  if (!(!options || !options.params)) {
115
- _context.next = 5;
126
+ _context.next = 6;
116
127
  break;
117
128
  }
118
129
  err = new Error("\u5E26\u53C2URL(".concat(url, ")\u8BF7\u6C42\u4E2D\uFF0C\u7F3A\u5C11params\u53C2\u6570"));
119
130
  throw err;
120
- case 5:
131
+ case 6:
121
132
  option = options;
122
133
  list = url.match(/{{\S*?}}/g) || [];
123
134
  list.forEach(function (param) {
@@ -125,7 +136,7 @@ function _request() {
125
136
  url = url.replace(param, option.params[key]);
126
137
  delete option.params[key];
127
138
  });
128
- case 8:
139
+ case 9:
129
140
  optionsWrapper = (options === null || options === void 0 ? void 0 : options.optionsWrapper) || ((_globalConfig$request = globalConfig.request) === null || _globalConfig$request === void 0 ? void 0 : _globalConfig$request.optionsWrapper);
130
141
  responseWrapper = (options === null || options === void 0 ? void 0 : options.responseWrapper) || ((_globalConfig$request2 = globalConfig.request) === null || _globalConfig$request2 === void 0 ? void 0 : _globalConfig$request2.responseWrapper);
131
142
  params = optionsWrapper ? optionsWrapper(url, options) : {
@@ -135,44 +146,44 @@ function _request() {
135
146
  if (((_params$options = params.options) === null || _params$options === void 0 ? void 0 : _params$options.responseType) === 'blob') {
136
147
  params.options.getResponse = true;
137
148
  }
138
- _context.next = 14;
149
+ _context.next = 15;
139
150
  return req(params.url, params.options);
140
- case 14:
151
+ case 15:
141
152
  res = _context.sent;
142
153
  if (res) {
143
- _context.next = 17;
154
+ _context.next = 18;
144
155
  break;
145
156
  }
146
157
  throw new Error('Request Interruption');
147
- case 17:
158
+ case 18:
148
159
  if (!(((_params$options2 = params.options) === null || _params$options2 === void 0 ? void 0 : _params$options2.responseType) === 'blob')) {
149
- _context.next = 23;
160
+ _context.next = 24;
150
161
  break;
151
162
  }
152
163
  if (!util.isBlob(res.data)) {
153
- _context.next = 22;
164
+ _context.next = 23;
154
165
  break;
155
166
  }
156
167
  return _context.abrupt("return", downloadFile(res, params.options.fileName));
157
- case 22:
158
- res = res.data;
159
168
  case 23:
169
+ res = res.data;
170
+ case 24:
160
171
  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));
161
- case 26:
162
- _context.prev = 26;
172
+ case 27:
173
+ _context.prev = 27;
163
174
  _context.t0 = _context["catch"](0);
164
175
  if (!(_context.t0.message === 'Request Interruption')) {
165
- _context.next = 30;
176
+ _context.next = 31;
166
177
  break;
167
178
  }
168
179
  throw new Error('Request Interruption');
169
- case 30:
170
- return _context.abrupt("return", null);
171
180
  case 31:
181
+ return _context.abrupt("return", null);
182
+ case 32:
172
183
  case "end":
173
184
  return _context.stop();
174
185
  }
175
- }, _callee, null, [[0, 26]]);
186
+ }, _callee, null, [[0, 27]]);
176
187
  }));
177
188
  return _request.apply(this, arguments);
178
189
  }
@@ -86,6 +86,7 @@ export declare class ApiResult<T> implements InterfaceApiResult<T> {
86
86
  export type ajaxConfig<T> = RequestOptionsInit & {
87
87
  errorTitle?: string;
88
88
  notifyType?: 'warning' | 'error' | 'info';
89
+ isTransform?: boolean;
89
90
  optionsWrapper?: (url: string, options?: RequestOptionsInit) => {
90
91
  url: string;
91
92
  options?: RequestOptionsInit;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.1.74",
3
+ "version": "1.1.76-bugfix.0",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -58,5 +58,5 @@
58
58
  "react": "^16.12.0 || ^17.0.0",
59
59
  "yorkie": "^2.0.0"
60
60
  },
61
- "gitHead": "03f3b5d09472eae8588b405314667fc5e3c4a6cd"
61
+ "gitHead": "1bb534a9839e354542789dbd97dc4f871dcb6787"
62
62
  }