@zgfe/business-lib 1.0.24-alpha.0 → 1.0.24-alpha.3

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 +1 @@
1
- export var chartColors = ['#165DFF', '#CDDBFD', '#80E1D9', '#CDF3F0', '#65789B', '#CED4DE', '#F8BC3B', '#FCE7B9', '#6F66ED', '#D1CEFD', '#66AFED', '#D3E7F9', '#9661BC', '#DFCFEA', '#FF7557', '#FFD1C7', '#4DB273', '#BBDEC8', '#F08BB4', '#FFE0ED'];
1
+ export var chartColors = ['#165DFF', '#80E1D9', '#65789B', '#F8BC3B', '#6F66ED', '#66AFED', '#9661BC', '#FF7557', '#4DB273', '#F08BB4', '#CDDBFD', '#CDF3F0', '#CED4DE', '#FCE7B9', '#D1CEFD', '#D3E7F9', '#DFCFEA', '#FFD1C7', '#BBDEC8', '#FFE0ED'];
@@ -12,11 +12,23 @@ export interface UserInfo {
12
12
  companyId: number;
13
13
  companyName: string;
14
14
  }
15
+ export interface Menu {
16
+ helpUrl: string;
17
+ href: string;
18
+ icon: string;
19
+ name: string;
20
+ nametext: string;
21
+ supportVirtualApp: boolean;
22
+ childrens?: Menu[];
23
+ }
15
24
  export interface GlobalContextProps {
16
25
  userGroupList?: Array<any>;
17
26
  eventGroupList?: EventGroup[];
18
27
  userPropList?: UserProp[];
19
28
  eventEnvList?: EnvProp[];
29
+ menuNameMap?: {
30
+ [name: string]: Menu;
31
+ };
20
32
  currentApp?: AppInfoProps;
21
33
  currentUser?: UserInfo;
22
34
  isDemo?: boolean;
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,76 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+
3
+ 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."); }
4
+
5
+ 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); }
6
+
7
+ 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; }
8
+
9
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
10
+
11
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+
13
+ import React, { useState } from 'react';
14
+ import { BizDnd } from '@zgfe/business-lib';
15
+ import styles from './styles/index.less';
16
+ import _ from 'lodash';
17
+ export default (function () {
18
+ var _useState = useState([{
19
+ id: 0,
20
+ label: 'a'
21
+ }, {
22
+ id: 1,
23
+ label: 'b'
24
+ }, {
25
+ id: 2,
26
+ label: 'c'
27
+ }, {
28
+ id: 3,
29
+ label: '添加',
30
+ disabled: true,
31
+ isAdd: true
32
+ }]),
33
+ _useState2 = _slicedToArray(_useState, 2),
34
+ list = _useState2[0],
35
+ setList = _useState2[1];
36
+
37
+ function onAdd() {
38
+ setList(function (list) {
39
+ var res = [];
40
+ list.forEach(function (item, i) {
41
+ if (item.isAdd) {
42
+ res.push({
43
+ id: Math.random(),
44
+ label: String.fromCharCode(97 + i)
45
+ });
46
+ }
47
+
48
+ res.push(_.cloneDeep(item));
49
+ });
50
+ return res;
51
+ });
52
+ }
53
+
54
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizDnd, {
55
+ className: styles.container,
56
+ store: list,
57
+ keyField: "id",
58
+ itemClassName: styles.item,
59
+ tempClassName: styles.temp,
60
+ draddingClassName: styles.doing,
61
+ itemRender: function itemRender(data) {
62
+ if (data.isAdd) return /*#__PURE__*/React.createElement("div", {
63
+ key: data.id,
64
+ className: styles.add,
65
+ onClick: onAdd
66
+ }, "+");
67
+ return /*#__PURE__*/React.createElement("div", {
68
+ key: data.id
69
+ }, data.label);
70
+ },
71
+ onChange: function onChange(array) {
72
+ console.log('排序后数据', array);
73
+ setList(array);
74
+ }
75
+ }));
76
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,77 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+
3
+ 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."); }
4
+
5
+ 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); }
6
+
7
+ 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; }
8
+
9
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
10
+
11
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+
13
+ import React, { useState } from 'react';
14
+ import { BizDnd } from '@zgfe/business-lib';
15
+ import styles from './styles/index.less';
16
+ import _ from 'lodash';
17
+ export default (function () {
18
+ var _useState = useState([{
19
+ id: 0,
20
+ label: 'a'
21
+ }, {
22
+ id: 1,
23
+ label: 'b'
24
+ }, {
25
+ id: 2,
26
+ label: 'c'
27
+ }, {
28
+ id: 3,
29
+ label: '添加',
30
+ disabled: true,
31
+ isAdd: true
32
+ }]),
33
+ _useState2 = _slicedToArray(_useState, 2),
34
+ list = _useState2[0],
35
+ setList = _useState2[1];
36
+
37
+ function onAdd() {
38
+ setList(function (list) {
39
+ var res = [];
40
+ list.forEach(function (item, i) {
41
+ if (item.isAdd) {
42
+ res.push({
43
+ id: Math.random(),
44
+ label: String.fromCharCode(97 + i)
45
+ });
46
+ }
47
+
48
+ res.push(_.cloneDeep(item));
49
+ });
50
+ return res;
51
+ });
52
+ }
53
+
54
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizDnd, {
55
+ className: styles.container,
56
+ store: list,
57
+ keyField: "id",
58
+ itemClassName: styles.item,
59
+ tempClassName: styles.temp,
60
+ draddingClassName: styles.doing,
61
+ handleClassName: styles.handle,
62
+ handle: /*#__PURE__*/React.createElement("div", null, "\u64CD\u4F5C\u680F"),
63
+ itemRender: function itemRender(data, _index, handle) {
64
+ if (data.isAdd) return /*#__PURE__*/React.createElement("div", {
65
+ key: data.id,
66
+ className: styles.add,
67
+ onClick: onAdd
68
+ }, "+");
69
+ return /*#__PURE__*/React.createElement("div", {
70
+ key: data.id
71
+ }, handle, data.label);
72
+ },
73
+ onChange: function onChange(list) {
74
+ console.log('排序后数据', list);
75
+ }
76
+ }));
77
+ });
@@ -17,6 +17,7 @@ export default (function () {
17
17
  keyField: "id",
18
18
  itemClassName: styles.item,
19
19
  tempClassName: styles.temp,
20
+ draddingClassName: styles.doing,
20
21
  itemRender: function itemRender(data) {
21
22
  return /*#__PURE__*/React.createElement("div", {
22
23
  key: data.id
@@ -6,21 +6,29 @@
6
6
  }
7
7
  .item {
8
8
  display: inline-block;
9
- width: 300px;
9
+ width: 10%;
10
10
  height: 150px;
11
11
  margin: @margin-md;
12
+ line-height: 150px;
12
13
  text-align: center;
14
+ vertical-align: top;
13
15
  background: @background-color-base;
14
16
  border-radius: @border-radius-normal;
15
17
  }
16
18
  .temp {
17
19
  display: inline-block;
18
- width: 300px;
19
- height: 150px;
20
- margin: @margin-md;
21
- text-align: center;
22
- vertical-align: top;
23
- background: @background-color-base;
24
20
  border: 2px dashed @primary-color;
25
21
  border-radius: @border-radius-normal;
26
22
  }
23
+ .add {
24
+ font-size: 48px;
25
+ cursor: pointer;
26
+ }
27
+ .doing {
28
+ border: 1px solid @warning-color;
29
+ }
30
+ .handle {
31
+ display: block;
32
+ height: 25px;
33
+ background: @info-color;
34
+ }
package/es/dnd/index.js CHANGED
@@ -12,7 +12,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
12
12
 
13
13
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
14
 
15
- import React, { useState } from 'react';
15
+ import React, { useEffect, useState } from 'react';
16
16
  import BizDndItem from './item';
17
17
  import _ from 'lodash';
18
18
  import './styles/index.less';
@@ -23,7 +23,10 @@ var BizDnd = function BizDnd(props) {
23
23
  keyField = props.keyField,
24
24
  className = props.className,
25
25
  itemClassName = props.itemClassName,
26
- tempClassName = props.tempClassName;
26
+ tempClassName = props.tempClassName,
27
+ draddingClassName = props.draddingClassName,
28
+ handle = props.handle,
29
+ handleClassName = props.handleClassName;
27
30
 
28
31
  var _useState = useState(),
29
32
  _useState2 = _slicedToArray(_useState, 2),
@@ -39,6 +42,10 @@ var BizDnd = function BizDnd(props) {
39
42
  renderData = _useState6[0],
40
43
  setRenderData = _useState6[1];
41
44
 
45
+ useEffect(function () {
46
+ setRenderData(_.cloneDeep(store));
47
+ }, [store]);
48
+
42
49
  function onMouseOver(data) {
43
50
  setHoverTarget(data);
44
51
  setHoverTarget(data);
@@ -68,6 +75,9 @@ var BizDnd = function BizDnd(props) {
68
75
  setCurrent(undefined);
69
76
  setRenderData(function (list) {
70
77
  var res = [];
78
+ if (!list.find(function (item) {
79
+ return item.isTemp;
80
+ })) return list;
71
81
 
72
82
  for (var i = 0; i < list.length; i++) {
73
83
  var item = _.cloneDeep(list[i]);
@@ -81,7 +91,9 @@ var BizDnd = function BizDnd(props) {
81
91
  res.push(item);
82
92
  }
83
93
 
84
- if (props.onChange) props.onChange(res);
94
+ setTimeout(function () {
95
+ if (props.onChange) props.onChange(res);
96
+ });
85
97
  return res;
86
98
  });
87
99
  return target;
@@ -90,11 +102,15 @@ var BizDnd = function BizDnd(props) {
90
102
 
91
103
  return /*#__PURE__*/React.createElement("div", {
92
104
  className: "".concat(classPrefix, "-container ").concat(className)
93
- }, renderData.map(function (data) {
105
+ }, renderData.map(function (data, i) {
94
106
  return /*#__PURE__*/React.createElement(BizDndItem, {
95
107
  data: data,
96
108
  key: data[keyField],
97
109
  className: "".concat(itemClassName, " ").concat(data.isTemp ? tempClassName : ''),
110
+ draddingClassName: draddingClassName,
111
+ index: i,
112
+ handle: handle,
113
+ handleClassName: handleClassName,
98
114
  render: props.itemRender,
99
115
  onDragging: setCurrent,
100
116
  onMouseOver: onMouseOver,
package/es/dnd/item.js CHANGED
@@ -1,4 +1,16 @@
1
- import React, { useRef } from 'react';
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+
3
+ 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."); }
4
+
5
+ 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); }
6
+
7
+ 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; }
8
+
9
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
10
+
11
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+
13
+ import React, { useRef, useState } from 'react';
2
14
  import { classPrefix } from '.';
3
15
  var preMouse = {
4
16
  x: 0,
@@ -14,7 +26,14 @@ var style = {
14
26
  var BizDndItem = function BizDndItem(props) {
15
27
  var className = props.className,
16
28
  render = props.render,
17
- data = props.data;
29
+ data = props.data,
30
+ draddingClassName = props.draddingClassName;
31
+
32
+ var _useState = useState(false),
33
+ _useState2 = _slicedToArray(_useState, 2),
34
+ isDragging = _useState2[0],
35
+ setIsDragging = _useState2[1];
36
+
18
37
  var ref = useRef();
19
38
 
20
39
  function onMousedown(e) {
@@ -28,24 +47,30 @@ var BizDndItem = function BizDndItem(props) {
28
47
  if (ref.current) {
29
48
  var computedStyle = window.getComputedStyle(ref.current);
30
49
  style = {
31
- position: 'fixed',
50
+ position: '',
32
51
  pointerEvents: 'inherit',
33
52
  top: top - Number(computedStyle.marginTop.replace('px', '')),
34
- left: left - Number(computedStyle.marginLeft.replace('px', ''))
53
+ left: left - Number(computedStyle.marginLeft.replace('px', '')),
54
+ width: computedStyle.width,
55
+ height: computedStyle.height
35
56
  };
36
57
  setStyle();
37
58
  preMouse = {
38
59
  x: e.clientX,
39
60
  y: e.clientY
40
61
  };
62
+ setIsDragging(true);
41
63
  }
42
64
  }
43
65
 
44
66
  function onMouseMove(e) {
67
+ var computedStyle = window.getComputedStyle(ref.current);
45
68
  style.position = 'fixed';
46
69
  style.top += e.clientY - (preMouse.y || 0);
47
70
  style.left += e.clientX - (preMouse.x || 0);
48
71
  style.pointerEvents = 'none';
72
+ style.width = computedStyle.width;
73
+ style.height = computedStyle.height;
49
74
  setStyle();
50
75
  preMouse = {
51
76
  x: e.clientX,
@@ -55,13 +80,16 @@ var BizDndItem = function BizDndItem(props) {
55
80
  }
56
81
 
57
82
  function onMouseUp() {
83
+ setIsDragging(false);
58
84
  window.removeEventListener('mousemove', onMouseMove);
59
85
  window.removeEventListener('mouseup', onMouseUp);
60
86
  style = {
61
87
  position: 'inherit',
62
88
  pointerEvents: 'inherit',
63
89
  top: 0,
64
- left: 0
90
+ left: 0,
91
+ width: '',
92
+ height: ''
65
93
  };
66
94
  setStyle();
67
95
  if (props.onDropEnd) props.onDropEnd(data);
@@ -73,6 +101,7 @@ var BizDndItem = function BizDndItem(props) {
73
101
  ref.current.style.top = "".concat(style.top, "px");
74
102
  ref.current.style.left = "".concat(style.left, "px");
75
103
  ref.current.style.pointerEvents = style.pointerEvents;
104
+ ref.current.style.width = style.width;
76
105
  }
77
106
  }
78
107
 
@@ -80,14 +109,39 @@ var BizDndItem = function BizDndItem(props) {
80
109
  className: "".concat(classPrefix, "-item ").concat(className),
81
110
  ref: ref
82
111
  });
112
+
113
+ if (props.data.disabled) {
114
+ return /*#__PURE__*/React.createElement("div", {
115
+ className: "".concat(classPrefix, "-item disable ").concat(className),
116
+ ref: ref,
117
+ onMouseOver: function onMouseOver() {
118
+ if (props.onMouseOver) props.onMouseOver(data);
119
+ }
120
+ }, render(data, props.index));
121
+ }
122
+
123
+ if (props.handle) {
124
+ var handle = /*#__PURE__*/React.createElement("span", {
125
+ className: "".concat(classPrefix, "-handle ").concat(props.handleClassName),
126
+ onMouseDown: onMousedown
127
+ }, props.handle);
128
+ return /*#__PURE__*/React.createElement("div", {
129
+ className: "".concat(classPrefix, "-item handle ").concat(className, " ").concat(isDragging ? draddingClassName : ''),
130
+ onMouseOver: function onMouseOver() {
131
+ if (props.onMouseOver) props.onMouseOver(data);
132
+ },
133
+ ref: ref
134
+ }, render(data, props.index, handle));
135
+ }
136
+
83
137
  return /*#__PURE__*/React.createElement("div", {
84
- className: "".concat(classPrefix, "-item ").concat(className),
138
+ className: "".concat(classPrefix, "-item ").concat(className, " ").concat(isDragging ? draddingClassName : ''),
85
139
  onMouseDown: onMousedown,
86
140
  onMouseOver: function onMouseOver() {
87
141
  if (props.onMouseOver) props.onMouseOver(data);
88
142
  },
89
143
  ref: ref
90
- }, render(data));
144
+ }, render(data, props.index));
91
145
  };
92
146
 
93
147
  export default BizDndItem;
@@ -3,6 +3,15 @@
3
3
  &-item {
4
4
  cursor: move;
5
5
  user-select: none;
6
+ &.disable,
7
+ &.handle {
8
+ cursor: inherit;
9
+ user-select: inherit;
10
+ }
11
+ }
12
+ &-handle {
13
+ cursor: move;
14
+ user-select: none;
6
15
  }
7
16
  &-temp {
8
17
  pointer-events: none;
package/es/dnd/types.d.ts CHANGED
@@ -1,23 +1,32 @@
1
1
  /// <reference types="react" />
2
2
  export declare namespace DndTypes {
3
+ type Data = Record<string, any> & {
4
+ isTemp?: boolean;
5
+ disabled?: boolean;
6
+ };
3
7
  interface ContainerProps {
4
8
  className?: string;
5
9
  itemClassName?: string;
6
- itemRender: (data: Record<string, any>) => React.ReactNode;
7
10
  draddingClassName?: string;
8
11
  tempClassName?: string;
9
- tempRender?: (data: Record<string, any>) => React.ReactNode;
12
+ handle?: React.ReactNode;
13
+ handleClassName?: string;
14
+ tempRender?: (data: Data) => React.ReactNode;
15
+ itemRender: (data: Data, index: number, handle?: React.ReactNode) => React.ReactNode;
10
16
  keyField: string;
11
- store: Record<string, any>[];
12
- onChange?: (list: Record<string, any>[]) => void;
17
+ store: Data[];
18
+ onChange?: (list: Data[]) => void;
13
19
  }
14
20
  interface ItemProps {
15
21
  className?: string;
16
- data: Record<string, any>;
17
- render: (data: Record<string, any>) => React.ReactNode;
22
+ data: Data;
23
+ index: number;
24
+ render: (data: Data, index: number, handle?: React.ReactNode) => React.ReactNode;
25
+ handle?: React.ReactNode;
26
+ handleClassName?: string;
18
27
  draddingClassName?: string;
19
- onDragging?: (data: Record<string, any>) => void;
20
- onMouseOver?: (data: Record<string, any>) => void;
21
- onDropEnd?: (data: Record<string, any>) => void;
28
+ onDragging?: (data: Data) => void;
29
+ onMouseOver?: (data: Data) => void;
30
+ onDropEnd?: (data: Data) => void;
22
31
  }
23
32
  }
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { IconFontProps } from '@ant-design/icons/lib/components/IconFont';
3
+ import '../assets/iconfont/iconfont.css';
3
4
  interface Props extends IconFontProps {
4
5
  family?: string;
5
6
  size?: number;
@@ -11,6 +11,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
11
11
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
12
12
 
13
13
  import React, { useMemo } from 'react';
14
+ import '../assets/iconfont/iconfont.css';
14
15
 
15
16
  var IconFont = function IconFont(props) {
16
17
  var className = props.className,
package/es/mock/event.js CHANGED
@@ -695,6 +695,43 @@ export default [{
695
695
  groupId: 4160,
696
696
  groupName: '小程序转化',
697
697
  eventList: [{
698
+ plats: [1, 2, 3],
699
+ click_analysis: false,
700
+ mark_type: null,
701
+ event_id: 7086289,
702
+ event_name: '付款成功',
703
+ event_hidden: 0,
704
+ event_type: 0,
705
+ is_stop: 0,
706
+ is_delete: 0,
707
+ alias_name: '',
708
+ event_attrs: [{
709
+ hidden: 0,
710
+ dimension_sub: 'event_attr',
711
+ encryption_type: 0,
712
+ alias_name: '',
713
+ value_dict: false,
714
+ attr_id: 5461056,
715
+ attr_name: '支付方式',
716
+ event_id: 7086289,
717
+ prop_type: 1,
718
+ is_stop: 0
719
+ }, {
720
+ hidden: 0,
721
+ dimension_sub: 'event_attr',
722
+ encryption_type: 0,
723
+ alias_name: '',
724
+ value_dict: false,
725
+ attr_id: 5461057,
726
+ attr_name: '金额',
727
+ event_id: 7086289,
728
+ prop_type: 2,
729
+ is_stop: 0
730
+ }],
731
+ stop_date_time: null,
732
+ insert_time: '2016-01-01 00:00:00',
733
+ owner: 'zg'
734
+ }, {
698
735
  plats: [3],
699
736
  click_analysis: false,
700
737
  mark_type: 1,
@@ -76,11 +76,13 @@ var BizTargetDimension = function BizTargetDimension(props) {
76
76
 
77
77
  var getAttrOption = function getAttrOption(eventId) {
78
78
  var attrData = [];
79
+ var attrMap = {};
79
80
  eventGroupList === null || eventGroupList === void 0 ? void 0 : eventGroupList.forEach(function (group) {
80
81
  group.eventList.forEach(function (event) {
81
82
  if (event.id === eventId) {
82
83
  event.attrList.forEach(function (attr) {
83
- if (attr.type === 2 && !attr.isHidden && attr.label) {
84
+ if (attr.type === 2 && !attr.isHidden && attr.label && !attrMap[String(attr.id)]) {
85
+ attrMap[String(attr.id)] = true;
84
86
  attrData.push({
85
87
  label: attr.label,
86
88
  value: String(attr.id),
@@ -18,8 +18,8 @@ import userData from '../../mock/user';
18
18
  var defaultValue = {
19
19
  type: 'event',
20
20
  alias: 'alias',
21
- eventId: 24143017,
22
- eventGroupId: 4201,
21
+ eventId: 7086289,
22
+ eventGroupId: 4160,
23
23
  analysisIndex: 'times',
24
24
  filters: {
25
25
  relation: 'or',
@@ -3,6 +3,7 @@ import { Space } from 'antd';
3
3
  import { PlusOutlined } from '@ant-design/icons';
4
4
  import './styles/conditionTypeList.less';
5
5
  import { BizUserConditionContext } from '.';
6
+ import BizGlobalDataContext from '../context';
6
7
 
7
8
  var ConditionTypeList = function ConditionTypeList(props) {
8
9
  var onAdd = props.onAdd,
@@ -13,6 +14,9 @@ var ConditionTypeList = function ConditionTypeList(props) {
13
14
  textMode = _useContext.textMode,
14
15
  openTagCondition = _useContext.openTagCondition;
15
16
 
17
+ var _useContext2 = useContext(BizGlobalDataContext),
18
+ menuNameMap = _useContext2.menuNameMap;
19
+
16
20
  if (!show || textMode) return null;
17
21
  return /*#__PURE__*/React.createElement("div", {
18
22
  className: "biz-user-condition-type-list"
@@ -52,7 +56,7 @@ var ConditionTypeList = function ConditionTypeList(props) {
52
56
  }
53
57
  }, /*#__PURE__*/React.createElement(Space, {
54
58
  key: "prop"
55
- }, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u7528\u6237\u5C5E\u6027\u6EE1\u8DB3"))), openTagCondition ? /*#__PURE__*/React.createElement("li", {
59
+ }, /*#__PURE__*/React.createElement(PlusOutlined, null), /*#__PURE__*/React.createElement("span", null, "\u7528\u6237\u5C5E\u6027\u6EE1\u8DB3"))), openTagCondition && menuNameMap && menuNameMap['userTags'] ? /*#__PURE__*/React.createElement("li", {
56
60
  className: "condition-type",
57
61
  onClick: function onClick() {
58
62
  return onAdd('tag');
@@ -10,7 +10,6 @@
10
10
  .biz-user-condition-item-delete {
11
11
  display: flex;
12
12
  align-items: center;
13
- height: 40px;
14
13
  margin-left: @margin-lg;
15
14
  cursor: pointer;
16
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.0.24-alpha.0",
3
+ "version": "1.0.24-alpha.3",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -58,5 +58,5 @@
58
58
  "react": "^16.12.0 || ^17.0.0",
59
59
  "yorkie": "^2.0.0"
60
60
  },
61
- "gitHead": "f2e1ee079aaeda5f20f3db5b51c0dbd5dd893871"
61
+ "gitHead": "cafe6c0c129954559c16afe53278d3ed9fb309d1"
62
62
  }