@zgfe/business-lib 1.0.10 → 1.0.13-alpha.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.
Files changed (44) hide show
  1. package/es/addToPanel/components/styleList.js +3 -1
  2. package/es/addToPanel/demo/edit.js +1 -0
  3. package/es/addToPanel/index.js +60 -25
  4. package/es/addToPanel/styles/index.less +1 -1
  5. package/es/addToPanel/types.d.ts +4 -3
  6. package/es/addToScene/index.js +10 -2
  7. package/es/addToScene/styles/index.less +1 -1
  8. package/es/addToScene/types.d.ts +1 -1
  9. package/es/analysisLayout/demo/index.d.ts +1 -0
  10. package/es/analysisLayout/demo/index.js +1 -0
  11. package/es/analysisLayout/index.js +1 -1
  12. package/es/analysisLayout/index.less +3 -2
  13. package/es/assets/iconfont/demo_index.html +72 -3
  14. package/es/assets/iconfont/iconfont.css +15 -3
  15. package/es/assets/iconfont/iconfont.js +1 -1
  16. package/es/assets/iconfont/iconfont.json +21 -0
  17. package/es/assets/iconfont/iconfont.ttf +0 -0
  18. package/es/assets/iconfont/iconfont.woff +0 -0
  19. package/es/assets/iconfont/iconfont.woff2 +0 -0
  20. package/es/assets/styles/chunks.less +5 -1
  21. package/es/assets/styles/resetAntd.less +177 -133
  22. package/es/assets/styles/variable.less +8 -1
  23. package/es/assets/theme.d.ts +5 -0
  24. package/es/assets/theme.js +6 -1
  25. package/es/attrConditions/components/stringList.js +1 -0
  26. package/es/attributeSelector/styles/index.less +2 -0
  27. package/es/config.d.ts +15 -0
  28. package/es/config.js +8 -0
  29. package/es/constants/apis.d.ts +1 -0
  30. package/es/constants/apis.js +2 -1
  31. package/es/datePicker/styles/index.less +4 -0
  32. package/es/dialog/index.js +2 -1
  33. package/es/eventSelector/listPanel.js +8 -0
  34. package/es/eventSelector/styles/index.less +11 -5
  35. package/es/index.d.ts +2 -1
  36. package/es/index.js +2 -1
  37. package/es/select/styles/handle.less +1 -0
  38. package/es/select/styles/index.less +0 -3
  39. package/es/targetSelector/styles/index.less +3 -1
  40. package/es/utils/ajax.d.ts +2 -20
  41. package/es/utils/ajax.js +24 -91
  42. package/es/utils/type.d.ts +31 -0
  43. package/es/utils/type.js +31 -1
  44. package/package.json +4 -4
@@ -32,7 +32,8 @@ BizDialog.defaultProps = {
32
32
  size: 'large'
33
33
  },
34
34
  cancelButtonProps: {
35
- size: 'large'
35
+ size: 'large',
36
+ type: 'text'
36
37
  }
37
38
  };
38
39
  export default BizDialog;
@@ -134,6 +134,14 @@ var EventListPanel = function EventListPanel(props) {
134
134
  setCurrentGroup(currentValue === null || currentValue === void 0 ? void 0 : currentValue.group);
135
135
  }
136
136
 
