@zgfe/business-lib 1.1.51 → 1.1.52

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 (57) hide show
  1. package/es/addToPanel/components/styleList.js +1 -1
  2. package/es/addToPanel/index.js +4 -0
  3. package/es/addToPanel/styles/style.less +6 -0
  4. package/es/addToScene/index.js +6 -14
  5. package/es/addToScene/types.d.ts +1 -1
  6. package/es/assets/iconfont/demo_index.html +233 -49
  7. package/es/assets/iconfont/iconfont.css +43 -11
  8. package/es/assets/iconfont/iconfont.js +7 -7
  9. package/es/assets/iconfont/iconfont.json +70 -14
  10. package/es/assets/iconfont/iconfont.ttf +0 -0
  11. package/es/assets/iconfont/iconfont.woff +0 -0
  12. package/es/assets/iconfont/iconfont.woff2 +0 -0
  13. package/es/attrCondition/demo/ajaxConfig.d.ts +8 -0
  14. package/es/attrCondition/demo/ajaxConfig.js +40 -0
  15. package/es/attrCondition/demo/group.d.ts +2 -0
  16. package/es/attrCondition/demo/group.js +29 -0
  17. package/es/attrCondition/demo/index.d.ts +2 -0
  18. package/es/attrCondition/demo/index.js +16 -0
  19. package/es/attrCondition/group.d.ts +4 -0
  20. package/es/attrCondition/group.js +59 -0
  21. package/es/attrCondition/index.d.ts +5 -0
  22. package/es/attrCondition/index.js +67 -0
  23. package/es/attrCondition/styles/index.less +74 -0
  24. package/es/attrCondition/useAttrCondition.d.ts +13 -0
  25. package/es/attrCondition/useAttrCondition.js +91 -0
  26. package/es/attrCondition/useConditionGroup.d.ts +10 -0
  27. package/es/attrCondition/useConditionGroup.js +127 -0
  28. package/es/attrConditions/components/operateList.js +7 -2
  29. package/es/attrConditions/components/stringList.js +7 -3
  30. package/es/attrConditions/components/valuesList.js +13 -7
  31. package/es/attrConditions/group.js +11 -118
  32. package/es/attrConditions/index.js +13 -79
  33. package/es/attrConditions/styles/index.less +0 -2
  34. package/es/attributeSelector/demo/index.js +4 -2
  35. package/es/attributeSelector/listPanel.js +2 -1
  36. package/es/constants/apis.js +2 -2
  37. package/es/datePicker/datePicker.d.ts +1 -0
  38. package/es/datePicker/datePicker.js +12 -3
  39. package/es/datePicker/demo/day.js +14 -2
  40. package/es/datePicker/index.js +18 -7
  41. package/es/datePicker/types.d.ts +1 -0
  42. package/es/demoWrapper/content.js +15 -15
  43. package/es/demoWrapper/head.js +4 -4
  44. package/es/demoWrapper/index.js +3 -2
  45. package/es/eventSelector/demo/index.js +2 -1
  46. package/es/eventSelector/index.js +2 -1
  47. package/es/eventSelector/listPanel.js +10 -3
  48. package/es/eventSelector/option.d.ts +1 -0
  49. package/es/eventSelector/option.js +4 -2
  50. package/es/eventSelector/styles/index.less +6 -0
  51. package/es/eventSelector/types.d.ts +2 -0
  52. package/es/index.d.ts +3 -1
  53. package/es/index.js +3 -1
  54. package/es/layout/optionTitle/index.js +2 -0
  55. package/es/select/option.js +1 -1
  56. package/es/utils/ajax.js +1 -3
  57. package/package.json +2 -2
@@ -27,14 +27,14 @@ var DemoHeader = function DemoHeader(_ref) {
27
27
  }, [loading, appList]);
