Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
a2b9f579
提交
a2b9f579
authored
5月 14, 2020
作者:
钟是志
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bug修改
上级
2166b56d
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
64 行增加
和
69 行删除
+64
-69
index.js
zyd_private/OneStopAppManage/index.js
+12
-36
pageButton.js
zyd_private/OneStopAppManage/pageButton.js
+19
-15
pageSearch.js
zyd_private/OneStopAppManage/pageSearch.js
+33
-18
没有找到文件。
zyd_private/OneStopAppManage/index.js
浏览文件 @
a2b9f579
...
...
@@ -24,11 +24,10 @@ const Index = (WrappedComponent) =>
selectKey
:
''
,
},
formValues
:
{
select
Type
:
'getAllRole'
,
apply
Type
:
'getAllRole'
,
sysCode
:
'xg'
,
},
typeList
:
[],
authorizedApp
:
[],
};
}
...
...
@@ -38,35 +37,10 @@ const Index = (WrappedComponent) =>
});
};
getAuthorizedApp
=
()
=>
{
const
{
selectKey
}
=
this
.
state
.
search
;
if
(
selectKey
)
{
getInfo
(
{
roleId
:
selectKey
,
cacheKey
:
Math
.
random
(),
},
'/CommonApi/queryRoleApply'
,
).
then
((
x
)
=>
{
if
(
x
)
{
this
.
setState
({
authorizedApp
:
x
,
});
}
});
// this.instanceComponent.getPage();
}
};
changeSearch
=
(
search
)
=>
{
this
.
setState
(
{
this
.
setState
({
search
,
},
()
=>
{
// this.getAuthorizedApp();
},
);
});
};
componentDidMount
()
{
...
...
@@ -98,19 +72,18 @@ const Index = (WrappedComponent) =>
}
render
()
{
const
{
search
,
typeList
,
authorizedApp
,
formValues
}
=
this
.
state
;
const
{
search
,
typeList
,
formValues
}
=
this
.
state
;
if
(
!
typeList
.
length
||
!
formValues
.
groupId
)
{
return
null
;
}
const
pageS
=
pageSearch
({
typeList
,
authorizedApp
,
selectKey
:
search
.
selectKey
,
changeFormValues
:
this
.
changeFormValues
,
});
const
pageB
=
pageButton
({
roleId
:
search
.
selectKey
,
authorizedApp
,
// getAuthorizedApp: this.getAuthorizedApp,
selectKey
:
search
.
selectKey
,
formValues
,
});
return
(
<
PageHeaderWrapper
title
=
""
>
...
...
@@ -123,14 +96,17 @@ const Index = (WrappedComponent) =>
groupId
=
{
formValues
.
groupId
}
/
>
<
/Col
>
<
Col
xl
=
{
19
}
xxl
=
{
20
}
>
{
search
.
selectKey
?
<
Col
xl
=
{
19
}
xxl
=
{
20
}
>
<
WrappedComponent
listConfig
=
{
pageSetting
.
listConfig
}
pageButton
=
{
pageB
}
ref
=
{(
instanceComponent
)
=>
(
this
.
instanceComponent
=
instanceComponent
)}
pageSearch
=
{
pageS
}
/
>
<
/Col
>
<
/Col> : nul
l
}
<
/Row
>
<
/PageHeaderWrapper
>
);
...
...
zyd_private/OneStopAppManage/pageButton.js
浏览文件 @
a2b9f579
...
...
@@ -2,35 +2,36 @@ import React from 'react';
import
{
message
}
from
'antd'
;
import
{
getInfo
}
from
'@/highOrderComponent/Service'
;
const
submitData
=
(
selectRows
,
role
Id
)
=>
{
const
submitData
=
(
selectRows
,
formValues
,
app
Id
)
=>
{
if
(
!
selectRows
.
length
)
{
message
.
warning
(
'请先选择一个应用'
);
return
false
;
}
else
{
let
content
=
selectRows
.
map
((
x
)
=>
{
return
{
appId
:
x
.
id
,
roleId
,
appId
,
bizId
:
x
.
id
,
applyType
:
formValues
.
applyType
,
sysCode
:
formValues
.
sysCode
,
};
});
content
=
JSON
.
stringify
(
content
);
const
data
=
{
roleId
,
//
roleId,
op
:
'add'
,
content
,
};
return
getInfo
(
data
,
'/CommonApi/config
Role
Apply'
);
return
getInfo
(
data
,
'/CommonApi/configApply'
);
}
};
const
deleteData
=
(
ids
,
roleId
)
=>
{
const
deleteData
=
(
ids
)
=>
{
const
data
=
{
ids
,
roleId
,
op
:
'delete'
,
};
return
getInfo
(
data
,
'/CommonApi/config
Role
Apply'
);
return
getInfo
(
data
,
'/CommonApi/configApply'
);
};
const
handleButton
=
(
props
)
=>
{
...
...
@@ -40,8 +41,10 @@ const handleButton = (props) => {
type
:
'Normal'
,
component
:
'Normal'
,
handleClick
:
(
selectRows
,
formValues
,
getPage
,
search
)
=>
{
submitData
(
selectRows
,
props
.
roleId
).
then
((
x
)
=>
{
// props.getAuthorizedApp();
submitData
(
selectRows
,
formValues
,
props
.
selectKey
).
then
((
x
)
=>
{
if
(
x
)
{
getPage
();
}
});
},
},
...
...
@@ -54,17 +57,18 @@ const handleButton = (props) => {
message
.
warning
(
'请先选择一个应用'
);
return
false
;
}
const
deleteIds
=
[];
for
(
let
item
of
selectRows
)
{
for
(
let
x
of
props
.
authorizedApp
)
{
if
(
x
.
appId
===
item
.
id
)
{
for
(
let
x
of
props
.
authorizedApp
)
{
if
(
x
.
appId
===
item
.
id
)
{
deleteIds
.
push
(
x
.
id
);
}
}
}
deleteData
(
deleteIds
,
props
.
roleId
).
then
((
x
)
=>
{
// props.getAuthorizedApp();
deleteData
(
deleteIds
).
then
((
x
)
=>
{
if
(
x
)
{
getPage
();
}
});
},
},
...
...
zyd_private/OneStopAppManage/pageSearch.js
浏览文件 @
a2b9f579
...
...
@@ -3,9 +3,26 @@ import { Link } from 'react-router-dom';
import
React
,
{
Fragment
}
from
'react'
;
import
{
getAppList
}
from
'@/webPublic/Services'
;
import
{
redText
}
from
'@/pages/zydxg/CheckManage/PiciSetting/publicFunc'
;
import
{
getInfo
}
from
'@/highOrderComponent/Service'
;
import
res
from
'@/pages/zydjy/system/StuBaseInfoManage/StuBaseManage/exportConfig'
;
const
width
=
110
;
const
deleteChildren
=
(
response
)
=>
{
if
(
response
&&
response
.
length
)
{
for
(
let
item
of
response
)
{
if
(
item
.
children
&&
!
item
.
children
.
length
)
{
delete
item
.
children
;
}
else
if
(
item
.
children
)
{
deleteChildren
(
item
.
children
);
}
}
return
response
;
}
else
{
return
[];
}
};
const
handlePageSearch
=
(
props
)
=>
{
const
pageSearch
=
{
search
:
{
...
...
@@ -19,19 +36,25 @@ const handlePageSearch = (props) => {
required
:
true
,
defaultValue
:
'xg'
,
},
select
Type
:
{
apply
Type
:
{
required
:
true
,
defaultValue
:
'
getAllR
ole'
,
defaultValue
:
'
r
ole'
,
},
},
getInfo
:
(
data
,
url
)
=>
{
return
getAppList
(
data
,
props
.
formValues
);
return
getInfo
({
appId
:
props
.
selectKey
,
applyType
:
data
.
applyType
,
sysCode
:
data
.
sysCode
,
},
'/CommonApi/queryApplyTarget'
);
},
giveFieldsToFormValues
:
true
,
afterFormValuesChange
:
(
key
,
oldValue
,
getPage
)
=>
{
getPage
();
props
.
changeFormValues
(
oldValue
);
},
responseCallBack
:
(
response
)
=>
{
console
.
log
(
deleteChildren
(
response
));
return
response
;
},
condition
:
[
...
...
@@ -55,17 +78,17 @@ const handlePageSearch = (props) => {
},
{
// /PermApi/getAllRole
key
:
'
select
Type'
,
key
:
'
apply
Type'
,
type
:
'radioGroup'
,
required
:
true
,
name
:
'权限分类'
,
options
:
[
{
key
:
'
getAllR
ole'
,
key
:
'
r
ole'
,
name
:
'角色'
,
},
{
key
:
'g
etUserGroupList
'
,
key
:
'g
roup
'
,
name
:
'分组'
,
},
],
...
...
@@ -90,23 +113,15 @@ const handlePageSearch = (props) => {
width
,
},
{
dataIndex
:
'
nam
e'
,
title
:
'
应用名
'
,
dataIndex
:
'
titl
e'
,
title
:
'
角色/分组
'
,
width
:
width
+
150
,
},
{
dataIndex
:
'
isAuthorized
'
,
dataIndex
:
'
hasAuth
'
,
title
:
'是否已授权'
,
render
:
(
text
,
record
)
=>
{
// return '未授权';
const
includesIds
=
props
.
authorizedApp
.
map
((
x
)
=>
{
return
x
.
appId
;
});
if
(
record
&&
record
.
id
&&
includesIds
.
includes
(
record
.
id
))
{
return
redText
(
'已授权'
);
}
else
{
return
'未授权'
;
}
return
text
?
redText
(
'已授权'
)
:
'未授权'
;
},
},
],
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论