mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-07 01:46:43 +08:00
Merge remote-tracking branch 'yx/250605-added-yzt'
This commit is contained in:
@@ -234,13 +234,19 @@ export default {
|
||||
//请求组织接口
|
||||
const getOrgList = async () => {
|
||||
var manageFlag = false;
|
||||
for(let i=0;i<store.state.userInfo.roleList.length;i++){
|
||||
if(store.state.userInfo.roleList[i].roleCode=="system-admin"){
|
||||
manageFlag = true;
|
||||
break;
|
||||
if (store.state.userInfo != null && store.state.userInfo.roleList != null) {
|
||||
for(let i=0;i<store.state.userInfo.roleList.length;i++){
|
||||
if(store.state.userInfo.roleList[i].roleCode=="system-admin"){
|
||||
manageFlag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const res = await api.userGetUserOrg({});
|
||||
if (res != null && res.data != null && res.data.result != null && res.data.result.orgTreeList != null) {
|
||||
orgArray = flattenOrgTree(res.data.result.orgTreeList);
|
||||
}
|
||||
if (res) {
|
||||
if(manageFlag){
|
||||
state.option = [{
|
||||
@@ -268,6 +274,25 @@ export default {
|
||||
getTableData();
|
||||
}
|
||||
};
|
||||
|
||||
function flattenOrgTree(orgTree) {
|
||||
const result = [];
|
||||
|
||||
function traverse(node) {
|
||||
if (node.organizationId && node.orgName) {
|
||||
result.push({
|
||||
organizationId: node.organizationId,
|
||||
orgName: node.orgName
|
||||
});
|
||||
}
|
||||
if (node.childList && node.childList.length > 0) {
|
||||
node.childList.forEach(child => traverse(child));
|
||||
}
|
||||
}
|
||||
|
||||
orgTree.forEach(node => traverse(node));
|
||||
return result;
|
||||
}
|
||||
//导出
|
||||
const exportbtnz = async () => {
|
||||
if (!state.selectedRowKeys?.length) {
|
||||
|
||||
Reference in New Issue
Block a user