137
+ if (!groupList || !groupList.length || !groupList[0].eventList || !groupList[0].eventList.length) {
138
+ return /*#__PURE__*/React.createElement("div", {
139
+ className: "".concat(classPrefix, "-nodata-panel")
140
+ }, /*#__PURE__*/React.createElement("div", {
141
+ className: "".concat(classPrefix, "-nodata")
142
+ }, "\u6682\u65E0\u6570\u636E"));
143
+ }
144
+
137
145
  return /*#__PURE__*/React.createElement("div", {
138
146
  className: "".concat(classPrefix, "-list-panel")
139
147
  }, /*#__PURE__*/React.createElement("div", {
@@ -10,13 +10,14 @@
10
10
  flex-direction: row;
11
11
  width: 477px;
12
12
  max-height: 400px;
13
+ padding: 0;
13
14
  .__select-panel();
14
15
  }
15
16
 
16
17
  &-left {
17
18
  flex: none;
18
19
  width: 192px;
19
- padding: 8px;
20
+ padding: @padding-xs;
20
21
  overflow-y: auto;
21
22
  border-right: 1px solid @border-color-base;
22
23
  }
@@ -25,21 +26,26 @@
25
26
  display: flex;
26
27
  flex: 1;
27
28
  flex-direction: column;
28
- padding: 8px;
29
+ padding: @padding-xs;
29
30
  }
30
31
 
31
32
  &-search {
32
33
  flex: none;
33
34
  margin-bottom: @margin-sm;
34
- &.ant-input-affix-wrapper {
35
- border-radius: @border-radius-normal;
36
- }
37
35
  }
38
36
 
39
37
  &-list {
40
38
  flex: 1;
41
39
  overflow-y: auto;
42
40
  }
41
+ &-nodata-panel {
42
+ width: 284px;
43
+ .__select-panel();
44
+ }
45
+
46
+ &-nodata {
47
+ .__select-nodata();
48
+ }
43
49
 
44
50
  &-option {
45
51
  .__select-option();
package/es/index.d.ts CHANGED
@@ -21,7 +21,8 @@ import BizUserCondition from './userCondition';
21
21
  import BizSearchInput from './searchInput';
22
22
  import BizAddToScene from './addToScene';
23
23
  import BizAddToPanel from './addToPanel';
24
- export { BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizUserGroup, IconFont, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, ajax, util, theme, convertAttributeData, };
24
+ import setGlobalConfig from './config';
25
+ export { BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizUserGroup, IconFont, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, ajax, util, theme, convertAttributeData, setGlobalConfig, };
25
26
  export type { UserGroupTypes } from './userGroup/types';
26
27
  export type { BizSelectTypes } from './select/types';
27
28
  export type { AttributeSelect } from './attributeSelector/types';
package/es/index.js CHANGED
@@ -20,4 +20,5 @@ import BizUserCondition from './userCondition';
20
20
  import BizSearchInput from './searchInput';
21
21
  import BizAddToScene from './addToScene';
22
22
  import BizAddToPanel from './addToPanel';
23
- export { BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizUserGroup, IconFont, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, ajax, util, theme, convertAttributeData };
23
+ import setGlobalConfig from './config';
24
+ export { BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizUserGroup, IconFont, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, ajax, util, theme, convertAttributeData, setGlobalConfig };
@@ -83,6 +83,7 @@
83
83
  top: 50%;
84
84
  right: 8px;
85
85
  flex: none;
86
+ color: @text-color-secondary;
86
87
  font-size: @font-size-lg;
87
88
  transform: translateY(-50%);
88
89
  }
@@ -21,9 +21,6 @@
21
21
  &-search {
22
22
  flex: none;
23
23
  margin-bottom: @margin-xs;
24
- &.ant-input-affix-wrapper {
25
- border-radius: @border-radius-normal;
26
- }
27
24
  }
28
25
 
29
26
  &-nodata {
@@ -29,6 +29,7 @@
29
29
  display: none;
30
30
  flex: none;
31
31
  width: @icon-width;
32
+ color: @text-color-secondary;
32
33
  line-height: 2em;
33
34
  text-align: center;
34
35
  border-radius: @border-radius-small;
@@ -67,7 +68,8 @@
67
68
  top: 45px;
68
69
  left: 0;
69
70
  z-index: 1000;
70
- width: 390px;
71
+ width: 100%;
72
+ min-width: 280px;
71
73
  .__select-panel();
72
74
  }
73
75
 
@@ -1,21 +1,3 @@
1
- import { RequestOptionsInit } from 'umi-request';
2
- declare enum ResponseStatus {
3
- success = 200,
4
- exists = 201,
5
- fail = 500,
6
- sysNotInit = 501,
7
- sysInited = 502,
8
- notLoggin = 503,
9
- paramError = 504,
10
- success2 = 106000,
11
- fail2 = 106001,
12
- paramError2 = 106002,
13
- paramError3 = 106003
14
- }
15
- export interface InterfaceApiResult<T> {
16
- code: ResponseStatus;
17
- data?: T;
18
- msg?: string;
19
- }
20
- declare function request<T>(url: string, options?: RequestOptionsInit): Promise<InterfaceApiResult<T> | null>;
1
+ import { ajaxConfig, InterfaceApiResult } from './type';
2
+ declare function request<T>(url: string, options?: ajaxConfig<T>): Promise<InterfaceApiResult<T> | null>;
21
3
  export default request;
package/es/utils/ajax.js CHANGED
@@ -2,41 +2,10 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
2
2
 
3
3
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
4
4
 
5
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
6
-
7
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
8
-
9
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
10
-
11
5
  import { extend } from 'umi-request';
12
6
  import { notification } from 'antd';
13
- var ResponseStatus;
14
-
15
- (function (ResponseStatus) {
16
- ResponseStatus[ResponseStatus["success"] = 200] = "success";
17
- ResponseStatus[ResponseStatus["exists"] = 201] = "exists";
18
- ResponseStatus[ResponseStatus["fail"] = 500] = "fail";
19
- ResponseStatus[ResponseStatus["sysNotInit"] = 501] = "sysNotInit";
20
- ResponseStatus[ResponseStatus["sysInited"] = 502] = "sysInited";
21
- ResponseStatus[ResponseStatus["notLoggin"] = 503] = "notLoggin";
22
- ResponseStatus[ResponseStatus["paramError"] = 504] = "paramError";
23
- ResponseStatus[ResponseStatus["success2"] = 106000] = "success2";
24
- ResponseStatus[ResponseStatus["fail2"] = 106001] = "fail2";
25
- ResponseStatus[ResponseStatus["paramError2"] = 106002] = "paramError2";
26
- ResponseStatus[ResponseStatus["paramError3"] = 106003] = "paramError3";
27
- })(ResponseStatus || (ResponseStatus = {}));
28
-
29
- var ApiResult = /*#__PURE__*/_createClass(function ApiResult(code, data, message) {
30
- _classCallCheck(this, ApiResult);
31
-
32
- this.code = void 0;
33
- this.data = void 0;
34
- this.msg = void 0;
35
- this.code = code;
36
- this.data = data;
37
- this.msg = message;
38
- });
39
-
7
+ import { globalConfig } from '../config';
8
+ import { ResponseStatus } from './type';
40
9
  var codeMessage = {
41
10
  200: '服务器成功返回请求的数据。',
42
11
  201: '新建或修改数据成功。',
@@ -85,59 +54,16 @@ function responseErrorHandler(url, apiResult) {
85
54
  notification.error({
86
55
  message: "\u63A5\u53E3\u54CD\u5E94\u7ED3\u6784\u5F02\u5E38"
87
56
  });
88
- throw new Error('接口响应结构异常,缺少status');
57
+ throw new Error('接口响应结构异常,缺少code');
89
58
  }
90
59
 
91
60
  var flag = false;
92
61
  var message = '接口请求失败';
93
62
 
94
- switch (apiResult.code) {
95
- case ResponseStatus.sysNotInit:
96
- message = '系统未初始化';
97
- break;
98
-
99
- case ResponseStatus.sysInited:
100
- message = '系统已初始化';
101
- break;
102
-
103
- case ResponseStatus.notLoggin:
104
- message = '账户未登录或登录已失效';
105
- break;
106
-
107
- case ResponseStatus.paramError:
108
- message = '请求参数错误';
109
- break;
110
-
111
- case ResponseStatus.paramError2:
112
- message = '请求参数缺失';
113
- break;
114
-
115
- case ResponseStatus.paramError3:
116
- message = '请求参数校验异常';
117
- break;
118
-
119
- case ResponseStatus.exists:
120
- message = '数据已存在';
121
- break;
122
-
123
- case ResponseStatus.success:
124
- flag = true;
125
- break;
126
-
127
- case ResponseStatus.success2:
128
- flag = true;
129
- break;
130
-
131
- case ResponseStatus.fail:
132
- message = apiResult.msg || '接口发生未知错误';
133
- break;
134
-
135
- case ResponseStatus.fail2:
136
- message = apiResult.msg || '接口发生未知错误';
137
- break;
138
-
139
- default:
140
- throw new Error("\u65E0\u6CD5\u8BC6\u522B\u7684\u8BF7\u6C42\u54CD\u5E94\u7801: ".concat(apiResult.code));
63
+ if (new RegExp("".concat(ResponseStatus.success, "$")).test(apiResult.code)) {
64
+ flag = true;
65
+ } else if (new RegExp("".concat(ResponseStatus.notLogin)).test(apiResult.code)) {
66
+ message = '账户未登录或登录已失效';
141
67
  }
142
68
 
143
69
  if (!flag) {
@@ -163,7 +89,8 @@ function request(_x, _x2) {
163
89
 
164
90
  function _request() {
165
91
  _request = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(url, options) {
166
- var err, option, list, res;
92
+ var _globalConfig$request, _globalConfig$request2, err, option, list, optionsWrapper, responseWrapper, params, res;
93
+
167
94
  return regeneratorRuntime.wrap(function _callee$(_context) {
168
95
  while (1) {
169
96
  switch (_context.prev = _context.next) {
@@ -193,24 +120,30 @@ function _request() {
193
120
  });
194
121
 
195
122
  case 8:
196
- _context.next = 10;
197
- return req(url, options);
198
-
199
- case 10:
123
+ optionsWrapper = (options === null || options === void 0 ? void 0 : options.optionsWrapper) || ((_globalConfig$request = globalConfig.request) === null || _globalConfig$request === void 0 ? void 0 : _globalConfig$request.optionsWrapper);
124
+ responseWrapper = (options === null || options === void 0 ? void 0 : options.responseWrapper) || ((_globalConfig$request2 = globalConfig.request) === null || _globalConfig$request2 === void 0 ? void 0 : _globalConfig$request2.responseWrapper);
125
+ params = optionsWrapper ? optionsWrapper(url, options) : {
126
+ url: url,
127
+ options: options
128
+ };
129
+ _context.next = 13;
130
+ return req(params.url, params.options);
131
+
132
+ case 13:
200
133
  res = _context.sent;
201
- return _context.abrupt("return", responseErrorHandler(url, res));
134
+ return _context.abrupt("return", responseWrapper ? responseWrapper(url, responseErrorHandler(url, res)) : responseErrorHandler(url, res));
202
135
 
203
- case 14:
204
- _context.prev = 14;
136
+ case 17:
137
+ _context.prev = 17;
205
138
  _context.t0 = _context["catch"](0);
206
139
  return _context.abrupt("return", null);
207
140
 
208
- case 17:
141
+ case 20:
209
142
  case "end":
210
143
  return _context.stop();
211
144
  }
212
145
  }
213
- }, _callee, null, [[0, 14]]);
146
+ }, _callee, null, [[0, 17]]);
214
147
  }));
215
148
  return _request.apply(this, arguments);
216
149
  }
