diff --git a/config/config.ts b/config/config.ts index c3955ff..e708dfb 100644 --- a/config/config.ts +++ b/config/config.ts @@ -2,7 +2,10 @@ import { defineConfig } from 'umi'; import defaultSettings from './defaultSettings'; // import proxy from './proxy'; import PageRoutes from './router.config' +import theme from './theme'; + const { REACT_APP_ENV } = process.env; + export default defineConfig({ hash: true, antd: {}, @@ -25,10 +28,7 @@ export default defineConfig({ // umi routes: https://umijs.org/docs/routing routes: PageRoutes, // Theme for antd: https://ant.design/docs/react/customize-theme-cn - theme: { - // ...darkTheme, - 'primary-color': defaultSettings.primaryColor, - }, + theme, // @ts-ignore title: false, ignoreMomentLocale: true, diff --git a/config/defaultSettings.ts b/config/defaultSettings.ts index d281703..ca8c2e9 100644 --- a/config/defaultSettings.ts +++ b/config/defaultSettings.ts @@ -6,7 +6,7 @@ type DefaultSettings = ProSettings & { const proSettings: DefaultSettings = { navTheme: 'light', - primaryColor: '#b30000', + primaryColor: '#014F8F', layout: 'side', contentWidth: 'Fluid', fixedHeader: false, diff --git a/config/theme.js b/config/theme.js new file mode 100644 index 0000000..3fdf767 --- /dev/null +++ b/config/theme.js @@ -0,0 +1,24 @@ +export default { + // 主题色 + 'primary-color': '#014F8F', + // 按钮圆角 + 'border-radius-base': '4px', + // layout background + 'layout-background': '#F5F7FA', + // 链接色 + 'link-color': '#014F8F', + // layout-header-background + 'layout-header-background': '#ffffff', + // error + 'error-color': '#D7000F', + // menu background + 'menu-list-bg': '#F2F6FC', + // menu item selected background + 'menu-item-selected-bg': '#D9ECFF', + // table header + 'table-header-bg': '#F2F6FC', + // table header text color + 'table-header-color': '#8F9298', + // table select row background + 'table-selected-row-bg': '#F2F6FC', +} \ No newline at end of file diff --git a/src/assets/home.svg b/src/assets/home.svg new file mode 100644 index 0000000..8405c6c --- /dev/null +++ b/src/assets/home.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/shutdown.svg b/src/assets/shutdown.svg new file mode 100644 index 0000000..917c660 --- /dev/null +++ b/src/assets/shutdown.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/user.svg b/src/assets/user.svg new file mode 100644 index 0000000..44c668d --- /dev/null +++ b/src/assets/user.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/baseStyle.less b/src/baseStyle.less index 3165e50..2dec159 100644 --- a/src/baseStyle.less +++ b/src/baseStyle.less @@ -3,12 +3,17 @@ top: 0; left: 0; .ant-pro-global-header{ - background-color: #b30000; + background-color: @layout-header-background; height: 56px; - color: #fff; + color: @primary-color; } } +// 通用页面布局样式 +.layout-container { + background-color: @layout-background; + min-height: 100vh; +} .ant-pro-sider-logo { background-color: #b30000; @@ -160,11 +165,11 @@ } -.ant-pro-table{ - .ant-card-body{ - padding: 0px; - } -} +// .ant-pro-table{ +// .ant-card-body{ +// padding: 0px; +// } +// } .ant-pro-table-search { padding: 10px 24px 6px 24px; @@ -308,3 +313,23 @@ input::-webkit-outer-spin-button, padding: 6px 24px; border-bottom: 1px solid #ddd; } + +#root { + .ant-table-tbody > tr.ant-table-row:hover > td, + .ant-table-tbody > tr > td.ant-table-cell-row-hover { + background-color: @table-selected-row-bg; + } +} + +// 控制左侧菜单背景色 +.ant-menu.ant-menu-sub.ant-menu-inline { + background-color: @menu-list-bg; + + .ant-menu-item-selected { + background-color: @menu-item-selected-bg; + } + .ant-menu-item-selected a { + color: @primary-color; + font-weight: bold; + } +} diff --git a/src/components/GlobalHeader/RightContent.tsx b/src/components/GlobalHeader/RightContent.tsx index ad7dc52..aad3ee8 100644 --- a/src/components/GlobalHeader/RightContent.tsx +++ b/src/components/GlobalHeader/RightContent.tsx @@ -9,27 +9,32 @@ import './index.less'; import { getMenu, getLogout } from './services' import { getSessionUserData } from "@/utils/session"; import { getToSecondUrl } from '@/pages/LoadingPage/service'; +import userIcon from '@/assets/user.svg'; +import homeIcon from '@/assets/home.svg'; +import shutdownIcon from '@/assets/shutdown.svg'; +import { logout } from './services'; +import cookie from 'react-cookies'; const GlobalHeaderRight: React.FC<{}> = (props) => { // let className = styles.right; - let data = getSessionUserData(); + const data = getSessionUserData(); const [dataMenu, setDataMenu] = React.useState([]); const urlRef = useRef(null); const handelRole = (item: any) => { sessionStorage.setItem('roleData', JSON.stringify(item)); sessionStorage.setItem('roleAuthority', JSON.stringify([item.roleCode])); - let params = { + const params = { roleIdList: [item.roleId] } history.push('/Dashboard') window.location.reload() - getMenu(params).then(res => { - if (res?.code == 1) { - setDataMenu(res?.data) - } else { - message.error("数据错误请联系管理员") - } - }) + // getMenu(params).then(res => { + // if (res?.code == 1) { + // setDataMenu(res?.data) + // } else { + // message.error("数据错误请联系管理员") + // } + // }) } //角色退出登录 const toLogout = () => { @@ -40,15 +45,21 @@ const GlobalHeaderRight: React.FC<{}> = (props) => { title: '请确认是否退出?', content: false, onOk() { - getLogout().then((res) => { + logout().then((res) => { if (res?.success) { - if (data?.userType == "0") {//联通智慧门户 - window.close(); - } else if (data?.userType == "1") {//合作方 - window.close(); - } else if (data?.userType == "2") {//专家 - window.location.href = "/userformal/login" - } + // if (data?.userType == "0") {//联通智慧门户 + // window.close(); + // } else if (data?.userType == "1") {//合作方 + // window.close(); + // } else if (data?.userType == "2") {//专家 + // window.location.href = "/userformal/login" + // } + message.success('退出登录成功'); + sessionStorage.clear(); + cookie.remove('mall3_token'); + setTimeout(() => { + history.push('/internal-login'); + }, 1000); } }) }, @@ -62,17 +73,17 @@ const GlobalHeaderRight: React.FC<{}> = (props) => { const droMenu = ( {data?.authorityList != undefined ? - data?.authorityList?.map((item: any, index: any) => ( - + data?.authorityList?.map((item: any) => ( + handelRole(item)}>{item.roleName} )) : null} - <> + {/* <> toLogout()}>退出登录 - + */} ); @@ -89,21 +100,35 @@ const GlobalHeaderRight: React.FC<{}> = (props) => { return (
- 中国联通智慧供应链平台 | 招标采购中心 +
+
+ +
+
+ 采购平台供应商统一管理系统 + CHINA COSCO SHIPPING CORPORATION LIMITED +
+
diff --git a/src/components/GlobalHeader/index.less b/src/components/GlobalHeader/index.less index 72eeb15..f3dfeec 100644 --- a/src/components/GlobalHeader/index.less +++ b/src/components/GlobalHeader/index.less @@ -25,8 +25,8 @@ float: left; line-height: 56px; font-size: 14px; - color: #fff; - padding: 0 14px; + color: inherit; + padding: 0 12px; list-style: none; span { @@ -35,7 +35,7 @@ } a { - color: #fff; + color: #131414 !important; } } } diff --git a/src/global.less b/src/global.less index c85eb4b..af3d51a 100644 --- a/src/global.less +++ b/src/global.less @@ -51,7 +51,7 @@ ol { } // 兼容IE11 -@media screen and(-ms-high-contrast: active), (-ms-high-contrast: none) { +@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { body .ant-design-pro > .ant-layout { min-height: 100vh; } diff --git a/src/pages/MainPage/ProjectManager/index.less b/src/pages/MainPage/ProjectManager/index.less index 2a0db0f..5964d3e 100644 --- a/src/pages/MainPage/ProjectManager/index.less +++ b/src/pages/MainPage/ProjectManager/index.less @@ -14,7 +14,7 @@ border-radius: 5px; overflow-y:hidden; .moret{ - color:#b30000; + color:@primary-color; font-size:12px; cursor: pointer; } @@ -101,7 +101,7 @@ // background:#FFFFFF; border-radius: 5px; .moret{ - color:#b30000; + color:@primary-color; font-size:12px; cursor: pointer; } @@ -270,7 +270,7 @@ border-top-left-radius: 10px; border-bottom-left-radius: 10px; padding: 10px 6px 0; - background: #b30000; + background: @primary-color; z-index: 100; color: #fff; text-align: center;