@zgfe/business-lib 1.1.49 → 1.1.50-tag.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 (50) hide show
  1. package/es/addToPanel/index.js +26 -52
  2. package/es/addToPanel/types.d.ts +2 -2
  3. package/es/constants/apis.d.ts +4 -0
  4. package/es/constants/apis.js +8 -4
  5. package/es/index.d.ts +3 -1
  6. package/es/index.js +3 -1
  7. package/es/layout/optionTitle/components/btnMenu/api.d.ts +4 -0
  8. package/es/layout/optionTitle/components/btnMenu/api.js +7 -0
  9. package/es/layout/optionTitle/components/btnMenu/demo.d.ts +2 -0
  10. package/es/layout/optionTitle/components/btnMenu/demo.js +80 -0
  11. package/es/layout/optionTitle/components/btnMenu/index.d.ts +5 -0
  12. package/es/layout/optionTitle/components/btnMenu/index.js +48 -0
  13. package/es/layout/optionTitle/components/btnMenu/index.less +18 -0
  14. package/es/layout/optionTitle/components/title/demo.d.ts +2 -0
  15. package/es/layout/optionTitle/components/title/demo.js +50 -0
  16. package/es/layout/optionTitle/components/title/index.d.ts +5 -0
  17. package/es/layout/optionTitle/components/title/index.js +106 -0
  18. package/es/layout/optionTitle/components/title/index.less +42 -0
  19. package/es/layout/optionTitle/data.d.ts +3 -0
  20. package/es/layout/optionTitle/data.js +77 -0
  21. package/es/layout/optionTitle/demo/index.d.ts +2 -0
  22. package/es/layout/optionTitle/demo/index.js +116 -0
  23. package/es/layout/optionTitle/demo/index.less +12 -0
  24. package/es/layout/optionTitle/demo/layout.d.ts +3 -0
  25. package/es/layout/optionTitle/demo/layout.js +41 -0
  26. package/es/layout/optionTitle/demo/panelCreate.d.ts +2 -0
  27. package/es/layout/optionTitle/demo/panelCreate.js +114 -0
  28. package/es/layout/optionTitle/index.d.ts +6 -0
  29. package/es/layout/optionTitle/index.js +155 -0
  30. package/es/layout/optionTitle/layout.d.ts +5 -0
  31. package/es/layout/optionTitle/layout.js +38 -0
  32. package/es/layout/optionTitle/styles/index.less +19 -0
  33. package/es/layout/optionTitle/styles/layout.less +43 -0
  34. package/es/layout/optionTitle/styles/search.less +27 -0
  35. package/es/layout/optionTitle/types.d.ts +85 -0
  36. package/es/layout/optionTitle/types.js +15 -0
  37. package/es/layout/optionTitle/typesValue.d.ts +4 -0
  38. package/es/layout/optionTitle/typesValue.js +7 -0
  39. package/es/userCondition/conditions/tagsCondition.js +4 -8
  40. package/es/userCondition/demo/index.js +19 -8
  41. package/es/userCondition/demo/mockData.d.ts +8 -1
  42. package/es/userCondition/demo/mockData.js +32 -1
  43. package/es/userTagsSelector/cascaderOverlay.js +168 -84
  44. package/es/userTagsSelector/components/tagList/index.d.ts +13 -0
  45. package/es/userTagsSelector/components/tagList/index.js +65 -0
  46. package/es/userTagsSelector/components/tagList/index.less +13 -0
  47. package/es/userTagsSelector/demo/index.js +45 -43
  48. package/es/userTagsSelector/groups/index.js +3 -7
  49. package/es/userTagsSelector/types.d.ts +37 -0
  50. package/package.json +2 -2
