@zgfe/modules-settings 1.2.12 → 1.2.13
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/components/settingTabs/index.less +3 -0
- package/es/constants/api.d.ts +21 -0
- package/es/constants/api.js +26 -1
- package/es/constants/icons/demo.css +0 -0
- package/es/constants/icons/demo_index.html +0 -0
- package/es/constants/icons/iconfont.css +0 -0
- package/es/constants/icons/iconfont.js +0 -0
- package/es/constants/icons/iconfont.json +0 -0
- package/es/constants/icons/iconfont.ttf +0 -0
- package/es/constants/icons/iconfont.woff +0 -0
- package/es/constants/icons/iconfont.woff2 +0 -0
- package/es/modules/appSettings/demo/index.d.ts +3 -1
- package/es/modules/appSettings/demo/index.js +16 -12
- package/es/modules/appSettings/index.js +6 -7
- package/es/modules/appSettings/member/index.js +75 -82
- package/es/modules/appSettings/member/index.less +4 -1
- package/es/modules/appSettings/member/modal.js +1 -1
- package/es/modules/companySetting/appList/index.js +24 -21
- package/es/modules/companySetting/appList/index.less +22 -0
- package/es/modules/companySetting/cost/index.js +2 -2
- package/es/modules/companySetting/cost/index.less +7 -0
- package/es/modules/companySetting/demo.js +3 -4
- package/es/modules/companySetting/department/index.d.ts +7 -0
- package/es/modules/companySetting/department/index.js +414 -0
- package/es/modules/companySetting/department/index.less +157 -0
- package/es/modules/companySetting/index.d.ts +0 -2
- package/es/modules/companySetting/index.js +189 -372
- package/es/modules/companySetting/index.less +65 -0
- package/es/modules/companySetting/info/index.js +6 -1
- package/es/modules/companySetting/info/index.less +7 -0
- package/es/modules/companySetting/operationLog/index.js +10 -4
- package/es/modules/companySetting/operationLog/index.less +6 -0
- package/es/modules/companySetting/role/index.d.ts +6 -0
- package/es/modules/companySetting/role/index.js +716 -0
- package/es/modules/companySetting/role/index.less +220 -0
- package/es/modules/companySetting/style/common.less +13 -2
- package/es/modules/companySetting/user/index.d.ts +1 -0
- package/es/modules/companySetting/user/index.js +224 -278
- package/es/modules/companySetting/user/index.less +199 -10
- package/es/modules/companySetting/user/invite.d.ts +4 -8
- package/es/modules/companySetting/user/invite.js +335 -174
- package/es/modules/companySetting/userGroup/groupItem.js +1 -1
- package/es/modules/companySetting/virtualApp/panels/list.js +1 -1
- package/es/modules/companySetting/wechatBinding/index.js +1 -1
- package/es/modules/companySetting/wechatBinding/index.less +10 -0
- package/es/modules/systemSetting/demo.d.ts +3 -0
- package/es/modules/systemSetting/demo.js +10 -0
- package/es/modules/systemSetting/notice/configItem/index.js +5 -1
- package/es/requests/department.d.ts +15 -0
- package/es/requests/department.js +68 -0
- package/es/requests/role.d.ts +25 -0
- package/es/requests/role.js +100 -0
- package/es/types/companySetting.d.ts +29 -2
- package/es/utils/util.d.ts +29 -0
- package/es/utils/util.js +77 -0
- package/package.json +5 -5
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Button, Col, Descriptions, Row } from 'antd';
|
|
2
2
|
import { EditOutlined } from '@ant-design/icons';
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { useContext } from 'react';
|
|
4
4
|
import './index.less';
|
|
5
|
+
import { BizGlobalDataContext } from '@zgfe/business-lib';
|
|
5
6
|
var ConfigItem = function ConfigItem(_ref) {
|
|
6
7
|
var _configFieldMap$get;
|
|
7
8
|
var onEdit = _ref.onEdit,
|
|
@@ -19,6 +20,8 @@ var ConfigItem = function ConfigItem(_ref) {
|
|
|
19
20
|
name: 'fromName',
|
|
20
21
|
value: '发件人昵称'
|
|
21
22
|
}]);
|
|
23
|
+
var _useContext = useContext(BizGlobalDataContext),
|
|
24
|
+
authority = _useContext.authority;
|
|
22
25
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Row, {
|
|
23
26
|
className: "item-title"
|
|
24
27
|
}, /*#__PURE__*/React.createElement(Col, {
|
|
@@ -29,6 +32,7 @@ var ConfigItem = function ConfigItem(_ref) {
|
|
|
29
32
|
className: "title-right"
|
|
30
33
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
31
34
|
type: "primary",
|
|
35
|
+
disabled: !authority[10085],
|
|
32
36
|
onClick: function onClick() {
|
|
33
37
|
return onEdit(item);
|
|
34
38
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const queryDeptList: (data: {
|
|
2
|
+
name: string;
|
|
3
|
+
}) => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<unknown> | null>, getGroupMembers: () => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<unknown> | null>, addDept: (data: {
|
|
4
|
+
deptBoss: string;
|
|
5
|
+
parentId: number;
|
|
6
|
+
id: number | null;
|
|
7
|
+
name: string;
|
|
8
|
+
}) => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<unknown> | null>, updateDept: (data: {
|
|
9
|
+
deptBoss: string;
|
|
10
|
+
parentId: number;
|
|
11
|
+
id: number | null;
|
|
12
|
+
name: string;
|
|
13
|
+
}) => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<unknown> | null>, deleteDept: (data: {
|
|
14
|
+
ids: number[];
|
|
15
|
+
}) => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<unknown> | null>;
|
|
@@ -0,0 +1,68 @@
|
|
|
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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
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 api from '../constants/api';
|
|
8
|
+
import { ajax } from '@zgfe/business-lib';
|
|
9
|
+
import apis from '../constants/api';
|
|
10
|
+
var Department = /*#__PURE__*/function () {
|
|
11
|
+
function Department() {
|
|
12
|
+
_classCallCheck(this, Department);
|
|
13
|
+
}
|
|
14
|
+
_createClass(Department, [{
|
|
15
|
+
key: "queryDeptList",
|
|
16
|
+
value:
|
|
17
|
+
// 部门列表
|
|
18
|
+
function queryDeptList(data) {
|
|
19
|
+
return ajax(api.setting.queryDeptList, {
|
|
20
|
+
method: 'post',
|
|
21
|
+
data: data
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
// 负责人列表
|
|
25
|
+
}, {
|
|
26
|
+
key: "getGroupMembers",
|
|
27
|
+
value: function getGroupMembers() {
|
|
28
|
+
return ajax(apis.setting.getGroupMembers, {
|
|
29
|
+
method: 'get'
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
// 添加
|
|
33
|
+
}, {
|
|
34
|
+
key: "addDept",
|
|
35
|
+
value: function addDept(data) {
|
|
36
|
+
return ajax(api.setting.addDept, {
|
|
37
|
+
method: 'post',
|
|
38
|
+
data: data
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
// 修改
|
|
42
|
+
}, {
|
|
43
|
+
key: "updateDept",
|
|
44
|
+
value: function updateDept(data) {
|
|
45
|
+
return ajax(api.setting.updateDept, {
|
|
46
|
+
method: 'post',
|
|
47
|
+
data: data
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
// 删除
|
|
51
|
+
}, {
|
|
52
|
+
key: "deleteDept",
|
|
53
|
+
value: function deleteDept(data) {
|
|
54
|
+
return ajax(api.setting.deleteDept, {
|
|
55
|
+
method: 'post',
|
|
56
|
+
data: data
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}]);
|
|
60
|
+
return Department;
|
|
61
|
+
}();
|
|
62
|
+
var _Department = new Department(),
|
|
63
|
+
queryDeptList = _Department.queryDeptList,
|
|
64
|
+
getGroupMembers = _Department.getGroupMembers,
|
|
65
|
+
addDept = _Department.addDept,
|
|
66
|
+
updateDept = _Department.updateDept,
|
|
67
|
+
deleteDept = _Department.deleteDept;
|
|
68
|
+
export { queryDeptList, getGroupMembers, addDept, updateDept, deleteDept };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const queryRolePage: (data: {
|
|
2
|
+
name: string;
|
|
3
|
+
pageNo: number;
|
|
4
|
+
pageSize: number;
|
|
5
|
+
}) => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<unknown> | null>, queryRoleDetails: (data: {
|
|
6
|
+
id: number | null;
|
|
7
|
+
}) => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<{
|
|
8
|
+
appIds: number[];
|
|
9
|
+
userIds: number[];
|
|
10
|
+
menuCodeMap: {};
|
|
11
|
+
settingMenuList: [];
|
|
12
|
+
}> | null>, queryRoleDataConfig: (data: {
|
|
13
|
+
id: number | null;
|
|
14
|
+
}) => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<unknown> | null>, queryRoleMenuTree: (data: {
|
|
15
|
+
id: number | null;
|
|
16
|
+
systemVersion: number | null;
|
|
17
|
+
}) => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<unknown> | null>, queryCompanyUser: (data: {
|
|
18
|
+
id: number | null;
|
|
19
|
+
}) => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<unknown> | null>, addRole: (data: {
|
|
20
|
+
id: number | null;
|
|
21
|
+
}) => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<unknown> | null>, updateRole: (data: {
|
|
22
|
+
id: number | null;
|
|
23
|
+
}) => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<unknown> | null>, deleteRole: (data: {
|
|
24
|
+
id: number | null;
|
|
25
|
+
}) => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<unknown> | null>;
|
|
@@ -0,0 +1,100 @@
|
|
|
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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
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 api from '../constants/api';
|
|
8
|
+
import { ajax } from '@zgfe/business-lib';
|
|
9
|
+
import apis from '../constants/api';
|
|
10
|
+
var Department = /*#__PURE__*/function () {
|
|
11
|
+
function Department() {
|
|
12
|
+
_classCallCheck(this, Department);
|
|
13
|
+
}
|
|
14
|
+
_createClass(Department, [{
|
|
15
|
+
key: "queryRolePage",
|
|
16
|
+
value:
|
|
17
|
+
// 列表
|
|
18
|
+
function queryRolePage(data) {
|
|
19
|
+
return ajax(api.setting.queryRolePage, {
|
|
20
|
+
method: 'post',
|
|
21
|
+
data: data
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
// 详情
|
|
25
|
+
}, {
|
|
26
|
+
key: "queryRoleDetails",
|
|
27
|
+
value: function queryRoleDetails(data) {
|
|
28
|
+
return ajax(apis.setting.queryRoleDetails, {
|
|
29
|
+
method: 'post',
|
|
30
|
+
data: data
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
// 应用下拉数据
|
|
34
|
+
}, {
|
|
35
|
+
key: "queryRoleDataConfig",
|
|
36
|
+
value: function queryRoleDataConfig(data) {
|
|
37
|
+
return ajax(api.setting.queryRoleDataConfig, {
|
|
38
|
+
method: 'post',
|
|
39
|
+
data: data
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
// 菜单下拉数据
|
|
43
|
+
}, {
|
|
44
|
+
key: "queryRoleMenuTree",
|
|
45
|
+
value: function queryRoleMenuTree(data) {
|
|
46
|
+
return ajax(api.setting.queryRoleMenuTree, {
|
|
47
|
+
method: 'post',
|
|
48
|
+
data: data
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
// 用户下拉数据
|
|
52
|
+
}, {
|
|
53
|
+
key: "queryCompanyUser",
|
|
54
|
+
value: function queryCompanyUser(data) {
|
|
55
|
+
return ajax(api.setting.queryCompanyUser, {
|
|
56
|
+
method: 'post',
|
|
57
|
+
data: data
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
// queryCompanyUser
|
|
61
|
+
// 修改
|
|
62
|
+
}, {
|
|
63
|
+
key: "addRole",
|
|
64
|
+
value: function addRole(data) {
|
|
65
|
+
return ajax(api.setting.addRole, {
|
|
66
|
+
method: 'post',
|
|
67
|
+
data: data
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
// 修改
|
|
71
|
+
}, {
|
|
72
|
+
key: "updateRole",
|
|
73
|
+
value: function updateRole(data) {
|
|
74
|
+
return ajax(api.setting.updateRole, {
|
|
75
|
+
method: 'post',
|
|
76
|
+
data: data
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
// 删除
|
|
80
|
+
}, {
|
|
81
|
+
key: "deleteRole",
|
|
82
|
+
value: function deleteRole(data) {
|
|
83
|
+
return ajax(api.setting.deleteRole, {
|
|
84
|
+
method: 'post',
|
|
85
|
+
data: data
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}]);
|
|
89
|
+
return Department;
|
|
90
|
+
}();
|
|
91
|
+
var _Department = new Department(),
|
|
92
|
+
queryRolePage = _Department.queryRolePage,
|
|
93
|
+
queryRoleDetails = _Department.queryRoleDetails,
|
|
94
|
+
queryRoleDataConfig = _Department.queryRoleDataConfig,
|
|
95
|
+
queryRoleMenuTree = _Department.queryRoleMenuTree,
|
|
96
|
+
queryCompanyUser = _Department.queryCompanyUser,
|
|
97
|
+
addRole = _Department.addRole,
|
|
98
|
+
updateRole = _Department.updateRole,
|
|
99
|
+
deleteRole = _Department.deleteRole;
|
|
100
|
+
export { queryRolePage, queryRoleDetails, queryRoleDataConfig, queryRoleMenuTree, queryCompanyUser, addRole, updateRole, deleteRole };
|
|
@@ -10,6 +10,11 @@ export interface AllGroupInfosItem {
|
|
|
10
10
|
createOn?: number;
|
|
11
11
|
isEncryption?: number;
|
|
12
12
|
}
|
|
13
|
+
export interface queryPanelItem {
|
|
14
|
+
email?: string;
|
|
15
|
+
username?: string;
|
|
16
|
+
roleId?: number;
|
|
17
|
+
}
|
|
13
18
|
export interface AllGroupInfosItemMembersItem {
|
|
14
19
|
userId: number;
|
|
15
20
|
username?: string;
|
|
@@ -35,6 +40,21 @@ export interface AppListItem {
|
|
|
35
40
|
data_source?: AppListItemSourceItem[];
|
|
36
41
|
apps: Array<AppListItemAppsItem>;
|
|
37
42
|
}
|
|
43
|
+
export interface DepartmentItem {
|
|
44
|
+
id: number;
|
|
45
|
+
value: number;
|
|
46
|
+
key: string;
|
|
47
|
+
createdTime: Date;
|
|
48
|
+
disabled: boolean;
|
|
49
|
+
defaultRowKeys: string[];
|
|
50
|
+
children?: DepartmentItem[];
|
|
51
|
+
deptBoss: string;
|
|
52
|
+
description: string;
|
|
53
|
+
level: number;
|
|
54
|
+
name: string;
|
|
55
|
+
title: string;
|
|
56
|
+
parentId: number;
|
|
57
|
+
}
|
|
38
58
|
export interface AppListItemAppsItem {
|
|
39
59
|
id: number;
|
|
40
60
|
sdkPlatform: string;
|
|
@@ -132,9 +152,11 @@ export interface AllMembersItem {
|
|
|
132
152
|
username?: string;
|
|
133
153
|
email?: string;
|
|
134
154
|
value?: string | number;
|
|
155
|
+
accountStatus?: number;
|
|
135
156
|
label?: string;
|
|
136
157
|
inv_status?: number;
|
|
137
|
-
|
|
158
|
+
isAdmin?: boolean;
|
|
159
|
+
createDateTime?: string;
|
|
138
160
|
authConfig?: AuthConfig;
|
|
139
161
|
groupName?: string;
|
|
140
162
|
}
|
|
@@ -191,9 +213,14 @@ export interface EventMetaDataSourceItem {
|
|
|
191
213
|
title: string;
|
|
192
214
|
chosen: number;
|
|
193
215
|
}
|
|
216
|
+
export interface InterfaceApiResponse {
|
|
217
|
+
company_members: {
|
|
218
|
+
email: string;
|
|
219
|
+
}[];
|
|
220
|
+
}
|
|
194
221
|
export interface SettingTabsItem {
|
|
195
222
|
key: string;
|
|
196
223
|
label: string;
|
|
197
|
-
|
|
224
|
+
children: JSX.Element;
|
|
198
225
|
hidden?: boolean;
|
|
199
226
|
}
|
package/es/utils/util.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DepartmentItem } from '../types';
|
|
1
2
|
/**
|
|
2
3
|
* Created by yqdong on 2017/5/3.
|
|
3
4
|
* qq: 1013501639
|
|
@@ -202,5 +203,33 @@ declare const util: {
|
|
|
202
203
|
covertSVG2Image(node: any, width: any, height: any): Promise<unknown>;
|
|
203
204
|
_getTypeStr: (index: any) => string;
|
|
204
205
|
getMenuRouterByName(name: any): any;
|
|
206
|
+
getAllIds(obj: {
|
|
207
|
+
id: number;
|
|
208
|
+
children?: DepartmentItem[];
|
|
209
|
+
}): number[];
|
|
210
|
+
getDefaultRowKeys(arr: DepartmentItem[], name: string): string[];
|
|
211
|
+
fuzzySearch(keyword: string | RegExp, arr: DepartmentItem[]): DepartmentItem[];
|
|
212
|
+
convertData(arr: DepartmentItem[], name: string): {
|
|
213
|
+
id: number;
|
|
214
|
+
value: number;
|
|
215
|
+
key: string;
|
|
216
|
+
createdTime: Date;
|
|
217
|
+
disabled: boolean;
|
|
218
|
+
defaultRowKeys: string[];
|
|
219
|
+
children?: DepartmentItem[] | undefined;
|
|
220
|
+
deptBoss: string;
|
|
221
|
+
description: string;
|
|
222
|
+
level: number;
|
|
223
|
+
name: string;
|
|
224
|
+
title: string;
|
|
225
|
+
parentId: number;
|
|
226
|
+
}[];
|
|
227
|
+
menuTreeData(arr: {
|
|
228
|
+
disabled: boolean | number;
|
|
229
|
+
children: object[] | undefined;
|
|
230
|
+
}[]): {
|
|
231
|
+
disabled: boolean | number;
|
|
232
|
+
children: object[] | undefined;
|
|
233
|
+
}[];
|
|
205
234
|
};
|
|
206
235
|
export default util;
|
package/es/utils/util.js
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
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
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
11
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
2
14
|
function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(re, groups) { return new BabelRegExp(re, void 0, groups); }; var _super = RegExp.prototype, _groups = new WeakMap(); function BabelRegExp(re, flags, groups) { var _this = new RegExp(re, flags); return _groups.set(_this, groups || _groups.get(re)), _setPrototypeOf(_this, BabelRegExp.prototype); } function buildGroups(result, re) { var g = _groups.get(re); return Object.keys(g).reduce(function (groups, name) { var i = g[name]; if ("number" == typeof i) groups[name] = result[i];else { for (var k = 0; void 0 === result[i[k]] && k + 1 < i.length;) k++; groups[name] = result[i[k]]; } return groups; }, Object.create(null)); } return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) { var result = _super.exec.call(this, str); if (result) { result.groups = buildGroups(result, this); var indices = result.indices; indices && (indices.groups = buildGroups(indices, this)); } return result; }, BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { if ("string" == typeof substitution) { var groups = _groups.get(this); return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { var group = groups[name]; return "$" + (Array.isArray(group) ? group.join("$") : group); })); } if ("function" == typeof substitution) { var _this = this; return _super[Symbol.replace].call(this, str, function () { var args = arguments; return "object" != _typeof(args[args.length - 1]) && (args = [].slice.call(args)).push(buildGroups(args, _this)), substitution.apply(this, args); }); } return _super[Symbol.replace].call(this, str, substitution); }, _wrapRegExp.apply(this, arguments); }
|
|
3
15
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
4
16
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
@@ -644,6 +656,71 @@ var util = {
|
|
|
644
656
|
userJourney: 'router-appUserJourney'
|
|
645
657
|
};
|
|
646
658
|
return hash[name] ? hash[name] : 'router-' + name;
|
|
659
|
+
},
|
|
660
|
+
getAllIds: function getAllIds(obj) {
|
|
661
|
+
var _obj$children;
|
|
662
|
+
var idArray = [];
|
|
663
|
+
idArray.push(obj.id);
|
|
664
|
+
if ((obj === null || obj === void 0 ? void 0 : obj.children) && (obj === null || obj === void 0 ? void 0 : (_obj$children = obj.children) === null || _obj$children === void 0 ? void 0 : _obj$children.length) > 0) {
|
|
665
|
+
var _iterator = _createForOfIteratorHelper(obj.children),
|
|
666
|
+
_step;
|
|
667
|
+
try {
|
|
668
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
669
|
+
var item = _step.value;
|
|
670
|
+
idArray.push.apply(idArray, _toConsumableArray(util.getAllIds(item)));
|
|
671
|
+
}
|
|
672
|
+
} catch (err) {
|
|
673
|
+
_iterator.e(err);
|
|
674
|
+
} finally {
|
|
675
|
+
_iterator.f();
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
return idArray;
|
|
679
|
+
},
|
|
680
|
+
getDefaultRowKeys: function getDefaultRowKeys(arr, name) {
|
|
681
|
+
var idArray = [];
|
|
682
|
+
arr === null || arr === void 0 ? void 0 : arr.map(function (item) {
|
|
683
|
+
var _item$children;
|
|
684
|
+
idArray.push(JSON.stringify(item.id));
|
|
685
|
+
if (item.children && ((_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.length) > 0) {
|
|
686
|
+
item === null || item === void 0 ? void 0 : item.children.map(function (v) {
|
|
687
|
+
idArray.push(JSON.stringify(v.id));
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
});
|
|
691
|
+
return idArray;
|
|
692
|
+
},
|
|
693
|
+
fuzzySearch: function fuzzySearch(keyword, arr) {
|
|
694
|
+
var regex = new RegExp(keyword, 'i'); // 'i' 表示忽略大小写
|
|
695
|
+
return arr.filter(function (item) {
|
|
696
|
+
return regex.test(item.name);
|
|
697
|
+
});
|
|
698
|
+
},
|
|
699
|
+
convertData: function convertData(arr, name) {
|
|
700
|
+
if (!Array.isArray(arr)) {
|
|
701
|
+
return arr;
|
|
702
|
+
}
|
|
703
|
+
return arr.map(function (item, index) {
|
|
704
|
+
var newItem = _objectSpread({}, item);
|
|
705
|
+
newItem.value = newItem.id;
|
|
706
|
+
newItem.disabled = newItem.level === 4 ? true : false;
|
|
707
|
+
newItem.key = JSON.stringify(newItem.id);
|
|
708
|
+
newItem.title = newItem.name;
|
|
709
|
+
newItem.defaultRowKeys = !name ? util.getDefaultRowKeys(arr, name) : [];
|
|
710
|
+
newItem.children = (newItem === null || newItem === void 0 ? void 0 : newItem.children) && (newItem === null || newItem === void 0 ? void 0 : newItem.children.length) > 0 ? util.convertData(newItem === null || newItem === void 0 ? void 0 : newItem.children, '') : undefined;
|
|
711
|
+
return newItem;
|
|
712
|
+
});
|
|
713
|
+
},
|
|
714
|
+
menuTreeData: function menuTreeData(arr) {
|
|
715
|
+
if (!Array.isArray(arr)) {
|
|
716
|
+
return arr;
|
|
717
|
+
}
|
|
718
|
+
return arr.map(function (item, index) {
|
|
719
|
+
var newItem = _objectSpread({}, item);
|
|
720
|
+
newItem.disabled = newItem.disabled === 0 ? true : false;
|
|
721
|
+
newItem.children = (newItem === null || newItem === void 0 ? void 0 : newItem.children) && (newItem === null || newItem === void 0 ? void 0 : newItem.children.length) > 0 ? util.menuTreeData(newItem === null || newItem === void 0 ? void 0 : newItem.children) : undefined;
|
|
722
|
+
return newItem;
|
|
723
|
+
});
|
|
647
724
|
}
|
|
648
725
|
};
|
|
649
726
|
export default util;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/modules-settings",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.13",
|
|
4
4
|
"module": "es/index.js",
|
|
5
5
|
"typings": "es/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"@types/lodash": "^4.14.182",
|
|
39
39
|
"@umijs/fabric": "^2.8.1",
|
|
40
40
|
"@umijs/test": "^3.0.5",
|
|
41
|
-
"@zgfe/business-lib": "
|
|
41
|
+
"@zgfe/business-lib": "1.1.87-auth.11",
|
|
42
42
|
"@zgfe/modules-demo-manage": "^1.0.1",
|
|
43
|
-
"antd": "4.22.6",
|
|
43
|
+
"antd": "^4.22.6",
|
|
44
44
|
"dumi": "^1.1.0",
|
|
45
45
|
"father-build": "^1.17.2",
|
|
46
46
|
"gh-pages": "^3.0.0",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"umi-request": "^1.4.0",
|
|
52
52
|
"yorkie": "^2.0.0"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "2e06635975cd56d952aba66b69cfc1e060d5a988",
|
|
55
55
|
"gitHooks": {
|
|
56
56
|
"pre-commit": "lint-staged"
|
|
57
57
|
}
|
|
58
|
-
}
|
|
58
|
+
}
|