update 夜间模式

This commit is contained in:
2021-07-01 19:08:15 +08:00
parent 95cb5b4483
commit 4436230c71
95 changed files with 3286 additions and 721 deletions

View File

@@ -4,7 +4,6 @@ import { isEqual } from 'lodash'
import store from 'store'
import { Container, Image, AntIcon } from 'components'
import moment from 'moment'
import './index.less'
import Statistics from './statistics'
import Task from './task'
@@ -17,9 +16,8 @@ const { getState, subscribe } = store
const storePath = 'user'
export default class index extends Component {
state = {
[storePath]: getState(storePath)
[storePath]: getState(storePath),
}
constructor(props) {
@@ -47,22 +45,37 @@ export default class index extends Component {
<Col>
<div className="home-header-row">
<div className="home-header-avatar">
<Image id={this.state.user.avatar} size={64} icon={<AntIcon type="UserOutlined" />} type="avatar" />
<Image
id={this.state.user.avatar}
size={64}
icon={<AntIcon type="UserOutlined" />}
type="avatar"
/>
</div>
<div className="home-header-content">
<h4>
{moment().format('A')}<span>{this.state.user.nickName || this.state.user.name}</span>欢迎您登录系统
</h4>
{moment().format('A')}
<span>
{this.state.user.nickName || this.state.user.name}
</span>
欢迎您登录系统
</h4>
<div>
<span>上次IP{this.state.user.lastLoginIp}</span>
<Divider type="vertical" />
<span>上次登录时间{this.state.user.lastLoginTime}</span>
<span>
上次登录时间{this.state.user.lastLoginTime}
</span>
</div>
</div>
</div>
</Col>
<Col>
<AntIcon type="MailOutlined" style={{ fontSize: '20px', color: '#f80000' }} className="mr-xs" />
<AntIcon
type="MailOutlined"
style={{ fontSize: '20px', color: '#f80000' }}
className="mr-xs"
/>
您有<a href="/">0</a>封未读邮件请尽快查收
</Col>
</Row>

View File

@@ -1,42 +0,0 @@
@import (reference) 'assets/style/app.less';
.home-header {
margin-bottom: @padding-md;
padding: @padding-lg 0;
background-color: @white;
}
.home-header-row {
display: flex;
}
.home-header-content {
margin-left: @padding-lg;
h4 {
span {
color: @primary-color;
}
}
p {
margin: 0;
}
}
.home-container {
.ant-card-meta-title {
font-size: @font-size-base + 1px;
display: -webkit-box;
-webkit-box-orient: vertical;
height: 42px;
white-space: normal;
-webkit-line-clamp: 2;
}
.ant-card-meta-description {
.ant-row {
line-height: 24px;
height: 24px;
}
}
}

View File

@@ -43,14 +43,14 @@ export default class statistics extends Component {
>
<span>
当月活跃用户
<AntIcon type="down" />
<AntIcon type="down" />
</span>
</Dropdown>
}
prefix={
<AntIcon style={{ fontSize: '13px' }} type="arrow-up" />
}>
</Statistic>
}
></Statistic>
</Col>
</Row>
</Card>

View File

@@ -5,7 +5,6 @@ import { Cropper } from 'react-cropper'
import 'cropperjs/dist/cropper.css'
import { BlobToFile } from 'util/file'
import './base.less'
import { api } from 'common/api'
export default class base extends Component {

View File

@@ -1,51 +0,0 @@
@import (reference) '~assets/style/app.less';
.yo-avatar-info {
position: relative;
overflow: hidden;
width: 128px;
margin: 0 auto;
border-radius: 50%;
&--cover {
font-size: @font-size-lg * 2;
position: absolute;
top: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
cursor: pointer;
transition: @animation-duration-slow;
opacity: 0;
color: @white;
background-color: fade(@black, 50%);
&:hover {
opacity: 1;
}
}
}
.yo-avatar-cropper {
overflow: hidden;
border-radius: @border-radius-base;
background-color: #ccc;
}
.yo-avatar-preview {
overflow: hidden;
width: 200px;
height: 200px;
margin: 0 auto;
border-radius: 50%;
background: #ccc;
}

View File

@@ -7,7 +7,6 @@ import MonacoEditor from 'react-monaco-editor'
const initialValues = {}
export default class form extends Component {
state = {
// 加载状态
loading: true,
@@ -32,7 +31,7 @@ export default class form extends Component {
* 填充数据
* 可以在设置this.record之后对其作出数据结构调整
* [异步,必要]
* @param {*} params
* @param {*} params
*/
async fillData(params) {
this.record = cloneDeep(params.record)
@@ -45,7 +44,7 @@ export default class form extends Component {
this.form.current.setFieldsValue(this.record)
this.setState({
loading: false
loading: false,
})
}
@@ -53,7 +52,7 @@ export default class form extends Component {
* 获取数据
* 可以对postData进行数据结构调整
* [异步,必要]
* @returns
* @returns
*/
async getData() {
const form = this.form.current
@@ -66,11 +65,11 @@ export default class form extends Component {
}
//#region 从前段转换后端所需格式
try {
const code = JSON.parse(this.code.current.editor.getValue());
const code = JSON.parse(this.code.current.editor.getValue())
if (code.constructor === Object) {
postData.extCode = JSON.stringify(code);
postData.extCode = JSON.stringify(code)
} else {
throw new Error(0);
throw new Error(0)
}
} catch {
Message.error('错误的JSON格式')
@@ -85,18 +84,15 @@ export default class form extends Component {
render() {
return (
<Form
initialValues={initialValues}
ref={this.form}
className="yo-form"
>
<Form initialValues={initialValues} ref={this.form} className="yo-form">
<Spin spinning={this.state.loading} indicator={<AntIcon type="loading" />}>
<div className="yo-form-group">
<MonacoEditor
height={300}
language="json"
theme="vs-dark"
options={{
fontSize: 12
fontSize: 12,
}}
ref={this.code}
/>