@zgfe/business-lib 1.2.16 → 1.2.17-heyh.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.
@@ -13,6 +13,7 @@ import SelectHandle from '../../select/handle';
13
13
  import { normalOptions, attrOptions } from '../data/operates';
14
14
  var BizTargetDimension = function BizTargetDimension(props) {
15
15
  var normalOptionsData = props.normalOptions ? props.normalOptions : normalOptions;
16
+ console.log('normalOptions: ', normalOptions);
16
17
  var _useState = useState(),
17
18
  _useState2 = _slicedToArray(_useState, 2),
18
19
  dimension = _useState2[0],
@@ -25,6 +26,9 @@ var BizTargetDimension = function BizTargetDimension(props) {
25
26
  _useState6 = _slicedToArray(_useState5, 2),
26
27
  options = _useState6[0],
27
28
  setOptions = _useState6[1];
29
+ useEffect(function () {
30
+ console.log('options: ', options);
31
+ }, [options]);
28
32
  var _useContext = useContext(BizGlobalDataContext),
29
33
  eventGroupList = _useContext.eventGroupList;
30
34
  var _useState7 = useState(false),
@@ -101,6 +105,45 @@ var BizTargetDimension = function BizTargetDimension(props) {
101
105
  var onVisibleChange = function onVisibleChange(show) {
102
106
  setVisible(show);
103
107
  };
108
+ var dropdownRender = function dropdownRender() {
109
+ console.log('dropdownRender: ', options);
110
+ return /*#__PURE__*/React.createElement(Menu, null, props.promptTxt && /*#__PURE__*/React.createElement("div", {
111
+ style: {
112
+ color: '#9AA1A9',
113
+ fontSize: 12,
114
+ marginBottom: 8
115
+ }
116
+ }, props.promptTxt), options.map(function (item) {
117
+ if (item.children) {
118
+ return /*#__PURE__*/React.createElement(SubMenu, {
119
+ popupClassName: "".concat(classPrefix, "-submenu"),
120
+ key: item.label,
121
+ title: item.label,
122
+ className: "".concat((dimensionParent === null || dimensionParent === void 0 ? void 0 : dimensionParent.label) === item.label ? 'active' : '')
123
+ }, item.children.map(function (sub) {
124
+ return /*#__PURE__*/React.createElement(Menu.Item, {
125
+ className: (dimensionParent === null || dimensionParent === void 0 ? void 0 : dimensionParent.value) === item.value && (dimension === null || dimension === void 0 ? void 0 : dimension.value) === sub.value ? 'active' : '',
126
+ title: sub.label,
127
+ key: "".concat(item.value, "-").concat(sub.value),
128
+ onClick: function onClick() {
129
+ return onChange(sub, item);
130
+ }
131
+ }, sub.label);
132
+ }));
133
+ }
134
+ return /*#__PURE__*/React.createElement(Menu.Item, {
135
+ className: (dimension === null || dimension === void 0 ? void 0 : dimension.value) === item.value ? 'active' : '',
136
+ key: item.value,
137
+ onClick: function onClick() {
138
+ onChange(item);
139
+ onVisibleChange(false);
140
+ },
141
+ title: item.label
142
+ }, item.label);
143
+ }), !options.length && /*#__PURE__*/React.createElement(Menu.Item, {
144
+ title: '暂无字段'
145
+ }, "\u6682\u65E0\u5B57\u6BB5"));
146
+ };
104
147
  return /*#__PURE__*/React.createElement(Dropdown, {
105
148
  overlayClassName: "".concat(classPrefix, "-dropmenu"),
106
149
  overlayStyle: {
@@ -108,44 +151,7 @@ var BizTargetDimension = function BizTargetDimension(props) {
108
151
  },
109
152
  placement: "bottomLeft",
110
153
  trigger: ['click'],
111
- dropdownRender: function dropdownRender() {
112
- return /*#__PURE__*/React.createElement(Menu, null, props.promptTxt && /*#__PURE__*/React.createElement("div", {
113
- style: {
114
- color: '#9AA1A9',
115
- fontSize: 12,
116
- marginBottom: 8
117
- }
118
- }, props.promptTxt), options.map(function (item) {
119
- if (item.children) {
120
- return /*#__PURE__*/React.createElement(SubMenu, {
121
- popupClassName: "".concat(classPrefix, "-submenu"),
122
- key: item.label,
123
- title: item.label,
124
- className: "".concat((dimensionParent === null || dimensionParent === void 0 ? void 0 : dimensionParent.label) === item.label ? 'active' : '')
125
- }, item.children.map(function (sub) {
126
- return /*#__PURE__*/React.createElement(Menu.Item, {
127
- className: (dimensionParent === null || dimensionParent === void 0 ? void 0 : dimensionParent.value) === item.value && (dimension === null || dimension === void 0 ? void 0 : dimension.value) === sub.value ? 'active' : '',
128
- title: sub.label,
129
- key: "".concat(item.value, "-").concat(sub.value),
130
- onClick: function onClick() {
131
- return onChange(sub, item);
132
- }
133
- }, sub.label);
134
- }));
135
- }
136
- return /*#__PURE__*/React.createElement(Menu.Item, {
137
- className: (dimension === null || dimension === void 0 ? void 0 : dimension.value) === item.value ? 'active' : '',
138
- key: item.value,
139
- onClick: function onClick() {
140
- onChange(item);
141
- onVisibleChange(false);
142
- },
143
- title: item.label
144
- }, item.label);
145
- }), !options.length && /*#__PURE__*/React.createElement(Menu.Item, {
146
- title: '暂无字段'
147
- }, "\u6682\u65E0\u5B57\u6BB5"));
148
- },
154
+ dropdownRender: dropdownRender,
149
155
  open: visible,
150
156
  onOpenChange: onVisibleChange
151
157
  }, /*#__PURE__*/React.createElement("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.2.16",
3
+ "version": "1.2.17-heyh.0",
4
4
  "module": "es/index.js",
5
5
  "typings": "es/index.d.ts",
6
6
  "files": [
@@ -55,7 +55,7 @@
55
55
  "react": "^16.12.0 || ^17.0.0",
56
56
  "yorkie": "^2.0.0"
57
57
  },
58
- "gitHead": "d94d26fd5bbb03478db11028e765a264ea2493e0",
58
+ "gitHead": "9d7c42266bb3be296400ca943d0cedb9ae727d88",
59
59
  "gitHooks": {
60
60
  "pre-commit": "lint-staged"
61
61
  }