Commit de5685b7 authored by superman's avatar superman

1.3.3

parent de51b747
This diff is collapsed.
This diff is collapsed.
......@@ -76,13 +76,13 @@
}
}
.ant-menu-inline .ant-menu-item,
.ant-menu-vertical .ant-menu-item{
.ant-menu-vertical .ant-menu-item {
border-right: 0;
margin-left: 0;
left: 0;
}
.ant-menu-inline .ant-menu-item-selected,
.ant-menu-inline .ant-menu-selected{
.ant-menu-inline .ant-menu-selected {
border-right: 0;
}
}
......@@ -124,6 +124,14 @@
.main-form {
padding-top: 24px;
}
.authorities-checkbox-group {
.ant-checkbox-group-item {
display: block;
}
.ant-checkbox-wrapper + .ant-checkbox-wrapper {
margin-left: 0;
}
}
}
}
......@@ -28,6 +28,7 @@ import {formItemLayout, footerFormSubmitLayout} from '../../utils';
@connect(state=>({
loading: state.customMessage.loading,
item: state.customMessage.item
}))
@Form.create()
export default class AddItem extends Component {
......@@ -40,6 +41,12 @@ export default class AddItem extends Component {
}
}
componentWillReceiveProps(nextProps) {
if (nextProps && nextProps.item && nextProps.item.id) {
this.props.history.replace('/customMessages/' + nextProps.item.id);
}
}
handleSubmit(e) {
e.preventDefault();
const data = this.props.form.getFieldsValue();
......
......@@ -87,7 +87,7 @@ export default class Item extends Component {
<Row type="flex" justify="space-around" align="middle">
<Col span={tw}>推送时间</Col>
<Col
span={vw}>{item.dateCreated && item.dateCreated.replace(/[年月]/g, '-').replace(/日/g, '')}</Col>
span={vw}>{item.dateCreated && (item.dateCreated+'').replace(/[年月]/g, '-').replace(/日/g, '')}</Col>
</Row>
<Row type="flex" justify="space-around" align="middle">
<Col span={tw}>推送人数</Col>
......
......@@ -12,21 +12,23 @@ const Home = ({location}) => {
<p>
1. 菜单栏增加"设置"; "管理员"菜单只分配给管理员角色。<br/>
2. 修复Window下, 报单审核照片下载文件扩展名缺失。<br/>
3. 创建角色时, 角色ID强制"ROLE_"开头<br/>
4. ROLE_ADMIN, ROLE_USER, ROLE_DEFAULT 三个角色不允许删除<br/>
3. 创建角色时, 角色ID强制"ROLE_"开头。<br/>
4. ROLE_ADMIN, ROLE_USER, ROLE_DEFAULT 三个角色不允许删除。<br/>
5. BUG修复: 推送自定义消息成功后进入消息详情页面。<br/>
6. 更严谨的权限控制。
</p>
<h3>2016-08-17 更新 1.3.2</h3>
<p>
1. 报单审核列表页 下载审核成功的照片
1. 报单审核列表页 下载审核成功的照片
</p>
<h3>2016-08-15 更新 1.3.1</h3>
<p>
1. 增加身份认证审核
1. 增加身份认证审核
</p>
<h3>2016-08-12 更新 1.3.0</h3>
<p>
1. 权限系统<br/>
2. 用户退出, 用户密码修改
1. 权限系统<br/>
2. 用户退出, 用户密码修改
</p>
</div>
......
......@@ -15,6 +15,10 @@ export default class Login extends Component {
};
componentWillMount() {
sessionStorage.clear();
}
handleSubmit = (e)=> {
e.preventDefault();
const data = this.props.form.getFieldsValue();
......
......@@ -26,6 +26,7 @@
& > div {
display: flex;
justify-content: center;
margin-top: -150px;
h1 {
text-align: center;
margin-bottom: 50px;
......@@ -64,8 +65,6 @@
}
}
:global(.fade-enter) {
opacity: 0;
animation-duration: 2s;
......
......@@ -51,11 +51,10 @@ export default class EditItem extends Component {
}
componentDidMount() {
console.log(this.props.isAdmin);
this.fetchItem(this.props.params.id);
if (this.props.isAdmin) {
// if (this.props.isAdmin) {
this.fetchAuthorityList();
}
// }
};
componentWillReceiveProps(nextProps) {
......@@ -106,9 +105,11 @@ export default class EditItem extends Component {
}
render() {
const {isAdmin, item, loading, form:{getFieldProps}, location:{query}, isEdit, authorities, dispatch, history} = this.props;
const {isAdmin, item, loading, form:{getFieldProps}, location:{query}, isEdit, dispatch, history} = this.props;
let {authorities} = this.props;
const breadcrumb = isAdmin ? ['用户管理', '用户详情'] : ['我的','个人信息'];
const breadcrumb = isAdmin ? ['用户管理', '用户详情'] : ['我的', '个人信息'];
const title = isAdmin ? '用户详情' : '个人信息';
......@@ -124,9 +125,10 @@ export default class EditItem extends Component {
const userAuthorities = [];
if (item && authorities) {
authorities.forEach(authority=> {
authority.label = authority.description + '(' + authority.name + ')';
authority.label = authority.description + '(' + authority.name + ')' + (authority.status === 5 ? '[已禁用]' : '');
authority.value = authority.name;
authoritiesMap[authority.name] = authority.label;
authority.disabled = authority.status !== 9;
authoritiesMap[authority.name] = authority;
});
if (item.authorities) {
const uas = item.authorities.split(',');
......@@ -140,18 +142,17 @@ export default class EditItem extends Component {
<Layout header={header}>
<Spin spinning={loading}>
{
item &&
item && authorities &&
<Form className="main-form" horizontal>
<Form.Item label="用户名" {...smallFormItemLayout}>
{ item.username }
</Form.Item>
{
isAdmin ?
<div>
<Form.Item label="状态" {...smallFormItemLayout}>
{
isEdit ?
isAdmin && isEdit ?
<Select
placeholder="请选择状态" {...getFieldProps('status', {initialValue: userStatusToString(item.status)})} >
<Select.Option value="0">未激活</Select.Option>
......@@ -162,7 +163,8 @@ export default class EditItem extends Component {
}
</Form.Item>
<Form.Item label="角色" {...smallFormItemLayout}>
{ isEdit ?
{ isAdmin && isEdit ?
<div className="authorities-checkbox-group">
<Checkbox.Group options={authorities}
value={this.state.authoritiesCheckedValues}
onChange={(checkedValues)=> {
......@@ -170,16 +172,26 @@ export default class EditItem extends Component {
authoritiesCheckedValues: checkedValues
})
}}/>
<p style={{opacity: .5}}>注意: 只能分配角色列表中已经启用的角色!</p>
</div>
:
(userAuthorities.length ? userAuthorities.join(',') : NULL)
(
userAuthorities.length ?
userAuthorities.map((userAuthorty)=>(
userAuthorty &&
<div style={userAuthorty.status === 5 ? {opacity: .7} : {}}
key={userAuthorty.name}>{userAuthorty.label}</div>
))
:
NULL
)
}
</Form.Item>
</div>
:
<div>
<Form.Item label="昵称" {...smallFormItemLayout}>
{
isEdit ?
!isAdmin && isEdit ?
<Input {...getFieldProps('nick', {initialValue: item.nick})} />
:
item.nick || NULL
......@@ -187,7 +199,7 @@ export default class EditItem extends Component {
</Form.Item>
<Form.Item label="E-mail" {...smallFormItemLayout}>
{
isEdit ?
!isAdmin && isEdit ?
<Input {...getFieldProps('email', {initialValue: item.email})} />
:
item.email || NULL
......@@ -195,14 +207,13 @@ export default class EditItem extends Component {
</Form.Item>
<Form.Item label="手机号" {...smallFormItemLayout}>
{
isEdit ?
!isAdmin && isEdit ?
<Input {...getFieldProps('mobile', {initialValue: item.mobile})} />
:
item.mobile || NULL
}
</Form.Item>
</div>
}
<Form.Item label="注册时间" {...smallFormItemLayout}>
{item.dateCreated && formatDateTime(item.dateCreated)}
</Form.Item>
......
......@@ -34,6 +34,10 @@ function errorMessageParse(res) {
function xFetch(url, options) {
const opts = {...options};
opts.headers = {
...opts.headers,
};
if (url !== '/api/authenticate') {
let user;
try {
user = JSON.parse(sessionStorage.getItem('user')) || {};
......@@ -41,10 +45,8 @@ function xFetch(url, options) {
} catch (ex) {
user = {};
}
opts.headers = {
...opts.headers,
authorization: user.token || '',
};
opts.headers.authorization = user.token || '';
}
if (opts.method != 'GET') {
opts.headers['content-type'] = 'application/x-www-form-urlencoded';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment