diff --git a/api/app/lib/controllers/overview/conserve.js b/api/app/lib/controllers/overview/conserve.js index 687b4bfb..d38f8e47 100644 --- a/api/app/lib/controllers/overview/conserve.js +++ b/api/app/lib/controllers/overview/conserve.js @@ -22,10 +22,18 @@ async function statistic (ctx) { } const reportRes = await await models.Report.findAll(findOption) + const reportCount = await models.Report.count({ + attributes: ['projectType'], + group: ['projectType'], + where: { + reportType: 'conserve', + }, + }) ctx.status = 200 ctx.body = { processed: reportRes.length, + reportCount: reportCount, reportList: reportRes, } } catch (error) { diff --git a/web/client/src/index.js b/web/client/src/index.js index 077d275f..234b13fa 100644 --- a/web/client/src/index.js +++ b/web/client/src/index.js @@ -4,4 +4,4 @@ import React from 'react'; import { render } from 'react-dom'; import App from './app'; -render((), document.getElementById('App')); \ No newline at end of file +render((), document.getElementById('App')); \ No newline at end of file diff --git a/web/client/src/layout/components/header/index.js b/web/client/src/layout/components/header/index.js index 4215357e..fe593adb 100644 --- a/web/client/src/layout/components/header/index.js +++ b/web/client/src/layout/components/header/index.js @@ -18,30 +18,15 @@ const themeMap = { } const Header = props => { - const { dispatch, changeTheme, history, user, pathname, toggleCollapsed, collapsed, actions } = props - - const changeTheme_ = (themeKey) => { - localStorage.setItem("theme-name", themeKey); - window.less.modifyVars(themeMap[themeKey]).catch(error => { - message.error(`Failed to reset theme`); - }); - changeTheme(themeKey) - } + const { dispatch, history, user, pathname, toggleCollapsed, collapsed, actions } = props const handelClick = item => { if (item.key == 'logout') { dispatch(actions.auth.logout(user)); history.push(`/signin`); - } else if (item.key == 'themeLight') { - changeTheme_('light') - } else if (item.key == 'themeDark') { - changeTheme_('dark') - } else if (item.key == 'themeExample') { - changeTheme_('example') } } - let current = pathname; console.log(pathname); if (pathname == '/' || pathname == '') { @@ -56,56 +41,46 @@ const Header = props => { return (
- {/*
+
{collapsed ? : }
- 智慧应急 */} - {/* {user.orgName} */} - {/*
+ 四好公路 +
- } > - - 亮色风格 + > + +
+ +
+
{user.name}
+
} + > + {/* }> + 个人设置 + */} + }> + 退出 - - 暗色风格 - - - 示例风格 - - */} - {/* -
- -
-
{user.name}
- } - > */} - {/* }> - 个人设置 - */} - {/* }> - 退出 - -
*/} - {/* */} - {/* */} + + + ); }; -function mapStateToProps(state) { +function mapStateToProps (state) { const { global, auth } = state; return { actions: global.actions, diff --git a/web/client/src/layout/components/sider/index.js b/web/client/src/layout/components/sider/index.js index c95e1370..d71d0ead 100644 --- a/web/client/src/layout/components/sider/index.js +++ b/web/client/src/layout/components/sider/index.js @@ -54,7 +54,7 @@ const Sider = props => { return ( {