@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
@@ -5,6 +5,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5
5
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import React, { useEffect, useState } from 'react';
8
+ import { message } from 'antd';
8
9
  import { classPrefix } from '..';
9
10
  import { PropType } from '../../attributeSelector/types';
10
11
  import BizSelect from '../../select';
@@ -50,12 +51,16 @@ var BizOperateList = function BizOperateList(props) {
50
51
  if (props.onChange) props.onChange(data.value);
51
52
  };
52
53
  if (!props.attr || !current || !options.length) {
53
- return /*#__PURE__*/React.createElement(BizSelect, {
54
+ return /*#__PURE__*/React.createElement("div", {
55
+ onClick: function onClick() {
56
+ return message.error('请先选择属性');
57
+ }
58
+ }, /*#__PURE__*/React.createElement(BizSelect, {
54
59
  className: "".concat(classPrefix, "-single-select"),
55
60
  theme: props.theme,
56
61
  disable: true,
57
62
  options: []
58
- });
63
+ }));
59
64
  }
60
65
  return /*#__PURE__*/React.createElement(BizSelect, {
61
66
  disable: !props.attr,
@@ -40,7 +40,8 @@ var StringList = function StringList(props) {
40
40
  timer = _useState10[0],
41
41
  setTimer = _useState10[1];
42
42
  useEffect(function () {
43
- if (props.value) {
43
+ setSearchValue('');
44
+ if (props.value && Object.keys(props.value).length > 0) {
44
45
  var data = props.value.map(function (item) {
45
46
  return {
46
47
  name: item,
@@ -53,6 +54,7 @@ var StringList = function StringList(props) {
53
54
  }
54
55
  }, [props.value]);
55
56
  useEffect(function () {
57
+ if (searchValue) setSearchValue('');
56
58
  fetchValues();
57
59
  if (isFirst) {
58
60
  setIsFirst(false);
@@ -79,7 +81,7 @@ var StringList = function StringList(props) {
79
81
  var attrData = props.attr;
80
82
  var requestData = {
81
83
  app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
82
- platform: currentApp === null || currentApp === void 0 ? void 0 : currentApp.platform,
84
+ platform: 0,
83
85
  limit: 20,
84
86
  attr: (attrData === null || attrData === void 0 ? void 0 : attrData.id) || 0,
85
87
  dimension_sub: attrData === null || attrData === void 0 ? void 0 : attrData.dimensionSub,
@@ -141,6 +143,7 @@ var StringList = function StringList(props) {
141
143
  size: "middle",
142
144
  className: "".concat(classPrefix, "-multi-select"),
143
145
  options: [],
146
+ placeholder: "\u8BF7\u9009\u62E9\u5C5E\u6027\u503C",
144
147
  disable: true
145
148
  });
146
149
  }
@@ -156,7 +159,8 @@ var StringList = function StringList(props) {
156
159
  keyField: "value",
157
160
  options: options,
158
161
  onChange: onChange,
159
- onSearch: setSearchValue
162
+ onSearch: setSearchValue,
163
+ placeholder: "\u8BF7\u9009\u62E9\u5C5E\u6027\u503C"
160
164
  });
161
165
  };
162
166
  export default StringList;
@@ -4,7 +4,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
4
4
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
5
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import { DatePicker, Input } from 'antd';
7
+ import { DatePicker, Input, message } from 'antd';
8
8
  import locale from 'antd/es/date-picker/locale/zh_CN';
9
9
  import moment from 'moment';
10
10
  import React, { useEffect, useState } from 'react';
@@ -94,13 +94,18 @@ var ValuesList = function ValuesList(props) {
94
94
  return current && current > moment().endOf('day');
95
95
  };
96
96
  if (!attr || !operate || isFirst) {
97
- return /*#__PURE__*/React.createElement(BizSelect, {
97
+ return /*#__PURE__*/React.createElement("div", {
98
+ onClick: function onClick() {
99
+ return message.error('请先选择属性');
100
+ }
101
+ }, /*#__PURE__*/React.createElement(BizSelect, {
98
102
  disable: true,
99
103
  className: "".concat(classPrefix, "-multi-select"),
100
104
  theme: theme,
101
105
  size: "middle",
102
- options: []
103
- });
106
+ options: [],
107
+ placeholder: "\u8BF7\u9009\u62E9\u5C5E\u6027\u503C"
108
+ }));
104
109
  }
105
110
  if (attr.type === PropType.STRING) {
106
111
  return /*#__PURE__*/React.createElement(StringList, {
@@ -122,14 +127,15 @@ var ValuesList = function ValuesList(props) {
122
127
  overlayWidth: 60,
123
128
  className: "".concat(classPrefix, "-input-select"),
124
129
  onChange: onChangeUnit,
125
- options: propSubtype
130
+ options: propSubtype,
131
+ placeholder: "\u8BF7\u9009\u62E9\u5C5E\u6027\u503C"
126
132
  });
127
133
  return /*#__PURE__*/React.createElement("div", {
128
134
  className: "".concat(classPrefix, "-value-content")
129
135
  }, /*#__PURE__*/React.createElement(Input, {
130
136
  className: "".concat(classPrefix, "-input"),
131
137
  value: current && current.length ? current[0] : '',
132
- placeholder: "\u8BF7\u8F93\u5165",
138
+ placeholder: "\u8BF7\u8F93\u5165\u5C5E\u6027\u503C",
133
139
  type: "number",
134
140
  size: "middle",
135
141
  onChange: onChangeNumber,
@@ -156,7 +162,7 @@ var ValuesList = function ValuesList(props) {
156
162
  return /*#__PURE__*/React.createElement(Input, {
157
163
  className: "".concat(classPrefix, "-input"),
158
164
  value: current && current[0] ? current[0] : 30,
159
- placeholder: "\u8BF7\u8F93\u5165",
165
+ placeholder: "\u8BF7\u8F93\u5165\u5C5E\u6027\u503C",
160
166
  type: "number",
161
167
  suffix: "\u5929",
162
168
  onChange: onChangeDate
@@ -1,134 +1,27 @@
1
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
4
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
5
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
10
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
- import React, { useEffect, useImperativeHandle, useState } from 'react';
1
+ import React from 'react';
12
2
  import BizConditionItem from './index';
13
3
  import './styles/group.less';
14
- import _ from 'lodash';
15
4
  import { Skeleton } from 'antd';
5
+ import useConditionGroup from '../attrCondition/useConditionGroup';
16
6
  var BizConditionGroup = function BizConditionGroup(props, ref) {
17
7
  var eventIdList = props.eventIdList,
18
8
  enableDelete = props.enableDelete,
19
9
  enableEventProp = props.enableEventProp,
20
10
  enableUserProp = props.enableUserProp,
21
11
  enableEnvProp = props.enableEnvProp,
22
- disableItemList = props.disableItemList,
23
- onConditionsCount = props.onConditionsCount;
24
- var _useState = useState('and'),
25
- _useState2 = _slicedToArray(_useState, 2),
26
- relation = _useState2[0],
27
- setRelation = _useState2[1];
28
- var _useState3 = useState([]),
29
- _useState4 = _slicedToArray(_useState3, 2),
30
- conditions = _useState4[0],
31
- setConditions = _useState4[1];
32
- var _useState5 = useState(true),
33
- _useState6 = _slicedToArray(_useState5, 2),
34
- ready = _useState6[0],
35
- setReady = _useState6[1];
12
+ disableItemList = props.disableItemList;
13
+ var _useConditionGroup = useConditionGroup(props, ref),
14
+ loading = _useConditionGroup.loading,
15
+ conditions = _useConditionGroup.conditions,
16
+ _onChange = _useConditionGroup.onChange,
17
+ onClickRelation = _useConditionGroup.onClickRelation,
18
+ _onDelete = _useConditionGroup.onDelete,
19
+ relation = _useConditionGroup.relation;
36
20
  var classPrefix = 'biz-condition';
37
- useEffect(function () {
38
- var data = props.defaultValue || props.value;
39
- if (data) {
40
- if (data.relation) setRelation(props.onlyAnd ? 'and' : data.relation);
41
- if (data.conditions) {
42
- setConditions(function () {
43
- return addKeyToGroup(data.conditions);
44
- });
45
- }
46
- }
47
- setReady(false);
48
- }, []);
49
- useImperativeHandle(ref, function () {
50
- return {
51
- add: function add() {
52
- onConditionsCount && onConditionsCount(conditions.length + 1);
53
- setConditions(function (conditions) {
54
- conditions.push({
55
- key: Math.random()
56
- });
57
- return _toConsumableArray(conditions);
58
- });
59
- },
60
- setValue: function setValue(data) {
61
- if (data) {
62
- if (data.relation) setRelation(props.onlyAnd ? 'and' : data.relation);
63
- if (data.conditions) {
64
- setConditions(function () {
65
- return addKeyToGroup(data.conditions);
66
- });
67
- }
68
- } else {
69
- setRelation('and');
70
- setConditions([]);
71
- }
72
- }
73
- };
74
- });
75
- var addKeyToGroup = function addKeyToGroup(data) {
76
- return data.map(function (item) {
77
- return {
78
- key: Math.random(),
79
- data: item
80
- };
81
- });
82
- };
83
- var removeKeyToGroup = function removeKeyToGroup(data) {
84
- var group = [];
85
- data.forEach(function (item) {
86
- if (item.data) group.push(item.data);
87
- });
88
- return group;
89
- };
90
- var onClickRelation = function onClickRelation(e) {
91
- e.stopPropagation();
92
- var data = e.target.innerText === '且' ? 'and' : 'or';
93
- setRelation(data);
94
- if (props.onChange) {
95
- var group = removeKeyToGroup(conditions);
96
- props.onChange({
97
- relation: data,
98
- conditions: group
99
- });
100
- }
101
- };
102
- var _onChange = function onChange(data, index) {
103
- var conditionArr = _.cloneDeep(conditions);
104
- conditionArr[index].data = data;
105
- setConditions(conditionArr);
106
- onConditionsCount && onConditionsCount(conditionArr.length);
107
- if (props.onChange) {
108
- var group = removeKeyToGroup(conditionArr);
109
- props.onChange({
110
- relation: relation,
111
- conditions: group
112
- });
113
- }
114
- };
115
- var _onDelete = function onDelete(index) {
116
- var conditionArr = _.cloneDeep(conditions);
117
- conditionArr.splice(index, 1);
118
- setConditions(conditionArr);
119
- onConditionsCount && onConditionsCount(conditionArr.length);
120
- if (props.onChange) {
121
- var group = removeKeyToGroup(conditionArr);
122
- props.onChange({
123
- relation: relation,
124
- conditions: group
125
- });
126
- }
127
- };
128
21
  return /*#__PURE__*/React.createElement("div", {
129
22
  className: classPrefix
130
23
  }, /*#__PURE__*/React.createElement(Skeleton, {
131
- loading: ready,
24
+ loading: loading,
132
25
  active: true,
133
26
  paragraph: {
134
27
  rows: 2
@@ -1,16 +1,11 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import React, { useEffect, useState } from 'react';
1
+ import React from 'react';
8
2
  import BizAttributeSelector from '../attributeSelector';
9
3
  import { PropCategory } from '../attributeSelector/types';
10
4
  import './styles/index.less';
11
5
  import BizOperateList from './components/operateList';
12
6
  import ValuesList from './components/valuesList';
13
7
  import { Skeleton } from 'antd';
8
+ import useAttrCondition from '../attrCondition/useAttrCondition';
14
9
  export var classPrefix = 'biz-condition-item';
15
10
  export function getCondition(attr, operate, values) {
16
11
  if (!attr) return;
@@ -35,9 +30,7 @@ export function getCondition(attr, operate, values) {
35
30
  return responseData;
36
31
  }
37
32
  var BizConditionItem = function BizConditionItem(props) {
38
- var _props$defaultValue, _props$value, _props$defaultValue2, _props$value2;
39
- var defaultValue = props.defaultValue,
40
- eventIdList = props.eventIdList,
33
+ var eventIdList = props.eventIdList,
41
34
  enableDelete = props.enableDelete,
42
35
  enableEventProp = props.enableEventProp,
43
36
  enableUserProp = props.enableUserProp,
@@ -45,78 +38,19 @@ var BizConditionItem = function BizConditionItem(props) {
45
38
  disableItemList = props.disableItemList,
46
39
  border = props.border,
47
40
  theme = props.theme;
48
- var _useState = useState(),
49
- _useState2 = _slicedToArray(_useState, 2),
50
- attr = _useState2[0],
51
- setAttr = _useState2[1];
52
- var _useState3 = useState(((_props$defaultValue = props.defaultValue) === null || _props$defaultValue === void 0 ? void 0 : _props$defaultValue.operator) || ((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.operator)),
53
- _useState4 = _slicedToArray(_useState3, 2),
54
- operate = _useState4[0],
55
- setOperate = _useState4[1];
56
- var _useState5 = useState(((_props$defaultValue2 = props.defaultValue) === null || _props$defaultValue2 === void 0 ? void 0 : _props$defaultValue2.values) || ((_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.values)),
57
- _useState6 = _slicedToArray(_useState5, 2),
58
- values = _useState6[0],
59
- setValues = _useState6[1];
60
- var _useState7 = useState(true),
61
- _useState8 = _slicedToArray(_useState7, 2),
62
- ready = _useState8[0],
63
- setReady = _useState8[1];
64
- useEffect(function () {
65
- var data = defaultValue || props.value;
66
- if (data) {
67
- var attrData;
68
- if (data.propCategory === PropCategory.EventProp) {
69
- if (data.attrId) {
70
- attrData = {
71
- id: data.attrId,
72
- propCategory: data.propCategory,
73
- type: data.type,
74
- key: data.attrId,
75
- label: data.label,
76
- dimensionSub: data.dimensionSub || 'event_attr'
77
- };
78
- }
79
- } else if (data.propCategory === PropCategory.UserProp || data.propCategory === PropCategory.EnvProp) {
80
- if (data.attrName) {
81
- var aId = data.attrId || 0;
82
- attrData = {
83
- id: aId,
84
- name: data.attrName,
85
- propCategory: data.propCategory,
86
- type: data.type,
87
- category: data.category,
88
- key: "".concat(data.propCategory, "-").concat(data.dimensionSub || data.attrName, "-").concat(aId),
89
- subtype: data.subtype,
90
- dimensionSub: data.dimensionSub || data.attrName
91
- };
92
- }
93
- }
94
- setAttr(attrData);
95
- }
96
- setReady(false);
97
- }, []);
98
- var onDelete = function onDelete() {
99
- if (props.onDelete) props.onDelete();
100
- };
101
- useEffect(function () {
102
- if (props.onChange) {
103
- if (!attr) return;
104
- props.onChange(getCondition(attr, operate, values));
105
- }
106
- }, [attr, operate, values]);
107
- var onChangeAttr = function onChangeAttr(attrData) {
108
- setAttr(attrData);
109
- };
110
- var onChangeOperate = function onChangeOperate(data) {
111
- setOperate(data);
112
- };
113
- var onChangeValues = function onChangeValues(data) {
114
- setValues(data);
115
- };
41
+ var _useAttrCondition = useAttrCondition(props),
42
+ loading = _useAttrCondition.loading,
43
+ attr = _useAttrCondition.attr,
44
+ operate = _useAttrCondition.operate,
45
+ values = _useAttrCondition.values,
46
+ onChangeAttr = _useAttrCondition.onChangeAttr,
47
+ onChangeOperate = _useAttrCondition.onChangeOperate,
48
+ onChangeValues = _useAttrCondition.onChangeValues,
49
+ onDelete = _useAttrCondition.onDelete;
116
50
  return /*#__PURE__*/React.createElement("div", {
117
51
  className: [classPrefix, border ? 'border' : ''].join(' ')
118
52
  }, /*#__PURE__*/React.createElement(Skeleton, {
119
- loading: ready,
53
+ loading: loading,
120
54
  active: true,
121
55
  paragraph: {
122
56
  rows: 2
@@ -49,8 +49,6 @@
49
49
 
50
50
  &-single-select {
51
51
  width: 100px;
52
- margin-right: @margin-xs;
53
-
54
52
  &.gray {
55
53
  color: @text-color-secondary;
56
54
 
@@ -13,8 +13,10 @@ import userData from './userData.js';
13
13
  import convertAttributeData from '../util';
14
14
  export default (function () {
15
15
  var _useState = useState({
16
- id: 30183426,
17
- propCategory: 'eventProp'
16
+ id: 0,
17
+ category: 'fixed',
18
+ name: 'is_anonymous',
19
+ propCategory: 'userProp'
18
20
  }),
19
21
  _useState2 = _slicedToArray(_useState, 2),
20
22
  attribute = _useState2[0],
@@ -113,7 +113,8 @@ var AttrListPanel = function AttrListPanel(props) {
113
113
  var showList = function () {
114
114
  var list = [];
115
115
  optionList.map(function (group) {
116
- if (!group.children.length) return;
116
+ var _group$children;
117
+ if (!((_group$children = group.children) === null || _group$children === void 0 ? void 0 : _group$children.length)) return;
117
118
  var head = /*#__PURE__*/React.createElement(Option, {
118
119
  group: group,
119
120
  key: group.key
@@ -1,6 +1,6 @@
1
1
  var Apis = {
2
- querySceneGroup: '/scene/queryScenesOfGroup.jsp',
3
- addScene: '/scene/addScene.jsp',
2
+ querySceneGroup: '/zg/web/v2/scene/queryScenesOfGroup',
3
+ addScene: '/zg/web/v2/scene/addScene',
4
4
  esQuery: '/data/queryEsData.jsp',
5
5
  addPanel: '/apppanel/addPanelElement.jsp',
6
6
  updatePanelTarget: '/apppanel/updateElemet.jsp',
@@ -4,6 +4,7 @@ declare const BizDate: React.FC<{
4
4
  type: 'hour' | 'day' | 'week' | 'month';
5
5
  value?: DatePickerTypes.Range;
6
6
  includeToday?: boolean;
7
+ selectRange?: number;
7
8
  dateCount?: DatePickerTypes.ListOption;
8
9
  onChange?: (val: DatePickerTypes.Range, isComeIn?: boolean) => void;
9
10
  }>;
@@ -13,7 +13,8 @@ import locale from 'antd/es/date-picker/locale/zh_CN';
13
13
  import { getDateRange } from './utils';
14
14
  var RangePicker = DatePicker.RangePicker;
15
15
  var BizDate = function BizDate(props) {
16
- var includeToday = props.includeToday;
16
+ var includeToday = props.includeToday,
17
+ selectRange = props.selectRange;
17
18
  var initValue = {
18
19
  begin: moment().subtract(includeToday ? 0 : 1, 'days').format('YYYY-MM-DD'),
19
20
  end: moment().subtract(includeToday ? 0 : 1, 'days').format('YYYY-MM-DD')
@@ -34,9 +35,17 @@ var BizDate = function BizDate(props) {
34
35
  }, [props.dateCount]);
35
36
  var disabledDate = function disabledDate(current) {
36
37
  if (includeToday) {
37
- return current && current > moment().endOf('day');
38
+ if (selectRange) {
39
+ return current && (current < moment().subtract(selectRange, 'days') || current > moment().endOf('day'));
40
+ } else {
41
+ return current && current > moment().endOf('day');
42
+ }
43
+ }
44
+ if (selectRange) {
45
+ return current && (current < moment().subtract(selectRange, 'days') || current > moment().subtract(1, 'days').endOf('day'));
46
+ } else {
47
+ return current && current > moment().subtract(1, 'days').endOf('day');
38
48
  }
39
- return current && current > moment().subtract(1, 'days').endOf('day');
40
49
  };
41
50
  var onChangeDate = function onChangeDate() {
42
51
  var range = {
@@ -18,6 +18,12 @@ export default (function () {
18
18
  _useState2 = _slicedToArray(_useState, 2),
19
19
  time = _useState2[0],
20
20
  setTime = _useState2[1];
21
+ var aaa = {
22
+ unit: 'day',
23
+ relative: [30, 1],
24
+ begin: '2023-05-10',
25
+ end: '2023-06-08'
26
+ };
21
27
  var _useState3 = useState(false),
22
28
  _useState4 = _slicedToArray(_useState3, 2),
23
29
  includeToday = _useState4[0],
@@ -27,13 +33,19 @@ export default (function () {
27
33
  return data;
28
34
  });
29
35
  };
30
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, "\u5305\u542B\u300C\u4ECA\u5929\u300D: ", /*#__PURE__*/React.createElement(Switch, {
36
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
37
+ onClick: function onClick() {
38
+ return setTime(aaa);
39
+ }
40
+ }, "\u624B\u52A8\u8BBE\u7F6E\u65F6\u95F4"), /*#__PURE__*/React.createElement("div", null, "\u5305\u542B\u300C\u4ECA\u5929\u300D: ", /*#__PURE__*/React.createElement(Switch, {
31
41
  defaultChecked: includeToday,
32
42
  onChange: setIncludeToday
33
43
  })), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(BizDatePicker, {
34
44
  mode: "simple",
35
45
  onChange: handleChange,
36
46
  includeToday: includeToday,
37
- defaultValue: time
47
+ value: time,
48
+ defaultValue: time,
49
+ selectRange: 365
38
50
  }), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u503C\uFF1A", JSON.stringify(time)));
39
51
  });
@@ -35,8 +35,14 @@ var BizDatePicker = function BizDatePicker(props) {
35
35
  _useState8 = _slicedToArray(_useState7, 2),
36
36
  ready = _useState8[0],
37
37
  setReady = _useState8[1];
38
+ var _useState9 = useState(),
39
+ _useState10 = _slicedToArray(_useState9, 2),
40
+ nowValue = _useState10[0],
41
+ setNowValue = _useState10[1];
38
42
  useEffect(function () {
39
- var data = props.defaultValue || props.value;
43
+ if (props.value && JSON.stringify(props.value) === JSON.stringify(nowValue)) return;
44
+ var data = props.value || props.defaultValue;
45
+ setNowValue(data);
40
46
  if (data) {
41
47
  setCurrentType(function () {
42
48
  var list = dateList.filter(function (item) {
@@ -60,12 +66,16 @@ var BizDatePicker = function BizDatePicker(props) {
60
66
  });
61
67
  }
62
68
  setReady(false);
63
- }, []);
69
+ }, [props.value]);
64
70
  useEffect(function () {
65
- if (props.onChange && dateRange) props.onChange(_objectSpread({
66
- unit: currentType.value,
67
- relative: currentTime ? [currentTime === null || currentTime === void 0 ? void 0 : currentTime.count, props.includeToday && currentType.value === 'day' ? 0 : 1] : undefined
68
- }, dateRange));
71
+ if (props.onChange && dateRange) {
72
+ var _nowTime = _objectSpread({
73
+ unit: currentType.value,
74
+ relative: currentTime ? [currentTime === null || currentTime === void 0 ? void 0 : currentTime.count, props.includeToday && currentType.value === 'day' ? 0 : 1] : undefined
75
+ }, dateRange);
76
+ setNowValue(_nowTime);
77
+ props.onChange(_nowTime);
78
+ }
69
79
  }, [currentType, currentTime, dateRange]);
70
80
  var onChangeDateType = function onChangeDateType(data) {
71
81
  setCurrentType(data);
@@ -111,7 +121,8 @@ var BizDatePicker = function BizDatePicker(props) {
111
121
  dateCount: currentTime,
112
122
  value: dateRange,
113
123
  includeToday: props.includeToday,
114
- onChange: onChangeRange
124
+ onChange: onChangeRange,
125
+ selectRange: props.selectRange
115
126
  })));
116
127
  };
117
128
  BizDatePicker.defaultProps = {
@@ -11,6 +11,7 @@ export declare namespace DatePickerTypes {
11
11
  defaultValue?: Value;
12
12
  value?: Value;
13
13
  includeToday?: boolean;
14
+ selectRange?: number;
14
15
  onChange?: (data: Value) => void;
15
16
  mode?: string;
16
17
  dateTypeList?: string[];
@@ -110,40 +110,40 @@ var DemoContent = function DemoContent(_ref3) {
110
110
  }, [loadEvent, loadEnv, loadUsers, loadUserGroups]);
111
111
  function loadUserGroup() {
112
112
  setLoadUserGroups(true);
113
- ajax('/analysis/api/common/proxy/usergroup/getAll.jsp', {
113
+ ajax('/zg/web/v2/userGroup/getAll', {
114
114
  method: 'post',
115
- params: {
115
+ data: {
116
116
  appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.id,
117
117
  platform: 0,
118
118
  includeDefault: true,
119
119
  includeToday: true
120
120
  }
121
121
  }).then(function (res) {
122
- setUserGroups(res.values.userGroups);
122
+ setUserGroups(res.data);
123
123
  setLoadUserGroups(false);
124
124
  });
125
125
  }
126
126
  function loadUserProps() {
127
127
  setLoadUsers(true);
128
- ajax('/analysis/api/common/proxy/appusergroup/getUserPropMeta.jsp', {
128
+ ajax('/zg/web/v2/appusergroup/getUserPropMeta', {
129
129
  method: 'post',
130
- params: {
131
- app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.id,
130
+ data: {
131
+ appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.id,
132
132
  platform: 0
133
133
  }
134
134
  }).then(function (res) {
135
- setUserProps(res.user_data);
135
+ setUserProps(res.data);
136
136
  setLoadUsers(false);
137
137
  });
138
138
  }
139
139
  function loadEvents() {
140
140
  setLoadEvent(true);
141
- ajax('/analysis/api/common/proxy/data/queryEventMetasOfGroup.jsp', {
141
+ ajax('/zg/web/v2/data/queryEventMetasOfGroup', {
142
142
  method: 'post',
143
- params: {
144
- app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.id,
143
+ data: {
144
+ appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.id,
145
145
  platform: 0,
146
- is_all: true
146
+ isAll: true
147
147
  }
148
148
  }).then(function (res) {
149
149
  setEventGroups(res.data);
@@ -152,14 +152,14 @@ var DemoContent = function DemoContent(_ref3) {
152
152
  }
153
153
  function loadEnvList() {
154
154
  setLoadEnv(true);
155
- ajax('/analysis/api/common/proxy/appusergroup/getEventEnvData.jsp', {
155
+ ajax('/zg/web/v2/appusergroup/getEventEnvData', {
156
156
  method: 'post',
157
- params: {
158
- app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.id,
157
+ data: {
158
+ appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.id,
159
159
  platform: 0
160
160
  }
161
161
  }).then(function (res) {
162
- setEnvList(res.event_env);
162
+ setEnvList(res.data.eventEnv);
163
163
  setLoadEnv(false);
164
164
  });
165
165
  }