diff --git a/.eslintignore b/.eslintignore
index 43ab7824efa0352bbcbffde924c60fb1d2634518..576c8151a65e40b3d1c53e0f117e295e0d347561 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,3 +1,3 @@
/functions/mock/**
/scripts
-/config
\ No newline at end of file
+/config
diff --git a/config/config.js b/config/config.js
index 887b06141eb5c952335a583a8821b351f5112aee..1d5f2530d6e128534cab3080e7574fad2b285b0a 100644
--- a/config/config.js
+++ b/config/config.js
@@ -1,6 +1,5 @@
// https://umijs.org/config/
import os from 'os';
-import pageRoutes from './router.config';
import webpackPlugin from './plugin.config';
import defaultSettings from '../src/defaultSettings';
import slash from 'slash2';
@@ -63,7 +62,25 @@ export default {
ie: 11,
},
// 路由配置
- routes: pageRoutes,
+ routes: [{
+ path: '/user',
+ components: ['../layouts/UserLayout'],
+ routes: [],
+ }, {
+ path: '/',
+ component: '../layouts/BasicLayout',
+ Routes: ['src/pages/Authorized'],
+ authority: ['admin', 'user'],
+ routes: [
+ // dashboard
+ {
+ path: '/',
+ name: 'dashboard',
+ icon: 'dashboard',
+ component: './BasicDemo',
+ },
+ ],
+ }],
// Theme for antd
// https://ant.design/docs/react/customize-theme-cn
theme: {
diff --git a/config/router.config.js b/config/router.config.js
deleted file mode 100644
index 656027d2371af19355c63eb2e989c8cefe306ffe..0000000000000000000000000000000000000000
--- a/config/router.config.js
+++ /dev/null
@@ -1,263 +0,0 @@
-export default [
- // user
- {
- path: '/user',
- component: '../layouts/UserLayout',
- routes: [
- { path: '/user', redirect: '/user/login' },
- { path: '/user/login', component: './User/Login' },
- { path: '/user/register', component: './User/Register' },
- { path: '/user/register-result', component: './User/RegisterResult' },
- ],
- },
- // app
- {
- path: '/',
- component: '../layouts/BasicLayout',
- Routes: ['src/pages/Authorized'],
- authority: ['admin', 'user'],
- routes: [
- // dashboard
- { path: '/', redirect: '/dashboard/analysis' },
- {
- path: '/dashboard',
- name: 'dashboard',
- icon: 'dashboard',
- routes: [
- {
- path: '/dashboard/analysis',
- name: 'analysis',
- component: './Dashboard/Analysis',
- },
- {
- path: '/dashboard/monitor',
- name: 'monitor',
- component: './Dashboard/Monitor',
- },
- {
- path: '/dashboard/workplace',
- name: 'workplace',
- component: './Dashboard/Workplace',
- },
- ],
- },
- // forms
- {
- path: '/form',
- icon: 'form',
- name: 'form',
- routes: [
- {
- path: '/form/basic-form',
- name: 'basicform',
- component: './Forms/BasicForm',
- },
- {
- path: '/form/step-form',
- name: 'stepform',
- component: './Forms/StepForm',
- hideChildrenInMenu: true,
- routes: [
- {
- path: '/form/step-form',
- redirect: '/form/step-form/info',
- },
- {
- path: '/form/step-form/info',
- name: 'info',
- component: './Forms/StepForm/Step1',
- },
- {
- path: '/form/step-form/confirm',
- name: 'confirm',
- component: './Forms/StepForm/Step2',
- },
- {
- path: '/form/step-form/result',
- name: 'result',
- component: './Forms/StepForm/Step3',
- },
- ],
- },
- {
- path: '/form/advanced-form',
- name: 'advancedform',
- authority: ['admin'],
- component: './Forms/AdvancedForm',
- },
- ],
- },
- // list
- {
- path: '/list',
- icon: 'table',
- name: 'list',
- routes: [
- {
- path: '/list/table-list',
- name: 'searchtable',
- component: './List/TableList',
- },
- {
- path: '/list/basic-list',
- name: 'basiclist',
- component: './List/BasicList',
- },
- {
- path: '/list/card-list',
- name: 'cardlist',
- component: './List/CardList',
- },
- {
- path: '/list/search',
- name: 'searchlist',
- component: './List/List',
- routes: [
- {
- path: '/list/search',
- redirect: '/list/search/articles',
- },
- {
- path: '/list/search/articles',
- name: 'articles',
- component: './List/Articles',
- },
- {
- path: '/list/search/projects',
- name: 'projects',
- component: './List/Projects',
- },
- {
- path: '/list/search/applications',
- name: 'applications',
- component: './List/Applications',
- },
- ],
- },
- ],
- },
- {
- path: '/profile',
- name: 'profile',
- icon: 'profile',
- routes: [
- // profile
- {
- path: '/profile/basic',
- name: 'basic',
- component: './Profile/BasicProfile',
- },
- {
- path: '/profile/advanced',
- name: 'advanced',
- authority: ['admin'],
- component: './Profile/AdvancedProfile',
- },
- ],
- },
- {
- name: 'result',
- icon: 'check-circle-o',
- path: '/result',
- routes: [
- // result
- {
- path: '/result/success',
- name: 'success',
- component: './Result/Success',
- },
- { path: '/result/fail', name: 'fail', component: './Result/Error' },
- ],
- },
- {
- name: 'exception',
- icon: 'warning',
- path: '/exception',
- routes: [
- // exception
- {
- path: '/exception/403',
- name: 'not-permission',
- component: './Exception/403',
- },
- {
- path: '/exception/404',
- name: 'not-find',
- component: './Exception/404',
- },
- {
- path: '/exception/500',
- name: 'server-error',
- component: './Exception/500',
- },
- {
- path: '/exception/trigger',
- name: 'trigger',
- hideInMenu: true,
- component: './Exception/TriggerException',
- },
- ],
- },
- {
- name: 'account',
- icon: 'user',
- path: '/account',
- routes: [
- {
- path: '/account/center',
- name: 'center',
- component: './Account/Center/Center',
- routes: [
- {
- path: '/account/center',
- redirect: '/account/center/articles',
- },
- {
- path: '/account/center/articles',
- component: './Account/Center/Articles',
- },
- {
- path: '/account/center/applications',
- component: './Account/Center/Applications',
- },
- {
- path: '/account/center/projects',
- component: './Account/Center/Projects',
- },
- ],
- },
- {
- path: '/account/settings',
- name: 'settings',
- component: './Account/Settings/Info',
- routes: [
- {
- path: '/account/settings',
- redirect: '/account/settings/base',
- },
- {
- path: '/account/settings/base',
- component: './Account/Settings/BaseView',
- },
- {
- path: '/account/settings/security',
- component: './Account/Settings/SecurityView',
- },
- {
- path: '/account/settings/binding',
- component: './Account/Settings/BindingView',
- },
- {
- path: '/account/settings/notification',
- component: './Account/Settings/NotificationView',
- },
- ],
- },
- ],
- },
- {
- component: '404',
- },
- ],
- },
-];
diff --git a/src/layouts/BasicLayout.js b/src/layouts/BasicLayout.js
index 914f47f8ce81adc592bde2361c6587893d21a59a..b121b45274313db6bb2934c1deeba1699f73bbaa 100644
--- a/src/layouts/BasicLayout.js
+++ b/src/layouts/BasicLayout.js
@@ -14,7 +14,6 @@ import logo from '../assets/logo.svg';
import Footer from './Footer';
import Header from './Header';
import Context from './MenuContext';
-import Exception403 from '../pages/Exception/403';
import PageLoading from '@/components/PageLoading';
import SiderMenu from '@/components/SiderMenu';
import { title } from '../defaultSettings';
@@ -25,6 +24,8 @@ const SettingDrawer = React.lazy(() => import('@/components/SettingDrawer'));
const { Content } = Layout;
+const Exception403 =
Exception403
;
+
const query = {
'screen-xs': {
maxWidth: 575,
diff --git a/src/pages/404.js b/src/pages/404.js
deleted file mode 100644
index 627797aeff6b3dca7e722ba15a8c5e75013b6e5c..0000000000000000000000000000000000000000
--- a/src/pages/404.js
+++ /dev/null
@@ -1,13 +0,0 @@
-import React from 'react';
-import Link from 'umi/link';
-import { formatMessage } from 'umi/locale';
-import Exception from 'ant-design-pro/lib/Exception';
-
-export default () => (
-
-);
diff --git a/src/pages/Account/Center/Applications.js b/src/pages/Account/Center/Applications.js
deleted file mode 100644
index 031686cd1148c48d8444eec9573776d5185950d3..0000000000000000000000000000000000000000
--- a/src/pages/Account/Center/Applications.js
+++ /dev/null
@@ -1,88 +0,0 @@
-import React, { PureComponent } from 'react';
-import { List, Card, Icon, Dropdown, Menu, Avatar, Tooltip } from 'antd';
-import numeral from 'numeral';
-import { connect } from 'dva';
-import { formatWan } from '@/utils/utils';
-import stylesApplications from '../../List/Applications.less';
-
-@connect(({ list }) => ({
- list,
-}))
-class Center extends PureComponent {
- render() {
- const {
- list: { list },
- } = this.props;
- const itemMenu = (
-
- );
- const CardInfo = ({ activeUser, newUser }) => (
-
- );
- return (
- (
-
-
-
- ,
-
-
- ,
-
-
- ,
-
-
- ,
- ]}
- >
- } title={item.title} />
-
-
-
-
-
- )}
- />
- );
- }
-}
-
-export default Center;
diff --git a/src/pages/Account/Center/Articles.js b/src/pages/Account/Center/Articles.js
deleted file mode 100644
index 9bb5ac309ef1180b5ed7bf53c32720545dc6386a..0000000000000000000000000000000000000000
--- a/src/pages/Account/Center/Articles.js
+++ /dev/null
@@ -1,59 +0,0 @@
-import React, { PureComponent } from 'react';
-import { List, Icon, Tag } from 'antd';
-import { connect } from 'dva';
-import ArticleListContent from '@/components/ArticleListContent';
-import styles from './Articles.less';
-
-@connect(({ list }) => ({
- list,
-}))
-class Center extends PureComponent {
- render() {
- const {
- list: { list },
- } = this.props;
- const IconText = ({ type, text }) => (
-
-
- {text}
-
- );
- return (
- (
- ,
- ,
- ,
- ]}
- >
-
- {item.title}
-
- }
- description={
-
- Ant Design
- 设计语言
- 蚂蚁金服
-
- }
- />
-
-
- )}
- />
- );
- }
-}
-
-export default Center;
diff --git a/src/pages/Account/Center/Articles.less b/src/pages/Account/Center/Articles.less
deleted file mode 100644
index 2e51509ba7debe11d9da0981b633d3ffe4b90d20..0000000000000000000000000000000000000000
--- a/src/pages/Account/Center/Articles.less
+++ /dev/null
@@ -1,12 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.articleList {
- :global {
- .ant-list-item:first-child {
- padding-top: 0;
- }
- }
-}
-a.listItemMetaTitle {
- color: @heading-color;
-}
diff --git a/src/pages/Account/Center/Center.js b/src/pages/Account/Center/Center.js
deleted file mode 100644
index d2512f95bc430cfbb2bff8f60db89391e21be1f3..0000000000000000000000000000000000000000
--- a/src/pages/Account/Center/Center.js
+++ /dev/null
@@ -1,216 +0,0 @@
-import React, { PureComponent } from 'react';
-import { connect } from 'dva';
-import Link from 'umi/link';
-import router from 'umi/router';
-import { Card, Row, Col, Icon, Avatar, Tag, Divider, Spin, Input } from 'antd';
-import GridContent from '@/components/PageHeaderWrapper/GridContent';
-import styles from './Center.less';
-
-@connect(({ loading, user, project }) => ({
- listLoading: loading.effects['list/fetch'],
- currentUser: user.currentUser,
- currentUserLoading: loading.effects['user/fetchCurrent'],
- project,
- projectLoading: loading.effects['project/fetchNotice'],
-}))
-class Center extends PureComponent {
- state = {
- newTags: [],
- inputVisible: false,
- inputValue: '',
- };
-
- componentDidMount() {
- const { dispatch } = this.props;
- dispatch({
- type: 'user/fetchCurrent',
- });
- dispatch({
- type: 'list/fetch',
- payload: {
- count: 8,
- },
- });
- dispatch({
- type: 'project/fetchNotice',
- });
- }
-
- onTabChange = key => {
- const { match } = this.props;
- switch (key) {
- case 'articles':
- router.push(`${match.url}/articles`);
- break;
- case 'applications':
- router.push(`${match.url}/applications`);
- break;
- case 'projects':
- router.push(`${match.url}/projects`);
- break;
- default:
- break;
- }
- };
-
- showInput = () => {
- this.setState({ inputVisible: true }, () => this.input.focus());
- };
-
- saveInputRef = input => {
- this.input = input;
- };
-
- handleInputChange = e => {
- this.setState({ inputValue: e.target.value });
- };
-
- handleInputConfirm = () => {
- const { state } = this;
- const { inputValue } = state;
- let { newTags } = state;
- if (inputValue && newTags.filter(tag => tag.label === inputValue).length === 0) {
- newTags = [...newTags, { key: `new-${newTags.length}`, label: inputValue }];
- }
- this.setState({
- newTags,
- inputVisible: false,
- inputValue: '',
- });
- };
-
- render() {
- const { newTags, inputVisible, inputValue } = this.state;
- const {
- listLoading,
- currentUser,
- currentUserLoading,
- project: { notice },
- projectLoading,
- match,
- location,
- children,
- } = this.props;
-
- const operationTabList = [
- {
- key: 'articles',
- tab: (
-
- 文章 (8)
-
- ),
- },
- {
- key: 'applications',
- tab: (
-
- 应用 (8)
-
- ),
- },
- {
- key: 'projects',
- tab: (
-
- 项目 (8)
-
- ),
- },
- ];
-
- return (
-
-
-
-
- {currentUser && Object.keys(currentUser).length ? (
-
-
-

-
{currentUser.name}
-
{currentUser.signature}
-
-
-
-
- {currentUser.title}
-
-
-
- {currentUser.group}
-
-
-
- {currentUser.geographic.province.label}
- {currentUser.geographic.city.label}
-
-
-
-
-
标签
- {currentUser.tags.concat(newTags).map(item => (
-
{item.label}
- ))}
- {inputVisible && (
-
- )}
- {!inputVisible && (
-
-
-
- )}
-
-
-
-
团队
-
-
- {notice.map(item => (
-
-
-
- {item.member}
-
-
- ))}
-
-
-
-
- ) : (
- 'loading...'
- )}
-
-
-
-
- {children}
-
-
-
-
- );
- }
-}
-
-export default Center;
diff --git a/src/pages/Account/Center/Center.less b/src/pages/Account/Center/Center.less
deleted file mode 100644
index 37d6a203e668df00d742f20c366721a18304600c..0000000000000000000000000000000000000000
--- a/src/pages/Account/Center/Center.less
+++ /dev/null
@@ -1,97 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.avatarHolder {
- text-align: center;
- margin-bottom: 24px;
-
- & > img {
- width: 104px;
- height: 104px;
- margin-bottom: 20px;
- }
-
- .name {
- font-size: 20px;
- line-height: 28px;
- font-weight: 500;
- color: @heading-color;
- margin-bottom: 4px;
- }
-}
-
-.detail {
- p {
- margin-bottom: 8px;
- padding-left: 26px;
- position: relative;
-
- &:last-child {
- margin-bottom: 0;
- }
- }
-
- i {
- position: absolute;
- height: 14px;
- width: 14px;
- left: 0;
- top: 4px;
- background: url(https://gw.alipayobjects.com/zos/rmsportal/pBjWzVAHnOOtAUvZmZfy.svg);
-
- &.title {
- background-position: 0 0;
- }
-
- &.group {
- background-position: 0 -22px;
- }
-
- &.address {
- background-position: 0 -44px;
- }
- }
-}
-
-.tagsTitle,
-.teamTitle {
- font-weight: 500;
- color: @heading-color;
- margin-bottom: 12px;
-}
-
-.tags {
- :global {
- .ant-tag {
- margin-bottom: 8px;
- }
- }
-}
-
-.team {
- :global {
- .ant-avatar {
- margin-right: 12px;
- }
- }
-
- a {
- display: block;
- margin-bottom: 24px;
- color: @text-color;
- transition: color 0.3s;
- .textOverflow();
-
- &:hover {
- color: @primary-color;
- }
- }
-}
-
-.tabsCard {
- :global {
- .ant-card-head {
- padding: 0 16px;
- }
- }
-}
diff --git a/src/pages/Account/Center/Projects.js b/src/pages/Account/Center/Projects.js
deleted file mode 100644
index ec0a358b1e741b84831b92cfc12d5c352461c557..0000000000000000000000000000000000000000
--- a/src/pages/Account/Center/Projects.js
+++ /dev/null
@@ -1,52 +0,0 @@
-import React, { PureComponent } from 'react';
-import { List, Card } from 'antd';
-import moment from 'moment';
-import { connect } from 'dva';
-import AvatarList from 'ant-design-pro/lib/AvatarList';
-import stylesProjects from '../../List/Projects.less';
-
-@connect(({ list }) => ({
- list,
-}))
-class Center extends PureComponent {
- render() {
- const {
- list: { list },
- } = this.props;
- return (
- (
-
- }
- >
- {item.title}} description={item.subDescription} />
-
-
{moment(item.updatedAt).fromNow()}
-
-
- {item.members.map(member => (
-
- ))}
-
-
-
-
-
- )}
- />
- );
- }
-}
-
-export default Center;
diff --git a/src/pages/Account/Settings/BaseView.js b/src/pages/Account/Settings/BaseView.js
deleted file mode 100644
index 388a835856a774b9fab30d5c8e1525579d25385c..0000000000000000000000000000000000000000
--- a/src/pages/Account/Settings/BaseView.js
+++ /dev/null
@@ -1,192 +0,0 @@
-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';
-
-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 {
- 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);
- });
- };
-
- getAvatarURL() {
- const { currentUser } = this.props;
- if (currentUser.avatar) {
- return currentUser.avatar;
- }
- const url = 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png';
- return url;
- }
-
- getViewDom = ref => {
- this.view = ref;
- };
-
- render() {
- const {
- form: { getFieldDecorator },
- } = this.props;
- return (
-
- );
- }
-}
-
-export default BaseView;
diff --git a/src/pages/Account/Settings/BaseView.less b/src/pages/Account/Settings/BaseView.less
deleted file mode 100644
index a0a2ffdefe6a1010a27b594a9d6fca82e5f70e94..0000000000000000000000000000000000000000
--- a/src/pages/Account/Settings/BaseView.less
+++ /dev/null
@@ -1,52 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.baseView {
- display: flex;
- padding-top: 12px;
-
- .left {
- max-width: 448px;
- min-width: 224px;
- }
- .right {
- flex: 1;
- padding-left: 104px;
- .avatar_title {
- height: 22px;
- font-size: @font-size-base;
- color: @heading-color;
- line-height: 22px;
- margin-bottom: 8px;
- }
- .avatar {
- width: 144px;
- height: 144px;
- margin-bottom: 12px;
- overflow: hidden;
- img {
- width: 100%;
- }
- }
- .button_view {
- width: 144px;
- text-align: center;
- }
- }
-}
-
-@media screen and (max-width: @screen-xl) {
- .baseView {
- flex-direction: column-reverse;
-
- .right {
- padding: 20px;
- display: flex;
- flex-direction: column;
- align-items: center;
- max-width: 448px;
- .avatar_title {
- display: none;
- }
- }
- }
-}
diff --git a/src/pages/Account/Settings/BindingView.js b/src/pages/Account/Settings/BindingView.js
deleted file mode 100644
index 29a29890ca0d5ab339f872f1fe614ff9b0122ea4..0000000000000000000000000000000000000000
--- a/src/pages/Account/Settings/BindingView.js
+++ /dev/null
@@ -1,60 +0,0 @@
-import React, { Component, Fragment } from 'react';
-import { formatMessage, FormattedMessage } from 'umi/locale';
-import { Icon, List } from 'antd';
-
-class BindingView extends Component {
- getData = () => [
- {
- title: formatMessage({ id: 'app.settings.binding.taobao' }, {}),
- description: formatMessage({ id: 'app.settings.binding.taobao-description' }, {}),
- actions: [
-
-
- ,
- ],
- avatar: ,
- },
- {
- title: formatMessage({ id: 'app.settings.binding.alipay' }, {}),
- description: formatMessage({ id: 'app.settings.binding.alipay-description' }, {}),
- actions: [
-
-
- ,
- ],
- avatar: ,
- },
- {
- title: formatMessage({ id: 'app.settings.binding.dingding' }, {}),
- description: formatMessage({ id: 'app.settings.binding.dingding-description' }, {}),
- actions: [
-
-
- ,
- ],
- avatar: ,
- },
- ];
-
- render() {
- return (
-
- (
-
-
-
- )}
- />
-
- );
- }
-}
-
-export default BindingView;
diff --git a/src/pages/Account/Settings/GeographicView.js b/src/pages/Account/Settings/GeographicView.js
deleted file mode 100644
index d33cb13871d39ef38ad986013339200c072b2d64..0000000000000000000000000000000000000000
--- a/src/pages/Account/Settings/GeographicView.js
+++ /dev/null
@@ -1,128 +0,0 @@
-import React, { PureComponent } from 'react';
-import { Select, Spin } from 'antd';
-import { connect } from 'dva';
-import styles from './GeographicView.less';
-
-const { Option } = Select;
-
-const nullSlectItem = {
- label: '',
- key: '',
-};
-
-@connect(({ geographic }) => {
- const { province, isLoading, city } = geographic;
- return {
- province,
- city,
- isLoading,
- };
-})
-class GeographicView extends PureComponent {
- componentDidMount = () => {
- const { dispatch } = this.props;
- dispatch({
- type: 'geographic/fetchProvince',
- });
- };
-
- componentDidUpdate(props) {
- const { dispatch, value } = this.props;
-
- if (!props.value && !!value && !!value.province) {
- dispatch({
- type: 'geographic/fetchCity',
- payload: value.province.key,
- });
- }
- }
-
- getProvinceOption() {
- const { province } = this.props;
- return this.getOption(province);
- }
-
- getCityOption = () => {
- const { city } = this.props;
- return this.getOption(city);
- };
-
- getOption = list => {
- if (!list || list.length < 1) {
- return (
-
- );
- }
- return list.map(item => (
-
- ));
- };
-
- selectProvinceItem = item => {
- const { dispatch, onChange } = this.props;
- dispatch({
- type: 'geographic/fetchCity',
- payload: item.key,
- });
- onChange({
- province: item,
- city: nullSlectItem,
- });
- };
-
- selectCityItem = item => {
- const { value, onChange } = this.props;
- onChange({
- province: value.province,
- city: item,
- });
- };
-
- conversionObject() {
- const { value } = this.props;
- if (!value) {
- return {
- province: nullSlectItem,
- city: nullSlectItem,
- };
- }
- const { province, city } = value;
- return {
- province: province || nullSlectItem,
- city: city || nullSlectItem,
- };
- }
-
- render() {
- const { province, city } = this.conversionObject();
- const { isLoading } = this.props;
- return (
-
-
-
-
- );
- }
-}
-
-export default GeographicView;
diff --git a/src/pages/Account/Settings/GeographicView.less b/src/pages/Account/Settings/GeographicView.less
deleted file mode 100644
index 22e35a29cea425faa33f82a76a89c6b0be3b8007..0000000000000000000000000000000000000000
--- a/src/pages/Account/Settings/GeographicView.less
+++ /dev/null
@@ -1,19 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.row {
- .item {
- max-width: 220px;
- width: 50%;
- }
- .item:first-child {
- margin-right: 8px;
- width: ~'calc(50% - 8px)';
- }
-}
-
-@media screen and (max-width: @screen-sm) {
- .item:first-child {
- margin: 0;
- margin-bottom: 8px;
- }
-}
diff --git a/src/pages/Account/Settings/Info.js b/src/pages/Account/Settings/Info.js
deleted file mode 100644
index ceee506b8bc5c5569d838f95f1d9cb051dbd2f26..0000000000000000000000000000000000000000
--- a/src/pages/Account/Settings/Info.js
+++ /dev/null
@@ -1,125 +0,0 @@
-import React, { Component } from 'react';
-import { connect } from 'dva';
-import router from 'umi/router';
-import { FormattedMessage } from 'umi/locale';
-import { Menu } from 'antd';
-import GridContent from '@/components/PageHeaderWrapper/GridContent';
-import styles from './Info.less';
-
-const { Item } = Menu;
-
-@connect(({ user }) => ({
- currentUser: user.currentUser,
-}))
-class Info extends Component {
- constructor(props) {
- super(props);
- const { match, location } = props;
- const menuMap = {
- base: ,
- security: (
-
- ),
- binding: (
-
- ),
- notification: (
-
- ),
- };
- const key = location.pathname.replace(`${match.path}/`, '');
- this.state = {
- mode: 'inline',
- menuMap,
- selectKey: menuMap[key] ? key : 'base',
- };
- }
-
- static getDerivedStateFromProps(props, state) {
- const { match, location } = props;
- let selectKey = location.pathname.replace(`${match.path}/`, '');
- selectKey = state.menuMap[selectKey] ? selectKey : 'base';
- if (selectKey !== state.selectKey) {
- return { selectKey };
- }
- return null;
- }
-
- componentDidMount() {
- window.addEventListener('resize', this.resize);
- this.resize();
- }
-
- componentWillUnmount() {
- window.removeEventListener('resize', this.resize);
- }
-
- getmenu = () => {
- const { menuMap } = this.state;
- return Object.keys(menuMap).map(item => - {menuMap[item]}
);
- };
-
- getRightTitle = () => {
- const { selectKey, menuMap } = this.state;
- return menuMap[selectKey];
- };
-
- selectKey = ({ key }) => {
- router.push(`/account/settings/${key}`);
- this.setState({
- selectKey: key,
- });
- };
-
- resize = () => {
- if (!this.main) {
- return;
- }
- requestAnimationFrame(() => {
- let mode = 'inline';
- const { offsetWidth } = this.main;
- if (this.main.offsetWidth < 641 && offsetWidth > 400) {
- mode = 'horizontal';
- }
- if (window.innerWidth < 768 && offsetWidth > 400) {
- mode = 'horizontal';
- }
- this.setState({
- mode,
- });
- });
- };
-
- render() {
- const { children, currentUser } = this.props;
- if (!currentUser.userid) {
- return '';
- }
- const { mode, selectKey } = this.state;
- return (
-
- {
- this.main = ref;
- }}
- >
-
-
-
-
-
{this.getRightTitle()}
- {children}
-
-
-
- );
- }
-}
-
-export default Info;
diff --git a/src/pages/Account/Settings/Info.less b/src/pages/Account/Settings/Info.less
deleted file mode 100644
index b7a59fba3e2b0a39c7404d1fdc4d12d7ee803021..0000000000000000000000000000000000000000
--- a/src/pages/Account/Settings/Info.less
+++ /dev/null
@@ -1,97 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.main {
- width: 100%;
- height: 100%;
- background-color: @body-background;
- display: flex;
- padding-top: 16px;
- padding-bottom: 16px;
- overflow: auto;
- .leftmenu {
- width: 224px;
- border-right: @border-width-base @border-style-base @border-color-split;
- :global {
- .ant-menu-inline {
- border: none;
- }
- .ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected {
- font-weight: bold;
- }
- }
- }
- .right {
- flex: 1;
- padding-left: 40px;
- padding-right: 40px;
- padding-top: 8px;
- padding-bottom: 8px;
- .title {
- font-size: 20px;
- color: @heading-color;
- line-height: 28px;
- font-weight: 500;
- margin-bottom: 12px;
- }
- }
- :global {
- .ant-list-split .ant-list-item:last-child {
- border-bottom: 1px solid #e8e8e8;
- }
- .ant-list-item {
- padding-top: 14px;
- padding-bottom: 14px;
- }
- }
-}
-:global {
- .ant-list-item-meta {
- // 账号绑定图标
- .taobao {
- color: #ff4000;
- display: block;
- font-size: 48px;
- line-height: 48px;
- border-radius: @border-radius-base;
- }
- .dingding {
- background-color: #2eabff;
- color: #fff;
- font-size: 32px;
- line-height: 32px;
- padding: 6px;
- margin: 2px;
- border-radius: @border-radius-base;
- }
- .alipay {
- color: #2eabff;
- font-size: 48px;
- line-height: 48px;
- border-radius: @border-radius-base;
- }
- }
-
- // 密码强度
- font.strong {
- color: @success-color;
- }
- font.medium {
- color: @warning-color;
- }
- font.weak {
- color: @error-color;
- }
-}
-
-@media screen and (max-width: @screen-md) {
- .main {
- flex-direction: column;
- .leftmenu {
- width: 100%;
- border: none;
- }
- .right {
- padding: 40px;
- }
- }
-}
diff --git a/src/pages/Account/Settings/NotificationView.js b/src/pages/Account/Settings/NotificationView.js
deleted file mode 100644
index 96677bbd269501cb9e901ea0f30b58ed2e51d774..0000000000000000000000000000000000000000
--- a/src/pages/Account/Settings/NotificationView.js
+++ /dev/null
@@ -1,50 +0,0 @@
-import React, { Component, Fragment } from 'react';
-import { formatMessage } from 'umi/locale';
-import { Switch, List } from 'antd';
-
-class NotificationView extends Component {
- getData = () => {
- const Action = (
-
- );
- return [
- {
- title: formatMessage({ id: 'app.settings.notification.password' }, {}),
- description: formatMessage({ id: 'app.settings.notification.password-description' }, {}),
- actions: [Action],
- },
- {
- title: formatMessage({ id: 'app.settings.notification.messages' }, {}),
- description: formatMessage({ id: 'app.settings.notification.messages-description' }, {}),
- actions: [Action],
- },
- {
- title: formatMessage({ id: 'app.settings.notification.todo' }, {}),
- description: formatMessage({ id: 'app.settings.notification.todo-description' }, {}),
- actions: [Action],
- },
- ];
- };
-
- render() {
- return (
-
- (
-
-
-
- )}
- />
-
- );
- }
-}
-
-export default NotificationView;
diff --git a/src/pages/Account/Settings/PhoneView.js b/src/pages/Account/Settings/PhoneView.js
deleted file mode 100644
index 2665527642409007a28ea61ab2db0dc46938f629..0000000000000000000000000000000000000000
--- a/src/pages/Account/Settings/PhoneView.js
+++ /dev/null
@@ -1,33 +0,0 @@
-import React, { Fragment, PureComponent } from 'react';
-import { Input } from 'antd';
-import styles from './PhoneView.less';
-
-class PhoneView extends PureComponent {
- render() {
- const { value, onChange } = this.props;
- let values = ['', ''];
- if (value) {
- values = value.split('-');
- }
- return (
-
- {
- onChange(`${e.target.value}-${values[1]}`);
- }}
- />
- {
- onChange(`${values[0]}-${e.target.value}`);
- }}
- value={values[1]}
- />
-
- );
- }
-}
-
-export default PhoneView;
diff --git a/src/pages/Account/Settings/PhoneView.less b/src/pages/Account/Settings/PhoneView.less
deleted file mode 100644
index 5c85970d511eebcbc14bd313e2066fc2f9da4c45..0000000000000000000000000000000000000000
--- a/src/pages/Account/Settings/PhoneView.less
+++ /dev/null
@@ -1,11 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.area_code {
- max-width: 128px;
- margin-right: 8px;
- width: 30%;
-}
-.phone_number {
- max-width: 312px;
- width: ~'calc(70% - 8px)';
-}
diff --git a/src/pages/Account/Settings/SecurityView.js b/src/pages/Account/Settings/SecurityView.js
deleted file mode 100644
index 0706bd0b9b2988bb41bcc2a3fe9ab20f65f6bf16..0000000000000000000000000000000000000000
--- a/src/pages/Account/Settings/SecurityView.js
+++ /dev/null
@@ -1,102 +0,0 @@
-import React, { Component, Fragment } from 'react';
-import { formatMessage, FormattedMessage } from 'umi/locale';
-import { List } from 'antd';
-// import { getTimeDistance } from '@/utils/utils';
-
-const passwordStrength = {
- strong: (
-
-
-
- ),
- medium: (
-
-
-
- ),
- weak: (
-
-
- Weak
-
- ),
-};
-
-class SecurityView extends Component {
- getData = () => [
- {
- title: formatMessage({ id: 'app.settings.security.password' }, {}),
- description: (
-
- {formatMessage({ id: 'app.settings.security.password-description' })}:
- {passwordStrength.strong}
-
- ),
- actions: [
-
-
- ,
- ],
- },
- {
- title: formatMessage({ id: 'app.settings.security.phone' }, {}),
- description: `${formatMessage(
- { id: 'app.settings.security.phone-description' },
- {}
- )}:138****8293`,
- actions: [
-
-
- ,
- ],
- },
- {
- title: formatMessage({ id: 'app.settings.security.question' }, {}),
- description: formatMessage({ id: 'app.settings.security.question-description' }, {}),
- actions: [
-
-
- ,
- ],
- },
- {
- title: formatMessage({ id: 'app.settings.security.email' }, {}),
- description: `${formatMessage(
- { id: 'app.settings.security.email-description' },
- {}
- )}:ant***sign.com`,
- actions: [
-
-
- ,
- ],
- },
- {
- title: formatMessage({ id: 'app.settings.security.mfa' }, {}),
- description: formatMessage({ id: 'app.settings.security.mfa-description' }, {}),
- actions: [
-
-
- ,
- ],
- },
- ];
-
- render() {
- return (
-
- (
-
-
-
- )}
- />
-
- );
- }
-}
-
-export default SecurityView;
diff --git a/src/pages/Account/Settings/models/geographic.js b/src/pages/Account/Settings/models/geographic.js
deleted file mode 100644
index a501920c7159e773285f23311e52366c563235f8..0000000000000000000000000000000000000000
--- a/src/pages/Account/Settings/models/geographic.js
+++ /dev/null
@@ -1,65 +0,0 @@
-import { queryProvince, queryCity } from '@/services/geographic';
-
-export default {
- namespace: 'geographic',
-
- state: {
- province: [],
- city: [],
- isLoading: false,
- },
-
- effects: {
- *fetchProvince(_, { call, put }) {
- yield put({
- type: 'changeLoading',
- payload: true,
- });
- const response = yield call(queryProvince);
- yield put({
- type: 'setProvince',
- payload: response,
- });
- yield put({
- type: 'changeLoading',
- payload: false,
- });
- },
- *fetchCity({ payload }, { call, put }) {
- yield put({
- type: 'changeLoading',
- payload: true,
- });
- const response = yield call(queryCity, payload);
- yield put({
- type: 'setCity',
- payload: response,
- });
- yield put({
- type: 'changeLoading',
- payload: false,
- });
- },
- },
-
- reducers: {
- setProvince(state, action) {
- return {
- ...state,
- province: action.payload,
- };
- },
- setCity(state, action) {
- return {
- ...state,
- city: action.payload,
- };
- },
- changeLoading(state, action) {
- return {
- ...state,
- isLoading: action.payload,
- };
- },
- },
-};
diff --git a/src/pages/BasicDemo.js b/src/pages/BasicDemo.js
new file mode 100644
index 0000000000000000000000000000000000000000..045b73649c4dacb86b631f6303e85f65de5193b6
--- /dev/null
+++ b/src/pages/BasicDemo.js
@@ -0,0 +1,3 @@
+import React from 'react';
+
+export default () => hello pro!
;
diff --git a/src/pages/Dashboard/Analysis.js b/src/pages/Dashboard/Analysis.js
deleted file mode 100644
index 0b85db70bb39bb5923a209d432b9f7fe54528638..0000000000000000000000000000000000000000
--- a/src/pages/Dashboard/Analysis.js
+++ /dev/null
@@ -1,187 +0,0 @@
-import React, { Component, Suspense } from 'react';
-import { connect } from 'dva';
-import { Row, Col, Icon, Menu, Dropdown } from 'antd';
-
-import GridContent from '@/components/PageHeaderWrapper/GridContent';
-import { getTimeDistance } from '@/utils/utils';
-
-import styles from './Analysis.less';
-import PageLoading from '@/components/PageLoading';
-
-const IntroduceRow = React.lazy(() => import('./IntroduceRow'));
-const SalesCard = React.lazy(() => import('./SalesCard'));
-const TopSearch = React.lazy(() => import('./TopSearch'));
-const ProportionSales = React.lazy(() => import('./ProportionSales'));
-const OfflineData = React.lazy(() => import('./OfflineData'));
-
-@connect(({ chart, loading }) => ({
- chart,
- loading: loading.effects['chart/fetch'],
-}))
-class Analysis extends Component {
- state = {
- salesType: 'all',
- currentTabKey: '',
- rangePickerValue: getTimeDistance('year'),
- };
-
- componentDidMount() {
- const { dispatch } = this.props;
- this.reqRef = requestAnimationFrame(() => {
- dispatch({
- type: 'chart/fetch',
- });
- });
- }
-
- componentWillUnmount() {
- const { dispatch } = this.props;
- dispatch({
- type: 'chart/clear',
- });
- cancelAnimationFrame(this.reqRef);
- clearTimeout(this.timeoutId);
- }
-
- handleChangeSalesType = e => {
- this.setState({
- salesType: e.target.value,
- });
- };
-
- handleTabChange = key => {
- this.setState({
- currentTabKey: key,
- });
- };
-
- handleRangePickerChange = rangePickerValue => {
- const { dispatch } = this.props;
- this.setState({
- rangePickerValue,
- });
-
- dispatch({
- type: 'chart/fetchSalesData',
- });
- };
-
- selectDate = type => {
- const { dispatch } = this.props;
- this.setState({
- rangePickerValue: getTimeDistance(type),
- });
-
- dispatch({
- type: 'chart/fetchSalesData',
- });
- };
-
- isActive = type => {
- const { rangePickerValue } = this.state;
- const value = getTimeDistance(type);
- if (!rangePickerValue[0] || !rangePickerValue[1]) {
- return '';
- }
- if (
- rangePickerValue[0].isSame(value[0], 'day') &&
- rangePickerValue[1].isSame(value[1], 'day')
- ) {
- return styles.currentDate;
- }
- return '';
- };
-
- render() {
- const { rangePickerValue, salesType, currentTabKey } = this.state;
- const { chart, loading } = this.props;
- const {
- visitData,
- visitData2,
- salesData,
- searchData,
- offlineData,
- offlineChartData,
- salesTypeData,
- salesTypeDataOnline,
- salesTypeDataOffline,
- } = chart;
- let salesPieData;
- if (salesType === 'all') {
- salesPieData = salesTypeData;
- } else {
- salesPieData = salesType === 'online' ? salesTypeDataOnline : salesTypeDataOffline;
- }
- const menu = (
-
- );
-
- const dropdownGroup = (
-
-
-
-
-
- );
-
- const activeKey = currentTabKey || (offlineData[0] && offlineData[0].name);
-
- return (
-
- }>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default Analysis;
diff --git a/src/pages/Dashboard/Analysis.less b/src/pages/Dashboard/Analysis.less
deleted file mode 100644
index 70877d6636cb5cffdadd44e242776cbdd4fdd663..0000000000000000000000000000000000000000
--- a/src/pages/Dashboard/Analysis.less
+++ /dev/null
@@ -1,197 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.iconGroup {
- i {
- transition: color 0.32s;
- color: @text-color-secondary;
- cursor: pointer;
- margin-left: 16px;
- &:hover {
- color: @text-color;
- }
- }
-}
-
-.rankingList {
- margin: 25px 0 0;
- padding: 0;
- list-style: none;
- li {
- .clearfix();
- margin-top: 16px;
- display: flex;
- align-items: center;
- span {
- color: @text-color;
- font-size: 14px;
- line-height: 22px;
- }
- .rankingItemNumber {
- background-color: @background-color-base;
- border-radius: 20px;
- display: inline-block;
- font-size: 12px;
- font-weight: 600;
- margin-right: 16px;
- height: 20px;
- line-height: 20px;
- width: 20px;
- text-align: center;
- margin-top: 1.5px;
- &.active {
- background-color: #314659;
- color: #fff;
- }
- }
- .rankingItemTitle {
- flex: 1;
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
- margin-right: 8px;
- }
- }
-}
-
-.salesExtra {
- display: inline-block;
- margin-right: 24px;
- a {
- color: @text-color;
- margin-left: 24px;
- &:hover {
- color: @primary-color;
- }
- &.currentDate {
- color: @primary-color;
- }
- }
-}
-
-.salesCard {
- .salesBar {
- padding: 0 0 32px 32px;
- }
- .salesRank {
- padding: 0 32px 32px 72px;
- }
- :global {
- .ant-tabs-bar {
- padding-left: 16px;
- .ant-tabs-nav .ant-tabs-tab {
- padding-top: 16px;
- padding-bottom: 14px;
- line-height: 24px;
- }
- }
- .ant-tabs-extra-content {
- padding-right: 24px;
- line-height: 55px;
- }
- .ant-card-head {
- position: relative;
- }
- .ant-card-head-title {
- align-items: normal;
- }
- }
-}
-
-.salesCardExtra {
- height: inherit;
-}
-
-.salesTypeRadio {
- position: absolute;
- right: 54px;
- bottom: 12px;
-}
-
-.offlineCard {
- :global {
- .ant-tabs-ink-bar {
- bottom: auto;
- }
- .ant-tabs-bar {
- border-bottom: none;
- }
- .ant-tabs-nav-container-scrolling {
- padding-left: 40px;
- padding-right: 40px;
- }
- .ant-tabs-tab-prev-icon:before {
- position: relative;
- left: 6px;
- }
- .ant-tabs-tab-next-icon:before {
- position: relative;
- right: 6px;
- }
- .ant-tabs-tab-active h4 {
- color: @primary-color;
- }
- }
-}
-
-.twoColLayout {
- .salesCard {
- height: calc(100% - 24px);
- }
- div[class^='ant-col']:last-child {
- right: 0\9;
- height: 100%\9;
- position: absolute\9;
- }
- :global {
- .ant-row {
- display: flex;
- display: block\9;
- flex-flow: row wrap;
- position: relative\9;
- }
- }
-}
-
-.trendText {
- margin-left: 8px;
- color: @heading-color;
-}
-
-@media screen and (max-width: @screen-lg) {
- .salesExtra {
- display: none;
- }
-
- .rankingList {
- li {
- span:first-child {
- margin-right: 8px;
- }
- }
- }
-}
-
-@media screen and (max-width: @screen-md) {
- .rankingTitle {
- margin-top: 16px;
- }
-
- .salesCard .salesBar {
- padding: 16px;
- }
-}
-
-@media screen and (max-width: @screen-sm) {
- .salesExtraWrap {
- display: none;
- }
-
- .salesCard {
- :global {
- .ant-tabs-content {
- padding-top: 30px;
- }
- }
- }
-}
diff --git a/src/pages/Dashboard/IntroduceRow.js b/src/pages/Dashboard/IntroduceRow.js
deleted file mode 100755
index 8e9020e79bacc6dfbed4c43bb34ff29eea1e57f1..0000000000000000000000000000000000000000
--- a/src/pages/Dashboard/IntroduceRow.js
+++ /dev/null
@@ -1,144 +0,0 @@
-import React, { memo } from 'react';
-import { Row, Col, Icon, Tooltip } from 'antd';
-import { FormattedMessage } from 'umi/locale';
-import styles from './Analysis.less';
-import { ChartCard, MiniArea, MiniBar, MiniProgress, Field } from 'ant-design-pro/lib/Charts';
-import Trend from 'ant-design-pro/lib/Trend';
-import numeral from 'numeral';
-import Yuan from '@/utils/Yuan';
-
-const topColResponsiveProps = {
- xs: 24,
- sm: 12,
- md: 12,
- lg: 12,
- xl: 6,
- style: { marginBottom: 24 },
-};
-
-const IntroduceRow = memo(({ loading, visitData }) => (
-
-
- }
- action={
- }
- >
-
-
- }
- loading={loading}
- total={() => 126560}
- footer={
- }
- value={`¥${numeral(12423).format('0,0')}`}
- />
- }
- contentHeight={46}
- >
-
-
- 12%
-
-
-
- 11%
-
-
-
-
-
- }
- action={
- }
- >
-
-
- }
- total={numeral(8846).format('0,0')}
- footer={
- }
- value={numeral(1234).format('0,0')}
- />
- }
- contentHeight={46}
- >
-
-
-
-
- }
- action={
- }
- >
-
-
- }
- total={numeral(6560).format('0,0')}
- footer={
-
- }
- value="60%"
- />
- }
- contentHeight={46}
- >
-
-
-
-
-
- }
- action={
- }
- >
-
-
- }
- total="78%"
- footer={
-
-
-
- 12%
-
-
-
- 11%
-
-
- }
- contentHeight={46}
- >
-
-
-
-
-));
-
-export default IntroduceRow;
diff --git a/src/pages/Dashboard/Monitor.js b/src/pages/Dashboard/Monitor.js
deleted file mode 100644
index 536c90ccf5d82801212e84b0fa7628cb475ea8ce..0000000000000000000000000000000000000000
--- a/src/pages/Dashboard/Monitor.js
+++ /dev/null
@@ -1,245 +0,0 @@
-import React, { PureComponent } from 'react';
-import { connect } from 'dva';
-import { formatMessage, FormattedMessage } from 'umi/locale';
-import { Row, Col, Card, Tooltip } from 'antd';
-import { Pie, WaterWave, Gauge, TagCloud } from 'ant-design-pro/lib/Charts';
-import NumberInfo from 'ant-design-pro/lib/NumberInfo';
-import CountDown from 'ant-design-pro/lib/CountDown';
-import ActiveChart from '@/components/ActiveChart';
-import numeral from 'numeral';
-import GridContent from '@/components/PageHeaderWrapper/GridContent';
-
-import Authorized from '@/utils/Authorized';
-import styles from './Monitor.less';
-
-const { Secured } = Authorized;
-
-const targetTime = new Date().getTime() + 3900000;
-
-// use permission as a parameter
-const havePermissionAsync = new Promise(resolve => {
- // Call resolve on behalf of passed
- setTimeout(() => resolve(), 300);
-});
-
-@Secured(havePermissionAsync)
-@connect(({ monitor, loading }) => ({
- monitor,
- loading: loading.models.monitor,
-}))
-class Monitor extends PureComponent {
- componentDidMount() {
- const { dispatch } = this.props;
- dispatch({
- type: 'monitor/fetchTags',
- });
- }
-
- render() {
- const { monitor, loading } = this.props;
- const { tags } = monitor;
-
- return (
-
-
-
-
- }
- bordered={false}
- >
-
-
-
- }
- suffix="元"
- total={numeral(124543233).format('0,0')}
- />
-
-
-
- }
- total="92%"
- />
-
-
-
- }
- total={}
- />
-
-
-
- }
- suffix="元"
- total={numeral(234).format('0,0')}
- />
-
-
-
-
- }
- >
-

-
-
-
-
-
-
- }
- style={{ marginBottom: 24 }}
- bordered={false}
- >
-
-
- }
- style={{ marginBottom: 24 }}
- bodyStyle={{ textAlign: 'center' }}
- bordered={false}
- >
-
-
-
-
-
-
-
- }
- bordered={false}
- className={styles.pieCard}
- >
-
-
-
- }
- total="28%"
- height={128}
- lineWidth={2}
- />
-
-
-
- }
- total="22%"
- height={128}
- lineWidth={2}
- />
-
-
-
- }
- total="32%"
- height={128}
- lineWidth={2}
- />
-
-
-
-
-
-
- }
- loading={loading}
- bordered={false}
- bodyStyle={{ overflow: 'hidden' }}
- >
-
-
-
-
-
- }
- bodyStyle={{ textAlign: 'center', fontSize: 0 }}
- bordered={false}
- >
-
- }
- percent={34}
- />
-
-
-
-
- );
- }
-}
-
-export default Monitor;
diff --git a/src/pages/Dashboard/Monitor.less b/src/pages/Dashboard/Monitor.less
deleted file mode 100644
index ca41f33e3cc29540c6c4dc72f483eedc2860cb53..0000000000000000000000000000000000000000
--- a/src/pages/Dashboard/Monitor.less
+++ /dev/null
@@ -1,23 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.mapChart {
- padding-top: 24px;
- height: 452px;
- text-align: center;
- img {
- display: inline-block;
- max-width: 100%;
- max-height: 437px;
- }
-}
-
-.pieCard :global(.pie-stat) {
- font-size: 24px !important;
-}
-
-@media screen and (max-width: @screen-lg) {
- .mapChart {
- height: auto;
- }
-}
diff --git a/src/pages/Dashboard/OfflineData.js b/src/pages/Dashboard/OfflineData.js
deleted file mode 100755
index e25210069733272de497cfaddcbe1154c777bb74..0000000000000000000000000000000000000000
--- a/src/pages/Dashboard/OfflineData.js
+++ /dev/null
@@ -1,65 +0,0 @@
-import React, { memo } from 'react';
-import { Card, Tabs, Row, Col } from 'antd';
-import { formatMessage, FormattedMessage } from 'umi/locale';
-import { TimelineChart, Pie } from 'ant-design-pro/lib/Charts';
-import NumberInfo from 'ant-design-pro/lib/NumberInfo';
-import styles from './Analysis.less';
-
-const CustomTab = ({ data, currentTabKey: currentKey }) => (
-
-
-
- }
- gap={2}
- total={`${data.cvr * 100}%`}
- theme={currentKey !== data.name && 'light'}
- />
-
-
-
-
-
-);
-
-const { TabPane } = Tabs;
-
-const OfflineData = memo(
- ({ activeKey, loading, offlineData, offlineChartData, handleTabChange }) => (
-
-
- {offlineData.map(shop => (
- } key={shop.name}>
-
-
-
-
- ))}
-
-
- )
-);
-
-export default OfflineData;
diff --git a/src/pages/Dashboard/ProportionSales.js b/src/pages/Dashboard/ProportionSales.js
deleted file mode 100755
index 47b011edb6b98a68c8009000dd98eef34d790f9f..0000000000000000000000000000000000000000
--- a/src/pages/Dashboard/ProportionSales.js
+++ /dev/null
@@ -1,58 +0,0 @@
-import React, { memo } from 'react';
-import { Card, Radio } from 'antd';
-import { FormattedMessage } from 'umi/locale';
-import styles from './Analysis.less';
-import { Pie } from 'ant-design-pro/lib/Charts';
-import Yuan from '@/utils/Yuan';
-
-const ProportionSales = memo(
- ({ dropdownGroup, salesType, loading, salesPieData, handleChangeSalesType }) => (
-
- }
- bodyStyle={{ padding: 24 }}
- extra={
-
- {dropdownGroup}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- style={{ marginTop: 24 }}
- >
-
-
-
- }
- total={() => {salesPieData.reduce((pre, now) => now.y + pre, 0)}}
- data={salesPieData}
- valueFormat={value => {value}}
- height={270}
- lineWidth={4}
- style={{ padding: '8px 0' }}
- />
-
- )
-);
-
-export default ProportionSales;
diff --git a/src/pages/Dashboard/SalesCard.js b/src/pages/Dashboard/SalesCard.js
deleted file mode 100755
index 453a4e17cc1999cb6932c69e1b9d1499e96464c1..0000000000000000000000000000000000000000
--- a/src/pages/Dashboard/SalesCard.js
+++ /dev/null
@@ -1,150 +0,0 @@
-import React, { memo } from 'react';
-import { Row, Col, Card, Tabs, DatePicker } from 'antd';
-import { FormattedMessage, formatMessage } from 'umi/locale';
-import numeral from 'numeral';
-import { Bar } from 'ant-design-pro/lib/Charts';
-import styles from './Analysis.less';
-
-const { RangePicker } = DatePicker;
-const { TabPane } = Tabs;
-
-const rankingListData = [];
-for (let i = 0; i < 7; i += 1) {
- rankingListData.push({
- title: formatMessage({ id: 'app.analysis.test' }, { no: i }),
- total: 323234,
- });
-}
-
-const SalesCard = memo(
- ({ rangePickerValue, salesData, isActive, handleRangePickerChange, loading, selectDate }) => (
-
-
- }
- size="large"
- tabBarStyle={{ marginBottom: 24 }}
- >
- }
- key="sales"
- >
-
-
-
-
- }
- data={salesData}
- />
-
-
-
-
-
-
-
-
- {rankingListData.map((item, i) => (
- -
-
- {i + 1}
-
-
- {item.title}
-
-
- {numeral(item.total).format('0,0')}
-
-
- ))}
-
-
-
-
-
- }
- key="views"
- >
-
-
-
-
- }
- data={salesData}
- />
-
-
-
-
-
-
-
-
- {rankingListData.map((item, i) => (
- -
-
- {i + 1}
-
-
- {item.title}
-
- {numeral(item.total).format('0,0')}
-
- ))}
-
-
-
-
-
-
-
-
- )
-);
-
-export default SalesCard;
diff --git a/src/pages/Dashboard/TopSearch.js b/src/pages/Dashboard/TopSearch.js
deleted file mode 100755
index 5ae05a12e26943c8a07799839e4cb3f0aa3f56ad..0000000000000000000000000000000000000000
--- a/src/pages/Dashboard/TopSearch.js
+++ /dev/null
@@ -1,111 +0,0 @@
-import React, { memo } from 'react';
-import { Row, Col, Table, Tooltip, Card, Icon } from 'antd';
-import { FormattedMessage } from 'umi/locale';
-import Trend from 'ant-design-pro/lib/Trend';
-import numeral from 'numeral';
-import NumberInfo from 'ant-design-pro/lib/NumberInfo';
-import { MiniArea } from 'ant-design-pro/lib/Charts';
-import styles from './Analysis.less';
-
-const columns = [
- {
- title: ,
- dataIndex: 'index',
- key: 'index',
- },
- {
- title: (
-
- ),
- dataIndex: 'keyword',
- key: 'keyword',
- render: text => {text},
- },
- {
- title: ,
- dataIndex: 'count',
- key: 'count',
- sorter: (a, b) => a.count - b.count,
- className: styles.alignRight,
- },
- {
- title: ,
- dataIndex: 'range',
- key: 'range',
- sorter: (a, b) => a.range - b.range,
- render: (text, record) => (
-
- {text}%
-
- ),
- align: 'right',
- },
-];
-
-const TopSearch = memo(({ loading, visitData2, searchData, dropdownGroup }) => (
-
- }
- extra={dropdownGroup}
- style={{ marginTop: 24 }}
- >
-
-
-
-
- }
- >
-
-
-
- }
- gap={8}
- total={numeral(12321).format('0,0')}
- status="up"
- subTotal={17.1}
- />
-
-
-
-
-
- }
- >
-
-
-
- }
- total={2.7}
- status="down"
- subTotal={26.2}
- gap={8}
- />
-
-
-
- record.index}
- size="small"
- columns={columns}
- dataSource={searchData}
- pagination={{
- style: { marginBottom: 0 },
- pageSize: 5,
- }}
- />
-
-));
-
-export default TopSearch;
diff --git a/src/pages/Dashboard/Workplace.js b/src/pages/Dashboard/Workplace.js
deleted file mode 100644
index 3a6e260740d7ae0302a56c98b2c5dc741b580085..0000000000000000000000000000000000000000
--- a/src/pages/Dashboard/Workplace.js
+++ /dev/null
@@ -1,256 +0,0 @@
-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 { Radar } from 'ant-design-pro/lib/Charts';
-import EditableLinkGroup from '@/components/EditableLinkGroup';
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-
-import styles from './Workplace.less';
-
-const links = [
- {
- title: '操作一',
- href: '',
- },
- {
- title: '操作二',
- href: '',
- },
- {
- title: '操作三',
- href: '',
- },
- {
- title: '操作四',
- href: '',
- },
- {
- title: '操作五',
- href: '',
- },
- {
- title: '操作六',
- href: '',
- },
-];
-
-@connect(({ user, project, activities, chart, loading }) => ({
- currentUser: user.currentUser,
- project,
- activities,
- chart,
- 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',
- });
- dispatch({
- type: 'chart/fetch',
- });
- }
-
- componentWillUnmount() {
- const { dispatch } = this.props;
- dispatch({
- type: 'chart/clear',
- });
- }
-
- 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,
- chart: { radarData },
- } = this.props;
-
- const pageHeaderContent =
- currentUser && Object.keys(currentUser).length ? (
-
-
-
-
- 早安,
- {currentUser.name}
- ,祝你开心每一天!
-
-
- {currentUser.title} |{currentUser.group}
-
-
-
- ) : null;
-
- const extraContent = (
-
- );
-
- return (
-
-
-
- 全部项目}
- loading={projectLoading}
- bodyStyle={{ padding: 0 }}
- >
- {notice.map(item => (
-
-
-
-
- {item.title}
-
- }
- description={item.description}
- />
-
- {item.member || ''}
- {item.updatedAt && (
-
- {moment(item.updatedAt).fromNow()}
-
- )}
-
-
-
- ))}
-
-
-
- {this.renderActivities()}
-
-
-
-
-
- {}} links={links} linkElement={Link} />
-
-
-
-
-
-
-
-
-
- {notice.map(item => (
-
-
-
- {item.member}
-
-
- ))}
-
-
-
-
-
-
- );
- }
-}
-
-export default Workplace;
diff --git a/src/pages/Dashboard/Workplace.less b/src/pages/Dashboard/Workplace.less
deleted file mode 100644
index 038017112f79467c737c87da0f83f203caffb63f..0000000000000000000000000000000000000000
--- a/src/pages/Dashboard/Workplace.less
+++ /dev/null
@@ -1,227 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.activitiesList {
- padding: 0 24px 8px 24px;
- .username {
- color: @text-color;
- }
- .event {
- font-weight: normal;
- }
-}
-
-.pageHeaderContent {
- display: flex;
- .avatar {
- flex: 0 1 72px;
- margin-bottom: 8px;
- & > span {
- border-radius: 72px;
- display: block;
- width: 72px;
- height: 72px;
- }
- }
- .content {
- position: relative;
- top: 4px;
- margin-left: 24px;
- flex: 1 1 auto;
- color: @text-color-secondary;
- line-height: 22px;
- .contentTitle {
- font-size: 20px;
- line-height: 28px;
- font-weight: 500;
- color: @heading-color;
- margin-bottom: 12px;
- }
- }
-}
-
-.extraContent {
- .clearfix();
- float: right;
- white-space: nowrap;
- .statItem {
- padding: 0 32px;
- position: relative;
- display: inline-block;
- > p:first-child {
- color: @text-color-secondary;
- font-size: @font-size-base;
- line-height: 22px;
- margin-bottom: 4px;
- }
- > p {
- color: @heading-color;
- font-size: 30px;
- line-height: 38px;
- margin: 0;
- > span {
- color: @text-color-secondary;
- font-size: 20px;
- }
- }
- &:after {
- background-color: @border-color-split;
- position: absolute;
- top: 8px;
- right: 0;
- width: 1px;
- height: 40px;
- content: '';
- }
- &:last-child {
- padding-right: 0;
- &:after {
- display: none;
- }
- }
- }
-}
-
-.members {
- a {
- display: block;
- margin: 12px 0;
- height: 24px;
- color: @text-color;
- transition: all 0.3s;
- .textOverflow();
- .member {
- font-size: @font-size-base;
- line-height: 24px;
- vertical-align: top;
- margin-left: 12px;
- }
- &:hover {
- color: @primary-color;
- }
- }
-}
-
-.projectList {
- :global {
- .ant-card-meta-description {
- color: @text-color-secondary;
- height: 44px;
- line-height: 22px;
- overflow: hidden;
- }
- }
- .cardTitle {
- font-size: 0;
- a {
- color: @heading-color;
- margin-left: 12px;
- line-height: 24px;
- height: 24px;
- display: inline-block;
- vertical-align: top;
- font-size: @font-size-base;
- &:hover {
- color: @primary-color;
- }
- }
- }
- .projectGrid {
- width: 33.33%;
- }
- .projectItemContent {
- display: flex;
- margin-top: 8px;
- overflow: hidden;
- font-size: 12px;
- height: 20px;
- line-height: 20px;
- .textOverflow();
- a {
- color: @text-color-secondary;
- display: inline-block;
- flex: 1 1 0;
- .textOverflow();
- &:hover {
- color: @primary-color;
- }
- }
- .datetime {
- color: @disabled-color;
- flex: 0 0 auto;
- float: right;
- }
- }
-}
-
-.datetime {
- color: @disabled-color;
-}
-
-@media screen and (max-width: @screen-xl) and (min-width: @screen-lg) {
- .activeCard {
- margin-bottom: 24px;
- }
- .members {
- margin-bottom: 0;
- }
- .extraContent {
- margin-left: -44px;
- .statItem {
- padding: 0 16px;
- }
- }
-}
-
-@media screen and (max-width: @screen-lg) {
- .activeCard {
- margin-bottom: 24px;
- }
- .members {
- margin-bottom: 0;
- }
- .extraContent {
- float: none;
- margin-right: 0;
- .statItem {
- padding: 0 16px;
- text-align: left;
- &:after {
- display: none;
- }
- }
- }
-}
-
-@media screen and (max-width: @screen-md) {
- .extraContent {
- margin-left: -16px;
- }
- .projectList {
- .projectGrid {
- width: 50%;
- }
- }
-}
-
-@media screen and (max-width: @screen-sm) {
- .pageHeaderContent {
- display: block;
- .content {
- margin-left: 0;
- }
- }
- .extraContent {
- .statItem {
- float: none;
- }
- }
-}
-
-@media screen and (max-width: @screen-xs) {
- .projectList {
- .projectGrid {
- width: 100%;
- }
- }
-}
diff --git a/src/pages/Dashboard/models/activities.js b/src/pages/Dashboard/models/activities.js
deleted file mode 100644
index 4e0a11e277f8b6e881da6eba44f884a04ce60aa9..0000000000000000000000000000000000000000
--- a/src/pages/Dashboard/models/activities.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import { queryActivities } from '@/services/api';
-
-export default {
- namespace: 'activities',
-
- state: {
- list: [],
- },
-
- effects: {
- *fetchList(_, { call, put }) {
- const response = yield call(queryActivities);
- yield put({
- type: 'saveList',
- payload: Array.isArray(response) ? response : [],
- });
- },
- },
-
- reducers: {
- saveList(state, action) {
- return {
- ...state,
- list: action.payload,
- };
- },
- },
-};
diff --git a/src/pages/Dashboard/models/chart.js b/src/pages/Dashboard/models/chart.js
deleted file mode 100644
index 8dfe4a93f5b9b1efbc957fc7034e9949b67f1d29..0000000000000000000000000000000000000000
--- a/src/pages/Dashboard/models/chart.js
+++ /dev/null
@@ -1,61 +0,0 @@
-import { fakeChartData } from '@/services/api';
-
-export default {
- namespace: 'chart',
-
- state: {
- visitData: [],
- visitData2: [],
- salesData: [],
- searchData: [],
- offlineData: [],
- offlineChartData: [],
- salesTypeData: [],
- salesTypeDataOnline: [],
- salesTypeDataOffline: [],
- radarData: [],
- loading: false,
- },
-
- effects: {
- *fetch(_, { call, put }) {
- const response = yield call(fakeChartData);
- yield put({
- type: 'save',
- payload: response,
- });
- },
- *fetchSalesData(_, { call, put }) {
- const response = yield call(fakeChartData);
- yield put({
- type: 'save',
- payload: {
- salesData: response.salesData,
- },
- });
- },
- },
-
- reducers: {
- save(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- },
- clear() {
- return {
- visitData: [],
- visitData2: [],
- salesData: [],
- searchData: [],
- offlineData: [],
- offlineChartData: [],
- salesTypeData: [],
- salesTypeDataOnline: [],
- salesTypeDataOffline: [],
- radarData: [],
- };
- },
- },
-};
diff --git a/src/pages/Dashboard/models/monitor.js b/src/pages/Dashboard/models/monitor.js
deleted file mode 100644
index e3e832ff8bc79e34430a69e671d1017023c317fa..0000000000000000000000000000000000000000
--- a/src/pages/Dashboard/models/monitor.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import { queryTags } from '@/services/api';
-
-export default {
- namespace: 'monitor',
-
- state: {
- tags: [],
- },
-
- effects: {
- *fetchTags(_, { call, put }) {
- const response = yield call(queryTags);
- yield put({
- type: 'saveTags',
- payload: response.list,
- });
- },
- },
-
- reducers: {
- saveTags(state, action) {
- return {
- ...state,
- tags: action.payload,
- };
- },
- },
-};
diff --git a/src/pages/Exception/403.js b/src/pages/Exception/403.js
deleted file mode 100644
index fd78e0ce1a40e5f144bc1f85e951439ac359c947..0000000000000000000000000000000000000000
--- a/src/pages/Exception/403.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import React from 'react';
-import { formatMessage } from 'umi/locale';
-import Link from 'umi/link';
-import Exception from 'ant-design-pro/lib/Exception';
-
-const Exception403 = () => (
-
-);
-
-export default Exception403;
diff --git a/src/pages/Exception/404.js b/src/pages/Exception/404.js
deleted file mode 100644
index 6cf91268751594708c61e526d498c4e2f5fb83ff..0000000000000000000000000000000000000000
--- a/src/pages/Exception/404.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import React from 'react';
-import { formatMessage } from 'umi/locale';
-import Link from 'umi/link';
-import Exception from 'ant-design-pro/lib/Exception';
-
-const Exception404 = () => (
-
-);
-
-export default Exception404;
diff --git a/src/pages/Exception/500.js b/src/pages/Exception/500.js
deleted file mode 100644
index 24fbc3a28a3f5038cd8d21e78ca465f5a33f8d83..0000000000000000000000000000000000000000
--- a/src/pages/Exception/500.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import React from 'react';
-import { formatMessage } from 'umi/locale';
-import Link from 'umi/link';
-import Exception from 'ant-design-pro/lib/Exception';
-
-const Exception500 = () => (
-
-);
-
-export default Exception500;
diff --git a/src/pages/Exception/TriggerException.js b/src/pages/Exception/TriggerException.js
deleted file mode 100644
index 15ace510f674c22a9ab0b35cc624f53ce0ff676b..0000000000000000000000000000000000000000
--- a/src/pages/Exception/TriggerException.js
+++ /dev/null
@@ -1,50 +0,0 @@
-import React, { PureComponent } from 'react';
-import { Button, Spin, Card } from 'antd';
-import { connect } from 'dva';
-import styles from './style.less';
-
-@connect(state => ({
- isloading: state.error.isloading,
-}))
-class TriggerException extends PureComponent {
- state = {
- isloading: false,
- };
-
- triggerError = code => {
- this.setState({
- isloading: true,
- });
- const { dispatch } = this.props;
- dispatch({
- type: 'error/query',
- payload: {
- code,
- },
- });
- };
-
- render() {
- const { isloading } = this.state;
- return (
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default TriggerException;
diff --git a/src/pages/Exception/models/error.js b/src/pages/Exception/models/error.js
deleted file mode 100644
index 1bfd9392139bb91e8a986b0c5878f6cea5d9c45f..0000000000000000000000000000000000000000
--- a/src/pages/Exception/models/error.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import queryError from '@/services/error';
-
-export default {
- namespace: 'error',
-
- state: {
- error: '',
- isloading: false,
- },
-
- effects: {
- *query({ payload }, { call, put }) {
- yield call(queryError, payload.code);
- yield put({
- type: 'trigger',
- payload: payload.code,
- });
- },
- },
-
- reducers: {
- trigger(state, action) {
- return {
- error: action.payload,
- };
- },
- },
-};
diff --git a/src/pages/Exception/style.less b/src/pages/Exception/style.less
deleted file mode 100644
index 91ec7dcf525f63df9853a9a005dcc476bc7318a3..0000000000000000000000000000000000000000
--- a/src/pages/Exception/style.less
+++ /dev/null
@@ -1,7 +0,0 @@
-.trigger {
- background: 'red';
- :global(.ant-btn) {
- margin-right: 8px;
- margin-bottom: 12px;
- }
-}
diff --git a/src/pages/Forms/AdvancedForm.js b/src/pages/Forms/AdvancedForm.js
deleted file mode 100644
index c1f8976fbe0ae0d03b834e86153f5e3e8586ace9..0000000000000000000000000000000000000000
--- a/src/pages/Forms/AdvancedForm.js
+++ /dev/null
@@ -1,323 +0,0 @@
-import React, { PureComponent } from 'react';
-import {
- Card,
- Button,
- Form,
- Icon,
- Col,
- Row,
- DatePicker,
- TimePicker,
- Input,
- Select,
- Popover,
-} from 'antd';
-import { connect } from 'dva';
-import FooterToolbar from 'ant-design-pro/lib/FooterToolbar';
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-import TableForm from './TableForm';
-import styles from './style.less';
-
-const { Option } = Select;
-const { RangePicker } = DatePicker;
-
-const fieldLabels = {
- name: '仓库名',
- url: '仓库域名',
- owner: '仓库管理员',
- approver: '审批人',
- dateRange: '生效日期',
- type: '仓库类型',
- name2: '任务名',
- url2: '任务描述',
- owner2: '执行人',
- approver2: '责任人',
- dateRange2: '生效日期',
- type2: '任务类型',
-};
-
-const tableData = [
- {
- key: '1',
- workId: '00001',
- name: 'John Brown',
- department: 'New York No. 1 Lake Park',
- },
- {
- key: '2',
- workId: '00002',
- name: 'Jim Green',
- department: 'London No. 1 Lake Park',
- },
- {
- key: '3',
- workId: '00003',
- name: 'Joe Black',
- department: 'Sidney No. 1 Lake Park',
- },
-];
-
-@connect(({ loading }) => ({
- submitting: loading.effects['form/submitAdvancedForm'],
-}))
-@Form.create()
-class AdvancedForm extends PureComponent {
- state = {
- width: '100%',
- };
-
- componentDidMount() {
- window.addEventListener('resize', this.resizeFooterToolbar, { passive: true });
- }
-
- componentWillUnmount() {
- window.removeEventListener('resize', this.resizeFooterToolbar);
- }
-
- getErrorInfo = () => {
- const {
- form: { getFieldsError },
- } = this.props;
- const errors = getFieldsError();
- const errorCount = Object.keys(errors).filter(key => errors[key]).length;
- if (!errors || errorCount === 0) {
- return null;
- }
- const scrollToField = fieldKey => {
- const labelNode = document.querySelector(`label[for="${fieldKey}"]`);
- if (labelNode) {
- labelNode.scrollIntoView(true);
- }
- };
- const errorList = Object.keys(errors).map(key => {
- if (!errors[key]) {
- return null;
- }
- return (
- scrollToField(key)}>
-
- {errors[key][0]}
- {fieldLabels[key]}
-
- );
- });
- return (
-
- trigger.parentNode}
- >
-
-
- {errorCount}
-
- );
- };
-
- resizeFooterToolbar = () => {
- requestAnimationFrame(() => {
- const sider = document.querySelectorAll('.ant-layout-sider')[0];
- if (sider) {
- const width = `calc(100% - ${sider.style.width})`;
- const { width: stateWidth } = this.state;
- if (stateWidth !== width) {
- this.setState({ width });
- }
- }
- });
- };
-
- validate = () => {
- const {
- form: { validateFieldsAndScroll },
- dispatch,
- } = this.props;
- validateFieldsAndScroll((error, values) => {
- if (!error) {
- // submit the values
- dispatch({
- type: 'form/submitAdvancedForm',
- payload: values,
- });
- }
- });
- };
-
- render() {
- const {
- form: { getFieldDecorator },
- submitting,
- } = this.props;
- const { width } = this.state;
-
- return (
-
-
-
-
-
-
-
-
- {getFieldDecorator('members', {
- initialValue: tableData,
- })()}
-
-
- {this.getErrorInfo()}
-
-
-
- );
- }
-}
-
-export default AdvancedForm;
diff --git a/src/pages/Forms/BasicForm.js b/src/pages/Forms/BasicForm.js
deleted file mode 100644
index 55833150a1ed63d053e894968d35ac548c3129ae..0000000000000000000000000000000000000000
--- a/src/pages/Forms/BasicForm.js
+++ /dev/null
@@ -1,247 +0,0 @@
-import React, { PureComponent } from 'react';
-import { connect } from 'dva';
-import { formatMessage, FormattedMessage } from 'umi/locale';
-import {
- Form,
- Input,
- DatePicker,
- Select,
- Button,
- Card,
- InputNumber,
- Radio,
- Icon,
- Tooltip,
-} from 'antd';
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-import styles from './style.less';
-
-const FormItem = Form.Item;
-const { Option } = Select;
-const { RangePicker } = DatePicker;
-const { TextArea } = Input;
-
-@connect(({ loading }) => ({
- submitting: loading.effects['form/submitRegularForm'],
-}))
-@Form.create()
-class BasicForms extends PureComponent {
- handleSubmit = e => {
- const { dispatch, form } = this.props;
- e.preventDefault();
- form.validateFieldsAndScroll((err, values) => {
- if (!err) {
- dispatch({
- type: 'form/submitRegularForm',
- payload: values,
- });
- }
- });
- };
-
- render() {
- const { submitting } = this.props;
- const {
- form: { getFieldDecorator, getFieldValue },
- } = this.props;
-
- const formItemLayout = {
- labelCol: {
- xs: { span: 24 },
- sm: { span: 7 },
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 12 },
- md: { span: 10 },
- },
- };
-
- const submitFormLayout = {
- wrapperCol: {
- xs: { span: 24, offset: 0 },
- sm: { span: 10, offset: 7 },
- },
- };
-
- return (
- }
- content={}
- >
-
-
-
-
- );
- }
-}
-
-export default BasicForms;
diff --git a/src/pages/Forms/StepForm/Step1.js b/src/pages/Forms/StepForm/Step1.js
deleted file mode 100644
index a62e294192b1cfcc74ef3ee5f817d005d05f22a2..0000000000000000000000000000000000000000
--- a/src/pages/Forms/StepForm/Step1.js
+++ /dev/null
@@ -1,115 +0,0 @@
-import React, { Fragment } from 'react';
-import { connect } from 'dva';
-import { Form, Input, Button, Select, Divider } from 'antd';
-import router from 'umi/router';
-import styles from './style.less';
-
-const { Option } = Select;
-
-const formItemLayout = {
- labelCol: {
- span: 5,
- },
- wrapperCol: {
- span: 19,
- },
-};
-
-@connect(({ form }) => ({
- data: form.step,
-}))
-@Form.create()
-class Step1 extends React.PureComponent {
- render() {
- const { form, dispatch, data } = this.props;
- const { getFieldDecorator, validateFields } = form;
- const onValidateForm = () => {
- validateFields((err, values) => {
- if (!err) {
- dispatch({
- type: 'form/saveStepFormData',
- payload: values,
- });
- router.push('/form/step-form/confirm');
- }
- });
- };
- return (
-
-
- {getFieldDecorator('payAccount', {
- initialValue: data.payAccount,
- rules: [{ required: true, message: '请选择付款账户' }],
- })(
-
- )}
-
-
-
-
- {getFieldDecorator('receiverAccount', {
- initialValue: data.receiverAccount,
- rules: [
- { required: true, message: '请输入收款人账户' },
- { type: 'email', message: '账户名应为邮箱格式' },
- ],
- })()}
-
-
-
- {getFieldDecorator('receiverName', {
- initialValue: data.receiverName,
- rules: [{ required: true, message: '请输入收款人姓名' }],
- })()}
-
-
- {getFieldDecorator('amount', {
- initialValue: data.amount,
- rules: [
- { required: true, message: '请输入转账金额' },
- {
- pattern: /^(\d+)((?:\.\d+)?)$/,
- message: '请输入合法金额数字',
- },
- ],
- })()}
-
-
-
-
-
-
-
-
说明
-
转账到支付宝账户
-
- 如果需要,这里可以放一些关于产品的常见问题说明。如果需要,这里可以放一些关于产品的常见问题说明。如果需要,这里可以放一些关于产品的常见问题说明。
-
-
转账到银行卡
-
- 如果需要,这里可以放一些关于产品的常见问题说明。如果需要,这里可以放一些关于产品的常见问题说明。如果需要,这里可以放一些关于产品的常见问题说明。
-
-
-
- );
- }
-}
-
-export default Step1;
diff --git a/src/pages/Forms/StepForm/Step2.js b/src/pages/Forms/StepForm/Step2.js
deleted file mode 100644
index 3e3b05bf2fe769c3994829ffff059844cb0f7146..0000000000000000000000000000000000000000
--- a/src/pages/Forms/StepForm/Step2.js
+++ /dev/null
@@ -1,99 +0,0 @@
-import React from 'react';
-import { connect } from 'dva';
-import { Form, Input, Button, Alert, Divider } from 'antd';
-import router from 'umi/router';
-import { digitUppercase } from '@/utils/utils';
-import styles from './style.less';
-
-const formItemLayout = {
- labelCol: {
- span: 5,
- },
- wrapperCol: {
- span: 19,
- },
-};
-
-@connect(({ form, loading }) => ({
- submitting: loading.effects['form/submitStepForm'],
- data: form.step,
-}))
-@Form.create()
-class Step2 extends React.PureComponent {
- render() {
- const { form, data, dispatch, submitting } = this.props;
- const { getFieldDecorator, validateFields } = form;
- const onPrev = () => {
- router.push('/form/step-form/info');
- };
- const onValidateForm = e => {
- e.preventDefault();
- validateFields((err, values) => {
- if (!err) {
- dispatch({
- type: 'form/submitStepForm',
- payload: {
- ...data,
- ...values,
- },
- });
- }
- });
- };
- return (
-
- {data.payAccount}
-
-
- {data.receiverAccount}
-
-
- {data.receiverName}
-
-
- {data.amount}
- ({digitUppercase(data.amount)})
-
-
-
- {getFieldDecorator('password', {
- initialValue: '123456',
- rules: [
- {
- required: true,
- message: '需要支付密码才能进行支付',
- },
- ],
- })()}
-
-
-
-
-
-
- );
- }
-}
-
-export default Step2;
diff --git a/src/pages/Forms/StepForm/Step3.js b/src/pages/Forms/StepForm/Step3.js
deleted file mode 100644
index 76e910e7c548d42a402b146323ec79532f3c62e4..0000000000000000000000000000000000000000
--- a/src/pages/Forms/StepForm/Step3.js
+++ /dev/null
@@ -1,74 +0,0 @@
-import React, { Fragment } from 'react';
-import { connect } from 'dva';
-import { Button, Row, Col } from 'antd';
-import router from 'umi/router';
-import Result from 'ant-design-pro/lib/Result';
-import styles from './style.less';
-
-@connect(({ form }) => ({
- data: form.step,
-}))
-class Step3 extends React.PureComponent {
- render() {
- const { data } = this.props;
- const onFinish = () => {
- router.push('/form/step-form/info');
- };
- const information = (
-
-
-
- 付款账户:
-
-
- {data.payAccount}
-
-
-
-
- 收款账户:
-
-
- {data.receiverAccount}
-
-
-
-
- 收款人姓名:
-
-
- {data.receiverName}
-
-
-
-
- 转账金额:
-
-
- {data.amount} 元
-
-
-
- );
- const actions = (
-
-
-
-
- );
- return (
-
- );
- }
-}
-
-export default Step3;
diff --git a/src/pages/Forms/StepForm/index.js b/src/pages/Forms/StepForm/index.js
deleted file mode 100644
index 98902a0aa4cf63b7207060a2ea62f6680029b994..0000000000000000000000000000000000000000
--- a/src/pages/Forms/StepForm/index.js
+++ /dev/null
@@ -1,46 +0,0 @@
-import React, { PureComponent, Fragment } from 'react';
-import { Card, Steps } from 'antd';
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-import styles from '../style.less';
-
-const { Step } = Steps;
-
-export default class StepForm extends PureComponent {
- getCurrentStep() {
- const { location } = this.props;
- const { pathname } = location;
- const pathList = pathname.split('/');
- switch (pathList[pathList.length - 1]) {
- case 'info':
- return 0;
- case 'confirm':
- return 1;
- case 'result':
- return 2;
- default:
- return 0;
- }
- }
-
- render() {
- const { location, children } = this.props;
- return (
-
-
-
-
-
-
-
-
- {children}
-
-
-
- );
- }
-}
diff --git a/src/pages/Forms/StepForm/style.less b/src/pages/Forms/StepForm/style.less
deleted file mode 100644
index 713dd54c5ba3fbc58f50f77cffbedd2b30a361c9..0000000000000000000000000000000000000000
--- a/src/pages/Forms/StepForm/style.less
+++ /dev/null
@@ -1,78 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.stepForm {
- margin: 40px auto 0;
- max-width: 500px;
-}
-
-.stepFormText {
- margin-bottom: 24px;
- :global {
- .ant-form-item-label,
- .ant-form-item-control {
- line-height: 22px;
- }
- }
-}
-
-.result {
- margin: 0 auto;
- max-width: 560px;
- padding: 24px 0 8px;
-}
-
-.desc {
- padding: 0 56px;
- color: @text-color-secondary;
- h3 {
- font-size: 16px;
- margin: 0 0 12px 0;
- color: @text-color-secondary;
- line-height: 32px;
- }
- h4 {
- margin: 0 0 4px 0;
- color: @text-color-secondary;
- font-size: 14px;
- line-height: 22px;
- }
- p {
- margin-top: 0;
- margin-bottom: 12px;
- line-height: 22px;
- }
-}
-
-@media screen and (max-width: @screen-md) {
- .desc {
- padding: 0;
- }
-}
-
-.information {
- line-height: 22px;
- :global {
- .ant-row:not(:last-child) {
- margin-bottom: 24px;
- }
- }
- .label {
- color: @heading-color;
- text-align: right;
- padding-right: 8px;
- @media screen and (max-width: @screen-sm) {
- text-align: left;
- }
- }
-}
-
-.money {
- font-family: 'Helvetica Neue', sans-serif;
- font-weight: 500;
- font-size: 20px;
- line-height: 14px;
-}
-
-.uppercase {
- font-size: 12px;
-}
diff --git a/src/pages/Forms/TableForm.js b/src/pages/Forms/TableForm.js
deleted file mode 100644
index ae2723e7ba4eea80351d5a3d772fba89404e2c5c..0000000000000000000000000000000000000000
--- a/src/pages/Forms/TableForm.js
+++ /dev/null
@@ -1,261 +0,0 @@
-import React, { PureComponent, Fragment } from 'react';
-import { Table, Button, Input, message, Popconfirm, Divider } from 'antd';
-import isEqual from 'lodash/isEqual';
-import styles from './style.less';
-
-class TableForm extends PureComponent {
- index = 0;
-
- cacheOriginData = {};
-
- constructor(props) {
- super(props);
-
- this.state = {
- data: props.value,
- loading: false,
- /* eslint-disable-next-line react/no-unused-state */
- value: props.value,
- };
- }
-
- static getDerivedStateFromProps(nextProps, preState) {
- if (isEqual(nextProps.value, preState.value)) {
- return null;
- }
- return {
- data: nextProps.value,
- value: nextProps.value,
- };
- }
-
- getRowByKey(key, newData) {
- const { data } = this.state;
- return (newData || data).filter(item => item.key === key)[0];
- }
-
- toggleEditable = (e, key) => {
- e.preventDefault();
- const { data } = this.state;
- const newData = data.map(item => ({ ...item }));
- const target = this.getRowByKey(key, newData);
- if (target) {
- // 进入编辑状态时保存原始数据
- if (!target.editable) {
- this.cacheOriginData[key] = { ...target };
- }
- target.editable = !target.editable;
- this.setState({ data: newData });
- }
- };
-
- newMember = () => {
- const { data } = this.state;
- const newData = data.map(item => ({ ...item }));
- newData.push({
- key: `NEW_TEMP_ID_${this.index}`,
- workId: '',
- name: '',
- department: '',
- editable: true,
- isNew: true,
- });
- this.index += 1;
- this.setState({ data: newData });
- };
-
- remove(key) {
- const { data } = this.state;
- const { onChange } = this.props;
- const newData = data.filter(item => item.key !== key);
- this.setState({ data: newData });
- onChange(newData);
- }
-
- handleKeyPress(e, key) {
- if (e.key === 'Enter') {
- this.saveRow(e, key);
- }
- }
-
- handleFieldChange(e, fieldName, key) {
- const { data } = this.state;
- const newData = data.map(item => ({ ...item }));
- const target = this.getRowByKey(key, newData);
- if (target) {
- target[fieldName] = e.target.value;
- this.setState({ data: newData });
- }
- }
-
- saveRow(e, key) {
- e.persist();
- this.setState({
- loading: true,
- });
- setTimeout(() => {
- if (this.clickedCancel) {
- this.clickedCancel = false;
- return;
- }
- const target = this.getRowByKey(key) || {};
- if (!target.workId || !target.name || !target.department) {
- message.error('请填写完整成员信息。');
- e.target.focus();
- this.setState({
- loading: false,
- });
- return;
- }
- delete target.isNew;
- this.toggleEditable(e, key);
- const { data } = this.state;
- const { onChange } = this.props;
- onChange(data);
- this.setState({
- loading: false,
- });
- }, 500);
- }
-
- cancel(e, key) {
- this.clickedCancel = true;
- e.preventDefault();
- const { data } = this.state;
- const newData = data.map(item => ({ ...item }));
- const target = this.getRowByKey(key, newData);
- if (this.cacheOriginData[key]) {
- Object.assign(target, this.cacheOriginData[key]);
- delete this.cacheOriginData[key];
- }
- target.editable = false;
- this.setState({ data: newData });
- this.clickedCancel = false;
- }
-
- render() {
- const columns = [
- {
- title: '成员姓名',
- dataIndex: 'name',
- key: 'name',
- width: '20%',
- render: (text, record) => {
- if (record.editable) {
- return (
- this.handleFieldChange(e, 'name', record.key)}
- onKeyPress={e => this.handleKeyPress(e, record.key)}
- placeholder="成员姓名"
- />
- );
- }
- return text;
- },
- },
- {
- title: '工号',
- dataIndex: 'workId',
- key: 'workId',
- width: '20%',
- render: (text, record) => {
- if (record.editable) {
- return (
- this.handleFieldChange(e, 'workId', record.key)}
- onKeyPress={e => this.handleKeyPress(e, record.key)}
- placeholder="工号"
- />
- );
- }
- return text;
- },
- },
- {
- title: '所属部门',
- dataIndex: 'department',
- key: 'department',
- width: '40%',
- render: (text, record) => {
- if (record.editable) {
- return (
- this.handleFieldChange(e, 'department', record.key)}
- onKeyPress={e => this.handleKeyPress(e, record.key)}
- placeholder="所属部门"
- />
- );
- }
- return text;
- },
- },
- {
- title: '操作',
- key: 'action',
- render: (text, record) => {
- const { loading } = this.state;
- if (!!record.editable && loading) {
- return null;
- }
- if (record.editable) {
- if (record.isNew) {
- return (
-
- this.saveRow(e, record.key)}>添加
-
- this.remove(record.key)}>
- 删除
-
-
- );
- }
- return (
-
- this.saveRow(e, record.key)}>保存
-
- this.cancel(e, record.key)}>取消
-
- );
- }
- return (
-
- this.toggleEditable(e, record.key)}>编辑
-
- this.remove(record.key)}>
- 删除
-
-
- );
- },
- },
- ];
-
- const { loading, data } = this.state;
-
- return (
-
- (record.editable ? styles.editable : '')}
- />
-
-
- );
- }
-}
-
-export default TableForm;
diff --git a/src/pages/Forms/models/form.js b/src/pages/Forms/models/form.js
deleted file mode 100644
index 0b241b133d5fb8c0147f8bf81f8400df1a97ffd7..0000000000000000000000000000000000000000
--- a/src/pages/Forms/models/form.js
+++ /dev/null
@@ -1,47 +0,0 @@
-import { routerRedux } from 'dva/router';
-import { message } from 'antd';
-import { fakeSubmitForm } from '@/services/api';
-
-export default {
- namespace: 'form',
-
- state: {
- step: {
- payAccount: 'ant-design@alipay.com',
- receiverAccount: 'test@example.com',
- receiverName: 'Alex',
- amount: '500',
- },
- },
-
- effects: {
- *submitRegularForm({ payload }, { call }) {
- yield call(fakeSubmitForm, payload);
- message.success('提交成功');
- },
- *submitStepForm({ payload }, { call, put }) {
- yield call(fakeSubmitForm, payload);
- yield put({
- type: 'saveStepFormData',
- payload,
- });
- yield put(routerRedux.push('/form/step-form/result'));
- },
- *submitAdvancedForm({ payload }, { call }) {
- yield call(fakeSubmitForm, payload);
- message.success('提交成功');
- },
- },
-
- reducers: {
- saveStepFormData(state, { payload }) {
- return {
- ...state,
- step: {
- ...state.step,
- ...payload,
- },
- };
- },
- },
-};
diff --git a/src/pages/Forms/style.less b/src/pages/Forms/style.less
deleted file mode 100644
index 6b12d3c3eaf4ad2159d35b7a8550f20ac37d72e5..0000000000000000000000000000000000000000
--- a/src/pages/Forms/style.less
+++ /dev/null
@@ -1,90 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.card {
- margin-bottom: 24px;
-}
-
-.heading {
- font-size: 14px;
- line-height: 22px;
- margin: 0 0 16px 0;
-}
-
-.steps:global(.ant-steps) {
- max-width: 750px;
- margin: 16px auto;
-}
-
-.errorIcon {
- cursor: pointer;
- color: @error-color;
- margin-right: 24px;
- i {
- margin-right: 4px;
- }
-}
-
-.errorPopover {
- :global {
- .ant-popover-inner-content {
- padding: 0;
- max-height: 290px;
- overflow: auto;
- min-width: 256px;
- }
- }
-}
-
-.errorListItem {
- list-style: none;
- border-bottom: 1px solid @border-color-split;
- padding: 8px 16px;
- cursor: pointer;
- transition: all 0.3s;
- &:hover {
- background: @primary-1;
- }
- &:last-child {
- border: 0;
- }
- .errorIcon {
- color: @error-color;
- float: left;
- margin-top: 4px;
- margin-right: 12px;
- padding-bottom: 22px;
- }
- .errorField {
- font-size: 12px;
- color: @text-color-secondary;
- margin-top: 2px;
- }
-}
-
-.editable {
- td {
- padding-top: 13px !important;
- padding-bottom: 12.5px !important;
- }
-}
-
-// custom footer for fixed footer toolbar
-.advancedForm + div {
- padding-bottom: 64px;
-}
-
-.advancedForm {
- :global {
- .ant-form .ant-row:last-child .ant-form-item {
- margin-bottom: 24px;
- }
- .ant-table td {
- transition: none !important;
- }
- }
-}
-
-.optional {
- color: @text-color-secondary;
- font-style: normal;
-}
diff --git a/src/pages/List/Applications.js b/src/pages/List/Applications.js
deleted file mode 100644
index 12c8a2e08ce7fd4b2865e9951468c3dca751673d..0000000000000000000000000000000000000000
--- a/src/pages/List/Applications.js
+++ /dev/null
@@ -1,183 +0,0 @@
-import React, { PureComponent } from 'react';
-import numeral from 'numeral';
-import { connect } from 'dva';
-import { Row, Col, Form, Card, Select, Icon, Avatar, List, Tooltip, Dropdown, Menu } from 'antd';
-import TagSelect from 'ant-design-pro/lib/TagSelect';
-import StandardFormRow from '@/components/StandardFormRow';
-
-import { formatWan } from '@/utils/utils';
-
-import styles from './Applications.less';
-
-const { Option } = Select;
-const FormItem = Form.Item;
-
-@connect(({ list, loading }) => ({
- list,
- loading: loading.models.list,
-}))
-@Form.create({
- onValuesChange({ dispatch }, changedValues, allValues) {
- // 表单项变化时请求数据
- // eslint-disable-next-line
- console.log(changedValues, allValues);
- // 模拟查询表单生效
- dispatch({
- type: 'list/fetch',
- payload: {
- count: 8,
- },
- });
- },
-})
-class FilterCardList extends PureComponent {
- componentDidMount() {
- const { dispatch } = this.props;
- dispatch({
- type: 'list/fetch',
- payload: {
- count: 8,
- },
- });
- }
-
- render() {
- const {
- list: { list },
- loading,
- form,
- } = this.props;
- const { getFieldDecorator } = form;
-
- const CardInfo = ({ activeUser, newUser }) => (
-
- );
-
- const formItemLayout = {
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 16 },
- },
- };
-
- const itemMenu = (
-
- );
-
- return (
-
-
-
-
-
(
-
-
-
- ,
-
-
- ,
-
-
- ,
-
-
- ,
- ]}
- >
- } title={item.title} />
-
-
-
-
-
- )}
- />
-
- );
- }
-}
-
-export default FilterCardList;
diff --git a/src/pages/List/Applications.less b/src/pages/List/Applications.less
deleted file mode 100644
index 8f5cb368d3931865ad68f330e4d2ceb0b4df21cd..0000000000000000000000000000000000000000
--- a/src/pages/List/Applications.less
+++ /dev/null
@@ -1,43 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.filterCardList {
- margin-bottom: -24px;
- :global {
- .ant-card-meta-content {
- margin-top: 0;
- }
- // disabled white space
- .ant-card-meta-avatar {
- font-size: 0;
- }
- .ant-card-actions {
- background: #f7f9fa;
- }
- .ant-list .ant-list-item-content-single {
- max-width: 100%;
- }
- }
- .cardInfo {
- .clearfix();
- margin-top: 16px;
- margin-left: 40px;
- & > div {
- position: relative;
- text-align: left;
- float: left;
- width: 50%;
- p {
- line-height: 32px;
- font-size: 24px;
- margin: 0;
- }
- p:first-child {
- color: @text-color-secondary;
- font-size: 12px;
- line-height: 20px;
- margin-bottom: 4px;
- }
- }
- }
-}
diff --git a/src/pages/List/Articles.js b/src/pages/List/Articles.js
deleted file mode 100644
index 67298c8cadee20719a49390c0916120dc241db1f..0000000000000000000000000000000000000000
--- a/src/pages/List/Articles.js
+++ /dev/null
@@ -1,242 +0,0 @@
-import React, { Component, Fragment } from 'react';
-import { connect } from 'dva';
-import { Form, Card, Select, List, Tag, Icon, Row, Col, Button } from 'antd';
-
-import TagSelect from 'ant-design-pro/lib/TagSelect';
-import StandardFormRow from '@/components/StandardFormRow';
-import ArticleListContent from '@/components/ArticleListContent';
-import styles from './Articles.less';
-
-const { Option } = Select;
-const FormItem = Form.Item;
-
-const pageSize = 5;
-
-@connect(({ list, loading }) => ({
- list,
- loading: loading.models.list,
-}))
-@Form.create({
- onValuesChange({ dispatch }, changedValues, allValues) {
- // 表单项变化时请求数据
- // eslint-disable-next-line
- console.log(changedValues, allValues);
- // 模拟查询表单生效
- dispatch({
- type: 'list/fetch',
- payload: {
- count: 5,
- },
- });
- },
-})
-class SearchList extends Component {
- componentDidMount() {
- const { dispatch } = this.props;
- dispatch({
- type: 'list/fetch',
- payload: {
- count: 5,
- },
- });
- }
-
- setOwner = () => {
- const { form } = this.props;
- form.setFieldsValue({
- owner: ['wzj'],
- });
- };
-
- fetchMore = () => {
- const { dispatch } = this.props;
- dispatch({
- type: 'list/appendFetch',
- payload: {
- count: pageSize,
- },
- });
- };
-
- render() {
- const {
- form,
- list: { list },
- loading,
- } = this.props;
- const { getFieldDecorator } = form;
-
- const owners = [
- {
- id: 'wzj',
- name: '我自己',
- },
- {
- id: 'wjh',
- name: '吴家豪',
- },
- {
- id: 'zxx',
- name: '周星星',
- },
- {
- id: 'zly',
- name: '赵丽颖',
- },
- {
- id: 'ym',
- name: '姚明',
- },
- ];
-
- const IconText = ({ type, text }) => (
-
-
- {text}
-
- );
-
- const formItemLayout = {
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 24 },
- md: { span: 12 },
- },
- };
-
- const loadMore =
- list.length > 0 ? (
-
-
-
- ) : null;
-
- return (
-
-
-
-
-
- (
- ,
- ,
- ,
- ]}
- extra={}
- >
-
- {item.title}
-
- }
- description={
-
- Ant Design
- 设计语言
- 蚂蚁金服
-
- }
- />
-
-
- )}
- />
-
-
- );
- }
-}
-
-export default SearchList;
diff --git a/src/pages/List/Articles.less b/src/pages/List/Articles.less
deleted file mode 100644
index 3ec950159ad2904b50e9ecd3208e3b369fe5daee..0000000000000000000000000000000000000000
--- a/src/pages/List/Articles.less
+++ /dev/null
@@ -1,31 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-a.listItemMetaTitle {
- color: @heading-color;
-}
-.listItemExtra {
- width: 272px;
- height: 1px;
-}
-.selfTrigger {
- margin-left: 12px;
-}
-
-@media screen and (max-width: @screen-xs) {
- .selfTrigger {
- display: block;
- margin-left: 0;
- }
-}
-@media screen and (max-width: @screen-md) {
- .selfTrigger {
- display: block;
- margin-left: 0;
- }
-}
-@media screen and (max-width: @screen-lg) {
- .listItemExtra {
- width: 0;
- height: 1px;
- }
-}
diff --git a/src/pages/List/BasicList.js b/src/pages/List/BasicList.js
deleted file mode 100644
index 68d8efa26c3c729056f21544cddd4be900d2056a..0000000000000000000000000000000000000000
--- a/src/pages/List/BasicList.js
+++ /dev/null
@@ -1,340 +0,0 @@
-import React, { PureComponent } from 'react';
-import { findDOMNode } from 'react-dom';
-import moment from 'moment';
-import { connect } from 'dva';
-import {
- List,
- Card,
- Row,
- Col,
- Radio,
- Input,
- Progress,
- Button,
- Icon,
- Dropdown,
- Menu,
- Avatar,
- Modal,
- Form,
- DatePicker,
- Select,
-} from 'antd';
-
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-import Result from 'ant-design-pro/lib/Result';
-
-import styles from './BasicList.less';
-
-const FormItem = Form.Item;
-const RadioButton = Radio.Button;
-const RadioGroup = Radio.Group;
-const SelectOption = Select.Option;
-const { Search, TextArea } = Input;
-
-@connect(({ list, loading }) => ({
- list,
- loading: loading.models.list,
-}))
-@Form.create()
-class BasicList extends PureComponent {
- state = { visible: false, done: false };
-
- formLayout = {
- labelCol: { span: 7 },
- wrapperCol: { span: 13 },
- };
-
- componentDidMount() {
- const { dispatch } = this.props;
- dispatch({
- type: 'list/fetch',
- payload: {
- count: 5,
- },
- });
- }
-
- showModal = () => {
- this.setState({
- visible: true,
- current: undefined,
- });
- };
-
- showEditModal = item => {
- this.setState({
- visible: true,
- current: item,
- });
- };
-
- handleDone = () => {
- setTimeout(() => this.addBtn.blur(), 0);
- this.setState({
- done: false,
- visible: false,
- });
- };
-
- handleCancel = () => {
- setTimeout(() => this.addBtn.blur(), 0);
- this.setState({
- visible: false,
- });
- };
-
- handleSubmit = e => {
- e.preventDefault();
- const { dispatch, form } = this.props;
- const { current } = this.state;
- const id = current ? current.id : '';
-
- setTimeout(() => this.addBtn.blur(), 0);
- form.validateFields((err, fieldsValue) => {
- if (err) return;
- this.setState({
- done: true,
- });
- dispatch({
- type: 'list/submit',
- payload: { id, ...fieldsValue },
- });
- });
- };
-
- deleteItem = id => {
- const { dispatch } = this.props;
- dispatch({
- type: 'list/submit',
- payload: { id },
- });
- };
-
- render() {
- const {
- list: { list },
- loading,
- } = this.props;
- const {
- form: { getFieldDecorator },
- } = this.props;
- const { visible, done, current = {} } = this.state;
-
- const editAndDelete = (key, currentItem) => {
- if (key === 'edit') this.showEditModal(currentItem);
- else if (key === 'delete') {
- Modal.confirm({
- title: '删除任务',
- content: '确定删除该任务吗?',
- okText: '确认',
- cancelText: '取消',
- onOk: () => this.deleteItem(currentItem.id),
- });
- }
- };
-
- const modalFooter = done
- ? { footer: null, onCancel: this.handleDone }
- : { okText: '保存', onOk: this.handleSubmit, onCancel: this.handleCancel };
-
- const Info = ({ title, value, bordered }) => (
-
-
{title}
-
{value}
- {bordered &&
}
-
- );
-
- const extraContent = (
-
-
- 全部
- 进行中
- 等待中
-
- ({})} />
-
- );
-
- const paginationProps = {
- showSizeChanger: true,
- showQuickJumper: true,
- pageSize: 5,
- total: 50,
- };
-
- const ListContent = ({ data: { owner, createdAt, percent, status } }) => (
-
-
-
-
开始时间
-
{moment(createdAt).format('YYYY-MM-DD HH:mm')}
-
-
-
- );
-
- const MoreBtn = props => (
- editAndDelete(key, props.current)}>
- 编辑
- 删除
-
- }
- >
-
- 更多
-
-
- );
-
- const getModalContent = () => {
- if (done) {
- return (
-
- 知道了
-
- }
- className={styles.formResult}
- />
- );
- }
- return (
-
- );
- };
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- (
- {
- e.preventDefault();
- this.showEditModal(item);
- }}
- >
- 编辑
- ,
- ,
- ]}
- >
- }
- title={{item.title}}
- description={item.subDescription}
- />
-
-
- )}
- />
-
-
-
- {getModalContent()}
-
-
- );
- }
-}
-
-export default BasicList;
diff --git a/src/pages/List/BasicList.less b/src/pages/List/BasicList.less
deleted file mode 100644
index f086c501c887f985093d0e6cf0b99643a0ed44dc..0000000000000000000000000000000000000000
--- a/src/pages/List/BasicList.less
+++ /dev/null
@@ -1,195 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.standardList {
- :global {
- .ant-card-head {
- border-bottom: none;
- }
- .ant-card-head-title {
- line-height: 32px;
- padding: 24px 0;
- }
- .ant-card-extra {
- padding: 24px 0;
- }
- .ant-list-pagination {
- text-align: right;
- margin-top: 24px;
- }
- .ant-avatar-lg {
- width: 48px;
- height: 48px;
- line-height: 48px;
- }
- }
- .headerInfo {
- position: relative;
- text-align: center;
- & > span {
- color: @text-color-secondary;
- display: inline-block;
- font-size: @font-size-base;
- line-height: 22px;
- margin-bottom: 4px;
- }
- & > p {
- color: @heading-color;
- font-size: 24px;
- line-height: 32px;
- margin: 0;
- }
- & > em {
- background-color: @border-color-split;
- position: absolute;
- height: 56px;
- width: 1px;
- top: 0;
- right: 0;
- }
- }
- .listContent {
- font-size: 0;
- .listContentItem {
- color: @text-color-secondary;
- display: inline-block;
- vertical-align: middle;
- font-size: @font-size-base;
- margin-left: 40px;
- > span {
- line-height: 20px;
- }
- > p {
- margin-top: 4px;
- margin-bottom: 0;
- line-height: 22px;
- }
- }
- }
- .extraContentSearch {
- margin-left: 16px;
- width: 272px;
- }
-}
-
-@media screen and (max-width: @screen-xs) {
- .standardList {
- :global {
- .ant-list-item-content {
- display: block;
- flex: none;
- width: 100%;
- }
- .ant-list-item-action {
- margin-left: 0;
- }
- }
- .listContent {
- margin-left: 0;
- & > div {
- margin-left: 0;
- }
- }
- .listCard {
- :global {
- .ant-card-head-title {
- overflow: visible;
- }
- }
- }
- }
-}
-
-@media screen and (max-width: @screen-sm) {
- .standardList {
- .extraContentSearch {
- margin-left: 0;
- width: 100%;
- }
- .headerInfo {
- margin-bottom: 16px;
- & > em {
- display: none;
- }
- }
- }
-}
-
-@media screen and (max-width: @screen-md) {
- .standardList {
- .listContent {
- & > div {
- display: block;
- }
- & > div:last-child {
- top: 0;
- width: 100%;
- }
- }
- }
- .listCard {
- :global {
- .ant-radio-group {
- display: block;
- margin-bottom: 8px;
- }
- }
- }
-}
-
-@media screen and (max-width: @screen-lg) and (min-width: @screen-md) {
- .standardList {
- .listContent {
- & > div {
- display: block;
- }
- & > div:last-child {
- top: 0;
- width: 100%;
- }
- }
- }
-}
-
-@media screen and (max-width: @screen-xl) {
- .standardList {
- .listContent {
- & > div {
- margin-left: 24px;
- }
- & > div:last-child {
- top: 0;
- }
- }
- }
-}
-
-@media screen and (max-width: 1400px) {
- .standardList {
- .listContent {
- text-align: right;
- & > div:last-child {
- top: 0;
- }
- }
- }
-}
-
-.standardListForm {
- :global {
- .ant-form-item {
- margin-bottom: 12px;
- &:last-child {
- padding-top: 4px;
- margin-bottom: 32px;
- }
- }
- }
-}
-
-.formResult {
- width: 100%;
- [class^='title'] {
- margin-bottom: 8px;
- }
-}
diff --git a/src/pages/List/CardList.js b/src/pages/List/CardList.js
deleted file mode 100644
index 611e63006b71bb3bd71378f4ccc04ac0115e60b2..0000000000000000000000000000000000000000
--- a/src/pages/List/CardList.js
+++ /dev/null
@@ -1,101 +0,0 @@
-import React, { PureComponent } from 'react';
-import { connect } from 'dva';
-import { Card, Button, Icon, List } from 'antd';
-
-import Ellipsis from 'ant-design-pro/lib/Ellipsis';
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-
-import styles from './CardList.less';
-
-@connect(({ list, loading }) => ({
- list,
- loading: loading.models.list,
-}))
-class CardList extends PureComponent {
- componentDidMount() {
- const { dispatch } = this.props;
- dispatch({
- type: 'list/fetch',
- payload: {
- count: 8,
- },
- });
- }
-
- render() {
- const {
- list: { list },
- loading,
- } = this.props;
-
- const content = (
-
-
- 段落示意:蚂蚁金服务设计平台 ant.design,用最小的工作量,无缝接入蚂蚁金服生态,
- 提供跨越设计与开发的体验解决方案。
-
-
-
- );
-
- const extraContent = (
-
-

-
- );
-
- return (
-
-
-
- item ? (
-
- 操作一, 操作二]}>
- }
- title={{item.title}}
- description={
-
- {item.description}
-
- }
- />
-
-
- ) : (
-
-
-
- )
- }
- />
-
-
- );
- }
-}
-
-export default CardList;
diff --git a/src/pages/List/CardList.less b/src/pages/List/CardList.less
deleted file mode 100644
index 3d6feacc2635872b8c6006c529524cb107a5c584..0000000000000000000000000000000000000000
--- a/src/pages/List/CardList.less
+++ /dev/null
@@ -1,113 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.cardList {
- margin-bottom: -24px;
-
- .card {
- :global {
- .ant-card-meta-title {
- margin-bottom: 12px;
- & > a {
- color: @heading-color;
- display: inline-block;
- max-width: 100%;
- }
- }
- .ant-card-actions {
- background: #f7f9fa;
- }
- .ant-card-body:hover {
- .ant-card-meta-title > a {
- color: @primary-color;
- }
- }
- }
- }
- .item {
- height: 64px;
- }
-
- :global {
- .ant-list .ant-list-item-content-single {
- max-width: 100%;
- }
- }
-}
-
-.extraImg {
- margin-top: -60px;
- text-align: center;
- width: 195px;
- img {
- width: 100%;
- }
-}
-
-.newButton {
- background-color: #fff;
- border-color: @border-color-base;
- border-radius: @border-radius-sm;
- color: @text-color-secondary;
- width: 100%;
- height: 188px;
-}
-
-.cardAvatar {
- width: 48px;
- height: 48px;
- border-radius: 48px;
-}
-
-.cardDescription {
- .textOverflowMulti();
-}
-
-.pageHeaderContent {
- position: relative;
-}
-
-.contentLink {
- margin-top: 16px;
- a {
- margin-right: 32px;
- img {
- width: 24px;
- }
- }
- img {
- vertical-align: middle;
- margin-right: 8px;
- }
-}
-
-@media screen and (max-width: @screen-lg) {
- .contentLink {
- a {
- margin-right: 16px;
- }
- }
-}
-@media screen and (max-width: @screen-md) {
- .extraImg {
- display: none;
- }
-}
-
-@media screen and (max-width: @screen-sm) {
- .pageHeaderContent {
- padding-bottom: 30px;
- }
- .contentLink {
- position: absolute;
- left: 0;
- bottom: -4px;
- width: 1000px;
- a {
- margin-right: 16px;
- }
- img {
- margin-right: 4px;
- }
- }
-}
diff --git a/src/pages/List/List.js b/src/pages/List/List.js
deleted file mode 100644
index d420af59222ab79c24ae894225b6d08437cf095a..0000000000000000000000000000000000000000
--- a/src/pages/List/List.js
+++ /dev/null
@@ -1,80 +0,0 @@
-import React, { Component } from 'react';
-import router from 'umi/router';
-import { connect } from 'dva';
-import { Input } from 'antd';
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-
-@connect()
-class SearchList extends Component {
- handleTabChange = key => {
- const { match } = this.props;
- switch (key) {
- case 'articles':
- router.push(`${match.url}/articles`);
- break;
- case 'applications':
- router.push(`${match.url}/applications`);
- break;
- case 'projects':
- router.push(`${match.url}/projects`);
- break;
- default:
- break;
- }
- };
-
- handleFormSubmit = value => {
- // eslint-disable-next-line
- console.log(value);
- };
-
- render() {
- const tabList = [
- {
- key: 'articles',
- tab: '文章',
- },
- {
- key: 'projects',
- tab: '项目',
- },
- {
- key: 'applications',
- tab: '应用',
- },
- ];
-
- const mainSearch = (
-
-
-
- );
-
- const { match, children, location } = this.props;
-
- return (
-
- {children}
- {/*
- {routes.map(item => (
-
- ))}
- */}
-
- );
- }
-}
-
-export default SearchList;
diff --git a/src/pages/List/Projects.js b/src/pages/List/Projects.js
deleted file mode 100644
index 8fbc1ea326a463020e75b4db565c9efd71e79f3a..0000000000000000000000000000000000000000
--- a/src/pages/List/Projects.js
+++ /dev/null
@@ -1,154 +0,0 @@
-import React, { PureComponent } from 'react';
-import moment from 'moment';
-import { connect } from 'dva';
-import { Row, Col, Form, Card, Select, List } from 'antd';
-
-import TagSelect from 'ant-design-pro/lib/TagSelect';
-import AvatarList from 'ant-design-pro/lib/AvatarList';
-import Ellipsis from 'ant-design-pro/lib/Ellipsis';
-import StandardFormRow from '@/components/StandardFormRow';
-
-import styles from './Projects.less';
-
-const { Option } = Select;
-const FormItem = Form.Item;
-
-/* eslint react/no-array-index-key: 0 */
-
-@connect(({ list, loading }) => ({
- list,
- loading: loading.models.list,
-}))
-@Form.create({
- onValuesChange({ dispatch }, changedValues, allValues) {
- // 表单项变化时请求数据
- // eslint-disable-next-line
- console.log(changedValues, allValues);
- // 模拟查询表单生效
- dispatch({
- type: 'list/fetch',
- payload: {
- count: 8,
- },
- });
- },
-})
-class CoverCardList extends PureComponent {
- componentDidMount() {
- const { dispatch } = this.props;
- dispatch({
- type: 'list/fetch',
- payload: {
- count: 8,
- },
- });
- }
-
- render() {
- const {
- list: { list = [] },
- loading,
- form,
- } = this.props;
- const { getFieldDecorator } = form;
-
- const cardList = list ? (
- (
-
- }
- >
- {item.title}}
- description={{item.subDescription}}
- />
-
-
{moment(item.updatedAt).fromNow()}
-
-
- {item.members.map((member, i) => (
-
- ))}
-
-
-
-
-
- )}
- />
- ) : null;
-
- const formItemLayout = {
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 16 },
- },
- };
-
- return (
-
-
-
-
-
{cardList}
-
- );
- }
-}
-
-export default CoverCardList;
diff --git a/src/pages/List/Projects.less b/src/pages/List/Projects.less
deleted file mode 100644
index 43b8d72655bafe27dbd31ad33c93e9b934289f17..0000000000000000000000000000000000000000
--- a/src/pages/List/Projects.less
+++ /dev/null
@@ -1,57 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.coverCardList {
- margin-bottom: -24px;
-
- .card {
- :global {
- .ant-card-meta-title {
- margin-bottom: 4px;
- & > a {
- color: @heading-color;
- display: inline-block;
- max-width: 100%;
- }
- }
- .ant-card-meta-description {
- height: 44px;
- line-height: 22px;
- overflow: hidden;
- }
- }
-
- &:hover {
- :global {
- .ant-card-meta-title > a {
- color: @primary-color;
- }
- }
- }
- }
-
- .cardItemContent {
- display: flex;
- margin-top: 16px;
- margin-bottom: -4px;
- line-height: 20px;
- height: 20px;
- & > span {
- color: @text-color-secondary;
- flex: 1;
- font-size: 12px;
- }
- .avatarList {
- flex: 0 1 auto;
- }
- }
- .cardList {
- margin-top: 24px;
- }
-
- :global {
- .ant-list .ant-list-item-content-single {
- max-width: 100%;
- }
- }
-}
diff --git a/src/pages/List/TableList.js b/src/pages/List/TableList.js
deleted file mode 100644
index 13f5fb60d04ebfd2dbb78420bfb36e600aa8c12e..0000000000000000000000000000000000000000
--- a/src/pages/List/TableList.js
+++ /dev/null
@@ -1,686 +0,0 @@
-import React, { PureComponent, Fragment } from 'react';
-import { connect } from 'dva';
-import moment from 'moment';
-import {
- Row,
- Col,
- Card,
- Form,
- Input,
- Select,
- Icon,
- Button,
- Dropdown,
- Menu,
- InputNumber,
- DatePicker,
- Modal,
- message,
- Badge,
- Divider,
- Steps,
- Radio,
-} from 'antd';
-import StandardTable from '@/components/StandardTable';
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-
-import styles from './TableList.less';
-
-const FormItem = Form.Item;
-const { Step } = Steps;
-const { TextArea } = Input;
-const { Option } = Select;
-const RadioGroup = Radio.Group;
-const getValue = obj =>
- Object.keys(obj)
- .map(key => obj[key])
- .join(',');
-const statusMap = ['default', 'processing', 'success', 'error'];
-const status = ['关闭', '运行中', '已上线', '异常'];
-
-const CreateForm = Form.create()(props => {
- const { modalVisible, form, handleAdd, handleModalVisible } = props;
- const okHandle = () => {
- form.validateFields((err, fieldsValue) => {
- if (err) return;
- form.resetFields();
- handleAdd(fieldsValue);
- });
- };
- return (
- handleModalVisible()}
- >
-
- {form.getFieldDecorator('desc', {
- rules: [{ required: true, message: '请输入至少五个字符的规则描述!', min: 5 }],
- })()}
-
-
- );
-});
-
-@Form.create()
-class UpdateForm extends PureComponent {
- static defaultProps = {
- handleUpdate: () => {},
- handleUpdateModalVisible: () => {},
- values: {},
- };
-
- constructor(props) {
- super(props);
-
- this.state = {
- formVals: {
- name: props.values.name,
- desc: props.values.desc,
- key: props.values.key,
- target: '0',
- template: '0',
- type: '1',
- time: '',
- frequency: 'month',
- },
- currentStep: 0,
- };
-
- this.formLayout = {
- labelCol: { span: 7 },
- wrapperCol: { span: 13 },
- };
- }
-
- handleNext = currentStep => {
- const { form, handleUpdate } = this.props;
- const { formVals: oldValue } = this.state;
- form.validateFields((err, fieldsValue) => {
- if (err) return;
- const formVals = { ...oldValue, ...fieldsValue };
- this.setState(
- {
- formVals,
- },
- () => {
- if (currentStep < 2) {
- this.forward();
- } else {
- handleUpdate(formVals);
- }
- }
- );
- });
- };
-
- backward = () => {
- const { currentStep } = this.state;
- this.setState({
- currentStep: currentStep - 1,
- });
- };
-
- forward = () => {
- const { currentStep } = this.state;
- this.setState({
- currentStep: currentStep + 1,
- });
- };
-
- renderContent = (currentStep, formVals) => {
- const { form } = this.props;
- if (currentStep === 1) {
- return [
-
- {form.getFieldDecorator('target', {
- initialValue: formVals.target,
- })(
-
- )}
- ,
-
- {form.getFieldDecorator('template', {
- initialValue: formVals.template,
- })(
-
- )}
- ,
-
- {form.getFieldDecorator('type', {
- initialValue: formVals.type,
- })(
-
- 强
- 弱
-
- )}
- ,
- ];
- }
- if (currentStep === 2) {
- return [
-
- {form.getFieldDecorator('time', {
- rules: [{ required: true, message: '请选择开始时间!' }],
- })(
-
- )}
- ,
-
- {form.getFieldDecorator('frequency', {
- initialValue: formVals.frequency,
- })(
-
- )}
- ,
- ];
- }
- return [
-
- {form.getFieldDecorator('name', {
- rules: [{ required: true, message: '请输入规则名称!' }],
- initialValue: formVals.name,
- })()}
- ,
-
- {form.getFieldDecorator('desc', {
- rules: [{ required: true, message: '请输入至少五个字符的规则描述!', min: 5 }],
- initialValue: formVals.desc,
- })()}
- ,
- ];
- };
-
- renderFooter = currentStep => {
- const { handleUpdateModalVisible, values } = this.props;
- if (currentStep === 1) {
- return [
- ,
- ,
- ,
- ];
- }
- if (currentStep === 2) {
- return [
- ,
- ,
- ,
- ];
- }
- return [
- ,
- ,
- ];
- };
-
- render() {
- const { updateModalVisible, handleUpdateModalVisible, values } = this.props;
- const { currentStep, formVals } = this.state;
-
- return (
- handleUpdateModalVisible(false, values)}
- afterClose={() => handleUpdateModalVisible()}
- >
-
-
-
-
-
- {this.renderContent(currentStep, formVals)}
-
- );
- }
-}
-
-/* eslint react/no-multi-comp:0 */
-@connect(({ rule, loading }) => ({
- rule,
- loading: loading.models.rule,
-}))
-@Form.create()
-class TableList extends PureComponent {
- state = {
- modalVisible: false,
- updateModalVisible: false,
- expandForm: false,
- selectedRows: [],
- formValues: {},
- stepFormValues: {},
- };
-
- columns = [
- {
- title: '规则名称',
- dataIndex: 'name',
- },
- {
- title: '描述',
- dataIndex: 'desc',
- },
- {
- title: '服务调用次数',
- dataIndex: 'callNo',
- sorter: true,
- align: 'right',
- render: val => `${val} 万`,
- // mark to display a total number
- needTotal: true,
- },
- {
- title: '状态',
- dataIndex: 'status',
- filters: [
- {
- text: status[0],
- value: 0,
- },
- {
- text: status[1],
- value: 1,
- },
- {
- text: status[2],
- value: 2,
- },
- {
- text: status[3],
- value: 3,
- },
- ],
- render(val) {
- return ;
- },
- },
- {
- title: '上次调度时间',
- dataIndex: 'updatedAt',
- sorter: true,
- render: val => {moment(val).format('YYYY-MM-DD HH:mm:ss')},
- },
- {
- title: '操作',
- render: (text, record) => (
-
- this.handleUpdateModalVisible(true, record)}>配置
-
- 订阅警报
-
- ),
- },
- ];
-
- componentDidMount() {
- const { dispatch } = this.props;
- dispatch({
- type: 'rule/fetch',
- });
- }
-
- handleStandardTableChange = (pagination, filtersArg, sorter) => {
- const { dispatch } = this.props;
- const { formValues } = this.state;
-
- const filters = Object.keys(filtersArg).reduce((obj, key) => {
- const newObj = { ...obj };
- newObj[key] = getValue(filtersArg[key]);
- return newObj;
- }, {});
-
- const params = {
- currentPage: pagination.current,
- pageSize: pagination.pageSize,
- ...formValues,
- ...filters,
- };
- if (sorter.field) {
- params.sorter = `${sorter.field}_${sorter.order}`;
- }
-
- dispatch({
- type: 'rule/fetch',
- payload: params,
- });
- };
-
- handleFormReset = () => {
- const { form, dispatch } = this.props;
- form.resetFields();
- this.setState({
- formValues: {},
- });
- dispatch({
- type: 'rule/fetch',
- payload: {},
- });
- };
-
- toggleForm = () => {
- const { expandForm } = this.state;
- this.setState({
- expandForm: !expandForm,
- });
- };
-
- handleMenuClick = e => {
- const { dispatch } = this.props;
- const { selectedRows } = this.state;
-
- if (selectedRows.length === 0) return;
- switch (e.key) {
- case 'remove':
- dispatch({
- type: 'rule/remove',
- payload: {
- key: selectedRows.map(row => row.key),
- },
- callback: () => {
- this.setState({
- selectedRows: [],
- });
- },
- });
- break;
- default:
- break;
- }
- };
-
- handleSelectRows = rows => {
- this.setState({
- selectedRows: rows,
- });
- };
-
- handleSearch = e => {
- e.preventDefault();
-
- const { dispatch, form } = this.props;
-
- form.validateFields((err, fieldsValue) => {
- if (err) return;
-
- const values = {
- ...fieldsValue,
- updatedAt: fieldsValue.updatedAt && fieldsValue.updatedAt.valueOf(),
- };
-
- this.setState({
- formValues: values,
- });
-
- dispatch({
- type: 'rule/fetch',
- payload: values,
- });
- });
- };
-
- handleModalVisible = flag => {
- this.setState({
- modalVisible: !!flag,
- });
- };
-
- handleUpdateModalVisible = (flag, record) => {
- this.setState({
- updateModalVisible: !!flag,
- stepFormValues: record || {},
- });
- };
-
- handleAdd = fields => {
- const { dispatch } = this.props;
- dispatch({
- type: 'rule/add',
- payload: {
- desc: fields.desc,
- },
- });
-
- message.success('添加成功');
- this.handleModalVisible();
- };
-
- handleUpdate = fields => {
- const { dispatch } = this.props;
- const { formValues } = this.state;
- dispatch({
- type: 'rule/update',
- payload: {
- query: formValues,
- body: {
- name: fields.name,
- desc: fields.desc,
- key: fields.key,
- },
- },
- });
-
- message.success('配置成功');
- this.handleUpdateModalVisible();
- };
-
- renderSimpleForm() {
- const {
- form: { getFieldDecorator },
- } = this.props;
- return (
-
- );
- }
-
- renderAdvancedForm() {
- const {
- form: { getFieldDecorator },
- } = this.props;
- return (
-
- );
- }
-
- renderForm() {
- const { expandForm } = this.state;
- return expandForm ? this.renderAdvancedForm() : this.renderSimpleForm();
- }
-
- render() {
- const {
- rule: { data },
- loading,
- } = this.props;
- const { selectedRows, modalVisible, updateModalVisible, stepFormValues } = this.state;
- const menu = (
-
- );
-
- const parentMethods = {
- handleAdd: this.handleAdd,
- handleModalVisible: this.handleModalVisible,
- };
- const updateMethods = {
- handleUpdateModalVisible: this.handleUpdateModalVisible,
- handleUpdate: this.handleUpdate,
- };
- return (
-
-
-
-
{this.renderForm()}
-
-
- {selectedRows.length > 0 && (
-
-
-
-
-
-
- )}
-
-
-
-
-
- {stepFormValues && Object.keys(stepFormValues).length ? (
-
- ) : null}
-
- );
- }
-}
-
-export default TableList;
diff --git a/src/pages/List/TableList.less b/src/pages/List/TableList.less
deleted file mode 100644
index 792757dfa5888c5bb934ada39842d467f407d10c..0000000000000000000000000000000000000000
--- a/src/pages/List/TableList.less
+++ /dev/null
@@ -1,49 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.tableList {
- .tableListOperator {
- margin-bottom: 16px;
- button {
- margin-right: 8px;
- }
- }
-}
-
-.tableListForm {
- :global {
- .ant-form-item {
- margin-bottom: 24px;
- margin-right: 0;
- display: flex;
- > .ant-form-item-label {
- width: auto;
- line-height: 32px;
- padding-right: 8px;
- }
- .ant-form-item-control {
- line-height: 32px;
- }
- }
- .ant-form-item-control-wrapper {
- flex: 1;
- }
- }
- .submitButtons {
- display: block;
- white-space: nowrap;
- margin-bottom: 24px;
- }
-}
-
-@media screen and (max-width: @screen-lg) {
- .tableListForm :global(.ant-form-item) {
- margin-right: 24px;
- }
-}
-
-@media screen and (max-width: @screen-md) {
- .tableListForm :global(.ant-form-item) {
- margin-right: 8px;
- }
-}
diff --git a/src/pages/List/models/rule.js b/src/pages/List/models/rule.js
deleted file mode 100644
index b318dbe3649b8957b29bad438d42baecec269d4a..0000000000000000000000000000000000000000
--- a/src/pages/List/models/rule.js
+++ /dev/null
@@ -1,55 +0,0 @@
-import { queryRule, removeRule, addRule, updateRule } from '@/services/api';
-
-export default {
- namespace: 'rule',
-
- state: {
- data: {
- list: [],
- pagination: {},
- },
- },
-
- effects: {
- *fetch({ payload }, { call, put }) {
- const response = yield call(queryRule, payload);
- yield put({
- type: 'save',
- payload: response,
- });
- },
- *add({ payload, callback }, { call, put }) {
- const response = yield call(addRule, payload);
- yield put({
- type: 'save',
- payload: response,
- });
- if (callback) callback();
- },
- *remove({ payload, callback }, { call, put }) {
- const response = yield call(removeRule, payload);
- yield put({
- type: 'save',
- payload: response,
- });
- if (callback) callback();
- },
- *update({ payload, callback }, { call, put }) {
- const response = yield call(updateRule, payload);
- yield put({
- type: 'save',
- payload: response,
- });
- if (callback) callback();
- },
- },
-
- reducers: {
- save(state, action) {
- return {
- ...state,
- data: action.payload,
- };
- },
- },
-};
diff --git a/src/pages/Profile/AdvancedProfile.js b/src/pages/Profile/AdvancedProfile.js
deleted file mode 100644
index 881926c987cac0b6e482309457e262bb9e5ecf54..0000000000000000000000000000000000000000
--- a/src/pages/Profile/AdvancedProfile.js
+++ /dev/null
@@ -1,353 +0,0 @@
-import React, { Component, Fragment } from 'react';
-import Debounce from 'lodash-decorators/debounce';
-import Bind from 'lodash-decorators/bind';
-import { connect } from 'dva';
-import {
- Button,
- Menu,
- Dropdown,
- Icon,
- Row,
- Col,
- Steps,
- Card,
- Popover,
- Badge,
- Table,
- Tooltip,
- Divider,
-} from 'antd';
-import classNames from 'classnames';
-import DescriptionList from 'ant-design-pro/lib/DescriptionList';
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-import styles from './AdvancedProfile.less';
-
-const { Step } = Steps;
-const { Description } = DescriptionList;
-const ButtonGroup = Button.Group;
-
-const getWindowWidth = () => window.innerWidth || document.documentElement.clientWidth;
-
-const menu = (
-
-);
-
-const action = (
-
-
-
-
-
-
-
-
-
-
-);
-
-const extra = (
-
-
- 状态
- 待审批
-
-
- 订单金额
- ¥ 568.08
-
-
-);
-
-const description = (
-
- 曲丽丽
- XX 服务
- 2017-07-07
-
- 12421
-
- 2017-07-07 ~ 2017-08-08
- 请于两个工作日内确认
-
-);
-
-const tabList = [
- {
- key: 'detail',
- tab: '详情',
- },
- {
- key: 'rule',
- tab: '规则',
- },
-];
-
-const desc1 = (
-
-
- 曲丽丽
-
-
-
2016-12-12 12:32
-
-);
-
-const desc2 = (
-
-);
-
-const popoverContent = (
-
- 吴加号
-
- 未响应} />
-
-
- 耗时:2小时25分钟
-
-
-);
-
-const customDot = (dot, { status }) =>
- status === 'process' ? (
-
- {dot}
-
- ) : (
- dot
- );
-
-const operationTabList = [
- {
- key: 'tab1',
- tab: '操作日志一',
- },
- {
- key: 'tab2',
- tab: '操作日志二',
- },
- {
- key: 'tab3',
- tab: '操作日志三',
- },
-];
-
-const columns = [
- {
- title: '操作类型',
- dataIndex: 'type',
- key: 'type',
- },
- {
- title: '操作人',
- dataIndex: 'name',
- key: 'name',
- },
- {
- title: '执行结果',
- dataIndex: 'status',
- key: 'status',
- render: text =>
- text === 'agree' ? (
-
- ) : (
-
- ),
- },
- {
- title: '操作时间',
- dataIndex: 'updatedAt',
- key: 'updatedAt',
- },
- {
- title: '备注',
- dataIndex: 'memo',
- key: 'memo',
- },
-];
-
-@connect(({ profile, loading }) => ({
- profile,
- loading: loading.effects['profile/fetchAdvanced'],
-}))
-class AdvancedProfile extends Component {
- state = {
- operationkey: 'tab1',
- stepDirection: 'horizontal',
- };
-
- componentDidMount() {
- const { dispatch } = this.props;
- dispatch({
- type: 'profile/fetchAdvanced',
- });
-
- this.setStepDirection();
- window.addEventListener('resize', this.setStepDirection, { passive: true });
- }
-
- componentWillUnmount() {
- window.removeEventListener('resize', this.setStepDirection);
- this.setStepDirection.cancel();
- }
-
- onOperationTabChange = key => {
- this.setState({ operationkey: key });
- };
-
- @Bind()
- @Debounce(200)
- setStepDirection() {
- const { stepDirection } = this.state;
- const w = getWindowWidth();
- if (stepDirection !== 'vertical' && w <= 576) {
- this.setState({
- stepDirection: 'vertical',
- });
- } else if (stepDirection !== 'horizontal' && w > 576) {
- this.setState({
- stepDirection: 'horizontal',
- });
- }
- }
-
- render() {
- const { stepDirection, operationkey } = this.state;
- const { profile, loading } = this.props;
- const { advancedOperation1, advancedOperation2, advancedOperation3 } = profile;
- const contentList = {
- tab1: (
-
- ),
- tab2: (
-
- ),
- tab3: (
-
- ),
- };
-
- return (
-
- }
- action={action}
- content={description}
- extraContent={extra}
- tabList={tabList}
- >
-
-
-
-
-
-
-
-
-
-
- 付小小
- 32943898021309809423
- 3321944288191034921
- 18112345678
-
- 曲丽丽 18100000000 浙江省杭州市西湖区黄姑山路工专路交叉路口
-
-
-
- 725
- 2017-08-08
-
-
- 某某数据
-
-
-
-
- }
- >
- 725
-
- 2017-08-08
-
- 信息组
-
-
- 林东东
- 1234567
- XX公司 - YY部
- 2017-08-08
-
- 这段描述很长很长很长很长很长很长很长很长很长很长很长很长很长很长...
-
-
-
-
-
- Citrullus lanatus (Thunb.) Matsum. et
- Nakai一年生蔓生藤本;茎、枝粗壮,具明显的棱。卷须较粗..
-
-
-
-
- 付小小
- 1234568
-
-
-
-
-
-
- 暂无数据
-
-
-
- {contentList[operationkey]}
-
-
- );
- }
-}
-
-export default AdvancedProfile;
diff --git a/src/pages/Profile/AdvancedProfile.less b/src/pages/Profile/AdvancedProfile.less
deleted file mode 100644
index 3897f11c20b20f21d44fb6ec7a5e9ec17db7706b..0000000000000000000000000000000000000000
--- a/src/pages/Profile/AdvancedProfile.less
+++ /dev/null
@@ -1,54 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.headerList {
- margin-bottom: 4px;
-}
-
-.tabsCard {
- :global {
- .ant-card-head {
- padding: 0 16px;
- }
- }
-}
-
-.noData {
- color: @disabled-color;
- text-align: center;
- line-height: 64px;
- font-size: 16px;
- i {
- font-size: 24px;
- margin-right: 16px;
- position: relative;
- top: 3px;
- }
-}
-
-.heading {
- color: @heading-color;
- font-size: 20px;
-}
-
-.stepDescription {
- font-size: 14px;
- position: relative;
- left: 38px;
- padding-top: 8px;
- text-align: left;
-
- > div {
- margin-top: 8px;
- margin-bottom: 4px;
- }
-}
-
-.textSecondary {
- color: @text-color-secondary;
-}
-
-@media screen and (max-width: @screen-sm) {
- .stepDescription {
- left: 8px;
- }
-}
diff --git a/src/pages/Profile/BasicProfile.js b/src/pages/Profile/BasicProfile.js
deleted file mode 100644
index 21f8b2ad65cc571529ac88bc1e69cbb7a2731a51..0000000000000000000000000000000000000000
--- a/src/pages/Profile/BasicProfile.js
+++ /dev/null
@@ -1,185 +0,0 @@
-import React, { Component } from 'react';
-import { connect } from 'dva';
-import { Card, Badge, Table, Divider } from 'antd';
-import DescriptionList from 'ant-design-pro/lib/DescriptionList';
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-import styles from './BasicProfile.less';
-
-const { Description } = DescriptionList;
-
-const progressColumns = [
- {
- title: '时间',
- dataIndex: 'time',
- key: 'time',
- },
- {
- title: '当前进度',
- dataIndex: 'rate',
- key: 'rate',
- },
- {
- title: '状态',
- dataIndex: 'status',
- key: 'status',
- render: text =>
- text === 'success' ? (
-
- ) : (
-
- ),
- },
- {
- title: '操作员ID',
- dataIndex: 'operator',
- key: 'operator',
- },
- {
- title: '耗时',
- dataIndex: 'cost',
- key: 'cost',
- },
-];
-
-@connect(({ profile, loading }) => ({
- profile,
- loading: loading.effects['profile/fetchBasic'],
-}))
-class BasicProfile extends Component {
- componentDidMount() {
- const { dispatch } = this.props;
- dispatch({
- type: 'profile/fetchBasic',
- });
- }
-
- render() {
- const { profile, loading } = this.props;
- const { basicGoods, basicProgress } = profile;
- let goodsData = [];
- if (basicGoods.length) {
- let num = 0;
- let amount = 0;
- basicGoods.forEach(item => {
- num += Number(item.num);
- amount += Number(item.amount);
- });
- goodsData = basicGoods.concat({
- id: '总计',
- num,
- amount,
- });
- }
- const renderContent = (value, row, index) => {
- const obj = {
- children: value,
- props: {},
- };
- if (index === basicGoods.length) {
- obj.props.colSpan = 0;
- }
- return obj;
- };
- const goodsColumns = [
- {
- title: '商品编号',
- dataIndex: 'id',
- key: 'id',
- render: (text, row, index) => {
- if (index < basicGoods.length) {
- return {text};
- }
- return {
- children: 总计,
- props: {
- colSpan: 4,
- },
- };
- },
- },
- {
- title: '商品名称',
- dataIndex: 'name',
- key: 'name',
- render: renderContent,
- },
- {
- title: '商品条码',
- dataIndex: 'barcode',
- key: 'barcode',
- render: renderContent,
- },
- {
- title: '单价',
- dataIndex: 'price',
- key: 'price',
- align: 'right',
- render: renderContent,
- },
- {
- title: '数量(件)',
- dataIndex: 'num',
- key: 'num',
- align: 'right',
- render: (text, row, index) => {
- if (index < basicGoods.length) {
- return text;
- }
- return {text};
- },
- },
- {
- title: '金额',
- dataIndex: 'amount',
- key: 'amount',
- align: 'right',
- render: (text, row, index) => {
- if (index < basicGoods.length) {
- return text;
- }
- return {text};
- },
- },
- ];
- return (
-
-
-
- 1000000000
- 已取货
- 1234123421
- 3214321432
-
-
-
- 付小小
- 18100000000
- 菜鸟仓储
- 浙江省杭州市西湖区万塘路18号
- 无
-
-
- 退货商品
-
- 退货进度
-
-
-
- );
- }
-}
-
-export default BasicProfile;
diff --git a/src/pages/Profile/BasicProfile.less b/src/pages/Profile/BasicProfile.less
deleted file mode 100644
index c830b0505733b794e813d20b08395f7df6273824..0000000000000000000000000000000000000000
--- a/src/pages/Profile/BasicProfile.less
+++ /dev/null
@@ -1,8 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.title {
- color: @heading-color;
- font-size: 16px;
- font-weight: 500;
- margin-bottom: 16px;
-}
diff --git a/src/pages/Profile/models/profile.js b/src/pages/Profile/models/profile.js
deleted file mode 100644
index de651b8afde813a230777c8af4d78dfecbfd86d7..0000000000000000000000000000000000000000
--- a/src/pages/Profile/models/profile.js
+++ /dev/null
@@ -1,38 +0,0 @@
-import { queryBasicProfile, queryAdvancedProfile } from '@/services/api';
-
-export default {
- namespace: 'profile',
-
- state: {
- basicGoods: [],
- advancedOperation1: [],
- advancedOperation2: [],
- advancedOperation3: [],
- },
-
- effects: {
- *fetchBasic(_, { call, put }) {
- const response = yield call(queryBasicProfile);
- yield put({
- type: 'show',
- payload: response,
- });
- },
- *fetchAdvanced(_, { call, put }) {
- const response = yield call(queryAdvancedProfile);
- yield put({
- type: 'show',
- payload: response,
- });
- },
- },
-
- reducers: {
- show(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- },
- },
-};
diff --git a/src/pages/Result/Error.js b/src/pages/Result/Error.js
deleted file mode 100644
index 1e0452c620104cbb3319fa8273f418d52dad8a51..0000000000000000000000000000000000000000
--- a/src/pages/Result/Error.js
+++ /dev/null
@@ -1,66 +0,0 @@
-import React, { Fragment } from 'react';
-import { formatMessage, FormattedMessage } from 'umi/locale';
-import { Button, Icon, Card } from 'antd';
-import Result from 'ant-design-pro/lib/Result';
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-
-const extra = (
-
-
-
-
-
-
-
-);
-
-const actions = (
-
-);
-
-export default () => (
-
-
-
-
-
-);
diff --git a/src/pages/Result/Success.js b/src/pages/Result/Success.js
deleted file mode 100644
index 6180c729648ea6aaa07892b4ae52aa6f91027fb5..0000000000000000000000000000000000000000
--- a/src/pages/Result/Success.js
+++ /dev/null
@@ -1,144 +0,0 @@
-import React, { Fragment } from 'react';
-import { formatMessage, FormattedMessage } from 'umi/locale';
-import { Button, Row, Col, Icon, Steps, Card } from 'antd';
-import Result from 'ant-design-pro/lib/Result';
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-
-const { Step } = Steps;
-
-const desc1 = (
-
-
-
-
-
-
2016-12-12 12:32
-
-);
-
-const desc2 = (
-
-);
-
-const extra = (
-
-
-
-
-
-
-
-
-
- 23421
-
-
-
-
-
-
-
-
-
-
-
- 2016-12-12 ~ 2017-12-12
-
-
-
-
-
-
- }
- description={desc1}
- />
-
-
-
- }
- description={desc2}
- />
-
-
-
- }
- />
-
-
-
- }
- />
-
-
-);
-
-const actions = (
-
-
-
-
-
-);
-
-export default () => (
-
-
-
-
-
-);
diff --git a/src/pages/Result/Success.test.js b/src/pages/Result/Success.test.js
deleted file mode 100644
index 9bc9b8dffdc39e5db8dbfd5b2c9e5203a4845e26..0000000000000000000000000000000000000000
--- a/src/pages/Result/Success.test.js
+++ /dev/null
@@ -1,9 +0,0 @@
-import React from 'react';
-import { shallow } from 'enzyme';
-import Success from './Success';
-
-it('renders with Result', () => {
- const wrapper = shallow();
- expect(wrapper.find('Result').length).toBe(1);
- expect(wrapper.find('Result').prop('type')).toBe('success');
-});
diff --git a/src/pages/User/Login.js b/src/pages/User/Login.js
deleted file mode 100644
index 84e301f2be5deda5c3fc041c79ea5bd2872e4578..0000000000000000000000000000000000000000
--- a/src/pages/User/Login.js
+++ /dev/null
@@ -1,168 +0,0 @@
-import React, { Component } from 'react';
-import { connect } from 'dva';
-import { formatMessage, FormattedMessage } from 'umi/locale';
-import Link from 'umi/link';
-import { Checkbox, Alert, Icon } from 'antd';
-import Login from 'ant-design-pro/lib/Login';
-import styles from './Login.less';
-
-const { Tab, UserName, Password, Mobile, Captcha, Submit } = Login;
-
-@connect(({ login, loading }) => ({
- login,
- submitting: loading.effects['login/login'],
-}))
-class LoginPage extends Component {
- state = {
- type: 'account',
- autoLogin: true,
- };
-
- onTabChange = type => {
- this.setState({ type });
- };
-
- onGetCaptcha = () =>
- new Promise((resolve, reject) => {
- this.loginForm.validateFields(['mobile'], {}, (err, values) => {
- if (err) {
- reject(err);
- } else {
- const { dispatch } = this.props;
- dispatch({
- type: 'login/getCaptcha',
- payload: values.mobile,
- })
- .then(resolve)
- .catch(reject);
- }
- });
- });
-
- handleSubmit = (err, values) => {
- const { type } = this.state;
- if (!err) {
- const { dispatch } = this.props;
- dispatch({
- type: 'login/login',
- payload: {
- ...values,
- type,
- },
- });
- }
- };
-
- changeAutoLogin = e => {
- this.setState({
- autoLogin: e.target.checked,
- });
- };
-
- renderMessage = content => (
-
- );
-
- render() {
- const { login, submitting } = this.props;
- const { type, autoLogin } = this.state;
- return (
-
-
{
- this.loginForm = form;
- }}
- >
-
- {login.status === 'error' &&
- login.type === 'account' &&
- !submitting &&
- this.renderMessage(formatMessage({ id: 'app.login.message-invalid-credentials' }))}
-
- this.loginForm.validateFields(this.handleSubmit)}
- />
-
-
- {login.status === 'error' &&
- login.type === 'mobile' &&
- !submitting &&
- this.renderMessage(
- formatMessage({ id: 'app.login.message-invalid-verification-code' })
- )}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default LoginPage;
diff --git a/src/pages/User/Login.less b/src/pages/User/Login.less
deleted file mode 100644
index 14a99ff11664d32aec1411154ec735ead61aae04..0000000000000000000000000000000000000000
--- a/src/pages/User/Login.less
+++ /dev/null
@@ -1,32 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.main {
- width: 368px;
- margin: 0 auto;
- @media screen and (max-width: @screen-sm) {
- width: 95%;
- }
-
- .icon {
- font-size: 24px;
- color: rgba(0, 0, 0, 0.2);
- margin-left: 16px;
- vertical-align: middle;
- cursor: pointer;
- transition: color 0.3s;
-
- &:hover {
- color: @primary-color;
- }
- }
-
- .other {
- text-align: left;
- margin-top: 24px;
- line-height: 22px;
-
- .register {
- float: right;
- }
- }
-}
diff --git a/src/pages/User/Register.js b/src/pages/User/Register.js
deleted file mode 100644
index ea4565c28bac77692a0f520ef372b7f4b8e5dc0a..0000000000000000000000000000000000000000
--- a/src/pages/User/Register.js
+++ /dev/null
@@ -1,334 +0,0 @@
-import React, { Component } from 'react';
-import { connect } from 'dva';
-import { formatMessage, FormattedMessage } from 'umi/locale';
-import Link from 'umi/link';
-import router from 'umi/router';
-import { Form, Input, Button, Select, Row, Col, Popover, Progress } from 'antd';
-import styles from './Register.less';
-
-const FormItem = Form.Item;
-const { Option } = Select;
-const InputGroup = Input.Group;
-
-const passwordStatusMap = {
- ok: (
-
-
-
- ),
- pass: (
-
-
-
- ),
- poor: (
-
-
-
- ),
-};
-
-const passwordProgressMap = {
- ok: 'success',
- pass: 'normal',
- poor: 'exception',
-};
-
-@connect(({ register, loading }) => ({
- register,
- submitting: loading.effects['register/submit'],
-}))
-@Form.create()
-class Register extends Component {
- state = {
- count: 0,
- confirmDirty: false,
- visible: false,
- help: '',
- prefix: '86',
- };
-
- componentDidUpdate() {
- const { form, register } = this.props;
- const account = form.getFieldValue('mail');
- if (register.status === 'ok') {
- router.push({
- pathname: '/user/register-result',
- state: {
- account,
- },
- });
- }
- }
-
- componentWillUnmount() {
- clearInterval(this.interval);
- }
-
- onGetCaptcha = () => {
- let count = 59;
- this.setState({ count });
- this.interval = setInterval(() => {
- count -= 1;
- this.setState({ count });
- if (count === 0) {
- clearInterval(this.interval);
- }
- }, 1000);
- };
-
- getPasswordStatus = () => {
- const { form } = this.props;
- const value = form.getFieldValue('password');
- if (value && value.length > 9) {
- return 'ok';
- }
- if (value && value.length > 5) {
- return 'pass';
- }
- return 'poor';
- };
-
- handleSubmit = e => {
- e.preventDefault();
- const { form, dispatch } = this.props;
- form.validateFields({ force: true }, (err, values) => {
- if (!err) {
- const { prefix } = this.state;
- dispatch({
- type: 'register/submit',
- payload: {
- ...values,
- prefix,
- },
- });
- }
- });
- };
-
- handleConfirmBlur = e => {
- const { value } = e.target;
- const { confirmDirty } = this.state;
- this.setState({ confirmDirty: confirmDirty || !!value });
- };
-
- checkConfirm = (rule, value, callback) => {
- const { form } = this.props;
- if (value && value !== form.getFieldValue('password')) {
- callback(formatMessage({ id: 'validation.password.twice' }));
- } else {
- callback();
- }
- };
-
- checkPassword = (rule, value, callback) => {
- const { visible, confirmDirty } = this.state;
- if (!value) {
- this.setState({
- help: formatMessage({ id: 'validation.password.required' }),
- visible: !!value,
- });
- callback('error');
- } else {
- this.setState({
- help: '',
- });
- if (!visible) {
- this.setState({
- visible: !!value,
- });
- }
- if (value.length < 6) {
- callback('error');
- } else {
- const { form } = this.props;
- if (value && confirmDirty) {
- form.validateFields(['confirm'], { force: true });
- }
- callback();
- }
- }
- };
-
- changePrefix = value => {
- this.setState({
- prefix: value,
- });
- };
-
- renderPasswordProgress = () => {
- const { form } = this.props;
- const value = form.getFieldValue('password');
- const passwordStatus = this.getPasswordStatus();
- return value && value.length ? (
-
-
- ) : null;
- };
-
- render() {
- const { form, submitting } = this.props;
- const { getFieldDecorator } = form;
- const { count, prefix, help, visible } = this.state;
- return (
-
-
-
-
-
-
- );
- }
-}
-
-export default Register;
diff --git a/src/pages/User/Register.less b/src/pages/User/Register.less
deleted file mode 100644
index acd1211a7f1458d3306dd52083015c4ed69fd7d6..0000000000000000000000000000000000000000
--- a/src/pages/User/Register.less
+++ /dev/null
@@ -1,57 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.main {
- width: 368px;
- margin: 0 auto;
-
- :global {
- .ant-form-item {
- margin-bottom: 24px;
- }
- }
-
- h3 {
- font-size: 16px;
- margin-bottom: 20px;
- }
-
- .getCaptcha {
- display: block;
- width: 100%;
- }
-
- .submit {
- width: 50%;
- }
-
- .login {
- float: right;
- line-height: @btn-height-lg;
- }
-}
-
-.success,
-.warning,
-.error {
- transition: color 0.3s;
-}
-
-.success {
- color: @success-color;
-}
-
-.warning {
- color: @warning-color;
-}
-
-.error {
- color: @error-color;
-}
-
-.progress-pass > .progress {
- :global {
- .ant-progress-bg {
- background-color: @warning-color;
- }
- }
-}
diff --git a/src/pages/User/RegisterResult.js b/src/pages/User/RegisterResult.js
deleted file mode 100644
index ea2d905b3742b8aafc210ecd7a287c37f8bd4535..0000000000000000000000000000000000000000
--- a/src/pages/User/RegisterResult.js
+++ /dev/null
@@ -1,41 +0,0 @@
-import React from 'react';
-import { formatMessage, FormattedMessage } from 'umi/locale';
-import { Button } from 'antd';
-import Link from 'umi/link';
-import Result from 'ant-design-pro/lib/Result';
-import styles from './RegisterResult.less';
-
-const actions = (
-
-);
-
-const RegisterResult = ({ location }) => (
-
-
-
- }
- description={formatMessage({ id: 'app.register-result.activation-email' })}
- actions={actions}
- style={{ marginTop: 56 }}
- />
-);
-
-export default RegisterResult;
diff --git a/src/pages/User/RegisterResult.less b/src/pages/User/RegisterResult.less
deleted file mode 100644
index a969a5eee1c69f1345c7fbc190c54cf94919e592..0000000000000000000000000000000000000000
--- a/src/pages/User/RegisterResult.less
+++ /dev/null
@@ -1,18 +0,0 @@
-.registerResult {
- :global {
- .anticon {
- font-size: 64px;
- }
- }
- .title {
- margin-top: 32px;
- font-size: 20px;
- line-height: 28px;
- }
- .actions {
- margin-top: 40px;
- a + a {
- margin-left: 8px;
- }
- }
-}
diff --git a/src/pages/User/models/register.js b/src/pages/User/models/register.js
deleted file mode 100644
index a2901bbd5c1393503bc0663eeee50b073ef33a08..0000000000000000000000000000000000000000
--- a/src/pages/User/models/register.js
+++ /dev/null
@@ -1,32 +0,0 @@
-import { fakeRegister } from '@/services/api';
-import { setAuthority } from '@/utils/authority';
-import { reloadAuthorized } from '@/utils/Authorized';
-
-export default {
- namespace: 'register',
-
- state: {
- status: undefined,
- },
-
- effects: {
- *submit({ payload }, { call, put }) {
- const response = yield call(fakeRegister, payload);
- yield put({
- type: 'registerHandle',
- payload: response,
- });
- },
- },
-
- reducers: {
- registerHandle(state, { payload }) {
- setAuthority('user');
- reloadAuthorized();
- return {
- ...state,
- status: payload.status,
- };
- },
- },
-};
diff --git a/src/pages/document.ejs b/src/pages/document.ejs
deleted file mode 100644
index eca451ca42a17566771387c377ab1e4cc99d1aec..0000000000000000000000000000000000000000
--- a/src/pages/document.ejs
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
- Ant Design Pro
-
-
-
-
-
-
-
-