@zgfe/business-lib 1.1.41-attribution.2 → 1.1.41-attribution.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.
- package/es/addToScene/index.js +1 -1
- package/es/constants/apis.js +1 -1
- package/es/demoWrapper/content.js +6 -6
- package/es/demoWrapper/index.js +3 -2
- package/es/eventSelector/demo/index.js +2 -1
- package/es/eventSelector/index.js +2 -1
- package/es/eventSelector/listPanel.js +14 -3
- package/es/eventSelector/option.d.ts +1 -0
- package/es/eventSelector/option.js +4 -2
- package/es/eventSelector/styles/index.less +6 -0
- package/es/eventSelector/types.d.ts +2 -0
- package/es/utils/ajax.js +1 -3
- package/package.json +2 -2
package/es/addToScene/index.js
CHANGED
package/es/constants/apis.js
CHANGED
|
@@ -109,16 +109,16 @@ var DemoContent = function DemoContent(_ref3) {
|
|
|
109
109
|
}, [loadEvent, loadEnv, loadUsers, loadUserGroups]);
|
|
110
110
|
function loadUserGroup() {
|
|
111
111
|
setLoadUserGroups(true);
|
|
112
|
-
ajax('/
|
|
112
|
+
ajax('/zg/web/v2/userGroup/getAll', {
|
|
113
113
|
method: 'post',
|
|
114
|
-
|
|
114
|
+
data: {
|
|
115
115
|
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.id,
|
|
116
116
|
platform: 0,
|
|
117
117
|
includeDefault: true,
|
|
118
118
|
includeToday: true
|
|
119
119
|
}
|
|
120
120
|
}).then(function (res) {
|
|
121
|
-
setUserGroups(res.
|
|
121
|
+
setUserGroups(res.data);
|
|
122
122
|
setLoadUserGroups(false);
|
|
123
123
|
});
|
|
124
124
|
}
|
|
@@ -151,14 +151,14 @@ var DemoContent = function DemoContent(_ref3) {
|
|
|
151
151
|
}
|
|
152
152
|
function loadEnvList() {
|
|
153
153
|
setLoadEnv(true);
|
|
154
|
-
ajax('/
|
|
154
|
+
ajax('/zg/web/v2/appusergroup/getEventEnvData', {
|
|
155
155
|
method: 'post',
|
|
156
|
-
|
|
156
|
+
data: {
|
|
157
157
|
app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.id,
|
|
158
158
|
platform: 0
|
|
159
159
|
}
|
|
160
160
|
}).then(function (res) {
|
|
161
|
-
setEnvList(res.
|
|
161
|
+
setEnvList(res.data.eventEnv);
|
|
162
162
|
setLoadEnv(false);
|
|
163
163
|
});
|
|
164
164
|
}
|
package/es/demoWrapper/index.js
CHANGED
|
@@ -36,8 +36,9 @@ var DemoWrapper = function DemoWrapper(_ref) {
|
|
|
36
36
|
getCurrentUser();
|
|
37
37
|
}, []);
|
|
38
38
|
function getCurrentUser() {
|
|
39
|
-
request('/
|
|
40
|
-
|
|
39
|
+
request('/zg/web/v2/user/getUserInfo').then(function (res) {
|
|
40
|
+
var _res$data;
|
|
41
|
+
if (res === null || (res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.ret) === '-1') setNotLogin(true);
|
|
41
42
|
}).catch(function (err) {
|
|
42
43
|
console.error('获取用户信息失败', err);
|
|
43
44
|
}).finally(function () {
|
|
@@ -42,7 +42,8 @@ var EventDemo = function EventDemo() {
|
|
|
42
42
|
showBuiltInTarget: true,
|
|
43
43
|
defaultValue: value,
|
|
44
44
|
alias: "\u522B\u540D",
|
|
45
|
-
onChange: onChange
|
|
45
|
+
onChange: onChange,
|
|
46
|
+
selectList: [24143017, 24256188, 24256187]
|
|
46
47
|
})), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u9009\u62E9\u7684\u4E8B\u4EF6\u662F\uFF1A", JSON.stringify(value))));
|
|
47
48
|
};
|
|
48
49
|
export default (function () {
|
|
@@ -108,7 +108,8 @@ var BizEventSelector = function BizEventSelector(props) {
|
|
|
108
108
|
onChange: onChange,
|
|
109
109
|
showOverview: showAllEvent,
|
|
110
110
|
showBuiltInTarget: props.showBuiltInTarget,
|
|
111
|
-
defaultSelectAble: defaultSelectAble
|
|
111
|
+
defaultSelectAble: defaultSelectAble,
|
|
112
|
+
selectList: props.selectList
|
|
112
113
|
});
|
|
113
114
|
},
|
|
114
115
|
trigger: ['click'],
|
|
@@ -31,6 +31,9 @@ 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]);
|
|
34
37
|
var _useState5 = useState(),
|
|
35
38
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
36
39
|
currentGroup = _useState6[0],
|
|
@@ -171,6 +174,7 @@ var EventListPanel = function EventListPanel(props) {
|
|
|
171
174
|
searchValue: searchValue,
|
|
172
175
|
currentGroup: currentGroup,
|
|
173
176
|
currentValue: currentValue,
|
|
177
|
+
selectList: props.selectList,
|
|
174
178
|
onClick: onClickEvent
|
|
175
179
|
}))));
|
|
176
180
|
};
|
|
@@ -180,7 +184,8 @@ var InfiniteScrollList = function InfiniteScrollList(_ref) {
|
|
|
180
184
|
searchValue = _ref.searchValue,
|
|
181
185
|
currentGroup = _ref.currentGroup,
|
|
182
186
|
currentValue = _ref.currentValue,
|
|
183
|
-
onClick = _ref.onClick
|
|
187
|
+
onClick = _ref.onClick,
|
|
188
|
+
selectList = _ref.selectList;
|
|
184
189
|
var _useState11 = useState([]),
|
|
185
190
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
186
191
|
showList = _useState12[0],
|
|
@@ -216,11 +221,17 @@ var InfiniteScrollList = function InfiniteScrollList(_ref) {
|
|
|
216
221
|
className: "".concat(classPrefix, "-event-item-wrap"),
|
|
217
222
|
key: Math.random()
|
|
218
223
|
}, showList.map(function (e) {
|
|
219
|
-
var _currentValue$event2;
|
|
224
|
+
var _currentValue$event2, _currentValue$event3;
|
|
225
|
+
var _disable = false;
|
|
226
|
+
console.log(666, e, selectList, selectList === null || selectList === void 0 ? void 0 : selectList.indexOf(e.id));
|
|
227
|
+
if ((selectList === null || selectList === void 0 ? void 0 : selectList.indexOf(e.id)) !== -1 && (currentValue === null || currentValue === void 0 ? void 0 : (_currentValue$event2 = currentValue.event) === null || _currentValue$event2 === void 0 ? void 0 : _currentValue$event2.id) !== e.id) {
|
|
228
|
+
_disable = true;
|
|
229
|
+
}
|
|
220
230
|
return /*#__PURE__*/React.createElement(EventListOption, {
|
|
221
231
|
label: e.alias || e.name,
|
|
222
232
|
key: "".concat(currentGroup === null || currentGroup === void 0 ? void 0 : currentGroup.id, "-").concat(e.id),
|
|
223
|
-
checked: (currentValue === null || currentValue === void 0 ? void 0 : (_currentValue$
|
|
233
|
+
checked: (currentValue === null || currentValue === void 0 ? void 0 : (_currentValue$event3 = currentValue.event) === null || _currentValue$event3 === void 0 ? void 0 : _currentValue$event3.id) === e.id,
|
|
234
|
+
disable: _disable,
|
|
224
235
|
highlight: {
|
|
225
236
|
enable: true,
|
|
226
237
|
text: searchValue
|
|
@@ -10,8 +10,10 @@ var EventListOption = function EventListOption(props) {
|
|
|
10
10
|
checked = props.checked,
|
|
11
11
|
highlight = props.highlight,
|
|
12
12
|
onClick = props.onClick,
|
|
13
|
-
data = props.data
|
|
13
|
+
data = props.data,
|
|
14
|
+
disable = props.disable;
|
|
14
15
|
var _onClick = function _onClick() {
|
|
16
|
+
if (disable) return;
|
|
15
17
|
if (onClick) onClick(data);
|
|
16
18
|
};
|
|
17
19
|
function getLabel(label) {
|
|
@@ -28,7 +30,7 @@ var EventListOption = function EventListOption(props) {
|
|
|
28
30
|
});
|
|
29
31
|
}
|
|
30
32
|
return /*#__PURE__*/React.createElement("div", {
|
|
31
|
-
className: "".concat(classPrefix, "-option ").concat(checked ? 'active' : ''),
|
|
33
|
+
className: "".concat(classPrefix, "-option ").concat(checked ? 'active' : '', " ").concat(disable ? 'disable' : ''),
|
|
32
34
|
onClick: _onClick
|
|
33
35
|
}, /*#__PURE__*/React.createElement("div", {
|
|
34
36
|
className: "".concat(classPrefix, "-option-label"),
|
|
@@ -30,6 +30,7 @@ export declare namespace EventSelectTypes {
|
|
|
30
30
|
size?: SizeType;
|
|
31
31
|
destroyPopupOnHide?: boolean;
|
|
32
32
|
onChange?: (val: Value) => void;
|
|
33
|
+
selectList?: number[];
|
|
33
34
|
}
|
|
34
35
|
interface DropdownProps {
|
|
35
36
|
value?: Value;
|
|
@@ -37,5 +38,6 @@ export declare namespace EventSelectTypes {
|
|
|
37
38
|
showBuiltInTarget?: boolean;
|
|
38
39
|
defaultSelectAble?: boolean;
|
|
39
40
|
onChange?: (value: Value, isOverview?: boolean) => void;
|
|
41
|
+
selectList?: number[];
|
|
40
42
|
}
|
|
41
43
|
}
|
package/es/utils/ajax.js
CHANGED
|
@@ -63,10 +63,8 @@ export function responseErrorHandler(url, apiResult, errorTitle, notifyType) {
|
|
|
63
63
|
flag = true;
|
|
64
64
|
} else if (new RegExp("".concat(ResponseStatus.notLogin)).test(apiResult.code)) {
|
|
65
65
|
message = '账户未登录或登录已失效';
|
|
66
|
-
window.location.href = '/webapp/app/login?destination=' + window.location.href;
|
|
67
66
|
} else if (new RegExp("".concat(ResponseStatus.noPermission)).test(apiResult.code)) {
|
|
68
|
-
|
|
69
|
-
throw new Error(apiResult.msg);
|
|
67
|
+
message = '账户没有权限';
|
|
70
68
|
}
|
|
71
69
|
if (!flag) {
|
|
72
70
|
message = apiResult.msg || message;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.1.41-attribution.
|
|
3
|
+
"version": "1.1.41-attribution.3",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"react": "^16.12.0 || ^17.0.0",
|
|
60
60
|
"yorkie": "^2.0.0"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "3887d8decfcf38b3702580350f5b54bb4a96ef68"
|
|
63
63
|
}
|