@zgfe/business-lib 1.1.11-insight.0 → 1.1.11

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.
@@ -1,4 +1,3 @@
1
- import { Tooltip } from 'antd';
2
1
  import React from 'react';
3
2
  import { classPrefix } from '.';
4
3
  import IconFont from '../icon/iconFont';
@@ -46,7 +45,8 @@ var SelectOption = function SelectOption(props) {
46
45
 
47
46
  return /*#__PURE__*/React.createElement("div", {
48
47
  className: "".concat(classPrefix, "-option ").concat(multiple ? classPrefix + '-option-multiple' : '', " ").concat(checked ? 'active' : '', " ").concat(disabled ? 'disabled' : ''),
49
- onClick: onClick
48
+ onClick: onClick,
49
+ title: option[props.labelField]
50
50
  }, multiple && (checked ? /*#__PURE__*/React.createElement(IconFont, {
51
51
  className: "".concat(classPrefix, "-checkbox ").concat(classPrefix, "-checked"),
52
52
  type: 'a-Property1xuanzhong'
@@ -55,12 +55,9 @@ var SelectOption = function SelectOption(props) {
55
55
  type: 'a-Property1moren'
56
56
  })), (option === null || option === void 0 ? void 0 : option.icon) && /*#__PURE__*/React.createElement("span", {
57
57
  className: "".concat(classPrefix, "-option-icon")
58
- }, option === null || option === void 0 ? void 0 : option.icon), /*#__PURE__*/React.createElement(Tooltip, {
59
- title: option[props.labelField],
60
- zIndex: 100000
61
- }, /*#__PURE__*/React.createElement("span", {
58
+ }, option === null || option === void 0 ? void 0 : option.icon), /*#__PURE__*/React.createElement("span", {
62
59
  className: "".concat(classPrefix, "-option-label")
63
- }, renderLabel(option))), !disabled && /*#__PURE__*/React.createElement("span", {
60
+ }, renderLabel(option)), !disabled && /*#__PURE__*/React.createElement("span", {
64
61
  className: "".concat(classPrefix, "-option-btn")
65
62
  }, props.extra && props.extra(option)));
66
63
  };
@@ -31,8 +31,7 @@ var BizTargetCondition = function BizTargetCondition(props) {
31
31
  setTargetData = _useState2[1];
32
32
 
33
33
  var _useContext = useContext(BizGlobalDataContext),
34
- _useContext$eventGrou = _useContext.eventGroupList,
35
- eventGroupList = _useContext$eventGrou === void 0 ? [] : _useContext$eventGrou;
34
+ eventGroupList = _useContext.eventGroupList;
36
35
 
37
36
  var _useState3 = useState({
38
37
  analysisIndex: 'number'
package/es/utils/ajax.js CHANGED
@@ -49,7 +49,7 @@ var errorHandler = function errorHandler(error) {
49
49
  return response;
50
50
  };
51
51
 
52
- function responseErrorHandler(url, apiResult, errorTitle) {
52
+ function responseErrorHandler(url, apiResult, errorTitle, notifyType) {
53
53
  if (/\.jsp/.test(url)) {
54
54
  return apiResult;
55
55
  }
@@ -59,7 +59,7 @@ function responseErrorHandler(url, apiResult, errorTitle) {
59
59
  }
60
60
 
61
61
  if (!apiResult.code) {
62
- notification.error({
62
+ notification[notifyType || 'error']({
63
63
  message: "\u63A5\u53E3\u54CD\u5E94\u7ED3\u6784\u5F02\u5E38"
64
64
  });
65
65
  throw new Error('接口响应结构异常,缺少code');
@@ -140,7 +140,7 @@ function _request() {
140
140
 
141
141
  case 13:
142
142
  res = _context.sent;
143
- return _context.abrupt("return", responseWrapper ? responseWrapper(url, responseErrorHandler(url, res, options === null || options === void 0 ? void 0 : options.errorTitle)) : responseErrorHandler(url, res, options === null || options === void 0 ? void 0 : options.errorTitle));
143
+ 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));
144
144
 
145
145
  case 17:
146
146
  _context.prev = 17;
@@ -84,6 +84,7 @@ export declare class ApiResult<T> implements InterfaceApiResult<T> {
84
84
  }
85
85
  export declare type ajaxConfig<T> = RequestOptionsInit & {
86
86
  errorTitle?: string;
87
+ notifyType?: 'warning' | 'error' | 'info';
87
88
  optionsWrapper?: (url: string, options?: RequestOptionsInit) => {
88
89
  url: string;
89
90
  options?: RequestOptionsInit;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.1.11-insight.0",
3
+ "version": "1.1.11",
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": "5aca941c63bda9262f0693ef06f59e72b9a3e59e"
63
+ "gitHead": "cd765a91987b55cbcbb8694e72dcf0cf10fbfeb3"
64
64
  }