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
shenshaokai
jinfa-admin
Commits
7e990265
Commit
7e990265
authored
Oct 21, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:修复权限能力bug
parent
6b9a5cbb
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
84 additions
and
25 deletions
+84
-25
index.tsx
src/components/TabTree/index.tsx
+11
-9
regExp.ts
src/constants/regExp.ts
+2
-0
memberDetail.tsx
src/pages/authConfig/memberSystem/memberDetail.tsx
+10
-1
index.tsx
src/pages/authConfig/organ/index.tsx
+11
-7
index.ts
src/pages/authConfig/organ/schema/index.ts
+27
-4
index.ts
src/pages/authConfig/userSystem/schema/index.ts
+23
-4
No files found.
src/components/TabTree/index.tsx
View file @
7e990265
import
React
,
{
useState
,
ReactText
,
useImperativeHandle
,
useEffect
,
useRef
}
from
'react'
import
{
Tree
,
Space
,
Tooltip
,
Button
}
from
'antd'
import
{
Tree
,
Space
,
Tooltip
,
Button
,
Popconfirm
}
from
'antd'
import
{
findItemAndDelete
,
findTreeKeys
,
treeReduction
,
getParentTreeTitles
}
from
'@/utils'
import
'./index.less'
import
deepClone
from
'clone'
...
...
@@ -115,14 +115,16 @@ const RenderIcons: React.FC<RenderIconsProps> = props => {
/>
</
Tooltip
>
<
Tooltip
title=
"删除当前节点"
>
<
DeleteOutlined
onClick=
{
e
=>
{
e
.
stopPropagation
();
toolsRender
&&
toolsRender
.
deleteNode
&&
toolsRender
.
deleteNode
(
props
.
node
);
}
}
/>
<
Popconfirm
title=
'确认删除当前节点?'
onConfirm=
{
e
=>
{
toolsRender
&&
toolsRender
.
deleteNode
&&
toolsRender
.
deleteNode
(
props
.
node
);
}
}
>
<
DeleteOutlined
onClick=
{
e
=>
e
.
stopPropagation
()
}
/>
</
Popconfirm
>
</
Tooltip
>
</
Space
>
);
...
...
src/constants/regExp.ts
View file @
7e990265
...
...
@@ -16,4 +16,5 @@ export const PATTERN_MAPS = {
smsCode
:
/^
\d{6}
$/
,
money
:
/^
\d
*
(?:\.\d{0,2})?
$/
,
weight
:
/^
\d
*
(?:\.\d{0,3})?
$/
,
idCard
:
/^
[
1-9
]\d{5}(
18|19|20|
(
3
\d))\d{2}((
0
[
1-9
])
|
(
1
[
0-2
]))(([
0-2
][
1-9
])
|10|20|30|31
)\d{3}[
0-9Xx
]
$/
}
\ No newline at end of file
src/pages/authConfig/memberSystem/memberDetail.tsx
View file @
7e990265
...
...
@@ -165,7 +165,16 @@ const MemberDetail: React.FC<{}> = () => {
roleName
:
{
type
:
'string'
,
title
:
'角色名称'
,
required
:
true
"x-rules"
:
[
{
message
:
'请输入角色名称'
,
required
:
true
},
{
limitByte
:
true
,
maxByte
:
20
}
]
},
remark
:
{
type
:
'textarea'
,
...
...
src/pages/authConfig/organ/index.tsx
View file @
7e990265
...
...
@@ -13,6 +13,7 @@ import { omit } from '@/utils';
import
{
useMap
,
useBoolean
}
from
'@umijs/hooks'
;
import
{
useTreeTabs
}
from
'@/hooks/useTreeTabs'
;
import
{
isObject
}
from
'@antv/util'
;
import
{
Prompt
}
from
'umi'
;
// import "./index.less"
const
{
ON_FORM_INPUT_CHANGE
}
=
LifeCycleTypes
...
...
@@ -46,7 +47,8 @@ const Organ: React.FC<{}> = () => {
setTreeMaps
,
resetMenu
,
toolsRender
,
handleDeleteMenu
handleDeleteMenu
,
isEditForm
}
=
useTreeTabs
({
treeActions
,
formActions
,
...
...
@@ -72,11 +74,13 @@ const Organ: React.FC<{}> = () => {
}
const
fn
=
editOrAdd
?
PublicApi
.
postMemberOrgUpdate
:
PublicApi
.
postMemberOrgAdd
fn
(
params
).
then
(
res
=>
{
resetMenu
()
setTreeStatus
(
FormState
.
FREE
)
setNodeRecord
(
undefined
)
// 保存后要将是否填写过表单设为false
setIsEditForm
(
false
)
if
(
res
.
code
===
1000
)
{
resetMenu
()
setTreeStatus
(
FormState
.
FREE
)
setNodeRecord
(
undefined
)
// 保存后要将是否填写过表单设为false
setIsEditForm
(
false
)
}
})
}
...
...
@@ -129,7 +133,7 @@ const Organ: React.FC<{}> = () => {
}
</
Col
>
</
Row
>
<
Prompt
when=
{
isEditForm
}
message=
'有未提交的内容,确定要离开吗?'
/>
</
div
>
}
...
...
src/pages/authConfig/organ/schema/index.ts
View file @
7e990265
...
...
@@ -14,20 +14,43 @@ export const menuSchema: ISchema = {
code
:
{
type
:
'string'
,
title
:
'组织代码'
,
required
:
true
,
"x-rules"
:
[
{
message
:
'请输入组织代码'
,
required
:
true
},
{
limitByte
:
true
,
maxByte
:
12
}
]
},
title
:
{
type
:
'string'
,
title
:
'组织机构'
,
required
:
true
"x-rules"
:
[
{
message
:
'请输入组织机构'
,
required
:
true
},
{
limitByte
:
true
,
maxByte
:
40
}
]
},
remark
:
{
type
:
'textarea'
,
title
:
'描述'
,
"x-component-props"
:
{
rows
:
4
}
},
"x-rules"
:
[
{
limitByte
:
true
,
maxByte
:
64
}
]
}
}
}
...
...
src/pages/authConfig/userSystem/schema/index.ts
View file @
7e990265
...
...
@@ -39,8 +39,16 @@ export const UserDetailSchema:ISchema = {
name
:
{
type
:
'string'
,
title
:
'姓名'
,
maxLength
:
16
,
required
:
true
"x-rules"
:
[
{
message
:
'请输入姓名'
,
required
:
true
},
{
limitByte
:
true
,
maxByte
:
16
}
]
},
phoneLayout
:
{
type
:
'object'
,
...
...
@@ -88,7 +96,13 @@ export const UserDetailSchema:ISchema = {
},
idCardNo
:
{
type
:
'string'
,
title
:
'身份证号'
title
:
'身份证号'
,
"x-rules"
:
[
{
pattern
:
PATTERN_MAPS
.
idCard
,
message
:
'请输入正确的身份证号'
}
]
},
email
:
{
type
:
'string'
,
...
...
@@ -103,7 +117,12 @@ export const UserDetailSchema:ISchema = {
jobTitle
:
{
type
:
'string'
,
title
:
'职位'
,
maxLength
:
20
,
"x-rules"
:
[
{
limitByte
:
true
,
maxByte
:
20
}
]
},
orgName
:
{
type
:
'string'
,
...
...
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