Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project
jinfa-admin
Commits
d802edd5
Commit
d802edd5
authored
Apr 19, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复权限菜单有时候更新不到的问题
parent
bf4444c1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
20 deletions
+23
-20
index.tsx
...ges/member/memberPrSubmit/components/DetailInfo/index.tsx
+23
-20
No files found.
src/pages/member/memberPrSubmit/components/DetailInfo/index.tsx
View file @
d802edd5
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Author: XieZhiXiong
* @Date: 2021-01-26 16:36:30
* @Date: 2021-01-26 16:36:30
* @LastEditors: XieZhiXiong
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-0
1-26 16:41:39
* @LastEditTime: 2021-0
4-19 16:58:00
* @Description: 待提交审核详情信息
* @Description: 待提交审核详情信息
*/
*/
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
...
@@ -17,6 +17,7 @@ import {
...
@@ -17,6 +17,7 @@ import {
Modal
,
Modal
,
Button
,
Button
,
Spin
,
Spin
,
message
,
}
from
'antd'
;
}
from
'antd'
;
import
{
FormOutlined
}
from
'@ant-design/icons'
;
import
{
FormOutlined
}
from
'@ant-design/icons'
;
import
{
usePageStatus
,
PageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
usePageStatus
,
PageStatus
}
from
'@/hooks/usePageStatus'
;
...
@@ -51,11 +52,11 @@ interface DetailInfoProps {
...
@@ -51,11 +52,11 @@ interface DetailInfoProps {
/**
/**
* 数据id
* 数据id
*/
*/
id
?
:
string
;
id
:
string
;
/**
/**
* 审核id
* 审核id
*/
*/
validateId
?
:
string
;
validateId
:
string
;
/**
/**
* 是否是编辑的
* 是否是编辑的
*/
*/
...
@@ -175,7 +176,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
...
@@ -175,7 +176,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
}
else
{
}
else
{
if
(
isEditForm
)
{
if
(
isEditForm
)
{
// 有填写过表单
// 有填写过表单
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
<
void
>
((
resolve
,
reject
)
=>
{
Modal
.
confirm
({
Modal
.
confirm
({
content
:
'确认要离开当前页面吗,您提交的数据尚未保存'
,
content
:
'确认要离开当前页面吗,您提交的数据尚未保存'
,
onOk
()
{
onOk
()
{
...
@@ -232,8 +233,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
...
@@ -232,8 +233,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
if
(
isEditForm
)
{
if
(
isEditForm
)
{
// 更新右侧按钮
// 更新右侧按钮
await
PublicApi
.
postMemberValidateCommitUpdatebutton
({
await
PublicApi
.
postMemberValidateCommitUpdatebutton
({
memberId
:
id
,
memberId
:
+
id
,
validateId
,
validateId
:
+
validateId
,
menuId
:
nodeRecord
.
id
,
menuId
:
nodeRecord
.
id
,
buttonIds
:
buttonIds
,
buttonIds
:
buttonIds
,
});
});
...
@@ -247,43 +248,44 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
...
@@ -247,43 +248,44 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
const
updateMenu
=
()
=>
{
const
updateMenu
=
()
=>
{
const
menuIds
:
any
=
treeActions
.
getSelectKeys
();
const
menuIds
:
any
=
treeActions
.
getSelectKeys
();
return
PublicApi
.
postMemberValidateCommitUpdatemenu
({
return
PublicApi
.
postMemberValidateCommitUpdatemenu
({
memberId
:
id
,
memberId
:
+
id
,
validateId
,
validateId
:
+
validateId
,
menuIds
,
menuIds
,
},
{
},
{
ctlType
:
'none'
,
ctlType
:
'none'
,
});
});
};
};
const
handleSubmit
=
values
=>
{
const
handleSubmit
=
async
(
values
)
=>
{
if
(
!
isEdit
)
{
if
(
!
isEdit
)
{
return
;
return
;
}
}
setConfirmLoading
(
true
);
setConfirmLoading
(
true
);
const
promises
=
[
const
updateRes
=
await
updateMenu
();
updateMenu
(),
if
(
updateRes
.
code
!==
1000
)
{
message
.
error
(
updateRes
.
message
||
'未知错误'
);
setConfirmLoading
(
false
);
return
;
}
PublicApi
.
postMemberValidateCommitSubmit
({
PublicApi
.
postMemberValidateCommitSubmit
({
memberId
:
id
,
memberId
:
id
,
validateId
,
validateId
,
...
values
,
...
values
,
}),
}).
then
((
res
)
=>
{
];
if
(
res
.
code
===
1000
)
{
Promise
.
all
(
promises
).
then
(
resArr
=>
{
if
(
resArr
.
every
(
item
=>
item
&&
item
.
code
===
1000
))
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
history
.
goBack
();
history
.
goBack
();
},
800
);
},
800
);
setModalVisible
(
false
);
setModalVisible
(
false
);
}
setConfirmLoading
(
false
);
setPowerUnsaved
(
false
);
setPowerUnsaved
(
false
);
}).
catch
(()
=>
{
}
}).
finally
(()
=>
{
setConfirmLoading
(
false
);
setConfirmLoading
(
false
);
});
});
};
};
const
handleCheck
=
(
)
=>
{
const
handleCheck
=
(
keys
:
any
,
nodes
:
any
):
any
=>
{
setPowerUnsaved
(
true
);
setPowerUnsaved
(
true
);
};
};
...
@@ -398,6 +400,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
...
@@ -398,6 +400,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
handleSelect=
{
handleSelect
}
handleSelect=
{
handleSelect
}
handleCheck=
{
handleCheck
}
handleCheck=
{
handleCheck
}
disabled=
{
!
isEdit
}
disabled=
{
!
isEdit
}
checkStrictly
checkable
checkable
/>
/>
</
MellowCard
>
</
MellowCard
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment