Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
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
ReactWeb5
CivManage
Commits
7b571f25
Commit
7b571f25
authored
Dec 24, 2020
by
Maofei94
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: 角色管理优化
parent
08e9235e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
13 deletions
+29
-13
webpack.base.babel.js
internals/webpack/webpack.base.babel.js
+1
-1
colContent.jsx
src/components/Colophon/colContent.jsx
+1
-1
DatabaseConfig.jsx
src/pages/database/databaseConfig/DatabaseConfig.jsx
+15
-2
AddModal.jsx
src/pages/userCenter/roleManage/AddModal.jsx
+1
-0
RoleManage.jsx
src/pages/userCenter/roleManage/RoleManage.jsx
+11
-9
No files found.
internals/webpack/webpack.base.babel.js
View file @
7b571f25
...
@@ -9,7 +9,7 @@ module.exports = options => ({
...
@@ -9,7 +9,7 @@ module.exports = options => ({
output
:
Object
.
assign
(
output
:
Object
.
assign
(
{
{
path
:
path
.
resolve
(
process
.
cwd
(),
'build'
),
path
:
path
.
resolve
(
process
.
cwd
(),
'build'
),
publicPath
:
process
.
env
.
PUBLIC_PATH
||
'/CivManage'
,
publicPath
:
process
.
env
.
PUBLIC_PATH
||
'/CivManage
/
'
,
},
},
options
.
output
,
options
.
output
,
),
// Merge with env dependent settings
),
// Merge with env dependent settings
...
...
src/components/Colophon/colContent.jsx
View file @
7b571f25
...
@@ -83,7 +83,7 @@ const arr = [
...
@@ -83,7 +83,7 @@ const arr = [
</
div
>
</
div
>
),
),
},
},
// CivManage后增加/ 2020-12-22
// {
// {
// key: '2',
// key: '2',
// label: '1.0.20201218',
// label: '1.0.20201218',
...
...
src/pages/database/databaseConfig/DatabaseConfig.jsx
View file @
7b571f25
...
@@ -29,6 +29,7 @@ const dataArr = [
...
@@ -29,6 +29,7 @@ const dataArr = [
component
:
<
MySQLTable
/>,
component
:
<
MySQLTable
/>,
},
},
];
];
const
Hr
=
()
=>
<
hr
style=
{
{
width
:
'calc( 100% - 40px)'
}
}
/>;
const
DatabaseConnectConfig
=
props
=>
{
const
DatabaseConnectConfig
=
props
=>
{
const
[
flag
,
setFlag
]
=
useState
(
false
);
const
[
flag
,
setFlag
]
=
useState
(
false
);
const
[
active
,
setActive
]
=
useState
(
'0'
);
const
[
active
,
setActive
]
=
useState
(
'0'
);
...
@@ -37,16 +38,28 @@ const DatabaseConnectConfig = props => {
...
@@ -37,16 +38,28 @@ const DatabaseConnectConfig = props => {
console
.
log
(
e
);
console
.
log
(
e
);
setActive
(
e
);
setActive
(
e
);
};
};
return
(
return
(
<
PageContainer
>
<
PageContainer
>
<
Card
>
<
Card
>
<
Tabs
activeKey=
{
active
}
onChange=
{
e
=>
handleChange
(
e
)
}
>
{
/*
<Tabs activeKey={active} onChange={e => handleChange(e)}>
{dataArr.map(item => (
{dataArr.map(item => (
<TabPane tab={item.title} key={item.key}>
<TabPane tab={item.title} key={item.key}>
{active === item.key && item.component}
{active === item.key && item.component}
</TabPane>
</TabPane>
))}
))}
</
Tabs
>
</Tabs> */
}
<
Hr
/>
<
SQLServerTable
/>
<
br
/>
<
Hr
/>
<
OracleTable
/>
<
br
/>
<
Hr
/>
<
MongDBTable
/>
<
br
/>
<
Hr
/>
<
MySQLTable
/>
</
Card
>
</
Card
>
</
PageContainer
>
</
PageContainer
>
);
);
...
...
src/pages/userCenter/roleManage/AddModal.jsx
View file @
7b571f25
...
@@ -214,6 +214,7 @@ const AddModal = props => {
...
@@ -214,6 +214,7 @@ const AddModal = props => {
onChange=
{
e
=>
{
onChange=
{
e
=>
{
handleChange
(
e
);
handleChange
(
e
);
}
}
}
}
disabled
>
>
{
typeList
.
map
(
item
=>
(
{
typeList
.
map
(
item
=>
(
<
Option
value=
{
item
.
value
}
key=
{
item
.
key
}
>
<
Option
value=
{
item
.
value
}
key=
{
item
.
key
}
>
...
...
src/pages/userCenter/roleManage/RoleManage.jsx
View file @
7b571f25
...
@@ -52,7 +52,7 @@ const SiteManage = () => {
...
@@ -52,7 +52,7 @@ const SiteManage = () => {
const
[
saveTreeId
,
setSaveTreeId
]
=
useState
(
''
);
// 保存点击回调的roleid
const
[
saveTreeId
,
setSaveTreeId
]
=
useState
(
''
);
// 保存点击回调的roleid
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
// 新增弹窗
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
// 新增弹窗
const
[
flag
,
setFlag
]
=
useState
(
1
);
const
[
flag
,
setFlag
]
=
useState
(
1
);
const
[
itemObj
,
setItemObj
]
=
useState
(
{}
);
// 选择的角色item
const
[
itemObj
,
setItemObj
]
=
useState
(
''
);
// 选择的角色item
const
[
delVisible
,
setDelVisible
]
=
useState
(
false
);
// 删除弹窗
const
[
delVisible
,
setDelVisible
]
=
useState
(
false
);
// 删除弹窗
const
[
editVisible
,
setEditVisible
]
=
useState
(
false
);
// 修改弹窗
const
[
editVisible
,
setEditVisible
]
=
useState
(
false
);
// 修改弹窗
const
[
subList
,
setSubList
]
=
useState
([]);
// 选中的数组
const
[
subList
,
setSubList
]
=
useState
([]);
// 选中的数组
...
@@ -103,7 +103,7 @@ const SiteManage = () => {
...
@@ -103,7 +103,7 @@ const SiteManage = () => {
}
}
});
});
return
()
=>
{
return
()
=>
{
setItemObj
(
{}
);
setItemObj
(
''
);
};
};
},
[
flag
]);
},
[
flag
]);
...
@@ -229,7 +229,9 @@ const SiteManage = () => {
...
@@ -229,7 +229,9 @@ const SiteManage = () => {
i
.
group
=
itemRole
.
visibleTitle
;
i
.
group
=
itemRole
.
visibleTitle
;
i
.
icon
=
<
UserOutlined
/>;
i
.
icon
=
<
UserOutlined
/>;
if
(
roleID
&&
roleID
===
i
.
roleID
)
{
if
(
roleID
&&
roleID
===
i
.
roleID
)
{
console
.
log
(
roleID
,
typeof
roleID
,
'roleID'
);
setItemObj
(
i
);
setItemObj
(
i
);
// setCurrentSelectId(roleID);
}
}
});
});
...
@@ -240,7 +242,9 @@ const SiteManage = () => {
...
@@ -240,7 +242,9 @@ const SiteManage = () => {
itemRole
.
subSystemValue
=
item
.
visibleValue
;
itemRole
.
subSystemValue
=
item
.
visibleValue
;
itemRole
.
icon
=
<
UserOutlined
/>;
itemRole
.
icon
=
<
UserOutlined
/>;
if
(
roleID
&&
roleID
===
itemRole
.
roleID
)
{
if
(
roleID
&&
roleID
===
itemRole
.
roleID
)
{
console
.
log
(
roleID
,
typeof
roleID
,
'roleID'
);
setItemObj
(
itemRole
);
setItemObj
(
itemRole
);
// setCurrentSelectId(roleID);
}
}
}
}
return
itemRole
;
return
itemRole
;
...
@@ -251,18 +255,16 @@ const SiteManage = () => {
...
@@ -251,18 +255,16 @@ const SiteManage = () => {
});
});
return
arr3
;
return
arr3
;
};
};
// 获取搜索框的值
const
handleSearch
=
value
=>
{
setSearchWord
(
value
);
};
const
handleChange
=
e
=>
{
const
handleChange
=
e
=>
{
const
{
value
}
=
e
.
target
;
const
{
value
}
=
e
.
target
;
setSearchWord
(
value
);
setSearchWord
(
value
);
};
};
// 确认回调
// 确认回调
const
confirmModal
=
e
=>
{
const
confirmModal
=
e
=>
{
console
.
log
(
e
,
'e'
);
console
.
log
(
e
,
typeof
e
,
'e'
);
setModalVisible
(
false
);
setModalVisible
(
false
);
setRoleID
(
`
${
e
}
`
);
setCurrentSelectId
([
`
${
e
}
`
]);
setFlag
(
flag
+
1
);
setFlag
(
flag
+
1
);
setItemObj
(
''
);
setItemObj
(
''
);
};
};
...
@@ -417,7 +419,7 @@ const SiteManage = () => {
...
@@ -417,7 +419,7 @@ const SiteManage = () => {
<
Search
<
Search
allowClear
allowClear
placeholder=
{
placeholder
}
placeholder=
{
placeholder
}
onSearch=
{
handleSearch
}
//
onSearch={handleSearch}
onChange=
{
handleChange
}
onChange=
{
handleChange
}
enterButton
enterButton
/>
/>
...
@@ -430,7 +432,7 @@ const SiteManage = () => {
...
@@ -430,7 +432,7 @@ const SiteManage = () => {
onClick=
{
()
=>
{
onClick=
{
()
=>
{
handleAdd
();
handleAdd
();
}
}
}
}
disabled=
{
itemObj
.
roleID
}
disabled=
{
!
itemObj
||
(
itemObj
&&
itemObj
.
roleID
)
}
>
>
新增角色
新增角色
</
Button
>
</
Button
>
...
...
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