From 50cbbe65248cdf0937b122830468582b452f4c93 Mon Sep 17 00:00:00 2001 From: smallchill Date: Fri, 24 Apr 2020 18:02:54 +0800 Subject: [PATCH] =?UTF-8?q?:tada:=202.7.0.RELEASE,=E5=86=85=E6=A0=B8?= =?UTF-8?q?=E5=85=A8=E9=9D=A2=E5=8D=87=E7=BA=A7,=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=B2=97=E4=BD=8D=E7=AE=A1=E7=90=86,=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE | 2 +- README.md | 7 +- config/router.config.js | 11 ++ mock/user.js | 4 +- package.json | 2 +- src/actions/post.js | 43 ++++++++ src/components/Sword/ToolBar.js | 4 +- src/defaultSettings.js | 1 + src/layouts/Footer.js | 2 +- src/layouts/UserLayout.js | 2 +- src/locales/en-US/menu.js | 1 + src/locales/zh-CN/menu.js | 1 + src/locales/zh-TW/menu.js | 1 + src/models/login.js | 2 + src/models/post.js | 108 +++++++++++++++++++ src/models/user.js | 16 ++- src/pages/Dashboard/Workplace.js | 22 +++- src/pages/Login/Login.js | 4 +- src/pages/System/Post/Post.js | 102 ++++++++++++++++++ src/pages/System/Post/PostAdd.js | 152 ++++++++++++++++++++++++++ src/pages/System/Post/PostEdit.js | 174 ++++++++++++++++++++++++++++++ src/pages/System/Post/PostView.js | 85 +++++++++++++++ src/pages/System/User/User.js | 143 +++++++++++++++++++++++- src/pages/System/User/UserAdd.js | 40 ++++++- src/pages/System/User/UserEdit.js | 53 ++++++++- src/pages/System/User/UserView.js | 12 +++ src/services/post.js | 29 +++++ src/services/user.js | 3 +- src/utils/authority.js | 8 ++ 29 files changed, 1004 insertions(+), 30 deletions(-) create mode 100644 src/actions/post.js create mode 100644 src/models/post.js create mode 100644 src/pages/System/Post/Post.js create mode 100644 src/pages/System/Post/PostAdd.js create mode 100644 src/pages/System/Post/PostEdit.js create mode 100644 src/pages/System/Post/PostView.js create mode 100644 src/services/post.js diff --git a/LICENSE b/LICENSE index 6d7205f..0d5a696 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 bladex.vip +Copyright (c) 2020 BladeX (https://bladex.vip) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 85650bd..5490155 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@

- Downloads + Downloads Build Status Build Status - Coverage Status - Downloads + Coverage Status + Downloads Downloads @@ -64,6 +64,7 @@ SpringBlade * Saber-基于Vue:[https://saber.bladex.vip](https://saber.bladex.vip) * Sword-基于React:[https://sword.bladex.vip](https://sword.bladex.vip) * Archer-全能代码生成系统:[https://archer.bladex.vip](https://archer.bladex.vip) +* Caster-数据大屏展示系统:[https://data.avuejs.com](https://data.avuejs.com) ## 技术文档 * [开发手册一览](https://gitee.com/smallc/SpringBlade/wikis/SpringBlade开发手册) diff --git a/config/router.config.js b/config/router.config.js index e62c8e2..e903132 100644 --- a/config/router.config.js +++ b/config/router.config.js @@ -125,6 +125,17 @@ export default [ { path: '/system/dept/view/:id', component: './System/Dept/DeptView' }, ], }, + { + path: '/system/post', + routes: [ + { path: '/system/post', redirect: '/system/post/list' }, + { path: '/system/post/list', component: './System/Post/Post' }, + { path: '/system/post/add', component: './System/Post/PostAdd' }, + { path: '/system/post/add/:id', component: './System/Post/PostAdd' }, + { path: '/system/post/edit/:id', component: './System/Post/PostEdit' }, + { path: '/system/post/view/:id', component: './System/Post/PostView' }, + ], + }, { path: '/system/role', routes: [ diff --git a/mock/user.js b/mock/user.js index 71ddc89..f56baa2 100644 --- a/mock/user.js +++ b/mock/user.js @@ -46,6 +46,7 @@ function getFakeDetail(req, res) { id: '1', tenantId: '000000', account: 'admin', + code: 'admin', name: '超级管理员', realName: '管理员', phone: '13888888888', @@ -54,6 +55,8 @@ function getFakeDetail(req, res) { roleName: '超级管理员', deptId: 1, deptName: '刀锋科技', + postId: 1, + postName: '首席执行官', sex: 1, sexName: '男', birthday: '2018-12-31 23:33:33', @@ -61,7 +64,6 @@ function getFakeDetail(req, res) { }; return res.json(json); } - function fakeSuccess(req, res) { const json = { code: 200, success: true, msg: '操作成功' }; return res.json(json); diff --git a/package.json b/package.json index d466035..2553693 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sword", - "version": "2.6.2", + "version": "2.7.0", "description": "An out-of-box UI solution for enterprise applications", "private": true, "scripts": { diff --git a/src/actions/post.js b/src/actions/post.js new file mode 100644 index 0000000..88ecc67 --- /dev/null +++ b/src/actions/post.js @@ -0,0 +1,43 @@ +export const POST_NAMESPACE = 'post'; + +export function POST_INIT() { + return { + type: `${POST_NAMESPACE}/fetchInit`, + payload: { code: 'post_category' }, + }; +} + +export function POST_LIST(payload) { + return { + type: `${POST_NAMESPACE}/fetchList`, + payload, + }; +} + +export function POST_DETAIL(id) { + return { + type: `${POST_NAMESPACE}/fetchDetail`, + payload: { id }, + }; +} + +export function POST_CLEAR_DETAIL() { + return { + type: `${POST_NAMESPACE}/clearDetail`, + payload: {}, + }; +} + +export function POST_SUBMIT(payload) { + return { + type: `${POST_NAMESPACE}/submit`, + payload, + }; +} + +export function POST_REMOVE(payload) { + return { + type: `${POST_NAMESPACE}/remove`, + payload, + }; +} diff --git a/src/components/Sword/ToolBar.js b/src/components/Sword/ToolBar.js index 67cdacc..7c44d01 100644 --- a/src/components/Sword/ToolBar.js +++ b/src/components/Sword/ToolBar.js @@ -30,9 +30,7 @@ export default class ToolBar extends PureComponent { ))} {renderLeftButton ? renderLeftButton() : null} - {renderRightButton ? ( -

{renderRightButton()}
- ) : null} + {renderRightButton ?
{renderRightButton()}
: null} ); diff --git a/src/defaultSettings.js b/src/defaultSettings.js index 4d39b6e..81398ba 100644 --- a/src/defaultSettings.js +++ b/src/defaultSettings.js @@ -3,6 +3,7 @@ module.exports = { clientId: 'sword', // 客户端id clientSecret: 'sword_secret', // 客户端密钥 tenantMode: true, // 开启租户模式 + captchaMode: true, // 开启验证码模式 navTheme: 'dark', // theme for nav menu primaryColor: '#1890FF', // primary color of ant design layout: 'sidemenu', // nav menu position: sidemenu or topmenu diff --git a/src/layouts/Footer.js b/src/layouts/Footer.js index 41548e5..b0d49c4 100644 --- a/src/layouts/Footer.js +++ b/src/layouts/Footer.js @@ -8,7 +8,7 @@ const FooterView = () => ( - Copyright 2019 SpringBlade{' '} + Copyright 2020 SpringBlade{' '} - Copyright 2019 SpringBlade{' '} + Copyright 2020 SpringBlade{' '}
- Downloads + Downloads Build Status Coverage Status Downloads @@ -147,7 +147,7 @@ class Workplace extends PureComponent {
2.接3个月以内工期的react、vue、springboot、springcloud、app、小程序等软件定制服务
-
3.有意向请联系唯一指定QQ:85088620
+
3.有意向请联系唯一指定QQ:1272154962
@@ -206,7 +206,19 @@ class Workplace extends PureComponent { - + + +
1.升级至 SpringCloud Hoxton.SR3
+
2.升级至 SpringBoot 2.2.6.RELEASE
+
3.升级至 Avue 2.5.0
+
4.升级Saber内核,采用最新版本API,优化交互体验
+
5.新增岗位管理模块
+
6.新增用户导入导出模块
+
7.数据库主键统一改成bigint并采用snowflake算法
+
8.优化INode类,主键跟随修改为Long类型
+
9.优化鉴权逻辑,支持header以及parameter两种方式
+
10.优化代码生成模板以支持最新版API
+
1.升级SpringBoot 2.2.5.RELEASE
2.升级SpringCloud Hoxton.SR2
diff --git a/src/pages/Login/Login.js b/src/pages/Login/Login.js index 4715e4b..fef01a0 100644 --- a/src/pages/Login/Login.js +++ b/src/pages/Login/Login.js @@ -4,7 +4,7 @@ import { formatMessage, FormattedMessage } from 'umi/locale'; import { Checkbox, Alert } from 'antd'; import Login from '../../components/Login'; import styles from './Login.less'; -import { tenantMode } from '../../defaultSettings'; +import { tenantMode, captchaMode } from '../../defaultSettings'; const { Tab, TenantId, UserName, Password, Captcha, Submit } = Login; @@ -117,7 +117,7 @@ class LoginPage extends Component { ]} onPressEnter={() => this.loginForm.validateFields(this.handleSubmit)} /> - + {captchaMode ? : null}
diff --git a/src/pages/System/Post/Post.js b/src/pages/System/Post/Post.js new file mode 100644 index 0000000..d1569ab --- /dev/null +++ b/src/pages/System/Post/Post.js @@ -0,0 +1,102 @@ +import React, { PureComponent } from 'react'; +import { connect } from 'dva'; +import { Button, Col, Form, Input, Row, Tag } from 'antd'; +import Panel from '../../../components/Panel'; +import { POST_LIST } from '../../../actions/post'; +import Grid from '../../../components/Sword/Grid'; + +const FormItem = Form.Item; + +@connect(({ post, loading }) => ({ + post, + loading: loading.models.post, +})) +@Form.create() +class Post extends PureComponent { + // ============ 查询 =============== + handleSearch = params => { + const { dispatch } = this.props; + dispatch(POST_LIST(params)); + }; + + // ============ 查询表单 =============== + renderSearchForm = onReset => { + const { form } = this.props; + const { getFieldDecorator } = form; + + return ( + + + + {getFieldDecorator('name')()} + + + +
+ + +
+ +
+ ); + }; + + render() { + const code = 'post'; + + const { + form, + loading, + post: { data }, + } = this.props; + + const columns = [ + { + title: '租户ID', + dataIndex: 'tenantId', + }, + { + title: '岗位类型', + dataIndex: 'categoryName', + render: categoryName => ( + + + {categoryName} + + + ), + }, + { + title: '岗位编号', + dataIndex: 'postCode', + }, + { + title: '岗位名称', + dataIndex: 'postName', + }, + { + title: '岗位排序', + dataIndex: 'sort', + }, + ]; + + return ( + + + + ); + } +} +export default Post; diff --git a/src/pages/System/Post/PostAdd.js b/src/pages/System/Post/PostAdd.js new file mode 100644 index 0000000..ef1cf77 --- /dev/null +++ b/src/pages/System/Post/PostAdd.js @@ -0,0 +1,152 @@ +import React, { PureComponent } from 'react'; +import { Form, Input, Card, Button, InputNumber, Col, Row, Select } from 'antd'; +import { connect } from 'dva'; +import Panel from '../../../components/Panel'; +import styles from '../../../layouts/Sword.less'; +import { POST_INIT, POST_SUBMIT } from '../../../actions/post'; + +const FormItem = Form.Item; +const { TextArea } = Input; + +@connect(({ post, loading }) => ({ + post, + submitting: loading.effects['post/submit'], +})) +@Form.create() +class PostAdd extends PureComponent { + componentWillMount() { + const { dispatch } = this.props; + dispatch(POST_INIT()); + } + + handleSubmit = e => { + e.preventDefault(); + const { dispatch, form } = this.props; + form.validateFieldsAndScroll((err, values) => { + if (!err) { + dispatch(POST_SUBMIT(values)); + } + }); + }; + + render() { + const { + form: { getFieldDecorator }, + post: { init }, + submitting, + } = this.props; + + const { category } = init; + + const formItemLayout = { + labelCol: { + span: 8, + }, + wrapperCol: { + span: 16, + }, + }; + + const formAllItemLayout = { + labelCol: { + span: 4, + }, + wrapperCol: { + span: 20, + }, + }; + + const action = ( + + ); + + return ( + +
+ + + + + {getFieldDecorator('category', { + rules: [ + { + required: true, + message: '请选择岗位类型', + }, + ], + })( + + )} + + + + + {getFieldDecorator('postCode', { + rules: [ + { + required: true, + message: '请输入岗位编号', + }, + ], + })()} + + + + + + + {getFieldDecorator('postName', { + rules: [ + { + required: true, + message: '请输入岗位名称', + }, + ], + })()} + + + + + {getFieldDecorator('sort', { + rules: [ + { + required: true, + message: '请输入岗位排序', + }, + ], + })()} + + + + + + + + + {getFieldDecorator('remark', { + rules: [ + { + required: true, + message: '请输入岗位描述', + }, + ], + })(