+
-
+
{
+ const v = value.replace(/<\/?.+?\/?>/g, '')
+ if (!v) {
+ throw Error('请输入内容')
+ }
+ },
+ },
+ ]}
>
diff --git a/web-react/src/pages/system/notice/index.jsx b/web-react/src/pages/system/notice/index.jsx
index 5a94045..0b37040 100644
--- a/web-react/src/pages/system/notice/index.jsx
+++ b/web-react/src/pages/system/notice/index.jsx
@@ -28,7 +28,7 @@ const apiAction = {
* 用于弹窗标题
* [必要]
*/
-const name = '啥玩意'
+const name = '通知公告'
/**
* 统一配置权限标识
@@ -253,6 +253,7 @@ export default class index extends Component {
this.table.current.onReloadData()}
@@ -264,6 +265,7 @@ export default class index extends Component {
this.table.current.onReloadData()}
diff --git a/web-react/src/views/main/_layout/header/index.jsx b/web-react/src/views/main/_layout/header/index.jsx
index e289d28..0cdf6c8 100644
--- a/web-react/src/views/main/_layout/header/index.jsx
+++ b/web-react/src/views/main/_layout/header/index.jsx
@@ -1,23 +1,19 @@
import React, { Component, useState } from 'react'
-import { Layout, Badge, Popover, Menu, Modal } from 'antd'
+import { Layout, Badge, Popover, Menu, Modal, Tooltip, Popconfirm } from 'antd'
import { AntIcon, Container } from 'components'
-import Logo from '../logo'
-import User from './user'
-import Search from './search'
import store from 'store'
import { api } from 'common/api'
+import Logo from '../logo'
+import Search from './search'
+import Notice from './notice'
+import User from './user'
+
const { getState, subscribe, dispatch } = store
export default class index extends Component {
state = {
...getState('layout'),
- notice: {
- count: 0,
- data: [],
- },
- modalVisible: false,
- currentNotice: {},
}
constructor(props) {
@@ -28,10 +24,6 @@ export default class index extends Component {
})
}
- componentDidMount() {
- this.loadNotice()
- }
-
componentWillUnmount() {
this.unsubscribe()
}
@@ -43,27 +35,8 @@ export default class index extends Component {
})
}
- async loadNotice() {
- const { data } = await api.sysNoticeGetCount()
- const items = await api.sysNoticeInfo()
- this.setState({
- notice: {
- count: data,
- data: items.data,
- },
- })
- }
- async showDetail(params, visible) {
- this.setState({ currentNotice: params })
-
- if (visible) {
- this.setState({ modalVisible: visible })
- } else {
- this.setState({ modalVisible: visible })
- }
- }
render() {
- const { allowSiderCollapsed, notice, currentNotice } = this.state
+ const { allowSiderCollapsed, theme } = this.state
return (
@@ -80,57 +53,38 @@ export default class index extends Component {
-
window.realodContentWindow()}
- >
-
-
-
-
- {notice.data.map(item => (
- this.showDetail(item, true)}
- key={item.id}
- >
- {item.title}
-
- ))}
-
- }
- >
-
-
-
-
-
-
- this.showDetail(false)}
- onCancel={() => this.showDetail(false)}
- style={{ zIndex: 1000 }}
+
+ window.realodContentWindow()}
>
-
-
- 发布人:{currentNotice.createdUserName}
- {' '}
- 发布时间:{currentNotice.createdTime}
-
-
-
+
+
+
+
+
+ {
+ dispatch({
+ type: 'SET_THEME',
+ theme: { default: 'dark', dark: 'default' }[theme],
+ })
+ window.location.reload()
+ }}
+ >
+
+
+
+
+
diff --git a/web-react/src/views/main/_layout/header/notice.jsx b/web-react/src/views/main/_layout/header/notice.jsx
new file mode 100644
index 0000000..dd89eab
--- /dev/null
+++ b/web-react/src/views/main/_layout/header/notice.jsx
@@ -0,0 +1,145 @@
+import React, { Component } from 'react'
+import { Badge, 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'
+import moment from 'moment'
+
+export default class notice extends Component {
+ state = {
+ count: 0,
+ list: [],
+
+ loading: false,
+ hasMore: true,
+
+ detailVisible: false,
+ detailLoading: false,
+ detailData: {},
+ }
+
+ async componentDidMount() {
+ const { data: count } = await api.sysNoticeUnread()
+ this.setState({ count })
+ }
+
+ finish() {
+ this.setState({ loading: false, hasMore: false })
+ }
+
+ async onInfiniteOnLoad(pageIndex) {
+ this.setState({ loading: true })
+ const { list } = this.state
+ if (list.length >= 30) {
+ return this.finish()
+ }
+
+ const {
+ data: { items },
+ } = await api.sysNoticeReceived({
+ pageIndex,
+ pageSize: 5,
+ sortField: 'createdTime',
+ sortOrder: 'descend',
+ })
+
+ if (!items.length) {
+ return this.finish()
+ }
+
+ this.setState({
+ list: [...list, ...items],
+ loading: false,
+ })
+ }
+
+ async onOpenDetail(id) {
+ this.setState({ detailLoading: true, detailVisible: true })
+ const { data } = await api.sysNoticeDetail({ id })
+ this.setState({
+ detailLoading: false,
+ detailData: data,
+ })
+ }
+
+ renderList() {
+ const { list, loading, hasMore } = this.state
+ return (
+
this.onInfiniteOnLoad(pageIndex)}
+ hasMore={!loading && hasMore}
+ useWindow={false}
+ threshold={100}
+ >
+ (
+
+ }
+ title={
+ this.onOpenDetail(item.id)}
+ >
+ {item.title}
+
+ }
+ description={moment(item.createdTime || item.publicTime).fromNow()}
+ />
+ {item.content}
+
+ )}
+ >
+ {loading && hasMore && (
+
+ } />
+
+ )}
+
+
+ )
+ }
+
+ render() {
+ const { count, detailLoading, detailVisible, detailData } = this.state
+
+ return (
+
+
+
+
+
+
+
+ this.setState({ detailVisible: false, detailData: {} })}
+ >
+ }>
+ {detailData.title}
+
+
+
+
+ 发布人:{detailData.publicUserName}
+ 发布时间:{detailData.publicTime}
+
+
+
+
+ )
+ }
+}
diff --git a/web-react/yarn.lock b/web-react/yarn.lock
index 963891e..a636c28 100644
--- a/web-react/yarn.lock
+++ b/web-react/yarn.lock
@@ -9285,7 +9285,7 @@ prompts@^2.0.1:
kleur "^3.0.3"
sisteransi "^1.0.5"
-prop-types@^15.5.10, prop-types@^15.6.2, prop-types@^15.7.2:
+prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.6.2, prop-types@^15.7.2:
version "15.7.2"
resolved "https://registry.npm.taobao.org/prop-types/download/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
integrity sha1-UsQedbjIfnK52TYOAga5ncv/psU=
@@ -9877,6 +9877,13 @@ react-error-overlay@^6.0.9:
resolved "https://registry.nlark.com/react-error-overlay/download/react-error-overlay-6.0.9.tgz?cache=0&sync_timestamp=1618847933355&other_urls=https%3A%2F%2Fregistry.nlark.com%2Freact-error-overlay%2Fdownload%2Freact-error-overlay-6.0.9.tgz#3c743010c9359608c375ecd6bc76f35d93995b0a"
integrity sha1-PHQwEMk1lgjDdezWvHbzXZOZWwo=
+react-infinite-scroller@^1.2.4:
+ version "1.2.4"
+ resolved "https://registry.npm.taobao.org/react-infinite-scroller/download/react-infinite-scroller-1.2.4.tgz#f67eaec4940a4ce6417bebdd6e3433bfc38826e9"
+ integrity sha1-9n6uxJQKTOZBe+vdbjQzv8OIJuk=
+ dependencies:
+ prop-types "^15.5.8"
+
react-is@^16.12.0, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1:
version "16.13.1"
resolved "https://registry.nlark.com/react-is/download/react-is-16.13.1.tgz?cache=0&sync_timestamp=1623273254569&other_urls=https%3A%2F%2Fregistry.nlark.com%2Freact-is%2Fdownload%2Freact-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
From 3725f586d2a16187ce2e0b0bc3edfb6e769375c3 Mon Sep 17 00:00:00 2001
From: ky_yusj <2655568377@qq.com>
Date: Fri, 2 Jul 2021 09:50:24 +0800
Subject: [PATCH 04/15] =?UTF-8?q?update=20=20=20=E7=94=A8=E6=88=B7?=
=?UTF-8?q?=E7=AE=A1=E7=90=86=E6=96=B0=E5=A2=9E=E6=94=B9=E4=B8=BA=E4=BD=BF?=
=?UTF-8?q?=E7=94=A8=E9=BB=98=E8=AE=A4=E5=AF=86=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Api/Ewide.Core/Ewide.Core.xml | 10 ----------
Api/Ewide.Core/Service/User/Dto/UserInput.cs | 16 ++++++----------
Api/Ewide.Core/Service/User/SysUserService.cs | 2 +-
.../src/pages/business/house/member/form.jsx | 4 ++--
web-react/src/pages/system/user/form.jsx | 4 ++--
5 files changed, 11 insertions(+), 25 deletions(-)
diff --git a/Api/Ewide.Core/Ewide.Core.xml b/Api/Ewide.Core/Ewide.Core.xml
index 113caf5..5d038ce 100644
--- a/Api/Ewide.Core/Ewide.Core.xml
+++ b/Api/Ewide.Core/Ewide.Core.xml
@@ -6804,16 +6804,6 @@
账号
-
-
- 密码
-
-
-
-
- 确认密码
-
-
用户Id
diff --git a/Api/Ewide.Core/Service/User/Dto/UserInput.cs b/Api/Ewide.Core/Service/User/Dto/UserInput.cs
index 28068f9..a096e4c 100644
--- a/Api/Ewide.Core/Service/User/Dto/UserInput.cs
+++ b/Api/Ewide.Core/Service/User/Dto/UserInput.cs
@@ -84,17 +84,13 @@ namespace Ewide.Core.Service
[Required(ErrorMessage = "账号名称不能为空")]
public override string Account { get; set; }
- ///
- /// 密码
- ///
- [Required(ErrorMessage = "密码不能为空")]
- public override string Password { get; set; }
+
+ //[Required(ErrorMessage = "密码不能为空")]
+ //public override string Password { get; set; }
- ///
- /// 确认密码
- ///
- [Required(ErrorMessage = "确认密码不能为空"), Compare(nameof(Password), ErrorMessage = "两次密码不一致")]
- public string Confirm { get; set; }
+
+ //[Required(ErrorMessage = "确认密码不能为空"), Compare(nameof(Password), ErrorMessage = "两次密码不一致")]
+ //public string Confirm { get; set; }
}
public class DeleteUserInput : UserInput
diff --git a/Api/Ewide.Core/Service/User/SysUserService.cs b/Api/Ewide.Core/Service/User/SysUserService.cs
index e32a508..2a36cb5 100644
--- a/Api/Ewide.Core/Service/User/SysUserService.cs
+++ b/Api/Ewide.Core/Service/User/SysUserService.cs
@@ -113,7 +113,7 @@ namespace Ewide.Core.Service
var isExist = await _sysUserRep.AnyAsync(u => u.Account == input.Account, false);
if (isExist) throw Oops.Oh(ErrorCode.D1003);
-
+ input.Password = CommonConst.DEFAULT_PASSWORD;
var user = input.Adapt();
user.Password = MD5Encryption.Encrypt(input.Password);
if (string.IsNullOrEmpty(user.Name))
diff --git a/web-react/src/pages/business/house/member/form.jsx b/web-react/src/pages/business/house/member/form.jsx
index 3a8145b..db24377 100644
--- a/web-react/src/pages/business/house/member/form.jsx
+++ b/web-react/src/pages/business/house/member/form.jsx
@@ -204,7 +204,7 @@ export default class form extends Component {
>
- {this.props.mode == 'add' && (
+ {/* {this.props.mode == 'add' && (
<>
>
- )}
+ )} */}
diff --git a/web-react/src/pages/system/user/form.jsx b/web-react/src/pages/system/user/form.jsx
index 204c88a..8504d3a 100644
--- a/web-react/src/pages/system/user/form.jsx
+++ b/web-react/src/pages/system/user/form.jsx
@@ -298,7 +298,7 @@ export default class form extends Component {
>
- {this.props.mode == 'add' && (
+ {/* {this.props.mode == 'add' && (
<>
>
- )}
+ )} */}
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 05/15] =?UTF-8?q?fix=20=E6=89=93=E5=8C=85=E5=90=8E?=
=?UTF-8?q?=E6=97=A0=E6=B3=95=E5=88=87=E6=8D=A2=E6=A0=B7=E5=BC=8F=E6=A8=A1?=
=?UTF-8?q?=E5=BC=8F=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 06/15] =?UTF-8?q?fix=20=E6=97=A0=E9=99=90=E6=BB=9A?=
=?UTF-8?q?=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 {
)}