@zgfe/business-lib 1.1.41-attribution.4 → 1.1.41-attribution.6
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.
- package/config.js +41 -0
- package/es/addToPanel/demo/edit.js +5 -3
- package/es/addToPanel/index.js +1 -4
- package/es/addToPanel/types.d.ts +2 -2
- package/es/addToScene/index.js +3 -13
- package/es/addToScene/types.d.ts +1 -1
- package/es/attributeSelector/demo/index.js +4 -2
- package/es/constants/apis.d.ts +2 -0
- package/es/constants/apis.js +3 -1
- package/es/context/index.d.ts +1 -0
- package/es/datePicker/demo/day.js +12 -1
- package/es/datePicker/index.js +16 -6
- package/es/demoWrapper/content.d.ts +2 -1
- package/es/demoWrapper/content.js +13 -12
- package/es/demoWrapper/head.js +4 -4
- package/es/demoWrapper/index.js +4 -2
- package/es/demoWrapper/types.d.ts +2 -0
- package/es/eventSelector/listPanel.js +0 -3
- package/es/index.d.ts +3 -1
- package/es/index.js +3 -1
- package/es/layout/optionTitle/components/btnMenu/api.d.ts +4 -0
- package/es/layout/optionTitle/components/btnMenu/api.js +7 -0
- package/es/layout/optionTitle/components/btnMenu/demo.d.ts +2 -0
- package/es/layout/optionTitle/components/btnMenu/demo.js +80 -0
- package/es/layout/optionTitle/components/btnMenu/index.d.ts +5 -0
- package/es/layout/optionTitle/components/btnMenu/index.js +48 -0
- package/es/layout/optionTitle/components/btnMenu/index.less +18 -0
- package/es/layout/optionTitle/components/title/demo.d.ts +2 -0
- package/es/layout/optionTitle/components/title/demo.js +50 -0
- package/es/layout/optionTitle/components/title/index.d.ts +5 -0
- package/es/layout/optionTitle/components/title/index.js +106 -0
- package/es/layout/optionTitle/components/title/index.less +42 -0
- package/es/layout/optionTitle/data.d.ts +3 -0
- package/es/layout/optionTitle/data.js +77 -0
- package/es/layout/optionTitle/demo/index.d.ts +2 -0
- package/es/layout/optionTitle/demo/index.js +116 -0
- package/es/layout/optionTitle/demo/index.less +12 -0
- package/es/layout/optionTitle/demo/layout.d.ts +3 -0
- package/es/layout/optionTitle/demo/layout.js +41 -0
- package/es/layout/optionTitle/demo/panelCreate.d.ts +2 -0
- package/es/layout/optionTitle/demo/panelCreate.js +114 -0
- package/es/layout/optionTitle/index.d.ts +6 -0
- package/es/layout/optionTitle/index.js +155 -0
- package/es/layout/optionTitle/layout.d.ts +5 -0
- package/es/layout/optionTitle/layout.js +38 -0
- package/es/layout/optionTitle/styles/index.less +19 -0
- package/es/layout/optionTitle/styles/layout.less +43 -0
- package/es/layout/optionTitle/styles/search.less +27 -0
- package/es/layout/optionTitle/types.d.ts +85 -0
- package/es/layout/optionTitle/types.js +15 -0
- package/es/layout/optionTitle/typesValue.d.ts +4 -0
- package/es/layout/optionTitle/typesValue.js +7 -0
- package/es/utils/ajax.js +1 -1
- package/package.json +4 -3
package/config.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 对关键配置信息进行本地化存储,避免多人项目配置代码冲突
|
|
6
|
+
* @param defaultConfig
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
function getConfig(defaultConfig, basePath) {
|
|
10
|
+
const configPath = path.resolve(basePath, '.config.json');
|
|
11
|
+
let resConfig = defaultConfig;
|
|
12
|
+
try {
|
|
13
|
+
if (fs.existsSync(configPath)) {
|
|
14
|
+
const config = fs.readFileSync(configPath, 'utf-8');
|
|
15
|
+
if (!config || config === '{}') {
|
|
16
|
+
throw new Error('配置文件为空');
|
|
17
|
+
}
|
|
18
|
+
const configObj = JSON.parse(config);
|
|
19
|
+
// 如果读取的配置文件,数据结构与默认配置不一致,则更新配置文件,更新规则:以默认配置为准,保留用户自定义配置
|
|
20
|
+
const isSame = Object.keys(defaultConfig).every((key) => {
|
|
21
|
+
return configObj.hasOwnProperty(key);
|
|
22
|
+
});
|
|
23
|
+
if (!isSame) {
|
|
24
|
+
resConfig = Object.assign({}, defaultConfig, configObj);
|
|
25
|
+
throw new Error('配置文件数据结构不一致');
|
|
26
|
+
}
|
|
27
|
+
resConfig = configObj;
|
|
28
|
+
} else {
|
|
29
|
+
throw new Error('配置文件不存在');
|
|
30
|
+
}
|
|
31
|
+
} catch (e) {
|
|
32
|
+
console.log(e.message);
|
|
33
|
+
fs.writeFileSync(configPath, JSON.stringify(resConfig, null, 2));
|
|
34
|
+
}
|
|
35
|
+
console.log('配置详情', resConfig);
|
|
36
|
+
return resConfig;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
module.exports = {
|
|
40
|
+
getConfig,
|
|
41
|
+
};
|
|
@@ -5,7 +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, { useState } from 'react';
|
|
8
|
-
import { BizAddToPanel } from '@zgfe/business-lib';
|
|
8
|
+
import { BizAddToPanel, DemoWrapper } from '@zgfe/business-lib';
|
|
9
9
|
import { Button } from 'antd';
|
|
10
10
|
var chartTypes = [{
|
|
11
11
|
label: '趋势图',
|
|
@@ -53,7 +53,9 @@ export default (function () {
|
|
|
53
53
|
_useState2 = _slicedToArray(_useState, 2),
|
|
54
54
|
showDialog = _useState2[0],
|
|
55
55
|
setShowDialog = _useState2[1];
|
|
56
|
-
return /*#__PURE__*/React.createElement(
|
|
56
|
+
return /*#__PURE__*/React.createElement(DemoWrapper, {
|
|
57
|
+
needMeta: true
|
|
58
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
|
|
57
59
|
onClick: function onClick() {
|
|
58
60
|
setShowDialog(true);
|
|
59
61
|
}
|
|
@@ -69,5 +71,5 @@ export default (function () {
|
|
|
69
71
|
onOk: function onOk() {
|
|
70
72
|
setShowDialog(false);
|
|
71
73
|
}
|
|
72
|
-
}));
|
|
74
|
+
})));
|
|
73
75
|
});
|
package/es/addToPanel/index.js
CHANGED
|
@@ -216,10 +216,7 @@ var BizAddToPanel = function BizAddToPanel(props) {
|
|
|
216
216
|
rules: [{
|
|
217
217
|
validator: function validator(_, value) {
|
|
218
218
|
if (props.type === 'edit') {
|
|
219
|
-
|
|
220
|
-
message: '指标名称不能为空'
|
|
221
|
-
});
|
|
222
|
-
return Promise.reject();
|
|
219
|
+
return Promise.resolve();
|
|
223
220
|
}
|
|
224
221
|
if (!value || !/\S+/.test(value)) return Promise.reject('请输入指标名称!');
|
|
225
222
|
if (!/^[\S\s]{1,20}$/.test(value)) return Promise.reject('指标名称最多为20个字符!');
|
package/es/addToPanel/types.d.ts
CHANGED
package/es/addToScene/index.js
CHANGED
|
@@ -56,10 +56,10 @@ var BizAddToScene = function BizAddToScene(props) {
|
|
|
56
56
|
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
|
|
57
57
|
platform: 0,
|
|
58
58
|
groupId: form.group.groupId,
|
|
59
|
-
json:
|
|
59
|
+
json: {
|
|
60
60
|
chosen_data: [],
|
|
61
61
|
data: params
|
|
62
|
-
}
|
|
62
|
+
},
|
|
63
63
|
name: form.name
|
|
64
64
|
};
|
|
65
65
|
if (form.group.groupId === 0) {
|
|
@@ -70,21 +70,11 @@ var BizAddToScene = function BizAddToScene(props) {
|
|
|
70
70
|
data: data
|
|
71
71
|
}).then(function (res) {
|
|
72
72
|
setLoading(false);
|
|
73
|
-
|
|
74
|
-
if (result.code === 10001) {
|
|
73
|
+
if (res.data) {
|
|
75
74
|
notification.success({
|
|
76
75
|
message: '添加成功'
|
|
77
76
|
});
|
|
78
77
|
if (props.onOk) props.onOk(res);
|
|
79
|
-
} else if (result.code === -10010) {
|
|
80
|
-
notification.error({
|
|
81
|
-
message: '添加失败',
|
|
82
|
-
description: data.groupId === 0 ? '场景分类已存在' : '场景名称已存在'
|
|
83
|
-
});
|
|
84
|
-
} else {
|
|
85
|
-
notification.error({
|
|
86
|
-
message: '添加失败'
|
|
87
|
-
});
|
|
88
78
|
}
|
|
89
79
|
}).catch(function () {
|
|
90
80
|
setLoading(false);
|
package/es/addToScene/types.d.ts
CHANGED
|
@@ -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:
|
|
17
|
-
|
|
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],
|
package/es/constants/apis.d.ts
CHANGED
package/es/constants/apis.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
var Apis = {
|
|
2
2
|
querySceneGroup: '/zg/web/v2/scene/queryScenesOfGroup',
|
|
3
|
-
addScene: '/scene/addScene
|
|
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',
|
|
7
7
|
queryPanelGroup: '/apppanel/panels.jsp',
|
|
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',
|
package/es/context/index.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ export interface GlobalContextProps {
|
|
|
39
39
|
router?: any;
|
|
40
40
|
routes?: any;
|
|
41
41
|
envs?: Record<string, any>;
|
|
42
|
+
onMessage?: (type: string, data?: any, callback?: Function) => void;
|
|
42
43
|
system?: string;
|
|
43
44
|
}
|
|
44
45
|
declare const BizGlobalDataContext: import("react").Context<GlobalContextProps>;
|
|
@@ -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,18 @@ export default (function () {
|
|
|
27
33
|
return data;
|
|
28
34
|
});
|
|
29
35
|
};
|
|
30
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div",
|
|
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,
|
|
47
|
+
value: time,
|
|
37
48
|
defaultValue: time
|
|
38
49
|
}), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u503C\uFF1A", JSON.stringify(time)));
|
|
39
50
|
});
|
package/es/datePicker/index.js
CHANGED
|
@@ -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
|
-
|
|
43
|
+
if (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)
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import { AppInfoProps } from '../context';
|
|
2
|
+
import { AppInfoProps, GlobalContextProps } from '../context';
|
|
3
3
|
declare const DemoContent: React.FC<{
|
|
4
4
|
children?: ReactNode;
|
|
5
5
|
needMeta?: boolean;
|
|
6
6
|
currentApp?: AppInfoProps;
|
|
7
|
+
contextProps?: GlobalContextProps;
|
|
7
8
|
}>;
|
|
8
9
|
export default DemoContent;
|
|
@@ -49,7 +49,8 @@ function ajax(url, options) {
|
|
|
49
49
|
var DemoContent = function DemoContent(_ref3) {
|
|
50
50
|
var children = _ref3.children,
|
|
51
51
|
currentApp = _ref3.currentApp,
|
|
52
|
-
needMeta = _ref3.needMeta
|
|
52
|
+
needMeta = _ref3.needMeta,
|
|
53
|
+
contextProps = _ref3.contextProps;
|
|
53
54
|
var _useState = useState([]),
|
|
54
55
|
_useState2 = _slicedToArray(_useState, 2),
|
|
55
56
|
eventGroups = _useState2[0],
|
|
@@ -124,25 +125,25 @@ var DemoContent = function DemoContent(_ref3) {
|
|
|
124
125
|
}
|
|
125
126
|
function loadUserProps() {
|
|
126
127
|
setLoadUsers(true);
|
|
127
|
-
ajax('/
|
|
128
|
+
ajax('/zg/web/v2/appusergroup/getUserPropMeta', {
|
|
128
129
|
method: 'post',
|
|
129
|
-
|
|
130
|
-
|
|
130
|
+
data: {
|
|
131
|
+
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.id,
|
|
131
132
|
platform: 0
|
|
132
133
|
}
|
|
133
134
|
}).then(function (res) {
|
|
134
|
-
setUserProps(res.
|
|
135
|
+
setUserProps(res.data);
|
|
135
136
|
setLoadUsers(false);
|
|
136
137
|
});
|
|
137
138
|
}
|
|
138
139
|
function loadEvents() {
|
|
139
140
|
setLoadEvent(true);
|
|
140
|
-
ajax('/
|
|
141
|
+
ajax('/zg/web/v2/data/queryEventMetasOfGroup', {
|
|
141
142
|
method: 'post',
|
|
142
|
-
|
|
143
|
-
|
|
143
|
+
data: {
|
|
144
|
+
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.id,
|
|
144
145
|
platform: 0,
|
|
145
|
-
|
|
146
|
+
isAll: true
|
|
146
147
|
}
|
|
147
148
|
}).then(function (res) {
|
|
148
149
|
setEventGroups(res.data);
|
|
@@ -154,7 +155,7 @@ var DemoContent = function DemoContent(_ref3) {
|
|
|
154
155
|
ajax('/zg/web/v2/appusergroup/getEventEnvData', {
|
|
155
156
|
method: 'post',
|
|
156
157
|
data: {
|
|
157
|
-
|
|
158
|
+
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.id,
|
|
158
159
|
platform: 0
|
|
159
160
|
}
|
|
160
161
|
}).then(function (res) {
|
|
@@ -168,7 +169,7 @@ var DemoContent = function DemoContent(_ref3) {
|
|
|
168
169
|
});
|
|
169
170
|
}
|
|
170
171
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BizGlobalDataContext.Provider, {
|
|
171
|
-
value: {
|
|
172
|
+
value: _objectSpread({
|
|
172
173
|
currentApp: _objectSpread(_objectSpread({}, currentApp), {}, {
|
|
173
174
|
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.id
|
|
174
175
|
}),
|
|
@@ -178,7 +179,7 @@ var DemoContent = function DemoContent(_ref3) {
|
|
|
178
179
|
eventIdMap: store === null || store === void 0 ? void 0 : store.eventIdMap,
|
|
179
180
|
eventNameMap: store === null || store === void 0 ? void 0 : store.eventNameMap,
|
|
180
181
|
userGroupList: userGroups
|
|
181
|
-
}
|
|
182
|
+
}, contextProps)
|
|
182
183
|
}, children));
|
|
183
184
|
};
|
|
184
185
|
export default DemoContent;
|
package/es/demoWrapper/head.js
CHANGED
|
@@ -27,14 +27,14 @@ var DemoHeader = function DemoHeader(_ref) {
|
|
|
27
27
|
}, [loading, appList]);
|
|
28
28
|
function queryAppList() {
|
|
29
29
|
setLoading(true);
|
|
30
|
-
request('/
|
|
31
|
-
setAppList(res.
|
|
30
|
+
request('/zg/web/v2/data/v2ajaxGetDataByApp').then(function (res) {
|
|
31
|
+
setAppList(res.data.appList);
|
|
32
32
|
if (defaultApp) {
|
|
33
|
-
_onChange(res.
|
|
33
|
+
_onChange(res.data.appList.find(function (item) {
|
|
34
34
|
return item.id === defaultApp;
|
|
35
35
|
}));
|
|
36
36
|
}
|
|
37
|
-
if (!defaultApp && res.
|
|
37
|
+
if (!defaultApp && res.data.appList.length) _onChange(res.data.appList[0]);
|
|
38
38
|
}).finally(function () {
|
|
39
39
|
setLoading(false);
|
|
40
40
|
});
|
package/es/demoWrapper/index.js
CHANGED
|
@@ -15,7 +15,8 @@ var DemoWrapper = function DemoWrapper(_ref) {
|
|
|
15
15
|
var children = _ref.children,
|
|
16
16
|
className = _ref.className,
|
|
17
17
|
defaultApp = _ref.defaultApp,
|
|
18
|
-
needMeta = _ref.needMeta
|
|
18
|
+
needMeta = _ref.needMeta,
|
|
19
|
+
contextProps = _ref.contextProps;
|
|
19
20
|
var _useState = useState(true),
|
|
20
21
|
_useState2 = _slicedToArray(_useState, 2),
|
|
21
22
|
loading = _useState2[0],
|
|
@@ -70,7 +71,8 @@ var DemoWrapper = function DemoWrapper(_ref) {
|
|
|
70
71
|
}) : /*#__PURE__*/React.createElement(DemoContent, {
|
|
71
72
|
currentApp: app,
|
|
72
73
|
needMeta: needMeta,
|
|
73
|
-
key: app === null || app === void 0 ? void 0 : app.appId
|
|
74
|
+
key: app === null || app === void 0 ? void 0 : app.appId,
|
|
75
|
+
contextProps: contextProps
|
|
74
76
|
}, children));
|
|
75
77
|
};
|
|
76
78
|
export default DemoWrapper;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
+
import { GlobalContextProps } from '../context';
|
|
2
3
|
declare namespace DemoWrapperTypes {
|
|
3
4
|
interface Props {
|
|
4
5
|
className?: string;
|
|
5
6
|
defaultApp?: number;
|
|
6
7
|
needMeta?: boolean;
|
|
7
8
|
children?: ReactNode;
|
|
9
|
+
contextProps?: GlobalContextProps;
|
|
8
10
|
}
|
|
9
11
|
}
|
|
10
12
|
export declare const Props: React.FC<DemoWrapperTypes.Props>;
|
|
@@ -31,9 +31,6 @@ var EventListPanel = function EventListPanel(props) {
|
|
|
31
31
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
32
32
|
groupList = _useState4[0],
|
|
33
33
|
setGroupList = _useState4[1];
|
|
34
|
-
useEffect(function () {
|
|
35
|
-
console.log('groupList', groupList, props.selectList);
|
|
36
|
-
}, [groupList]);
|
|
37
34
|
var _useState5 = useState(),
|
|
38
35
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
39
36
|
currentGroup = _useState6[0],
|
package/es/index.d.ts
CHANGED
|
@@ -32,7 +32,9 @@ import DemoWrapper from './demoWrapper';
|
|
|
32
32
|
import SocketClient from './socket';
|
|
33
33
|
import BizAttrCondition from './attrCondition';
|
|
34
34
|
import BizAttrConditionGroup from './attrCondition/group';
|
|
35
|
-
|
|
35
|
+
import BizTargetFromPanel from './layout/optionTitle';
|
|
36
|
+
import { BizTargetFromPanelContext } from './layout/optionTitle/types';
|
|
37
|
+
export { BizTargetFromPanel, BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizDetailLayout, BizUserGroup, IconFont, ColorIcon, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetFromPanelContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizAttrCondition, BizAttrConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, SocketClient, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig, };
|
|
36
38
|
export type { UserGroupTypes } from './userGroup/types';
|
|
37
39
|
export type { BizSelectTypes } from './select/types';
|
|
38
40
|
export type { AttributeSelect } from './attributeSelector/types';
|
package/es/index.js
CHANGED
|
@@ -31,4 +31,6 @@ import DemoWrapper from './demoWrapper';
|
|
|
31
31
|
import SocketClient from './socket';
|
|
32
32
|
import BizAttrCondition from './attrCondition';
|
|
33
33
|
import BizAttrConditionGroup from './attrCondition/group';
|
|
34
|
-
|
|
34
|
+
import BizTargetFromPanel from './layout/optionTitle';
|
|
35
|
+
import { BizTargetFromPanelContext } from './layout/optionTitle/types';
|
|
36
|
+
export { BizTargetFromPanel, BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizDetailLayout, BizUserGroup, IconFont, ColorIcon, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetFromPanelContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizAttrCondition, BizAttrConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, SocketClient, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig };
|
|
@@ -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,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,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
|
+
}
|