28
28
  function queryAppList() {
29
29
  setLoading(true);
30
- request('/analysis/api/common/proxy/data/v2ajaxGetDataByApp.jsp').then(function (res) {
31
- setAppList(res.applist);
30
+ request('/zg/web/v2/data/v2ajaxGetDataByApp').then(function (res) {
31
+ setAppList(res.data.appList);
32
32
  if (defaultApp) {
33
- _onChange(res.applist.find(function (item) {
33
+ _onChange(res.data.appList.find(function (item) {
34
34
  return item.id === defaultApp;
35
35
  }));
36
36
  }
37
- if (!defaultApp && res.applist.length) _onChange(res.applist[0]);
37
+ if (!defaultApp && res.data.appList.length) _onChange(res.data.appList[0]);
38
38
  }).finally(function () {
39
39
  setLoading(false);
40
40
  });
@@ -37,8 +37,9 @@ var DemoWrapper = function DemoWrapper(_ref) {
37
37
  getCurrentUser();
38
38
  }, []);
39
39
  function getCurrentUser() {
40
- request('/analysis/api/common/proxy/user/getUserInfo.jsp').then(function (res) {
41
- if (res.status === 503 || res.ret === '-1') setNotLogin(true);
40
+ request('/zg/web/v2/user/getUserInfo').then(function (res) {
41
+ var _res$data;
42
+ if (res === null || (res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.ret) === '-1') setNotLogin(true);
42
43
  }).catch(function (err) {
43
44
  console.error('获取用户信息失败', err);
44
45
  }).finally(function () {
@@ -42,7 +42,8 @@ var EventDemo = function EventDemo() {
42
42
  showBuiltInTarget: true,
43
43
  defaultValue: value,
44
44
  alias: "\u522B\u540D",
45
- onChange: onChange
45
+ onChange: onChange,
46
+ selectList: [24143017, 24256188, 24256187]
46
47
  })), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u9009\u62E9\u7684\u4E8B\u4EF6\u662F\uFF1A", JSON.stringify(value))));
47
48
  };
48
49
  export default (function () {
@@ -108,7 +108,8 @@ var BizEventSelector = function BizEventSelector(props) {
108
108
  onChange: onChange,
109
109
  showOverview: showAllEvent,
110
110
  showBuiltInTarget: props.showBuiltInTarget,
111
- defaultSelectAble: defaultSelectAble
111
+ defaultSelectAble: defaultSelectAble,
112
+ selectList: props.selectList
112
113
  });
113
114
  },
114
115
  trigger: ['click'],
@@ -171,6 +171,7 @@ var EventListPanel = function EventListPanel(props) {
171
171
  searchValue: searchValue,
172
172
  currentGroup: currentGroup,
173
173
  currentValue: currentValue,
174
+ selectList: props.selectList,
174
175
  onClick: onClickEvent
175
176
  }))));
176
177
  };
@@ -180,7 +181,8 @@ var InfiniteScrollList = function InfiniteScrollList(_ref) {
180
181
  searchValue = _ref.searchValue,
181
182
  currentGroup = _ref.currentGroup,
182
183
  currentValue = _ref.currentValue,
183
- onClick = _ref.onClick;
184
+ onClick = _ref.onClick,
185
+ selectList = _ref.selectList;
184
186
  var _useState11 = useState([]),
185
187
  _useState12 = _slicedToArray(_useState11, 2),
186
188
  showList = _useState12[0],
@@ -216,11 +218,16 @@ var InfiniteScrollList = function InfiniteScrollList(_ref) {
216
218
  className: "".concat(classPrefix, "-event-item-wrap"),
217
219
  key: Math.random()
218
220
  }, showList.map(function (e) {
219
- var _currentValue$event2;
221
+ var _currentValue$event2, _currentValue$event3;
222
+ var _disable = false;
223
+ if (selectList && (selectList === null || selectList === void 0 ? void 0 : selectList.indexOf(e.id)) !== -1 && (currentValue === null || currentValue === void 0 ? void 0 : (_currentValue$event2 = currentValue.event) === null || _currentValue$event2 === void 0 ? void 0 : _currentValue$event2.id) !== e.id) {
224
+ _disable = true;
225
+ }
220
226
  return /*#__PURE__*/React.createElement(EventListOption, {
221
227
  label: e.alias || e.name,
222
228
  key: "".concat(currentGroup === null || currentGroup === void 0 ? void 0 : currentGroup.id, "-").concat(e.id),
223
- checked: (currentValue === null || currentValue === void 0 ? void 0 : (_currentValue$event2 = currentValue.event) === null || _currentValue$event2 === void 0 ? void 0 : _currentValue$event2.id) === e.id,
229
+ checked: (currentValue === null || currentValue === void 0 ? void 0 : (_currentValue$event3 = currentValue.event) === null || _currentValue$event3 === void 0 ? void 0 : _currentValue$event3.id) === e.id,
230
+ disable: _disable,
224
231
  highlight: {
225
232
  enable: true,
226
233
  text: searchValue
@@ -4,6 +4,7 @@ declare const EventListOption: React.FC<{
4
4
  showCount?: boolean;
5
5
  count?: number;
6
6
  label?: string;
7
+ disable?: boolean;
7
8
  checked?: boolean;
8
9
  highlight?: {
9
10
  enable: boolean;
@@ -10,8 +10,10 @@ var EventListOption = function EventListOption(props) {
10
10
  checked = props.checked,
11
11
  highlight = props.highlight,
12
12
  onClick = props.onClick,
13
- data = props.data;
13
+ data = props.data,
14
+ disable = props.disable;
14
15
  var _onClick = function _onClick() {
16
+ if (disable) return;
15
17
  if (onClick) onClick(data);
16
18
  };
17
19
  function getLabel(label) {
@@ -28,7 +30,7 @@ var EventListOption = function EventListOption(props) {
28
30
  });
29
31
  }
30
32
  return /*#__PURE__*/React.createElement("div", {
31
- className: "".concat(classPrefix, "-option ").concat(checked ? 'active' : ''),
33
+ className: "".concat(classPrefix, "-option ").concat(checked ? 'active' : '', " ").concat(disable ? 'disable' : ''),
32
34
  onClick: _onClick
33
35
  }, /*#__PURE__*/React.createElement("div", {
34
36
  className: "".concat(classPrefix, "-option-label"),
@@ -73,6 +73,12 @@
73
73
  background: @primary-color;
74
74
  }
75
75
  }
76
+ &.disable,
77
+ &.disable:hover {
78
+ color: #ccd0d4;
79
+ background: #fff;
80
+ cursor: not-allowed;
81
+ }
76
82
 
77
83
  &-label {
78
84
  flex: 1;
@@ -30,6 +30,7 @@ export declare namespace EventSelectTypes {
30
30
  size?: SizeType;
31
31
  destroyPopupOnHide?: boolean;
32
32
  onChange?: (val: Value) => void;
33
+ selectList?: number[];
33
34
  }
34
35
  interface DropdownProps {
35
36
  value?: Value;
@@ -37,5 +38,6 @@ export declare namespace EventSelectTypes {
37
38
  showBuiltInTarget?: boolean;
38
39
  defaultSelectAble?: boolean;
39
40
  onChange?: (value: Value, isOverview?: boolean) => void;
41
+ selectList?: number[];
40
42
  }
41
43
  }
package/es/index.d.ts CHANGED
@@ -30,9 +30,11 @@ import BizDetailLayout from './layout/detail';
30
30
  import BizLoginForm from './loginForm';
31
31
  import DemoWrapper from './demoWrapper';
32
32
  import SocketClient from './socket';
33
+ import BizAttrCondition from './attrCondition';
34
+ import BizAttrConditionGroup from './attrCondition/group';
33
35
  import BizTargetFromPanel from './layout/optionTitle';
34
36
  import { BizTargetFromPanelContext } from './layout/optionTitle/types';
35
- export { BizTargetFromPanel, BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizDetailLayout, BizUserGroup, IconFont, ColorIcon, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetFromPanelContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, SocketClient, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig, };
37
+ export { BizTargetFromPanel, BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizDetailLayout, BizUserGroup, IconFont, ColorIcon, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetFromPanelContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizAttrCondition, BizAttrConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, SocketClient, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig, };
36
38
  export type { UserGroupTypes } from './userGroup/types';
37
39
  export type { BizSelectTypes } from './select/types';
38
40
  export type { AttributeSelect } from './attributeSelector/types';
package/es/index.js CHANGED
@@ -29,6 +29,8 @@ import BizDetailLayout from './layout/detail';
29
29
  import BizLoginForm from './loginForm';
30
30
  import DemoWrapper from './demoWrapper';
31
31
  import SocketClient from './socket';
32
+ import BizAttrCondition from './attrCondition';
33
+ import BizAttrConditionGroup from './attrCondition/group';
32
34
  import BizTargetFromPanel from './layout/optionTitle';
33
35
  import { BizTargetFromPanelContext } from './layout/optionTitle/types';
34
- export { BizTargetFromPanel, BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizDetailLayout, BizUserGroup, IconFont, ColorIcon, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetFromPanelContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, SocketClient, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig };
36
+ export { BizTargetFromPanel, BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizDetailLayout, BizUserGroup, IconFont, ColorIcon, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetFromPanelContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizAttrCondition, BizAttrConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, SocketClient, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig };
@@ -97,6 +97,8 @@ var BizTargetFromPanel = function BizTargetFromPanel(props) {
97
97
  return;
98
98
  }
99
99
  callback();
100
+ }).catch(function () {
101
+ callback(true, '');
100
102
  }).finally(function () {
101
103
  setLoading(false);
102
104
  });
@@ -82,7 +82,7 @@ var SelectOption = function SelectOption(props) {
82
82
  }), /*#__PURE__*/React.createElement("span", null, group.name));
83
83
  }
84
84
  return /*#__PURE__*/React.createElement(Tooltip, {
85
- placement: "rightBottom",
85
+ placement: "right",
86
86
  title: isOverflow ? option[props.labelField] : null,
87
87
  zIndex: 100000
88
88
  }, /*#__PURE__*/React.createElement("div", {
package/es/utils/ajax.js CHANGED
@@ -63,10 +63,8 @@ export function responseErrorHandler(url, apiResult, errorTitle, notifyType) {
63
63
  flag = true;
64
64
  } else if (new RegExp("".concat(ResponseStatus.notLogin)).test(apiResult.code)) {
65
65
  message = '账户未登录或登录已失效';
66
- window.location.href = '/webapp/app/login?destination=' + window.location.href;
67
66
  } else if (new RegExp("".concat(ResponseStatus.noPermission)).test(apiResult.code)) {
68
- window.location.href = '/webapp/app/noPermission';
69
- throw new Error(apiResult.msg);
67
+ message = '账户没有权限';
70
68
  }
71
69
  if (!flag) {
72
70
  message = apiResult.msg || message;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.1.51",
3
+ "version": "1.1.52",
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": "8e88533be9edd702428e49b00aa0f6c4379e7cc1"
63
+ "gitHead": "251739f1839ece949e783f20628022ef81bca705"
64
64
  }