@mu-cabin/opms-permission 0.8.12 → 0.8.15
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/dist/index.cjs +42 -32
- package/dist/index.d.mts +40 -10
- package/dist/index.d.ts +40 -10
- package/dist/index.mjs +42 -32
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -144,16 +144,16 @@ function createMenuList(items) {
|
|
144
144
|
return { menuList: menus, menuMap };
|
145
145
|
}
|
146
146
|
function iterateNestedArray(items, callback) {
|
147
|
-
function
|
147
|
+
function travel(items2, parent) {
|
148
148
|
return items2.map((item) => {
|
149
149
|
const handledItem = callback(item, parent);
|
150
150
|
if (handledItem && handledItem.children) {
|
151
|
-
handledItem.children =
|
151
|
+
handledItem.children = travel(handledItem.children, handledItem);
|
152
152
|
}
|
153
153
|
return handledItem;
|
154
154
|
}).filter((v) => v);
|
155
155
|
}
|
156
|
-
return
|
156
|
+
return travel(items);
|
157
157
|
}
|
158
158
|
function findFirstEnableCode(data) {
|
159
159
|
if (!Array.isArray(data) || data.length === 0) {
|
@@ -245,10 +245,9 @@ async function queryResource(baseUrl, params) {
|
|
245
245
|
params
|
246
246
|
);
|
247
247
|
}
|
248
|
-
async function getUserOrgTree(baseUrl
|
248
|
+
async function getUserOrgTree(baseUrl) {
|
249
249
|
return await axiosClient.post(
|
250
|
-
`${baseUrl}/
|
251
|
-
params
|
250
|
+
`${baseUrl}/user/userInfo`
|
252
251
|
);
|
253
252
|
}
|
254
253
|
async function queryOrgCompanies(baseUrl, params) {
|
@@ -260,25 +259,41 @@ async function queryOrgCompanies(baseUrl, params) {
|
|
260
259
|
|
261
260
|
// src/permission.ts
|
262
261
|
var DataHandler = {
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
262
|
+
iterateOrgTree(orgTree) {
|
263
|
+
return iterateNestedArray(orgTree, (item) => {
|
264
|
+
return {
|
265
|
+
label: item.orgShortName,
|
266
|
+
value: item.orgCode,
|
267
|
+
title: item.orgShortName,
|
268
|
+
key: item.orgCode,
|
269
|
+
nodeLevel: item.nodeLevel,
|
270
|
+
children: item.children,
|
271
|
+
disabled: !item.hasPermission,
|
272
|
+
orgType: item.orgType,
|
273
|
+
orgId: item.orgId
|
274
|
+
};
|
275
|
+
});
|
267
276
|
},
|
277
|
+
// 获取单位组织
|
278
|
+
// getUnitOptions(orgTree: OrgTreeItem[]): Option[] {
|
279
|
+
// if (!orgTree) return [];
|
280
|
+
// return orgTree.disabled ? (orgTree.children ?? []) : [orgTree];
|
281
|
+
// },
|
268
282
|
// 获取所有单位组织
|
269
283
|
getAllUnitOptions(orgTree) {
|
270
284
|
if (!orgTree) return [];
|
271
285
|
const newTree = iterateNestedArray(
|
272
|
-
|
286
|
+
orgTree,
|
273
287
|
({ disabled, ...other }) => ({ ...other })
|
274
288
|
)?.[0];
|
275
289
|
return newTree ? newTree.children ?? [] : [];
|
276
290
|
},
|
277
291
|
getCompaniesOptions(orgTree, hasRootAuth) {
|
278
292
|
if (!orgTree) return [];
|
279
|
-
const list = (orgTree
|
280
|
-
|
281
|
-
|
293
|
+
const list = (orgTree || []).map(({ children, ...others }) => ({
|
294
|
+
...others,
|
295
|
+
disabled: false
|
296
|
+
}));
|
282
297
|
if (hasRootAuth) {
|
283
298
|
list.unshift({ ...orgTree, label: "\u5168\u516C\u53F8", children: [] });
|
284
299
|
}
|
@@ -287,9 +302,7 @@ var DataHandler = {
|
|
287
302
|
// 获取所有顶级单位组织代码
|
288
303
|
topLevelUnitOrgCodes(orgTree) {
|
289
304
|
if (!orgTree) return [];
|
290
|
-
return findAllEnableTopLevelCodes(
|
291
|
-
Array.isArray(orgTree) ? orgTree : [orgTree]
|
292
|
-
);
|
305
|
+
return findAllEnableTopLevelCodes(orgTree);
|
293
306
|
},
|
294
307
|
// 获取资源数据, 包含资源map和组件map
|
295
308
|
getResourceData(resources) {
|
@@ -300,7 +313,7 @@ var DataHandler = {
|
|
300
313
|
return createMenuList(resources);
|
301
314
|
},
|
302
315
|
getFirstUnitOrgCode(orgTree) {
|
303
|
-
return findFirstEnableCode(
|
316
|
+
return findFirstEnableCode(orgTree) ?? "";
|
304
317
|
}
|
305
318
|
};
|
306
319
|
var Permission = class {
|
@@ -419,21 +432,17 @@ var Permission = class {
|
|
419
432
|
/**
|
420
433
|
* Query and process organization tree
|
421
434
|
*/
|
422
|
-
async
|
435
|
+
async queryUserOrgs() {
|
423
436
|
try {
|
424
|
-
const
|
425
|
-
|
426
|
-
name: "COS"
|
427
|
-
});
|
428
|
-
const { obj, success, msg, code } = data;
|
437
|
+
const res = await getUserOrgTree(this.baseUrl);
|
438
|
+
const { data, success, msg, code } = res;
|
429
439
|
if (!success) {
|
430
440
|
return Promise.reject({
|
431
441
|
code,
|
432
442
|
msg
|
433
443
|
});
|
434
444
|
}
|
435
|
-
const
|
436
|
-
const newTree = iterateNestedArray([orgTree], (item) => {
|
445
|
+
const newTree = iterateNestedArray(data, (item) => {
|
437
446
|
return {
|
438
447
|
label: item.orgShortName,
|
439
448
|
value: item.orgCode,
|
@@ -445,7 +454,7 @@ var Permission = class {
|
|
445
454
|
orgType: item.orgType,
|
446
455
|
orgId: item.orgId
|
447
456
|
};
|
448
|
-
})
|
457
|
+
});
|
449
458
|
this._orgTree = newTree;
|
450
459
|
return newTree;
|
451
460
|
} catch (error) {
|
@@ -505,9 +514,10 @@ var Permission = class {
|
|
505
514
|
get companyOptions() {
|
506
515
|
const orgTree = this._orgTree;
|
507
516
|
if (!orgTree) return [];
|
508
|
-
const list =
|
509
|
-
|
510
|
-
|
517
|
+
const list = orgTree.map(({ children, ...others }) => ({
|
518
|
+
...others,
|
519
|
+
disabled: false
|
520
|
+
}));
|
511
521
|
if (this.hasRootAuth) {
|
512
522
|
list.unshift({ ...orgTree, label: "\u5168\u516C\u53F8", children: [] });
|
513
523
|
}
|
@@ -519,7 +529,7 @@ var Permission = class {
|
|
519
529
|
get unitOptions() {
|
520
530
|
const orgTree = this._orgTree;
|
521
531
|
if (!orgTree) return [];
|
522
|
-
return
|
532
|
+
return orgTree;
|
523
533
|
}
|
524
534
|
get allUnitOptions() {
|
525
535
|
const orgTree = this._orgTree;
|
@@ -532,7 +542,7 @@ var Permission = class {
|
|
532
542
|
}
|
533
543
|
const orgTree = this._orgTree;
|
534
544
|
if (!orgTree) return "";
|
535
|
-
return findFirstEnableCode(
|
545
|
+
return findFirstEnableCode(orgTree) ?? "";
|
536
546
|
}
|
537
547
|
get topLevelUnitOrgCodes() {
|
538
548
|
const orgTree = this._orgTree;
|
package/dist/index.d.mts
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
interface OrgRecord {
|
1
|
+
interface OrgRecord$1 {
|
2
2
|
orgId: number;
|
3
3
|
orgName: string;
|
4
4
|
orgShortName: string;
|
5
5
|
orgCode: string;
|
6
6
|
nodeLevel: number;
|
7
7
|
hasPermission: boolean;
|
8
|
-
children?: OrgRecord[];
|
8
|
+
children?: OrgRecord$1[];
|
9
9
|
}
|
10
10
|
|
11
11
|
interface Resource {
|
@@ -60,6 +60,36 @@ interface OrgTreeItem {
|
|
60
60
|
orgType: string;
|
61
61
|
orgId: string;
|
62
62
|
}
|
63
|
+
interface ChildOrganization {
|
64
|
+
orgId: number;
|
65
|
+
parentOrgId: number;
|
66
|
+
orgCode: string;
|
67
|
+
orgName: string;
|
68
|
+
orgShortName: string;
|
69
|
+
orgType: string;
|
70
|
+
}
|
71
|
+
interface OrgRecord {
|
72
|
+
allOrgTags: boolean;
|
73
|
+
allSystem: boolean;
|
74
|
+
canModify: boolean;
|
75
|
+
children: ChildOrganization[];
|
76
|
+
cosOrgCode: string;
|
77
|
+
csmOrgCode: string | null;
|
78
|
+
hasPermission: boolean;
|
79
|
+
nodeLevel: number;
|
80
|
+
orgBindType: string;
|
81
|
+
orgCode: string;
|
82
|
+
orgId: number;
|
83
|
+
orgName: string;
|
84
|
+
orgShortName: string;
|
85
|
+
orgTags: any[];
|
86
|
+
orgType: string;
|
87
|
+
parentOrgId: number | null;
|
88
|
+
positionInfo: any[];
|
89
|
+
searchPath: string;
|
90
|
+
showOrder: number | null;
|
91
|
+
systemList: any[];
|
92
|
+
}
|
63
93
|
|
64
94
|
interface PermissionOptions {
|
65
95
|
systemId: string;
|
@@ -69,10 +99,10 @@ interface PermissionOptions {
|
|
69
99
|
* 组织树处理工具
|
70
100
|
*/
|
71
101
|
declare const DataHandler: {
|
72
|
-
|
73
|
-
getAllUnitOptions(orgTree: OrgTreeItem): Option[];
|
74
|
-
getCompaniesOptions(orgTree: OrgTreeItem, hasRootAuth: boolean): Option[];
|
75
|
-
topLevelUnitOrgCodes(orgTree: OrgTreeItem): string[];
|
102
|
+
iterateOrgTree(orgTree: OrgRecord$1[]): OrgTreeItem[];
|
103
|
+
getAllUnitOptions(orgTree: OrgTreeItem[]): Option[];
|
104
|
+
getCompaniesOptions(orgTree: OrgTreeItem[], hasRootAuth: boolean): Option[];
|
105
|
+
topLevelUnitOrgCodes(orgTree: OrgTreeItem[]): string[];
|
76
106
|
getResourceData(resources: Resource[]): {
|
77
107
|
resourceMap: {
|
78
108
|
[path: string]: Resource;
|
@@ -87,7 +117,7 @@ declare const DataHandler: {
|
|
87
117
|
[path: string]: MenuItem;
|
88
118
|
};
|
89
119
|
};
|
90
|
-
getFirstUnitOrgCode(orgTree: OrgTreeItem): string;
|
120
|
+
getFirstUnitOrgCode(orgTree: OrgTreeItem[]): string;
|
91
121
|
};
|
92
122
|
declare class Permission {
|
93
123
|
private _userInfo;
|
@@ -140,8 +170,8 @@ declare class Permission {
|
|
140
170
|
/**
|
141
171
|
* Query and process organization tree
|
142
172
|
*/
|
143
|
-
|
144
|
-
queryCompanies(): Promise<OrgRecord[]>;
|
173
|
+
queryUserOrgs(): Promise<any[] | null>;
|
174
|
+
queryCompanies(): Promise<OrgRecord$1[]>;
|
145
175
|
isLogin(): boolean;
|
146
176
|
getToken(): string | null;
|
147
177
|
setToken(token: string): void;
|
@@ -179,4 +209,4 @@ declare function jumpToSSOLogout({ baseUrl, redirectToUrl, clientId, }: {
|
|
179
209
|
clientId?: string;
|
180
210
|
}): void;
|
181
211
|
|
182
|
-
export { DataHandler, type MenuItem, Permission as OpmsPermission, type Option, type OrgTreeItem, type Resource, type UserInfo, type UserOrganization, jumpToSSOLogin, jumpToSSOLogout };
|
212
|
+
export { type ChildOrganization, DataHandler, type MenuItem, Permission as OpmsPermission, type Option, type OrgRecord, type OrgTreeItem, type Resource, type UserInfo, type UserOrganization, jumpToSSOLogin, jumpToSSOLogout };
|
package/dist/index.d.ts
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
interface OrgRecord {
|
1
|
+
interface OrgRecord$1 {
|
2
2
|
orgId: number;
|
3
3
|
orgName: string;
|
4
4
|
orgShortName: string;
|
5
5
|
orgCode: string;
|
6
6
|
nodeLevel: number;
|
7
7
|
hasPermission: boolean;
|
8
|
-
children?: OrgRecord[];
|
8
|
+
children?: OrgRecord$1[];
|
9
9
|
}
|
10
10
|
|
11
11
|
interface Resource {
|
@@ -60,6 +60,36 @@ interface OrgTreeItem {
|
|
60
60
|
orgType: string;
|
61
61
|
orgId: string;
|
62
62
|
}
|
63
|
+
interface ChildOrganization {
|
64
|
+
orgId: number;
|
65
|
+
parentOrgId: number;
|
66
|
+
orgCode: string;
|
67
|
+
orgName: string;
|
68
|
+
orgShortName: string;
|
69
|
+
orgType: string;
|
70
|
+
}
|
71
|
+
interface OrgRecord {
|
72
|
+
allOrgTags: boolean;
|
73
|
+
allSystem: boolean;
|
74
|
+
canModify: boolean;
|
75
|
+
children: ChildOrganization[];
|
76
|
+
cosOrgCode: string;
|
77
|
+
csmOrgCode: string | null;
|
78
|
+
hasPermission: boolean;
|
79
|
+
nodeLevel: number;
|
80
|
+
orgBindType: string;
|
81
|
+
orgCode: string;
|
82
|
+
orgId: number;
|
83
|
+
orgName: string;
|
84
|
+
orgShortName: string;
|
85
|
+
orgTags: any[];
|
86
|
+
orgType: string;
|
87
|
+
parentOrgId: number | null;
|
88
|
+
positionInfo: any[];
|
89
|
+
searchPath: string;
|
90
|
+
showOrder: number | null;
|
91
|
+
systemList: any[];
|
92
|
+
}
|
63
93
|
|
64
94
|
interface PermissionOptions {
|
65
95
|
systemId: string;
|
@@ -69,10 +99,10 @@ interface PermissionOptions {
|
|
69
99
|
* 组织树处理工具
|
70
100
|
*/
|
71
101
|
declare const DataHandler: {
|
72
|
-
|
73
|
-
getAllUnitOptions(orgTree: OrgTreeItem): Option[];
|
74
|
-
getCompaniesOptions(orgTree: OrgTreeItem, hasRootAuth: boolean): Option[];
|
75
|
-
topLevelUnitOrgCodes(orgTree: OrgTreeItem): string[];
|
102
|
+
iterateOrgTree(orgTree: OrgRecord$1[]): OrgTreeItem[];
|
103
|
+
getAllUnitOptions(orgTree: OrgTreeItem[]): Option[];
|
104
|
+
getCompaniesOptions(orgTree: OrgTreeItem[], hasRootAuth: boolean): Option[];
|
105
|
+
topLevelUnitOrgCodes(orgTree: OrgTreeItem[]): string[];
|
76
106
|
getResourceData(resources: Resource[]): {
|
77
107
|
resourceMap: {
|
78
108
|
[path: string]: Resource;
|
@@ -87,7 +117,7 @@ declare const DataHandler: {
|
|
87
117
|
[path: string]: MenuItem;
|
88
118
|
};
|
89
119
|
};
|
90
|
-
getFirstUnitOrgCode(orgTree: OrgTreeItem): string;
|
120
|
+
getFirstUnitOrgCode(orgTree: OrgTreeItem[]): string;
|
91
121
|
};
|
92
122
|
declare class Permission {
|
93
123
|
private _userInfo;
|
@@ -140,8 +170,8 @@ declare class Permission {
|
|
140
170
|
/**
|
141
171
|
* Query and process organization tree
|
142
172
|
*/
|
143
|
-
|
144
|
-
queryCompanies(): Promise<OrgRecord[]>;
|
173
|
+
queryUserOrgs(): Promise<any[] | null>;
|
174
|
+
queryCompanies(): Promise<OrgRecord$1[]>;
|
145
175
|
isLogin(): boolean;
|
146
176
|
getToken(): string | null;
|
147
177
|
setToken(token: string): void;
|
@@ -179,4 +209,4 @@ declare function jumpToSSOLogout({ baseUrl, redirectToUrl, clientId, }: {
|
|
179
209
|
clientId?: string;
|
180
210
|
}): void;
|
181
211
|
|
182
|
-
export { DataHandler, type MenuItem, Permission as OpmsPermission, type Option, type OrgTreeItem, type Resource, type UserInfo, type UserOrganization, jumpToSSOLogin, jumpToSSOLogout };
|
212
|
+
export { type ChildOrganization, DataHandler, type MenuItem, Permission as OpmsPermission, type Option, type OrgRecord, type OrgTreeItem, type Resource, type UserInfo, type UserOrganization, jumpToSSOLogin, jumpToSSOLogout };
|
package/dist/index.mjs
CHANGED
@@ -105,16 +105,16 @@ function createMenuList(items) {
|
|
105
105
|
return { menuList: menus, menuMap };
|
106
106
|
}
|
107
107
|
function iterateNestedArray(items, callback) {
|
108
|
-
function
|
108
|
+
function travel(items2, parent) {
|
109
109
|
return items2.map((item) => {
|
110
110
|
const handledItem = callback(item, parent);
|
111
111
|
if (handledItem && handledItem.children) {
|
112
|
-
handledItem.children =
|
112
|
+
handledItem.children = travel(handledItem.children, handledItem);
|
113
113
|
}
|
114
114
|
return handledItem;
|
115
115
|
}).filter((v) => v);
|
116
116
|
}
|
117
|
-
return
|
117
|
+
return travel(items);
|
118
118
|
}
|
119
119
|
function findFirstEnableCode(data) {
|
120
120
|
if (!Array.isArray(data) || data.length === 0) {
|
@@ -206,10 +206,9 @@ async function queryResource(baseUrl, params) {
|
|
206
206
|
params
|
207
207
|
);
|
208
208
|
}
|
209
|
-
async function getUserOrgTree(baseUrl
|
209
|
+
async function getUserOrgTree(baseUrl) {
|
210
210
|
return await axiosClient.post(
|
211
|
-
`${baseUrl}/
|
212
|
-
params
|
211
|
+
`${baseUrl}/user/userInfo`
|
213
212
|
);
|
214
213
|
}
|
215
214
|
async function queryOrgCompanies(baseUrl, params) {
|
@@ -221,25 +220,41 @@ async function queryOrgCompanies(baseUrl, params) {
|
|
221
220
|
|
222
221
|
// src/permission.ts
|
223
222
|
var DataHandler = {
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
223
|
+
iterateOrgTree(orgTree) {
|
224
|
+
return iterateNestedArray(orgTree, (item) => {
|
225
|
+
return {
|
226
|
+
label: item.orgShortName,
|
227
|
+
value: item.orgCode,
|
228
|
+
title: item.orgShortName,
|
229
|
+
key: item.orgCode,
|
230
|
+
nodeLevel: item.nodeLevel,
|
231
|
+
children: item.children,
|
232
|
+
disabled: !item.hasPermission,
|
233
|
+
orgType: item.orgType,
|
234
|
+
orgId: item.orgId
|
235
|
+
};
|
236
|
+
});
|
228
237
|
},
|
238
|
+
// 获取单位组织
|
239
|
+
// getUnitOptions(orgTree: OrgTreeItem[]): Option[] {
|
240
|
+
// if (!orgTree) return [];
|
241
|
+
// return orgTree.disabled ? (orgTree.children ?? []) : [orgTree];
|
242
|
+
// },
|
229
243
|
// 获取所有单位组织
|
230
244
|
getAllUnitOptions(orgTree) {
|
231
245
|
if (!orgTree) return [];
|
232
246
|
const newTree = iterateNestedArray(
|
233
|
-
|
247
|
+
orgTree,
|
234
248
|
({ disabled, ...other }) => ({ ...other })
|
235
249
|
)?.[0];
|
236
250
|
return newTree ? newTree.children ?? [] : [];
|
237
251
|
},
|
238
252
|
getCompaniesOptions(orgTree, hasRootAuth) {
|
239
253
|
if (!orgTree) return [];
|
240
|
-
const list = (orgTree
|
241
|
-
|
242
|
-
|
254
|
+
const list = (orgTree || []).map(({ children, ...others }) => ({
|
255
|
+
...others,
|
256
|
+
disabled: false
|
257
|
+
}));
|
243
258
|
if (hasRootAuth) {
|
244
259
|
list.unshift({ ...orgTree, label: "\u5168\u516C\u53F8", children: [] });
|
245
260
|
}
|
@@ -248,9 +263,7 @@ var DataHandler = {
|
|
248
263
|
// 获取所有顶级单位组织代码
|
249
264
|
topLevelUnitOrgCodes(orgTree) {
|
250
265
|
if (!orgTree) return [];
|
251
|
-
return findAllEnableTopLevelCodes(
|
252
|
-
Array.isArray(orgTree) ? orgTree : [orgTree]
|
253
|
-
);
|
266
|
+
return findAllEnableTopLevelCodes(orgTree);
|
254
267
|
},
|
255
268
|
// 获取资源数据, 包含资源map和组件map
|
256
269
|
getResourceData(resources) {
|
@@ -261,7 +274,7 @@ var DataHandler = {
|
|
261
274
|
return createMenuList(resources);
|
262
275
|
},
|
263
276
|
getFirstUnitOrgCode(orgTree) {
|
264
|
-
return findFirstEnableCode(
|
277
|
+
return findFirstEnableCode(orgTree) ?? "";
|
265
278
|
}
|
266
279
|
};
|
267
280
|
var Permission = class {
|
@@ -380,21 +393,17 @@ var Permission = class {
|
|
380
393
|
/**
|
381
394
|
* Query and process organization tree
|
382
395
|
*/
|
383
|
-
async
|
396
|
+
async queryUserOrgs() {
|
384
397
|
try {
|
385
|
-
const
|
386
|
-
|
387
|
-
name: "COS"
|
388
|
-
});
|
389
|
-
const { obj, success, msg, code } = data;
|
398
|
+
const res = await getUserOrgTree(this.baseUrl);
|
399
|
+
const { data, success, msg, code } = res;
|
390
400
|
if (!success) {
|
391
401
|
return Promise.reject({
|
392
402
|
code,
|
393
403
|
msg
|
394
404
|
});
|
395
405
|
}
|
396
|
-
const
|
397
|
-
const newTree = iterateNestedArray([orgTree], (item) => {
|
406
|
+
const newTree = iterateNestedArray(data, (item) => {
|
398
407
|
return {
|
399
408
|
label: item.orgShortName,
|
400
409
|
value: item.orgCode,
|
@@ -406,7 +415,7 @@ var Permission = class {
|
|
406
415
|
orgType: item.orgType,
|
407
416
|
orgId: item.orgId
|
408
417
|
};
|
409
|
-
})
|
418
|
+
});
|
410
419
|
this._orgTree = newTree;
|
411
420
|
return newTree;
|
412
421
|
} catch (error) {
|
@@ -466,9 +475,10 @@ var Permission = class {
|
|
466
475
|
get companyOptions() {
|
467
476
|
const orgTree = this._orgTree;
|
468
477
|
if (!orgTree) return [];
|
469
|
-
const list =
|
470
|
-
|
471
|
-
|
478
|
+
const list = orgTree.map(({ children, ...others }) => ({
|
479
|
+
...others,
|
480
|
+
disabled: false
|
481
|
+
}));
|
472
482
|
if (this.hasRootAuth) {
|
473
483
|
list.unshift({ ...orgTree, label: "\u5168\u516C\u53F8", children: [] });
|
474
484
|
}
|
@@ -480,7 +490,7 @@ var Permission = class {
|
|
480
490
|
get unitOptions() {
|
481
491
|
const orgTree = this._orgTree;
|
482
492
|
if (!orgTree) return [];
|
483
|
-
return
|
493
|
+
return orgTree;
|
484
494
|
}
|
485
495
|
get allUnitOptions() {
|
486
496
|
const orgTree = this._orgTree;
|
@@ -493,7 +503,7 @@ var Permission = class {
|
|
493
503
|
}
|
494
504
|
const orgTree = this._orgTree;
|
495
505
|
if (!orgTree) return "";
|
496
|
-
return findFirstEnableCode(
|
506
|
+
return findFirstEnableCode(orgTree) ?? "";
|
497
507
|
}
|
498
508
|
get topLevelUnitOrgCodes() {
|
499
509
|
const orgTree = this._orgTree;
|