@@ -1,9 +1,3 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
1
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
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."); }
9
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); }
@@ -50,9 +44,9 @@ var BizAddToPanel = function BizAddToPanel(props) {
50
44
  request(Apis.queryPanelGroup, {
51
45
  method: 'post',
52
46
  data: {
53
- app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
47
+ appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
54
48
  platform: (currentApp === null || currentApp === void 0 ? void 0 : currentApp.platform) || 0,
55
- role_type: 3
49
+ roleType: 3
56
50
  }
57
51
  }).then(function (res) {
58
52
  if (!res) {
@@ -61,7 +55,7 @@ var BizAddToPanel = function BizAddToPanel(props) {
61
55
  });
62
56
  return;
63
57
  }
64
- setGroupList(res.panels || []);
58
+ setGroupList(res.data || []);
65
59
  }).catch(function () {
66
60
  notification.error({
67
61
  message: '获取看板列表失败'
@@ -96,22 +90,22 @@ var BizAddToPanel = function BizAddToPanel(props) {
96
90
  if (props.type === 'edit') {
97
91
  data = {
98
92
  name: form.name,
99
- panel_id: form.panel.id,
100
- element_id: props.elementId,
101
- web_data: JSON.stringify(resData)
93
+ panelId: form.panel.id,
94
+ elementId: props.elementId,
95
+ webData: JSON.stringify(resData)
102
96
  };
103
97
  } else {
104
98
  data = {
105
99
  name: form.name,
106
- panel_id: form.panel.id,
107
- web_data: JSON.stringify(resData),
108
- mobile_data: JSON.stringify(resData)
100
+ panelId: form.panel.id,
101
+ webData: JSON.stringify(resData),
102
+ mobileData: JSON.stringify(resData)
109
103
  };
110
104
  if (form.panel.id === 0) {
111
- data.app_id = currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId;
105
+ data.appId = currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId;
112
106
  data.platform = (currentApp === null || currentApp === void 0 ? void 0 : currentApp.platform) || 0;
113
- data.panel_name = form.panel.name;
114
- data.open_type = form.panel.open_type;
107
+ data.panelName = form.panel.name;
108
+ data.openType = form.panel.open_type;
115
109
  }
116
110
  url = Apis.addPanel;
117
111
  msgType = '添加';
@@ -122,44 +116,24 @@ var BizAddToPanel = function BizAddToPanel(props) {
122
116
  }).then(function (res) {
123
117
  setLoading(false);
124
118
  var result = res;
125
- if (result.flag === 101) {
126
- var _result$panel2;
127
- notification.success({
128
- message: /*#__PURE__*/React.createElement(React.Fragment, null, msgType, "\u81F3", /*#__PURE__*/React.createElement("a", {
129
- onClick: function onClick() {
130
- var _result$panel;
131
- if (router && routes) router.push({
132
- name: routes.panel,
133
- params: {
134
- panelId: ((_result$panel = result.panel) === null || _result$panel === void 0 ? void 0 : _result$panel.id) || form.panel.id
135
- }
136
- });
137
- }
138
- }, form.panel.name || ((_result$panel2 = result.panel) === null || _result$panel2 === void 0 ? void 0 : _result$panel2.name)), "\u6210\u529F")
139
- });
140
- if (props.onOk) {
141
- var responseData = data;
142
- if (props.type !== 'edit') {
143
- var _result$panel3;
144
- responseData = _objectSpread({
145
- panelId: ((_result$panel3 = result.panel) === null || _result$panel3 === void 0 ? void 0 : _result$panel3.id) || form.panel.id
146
- }, result.panel_element);
147
- if (form.panel.id === 0) {
148
- responseData.panel = _objectSpread({}, result.panel);
149
- }
150
- }
151
- props.onOk(responseData);
152
- }
153
- } else if (result.flag === -101) {
154
- notification.error({
155
- message: '添加失败',
156
- description: data.panel_id === 0 ? '看板已存在' : '看板名称已存在'
157
- });
158
- } else {
119
+ if (!res) {
159
120
  notification.error({
160
121
  message: "".concat(msgType, "\u5931\u8D25")
161
122
  });
123
+ return;
162
124
  }
125
+ notification.success({
126
+ message: /*#__PURE__*/React.createElement(React.Fragment, null, msgType, "\u81F3", /*#__PURE__*/React.createElement("a", {
127
+ onClick: function onClick() {
128
+ if (router && routes) router.push({
129
+ name: routes.panel,
130
+ params: {
131
+ panelId: result.data.id || form.panel.id
132
+ }
133
+ });
134
+ }
135
+ }, form.panel.name || result.data.name), "\u6210\u529F")
136
+ });
163
137
  }).catch(function () {
164
138
  setLoading(false);
165
139
  });
@@ -21,8 +21,8 @@ declare namespace AddToPanel {
21
21
  }
22
22
  interface PanelValue {
23
23
  id: number;
24
- name: string;
25
- open_type: number;
24
+ name?: string;
25
+ open_type?: number;
26
26
  }
27
27
  export interface Value {
28
28
  panel: PanelValue;
@@ -5,6 +5,8 @@ declare const Apis: {
5
5
  addPanel: string;
6
6
  updatePanelTarget: string;
7
7
  queryPanelGroup: string;
8
+ delPanelElement: string;
9
+ updateElementName: string;
8
10
  queryDatasetList: string;
9
11
  queryDatasetDetail: string;
10
12
  getSocketToken: string;
@@ -13,5 +15,7 @@ declare const Apis: {
13
15
  orderAttributeSon: string;
14
16
  bizDataAttrList: string;
15
17
  dataAttrValue: string;
18
+ queryTagsByGroup: string;
19
+ queryTagGroups: string;
16
20
  };
17
21
  export default Apis;
@@ -2,9 +2,11 @@ var Apis = {
2
2
  querySceneGroup: '/scene/queryScenesOfGroup.jsp',
3
3
  addScene: '/scene/addScene.jsp',
4
4
  esQuery: '/data/queryEsData.jsp',
5
- addPanel: '/apppanel/addPanelElement.jsp',
6
- updatePanelTarget: '/apppanel/updateElemet.jsp',
7
- queryPanelGroup: '/apppanel/panels.jsp',
5
+ addPanel: '/apppanel/addPanelElement',
6
+ updatePanelTarget: '/apppanel/updateElemet',
7
+ queryPanelGroup: '/apppanel/panels',
8
+ delPanelElement: '/apppanel/delPanelElement.jsp',
9
+ updateElementName: '/apppanel/updateElementName.jsp',
8
10
  queryDatasetList: '/zg/web/cdp/inner/dataset/list',
9
11
  queryDatasetDetail: '/zg/web/cdp/inner/dataset/detail',
10
12
  getSocketToken: '/zg/web/v2/tracking/view/websocket/token',
@@ -12,6 +14,8 @@ var Apis = {
12
14
  orderAttributeMaster: '/cep-console/api/v1/cdp/orderAttribute/master',
13
15
  orderAttributeSon: '/cep-console/api/v1/cdp/orderAttribute/son',
14
16
  bizDataAttrList: '/cep-console/api/v1/bizdata/attr/list',
15
- dataAttrValue: '/cep-console/api/v1/es/data/attr/value'
17
+ dataAttrValue: '/cep-console/api/v1/es/data/attr/value',
18
+ queryTagsByGroup: '/zg/web/v2/v4/labelGroup/label/list',
19
+ queryTagGroups: '/zg/web/v2/label/group/list'
16
20
  };
17
21
  export default Apis;
package/es/index.d.ts CHANGED
@@ -30,7 +30,9 @@ import BizDetailLayout from './layout/detail';
30
30
  import BizLoginForm from './loginForm';
31
31
  import DemoWrapper from './demoWrapper';
32
32
  import SocketClient from './socket';
33
- export { BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizDetailLayout, BizUserGroup, IconFont, ColorIcon, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, SocketClient, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig, };
33
+ import BizTargetFromPanel from './layout/optionTitle';
34
+ 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, };
34
36
  export type { UserGroupTypes } from './userGroup/types';
35
37
  export type { BizSelectTypes } from './select/types';
36
38
  export type { AttributeSelect } from './attributeSelector/types';
package/es/index.js CHANGED
@@ -29,4 +29,6 @@ import BizDetailLayout from './layout/detail';
29
29
  import BizLoginForm from './loginForm';
30
30
  import DemoWrapper from './demoWrapper';
31
31
  import SocketClient from './socket';
32
- export { BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizDetailLayout, BizUserGroup, IconFont, ColorIcon, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, SocketClient, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig };
32
+ import BizTargetFromPanel from './layout/optionTitle';
33
+ 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 };
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { BizOptionTitleProps } from '../../types';
3
+ export declare const BtnMenuProps_: React.FC<BizOptionTitleProps.BtnMenuProps>;
4
+ export declare const BtnItem_: React.FC<BizOptionTitleProps.BtnItem>;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export var BtnMenuProps_ = function BtnMenuProps_() {
3
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
4
+ };
5
+ export var BtnItem_ = function BtnItem_() {
6
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
7
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,80 @@
1
+ import React from 'react';
2
+ import BizBtnMenu from '.';
3
+ import { IconFont } from '../../../..';
4
+ var menu = [{
5
+ key: '10',
6
+ label: '下载',
7
+ itemType: 'dropdownBtn',
8
+ type: 'default',
9
+ children: [{
10
+ key: '100',
11
+ label: 'JPG',
12
+ onClick: function onClick() {
13
+ console.log('JPG');
14
+ }
15
+ }, {
16
+ key: '101',
17
+ label: 'PNG',
18
+ onClick: function onClick() {
19
+ console.log('PNG');
20
+ }
21
+ }]
22
+ }, {
23
+ key: '11',
24
+ label: /*#__PURE__*/React.createElement("a", {
25
+ style: {
26
+ width: 32,
27
+ height: 32,
28
+ color: '#5f6085',
29
+ fontSize: 16,
30
+ textAlign: 'center',
31
+ transform: 'rotate(90deg)'
32
+ }
33
+ }, /*#__PURE__*/React.createElement(IconFont, {
34
+ type: "gengduocaozuo1"
35
+ })),
36
+ itemType: 'dropdown',
37
+ type: 'default',
38
+ children: [{
39
+ key: '110',
40
+ label: '编辑',
41
+ onClick: function onClick() {
42
+ console.log('编辑');
43
+ }
44
+ }, {
45
+ key: '111',
46
+ label: '删除',
47
+ onClick: function onClick() {
48
+ console.log('删除');
49
+ }
50
+ }]
51
+ }, {
52
+ key: '12',
53
+ label: '',
54
+ itemType: 'divider'
55
+ }, {
56
+ key: '1',
57
+ label: '测试按钮1',
58
+ onClick: function onClick() {
59
+ console.log('测试按钮1');
60
+ }
61
+ }, {
62
+ key: '2',
63
+ label: '测试按钮2',
64
+ type: 'text',
65
+ onClick: function onClick() {
66
+ console.log('测试按钮2');
67
+ }
68
+ }, {
69
+ key: '3',
70
+ label: '测试按钮3',
71
+ disabled: true,
72
+ onClick: function onClick() {
73
+ console.log('测试按钮3');
74
+ }
75
+ }];
76
+ export default (function () {
77
+ return /*#__PURE__*/React.createElement(BizBtnMenu, {
78
+ menu: menu
79
+ });
80
+ });
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { BizOptionTitleProps } from '../../types';
3
+ import './index.less';
4
+ export declare const BizBtnMenu: React.FC<BizOptionTitleProps.BtnMenuProps>;
5
+ export default BizBtnMenu;
@@ -0,0 +1,48 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ import { Button, Dropdown } from 'antd';
8
+ import React from 'react';
9
+ import './index.less';
10
+ export var BizBtnMenu = function BizBtnMenu(props) {
11
+ var classPrefix = 'btn-menu';
12
+ return /*#__PURE__*/React.createElement("div", {
13
+ className: "".concat(classPrefix, " ").concat(props.className || '')
14
+ }, props.menu.map(function (item) {
15
+ var config = {
16
+ key: item.key,
17
+ type: item.type || 'primary',
18
+ disabled: item.disabled,
19
+ icon: item.icon,
20
+ className: "".concat(classPrefix, "-btn ").concat(item.className || ''),
21
+ onClick: item.onClick
22
+ };
23
+ switch (item.itemType) {
24
+ case 'dropdownBtn':
25
+ return /*#__PURE__*/React.createElement(Dropdown.Button, _objectSpread(_objectSpread({}, config), {}, {
26
+ overlayClassName: "".concat(item.overlayClassName || ''),
27
+ menu: {
28
+ items: item.children
29
+ }
30
+ }), item.label);
31
+ case 'dropdown':
32
+ return /*#__PURE__*/React.createElement(Dropdown, _objectSpread(_objectSpread({}, config), {}, {
33
+ overlayClassName: "".concat(item.overlayClassName || ''),
34
+ menu: {
35
+ items: item.children
36
+ }
37
+ }), item.label);
38
+ case 'divider':
39
+ return /*#__PURE__*/React.createElement("div", {
40
+ key: item.key,
41
+ className: "".concat(classPrefix, "-divider ").concat(item.className || '')
42
+ });
43
+ default:
44
+ return /*#__PURE__*/React.createElement(Button, _objectSpread({}, config), item.label);
45
+ }
46
+ }));
47
+ };
48
+ export default BizBtnMenu;
@@ -0,0 +1,18 @@
1
+ @import '~@zgfe/business-lib/es/assets/styles/variable.less';
2
+ .btn-menu {
3
+ display: flex;
4
+ align-items: center;
5
+
6
+ &-btn {
7
+ margin-right: 16px;
8
+ border-radius: @border-radius-small;
9
+ }
10
+
11
+ &-divider {
12
+ width: 1px;
13
+ height: 32px;
14
+ margin-right: 32px;
15
+ margin-left: 16px;
16
+ background-color: #ecedf0;
17
+ }
18
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,50 @@
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, { useState } from 'react';
8
+ import BizEditText from '.';
9
+ export default (function () {
10
+ var _useState = useState('洞察'),
11
+ _useState2 = _slicedToArray(_useState, 2),
12
+ title = _useState2[0],
13
+ setTitle = _useState2[1];
14
+ var _useState3 = useState('洞察'),
15
+ _useState4 = _slicedToArray(_useState3, 2),
16
+ title2 = _useState4[0],
17
+ setTitle2 = _useState4[1];
18
+ var onChange = function onChange(value) {
19
+ setTitle(value || '');
20
+ };
21
+ var onChange2 = function onChange2(value) {
22
+ setTitle2(value || '');
23
+ };
24
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h2", null, "\u8F93\u5165\u6846\u5931\u7126\u53D8\u4E3A\u6587\u672C"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("div", {
25
+ style: {
26
+ border: '1px solid #f5f5f5',
27
+ height: 60,
28
+ padding: 24,
29
+ display: 'flex',
30
+ alignItems: 'center'
31
+ }
32
+ }, /*#__PURE__*/React.createElement(BizEditText, {
33
+ name: "\u6D4B\u8BD5",
34
+ value: title,
35
+ onChange: onChange
36
+ })), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("h2", null, "\u8F93\u5165\u6846\u5931\u7126\u8FD8\u662F\u8F93\u5165\u6846"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("div", {
37
+ style: {
38
+ border: '1px solid #f5f5f5',
39
+ height: 60,
40
+ padding: 24,
41
+ display: 'flex',
42
+ alignItems: 'center'
43
+ }
44
+ }, /*#__PURE__*/React.createElement(BizEditText, {
45
+ name: "\u6D4B\u8BD52",
46
+ value: title2,
47
+ isInput: true,
48
+ onChange: onChange2
49
+ })));
50
+ });
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ import { BizOptionTitleProps } from '../../types';
4
+ declare const BizEditText: React.ForwardRefExoticComponent<BizOptionTitleProps.TitleProps & React.RefAttributes<any>>;
5
+ export default BizEditText;
@@ -0,0 +1,106 @@
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 { Input, message } from 'antd';
8
+ import React, { useImperativeHandle, useRef, useState } from 'react';
9
+ import './index.less';
10
+ import { IconFont } from '../../../..';
11
+ var BizEditText = /*#__PURE__*/React.forwardRef(function (props, ref) {
12
+ var classPrefix = 'biz-edit-text';
13
+ var inputRef = useRef(null);
14
+ var _useState = useState(props.value),
15
+ _useState2 = _slicedToArray(_useState, 2),
16
+ curTitle = _useState2[0],
17
+ setCurTitle = _useState2[1];
18
+ var _useState3 = useState(props.value),
19
+ _useState4 = _slicedToArray(_useState3, 2),
20
+ prevTitle = _useState4[0],
21
+ setPrevTitle = _useState4[1];
22
+ var _useState5 = useState(!props.value && props.canEdit),
23
+ _useState6 = _slicedToArray(_useState5, 2),
24
+ isEdit = _useState6[0],
25
+ setIsEdit = _useState6[1];
26
+ var _useState7 = useState(''),
27
+ _useState8 = _slicedToArray(_useState7, 2),
28
+ errorText = _useState8[0],
29
+ setErrorText = _useState8[1];
30
+ useImperativeHandle(ref, function () {
31
+ return {
32
+ setEdit: function setEdit() {
33
+ setIsEdit(true);
34
+ inputRef.current.focus();
35
+ }
36
+ };
37
+ });
38
+ var onBlur = function onBlur(e) {
39
+ var value = e.target.value.trim();
40
+ if (props.required && !value) {
41
+ inputRef.current.focus();
42
+ setErrorText("".concat(props.name || '名称', "\u4E0D\u80FD\u4E3A\u7A7A"));
43
+ props.onChange && props.onChange(value);
44
+ return;
45
+ }
46
+ if (value === prevTitle) {
47
+ setIsEdit(false);
48
+ return;
49
+ }
50
+ if (props.onService) {
51
+ props.onService(value, changeService);
52
+ } else {
53
+ setIsEdit(false);
54
+ props.onChange && props.onChange(value);
55
+ }
56
+ };
57
+ var changeService = function changeService(error, msg) {
58
+ if (error) {
59
+ if (!msg) {
60
+ setCurTitle(prevTitle);
61
+ } else {
62
+ setErrorText(msg);
63
+ }
64
+ } else {
65
+ setIsEdit(false);
66
+ setPrevTitle(curTitle);
67
+ message.success("".concat(props.name || '', "\u7F16\u8F91\u6210\u529F"));
68
+ }
69
+ };
70
+ var onChange = function onChange(e) {
71
+ setErrorText('');
72
+ setCurTitle(e.target.value.trim());
73
+ };
74
+ return /*#__PURE__*/React.createElement("div", {
75
+ className: classPrefix
76
+ }, isEdit || props.isInput ? /*#__PURE__*/React.createElement("div", {
77
+ className: "".concat(classPrefix, "-input")
78
+ }, /*#__PURE__*/React.createElement(Input, {
79
+ ref: inputRef,
80
+ className: "".concat(classPrefix, "-input-content"),
81
+ status: errorText && 'error',
82
+ value: curTitle,
83
+ required: props.required,
84
+ disabled: !props.canEdit,
85
+ autoFocus: !curTitle,
86
+ max: props.max,
87
+ placeholder: "\u8BF7\u8F93\u5165".concat(props.name || ''),
88
+ onBlur: onBlur,
89
+ onChange: onChange
90
+ }), errorText ? /*#__PURE__*/React.createElement("span", {
91
+ className: "".concat(classPrefix, "-error-tip")
92
+ }, errorText) : null) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
93
+ className: "".concat(classPrefix, "-content")
94
+ }, props.value), props.canEdit ? /*#__PURE__*/React.createElement(IconFont, {
95
+ className: "".concat(classPrefix, "-icon"),
96
+ type: "bianji1",
97
+ onClick: function onClick() {
98
+ setIsEdit(true);
99
+ }
100
+ }) : null));
101
+ });
102
+ BizEditText.defaultProps = {
103
+ required: true,
104
+ canEdit: true
105
+ };
106
+ export default BizEditText;
@@ -0,0 +1,42 @@
1
+ @import '~@zgfe/business-lib/es/assets/styles/inner.less';
2
+ .biz-edit-text {
3
+ display: flex;
4
+ align-items: center;
5
+ &-input {
6
+ position: relative;
7
+ width: 350px;
8
+ height: 100%;
9
+ .ant-input {
10
+ background-color: #fff !important;
11
+ border-color: #fff;
12
+ &:not(.ant-input-status-error):hover {
13
+ border-color: @primary-color!important;
14
+ }
15
+ &:not(.ant-input-status-error):focus {
16
+ border-color: @primary-color!important;
17
+ }
18
+ }
19
+ }
20
+ &-error-tip {
21
+ position: absolute;
22
+ top: 100%;
23
+ left: 0;
24
+ color: @error-color;
25
+ line-height: 1.2;
26
+ }
27
+
28
+ &-content {
29
+ display: inline-block;
30
+ max-width: 330px;
31
+ height: @height-sm;
32
+ color: @text-color;
33
+ font-size: 16px;
34
+ line-height: @height-sm;
35
+ .__default-overflow();
36
+ }
37
+ &-icon {
38
+ margin-left: @margin-xs;
39
+ color: @primary-color;
40
+ cursor: pointer;
41
+ }
42
+ }
@@ -0,0 +1,3 @@
1
+ import { BizOptionTitleProps } from './types';
2
+ export declare const panelBtn: (callback: Function, disabled?: boolean) => BizOptionTitleProps.BtnItem[];
3
+ export declare const panelCreateBtn: (callback: Function, disabled?: boolean) => BizOptionTitleProps.BtnItem[];