From 0d9e77afc751905e6b9d4cd2ef7b4763fe55be72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=87=AA=E5=B8=A6=E5=A4=A7=E4=BD=AC=E6=B0=94=E5=9C=BA?= <188633308@qq.com> Date: Fri, 2 Jul 2021 12:15:23 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix=20=E6=89=93=E5=8C=85=E5=90=8E=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E5=88=87=E6=8D=A2=E6=A0=B7=E5=BC=8F=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web-react/.env | 1 + web-react/src/assets/style/dark/extend.less | 5 +++++ web-react/src/assets/style/default/extend.less | 5 +++++ web-react/src/index.js | 9 ++++++--- 4 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 web-react/.env diff --git a/web-react/.env b/web-react/.env new file mode 100644 index 0000000..4f79a0f --- /dev/null +++ b/web-react/.env @@ -0,0 +1 @@ +GENERATE_SOURCEMAP=false \ No newline at end of file diff --git a/web-react/src/assets/style/dark/extend.less b/web-react/src/assets/style/dark/extend.less index 9bdd94f..7f3c2c9 100644 --- a/web-react/src/assets/style/dark/extend.less +++ b/web-react/src/assets/style/dark/extend.less @@ -4,3 +4,8 @@ body { line-height: 1.42857143; } +#root { + transition: @animation-duration-slow opacity; + + opacity: 1 !important; +} diff --git a/web-react/src/assets/style/default/extend.less b/web-react/src/assets/style/default/extend.less index 07ee081..4b038cc 100644 --- a/web-react/src/assets/style/default/extend.less +++ b/web-react/src/assets/style/default/extend.less @@ -4,3 +4,8 @@ body { line-height: 1.42857143; } +#root { + transition: @animation-duration-slow opacity; + + opacity: 1 !important; +} diff --git a/web-react/src/index.js b/web-react/src/index.js index f63c526..3d85d46 100644 --- a/web-react/src/index.js +++ b/web-react/src/index.js @@ -15,15 +15,18 @@ const SETTING = JSON.parse(window.localStorage.getItem(SETTING_KEY)) || { }; if (SETTING.theme === 'dark') { - require('./assets/style/dark/index.less') + import('./assets/style/dark/index.less') } else { - require('./assets/style/default/index.less') + import('./assets/style/default/index.less') } moment.locale('zh-cn') // +const root = document.getElementById('root') +root.style.opacity = 0 + ReactDOM.render( , - document.getElementById('root') + root ); // If you want to start measuring performance in your app, pass a function From 4053d6ff0a1eb3601d16c2355550d9ae4118ebd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=87=AA=E5=B8=A6=E5=A4=A7=E4=BD=AC=E6=B0=94=E5=9C=BA?= <188633308@qq.com> Date: Fri, 2 Jul 2021 12:15:48 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix=20=E6=97=A0=E9=99=90=E6=BB=9A=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Api/Ewide.Core/Manager/UserManager.cs | 2 +- web-react/src/assets/style/dark/main.less | 7 +++++ web-react/src/assets/style/default/main.less | 7 +++++ .../src/views/main/_layout/header/notice.jsx | 27 ++++++++++++------- 4 files changed, 32 insertions(+), 11 deletions(-) diff --git a/Api/Ewide.Core/Manager/UserManager.cs b/Api/Ewide.Core/Manager/UserManager.cs index a2ec008..c596181 100644 --- a/Api/Ewide.Core/Manager/UserManager.cs +++ b/Api/Ewide.Core/Manager/UserManager.cs @@ -202,7 +202,7 @@ namespace Ewide.Core .Select(u => u.Permission).ToListAsync(); #if DEBUG #else - await _sysCacheService.SetPermission(userId, permissions); // 缓存结果 + await _sysCacheService.SetPermission(UserId, permissions); // 缓存结果 #endif } return permissions; diff --git a/web-react/src/assets/style/dark/main.less b/web-react/src/assets/style/dark/main.less index 1060b2f..c6ea34e 100644 --- a/web-react/src/assets/style/dark/main.less +++ b/web-react/src/assets/style/dark/main.less @@ -688,3 +688,10 @@ padding: 0; } } +.yo-popover-infinite-scroll { + .ant-popover-inner-content { + overflow-y: auto; + + max-height: 300px; + } +} diff --git a/web-react/src/assets/style/default/main.less b/web-react/src/assets/style/default/main.less index 8f1100f..68cd631 100644 --- a/web-react/src/assets/style/default/main.less +++ b/web-react/src/assets/style/default/main.less @@ -682,3 +682,10 @@ padding: 0; } } +.yo-popover-infinite-scroll { + .ant-popover-inner-content { + overflow-y: auto; + + max-height: 300px; + } +} diff --git a/web-react/src/views/main/_layout/header/notice.jsx b/web-react/src/views/main/_layout/header/notice.jsx index dd89eab..b6f7d9d 100644 --- a/web-react/src/views/main/_layout/header/notice.jsx +++ b/web-react/src/views/main/_layout/header/notice.jsx @@ -1,5 +1,5 @@ import React, { Component } from 'react' -import { Badge, Divider, List, Menu, Modal, Popover, Row, Spin } from 'antd' +import { Badge, Button, Divider, List, Menu, Modal, Popover, Row, Spin } from 'antd' import { AntIcon, Image } from 'components' import { api } from 'common/api' import InfiniteScroll from 'react-infinite-scroller' @@ -69,7 +69,7 @@ export default class notice extends Component { loadMore={pageIndex => this.onInfiniteOnLoad(pageIndex)} hasMore={!loading && hasMore} useWindow={false} - threshold={100} + threshold={50} > } title={ - this.onOpenDetail(item.id)} - > - {item.title} - + <> + this.onOpenDetail(item.id)}> + {item.title} + + + {moment(item.createdTime || item.publicTime).fromNow()} + + } - description={moment(item.createdTime || item.publicTime).fromNow()} />
{item.content}
@@ -98,6 +99,11 @@ export default class notice extends Component { )}
+ {!hasMore && ( + + )} ) } @@ -110,8 +116,9 @@ export default class notice extends Component { arrowPointAtCenter={true} placement="bottomRight" content={this.renderList()} - overlayInnerStyle={{ width: 300, maxHeight: 300, overflowY: 'auto' }} + overlayInnerStyle={{ width: 300 }} overlayStyle={{ zIndex: 999 }} + overlayClassName="yo-popover-infinite-scroll" > From 717c264518352f66f29a542e339b1aa28a6bc26f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=87=AA=E5=B8=A6=E5=A4=A7=E4=BD=AC=E6=B0=94=E5=9C=BA?= <188633308@qq.com> Date: Fri, 2 Jul 2021 14:11:48 +0800 Subject: [PATCH 3/4] =?UTF-8?q?update=20=E5=A4=84=E7=90=86=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E6=A0=B7=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web-react/craco.config.js | 4 +- web-react/src/assets/style/dark/lib/card.less | 10 ++++ .../src/assets/style/dark/lib/table.less | 45 +++++++++++------ web-react/src/assets/style/dark/public.less | 2 +- .../src/assets/style/default/lib/table.less | 45 +++++++++++------ web-react/src/index.js | 48 ++++++++++--------- .../src/pages/system/dict/dictdata/form.jsx | 8 +++- 7 files changed, 106 insertions(+), 56 deletions(-) diff --git a/web-react/craco.config.js b/web-react/craco.config.js index 0b2c146..e240718 100644 --- a/web-react/craco.config.js +++ b/web-react/craco.config.js @@ -29,7 +29,7 @@ module.exports = { ], webpack: { plugins: [ - //new MonacoWebpackPlugin() + new MonacoWebpackPlugin() ] - } + }, } \ No newline at end of file diff --git a/web-react/src/assets/style/dark/lib/card.less b/web-react/src/assets/style/dark/lib/card.less index 7ae210e..6fdc1e2 100644 --- a/web-react/src/assets/style/dark/lib/card.less +++ b/web-react/src/assets/style/dark/lib/card.less @@ -2,3 +2,13 @@ .ant-card { margin-bottom: @padding-md; } +.ant-card-grid-hoverable { + &:hover { + box-shadow: 1px 0 0 0 #303030, + 0 1px 0 0 #303030, + 1px 1px 0 0 #303030, + 1px 0 0 0 #303030 inset, + 0 1px 0 0 #303030 inset, + @card-shadow; + } +} diff --git a/web-react/src/assets/style/dark/lib/table.less b/web-react/src/assets/style/dark/lib/table.less index 684a4ea..72993b8 100644 --- a/web-react/src/assets/style/dark/lib/table.less +++ b/web-react/src/assets/style/dark/lib/table.less @@ -75,6 +75,9 @@ .ant-table-sticky-scroll { display: none; } +.ant-table-expanded-row>td { + border-right: @border-width-base @border-style-base @table-border-color !important; +} .yo-table { .ant-table { margin: 0 !important; @@ -196,11 +199,13 @@ } } .ant-table-tbody { - >.ant-table-expanded-row-level-1>td { + >.ant-table-expanded-row>td { padding: 0; border-right: none !important; .ant-table-wrapper { + margin-bottom: -1px; + border: none; .ant-table { margin: 0 !important; @@ -215,20 +220,17 @@ padding-left: @padding-md; } } - .ant-table-expanded-row-level-1>td { - padding: @padding-sm @padding-xs @padding-sm @padding-xl; - - border-right: @border-width-base @border-style-base @table-border-color !important; - .ant-card { - max-width: fit-content; - margin-bottom: 0; - - background: none; - .ant-card-grid { - width: 300px; - padding: @padding-xs @padding-sm; - - background-color: @card-background; + .ant-table-tbody { + >tr { + &:last-child { + >td { + border-bottom: @border-width-base @border-style-base @table-border-color; + } + &:hover { + >td { + border-bottom-color: lighten(@primary-color, 30%); + } + } } } } @@ -237,4 +239,17 @@ } } } + .ant-card { + max-width: fit-content; + margin: @padding-sm @padding-xs @padding-sm @padding-xl; + + background: none; + .ant-card-grid { + width: 300px; + height: 90px; + padding: @padding-xs @padding-sm; + + background-color: @card-background; + } + } } diff --git a/web-react/src/assets/style/dark/public.less b/web-react/src/assets/style/dark/public.less index 16a4aed..ee4716d 100644 --- a/web-react/src/assets/style/dark/public.less +++ b/web-react/src/assets/style/dark/public.less @@ -35,7 +35,7 @@ } } a.link-gray { - color: fade(@black, 50%); + color: fade(@white, 50%); &:hover { color: @link-hover-color; } diff --git a/web-react/src/assets/style/default/lib/table.less b/web-react/src/assets/style/default/lib/table.less index 48fbda4..72993b8 100644 --- a/web-react/src/assets/style/default/lib/table.less +++ b/web-react/src/assets/style/default/lib/table.less @@ -75,6 +75,9 @@ .ant-table-sticky-scroll { display: none; } +.ant-table-expanded-row>td { + border-right: @border-width-base @border-style-base @table-border-color !important; +} .yo-table { .ant-table { margin: 0 !important; @@ -196,11 +199,13 @@ } } .ant-table-tbody { - >.ant-table-expanded-row-level-1>td { + >.ant-table-expanded-row>td { padding: 0; border-right: none !important; .ant-table-wrapper { + margin-bottom: -1px; + border: none; .ant-table { margin: 0 !important; @@ -215,20 +220,17 @@ padding-left: @padding-md; } } - .ant-table-expanded-row-level-1>td { - padding: @padding-sm @padding-xs @padding-sm @padding-xl; - - border-right: @border-width-base @border-style-base @table-border-color !important; - .ant-card { - max-width: fit-content; - margin-bottom: 0; - - background: none; - .ant-card-grid { - width: 300px; - padding: @padding-xs @padding-sm; - - background-color: @card-background; + .ant-table-tbody { + >tr { + &:last-child { + >td { + border-bottom: @border-width-base @border-style-base @table-border-color; + } + &:hover { + >td { + border-bottom-color: lighten(@primary-color, 30%); + } + } } } } @@ -237,4 +239,17 @@ } } } + .ant-card { + max-width: fit-content; + margin: @padding-sm @padding-xs @padding-sm @padding-xl; + + background: none; + .ant-card-grid { + width: 300px; + height: 90px; + padding: @padding-xs @padding-sm; + + background-color: @card-background; + } + } } diff --git a/web-react/src/index.js b/web-react/src/index.js index 3d85d46..2d346e4 100644 --- a/web-react/src/index.js +++ b/web-react/src/index.js @@ -14,10 +14,12 @@ const SETTING = JSON.parse(window.localStorage.getItem(SETTING_KEY)) || { theme: 'default' }; +let imp + if (SETTING.theme === 'dark') { - import('./assets/style/dark/index.less') + imp = import('./assets/style/dark/index.less') } else { - import('./assets/style/default/index.less') + imp = import('./assets/style/default/index.less') } moment.locale('zh-cn') @@ -27,24 +29,26 @@ moment.locale('zh-cn') const root = document.getElementById('root') root.style.opacity = 0 -ReactDOM.render( - ( -
- -

暂无数据

-
- ) - } - > - -
, - root -); +imp.then(() => { + ReactDOM.render( + ( +
+ +

暂无数据

+
+ ) + } + > + +
, + root + ); -// If you want to start measuring performance in your app, pass a function -// to log results (for example: reportWebVitals(console.log)) -// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals -reportWebVitals(); \ No newline at end of file + // If you want to start measuring performance in your app, pass a function + // to log results (for example: reportWebVitals(console.log)) + // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals + reportWebVitals(); +}) \ No newline at end of file diff --git a/web-react/src/pages/system/dict/dictdata/form.jsx b/web-react/src/pages/system/dict/dictdata/form.jsx index 50ce9d7..764cd99 100644 --- a/web-react/src/pages/system/dict/dictdata/form.jsx +++ b/web-react/src/pages/system/dict/dictdata/form.jsx @@ -3,6 +3,9 @@ import { Form, message as Message, Spin } from 'antd' import { AntIcon } from 'components' import { cloneDeep } from 'lodash' import MonacoEditor from 'react-monaco-editor' +import store from 'store' + +const { getState } = store const initialValues = {} @@ -10,6 +13,7 @@ export default class form extends Component { state = { // 加载状态 loading: true, + ...getState('layout'), } // 表单实例 @@ -83,6 +87,8 @@ export default class form extends Component { //#endregion render() { + const { theme } = this.state + return (
}> @@ -90,7 +96,7 @@ export default class form extends Component { Date: Fri, 2 Jul 2021 14:48:19 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix=20=E9=BB=98=E8=AE=A4=E5=80=BC=E8=A2=AB?= =?UTF-8?q?=E7=A9=BA=E8=8A=82=E7=82=B9=E8=A6=86=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web-react/src/pages/business/house/info/form/index.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web-react/src/pages/business/house/info/form/index.jsx b/web-react/src/pages/business/house/info/form/index.jsx index 5a2363d..1bf327c 100644 --- a/web-react/src/pages/business/house/info/form/index.jsx +++ b/web-react/src/pages/business/house/info/form/index.jsx @@ -1,6 +1,6 @@ import React, { Component } from 'react' import { Form, Button, Input, Descriptions, message as Message, Modal, Spin, Tabs } from 'antd' -import { merge, isEqual } from 'lodash' +import { merge, isEqual, pickBy } from 'lodash' import { AntIcon, ComponentDynamic, Container } from 'components' import { api } from 'common/api' @@ -90,6 +90,10 @@ export default class index extends Component { const { taskId } = this.props.param if (taskId) { api.houseInfoGetByTaskId({ taskId }).then(({ data }) => { + // 删除空节点 + for (const key in data) { + data[key] = pickBy(data[key], p => p !== null && p !== undefined) + } this.setState({ taskStatus: data.patrolInfo.status, record: data, @@ -168,7 +172,6 @@ export default class index extends Component { this.formData.patrolInfo.id = this.props.param.taskId } - console.log(this.formData) this.setState({ saving: true }) if (action) {