巴林闲侠 2 years ago
parent
commit
94429e18d7
  1. 226
      web/client/src/layout/components/header/index.jsx
  2. 3
      web/client/src/sections/install/components/adminModal.jsx
  3. 3
      web/client/src/sections/install/components/memberModal.jsx
  4. 3
      web/client/src/sections/install/components/systemModal.jsx
  5. 6
      web/client/src/sections/install/containers/roles.jsx
  6. 3
      web/client/src/sections/install/containers/system.jsx

226
web/client/src/layout/components/header/index.jsx

@ -5,121 +5,133 @@ import { Nav, Avatar, Dropdown } from "@douyinfe/semi-ui";
import "./index.less"; import "./index.less";
const Header = (props) => { const Header = (props) => {
const { dispatch, history, user, actions, socket, headerItems, tochange } = props; const { dispatch, history, user, actions, socket, headerItems, tochange } = props;
return ( return (
<> <>
<div id="top-slider"> <div id="top-slider">
<Nav <Nav
mode={"horizontal"} mode={"horizontal"}
onClick={({ itemKey }) => { onClick={({ itemKey }) => {
if (itemKey == "logout") { if (itemKey == "logout") {
dispatch(actions.auth.logout(user)); dispatch(actions.auth.logout(user));
if (socket) { if (socket) {
socket.disconnect(); socket.disconnect();
} }
history.push(`/signin`); history.push(`/signin`);
}
}}
style={{
height: 48,
minWidth: 520,
background: '#1D2343',
backgroundSize: "100% 100%",
color: "white",
}}
header={{
logo: (
<img
src="/assets/images/background/logo.png"
style={{ display: "inline-block", width: 280, height: 40 }}
/>
),
text: (
<div style={{ fontFamily: "YouSheBiaoTiHei", color: '#FFFFFF' }}>运维管理系统</div>
),
}}
footer={
<>
{headerItems.map((item, index) => {
if (item.hasOwnProperty('items')) {
return (
<Nav.Sub
key={index + 'a'}
itemKey={item.itemKey}
text={item.text}
dropdownStyle={{ color: '#F2F3F5' }}
>
{item.hasOwnProperty('items') && item.items.map((ite, idx) => (
<Nav.Item key={idx + 'd'} itemKey={ite.itemKey} text={ite.text} onClick={() => { tochange(ite); }} />
))}
</Nav.Sub>
)
} }
else { }}
return ( style={{
<Nav.Item key={index + 'a'} itemKey={item.itemKey} text={item.text} onClick={() => { tochange(item) }} /> height: 48,
) minWidth: 520,
} background: '#1D2343',
})} backgroundSize: "100% 100%",
<Nav.Sub color: "white",
itemKey={"user"} }}
text={ header={{
<div logo: (
style={{ <div style={{display:'flex',alignItems: 'center'}}>
marginLeft: -8, <div>
display: "inline-block", <img
color: "white", src="/assets/images/background/logo.png"
}} style={{ display: "inline-block", width: 24, height: 24 }}
> />
<Avatar size="extra-small" color="light-blue" style={{ marginRight: 4 }}> </div>
{user?.name?.substr(0, 1)} <div>
</Avatar> <div style={{ fontSize: 18, fontFamily: "YouSheBiaoTiHei", color: '#FFFFFF',letterSpacing: 3 }}>运维管理系统</div>
<div style={{ <div style={{ fontSize: 8, fontFamily: "YouSheBiaoTiHei", color: '#FFFFFF' }}>RUNNING MANAGEMENT SYSTEM</div>
display: "inline-block", position: "relative", </div>
top: 10, </div>
left: 4, // <img
marginRight: 4, // src="/assets/images/background/logo.png"
}} // style={{ display: "inline-block", width: 280, height: 40 }}
> // />
</div> ),
</div> // text: (
} // <div style={{ fontFamily: "YouSheBiaoTiHei", color: '#FFFFFF' }}></div>
> // ),
<div style={{ width: 200, padding: 16, background: '#c7bebeeb' }}> }}
<div style={{ display: "flex" }}> footer={
<Avatar size="default" color="light-blue" style={{ marginRight: 4 }}> <>
{user?.name?.substr(0, 1)} {headerItems.map((item, index) => {
</Avatar> if (item.hasOwnProperty('items')) {
<div style={{ fontSize: 12 }}> return (
{user.name} <Nav.Sub
<div title={user?.department?.map(v => v.name + '、')} style={{ width: 100, overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }}>{user?.department?.map(v => v.name + '、')}</div> key={index + 'a'}
</div> itemKey={item.itemKey}
</div> text={item.text}
<div>用户中心</div> dropdownStyle={{ color: '#F2F3F5' }}
<div>安全认证</div> >
</div> {item.hasOwnProperty('items') && item.items.map((ite, idx) => (
<Nav.Item itemKey={"logout"} text={"退出"} style={{ textAlign: "center" }} /> <Nav.Item key={idx + 'd'} itemKey={ite.itemKey} text={ite.text} onClick={() => { tochange(ite); }} />
))}
</Nav.Sub>
)
}
else {
return (
<Nav.Item key={index + 'a'} itemKey={item.itemKey} text={item.text} onClick={() => { tochange(item) }} />
)
}
})}
<Nav.Sub
itemKey={"user"}
text={
<div
style={{
marginLeft: -8,
display: "inline-block",
color: "white",
}}
>
<Avatar size="extra-small" color="light-blue" style={{ marginRight: 4 }}>
{user?.name?.substr(0, 1)}
</Avatar>
<div style={{
display: "inline-block", position: "relative",
top: 10,
left: 4,
marginRight: 4,
}}
>
</div>
</div>
}
>
<div style={{ width: 200, padding: 16, background: '#c7bebeeb' }}>
<div style={{ display: "flex" }}>
<Avatar size="default" color="light-blue" style={{ marginRight: 4 }}>
{user?.name?.substr(0, 1)}
</Avatar>
<div style={{ fontSize: 12 }}>
{user.name}
<div title={user?.department?.map(v => v.name + '、')} style={{ width: 100, overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }}>{user?.department?.map(v => v.name + '、')}</div>
</div>
</div>
<div>用户中心</div>
<div>安全认证</div>
</div>
<Nav.Item itemKey={"logout"} text={"退出"} style={{ textAlign: "center" }} />
{/* collapseButton collapseText */} {/* collapseButton collapseText */}
</Nav.Sub> </Nav.Sub>
</> </>
} }
/> />
</div> </div>
</> </>
); );
}; };
function mapStateToProps (state) { function mapStateToProps (state) {
const { global, auth, webSocket } = state; const { global, auth, webSocket } = state;
return { return {
actions: global.actions, actions: global.actions,
user: auth.user, user: auth.user,
socket: webSocket.socket, socket: webSocket.socket,
}; };
} }
export default connect(mapStateToProps)(Header); export default connect(mapStateToProps)(Header);

