@yeeyoon/library 2.8.1 → 2.8.5
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.
@@ -8,11 +8,9 @@ const CommonTable = (props) => {
|
|
8
8
|
data,
|
9
9
|
dataTransform,
|
10
10
|
paginationKey = ['each_page', 'current_page'],
|
11
|
-
systemTags = [],
|
12
11
|
} = props;
|
13
12
|
const { rowKey, columns, reqFunc, reqParams, reqCbFn, ...rest } = data;
|
14
13
|
let sortData = {};
|
15
|
-
let filterData = {};
|
16
14
|
return (
|
17
15
|
<ProTable
|
18
16
|
rowKey={(record) => record[rowKey]}
|
@@ -34,9 +32,7 @@ const CommonTable = (props) => {
|
|
34
32
|
...rest,
|
35
33
|
...reqParams,
|
36
34
|
...sortData,
|
37
|
-
...filterData,
|
38
35
|
});
|
39
|
-
filterData = {};
|
40
36
|
const { total_data, data } = dataTransform ? dataTransform(resp) : resp;
|
41
37
|
if (reqCbFn) reqCbFn(params, { data, total: total_data });
|
42
38
|
return {
|
@@ -46,20 +42,6 @@ const CommonTable = (props) => {
|
|
46
42
|
};
|
47
43
|
}}
|
48
44
|
onChange={(pagination, filters, sorter) => {
|
49
|
-
if (filters) {
|
50
|
-
Object.keys(filters).forEach((key) => {
|
51
|
-
if (filters[key]) {
|
52
|
-
filterData[key] = filters[key];
|
53
|
-
}
|
54
|
-
});
|
55
|
-
filterData = {
|
56
|
-
filters: JSON.stringify({
|
57
|
-
system_tags: systemTags,
|
58
|
-
...filterData,
|
59
|
-
}),
|
60
|
-
};
|
61
|
-
rest.actionRef && rest.actionRef.current.reloadAndRest();
|
62
|
-
}
|
63
45
|
if (sorter.field) {
|
64
46
|
const { field, order, column } = sorter;
|
65
47
|
if (!column) sortData = {};
|
@@ -83,7 +65,6 @@ CommonTable.propTypes = {
|
|
83
65
|
data: PropTypes.object,
|
84
66
|
dataTransform: PropTypes.func,
|
85
67
|
paginationKey: PropTypes.array,
|
86
|
-
systemTags: PropTypes.array,
|
87
68
|
};
|
88
69
|
|
89
70
|
export default CommonTable;
|
@@ -6,6 +6,7 @@ import { Menu, Dropdown, Tooltip, Avatar, Drawer, Modal, Divider } from 'antd';
|
|
6
6
|
import {
|
7
7
|
UserOutlined,
|
8
8
|
SettingOutlined,
|
9
|
+
UsergroupAddOutlined,
|
9
10
|
PoweroffOutlined,
|
10
11
|
} from '@ant-design/icons';
|
11
12
|
// import Notification from '../Notification/recent';
|
@@ -27,6 +28,7 @@ import {
|
|
27
28
|
HOST_PROFILE_DASH_BOARD,
|
28
29
|
HOST_PROFILE_USER,
|
29
30
|
HOST_PROFILE_PASSWORD,
|
31
|
+
HOST_PROFILE_GROUP,
|
30
32
|
} from '../../config/env';
|
31
33
|
|
32
34
|
import LogoProfile from './assets/profile.svg';
|
@@ -89,6 +91,14 @@ const Header = (props) => {
|
|
89
91
|
>
|
90
92
|
修改密码
|
91
93
|
</Menu.Item>
|
94
|
+
<Menu.Item
|
95
|
+
icon={<UsergroupAddOutlined />}
|
96
|
+
onClick={() => {
|
97
|
+
window.location.href = `${HOST_PROFILE_GROUP}?token=${token}`;
|
98
|
+
}}
|
99
|
+
>
|
100
|
+
群组管理
|
101
|
+
</Menu.Item>
|
92
102
|
<Menu.Item
|
93
103
|
icon={<PoweroffOutlined />}
|
94
104
|
onClick={() => {
|
package/lib/config/env.js
CHANGED
@@ -121,6 +121,7 @@ export const HOST_PROFILE_MESSAGE = getEnvHost(
|
|
121
121
|
'profile',
|
122
122
|
'/message-center/home/list'
|
123
123
|
);
|
124
|
+
export const HOST_PROFILE_GROUP = getEnvHost('profile', '/user-profile/group');
|
124
125
|
export const HOST_ZHONGTAI_XLT = getEnvHost('zhongtai_cy');
|
125
126
|
export const HOST_ZHONGTAI_CY = getEnvHost('zhongtai_xlt');
|
126
127
|
|
package/lib/utils/request.js
CHANGED
@@ -7,7 +7,14 @@ import { notification } from 'antd';
|
|
7
7
|
const TOKEN_KEY = 'X-Auth-Token';
|
8
8
|
const ID_KEY = 'X-Auth-Id';
|
9
9
|
const REST_KEY = 'Login-Rest-Info';
|
10
|
-
const
|
10
|
+
const { search, hash } = window.location;
|
11
|
+
let searchQs = '';
|
12
|
+
if (search !== '') {
|
13
|
+
searchQs = search.slice(1);
|
14
|
+
} else if (hash !== '') {
|
15
|
+
searchQs = hash.split('?')[1] || '';
|
16
|
+
}
|
17
|
+
const qsData = qs.parse(searchQs);
|
11
18
|
const { token, userId, ...rest } = qsData;
|
12
19
|
|
13
20
|
token && ls.set(TOKEN_KEY, token);
|