@@ -1,3 +1,4 @@
1
+ import { RequestOptionsInit } from 'umi-request';
1
2
  import { PropType } from '../attributeSelector/types';
2
3
  export interface Event {
3
4
  value?: string | number;
@@ -50,3 +51,33 @@ export declare namespace OldSystem {
50
51
  interface EnvProp extends UserProp {
51
52
  }
52
53
  }
54
+ export declare enum ResponseStatus {
55
+ success = "00",
56
+ fail = "01",
57
+ paramNotFound = "02",
58
+ paramError = "03",
59
+ saveFileFail = "04",
60
+ readFileFail = "05",
61
+ notValid = "06",
62
+ notLogin = "07",
63
+ delFileFail = "08",
64
+ systemError = "09"
65
+ }
66
+ export interface InterfaceApiResult<T> {
67
+ code: string;
68
+ data?: T;
69
+ msg?: string;
70
+ }
71
+ export declare class ApiResult<T> implements InterfaceApiResult<T> {
72
+ code: string;
73
+ data?: T;
74
+ msg?: string;
75
+ constructor(code: ResponseStatus, data: any, message?: string);
76
+ }
77
+ export declare type ajaxConfig<T> = RequestOptionsInit & {
78
+ optionsWrapper?: (url: string, options?: RequestOptionsInit) => {
79
+ url: string;
80
+ options?: RequestOptionsInit;
81
+ };
82
+ responseWrapper?: (url: string, apiResult: ApiResult<T>) => ApiResult<T>;
83
+ };
package/es/utils/type.js CHANGED
@@ -1 +1,31 @@
1
- export {};
1
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2
+
3
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
4
+
5
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6
+
7
+ export var ResponseStatus;
8
+
9
+ (function (ResponseStatus) {
10
+ ResponseStatus["success"] = "00";
11
+ ResponseStatus["fail"] = "01";
12
+ ResponseStatus["paramNotFound"] = "02";
13
+ ResponseStatus["paramError"] = "03";
14
+ ResponseStatus["saveFileFail"] = "04";
15
+ ResponseStatus["readFileFail"] = "05";
16
+ ResponseStatus["notValid"] = "06";
17
+ ResponseStatus["notLogin"] = "07";
18
+ ResponseStatus["delFileFail"] = "08";
19
+ ResponseStatus["systemError"] = "09";
20
+ })(ResponseStatus || (ResponseStatus = {}));
21
+
22
+ export var ApiResult = /*#__PURE__*/_createClass(function ApiResult(code, data, message) {
23
+ _classCallCheck(this, ApiResult);
24
+
25
+ this.code = void 0;
26
+ this.data = void 0;
27
+ this.msg = void 0;
28
+ this.code = code;
29
+ this.data = data;
30
+ this.msg = message;
31
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.0.10",
3
+ "version": "1.0.13-alpha.0",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -36,7 +36,8 @@
36
36
  "echarts": "^5.3.2",
37
37
  "echarts-for-react": "^3.0.2",
38
38
  "lerna": "^4.0.0",
39
- "react-infinite-scroll-component": "^6.1.0"
39
+ "react-infinite-scroll-component": "^6.1.0",
40
+ "umi-request": "^1.4.0"
40
41
  },
41
42
  "peerDependencies": {
42
43
  "@types/lodash": "^4.14.182",
@@ -56,8 +57,7 @@
56
57
  "gh-pages": "^3.0.0",
57
58
  "lint-staged": "^10.0.7",
58
59
  "prettier": "^2.2.1",
59
- "umi-request": "^1.4.0",
60
60
  "yorkie": "^2.0.0"
61
61
  },
62
- "gitHead": "31f61ad6ee6757193c95445304205616b143193b"
62
+ "gitHead": "f622cd527db39c1afb4bd457edc8457d337478fe"
63
63
  }