3
web/client/src/sections/install/components/adminModal.jsx

@ -7,6 +7,7 @@ import { IconAlertCircle } from '@douyinfe/semi-icons';
function adminModal (props) { function adminModal (props) {
const { const {
close, close,
cancel,
visible, visible,
dispatch, dispatch,
pepList, pepList,
@ -60,7 +61,7 @@ function adminModal (props) {
}) })
} }
function handleCancel () { function handleCancel () {
close(); cancel();
// //
} }
return ( return (

3
web/client/src/sections/install/components/memberModal.jsx

@ -7,6 +7,7 @@ import { IconAlertCircle } from '@douyinfe/semi-icons';
function memberModal (props) { function memberModal (props) {
const { const {
close, close,
cancel,
visible, visible,
dispatch, dispatch,
pepList, pepList,
@ -82,7 +83,7 @@ function memberModal (props) {
}) })
} }
function handleCancel () { function handleCancel () {
close(); cancel();
// //
} }
return ( return (

3
web/client/src/sections/install/components/systemModal.jsx

@ -7,6 +7,7 @@ import { IconAlertCircle, IconAlertTriangle } from '@douyinfe/semi-icons';
function adminModal (props) { function adminModal (props) {
const { const {
close, close,
cancel,
visible, visible,
dispatch, dispatch,
actions, actions,
@ -67,7 +68,7 @@ function adminModal (props) {
}) })
} }
function handleCancel () { function handleCancel () {
close(); cancel();
// //
} }
const renderMultipleWithCustomTag = (optionNode, { onClose }) => { const renderMultipleWithCustomTag = (optionNode, { onClose }) => {

6
web/client/src/sections/install/containers/roles.jsx

@ -593,6 +593,9 @@ const Roles = (props) => {
pepList={pepList} pepList={pepList}
adminEdit={adminEdit} adminEdit={adminEdit}
editObj={editObj} editObj={editObj}
cancel={() => {
setAdminModal(false);
}}
close={() => { close={() => {
setAdminModal(false); setAdminModal(false);
getUserList() getUserList()
@ -609,6 +612,9 @@ const Roles = (props) => {
pomsList={pomsList} pomsList={pomsList}
anxinDelete={anxinDelete} anxinDelete={anxinDelete}
anxincloudArr={anxincloudArr} anxincloudArr={anxincloudArr}
cancel={() => {
setMemberModal(false);
}}
close={() => { close={() => {
setMemberModal(false); setMemberModal(false);
getUserList() getUserList()

3
web/client/src/sections/install/containers/system.jsx

@ -420,6 +420,9 @@ const Example = (props) => {
anxinDelete={anxinDelete} anxinDelete={anxinDelete}
appArr={appArr} appArr={appArr}
bindId={bindId} bindId={bindId}
cancel={() => {
setSystemModal(false);
}}
close={() => { close={() => {
setSystemModal(false); setSystemModal(false);
getProjectPomsList() getProjectPomsList()

Loading…
Cancel
Save