-
- {title &&
{title}
}
- {action &&
{action}
}
-
+ {title && (
+
+
{title}
+ {action &&
{action}
}
+
+ )}
{content &&
{content}
}
{extraContent &&
{extraContent}
}
diff --git a/src/components/Sword/Grid.js b/src/components/Sword/Grid.js
index aff6b9a..0b8f796 100644
--- a/src/components/Sword/Grid.js
+++ b/src/components/Sword/Grid.js
@@ -34,7 +34,9 @@ export default class Grid extends PureComponent {
const { form } = this.props;
form.validateFields(async (err, fieldsValue) => {
- if (err) return;
+ if (err) {
+ return;
+ }
const values = {
...fieldsValue,
@@ -57,7 +59,9 @@ export default class Grid extends PureComponent {
formValues: {},
selectedRows: [],
});
- if (onReset) onReset();
+ if (onReset) {
+ onReset();
+ }
this.refreshTable();
};
@@ -79,7 +83,9 @@ export default class Grid extends PureComponent {
size,
...formValues,
};
- if (onSearch) onSearch(params);
+ if (onSearch) {
+ onSearch(params);
+ }
};
handleSelectRows = rows => {
@@ -105,12 +111,13 @@ export default class Grid extends PureComponent {
});
};
- handelToolBarClick = btn => {
+ handleToolBarClick = btn => {
+ const { selectedRows } = this.state;
const keys = this.getSelectKeys();
- this.handelClick(btn, keys);
+ this.handleClick(btn, keys, selectedRows);
};
- handelClick = (btn, keys = []) => {
+ handleClick = (btn, keys = [], rows) => {
const { path, alias } = btn;
const { btnCallBack } = this.props;
const refresh = (temp = true) => this.refreshTable(temp);
@@ -176,7 +183,7 @@ export default class Grid extends PureComponent {
return;
}
if (btnCallBack) {
- btnCallBack({ btn, keys, refresh });
+ btnCallBack({ btn, keys, rows, refresh });
}
};
@@ -195,12 +202,13 @@ export default class Grid extends PureComponent {
renderSearchForm,
renderLeftButton,
renderRightButton,
+ renderActionButton,
} = this.props;
let { columns } = this.props;
const actionButtons = buttons.filter(button => button.action === 2 || button.action === 3);
- if (columns && Array.isArray(columns) && actionButtons.length > 0) {
+ if (columns && Array.isArray(columns) && (actionButtons.length > 0 || renderActionButton)) {
const key = pkField || rowKey || 'id';
columns = [
...columns,
@@ -209,17 +217,24 @@ export default class Grid extends PureComponent {
width: actionColumnWidth || 200,
render: (text, record) => (
- {actionButtons.map((button, index) => (
-
- {index > 0 ? : null}
- this.handelClick(button, [record[childPkField || key]])}
- >
-
-
-
- ))}
+
),
},
@@ -236,7 +251,7 @@ export default class Grid extends PureComponent {
buttons={buttons}
renderLeftButton={renderLeftButton}
renderRightButton={renderRightButton}
- onClick={this.handelToolBarClick}
+ onClick={this.handleToolBarClick}
/>
diff --git a/src/layouts/Header.js b/src/layouts/Header.js
index 18a09f6..69571c5 100644
--- a/src/layouts/Header.js
+++ b/src/layouts/Header.js
@@ -62,8 +62,11 @@ class HeaderView extends React.Component {
return;
}
if (key === 'userinfo') {
- message.success('即将开放');
- // router.push('/account/settings/base');
+ router.push('/account/settings/base');
+ return;
+ }
+ if (key === 'password') {
+ router.push('/account/settings/password');
return;
}
if (key === 'triggerError') {
diff --git a/src/locales/en-US/login.js b/src/locales/en-US/login.js
index a7bc864..ac476dc 100644
--- a/src/locales/en-US/login.js
+++ b/src/locales/en-US/login.js
@@ -1,5 +1,5 @@
export default {
- 'app.login.tenantCode': 'tenantCode',
+ 'app.login.tenantId': 'tenantId',
'app.login.userName': 'userName',
'app.login.password': 'password',
'app.login.message-invalid-credentials': 'Invalid username or password(admin/ant.design)',
@@ -21,7 +21,7 @@ export default {
'app.register-result.view-mailbox': 'View mailbox',
'validation.email.required': 'Please enter your email!',
'validation.email.wrong-format': 'The email address is in the wrong format!',
- 'validation.userName.tenantCode': 'Please enter your tenantCode!',
+ 'validation.userName.tenantId': 'Please enter your tenantId!',
'validation.userName.required': 'Please enter your userName!',
'validation.password.required': 'Please enter your password!',
'validation.password.twice': 'The passwords entered twice do not match!',
diff --git a/src/locales/en-US/menu.js b/src/locales/en-US/menu.js
index cc83d16..40e9282 100644
--- a/src/locales/en-US/menu.js
+++ b/src/locales/en-US/menu.js
@@ -24,6 +24,7 @@ export default {
'menu.monitor.doc': 'api doc',
'menu.tool': 'develop',
'menu.tool.code': 'code generate',
+ 'menu.tool.datasource': 'datasource',
'menu.result': 'Result',
'menu.result.success': 'Success',
'menu.result.fail': 'Fail',
@@ -34,6 +35,7 @@ export default {
'menu.exception.trigger': 'Trigger',
'menu.account': 'Account',
'menu.account.center': 'Account Center',
+ 'menu.account.password': 'Modify Password',
'menu.account.settings': 'Account Settings',
'menu.account.trigger': 'Trigger Error',
'menu.account.logout': 'Logout',
diff --git a/src/locales/en-US/settings.js b/src/locales/en-US/settings.js
index 822dd00..0e8318b 100644
--- a/src/locales/en-US/settings.js
+++ b/src/locales/en-US/settings.js
@@ -9,6 +9,8 @@ export default {
'app.settings.basic.email-message': 'Please input your email!',
'app.settings.basic.nickname': 'Nickname',
'app.settings.basic.nickname-message': 'Please input your Nickname!',
+ 'app.settings.basic.realname': 'Realname',
+ 'app.settings.basic.realname-message': 'Please input your Realname!',
'app.settings.basic.profile': 'Personal profile',
'app.settings.basic.profile-message': 'Please input your personal profile!',
'app.settings.basic.profile-placeholder': 'Brief introduction to yourself',
@@ -21,6 +23,12 @@ export default {
'app.settings.basic.phone': 'Phone Number',
'app.settings.basic.phone-message': 'Please input your phone!',
'app.settings.basic.update': 'Update Information',
+ 'app.settings.password.old': 'Old Password',
+ 'app.settings.password.old-message': 'Please input your Old Password!',
+ 'app.settings.password.new': 'New Password',
+ 'app.settings.password.new-message': 'Please input your new Password!',
+ 'app.settings.password.new1': 'New Password1',
+ 'app.settings.password.new1-message': 'Please comfirm your new Password!',
'app.settings.security.strong': 'Strong',
'app.settings.security.medium': 'Medium',
'app.settings.security.weak': 'Weak',
diff --git a/src/locales/zh-CN/login.js b/src/locales/zh-CN/login.js
index 67696d6..64b3887 100644
--- a/src/locales/zh-CN/login.js
+++ b/src/locales/zh-CN/login.js
@@ -1,5 +1,5 @@
export default {
- 'app.login.tenantCode': '租户编号',
+ 'app.login.tenantId': '租户ID',
'app.login.userName': '用户名',
'app.login.password': '密码',
'app.login.message-invalid-credentials': '账户或密码错误(admin/ant.design)',
@@ -21,7 +21,7 @@ export default {
'app.register-result.view-mailbox': '查看邮箱',
'validation.email.required': '请输入邮箱地址!',
'validation.email.wrong-format': '邮箱地址格式错误!',
- 'validation.tenantCode.required': '请输入租户编号!',
+ 'validation.tenantId.required': '请输入租户ID!',
'validation.userName.required': '请输入用户名!',
'validation.password.required': '请输入密码!',
'validation.password.twice': '两次输入的密码不匹配!',
diff --git a/src/locales/zh-CN/menu.js b/src/locales/zh-CN/menu.js
index eafd4bb..f8cee1d 100644
--- a/src/locales/zh-CN/menu.js
+++ b/src/locales/zh-CN/menu.js
@@ -24,6 +24,7 @@ export default {
'menu.monitor.doc': '接口文档',
'menu.tool': '研发工具',
'menu.tool.code': '代码生成',
+ 'menu.tool.datasource': '数据源管理',
'menu.result': '结果页',
'menu.result.success': '成功页',
'menu.result.fail': '失败页',
@@ -34,6 +35,7 @@ export default {
'menu.exception.trigger': '触发错误',
'menu.account': '个人页',
'menu.account.center': '个人中心',
+ 'menu.account.password': '密码修改',
'menu.account.settings': '个人设置',
'menu.account.trigger': '触发报错',
'menu.account.logout': '退出登录',
diff --git a/src/locales/zh-CN/settings.js b/src/locales/zh-CN/settings.js
index df8af43..be7f3c5 100644
--- a/src/locales/zh-CN/settings.js
+++ b/src/locales/zh-CN/settings.js
@@ -9,6 +9,8 @@ export default {
'app.settings.basic.email-message': '请输入您的邮箱!',
'app.settings.basic.nickname': '昵称',
'app.settings.basic.nickname-message': '请输入您的昵称!',
+ 'app.settings.basic.realname': '姓名',
+ 'app.settings.basic.realname-message': '请输入您的姓名!',
'app.settings.basic.profile': '个人简介',
'app.settings.basic.profile-message': '请输入个人简介!',
'app.settings.basic.profile-placeholder': '个人简介',
@@ -21,6 +23,12 @@ export default {
'app.settings.basic.phone': '联系电话',
'app.settings.basic.phone-message': '请输入您的联系电话!',
'app.settings.basic.update': '更新基本信息',
+ 'app.settings.password.old': '旧密码',
+ 'app.settings.password.old-message': '请输入你的旧密码!',
+ 'app.settings.password.new': '新密码',
+ 'app.settings.password.new-message': '请输入你的新密码!',
+ 'app.settings.password.new1': '确认密码',
+ 'app.settings.password.new1-message': '请输入你的确认密码!',
'app.settings.security.strong': '强',
'app.settings.security.medium': '中',
'app.settings.security.weak': '弱',
diff --git a/src/locales/zh-TW/login.js b/src/locales/zh-TW/login.js
index 2505951..6c05cf9 100644
--- a/src/locales/zh-TW/login.js
+++ b/src/locales/zh-TW/login.js
@@ -1,5 +1,5 @@
export default {
- 'app.login.tenantCode': '租戶編號',
+ 'app.login.tenantId': '租戶編號',
'app.login.userName': '賬戶',
'app.login.password': '密碼',
'app.login.message-invalid-credentials': '賬戶或密碼錯誤(admin/ant.design)',
@@ -21,7 +21,7 @@ export default {
'app.register-result.view-mailbox': '查看郵箱',
'validation.email.required': '請輸入郵箱地址!',
'validation.email.wrong-format': '郵箱地址格式錯誤!',
- 'validation.tenantCode.required': '請輸入租戶編號!',
+ 'validation.tenantId.required': '請輸入租戶編號!',
'validation.userName.required': '請輸入賬戶!',
'validation.password.required': '請輸入密碼!',
'validation.password.twice': '兩次輸入的密碼不匹配!',
diff --git a/src/locales/zh-TW/menu.js b/src/locales/zh-TW/menu.js
index 3bd46e2..68ed137 100644
--- a/src/locales/zh-TW/menu.js
+++ b/src/locales/zh-TW/menu.js
@@ -24,6 +24,7 @@ export default {
'menu.monitor.doc': '接口文檔',
'menu.tool': '研發工具',
'menu.tool.code': '代碼生成',
+ 'menu.tool.datasource': '數據源管理',
'menu.result': '結果頁',
'menu.result.success': '成功頁',
'menu.result.fail': '失敗頁',
@@ -34,6 +35,7 @@ export default {
'menu.exception.trigger': '觸發錯誤',
'menu.account': '個人頁',
'menu.account.center': '個人中心',
+ 'menu.account.password': '密碼修改',
'menu.account.settings': '個人設置',
'menu.account.trigger': '觸發報錯',
'menu.account.logout': '退出登錄',
diff --git a/src/locales/zh-TW/settings.js b/src/locales/zh-TW/settings.js
index dd45151..66acea6 100644
--- a/src/locales/zh-TW/settings.js
+++ b/src/locales/zh-TW/settings.js
@@ -9,6 +9,8 @@ export default {
'app.settings.basic.email-message': '請輸入您的郵箱!',
'app.settings.basic.nickname': '昵稱',
'app.settings.basic.nickname-message': '請輸入您的昵稱!',
+ 'app.settings.basic.realname': '姓名',
+ 'app.settings.basic.realname-message': '請輸入您的姓名!',
'app.settings.basic.profile': '個人簡介',
'app.settings.basic.profile-message': '請輸入個人簡介!',
'app.settings.basic.profile-placeholder': '個人簡介',
@@ -21,6 +23,12 @@ export default {
'app.settings.basic.phone': '聯系電話',
'app.settings.basic.phone-message': '請輸入您的聯系電話!',
'app.settings.basic.update': '更新基本信息',
+ 'app.settings.password.old': '舊密碼',
+ 'app.settings.password.old-message': '請輸入妳的舊密碼!',
+ 'app.settings.password.new': '新密碼',
+ 'app.settings.password.new-message': '請輸入妳的新密碼!',
+ 'app.settings.password.new1': '確認密碼',
+ 'app.settings.password.new1-message': '請輸入妳的確認密碼!',
'app.settings.security.strong': '強',
'app.settings.security.medium': '中',
'app.settings.security.weak': '弱',
diff --git a/src/models/code.js b/src/models/code.js
index b746a3c..6e2da3f 100644
--- a/src/models/code.js
+++ b/src/models/code.js
@@ -2,6 +2,8 @@ import { message } from 'antd';
import router from 'umi/router';
import { CODE_NAMESPACE } from '../actions/code';
import { list, submit, detail, remove } from '../services/code';
+import { select } from '../services/datasource';
+import { dict } from '../services/dict';
export default {
namespace: CODE_NAMESPACE,
@@ -10,6 +12,10 @@ export default {
list: [],
pagination: {},
},
+ init: {
+ source: [],
+ category: [],
+ },
detail: {},
},
effects: {
@@ -29,6 +35,19 @@ export default {
});
}
},
+ *fetchInit({ payload }, { call, put }) {
+ const responseS = yield call(select, payload);
+ const responseC = yield call(dict, payload);
+ if (responseS.success && responseC.success) {
+ yield put({
+ type: 'saveInit',
+ payload: {
+ source: responseS.data,
+ category: responseC.data,
+ },
+ });
+ }
+ },
*fetchDetail({ payload }, { call, put }) {
const response = yield call(detail, payload);
if (response.success) {
@@ -71,6 +90,12 @@ export default {
data: action.payload,
};
},
+ saveInit(state, action) {
+ return {
+ ...state,
+ init: action.payload,
+ };
+ },
saveDetail(state, action) {
return {
...state,
diff --git a/src/models/datasource.js b/src/models/datasource.js
new file mode 100644
index 0000000..e55dde7
--- /dev/null
+++ b/src/models/datasource.js
@@ -0,0 +1,87 @@
+import { message } from 'antd';
+import router from 'umi/router';
+import { DATASOURCE_NAMESPACE } from '../actions/datasource';
+import { list, submit, detail, remove } from '../services/datasource';
+
+export default {
+ namespace: DATASOURCE_NAMESPACE,
+ state: {
+ data: {
+ list: [],
+ pagination: false,
+ },
+ detail: {},
+ },
+ effects: {
+ *fetchList({ payload }, { call, put }) {
+ const response = yield call(list, payload);
+ if (response.success) {
+ yield put({
+ type: 'saveList',
+ payload: {
+ list: response.data.records,
+ pagination: {
+ total: response.data.total,
+ current: response.data.current,
+ pageSize: response.data.size,
+ },
+ },
+ });
+ }
+ },
+ *fetchDetail({ payload }, { call, put }) {
+ const response = yield call(detail, payload);
+ if (response.success) {
+ yield put({
+ type: 'saveDetail',
+ payload: {
+ detail: response.data,
+ },
+ });
+ }
+ },
+ *clearDetail({ payload }, { put }) {
+ yield put({
+ type: 'removeDetail',
+ payload: { payload },
+ });
+ },
+ *submit({ payload }, { call }) {
+ const response = yield call(submit, payload);
+ if (response.success) {
+ message.success('提交成功');
+ router.push('/tool/datasource');
+ }
+ },
+ *remove({ payload }, { call }) {
+ const {
+ data: { keys },
+ success,
+ } = payload;
+ const response = yield call(remove, { ids: keys });
+ if (response.success) {
+ success();
+ }
+ },
+ },
+ reducers: {
+ saveList(state, action) {
+ return {
+ ...state,
+ data: action.payload,
+ };
+ },
+ saveDetail(state, action) {
+ return {
+ ...state,
+ detail: action.payload.detail,
+ };
+ },
+ removeDetail(state) {
+ return {
+ ...state,
+ detail: {},
+ };
+ },
+ },
+};
diff --git a/src/models/user.js b/src/models/user.js
index 2c9ef01..1fda883 100644
--- a/src/models/user.js
+++ b/src/models/user.js
@@ -1,7 +1,7 @@
import { message } from 'antd';
import router from 'umi/router';
import { USER_NAMESPACE } from '../actions/user';
-import { query as queryUsers, list, submit, detail, remove, grant } from '../services/user';
+import { query as queryUsers, list, submit, update, detail, remove, grant } from '../services/user';
import { select as tenants } from '../services/tenant';
import { tree as roles } from '../services/role';
import { tree as depts } from '../services/dept';
@@ -116,6 +116,13 @@ export default {
router.push('/system/user');
}
},
+ *update({ payload }, { call }) {
+ const response = yield call(update, payload);
+ if (response.success) {
+ message.success('提交成功');
+ router.push('/system/user');
+ }
+ },
*remove({ payload }, { call }) {
const {
data: { keys },
diff --git a/src/pages/Account/Settings/BaseView.js b/src/pages/Account/Settings/BaseView.js
index 388a835..045948d 100644
--- a/src/pages/Account/Settings/BaseView.js
+++ b/src/pages/Account/Settings/BaseView.js
@@ -1,106 +1,161 @@
-import React, { Component, Fragment } from 'react';
-import { formatMessage, FormattedMessage } from 'umi/locale';
-import { Form, Input, Upload, Select, Button } from 'antd';
-import { connect } from 'dva';
-import styles from './BaseView.less';
-import GeographicView from './GeographicView';
-import PhoneView from './PhoneView';
-// import { getTimeDistance } from '@/utils/utils';
+import React, { Component } from 'react';
+import { formatMessage } from 'umi/locale';
+import { Form, Input, Upload, Button, message, Icon, Card } from 'antd';
+import Panel from '../../../components/Panel';
+import { getUserInfo, update } from '../../../services/user';
+import { getToken } from '../../../utils/authority';
const FormItem = Form.Item;
-const { Option } = Select;
-// 头像组件 方便以后独立,增加裁剪之类的功能
-const AvatarView = ({ avatar }) => (
-
-
-
-
-
-
-
-
-
-
-
-
-
-);
-
-const validatorGeographic = (rule, value, callback) => {
- const { province, city } = value;
- if (!province.key) {
- callback('Please input your province!');
- }
- if (!city.key) {
- callback('Please input your city!');
- }
- callback();
-};
-
-const validatorPhone = (rule, value, callback) => {
- const values = value.split('-');
- if (!values[0]) {
- callback('Please input your area code!');
- }
- if (!values[1]) {
- callback('Please input your phone number!');
- }
- callback();
-};
-
-@connect(({ user }) => ({
- currentUser: user.currentUser,
-}))
@Form.create()
class BaseView extends Component {
+ state = {
+ userId: '',
+ avatar: '',
+ loading: false,
+ };
+
componentDidMount() {
this.setBaseInfo();
}
setBaseInfo = () => {
- const { currentUser, form } = this.props;
- Object.keys(form.getFieldsValue()).forEach(key => {
- const obj = {};
- obj[key] = currentUser[key] || null;
- form.setFieldsValue(obj);
+ const { form } = this.props;
+ getUserInfo().then(resp => {
+ if (resp.success) {
+ const userInfo = resp.data;
+ Object.keys(form.getFieldsValue()).forEach(key => {
+ const obj = {};
+ obj[key] = userInfo[key] || null;
+ form.setFieldsValue(obj);
+ });
+ this.setState({ userId: userInfo.id, avatar: userInfo.avatar });
+ } else {
+ message.error(resp.msg || '获取数据失败');
+ }
});
};
- getAvatarURL() {
- const { currentUser } = this.props;
- if (currentUser.avatar) {
- return currentUser.avatar;
+ beforeUpload = file => {
+ const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
+ if (!isJpgOrPng) {
+ message.error('You can only upload JPG/PNG file!');
}
- const url = 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png';
- return url;
- }
+ const isLt2M = file.size / 1024 / 1024 < 2;
+ if (!isLt2M) {
+ message.error('Image must smaller than 2MB!');
+ }
+ return isJpgOrPng && isLt2M;
+ };
- getViewDom = ref => {
- this.view = ref;
+ handleChange = info => {
+ if (info.file.status === 'uploading') {
+ this.setState({ loading: true });
+ return;
+ }
+ if (info.file.status === 'done') {
+ this.setState({ loading: false, avatar: info.file.response.data.link });
+ }
+ };
+
+ handleSubmit = e => {
+ e.preventDefault();
+ const { form } = this.props;
+ const { userId, avatar } = this.state;
+ form.validateFieldsAndScroll((err, values) => {
+ if (!err) {
+ const params = {
+ id: userId,
+ ...values,
+ avatar,
+ };
+ update(params).then(resp => {
+ if (resp.success) {
+ message.success(resp.msg);
+ } else {
+ message.error(resp.msg || '提交失败');
+ }
+ });
+ }
+ });
};
render() {
const {
form: { getFieldDecorator },
} = this.props;
+
+ const { avatar, loading } = this.state;
+
+ const formItemLayout = {
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 7 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 12 },
+ md: { span: 10 },
+ },
+ };
+
+ const uploadProp = {
+ action: '/api/blade-resource/oss/endpoint/put-file',
+ headers: {
+ 'Blade-Auth': getToken(),
+ },
+ };
+
+ const uploadButton = (
+
+ );
+
+ const action = (
+
+ );
+
return (
-
+
+ {getFieldDecorator('email', {
+ rules: [
+ {
+ required: true,
+ message: formatMessage({ id: 'app.settings.basic.email-message' }, {}),
+ },
+ ],
+ })()}
+
+
+
+
);
}
}
diff --git a/src/pages/Account/Settings/PasswordView.js b/src/pages/Account/Settings/PasswordView.js
new file mode 100644
index 0000000..1e0e23d
--- /dev/null
+++ b/src/pages/Account/Settings/PasswordView.js
@@ -0,0 +1,98 @@
+import React, { Component } from 'react';
+import { formatMessage } from 'umi/locale';
+import { Form, Input, Button, Card, message } from 'antd';
+import Panel from '../../../components/Panel';
+import { updatePassword } from '../../../services/user';
+
+const FormItem = Form.Item;
+
+@Form.create()
+class PasswordView extends Component {
+ handleSubmit = e => {
+ e.preventDefault();
+ const { form } = this.props;
+ form.validateFieldsAndScroll((err, values) => {
+ if (!err) {
+ updatePassword(values).then(resp => {
+ if (resp.success) {
+ message.success(resp.msg);
+ }
+ });
+ }
+ });
+ };
+
+ render() {
+ const {
+ form: { getFieldDecorator },
+ } = this.props;
+
+ const formItemLayout = {
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 7 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 12 },
+ md: { span: 10 },
+ },
+ };
+
+ const action = (
+
+ );
+
+ return (
+
+
+
+ );
+ }
+}
+
+export default PasswordView;
diff --git a/src/pages/Dashboard/Workplace.js b/src/pages/Dashboard/Workplace.js
index 17c2431..a62290b 100644
--- a/src/pages/Dashboard/Workplace.js
+++ b/src/pages/Dashboard/Workplace.js
@@ -1,286 +1,223 @@
import React, { PureComponent } from 'react';
-import moment from 'moment';
-import { connect } from 'dva';
-import Link from 'umi/link';
-import { Row, Col, Card, List, Avatar } from 'antd';
+import { Card, Col, Collapse, Row } from 'antd';
+import styles from '../../layouts/Sword.less';
-import EditableLinkGroup from '@/components/EditableLinkGroup';
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-import styles from './Workplace.less';
+const { Panel } = Collapse;
-const links = [
- {
- title: '操作一',
- href: '',
- },
- {
- title: '操作二',
- href: '',
- },
- {
- title: '操作三',
- href: '',
- },
- {
- title: '操作四',
- href: '',
- },
- {
- title: '操作五',
- href: '',
- },
- {
- title: '操作六',
- href: '',
- },
-];
-@connect(({ user, project, activities, loading }) => ({
- currentUser: user.currentUser,
- project,
- activities,
- currentUserLoading: loading.effects['user/fetchCurrent'],
- projectLoading: loading.effects['project/fetchNotice'],
- activitiesLoading: loading.effects['activities/fetchList'],
-}))
class Workplace extends PureComponent {
- componentDidMount() {
- const { dispatch } = this.props;
- dispatch({
- type: 'user/fetchCurrent',
- });
- dispatch({
- type: 'project/fetchNotice',
- });
- dispatch({
- type: 'activities/fetchList',
- });
- }
-
- renderActivities() {
- const {
- activities: { list },
- } = this.props;
- return list.map(item => {
- const events = item.template.split(/@\{([^{}]*)\}/gi).map(key => {
- if (item[key]) {
- return (
-
- {item[key].name}
-
- );
- }
- return key;
- });
- return (
-
- }
- title={
-
- {item.user.name}
-
- {events}
-
- }
- description={
-
- {moment(item.updatedAt).fromNow()}
-
- }
- />
-
- );
- });
- }
-
render() {
- const {
- currentUser,
- currentUserLoading,
- project: { notice },
- projectLoading,
- activitiesLoading,
- } = this.props;
-
- const pageHeaderContent =
- currentUser && Object.keys(currentUser).length ? (
-
-
-
-
- 您好,
- {currentUser.name}
- ,祝您开心每一天!
-
-
我们用代码编写梦想,用梦想改变世界。
-
-
- ) : null;
-
- const extraContent = (
-
- );
-
return (
-
-
-
-
-
-
-
-
- SpringBlade 2.0
-
- 是一个基于 Spring Boot 2 & Spring Cloud Finchley & Mybatis
- 等核心技术,用于快速构建中大型系统的基础框架。
-
-
- }
- />
-
-
-
- SpringBlade 企业版系列
-
- 已通过长时间生产环境的考验,现将其拆分出基础模块进行开源,当前版本为:2.0.0。
-
-
- }
- />
-
-
-
- SpringBlade
-
- 技术交流群号:477853168。欢迎大家加入。
-
-
- }
- />
-
-
-
-
-
-
- {notice.map(item => (
-
-
-
-
- {item.title}
-
- }
- description={item.description}
- />
-
-
- ))}
-
-
-