{}
diff --git a/admin-web/src/components/Authorized/AuthorizedRoute.js b/admin-web/src/components/Authorized/AuthorizedRoute.js
deleted file mode 100644
index 39c6a665f..000000000
--- a/admin-web/src/components/Authorized/AuthorizedRoute.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import React from 'react';
-import { Route, Redirect } from 'react-router-dom';
-import Authorized from './Authorized';
-
-// TODO: umi只会返回render和rest
-const AuthorizedRoute = ({ component: Component, render, authority, redirectPath, ...rest }) => (
- } />}
- >
- (Component ? : render(props))} />
-
-);
-
-export default AuthorizedRoute;
diff --git a/admin-web/src/components/Authorized/CheckPermissions.js b/admin-web/src/components/Authorized/CheckPermissions.js
deleted file mode 100644
index ba83f5b9a..000000000
--- a/admin-web/src/components/Authorized/CheckPermissions.js
+++ /dev/null
@@ -1,88 +0,0 @@
-import React from 'react';
-import PromiseRender from './PromiseRender';
-import { CURRENT } from './renderAuthorize';
-
-function isPromise(obj) {
- return (
- !!obj &&
- (typeof obj === 'object' || typeof obj === 'function') &&
- typeof obj.then === 'function'
- );
-}
-
-/**
- * 通用权限检查方法
- * Common check permissions method
- * @param { 权限判定 Permission judgment type string |array | Promise | Function } authority
- * @param { 你的权限 Your permission description type:string} currentAuthority
- * @param { 通过的组件 Passing components } target
- * @param { 未通过的组件 no pass components } Exception
- */
-const checkPermissions = (authority, currentAuthority, target, Exception) => {
- // 没有判定权限.默认查看所有
- // Retirement authority, return target;
- if (!authority) {
- return target;
- }
- // 数组处理
- if (Array.isArray(authority)) {
- if (authority.indexOf(currentAuthority) >= 0) {
- return target;
- }
- if (Array.isArray(currentAuthority)) {
- for (let i = 0; i < currentAuthority.length; i += 1) {
- const element = currentAuthority[i];
- if (authority.indexOf(element) >= 0) {
- return target;
- }
- }
- }
- return Exception;
- }
-
- // string 处理
- if (typeof authority === 'string') {
- if (authority === currentAuthority) {
- return target;
- }
- if (Array.isArray(currentAuthority)) {
- for (let i = 0; i < currentAuthority.length; i += 1) {
- const element = currentAuthority[i];
- if (authority === element) {
- return target;
- }
- }
- }
- return Exception;
- }
-
- // Promise 处理
- if (isPromise(authority)) {
- return ;
- }
-
- // Function 处理
- if (typeof authority === 'function') {
- try {
- const bool = authority(currentAuthority);
- // 函数执行后返回值是 Promise
- if (isPromise(bool)) {
- return ;
- }
- if (bool) {
- return target;
- }
- return Exception;
- } catch (error) {
- throw error;
- }
- }
- throw new Error('unsupported parameters');
-};
-
-export { checkPermissions };
-
-const check = (authority, target, Exception) =>
- checkPermissions(authority, CURRENT, target, Exception);
-
-export default check;
diff --git a/admin-web/src/components/Authorized/CheckPermissions.test.js b/admin-web/src/components/Authorized/CheckPermissions.test.js
deleted file mode 100644
index 3988d85a1..000000000
--- a/admin-web/src/components/Authorized/CheckPermissions.test.js
+++ /dev/null
@@ -1,55 +0,0 @@
-import { checkPermissions } from './CheckPermissions';
-
-const target = 'ok';
-const error = 'error';
-
-describe('test CheckPermissions', () => {
- it('Correct string permission authentication', () => {
- expect(checkPermissions('user', 'user', target, error)).toEqual('ok');
- });
- it('Correct string permission authentication', () => {
- expect(checkPermissions('user', 'NULL', target, error)).toEqual('error');
- });
- it('authority is undefined , return ok', () => {
- expect(checkPermissions(null, 'NULL', target, error)).toEqual('ok');
- });
- it('currentAuthority is undefined , return error', () => {
- expect(checkPermissions('admin', null, target, error)).toEqual('error');
- });
- it('Wrong string permission authentication', () => {
- expect(checkPermissions('admin', 'user', target, error)).toEqual('error');
- });
- it('Correct Array permission authentication', () => {
- expect(checkPermissions(['user', 'admin'], 'user', target, error)).toEqual('ok');
- });
- it('Wrong Array permission authentication,currentAuthority error', () => {
- expect(checkPermissions(['user', 'admin'], 'user,admin', target, error)).toEqual('error');
- });
- it('Wrong Array permission authentication', () => {
- expect(checkPermissions(['user', 'admin'], 'guest', target, error)).toEqual('error');
- });
- it('Wrong Function permission authentication', () => {
- expect(checkPermissions(() => false, 'guest', target, error)).toEqual('error');
- });
- it('Correct Function permission authentication', () => {
- expect(checkPermissions(() => true, 'guest', target, error)).toEqual('ok');
- });
- it('authority is string, currentAuthority is array, return ok', () => {
- expect(checkPermissions('user', ['user'], target, error)).toEqual('ok');
- });
- it('authority is string, currentAuthority is array, return ok', () => {
- expect(checkPermissions('user', ['user', 'admin'], target, error)).toEqual('ok');
- });
- it('authority is array, currentAuthority is array, return ok', () => {
- expect(checkPermissions(['user', 'admin'], ['user', 'admin'], target, error)).toEqual('ok');
- });
- it('Wrong Function permission authentication', () => {
- expect(checkPermissions(() => false, ['user'], target, error)).toEqual('error');
- });
- it('Correct Function permission authentication', () => {
- expect(checkPermissions(() => true, ['user'], target, error)).toEqual('ok');
- });
- it('authority is undefined , return ok', () => {
- expect(checkPermissions(null, ['user'], target, error)).toEqual('ok');
- });
-});
diff --git a/admin-web/src/components/Authorized/PromiseRender.js b/admin-web/src/components/Authorized/PromiseRender.js
deleted file mode 100644
index 8e2a4059d..000000000
--- a/admin-web/src/components/Authorized/PromiseRender.js
+++ /dev/null
@@ -1,65 +0,0 @@
-import React from 'react';
-import { Spin } from 'antd';
-
-export default class PromiseRender extends React.PureComponent {
- state = {
- component: null,
- };
-
- componentDidMount() {
- this.setRenderComponent(this.props);
- }
-
- componentDidUpdate(nextProps) {
- // new Props enter
- this.setRenderComponent(nextProps);
- }
-
- // set render Component : ok or error
- setRenderComponent(props) {
- const ok = this.checkIsInstantiation(props.ok);
- const error = this.checkIsInstantiation(props.error);
- props.promise
- .then(() => {
- this.setState({
- component: ok,
- });
- })
- .catch(() => {
- this.setState({
- component: error,
- });
- });
- }
-
- // Determine whether the incoming component has been instantiated
- // AuthorizedRoute is already instantiated
- // Authorized render is already instantiated, children is no instantiated
- // Secured is not instantiated
- checkIsInstantiation = target => {
- if (!React.isValidElement(target)) {
- return target;
- }
- return () => target;
- };
-
- render() {
- const { component: Component } = this.state;
- const { ok, error, promise, ...rest } = this.props;
- return Component ? (
-
- ) : (
-
-
-
- );
- }
-}
diff --git a/admin-web/src/components/Authorized/Secured.js b/admin-web/src/components/Authorized/Secured.js
deleted file mode 100644
index c935183da..000000000
--- a/admin-web/src/components/Authorized/Secured.js
+++ /dev/null
@@ -1,55 +0,0 @@
-import React from 'react';
-import Exception from '../Exception';
-import CheckPermissions from './CheckPermissions';
-/**
- * 默认不能访问任何页面
- * default is "NULL"
- */
-const Exception403 = () => ;
-
-// Determine whether the incoming component has been instantiated
-// AuthorizedRoute is already instantiated
-// Authorized render is already instantiated, children is no instantiated
-// Secured is not instantiated
-const checkIsInstantiation = target => {
- if (!React.isValidElement(target)) {
- return target;
- }
- return () => target;
-};
-
-/**
- * 用于判断是否拥有权限访问此view权限
- * authority 支持传入 string, function:()=>boolean|Promise
- * e.g. 'user' 只有user用户能访问
- * e.g. 'user,admin' user和 admin 都能访问
- * e.g. ()=>boolean 返回true能访问,返回false不能访问
- * e.g. Promise then 能访问 catch不能访问
- * e.g. authority support incoming string, function: () => boolean | Promise
- * e.g. 'user' only user user can access
- * e.g. 'user, admin' user and admin can access
- * e.g. () => boolean true to be able to visit, return false can not be accessed
- * e.g. Promise then can not access the visit to catch
- * @param {string | function | Promise} authority
- * @param {ReactNode} error 非必需参数
- */
-const authorize = (authority, error) => {
- /**
- * conversion into a class
- * 防止传入字符串时找不到staticContext造成报错
- * String parameters can cause staticContext not found error
- */
- let classError = false;
- if (error) {
- classError = () => error;
- }
- if (!authority) {
- throw new Error('authority is required');
- }
- return function decideAuthority(target) {
- const component = CheckPermissions(authority, target, classError || Exception403);
- return checkIsInstantiation(component);
- };
-};
-
-export default authorize;
diff --git a/admin-web/src/components/Authorized/demo/AuthorizedArray.md b/admin-web/src/components/Authorized/demo/AuthorizedArray.md
deleted file mode 100644
index 46eaf761c..000000000
--- a/admin-web/src/components/Authorized/demo/AuthorizedArray.md
+++ /dev/null
@@ -1,23 +0,0 @@
----
-order: 1
-title:
- zh-CN: 使用数组作为参数
- en-US: Use Array as a parameter
----
-
-Use Array as a parameter
-
-```jsx
-import RenderAuthorized from 'ant-design-pro/lib/Authorized';
-import { Alert } from 'antd';
-
-const Authorized = RenderAuthorized('user');
-const noMatch = ;
-
-ReactDOM.render(
-
-
- ,
- mountNode,
-);
-```
diff --git a/admin-web/src/components/Authorized/demo/AuthorizedFunction.md b/admin-web/src/components/Authorized/demo/AuthorizedFunction.md
deleted file mode 100644
index 8ad8b91e1..000000000
--- a/admin-web/src/components/Authorized/demo/AuthorizedFunction.md
+++ /dev/null
@@ -1,31 +0,0 @@
----
-order: 2
-title:
- zh-CN: 使用方法作为参数
- en-US: Use function as a parameter
----
-
-Use Function as a parameter
-
-```jsx
-import RenderAuthorized from 'ant-design-pro/lib/Authorized';
-import { Alert } from 'antd';
-
-const Authorized = RenderAuthorized('user');
-const noMatch = ;
-
-const havePermission = () => {
- return false;
-};
-
-ReactDOM.render(
-
-
- ,
- mountNode,
-);
-```
diff --git a/admin-web/src/components/Authorized/demo/basic.md b/admin-web/src/components/Authorized/demo/basic.md
deleted file mode 100644
index a5f12f29e..000000000
--- a/admin-web/src/components/Authorized/demo/basic.md
+++ /dev/null
@@ -1,25 +0,0 @@
----
-order: 0
-title:
- zh-CN: 基本使用
- en-US: Basic use
----
-
-Basic use
-
-```jsx
-import RenderAuthorized from 'ant-design-pro/lib/Authorized';
-import { Alert } from 'antd';
-
-const Authorized = RenderAuthorized('user');
-const noMatch = ;
-
-ReactDOM.render(
- ,
- mountNode,
-);
-```
diff --git a/admin-web/src/components/Authorized/demo/secured.md b/admin-web/src/components/Authorized/demo/secured.md
deleted file mode 100644
index 1e9537af1..000000000
--- a/admin-web/src/components/Authorized/demo/secured.md
+++ /dev/null
@@ -1,28 +0,0 @@
----
-order: 3
-title:
- zh-CN: 注解基本使用
- en-US: Basic use secured
----
-
-secured demo used
-
-```jsx
-import RenderAuthorized from 'ant-design-pro/lib/Authorized';
-import { Alert } from 'antd';
-
-const { Secured } = RenderAuthorized('user');
-
-@Secured('admin')
-class TestSecuredString extends React.Component {
- render() {
- ;
- }
-}
-ReactDOM.render(
-
-
-
,
- mountNode,
-);
-```
diff --git a/admin-web/src/components/Authorized/index.d.ts b/admin-web/src/components/Authorized/index.d.ts
deleted file mode 100644
index b3e2f56c6..000000000
--- a/admin-web/src/components/Authorized/index.d.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-import * as React from 'react';
-import AuthorizedRoute, { authority } from './AuthorizedRoute';
-export type IReactComponent =
- | React.StatelessComponent
- | React.ComponentClass
- | React.ClassicComponentClass
;
-
-type Secured = (
- authority: authority,
- error?: React.ReactNode
-) => (target: T) => T;
-
-type check = (
- authority: authority,
- target: T,
- Exception: S
-) => T | S;
-
-export interface IAuthorizedProps {
- authority: authority;
- noMatch?: React.ReactNode;
-}
-
-export class Authorized extends React.Component {
- public static Secured: Secured;
- public static AuthorizedRoute: typeof AuthorizedRoute;
- public static check: check;
-}
-
-declare function renderAuthorize(currentAuthority: string): typeof Authorized;
-
-export default renderAuthorize;
diff --git a/admin-web/src/components/Authorized/index.js b/admin-web/src/components/Authorized/index.js
deleted file mode 100644
index 22ac664d0..000000000
--- a/admin-web/src/components/Authorized/index.js
+++ /dev/null
@@ -1,11 +0,0 @@
-import Authorized from './Authorized';
-import AuthorizedRoute from './AuthorizedRoute';
-import Secured from './Secured';
-import check from './CheckPermissions';
-import renderAuthorize from './renderAuthorize';
-
-Authorized.Secured = Secured;
-Authorized.AuthorizedRoute = AuthorizedRoute;
-Authorized.check = check;
-
-export default renderAuthorize(Authorized);
diff --git a/admin-web/src/components/Authorized/index.md b/admin-web/src/components/Authorized/index.md
deleted file mode 100644
index 48c93f8fa..000000000
--- a/admin-web/src/components/Authorized/index.md
+++ /dev/null
@@ -1,56 +0,0 @@
----
-title: Authorized
-subtitle: 权限
-cols: 1
-order: 15
----
-
-权限组件,通过比对现有权限与准入权限,决定相关元素的展示。
-
-## API
-
-### RenderAuthorized
-
-`RenderAuthorized: (currentAuthority: string | () => string) => Authorized`
-
-权限组件默认 export RenderAuthorized 函数,它接收当前权限作为参数,返回一个权限对象,该对象提供以下几种使用方式。
-
-
-### Authorized
-
-最基础的权限控制。
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| children | 正常渲染的元素,权限判断通过时展示 | ReactNode | - |
-| authority | 准入权限/权限判断 | `string | array | Promise | (currentAuthority) => boolean | Promise` | - |
-| noMatch | 权限异常渲染元素,权限判断不通过时展示 | ReactNode | - |
-
-### Authorized.AuthorizedRoute
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| authority | 准入权限/权限判断 | `string | array | Promise | (currentAuthority) => boolean | Promise` | - |
-| redirectPath | 权限异常时重定向的页面路由 | string | - |
-
-其余参数与 `Route` 相同。
-
-### Authorized.Secured
-
-注解方式,`@Authorized.Secured(authority, error)`
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| authority | 准入权限/权限判断 | `string | Promise | (currentAuthority) => boolean | Promise` | - |
-| error | 权限异常时渲染元素 | ReactNode | |
-
-### Authorized.check
-
-函数形式的 Authorized,用于某些不能被 HOC 包裹的组件。 `Authorized.check(authority, target, Exception)`
-注意:传入一个 Promise 时,无论正确还是错误返回的都是一个 ReactClass。
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| authority | 准入权限/权限判断 | `string | Promise | (currentAuthority) => boolean | Promise` | - |
-| target | 权限判断通过时渲染的元素 | ReactNode | - |
-| Exception | 权限异常时渲染元素 | ReactNode | - |
diff --git a/admin-web/src/components/Authorized/renderAuthorize.js b/admin-web/src/components/Authorized/renderAuthorize.js
deleted file mode 100644
index be373d996..000000000
--- a/admin-web/src/components/Authorized/renderAuthorize.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/* eslint-disable import/no-mutable-exports */
-let CURRENT = 'NULL';
-/**
- * use authority or getAuthority
- * @param {string|()=>String} currentAuthority
- */
-const renderAuthorize = Authorized => currentAuthority => {
- if (currentAuthority) {
- if (typeof currentAuthority === 'function') {
- CURRENT = currentAuthority();
- }
- if (
- Object.prototype.toString.call(currentAuthority) === '[object String]' ||
- Array.isArray(currentAuthority)
- ) {
- CURRENT = currentAuthority;
- }
- } else {
- CURRENT = 'NULL';
- }
- return Authorized;
-};
-
-export { CURRENT };
-export default Authorized => renderAuthorize(Authorized);
diff --git a/admin-web/src/components/AvatarList/AvatarItem.d.ts b/admin-web/src/components/AvatarList/AvatarItem.d.ts
deleted file mode 100644
index 5681de77c..000000000
--- a/admin-web/src/components/AvatarList/AvatarItem.d.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import * as React from 'react';
-export interface IAvatarItemProps {
- tips: React.ReactNode;
- src: string;
- style?: React.CSSProperties;
-}
-
-export default class AvatarItem extends React.Component {
- constructor(props: IAvatarItemProps);
-}
diff --git a/admin-web/src/components/AvatarList/demo/maxLength.md b/admin-web/src/components/AvatarList/demo/maxLength.md
deleted file mode 100644
index 76c6b421c..000000000
--- a/admin-web/src/components/AvatarList/demo/maxLength.md
+++ /dev/null
@@ -1,24 +0,0 @@
----
-order: 0
-title:
- zh-CN: 要显示的最大项目
- en-US: Max Items to Show
----
-
-`maxLength` attribute specifies the maximum number of items to show while `excessItemsStyle` style the excess
-item component.
-
-````jsx
-import AvatarList from 'ant-design-pro/lib/AvatarList';
-
-ReactDOM.render(
-
-
-
-
-
-
-
-
-, mountNode);
-````
diff --git a/admin-web/src/components/AvatarList/demo/simple.md b/admin-web/src/components/AvatarList/demo/simple.md
deleted file mode 100644
index e941aea9b..000000000
--- a/admin-web/src/components/AvatarList/demo/simple.md
+++ /dev/null
@@ -1,20 +0,0 @@
----
-order: 0
-title:
- zh-CN: 基础样例
- en-US: Basic Usage
----
-
-Simplest of usage.
-
-````jsx
-import AvatarList from 'ant-design-pro/lib/AvatarList';
-
-ReactDOM.render(
-
-
-
-
-
-, mountNode);
-````
diff --git a/admin-web/src/components/AvatarList/index.d.ts b/admin-web/src/components/AvatarList/index.d.ts
deleted file mode 100644
index f49ca010d..000000000
--- a/admin-web/src/components/AvatarList/index.d.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import * as React from 'react';
-import AvatarItem from './AvatarItem';
-
-export interface IAvatarListProps {
- size?: 'large' | 'small' | 'mini' | 'default';
- maxLength?: number;
- excessItemsStyle?: React.CSSProperties;
- style?: React.CSSProperties;
- children: React.ReactElement | Array>;
-}
-
-export default class AvatarList extends React.Component {
- public static Item: typeof AvatarItem;
-}
diff --git a/admin-web/src/components/AvatarList/index.en-US.md b/admin-web/src/components/AvatarList/index.en-US.md
deleted file mode 100644
index 7fc39cc2b..000000000
--- a/admin-web/src/components/AvatarList/index.en-US.md
+++ /dev/null
@@ -1,24 +0,0 @@
----
-title: AvatarList
-order: 1
-cols: 1
----
-
-A list of user's avatar for project or group member list frequently. If a large or small AvatarList is desired, set the `size` property to either `large` or `small` and `mini` respectively. Omit the `size` property for a AvatarList with the default size.
-
-## API
-
-### AvatarList
-
-| Property | Description | Type | Default |
-| ---------------- | --------------------- | ---------------------------------- | --------- |
-| size | size of list | `large`、`small` 、`mini`, `default` | `default` |
-| maxLength | max items to show | number | - |
-| excessItemsStyle | the excess item style | CSSProperties | - |
-
-### AvatarList.Item
-
-| Property | Description | Type | Default |
-| -------- | -------------------------------------------- | --------- | ------- |
-| tips | title tips for avatar item | ReactNode | - |
-| src | the address of the image for an image avatar | string | - |
diff --git a/admin-web/src/components/AvatarList/index.js b/admin-web/src/components/AvatarList/index.js
deleted file mode 100644
index 9af32bcfd..000000000
--- a/admin-web/src/components/AvatarList/index.js
+++ /dev/null
@@ -1,61 +0,0 @@
-import React from 'react';
-import { Tooltip, Avatar } from 'antd';
-import classNames from 'classnames';
-
-import styles from './index.less';
-
-const avatarSizeToClassName = size =>
- classNames(styles.avatarItem, {
- [styles.avatarItemLarge]: size === 'large',
- [styles.avatarItemSmall]: size === 'small',
- [styles.avatarItemMini]: size === 'mini',
- });
-
-const AvatarList = ({ children, size, maxLength, excessItemsStyle, ...other }) => {
- const numOfChildren = React.Children.count(children);
- const numToShow = maxLength >= numOfChildren ? numOfChildren : maxLength;
-
- const childrenWithProps = React.Children.toArray(children)
- .slice(0, numToShow)
- .map(child =>
- React.cloneElement(child, {
- size,
- })
- );
-
- if (numToShow < numOfChildren) {
- const cls = avatarSizeToClassName(size);
-
- childrenWithProps.push(
-
- {`+${numOfChildren - maxLength}`}
-
- );
- }
-
- return (
-
- );
-};
-
-const Item = ({ src, size, tips, onClick = () => {} }) => {
- const cls = avatarSizeToClassName(size);
-
- return (
-
- {tips ? (
-
-
-
- ) : (
-
- )}
-
- );
-};
-
-AvatarList.Item = Item;
-
-export default AvatarList;
diff --git a/admin-web/src/components/AvatarList/index.less b/admin-web/src/components/AvatarList/index.less
deleted file mode 100644
index 45904ce6a..000000000
--- a/admin-web/src/components/AvatarList/index.less
+++ /dev/null
@@ -1,50 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.avatarList {
- display: inline-block;
- ul {
- display: inline-block;
- margin-left: 8px;
- font-size: 0;
- }
-}
-
-.avatarItem {
- display: inline-block;
- width: @avatar-size-base;
- height: @avatar-size-base;
- margin-left: -8px;
- font-size: @font-size-base;
- :global {
- .ant-avatar {
- border: 1px solid #fff;
- }
- }
-}
-
-.avatarItemLarge {
- width: @avatar-size-lg;
- height: @avatar-size-lg;
-}
-
-.avatarItemSmall {
- width: @avatar-size-sm;
- height: @avatar-size-sm;
-}
-
-.avatarItemMini {
- width: 20px;
- height: 20px;
- :global {
- .ant-avatar {
- width: 20px;
- height: 20px;
- line-height: 20px;
-
- .ant-avatar-string {
- font-size: 12px;
- line-height: 18px;
- }
- }
- }
-}
diff --git a/admin-web/src/components/AvatarList/index.test.js b/admin-web/src/components/AvatarList/index.test.js
deleted file mode 100644
index 2b5bc438d..000000000
--- a/admin-web/src/components/AvatarList/index.test.js
+++ /dev/null
@@ -1,29 +0,0 @@
-import React from 'react';
-import range from 'lodash/range';
-import { mount } from 'enzyme';
-import AvatarList from './index';
-
-const renderItems = numItems =>
- range(numItems).map(i => (
-
- ));
-
-describe('AvatarList', () => {
- it('renders all items', () => {
- const wrapper = mount({renderItems(4)});
- expect(wrapper.find('AvatarList').length).toBe(1);
- expect(wrapper.find('Item').length).toBe(4);
- expect(wrapper.findWhere(node => node.key() === 'exceed').length).toBe(0);
- });
-
- it('renders max of 3 items', () => {
- const wrapper = mount({renderItems(4)});
- expect(wrapper.find('AvatarList').length).toBe(1);
- expect(wrapper.find('Item').length).toBe(3);
- expect(wrapper.findWhere(node => node.key() === 'exceed').length).toBe(1);
- });
-});
diff --git a/admin-web/src/components/AvatarList/index.zh-CN.md b/admin-web/src/components/AvatarList/index.zh-CN.md
deleted file mode 100644
index bdab181ce..000000000
--- a/admin-web/src/components/AvatarList/index.zh-CN.md
+++ /dev/null
@@ -1,25 +0,0 @@
----
-title: AvatarList
-subtitle: 用户头像列表
-order: 1
-cols: 1
----
-
-一组用户头像,常用在项目/团队成员列表。可通过设置 `size` 属性来指定头像大小。
-
-## API
-
-### AvatarList
-
-| 参数 | 说明 | 类型 | 默认值 |
-| ---------------- | -------- | ---------------------------------- | --------- |
-| size | 头像大小 | `large`、`small` 、`mini`, `default` | `default` |
-| maxLength | 要显示的最大项目 | number | - |
-| excessItemsStyle | 多余的项目风格 | CSSProperties | - |
-
-### AvatarList.Item
-
-| 参数 | 说明 | 类型 | 默认值 |
-| ---- | ------ | --------- | --- |
-| tips | 头像展示文案 | ReactNode | - |
-| src | 头像图片连接 | string | - |
diff --git a/admin-web/src/components/Charts/AsyncLoadBizCharts.js b/admin-web/src/components/Charts/AsyncLoadBizCharts.js
deleted file mode 100644
index 8d9a2cd05..000000000
--- a/admin-web/src/components/Charts/AsyncLoadBizCharts.js
+++ /dev/null
@@ -1,44 +0,0 @@
-import React from 'react';
-import PageLoading from '../PageLoading';
-import { importCDN } from '@/utils/utils';
-
-let isLoaderBizChart = false;
-const loadBizCharts = async () => {
- if (isLoaderBizChart) {
- return Promise.resolve(true);
- }
- await Promise.all([
- importCDN('//gw.alipayobjects.com/os/lib/bizcharts/3.4.3/umd/BizCharts.min.js'),
- importCDN('//gw.alipayobjects.com/os/lib/antv/data-set/0.10.1/dist/data-set.min.js'),
- ]);
- // eslint-disable-next-line no-console
- console.log('bizCharts load success');
- isLoaderBizChart = true;
- return Promise.resolve(true);
-};
-
-class AsyncLoadBizCharts extends React.Component {
- state = {
- loading: !isLoaderBizChart,
- };
-
- async componentDidMount() {
- await loadBizCharts();
- requestAnimationFrame(() => {
- this.setState({
- loading: false,
- });
- });
- }
-
- render() {
- const { children } = this.props;
- const { loading } = this.state;
- if (!loading) {
- return children;
- }
- return ;
- }
-}
-
-export { loadBizCharts, AsyncLoadBizCharts };
diff --git a/admin-web/src/components/Charts/Bar/index.d.ts b/admin-web/src/components/Charts/Bar/index.d.ts
deleted file mode 100644
index 489908250..000000000
--- a/admin-web/src/components/Charts/Bar/index.d.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import * as React from 'react';
-export interface IBarProps {
- title: React.ReactNode;
- color?: string;
- padding?: [number, number, number, number];
- height: number;
- data: Array<{
- x: string;
- y: number;
- }>;
- autoLabel?: boolean;
- style?: React.CSSProperties;
-}
-
-export default class Bar extends React.Component {}
diff --git a/admin-web/src/components/Charts/Bar/index.js b/admin-web/src/components/Charts/Bar/index.js
deleted file mode 100644
index f0cb65ffe..000000000
--- a/admin-web/src/components/Charts/Bar/index.js
+++ /dev/null
@@ -1,113 +0,0 @@
-import React, { Component } from 'react';
-import { Chart, Axis, Tooltip, Geom } from 'bizcharts';
-import Debounce from 'lodash-decorators/debounce';
-import Bind from 'lodash-decorators/bind';
-import autoHeight from '../autoHeight';
-import styles from '../index.less';
-
-@autoHeight()
-class Bar extends Component {
- state = {
- autoHideXLabels: false,
- };
-
- componentDidMount() {
- window.addEventListener('resize', this.resize, { passive: true });
- }
-
- componentWillUnmount() {
- window.removeEventListener('resize', this.resize);
- }
-
- handleRoot = n => {
- this.root = n;
- };
-
- handleRef = n => {
- this.node = n;
- };
-
- @Bind()
- @Debounce(400)
- resize() {
- if (!this.node) {
- return;
- }
- const canvasWidth = this.node.parentNode.clientWidth;
- const { data = [], autoLabel = true } = this.props;
- if (!autoLabel) {
- return;
- }
- const minWidth = data.length * 30;
- const { autoHideXLabels } = this.state;
-
- if (canvasWidth <= minWidth) {
- if (!autoHideXLabels) {
- this.setState({
- autoHideXLabels: true,
- });
- }
- } else if (autoHideXLabels) {
- this.setState({
- autoHideXLabels: false,
- });
- }
- }
-
- render() {
- const {
- height,
- title,
- forceFit = true,
- data,
- color = 'rgba(24, 144, 255, 0.85)',
- padding,
- } = this.props;
-
- const { autoHideXLabels } = this.state;
-
- const scale = {
- x: {
- type: 'cat',
- },
- y: {
- min: 0,
- },
- };
-
- const tooltip = [
- 'x*y',
- (x, y) => ({
- name: x,
- value: y,
- }),
- ];
-
- return (
-
-
- {title &&
{title}
}
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default Bar;
diff --git a/admin-web/src/components/Charts/ChartCard/index.d.ts b/admin-web/src/components/Charts/ChartCard/index.d.ts
deleted file mode 100644
index 0437c0c85..000000000
--- a/admin-web/src/components/Charts/ChartCard/index.d.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { CardProps } from 'antd/lib/card';
-import * as React from 'react';
-
-export interface IChartCardProps extends CardProps {
- title: React.ReactNode;
- action?: React.ReactNode;
- total?: React.ReactNode | number | (() => React.ReactNode | number);
- footer?: React.ReactNode;
- contentHeight?: number;
- avatar?: React.ReactNode;
- style?: React.CSSProperties;
-}
-
-export default class ChartCard extends React.Component {}
diff --git a/admin-web/src/components/Charts/ChartCard/index.js b/admin-web/src/components/Charts/ChartCard/index.js
deleted file mode 100644
index ca6bcb2e6..000000000
--- a/admin-web/src/components/Charts/ChartCard/index.js
+++ /dev/null
@@ -1,82 +0,0 @@
-import React from 'react';
-import { Card } from 'antd';
-import classNames from 'classnames';
-
-import styles from './index.less';
-
-const renderTotal = total => {
- let totalDom;
- switch (typeof total) {
- case 'undefined':
- totalDom = null;
- break;
- case 'function':
- totalDom = {total()}
;
- break;
- default:
- totalDom = {total}
;
- }
- return totalDom;
-};
-
-class ChartCard extends React.PureComponent {
- renderConnet = () => {
- const { contentHeight, title, avatar, action, total, footer, children, loading } = this.props;
- if (loading) {
- return false;
- }
- return (
-
-
-
{avatar}
-
-
- {title}
- {action}
-
- {renderTotal(total)}
-
-
- {children && (
-
- )}
- {footer && (
-
- {footer}
-
- )}
-
- );
- };
-
- render() {
- const {
- loading = false,
- contentHeight,
- title,
- avatar,
- action,
- total,
- footer,
- children,
- ...rest
- } = this.props;
- return (
-
- {this.renderConnet()}
-
- );
- }
-}
-
-export default ChartCard;
diff --git a/admin-web/src/components/Charts/ChartCard/index.less b/admin-web/src/components/Charts/ChartCard/index.less
deleted file mode 100644
index 282f17d9c..000000000
--- a/admin-web/src/components/Charts/ChartCard/index.less
+++ /dev/null
@@ -1,75 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.chartCard {
- position: relative;
- .chartTop {
- position: relative;
- width: 100%;
- overflow: hidden;
- }
- .chartTopMargin {
- margin-bottom: 12px;
- }
- .chartTopHasMargin {
- margin-bottom: 20px;
- }
- .metaWrap {
- float: left;
- }
- .avatar {
- position: relative;
- top: 4px;
- float: left;
- margin-right: 20px;
- img {
- border-radius: 100%;
- }
- }
- .meta {
- height: 22px;
- color: @text-color-secondary;
- font-size: @font-size-base;
- line-height: 22px;
- }
- .action {
- position: absolute;
- top: 4px;
- right: 0;
- line-height: 1;
- cursor: pointer;
- }
- .total {
- height: 38px;
- margin-top: 4px;
- margin-bottom: 0;
- overflow: hidden;
- color: @heading-color;
- font-size: 30px;
- line-height: 38px;
- white-space: nowrap;
- text-overflow: ellipsis;
- word-break: break-all;
- }
- .content {
- position: relative;
- width: 100%;
- margin-bottom: 12px;
- }
- .contentFixed {
- position: absolute;
- bottom: 0;
- left: 0;
- width: 100%;
- }
- .footer {
- margin-top: 8px;
- padding-top: 9px;
- border-top: 1px solid @border-color-split;
- & > * {
- position: relative;
- }
- }
- .footerMargin {
- margin-top: 20px;
- }
-}
diff --git a/admin-web/src/components/Charts/Field/index.d.ts b/admin-web/src/components/Charts/Field/index.d.ts
deleted file mode 100644
index 975fb667d..000000000
--- a/admin-web/src/components/Charts/Field/index.d.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import * as React from 'react';
-export interface IFieldProps {
- label: React.ReactNode;
- value: React.ReactNode;
- style?: React.CSSProperties;
-}
-
-export default class Field extends React.Component {}
diff --git a/admin-web/src/components/Charts/Field/index.js b/admin-web/src/components/Charts/Field/index.js
deleted file mode 100644
index 22dca86c0..000000000
--- a/admin-web/src/components/Charts/Field/index.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import React from 'react';
-
-import styles from './index.less';
-
-const Field = ({ label, value, ...rest }) => (
-
- {label}
- {value}
-
-);
-
-export default Field;
diff --git a/admin-web/src/components/Charts/Field/index.less b/admin-web/src/components/Charts/Field/index.less
deleted file mode 100644
index 4124471cb..000000000
--- a/admin-web/src/components/Charts/Field/index.less
+++ /dev/null
@@ -1,17 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.field {
- margin: 0;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- .label,
- .number {
- font-size: @font-size-base;
- line-height: 22px;
- }
- .number {
- margin-left: 8px;
- color: @heading-color;
- }
-}
diff --git a/admin-web/src/components/Charts/Gauge/index.d.ts b/admin-web/src/components/Charts/Gauge/index.d.ts
deleted file mode 100644
index 66e3c003a..000000000
--- a/admin-web/src/components/Charts/Gauge/index.d.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import * as React from 'react';
-export interface IGaugeProps {
- title: React.ReactNode;
- color?: string;
- height: number;
- bgColor?: number;
- percent: number;
- style?: React.CSSProperties;
-}
-
-export default class Gauge extends React.Component {}
diff --git a/admin-web/src/components/Charts/Gauge/index.js b/admin-web/src/components/Charts/Gauge/index.js
deleted file mode 100644
index 2249211ae..000000000
--- a/admin-web/src/components/Charts/Gauge/index.js
+++ /dev/null
@@ -1,167 +0,0 @@
-import React from 'react';
-import { Chart, Geom, Axis, Coord, Guide, Shape } from 'bizcharts';
-import autoHeight from '../autoHeight';
-
-const { Arc, Html, Line } = Guide;
-
-const defaultFormatter = val => {
- switch (val) {
- case '2':
- return '差';
- case '4':
- return '中';
- case '6':
- return '良';
- case '8':
- return '优';
- default:
- return '';
- }
-};
-
-Shape.registerShape('point', 'pointer', {
- drawShape(cfg, group) {
- let point = cfg.points[0];
- point = this.parsePoint(point);
- const center = this.parsePoint({
- x: 0,
- y: 0,
- });
- group.addShape('line', {
- attrs: {
- x1: center.x,
- y1: center.y,
- x2: point.x,
- y2: point.y,
- stroke: cfg.color,
- lineWidth: 2,
- lineCap: 'round',
- },
- });
- return group.addShape('circle', {
- attrs: {
- x: center.x,
- y: center.y,
- r: 6,
- stroke: cfg.color,
- lineWidth: 3,
- fill: '#fff',
- },
- });
- },
-});
-
-@autoHeight()
-class Gauge extends React.Component {
- render() {
- const {
- title,
- height,
- percent,
- forceFit = true,
- formatter = defaultFormatter,
- color = '#2F9CFF',
- bgColor = '#F0F2F5',
- } = this.props;
- const cols = {
- value: {
- type: 'linear',
- min: 0,
- max: 10,
- tickCount: 6,
- nice: true,
- },
- };
- const data = [{ value: percent / 10 }];
- return (
-
-
-
-
-
-
-
-
-
-
- `
-
-
${title}
-
- ${data[0].value * 10}%
-
-
`}
- />
-
-
-
- );
- }
-}
-
-export default Gauge;
diff --git a/admin-web/src/components/Charts/MiniArea/index.d.ts b/admin-web/src/components/Charts/MiniArea/index.d.ts
deleted file mode 100644
index b223b68ca..000000000
--- a/admin-web/src/components/Charts/MiniArea/index.d.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import * as React from 'react';
-
-// g2已经更新到3.0
-// 不带的写了
-
-export interface IAxis {
- title: any;
- line: any;
- gridAlign: any;
- labels: any;
- tickLine: any;
- grid: any;
-}
-
-export interface IMiniAreaProps {
- color?: string;
- height: number;
- borderColor?: string;
- line?: boolean;
- animate?: boolean;
- xAxis?: IAxis;
- yAxis?: IAxis;
- data: Array<{
- x: number | string;
- y: number;
- }>;
-}
-
-export default class MiniArea extends React.Component {}
diff --git a/admin-web/src/components/Charts/MiniArea/index.js b/admin-web/src/components/Charts/MiniArea/index.js
deleted file mode 100644
index d3209beca..000000000
--- a/admin-web/src/components/Charts/MiniArea/index.js
+++ /dev/null
@@ -1,108 +0,0 @@
-import React from 'react';
-import { Chart, Axis, Tooltip, Geom } from 'bizcharts';
-import autoHeight from '../autoHeight';
-import styles from '../index.less';
-
-@autoHeight()
-class MiniArea extends React.PureComponent {
- render() {
- const {
- height,
- data = [],
- forceFit = true,
- color = 'rgba(24, 144, 255, 0.2)',
- borderColor = '#1089ff',
- scale = {},
- borderWidth = 2,
- line,
- xAxis,
- yAxis,
- animate = true,
- } = this.props;
-
- const padding = [36, 5, 30, 5];
-
- const scaleProps = {
- x: {
- type: 'cat',
- range: [0, 1],
- ...scale.x,
- },
- y: {
- min: 0,
- ...scale.y,
- },
- };
-
- const tooltip = [
- 'x*y',
- (x, y) => ({
- name: x,
- value: y,
- }),
- ];
-
- const chartHeight = height + 54;
-
- return (
-
-
- {height > 0 && (
-
-
-
-
-
- {line ? (
-
- ) : (
-
- )}
-
- )}
-
-
- );
- }
-}
-
-export default MiniArea;
diff --git a/admin-web/src/components/Charts/MiniBar/index.d.ts b/admin-web/src/components/Charts/MiniBar/index.d.ts
deleted file mode 100644
index 0c4bd6cce..000000000
--- a/admin-web/src/components/Charts/MiniBar/index.d.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import * as React from 'react';
-export interface IMiniBarProps {
- color?: string;
- height: number;
- data: Array<{
- x: number | string;
- y: number;
- }>;
- style?: React.CSSProperties;
-}
-
-export default class MiniBar extends React.Component {}
diff --git a/admin-web/src/components/Charts/MiniBar/index.js b/admin-web/src/components/Charts/MiniBar/index.js
deleted file mode 100644
index 18e4d8c6f..000000000
--- a/admin-web/src/components/Charts/MiniBar/index.js
+++ /dev/null
@@ -1,51 +0,0 @@
-import React from 'react';
-import { Chart, Tooltip, Geom } from 'bizcharts';
-import autoHeight from '../autoHeight';
-import styles from '../index.less';
-
-@autoHeight()
-class MiniBar extends React.Component {
- render() {
- const { height, forceFit = true, color = '#1890FF', data = [] } = this.props;
-
- const scale = {
- x: {
- type: 'cat',
- },
- y: {
- min: 0,
- },
- };
-
- const padding = [36, 5, 30, 5];
-
- const tooltip = [
- 'x*y',
- (x, y) => ({
- name: x,
- value: y,
- }),
- ];
-
- // for tooltip not to be hide
- const chartHeight = height + 54;
-
- return (
-
- );
- }
-}
-export default MiniBar;
diff --git a/admin-web/src/components/Charts/MiniProgress/index.d.ts b/admin-web/src/components/Charts/MiniProgress/index.d.ts
deleted file mode 100644
index aaeb7261d..000000000
--- a/admin-web/src/components/Charts/MiniProgress/index.d.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import * as React from 'react';
-export interface IMiniProgressProps {
- target: number;
- color?: string;
- strokeWidth?: number;
- percent?: number;
- style?: React.CSSProperties;
-}
-
-export default class MiniProgress extends React.Component {}
diff --git a/admin-web/src/components/Charts/MiniProgress/index.js b/admin-web/src/components/Charts/MiniProgress/index.js
deleted file mode 100644
index 795c79b15..000000000
--- a/admin-web/src/components/Charts/MiniProgress/index.js
+++ /dev/null
@@ -1,27 +0,0 @@
-import React from 'react';
-import { Tooltip } from 'antd';
-
-import styles from './index.less';
-
-const MiniProgress = ({ target, color = 'rgb(19, 194, 194)', strokeWidth, percent }) => (
-
-);
-
-export default MiniProgress;
diff --git a/admin-web/src/components/Charts/MiniProgress/index.less b/admin-web/src/components/Charts/MiniProgress/index.less
deleted file mode 100644
index 40ba70be6..000000000
--- a/admin-web/src/components/Charts/MiniProgress/index.less
+++ /dev/null
@@ -1,35 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.miniProgress {
- position: relative;
- width: 100%;
- padding: 5px 0;
- .progressWrap {
- position: relative;
- background-color: @background-color-base;
- }
- .progress {
- width: 0;
- height: 100%;
- background-color: @primary-color;
- border-radius: 1px 0 0 1px;
- transition: all 0.4s cubic-bezier(0.08, 0.82, 0.17, 1) 0s;
- }
- .target {
- position: absolute;
- top: 0;
- bottom: 0;
- span {
- position: absolute;
- top: 0;
- left: 0;
- width: 2px;
- height: 4px;
- border-radius: 100px;
- }
- span:last-child {
- top: auto;
- bottom: 0;
- }
- }
-}
diff --git a/admin-web/src/components/Charts/Pie/index.d.ts b/admin-web/src/components/Charts/Pie/index.d.ts
deleted file mode 100644
index 66c93eeb5..000000000
--- a/admin-web/src/components/Charts/Pie/index.d.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import * as React from 'react';
-export interface IPieProps {
- animate?: boolean;
- color?: string;
- colors?: string[];
- height: number;
- hasLegend?: boolean;
- padding?: [number, number, number, number];
- percent?: number;
- data?: Array<{
- x: string | string;
- y: number;
- }>;
- total?: React.ReactNode | number | (() => React.ReactNode | number);
- title?: React.ReactNode;
- tooltip?: boolean;
- valueFormat?: (value: string) => string | React.ReactNode;
- subTitle?: React.ReactNode;
-}
-
-export default class Pie extends React.Component {}
diff --git a/admin-web/src/components/Charts/Pie/index.js b/admin-web/src/components/Charts/Pie/index.js
deleted file mode 100644
index 7dff5123f..000000000
--- a/admin-web/src/components/Charts/Pie/index.js
+++ /dev/null
@@ -1,271 +0,0 @@
-import React, { Component } from 'react';
-import { Chart, Tooltip, Geom, Coord } from 'bizcharts';
-import { DataView } from '@antv/data-set';
-import { Divider } from 'antd';
-import classNames from 'classnames';
-import ReactFitText from 'react-fittext';
-import Debounce from 'lodash-decorators/debounce';
-import Bind from 'lodash-decorators/bind';
-import autoHeight from '../autoHeight';
-
-import styles from './index.less';
-
-/* eslint react/no-danger:0 */
-@autoHeight()
-class Pie extends Component {
- state = {
- legendData: [],
- legendBlock: false,
- };
-
- componentDidMount() {
- window.addEventListener(
- 'resize',
- () => {
- this.requestRef = requestAnimationFrame(() => this.resize());
- },
- { passive: true }
- );
- }
-
- componentDidUpdate(preProps) {
- const { data } = this.props;
- if (data !== preProps.data) {
- // because of charts data create when rendered
- // so there is a trick for get rendered time
- this.getLegendData();
- }
- }
-
- componentWillUnmount() {
- window.cancelAnimationFrame(this.requestRef);
- window.removeEventListener('resize', this.resize);
- this.resize.cancel();
- }
-
- getG2Instance = chart => {
- this.chart = chart;
- requestAnimationFrame(() => {
- this.getLegendData();
- this.resize();
- });
- };
-
- // for custom lengend view
- getLegendData = () => {
- if (!this.chart) return;
- const geom = this.chart.getAllGeoms()[0]; // 获取所有的图形
- if (!geom) return;
- const items = geom.get('dataArray') || []; // 获取图形对应的
-
- const legendData = items.map(item => {
- /* eslint no-underscore-dangle:0 */
- const origin = item[0]._origin;
- origin.color = item[0].color;
- origin.checked = true;
- return origin;
- });
-
- this.setState({
- legendData,
- });
- };
-
- handleRoot = n => {
- this.root = n;
- };
-
- handleLegendClick = (item, i) => {
- const newItem = item;
- newItem.checked = !newItem.checked;
-
- const { legendData } = this.state;
- legendData[i] = newItem;
-
- const filteredLegendData = legendData.filter(l => l.checked).map(l => l.x);
-
- if (this.chart) {
- this.chart.filter('x', val => filteredLegendData.indexOf(val) > -1);
- }
-
- this.setState({
- legendData,
- });
- };
-
- // for window resize auto responsive legend
- @Bind()
- @Debounce(300)
- resize() {
- const { hasLegend } = this.props;
- const { legendBlock } = this.state;
- if (!hasLegend || !this.root) {
- window.removeEventListener('resize', this.resize);
- return;
- }
- if (this.root.parentNode.clientWidth <= 380) {
- if (!legendBlock) {
- this.setState({
- legendBlock: true,
- });
- }
- } else if (legendBlock) {
- this.setState({
- legendBlock: false,
- });
- }
- }
-
- render() {
- const {
- valueFormat,
- subTitle,
- total,
- hasLegend = false,
- className,
- style,
- height,
- forceFit = true,
- percent,
- color,
- inner = 0.75,
- animate = true,
- colors,
- lineWidth = 1,
- } = this.props;
-
- const { legendData, legendBlock } = this.state;
- const pieClassName = classNames(styles.pie, className, {
- [styles.hasLegend]: !!hasLegend,
- [styles.legendBlock]: legendBlock,
- });
-
- const {
- data: propsData,
- selected: propsSelected = true,
- tooltip: propsTooltip = true,
- } = this.props;
-
- let data = propsData || [];
- let selected = propsSelected;
- let tooltip = propsTooltip;
-
- const defaultColors = colors;
- data = data || [];
- selected = selected || true;
- tooltip = tooltip || true;
- let formatColor;
-
- const scale = {
- x: {
- type: 'cat',
- range: [0, 1],
- },
- y: {
- min: 0,
- },
- };
-
- if (percent || percent === 0) {
- selected = false;
- tooltip = false;
- formatColor = value => {
- if (value === '占比') {
- return color || 'rgba(24, 144, 255, 0.85)';
- }
- return '#F0F2F5';
- };
-
- data = [
- {
- x: '占比',
- y: parseFloat(percent),
- },
- {
- x: '反比',
- y: 100 - parseFloat(percent),
- },
- ];
- }
-
- const tooltipFormat = [
- 'x*percent',
- (x, p) => ({
- name: x,
- value: `${(p * 100).toFixed(2)}%`,
- }),
- ];
-
- const padding = [12, 0, 12, 0];
-
- const dv = new DataView();
- dv.source(data).transform({
- type: 'percent',
- field: 'y',
- dimension: 'x',
- as: 'percent',
- });
-
- return (
-
-
-
-
- {!!tooltip && }
-
-
-
-
- {(subTitle || total) && (
-
- {subTitle &&
{subTitle}
}
- {/* eslint-disable-next-line */}
- {total && (
-
{typeof total === 'function' ? total() : total}
- )}
-
- )}
-
-
-
- {hasLegend && (
-
- {legendData.map((item, i) => (
- - this.handleLegendClick(item, i)}>
-
- {item.x}
-
-
- {`${(Number.isNaN(item.percent) ? 0 : item.percent * 100).toFixed(2)}%`}
-
- {valueFormat ? valueFormat(item.y) : item.y}
-
- ))}
-
- )}
-
- );
- }
-}
-
-export default Pie;
diff --git a/admin-web/src/components/Charts/Pie/index.less b/admin-web/src/components/Charts/Pie/index.less
deleted file mode 100644
index fc961b41d..000000000
--- a/admin-web/src/components/Charts/Pie/index.less
+++ /dev/null
@@ -1,94 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.pie {
- position: relative;
- .chart {
- position: relative;
- }
- &.hasLegend .chart {
- width: ~'calc(100% - 240px)';
- }
- .legend {
- position: absolute;
- top: 50%;
- right: 0;
- min-width: 200px;
- margin: 0 20px;
- padding: 0;
- list-style: none;
- transform: translateY(-50%);
- li {
- height: 22px;
- margin-bottom: 16px;
- line-height: 22px;
- cursor: pointer;
- &:last-child {
- margin-bottom: 0;
- }
- }
- }
- .dot {
- position: relative;
- top: -1px;
- display: inline-block;
- width: 8px;
- height: 8px;
- margin-right: 8px;
- border-radius: 8px;
- }
- .line {
- display: inline-block;
- width: 1px;
- height: 16px;
- margin-right: 8px;
- background-color: @border-color-split;
- }
- .legendTitle {
- color: @text-color;
- }
- .percent {
- color: @text-color-secondary;
- }
- .value {
- position: absolute;
- right: 0;
- }
- .title {
- margin-bottom: 8px;
- }
- .total {
- position: absolute;
- top: 50%;
- left: 50%;
- max-height: 62px;
- text-align: center;
- transform: translate(-50%, -50%);
- & > h4 {
- height: 22px;
- margin-bottom: 8px;
- color: @text-color-secondary;
- font-weight: normal;
- font-size: 14px;
- line-height: 22px;
- }
- & > p {
- display: block;
- height: 32px;
- color: @heading-color;
- font-size: 1.2em;
- line-height: 32px;
- white-space: nowrap;
- }
- }
-}
-
-.legendBlock {
- &.hasLegend .chart {
- width: 100%;
- margin: 0 0 32px 0;
- }
- .legend {
- position: relative;
- transform: none;
- }
-}
diff --git a/admin-web/src/components/Charts/Radar/index.d.ts b/admin-web/src/components/Charts/Radar/index.d.ts
deleted file mode 100644
index 963ac8c37..000000000
--- a/admin-web/src/components/Charts/Radar/index.d.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import * as React from 'react';
-export interface IRadarProps {
- title?: React.ReactNode;
- height: number;
- padding?: [number, number, number, number];
- hasLegend?: boolean;
- data: Array<{
- name: string;
- label: string;
- value: string;
- }>;
- style?: React.CSSProperties;
-}
-
-export default class Radar extends React.Component {}
diff --git a/admin-web/src/components/Charts/Radar/index.js b/admin-web/src/components/Charts/Radar/index.js
deleted file mode 100644
index a0aa7fab6..000000000
--- a/admin-web/src/components/Charts/Radar/index.js
+++ /dev/null
@@ -1,184 +0,0 @@
-import React, { Component } from 'react';
-import { Chart, Tooltip, Geom, Coord, Axis } from 'bizcharts';
-import { Row, Col } from 'antd';
-import autoHeight from '../autoHeight';
-import styles from './index.less';
-
-/* eslint react/no-danger:0 */
-@autoHeight()
-class Radar extends Component {
- state = {
- legendData: [],
- };
-
- componentDidMount() {
- this.getLegendData();
- }
-
- componentDidUpdate(preProps) {
- const { data } = this.props;
- if (data !== preProps.data) {
- this.getLegendData();
- }
- }
-
- getG2Instance = chart => {
- this.chart = chart;
- };
-
- // for custom lengend view
- getLegendData = () => {
- if (!this.chart) return;
- const geom = this.chart.getAllGeoms()[0]; // 获取所有的图形
- if (!geom) return;
- const items = geom.get('dataArray') || []; // 获取图形对应的
-
- const legendData = items.map(item => {
- // eslint-disable-next-line
- const origins = item.map(t => t._origin);
- const result = {
- name: origins[0].name,
- color: item[0].color,
- checked: true,
- value: origins.reduce((p, n) => p + n.value, 0),
- };
-
- return result;
- });
-
- this.setState({
- legendData,
- });
- };
-
- handleRef = n => {
- this.node = n;
- };
-
- handleLegendClick = (item, i) => {
- const newItem = item;
- newItem.checked = !newItem.checked;
-
- const { legendData } = this.state;
- legendData[i] = newItem;
-
- const filteredLegendData = legendData.filter(l => l.checked).map(l => l.name);
-
- if (this.chart) {
- this.chart.filter('name', val => filteredLegendData.indexOf(val) > -1);
- this.chart.repaint();
- }
-
- this.setState({
- legendData,
- });
- };
-
- render() {
- const defaultColors = [
- '#1890FF',
- '#FACC14',
- '#2FC25B',
- '#8543E0',
- '#F04864',
- '#13C2C2',
- '#fa8c16',
- '#a0d911',
- ];
-
- const {
- data = [],
- height = 0,
- title,
- hasLegend = false,
- forceFit = true,
- tickCount = 5,
- padding = [35, 30, 16, 30],
- animate = true,
- colors = defaultColors,
- } = this.props;
-
- const { legendData } = this.state;
-
- const scale = {
- value: {
- min: 0,
- tickCount,
- },
- };
-
- const chartHeight = height - (hasLegend ? 80 : 22);
-
- return (
-
- {title &&
{title}
}
-
-
-
-
-
-
-
-
- {hasLegend && (
-
- {legendData.map((item, i) => (
- this.handleLegendClick(item, i)}
- >
-
-
-
- {item.name}
-
-
{item.value}
-
-
- ))}
-
- )}
-
- );
- }
-}
-
-export default Radar;
diff --git a/admin-web/src/components/Charts/Radar/index.less b/admin-web/src/components/Charts/Radar/index.less
deleted file mode 100644
index 437a71297..000000000
--- a/admin-web/src/components/Charts/Radar/index.less
+++ /dev/null
@@ -1,46 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.radar {
- .legend {
- margin-top: 16px;
- .legendItem {
- position: relative;
- color: @text-color-secondary;
- line-height: 22px;
- text-align: center;
- cursor: pointer;
- p {
- margin: 0;
- }
- h6 {
- margin-top: 4px;
- margin-bottom: 0;
- padding-left: 16px;
- color: @heading-color;
- font-size: 24px;
- line-height: 32px;
- }
- &::after {
- position: absolute;
- top: 8px;
- right: 0;
- width: 1px;
- height: 40px;
- background-color: @border-color-split;
- content: '';
- }
- }
- > :last-child .legendItem::after {
- display: none;
- }
- .dot {
- position: relative;
- top: -1px;
- display: inline-block;
- width: 6px;
- height: 6px;
- margin-right: 6px;
- border-radius: 6px;
- }
- }
-}
diff --git a/admin-web/src/components/Charts/TagCloud/index.d.ts b/admin-web/src/components/Charts/TagCloud/index.d.ts
deleted file mode 100644
index 462650c4d..000000000
--- a/admin-web/src/components/Charts/TagCloud/index.d.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import * as React from 'react';
-export interface ITagCloudProps {
- data: Array<{
- name: string;
- value: number;
- }>;
- height: number;
- style?: React.CSSProperties;
-}
-
-export default class TagCloud extends React.Component {}
diff --git a/admin-web/src/components/Charts/TagCloud/index.js b/admin-web/src/components/Charts/TagCloud/index.js
deleted file mode 100644
index d94699bd5..000000000
--- a/admin-web/src/components/Charts/TagCloud/index.js
+++ /dev/null
@@ -1,182 +0,0 @@
-import React, { Component } from 'react';
-import { Chart, Geom, Coord, Shape, Tooltip } from 'bizcharts';
-import DataSet from '@antv/data-set';
-import Debounce from 'lodash-decorators/debounce';
-import Bind from 'lodash-decorators/bind';
-import classNames from 'classnames';
-import autoHeight from '../autoHeight';
-import styles from './index.less';
-
-/* eslint no-underscore-dangle: 0 */
-/* eslint no-param-reassign: 0 */
-
-const imgUrl = 'https://gw.alipayobjects.com/zos/rmsportal/gWyeGLCdFFRavBGIDzWk.png';
-
-@autoHeight()
-class TagCloud extends Component {
- state = {
- dv: null,
- };
-
- componentDidMount() {
- requestAnimationFrame(() => {
- this.initTagCloud();
- this.renderChart();
- });
- window.addEventListener('resize', this.resize, { passive: true });
- }
-
- componentDidUpdate(preProps) {
- const { data } = this.props;
- if (JSON.stringify(preProps.data) !== JSON.stringify(data)) {
- this.renderChart(this.props);
- }
- }
-
- componentWillUnmount() {
- this.isUnmount = true;
- window.cancelAnimationFrame(this.requestRef);
- window.removeEventListener('resize', this.resize);
- }
-
- resize = () => {
- this.requestRef = requestAnimationFrame(() => {
- this.renderChart();
- });
- };
-
- saveRootRef = node => {
- this.root = node;
- };
-
- initTagCloud = () => {
- function getTextAttrs(cfg) {
- return Object.assign(
- {},
- {
- fillOpacity: cfg.opacity,
- fontSize: cfg.origin._origin.size,
- rotate: cfg.origin._origin.rotate,
- text: cfg.origin._origin.text,
- textAlign: 'center',
- fontFamily: cfg.origin._origin.font,
- fill: cfg.color,
- textBaseline: 'Alphabetic',
- },
- cfg.style
- );
- }
-
- // 给point注册一个词云的shape
- Shape.registerShape('point', 'cloud', {
- drawShape(cfg, container) {
- const attrs = getTextAttrs(cfg);
- return container.addShape('text', {
- attrs: Object.assign(attrs, {
- x: cfg.x,
- y: cfg.y,
- }),
- });
- },
- });
- };
-
- @Bind()
- @Debounce(500)
- renderChart(nextProps) {
- // const colors = ['#1890FF', '#41D9C7', '#2FC25B', '#FACC14', '#9AE65C'];
- const { data, height } = nextProps || this.props;
-
- if (data.length < 1 || !this.root) {
- return;
- }
-
- const h = height;
- const w = this.root.offsetWidth;
-
- const onload = () => {
- const dv = new DataSet.View().source(data);
- const range = dv.range('value');
- const [min, max] = range;
- dv.transform({
- type: 'tag-cloud',
- fields: ['name', 'value'],
- imageMask: this.imageMask,
- font: 'Verdana',
- size: [w, h], // 宽高设置最好根据 imageMask 做调整
- padding: 0,
- timeInterval: 5000, // max execute time
- rotate() {
- return 0;
- },
- fontSize(d) {
- // eslint-disable-next-line
- return Math.pow((d.value - min) / (max - min), 2) * (17.5 - 5) + 5;
- },
- });
-
- if (this.isUnmount) {
- return;
- }
-
- this.setState({
- dv,
- w,
- h,
- });
- };
-
- if (!this.imageMask) {
- this.imageMask = new Image();
- this.imageMask.crossOrigin = '';
- this.imageMask.src = imgUrl;
-
- this.imageMask.onload = onload;
- } else {
- onload();
- }
- }
-
- render() {
- const { className, height } = this.props;
- const { dv, w, h } = this.state;
-
- return (
-
- {dv && (
-
-
-
-
-
- )}
-
- );
- }
-}
-
-export default TagCloud;
diff --git a/admin-web/src/components/Charts/TagCloud/index.less b/admin-web/src/components/Charts/TagCloud/index.less
deleted file mode 100644
index db8e4dabf..000000000
--- a/admin-web/src/components/Charts/TagCloud/index.less
+++ /dev/null
@@ -1,6 +0,0 @@
-.tagCloud {
- overflow: hidden;
- canvas {
- transform-origin: 0 0;
- }
-}
diff --git a/admin-web/src/components/Charts/TimelineChart/index.d.ts b/admin-web/src/components/Charts/TimelineChart/index.d.ts
deleted file mode 100644
index 40b94325a..000000000
--- a/admin-web/src/components/Charts/TimelineChart/index.d.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import * as React from 'react';
-export interface ITimelineChartProps {
- data: Array<{
- x: number;
- y1: number;
- y2?: number;
- }>;
- titleMap: { y1: string; y2?: string };
- padding?: [number, number, number, number];
- height?: number;
- style?: React.CSSProperties;
-}
-
-export default class TimelineChart extends React.Component {}
diff --git a/admin-web/src/components/Charts/TimelineChart/index.js b/admin-web/src/components/Charts/TimelineChart/index.js
deleted file mode 100644
index d82623c58..000000000
--- a/admin-web/src/components/Charts/TimelineChart/index.js
+++ /dev/null
@@ -1,120 +0,0 @@
-import React from 'react';
-import { Chart, Tooltip, Geom, Legend, Axis } from 'bizcharts';
-import DataSet from '@antv/data-set';
-import Slider from 'bizcharts-plugin-slider';
-import autoHeight from '../autoHeight';
-import styles from './index.less';
-
-@autoHeight()
-class TimelineChart extends React.Component {
- render() {
- const {
- title,
- height = 400,
- padding = [60, 20, 40, 40],
- titleMap = {
- y1: 'y1',
- y2: 'y2',
- },
- borderWidth = 2,
- data: sourceData,
- } = this.props;
-
- const data = Array.isArray(sourceData) ? sourceData : [{ x: 0, y1: 0, y2: 0 }];
-
- data.sort((a, b) => a.x - b.x);
-
- let max;
- if (data[0] && data[0].y1 && data[0].y2) {
- max = Math.max(
- [...data].sort((a, b) => b.y1 - a.y1)[0].y1,
- [...data].sort((a, b) => b.y2 - a.y2)[0].y2
- );
- }
-
- const ds = new DataSet({
- state: {
- start: data[0].x,
- end: data[data.length - 1].x,
- },
- });
-
- const dv = ds.createView();
- dv.source(data)
- .transform({
- type: 'filter',
- callback: obj => {
- const date = obj.x;
- return date <= ds.state.end && date >= ds.state.start;
- },
- })
- .transform({
- type: 'map',
- callback(row) {
- const newRow = { ...row };
- newRow[titleMap.y1] = row.y1;
- newRow[titleMap.y2] = row.y2;
- return newRow;
- },
- })
- .transform({
- type: 'fold',
- fields: [titleMap.y1, titleMap.y2], // 展开字段集
- key: 'key', // key字段
- value: 'value', // value字段
- });
-
- const timeScale = {
- type: 'time',
- tickInterval: 60 * 60 * 1000,
- mask: 'HH:mm',
- range: [0, 1],
- };
-
- const cols = {
- x: timeScale,
- value: {
- max,
- min: 0,
- },
- };
-
- const SliderGen = () => (
- {
- ds.setState('start', startValue);
- ds.setState('end', endValue);
- }}
- />
- );
-
- return (
-
-
- {title &&
{title}
}
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default TimelineChart;
diff --git a/admin-web/src/components/Charts/TimelineChart/index.less b/admin-web/src/components/Charts/TimelineChart/index.less
deleted file mode 100644
index 175197569..000000000
--- a/admin-web/src/components/Charts/TimelineChart/index.less
+++ /dev/null
@@ -1,3 +0,0 @@
-.timelineChart {
- background: #fff;
-}
diff --git a/admin-web/src/components/Charts/WaterWave/index.d.ts b/admin-web/src/components/Charts/WaterWave/index.d.ts
deleted file mode 100644
index 8f5588d29..000000000
--- a/admin-web/src/components/Charts/WaterWave/index.d.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import * as React from 'react';
-export interface IWaterWaveProps {
- title: React.ReactNode;
- color?: string;
- height: number;
- percent: number;
- style?: React.CSSProperties;
-}
-
-export default class WaterWave extends React.Component {}
diff --git a/admin-web/src/components/Charts/WaterWave/index.js b/admin-web/src/components/Charts/WaterWave/index.js
deleted file mode 100644
index 055f7c734..000000000
--- a/admin-web/src/components/Charts/WaterWave/index.js
+++ /dev/null
@@ -1,213 +0,0 @@
-import React, { PureComponent } from 'react';
-import autoHeight from '../autoHeight';
-import styles from './index.less';
-
-/* eslint no-return-assign: 0 */
-/* eslint no-mixed-operators: 0 */
-// riddle: https://riddle.alibaba-inc.com/riddles/2d9a4b90
-
-@autoHeight()
-class WaterWave extends PureComponent {
- state = {
- radio: 1,
- };
-
- componentDidMount() {
- this.renderChart();
- this.resize();
- window.addEventListener(
- 'resize',
- () => {
- requestAnimationFrame(() => this.resize());
- },
- { passive: true }
- );
- }
-
- componentDidUpdate(props) {
- const { percent } = this.props;
- if (props.percent !== percent) {
- // 不加这个会造成绘制缓慢
- this.renderChart('update');
- }
- }
-
- componentWillUnmount() {
- cancelAnimationFrame(this.timer);
- if (this.node) {
- this.node.innerHTML = '';
- }
- window.removeEventListener('resize', this.resize);
- }
-
- resize = () => {
- if (this.root) {
- const { height } = this.props;
- const { offsetWidth } = this.root.parentNode;
- this.setState({
- radio: offsetWidth < height ? offsetWidth / height : 1,
- });
- }
- };
-
- renderChart(type) {
- const { percent, color = '#1890FF' } = this.props;
- const data = percent / 100;
- const self = this;
- cancelAnimationFrame(this.timer);
-
- if (!this.node || (data !== 0 && !data)) {
- return;
- }
-
- const canvas = this.node;
- const ctx = canvas.getContext('2d');
- const canvasWidth = canvas.width;
- const canvasHeight = canvas.height;
- const radius = canvasWidth / 2;
- const lineWidth = 2;
- const cR = radius - lineWidth;
-
- ctx.beginPath();
- ctx.lineWidth = lineWidth * 2;
-
- const axisLength = canvasWidth - lineWidth;
- const unit = axisLength / 8;
- const range = 0.2; // 振幅
- let currRange = range;
- const xOffset = lineWidth;
- let sp = 0; // 周期偏移量
- let currData = 0;
- const waveupsp = 0.005; // 水波上涨速度
-
- let arcStack = [];
- const bR = radius - lineWidth;
- const circleOffset = -(Math.PI / 2);
- let circleLock = true;
-
- for (let i = circleOffset; i < circleOffset + 2 * Math.PI; i += 1 / (8 * Math.PI)) {
- arcStack.push([radius + bR * Math.cos(i), radius + bR * Math.sin(i)]);
- }
-
- const cStartPoint = arcStack.shift();
- ctx.strokeStyle = color;
- ctx.moveTo(cStartPoint[0], cStartPoint[1]);
-
- function drawSin() {
- ctx.beginPath();
- ctx.save();
-
- const sinStack = [];
- for (let i = xOffset; i <= xOffset + axisLength; i += 20 / axisLength) {
- const x = sp + (xOffset + i) / unit;
- const y = Math.sin(x) * currRange;
- const dx = i;
- const dy = 2 * cR * (1 - currData) + (radius - cR) - unit * y;
-
- ctx.lineTo(dx, dy);
- sinStack.push([dx, dy]);
- }
-
- const startPoint = sinStack.shift();
-
- ctx.lineTo(xOffset + axisLength, canvasHeight);
- ctx.lineTo(xOffset, canvasHeight);
- ctx.lineTo(startPoint[0], startPoint[1]);
-
- const gradient = ctx.createLinearGradient(0, 0, 0, canvasHeight);
- gradient.addColorStop(0, '#ffffff');
- gradient.addColorStop(1, color);
- ctx.fillStyle = gradient;
- ctx.fill();
- ctx.restore();
- }
-
- function render() {
- ctx.clearRect(0, 0, canvasWidth, canvasHeight);
- if (circleLock && type !== 'update') {
- if (arcStack.length) {
- const temp = arcStack.shift();
- ctx.lineTo(temp[0], temp[1]);
- ctx.stroke();
- } else {
- circleLock = false;
- ctx.lineTo(cStartPoint[0], cStartPoint[1]);
- ctx.stroke();
- arcStack = null;
-
- ctx.globalCompositeOperation = 'destination-over';
- ctx.beginPath();
- ctx.lineWidth = lineWidth;
- ctx.arc(radius, radius, bR, 0, 2 * Math.PI, 1);
-
- ctx.beginPath();
- ctx.save();
- ctx.arc(radius, radius, radius - 3 * lineWidth, 0, 2 * Math.PI, 1);
-
- ctx.restore();
- ctx.clip();
- ctx.fillStyle = color;
- }
- } else {
- if (data >= 0.85) {
- if (currRange > range / 4) {
- const t = range * 0.01;
- currRange -= t;
- }
- } else if (data <= 0.1) {
- if (currRange < range * 1.5) {
- const t = range * 0.01;
- currRange += t;
- }
- } else {
- if (currRange <= range) {
- const t = range * 0.01;
- currRange += t;
- }
- if (currRange >= range) {
- const t = range * 0.01;
- currRange -= t;
- }
- }
- if (data - currData > 0) {
- currData += waveupsp;
- }
- if (data - currData < 0) {
- currData -= waveupsp;
- }
-
- sp += 0.07;
- drawSin();
- }
- self.timer = requestAnimationFrame(render);
- }
- render();
- }
-
- render() {
- const { radio } = this.state;
- const { percent, title, height } = this.props;
- return (
- (this.root = n)}
- style={{ transform: `scale(${radio})` }}
- >
-
-
-
- {title && {title}}
-
{percent}%
-
-
- );
- }
-}
-
-export default WaterWave;
diff --git a/admin-web/src/components/Charts/WaterWave/index.less b/admin-web/src/components/Charts/WaterWave/index.less
deleted file mode 100644
index 2e75f2146..000000000
--- a/admin-web/src/components/Charts/WaterWave/index.less
+++ /dev/null
@@ -1,28 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.waterWave {
- position: relative;
- display: inline-block;
- transform-origin: left;
- .text {
- position: absolute;
- top: 32px;
- left: 0;
- width: 100%;
- text-align: center;
- span {
- color: @text-color-secondary;
- font-size: 14px;
- line-height: 22px;
- }
- h4 {
- color: @heading-color;
- font-size: 24px;
- line-height: 32px;
- }
- }
- .waterWaveCanvasWrapper {
- transform: scale(0.5);
- transform-origin: 0 0;
- }
-}
diff --git a/admin-web/src/components/Charts/autoHeight.js b/admin-web/src/components/Charts/autoHeight.js
deleted file mode 100644
index 6ee9e098d..000000000
--- a/admin-web/src/components/Charts/autoHeight.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/* eslint eqeqeq: 0 */
-import React from 'react';
-
-function computeHeight(node) {
- const totalHeight = parseInt(getComputedStyle(node).height, 10);
- const padding =
- parseInt(getComputedStyle(node).paddingTop, 10) +
- parseInt(getComputedStyle(node).paddingBottom, 10);
- return totalHeight - padding;
-}
-
-function getAutoHeight(n) {
- if (!n) {
- return 0;
- }
-
- let node = n;
-
- let height = computeHeight(node);
-
- while (!height) {
- node = node.parentNode;
- if (node) {
- height = computeHeight(node);
- } else {
- break;
- }
- }
-
- return height;
-}
-
-const autoHeight = () => WrappedComponent =>
- class extends React.Component {
- state = {
- computedHeight: 0,
- };
-
- componentDidMount() {
- const { height } = this.props;
- if (!height) {
- const h = getAutoHeight(this.root);
- // eslint-disable-next-line
- this.setState({ computedHeight: h });
- }
- }
-
- handleRoot = node => {
- this.root = node;
- };
-
- render() {
- const { height } = this.props;
- const { computedHeight } = this.state;
- const h = height || computedHeight;
- return (
- {h > 0 && }
- );
- }
- };
-
-export default autoHeight;
diff --git a/admin-web/src/components/Charts/bizcharts.d.ts b/admin-web/src/components/Charts/bizcharts.d.ts
deleted file mode 100644
index 0815ffeef..000000000
--- a/admin-web/src/components/Charts/bizcharts.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import * as BizChart from 'bizcharts';
-
-export = BizChart;
diff --git a/admin-web/src/components/Charts/bizcharts.js b/admin-web/src/components/Charts/bizcharts.js
deleted file mode 100644
index e08db8d6d..000000000
--- a/admin-web/src/components/Charts/bizcharts.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import * as BizChart from 'bizcharts';
-
-export default BizChart;
diff --git a/admin-web/src/components/Charts/demo/bar.md b/admin-web/src/components/Charts/demo/bar.md
deleted file mode 100644
index 955f44e07..000000000
--- a/admin-web/src/components/Charts/demo/bar.md
+++ /dev/null
@@ -1,26 +0,0 @@
----
-order: 4
-title: 柱状图
----
-
-通过设置 `x`,`y` 属性,可以快速的构建出一个漂亮的柱状图,各种纬度的关系则是通过自定义的数据展现。
-
-````jsx
-import { Bar } from 'ant-design-pro/lib/Charts';
-
-const salesData = [];
-for (let i = 0; i < 12; i += 1) {
- salesData.push({
- x: `${i + 1}月`,
- y: Math.floor(Math.random() * 1000) + 200,
- });
-}
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/admin-web/src/components/Charts/demo/chart-card.md b/admin-web/src/components/Charts/demo/chart-card.md
deleted file mode 100644
index 4da852b71..000000000
--- a/admin-web/src/components/Charts/demo/chart-card.md
+++ /dev/null
@@ -1,95 +0,0 @@
----
-order: 1
-title: 图表卡片
----
-
-用于展示图表的卡片容器,可以方便的配合其它图表套件展示丰富信息。
-
-```jsx
-import { ChartCard, yuan, Field } from 'ant-design-pro/lib/Charts';
-import Trend from 'ant-design-pro/lib/Trend';
-import { Row, Col, Icon, Tooltip } from 'antd';
-import numeral from 'numeral';
-
-ReactDOM.render(
-
-
-
-
-
- }
- total={() => (
-
- )}
- footer={
-
- }
- contentHeight={46}
- >
-
- 周同比
-
- 12%
-
-
-
- 日环比
-
- 11%
-
-
-
-
-
-
- }
- action={
-
-
-
- }
- total={() => (
-
- )}
- footer={
-
- }
- />
-
-
-
- }
- action={
-
-
-
- }
- total={() => (
-
- )}
- />
-
-
,
- mountNode,
-);
-```
diff --git a/admin-web/src/components/Charts/demo/gauge.md b/admin-web/src/components/Charts/demo/gauge.md
deleted file mode 100644
index f53465d88..000000000
--- a/admin-web/src/components/Charts/demo/gauge.md
+++ /dev/null
@@ -1,18 +0,0 @@
----
-order: 7
-title: 仪表盘
----
-
-仪表盘是一种进度展示方式,可以更直观的展示当前的进展情况,通常也可表示占比。
-
-````jsx
-import { Gauge } from 'ant-design-pro/lib/Charts';
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/admin-web/src/components/Charts/demo/mini-area.md b/admin-web/src/components/Charts/demo/mini-area.md
deleted file mode 100644
index 2b9bfb477..000000000
--- a/admin-web/src/components/Charts/demo/mini-area.md
+++ /dev/null
@@ -1,28 +0,0 @@
----
-order: 2
-col: 2
-title: 迷你区域图
----
-
-````jsx
-import { MiniArea } from 'ant-design-pro/lib/Charts';
-import moment from 'moment';
-
-const visitData = [];
-const beginDay = new Date().getTime();
-for (let i = 0; i < 20; i += 1) {
- visitData.push({
- x: moment(new Date(beginDay + (1000 * 60 * 60 * 24 * i))).format('YYYY-MM-DD'),
- y: Math.floor(Math.random() * 100) + 10,
- });
-}
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/admin-web/src/components/Charts/demo/mini-bar.md b/admin-web/src/components/Charts/demo/mini-bar.md
deleted file mode 100644
index fef301bca..000000000
--- a/admin-web/src/components/Charts/demo/mini-bar.md
+++ /dev/null
@@ -1,28 +0,0 @@
----
-order: 2
-col: 2
-title: 迷你柱状图
----
-
-迷你柱状图更适合展示简单的区间数据,简洁的表现方式可以很好的减少大数据量的视觉展现压力。
-
-````jsx
-import { MiniBar } from 'ant-design-pro/lib/Charts';
-import moment from 'moment';
-
-const visitData = [];
-const beginDay = new Date().getTime();
-for (let i = 0; i < 20; i += 1) {
- visitData.push({
- x: moment(new Date(beginDay + (1000 * 60 * 60 * 24 * i))).format('YYYY-MM-DD'),
- y: Math.floor(Math.random() * 100) + 10,
- });
-}
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/admin-web/src/components/Charts/demo/mini-pie.md b/admin-web/src/components/Charts/demo/mini-pie.md
deleted file mode 100644
index 9b1abf059..000000000
--- a/admin-web/src/components/Charts/demo/mini-pie.md
+++ /dev/null
@@ -1,16 +0,0 @@
----
-order: 6
-title: 迷你饼状图
----
-
-通过简化 `Pie` 属性的设置,可以快速的实现极简的饼状图,可配合 `ChartCard` 组合展
-现更多业务场景。
-
-```jsx
-import { Pie } from 'ant-design-pro/lib/Charts';
-
-ReactDOM.render(
- ,
- mountNode
-);
-```
diff --git a/admin-web/src/components/Charts/demo/mini-progress.md b/admin-web/src/components/Charts/demo/mini-progress.md
deleted file mode 100644
index 6308a8fae..000000000
--- a/admin-web/src/components/Charts/demo/mini-progress.md
+++ /dev/null
@@ -1,12 +0,0 @@
----
-order: 3
-title: 迷你进度条
----
-
-````jsx
-import { MiniProgress } from 'ant-design-pro/lib/Charts';
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/admin-web/src/components/Charts/demo/mix.md b/admin-web/src/components/Charts/demo/mix.md
deleted file mode 100644
index fc64110ae..000000000
--- a/admin-web/src/components/Charts/demo/mix.md
+++ /dev/null
@@ -1,84 +0,0 @@
----
-order: 0
-title: 图表套件组合展示
----
-
-利用 Ant Design Pro 提供的图表套件,可以灵活组合符合设计规范的图表来满足复杂的业务需求。
-
-````jsx
-import { ChartCard, Field, MiniArea, MiniBar, MiniProgress } from 'ant-design-pro/lib/Charts';
-import Trend from 'ant-design-pro/lib/Trend';
-import NumberInfo from 'ant-design-pro/lib/NumberInfo';
-import { Row, Col, Icon, Tooltip } from 'antd';
-import numeral from 'numeral';
-import moment from 'moment';
-
-const visitData = [];
-const beginDay = new Date().getTime();
-for (let i = 0; i < 20; i += 1) {
- visitData.push({
- x: moment(new Date(beginDay + (1000 * 60 * 60 * 24 * i))).format('YYYY-MM-DD'),
- y: Math.floor(Math.random() * 100) + 10,
- });
-}
-
-ReactDOM.render(
-
-
-
- 本周访问}
- total={numeral(12321).format('0,0')}
- status="up"
- subTotal={17.1}
- />
-
-
-
-
- }
- total={numeral(8846).format('0,0')}
- footer={}
- contentHeight={46}
- >
-
-
-
-
- }
- total="78%"
- footer={
-
-
- 周同比
- 12%
-
-
- 日环比
- 11%
-
-
- }
- contentHeight={46}
- >
-
-
-
-
-, mountNode);
-````
diff --git a/admin-web/src/components/Charts/demo/pie.md b/admin-web/src/components/Charts/demo/pie.md
deleted file mode 100644
index 9c87161a2..000000000
--- a/admin-web/src/components/Charts/demo/pie.md
+++ /dev/null
@@ -1,54 +0,0 @@
----
-order: 5
-title: 饼状图
----
-
-```jsx
-import { Pie, yuan } from 'ant-design-pro/lib/Charts';
-
-const salesPieData = [
- {
- x: '家用电器',
- y: 4544,
- },
- {
- x: '食用酒水',
- y: 3321,
- },
- {
- x: '个护健康',
- y: 3113,
- },
- {
- x: '服饰箱包',
- y: 2341,
- },
- {
- x: '母婴产品',
- y: 1231,
- },
- {
- x: '其他',
- y: 1231,
- },
-];
-
-ReactDOM.render(
- (
- now.y + pre, 0))
- }}
- />
- )}
- data={salesPieData}
- valueFormat={val => }
- height={294}
- />,
- mountNode,
-);
-```
diff --git a/admin-web/src/components/Charts/demo/radar.md b/admin-web/src/components/Charts/demo/radar.md
deleted file mode 100644
index 584344aa3..000000000
--- a/admin-web/src/components/Charts/demo/radar.md
+++ /dev/null
@@ -1,64 +0,0 @@
----
-order: 7
-title: 雷达图
----
-
-````jsx
-import { Radar, ChartCard } from 'ant-design-pro/lib/Charts';
-
-const radarOriginData = [
- {
- name: '个人',
- ref: 10,
- koubei: 8,
- output: 4,
- contribute: 5,
- hot: 7,
- },
- {
- name: '团队',
- ref: 3,
- koubei: 9,
- output: 6,
- contribute: 3,
- hot: 1,
- },
- {
- name: '部门',
- ref: 4,
- koubei: 1,
- output: 6,
- contribute: 5,
- hot: 7,
- },
-];
-const radarData = [];
-const radarTitleMap = {
- ref: '引用',
- koubei: '口碑',
- output: '产量',
- contribute: '贡献',
- hot: '热度',
-};
-radarOriginData.forEach((item) => {
- Object.keys(item).forEach((key) => {
- if (key !== 'name') {
- radarData.push({
- name: item.name,
- label: radarTitleMap[key],
- value: item[key],
- });
- }
- });
-});
-
-ReactDOM.render(
-
-
-
-, mountNode);
-````
diff --git a/admin-web/src/components/Charts/demo/tag-cloud.md b/admin-web/src/components/Charts/demo/tag-cloud.md
deleted file mode 100644
index c66f6fe6b..000000000
--- a/admin-web/src/components/Charts/demo/tag-cloud.md
+++ /dev/null
@@ -1,25 +0,0 @@
----
-order: 9
-title: 标签云
----
-
-标签云是一套相关的标签以及与此相应的权重展示方式,一般典型的标签云有 30 至 150 个标签,而权重影响使用的字体大小或其他视觉效果。
-
-````jsx
-import { TagCloud } from 'ant-design-pro/lib/Charts';
-
-const tags = [];
-for (let i = 0; i < 50; i += 1) {
- tags.push({
- name: `TagClout-Title-${i}`,
- value: Math.floor((Math.random() * 50)) + 20,
- });
-}
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/admin-web/src/components/Charts/demo/timeline-chart.md b/admin-web/src/components/Charts/demo/timeline-chart.md
deleted file mode 100644
index 60773b575..000000000
--- a/admin-web/src/components/Charts/demo/timeline-chart.md
+++ /dev/null
@@ -1,27 +0,0 @@
----
-order: 9
-title: 带有时间轴的图表
----
-
-使用 `TimelineChart` 组件可以实现带有时间轴的柱状图展现,而其中的 `x` 属性,则是时间值的指向,默认最多支持同时展现两个指标,分别是 `y1` 和 `y2`。
-
-````jsx
-import { TimelineChart } from 'ant-design-pro/lib/Charts';
-
-const chartData = [];
-for (let i = 0; i < 20; i += 1) {
- chartData.push({
- x: (new Date().getTime()) + (1000 * 60 * 30 * i),
- y1: Math.floor(Math.random() * 100) + 1000,
- y2: Math.floor(Math.random() * 100) + 10,
- });
-}
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/admin-web/src/components/Charts/demo/waterwave.md b/admin-web/src/components/Charts/demo/waterwave.md
deleted file mode 100644
index 74d290f54..000000000
--- a/admin-web/src/components/Charts/demo/waterwave.md
+++ /dev/null
@@ -1,20 +0,0 @@
----
-order: 8
-title: 水波图
----
-
-水波图是一种比例的展示方式,可以更直观的展示关键值的占比。
-
-````jsx
-import { WaterWave } from 'ant-design-pro/lib/Charts';
-
-ReactDOM.render(
-
-
-
-, mountNode);
-````
diff --git a/admin-web/src/components/Charts/index.d.ts b/admin-web/src/components/Charts/index.d.ts
deleted file mode 100644
index 57f1d5272..000000000
--- a/admin-web/src/components/Charts/index.d.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-import * as numeral from 'numeral';
-import { default as Bar } from './Bar';
-import { default as ChartCard } from './ChartCard';
-import { default as Field } from './Field';
-import { default as Gauge } from './Gauge';
-import { default as MiniArea } from './MiniArea';
-import { default as MiniBar } from './MiniBar';
-import { default as MiniProgress } from './MiniProgress';
-import { default as Pie } from './Pie';
-import { default as Radar } from './Radar';
-import { default as TagCloud } from './TagCloud';
-import { default as TimelineChart } from './TimelineChart';
-import { default as WaterWave } from './WaterWave';
-
-declare const yuan: (value: number | string) => string;
-
-declare const Charts: {
- yuan: (value: number | string) => string;
- Bar: Bar;
- Pie: Pie;
- Gauge: Gauge;
- Radar: Radar;
- MiniBar: MiniBar;
- MiniArea: MiniArea;
- MiniProgress: MiniProgress;
- ChartCard: ChartCard;
- Field: Field;
- WaterWave: WaterWave;
- TagCloud: TagCloud;
- TimelineChart: TimelineChart;
-};
-
-export {
- Charts as default,
- yuan,
- Bar,
- Pie,
- Gauge,
- Radar,
- MiniBar,
- MiniArea,
- MiniProgress,
- ChartCard,
- Field,
- WaterWave,
- TagCloud,
- TimelineChart,
-};
diff --git a/admin-web/src/components/Charts/index.js b/admin-web/src/components/Charts/index.js
deleted file mode 100644
index 56a1c565f..000000000
--- a/admin-web/src/components/Charts/index.js
+++ /dev/null
@@ -1,60 +0,0 @@
-import React, { Suspense } from 'react';
-import numeral from 'numeral';
-import ChartCard from './ChartCard';
-import Field from './Field';
-
-const getComponent = Component => {
- return props => {
- return (
-
-
-
- );
- };
-};
-
-const Bar = getComponent(React.lazy(() => import('./Bar')));
-const Pie = getComponent(React.lazy(() => import('./Pie')));
-const Radar = getComponent(React.lazy(() => import('./Radar')));
-const Gauge = getComponent(React.lazy(() => import('./Gauge')));
-const MiniArea = getComponent(React.lazy(() => import('./MiniArea')));
-const MiniBar = getComponent(React.lazy(() => import('./MiniBar')));
-const MiniProgress = getComponent(React.lazy(() => import('./MiniProgress')));
-const WaterWave = getComponent(React.lazy(() => import('./WaterWave')));
-const TagCloud = getComponent(React.lazy(() => import('./TagCloud')));
-const TimelineChart = getComponent(React.lazy(() => import('./TimelineChart')));
-
-const yuan = val => `¥ ${numeral(val).format('0,0')}`;
-
-const Charts = {
- yuan,
- Bar,
- Pie,
- Gauge,
- Radar,
- MiniBar,
- MiniArea,
- MiniProgress,
- ChartCard,
- Field,
- WaterWave,
- TagCloud,
- TimelineChart,
-};
-
-export {
- Charts as default,
- yuan,
- Bar,
- Pie,
- Gauge,
- Radar,
- MiniBar,
- MiniArea,
- MiniProgress,
- ChartCard,
- Field,
- WaterWave,
- TagCloud,
- TimelineChart,
-};
diff --git a/admin-web/src/components/Charts/index.less b/admin-web/src/components/Charts/index.less
deleted file mode 100644
index 190428bc8..000000000
--- a/admin-web/src/components/Charts/index.less
+++ /dev/null
@@ -1,19 +0,0 @@
-.miniChart {
- position: relative;
- width: 100%;
- .chartContent {
- position: absolute;
- bottom: -28px;
- width: 100%;
- > div {
- margin: 0 -5px;
- overflow: hidden;
- }
- }
- .chartLoading {
- position: absolute;
- top: 16px;
- left: 50%;
- margin-left: -7px;
- }
-}
diff --git a/admin-web/src/components/Charts/index.md b/admin-web/src/components/Charts/index.md
deleted file mode 100644
index e5f41c873..000000000
--- a/admin-web/src/components/Charts/index.md
+++ /dev/null
@@ -1,130 +0,0 @@
----
-title: Charts
-subtitle: 图表
-order: 2
-cols: 2
----
-
-Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https://antv.alipay.com/g2/doc/index.html) 按照 Ant Design 图表规范封装,需要注意的是 Ant Design Pro 的图表组件以套件形式提供,可以任意组合实现复杂的业务需求。
-
-因为结合了 Ant Design 的标准设计,本着极简的设计思想以及开箱即用的理念,简化了大量 API 配置,所以如果需要灵活定制图表,可以参考 Ant Design Pro 图表实现,自行基于 [G2](https://antv.alipay.com/g2/doc/index.html) 封装图表组件使用。
-
-## API
-
-### ChartCard
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| title | 卡片标题 | ReactNode\|string | - |
-| action | 卡片操作 | ReactNode | - |
-| total | 数据总量 | ReactNode \| number \| function | - |
-| footer | 卡片底部 | ReactNode | - |
-| contentHeight | 内容区域高度 | number | - |
-| avatar | 右侧图标 | React.ReactNode | - |
-### MiniBar
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| color | 图表颜色 | string | `#1890FF` |
-| height | 图表高度 | number | - |
-| data | 数据 | array<{x, y}> | - |
-
-### MiniArea
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| color | 图表颜色 | string | `rgba(24, 144, 255, 0.2)` |
-| borderColor | 图表边颜色 | string | `#1890FF` |
-| height | 图表高度 | number | - |
-| line | 是否显示描边 | boolean | false |
-| animate | 是否显示动画 | boolean | true |
-| xAxis | [x 轴配置](http://antvis.github.io/g2/doc/tutorial/start/axis.html) | object | - |
-| yAxis | [y 轴配置](http://antvis.github.io/g2/doc/tutorial/start/axis.html) | object | - |
-| data | 数据 | array<{x, y}> | - |
-
-### MiniProgress
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| target | 目标比例 | number | - |
-| color | 进度条颜色 | string | - |
-| strokeWidth | 进度条高度 | number | - |
-| percent | 进度比例 | number | - |
-
-### Bar
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| title | 图表标题 | ReactNode\|string | - |
-| color | 图表颜色 | string | `rgba(24, 144, 255, 0.85)` |
-| padding | 图表内部间距 | [array](https://github.com/alibaba/BizCharts/blob/master/doc/api/chart.md#7padding-object--number--array-) | `'auto'` |
-| height | 图表高度 | number | - |
-| data | 数据 | array<{x, y}> | - |
-| autoLabel | 在宽度不足时,自动隐藏 x 轴的 label | boolean | `true` |
-
-### Pie
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| animate | 是否显示动画 | boolean | true |
-| color | 图表颜色 | string | `rgba(24, 144, 255, 0.85)` |
-| height | 图表高度 | number | - |
-| hasLegend | 是否显示 legend | boolean | `false` |
-| padding | 图表内部间距 | [array](https://github.com/alibaba/BizCharts/blob/master/doc/api/chart.md#7padding-object--number--array-) | `'auto'` |
-| percent | 占比 | number | - |
-| tooltip | 是否显示 tooltip | boolean | true |
-| valueFormat | 显示值的格式化函数 | function | - |
-| title | 图表标题 | ReactNode\|string | - |
-| subTitle | 图表子标题 | ReactNode\|string | - |
-| total | 图标中央的总数 | string | function | - |
-
-### Radar
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| title | 图表标题 | ReactNode\|string | - |
-| height | 图表高度 | number | - |
-| hasLegend | 是否显示 legend | boolean | `false` |
-| padding | 图表内部间距 | [array](https://github.com/alibaba/BizCharts/blob/master/doc/api/chart.md#7padding-object--number--array-) | `'auto'` |
-| data | 图标数据 | array<{name,label,value}> | - |
-
-### Gauge
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| title | 图表标题 | ReactNode\|string | - |
-| height | 图表高度 | number | - |
-| color | 图表颜色 | string | `#2F9CFF` |
-| bgColor | 图表背景颜色 | string | `#F0F2F5` |
-| percent | 进度比例 | number | - |
-
-### WaterWave
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| title | 图表标题 | ReactNode\|string | - |
-| height | 图表高度 | number | - |
-| color | 图表颜色 | string | `#1890FF` |
-| percent | 进度比例 | number | - |
-
-### TagCloud
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| data | 标题 | Array | - |
-| height | 高度值 | number | - |
-
-### TimelineChart
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| data | 标题 | Array | - |
-| titleMap | 指标别名 | Object{y1: '客流量', y2: '支付笔数'} | - |
-| height | 高度值 | number | 400 |
-
-### Field
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| label | 标题 | ReactNode\|string | - |
-| value | 值 | ReactNode\|string | - |
diff --git a/admin-web/src/components/CountDown/demo/simple.md b/admin-web/src/components/CountDown/demo/simple.md
deleted file mode 100644
index e42cbf1d9..000000000
--- a/admin-web/src/components/CountDown/demo/simple.md
+++ /dev/null
@@ -1,24 +0,0 @@
----
-order: 0
-title:
- zh-CN: 基本
- en-US: Basic
----
-
-## zh-CN
-
-简单的倒计时组件使用。
-
-## en-US
-
-The simplest usage.
-
-````jsx
-import CountDown from 'ant-design-pro/lib/CountDown';
-
-const targetTime = new Date().getTime() + 3900000;
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/admin-web/src/components/CountDown/index.d.ts b/admin-web/src/components/CountDown/index.d.ts
deleted file mode 100644
index d39a2e951..000000000
--- a/admin-web/src/components/CountDown/index.d.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import * as React from 'react';
-export interface ICountDownProps {
- format?: (time: number) => void;
- target: Date | number;
- onEnd?: () => void;
- style?: React.CSSProperties;
-}
-
-export default class CountDown extends React.Component {}
diff --git a/admin-web/src/components/CountDown/index.en-US.md b/admin-web/src/components/CountDown/index.en-US.md
deleted file mode 100644
index 7b452406b..000000000
--- a/admin-web/src/components/CountDown/index.en-US.md
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: CountDown
-cols: 1
-order: 3
----
-
-Simple CountDown Component.
-
-## API
-
-| Property | Description | Type | Default |
-|----------|------------------------------------------|-------------|-------|
-| format | Formatter of time | Function(time) | |
-| target | Target time | Date | - |
-| onEnd | Countdown to the end callback | funtion | -|
diff --git a/admin-web/src/components/CountDown/index.js b/admin-web/src/components/CountDown/index.js
deleted file mode 100644
index 7565bd82d..000000000
--- a/admin-web/src/components/CountDown/index.js
+++ /dev/null
@@ -1,121 +0,0 @@
-import React, { Component } from 'react';
-
-function fixedZero(val) {
- return val * 1 < 10 ? `0${val}` : val;
-}
-const initTime = props => {
- let lastTime = 0;
- let targetTime = 0;
- try {
- if (Object.prototype.toString.call(props.target) === '[object Date]') {
- targetTime = props.target.getTime();
- } else {
- targetTime = new Date(props.target).getTime();
- }
- } catch (e) {
- throw new Error('invalid target prop', e);
- }
-
- lastTime = targetTime - new Date().getTime();
- return {
- lastTime: lastTime < 0 ? 0 : lastTime,
- };
-};
-
-class CountDown extends Component {
- timer = 0;
-
- interval = 1000;
-
- constructor(props) {
- super(props);
- const { lastTime } = initTime(props);
- this.state = {
- lastTime,
- };
- }
-
- static getDerivedStateFromProps(nextProps, preState) {
- const { lastTime } = initTime(nextProps);
- if (preState.lastTime !== lastTime) {
- return {
- lastTime,
- };
- }
- return null;
- }
-
- componentDidMount() {
- this.tick();
- }
-
- componentDidUpdate(prevProps) {
- const { target } = this.props;
- if (target !== prevProps.target) {
- clearTimeout(this.timer);
- this.tick();
- }
- }
-
- componentWillUnmount() {
- clearTimeout(this.timer);
- }
-
- // defaultFormat = time => (
- // {moment(time).format('hh:mm:ss')}
- // );
- defaultFormat = time => {
- const hours = 60 * 60 * 1000;
- const minutes = 60 * 1000;
-
- const h = Math.floor(time / hours);
- const m = Math.floor((time - h * hours) / minutes);
- const s = Math.floor((time - h * hours - m * minutes) / 1000);
- return (
-
- {fixedZero(h)}:{fixedZero(m)}:{fixedZero(s)}
-
- );
- };
-
- tick = () => {
- const { onEnd } = this.props;
- let { lastTime } = this.state;
-
- this.timer = setTimeout(() => {
- if (lastTime < this.interval) {
- clearTimeout(this.timer);
- this.setState(
- {
- lastTime: 0,
- },
- () => {
- if (onEnd) {
- onEnd();
- }
- }
- );
- } else {
- lastTime -= this.interval;
- this.setState(
- {
- lastTime,
- },
- () => {
- this.tick();
- }
- );
- }
- }, this.interval);
- };
-
- render() {
- const { format = this.defaultFormat, onEnd, ...rest } = this.props;
- const { lastTime } = this.state;
- const result = format(lastTime);
-
- return {result};
- }
-}
-
-export default CountDown;
diff --git a/admin-web/src/components/CountDown/index.zh-CN.md b/admin-web/src/components/CountDown/index.zh-CN.md
deleted file mode 100644
index 7e00ba1da..000000000
--- a/admin-web/src/components/CountDown/index.zh-CN.md
+++ /dev/null
@@ -1,16 +0,0 @@
----
-title: CountDown
-subtitle: 倒计时
-cols: 1
-order: 3
----
-
-倒计时组件。
-
-## API
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| format | 时间格式化显示 | Function(time) | |
-| target | 目标时间 | Date | - |
-| onEnd | 倒计时结束回调 | funtion | -|
diff --git a/admin-web/src/components/DescriptionList/Description.d.ts b/admin-web/src/components/DescriptionList/Description.d.ts
deleted file mode 100644
index 2a17be374..000000000
--- a/admin-web/src/components/DescriptionList/Description.d.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import * as React from 'react';
-
-export default class Description extends React.Component<
- {
- term: React.ReactNode;
- style?: React.CSSProperties;
- },
- any
-> {}
diff --git a/admin-web/src/components/DescriptionList/Description.js b/admin-web/src/components/DescriptionList/Description.js
deleted file mode 100644
index fce9fd3cb..000000000
--- a/admin-web/src/components/DescriptionList/Description.js
+++ /dev/null
@@ -1,22 +0,0 @@
-import React from 'react';
-import PropTypes from 'prop-types';
-import { Col } from 'antd';
-import styles from './index.less';
-import responsive from './responsive';
-
-const Description = ({ term, column, children, ...restProps }) => (
-
- {term && {term}
}
- {children !== null && children !== undefined && {children}
}
-
-);
-
-Description.defaultProps = {
- term: '',
-};
-
-Description.propTypes = {
- term: PropTypes.node,
-};
-
-export default Description;
diff --git a/admin-web/src/components/DescriptionList/DescriptionList.js b/admin-web/src/components/DescriptionList/DescriptionList.js
deleted file mode 100644
index 84bdbd79d..000000000
--- a/admin-web/src/components/DescriptionList/DescriptionList.js
+++ /dev/null
@@ -1,33 +0,0 @@
-import React from 'react';
-import classNames from 'classnames';
-import { Row } from 'antd';
-import styles from './index.less';
-
-const DescriptionList = ({
- className,
- title,
- col = 3,
- layout = 'horizontal',
- gutter = 32,
- children,
- size,
- ...restProps
-}) => {
- const clsString = classNames(styles.descriptionList, styles[layout], className, {
- [styles.small]: size === 'small',
- [styles.large]: size === 'large',
- });
- const column = col > 4 ? 4 : col;
- return (
-
- {title ?
{title}
: null}
-
- {React.Children.map(children, child =>
- child ? React.cloneElement(child, { column }) : child
- )}
-
-
- );
-};
-
-export default DescriptionList;
diff --git a/admin-web/src/components/DescriptionList/demo/basic.md b/admin-web/src/components/DescriptionList/demo/basic.md
deleted file mode 100644
index 87954551e..000000000
--- a/admin-web/src/components/DescriptionList/demo/basic.md
+++ /dev/null
@@ -1,43 +0,0 @@
----
-order: 0
-title:
- zh-CN: 基本
- en-US: Basic
----
-
-## zh-CN
-
-基本描述列表。
-
-## en-US
-
-Basic DescriptionList.
-
-````jsx
-import DescriptionList from 'ant-design-pro/lib/DescriptionList';
-
-const { Description } = DescriptionList;
-
-ReactDOM.render(
-
-
- A free, open source, cross-platform,
- graphical web browser developed by the
- Mozilla Corporation and hundreds of
- volunteers.
-
-
- A free, open source, cross-platform,
- graphical web browser developed by the
- Mozilla Corporation and hundreds of
- volunteers.
-
-
- A free, open source, cross-platform,
- graphical web browser developed by the
- Mozilla Corporation and hundreds of
- volunteers.
-
-
-, mountNode);
-````
diff --git a/admin-web/src/components/DescriptionList/demo/vertical.md b/admin-web/src/components/DescriptionList/demo/vertical.md
deleted file mode 100644
index 2742f7c9f..000000000
--- a/admin-web/src/components/DescriptionList/demo/vertical.md
+++ /dev/null
@@ -1,43 +0,0 @@
----
-order: 1
-title:
- zh-CN: 垂直型
- en-US: Vertical
----
-
-## zh-CN
-
-垂直布局。
-
-## en-US
-
-Vertical layout.
-
-````jsx
-import DescriptionList from 'ant-design-pro/lib/DescriptionList';
-
-const { Description } = DescriptionList;
-
-ReactDOM.render(
-
-
- A free, open source, cross-platform,
- graphical web browser developed by the
- Mozilla Corporation and hundreds of
- volunteers.
-
-
- A free, open source, cross-platform,
- graphical web browser developed by the
- Mozilla Corporation and hundreds of
- volunteers.
-
-
- A free, open source, cross-platform,
- graphical web browser developed by the
- Mozilla Corporation and hundreds of
- volunteers.
-
-
-, mountNode);
-````
diff --git a/admin-web/src/components/DescriptionList/index.d.ts b/admin-web/src/components/DescriptionList/index.d.ts
deleted file mode 100644
index 96ccfa7da..000000000
--- a/admin-web/src/components/DescriptionList/index.d.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import * as React from 'react';
-import Description from './Description';
-
-export interface IDescriptionListProps {
- layout?: 'horizontal' | 'vertical';
- col?: number;
- title: React.ReactNode;
- gutter?: number;
- size?: 'large' | 'small';
- style?: React.CSSProperties;
-}
-
-export default class DescriptionList extends React.Component {
- public static Description: typeof Description;
-}
diff --git a/admin-web/src/components/DescriptionList/index.en-US.md b/admin-web/src/components/DescriptionList/index.en-US.md
deleted file mode 100644
index 089f30b1a..000000000
--- a/admin-web/src/components/DescriptionList/index.en-US.md
+++ /dev/null
@@ -1,33 +0,0 @@
----
-title: DescriptionList
-cols: 1
-order: 4
----
-
-Groups display multiple read-only fields, which are common to informational displays on detail pages.
-
-## API
-
-### DescriptionList
-
-| Property | Description | Type | Default |
-|----------|------------------------------------------|-------------|---------|
-| layout | type of layout | Enum{'horizontal', 'vertical'} | 'horizontal' |
-| col | specify the maximum number of columns to display, the final columns number is determined by col setting combined with [Responsive Rules](/components/DescriptionList#Responsive-Rules) | number(0 < col <= 4) | 3 |
-| title | title | ReactNode | - |
-| gutter | specify the distance between two items, unit is `px` | number | 32 |
-| size | size of list | Enum{'large', 'small'} | - |
-
-#### Responsive Rules
-
-| Window Width | Columns Number |
-|---------------------|---------------------------------------------|
-| `≥768px` | `col` |
-| `≥576px` | `col < 2 ? col : 2` |
-| `<576px` | `1` |
-
-### DescriptionList.Description
-
-| Property | Description | Type | Default |
-|----------|------------------------------------------|-------------|-------|
-| term | item title | ReactNode | - |
diff --git a/admin-web/src/components/DescriptionList/index.js b/admin-web/src/components/DescriptionList/index.js
deleted file mode 100644
index 357f479fd..000000000
--- a/admin-web/src/components/DescriptionList/index.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import DescriptionList from './DescriptionList';
-import Description from './Description';
-
-DescriptionList.Description = Description;
-export default DescriptionList;
diff --git a/admin-web/src/components/DescriptionList/index.less b/admin-web/src/components/DescriptionList/index.less
deleted file mode 100644
index 4048a128e..000000000
--- a/admin-web/src/components/DescriptionList/index.less
+++ /dev/null
@@ -1,76 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.descriptionList {
- // offset the padding-bottom of last row
- :global {
- .ant-row {
- margin-bottom: -16px;
- overflow: hidden;
- }
- }
-
- .title {
- margin-bottom: 16px;
- color: @heading-color;
- font-weight: 500;
- font-size: 14px;
- }
-
- .term {
- display: table-cell;
- padding-bottom: 16px;
- color: @heading-color;
- // Line-height is 22px IE dom height will calculate error
- line-height: 20px;
- white-space: nowrap;
-
- &::after {
- position: relative;
- top: -0.5px;
- margin: 0 8px 0 2px;
- content: ':';
- }
- }
-
- .detail {
- display: table-cell;
- width: 100%;
- padding-bottom: 16px;
- color: @text-color;
- line-height: 20px;
- }
-
- &.small {
- // offset the padding-bottom of last row
- :global {
- .ant-row {
- margin-bottom: -8px;
- }
- }
- .title {
- margin-bottom: 12px;
- color: @text-color;
- }
- .term,
- .detail {
- padding-bottom: 8px;
- }
- }
-
- &.large {
- .title {
- font-size: 16px;
- }
- }
-
- &.vertical {
- .term {
- display: block;
- padding-bottom: 8px;
- }
-
- .detail {
- display: block;
- }
- }
-}
diff --git a/admin-web/src/components/DescriptionList/index.zh-CN.md b/admin-web/src/components/DescriptionList/index.zh-CN.md
deleted file mode 100644
index b16a7fe76..000000000
--- a/admin-web/src/components/DescriptionList/index.zh-CN.md
+++ /dev/null
@@ -1,37 +0,0 @@
----
-title: DescriptionList
-subtitle: 描述列表
-cols: 1
-order: 4
----
-
-成组展示多个只读字段,常见于详情页的信息展示。
-
-## API
-
-### DescriptionList
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| layout | 布局方式 | Enum{'horizontal', 'vertical'} | 'horizontal' |
-| col | 指定信息最多分几列展示,最终一行几列由 col 配置结合[响应式规则](/components/DescriptionList#响应式规则)决定 | number(0 < col <= 4) | 3 |
-| title | 列表标题 | ReactNode | - |
-| gutter | 列表项间距,单位为 `px` | number | 32 |
-| size | 列表型号 | Enum{'large', 'small'} | - |
-
-#### 响应式规则
-
-| 窗口宽度 | 展示列数 |
-|---------------------|---------------------------------------------|
-| `≥768px` | `col` |
-| `≥576px` | `col < 2 ? col : 2` |
-| `<576px` | `1` |
-
-### DescriptionList.Description
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| term | 列表项标题 | ReactNode | - |
-
-
-
diff --git a/admin-web/src/components/DescriptionList/responsive.js b/admin-web/src/components/DescriptionList/responsive.js
deleted file mode 100644
index a5aa73f78..000000000
--- a/admin-web/src/components/DescriptionList/responsive.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export default {
- 1: { xs: 24 },
- 2: { xs: 24, sm: 12 },
- 3: { xs: 24, sm: 12, md: 8 },
- 4: { xs: 24, sm: 12, md: 6 },
-};
diff --git a/admin-web/src/components/Dictionary/DictionaryContext.js b/admin-web/src/components/Dictionary/DictionaryContext.js
deleted file mode 100644
index 08220f13f..000000000
--- a/admin-web/src/components/Dictionary/DictionaryContext.js
+++ /dev/null
@@ -1,6 +0,0 @@
-import React from 'react';
-
-// 字典全局的 Context,会提前初始化工作。
-const DictionaryContext = React.createContext({});
-
-export default DictionaryContext;
diff --git a/admin-web/src/components/Dictionary/DictionarySelect.d.ts b/admin-web/src/components/Dictionary/DictionarySelect.d.ts
deleted file mode 100644
index aed5d9f31..000000000
--- a/admin-web/src/components/Dictionary/DictionarySelect.d.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { Select } from 'antd';
-import * as React from 'react';
-
-export interface IDictionarySelectProps extends Select {
- dicKey?: string;
- defaultValue?: string | number | boolean;
-}
-
-// eslint-disable-next-line react/prefer-stateless-function
-export default class DictionarySelectD extends React.Component {}
diff --git a/admin-web/src/components/Dictionary/DictionarySelect.js b/admin-web/src/components/Dictionary/DictionarySelect.js
deleted file mode 100644
index 7c4ba54d0..000000000
--- a/admin-web/src/components/Dictionary/DictionarySelect.js
+++ /dev/null
@@ -1,42 +0,0 @@
-import React, { PureComponent } from 'react';
-import { Select } from 'antd';
-import DictionaryContext from './DictionaryContext';
-
-export default class DictionarySelect extends PureComponent {
- renderSelect(children) {
- // const { initialValue } = this.props['data-__meta'];
- const propsX = {
- ...this.props,
- };
- if (propsX.value !== undefined || propsX.value !== null) {
- propsX.value = `${propsX.value}`;
- }
- if (propsX.value === 'undefined' || propsX.value === 'null') {
- delete propsX.value;
- }
- return ;
- }
-
- render() {
- const { dicKey } = this.props;
- return (
-
- {context => {
- const dicValues = context[dicKey];
- let nodes = [];
- if (dicValues) {
- nodes = Object.keys(dicValues).map(value => {
- const text = dicValues[value];
- return (
-
- {text}
-
- );
- });
- }
- return this.renderSelect(nodes);
- }}
-
- );
- }
-}
diff --git a/admin-web/src/components/Dictionary/DictionarySelect.md b/admin-web/src/components/Dictionary/DictionarySelect.md
deleted file mode 100644
index dc3d4a7aa..000000000
--- a/admin-web/src/components/Dictionary/DictionarySelect.md
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: DictionarySelect
-subtitle: 描述列表
----
-
-次组件跟使用 Antd extends Select,使用方法跟 Select 一样
-
-## API
-
-### DictionarySelect
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| dicKey | 字典key值 | string[] | [] |
-| defaultValue | 来自 antd Select组件 | string、number、boolean | [] |
-
-### Demo
-```jsx harmony
-
-```
-
diff --git a/admin-web/src/components/Dictionary/DictionaryText.d.ts b/admin-web/src/components/Dictionary/DictionaryText.d.ts
deleted file mode 100644
index 4c2b4eaa2..000000000
--- a/admin-web/src/components/Dictionary/DictionaryText.d.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { Select } from 'antd';
-import * as React from 'react';
-
-export interface IDictionaryTextProps extends Select {
- dicKey?: string;
- dicValue?: string | number | boolean | Array;
-}
-
-// eslint-disable-next-line react/prefer-stateless-function
-export default class DictionaryText extends React.Component {}
diff --git a/admin-web/src/components/Dictionary/DictionaryText.js b/admin-web/src/components/Dictionary/DictionaryText.js
deleted file mode 100644
index c5de6250e..000000000
--- a/admin-web/src/components/Dictionary/DictionaryText.js
+++ /dev/null
@@ -1,22 +0,0 @@
-import React, { PureComponent } from 'react';
-import DictionaryContext from './DictionaryContext';
-
-export default class DictionaryText extends PureComponent {
- componentDidMount() {}
-
- render() {
- // debugger;
- const { dicKey, dicValue } = this.props;
- return (
-
- {context => {
- const dicValues = context[dicKey];
- if (dicValues) {
- return dicValues[dicValue];
- }
- return dicValue;
- }}
-
- );
- }
-}
diff --git a/admin-web/src/components/Dictionary/DictionaryText.md b/admin-web/src/components/Dictionary/DictionaryText.md
deleted file mode 100644
index 0750889ca..000000000
--- a/admin-web/src/components/Dictionary/DictionaryText.md
+++ /dev/null
@@ -1,19 +0,0 @@
----
-title: DictionaryText
-subtitle: 获取字典 value 显示值
----
-
-## API
-
-### DescriptionList
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| dicKey | 字典的key | string | [] |
-| dicValue | value值 | string、number、boolean | [] |
-
-
-### Demo
-```jsx harmony
-
-```
diff --git a/admin-web/src/components/EditableItem/index.js b/admin-web/src/components/EditableItem/index.js
deleted file mode 100644
index 40034d0ac..000000000
--- a/admin-web/src/components/EditableItem/index.js
+++ /dev/null
@@ -1,50 +0,0 @@
-import React, { PureComponent } from 'react';
-import { Input, Icon } from 'antd';
-import styles from './index.less';
-
-export default class EditableItem extends PureComponent {
- constructor(props) {
- super(props);
- this.state = {
- value: props.value,
- editable: false,
- };
- }
-
- handleChange = e => {
- const { value } = e.target;
- this.setState({ value });
- };
-
- check = () => {
- this.setState({ editable: false });
- const { value } = this.state;
- const { onChange } = this.props;
- if (onChange) {
- onChange(value);
- }
- };
-
- edit = () => {
- this.setState({ editable: true });
- };
-
- render() {
- const { value, editable } = this.state;
- return (
-
- {editable ? (
-
-
-
-
- ) : (
-
- {value || ' '}
-
-
- )}
-
- );
- }
-}
diff --git a/admin-web/src/components/EditableItem/index.less b/admin-web/src/components/EditableItem/index.less
deleted file mode 100644
index 7fdf33706..000000000
--- a/admin-web/src/components/EditableItem/index.less
+++ /dev/null
@@ -1,25 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.editableItem {
- display: table;
- width: 100%;
- margin-top: (@font-size-base * @line-height-base - @input-height-base) / 2;
- line-height: @input-height-base;
-
- .wrapper {
- display: table-row;
-
- & > * {
- display: table-cell;
- }
-
- & > *:first-child {
- width: 85%;
- }
-
- .icon {
- text-align: right;
- cursor: pointer;
- }
- }
-}
diff --git a/admin-web/src/components/EditableLinkGroup/index.js b/admin-web/src/components/EditableLinkGroup/index.js
deleted file mode 100644
index ae3d93c71..000000000
--- a/admin-web/src/components/EditableLinkGroup/index.js
+++ /dev/null
@@ -1,46 +0,0 @@
-import React, { PureComponent, createElement } from 'react';
-import PropTypes from 'prop-types';
-import { Button } from 'antd';
-import styles from './index.less';
-
-// TODO: 添加逻辑
-
-class EditableLinkGroup extends PureComponent {
- static propTypes = {
- links: PropTypes.array,
- onAdd: PropTypes.func,
- linkElement: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
- };
-
- static defaultProps = {
- links: [],
- onAdd: () => {},
- linkElement: 'a',
- };
-
- render() {
- const { links, linkElement, onAdd } = this.props;
- return (
-
- {links.map(link =>
- createElement(
- linkElement,
- {
- key: `linkGroup-item-${link.id || link.title}`,
- to: link.href,
- href: link.href,
- },
- link.title
- )
- )}
- {
-
- }
-
- );
- }
-}
-
-export default EditableLinkGroup;
diff --git a/admin-web/src/components/EditableLinkGroup/index.less b/admin-web/src/components/EditableLinkGroup/index.less
deleted file mode 100644
index ba53315d9..000000000
--- a/admin-web/src/components/EditableLinkGroup/index.less
+++ /dev/null
@@ -1,16 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.linkGroup {
- padding: 20px 0 8px 24px;
- font-size: 0;
- & > a {
- display: inline-block;
- width: 25%;
- margin-bottom: 13px;
- color: @text-color;
- font-size: @font-size-base;
- &:hover {
- color: @primary-color;
- }
- }
-}
diff --git a/admin-web/src/components/Editor/HtmlEditor.js b/admin-web/src/components/Editor/HtmlEditor.js
deleted file mode 100644
index 7cd8d1611..000000000
--- a/admin-web/src/components/Editor/HtmlEditor.js
+++ /dev/null
@@ -1,116 +0,0 @@
-import React from "react";
-
-import 'braft-editor/dist/index.css'
-import BraftEditor from 'braft-editor'
-import { ContentUtils } from 'braft-utils'
-import { ImageUtils } from 'braft-finder'
-
-import {fileGetQiniuToken} from "../../services/admin";
-import uuid from "js-uuid";
-import * as qiniu from "qiniu-js";
-import {Icon, Upload} from "antd";
-
-class HtmlEditor extends React.Component {
-
- state = {
- editorState: BraftEditor.createEditorState(null),
- };
-
- handleChange = (editorState) => {
- this.setState({editorState})
- };
-
- uploadHandler = async (param) => {
- if (!param.file) {
- return false
- }
- debugger;
- const tokenResult = await fileGetQiniuToken();
- if (tokenResult.code !== 0) {
- alert('获得七牛上传 Token 失败');
- return false;
- }
- let token = tokenResult.data;
- let that = this;
- const reader = new FileReader();
- const file = param.file;
- reader.readAsArrayBuffer(file);
- let fileData = null;
- reader.onload = (e) => {
- let key = uuid.v4(); // TODO 芋艿,可能后面要优化。MD5?
- let observable = qiniu.upload(file, key, token); // TODO 芋艿,最后后面去掉 qiniu 的库依赖,直接 http 请求,这样更轻量
- observable.subscribe(function () {
- // next
- }, function (e) {
- // error
- // TODO 芋艿,后续补充
- // debugger;
- }, function (response) {
- // complete
- that.setState({
- editorState: ContentUtils.insertMedias(that.state.editorState, [{
- type: 'IMAGE',
- url: 'http://static.shop.iocoder.cn/' + response.key,
- }])
- })
- });
- }
- };
-
- getHtml() {
- return this.state.editorState.toHTML();
- }
-
- setHtml = (html) => {
- this.setState({
- editorState: BraftEditor.createEditorState(html),
- })
- };
-
- isEmpty = () => {
- return this.state.editorState.isEmpty();
- };
-
- render() {
- // const controls = ['bold', 'italic', 'underline', 'text-color', 'separator', 'link', 'separator'];
- const extendControls = [
- {
- key: 'antd-uploader',
- type: 'component',
- component: (
-
- {/* 这里的按钮最好加上type="button",以避免在表单容器中触发表单提交,用Antd的Button组件则无需如此 */}
-
-
- )
- }
- ];
-
- return (
-
-
-
- )
- }
-
-}
-
-
-{/**/}
-
-//
-
-export default HtmlEditor;
diff --git a/admin-web/src/components/Ellipsis/demo/line.md b/admin-web/src/components/Ellipsis/demo/line.md
deleted file mode 100644
index bc31170dc..000000000
--- a/admin-web/src/components/Ellipsis/demo/line.md
+++ /dev/null
@@ -1,31 +0,0 @@
----
-order: 1
-title:
- zh-CN: 按照行数省略
- en-US: Truncate according to the number of rows
----
-
-## zh-CN
-
-通过设置 `lines` 属性指定最大行数,如果超过这个行数的文本会自动截取。但是在这种模式下所有 `children` 将会被转换成纯文本。
-
-并且注意在这种模式下,外容器需要有指定的宽度(或设置自身宽度)。
-
-## en-US
-
-`lines` attribute specifies the maximum number of rows where the text will automatically be truncated when exceeded. In this mode, all children will be converted to plain text.
-
-Also note that, in this mode, the outer container needs to have a specified width (or set its own width).
-
-
-````jsx
-import Ellipsis from 'ant-design-pro/lib/Ellipsis';
-
-const article = There were injuries alleged in three cases in 2015, and a fourth incident in September, according to the safety recall report. After meeting with US regulators in October, the firm decided to issue a voluntary recall.
;
-
-ReactDOM.render(
-
- {article}
-
-, mountNode);
-````
diff --git a/admin-web/src/components/Ellipsis/demo/number.md b/admin-web/src/components/Ellipsis/demo/number.md
deleted file mode 100644
index 0bc1a0ff7..000000000
--- a/admin-web/src/components/Ellipsis/demo/number.md
+++ /dev/null
@@ -1,28 +0,0 @@
----
-order: 0
-title:
- zh-CN: 按照字符数省略
- en-US: Truncate according to the number of character
----
-
-## zh-CN
-
-通过设置 `length` 属性指定文本最长长度,如果超过这个长度会自动截取。
-
-## en-US
-
-`length` attribute specifies the maximum length where the text will automatically be truncated when exceeded.
-
-````jsx
-import Ellipsis from 'ant-design-pro/lib/Ellipsis';
-
-const article = 'There were injuries alleged in three cases in 2015, and a fourth incident in September, according to the safety recall report. After meeting with US regulators in October, the firm decided to issue a voluntary recall.';
-
-ReactDOM.render(
-
- {article}
-
Show Tooltip
- {article}
-
-, mountNode);
-````
diff --git a/admin-web/src/components/Ellipsis/index.d.ts b/admin-web/src/components/Ellipsis/index.d.ts
deleted file mode 100644
index 37d508d77..000000000
--- a/admin-web/src/components/Ellipsis/index.d.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import * as React from 'react';
-import { TooltipProps } from 'antd/lib/tooltip';
-
-export interface IEllipsisTooltipProps extends TooltipProps {
- title?: undefined;
- overlayStyle?: undefined;
-}
-
-export interface IEllipsisProps {
- tooltip?: boolean | IEllipsisTooltipProps;
- length?: number;
- lines?: number;
- style?: React.CSSProperties;
- className?: string;
- fullWidthRecognition?: boolean;
-}
-
-export function getStrFullLength(str: string): number;
-export function cutStrByFullLength(str: string, maxLength: number): string;
-
-export default class Ellipsis extends React.Component {}
diff --git a/admin-web/src/components/Ellipsis/index.en-US.md b/admin-web/src/components/Ellipsis/index.en-US.md
deleted file mode 100644
index 15139cc9d..000000000
--- a/admin-web/src/components/Ellipsis/index.en-US.md
+++ /dev/null
@@ -1,16 +0,0 @@
----
-title: Ellipsis
-cols: 1
-order: 10
----
-
-When the text is too long, the Ellipsis automatically shortens it according to its length or the maximum number of lines.
-
-## API
-
-Property | Description | Type | Default
-----|------|-----|------
-tooltip | tooltip for showing the full text content when hovering over | boolean | -
-length | maximum number of characters in the text before being truncated | number | -
-lines | maximum number of rows in the text before being truncated | number | `1`
-fullWidthRecognition | whether consider full-width character length as 2 when calculate string length | boolean | -
diff --git a/admin-web/src/components/Ellipsis/index.js b/admin-web/src/components/Ellipsis/index.js
deleted file mode 100644
index de700b74b..000000000
--- a/admin-web/src/components/Ellipsis/index.js
+++ /dev/null
@@ -1,270 +0,0 @@
-import React, { Component } from 'react';
-import { Tooltip } from 'antd';
-import classNames from 'classnames';
-import styles from './index.less';
-
-/* eslint react/no-did-mount-set-state: 0 */
-/* eslint no-param-reassign: 0 */
-
-const isSupportLineClamp = document.body.style.webkitLineClamp !== undefined;
-
-const TooltipOverlayStyle = {
- overflowWrap: 'break-word',
- wordWrap: 'break-word',
-};
-
-export const getStrFullLength = (str = '') =>
- str.split('').reduce((pre, cur) => {
- const charCode = cur.charCodeAt(0);
- if (charCode >= 0 && charCode <= 128) {
- return pre + 1;
- }
- return pre + 2;
- }, 0);
-
-export const cutStrByFullLength = (str = '', maxLength) => {
- let showLength = 0;
- return str.split('').reduce((pre, cur) => {
- const charCode = cur.charCodeAt(0);
- if (charCode >= 0 && charCode <= 128) {
- showLength += 1;
- } else {
- showLength += 2;
- }
- if (showLength <= maxLength) {
- return pre + cur;
- }
- return pre;
- }, '');
-};
-
-const getTooltip = ({ tooltip, overlayStyle, title, children }) => {
- if (tooltip) {
- const props = tooltip === true ? { overlayStyle, title } : { ...tooltip, overlayStyle, title };
- return {children};
- }
- return children;
-};
-
-const EllipsisText = ({ text, length, tooltip, fullWidthRecognition, ...other }) => {
- if (typeof text !== 'string') {
- throw new Error('Ellipsis children must be string.');
- }
- const textLength = fullWidthRecognition ? getStrFullLength(text) : text.length;
- if (textLength <= length || length < 0) {
- return {text};
- }
- const tail = '...';
- let displayText;
- if (length - tail.length <= 0) {
- displayText = '';
- } else {
- displayText = fullWidthRecognition ? cutStrByFullLength(text, length) : text.slice(0, length);
- }
-
- const spanAttrs = tooltip ? {} : { ...other };
- return getTooltip({
- tooltip,
- overlayStyle: TooltipOverlayStyle,
- title: text,
- children: (
-
- {displayText}
- {tail}
-
- ),
- });
-};
-
-export default class Ellipsis extends Component {
- state = {
- text: '',
- targetCount: 0,
- };
-
- componentDidMount() {
- if (this.node) {
- this.computeLine();
- }
- }
-
- componentDidUpdate(perProps) {
- const { lines } = this.props;
- if (lines !== perProps.lines) {
- this.computeLine();
- }
- }
-
- computeLine = () => {
- const { lines } = this.props;
- if (lines && !isSupportLineClamp) {
- const text = this.shadowChildren.innerText || this.shadowChildren.textContent;
- const lineHeight = parseInt(getComputedStyle(this.root).lineHeight, 10);
- const targetHeight = lines * lineHeight;
- this.content.style.height = `${targetHeight}px`;
- const totalHeight = this.shadowChildren.offsetHeight;
- const shadowNode = this.shadow.firstChild;
-
- if (totalHeight <= targetHeight) {
- this.setState({
- text,
- targetCount: text.length,
- });
- return;
- }
-
- // bisection
- const len = text.length;
- const mid = Math.ceil(len / 2);
-
- const count = this.bisection(targetHeight, mid, 0, len, text, shadowNode);
-
- this.setState({
- text,
- targetCount: count,
- });
- }
- };
-
- bisection = (th, m, b, e, text, shadowNode) => {
- const suffix = '...';
- let mid = m;
- let end = e;
- let begin = b;
- shadowNode.innerHTML = text.substring(0, mid) + suffix;
- let sh = shadowNode.offsetHeight;
-
- if (sh <= th) {
- shadowNode.innerHTML = text.substring(0, mid + 1) + suffix;
- sh = shadowNode.offsetHeight;
- if (sh > th || mid === begin) {
- return mid;
- }
- begin = mid;
- if (end - begin === 1) {
- mid = 1 + begin;
- } else {
- mid = Math.floor((end - begin) / 2) + begin;
- }
- return this.bisection(th, mid, begin, end, text, shadowNode);
- }
- if (mid - 1 < 0) {
- return mid;
- }
- shadowNode.innerHTML = text.substring(0, mid - 1) + suffix;
- sh = shadowNode.offsetHeight;
- if (sh <= th) {
- return mid - 1;
- }
- end = mid;
- mid = Math.floor((end - begin) / 2) + begin;
- return this.bisection(th, mid, begin, end, text, shadowNode);
- };
-
- handleRoot = n => {
- this.root = n;
- };
-
- handleContent = n => {
- this.content = n;
- };
-
- handleNode = n => {
- this.node = n;
- };
-
- handleShadow = n => {
- this.shadow = n;
- };
-
- handleShadowChildren = n => {
- this.shadowChildren = n;
- };
-
- render() {
- const { text, targetCount } = this.state;
- const {
- children,
- lines,
- length,
- className,
- tooltip,
- fullWidthRecognition,
- ...restProps
- } = this.props;
-
- const cls = classNames(styles.ellipsis, className, {
- [styles.lines]: lines && !isSupportLineClamp,
- [styles.lineClamp]: lines && isSupportLineClamp,
- });
-
- if (!lines && !length) {
- return (
-
- {children}
-
- );
- }
-
- // length
- if (!lines) {
- return (
-
- );
- }
-
- const id = `antd-pro-ellipsis-${`${new Date().getTime()}${Math.floor(Math.random() * 100)}`}`;
-
- // support document.body.style.webkitLineClamp
- if (isSupportLineClamp) {
- const style = `#${id}{-webkit-line-clamp:${lines};-webkit-box-orient: vertical;}`;
-
- const node = (
-
-
- {children}
-
- );
-
- return getTooltip({
- tooltip,
- overlayStyle: TooltipOverlayStyle,
- title: children,
- children: node,
- });
- }
-
- const childNode = (
-
- {targetCount > 0 && text.substring(0, targetCount)}
- {targetCount > 0 && targetCount < text.length && '...'}
-
- );
-
- return (
-
-
- {getTooltip({
- tooltip,
- overlayStyle: TooltipOverlayStyle,
- title: text,
- children: childNode,
- })}
-
- {children}
-
-
- {text}
-
-
-
- );
- }
-}
diff --git a/admin-web/src/components/Ellipsis/index.less b/admin-web/src/components/Ellipsis/index.less
deleted file mode 100644
index 3c0360c10..000000000
--- a/admin-web/src/components/Ellipsis/index.less
+++ /dev/null
@@ -1,24 +0,0 @@
-.ellipsis {
- display: inline-block;
- width: 100%;
- overflow: hidden;
- word-break: break-all;
-}
-
-.lines {
- position: relative;
- .shadow {
- position: absolute;
- z-index: -999;
- display: block;
- color: transparent;
- opacity: 0;
- }
-}
-
-.lineClamp {
- position: relative;
- display: -webkit-box;
- overflow: hidden;
- text-overflow: ellipsis;
-}
diff --git a/admin-web/src/components/Ellipsis/index.test.js b/admin-web/src/components/Ellipsis/index.test.js
deleted file mode 100644
index 4d057b24e..000000000
--- a/admin-web/src/components/Ellipsis/index.test.js
+++ /dev/null
@@ -1,13 +0,0 @@
-import { getStrFullLength, cutStrByFullLength } from './index';
-
-describe('test calculateShowLength', () => {
- it('get full length', () => {
- expect(getStrFullLength('一二,a,')).toEqual(8);
- });
- it('cut str by full length', () => {
- expect(cutStrByFullLength('一二,a,', 7)).toEqual('一二,a');
- });
- it('cut str when length small', () => {
- expect(cutStrByFullLength('一22三', 5)).toEqual('一22');
- });
-});
diff --git a/admin-web/src/components/Ellipsis/index.zh-CN.md b/admin-web/src/components/Ellipsis/index.zh-CN.md
deleted file mode 100644
index f7a70eadd..000000000
--- a/admin-web/src/components/Ellipsis/index.zh-CN.md
+++ /dev/null
@@ -1,17 +0,0 @@
----
-title: Ellipsis
-subtitle: 文本自动省略号
-cols: 1
-order: 10
----
-
-文本过长自动处理省略号,支持按照文本长度和最大行数两种方式截取。
-
-## API
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-tooltip | 移动到文本展示完整内容的提示 | boolean | -
-length | 在按照长度截取下的文本最大字符数,超过则截取省略 | number | -
-lines | 在按照行数截取下最大的行数,超过则截取省略 | number | `1`
-fullWidthRecognition | 是否将全角字符的长度视为2来计算字符串长度 | boolean | -
diff --git a/admin-web/src/components/Exception/demo/403.md b/admin-web/src/components/Exception/demo/403.md
deleted file mode 100644
index c0244ab12..000000000
--- a/admin-web/src/components/Exception/demo/403.md
+++ /dev/null
@@ -1,29 +0,0 @@
----
-order: 2
-title:
- zh-CN: 403 页面
- en-US: 403 Page
----
-
-## zh-CN
-
-403 页面,配合自定义操作。
-
-## en-US
-
-403 page with custom operations.
-
-````jsx
-import Exception from 'ant-design-pro/lib/Exception';
-import { Button } from 'antd';
-
-const actions = (
-
-
-
-
-);
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/admin-web/src/components/Exception/demo/404.md b/admin-web/src/components/Exception/demo/404.md
deleted file mode 100644
index c54e99d47..000000000
--- a/admin-web/src/components/Exception/demo/404.md
+++ /dev/null
@@ -1,22 +0,0 @@
----
-order: 0
-title:
- zh-CN: 404 页面
- en-US: 404 Page
----
-
-## zh-CN
-
-404 页面。
-
-## en-US
-
-404 page.
-
-````jsx
-import Exception from 'ant-design-pro/lib/Exception';
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/admin-web/src/components/Exception/demo/500.md b/admin-web/src/components/Exception/demo/500.md
deleted file mode 100644
index 2336e41ed..000000000
--- a/admin-web/src/components/Exception/demo/500.md
+++ /dev/null
@@ -1,22 +0,0 @@
----
-order: 1
-title:
- zh-CN: 500 页面
- en-US: 500 Page
----
-
-## zh-CN
-
-500 页面。
-
-## en-US
-
-500 page.
-
-````jsx
-import Exception from 'ant-design-pro/lib/Exception';
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/admin-web/src/components/Exception/index.d.ts b/admin-web/src/components/Exception/index.d.ts
deleted file mode 100644
index a74abb1fa..000000000
--- a/admin-web/src/components/Exception/index.d.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import * as React from 'react';
-export interface IExceptionProps {
- type?: '403' | '404' | '500';
- title?: React.ReactNode;
- desc?: React.ReactNode;
- img?: string;
- actions?: React.ReactNode;
- linkElement?: string | React.ComponentType;
- style?: React.CSSProperties;
- className?: string;
- backText?: React.ReactNode;
- redirect?: string;
-}
-
-export default class Exception extends React.Component {}
diff --git a/admin-web/src/components/Exception/index.en-US.md b/admin-web/src/components/Exception/index.en-US.md
deleted file mode 100644
index 37e7e8075..000000000
--- a/admin-web/src/components/Exception/index.en-US.md
+++ /dev/null
@@ -1,20 +0,0 @@
----
-title: Exception
-cols: 1
-order: 5
----
-
-Exceptions page is used to provide feedback on specific abnormal state. Usually, it contains an explanation of the error status, and provides users with suggestions or operations, to prevent users from feeling lost and confused.
-
-## API
-
-Property | Description | Type | Default
----------|-------------|------|--------
-| backText | default return button text | ReactNode | back to home |
-type | type of exception, the corresponding default `title`, `desc`, `img` will be given if set, which can be overridden by explicit setting of `title`, `desc`, `img` | Enum {'403', '404', '500'} | -
-title | title | ReactNode | -
-desc | supplementary description | ReactNode | -
-img | the url of background image | string | -
-actions | suggested operations, a default 'Home' link will show if not set | ReactNode | -
-linkElement | to specify the element of link | string\|ReactElement | 'a'
-redirect | redirect path | string | '/'
\ No newline at end of file
diff --git a/admin-web/src/components/Exception/index.js b/admin-web/src/components/Exception/index.js
deleted file mode 100644
index 2c7223cc7..000000000
--- a/admin-web/src/components/Exception/index.js
+++ /dev/null
@@ -1,61 +0,0 @@
-import React, { createElement } from 'react';
-import classNames from 'classnames';
-import { Button } from 'antd';
-import config from './typeConfig';
-import styles from './index.less';
-
-class Exception extends React.PureComponent {
- static defaultProps = {
- backText: 'back to home',
- redirect: '/',
- };
-
- constructor(props) {
- super(props);
- this.state = {};
- }
-
- render() {
- const {
- className,
- backText,
- linkElement = 'a',
- type,
- title,
- desc,
- img,
- actions,
- redirect,
- ...rest
- } = this.props;
- const pageType = type in config ? type : '404';
- const clsString = classNames(styles.exception, className);
- return (
-
-
-
-
{title || config[pageType].title}
-
{desc || config[pageType].desc}
-
- {actions ||
- createElement(
- linkElement,
- {
- to: redirect,
- href: redirect,
- },
-
- )}
-
-
-
- );
- }
-}
-
-export default Exception;
diff --git a/admin-web/src/components/Exception/index.less b/admin-web/src/components/Exception/index.less
deleted file mode 100644
index 45a2844b8..000000000
--- a/admin-web/src/components/Exception/index.less
+++ /dev/null
@@ -1,89 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.exception {
- display: flex;
- align-items: center;
- height: 80%;
- min-height: 500px;
-
- .imgBlock {
- flex: 0 0 62.5%;
- width: 62.5%;
- padding-right: 152px;
- zoom: 1;
- &::before,
- &::after {
- content: ' ';
- display: table;
- }
- &::after {
- clear: both;
- height: 0;
- font-size: 0;
- visibility: hidden;
- }
- }
-
- .imgEle {
- float: right;
- width: 100%;
- max-width: 430px;
- height: 360px;
- background-repeat: no-repeat;
- background-position: 50% 50%;
- background-size: contain;
- }
-
- .content {
- flex: auto;
-
- h1 {
- margin-bottom: 24px;
- color: #434e59;
- font-weight: 600;
- font-size: 72px;
- line-height: 72px;
- }
-
- .desc {
- margin-bottom: 16px;
- color: @text-color-secondary;
- font-size: 20px;
- line-height: 28px;
- }
-
- .actions {
- button:not(:last-child) {
- margin-right: 8px;
- }
- }
- }
-}
-
-@media screen and (max-width: @screen-xl) {
- .exception {
- .imgBlock {
- padding-right: 88px;
- }
- }
-}
-
-@media screen and (max-width: @screen-sm) {
- .exception {
- display: block;
- text-align: center;
- .imgBlock {
- margin: 0 auto 24px;
- padding-right: 0;
- }
- }
-}
-
-@media screen and (max-width: @screen-xs) {
- .exception {
- .imgBlock {
- margin-bottom: -24px;
- overflow: hidden;
- }
- }
-}
diff --git a/admin-web/src/components/Exception/index.zh-CN.md b/admin-web/src/components/Exception/index.zh-CN.md
deleted file mode 100644
index 2e64399fc..000000000
--- a/admin-web/src/components/Exception/index.zh-CN.md
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: Exception
-subtitle: 异常
-cols: 1
-order: 5
----
-
-异常页用于对页面特定的异常状态进行反馈。通常,它包含对错误状态的阐述,并向用户提供建议或操作,避免用户感到迷失和困惑。
-
-## API
-
-| 参数 | 说明| 类型 | 默认值 |
-|-------------|------------------------------------------|-------------|-------|
-| backText| 默认的返回按钮文本 | ReactNode| back to home |
-| type| 页面类型,若配置,则自带对应类型默认的 `title`,`desc`,`img`,此默认设置可以被 `title`,`desc`,`img` 覆盖 | Enum {'403', '404', '500'} | - |
-| title | 标题 | ReactNode| -|
-| desc| 补充描述| ReactNode| -|
-| img | 背景图片地址 | string| -|
-| actions | 建议操作,配置此属性时默认的『返回首页』按钮不生效| ReactNode| -|
-| linkElement | 定义链接的元素 | string\|ReactElement | 'a' |
-| redirect | 返回按钮的跳转地址 | string | '/'
diff --git a/admin-web/src/components/Exception/typeConfig.js b/admin-web/src/components/Exception/typeConfig.js
deleted file mode 100644
index b6e1ee5a9..000000000
--- a/admin-web/src/components/Exception/typeConfig.js
+++ /dev/null
@@ -1,19 +0,0 @@
-const config = {
- 403: {
- img: 'https://gw.alipayobjects.com/zos/rmsportal/wZcnGqRDyhPOEYFcZDnb.svg',
- title: '403',
- desc: '抱歉,你无权访问该页面',
- },
- 404: {
- img: 'https://gw.alipayobjects.com/zos/rmsportal/KpnpchXsobRgLElEozzI.svg',
- title: '404',
- desc: '抱歉,你访问的页面不存在',
- },
- 500: {
- img: 'https://gw.alipayobjects.com/zos/rmsportal/RVRUAYdCGeYNBWoKiIwB.svg',
- title: '500',
- desc: '抱歉,服务器出错了',
- },
-};
-
-export default config;
diff --git a/admin-web/src/components/FooterToolbar/demo/basic.md b/admin-web/src/components/FooterToolbar/demo/basic.md
deleted file mode 100644
index 3043dbf74..000000000
--- a/admin-web/src/components/FooterToolbar/demo/basic.md
+++ /dev/null
@@ -1,44 +0,0 @@
----
-order: 0
-title:
- zh-CN: 演示
- en-US: demo
-iframe: 400
----
-
-## zh-CN
-
-浮动固定页脚。
-
-## en-US
-
-Fixed to the footer.
-
-````jsx
-import FooterToolbar from 'ant-design-pro/lib/FooterToolbar';
-import { Button } from 'antd';
-
-ReactDOM.render(
-
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
Content Content Content Content
-
-
-
-
-
-, mountNode);
-````
\ No newline at end of file
diff --git a/admin-web/src/components/FooterToolbar/index.d.ts b/admin-web/src/components/FooterToolbar/index.d.ts
deleted file mode 100644
index 9c6ac5b4c..000000000
--- a/admin-web/src/components/FooterToolbar/index.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import * as React from 'react';
-export interface IFooterToolbarProps {
- extra: React.ReactNode;
- style?: React.CSSProperties;
-}
-
-export default class FooterToolbar extends React.Component {}
diff --git a/admin-web/src/components/FooterToolbar/index.en-US.md b/admin-web/src/components/FooterToolbar/index.en-US.md
deleted file mode 100644
index 69fd80bda..000000000
--- a/admin-web/src/components/FooterToolbar/index.en-US.md
+++ /dev/null
@@ -1,18 +0,0 @@
----
-title: FooterToolbar
-cols: 1
-order: 6
----
-
-A toolbar fixed at the bottom.
-
-## Usage
-
-It is fixed at the bottom of the content area and does not move along with the scroll bar, which is usually used for data collection and submission for long pages.
-
-## API
-
-Property | Description | Type | Default
----------|-------------|------|--------
-children | toolbar content, align to the right | ReactNode | -
-extra | extra information, align to the left | ReactNode | -
\ No newline at end of file
diff --git a/admin-web/src/components/FooterToolbar/index.js b/admin-web/src/components/FooterToolbar/index.js
deleted file mode 100644
index d43f72fb4..000000000
--- a/admin-web/src/components/FooterToolbar/index.js
+++ /dev/null
@@ -1,47 +0,0 @@
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import classNames from 'classnames';
-import styles from './index.less';
-
-export default class FooterToolbar extends Component {
- static contextTypes = {
- isMobile: PropTypes.bool,
- };
-
- state = {
- width: undefined,
- };
-
- componentDidMount() {
- window.addEventListener('resize', this.resizeFooterToolbar);
- this.resizeFooterToolbar();
- }
-
- componentWillUnmount() {
- window.removeEventListener('resize', this.resizeFooterToolbar);
- }
-
- resizeFooterToolbar = () => {
- const sider = document.querySelector('.ant-layout-sider');
- if (sider == null) {
- return;
- }
- const { isMobile } = this.context;
- const width = isMobile ? null : `calc(100% - ${sider.style.width})`;
- const { width: stateWidth } = this.state;
- if (stateWidth !== width) {
- this.setState({ width });
- }
- };
-
- render() {
- const { children, className, extra, ...restProps } = this.props;
- const { width } = this.state;
- return (
-
- );
- }
-}
diff --git a/admin-web/src/components/FooterToolbar/index.less b/admin-web/src/components/FooterToolbar/index.less
deleted file mode 100644
index 5073cff61..000000000
--- a/admin-web/src/components/FooterToolbar/index.less
+++ /dev/null
@@ -1,33 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.toolbar {
- position: fixed;
- right: 0;
- bottom: 0;
- z-index: 9;
- width: 100%;
- height: 56px;
- padding: 0 24px;
- line-height: 56px;
- background: #fff;
- border-top: 1px solid @border-color-split;
- box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.03);
-
- &::after {
- display: block;
- clear: both;
- content: '';
- }
-
- .left {
- float: left;
- }
-
- .right {
- float: right;
- }
-
- button + button {
- margin-left: 8px;
- }
-}
diff --git a/admin-web/src/components/FooterToolbar/index.zh-CN.md b/admin-web/src/components/FooterToolbar/index.zh-CN.md
deleted file mode 100644
index 421ac08e7..000000000
--- a/admin-web/src/components/FooterToolbar/index.zh-CN.md
+++ /dev/null
@@ -1,19 +0,0 @@
----
-title: FooterToolbar
-subtitle: 底部工具栏
-cols: 1
-order: 6
----
-
-固定在底部的工具栏。
-
-## 何时使用
-
-固定在内容区域的底部,不随滚动条移动,常用于长页面的数据搜集和提交工作。
-
-## API
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-children | 工具栏内容,向右对齐 | ReactNode | -
-extra | 额外信息,向左对齐 | ReactNode | -
diff --git a/admin-web/src/components/GlobalFooter/demo/basic.md b/admin-web/src/components/GlobalFooter/demo/basic.md
deleted file mode 100644
index 9a06bade6..000000000
--- a/admin-web/src/components/GlobalFooter/demo/basic.md
+++ /dev/null
@@ -1,37 +0,0 @@
----
-order: 0
-title: 演示
-iframe: 400
----
-
-基本页脚。
-
-````jsx
-import GlobalFooter from 'ant-design-pro/lib/GlobalFooter';
-import { Icon } from 'antd';
-
-const links = [{
- key: '帮助',
- title: '帮助',
- href: '',
-}, {
- key: 'github',
- title: ,
- href: 'https://github.com/ant-design/ant-design-pro',
- blankTarget: true,
-}, {
- key: '条款',
- title: '条款',
- href: '',
- blankTarget: true,
-}];
-
-const copyright = Copyright 2017 蚂蚁金服体验技术部出品
;
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/admin-web/src/components/GlobalFooter/index.d.ts b/admin-web/src/components/GlobalFooter/index.d.ts
deleted file mode 100644
index 3fa5c423e..000000000
--- a/admin-web/src/components/GlobalFooter/index.d.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import * as React from 'react';
-export interface IGlobalFooterProps {
- links?: Array<{
- key?: string;
- title: React.ReactNode;
- href: string;
- blankTarget?: boolean;
- }>;
- copyright?: React.ReactNode;
- style?: React.CSSProperties;
-}
-
-export default class GlobalFooter extends React.Component {}
diff --git a/admin-web/src/components/GlobalFooter/index.js b/admin-web/src/components/GlobalFooter/index.js
deleted file mode 100644
index f98f51d9e..000000000
--- a/admin-web/src/components/GlobalFooter/index.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import React from 'react';
-import classNames from 'classnames';
-import styles from './index.less';
-
-const GlobalFooter = ({ className, links, copyright }) => {
- const clsString = classNames(styles.globalFooter, className);
- return (
-
- );
-};
-
-export default GlobalFooter;
diff --git a/admin-web/src/components/GlobalFooter/index.less b/admin-web/src/components/GlobalFooter/index.less
deleted file mode 100644
index e4b3dfd47..000000000
--- a/admin-web/src/components/GlobalFooter/index.less
+++ /dev/null
@@ -1,29 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.globalFooter {
- margin: 48px 0 24px 0;
- padding: 0 16px;
- text-align: center;
-
- .links {
- margin-bottom: 8px;
-
- a {
- color: @text-color-secondary;
- transition: all 0.3s;
-
- &:not(:last-child) {
- margin-right: 40px;
- }
-
- &:hover {
- color: @text-color;
- }
- }
- }
-
- .copyright {
- color: @text-color-secondary;
- font-size: @font-size-base;
- }
-}
diff --git a/admin-web/src/components/GlobalFooter/index.md b/admin-web/src/components/GlobalFooter/index.md
deleted file mode 100644
index 96e04fee2..000000000
--- a/admin-web/src/components/GlobalFooter/index.md
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: GlobalFooter
-subtitle: 全局页脚
-cols: 1
-order: 7
----
-
-页脚属于全局导航的一部分,作为对顶部导航的补充,通过传递数据控制展示内容。
-
-## API
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-links | 链接数据 | array<{ title: ReactNode, href: string, blankTarget?: boolean }> | -
-copyright | 版权信息 | ReactNode | -
diff --git a/admin-web/src/components/GlobalHeader/RightContent.js b/admin-web/src/components/GlobalHeader/RightContent.js
deleted file mode 100644
index dad360ff0..000000000
--- a/admin-web/src/components/GlobalHeader/RightContent.js
+++ /dev/null
@@ -1,217 +0,0 @@
-import React, { PureComponent } from 'react';
-import { FormattedMessage, formatMessage } from 'umi/locale';
-import { Spin, Tag, Menu, Icon, Avatar, Tooltip } from 'antd';
-import moment from 'moment';
-import groupBy from 'lodash/groupBy';
-import NoticeIcon from '../NoticeIcon';
-import HeaderSearch from '../HeaderSearch';
-import HeaderDropdown from '../HeaderDropdown';
-import SelectLang from '../SelectLang';
-import styles from './index.less';
-
-export default class GlobalHeaderRight extends PureComponent {
- getNoticeData() {
- const { notices = [] } = this.props;
- if (notices.length === 0) {
- return {};
- }
- const newNotices = notices.map(notice => {
- const newNotice = { ...notice };
- if (newNotice.datetime) {
- newNotice.datetime = moment(notice.datetime).fromNow();
- }
- if (newNotice.id) {
- newNotice.key = newNotice.id;
- }
- if (newNotice.extra && newNotice.status) {
- const color = {
- todo: '',
- processing: 'blue',
- urgent: 'red',
- doing: 'gold',
- }[newNotice.status];
- newNotice.extra = (
-
- {newNotice.extra}
-
- );
- }
- return newNotice;
- });
- return groupBy(newNotices, 'type');
- }
-
- getUnreadData = noticeData => {
- const unreadMsg = {};
- Object.entries(noticeData).forEach(([key, value]) => {
- if (!unreadMsg[key]) {
- unreadMsg[key] = 0;
- }
- if (Array.isArray(value)) {
- unreadMsg[key] = value.filter(item => !item.read).length;
- }
- });
- return unreadMsg;
- };
-
- changeReadState = clickedItem => {
- const { id } = clickedItem;
- const { dispatch } = this.props;
- dispatch({
- type: 'global/changeNoticeReadState',
- payload: id,
- });
- };
-
- fetchMoreNotices = tabProps => {
- const { list, name } = tabProps;
- const { dispatch, notices = [] } = this.props;
- const lastItemId = notices[notices.length - 1].id;
- dispatch({
- type: 'global/fetchMoreNotices',
- payload: {
- lastItemId,
- type: name,
- offset: list.length,
- },
- });
- };
-
- render() {
- const {
- currentUser,
- fetchingMoreNotices,
- fetchingNotices,
- loadedAllNotices,
- onNoticeVisibleChange,
- onMenuClick,
- onNoticeClear,
- skeletonCount,
- theme,
- } = this.props;
- const menu = (
-
- );
- const loadMoreProps = {
- skeletonCount,
- loadedAll: loadedAllNotices,
- loading: fetchingMoreNotices,
- };
- const noticeData = this.getNoticeData();
- const unreadMsg = this.getUnreadData(noticeData);
- let className = styles.right;
- if (theme === 'dark') {
- className = `${styles.right} ${styles.dark}`;
- }
- return (
-
-
{
- console.log('input', value); // eslint-disable-line
- }}
- onPressEnter={value => {
- console.log('enter', value); // eslint-disable-line
- }}
- />
-
-
-
-
-
- {
- console.log(item, tabProps); // eslint-disable-line
- this.changeReadState(item, tabProps);
- }}
- locale={{
- emptyText: formatMessage({ id: 'component.noticeIcon.empty' }),
- clear: formatMessage({ id: 'component.noticeIcon.clear' }),
- loadedAll: formatMessage({ id: 'component.noticeIcon.loaded' }),
- loadMore: formatMessage({ id: 'component.noticeIcon.loading-more' }),
- }}
- onClear={onNoticeClear}
- onLoadMore={this.fetchMoreNotices}
- onPopupVisibleChange={onNoticeVisibleChange}
- loading={fetchingNotices}
- clearClose
- >
-
-
-
-
- {currentUser.name ? (
-
-
-
- {currentUser.name}
-
-
- ) : (
-
- )}
-
-
- );
- }
-}
diff --git a/admin-web/src/components/GlobalHeader/index.js b/admin-web/src/components/GlobalHeader/index.js
deleted file mode 100644
index fe96cdea6..000000000
--- a/admin-web/src/components/GlobalHeader/index.js
+++ /dev/null
@@ -1,41 +0,0 @@
-import React, { PureComponent } from 'react';
-import { Icon } from 'antd';
-import Link from 'umi/link';
-import Debounce from 'lodash-decorators/debounce';
-import styles from './index.less';
-import RightContent from './RightContent';
-
-export default class GlobalHeader extends PureComponent {
- componentWillUnmount() {
- this.triggerResizeEvent.cancel();
- }
- /* eslint-disable*/
- @Debounce(600)
- triggerResizeEvent() {
- // eslint-disable-line
- const event = document.createEvent('HTMLEvents');
- event.initEvent('resize', true, false);
- window.dispatchEvent(event);
- }
- toggle = () => {
- const { collapsed, onCollapse } = this.props;
- onCollapse(!collapsed);
- this.triggerResizeEvent();
- };
- render() {
- const { collapsed, isMobile, logo } = this.props;
- return (
-
- {isMobile && (
-
-
-
- )}
-
-
-
-
-
- );
- }
-}
diff --git a/admin-web/src/components/GlobalHeader/index.less b/admin-web/src/components/GlobalHeader/index.less
deleted file mode 100644
index e66510b90..000000000
--- a/admin-web/src/components/GlobalHeader/index.less
+++ /dev/null
@@ -1,130 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-@pro-header-hover-bg: rgba(0, 0, 0, 0.025);
-
-.header {
- position: relative;
- height: @layout-header-height;
- padding: 0;
- background: #fff;
- box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
-}
-
-.logo {
- display: inline-block;
- height: @layout-header-height;
- padding: 0 0 0 24px;
- font-size: 20px;
- line-height: @layout-header-height;
- vertical-align: top;
- cursor: pointer;
- img {
- display: inline-block;
- vertical-align: middle;
- }
-}
-
-.menu {
- :global(.anticon) {
- margin-right: 8px;
- }
- :global(.ant-dropdown-menu-item) {
- min-width: 160px;
- }
-}
-
-.trigger {
- height: @layout-header-height;
- padding: ~'calc((@{layout-header-height} - 20px) / 2)' 24px;
- font-size: 20px;
- cursor: pointer;
- transition: all 0.3s, padding 0s;
- &:hover {
- background: @pro-header-hover-bg;
- }
-}
-
-.right {
- float: right;
- height: 100%;
- overflow: hidden;
- .action {
- display: inline-block;
- height: 100%;
- padding: 0 12px;
- cursor: pointer;
- transition: all 0.3s;
- > i {
- color: @text-color;
- vertical-align: middle;
- }
- &:hover {
- background: @pro-header-hover-bg;
- }
- &:global(.opened) {
- background: @pro-header-hover-bg;
- }
- }
- .search {
- padding: 0 12px;
- &:hover {
- background: transparent;
- }
- }
- .account {
- .avatar {
- margin: ~'calc((@{layout-header-height} - 24px) / 2)' 0;
- margin-right: 8px;
- color: @primary-color;
- vertical-align: top;
- background: rgba(255, 255, 255, 0.85);
- }
- }
-}
-
-.dark {
- height: @layout-header-height;
- .action {
- color: rgba(255, 255, 255, 0.85);
- > i {
- color: rgba(255, 255, 255, 0.85);
- }
- &:hover,
- &:global(.opened) {
- background: @primary-color;
- }
- :global(.ant-badge) {
- color: rgba(255, 255, 255, 0.85);
- }
- }
-}
-
-@media only screen and (max-width: @screen-md) {
- .header {
- :global(.ant-divider-vertical) {
- vertical-align: unset;
- }
- .name {
- display: none;
- }
- i.trigger {
- padding: 22px 12px;
- }
- .logo {
- position: relative;
- padding-right: 12px;
- padding-left: 12px;
- }
- .right {
- position: absolute;
- top: 0;
- right: 12px;
- background: #fff;
- .account {
- .avatar {
- margin-right: 0;
- }
- }
- }
- }
-}
diff --git a/admin-web/src/components/HeaderDropdown/index.d.ts b/admin-web/src/components/HeaderDropdown/index.d.ts
deleted file mode 100644
index e9dac7e53..000000000
--- a/admin-web/src/components/HeaderDropdown/index.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-import * as React from 'react';
-export default class HeaderDropdown extends React.Component {}
diff --git a/admin-web/src/components/HeaderDropdown/index.js b/admin-web/src/components/HeaderDropdown/index.js
deleted file mode 100644
index a19c471ac..000000000
--- a/admin-web/src/components/HeaderDropdown/index.js
+++ /dev/null
@@ -1,13 +0,0 @@
-import React, { PureComponent } from 'react';
-import { Dropdown } from 'antd';
-import classNames from 'classnames';
-import styles from './index.less';
-
-export default class HeaderDropdown extends PureComponent {
- render() {
- const { overlayClassName, ...props } = this.props;
- return (
-
- );
- }
-}
diff --git a/admin-web/src/components/HeaderDropdown/index.less b/admin-web/src/components/HeaderDropdown/index.less
deleted file mode 100644
index ef0c75913..000000000
--- a/admin-web/src/components/HeaderDropdown/index.less
+++ /dev/null
@@ -1,16 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.container > * {
- background-color: #fff;
- border-radius: 4px;
- box-shadow: @shadow-1-down;
-}
-
-@media screen and (max-width: @screen-xs) {
- .container {
- width: 100% !important;
- }
- .container > * {
- border-radius: 0 !important;
- }
-}
diff --git a/admin-web/src/components/HeaderSearch/demo/basic.md b/admin-web/src/components/HeaderSearch/demo/basic.md
deleted file mode 100644
index 2139207c0..000000000
--- a/admin-web/src/components/HeaderSearch/demo/basic.md
+++ /dev/null
@@ -1,34 +0,0 @@
----
-order: 0
-title: 全局搜索
----
-
-通常放置在导航工具条右侧。(点击搜索图标预览效果)
-
-````jsx
-import HeaderSearch from 'ant-design-pro/lib/HeaderSearch';
-
-ReactDOM.render(
-
- {
- console.log('input', value); // eslint-disable-line
- }}
- onPressEnter={(value) => {
- console.log('enter', value); // eslint-disable-line
- }}
- />
-
-, mountNode);
-````
diff --git a/admin-web/src/components/HeaderSearch/index.d.ts b/admin-web/src/components/HeaderSearch/index.d.ts
deleted file mode 100644
index d78fde471..000000000
--- a/admin-web/src/components/HeaderSearch/index.d.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import * as React from 'react';
-export interface IHeaderSearchProps {
- placeholder?: string;
- dataSource?: string[];
- defaultOpen?: boolean;
- open?: boolean;
- onSearch?: (value: string) => void;
- onChange?: (value: string) => void;
- onVisibleChange?: (visible: boolean) => void;
- onPressEnter?: (value: string) => void;
- style?: React.CSSProperties;
- className?: string;
-}
-
-export default class HeaderSearch extends React.Component {}
diff --git a/admin-web/src/components/HeaderSearch/index.en-US.md b/admin-web/src/components/HeaderSearch/index.en-US.md
deleted file mode 100644
index 9f2b5e8a4..000000000
--- a/admin-web/src/components/HeaderSearch/index.en-US.md
+++ /dev/null
@@ -1,22 +0,0 @@
----
-title: HeaderSearch
-subtitle:
-cols: 1
-order: 8
----
-
-Usually placed as an entry to the global search, placed on the right side of the navigation toolbar.
-
-## API
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-placeholder | placeholder text | string | -
-dataSource | current list of prompts | string[] | -
-onSearch | Called when searching items. | function(value) | -
-onChange | Called when select an option or input value change, or value of input is changed | function(value) | -
-onSelect | Called when a option is selected. param is option's value and option instance. | function(value) | -
-onPressEnter | Callback when pressing Enter | function(value) | -
-onVisibleChange | Show or hide the callback of the text box | function(value) |-
-defaultOpen | The input box is displayed for the first time. | boolean | false
-open | The input box is displayed | boolean |false
\ No newline at end of file
diff --git a/admin-web/src/components/HeaderSearch/index.js b/admin-web/src/components/HeaderSearch/index.js
deleted file mode 100644
index 04f8b38ec..000000000
--- a/admin-web/src/components/HeaderSearch/index.js
+++ /dev/null
@@ -1,145 +0,0 @@
-import React, { PureComponent } from 'react';
-import PropTypes from 'prop-types';
-import { Input, Icon, AutoComplete } from 'antd';
-import classNames from 'classnames';
-import Debounce from 'lodash-decorators/debounce';
-import Bind from 'lodash-decorators/bind';
-import styles from './index.less';
-
-export default class HeaderSearch extends PureComponent {
- static propTypes = {
- className: PropTypes.string,
- placeholder: PropTypes.string,
- onSearch: PropTypes.func,
- onChange: PropTypes.func,
- onPressEnter: PropTypes.func,
- defaultActiveFirstOption: PropTypes.bool,
- dataSource: PropTypes.array,
- defaultOpen: PropTypes.bool,
- onVisibleChange: PropTypes.func,
- };
-
- static defaultProps = {
- defaultActiveFirstOption: false,
- onPressEnter: () => {},
- onSearch: () => {},
- onChange: () => {},
- className: '',
- placeholder: '',
- dataSource: [],
- defaultOpen: false,
- onVisibleChange: () => {},
- };
-
- static getDerivedStateFromProps(props) {
- if ('open' in props) {
- return {
- searchMode: props.open,
- };
- }
- return null;
- }
-
- constructor(props) {
- super(props);
- this.state = {
- searchMode: props.defaultOpen,
- value: '',
- };
- }
-
- componentWillUnmount() {
- clearTimeout(this.timeout);
- }
-
- onKeyDown = e => {
- if (e.key === 'Enter') {
- const { onPressEnter } = this.props;
- const { value } = this.state;
- this.timeout = setTimeout(() => {
- onPressEnter(value); // Fix duplicate onPressEnter
- }, 0);
- }
- };
-
- onChange = value => {
- const { onSearch, onChange } = this.props;
- this.setState({ value });
- if (onSearch) {
- onSearch(value);
- }
- if (onChange) {
- onChange(value);
- }
- };
-
- enterSearchMode = () => {
- const { onVisibleChange } = this.props;
- onVisibleChange(true);
- this.setState({ searchMode: true }, () => {
- const { searchMode } = this.state;
- if (searchMode) {
- this.input.focus();
- }
- });
- };
-
- leaveSearchMode = () => {
- this.setState({
- searchMode: false,
- value: '',
- });
- };
-
- // NOTE: 不能小于500,如果长按某键,第一次触发auto repeat的间隔是500ms,小于500会导致触发2次
- @Bind()
- @Debounce(500, {
- leading: true,
- trailing: false,
- })
- debouncePressEnter() {
- const { onPressEnter } = this.props;
- const { value } = this.state;
- onPressEnter(value);
- }
-
- render() {
- const { className, placeholder, open, ...restProps } = this.props;
- const { searchMode, value } = this.state;
- delete restProps.defaultOpen; // for rc-select not affected
- const inputClass = classNames(styles.input, {
- [styles.show]: searchMode,
- });
- return (
- {
- if (propertyName === 'width' && !searchMode) {
- const { onVisibleChange } = this.props;
- onVisibleChange(searchMode);
- }
- }}
- >
-
-
- {
- this.input = node;
- }}
- aria-label={placeholder}
- placeholder={placeholder}
- onKeyDown={this.onKeyDown}
- onBlur={this.leaveSearchMode}
- />
-
-
- );
- }
-}
diff --git a/admin-web/src/components/HeaderSearch/index.less b/admin-web/src/components/HeaderSearch/index.less
deleted file mode 100644
index 88fadecdc..000000000
--- a/admin-web/src/components/HeaderSearch/index.less
+++ /dev/null
@@ -1,32 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.headerSearch {
- :global(.anticon-search) {
- font-size: 16px;
- cursor: pointer;
- }
- .input {
- width: 0;
- background: transparent;
- border-radius: 0;
- transition: width 0.3s, margin-left 0.3s;
- :global(.ant-select-selection) {
- background: transparent;
- }
- input {
- padding-right: 0;
- padding-left: 0;
- border: 0;
- box-shadow: none !important;
- }
- &,
- &:hover,
- &:focus {
- border-bottom: 1px solid @border-color-base;
- }
- &.show {
- width: 210px;
- margin-left: 8px;
- }
- }
-}
diff --git a/admin-web/src/components/HeaderSearch/index.zh-CN.md b/admin-web/src/components/HeaderSearch/index.zh-CN.md
deleted file mode 100644
index 83e74887f..000000000
--- a/admin-web/src/components/HeaderSearch/index.zh-CN.md
+++ /dev/null
@@ -1,22 +0,0 @@
----
-title: HeaderSearch
-subtitle: 顶部搜索框
-cols: 1
-order: 8
----
-
-通常作为全局搜索的入口,放置在导航工具条右侧。
-
-## API
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-placeholder | 占位文字 | string | -
-dataSource | 当前提示内容列表 | string[] | -
-onSearch | 搜索补全项的时候调用 | function(value) | -
-onChange | 选中 option,或 input 的 value 变化时,调用此函数 | function(value) | -
-onSelect | 被选中时调用,参数为选中项的 value 值 | function(value) | -
-onPressEnter | 按下回车时的回调 | function(value) | -
-onVisibleChange | 显示或隐藏文本框的回调 | function(value) |-
-defaultOpen | 输入框首次显示是否显示 | boolean | false
-open | 控制输入框是否显示 | boolean |false
\ No newline at end of file
diff --git a/admin-web/src/components/IconFont/index.js b/admin-web/src/components/IconFont/index.js
deleted file mode 100644
index 0b99dec3a..000000000
--- a/admin-web/src/components/IconFont/index.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import { Icon } from 'antd';
-import { iconfontUrl as scriptUrl } from '../../defaultSettings';
-
-// 使用:
-// import IconFont from '@/components/IconFont';
-//
-export default Icon.createFromIconfontCN({ scriptUrl });
diff --git a/admin-web/src/components/Image/PicturesWall.js b/admin-web/src/components/Image/PicturesWall.js
deleted file mode 100644
index 2e27ec07f..000000000
--- a/admin-web/src/components/Image/PicturesWall.js
+++ /dev/null
@@ -1,209 +0,0 @@
-import React from "react";
-import {fileGetQiniuToken} from "../../services/admin";
-import uuid from "js-uuid";
-import * as qiniu from "qiniu-js";
-import {Icon, Modal, Upload} from "antd";
-
-import styles from './PicturesWall.less';
-
-/**
- * 照片墙,带有上传图片到七牛。
- */
-class PicturesWall extends React.Component {
- state = {
- token: undefined, // 七牛 token
-
-
- previewVisible: false,
- previewImage: '',
-
- fileList: [
- // { // 目前图片
- // uid: -1,
- // name: 'xxx.png',
- // status: 'done',
- // url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
- // }
- ],
- };
-
- componentDidMount() {
- if (this.props.urls) {
- this.setUrls(this.props.urls);
- }
- }
-
- handleCancel = () => this.setState({ previewVisible: false })
-
- handlePreview = (file) => {
- this.setState({
- previewImage: file.url || file.thumbUrl,
- previewVisible: true,
- });
- }
-
- beforeUpload = async () => {
- const tokenResult = await fileGetQiniuToken();
- if (tokenResult.code !== 0) {
- alert('获得七牛上传 Token 失败');
- return false;
- }
- this.setState({
- token: tokenResult.data,
- });
- return true;
- };
-
- customRequest = ({action,
- file,
- headers,
- onError,
- onProgress,
- onSuccess,
- withCredentials,}) => {
- // fs.readFile(path, function(err, data) {
- // if (err) return;
- // let md5Value= crypto.createHash('md5').update(data, 'utf8').digest('hex');
- // let observable = qiniu.upload(file, md5Value, this.state.token);
- // observable.subscribe(function () {
- // // next
- // }, function () {
- // // error
- // }, function (response) {
- // // complete
- // debugger;
- // onSuccess(response, file);
- // });
- // });
-
- // 使用 FileReader 将上传的文件转换成二进制流,满足 'application/octet-stream' 格式的要求
- const reader = new FileReader();
- reader.readAsArrayBuffer(file);
- let fileData = null;
- reader.onload = (e) => {
- // 在文件读取结束后执行的操作
- fileData = e.target.result;
- // debugger;
- // let md5Value= crypto.createHash('md5').update(fileData, 'utf8').digest('hex');
- // 上传文件
- // fileUploadQiniu(fileData);
- // debugger;
- // 使用 axios 进行文件上传的请求
- // axios.put(action, fileData, {
- // withCredentials,
- // headers,
- // onUploadProgress: ({ total, loaded }) => {
- // // 进行上传进度输出,更加直观
- // onProgress({ percent: Math.round(loaded / total * 100).toFixed(2) }, file);
- // },
- // }).then(response => {
- // onSuccess(response, file);
- // })
- // .catch(onError);
- let key = uuid.v4(); // TODO 芋艿,可能后面要优化。MD5?
- let observable = qiniu.upload(file, key, this.state.token); // TODO 芋艿,最后后面去掉 qiniu 的库依赖,直接 http 请求,这样更轻量
- observable.subscribe(function () {
- // next
- }, function () {
- // error
- // TODO 芋艿,后续补充
- debugger;
- }, function (response) {
- debugger;
- // complete
- // debugger;
- response.url = 'http://static.shop.iocoder.cn/' + response.key; // 需要设置,用于后续 onSuccess ,合并到 file 中,从而设置到 fileList
- onSuccess(response, file);
- });
- };
- return {
- abort() {
- console.log('upload progress is aborted.');
- },
- };
- };
-
- handleChange = ({ file, fileList }) => {
- if (file.response && file.response.url) {
- // debugger
- // file.url =
- for (let i in fileList) {
- if (fileList[i].uid === file.uid) {
- fileList[i].url = file.response.url;
- }
- }
- }
- this.setState({ fileList });
- }
-
- getUrls = () => {
- let urls = [];
- for (let i in this.state.fileList) {
- urls.push(this.state.fileList[i].url);
- }
- return urls;
- };
-
- getUrl = () => {
- let urls = this.getUrls();
- if (urls && urls.length > 0) {
- return urls[0];
- }
- return undefined;
- };
-
- setUrls = (urls) => {
- // let urls = this.props.urls;
- if (urls) {
- let fileList = [];
- for (let i in urls) {
- let url = urls[i];
- fileList.push({
- uid: -i,
- name: url,
- status: 'done',
- url,
- });
- }
- this.setState({
- fileList: fileList,
- })
- }
- };
-
- render() {
- const { previewVisible, previewImage, fileList } = this.state;
- const uploadButton = (
-
- );
- return (
-
-
- {fileList.length >= this.props.maxLength ? null : uploadButton}
-
-
-
-
-
- );
- }
-};
-
-PicturesWall.propTypes = {
- maxLength: Number, // 最大照片墙图片数量
- urls: Array, // 初始图片列表
-};
-
-export default PicturesWall;
diff --git a/admin-web/src/components/Image/PicturesWall.less b/admin-web/src/components/Image/PicturesWall.less
deleted file mode 100644
index b2d2f2e4e..000000000
--- a/admin-web/src/components/Image/PicturesWall.less
+++ /dev/null
@@ -1,10 +0,0 @@
-
-.ant-upload-select-picture-card i {
- font-size: 32px;
- color: #999;
-}
-
-.ant-upload-select-picture-card .ant-upload-text {
- margin-top: 8px;
- color: #666;
-}
diff --git a/admin-web/src/components/Login/LoginItem.d.ts b/admin-web/src/components/Login/LoginItem.d.ts
deleted file mode 100644
index bcfb73b86..000000000
--- a/admin-web/src/components/Login/LoginItem.d.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import * as React from 'react';
-export interface ILoginItemProps {
- name?: string;
- rules?: any[];
- style?: React.CSSProperties;
- onGetCaptcha?: () => void;
- placeholder?: string;
- buttonText?: React.ReactNode;
-}
-
-export default class LoginItem extends React.Component {}
diff --git a/admin-web/src/components/Login/LoginItem.js b/admin-web/src/components/Login/LoginItem.js
deleted file mode 100644
index b3cc4d48a..000000000
--- a/admin-web/src/components/Login/LoginItem.js
+++ /dev/null
@@ -1,147 +0,0 @@
-import React, { Component } from 'react';
-import { Form, Input, Button, Row, Col } from 'antd';
-import omit from 'omit.js';
-import styles from './index.less';
-import ItemMap from './map';
-import LoginContext from './loginContext';
-
-const FormItem = Form.Item;
-
-class WrapFormItem extends Component {
- static defaultProps = {
- getCaptchaButtonText: 'captcha',
- getCaptchaSecondText: 'second',
- };
-
- constructor(props) {
- super(props);
- this.state = {
- count: 0,
- };
- }
-
- componentDidMount() {
- const { updateActive, name } = this.props;
- if (updateActive) {
- updateActive(name);
- }
- }
-
- componentWillUnmount() {
- clearInterval(this.interval);
- }
-
- onGetCaptcha = () => {
- const { onGetCaptcha } = this.props;
- const result = onGetCaptcha ? onGetCaptcha() : null;
- if (result === false) {
- return;
- }
- if (result instanceof Promise) {
- result.then(this.runGetCaptchaCountDown);
- } else {
- this.runGetCaptchaCountDown();
- }
- };
-
- getFormItemOptions = ({ onChange, defaultValue, customprops, rules }) => {
- const options = {
- rules: rules || customprops.rules,
- };
- if (onChange) {
- options.onChange = onChange;
- }
- if (defaultValue) {
- options.initialValue = defaultValue;
- }
- return options;
- };
-
- runGetCaptchaCountDown = () => {
- const { countDown } = this.props;
- let count = countDown || 59;
- this.setState({ count });
- this.interval = setInterval(() => {
- count -= 1;
- this.setState({ count });
- if (count === 0) {
- clearInterval(this.interval);
- }
- }, 1000);
- };
-
- render() {
- const { count } = this.state;
-
- const {
- form: { getFieldDecorator },
- } = this.props;
-
- // 这么写是为了防止restProps中 带入 onChange, defaultValue, rules props
- const {
- onChange,
- customprops,
- defaultValue,
- rules,
- name,
- getCaptchaButtonText,
- getCaptchaSecondText,
- updateActive,
- type,
- ...restProps
- } = this.props;
-
- // get getFieldDecorator props
- const options = this.getFormItemOptions(this.props);
-
- const otherProps = restProps || {};
- if (type === 'Captcha') {
- const inputProps = omit(otherProps, ['onGetCaptcha', 'countDown']);
- return (
-
-
-
- {getFieldDecorator(name, options)()}
-
-
-
-
-
-
- );
- }
- return (
-
- {getFieldDecorator(name, options)()}
-
- );
- }
-}
-
-const LoginItem = {};
-Object.keys(ItemMap).forEach(key => {
- const item = ItemMap[key];
- LoginItem[key] = props => (
-
- {context => (
-
- )}
-
- );
-});
-
-export default LoginItem;
diff --git a/admin-web/src/components/Login/LoginSubmit.js b/admin-web/src/components/Login/LoginSubmit.js
deleted file mode 100644
index 4aebabf89..000000000
--- a/admin-web/src/components/Login/LoginSubmit.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import React from 'react';
-import classNames from 'classnames';
-import { Button, Form } from 'antd';
-import styles from './index.less';
-
-const FormItem = Form.Item;
-
-const LoginSubmit = ({ className, ...rest }) => {
- const clsString = classNames(styles.submit, className);
- return (
-
-
-
- );
-};
-
-export default LoginSubmit;
diff --git a/admin-web/src/components/Login/LoginTab.d.ts b/admin-web/src/components/Login/LoginTab.d.ts
deleted file mode 100644
index db651f7b4..000000000
--- a/admin-web/src/components/Login/LoginTab.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import * as React from 'react';
-
-export interface ILoginTabProps {
- key?: string;
- tab?: React.ReactNode;
-}
-export default class LoginTab extends React.Component {}
diff --git a/admin-web/src/components/Login/LoginTab.js b/admin-web/src/components/Login/LoginTab.js
deleted file mode 100644
index 7c46db532..000000000
--- a/admin-web/src/components/Login/LoginTab.js
+++ /dev/null
@@ -1,41 +0,0 @@
-import React, { Component } from 'react';
-import { Tabs } from 'antd';
-import LoginContext from './loginContext';
-
-const { TabPane } = Tabs;
-
-const generateId = (() => {
- let i = 0;
- return (prefix = '') => {
- i += 1;
- return `${prefix}${i}`;
- };
-})();
-
-class LoginTab extends Component {
- constructor(props) {
- super(props);
- this.uniqueId = generateId('login-tab-');
- }
-
- componentDidMount() {
- const { tabUtil } = this.props;
- tabUtil.addTab(this.uniqueId);
- }
-
- render() {
- const { children } = this.props;
- return {children};
- }
-}
-
-const wrapContext = props => (
-
- {value => }
-
-);
-
-// 标志位 用来判断是不是自定义组件
-wrapContext.typeName = 'LoginTab';
-
-export default wrapContext;
diff --git a/admin-web/src/components/Login/demo/basic.md b/admin-web/src/components/Login/demo/basic.md
deleted file mode 100644
index 5fbd0ca25..000000000
--- a/admin-web/src/components/Login/demo/basic.md
+++ /dev/null
@@ -1,115 +0,0 @@
----
-order: 0
-title:
- zh-CN: 标准登录
- en-US: Standard Login
----
-
-Support login with account and mobile number.
-
-````jsx
-import Login from 'ant-design-pro/lib/Login';
-import { Alert, Checkbox } from 'antd';
-
-const { Tab, UserName, Password, Mobile, Captcha, Submit } = Login;
-
-class LoginDemo extends React.Component {
- state = {
- notice: '',
- type: 'tab2',
- autoLogin: true,
- }
- onSubmit = (err, values) => {
- console.log('value collected ->', { ...values, autoLogin: this.state.autoLogin });
- if (this.state.type === 'tab1') {
- this.setState({
- notice: '',
- }, () => {
- if (!err && (values.username !== 'admin' || values.password !== '888888')) {
- setTimeout(() => {
- this.setState({
- notice: 'The combination of username and password is incorrect!',
- });
- }, 500);
- }
- });
- }
- }
- onTabChange = (key) => {
- this.setState({
- type: key,
- });
- }
- changeAutoLogin = (e) => {
- this.setState({
- autoLogin: e.target.checked,
- });
- }
- render() {
- return (
-
-
- {
- this.state.notice &&
-
- }
-
-
-
-
-
- console.log('Get captcha!')} name="captcha" />
-
-
- Login
-
- Other login methods
-
-
-
-
Register
-
-
- );
- }
-}
-
-ReactDOM.render(, mountNode);
-````
-
-
diff --git a/admin-web/src/components/Login/index.d.ts b/admin-web/src/components/Login/index.d.ts
deleted file mode 100644
index 6a6f67fe6..000000000
--- a/admin-web/src/components/Login/index.d.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import Button from 'antd/lib/button';
-import * as React from 'react';
-import LoginItem from './LoginItem';
-import LoginTab from './LoginTab';
-
-export interface ILoginProps {
- defaultActiveKey?: string;
- onTabChange?: (key: string) => void;
- style?: React.CSSProperties;
- onSubmit?: (error: any, values: any) => void;
-}
-
-export default class Login extends React.Component {
- public static Tab: typeof LoginTab;
- public static UserName: typeof LoginItem;
- public static Password: typeof LoginItem;
- public static Mobile: typeof LoginItem;
- public static Captcha: typeof LoginItem;
- public static Submit: typeof Button;
-}
diff --git a/admin-web/src/components/Login/index.en-US.md b/admin-web/src/components/Login/index.en-US.md
deleted file mode 100644
index 3b5992e28..000000000
--- a/admin-web/src/components/Login/index.en-US.md
+++ /dev/null
@@ -1,49 +0,0 @@
----
-title: Login
-cols: 1
-order: 15
----
-
-Support multiple common ways of login with built-in controls. You can choose your own combinations and use with your custom controls.
-
-## API
-
-### Login
-
-Property | Description | Type | Default
-----|------|-----|------
-defaultActiveKey | default key to activate the tab panel | String | -
-onTabChange | callback on changing tabs | (key) => void | -
-onSubmit | callback on submit | (err, values) => void | -
-
-### Login.Tab
-
-Property | Description | Type | Default
-----|------|-----|------
-key | key of the tab | String | -
-tab | displayed text of the tab | ReactNode | -
-
-### Login.UserName
-
-Property | Description | Type | Default
-----|------|-----|------
-name | name of the control, also the key of the submitted data | String | -
-rules | validation rules, same with [option.rules](getFieldDecorator(id, options)) in Form getFieldDecorator(id, options) | object[] | -
-
-Apart from the above properties, Login.Username also support all properties of antd.Input, together with the default values of basic settings, such as _placeholder_, _size_ and _prefix_. All of these default values can be over-written.
-
-### Login.Password, Login.Mobile are the same as Login.UserName
-
-### Login.Captcha
-
-Property | Description | Type | Default
-----|------|-----|------
-onGetCaptcha | callback on getting a new Captcha | () => (void \| false \| Promise) | -
-countDown | count down | number |-
-buttonText | text on getting a new Captcha | ReactNode | '获取验证码'
-
-Apart from the above properties, _Login.Captcha_ support the same properties with _Login.UserName_.
-
-### Login.Submit
-
-Support all properties of _antd.Button_.
\ No newline at end of file
diff --git a/admin-web/src/components/Login/index.js b/admin-web/src/components/Login/index.js
deleted file mode 100644
index 79cc56deb..000000000
--- a/admin-web/src/components/Login/index.js
+++ /dev/null
@@ -1,132 +0,0 @@
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { Form, Tabs } from 'antd';
-import classNames from 'classnames';
-import LoginItem from './LoginItem';
-import LoginTab from './LoginTab';
-import LoginSubmit from './LoginSubmit';
-import styles from './index.less';
-import LoginContext from './loginContext';
-
-class Login extends Component {
- static propTypes = {
- className: PropTypes.string,
- defaultActiveKey: PropTypes.string,
- onTabChange: PropTypes.func,
- onSubmit: PropTypes.func,
- };
-
- static defaultProps = {
- className: '',
- defaultActiveKey: '',
- onTabChange: () => {},
- onSubmit: () => {},
- };
-
- constructor(props) {
- super(props);
- this.state = {
- type: props.defaultActiveKey,
- tabs: [],
- active: {},
- };
- }
-
- onSwitch = type => {
- this.setState({
- type,
- });
- const { onTabChange } = this.props;
- onTabChange(type);
- };
-
- getContext = () => {
- const { tabs } = this.state;
- const { form } = this.props;
- return {
- tabUtil: {
- addTab: id => {
- this.setState({
- tabs: [...tabs, id],
- });
- },
- removeTab: id => {
- this.setState({
- tabs: tabs.filter(currentId => currentId !== id),
- });
- },
- },
- form,
- updateActive: activeItem => {
- const { type, active } = this.state;
- if (active[type]) {
- active[type].push(activeItem);
- } else {
- active[type] = [activeItem];
- }
- this.setState({
- active,
- });
- },
- };
- };
-
- handleSubmit = e => {
- e.preventDefault();
- const { active, type } = this.state;
- const { form, onSubmit } = this.props;
- const activeFileds = active[type];
- form.validateFields(activeFileds, { force: true }, (err, values) => {
- onSubmit(err, values);
- });
- };
-
- render() {
- const { className, children } = this.props;
- const { type, tabs } = this.state;
- const TabChildren = [];
- const otherChildren = [];
- React.Children.forEach(children, item => {
- if (!item) {
- return;
- }
- // eslint-disable-next-line
- if (item.type.typeName === 'LoginTab') {
- TabChildren.push(item);
- } else {
- otherChildren.push(item);
- }
- });
- return (
-
-
-
-
-
- );
- }
-}
-
-Login.Tab = LoginTab;
-Login.Submit = LoginSubmit;
-Object.keys(LoginItem).forEach(item => {
- Login[item] = LoginItem[item];
-});
-
-export default Form.create()(Login);
diff --git a/admin-web/src/components/Login/index.less b/admin-web/src/components/Login/index.less
deleted file mode 100644
index 242e06756..000000000
--- a/admin-web/src/components/Login/index.less
+++ /dev/null
@@ -1,53 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.login {
- :global {
- .ant-tabs .ant-tabs-bar {
- margin-bottom: 24px;
- text-align: center;
- border-bottom: 0;
- }
-
- .ant-form-item {
- margin: 0 2px 24px;
- }
- }
-
- .getCaptcha {
- display: block;
- width: 100%;
- }
-
- .icon {
- margin-left: 16px;
- color: rgba(0, 0, 0, 0.2);
- font-size: 24px;
- vertical-align: middle;
- cursor: pointer;
- transition: color 0.3s;
-
- &:hover {
- color: @primary-color;
- }
- }
-
- .other {
- margin-top: 24px;
- line-height: 22px;
- text-align: left;
-
- .register {
- float: right;
- }
- }
-
- .prefixIcon {
- color: @disabled-color;
- font-size: @font-size-base;
- }
-
- .submit {
- width: 100%;
- margin-top: 24px;
- }
-}
diff --git a/admin-web/src/components/Login/index.zh-CN.md b/admin-web/src/components/Login/index.zh-CN.md
deleted file mode 100644
index a869e96c3..000000000
--- a/admin-web/src/components/Login/index.zh-CN.md
+++ /dev/null
@@ -1,49 +0,0 @@
----
-title: Login
-subtitle: 登录
-cols: 1
-order: 15
----
-
-支持多种登录方式切换,内置了几种常见的登录控件,可以灵活组合,也支持和自定义控件配合使用。
-
-## API
-
-### Login
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-defaultActiveKey | 默认激活 tab 面板的 key | String | -
-onTabChange | 切换页签时的回调 | (key) => void | -
-onSubmit | 点击提交时的回调 | (err, values) => void | -
-
-### Login.Tab
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-key | 对应选项卡的 key | String | -
-tab | 选项卡头显示文字 | ReactNode | -
-
-### Login.UserName
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-name | 控件标记,提交数据中同样以此为 key | String | -
-rules | 校验规则,同 Form getFieldDecorator(id, options) 中 [option.rules 的规则](getFieldDecorator(id, options)) | object[] | -
-
-除上述属性以外,Login.UserName 还支持 antd.Input 的所有属性,并且自带默认的基础配置,包括 `placeholder` `size` `prefix` 等,这些基础配置均可被覆盖。
-## Login.Password、Login.Mobile 同 Login.UserName
-
-### Login.Captcha
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-onGetCaptcha | 点击获取校验码的回调 | () => (void \| false \| Promise) | -
-countDown | 倒计时 | number |-
-buttonText | 点击获取校验码的说明文字 | ReactNode | '获取验证码'
-
-除上述属性以外,Login.Captcha 支持的属性与 Login.UserName 相同。
-
-### Login.Submit
-
-支持 antd.Button 的所有属性。
diff --git a/admin-web/src/components/Login/loginContext.js b/admin-web/src/components/Login/loginContext.js
deleted file mode 100644
index a13e6599c..000000000
--- a/admin-web/src/components/Login/loginContext.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import { createContext } from 'react';
-
-const LoginContext = createContext();
-export default LoginContext;
diff --git a/admin-web/src/components/Login/map.js b/admin-web/src/components/Login/map.js
deleted file mode 100644
index dfa881998..000000000
--- a/admin-web/src/components/Login/map.js
+++ /dev/null
@@ -1,65 +0,0 @@
-import React from 'react';
-import { Icon } from 'antd';
-import styles from './index.less';
-
-export default {
- UserName: {
- props: {
- size: 'large',
- id: 'userName',
- prefix: ,
- placeholder: 'admin',
- },
- rules: [
- {
- required: true,
- message: 'Please enter username!',
- },
- ],
- },
- Password: {
- props: {
- size: 'large',
- prefix: ,
- type: 'password',
- id: 'password',
- placeholder: '888888',
- },
- rules: [
- {
- required: true,
- message: 'Please enter password!',
- },
- ],
- },
- Mobile: {
- props: {
- size: 'large',
- prefix: ,
- placeholder: 'mobile number',
- },
- rules: [
- {
- required: true,
- message: 'Please enter mobile number!',
- },
- {
- pattern: /^1\d{10}$/,
- message: 'Wrong mobile number format!',
- },
- ],
- },
- Captcha: {
- props: {
- size: 'large',
- prefix: ,
- placeholder: 'captcha',
- },
- rules: [
- {
- required: true,
- message: 'Please enter Captcha!',
- },
- ],
- },
-};
diff --git a/admin-web/src/components/NoticeIcon/NoticeIconTab.d.ts b/admin-web/src/components/NoticeIcon/NoticeIconTab.d.ts
deleted file mode 100644
index 6ffaf0321..000000000
--- a/admin-web/src/components/NoticeIcon/NoticeIconTab.d.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import { SkeletonProps } from 'antd/lib/skeleton';
-import * as React from 'react';
-
-export interface INoticeIconData {
- avatar?: string | React.ReactNode;
- title?: React.ReactNode;
- description?: React.ReactNode;
- datetime?: React.ReactNode;
- extra?: React.ReactNode;
- style?: React.CSSProperties;
-}
-
-export interface INoticeIconTabProps {
- count?: number;
- emptyText?: React.ReactNode;
- emptyImage?: string;
- list?: INoticeIconData[];
- loadedAll?: boolean;
- loading?: boolean;
- name?: string;
- showClear?: boolean;
- skeletonCount?: number;
- skeletonProps?: SkeletonProps;
- style?: React.CSSProperties;
- title?: string;
-}
-
-export default class NoticeIconTab extends React.Component {}
diff --git a/admin-web/src/components/NoticeIcon/NoticeList.js b/admin-web/src/components/NoticeIcon/NoticeList.js
deleted file mode 100644
index 6b73e6e0d..000000000
--- a/admin-web/src/components/NoticeIcon/NoticeList.js
+++ /dev/null
@@ -1,108 +0,0 @@
-import React from 'react';
-import { Avatar, List, Skeleton } from 'antd';
-import classNames from 'classnames';
-import styles from './NoticeList.less';
-
-let ListElement = null;
-
-export default function NoticeList({
- data = [],
- onClick,
- onClear,
- title,
- locale,
- emptyText,
- emptyImage,
- loading,
- onLoadMore,
- visible,
- loadedAll = true,
- scrollToLoad = true,
- showClear = true,
- skeletonCount = 5,
- skeletonProps = {},
-}) {
- if (data.length === 0) {
- return (
-
- {emptyImage ?
: null}
-
{emptyText || locale.emptyText}
-
- );
- }
- const loadingList = Array.from({ length: loading ? skeletonCount : 0 }).map(() => ({ loading }));
- const LoadMore = loadedAll ? (
-
- {locale.loadedAll}
-
- ) : (
-
- {locale.loadMore}
-
- );
- const onScroll = event => {
- if (!scrollToLoad || loading || loadedAll) return;
- if (typeof onLoadMore !== 'function') return;
- const { currentTarget: t } = event;
- if (t.scrollHeight - t.scrollTop - t.clientHeight <= 40) {
- onLoadMore(event);
- ListElement = t;
- }
- };
- if (!visible && ListElement) {
- try {
- ListElement.scrollTo(null, 0);
- } catch (err) {
- ListElement = null;
- }
- }
- return (
-
-
- {[...data, ...loadingList].map((item, i) => {
- const itemCls = classNames(styles.item, {
- [styles.read]: item.read,
- });
- // eslint-disable-next-line no-nested-ternary
- const leftIcon = item.avatar ? (
- typeof item.avatar === 'string' ? (
-
- ) : (
- {item.avatar}
- )
- ) : null;
-
- return (
- onClick(item)}>
-
-
- {item.title}
- {item.extra}
-
- }
- description={
-
-
- {item.description}
-
-
{item.datetime}
-
- }
- />
-
-
- );
- })}
-
- {showClear ? (
-
- {locale.clear} {title}
-
- ) : null}
-
- );
-}
diff --git a/admin-web/src/components/NoticeIcon/NoticeList.less b/admin-web/src/components/NoticeIcon/NoticeList.less
deleted file mode 100644
index fc566ad06..000000000
--- a/admin-web/src/components/NoticeIcon/NoticeList.less
+++ /dev/null
@@ -1,94 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.list {
- max-height: 400px;
- overflow: auto;
- &::-webkit-scrollbar {
- display: none;
- }
- .item {
- padding-right: 24px;
- padding-left: 24px;
- overflow: hidden;
- cursor: pointer;
- transition: all 0.3s;
-
- .meta {
- width: 100%;
- }
-
- .avatar {
- margin-top: 4px;
- background: #fff;
- }
- .iconElement {
- font-size: 32px;
- }
-
- &.read {
- opacity: 0.4;
- }
- &:last-child {
- border-bottom: 0;
- }
- &:hover {
- background: @primary-1;
- }
- .title {
- margin-bottom: 8px;
- font-weight: normal;
- }
- .description {
- font-size: 12px;
- line-height: @line-height-base;
- }
- .datetime {
- margin-top: 4px;
- font-size: 12px;
- line-height: @line-height-base;
- }
- .extra {
- float: right;
- margin-top: -1.5px;
- margin-right: 0;
- color: @text-color-secondary;
- font-weight: normal;
- }
- }
- .loadMore {
- padding: 8px 0;
- color: @primary-6;
- text-align: center;
- cursor: pointer;
- &.loadedAll {
- color: rgba(0, 0, 0, 0.25);
- cursor: unset;
- }
- }
-}
-
-.notFound {
- padding: 73px 0 88px 0;
- color: @text-color-secondary;
- text-align: center;
- img {
- display: inline-block;
- height: 76px;
- margin-bottom: 16px;
- }
-}
-
-.clear {
- height: 46px;
- color: @text-color;
- line-height: 46px;
- text-align: center;
- border-top: 1px solid @border-color-split;
- border-radius: 0 0 @border-radius-base @border-radius-base;
- cursor: pointer;
- transition: all 0.3s;
-
- &:hover {
- color: @heading-color;
- }
-}
diff --git a/admin-web/src/components/NoticeIcon/demo/basic.md b/admin-web/src/components/NoticeIcon/demo/basic.md
deleted file mode 100644
index dc9afeaa8..000000000
--- a/admin-web/src/components/NoticeIcon/demo/basic.md
+++ /dev/null
@@ -1,12 +0,0 @@
----
-order: 1
-title: 通知图标
----
-
-通常用在导航工具栏上。
-
-````jsx
-import NoticeIcon from 'ant-design-pro/lib/NoticeIcon';
-
-ReactDOM.render(, mountNode);
-````
diff --git a/admin-web/src/components/NoticeIcon/demo/popover.md b/admin-web/src/components/NoticeIcon/demo/popover.md
deleted file mode 100644
index 9515c5187..000000000
--- a/admin-web/src/components/NoticeIcon/demo/popover.md
+++ /dev/null
@@ -1,191 +0,0 @@
----
-order: 2
-title: 带浮层卡片
----
-
-点击展开通知卡片,展现多种类型的通知,通常放在导航工具栏。
-
-```jsx
-import NoticeIcon from 'ant-design-pro/lib/NoticeIcon';
-import { Tag } from 'antd';
-
-const data = [
- {
- id: '000000001',
- avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png',
- title: '你收到了 14 份新周报',
- datetime: '2017-08-09',
- type: '通知',
- },
- {
- id: '000000002',
- avatar: 'https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png',
- title: '你推荐的 曲妮妮 已通过第三轮面试',
- datetime: '2017-08-08',
- type: '通知',
- },
- {
- id: '000000003',
- avatar: 'https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png',
- title: '这种模板可以区分多种通知类型',
- datetime: '2017-08-07',
- read: true,
- type: '通知',
- },
- {
- id: '000000004',
- avatar: 'https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png',
- title: '左侧图标用于区分不同的类型',
- datetime: '2017-08-07',
- type: '通知',
- },
- {
- id: '000000005',
- avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png',
- title: '内容不要超过两行字,超出时自动截断',
- datetime: '2017-08-07',
- type: '通知',
- },
- {
- id: '000000006',
- avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg',
- title: '曲丽丽 评论了你',
- description: '描述信息描述信息描述信息',
- datetime: '2017-08-07',
- type: '消息',
- clickClose: true,
- },
- {
- id: '000000007',
- avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg',
- title: '朱偏右 回复了你',
- description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像',
- datetime: '2017-08-07',
- type: '消息',
- clickClose: true,
- },
- {
- id: '000000008',
- avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg',
- title: '标题',
- description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像',
- datetime: '2017-08-07',
- type: '消息',
- clickClose: true,
- },
- {
- id: '000000009',
- title: '任务名称',
- description: '任务需要在 2017-01-12 20:00 前启动',
- extra: '未开始',
- status: 'todo',
- type: '待办',
- },
- {
- id: '000000010',
- title: '第三方紧急代码变更',
- description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务',
- extra: '马上到期',
- status: 'urgent',
- type: '待办',
- },
- {
- id: '000000011',
- title: '信息安全考试',
- description: '指派竹尔于 2017-01-09 前完成更新并发布',
- extra: '已耗时 8 天',
- status: 'doing',
- type: '待办',
- },
- {
- id: '000000012',
- title: 'ABCD 版本发布',
- description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务',
- extra: '进行中',
- status: 'processing',
- type: '待办',
- },
-];
-
-function onItemClick(item, tabProps) {
- console.log(item, tabProps);
-}
-
-function onClear(tabTitle) {
- console.log(tabTitle);
-}
-
-function getNoticeData(notices) {
- if (notices.length === 0) {
- return {};
- }
- const newNotices = notices.map(notice => {
- const newNotice = { ...notice };
- // transform id to item key
- if (newNotice.id) {
- newNotice.key = newNotice.id;
- }
- if (newNotice.extra && newNotice.status) {
- const color = {
- todo: '',
- processing: 'blue',
- urgent: 'red',
- doing: 'gold',
- }[newNotice.status];
- newNotice.extra = (
-
- {newNotice.extra}
-
- );
- }
- return newNotice;
- });
- return newNotices.reduce((pre, data) => {
- if (!pre[data.type]) {
- pre[data.type] = [];
- }
- pre[data.type].push(data);
- return pre;
- }, {});
-}
-
-const noticeData = getNoticeData(data);
-const Demo = () => (
-
-
-
-
-
-
-
-);
-
-ReactDOM.render(, mountNode);
-```
diff --git a/admin-web/src/components/NoticeIcon/index.d.ts b/admin-web/src/components/NoticeIcon/index.d.ts
deleted file mode 100644
index f7d6479aa..000000000
--- a/admin-web/src/components/NoticeIcon/index.d.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import * as React from 'react';
-import NoticeIconTab, { INoticeIconData } from './NoticeIconTab';
-
-export interface INoticeIconProps {
- count?: number;
- bell?: React.ReactNode;
- className?: string;
- loading?: boolean;
- onClear?: (tabName: string) => void;
- onItemClick?: (item: INoticeIconData, tabProps: INoticeIconProps) => void;
- onLoadMore?: (tabProps: INoticeIconProps) => void;
- onTabChange?: (tabTile: string) => void;
- style?: React.CSSProperties;
- onPopupVisibleChange?: (visible: boolean) => void;
- popupVisible?: boolean;
- locale?: {
- emptyText: string;
- clear: string;
- loadedAll: string;
- loadMore: string;
- };
- clearClose?: boolean;
-}
-
-export default class NoticeIcon extends React.Component {
- public static Tab: typeof NoticeIconTab;
-}
diff --git a/admin-web/src/components/NoticeIcon/index.en-US.md b/admin-web/src/components/NoticeIcon/index.en-US.md
deleted file mode 100644
index c64727806..000000000
--- a/admin-web/src/components/NoticeIcon/index.en-US.md
+++ /dev/null
@@ -1,52 +0,0 @@
----
-title: NoticeIcon
-subtitle:
-cols: 1
-order: 9
----
-
-用在导航工具栏上,作为整个产品统一的通知中心。
-
-## API
-
-Property | Description | Type | Default
-----|------|-----|------
-count | Total number of messages | number | -
-bell | Change the bell Icon | ReactNode | ``
-loading | Popup card loading status | boolean | `false`
-onClear | Click to clear button the callback | function(tabName) | -
-onItemClick | Click on the list item's callback | function(item, tabProps) | -
-onLoadMore | Callback of click for loading more | function(tabProps, event) | -
-onPopupVisibleChange | Popup Card Showing or Hiding Callbacks | function(visible) | -
-onTabChange | Switching callbacks for tabs | function(tabTitle) | -
-popupVisible | Popup card display state | boolean | -
-locale | Default message text | Object | `{ emptyText: 'No notifications', clear: 'Clear', loadedAll: 'Loaded', loadMore: 'Loading more' }`
-clearClose | Close menu after clear | boolean | `false`
-
-### NoticeIcon.Tab
-
-Property | Description | Type | Default
-----|------|-----|------
-count | Unread messages count of this tab | number | list.length
-emptyText | Message text when list is empty | ReactNode | -
-emptyImage | Image when list is empty | string | -
-list | List data, format refer to the following table | Array | `[]`
-loadedAll | All messages have been loaded | boolean | `true`
-loading | Loading status of this tab | boolean | `false`
-name | identifier for message Tab | string | -
-scrollToLoad | Scroll to load | boolean | `true`
-skeletonCount | Number of skeleton when tab is loading | number | `5`
-skeletonProps | Props of skeleton | SkeletonProps | `{}`
-showClear | Clear button display status | boolean | `true`
-title | header for message Tab | string | -
-
-### Tab data
-
-Property | Description | Type | Default
-----|------|-----|------
-avatar | avatar img url | string \| ReactNode | -
-title | title | ReactNode | -
-description | description info | ReactNode | -
-datetime | Timestamps | ReactNode | -
-extra | Additional information in the upper right corner of the list item | ReactNode | -
-clickClose | Close menu after clicking list item | boolean | `false`
diff --git a/admin-web/src/components/NoticeIcon/index.js b/admin-web/src/components/NoticeIcon/index.js
deleted file mode 100644
index 133819bb1..000000000
--- a/admin-web/src/components/NoticeIcon/index.js
+++ /dev/null
@@ -1,159 +0,0 @@
-import React, { PureComponent, Fragment } from 'react';
-import ReactDOM from 'react-dom';
-import { Icon, Tabs, Badge, Spin } from 'antd';
-import classNames from 'classnames';
-import HeaderDropdown from '../HeaderDropdown';
-import List from './NoticeList';
-import styles from './index.less';
-
-const { TabPane } = Tabs;
-
-export default class NoticeIcon extends PureComponent {
- static Tab = TabPane;
-
- static defaultProps = {
- onItemClick: () => {},
- onPopupVisibleChange: () => {},
- onTabChange: () => {},
- onClear: () => {},
- loading: false,
- clearClose: false,
- locale: {
- emptyText: 'No notifications',
- clear: 'Clear',
- loadedAll: 'Loaded',
- loadMore: 'Loading more',
- },
- emptyImage: 'https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg',
- };
-
- state = {
- visible: false,
- };
-
- onItemClick = (item, tabProps) => {
- const { onItemClick } = this.props;
- const { clickClose } = item;
- onItemClick(item, tabProps);
- if (clickClose) {
- this.popover.click();
- }
- };
-
- onClear = name => {
- const { onClear, clearClose } = this.props;
- onClear(name);
- if (clearClose) {
- this.popover.click();
- }
- };
-
- onTabChange = tabType => {
- const { onTabChange } = this.props;
- onTabChange(tabType);
- };
-
- onLoadMore = (tabProps, event) => {
- const { onLoadMore } = this.props;
- onLoadMore(tabProps, event);
- };
-
- getNotificationBox() {
- const { visible } = this.state;
- const { children, loading, locale } = this.props;
- if (!children) {
- return null;
- }
- const panes = React.Children.map(children, child => {
- const {
- list,
- title,
- name,
- count,
- emptyText,
- emptyImage,
- showClear,
- loadedAll,
- scrollToLoad,
- skeletonCount,
- skeletonProps,
- loading: tabLoading,
- } = child.props;
- const len = list && list.length ? list.length : 0;
- const msgCount = count || count === 0 ? count : len;
- const tabTitle = msgCount > 0 ? `${title} (${msgCount})` : title;
- return (
-
- this.onClear(name)}
- onClick={item => this.onItemClick(item, child.props)}
- onLoadMore={event => this.onLoadMore(child.props, event)}
- scrollToLoad={scrollToLoad}
- showClear={showClear}
- skeletonCount={skeletonCount}
- skeletonProps={skeletonProps}
- title={title}
- visible={visible}
- />
-
- );
- });
- return (
-
-
-
- {panes}
-
-
-
- );
- }
-
- handleVisibleChange = visible => {
- const { onPopupVisibleChange } = this.props;
- this.setState({ visible });
- onPopupVisibleChange(visible);
- };
-
- render() {
- const { className, count, popupVisible, bell } = this.props;
- const { visible } = this.state;
- const noticeButtonClass = classNames(className, styles.noticeButton);
- const notificationBox = this.getNotificationBox();
- const NoticeBellIcon = bell || ;
- const trigger = (
-
-
- {NoticeBellIcon}
-
-
- );
- if (!notificationBox) {
- return trigger;
- }
- const popoverProps = {};
- if ('popupVisible' in this.props) {
- popoverProps.visible = popupVisible;
- }
- return (
- (this.popover = ReactDOM.findDOMNode(node))} // eslint-disable-line
- >
- {trigger}
-
- );
- }
-}
diff --git a/admin-web/src/components/NoticeIcon/index.less b/admin-web/src/components/NoticeIcon/index.less
deleted file mode 100644
index 1c0593eea..000000000
--- a/admin-web/src/components/NoticeIcon/index.less
+++ /dev/null
@@ -1,31 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.popover {
- position: relative;
- width: 336px;
-}
-
-.noticeButton {
- display: inline-block;
- cursor: pointer;
- transition: all 0.3s;
-}
-.icon {
- padding: 4px;
- vertical-align: middle;
-}
-
-.badge {
- font-size: 16px;
-}
-
-.tabs {
- :global {
- .ant-tabs-nav-scroll {
- text-align: center;
- }
- .ant-tabs-bar {
- margin-bottom: 0;
- }
- }
-}
diff --git a/admin-web/src/components/NoticeIcon/index.zh-CN.md b/admin-web/src/components/NoticeIcon/index.zh-CN.md
deleted file mode 100644
index 23dab2203..000000000
--- a/admin-web/src/components/NoticeIcon/index.zh-CN.md
+++ /dev/null
@@ -1,52 +0,0 @@
----
-title: NoticeIcon
-subtitle: 通知菜单
-cols: 1
-order: 9
----
-
-用在导航工具栏上,作为整个产品统一的通知中心。
-
-## API
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-count | 图标上的消息总数 | number | -
-bell | translate this please -> Change the bell Icon | ReactNode | ``
-loading | 弹出卡片加载状态 | boolean | `false`
-onClear | 点击清空按钮的回调 | function(tabName) | -
-onItemClick | 点击列表项的回调 | function(item, tabProps) | -
-onLoadMore | 加载更多的回调 | function(tabProps, event) | -
-onPopupVisibleChange | 弹出卡片显隐的回调 | function(visible) | -
-onTabChange | 切换页签的回调 | function(tabTitle) | -
-popupVisible | 控制弹层显隐 | boolean | -
-locale | 默认文案 | Object | `{ emptyText: 'No notifications', clear: 'Clear', loadedAll: 'Loaded', loadMore: 'Loading more' }`
-clearClose | 点击清空按钮后关闭通知菜单 | boolean | `false`
-
-### NoticeIcon.Tab
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-count | 当前 Tab 未读消息数量 | number | list.length
-emptyText | 针对每个 Tab 定制空数据文案 | ReactNode | -
-emptyImage | 针对每个 Tab 定制空数据图片 | string | -
-list | 列表数据,格式参照下表 | Array | `[]`
-loadedAll | 已加载完所有消息 | boolean | `true`
-loading | 当前 Tab 的加载状态 | boolean | `false`
-name | 消息分类的标识符 | string | -
-scrollToLoad | 允许滚动自加载 | boolean | `true`
-skeletonCount | 加载时占位骨架的数量 | number | `5`
-skeletonProps | 加载时占位骨架的属性 | SkeletonProps | `{}`
-showClear | 是否显示清空按钮 | boolean | `true`
-title | 消息分类的页签标题 | string | -
-
-### Tab data
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-avatar | 头像图片链接 | string \| ReactNode | -
-title | 标题 | ReactNode | -
-description | 描述信息 | ReactNode | -
-datetime | 时间戳 | ReactNode | -
-extra | 额外信息,在列表项右上角 | ReactNode | -
-clickClose | 点击列表项关闭通知菜单 | boolean | `false`
diff --git a/admin-web/src/components/NumberInfo/demo/basic.md b/admin-web/src/components/NumberInfo/demo/basic.md
deleted file mode 100644
index b399655ee..000000000
--- a/admin-web/src/components/NumberInfo/demo/basic.md
+++ /dev/null
@@ -1,30 +0,0 @@
----
-order: 0
-title:
- zh-CN: 演示
- en-US: Demo
----
-
-## zh-CN
-
-各种数据文案的展现方式。
-
-## en-US
-
-Used for presenting various numerical data.
-
-````jsx
-import NumberInfo from 'ant-design-pro/lib/NumberInfo';
-import numeral from 'numeral';
-
-ReactDOM.render(
-
- Visits this week}
- total={numeral(12321).format('0,0')}
- status="up"
- subTotal={17.1}
- />
-
-, mountNode);
-````
diff --git a/admin-web/src/components/NumberInfo/index.d.ts b/admin-web/src/components/NumberInfo/index.d.ts
deleted file mode 100644
index ca93ba5d3..000000000
--- a/admin-web/src/components/NumberInfo/index.d.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import * as React from 'react';
-export interface INumberInfoProps {
- title?: React.ReactNode | string;
- subTitle?: React.ReactNode | string;
- total?: React.ReactNode | string;
- status?: 'up' | 'down';
- theme?: string;
- gap?: number;
- subTotal?: number;
- style?: React.CSSProperties;
-}
-
-export default class NumberInfo extends React.Component {}
diff --git a/admin-web/src/components/NumberInfo/index.en-US.md b/admin-web/src/components/NumberInfo/index.en-US.md
deleted file mode 100644
index b82afbe4f..000000000
--- a/admin-web/src/components/NumberInfo/index.en-US.md
+++ /dev/null
@@ -1,19 +0,0 @@
----
-title: NumberInfo
-cols: 1
-order: 10
----
-
-Often used in data cards for highlighting the business data.
-
-## API
-
-Property | Description | Type | Default
-----|------|-----|------
-title | title | ReactNode\|string | -
-subTitle | subtitle | ReactNode\|string | -
-total | total amount | ReactNode\|string | -
-subTotal | total amount of additional information | ReactNode\|string | -
-status | increase state | 'up \| down' | -
-theme | state style | string | 'light'
-gap | set the spacing (pixels) between numbers and descriptions | number | 8
diff --git a/admin-web/src/components/NumberInfo/index.js b/admin-web/src/components/NumberInfo/index.js
deleted file mode 100644
index 717aee9dd..000000000
--- a/admin-web/src/components/NumberInfo/index.js
+++ /dev/null
@@ -1,41 +0,0 @@
-import React from 'react';
-import { Icon } from 'antd';
-import classNames from 'classnames';
-import styles from './index.less';
-
-const NumberInfo = ({ theme, title, subTitle, total, subTotal, status, suffix, gap, ...rest }) => (
-
- {title && (
-
- {title}
-
- )}
- {subTitle && (
-
- {subTitle}
-
- )}
-
-
- {total}
- {suffix && {suffix}}
-
- {(status || subTotal) && (
-
- {subTotal}
- {status && }
-
- )}
-
-
-);
-
-export default NumberInfo;
diff --git a/admin-web/src/components/NumberInfo/index.less b/admin-web/src/components/NumberInfo/index.less
deleted file mode 100644
index 4a77288cc..000000000
--- a/admin-web/src/components/NumberInfo/index.less
+++ /dev/null
@@ -1,68 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.numberInfo {
- .suffix {
- margin-left: 4px;
- color: @text-color;
- font-size: 16px;
- font-style: normal;
- }
- .numberInfoTitle {
- margin-bottom: 16px;
- color: @text-color;
- font-size: @font-size-lg;
- transition: all 0.3s;
- }
- .numberInfoSubTitle {
- height: 22px;
- overflow: hidden;
- color: @text-color-secondary;
- font-size: @font-size-base;
- line-height: 22px;
- white-space: nowrap;
- text-overflow: ellipsis;
- word-break: break-all;
- }
- .numberInfoValue {
- margin-top: 4px;
- overflow: hidden;
- font-size: 0;
- white-space: nowrap;
- text-overflow: ellipsis;
- word-break: break-all;
- & > span {
- display: inline-block;
- height: 32px;
- margin-right: 32px;
- color: @heading-color;
- font-size: 24px;
- line-height: 32px;
- }
- .subTotal {
- margin-right: 0;
- color: @text-color-secondary;
- font-size: @font-size-lg;
- vertical-align: top;
- i {
- margin-left: 4px;
- font-size: 12px;
- transform: scale(0.82);
- }
- :global {
- .anticon-caret-up {
- color: @red-6;
- }
- .anticon-caret-down {
- color: @green-6;
- }
- }
- }
- }
-}
-.numberInfolight {
- .numberInfoValue {
- & > span {
- color: @text-color;
- }
- }
-}
diff --git a/admin-web/src/components/NumberInfo/index.zh-CN.md b/admin-web/src/components/NumberInfo/index.zh-CN.md
deleted file mode 100644
index 719853948..000000000
--- a/admin-web/src/components/NumberInfo/index.zh-CN.md
+++ /dev/null
@@ -1,20 +0,0 @@
----
-title: NumberInfo
-subtitle: 数据文本
-cols: 1
-order: 10
----
-
-常用在数据卡片中,用于突出展示某个业务数据。
-
-## API
-
-参数 | 说明 | 类型 | 默认值
-----|------|-----|------
-title | 标题 | ReactNode\|string | -
-subTitle | 子标题 | ReactNode\|string | -
-total | 总量 | ReactNode\|string | -
-subTotal | 子总量 | ReactNode\|string | -
-status | 增加状态 | 'up \| down' | -
-theme | 状态样式 | string | 'light'
-gap | 设置数字和描述之间的间距(像素)| number | 8
diff --git a/admin-web/src/components/OrderTable/index.js b/admin-web/src/components/OrderTable/index.js
deleted file mode 100644
index 2c74867eb..000000000
--- a/admin-web/src/components/OrderTable/index.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// import React, { PureComponent } from 'react';
-// import {} from 'antd';
-//
-// export default class OrderTable extends PureComponent {
-// render() {
-// return cc
;
-// }
-// }
diff --git a/admin-web/src/components/PageHeader/breadcrumb.d.ts b/admin-web/src/components/PageHeader/breadcrumb.d.ts
deleted file mode 100644
index cfed40211..000000000
--- a/admin-web/src/components/PageHeader/breadcrumb.d.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import * as React from 'react';
-import { IPageHeaderProps } from './index';
-
-export default class BreadcrumbView extends React.Component {}
-
-export function getBreadcrumb(breadcrumbNameMap: object, url: string): object;
diff --git a/admin-web/src/components/PageHeader/breadcrumb.js b/admin-web/src/components/PageHeader/breadcrumb.js
deleted file mode 100644
index e6afcb54c..000000000
--- a/admin-web/src/components/PageHeader/breadcrumb.js
+++ /dev/null
@@ -1,178 +0,0 @@
-import React, { PureComponent, createElement } from 'react';
-import pathToRegexp from 'path-to-regexp';
-import { Breadcrumb } from 'antd';
-import styles from './index.less';
-import { urlToList } from '../_utils/pathTools';
-
-export const getBreadcrumb = (breadcrumbNameMap, url) => {
- let breadcrumb = breadcrumbNameMap[url];
- if (!breadcrumb) {
- Object.keys(breadcrumbNameMap).forEach(item => {
- if (pathToRegexp(item).test(url)) {
- breadcrumb = breadcrumbNameMap[item];
- }
- });
- }
- return breadcrumb || {};
-};
-
-export default class BreadcrumbView extends PureComponent {
- state = {
- breadcrumb: null,
- };
-
- componentDidMount() {
- this.getBreadcrumbDom();
- }
-
- componentDidUpdate(preProps) {
- const { location } = this.props;
- if (!location || !preProps.location) {
- return;
- }
- const prePathname = preProps.location.pathname;
- if (prePathname !== location.pathname) {
- this.getBreadcrumbDom();
- }
- }
-
- getBreadcrumbDom = () => {
- const breadcrumb = this.conversionBreadcrumbList();
- this.setState({
- breadcrumb,
- });
- };
-
- getBreadcrumbProps = () => {
- const { routes, params, location, breadcrumbNameMap } = this.props;
- return {
- routes,
- params,
- routerLocation: location,
- breadcrumbNameMap,
- };
- };
-
- // Generated according to props
- conversionFromProps = () => {
- const { breadcrumbList, breadcrumbSeparator, itemRender, linkElement = 'a' } = this.props;
- return (
-
- {breadcrumbList.map(item => {
- const title = itemRender ? itemRender(item) : item.title;
- return (
-
- {item.href
- ? createElement(
- linkElement,
- {
- [linkElement === 'a' ? 'href' : 'to']: item.href,
- },
- title
- )
- : title}
-
- );
- })}
-
- );
- };
-
- conversionFromLocation = (routerLocation, breadcrumbNameMap) => {
- const { breadcrumbSeparator, home, itemRender, linkElement = 'a' } = this.props;
- // Convert the url to an array
- const pathSnippets = urlToList(routerLocation.pathname);
- // Loop data mosaic routing
- const extraBreadcrumbItems = pathSnippets.map((url, index) => {
- const currentBreadcrumb = getBreadcrumb(breadcrumbNameMap, url);
- if (currentBreadcrumb.inherited) {
- return null;
- }
- const isLinkable = index !== pathSnippets.length - 1 && currentBreadcrumb.component;
- const name = itemRender ? itemRender(currentBreadcrumb) : currentBreadcrumb.name;
- return currentBreadcrumb.name && !currentBreadcrumb.hideInBreadcrumb ? (
-
- {createElement(
- isLinkable ? linkElement : 'span',
- { [linkElement === 'a' ? 'href' : 'to']: url },
- name
- )}
-
- ) : null;
- });
- // Add home breadcrumbs to your head if defined
- if (home) {
- extraBreadcrumbItems.unshift(
-
- {createElement(
- linkElement,
- {
- [linkElement === 'a' ? 'href' : 'to']: '/',
- },
- home
- )}
-
- );
- }
- return (
-
- {extraBreadcrumbItems}
-
- );
- };
-
- /**
- * 将参数转化为面包屑
- * Convert parameters into breadcrumbs
- */
- conversionBreadcrumbList = () => {
- const { breadcrumbList, breadcrumbSeparator } = this.props;
- const { routes, params, routerLocation, breadcrumbNameMap } = this.getBreadcrumbProps();
- if (breadcrumbList && breadcrumbList.length) {
- return this.conversionFromProps();
- }
- // 如果传入 routes 和 params 属性
- // If pass routes and params attributes
- if (routes && params) {
- return (
- route.breadcrumbName)}
- params={params}
- itemRender={this.itemRender}
- separator={breadcrumbSeparator}
- />
- );
- }
- // 根据 location 生成 面包屑
- // Generate breadcrumbs based on location
- if (routerLocation && routerLocation.pathname) {
- return this.conversionFromLocation(routerLocation, breadcrumbNameMap);
- }
- return null;
- };
-
- // 渲染Breadcrumb 子节点
- // Render the Breadcrumb child node
- itemRender = (route, params, routes, paths) => {
- const { linkElement = 'a' } = this.props;
- const last = routes.indexOf(route) === routes.length - 1;
- return last || !route.component ? (
- {route.breadcrumbName}
- ) : (
- createElement(
- linkElement,
- {
- href: paths.join('/') || '/',
- to: paths.join('/') || '/',
- },
- route.breadcrumbName
- )
- );
- };
-
- render() {
- const { breadcrumb } = this.state;
- return breadcrumb;
- }
-}
diff --git a/admin-web/src/components/PageHeader/demo/image.md b/admin-web/src/components/PageHeader/demo/image.md
deleted file mode 100644
index 511bac5d0..000000000
--- a/admin-web/src/components/PageHeader/demo/image.md
+++ /dev/null
@@ -1,75 +0,0 @@
----
-order: 2
-title: With Image
----
-
-带图片的页头。
-
-````jsx
-import PageHeader from 'ant-design-pro/lib/PageHeader';
-
-const content = (
-
-
段落示意:蚂蚁金服务设计平台 ant.design,用最小的工作量,无缝接入蚂蚁金服生态,提供跨越设计与开发的体验解决方案。
-
-
-);
-
-const extra = (
-
-
-
-);
-
-const breadcrumbList = [{
- title: '一级菜单',
- href: '/',
-}, {
- title: '二级菜单',
- href: '/',
-}, {
- title: '三级菜单',
-}];
-
-ReactDOM.render(
-
-, mountNode);
-````
-
-
diff --git a/admin-web/src/components/PageHeader/demo/simple.md b/admin-web/src/components/PageHeader/demo/simple.md
deleted file mode 100644
index d0ad1f7d2..000000000
--- a/admin-web/src/components/PageHeader/demo/simple.md
+++ /dev/null
@@ -1,32 +0,0 @@
----
-order: 3
-title: Simple
----
-
-简单的页头。
-
-````jsx
-import PageHeader from 'ant-design-pro/lib/PageHeader';
-
-const breadcrumbList = [{
- title: '一级菜单',
- href: '/',
-}, {
- title: '二级菜单',
- href: '/',
-}, {
- title: '三级菜单',
-}];
-
-ReactDOM.render(
-
-, mountNode);
-````
-
-
diff --git a/admin-web/src/components/PageHeader/demo/standard.md b/admin-web/src/components/PageHeader/demo/standard.md
deleted file mode 100644
index 5c59c933c..000000000
--- a/admin-web/src/components/PageHeader/demo/standard.md
+++ /dev/null
@@ -1,102 +0,0 @@
----
-order: 1
-title: Standard
----
-
-标准页头。
-
-````jsx
-import PageHeader from 'ant-design-pro/lib/PageHeader';
-import DescriptionList from 'ant-design-pro/lib/DescriptionList';
-import { Button, Menu, Dropdown, Icon, Row, Col } from 'antd';
-
-const { Description } = DescriptionList;
-const ButtonGroup = Button.Group;
-
-const description = (
-
- 曲丽丽
- XX 服务
- 2017-07-07
- 12421
-
-);
-
-const menu = (
-
-);
-
-const action = (
-
-
-
-
-
-
-
-
-
-
-);
-
-const extra = (
-
-
- 状态
- 待审批
-
-
- 订单金额
- ¥ 568.08
-
-
-);
-
-const breadcrumbList = [{
- title: '一级菜单',
- href: '/',
-}, {
- title: '二级菜单',
- href: '/',
-}, {
- title: '三级菜单',
-}];
-
-const tabList = [{
- key: 'detail',
- tab: '详情',
-}, {
- key: 'rule',
- tab: '规则',
-}];
-
-function onTabChange(key) {
- console.log(key);
-}
-
-ReactDOM.render(
-
-
}
- action={action}
- content={description}
- extraContent={extra}
- breadcrumbList={breadcrumbList}
- tabList={tabList}
- tabActiveKey="detail"
- onTabChange={onTabChange}
- />
-
-, mountNode);
-````
-
-
diff --git a/admin-web/src/components/PageHeader/demo/structure.md b/admin-web/src/components/PageHeader/demo/structure.md
deleted file mode 100644
index 429eed631..000000000
--- a/admin-web/src/components/PageHeader/demo/structure.md
+++ /dev/null
@@ -1,68 +0,0 @@
----
-order: 0
-title: Structure
----
-
-基本结构,具备响应式布局功能,主要断点为 768px 和 576px,拖动窗口改变大小试试看。
-
-````jsx
-import PageHeader from 'ant-design-pro/lib/PageHeader';
-
-const breadcrumbList = [{
- title: '面包屑',
-}];
-
-const tabList = [{
- key: '1',
- tab: '页签一',
-}, {
- key: '2',
- tab: '页签二',
-}, {
- key: '3',
- tab: '页签三',
-}];
-
-ReactDOM.render(
- }
- logo={logo
}
- action={action
}
- content={content
}
- extraContent={extraContent
}
- breadcrumbList={breadcrumbList}
- tabList={tabList}
- tabActiveKey="1"
- />
-
-, mountNode);
-````
-
-
diff --git a/admin-web/src/components/PageHeader/index.d.ts b/admin-web/src/components/PageHeader/index.d.ts
deleted file mode 100644
index eacbb2de9..000000000
--- a/admin-web/src/components/PageHeader/index.d.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import * as React from 'react';
-export interface IPageHeaderProps {
- title?: React.ReactNode | string;
- logo?: React.ReactNode | string;
- action?: React.ReactNode | string;
- content?: React.ReactNode;
- extraContent?: React.ReactNode;
- routes?: any[];
- params?: any;
- breadcrumbList?: Array<{ title: React.ReactNode; href?: string }>;
- tabList?: Array<{ key: string; tab: React.ReactNode }>;
- tabActiveKey?: string;
- tabDefaultActiveKey?: string;
- onTabChange?: (key: string) => void;
- tabBarExtraContent?: React.ReactNode;
- linkElement?: React.ReactNode;
- style?: React.CSSProperties;
- home?: React.ReactNode;
- wide?: boolean;
- hiddenBreadcrumb?: boolean;
-}
-
-export default class PageHeader extends React.Component {}
diff --git a/admin-web/src/components/PageHeader/index.js b/admin-web/src/components/PageHeader/index.js
deleted file mode 100644
index 17c1a7e28..000000000
--- a/admin-web/src/components/PageHeader/index.js
+++ /dev/null
@@ -1,82 +0,0 @@
-import React, { PureComponent } from 'react';
-import { Tabs, Skeleton } from 'antd';
-import classNames from 'classnames';
-import styles from './index.less';
-import BreadcrumbView from './breadcrumb';
-
-const { TabPane } = Tabs;
-export default class PageHeader extends PureComponent {
- onChange = key => {
- const { onTabChange } = this.props;
- if (onTabChange) {
- onTabChange(key);
- }
- };
-
- render() {
- const {
- title = '',
- logo,
- action,
- content,
- extraContent,
- tabList,
- className,
- tabActiveKey,
- tabDefaultActiveKey,
- tabBarExtraContent,
- loading = false,
- wide = false,
- hiddenBreadcrumb = false,
- } = this.props;
-
- const clsString = classNames(styles.pageHeader, className);
- const activeKeyProps = {};
- if (tabDefaultActiveKey !== undefined) {
- activeKeyProps.defaultActiveKey = tabDefaultActiveKey;
- }
- if (tabActiveKey !== undefined) {
- activeKeyProps.activeKey = tabActiveKey;
- }
- return (
-
-
-
- {hiddenBreadcrumb ? null : }
-
- {logo &&
{logo}
}
-
-
-
{title}
- {action &&
{action}
}
-
-
- {content &&
{content}
}
- {extraContent &&
{extraContent}
}
-
-
-
- {tabList && tabList.length ? (
-
- {tabList.map(item => (
-
- ))}
-
- ) : null}
-
-
-
- );
- }
-}
diff --git a/admin-web/src/components/PageHeader/index.less b/admin-web/src/components/PageHeader/index.less
deleted file mode 100644
index 81125bbd5..000000000
--- a/admin-web/src/components/PageHeader/index.less
+++ /dev/null
@@ -1,161 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.pageHeader {
- padding: 16px 32px 0 32px;
- background: @component-background;
- border-bottom: @border-width-base @border-style-base @border-color-split;
- .wide {
- max-width: 1200px;
- margin: auto;
- }
- .detail {
- display: flex;
- }
-
- .row {
- display: flex;
- width: 100%;
- }
-
- .breadcrumb {
- margin-bottom: 16px;
- }
-
- .tabs {
- margin: 0 0 0 -8px;
-
- :global {
- // 1px 可以让选中效果显示完成
- .ant-tabs-bar {
- margin-bottom: 1px;
- border-bottom: none;
- }
- }
- }
-
- .logo {
- flex: 0 1 auto;
- margin-right: 16px;
- padding-top: 1px;
- > img {
- display: block;
- width: 28px;
- height: 28px;
- border-radius: @border-radius-base;
- }
- }
-
- .title {
- color: @heading-color;
- font-weight: 500;
- font-size: 20px;
- }
-
- .action {
- min-width: 266px;
- margin-left: 56px;
-
- :global {
- .ant-btn-group:not(:last-child),
- .ant-btn:not(:last-child) {
- margin-right: 8px;
- }
-
- .ant-btn-group > .ant-btn {
- margin-right: 0;
- }
- }
- }
-
- .title,
- .content {
- flex: auto;
- }
-
- .action,
- .extraContent,
- .main {
- flex: 0 1 auto;
- }
-
- .main {
- width: 100%;
- }
-
- .title,
- .action {
- margin-bottom: 16px;
- }
-
- .logo,
- .content,
- .extraContent {
- margin-bottom: 16px;
- }
-
- .action,
- .extraContent {
- text-align: right;
- }
-
- .extraContent {
- min-width: 242px;
- margin-left: 88px;
- }
-}
-
-@media screen and (max-width: @screen-xl) {
- .pageHeader {
- .extraContent {
- margin-left: 44px;
- }
- }
-}
-
-@media screen and (max-width: @screen-lg) {
- .pageHeader {
- .extraContent {
- margin-left: 20px;
- }
- }
-}
-
-@media screen and (max-width: @screen-md) {
- .pageHeader {
- .row {
- display: block;
- }
-
- .action,
- .extraContent {
- margin-left: 0;
- text-align: left;
- }
- }
-}
-
-@media screen and (max-width: @screen-sm) {
- .pageHeader {
- .detail {
- display: block;
- }
- }
-}
-
-@media screen and (max-width: @screen-xs) {
- .pageHeader {
- .action {
- :global {
- .ant-btn-group,
- .ant-btn {
- display: block;
- margin-bottom: 8px;
- }
- .ant-btn-group > .ant-btn {
- display: inline-block;
- margin-bottom: 0;
- }
- }
- }
- }
-}
diff --git a/admin-web/src/components/PageHeader/index.md b/admin-web/src/components/PageHeader/index.md
deleted file mode 100644
index 48543f5f4..000000000
--- a/admin-web/src/components/PageHeader/index.md
+++ /dev/null
@@ -1,34 +0,0 @@
----
-title: PageHeader
-subtitle: 页头
-cols: 1
-order: 11
----
-
-页头用来声明页面的主题,包含了用户所关注的最重要的信息,使用户可以快速理解当前页面是什么以及它的功能。
-
-## API
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| title | title 区域 | ReactNode | - |
-| logo | logo区域 | ReactNode | - |
-| action | 操作区,位于 title 行的行尾 | ReactNode | - |
-| home | 默认的主页说明文字 | ReactNode | - |
-| content | 内容区 | ReactNode | - |
-| extraContent | 额外内容区,位于content的右侧 | ReactNode | - |
-| breadcrumbList | 面包屑数据,配置了此属性时 `routes` `params` `location` `breadcrumbNameMap` 无效 | array<{title: ReactNode, href?: string}> | - |
-| hiddenBreadcrumb |隐藏面包屑 | boolean | false |
-| routes | 面包屑相关属性,router 的路由栈信息 | object[] | - |
-| params | 面包屑相关属性,路由的参数 | object | - |
-| location | 面包屑相关属性,当前的路由信息 | object | - |
-| breadcrumbNameMap | 面包屑相关属性,路由的地址-名称映射表 | object | - |
-| tabList | tab 标题列表 | array<{key: string, tab: ReactNode}> | - |
-| tabActiveKey | 当前高亮的 tab 项 | string | - |
-| tabDefaultActiveKey | 默认高亮的 tab 项 | string | 第一项 |
-| wide | 是否定宽 | boolean | false |
-| onTabChange | 切换面板的回调 | (key) => void | - |
-| itemRender | 自定义节点方法 | (menuItem) => ReactNode | - |
-| linkElement | 定义链接的元素,默认为 `a`,可传入 react-router 的 Link | string\|ReactElement | - |
-
-> 面包屑的配置方式有三种,一是直接配置 `breadcrumbList`,二是结合 `react-router@2` `react-router@3`,配置 `routes` 及 `params` 实现,类似 [面包屑 Demo](https://ant.design/components/breadcrumb-cn/#components-breadcrumb-demo-router),三是结合 `react-router@4`,配置 `location` `breadcrumbNameMap`,优先级依次递减,脚手架中使用最后一种。 对于后两种用法,你也可以将 `routes` `params` 及 `location` `breadcrumbNameMap` 放到 context 中,组件会自动获取。
diff --git a/admin-web/src/components/PageHeader/index.test.js b/admin-web/src/components/PageHeader/index.test.js
deleted file mode 100644
index d22706e9c..000000000
--- a/admin-web/src/components/PageHeader/index.test.js
+++ /dev/null
@@ -1,43 +0,0 @@
-import { getBreadcrumb } from './breadcrumb';
-import { urlToList } from '../_utils/pathTools';
-
-const routerData = {
- '/dashboard/analysis': {
- name: '分析页',
- },
- '/userinfo': {
- name: '用户列表',
- },
- '/userinfo/:id': {
- name: '用户信息',
- },
- '/userinfo/:id/addr': {
- name: '收货订单',
- },
-};
-describe('test getBreadcrumb', () => {
- it('Simple url', () => {
- expect(getBreadcrumb(routerData, '/dashboard/analysis').name).toEqual('分析页');
- });
- it('Parameters url', () => {
- expect(getBreadcrumb(routerData, '/userinfo/2144').name).toEqual('用户信息');
- });
- it('The middle parameter url', () => {
- expect(getBreadcrumb(routerData, '/userinfo/2144/addr').name).toEqual('收货订单');
- });
- it('Loop through the parameters', () => {
- const urlNameList = urlToList('/userinfo/2144/addr').map(
- url => getBreadcrumb(routerData, url).name
- );
- expect(urlNameList).toEqual(['用户列表', '用户信息', '收货订单']);
- });
-
- it('a path', () => {
- const urlNameList = urlToList('/userinfo').map(url => getBreadcrumb(routerData, url).name);
- expect(urlNameList).toEqual(['用户列表']);
- });
- it('Secondary path', () => {
- const urlNameList = urlToList('/userinfo/2144').map(url => getBreadcrumb(routerData, url).name);
- expect(urlNameList).toEqual(['用户列表', '用户信息']);
- });
-});
diff --git a/admin-web/src/components/PageHeaderWrapper/GridContent.js b/admin-web/src/components/PageHeaderWrapper/GridContent.js
deleted file mode 100644
index 931ea20c9..000000000
--- a/admin-web/src/components/PageHeaderWrapper/GridContent.js
+++ /dev/null
@@ -1,18 +0,0 @@
-import React, { PureComponent } from 'react';
-import { connect } from 'dva';
-import styles from './GridContent.less';
-
-class GridContent extends PureComponent {
- render() {
- const { contentWidth, children } = this.props;
- let className = `${styles.main}`;
- if (contentWidth === 'Fixed') {
- className = `${styles.main} ${styles.wide}`;
- }
- return {children}
;
- }
-}
-
-export default connect(({ setting }) => ({
- contentWidth: setting.contentWidth,
-}))(GridContent);
diff --git a/admin-web/src/components/PageHeaderWrapper/GridContent.less b/admin-web/src/components/PageHeaderWrapper/GridContent.less
deleted file mode 100644
index d5496e9ec..000000000
--- a/admin-web/src/components/PageHeaderWrapper/GridContent.less
+++ /dev/null
@@ -1,10 +0,0 @@
-.main {
- width: 100%;
- height: 100%;
- min-height: 100%;
- transition: 0.3s;
- &.wide {
- max-width: 1200px;
- margin: 0 auto;
- }
-}
diff --git a/admin-web/src/components/PageHeaderWrapper/index.js b/admin-web/src/components/PageHeaderWrapper/index.js
deleted file mode 100644
index cd745f66e..000000000
--- a/admin-web/src/components/PageHeaderWrapper/index.js
+++ /dev/null
@@ -1,41 +0,0 @@
-import React from 'react';
-import { FormattedMessage } from 'umi/locale';
-import Link from 'umi/link';
-import PageHeader from '@/components/PageHeader';
-import { connect } from 'dva';
-import GridContent from './GridContent';
-import styles from './index.less';
-import MenuContext from '@/layouts/MenuContext';
-
-const PageHeaderWrapper = ({ children, contentWidth, wrapperClassName, top, ...restProps }) => (
-
- {top}
-
- {value => (
- }
- {...value}
- key="pageheader"
- {...restProps}
- linkElement={Link}
- itemRender={item => {
- if (item.locale) {
- return ;
- }
- return item.title;
- }}
- />
- )}
-
- {children ? (
-
- {children}
-
- ) : null}
-
-);
-
-export default connect(({ setting }) => ({
- contentWidth: setting.contentWidth,
-}))(PageHeaderWrapper);
diff --git a/admin-web/src/components/PageHeaderWrapper/index.less b/admin-web/src/components/PageHeaderWrapper/index.less
deleted file mode 100644
index 39a449657..000000000
--- a/admin-web/src/components/PageHeaderWrapper/index.less
+++ /dev/null
@@ -1,11 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.content {
- margin: 24px 24px 0;
-}
-
-@media screen and (max-width: @screen-sm) {
- .content {
- margin: 24px 0 0;
- }
-}
diff --git a/admin-web/src/components/PageLoading/index.js b/admin-web/src/components/PageLoading/index.js
deleted file mode 100644
index 77c0f165f..000000000
--- a/admin-web/src/components/PageLoading/index.js
+++ /dev/null
@@ -1,10 +0,0 @@
-import React from 'react';
-import { Spin } from 'antd';
-
-// loading components from code split
-// https://umijs.org/plugin/umi-plugin-react.html#dynamicimport
-export default () => (
-
-
-
-);
diff --git a/admin-web/src/components/Product/ProductAttrSelectFormItem.js b/admin-web/src/components/Product/ProductAttrSelectFormItem.js
deleted file mode 100644
index aa01fcfc1..000000000
--- a/admin-web/src/components/Product/ProductAttrSelectFormItem.js
+++ /dev/null
@@ -1,148 +0,0 @@
-import React, {PureComponent} from "react";
-import {Select} from "antd";
-
-const Option = Select.Option;
-
-class AttrValueSelect extends Select {
-
- handleSelectAttrValue = (value, option) => {
-
- };
-
- render() {
- const {index, attrValues, attrValueOptions, attr} = this.props;
-
- const handleChangeAttrValue = async (values, options) => {
- let attrValues = [];
- const {dispatch, index} = this.props;
- // debugger;
- // console.log('x' + this.children[0]);
- // let firstOption = this.children[0];
- // let attrIndex = firstOption.key.substring(firstOption.key.indexOf('option-attr-value-') + 'option-attr-value-'.length, firstOption.key.lastIndexOf('-'));
- for (let i in options) {
- let option = options[i];
- // TODO 芋艿,这个做法很不优雅,后面看俺。需要问下 answer 。
- let attrValueId = undefined;
- if (option.key.indexOf('option-attr-value-') === -1) {
- await dispatch({
- type: 'productAttrList/addValue',
- payload: {
- attrId: attr.id,
- name: option.props.children,
- },
- callback: function (data) {
- attrValueId = data.id;
- }
- });
- } else {
- attrValueId = parseInt(option.props.value);
- }
- // 添加到 attrValues 中。
- // debugger;
- attrValues.push({
- id: attrValueId,
- name: option.props.children,
- });
- }
- dispatch({
- type: 'productSpuAddOrUpdate/selectAttrValues',
- payload: {
- attrIndex: index,
- attrValues: attrValues,
- },
- });
- // debugger;
-
- // console.log(value);
- };
-
- return ;
- }
-
-}
-
-export default class ProductAttrSelectFormItem extends PureComponent {
-
- handleSelectAttr = (value, option) => {
- // debugger;
- // console.log(value);
- // console.log(option);
- // debugger;
- const { dispatch, index } = this.props;
- // let attrIndex = option.key.substring(option.key.indexOf('option-attr-') + 'option-attr-'.length, option.key.lastIndexOf('-'));
- // console.log('attrIndex: ' + attrIndex);
- // debugger;
- dispatch({
- type: 'productSpuAddOrUpdate/selectAttr',
- payload: {
- attrIndex: index,
- attr: {
- id: option.props.value,
- name: option.props.children,
- values: []
- }
- },
- });
- };
-
- render() {
- const {attr, allAttrTree, selectedAttrIds, index, dispatch} = this.props;
- // console.log('i: ' + i);
- // 1. 规格
- let attrOptions = [];
- // allAttrTree.unshift(attr);
- // debugger;
- for (let j in allAttrTree) {
- let allAttr = allAttrTree[j];
- if (selectedAttrIds.has(allAttr.id) && allAttr.id !== attr.id) {
- continue;
- }
- attrOptions.push();
- }
- // 2. 规格值
- let attrValueOptions = [];
- // debugger;
- if (attr.id) {
- // 2.1 先找到规格值的数组
- let attrValues = [];
- for (let j in allAttrTree) {
- let allAttr = allAttrTree[j];
- if (attr.id === allAttr.id) {
- attrValues = allAttr.values;
- break;
- }
- }
- // 2.2 生成规格值的 HTML
- for (let j in attrValues) {
- let attrValue = attrValues[j];
- attrValueOptions.push(); // + '' 的原因是,多选必须是字符串
- }
- }
- // 3. 拼装最终,添加到 attrTreeHTML 中
- // debugger;
- let attrValues = []; // 选中的规格值集合
- for (let i in attr.values) {
- attrValues.push(attr.values[i].id + ''); // Select 传入数组时,如果不 + '' ,选不中。
- }
- let attrValueSelectProps = {
- index: index,
- attrValues: attrValues,
- dispatch: dispatch,
- attrValueOptions: attrValueOptions,
- attr: attr,
- };
- // TODO BUG ,规格不能搜索添加
- return ;
- }
-
-}
diff --git a/admin-web/src/components/Product/ProductSkuAddOrUpdateTable.js b/admin-web/src/components/Product/ProductSkuAddOrUpdateTable.js
deleted file mode 100644
index c4659ebb0..000000000
--- a/admin-web/src/components/Product/ProductSkuAddOrUpdateTable.js
+++ /dev/null
@@ -1,96 +0,0 @@
-import React, {PureComponent} from "react";
-import {InputNumber, Select, Table} from "antd";
-import Input from "antd/es/input";
-
-const Option = Select.Option;
-
-class SkuInputNumber extends PureComponent {
-
- handleChange = value => {
- // debugger;
- const { dispatch, index, dataIndex } = this.props;
- if (dataIndex === 'price') {
- dispatch({
- type: 'productSpuAddOrUpdate/inputSkuPrice',
- payload: {
- index: index,
- price: value
- },
- });
- } else if (dataIndex === 'quantity') {
- dispatch({
- type: 'productSpuAddOrUpdate/inputSkuQuantity',
- payload: {
- index: index,
- quantity: value
- },
- });
- }
- }
-
- render() {
- const { value } = this.props;
- return
- }
-
-}
-
-export default class ProductSkuAddOrUpdateTable extends PureComponent {
-
- render() {
- let that = this;
- // debugger;
- // console.log('ProductSkuAddOrUpdateTable');
- const {attrTree, skus, dispatch} = this.props;
- // 排除空选项的规格
- let newAttrTree = [];
- for (let i in attrTree) {
- let attr = attrTree[i];
- if (attr && attr.values && attr.values.length > 0) {
- newAttrTree.push(attr);
- }
- }
- let columns = [];
- for (let i in newAttrTree) {
- let attr = newAttrTree[i];
- columns.push({
- title: attr.name,
- dataIndex: 'attrs[i]',
- render(value, record) {
- return record.attrs[i].name;
- }
- })
- }
- columns.push({
- title: '价格',
- dataIndex: 'price',
- render(value, record, index) {
- let props = {
- record: record,
- index: index,
- dispatch: dispatch,
- dataIndex: 'price',
- value: record.price,
- };
- return ;
- }
- });
- columns.push({
- title: '库存',
- dataIndex: 'quantity',
- render(value, record, index) {
- let props = {
- record: record,
- index: index,
- dispatch: dispatch,
- dataIndex: 'quantity',
- value: record.quantity,
- };
- return ;
- }
- });
- return ;
- // return ;
- }
-
-}
diff --git a/admin-web/src/components/Result/demo/classic.md b/admin-web/src/components/Result/demo/classic.md
deleted file mode 100644
index 0cd9d14b3..000000000
--- a/admin-web/src/components/Result/demo/classic.md
+++ /dev/null
@@ -1,80 +0,0 @@
----
-order: 1
-title: Classic
----
-
-典型结果页面。
-
-````jsx
-import Result from 'ant-design-pro/lib/Result';
-import { Button, Row, Col, Icon, Steps } from 'antd';
-
-const { Step } = Steps;
-
-const desc1 = (
-
-
- 曲丽丽
-
-
-
2016-12-12 12:32
-
-);
-
-const desc2 = (
-
-);
-
-const extra = (
-
-
- 项目名称
-
-
-
- 项目 ID:
- 23421
-
-
- 负责人:
- 曲丽丽
-
-
- 生效时间:
- 2016-12-12 ~ 2017-12-12
-
-
-
-
-
-
-
-
-
-);
-
-const actions = (
-
-
-
-
-
-);
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/admin-web/src/components/Result/demo/error.md b/admin-web/src/components/Result/demo/error.md
deleted file mode 100644
index 5fd25cfdd..000000000
--- a/admin-web/src/components/Result/demo/error.md
+++ /dev/null
@@ -1,39 +0,0 @@
----
-order: 2
-title: Failed
----
-
-提交失败。
-
-````jsx
-import Result from 'ant-design-pro/lib/Result';
-import { Button, Icon } from 'antd';
-
-const extra = (
-
-);
-
-const actions = ;
-
-ReactDOM.render(
-
-, mountNode);
-````
diff --git a/admin-web/src/components/Result/demo/structure.md b/admin-web/src/components/Result/demo/structure.md
deleted file mode 100644
index 7fcecfd6d..000000000
--- a/admin-web/src/components/Result/demo/structure.md
+++ /dev/null
@@ -1,20 +0,0 @@
----
-order: 0
-title: Structure
----
-
-结构包含 `处理结果`,`补充信息` 以及 `操作建议` 三个部分,其中 `处理结果` 由 `提示图标`,`标题` 和 `结果描述` 组成。
-
-````jsx
-import Result from 'ant-design-pro/lib/Result';
-
-ReactDOM.render(
- 标题}
- description={结果描述
}
- extra="其他补充信息,自带灰底效果"
- actions={操作建议,一般放置按钮组
}
- />
-, mountNode);
-````
diff --git a/admin-web/src/components/Result/index.d.ts b/admin-web/src/components/Result/index.d.ts
deleted file mode 100644
index 0c34c2540..000000000
--- a/admin-web/src/components/Result/index.d.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import * as React from 'react';
-export interface IResultProps {
- type: 'success' | 'error';
- title: React.ReactNode;
- description?: React.ReactNode;
- extra?: React.ReactNode;
- actions?: React.ReactNode;
- style?: React.CSSProperties;
-}
-
-export default class Result extends React.Component {}
diff --git a/admin-web/src/components/Result/index.js b/admin-web/src/components/Result/index.js
deleted file mode 100644
index 89f9f31ab..000000000
--- a/admin-web/src/components/Result/index.js
+++ /dev/null
@@ -1,29 +0,0 @@
-import React from 'react';
-import classNames from 'classnames';
-import { Icon } from 'antd';
-import styles from './index.less';
-
-export default function Result({
- className,
- type,
- title,
- description,
- extra,
- actions,
- ...restProps
-}) {
- const iconMap = {
- error: ,
- success: ,
- };
- const clsString = classNames(styles.result, className);
- return (
-
-
{iconMap[type]}
-
{title}
- {description &&
{description}
}
- {extra &&
{extra}
}
- {actions &&
{actions}
}
-
- );
-}
diff --git a/admin-web/src/components/Result/index.less b/admin-web/src/components/Result/index.less
deleted file mode 100644
index 00c958793..000000000
--- a/admin-web/src/components/Result/index.less
+++ /dev/null
@@ -1,58 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.result {
- width: 72%;
- margin: 0 auto;
- text-align: center;
- @media screen and (max-width: @screen-xs) {
- width: 100%;
- }
-
- .icon {
- margin-bottom: 24px;
- font-size: 72px;
- line-height: 72px;
-
- & > .success {
- color: @success-color;
- }
-
- & > .error {
- color: @error-color;
- }
- }
-
- .title {
- margin-bottom: 16px;
- color: @heading-color;
- font-weight: 500;
- font-size: 24px;
- line-height: 32px;
- }
-
- .description {
- margin-bottom: 24px;
- color: @text-color-secondary;
- font-size: 14px;
- line-height: 22px;
- }
-
- .extra {
- padding: 24px 40px;
- text-align: left;
- background: #fafafa;
- border-radius: @border-radius-sm;
-
- @media screen and (max-width: @screen-xs) {
- padding: 18px 20px;
- }
- }
-
- .actions {
- margin-top: 32px;
-
- button:not(:last-child) {
- margin-right: 8px;
- }
- }
-}
diff --git a/admin-web/src/components/Result/index.md b/admin-web/src/components/Result/index.md
deleted file mode 100644
index 05e1c0e2f..000000000
--- a/admin-web/src/components/Result/index.md
+++ /dev/null
@@ -1,18 +0,0 @@
----
-title: Result
-subtitle: 处理结果
-cols: 1
-order: 12
----
-
-结果页用于对用户进行的一系列任务处理结果进行反馈。
-
-## API
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| type | 类型,不同类型自带对应的图标 | Enum {'success', 'error'} | - |
-| title | 标题 | ReactNode | - |
-| description | 结果描述 | ReactNode | - |
-| extra | 补充信息,有默认的灰色背景 | ReactNode | - |
-| actions | 操作建议,推荐放置跳转链接,按钮组等 | ReactNode | - |
diff --git a/admin-web/src/components/SelectLang/index.js b/admin-web/src/components/SelectLang/index.js
deleted file mode 100644
index f6abe2f27..000000000
--- a/admin-web/src/components/SelectLang/index.js
+++ /dev/null
@@ -1,49 +0,0 @@
-import React, { PureComponent } from 'react';
-import { formatMessage, setLocale, getLocale } from 'umi/locale';
-import { Menu, Icon } from 'antd';
-import classNames from 'classnames';
-import HeaderDropdown from '../HeaderDropdown';
-import styles from './index.less';
-
-export default class SelectLang extends PureComponent {
- changeLang = ({ key }) => {
- setLocale(key);
- };
-
- render() {
- const { className } = this.props;
- const selectedLang = getLocale();
- const locales = ['zh-CN', 'zh-TW', 'en-US', 'pt-BR'];
- const languageLabels = {
- 'zh-CN': '简体中文',
- 'zh-TW': '繁体中文',
- 'en-US': 'English',
- 'pt-BR': 'Português',
- };
- const languageIcons = {
- 'zh-CN': '🇨🇳',
- 'zh-TW': '🇭🇰',
- 'en-US': '🇬🇧',
- 'pt-BR': '🇧🇷',
- };
- const langMenu = (
-
- );
- return (
-
-
-
-
-
- );
- }
-}
diff --git a/admin-web/src/components/SelectLang/index.less b/admin-web/src/components/SelectLang/index.less
deleted file mode 100644
index 9f41ade9a..000000000
--- a/admin-web/src/components/SelectLang/index.less
+++ /dev/null
@@ -1,24 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.menu {
- :global(.anticon) {
- margin-right: 8px;
- }
- :global(.ant-dropdown-menu-item) {
- min-width: 160px;
- }
-}
-
-.dropDown {
- line-height: @layout-header-height;
- vertical-align: top;
- cursor: pointer;
- > i {
- font-size: 16px !important;
- transform: none !important;
- svg {
- position: relative;
- top: -1px;
- }
- }
-}
diff --git a/admin-web/src/components/SettingDrawer/BlockCheckbox.js b/admin-web/src/components/SettingDrawer/BlockCheckbox.js
deleted file mode 100644
index 49af42c73..000000000
--- a/admin-web/src/components/SettingDrawer/BlockCheckbox.js
+++ /dev/null
@@ -1,25 +0,0 @@
-import React from 'react';
-import { Tooltip, Icon } from 'antd';
-import style from './index.less';
-
-const BlockChecbox = ({ value, onChange, list }) => (
-
- {list.map(item => (
-
- onChange(item.key)}>
-
-
-
-
-
-
- ))}
-
-);
-
-export default BlockChecbox;
diff --git a/admin-web/src/components/SettingDrawer/ThemeColor.js b/admin-web/src/components/SettingDrawer/ThemeColor.js
deleted file mode 100644
index e5d66d4be..000000000
--- a/admin-web/src/components/SettingDrawer/ThemeColor.js
+++ /dev/null
@@ -1,74 +0,0 @@
-import React from 'react';
-import { Tooltip, Icon } from 'antd';
-import { formatMessage } from 'umi/locale';
-import styles from './ThemeColor.less';
-
-const Tag = ({ color, check, ...rest }) => (
-
- {check ? : ''}
-
-);
-
-const ThemeColor = ({ colors, title, value, onChange }) => {
- let colorList = colors;
- if (!colors) {
- colorList = [
- {
- key: 'dust',
- color: '#F5222D',
- },
- {
- key: 'volcano',
- color: '#FA541C',
- },
- {
- key: 'sunset',
- color: '#FAAD14',
- },
- {
- key: 'cyan',
- color: '#13C2C2',
- },
- {
- key: 'green',
- color: '#52C41A',
- },
- {
- key: 'daybreak',
- color: '#1890FF',
- },
- {
- key: 'geekblue',
- color: '#2F54EB',
- },
- {
- key: 'purple',
- color: '#722ED1',
- },
- ];
- }
- return (
-
-
{title}
-
- {colorList.map(({ key, color }) => (
-
- onChange && onChange(color)}
- />
-
- ))}
-
-
- );
-};
-
-export default ThemeColor;
diff --git a/admin-web/src/components/SettingDrawer/ThemeColor.less b/admin-web/src/components/SettingDrawer/ThemeColor.less
deleted file mode 100644
index 52e63beac..000000000
--- a/admin-web/src/components/SettingDrawer/ThemeColor.less
+++ /dev/null
@@ -1,21 +0,0 @@
-.themeColor {
- margin-top: 24px;
- overflow: hidden;
- .title {
- margin-bottom: 12px;
- color: rgba(0, 0, 0, 0.65);
- font-size: 14px;
- line-height: 22px;
- }
- .colorBlock {
- float: left;
- width: 20px;
- height: 20px;
- margin-right: 8px;
- color: #fff;
- font-weight: bold;
- text-align: center;
- border-radius: 2px;
- cursor: pointer;
- }
-}
diff --git a/admin-web/src/components/SettingDrawer/index.js b/admin-web/src/components/SettingDrawer/index.js
deleted file mode 100644
index cdb28aa3c..000000000
--- a/admin-web/src/components/SettingDrawer/index.js
+++ /dev/null
@@ -1,253 +0,0 @@
-import React, { PureComponent } from 'react';
-import { Select, message, Drawer, List, Switch, Divider, Icon, Button, Alert, Tooltip } from 'antd';
-import { formatMessage } from 'umi/locale';
-import { CopyToClipboard } from 'react-copy-to-clipboard';
-import { connect } from 'dva';
-import omit from 'omit.js';
-import styles from './index.less';
-import ThemeColor from './ThemeColor';
-import BlockCheckbox from './BlockCheckbox';
-
-const { Option } = Select;
-
-const Body = ({ children, title, style }) => (
-
-
{title}
- {children}
-
-);
-
-@connect(({ setting }) => ({ setting }))
-class SettingDrawer extends PureComponent {
- state = {
- collapse: false,
- };
-
- getLayoutSetting = () => {
- const {
- setting: { contentWidth, fixedHeader, layout, autoHideHeader, fixSiderbar },
- } = this.props;
- return [
- {
- title: formatMessage({ id: 'app.setting.content-width' }),
- action: (
-
- ),
- },
- {
- title: formatMessage({ id: 'app.setting.fixedheader' }),
- action: (
- this.changeSetting('fixedHeader', checked)}
- />
- ),
- },
- {
- title: formatMessage({ id: 'app.setting.hideheader' }),
- disabled: !fixedHeader,
- disabledReason: formatMessage({ id: 'app.setting.hideheader.hint' }),
- action: (
- this.changeSetting('autoHideHeader', checked)}
- />
- ),
- },
- {
- title: formatMessage({ id: 'app.setting.fixedsidebar' }),
- disabled: layout === 'topmenu',
- disabledReason: formatMessage({ id: 'app.setting.fixedsidebar.hint' }),
- action: (
- this.changeSetting('fixSiderbar', checked)}
- />
- ),
- },
- ];
- };
-
- changeSetting = (key, value) => {
- const { setting } = this.props;
- const nextState = { ...setting };
- nextState[key] = value;
- if (key === 'layout') {
- nextState.contentWidth = value === 'topmenu' ? 'Fixed' : 'Fluid';
- } else if (key === 'fixedHeader' && !value) {
- nextState.autoHideHeader = false;
- }
- this.setState(nextState, () => {
- const { dispatch } = this.props;
- dispatch({
- type: 'setting/changeSetting',
- payload: this.state,
- });
- });
- };
-
- togglerContent = () => {
- const { collapse } = this.state;
- this.setState({ collapse: !collapse });
- };
-
- renderLayoutSettingItem = item => {
- const action = React.cloneElement(item.action, {
- disabled: item.disabled,
- });
- return (
-
-
- {item.title}
-
-
- );
- };
-
- render() {
- const { setting } = this.props;
- const { navTheme, primaryColor, layout, colorWeak } = setting;
- const { collapse } = this.state;
- return (
-
-
-
- }
- style={{
- zIndex: 999,
- }}
- >
-
-
-
this.changeSetting('navTheme', value)}
- />
-
-
- this.changeSetting('primaryColor', color)}
- />
-
-
-
-
- this.changeSetting('layout', value)}
- />
-
-
-
-
-
-
-
- this.changeSetting('colorWeak', checked)}
- />,
- ]}
- >
- {formatMessage({ id: 'app.setting.weakmode' })}
-
-
-
- message.success(formatMessage({ id: 'app.setting.copyinfo' }))}
- >
-
-
-
- {formatMessage({ id: 'app.setting.production.hint' })}{' '}
-
- src/defaultSettings.js
-
-
- }
- />
-
-
- );
- }
-}
-
-export default SettingDrawer;
diff --git a/admin-web/src/components/SettingDrawer/index.less b/admin-web/src/components/SettingDrawer/index.less
deleted file mode 100644
index 4ee941c0e..000000000
--- a/admin-web/src/components/SettingDrawer/index.less
+++ /dev/null
@@ -1,74 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.content {
- position: relative;
- min-height: 100%;
- background: #fff;
-}
-
-.blockChecbox {
- display: flex;
- .item {
- position: relative;
- margin-right: 16px;
- // box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
- border-radius: @border-radius-base;
- cursor: pointer;
- img {
- width: 48px;
- }
- }
- .selectIcon {
- position: absolute;
- top: 0;
- right: 0;
- width: 100%;
- height: 100%;
- padding-top: 15px;
- padding-left: 24px;
- color: @primary-color;
- font-weight: bold;
- font-size: 14px;
- }
-}
-
-.color_block {
- display: inline-block;
- width: 38px;
- height: 22px;
- margin: 4px;
- margin-right: 12px;
- vertical-align: middle;
- border-radius: 4px;
- cursor: pointer;
-}
-
-.title {
- margin-bottom: 12px;
- color: @heading-color;
- font-size: 14px;
- line-height: 22px;
-}
-
-.handle {
- position: absolute;
- top: 240px;
- right: 300px;
- z-index: 0;
- display: flex;
- justify-content: center;
- align-items: center;
- width: 48px;
- height: 48px;
- font-size: 16px;
- text-align: center;
- background: @primary-color;
- border-radius: 4px 0 0 4px;
- cursor: pointer;
- pointer-events: auto;
-}
-
-.productionHint {
- margin-top: 16px;
- font-size: 12px;
-}
diff --git a/admin-web/src/components/SiderMenu/BaseMenu.js b/admin-web/src/components/SiderMenu/BaseMenu.js
deleted file mode 100644
index 407d529a1..000000000
--- a/admin-web/src/components/SiderMenu/BaseMenu.js
+++ /dev/null
@@ -1,166 +0,0 @@
-import React, { PureComponent } from 'react';
-import classNames from 'classnames';
-import { Menu, Icon } from 'antd';
-import Link from 'umi/link';
-import { urlToList } from '../_utils/pathTools';
-import { getMenuMatches } from './SiderMenuUtils';
-import { isUrl } from '@/utils/utils';
-import styles from './index.less';
-import IconFont from '@/components/IconFont';
-
-const { SubMenu } = Menu;
-
-// Allow menu.js config icon as string or ReactNode
-// icon: 'setting',
-// icon: 'icon-geren' #For Iconfont ,
-// icon: 'http://demo.com/icon.png',
-// icon: ,
-const getIcon = icon => {
- if (typeof icon === 'string') {
- if (isUrl(icon)) {
- return } />;
- }
- if (icon.startsWith('icon-')) {
- return ;
- }
- return ;
- }
- return icon;
-};
-
-export default class BaseMenu extends PureComponent {
- /**
- * 获得菜单子节点
- * @memberof SiderMenu
- */
- getNavMenuItems = (menusData, parent) => {
- if (!menusData) {
- return [];
- }
- return menusData
- .filter(item => item.name && !item.hideInMenu)
- .map(item => this.getSubMenuOrItem(item, parent))
- .filter(item => item);
- };
-
- // Get the currently selected menu
- getSelectedMenuKeys = pathname => {
- const { flatMenuKeys } = this.props;
- return urlToList(pathname).map(itemPath => getMenuMatches(flatMenuKeys, itemPath).pop());
- };
-
- /**
- * get SubMenu or Item
- */
- getSubMenuOrItem = item => {
- // doc: add hideChildrenInMenu
- if (item.children && !item.hideChildrenInMenu && item.children.some(child => child.name)) {
- const { name } = item;
- return (
-
- {getIcon(item.icon)}
- {name}
-
- ) : (
- name
- )
- }
- key={item.path}
- >
- {this.getNavMenuItems(item.children)}
-
- );
- }
- return {this.getMenuItemPath(item)};
- };
-
- /**
- * 判断是否是http链接.返回 Link 或 a
- * Judge whether it is http link.return a or Link
- * @memberof SiderMenu
- */
- getMenuItemPath = item => {
- const { name } = item;
- const itemPath = this.conversionPath(item.path);
- const icon = getIcon(item.icon);
- const { target } = item;
- // Is it a http link
- if (/^https?:\/\//.test(itemPath)) {
- return (
-
- {icon}
- {name}
-
- );
- }
- const { location, isMobile, onCollapse } = this.props;
- return (
- {
- onCollapsetrue;
- }
- : undefined
- }
- >
- {icon}
- {name}
-
- );
- };
-
- conversionPath = path => {
- if (path && path.indexOf('http') === 0) {
- return path;
- }
- return `/${path || ''}`.replace(/\/+/g, '/');
- };
-
- render() {
- const {
- openKeys,
- theme,
- mode,
- location: { pathname },
- className,
- collapsed,
- } = this.props;
- // if pathname can't match, use the nearest parent's key
- let selectedKeys = this.getSelectedMenuKeys(pathname);
- if (!selectedKeys.length && openKeys) {
- selectedKeys = [openKeys[openKeys.length - 1]];
- }
- let props = {};
- if (openKeys && !collapsed) {
- props = {
- openKeys: openKeys.length === 0 ? [...selectedKeys] : openKeys,
- };
- }
- const { handleOpenChange, style, menuData } = this.props;
- const cls = classNames(className, {
- 'top-nav-menu': mode === 'horizontal',
- });
-
- return (
-
- );
- }
-}
diff --git a/admin-web/src/components/SiderMenu/SiderMenu.js b/admin-web/src/components/SiderMenu/SiderMenu.js
deleted file mode 100644
index da9520faa..000000000
--- a/admin-web/src/components/SiderMenu/SiderMenu.js
+++ /dev/null
@@ -1,99 +0,0 @@
-import React, { PureComponent, Suspense } from 'react';
-import { Layout } from 'antd';
-import classNames from 'classnames';
-import Link from 'umi/link';
-import styles from './index.less';
-import PageLoading from '../PageLoading';
-import { getDefaultCollapsedSubMenus } from './SiderMenuUtils';
-import { title } from '../../defaultSettings';
-
-const BaseMenu = React.lazy(() => import('./BaseMenu'));
-const { Sider } = Layout;
-
-let firstMount = true;
-
-export default class SiderMenu extends PureComponent {
- constructor(props) {
- super(props);
- this.state = {
- openKeys: getDefaultCollapsedSubMenus(props),
- };
- }
-
- componentDidMount() {
- firstMount = false;
- }
-
- static getDerivedStateFromProps(props, state) {
- const { pathname, flatMenuKeysLen } = state;
- if (props.location.pathname !== pathname || props.flatMenuKeys.length !== flatMenuKeysLen) {
- return {
- pathname: props.location.pathname,
- flatMenuKeysLen: props.flatMenuKeys.length,
- openKeys: getDefaultCollapsedSubMenus(props),
- };
- }
- return null;
- }
-
- isMainMenu = key => {
- const { menuData } = this.props;
- return menuData.some(item => {
- if (key) {
- return item.key === key || item.path === key;
- }
- return false;
- });
- };
-
- handleOpenChange = openKeys => {
- const moreThanOne = openKeys.filter(openKey => this.isMainMenu(openKey)).length > 1;
- this.setState({
- openKeys: moreThanOne ? [openKeys.pop()] : [...openKeys],
- });
- };
-
- render() {
- const { logo, collapsed, onCollapse, fixSiderbar, theme, isMobile } = this.props;
- const { openKeys } = this.state;
- const defaultProps = collapsed ? {} : { openKeys };
-
- const siderClassName = classNames(styles.sider, {
- [styles.fixSiderBar]: fixSiderbar,
- [styles.light]: theme === 'light',
- });
- return (
- {
- if (firstMount || !isMobile) {
- onCollapse(collapse);
- }
- }}
- width={256}
- theme={theme}
- className={siderClassName}
- >
-
-
-
-
{title}
-
-
- }>
-
-
-
- );
- }
-}
diff --git a/admin-web/src/components/SiderMenu/SiderMenu.test.js b/admin-web/src/components/SiderMenu/SiderMenu.test.js
deleted file mode 100644
index 3d280da08..000000000
--- a/admin-web/src/components/SiderMenu/SiderMenu.test.js
+++ /dev/null
@@ -1,39 +0,0 @@
-import { getFlatMenuKeys } from './SiderMenuUtils';
-
-const menu = [
- {
- path: '/dashboard',
- children: [
- {
- path: '/dashboard/name',
- },
- ],
- },
- {
- path: '/userinfo',
- children: [
- {
- path: '/userinfo/:id',
- children: [
- {
- path: '/userinfo/:id/info',
- },
- ],
- },
- ],
- },
-];
-
-const flatMenuKeys = getFlatMenuKeys(menu);
-
-describe('test convert nested menu to flat menu', () => {
- it('simple menu', () => {
- expect(flatMenuKeys).toEqual([
- '/dashboard',
- '/dashboard/name',
- '/userinfo',
- '/userinfo/:id',
- '/userinfo/:id/info',
- ]);
- });
-});
diff --git a/admin-web/src/components/SiderMenu/SiderMenuUtils.js b/admin-web/src/components/SiderMenu/SiderMenuUtils.js
deleted file mode 100644
index 6e04ec134..000000000
--- a/admin-web/src/components/SiderMenu/SiderMenuUtils.js
+++ /dev/null
@@ -1,40 +0,0 @@
-import pathToRegexp from 'path-to-regexp';
-import { urlToList } from '../_utils/pathTools';
-
-/**
- * Recursively flatten the data
- * [{path:string},{path:string}] => {path,path2}
- * @param menus
- */
-export const getFlatMenuKeys = menuData => {
- let keys = [];
- menuData.forEach(item => {
- keys.push(item.path);
- if (item.children) {
- keys = keys.concat(getFlatMenuKeys(item.children));
- }
- });
- return keys;
-};
-
-export const getMenuMatches = (flatMenuKeys, path) =>
- flatMenuKeys.filter(item => {
- if (item) {
- return pathToRegexp(item).test(path);
- }
- return false;
- });
-/**
- * 获得菜单子节点
- * @memberof SiderMenu
- */
-export const getDefaultCollapsedSubMenus = props => {
- const {
- location: { pathname },
- flatMenuKeys,
- } = props;
- return urlToList(pathname)
- .map(item => getMenuMatches(flatMenuKeys, item)[0])
- .filter(item => item)
- .reduce((acc, curr) => [...acc, curr], ['/']);
-};
diff --git a/admin-web/src/components/SiderMenu/index.js b/admin-web/src/components/SiderMenu/index.js
deleted file mode 100644
index 58ce4b457..000000000
--- a/admin-web/src/components/SiderMenu/index.js
+++ /dev/null
@@ -1,27 +0,0 @@
-import React from 'react';
-import { Drawer } from 'antd';
-import SiderMenu from './SiderMenu';
-import { getFlatMenuKeys } from './SiderMenuUtils';
-
-const SiderMenuWrapper = React.memo(props => {
- const { isMobile, menuData, collapsed, onCollapse } = props;
- const flatMenuKeys = getFlatMenuKeys(menuData);
-
- return isMobile ? (
- onCollapse(true)}
- style={{
- padding: 0,
- height: '100vh',
- }}
- >
-
-
- ) : (
-
- );
-});
-
-export default SiderMenuWrapper;
diff --git a/admin-web/src/components/SiderMenu/index.less b/admin-web/src/components/SiderMenu/index.less
deleted file mode 100644
index 88722c87e..000000000
--- a/admin-web/src/components/SiderMenu/index.less
+++ /dev/null
@@ -1,105 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-@nav-header-height: @layout-header-height;
-
-.logo {
- position: relative;
- height: @nav-header-height;
- padding-left: (@menu-collapsed-width - 32px) / 2;
- overflow: hidden;
- line-height: @nav-header-height;
- background: #002140;
- transition: all 0.3s;
- img {
- display: inline-block;
- height: 32px;
- vertical-align: middle;
- }
- h1 {
- display: inline-block;
- margin: 0 0 0 12px;
- color: white;
- font-weight: 600;
- font-size: 20px;
- font-family: Avenir, 'Helvetica Neue', Arial, Helvetica, sans-serif;
- vertical-align: middle;
- }
-}
-.sider {
- position: relative;
- z-index: 10;
- min-height: 100vh;
- box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
- &.fixSiderBar {
- position: fixed;
- top: 0;
- left: 0;
- box-shadow: 2px 0 8px 0 rgba(29, 35, 41, 0.05);
- :global {
- .ant-menu-root {
- height: ~'calc(100vh - @{nav-header-height})';
- overflow-y: auto;
- }
- .ant-menu-inline {
- border-right: 0;
- .ant-menu-item,
- .ant-menu-submenu-title {
- width: 100%;
- }
- }
- }
- }
- &.light {
- background-color: white;
- box-shadow: 2px 0 8px 0 rgba(29, 35, 41, 0.05);
- .logo {
- background: white;
- box-shadow: 1px 1px 0 0 @border-color-split;
- h1 {
- color: @primary-color;
- }
- }
- :global(.ant-menu-light) {
- border-right-color: transparent;
- }
- }
-}
-
-.icon {
- width: 14px;
- vertical-align: baseline;
-}
-
-:global {
- .top-nav-menu li.ant-menu-item {
- height: @nav-header-height;
- line-height: @nav-header-height;
- }
- .drawer .drawer-content {
- background: #001529;
- }
- .ant-menu-inline-collapsed {
- & > .ant-menu-item .sider-menu-item-img + span,
- &
- > .ant-menu-item-group
- > .ant-menu-item-group-list
- > .ant-menu-item
- .sider-menu-item-img
- + span,
- & > .ant-menu-submenu > .ant-menu-submenu-title .sider-menu-item-img + span {
- display: inline-block;
- max-width: 0;
- opacity: 0;
- }
- }
- .ant-menu-item .sider-menu-item-img + span,
- .ant-menu-submenu-title .sider-menu-item-img + span {
- opacity: 1;
- transition: opacity 0.3s @ease-in-out, width 0.3s @ease-in-out;
- }
- .ant-drawer-left {
- .ant-drawer-body {
- padding: 0;
- }
- }
-}
diff --git a/admin-web/src/components/StandardFormRow/index.js b/admin-web/src/components/StandardFormRow/index.js
deleted file mode 100644
index 8cb0e444e..000000000
--- a/admin-web/src/components/StandardFormRow/index.js
+++ /dev/null
@@ -1,24 +0,0 @@
-import React from 'react';
-import classNames from 'classnames';
-import styles from './index.less';
-
-const StandardFormRow = ({ title, children, last, block, grid, ...rest }) => {
- const cls = classNames(styles.standardFormRow, {
- [styles.standardFormRowBlock]: block,
- [styles.standardFormRowLast]: last,
- [styles.standardFormRowGrid]: grid,
- });
-
- return (
-
- {title && (
-
- {title}
-
- )}
-
{children}
-
- );
-};
-
-export default StandardFormRow;
diff --git a/admin-web/src/components/StandardFormRow/index.less b/admin-web/src/components/StandardFormRow/index.less
deleted file mode 100644
index 042723336..000000000
--- a/admin-web/src/components/StandardFormRow/index.less
+++ /dev/null
@@ -1,72 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.standardFormRow {
- display: flex;
- margin-bottom: 16px;
- padding-bottom: 16px;
- border-bottom: 1px dashed @border-color-split;
- :global {
- .ant-form-item {
- margin-right: 24px;
- }
- .ant-form-item-label label {
- margin-right: 0;
- color: @text-color;
- }
- .ant-form-item-label,
- .ant-form-item-control {
- padding: 0;
- line-height: 32px;
- }
- }
- .label {
- flex: 0 0 auto;
- margin-right: 24px;
- color: @heading-color;
- font-size: @font-size-base;
- text-align: right;
- & > span {
- display: inline-block;
- height: 32px;
- line-height: 32px;
- &::after {
- content: ':';
- }
- }
- }
- .content {
- flex: 1 1 0;
- :global {
- .ant-form-item:last-child {
- margin-right: 0;
- }
- }
- }
-}
-
-.standardFormRowLast {
- margin-bottom: 0;
- padding-bottom: 0;
- border: none;
-}
-
-.standardFormRowBlock {
- :global {
- .ant-form-item,
- div.ant-form-item-control-wrapper {
- display: block;
- }
- }
-}
-
-.standardFormRowGrid {
- :global {
- .ant-form-item,
- div.ant-form-item-control-wrapper {
- display: block;
- }
- .ant-form-item-label {
- float: left;
- }
- }
-}
diff --git a/admin-web/src/components/StandardTable/index.js b/admin-web/src/components/StandardTable/index.js
deleted file mode 100644
index c0c17251e..000000000
--- a/admin-web/src/components/StandardTable/index.js
+++ /dev/null
@@ -1,121 +0,0 @@
-import React, { PureComponent, Fragment } from 'react';
-import { Table, Alert } from 'antd';
-import styles from './index.less';
-
-function initTotalList(columns) {
- const totalList = [];
- columns.forEach(column => {
- if (column.needTotal) {
- totalList.push({ ...column, total: 0 });
- }
- });
- return totalList;
-}
-
-class StandardTable extends PureComponent {
- constructor(props) {
- super(props);
- const { columns } = props;
- const needTotalList = initTotalList(columns);
-
- this.state = {
- selectedRowKeys: [],
- needTotalList,
- };
- }
-
- static getDerivedStateFromProps(nextProps) {
- // clean state
- if (nextProps.selectedRows.length === 0) {
- const needTotalList = initTotalList(nextProps.columns);
- return {
- selectedRowKeys: [],
- needTotalList,
- };
- }
- return null;
- }
-
- handleRowSelectChange = (selectedRowKeys, selectedRows) => {
- let { needTotalList } = this.state;
- needTotalList = needTotalList.map(item => ({
- ...item,
- total: selectedRows.reduce((sum, val) => sum + parseFloat(val[item.dataIndex], 10), 0),
- }));
- const { onSelectRow } = this.props;
- if (onSelectRow) {
- onSelectRow(selectedRows);
- }
-
- this.setState({ selectedRowKeys, needTotalList });
- };
-
- handleTableChange = (pagination, filters, sorter) => {
- const { onChange } = this.props;
- if (onChange) {
- onChange(pagination, filters, sorter);
- }
- };
-
- cleanSelectedKeys = () => {
- this.handleRowSelectChange([], []);
- };
-
- render() {
- const { selectedRowKeys, needTotalList } = this.state;
- const { data = {}, rowKey, ...rest } = this.props;
- const { list = [], pagination } = data;
-
- const paginationProps = {
- showSizeChanger: true,
- showQuickJumper: true,
- ...pagination,
- };
-
- const rowSelection = {
- selectedRowKeys,
- onChange: this.handleRowSelectChange,
- getCheckboxProps: record => ({
- disabled: record.disabled,
- }),
- };
-
- return (
-
-
-
- 已选择 {selectedRowKeys.length} 项
- {needTotalList.map(item => (
-
- {item.title}
- 总计
-
- {item.render ? item.render(item.total) : item.total}
-
-
- ))}
-
- 清空
-
-
- }
- type="info"
- showIcon
- />
-
-
-
- );
- }
-}
-
-export default StandardTable;
diff --git a/admin-web/src/components/StandardTable/index.less b/admin-web/src/components/StandardTable/index.less
deleted file mode 100644
index 817be991f..000000000
--- a/admin-web/src/components/StandardTable/index.less
+++ /dev/null
@@ -1,13 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.standardTable {
- :global {
- .ant-table-pagination {
- margin-top: 24px;
- }
- }
-
- .tableAlert {
- margin-bottom: 16px;
- }
-}
diff --git a/admin-web/src/components/TagSelect/TagSelectOption.d.ts b/admin-web/src/components/TagSelect/TagSelectOption.d.ts
deleted file mode 100644
index 366b297a7..000000000
--- a/admin-web/src/components/TagSelect/TagSelectOption.d.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import * as React from 'react';
-
-export interface ITagSelectOptionProps {
- value: string | number;
- style?: React.CSSProperties;
-}
-
-export default class TagSelectOption extends React.Component {}
diff --git a/admin-web/src/components/TagSelect/demo/controlled.md b/admin-web/src/components/TagSelect/demo/controlled.md
deleted file mode 100644
index 4e9defa78..000000000
--- a/admin-web/src/components/TagSelect/demo/controlled.md
+++ /dev/null
@@ -1,50 +0,0 @@
----
-order: 3
-title: 受控模式
----
-
-结合 `Tag` 的 `TagSelect` 组件,方便的应用于筛选类目的业务场景中。
-
-```jsx
-import { Button } from 'antd';
-import TagSelect from 'ant-design-pro/lib/TagSelect';
-
-class Demo extends React.Component {
- state = {
- value: ['cat1'],
- };
- handleFormSubmit = value => {
- this.setState({
- value,
- });
- };
- checkAll = () => {
- this.setState({
- value: ['cat1', 'cat2', 'cat3', 'cat4', 'cat5', 'cat6'],
- });
- };
- render() {
- return (
-
-
-
-
- 类目一
- 类目二
- 类目三
- 类目四
- 类目五
- 类目六
-
-
-
- );
- }
-}
-
-ReactDOM.render(, mountNode);
-```
diff --git a/admin-web/src/components/TagSelect/demo/expandable.md b/admin-web/src/components/TagSelect/demo/expandable.md
deleted file mode 100644
index c45a30a34..000000000
--- a/admin-web/src/components/TagSelect/demo/expandable.md
+++ /dev/null
@@ -1,31 +0,0 @@
----
-order: 1
-title: 可展开和收起
----
-
-使用 `expandable` 属性,让标签组可以收起,避免过高。
-
-````jsx
-import TagSelect from 'ant-design-pro/lib/TagSelect';
-
-function handleFormSubmit(checkedValue) {
- console.log(checkedValue);
-}
-
-ReactDOM.render(
-
- 类目一
- 类目二
- 类目三
- 类目四
- 类目五
- 类目六
- 类目七
- 类目八
- 类目九
- 类目十
- 类目十一
- 类目十二
-
-, mountNode);
-````
diff --git a/admin-web/src/components/TagSelect/demo/simple.md b/admin-web/src/components/TagSelect/demo/simple.md
deleted file mode 100644
index 9e7a13a49..000000000
--- a/admin-web/src/components/TagSelect/demo/simple.md
+++ /dev/null
@@ -1,25 +0,0 @@
----
-order: 0
-title: 基础样例
----
-
-结合 `Tag` 的 `TagSelect` 组件,方便的应用于筛选类目的业务场景中。
-
-````jsx
-import TagSelect from 'ant-design-pro/lib/TagSelect';
-
-function handleFormSubmit(checkedValue) {
- console.log(checkedValue);
-}
-
-ReactDOM.render(
-
- 类目一
- 类目二
- 类目三
- 类目四
- 类目五
- 类目六
-
-, mountNode);
-````
diff --git a/admin-web/src/components/TagSelect/index.d.ts b/admin-web/src/components/TagSelect/index.d.ts
deleted file mode 100644
index 9de30263f..000000000
--- a/admin-web/src/components/TagSelect/index.d.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import * as React from 'react';
-import TagSelectOption from './TagSelectOption';
-
-export interface ITagSelectProps {
- onChange?: (value: string[]) => void;
- expandable?: boolean;
- value?: string[] | number[];
- style?: React.CSSProperties;
- hideCheckAll?: boolean;
- actionsText?: { expandText?: string; collapseText?: string; selectAllText?: string };
-}
-
-export default class TagSelect extends React.Component {
- public static Option: typeof TagSelectOption;
- private children:
- | React.ReactElement
- | Array>;
-}
diff --git a/admin-web/src/components/TagSelect/index.js b/admin-web/src/components/TagSelect/index.js
deleted file mode 100644
index 6d0394dd3..000000000
--- a/admin-web/src/components/TagSelect/index.js
+++ /dev/null
@@ -1,143 +0,0 @@
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import classNames from 'classnames';
-import { Tag, Icon } from 'antd';
-
-import styles from './index.less';
-
-const { CheckableTag } = Tag;
-
-const TagSelectOption = ({ children, checked, onChange, value }) => (
- onChange(value, state)}>
- {children}
-
-);
-
-TagSelectOption.isTagSelectOption = true;
-
-class TagSelect extends Component {
- static propTypes = {
- actionsText: PropTypes.object,
- hideCheckAll: PropTypes.bool,
- };
-
- static defaultProps = {
- hideCheckAll: false,
- actionsText: {
- expandText: 'Expand',
- collapseText: 'Collapse',
- selectAllText: 'All',
- },
- };
-
- constructor(props) {
- super(props);
- this.state = {
- expand: false,
- value: props.value || props.defaultValue || [],
- };
- }
-
- static getDerivedStateFromProps(nextProps) {
- if ('value' in nextProps) {
- return { value: nextProps.value || [] };
- }
- return null;
- }
-
- onChange = value => {
- const { onChange } = this.props;
- if (!('value' in this.props)) {
- this.setState({ value });
- }
- if (onChange) {
- onChange(value);
- }
- };
-
- onSelectAll = checked => {
- let checkedTags = [];
- if (checked) {
- checkedTags = this.getAllTags();
- }
- this.onChange(checkedTags);
- };
-
- getAllTags() {
- let { children } = this.props;
- children = React.Children.toArray(children);
- const checkedTags = children
- .filter(child => this.isTagSelectOption(child))
- .map(child => child.props.value);
- return checkedTags || [];
- }
-
- handleTagChange = (value, checked) => {
- const { value: StateValue } = this.state;
- const checkedTags = [...StateValue];
-
- const index = checkedTags.indexOf(value);
- if (checked && index === -1) {
- checkedTags.push(value);
- } else if (!checked && index > -1) {
- checkedTags.splice(index, 1);
- }
- this.onChange(checkedTags);
- };
-
- handleExpand = () => {
- const { expand } = this.state;
- this.setState({
- expand: !expand,
- });
- };
-
- isTagSelectOption = node =>
- node &&
- node.type &&
- (node.type.isTagSelectOption || node.type.displayName === 'TagSelectOption');
-
- render() {
- const { value, expand } = this.state;
- const { children, hideCheckAll, className, style, expandable, actionsText } = this.props;
- const checkedAll = this.getAllTags().length === value.length;
- const { expandText = 'Expand', collapseText = 'Collapse', selectAllText = 'All' } =
- actionsText === null ? {} : actionsText;
-
- const cls = classNames(styles.tagSelect, className, {
- [styles.hasExpandTag]: expandable,
- [styles.expanded]: expand,
- });
-
- return (
-
- {hideCheckAll ? null : (
-
- {selectAllText}
-
- )}
- {value &&
- React.Children.map(children, child => {
- if (this.isTagSelectOption(child)) {
- return React.cloneElement(child, {
- key: `tag-select-${child.props.value}`,
- value: child.props.value,
- checked: value.indexOf(child.props.value) > -1,
- onChange: this.handleTagChange,
- });
- }
- return child;
- })}
- {expandable && (
-
- {expand ? collapseText : expandText}
-
- )}
-
- );
- }
-}
-
-TagSelect.Option = TagSelectOption;
-
-export default TagSelect;
diff --git a/admin-web/src/components/TagSelect/index.less b/admin-web/src/components/TagSelect/index.less
deleted file mode 100644
index 936946531..000000000
--- a/admin-web/src/components/TagSelect/index.less
+++ /dev/null
@@ -1,33 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.tagSelect {
- position: relative;
- max-height: 32px;
- margin-left: -8px;
- overflow: hidden;
- line-height: 32px;
- transition: all 0.3s;
- user-select: none;
- :global {
- .ant-tag {
- margin-right: 24px;
- padding: 0 8px;
- font-size: @font-size-base;
- }
- }
- &.expanded {
- max-height: 200px;
- transition: all 0.3s;
- }
- .trigger {
- position: absolute;
- top: 0;
- right: 0;
- i {
- font-size: 12px;
- }
- }
- &.hasExpandTag {
- padding-right: 50px;
- }
-}
diff --git a/admin-web/src/components/TagSelect/index.md b/admin-web/src/components/TagSelect/index.md
deleted file mode 100644
index 8d21de7b7..000000000
--- a/admin-web/src/components/TagSelect/index.md
+++ /dev/null
@@ -1,27 +0,0 @@
----
-title: TagSelect
-subtitle: 标签选择器
-cols: 1
-order: 13
----
-
-可进行多选,带折叠收起和展开更多功能,常用于对列表进行筛选。
-
-## API
-
-### TagSelect
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| value |选中的项 |string[] \| number[] | |
-| defaultValue |默认选中的项 |string[] \| number[] | |
-| onChange | 标签选择的回调函数 | Function(checkedTags) | |
-| expandable | 是否展示 `展开/收起` 按钮 | Boolean | false |
-| hideCheckAll | 隐藏 `全部` 按钮 | Boolean | false |
-
-### TagSelectOption
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| value | TagSelect的值 | string\| number | - |
-| children | tag的内容 | string \| ReactNode | - |
diff --git a/admin-web/src/components/TopNavHeader/index.js b/admin-web/src/components/TopNavHeader/index.js
deleted file mode 100644
index 2d0e06561..000000000
--- a/admin-web/src/components/TopNavHeader/index.js
+++ /dev/null
@@ -1,52 +0,0 @@
-import React, { PureComponent } from 'react';
-import Link from 'umi/link';
-import RightContent from '../GlobalHeader/RightContent';
-import BaseMenu from '../SiderMenu/BaseMenu';
-import { getFlatMenuKeys } from '../SiderMenu/SiderMenuUtils';
-import styles from './index.less';
-import { title } from '../../defaultSettings';
-
-export default class TopNavHeader extends PureComponent {
- state = {
- maxWidth: undefined,
- };
-
- static getDerivedStateFromProps(props) {
- return {
- maxWidth: (props.contentWidth === 'Fixed' ? 1200 : window.innerWidth) - 280 - 165 - 40,
- };
- }
-
- render() {
- const { theme, contentWidth, menuData, logo } = this.props;
- const { maxWidth } = this.state;
- const flatMenuKeys = getFlatMenuKeys(menuData);
- return (
-
-
{
- this.maim = ref;
- }}
- className={`${styles.main} ${contentWidth === 'Fixed' ? styles.wide : ''}`}
- >
-
-
-
-
-
{title}
-
-
-
-
-
-
-
-
-
- );
- }
-}
diff --git a/admin-web/src/components/TopNavHeader/index.less b/admin-web/src/components/TopNavHeader/index.less
deleted file mode 100644
index aad3d74e2..000000000
--- a/admin-web/src/components/TopNavHeader/index.less
+++ /dev/null
@@ -1,72 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.head {
- position: relative;
- width: 100%;
- height: @layout-header-height;
- box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
- transition: background 0.3s, width 0.2s;
- :global {
- .ant-menu-submenu.ant-menu-submenu-horizontal {
- height: 100%;
- line-height: @layout-header-height;
- .ant-menu-submenu-title {
- height: 100%;
- }
- }
- }
- &.light {
- background-color: #fff;
- }
- .main {
- display: flex;
- height: @layout-header-height;
- padding-left: 24px;
- &.wide {
- max-width: 1200px;
- margin: auto;
- padding-left: 0;
- }
- .left {
- display: flex;
- flex: 1;
- }
- .right {
- width: 324px;
- }
- }
-}
-
-.logo {
- position: relative;
- width: 165px;
- height: @layout-header-height;
- overflow: hidden;
- line-height: @layout-header-height;
- transition: all 0.3s;
- img {
- display: inline-block;
- height: 32px;
- vertical-align: middle;
- }
- h1 {
- display: inline-block;
- margin: 0 0 0 12px;
- color: #fff;
- font-weight: 400;
- font-size: 16px;
- vertical-align: top;
- }
-}
-
-.light {
- h1 {
- color: #002140;
- }
-}
-
-.menu {
- height: @layout-header-height;
- line-height: @layout-header-height;
- border: none;
-}
diff --git a/admin-web/src/components/Trend/demo/basic.md b/admin-web/src/components/Trend/demo/basic.md
deleted file mode 100644
index da771dc2f..000000000
--- a/admin-web/src/components/Trend/demo/basic.md
+++ /dev/null
@@ -1,17 +0,0 @@
----
-order: 0
-title: 演示
----
-
-在数值背后添加一个小图标来标识涨跌情况。
-
-```jsx
-import Trend from 'ant-design-pro/lib/Trend';
-
-ReactDOM.render(
-
- 12%
- 11%
-
-, mountNode);
-```
diff --git a/admin-web/src/components/Trend/demo/reverse.md b/admin-web/src/components/Trend/demo/reverse.md
deleted file mode 100644
index 26f736672..000000000
--- a/admin-web/src/components/Trend/demo/reverse.md
+++ /dev/null
@@ -1,17 +0,0 @@
----
-order: 0
-title: 颜色反转
----
-
-在数值背后添加一个小图标来标识涨跌情况。
-
-```jsx
-import Trend from 'ant-design-pro/lib/Trend';
-
-ReactDOM.render(
-
- 12%
- 11%
-
-, mountNode);
-```
diff --git a/admin-web/src/components/Trend/index.d.ts b/admin-web/src/components/Trend/index.d.ts
deleted file mode 100644
index 7dc020103..000000000
--- a/admin-web/src/components/Trend/index.d.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import * as React from 'react';
-
-export interface ITrendProps {
- colorful?: boolean;
- flag: 'up' | 'down';
- style?: React.CSSProperties;
- reverseColor?: boolean;
-}
-
-export default class Trend extends React.Component {}
diff --git a/admin-web/src/components/Trend/index.js b/admin-web/src/components/Trend/index.js
deleted file mode 100644
index c476ef62c..000000000
--- a/admin-web/src/components/Trend/index.js
+++ /dev/null
@@ -1,27 +0,0 @@
-import React from 'react';
-import { Icon } from 'antd';
-import classNames from 'classnames';
-import styles from './index.less';
-
-const Trend = ({ colorful = true, reverseColor = false, flag, children, className, ...rest }) => {
- const classString = classNames(
- styles.trendItem,
- {
- [styles.trendItemGrey]: !colorful,
- [styles.reverseColor]: reverseColor && colorful,
- },
- className
- );
- return (
-
- {children}
- {flag && (
-
-
-
- )}
-
- );
-};
-
-export default Trend;
diff --git a/admin-web/src/components/Trend/index.less b/admin-web/src/components/Trend/index.less
deleted file mode 100644
index 13618838a..000000000
--- a/admin-web/src/components/Trend/index.less
+++ /dev/null
@@ -1,37 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.trendItem {
- display: inline-block;
- font-size: @font-size-base;
- line-height: 22px;
-
- .up,
- .down {
- position: relative;
- top: 1px;
- margin-left: 4px;
- i {
- font-size: 12px;
- transform: scale(0.83);
- }
- }
- .up {
- color: @red-6;
- }
- .down {
- top: -1px;
- color: @green-6;
- }
-
- &.trendItemGrey .up,
- &.trendItemGrey .down {
- color: @text-color;
- }
-
- &.reverseColor .up {
- color: @green-6;
- }
- &.reverseColor .down {
- color: @red-6;
- }
-}
diff --git a/admin-web/src/components/Trend/index.md b/admin-web/src/components/Trend/index.md
deleted file mode 100644
index 96d83b853..000000000
--- a/admin-web/src/components/Trend/index.md
+++ /dev/null
@@ -1,20 +0,0 @@
----
-title: Trend
-subtitle: 趋势标记
-cols: 1
-order: 14
----
-
-趋势符号,标记上升和下降趋势。通常用绿色代表“好”,红色代表“不好”,股票涨跌场景除外。
-
-## API
-
-```html
-50%
-```
-
-| 参数 | 说明 | 类型 | 默认值 |
-|----------|------------------------------------------|-------------|-------|
-| colorful | 是否彩色标记 | Boolean | true |
-| flag | 上升下降标识:`up|down` | string | - |
-| reverseColor | 颜色反转 | Boolean | false |
diff --git a/admin-web/src/components/_utils/pathTools.js b/admin-web/src/components/_utils/pathTools.js
deleted file mode 100644
index bfb94e74e..000000000
--- a/admin-web/src/components/_utils/pathTools.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// /userinfo/2144/id => ['/userinfo','/useinfo/2144,'/userindo/2144/id']
-// eslint-disable-next-line import/prefer-default-export
-export function urlToList(url) {
- const urllist = url.split('/').filter(i => i);
- return urllist.map((urlItem, index) => `/${urllist.slice(0, index + 1).join('/')}`);
-}
diff --git a/admin-web/src/components/_utils/pathTools.test.js b/admin-web/src/components/_utils/pathTools.test.js
deleted file mode 100644
index a9b931551..000000000
--- a/admin-web/src/components/_utils/pathTools.test.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import { urlToList } from './pathTools';
-
-describe('test urlToList', () => {
- it('A path', () => {
- expect(urlToList('/userinfo')).toEqual(['/userinfo']);
- });
- it('Secondary path', () => {
- expect(urlToList('/userinfo/2144')).toEqual(['/userinfo', '/userinfo/2144']);
- });
- it('Three paths', () => {
- expect(urlToList('/userinfo/2144/addr')).toEqual([
- '/userinfo',
- '/userinfo/2144',
- '/userinfo/2144/addr',
- ]);
- });
-});
diff --git a/admin-web/src/defaultSettings.js b/admin-web/src/defaultSettings.js
deleted file mode 100644
index 5a3dc1b2e..000000000
--- a/admin-web/src/defaultSettings.js
+++ /dev/null
@@ -1,18 +0,0 @@
-module.exports = {
- navTheme: 'dark', // theme for nav menu
- primaryColor: '#1890FF', // primary color of ant design
- layout: 'sidemenu', // nav menu position: sidemenu or topmenu
- contentWidth: 'Fluid', // layout of content: Fluid or Fixed, only works when layout is topmenu
- fixedHeader: false, // sticky header
- autoHideHeader: false, // auto hide header
- fixSiderbar: false, // sticky siderbar
- menu: {
- disableLocal: false,
- },
- title: '一个商城管理平台',
- pwa: true,
- // your iconfont Symbol Scrip Url
- // eg://at.alicdn.com/t/font_1039637_btcrd5co4w.js
- // 注意:如果需要图标多色,Iconfont图标项目里要进行批量去色处理
- iconfontUrl: '',
-};
diff --git a/admin-web/src/e2e/baseLayout.e2e.js b/admin-web/src/e2e/baseLayout.e2e.js
deleted file mode 100644
index 74938719d..000000000
--- a/admin-web/src/e2e/baseLayout.e2e.js
+++ /dev/null
@@ -1,34 +0,0 @@
-import RouterConfig from '../../config/router.config';
-
-const BASE_URL = `http://localhost:${process.env.PORT || 8000}`;
-
-function formatter(data) {
- return data
- .reduce((pre, item) => {
- pre.push(item.path);
- return pre;
- }, [])
- .filter(item => item);
-}
-
-describe('Homepage', async () => {
- const testPage = path => async () => {
- await page.goto(`${BASE_URL}${path}`);
- await page.waitForSelector('footer', {
- timeout: 2000,
- });
- const haveFooter = await page.evaluate(
- () => document.getElementsByTagName('footer').length > 0
- );
- expect(haveFooter).toBeTruthy();
- };
-
- beforeAll(async () => {
- jest.setTimeout(1000000);
- await page.setCacheEnabled(false);
- });
- const routers = formatter(RouterConfig[1].routes);
- routers.forEach(route => {
- it(`test pages ${route}`, testPage(route));
- });
-});
diff --git a/admin-web/src/e2e/home.e2e.js b/admin-web/src/e2e/home.e2e.js
deleted file mode 100644
index 0531d5f4b..000000000
--- a/admin-web/src/e2e/home.e2e.js
+++ /dev/null
@@ -1,15 +0,0 @@
-const BASE_URL = `http://localhost:${process.env.PORT || 8000}`;
-
-describe('Homepage', () => {
- beforeAll(async () => {
- jest.setTimeout(1000000);
- });
- it('it should have logo text', async () => {
- await page.goto(BASE_URL);
- await page.waitForSelector('h1', {
- timeout: 5000,
- });
- const text = await page.evaluate(() => document.getElementsByTagName('h1')[0].innerText);
- expect(text).toContain('Ant Design Pro');
- });
-});
diff --git a/admin-web/src/e2e/login.e2e.js b/admin-web/src/e2e/login.e2e.js
deleted file mode 100644
index b991af44b..000000000
--- a/admin-web/src/e2e/login.e2e.js
+++ /dev/null
@@ -1,34 +0,0 @@
-const BASE_URL = `http://localhost:${process.env.PORT || 8000}`;
-
-describe('Login', () => {
- beforeAll(async () => {
- jest.setTimeout(1000000);
- });
-
- beforeEach(async () => {
- await page.goto(`${BASE_URL}/user/login`, { waitUntil: 'networkidle2' });
- await page.evaluate(() => window.localStorage.setItem('antd-pro-authority', 'guest'));
- });
-
- it('should login with failure', async () => {
- await page.waitForSelector('#userName', {
- timeout: 2000,
- });
- await page.type('#userName', 'mockuser');
- await page.type('#password', 'wrong_password');
- await page.click('button[type="submit"]');
- await page.waitForSelector('.ant-alert-error'); // should display error
- });
-
- it('should login successfully', async () => {
- await page.waitForSelector('#userName', {
- timeout: 2000,
- });
- await page.type('#userName', 'admin');
- await page.type('#password', 'ant.design');
- await page.click('button[type="submit"]');
- await page.waitForSelector('.ant-layout-sider h1'); // should display error
- const text = await page.evaluate(() => document.body.innerHTML);
- expect(text).toContain('Ant Design Pro
');
- });
-});
diff --git a/admin-web/src/e2e/topMenu.e2e.js b/admin-web/src/e2e/topMenu.e2e.js
deleted file mode 100644
index 51ff9f35c..000000000
--- a/admin-web/src/e2e/topMenu.e2e.js
+++ /dev/null
@@ -1,18 +0,0 @@
-const BASE_URL = `http://localhost:${process.env.PORT || 8000}`;
-
-describe('Homepage', () => {
- beforeAll(async () => {
- jest.setTimeout(1000000);
- });
- it('topmenu should have footer', async () => {
- const params = '/form/basic-form?navTheme=light&layout=topmenu';
- await page.goto(`${BASE_URL}${params}`);
- await page.waitForSelector('footer', {
- timeout: 2000,
- });
- const haveFooter = await page.evaluate(
- () => document.getElementsByTagName('footer').length > 0
- );
- expect(haveFooter).toBeTruthy();
- });
-});
diff --git a/admin-web/src/e2e/userLayout.e2e.js b/admin-web/src/e2e/userLayout.e2e.js
deleted file mode 100644
index a2edfc7b8..000000000
--- a/admin-web/src/e2e/userLayout.e2e.js
+++ /dev/null
@@ -1,32 +0,0 @@
-import RouterConfig from '../../config/router.config';
-
-const BASE_URL = `http://localhost:${process.env.PORT || 8000}`;
-
-function formatter(data) {
- return data
- .reduce((pre, item) => {
- pre.push(item.path);
- return pre;
- }, [])
- .filter(item => item);
-}
-
-describe('Homepage', () => {
- const testPage = path => async () => {
- await page.goto(`${BASE_URL}${path}`);
- await page.waitForSelector('footer', {
- timeout: 2000,
- });
- const haveFooter = await page.evaluate(
- () => document.getElementsByTagName('footer').length > 0
- );
- expect(haveFooter).toBeTruthy();
- };
-
- beforeAll(async () => {
- jest.setTimeout(1000000);
- });
- formatter(RouterConfig[0].routes).forEach(route => {
- it(`test pages ${route}`, testPage(route));
- });
-});
diff --git a/admin-web/src/global.js b/admin-web/src/global.js
deleted file mode 100644
index bebe4829c..000000000
--- a/admin-web/src/global.js
+++ /dev/null
@@ -1,61 +0,0 @@
-import React from 'react';
-import { notification, Button, message } from 'antd';
-import { formatMessage } from 'umi/locale';
-import defaultSettings from './defaultSettings';
-
-window.React = React;
-
-const { pwa } = defaultSettings;
-// if pwa is true
-if (pwa) {
- // Notify user if offline now
- window.addEventListener('sw.offline', () => {
- message.warning(formatMessage({ id: 'app.pwa.offline' }));
- });
-
- // Pop up a prompt on the page asking the user if they want to use the latest version
- window.addEventListener('sw.updated', e => {
- const reloadSW = async () => {
- // Check if there is sw whose state is waiting in ServiceWorkerRegistration
- // https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration
- const worker = e.detail && e.detail.waiting;
- if (!worker) {
- return Promise.resolve();
- }
- // Send skip-waiting event to waiting SW with MessageChannel
- await new Promise((resolve, reject) => {
- const channel = new MessageChannel();
- channel.port1.onmessage = event => {
- if (event.data.error) {
- reject(event.data.error);
- } else {
- resolve(event.data);
- }
- };
- worker.postMessage({ type: 'skip-waiting' }, [channel.port2]);
- });
- // Refresh current page to use the updated HTML and other assets after SW has skiped waiting
- window.location.reload(true);
- return true;
- };
- const key = `open${Date.now()}`;
- const btn = (
-
- );
- notification.open({
- message: formatMessage({ id: 'app.pwa.serviceworker.updated' }),
- description: formatMessage({ id: 'app.pwa.serviceworker.updated.hint' }),
- btn,
- key,
- onClose: async () => {},
- });
- });
-}
diff --git a/admin-web/src/global.less b/admin-web/src/global.less
deleted file mode 100644
index 1450ba46b..000000000
--- a/admin-web/src/global.less
+++ /dev/null
@@ -1,52 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-html,
-body,
-#root {
- height: 100%;
-}
-
-.colorWeak {
- filter: invert(80%);
-}
-
-.ant-layout {
- min-height: 100vh;
-}
-
-canvas {
- display: block;
-}
-
-body {
- text-rendering: optimizeLegibility;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-}
-
-.globalSpin {
- width: 100%;
- margin: 40px 0 !important;
-}
-
-ul,
-ol {
- list-style: none;
-}
-
-@media (max-width: @screen-xs) {
- .ant-table {
- width: 100%;
- overflow-x: auto;
- &-thead > tr,
- &-tbody > tr {
- > th,
- > td {
- white-space: pre;
- > span {
- display: block;
- }
- }
- }
- }
-}
diff --git a/admin-web/src/layouts/BasicLayout.js b/admin-web/src/layouts/BasicLayout.js
deleted file mode 100644
index 574788052..000000000
--- a/admin-web/src/layouts/BasicLayout.js
+++ /dev/null
@@ -1,233 +0,0 @@
-import React, { Suspense } from 'react';
-import { Layout } from 'antd';
-import DocumentTitle from 'react-document-title';
-import { connect } from 'dva';
-import { ContainerQuery } from 'react-container-query';
-import classNames from 'classnames';
-import pathToRegexp from 'path-to-regexp';
-import Media from 'react-media';
-import Authorized from '@/utils/Authorized';
-import logo from '../assets/logo.svg';
-import Footer from './Footer';
-import Header from './Header';
-import Context from './MenuContext';
-import UrlsContext from './UrlsContext';
-import Exception403 from '../pages/Exception/403';
-import PageLoading from '@/components/PageLoading';
-import SiderMenu from '@/components/SiderMenu';
-import getPageTitle from '@/utils/getPageTitle';
-import DictionaryContext from '@/components/Dictionary/DictionaryContext';
-import styles from './BasicLayout.less';
-
-// lazy load SettingDrawer
-const SettingDrawer = React.lazy(() => import('@/components/SettingDrawer'));
-
-const { Content } = Layout;
-
-const query = {
- 'screen-xs': {
- maxWidth: 575,
- },
- 'screen-sm': {
- minWidth: 576,
- maxWidth: 767,
- },
- 'screen-md': {
- minWidth: 768,
- maxWidth: 991,
- },
- 'screen-lg': {
- minWidth: 992,
- maxWidth: 1199,
- },
- 'screen-xl': {
- minWidth: 1200,
- maxWidth: 1599,
- },
- 'screen-xxl': {
- minWidth: 1600,
- },
-};
-
-class BasicLayout extends React.Component {
- componentDidMount() {
- const {
- dispatch,
- route: { routes, authority },
- } = this.props;
- dispatch({
- type: 'user/fetchCurrent',
- });
- dispatch({
- type: 'setting/getSetting',
- });
- dispatch({
- type: 'menu/getUrlsData',
- payload: { routes, authority },
- });
- dispatch({
- type: 'menu/getMenuData',
- payload: { routes, authority },
- });
- dispatch({
- type: 'dictionaryContext/tree',
- payload: {},
- });
- }
-
- getContext() {
- const { location, breadcrumbNameMap } = this.props;
- return {
- location,
- breadcrumbNameMap,
- };
- }
-
- getUrlsContext() {
- const { urlsData } = this.props;
- return {
- urls: {
- ...urlsData,
- },
- };
- }
-
- getDictionaryContext() {
- const { dicTreeMap } = this.props;
- return dicTreeMap;
- }
-
- getRouteAuthority = (pathname, routeData) => {
- const routes = routeData.slice(); // clone
-
- const getAuthority = (routeDatas, path) => {
- let authorities;
- routeDatas.forEach(route => {
- // check partial route
- if (pathToRegexp(`${route.path}(.*)`).test(path)) {
- if (route.authority) {
- authorities = route.authority;
- }
- // is exact route?
- if (!pathToRegexp(route.path).test(path) && route.routes) {
- authorities = getAuthority(route.routes, path);
- }
- }
- });
- return authorities;
- };
-
- return getAuthority(routes, pathname);
- };
-
- getLayoutStyle = () => {
- const { fixSiderbar, isMobile, collapsed, layout } = this.props;
- if (fixSiderbar && layout !== 'topmenu' && !isMobile) {
- return {
- paddingLeft: collapsed ? '80px' : '256px',
- };
- }
- return null;
- };
-
- handleMenuCollapse = collapsed => {
- const { dispatch } = this.props;
- dispatch({
- type: 'global/changeLayoutCollapsed',
- payload: collapsed,
- });
- };
-
- renderSettingDrawer = () => {
- // Do not render SettingDrawer in production
- // unless it is deployed in preview.pro.ant.design as demo
- if (process.env.NODE_ENV === 'production' && APP_TYPE !== 'site') {
- return null;
- }
- return ;
- };
-
- render() {
- const {
- navTheme,
- layout: PropsLayout,
- children,
- location: { pathname },
- isMobile,
- menuData,
- breadcrumbNameMap,
- route: { routes },
- fixedHeader,
- } = this.props;
-
- const isTop = PropsLayout === 'topmenu';
- const routerConfig = this.getRouteAuthority(pathname, routes);
- const contentStyle = !fixedHeader ? { paddingTop: 0 } : {};
- const layout = (
-
- {isTop && !isMobile ? null : (
-
- )}
-
-
-
- }>
- {children}
-
-
-
-
-
- );
- return (
-
-
-
- {params => (
-
-
-
- {layout}
-
-
-
- )}
-
-
- }>{this.renderSettingDrawer()}
-
- );
- }
-}
-
-export default connect(({ global, setting, dictionaryContext, menu: menuModel }) => ({
- collapsed: global.collapsed,
- layout: setting.layout,
- menuData: menuModel.menuData,
- urlsData: menuModel.urlsData,
- breadcrumbNameMap: menuModel.breadcrumbNameMap,
- dicTreeMap: dictionaryContext.dicTreeMap,
- ...setting,
-}))(props => (
-
- {isMobile => }
-
-));
diff --git a/admin-web/src/layouts/BasicLayout.less b/admin-web/src/layouts/BasicLayout.less
deleted file mode 100644
index 60beb6092..000000000
--- a/admin-web/src/layouts/BasicLayout.less
+++ /dev/null
@@ -1,6 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.content {
- margin: 24px;
- padding-top: @layout-header-height;
-}
diff --git a/admin-web/src/layouts/BlankLayout.js b/admin-web/src/layouts/BlankLayout.js
deleted file mode 100644
index ef39aa4c2..000000000
--- a/admin-web/src/layouts/BlankLayout.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import React from 'react';
-
-export default ({ children }) => {children}
;
diff --git a/admin-web/src/layouts/Footer.js b/admin-web/src/layouts/Footer.js
deleted file mode 100644
index 693c81721..000000000
--- a/admin-web/src/layouts/Footer.js
+++ /dev/null
@@ -1,37 +0,0 @@
-import React, { Fragment } from 'react';
-import { Layout, Icon } from 'antd';
-import GlobalFooter from '@/components/GlobalFooter';
-
-const { Footer } = Layout;
-const FooterView = () => (
-
-);
-export default FooterView;
diff --git a/admin-web/src/layouts/Header.js b/admin-web/src/layouts/Header.js
deleted file mode 100644
index 0059ee7ea..000000000
--- a/admin-web/src/layouts/Header.js
+++ /dev/null
@@ -1,161 +0,0 @@
-import React, { Component } from 'react';
-import { formatMessage } from 'umi/locale';
-import { Layout, message } from 'antd';
-import Animate from 'rc-animate';
-import { connect } from 'dva';
-import router from 'umi/router';
-import GlobalHeader from '@/components/GlobalHeader';
-import TopNavHeader from '@/components/TopNavHeader';
-import styles from './Header.less';
-
-const { Header } = Layout;
-
-class HeaderView extends Component {
- state = {
- visible: true,
- };
-
- static getDerivedStateFromProps(props, state) {
- if (!props.autoHideHeader && !state.visible) {
- return {
- visible: true,
- };
- }
- return null;
- }
-
- componentDidMount() {
- document.addEventListener('scroll', this.handScroll, { passive: true });
- }
-
- componentWillUnmount() {
- document.removeEventListener('scroll', this.handScroll);
- }
-
- getHeadWidth = () => {
- const { isMobile, collapsed, setting } = this.props;
- const { fixedHeader, layout } = setting;
- if (isMobile || !fixedHeader || layout === 'topmenu') {
- return '100%';
- }
- return collapsed ? 'calc(100% - 80px)' : 'calc(100% - 256px)';
- };
-
- handleNoticeClear = type => {
- message.success(
- `${formatMessage({ id: 'component.noticeIcon.cleared' })} ${formatMessage({
- id: `component.globalHeader.${type}`,
- })}`
- );
- const { dispatch } = this.props;
- dispatch({
- type: 'global/clearNotices',
- payload: type,
- });
- };
-
- handleMenuClick = ({ key }) => {
- const { dispatch } = this.props;
- if (key === 'userCenter') {
- router.push('/account/center');
- return;
- }
- if (key === 'triggerError') {
- router.push('/exception/trigger');
- return;
- }
- if (key === 'userinfo') {
- router.push('/account/settings/base');
- return;
- }
- if (key === 'logout') {
- dispatch({
- type: 'login/logout',
- });
- }
- };
-
- handleNoticeVisibleChange = visible => {
- if (visible) {
- const { dispatch } = this.props;
- dispatch({
- type: 'global/fetchNotices',
- });
- }
- };
-
- handScroll = () => {
- const { autoHideHeader } = this.props;
- const { visible } = this.state;
- if (!autoHideHeader) {
- return;
- }
- const scrollTop = document.body.scrollTop + document.documentElement.scrollTop;
- if (!this.ticking) {
- this.ticking = true;
- requestAnimationFrame(() => {
- if (this.oldScrollTop > scrollTop) {
- this.setState({
- visible: true,
- });
- } else if (scrollTop > 300 && visible) {
- this.setState({
- visible: false,
- });
- } else if (scrollTop < 300 && !visible) {
- this.setState({
- visible: true,
- });
- }
- this.oldScrollTop = scrollTop;
- this.ticking = false;
- });
- }
- };
-
- render() {
- const { isMobile, handleMenuCollapse, setting } = this.props;
- const { navTheme, layout, fixedHeader } = setting;
- const { visible } = this.state;
- const isTop = layout === 'topmenu';
- const width = this.getHeadWidth();
- const HeaderDom = visible ? (
-
- {isTop && !isMobile ? (
-
- ) : (
-
- )}
-
- ) : null;
- return (
-
- {HeaderDom}
-
- );
- }
-}
-
-export default connect(({ user, global, setting, loading }) => ({
- currentUser: user.currentUser,
- collapsed: global.collapsed,
- fetchingMoreNotices: loading.effects['global/fetchMoreNotices'],
- fetchingNotices: loading.effects['global/fetchNotices'],
- loadedAllNotices: global.loadedAllNotices,
- notices: global.notices,
- setting,
-}))(HeaderView);
diff --git a/admin-web/src/layouts/Header.less b/admin-web/src/layouts/Header.less
deleted file mode 100644
index cc2da9629..000000000
--- a/admin-web/src/layouts/Header.less
+++ /dev/null
@@ -1,8 +0,0 @@
-.fixedHeader {
- position: fixed;
- top: 0;
- right: 0;
- z-index: 9;
- width: 100%;
- transition: width 0.2s;
-}
diff --git a/admin-web/src/layouts/MenuContext.js b/admin-web/src/layouts/MenuContext.js
deleted file mode 100644
index 860f10686..000000000
--- a/admin-web/src/layouts/MenuContext.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import { createContext } from 'react';
-
-export default createContext();
diff --git a/admin-web/src/layouts/UrlsContext.js b/admin-web/src/layouts/UrlsContext.js
deleted file mode 100644
index 860f10686..000000000
--- a/admin-web/src/layouts/UrlsContext.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import { createContext } from 'react';
-
-export default createContext();
diff --git a/admin-web/src/layouts/UserLayout.js b/admin-web/src/layouts/UserLayout.js
deleted file mode 100644
index c1250f42b..000000000
--- a/admin-web/src/layouts/UserLayout.js
+++ /dev/null
@@ -1,81 +0,0 @@
-import React, { Component, Fragment } from 'react';
-import { formatMessage } from 'umi/locale';
-import { connect } from 'dva';
-import Link from 'umi/link';
-import { Icon } from 'antd';
-import GlobalFooter from '@/components/GlobalFooter';
-import DocumentTitle from 'react-document-title';
-import SelectLang from '@/components/SelectLang';
-import styles from './UserLayout.less';
-import logo from '../assets/logo.svg';
-import getPageTitle from '@/utils/getPageTitle';
-
-const links = [
- {
- key: 'help',
- title: formatMessage({ id: 'layout.user.link.help' }),
- href: '',
- },
- {
- key: 'privacy',
- title: formatMessage({ id: 'layout.user.link.privacy' }),
- href: '',
- },
- {
- key: 'terms',
- title: formatMessage({ id: 'layout.user.link.terms' }),
- href: '',
- },
-];
-
-const copyright = (
- 请使用谷歌浏览器(Chrome)获取最佳用户体验
-);
-
-class UserLayout extends Component {
- componentDidMount() {
- // const {
- // dispatch,
- // route: { routes, authority },
- // } = this.props;
- // dispatch({
- // type: 'menu/getMenuData',
- // payload: { routes, authority },
- // });
- }
-
- render() {
- const {
- children,
- location: { pathname },
- breadcrumbNameMap,
- } = this.props;
- return (
-
-
-
-
-
-
-
-
-
-
-
一个商城管理平台
-
-
- {/*
TODO....
*/}
-
- {children}
-
-
-
-
- );
- }
-}
-
-export default connect(({ menu: menuModel }) => ({
- menuData: menuModel.menuData,
- breadcrumbNameMap: menuModel.breadcrumbNameMap,
-}))(UserLayout);
diff --git a/admin-web/src/layouts/UserLayout.less b/admin-web/src/layouts/UserLayout.less
deleted file mode 100644
index ba3d3235f..000000000
--- a/admin-web/src/layouts/UserLayout.less
+++ /dev/null
@@ -1,71 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.container {
- display: flex;
- flex-direction: column;
- height: 100vh;
- overflow: auto;
- background: @layout-body-background;
-}
-
-.lang {
- width: 100%;
- height: 40px;
- line-height: 44px;
- text-align: right;
- :global(.ant-dropdown-trigger) {
- margin-right: 24px;
- }
-}
-
-.content {
- flex: 1;
- padding: 32px 0;
-}
-
-@media (min-width: @screen-md-min) {
- .container {
- background-image: url('https://gw.alipayobjects.com/zos/rmsportal/TVYTbAXWheQpRcWDaDMu.svg');
- background-repeat: no-repeat;
- background-position: center 110px;
- background-size: 100%;
- }
-
- .content {
- padding: 32px 0 24px 0;
- }
-}
-
-.top {
- text-align: center;
-}
-
-.header {
- height: 44px;
- line-height: 44px;
- a {
- text-decoration: none;
- }
-}
-
-.logo {
- height: 44px;
- margin-right: 16px;
- vertical-align: top;
-}
-
-.title {
- position: relative;
- top: 2px;
- color: @heading-color;
- font-weight: 600;
- font-size: 33px;
- font-family: Avenir, 'Helvetica Neue', Arial, Helvetica, sans-serif;
-}
-
-.desc {
- margin-top: 12px;
- margin-bottom: 40px;
- color: @text-color-secondary;
- font-size: @font-size-base;
-}
diff --git a/admin-web/src/locales/en-US.js b/admin-web/src/locales/en-US.js
deleted file mode 100644
index 25f2888c5..000000000
--- a/admin-web/src/locales/en-US.js
+++ /dev/null
@@ -1,35 +0,0 @@
-import analysis from './en-US/analysis';
-import exception from './en-US/exception';
-import form from './en-US/form';
-import globalHeader from './en-US/globalHeader';
-import login from './en-US/login';
-import menu from './en-US/menu';
-import monitor from './en-US/monitor';
-import result from './en-US/result';
-import settingDrawer from './en-US/settingDrawer';
-import settings from './en-US/settings';
-import pwa from './en-US/pwa';
-import component from './en-US/component';
-
-export default {
- 'navBar.lang': 'Languages',
- 'layout.user.link.help': 'Help',
- 'layout.user.link.privacy': 'Privacy',
- 'layout.user.link.terms': 'Terms',
- 'app.home.introduce': 'introduce',
- 'app.forms.basic.title': 'Basic form',
- 'app.forms.basic.description':
- 'Form pages are used to collect or verify information to users, and basic forms are common in scenarios where there are fewer data items.',
- ...analysis,
- ...exception,
- ...form,
- ...globalHeader,
- ...login,
- ...menu,
- ...monitor,
- ...result,
- ...settingDrawer,
- ...settings,
- ...pwa,
- ...component,
-};
diff --git a/admin-web/src/locales/en-US/analysis.js b/admin-web/src/locales/en-US/analysis.js
deleted file mode 100644
index f3005dabd..000000000
--- a/admin-web/src/locales/en-US/analysis.js
+++ /dev/null
@@ -1,34 +0,0 @@
-export default {
- 'app.analysis.test': 'Gongzhuan No.{no} shop',
- 'app.analysis.introduce': 'Introduce',
- 'app.analysis.total-sales': 'Total Sales',
- 'app.analysis.day-sales': 'Daily Sales',
- 'app.analysis.visits': 'Visits',
- 'app.analysis.visits-trend': 'Visits Trend',
- 'app.analysis.visits-ranking': 'Visits Ranking',
- 'app.analysis.day-visits': 'Daily Visits',
- 'app.analysis.week': 'WoW Change',
- 'app.analysis.day': 'DoD Change',
- 'app.analysis.payments': 'Payments',
- 'app.analysis.conversion-rate': 'Conversion Rate',
- 'app.analysis.operational-effect': 'Operational Effect',
- 'app.analysis.sales-trend': 'Stores Sales Trend',
- 'app.analysis.sales-ranking': 'Sales Ranking',
- 'app.analysis.all-year': 'All Year',
- 'app.analysis.all-month': 'All Month',
- 'app.analysis.all-week': 'All Week',
- 'app.analysis.all-day': 'All day',
- 'app.analysis.search-users': 'Search Users',
- 'app.analysis.per-capita-search': 'Per Capita Search',
- 'app.analysis.online-top-search': 'Online Top Search',
- 'app.analysis.the-proportion-of-sales': 'The Proportion Of Sales',
- 'app.analysis.channel.all': 'ALL',
- 'app.analysis.channel.online': 'Online',
- 'app.analysis.channel.stores': 'Stores',
- 'app.analysis.sales': 'Sales',
- 'app.analysis.traffic': 'Traffic',
- 'app.analysis.table.rank': 'Rank',
- 'app.analysis.table.search-keyword': 'Keyword',
- 'app.analysis.table.users': 'Users',
- 'app.analysis.table.weekly-range': 'Weekly Range',
-};
diff --git a/admin-web/src/locales/en-US/component.js b/admin-web/src/locales/en-US/component.js
deleted file mode 100644
index 3ba7eeda6..000000000
--- a/admin-web/src/locales/en-US/component.js
+++ /dev/null
@@ -1,5 +0,0 @@
-export default {
- 'component.tagSelect.expand': 'Expand',
- 'component.tagSelect.collapse': 'Collapse',
- 'component.tagSelect.all': 'All',
-};
diff --git a/admin-web/src/locales/en-US/exception.js b/admin-web/src/locales/en-US/exception.js
deleted file mode 100644
index 5035552af..000000000
--- a/admin-web/src/locales/en-US/exception.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export default {
- 'app.exception.back': 'Back to home',
- 'app.exception.description.403': "Sorry, you don't have access to this page",
- 'app.exception.description.404': 'Sorry, the page you visited does not exist',
- 'app.exception.description.500': 'Sorry, the server is reporting an error',
-};
diff --git a/admin-web/src/locales/en-US/form.js b/admin-web/src/locales/en-US/form.js
deleted file mode 100644
index 36e088d3e..000000000
--- a/admin-web/src/locales/en-US/form.js
+++ /dev/null
@@ -1,38 +0,0 @@
-export default {
- 'form.get-captcha': 'Get Captcha',
- 'form.captcha.second': 'sec',
- 'form.optional': ' (optional) ',
- 'form.submit': 'Submit',
- 'form.save': 'Save',
- 'form.email.placeholder': 'Email',
- 'form.password.placeholder': 'Password',
- 'form.confirm-password.placeholder': 'Confirm password',
- 'form.phone-number.placeholder': 'Phone number',
- 'form.verification-code.placeholder': 'Verification code',
- 'form.title.label': 'Title',
- 'form.title.placeholder': 'Give the target a name',
- 'form.date.label': 'Start and end date',
- 'form.date.placeholder.start': 'Start date',
- 'form.date.placeholder.end': 'End date',
- 'form.goal.label': 'Goal description',
- 'form.goal.placeholder': 'Please enter your work goals',
- 'form.standard.label': 'Metrics',
- 'form.standard.placeholder': 'Please enter a metric',
- 'form.client.label': 'Client',
- 'form.client.label.tooltip': 'Target service object',
- 'form.client.placeholder':
- 'Please describe your customer service, internal customers directly @ Name / job number',
- 'form.invites.label': 'Inviting critics',
- 'form.invites.placeholder': 'Please direct @ Name / job number, you can invite up to 5 people',
- 'form.weight.label': 'Weight',
- 'form.weight.placeholder': 'Please enter weight',
- 'form.public.label': 'Target disclosure',
- 'form.public.label.help': 'Customers and invitees are shared by default',
- 'form.public.radio.public': 'Public',
- 'form.public.radio.partially-public': 'Partially public',
- 'form.public.radio.private': 'Private',
- 'form.publicUsers.placeholder': 'Open to',
- 'form.publicUsers.option.A': 'Colleague A',
- 'form.publicUsers.option.B': 'Colleague B',
- 'form.publicUsers.option.C': 'Colleague C',
-};
diff --git a/admin-web/src/locales/en-US/globalHeader.js b/admin-web/src/locales/en-US/globalHeader.js
deleted file mode 100644
index 29f21d7d2..000000000
--- a/admin-web/src/locales/en-US/globalHeader.js
+++ /dev/null
@@ -1,18 +0,0 @@
-export default {
- 'component.globalHeader.search': 'Search',
- 'component.globalHeader.search.example1': 'Search example 1',
- 'component.globalHeader.search.example2': 'Search example 2',
- 'component.globalHeader.search.example3': 'Search example 3',
- 'component.globalHeader.help': 'Help',
- 'component.globalHeader.notification': 'Notification',
- 'component.globalHeader.notification.empty': 'You have viewed all notifications.',
- 'component.globalHeader.message': 'Message',
- 'component.globalHeader.message.empty': 'You have viewed all messsages.',
- 'component.globalHeader.event': 'Event',
- 'component.globalHeader.event.empty': 'You have viewed all events.',
- 'component.noticeIcon.clear': 'Clear',
- 'component.noticeIcon.cleared': 'Cleared',
- 'component.noticeIcon.empty': 'No notifications',
- 'component.noticeIcon.loaded': 'Loaded',
- 'component.noticeIcon.loading-more': 'Loading more',
-};
diff --git a/admin-web/src/locales/en-US/login.js b/admin-web/src/locales/en-US/login.js
deleted file mode 100644
index 82c1c20f8..000000000
--- a/admin-web/src/locales/en-US/login.js
+++ /dev/null
@@ -1,39 +0,0 @@
-export default {
- 'app.login.userName': 'userName',
- 'app.login.password': 'password',
- 'app.login.message-invalid-credentials': 'Invalid username or password(admin/ant.design)',
- 'app.login.message-invalid-verification-code': 'Invalid verification code',
- 'app.login.tab-login-credentials': 'Credentials',
- 'app.login.tab-login-mobile': 'Mobile number',
- 'app.login.remember-me': 'Remember me',
- 'app.login.forgot-password': 'Forgot your password?',
- 'app.login.sign-in-with': 'Sign in with',
- 'app.login.signup': 'Sign up',
- 'app.login.login': 'Login',
- 'app.register.register': 'Register',
- 'app.register.get-verification-code': 'Get code',
- 'app.register.sign-in': 'Already have an account?',
- 'app.register-result.msg': 'Account:registered at {email}',
- 'app.register-result.activation-email':
- 'The activation email has been sent to your email address and is valid for 24 hours. Please log in to the email in time and click on the link in the email to activate the account.',
- 'app.register-result.back-home': 'Back to home',
- 'app.register-result.view-mailbox': 'View mailbox',
- 'validation.email.required': 'Please enter your email!',
- 'validation.email.wrong-format': 'The email address is in the wrong format!',
- 'validation.userName.required': 'Please enter your userName!',
- 'validation.password.required': 'Please enter your password!',
- 'validation.password.twice': 'The passwords entered twice do not match!',
- 'validation.password.strength.msg':
- "Please enter at least 6 characters and don't use passwords that are easy to guess.",
- 'validation.password.strength.strong': 'Strength: strong',
- 'validation.password.strength.medium': 'Strength: medium',
- 'validation.password.strength.short': 'Strength: too short',
- 'validation.confirm-password.required': 'Please confirm your password!',
- 'validation.phone-number.required': 'Please enter your phone number!',
- 'validation.phone-number.wrong-format': 'Malformed phone number!',
- 'validation.verification-code.required': 'Please enter the verification code!',
- 'validation.title.required': 'Please enter a title',
- 'validation.date.required': 'Please select the start and end date',
- 'validation.goal.required': 'Please enter a description of the goal',
- 'validation.standard.required': 'Please enter a metric',
-};
diff --git a/admin-web/src/locales/en-US/menu.js b/admin-web/src/locales/en-US/menu.js
deleted file mode 100644
index 056c255ec..000000000
--- a/admin-web/src/locales/en-US/menu.js
+++ /dev/null
@@ -1,41 +0,0 @@
-export default {
- 'menu.home': 'Home',
- 'menu.login': 'Login',
- 'menu.register': 'Register',
- 'menu.register.result': 'Register Result',
- 'menu.dashboard': 'Dashboard',
- 'menu.dashboard.analysis': 'Analysis',
- 'menu.dashboard.monitor': 'Monitor',
- 'menu.dashboard.workplace': 'Workplace',
- 'menu.form': 'Form',
- 'menu.form.basicform': 'Basic Form',
- 'menu.form.stepform': 'Step Form',
- 'menu.form.stepform.info': 'Step Form(write transfer information)',
- 'menu.form.stepform.confirm': 'Step Form(confirm transfer information)',
- 'menu.form.stepform.result': 'Step Form(finished)',
- 'menu.form.advancedform': 'Advanced Form',
- 'menu.list': 'List',
- 'menu.list.searchtable': 'Search Table',
- 'menu.list.basiclist': 'Basic List',
- 'menu.list.cardlist': 'Card List',
- 'menu.list.searchlist': 'Search List',
- 'menu.list.searchlist.articles': 'Search List(articles)',
- 'menu.list.searchlist.projects': 'Search List(projects)',
- 'menu.list.searchlist.applications': 'Search List(applications)',
- 'menu.profile': 'Profile',
- 'menu.profile.basic': 'Basic Profile',
- 'menu.profile.advanced': 'Advanced Profile',
- 'menu.result': 'Result',
- 'menu.result.success': 'Success',
- 'menu.result.fail': 'Fail',
- 'menu.exception': 'Exception',
- 'menu.exception.not-permission': '403',
- 'menu.exception.not-find': '404',
- 'menu.exception.server-error': '500',
- 'menu.exception.trigger': 'Trigger',
- 'menu.account': 'Account',
- 'menu.account.center': 'Account Center',
- 'menu.account.settings': 'Account Settings',
- 'menu.account.trigger': 'Trigger Error',
- 'menu.account.logout': 'Logout',
-};
diff --git a/admin-web/src/locales/en-US/monitor.js b/admin-web/src/locales/en-US/monitor.js
deleted file mode 100644
index dcb570552..000000000
--- a/admin-web/src/locales/en-US/monitor.js
+++ /dev/null
@@ -1,18 +0,0 @@
-export default {
- 'app.monitor.trading-activity': 'Real-Time Trading Activity',
- 'app.monitor.total-transactions': 'Total transactions today',
- 'app.monitor.sales-target': 'Sales target completion rate',
- 'app.monitor.remaining-time': 'Remaining time of activity',
- 'app.monitor.total-transactions-per-second': 'Total transactions per second',
- 'app.monitor.activity-forecast': 'Activity forecast',
- 'app.monitor.efficiency': 'Efficiency',
- 'app.monitor.ratio': 'Ratio',
- 'app.monitor.proportion-per-category': 'Proportion Per Category',
- 'app.monitor.fast-food': 'Fast food',
- 'app.monitor.western-food': 'Western food',
- 'app.monitor.hot-pot': 'Hot pot',
- 'app.monitor.waiting-for-implementation': 'Waiting for implementation',
- 'app.monitor.popular-searches': 'Popular Searches',
- 'app.monitor.resource-surplus': 'Resource Surplus',
- 'app.monitor.fund-surplus': 'Fund Surplus',
-};
diff --git a/admin-web/src/locales/en-US/pwa.js b/admin-web/src/locales/en-US/pwa.js
deleted file mode 100644
index ed8d199ea..000000000
--- a/admin-web/src/locales/en-US/pwa.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export default {
- 'app.pwa.offline': 'You are offline now',
- 'app.pwa.serviceworker.updated': 'New content is available',
- 'app.pwa.serviceworker.updated.hint': 'Please press the "Refresh" button to reload current page',
- 'app.pwa.serviceworker.updated.ok': 'Refresh',
-};
diff --git a/admin-web/src/locales/en-US/result.js b/admin-web/src/locales/en-US/result.js
deleted file mode 100644
index 23de8b7b7..000000000
--- a/admin-web/src/locales/en-US/result.js
+++ /dev/null
@@ -1,28 +0,0 @@
-export default {
- 'app.result.error.title': 'Submission Failed',
- 'app.result.error.description':
- 'Please check and modify the following information before resubmitting.',
- 'app.result.error.hint-title': 'The content you submitted has the following error:',
- 'app.result.error.hint-text1': 'Your account has been frozen',
- 'app.result.error.hint-btn1': 'Thaw immediately',
- 'app.result.error.hint-text2': 'Your account is not yet eligible to apply',
- 'app.result.error.hint-btn2': 'Upgrade immediately',
- 'app.result.error.btn-text': 'Return to modify',
- 'app.result.success.title': 'Submission Success',
- 'app.result.success.description':
- 'The submission results page is used to feed back the results of a series of operational tasks. If it is a simple operation, use the Message global prompt feedback. This text area can show a simple supplementary explanation. If there is a similar requirement for displaying “documents”, the following gray area can present more complicated content.',
- 'app.result.success.operate-title': 'Project Name',
- 'app.result.success.operate-id': 'Project ID:',
- 'app.result.success.principal': 'Principal:',
- 'app.result.success.operate-time': 'Effective time:',
- 'app.result.success.step1-title': 'Create project',
- 'app.result.success.step1-operator': 'Qu Lili',
- 'app.result.success.step2-title': 'Departmental preliminary review',
- 'app.result.success.step2-operator': 'Zhou Maomao',
- 'app.result.success.step2-extra': 'Urge',
- 'app.result.success.step3-title': 'Financial review',
- 'app.result.success.step4-title': 'Finish',
- 'app.result.success.btn-return': 'Back to list',
- 'app.result.success.btn-project': 'View project',
- 'app.result.success.btn-print': 'Print',
-};
diff --git a/admin-web/src/locales/en-US/settingDrawer.js b/admin-web/src/locales/en-US/settingDrawer.js
deleted file mode 100644
index a644905e7..000000000
--- a/admin-web/src/locales/en-US/settingDrawer.js
+++ /dev/null
@@ -1,31 +0,0 @@
-export default {
- 'app.setting.pagestyle': 'Page style setting',
- 'app.setting.pagestyle.dark': 'Dark style',
- 'app.setting.pagestyle.light': 'Light style',
- 'app.setting.content-width': 'Content Width',
- 'app.setting.content-width.fixed': 'Fixed',
- 'app.setting.content-width.fluid': 'Fluid',
- 'app.setting.themecolor': 'Theme Color',
- 'app.setting.themecolor.dust': 'Dust Red',
- 'app.setting.themecolor.volcano': 'Volcano',
- 'app.setting.themecolor.sunset': 'Sunset Orange',
- 'app.setting.themecolor.cyan': 'Cyan',
- 'app.setting.themecolor.green': 'Polar Green',
- 'app.setting.themecolor.daybreak': 'Daybreak Blue (default)',
- 'app.setting.themecolor.geekblue': 'Geek Glue',
- 'app.setting.themecolor.purple': 'Golden Purple',
- 'app.setting.navigationmode': 'Navigation Mode',
- 'app.setting.sidemenu': 'Side Menu Layout',
- 'app.setting.topmenu': 'Top Menu Layout',
- 'app.setting.fixedheader': 'Fixed Header',
- 'app.setting.fixedsidebar': 'Fixed Sidebar',
- 'app.setting.fixedsidebar.hint': 'Works on Side Menu Layout',
- 'app.setting.hideheader': 'Hidden Header when scrolling',
- 'app.setting.hideheader.hint': 'Works when Hidden Header is enabled',
- 'app.setting.othersettings': 'Other Settings',
- 'app.setting.weakmode': 'Weak Mode',
- 'app.setting.copy': 'Copy Setting',
- 'app.setting.copyinfo': 'copy success,please replace defaultSettings in src/models/setting.js',
- 'app.setting.production.hint':
- 'Setting panel shows in development environment only, please manually modify',
-};
diff --git a/admin-web/src/locales/en-US/settings.js b/admin-web/src/locales/en-US/settings.js
deleted file mode 100644
index 822dd003c..000000000
--- a/admin-web/src/locales/en-US/settings.js
+++ /dev/null
@@ -1,60 +0,0 @@
-export default {
- 'app.settings.menuMap.basic': 'Basic Settings',
- 'app.settings.menuMap.security': 'Security Settings',
- 'app.settings.menuMap.binding': 'Account Binding',
- 'app.settings.menuMap.notification': 'New Message Notification',
- 'app.settings.basic.avatar': 'Avatar',
- 'app.settings.basic.change-avatar': 'Change avatar',
- 'app.settings.basic.email': 'Email',
- 'app.settings.basic.email-message': 'Please input your email!',
- 'app.settings.basic.nickname': 'Nickname',
- 'app.settings.basic.nickname-message': 'Please input your Nickname!',
- 'app.settings.basic.profile': 'Personal profile',
- 'app.settings.basic.profile-message': 'Please input your personal profile!',
- 'app.settings.basic.profile-placeholder': 'Brief introduction to yourself',
- 'app.settings.basic.country': 'Country/Region',
- 'app.settings.basic.country-message': 'Please input your country!',
- 'app.settings.basic.geographic': 'Province or city',
- 'app.settings.basic.geographic-message': 'Please input your geographic info!',
- 'app.settings.basic.address': 'Street Address',
- 'app.settings.basic.address-message': 'Please input your address!',
- 'app.settings.basic.phone': 'Phone Number',
- 'app.settings.basic.phone-message': 'Please input your phone!',
- 'app.settings.basic.update': 'Update Information',
- 'app.settings.security.strong': 'Strong',
- 'app.settings.security.medium': 'Medium',
- 'app.settings.security.weak': 'Weak',
- 'app.settings.security.password': 'Account Password',
- 'app.settings.security.password-description': 'Current password strength',
- 'app.settings.security.phone': 'Security Phone',
- 'app.settings.security.phone-description': 'Bound phone',
- 'app.settings.security.question': 'Security Question',
- 'app.settings.security.question-description':
- 'The security question is not set, and the security policy can effectively protect the account security',
- 'app.settings.security.email': 'Backup Email',
- 'app.settings.security.email-description': 'Bound Email',
- 'app.settings.security.mfa': 'MFA Device',
- 'app.settings.security.mfa-description':
- 'Unbound MFA device, after binding, can be confirmed twice',
- 'app.settings.security.modify': 'Modify',
- 'app.settings.security.set': 'Set',
- 'app.settings.security.bind': 'Bind',
- 'app.settings.binding.taobao': 'Binding Taobao',
- 'app.settings.binding.taobao-description': 'Currently unbound Taobao account',
- 'app.settings.binding.alipay': 'Binding Alipay',
- 'app.settings.binding.alipay-description': 'Currently unbound Alipay account',
- 'app.settings.binding.dingding': 'Binding DingTalk',
- 'app.settings.binding.dingding-description': 'Currently unbound DingTalk account',
- 'app.settings.binding.bind': 'Bind',
- 'app.settings.notification.password': 'Account Password',
- 'app.settings.notification.password-description':
- 'Messages from other users will be notified in the form of a station letter',
- 'app.settings.notification.messages': 'System Messages',
- 'app.settings.notification.messages-description':
- 'System messages will be notified in the form of a station letter',
- 'app.settings.notification.todo': 'To-do Notification',
- 'app.settings.notification.todo-description':
- 'The to-do list will be notified in the form of a letter from the station',
- 'app.settings.open': 'Open',
- 'app.settings.close': 'Close',
-};
diff --git a/admin-web/src/locales/pt-BR.js b/admin-web/src/locales/pt-BR.js
deleted file mode 100644
index af8bcee53..000000000
--- a/admin-web/src/locales/pt-BR.js
+++ /dev/null
@@ -1,35 +0,0 @@
-import analysis from './pt-BR/analysis';
-import exception from './pt-BR/exception';
-import form from './pt-BR/form';
-import globalHeader from './pt-BR/globalHeader';
-import login from './pt-BR/login';
-import menu from './pt-BR/menu';
-import monitor from './pt-BR/monitor';
-import result from './pt-BR/result';
-import settingDrawer from './pt-BR/settingDrawer';
-import settings from './pt-BR/settings';
-import pwa from './pt-BR/pwa';
-import component from './pt-BR/component';
-
-export default {
- 'navBar.lang': 'Idiomas',
- 'layout.user.link.help': 'ajuda',
- 'layout.user.link.privacy': 'política de privacidade',
- 'layout.user.link.terms': 'termos de serviços',
- 'app.home.introduce': 'introduzir',
- 'app.forms.basic.title': 'Basic form',
- 'app.forms.basic.description':
- 'Páginas de formulário são usadas para coletar e verificar as informações dos usuários e formulários básicos são comuns nos cenários onde existem alguns formatos de informações.',
- ...analysis,
- ...exception,
- ...form,
- ...globalHeader,
- ...login,
- ...menu,
- ...monitor,
- ...result,
- ...settingDrawer,
- ...settings,
- ...pwa,
- ...component,
-};
diff --git a/admin-web/src/locales/pt-BR/analysis.js b/admin-web/src/locales/pt-BR/analysis.js
deleted file mode 100644
index eb33f10b6..000000000
--- a/admin-web/src/locales/pt-BR/analysis.js
+++ /dev/null
@@ -1,34 +0,0 @@
-export default {
- 'app.analysis.test': 'Gongzhuan No.{no} shop',
- 'app.analysis.introduce': 'Introduzir',
- 'app.analysis.total-sales': 'Vendas Totais',
- 'app.analysis.day-sales': 'Vendas do Dia',
- 'app.analysis.visits': 'Visitas',
- 'app.analysis.visits-trend': 'Tendência de Visitas',
- 'app.analysis.visits-ranking': 'Ranking de Visitas',
- 'app.analysis.day-visits': 'Visitas do Dia',
- 'app.analysis.week': 'Taxa Semanal',
- 'app.analysis.day': 'Taxa Diária',
- 'app.analysis.payments': 'Pagamentos',
- 'app.analysis.conversion-rate': 'Taxa de Conversão',
- 'app.analysis.operational-effect': 'Efeito Operacional',
- 'app.analysis.sales-trend': 'Tendência de Vendas das Lojas',
- 'app.analysis.sales-ranking': 'Ranking de Vendas',
- 'app.analysis.all-year': 'Todo ano',
- 'app.analysis.all-month': 'Todo mês',
- 'app.analysis.all-week': 'Toda semana',
- 'app.analysis.all-day': 'Todo dia',
- 'app.analysis.search-users': 'Pesquisa de Usuários',
- 'app.analysis.per-capita-search': 'Busca Per Capta',
- 'app.analysis.online-top-search': 'Mais Buscadas Online',
- 'app.analysis.the-proportion-of-sales': 'Proporção de Vendas',
- 'app.analysis.channel.all': 'Tudo',
- 'app.analysis.channel.online': 'Online',
- 'app.analysis.channel.stores': 'Lojas',
- 'app.analysis.sales': 'Vendas',
- 'app.analysis.traffic': 'Tráfego',
- 'app.analysis.table.rank': 'Rank',
- 'app.analysis.table.search-keyword': 'Palavra chave',
- 'app.analysis.table.users': 'Usuários',
- 'app.analysis.table.weekly-range': 'Faixa Semanal',
-};
diff --git a/admin-web/src/locales/pt-BR/component.js b/admin-web/src/locales/pt-BR/component.js
deleted file mode 100644
index 7cf9999c3..000000000
--- a/admin-web/src/locales/pt-BR/component.js
+++ /dev/null
@@ -1,5 +0,0 @@
-export default {
- 'component.tagSelect.expand': 'Expandir',
- 'component.tagSelect.collapse': 'Diminuir',
- 'component.tagSelect.all': 'Todas',
-};
diff --git a/admin-web/src/locales/pt-BR/exception.js b/admin-web/src/locales/pt-BR/exception.js
deleted file mode 100644
index ff4f1a8dd..000000000
--- a/admin-web/src/locales/pt-BR/exception.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export default {
- 'app.exception.back': 'Voltar para Início',
- 'app.exception.description.403': 'Desculpe, você não tem acesso a esta página',
- 'app.exception.description.404': 'Desculpe, a página que você visitou não existe',
- 'app.exception.description.500': 'Desculpe, o servidor está reportando um erro',
-};
diff --git a/admin-web/src/locales/pt-BR/form.js b/admin-web/src/locales/pt-BR/form.js
deleted file mode 100644
index 8e5b76022..000000000
--- a/admin-web/src/locales/pt-BR/form.js
+++ /dev/null
@@ -1,39 +0,0 @@
-export default {
- 'form.get-captcha': 'Get Captcha',
- 'form.captcha.second': 'sec',
- 'form.email.placeholder': 'Email',
- 'form.password.placeholder': 'Senha',
- 'form.confirm-password.placeholder': 'Confirme a senha',
- 'form.phone-number.placeholder': 'Telefone',
- 'form.verification-code.placeholder': 'Código de verificação',
- 'form.optional': ' (opcional) ',
- 'form.submit': 'Enviar',
- 'form.save': 'Salvar',
- 'form.title.label': 'Titulo',
- 'form.title.placeholder': 'Dê o nome do input',
- 'form.date.label': 'Período',
- 'form.date.placeholder.start': 'Data Inicial',
- 'form.date.placeholder.end': 'Data Final',
- 'form.goal.label': 'Objetivos',
- 'form.goal.placeholder': 'Por favor, digite os seus objetivos',
- 'form.standard.label': 'Métricas',
- 'form.standard.placeholder': 'Por favor, digite suas métricas',
- 'form.client.label': 'Cliente',
- 'form.client.label.tooltip': 'Target service object',
- 'form.client.placeholder':
- 'Por favor, descreva seu atendimento ao cliente, clientes internos diretamente @ Nome / número do trabalho',
- 'form.invites.label': 'Convidados críticos',
- 'form.invites.placeholder':
- 'Por favor, dirija @ Nome / número do trabalho, você pode convidar até 5 pessoas',
- 'form.weight.label': 'Peso',
- 'form.weight.placeholder': 'Por favor, entre com o peso',
- 'form.public.label': 'Revelação de objetivo',
- 'form.public.label.help': 'Clientes e convidados são compartilhados por padrão',
- 'form.public.radio.public': 'Publico',
- 'form.public.radio.partially-public': 'Parcialmente publico',
- 'form.public.radio.private': 'Privado',
- 'form.publicUsers.placeholder': 'Aberto para',
- 'form.publicUsers.option.A': 'Colega A',
- 'form.publicUsers.option.B': 'Colega B',
- 'form.publicUsers.option.C': 'Colega C',
-};
diff --git a/admin-web/src/locales/pt-BR/globalHeader.js b/admin-web/src/locales/pt-BR/globalHeader.js
deleted file mode 100644
index eac034d50..000000000
--- a/admin-web/src/locales/pt-BR/globalHeader.js
+++ /dev/null
@@ -1,18 +0,0 @@
-export default {
- 'component.globalHeader.search': 'Busca',
- 'component.globalHeader.search.example1': 'Exemplo de busca 1',
- 'component.globalHeader.search.example2': 'Exemplo de busca 2',
- 'component.globalHeader.search.example3': 'Exemplo de busca 3',
- 'component.globalHeader.help': 'Ajuda',
- 'component.globalHeader.notification': 'Notificação',
- 'component.globalHeader.notification.empty': 'Você visualizou todas as notificações.',
- 'component.globalHeader.message': 'Mensagem',
- 'component.globalHeader.message.empty': 'Você visualizou todas as mensagens.',
- 'component.globalHeader.event': 'Evento',
- 'component.globalHeader.event.empty': 'Você visualizou todos os eventos.',
- 'component.noticeIcon.clear': 'Limpar',
- 'component.noticeIcon.cleared': 'Limpo',
- 'component.noticeIcon.empty': 'Sem notificações',
- 'component.noticeIcon.loaded': 'Carregado',
- 'component.noticeIcon.loading-more': 'Carregar mais',
-};
diff --git a/admin-web/src/locales/pt-BR/login.js b/admin-web/src/locales/pt-BR/login.js
deleted file mode 100644
index 453b3dac1..000000000
--- a/admin-web/src/locales/pt-BR/login.js
+++ /dev/null
@@ -1,36 +0,0 @@
-export default {
- 'app.login.userName': 'Nome de usuário',
- 'app.login.password': 'Sua senha',
- 'app.login.message-invalid-credentials':
- 'Nome de usuário ou senha inválidosd(admin/ant.design)',
- 'app.login.message-invalid-verification-code': 'Código de verificação inválido',
- 'app.login.tab-login-credentials': 'Credenciais',
- 'app.login.tab-login-mobile': 'Telefone',
- 'app.login.remember-me': 'Lembre-me',
- 'app.login.forgot-password': 'Esqueceu sua senha?',
- 'app.login.sign-in-with': 'Login com',
- 'app.login.signup': 'Cadastre-se',
- 'app.login.login': 'Login',
- 'app.register.register': 'Cadastro',
- 'app.register.get-verification-code': 'Recuperar código',
- 'app.register.sign-in': 'Já tem uma conta?',
- 'app.register-result.msg': 'Conta:registrada em {email}',
- 'app.register-result.activation-email':
- 'Um email de ativação foi enviado para o seu email e é válido por 24 horas. Por favor entre no seu email e clique no link de ativação da conta.',
- 'app.register-result.back-home': 'Voltar ao Início',
- 'app.register-result.view-mailbox': 'Visualizar a caixa de email',
- 'validation.email.required': 'Por favor insira seu email!',
- 'validation.email.wrong-format': 'O email está errado!',
- 'validation.userName.required': 'Por favor insira nome de usuário!',
- 'validation.password.required': 'Por favor insira sua senha!',
- 'validation.password.twice': 'As senhas não estão iguais!',
- 'validation.password.strength.msg':
- 'Por favor insira pelo menos 6 caracteres e não use senhas fáceis de adivinhar.',
- 'validation.password.strength.strong': 'Força: forte',
- 'validation.password.strength.medium': 'Força: média',
- 'validation.password.strength.short': 'Força: curta',
- 'validation.confirm-password.required': 'Por favor confirme sua senha!',
- 'validation.phone-number.required': 'Por favor insira seu telefone!',
- 'validation.phone-number.wrong-format': 'Formato de telefone errado!',
- 'validation.verification-code.required': 'Por favor insira seu código de verificação!',
-};
diff --git a/admin-web/src/locales/pt-BR/menu.js b/admin-web/src/locales/pt-BR/menu.js
deleted file mode 100644
index 77ee7fd7e..000000000
--- a/admin-web/src/locales/pt-BR/menu.js
+++ /dev/null
@@ -1,41 +0,0 @@
-export default {
- 'menu.home': 'Início',
- 'menu.login': 'Login',
- 'menu.register': 'Registro',
- 'menu.register.result': 'Resultado de registro',
- 'menu.dashboard': 'Dashboard',
- 'menu.dashboard.analysis': 'Análise',
- 'menu.dashboard.monitor': 'Monitor',
- 'menu.dashboard.workplace': 'Ambiente de Trabalho',
- 'menu.form': 'Formulário',
- 'menu.form.basicform': 'Formulário Básico',
- 'menu.form.stepform': 'Formulário Assistido',
- 'menu.form.stepform.info': 'Formulário Assistido(gravar informações de transferência)',
- 'menu.form.stepform.confirm': 'Formulário Assistido(confirmar informações de transferência)',
- 'menu.form.stepform.result': 'Formulário Assistido(finalizado)',
- 'menu.form.advancedform': 'Formulário Avançado',
- 'menu.list': 'Lista',
- 'menu.list.searchtable': 'Tabela de Busca',
- 'menu.list.basiclist': 'Lista Básica',
- 'menu.list.cardlist': 'Lista de Card',
- 'menu.list.searchlist': 'Lista de Busca',
- 'menu.list.searchlist.articles': 'Lista de Busca(artigos)',
- 'menu.list.searchlist.projects': 'Lista de Busca(projetos)',
- 'menu.list.searchlist.applications': 'Lista de Busca(aplicações)',
- 'menu.profile': 'Perfil',
- 'menu.profile.basic': 'Perfil Básico',
- 'menu.profile.advanced': 'Perfil Avançado',
- 'menu.result': 'Resultado',
- 'menu.result.success': 'Sucesso',
- 'menu.result.fail': 'Falha',
- 'menu.exception': 'Exceção',
- 'menu.exception.not-permission': '403',
- 'menu.exception.not-find': '404',
- 'menu.exception.server-error': '500',
- 'menu.exception.trigger': 'Disparar',
- 'menu.account': 'Conta',
- 'menu.account.center': 'Central da Conta',
- 'menu.account.settings': 'Configurar Conta',
- 'menu.account.trigger': 'Disparar Erro',
- 'menu.account.logout': 'Sair',
-};
diff --git a/admin-web/src/locales/pt-BR/monitor.js b/admin-web/src/locales/pt-BR/monitor.js
deleted file mode 100644
index 44a260843..000000000
--- a/admin-web/src/locales/pt-BR/monitor.js
+++ /dev/null
@@ -1,19 +0,0 @@
-export default {
- 'app.monitor.trading-activity': 'Atividade de Trading Real-time',
- 'app.monitor.total-transactions': 'Total de transações hoje',
- 'app.monitor.sales-target': 'Taxa de conclusão da meta de vendas',
- 'app.monitor.remaining-time': 'Tempo restante da atividade',
- 'app.monitor.total-transactions-per-second': 'Total de transações por segundo',
- 'app.monitor.activity-forecast': 'Previsão atual',
- 'app.monitor.efficiency': 'Eficiência',
- 'app.monitor.ratio': 'Relação',
- 'app.monitor.proportion-per-category': 'Proporção por categoria',
- 'app.monitor.fast-food': 'Fast food',
- 'app.monitor.western-food': 'Comida Ocidental',
- 'app.monitor.hot-pot': 'Hot pot',
- 'app.monitor.waiting-for-implementation': 'Aguardando implementação',
- 'app.monitor.popular-searches': 'Buscas populares',
- 'app.monitor.resource-surplus': 'Excedente de recursos',
- 'app.monitor.fund-surplus': 'Excedente do fundo',
- 'app.exception.back': 'Voltar a home',
-};
diff --git a/admin-web/src/locales/pt-BR/pwa.js b/admin-web/src/locales/pt-BR/pwa.js
deleted file mode 100644
index 05cc79784..000000000
--- a/admin-web/src/locales/pt-BR/pwa.js
+++ /dev/null
@@ -1,7 +0,0 @@
-export default {
- 'app.pwa.offline': 'Você está offline agora',
- 'app.pwa.serviceworker.updated': 'Novo conteúdo está disponível',
- 'app.pwa.serviceworker.updated.hint':
- 'Por favor, pressione o botão "Atualizar" para recarregar a página atual',
- 'app.pwa.serviceworker.updated.ok': 'Atualizar',
-};
diff --git a/admin-web/src/locales/pt-BR/result.js b/admin-web/src/locales/pt-BR/result.js
deleted file mode 100644
index 2720e0722..000000000
--- a/admin-web/src/locales/pt-BR/result.js
+++ /dev/null
@@ -1,28 +0,0 @@
-export default {
- 'app.result.error.title': 'A Submissão Falhou',
- 'app.result.error.description':
- 'Por favor, verifique e modifique as seguintes informações antes de reenviar.',
- 'app.result.error.hint-title': 'O conteúdo que você enviou tem o seguinte erro:',
- 'app.result.error.hint-text1': 'Sua conta foi congelada',
- 'app.result.error.hint-btn1': 'Descongele imediatamente',
- 'app.result.error.hint-text2': 'Sua conta ainda não está qualificada para se candidatar',
- 'app.result.error.hint-btn2': 'Atualizar imediatamente',
- 'app.result.error.btn-text': 'Retornar para modificar',
- 'app.result.success.title': 'A Submissão foi um Sucesso',
- 'app.result.success.description':
- 'A página de resultados de envio é usada para fornecer os resultados de uma série de tarefas operacionais. Se for uma operação simples, use o prompt de feedback de Mensagem global. Esta área de texto pode mostrar uma explicação suplementar simples. Se houver um requisito semelhante para exibir "documentos", a área cinza a seguir pode apresentar um conteúdo mais complicado.',
- 'app.result.success.operate-title': 'Nome do Projeto',
- 'app.result.success.operate-id': 'ID do Projeto:',
- 'app.result.success.principal': 'Principal:',
- 'app.result.success.operate-time': 'Tempo efetivo:',
- 'app.result.success.step1-title': 'Criar projeto',
- 'app.result.success.step1-operator': 'Qu Lili',
- 'app.result.success.step2-title': 'Revisão preliminar do departamento',
- 'app.result.success.step2-operator': 'Zhou Maomao',
- 'app.result.success.step2-extra': 'Urge',
- 'app.result.success.step3-title': 'Revisão financeira',
- 'app.result.success.step4-title': 'Terminar',
- 'app.result.success.btn-return': 'Voltar a lista',
- 'app.result.success.btn-project': 'Ver projeto',
- 'app.result.success.btn-print': 'imprimir',
-};
diff --git a/admin-web/src/locales/pt-BR/settingDrawer.js b/admin-web/src/locales/pt-BR/settingDrawer.js
deleted file mode 100644
index 8a10b57e2..000000000
--- a/admin-web/src/locales/pt-BR/settingDrawer.js
+++ /dev/null
@@ -1,32 +0,0 @@
-export default {
- 'app.setting.pagestyle': 'Configuração de estilo da página',
- 'app.setting.pagestyle.dark': 'Dark style',
- 'app.setting.pagestyle.light': 'Light style',
- 'app.setting.content-width': 'Largura do conteúdo',
- 'app.setting.content-width.fixed': 'Fixo',
- 'app.setting.content-width.fluid': 'Fluido',
- 'app.setting.themecolor': 'Cor do Tema',
- 'app.setting.themecolor.dust': 'Dust Red',
- 'app.setting.themecolor.volcano': 'Volcano',
- 'app.setting.themecolor.sunset': 'Sunset Orange',
- 'app.setting.themecolor.cyan': 'Cyan',
- 'app.setting.themecolor.green': 'Polar Green',
- 'app.setting.themecolor.daybreak': 'Daybreak Blue (default)',
- 'app.setting.themecolor.geekblue': 'Geek Glue',
- 'app.setting.themecolor.purple': 'Golden Purple',
- 'app.setting.navigationmode': 'Modo de Navegação',
- 'app.setting.sidemenu': 'Layout do Menu Lateral',
- 'app.setting.topmenu': 'Layout do Menu Superior',
- 'app.setting.fixedheader': 'Cabeçalho fixo',
- 'app.setting.fixedsidebar': 'Barra lateral fixa',
- 'app.setting.fixedsidebar.hint': 'Funciona no layout do menu lateral',
- 'app.setting.hideheader': 'Esconder o cabeçalho quando rolar',
- 'app.setting.hideheader.hint': 'Funciona quando o esconder cabeçalho está abilitado',
- 'app.setting.othersettings': 'Outras configurações',
- 'app.setting.weakmode': 'Weak Mode',
- 'app.setting.copy': 'Copiar Configuração',
- 'app.setting.copyinfo':
- 'copiado com sucesso,por favor trocar o defaultSettings em src/models/setting.js',
- 'app.setting.production.hint':
- 'O painel de configuração apenas é exibido no ambiente de desenvolvimento, por favor modifique manualmente o',
-};
diff --git a/admin-web/src/locales/pt-BR/settings.js b/admin-web/src/locales/pt-BR/settings.js
deleted file mode 100644
index aad2e3877..000000000
--- a/admin-web/src/locales/pt-BR/settings.js
+++ /dev/null
@@ -1,60 +0,0 @@
-export default {
- 'app.settings.menuMap.basic': 'Configurações Básicas',
- 'app.settings.menuMap.security': 'Configurações de Segurança',
- 'app.settings.menuMap.binding': 'Vinculação de Conta',
- 'app.settings.menuMap.notification': 'Mensagens de Notificação',
- 'app.settings.basic.avatar': 'Avatar',
- 'app.settings.basic.change-avatar': 'Alterar avatar',
- 'app.settings.basic.email': 'Email',
- 'app.settings.basic.email-message': 'Por favor insira seu email!',
- 'app.settings.basic.nickname': 'Nome de usuário',
- 'app.settings.basic.nickname-message': 'Por favor insira seu nome de usuário!',
- 'app.settings.basic.profile': 'Perfil pessoal',
- 'app.settings.basic.profile-message': 'Por favor insira seu perfil pessoal!',
- 'app.settings.basic.profile-placeholder': 'Breve introdução sua',
- 'app.settings.basic.country': 'País/Região',
- 'app.settings.basic.country-message': 'Por favor insira país!',
- 'app.settings.basic.geographic': 'Província, estado ou cidade',
- 'app.settings.basic.geographic-message': 'Por favor insira suas informações geográficas!',
- 'app.settings.basic.address': 'Endereço',
- 'app.settings.basic.address-message': 'Por favor insira seu endereço!',
- 'app.settings.basic.phone': 'Número de telefone',
- 'app.settings.basic.phone-message': 'Por favor insira seu número de telefone!',
- 'app.settings.basic.update': 'Atualizar Informações',
- 'app.settings.security.strong': 'Forte',
- 'app.settings.security.medium': 'Média',
- 'app.settings.security.weak': 'Fraca',
- 'app.settings.security.password': 'Senha da Conta',
- 'app.settings.security.password-description': 'Força da senha',
- 'app.settings.security.phone': 'Telefone de Seguraça',
- 'app.settings.security.phone-description': 'Telefone vinculado',
- 'app.settings.security.question': 'Pergunta de Segurança',
- 'app.settings.security.question-description':
- 'A pergunta de segurança não está definida e a política de segurança pode proteger efetivamente a segurança da conta',
- 'app.settings.security.email': 'Email de Backup',
- 'app.settings.security.email-description': 'Email vinculado',
- 'app.settings.security.mfa': 'Dispositivo MFA',
- 'app.settings.security.mfa-description':
- 'O dispositivo MFA não vinculado, após a vinculação, pode ser confirmado duas vezes',
- 'app.settings.security.modify': 'Modificar',
- 'app.settings.security.set': 'Atribuir',
- 'app.settings.security.bind': 'Vincular',
- 'app.settings.binding.taobao': 'Vincular Taobao',
- 'app.settings.binding.taobao-description': 'Atualmente não vinculado à conta Taobao',
- 'app.settings.binding.alipay': 'Vincular Alipay',
- 'app.settings.binding.alipay-description': 'Atualmente não vinculado à conta Alipay',
- 'app.settings.binding.dingding': 'Vincular DingTalk',
- 'app.settings.binding.dingding-description': 'Atualmente não vinculado à conta DingTalk',
- 'app.settings.binding.bind': 'Vincular',
- 'app.settings.notification.password': 'Senha da Conta',
- 'app.settings.notification.password-description':
- 'Mensagens de outros usuários serão notificadas na forma de uma estação de letra',
- 'app.settings.notification.messages': 'Mensagens de Sistema',
- 'app.settings.notification.messages-description':
- 'Mensagens de sistema serão notificadas na forma de uma estação de letra',
- 'app.settings.notification.todo': 'Notificação de To-do',
- 'app.settings.notification.todo-description':
- 'A lista de to-do será notificada na forma de uma estação de letra',
- 'app.settings.open': 'Aberto',
- 'app.settings.close': 'Fechado',
-};
diff --git a/admin-web/src/locales/zh-CN.js b/admin-web/src/locales/zh-CN.js
deleted file mode 100644
index cf601f378..000000000
--- a/admin-web/src/locales/zh-CN.js
+++ /dev/null
@@ -1,35 +0,0 @@
-import analysis from './zh-CN/analysis';
-import exception from './zh-CN/exception';
-import form from './zh-CN/form';
-import globalHeader from './zh-CN/globalHeader';
-import login from './zh-CN/login';
-import menu from './zh-CN/menu';
-import monitor from './zh-CN/monitor';
-import result from './zh-CN/result';
-import settingDrawer from './zh-CN/settingDrawer';
-import settings from './zh-CN/settings';
-import pwa from './zh-CN/pwa';
-import component from './zh-CN/component';
-
-export default {
- 'navBar.lang': '语言',
- 'layout.user.link.help': '帮助',
- 'layout.user.link.privacy': '隐私',
- 'layout.user.link.terms': '条款',
- 'app.home.introduce': '介绍',
- 'app.forms.basic.title': '基础表单',
- 'app.forms.basic.description':
- '表单页用于向用户收集或验证信息,基础表单常见于数据项较少的表单场景。',
- ...analysis,
- ...exception,
- ...form,
- ...globalHeader,
- ...login,
- ...menu,
- ...monitor,
- ...result,
- ...settingDrawer,
- ...settings,
- ...pwa,
- ...component,
-};
diff --git a/admin-web/src/locales/zh-CN/analysis.js b/admin-web/src/locales/zh-CN/analysis.js
deleted file mode 100644
index 8ed17ed83..000000000
--- a/admin-web/src/locales/zh-CN/analysis.js
+++ /dev/null
@@ -1,34 +0,0 @@
-export default {
- 'app.analysis.test': '工专路 {no} 号店',
- 'app.analysis.introduce': '指标说明',
- 'app.analysis.total-sales': '总销售额',
- 'app.analysis.day-sales': '日销售额',
- 'app.analysis.visits': '访问量',
- 'app.analysis.visits-trend': '访问量趋势',
- 'app.analysis.visits-ranking': '门店访问量排名',
- 'app.analysis.day-visits': '日访问量',
- 'app.analysis.week': '周同比',
- 'app.analysis.day': '日同比',
- 'app.analysis.payments': '支付笔数',
- 'app.analysis.conversion-rate': '转化率',
- 'app.analysis.operational-effect': '运营活动效果',
- 'app.analysis.sales-trend': '销售趋势',
- 'app.analysis.sales-ranking': '门店销售额排名',
- 'app.analysis.all-year': '全年',
- 'app.analysis.all-month': '本月',
- 'app.analysis.all-week': '本周',
- 'app.analysis.all-day': '今日',
- 'app.analysis.search-users': '搜索用户数',
- 'app.analysis.per-capita-search': '人均搜索次数',
- 'app.analysis.online-top-search': '线上热门搜索',
- 'app.analysis.the-proportion-of-sales': '销售额类别占比',
- 'app.analysis.channel.all': '全部渠道',
- 'app.analysis.channel.online': '线上',
- 'app.analysis.channel.stores': '门店',
- 'app.analysis.sales': '销售额',
- 'app.analysis.traffic': '客流量',
- 'app.analysis.table.rank': '排名',
- 'app.analysis.table.search-keyword': '搜索关键词',
- 'app.analysis.table.users': '用户数',
- 'app.analysis.table.weekly-range': '周涨幅',
-};
diff --git a/admin-web/src/locales/zh-CN/component.js b/admin-web/src/locales/zh-CN/component.js
deleted file mode 100644
index 1f1feadbf..000000000
--- a/admin-web/src/locales/zh-CN/component.js
+++ /dev/null
@@ -1,5 +0,0 @@
-export default {
- 'component.tagSelect.expand': '展开',
- 'component.tagSelect.collapse': '收起',
- 'component.tagSelect.all': '全部',
-};
diff --git a/admin-web/src/locales/zh-CN/exception.js b/admin-web/src/locales/zh-CN/exception.js
deleted file mode 100644
index 6f645daed..000000000
--- a/admin-web/src/locales/zh-CN/exception.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export default {
- 'app.exception.back': '返回首页',
- 'app.exception.description.403': '抱歉,你无权访问该页面',
- 'app.exception.description.404': '抱歉,你访问的页面不存在',
- 'app.exception.description.500': '抱歉,服务器出错了',
-};
diff --git a/admin-web/src/locales/zh-CN/form.js b/admin-web/src/locales/zh-CN/form.js
deleted file mode 100644
index 7f3bd9525..000000000
--- a/admin-web/src/locales/zh-CN/form.js
+++ /dev/null
@@ -1,37 +0,0 @@
-export default {
- 'form.get-captcha': '获取验证码',
- 'form.captcha.second': '秒',
- 'form.optional': '(选填)',
- 'form.submit': '提交',
- 'form.save': '保存',
- 'form.email.placeholder': '邮箱',
- 'form.password.placeholder': '至少6位密码,区分大小写',
- 'form.confirm-password.placeholder': '确认密码',
- 'form.phone-number.placeholder': '手机号',
- 'form.verification-code.placeholder': '验证码',
- 'form.title.label': '标题',
- 'form.title.placeholder': '给目标起个名字',
- 'form.date.label': '起止日期',
- 'form.date.placeholder.start': '开始日期',
- 'form.date.placeholder.end': '结束日期',
- 'form.goal.label': '目标描述',
- 'form.goal.placeholder': '请输入你的阶段性工作目标',
- 'form.standard.label': '衡量标准',
- 'form.standard.placeholder': '请输入衡量标准',
- 'form.client.label': '客户',
- 'form.client.label.tooltip': '目标的服务对象',
- 'form.client.placeholder': '请描述你服务的客户,内部客户直接 @姓名/工号',
- 'form.invites.label': '邀评人',
- 'form.invites.placeholder': '请直接 @姓名/工号,最多可邀请 5 人',
- 'form.weight.label': '权重',
- 'form.weight.placeholder': '请输入',
- 'form.public.label': '目标公开',
- 'form.public.label.help': '客户、邀评人默认被分享',
- 'form.public.radio.public': '公开',
- 'form.public.radio.partially-public': '部分公开',
- 'form.public.radio.private': '不公开',
- 'form.publicUsers.placeholder': '公开给',
- 'form.publicUsers.option.A': '同事甲',
- 'form.publicUsers.option.B': '同事乙',
- 'form.publicUsers.option.C': '同事丙',
-};
diff --git a/admin-web/src/locales/zh-CN/globalHeader.js b/admin-web/src/locales/zh-CN/globalHeader.js
deleted file mode 100644
index 204538294..000000000
--- a/admin-web/src/locales/zh-CN/globalHeader.js
+++ /dev/null
@@ -1,18 +0,0 @@
-export default {
- 'component.globalHeader.search': '站内搜索',
- 'component.globalHeader.search.example1': '搜索提示一',
- 'component.globalHeader.search.example2': '搜索提示二',
- 'component.globalHeader.search.example3': '搜索提示三',
- 'component.globalHeader.help': '使用文档',
- 'component.globalHeader.notification': '通知',
- 'component.globalHeader.notification.empty': '你已查看所有通知',
- 'component.globalHeader.message': '消息',
- 'component.globalHeader.message.empty': '您已读完所有消息',
- 'component.globalHeader.event': '待办',
- 'component.globalHeader.event.empty': '你已完成所有待办',
- 'component.noticeIcon.clear': '清空',
- 'component.noticeIcon.cleared': '清空了',
- 'component.noticeIcon.empty': '暂无数据',
- 'component.noticeIcon.loaded': '加载完毕',
- 'component.noticeIcon.loading-more': '加载更多',
-};
diff --git a/admin-web/src/locales/zh-CN/login.js b/admin-web/src/locales/zh-CN/login.js
deleted file mode 100644
index eb2272073..000000000
--- a/admin-web/src/locales/zh-CN/login.js
+++ /dev/null
@@ -1,38 +0,0 @@
-export default {
- 'app.login.userName': '用户名',
- 'app.login.password': '密码',
- 'app.login.message-invalid-credentials': '账户或密码错误(admin/ant.design)',
- 'app.login.message-invalid-verification-code': '验证码错误',
- 'app.login.tab-login-credentials': '账户密码登录',
- 'app.login.tab-login-mobile': '手机号登录',
- 'app.login.remember-me': '自动登录',
- 'app.login.forgot-password': '忘记密码',
- 'app.login.sign-in-with': '其他登录方式',
- 'app.login.signup': '注册账户',
- 'app.login.login': '登录',
- 'app.register.register': '注册',
- 'app.register.get-verification-code': '获取验证码',
- 'app.register.sign-in': '使用已有账户登录',
- 'app.register-result.msg': '你的账户:{email} 注册成功',
- 'app.register-result.activation-email':
- '激活邮件已发送到你的邮箱中,邮件有效期为24小时。请及时登录邮箱,点击邮件中的链接激活帐户。',
- 'app.register-result.back-home': '返回首页',
- 'app.register-result.view-mailbox': '查看邮箱',
- 'validation.email.required': '请输入邮箱地址!',
- 'validation.email.wrong-format': '邮箱地址格式错误!',
- 'validation.userName.required': '请输入用户名!',
- 'validation.password.required': '请输入密码!',
- 'validation.password.twice': '两次输入的密码不匹配!',
- 'validation.password.strength.msg': '请至少输入 6 个字符。请不要使用容易被猜到的密码。',
- 'validation.password.strength.strong': '强度:强',
- 'validation.password.strength.medium': '强度:中',
- 'validation.password.strength.short': '强度:太短',
- 'validation.confirm-password.required': '请确认密码!',
- 'validation.phone-number.required': '请输入手机号!',
- 'validation.phone-number.wrong-format': '手机号格式错误!',
- 'validation.verification-code.required': '请输入验证码!',
- 'validation.title.required': '请输入标题',
- 'validation.date.required': '请选择起止日期',
- 'validation.goal.required': '请输入目标描述',
- 'validation.standard.required': '请输入衡量标准',
-};
diff --git a/admin-web/src/locales/zh-CN/menu.js b/admin-web/src/locales/zh-CN/menu.js
deleted file mode 100644
index 0e9ef9d14..000000000
--- a/admin-web/src/locales/zh-CN/menu.js
+++ /dev/null
@@ -1,79 +0,0 @@
-export default {
- 'menu.home': '首页',
- 'menu.login': '登录',
- 'menu.register': '注册',
- 'menu.register.result': '注册结果',
- 'menu.dashboard': 'Dashboard',
- 'menu.dashboard.analysis': '分析页',
- 'menu.dashboard.monitor': '监控页',
- 'menu.dashboard.workplace': '工作台',
- 'menu.form': '表单页',
- 'menu.form.basicform': '基础表单',
- 'menu.form.stepform': '分步表单',
- 'menu.form.stepform.info': '分步表单(填写转账信息)',
- 'menu.form.stepform.confirm': '分步表单(确认转账信息)',
- 'menu.form.stepform.result': '分步表单(完成)',
- 'menu.form.advancedform': '高级表单',
- 'menu.list': '列表页',
- 'menu.list.searchtable': '查询表格',
- 'menu.list.basiclist': '标准列表',
- 'menu.list.cardlist': '卡片列表',
- 'menu.list.searchlist': '搜索列表',
- 'menu.list.searchlist.articles': '搜索列表(文章)',
- 'menu.list.searchlist.projects': '搜索列表(项目)',
- 'menu.list.searchlist.applications': '搜索列表(应用)',
- 'menu.profile': '详情页',
- 'menu.profile.basic': '基础详情页',
- 'menu.profile.advanced': '高级详情页',
- 'menu.result': '结果页',
- 'menu.result.success': '成功页',
- 'menu.result.fail': '失败页',
- 'menu.exception': '异常页',
- 'menu.exception.not-permission': '403',
- 'menu.exception.not-find': '404',
- 'menu.exception.server-error': '500',
- 'menu.exception.trigger': '触发错误',
- 'menu.account': '个人页',
- 'menu.account.center': '个人中心',
- 'menu.account.settings': '个人设置',
- 'menu.account.trigger': '触发报错',
- 'menu.account.logout': '退出登录',
- // admin
- 'menu.admin': '系统设置',
- 'menu.admin.admin-list': '管理员列表',
- 'menu.admin.resource-list': '权限列表',
- 'menu.admin.role-list': '角色列表',
- 'menu.admin.dictionary-list': '数据字典',
- 'menu.admin.deptment-list': '部门列表',
- // 商品相关
- 'menu.product': '商品管理',
- 'menu.product.product-spu-list': '商品管理',
- 'menu.product.product-spu-add': '商品添加',
- 'menu.product.product-spu-update': '商品编辑',
- 'menu.product.product-category-list': '商品分类',
- 'menu.product.product-brand-list': '商品品牌',
- 'menu.product.product-attr-list': '规格管理',
-
- // 订单
- 'menu.order': '订单管理',
- 'menu.order.order-list': '订单管理',
- 'menu.order.order-refunds': '退货维权',
- // 营销相关
- 'menu.promotion': '首页管理',
- 'menu.promotion.promotion-banner-list': '首页广告',
- 'menu.promotion.product-recommend-list': '商品推荐',
- 'menu.promotion.coupon-card-template-list': '优惠劵管理',
- 'menu.promotion.time-limit-discount-list': '限时折扣',
- 'menu.promotion.full-privilege-list': '满减送',
- // 会员相关
- 'menu.user': '会员管理',
- 'menu.user.user-list': '会员资料',
- // 支付相关
- 'menu.pay': '支付管理',
- 'menu.pay.pay-transaction-list': '支付单',
- 'menu.pay.pay-refund-list': '退款单',
- // 短信服务
- 'menu.sms': '短信服务',
- 'menu.sms.sign-list': '签名模板',
- 'menu.sms.template-list': '短信模板',
-};
diff --git a/admin-web/src/locales/zh-CN/monitor.js b/admin-web/src/locales/zh-CN/monitor.js
deleted file mode 100644
index 3a3e3f0b5..000000000
--- a/admin-web/src/locales/zh-CN/monitor.js
+++ /dev/null
@@ -1,18 +0,0 @@
-export default {
- 'app.monitor.trading-activity': '活动实时交易情况',
- 'app.monitor.total-transactions': '今日交易总额',
- 'app.monitor.sales-target': '销售目标完成率',
- 'app.monitor.remaining-time': '活动剩余时间',
- 'app.monitor.total-transactions-per-second': '每秒交易总额',
- 'app.monitor.activity-forecast': '活动情况预测',
- 'app.monitor.efficiency': '券核效率',
- 'app.monitor.ratio': '跳出率',
- 'app.monitor.proportion-per-category': '各品类占比',
- 'app.monitor.fast-food': '中式快餐',
- 'app.monitor.western-food': '西餐',
- 'app.monitor.hot-pot': '火锅',
- 'app.monitor.waiting-for-implementation': 'Waiting for implementation',
- 'app.monitor.popular-searches': '热门搜索',
- 'app.monitor.resource-surplus': '资源剩余',
- 'app.monitor.fund-surplus': '补贴资金剩余',
-};
diff --git a/admin-web/src/locales/zh-CN/pwa.js b/admin-web/src/locales/zh-CN/pwa.js
deleted file mode 100644
index e9504849e..000000000
--- a/admin-web/src/locales/zh-CN/pwa.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export default {
- 'app.pwa.offline': '当前处于离线状态',
- 'app.pwa.serviceworker.updated': '有新内容',
- 'app.pwa.serviceworker.updated.hint': '请点击“刷新”按钮或者手动刷新页面',
- 'app.pwa.serviceworker.updated.ok': '刷新',
-};
diff --git a/admin-web/src/locales/zh-CN/result.js b/admin-web/src/locales/zh-CN/result.js
deleted file mode 100644
index cba0e1c1c..000000000
--- a/admin-web/src/locales/zh-CN/result.js
+++ /dev/null
@@ -1,27 +0,0 @@
-export default {
- 'app.result.error.title': '提交失败',
- 'app.result.error.description': '请核对并修改以下信息后,再重新提交。',
- 'app.result.error.hint-title': '您提交的内容有如下错误:',
- 'app.result.error.hint-text1': '您的账户已被冻结',
- 'app.result.error.hint-btn1': '立即解冻',
- 'app.result.error.hint-text2': '您的账户还不具备申请资格',
- 'app.result.error.hint-btn2': '立即升级',
- 'app.result.error.btn-text': '返回修改',
- 'app.result.success.title': '提交成功',
- 'app.result.success.description':
- '提交结果页用于反馈一系列操作任务的处理结果, 如果仅是简单操作,使用 Message 全局提示反馈即可。 本文字区域可以展示简单的补充说明,如果有类似展示 “单据”的需求,下面这个灰色区域可以呈现比较复杂的内容。',
- 'app.result.success.operate-title': '项目名称',
- 'app.result.success.operate-id': '项目 ID:',
- 'app.result.success.principal': '负责人:',
- 'app.result.success.operate-time': '生效时间:',
- 'app.result.success.step1-title': '创建项目',
- 'app.result.success.step1-operator': '曲丽丽',
- 'app.result.success.step2-title': '部门初审',
- 'app.result.success.step2-operator': '周毛毛',
- 'app.result.success.step2-extra': '催一下',
- 'app.result.success.step3-title': '财务复核',
- 'app.result.success.step4-title': '完成',
- 'app.result.success.btn-return': '返回列表',
- 'app.result.success.btn-project': '查看项目',
- 'app.result.success.btn-print': '打印',
-};
diff --git a/admin-web/src/locales/zh-CN/settingDrawer.js b/admin-web/src/locales/zh-CN/settingDrawer.js
deleted file mode 100644
index 15685a405..000000000
--- a/admin-web/src/locales/zh-CN/settingDrawer.js
+++ /dev/null
@@ -1,31 +0,0 @@
-export default {
- 'app.setting.pagestyle': '整体风格设置',
- 'app.setting.pagestyle.dark': '暗色菜单风格',
- 'app.setting.pagestyle.light': '亮色菜单风格',
- 'app.setting.content-width': '内容区域宽度',
- 'app.setting.content-width.fixed': '定宽',
- 'app.setting.content-width.fluid': '流式',
- 'app.setting.themecolor': '主题色',
- 'app.setting.themecolor.dust': '薄暮',
- 'app.setting.themecolor.volcano': '火山',
- 'app.setting.themecolor.sunset': '日暮',
- 'app.setting.themecolor.cyan': '明青',
- 'app.setting.themecolor.green': '极光绿',
- 'app.setting.themecolor.daybreak': '拂晓蓝(默认)',
- 'app.setting.themecolor.geekblue': '极客蓝',
- 'app.setting.themecolor.purple': '酱紫',
- 'app.setting.navigationmode': '导航模式',
- 'app.setting.sidemenu': '侧边菜单布局',
- 'app.setting.topmenu': '顶部菜单布局',
- 'app.setting.fixedheader': '固定 Header',
- 'app.setting.fixedsidebar': '固定侧边菜单',
- 'app.setting.fixedsidebar.hint': '侧边菜单布局时可配置',
- 'app.setting.hideheader': '下滑时隐藏 Header',
- 'app.setting.hideheader.hint': '固定 Header 时可配置',
- 'app.setting.othersettings': '其他设置',
- 'app.setting.weakmode': '色弱模式',
- 'app.setting.copy': '拷贝设置',
- 'app.setting.copyinfo': '拷贝成功,请到 src/defaultSettings.js 中替换默认配置',
- 'app.setting.production.hint':
- '配置栏只在开发环境用于预览,生产环境不会展现,请拷贝后手动修改配置文件',
-};
diff --git a/admin-web/src/locales/zh-CN/settings.js b/admin-web/src/locales/zh-CN/settings.js
deleted file mode 100644
index df8af4346..000000000
--- a/admin-web/src/locales/zh-CN/settings.js
+++ /dev/null
@@ -1,55 +0,0 @@
-export default {
- 'app.settings.menuMap.basic': '基本设置',
- 'app.settings.menuMap.security': '安全设置',
- 'app.settings.menuMap.binding': '账号绑定',
- 'app.settings.menuMap.notification': '新消息通知',
- 'app.settings.basic.avatar': '头像',
- 'app.settings.basic.change-avatar': '更换头像',
- 'app.settings.basic.email': '邮箱',
- 'app.settings.basic.email-message': '请输入您的邮箱!',
- 'app.settings.basic.nickname': '昵称',
- 'app.settings.basic.nickname-message': '请输入您的昵称!',
- 'app.settings.basic.profile': '个人简介',
- 'app.settings.basic.profile-message': '请输入个人简介!',
- 'app.settings.basic.profile-placeholder': '个人简介',
- 'app.settings.basic.country': '国家/地区',
- 'app.settings.basic.country-message': '请输入您的国家或地区!',
- 'app.settings.basic.geographic': '所在省市',
- 'app.settings.basic.geographic-message': '请输入您的所在省市!',
- 'app.settings.basic.address': '街道地址',
- 'app.settings.basic.address-message': '请输入您的街道地址!',
- 'app.settings.basic.phone': '联系电话',
- 'app.settings.basic.phone-message': '请输入您的联系电话!',
- 'app.settings.basic.update': '更新基本信息',
- 'app.settings.security.strong': '强',
- 'app.settings.security.medium': '中',
- 'app.settings.security.weak': '弱',
- 'app.settings.security.password': '账户密码',
- 'app.settings.security.password-description': '当前密码强度',
- 'app.settings.security.phone': '密保手机',
- 'app.settings.security.phone-description': '已绑定手机',
- 'app.settings.security.question': '密保问题',
- 'app.settings.security.question-description': '未设置密保问题,密保问题可有效保护账户安全',
- 'app.settings.security.email': '备用邮箱',
- 'app.settings.security.email-description': '已绑定邮箱',
- 'app.settings.security.mfa': 'MFA 设备',
- 'app.settings.security.mfa-description': '未绑定 MFA 设备,绑定后,可以进行二次确认',
- 'app.settings.security.modify': '修改',
- 'app.settings.security.set': '设置',
- 'app.settings.security.bind': '绑定',
- 'app.settings.binding.taobao': '绑定淘宝',
- 'app.settings.binding.taobao-description': '当前未绑定淘宝账号',
- 'app.settings.binding.alipay': '绑定支付宝',
- 'app.settings.binding.alipay-description': '当前未绑定支付宝账号',
- 'app.settings.binding.dingding': '绑定钉钉',
- 'app.settings.binding.dingding-description': '当前未绑定钉钉账号',
- 'app.settings.binding.bind': '绑定',
- 'app.settings.notification.password': '账户密码',
- 'app.settings.notification.password-description': '其他用户的消息将以站内信的形式通知',
- 'app.settings.notification.messages': '系统消息',
- 'app.settings.notification.messages-description': '系统消息将以站内信的形式通知',
- 'app.settings.notification.todo': '待办任务',
- 'app.settings.notification.todo-description': '待办任务将以站内信的形式通知',
- 'app.settings.open': '开',
- 'app.settings.close': '关',
-};
diff --git a/admin-web/src/locales/zh-TW.js b/admin-web/src/locales/zh-TW.js
deleted file mode 100644
index c62173398..000000000
--- a/admin-web/src/locales/zh-TW.js
+++ /dev/null
@@ -1,35 +0,0 @@
-import analysis from './zh-TW/analysis';
-import exception from './zh-TW/exception';
-import form from './zh-TW/form';
-import globalHeader from './zh-TW/globalHeader';
-import login from './zh-TW/login';
-import menu from './zh-TW/menu';
-import monitor from './zh-TW/monitor';
-import result from './zh-TW/result';
-import settingDrawer from './zh-TW/settingDrawer';
-import settings from './zh-TW/settings';
-import pwa from './zh-TW/pwa';
-import component from './zh-TW/component';
-
-export default {
- 'navBar.lang': '語言',
- 'layout.user.link.help': '幫助',
- 'layout.user.link.privacy': '隱私',
- 'layout.user.link.terms': '條款',
- 'app.home.introduce': '介紹',
- 'app.forms.basic.title': '基礎表單',
- 'app.forms.basic.description':
- '表單頁用於向用戶收集或驗證信息,基礎表單常見於數據項較少的表單場景。',
- ...analysis,
- ...exception,
- ...form,
- ...globalHeader,
- ...login,
- ...menu,
- ...monitor,
- ...result,
- ...settingDrawer,
- ...settings,
- ...pwa,
- ...component,
-};
diff --git a/admin-web/src/locales/zh-TW/analysis.js b/admin-web/src/locales/zh-TW/analysis.js
deleted file mode 100644
index 7b2e37cf3..000000000
--- a/admin-web/src/locales/zh-TW/analysis.js
+++ /dev/null
@@ -1,34 +0,0 @@
-export default {
- 'app.analysis.test': '工專路 {no} 號店',
- 'app.analysis.introduce': '指標說明',
- 'app.analysis.total-sales': '總銷售額',
- 'app.analysis.day-sales': '日銷售額',
- 'app.analysis.visits': '訪問量',
- 'app.analysis.visits-trend': '訪問量趨勢',
- 'app.analysis.visits-ranking': '門店訪問量排名',
- 'app.analysis.day-visits': '日訪問量',
- 'app.analysis.week': '周同比',
- 'app.analysis.day': '日同比',
- 'app.analysis.payments': '支付筆數',
- 'app.analysis.conversion-rate': '轉化率',
- 'app.analysis.operational-effect': '運營活動效果',
- 'app.analysis.sales-trend': '銷售趨勢',
- 'app.analysis.sales-ranking': '門店銷售額排名',
- 'app.analysis.all-year': '全年',
- 'app.analysis.all-month': '本月',
- 'app.analysis.all-week': '本周',
- 'app.analysis.all-day': '今日',
- 'app.analysis.search-users': '搜索用戶數',
- 'app.analysis.per-capita-search': '人均搜索次數',
- 'app.analysis.online-top-search': '線上熱門搜索',
- 'app.analysis.the-proportion-of-sales': '銷售額類別占比',
- 'app.analysis.channel.all': '全部渠道',
- 'app.analysis.channel.online': '線上',
- 'app.analysis.channel.stores': '門店',
- 'app.analysis.sales': '銷售額',
- 'app.analysis.traffic': '客流量',
- 'app.analysis.table.rank': '排名',
- 'app.analysis.table.search-keyword': '搜索關鍵詞',
- 'app.analysis.table.users': '用戶數',
- 'app.analysis.table.weekly-range': '周漲幅',
-};
diff --git a/admin-web/src/locales/zh-TW/component.js b/admin-web/src/locales/zh-TW/component.js
deleted file mode 100644
index ba48e299a..000000000
--- a/admin-web/src/locales/zh-TW/component.js
+++ /dev/null
@@ -1,5 +0,0 @@
-export default {
- 'component.tagSelect.expand': '展開',
- 'component.tagSelect.collapse': '收起',
- 'component.tagSelect.all': '全部',
-};
diff --git a/admin-web/src/locales/zh-TW/exception.js b/admin-web/src/locales/zh-TW/exception.js
deleted file mode 100644
index 24a266137..000000000
--- a/admin-web/src/locales/zh-TW/exception.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export default {
- 'app.exception.back': '返回首頁',
- 'app.exception.description.403': '抱歉,妳無權訪問該頁面',
- 'app.exception.description.404': '抱歉,妳訪問的頁面不存在',
- 'app.exception.description.500': '抱歉,服務器出錯了',
-};
diff --git a/admin-web/src/locales/zh-TW/form.js b/admin-web/src/locales/zh-TW/form.js
deleted file mode 100644
index cf1adf548..000000000
--- a/admin-web/src/locales/zh-TW/form.js
+++ /dev/null
@@ -1,37 +0,0 @@
-export default {
- 'form.get-captcha': '獲取驗證碼',
- 'form.captcha.second': '秒',
- 'form.optional': '(選填)',
- 'form.submit': '提交',
- 'form.save': '保存',
- 'form.email.placeholder': '郵箱',
- 'form.password.placeholder': '至少6位密碼,區分大小寫',
- 'form.confirm-password.placeholder': '確認密碼',
- 'form.phone-number.placeholder': '手機號',
- 'form.verification-code.placeholder': '驗證碼',
- 'form.title.label': '標題',
- 'form.title.placeholder': '給目標起個名字',
- 'form.date.label': '起止日期',
- 'form.date.placeholder.start': '開始日期',
- 'form.date.placeholder.end': '結束日期',
- 'form.goal.label': '目標描述',
- 'form.goal.placeholder': '請輸入妳的階段性工作目標',
- 'form.standard.label': '衡量標淮',
- 'form.standard.placeholder': '請輸入衡量標淮',
- 'form.client.label': '客戶',
- 'form.client.label.tooltip': '目標的服務對象',
- 'form.client.placeholder': '請描述妳服務的客戶,內部客戶直接 @姓名/工號',
- 'form.invites.label': '邀評人',
- 'form.invites.placeholder': '請直接 @姓名/工號,最多可邀請 5 人',
- 'form.weight.label': '權重',
- 'form.weight.placeholder': '請輸入',
- 'form.public.label': '目標公開',
- 'form.public.label.help': '客戶、邀評人默認被分享',
- 'form.public.radio.public': '公開',
- 'form.public.radio.partially-public': '部分公開',
- 'form.public.radio.private': '不公開',
- 'form.publicUsers.placeholder': '公開給',
- 'form.publicUsers.option.A': '同事甲',
- 'form.publicUsers.option.B': '同事乙',
- 'form.publicUsers.option.C': '同事丙',
-};
diff --git a/admin-web/src/locales/zh-TW/globalHeader.js b/admin-web/src/locales/zh-TW/globalHeader.js
deleted file mode 100644
index c7b4e6f6c..000000000
--- a/admin-web/src/locales/zh-TW/globalHeader.js
+++ /dev/null
@@ -1,18 +0,0 @@
-export default {
- 'component.globalHeader.search': '站內搜索',
- 'component.globalHeader.search.example1': '搜索提示壹',
- 'component.globalHeader.search.example2': '搜索提示二',
- 'component.globalHeader.search.example3': '搜索提示三',
- 'component.globalHeader.help': '使用手冊',
- 'component.globalHeader.notification': '通知',
- 'component.globalHeader.notification.empty': '妳已查看所有通知',
- 'component.globalHeader.message': '消息',
- 'component.globalHeader.message.empty': '您已讀完所有消息',
- 'component.globalHeader.event': '待辦',
- 'component.globalHeader.event.empty': '妳已完成所有待辦',
- 'component.noticeIcon.clear': '清空',
- 'component.noticeIcon.cleared': '清空了',
- 'component.noticeIcon.empty': '暫無資料',
- 'component.noticeIcon.loaded': '加載完畢',
- 'component.noticeIcon.loading-more': '加載更多',
-};
diff --git a/admin-web/src/locales/zh-TW/login.js b/admin-web/src/locales/zh-TW/login.js
deleted file mode 100644
index ec5706a6c..000000000
--- a/admin-web/src/locales/zh-TW/login.js
+++ /dev/null
@@ -1,38 +0,0 @@
-export default {
- 'app.login.userName': '賬戶',
- 'app.login.password': '密碼',
- 'app.login.message-invalid-credentials': '賬戶或密碼錯誤(admin/ant.design)',
- 'app.login.message-invalid-verification-code': '驗證碼錯誤',
- 'app.login.tab-login-credentials': '賬戶密碼登錄',
- 'app.login.tab-login-mobile': '手機號登錄',
- 'app.login.remember-me': '自動登錄',
- 'app.login.forgot-password': '忘記密碼',
- 'app.login.sign-in-with': '其他登錄方式',
- 'app.login.signup': '註冊賬戶',
- 'app.login.login': '登錄',
- 'app.register.register': '註冊',
- 'app.register.get-verification-code': '獲取驗證碼',
- 'app.register.sign-in': '使用已有賬戶登錄',
- 'app.register-result.msg': '妳的賬戶:{email} 註冊成功',
- 'app.register-result.activation-email':
- '激活郵件已發送到妳的郵箱中,郵件有效期為24小時。請及時登錄郵箱,點擊郵件中的鏈接激活帳戶。',
- 'app.register-result.back-home': '返回首頁',
- 'app.register-result.view-mailbox': '查看郵箱',
- 'validation.email.required': '請輸入郵箱地址!',
- 'validation.email.wrong-format': '郵箱地址格式錯誤!',
- 'validation.userName.required': '請輸入賬戶!',
- 'validation.password.required': '請輸入密碼!',
- 'validation.password.twice': '兩次輸入的密碼不匹配!',
- 'validation.password.strength.msg': '請至少輸入 6 個字符。請不要使用容易被猜到的密碼。',
- 'validation.password.strength.strong': '強度:強',
- 'validation.password.strength.medium': '強度:中',
- 'validation.password.strength.short': '強度:太短',
- 'validation.confirm-password.required': '請確認密碼!',
- 'validation.phone-number.required': '請輸入手機號!',
- 'validation.phone-number.wrong-format': '手機號格式錯誤!',
- 'validation.verification-code.required': '請輸入驗證碼!',
- 'validation.title.required': '請輸入標題',
- 'validation.date.required': '請選擇起止日期',
- 'validation.goal.required': '請輸入目標描述',
- 'validation.standard.required': '請輸入衡量標淮',
-};
diff --git a/admin-web/src/locales/zh-TW/menu.js b/admin-web/src/locales/zh-TW/menu.js
deleted file mode 100644
index 7bd71a7a7..000000000
--- a/admin-web/src/locales/zh-TW/menu.js
+++ /dev/null
@@ -1,41 +0,0 @@
-export default {
- 'menu.home': '首頁',
- 'menu.login': '登錄',
- 'menu.register': '註冊',
- 'menu.register.resultt': '註冊結果',
- 'menu.dashboard': 'Dashboard',
- 'menu.dashboard.analysis': '分析頁',
- 'menu.dashboard.monitor': '監控頁',
- 'menu.dashboard.workplace': '工作臺',
- 'menu.form': '表單頁',
- 'menu.form.basicform': '基礎表單',
- 'menu.form.stepform': '分步表單',
- 'menu.form.stepform.info': '分步表單(填寫轉賬信息)',
- 'menu.form.stepform.confirm': '分步表單(確認轉賬信息)',
- 'menu.form.stepform.result': '分步表單(完成)',
- 'menu.form.advancedform': '高級表單',
- 'menu.list': '列表頁',
- 'menu.list.searchtable': '查詢表格',
- 'menu.list.basiclist': '標淮列表',
- 'menu.list.cardlist': '卡片列表',
- 'menu.list.searchlist': '搜索列表',
- 'menu.list.searchlist.articles': '搜索列表(文章)',
- 'menu.list.searchlist.projects': '搜索列表(項目)',
- 'menu.list.searchlist.applications': '搜索列表(應用)',
- 'menu.profile': '詳情頁',
- 'menu.profile.basic': '基礎詳情頁',
- 'menu.profile.advanced': '高級詳情頁',
- 'menu.result': '結果頁',
- 'menu.result.success': '成功頁',
- 'menu.result.fail': '失敗頁',
- 'menu.account': '個人頁',
- 'menu.account.center': '個人中心',
- 'menu.account.settings': '個人設置',
- 'menu.account.trigger': '觸發報錯',
- 'menu.account.logout': '退出登錄',
- 'menu.exception': '异常页',
- 'menu.exception.not-permission': '403',
- 'menu.exception.not-find': '404',
- 'menu.exception.server-error': '500',
- 'menu.exception.trigger': '触发错误',
-};
diff --git a/admin-web/src/locales/zh-TW/monitor.js b/admin-web/src/locales/zh-TW/monitor.js
deleted file mode 100644
index d19ac054d..000000000
--- a/admin-web/src/locales/zh-TW/monitor.js
+++ /dev/null
@@ -1,18 +0,0 @@
-export default {
- 'app.monitor.trading-activity': '活動實時交易情況',
- 'app.monitor.total-transactions': '今日交易總額',
- 'app.monitor.sales-target': '銷售目標完成率',
- 'app.monitor.remaining-time': '活動剩余時間',
- 'app.monitor.total-transactions-per-second': '每秒交易總額',
- 'app.monitor.activity-forecast': '活動情況預測',
- 'app.monitor.efficiency': '券核效率',
- 'app.monitor.ratio': '跳出率',
- 'app.monitor.proportion-per-category': '各品類占比',
- 'app.monitor.fast-food': '中式快餐',
- 'app.monitor.western-food': '西餐',
- 'app.monitor.hot-pot': '火鍋',
- 'app.monitor.waiting-for-implementation': 'Waiting for implementation',
- 'app.monitor.popular-searches': '熱門搜索',
- 'app.monitor.resource-surplus': '資源剩余',
- 'app.monitor.fund-surplus': '補貼資金剩余',
-};
diff --git a/admin-web/src/locales/zh-TW/pwa.js b/admin-web/src/locales/zh-TW/pwa.js
deleted file mode 100644
index 108a6e489..000000000
--- a/admin-web/src/locales/zh-TW/pwa.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export default {
- 'app.pwa.offline': '當前處於離線狀態',
- 'app.pwa.serviceworker.updated': '有新內容',
- 'app.pwa.serviceworker.updated.hint': '請點擊“刷新”按鈕或者手動刷新頁面',
- 'app.pwa.serviceworker.updated.ok': '刷新',
-};
diff --git a/admin-web/src/locales/zh-TW/result.js b/admin-web/src/locales/zh-TW/result.js
deleted file mode 100644
index a87b96e5c..000000000
--- a/admin-web/src/locales/zh-TW/result.js
+++ /dev/null
@@ -1,27 +0,0 @@
-export default {
- 'app.result.error.title': '提交失敗',
- 'app.result.error.description': '請核對並修改以下信息後,再重新提交。',
- 'app.result.error.hint-title': '您提交的內容有如下錯誤:',
- 'app.result.error.hint-text1': '您的賬戶已被凍結',
- 'app.result.error.hint-btn1': '立即解凍',
- 'app.result.error.hint-text2': '您的賬戶還不具備申請資格',
- 'app.result.error.hint-btn2': '立即升級',
- 'app.result.error.btn-text': '返回修改',
- 'app.result.success.title': '提交成功',
- 'app.result.success.description':
- '提交結果頁用於反饋壹系列操作任務的處理結果, 如果僅是簡單操作,使用 Message 全局提示反饋即可。 本文字區域可以展示簡單的補充說明,如果有類似展示 “單據”的需求,下面這個灰色區域可以呈現比較復雜的內容。',
- 'app.result.success.operate-title': '項目名稱',
- 'app.result.success.operate-id': '項目 ID:',
- 'app.result.success.principal': '負責人:',
- 'app.result.success.operate-time': '生效時間:',
- 'app.result.success.step1-title': '創建項目',
- 'app.result.success.step1-operator': '曲麗麗',
- 'app.result.success.step2-title': '部門初審',
- 'app.result.success.step2-operator': '周毛毛',
- 'app.result.success.step2-extra': '催壹下',
- 'app.result.success.step3-title': '財務復核',
- 'app.result.success.step4-title': '完成',
- 'app.result.success.btn-return': '返回列表',
- 'app.result.success.btn-project': '查看項目',
- 'app.result.success.btn-print': '打印',
-};
diff --git a/admin-web/src/locales/zh-TW/settingDrawer.js b/admin-web/src/locales/zh-TW/settingDrawer.js
deleted file mode 100644
index 24dc281fa..000000000
--- a/admin-web/src/locales/zh-TW/settingDrawer.js
+++ /dev/null
@@ -1,31 +0,0 @@
-export default {
- 'app.setting.pagestyle': '整體風格設置',
- 'app.setting.pagestyle.dark': '暗色菜單風格',
- 'app.setting.pagestyle.light': '亮色菜單風格',
- 'app.setting.content-width': '內容區域寬度',
- 'app.setting.content-width.fixed': '定寬',
- 'app.setting.content-width.fluid': '流式',
- 'app.setting.themecolor': '主題色',
- 'app.setting.themecolor.dust': '薄暮',
- 'app.setting.themecolor.volcano': '火山',
- 'app.setting.themecolor.sunset': '日暮',
- 'app.setting.themecolor.cyan': '明青',
- 'app.setting.themecolor.green': '極光綠',
- 'app.setting.themecolor.daybreak': '拂曉藍(默認)',
- 'app.setting.themecolor.geekblue': '極客藍',
- 'app.setting.themecolor.purple': '醬紫',
- 'app.setting.navigationmode': '導航模式',
- 'app.setting.sidemenu': '側邊菜單布局',
- 'app.setting.topmenu': '頂部菜單布局',
- 'app.setting.fixedheader': '固定 Header',
- 'app.setting.fixedsidebar': '固定側邊菜單',
- 'app.setting.fixedsidebar.hint': '側邊菜單布局時可配置',
- 'app.setting.hideheader': '下滑時隱藏 Header',
- 'app.setting.hideheader.hint': '固定 Header 時可配置',
- 'app.setting.othersettings': '其他設置',
- 'app.setting.weakmode': '色弱模式',
- 'app.setting.copy': '拷貝設置',
- 'app.setting.copyinfo': '拷貝成功,請到 src/defaultSettings.js 中替換默認配置',
- 'app.setting.production.hint':
- '配置欄只在開發環境用於預覽,生產環境不會展現,請拷貝後手動修改配置文件',
-};
diff --git a/admin-web/src/locales/zh-TW/settings.js b/admin-web/src/locales/zh-TW/settings.js
deleted file mode 100644
index dd45151a8..000000000
--- a/admin-web/src/locales/zh-TW/settings.js
+++ /dev/null
@@ -1,55 +0,0 @@
-export default {
- 'app.settings.menuMap.basic': '基本設置',
- 'app.settings.menuMap.security': '安全設置',
- 'app.settings.menuMap.binding': '賬號綁定',
- 'app.settings.menuMap.notification': '新消息通知',
- 'app.settings.basic.avatar': '頭像',
- 'app.settings.basic.change-avatar': '更換頭像',
- 'app.settings.basic.email': '郵箱',
- 'app.settings.basic.email-message': '請輸入您的郵箱!',
- 'app.settings.basic.nickname': '昵稱',
- 'app.settings.basic.nickname-message': '請輸入您的昵稱!',
- 'app.settings.basic.profile': '個人簡介',
- 'app.settings.basic.profile-message': '請輸入個人簡介!',
- 'app.settings.basic.profile-placeholder': '個人簡介',
- 'app.settings.basic.country': '國家/地區',
- 'app.settings.basic.country-message': '請輸入您的國家或地區!',
- 'app.settings.basic.geographic': '所在省市',
- 'app.settings.basic.geographic-message': '請輸入您的所在省市!',
- 'app.settings.basic.address': '街道地址',
- 'app.settings.basic.address-message': '請輸入您的街道地址!',
- 'app.settings.basic.phone': '聯系電話',
- 'app.settings.basic.phone-message': '請輸入您的聯系電話!',
- 'app.settings.basic.update': '更新基本信息',
- 'app.settings.security.strong': '強',
- 'app.settings.security.medium': '中',
- 'app.settings.security.weak': '弱',
- 'app.settings.security.password': '賬戶密碼',
- 'app.settings.security.password-description': '當前密碼強度',
- 'app.settings.security.phone': '密保手機',
- 'app.settings.security.phone-description': '已綁定手機',
- 'app.settings.security.question': '密保問題',
- 'app.settings.security.question-description': '未設置密保問題,密保問題可有效保護賬戶安全',
- 'app.settings.security.email': '備用郵箱',
- 'app.settings.security.email-description': '已綁定郵箱',
- 'app.settings.security.mfa': 'MFA 設備',
- 'app.settings.security.mfa-description': '未綁定 MFA 設備,綁定後,可以進行二次確認',
- 'app.settings.security.modify': '修改',
- 'app.settings.security.set': '設置',
- 'app.settings.security.bind': '綁定',
- 'app.settings.binding.taobao': '綁定淘寶',
- 'app.settings.binding.taobao-description': '當前未綁定淘寶賬號',
- 'app.settings.binding.alipay': '綁定支付寶',
- 'app.settings.binding.alipay-description': '當前未綁定支付寶賬號',
- 'app.settings.binding.dingding': '綁定釘釘',
- 'app.settings.binding.dingding-description': '當前未綁定釘釘賬號',
- 'app.settings.binding.bind': '綁定',
- 'app.settings.notification.password': '賬戶密碼',
- 'app.settings.notification.password-description': '其他用戶的消息將以站內信的形式通知',
- 'app.settings.notification.messages': '系統消息',
- 'app.settings.notification.messages-description': '系統消息將以站內信的形式通知',
- 'app.settings.notification.todo': '待辦任務',
- 'app.settings.notification.todo-description': '待辦任務將以站內信的形式通知',
- 'app.settings.open': '開',
- 'app.settings.close': '關',
-};
diff --git a/admin-web/src/manifest.json b/admin-web/src/manifest.json
deleted file mode 100644
index 839bc5b5e..000000000
--- a/admin-web/src/manifest.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "name": "Ant Design Pro",
- "short_name": "Ant Design Pro",
- "display": "standalone",
- "start_url": "./?utm_source=homescreen",
- "theme_color": "#002140",
- "background_color": "#001529",
- "icons": [
- {
- "src": "icons/icon-192x192.png",
- "sizes": "192x192"
- },
- {
- "src": "icons/icon-128x128.png",
- "sizes": "128x128"
- },
- {
- "src": "icons/icon-512x512.png",
- "sizes": "512x512"
- }
- ]
-}
diff --git a/admin-web/src/mock-data/authRoutesData.js b/admin-web/src/mock-data/authRoutesData.js
deleted file mode 100644
index 64016f29e..000000000
--- a/admin-web/src/mock-data/authRoutesData.js
+++ /dev/null
@@ -1,6 +0,0 @@
-function getAuthRoutesData() {
- // return {authority: ['admin', 'user']}
- return { authority: ['guest'] };
-}
-
-export default getAuthRoutesData();
diff --git a/admin-web/src/mock-data/currentUserData.js b/admin-web/src/mock-data/currentUserData.js
deleted file mode 100644
index 202c7ea2c..000000000
--- a/admin-web/src/mock-data/currentUserData.js
+++ /dev/null
@@ -1,56 +0,0 @@
-// TODO 临时使用,后台暂时无接口
-
-function getCurrentUser() {
- return {
- name: 'Serati Ma',
- avatar: 'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png',
- userid: '00000001',
- email: 'antdesign@alipay.com',
- signature: '海纳百川,有容乃大',
- title: '交互专家',
- group: '蚂蚁金服-某某某事业群-某某平台部-某某技术部-UED',
- tags: [
- {
- key: '0',
- label: '很有想法的',
- },
- {
- key: '1',
- label: '专注设计',
- },
- {
- key: '2',
- label: '辣~',
- },
- {
- key: '3',
- label: '大长腿',
- },
- {
- key: '4',
- label: '川妹子',
- },
- {
- key: '5',
- label: '海纳百川',
- },
- ],
- notifyCount: 12,
- unreadCount: 11,
- country: 'China',
- geographic: {
- province: {
- label: '浙江省',
- key: '330000',
- },
- city: {
- label: '杭州市',
- key: '330100',
- },
- },
- address: '西湖区工专路 77 号',
- phone: '0752-268888888',
- };
-}
-
-export default getCurrentUser();
diff --git a/admin-web/src/models/admin/adminList.js b/admin-web/src/models/admin/adminList.js
deleted file mode 100644
index cade26268..000000000
--- a/admin-web/src/models/admin/adminList.js
+++ /dev/null
@@ -1,306 +0,0 @@
-import { message } from 'antd';
-import { buildTreeNode, findCheckedKeys } from '../../utils/tree.utils';
-import {
- addAdmin,
- adminRoleAssign,
- deleteAdmin,
- queryAdminRoleList,
- updateAdmin,
- updateAdminStatus,
- deptTreeAll,
-} from '../../services/admin';
-import {
- adminPage
-} from '../../services/system';
-import { arrayToStringParams } from '../../utils/request.qs';
-import PaginationHelper from '../../../helpers/PaginationHelper';
-
-const SEARCH_PARAMS_DEFAULT = {
- name: '',
-};
-
-const buildSelectTree = list => {
- return list.map(item => {
- let children = [];
- if (item.children) {
- children = buildSelectTree(item.children);
- }
- return {
- title: item.name,
- value: `${item.name}-${item.id}`,
- key: item.id,
- children,
- };
- });
-};
-
-export default {
- namespace: 'adminList',
-
- state: {
- // 分页列表相关
- list: [],
- listLoading: false,
- pagination: PaginationHelper.defaultPaginationConfig,
- searchParams: SEARCH_PARAMS_DEFAULT,
-
- // 添加 or 修改表单相关
- modalVisible: false,
- modalType: undefined, // 'add' or 'update' 表单
- formVals: {}, // 当前表单值
- modalLoading: false,
-
- // 分配角色表单相关
- roleList: [],
- roleModalVisible: false,
- roleCheckedKeys: [], // 此处的 Key ,就是角色编号
- roleAssignLoading: false,
-
- //部门相关
- deptSelectTree: [],
- },
-
- effects: {
- *getDeptmentTree({ payload }, { call, put }) {
- const result = yield call(deptTreeAll, payload);
- yield put({
- type: 'treeSuccess',
- payload: result.data,
- });
- },
-
- // 查询列表
- *query({ payload }, { call, put }) {
- // 显示加载中
- yield put({
- type: 'changeListLoading',
- payload: true,
- });
-
- // 请求
- const response = yield call(adminPage, payload);
- // 响应
- yield put({
- type: 'setAll',
- payload: {
- list: response.data.list,
- pagination: PaginationHelper.formatPagination(response.data, payload),
- searchParams: {
- name: payload.name || '',
- },
- },
- });
-
- // 隐藏加载中
- yield put({
- type: 'changeListLoading',
- payload: false,
- });
- },
- *add({ payload }, { call, put }) {
- // 显示加载中
- yield put({
- type: 'changeModalLoading',
- payload: true,
- });
-
- // 请求
- const { callback, body } = payload;
- const response = yield call(addAdmin, body);
- // 响应
- if (response.code === 0) {
- if (callback) {
- callback(response);
- }
- // 刷新列表
- yield put({
- type: 'query',
- payload: {
- ...PaginationHelper.defaultPayload,
- },
- });
- }
-
- // 隐藏加载中
- yield put({
- type: 'changeModalLoading',
- payload: false,
- });
- },
- *update({ payload }, { call, put }) {
- const { callback, body } = payload;
- // 显示加载中
- yield put({
- type: 'changeModalLoading',
- payload: true,
- });
-
- // 请求
- const response = yield call(updateAdmin, body);
- // 响应
- if (response.code === 0) {
- if (callback) {
- callback(response);
- }
- // 刷新列表
- yield put({
- type: 'query',
- payload: {
- ...PaginationHelper.defaultPayload,
- },
- });
- }
-
- // 隐藏加载中
- yield put({
- type: 'changeModalLoading',
- payload: false,
- });
- },
-
- *updateStatus({ payload }, { call, put }) {
- // 请求
- const response = yield call(updateAdminStatus, payload);
- // 响应
- if (response.code === 0) {
- message.info('更新状态成功!');
- // 刷新列表
- yield put({
- type: 'query',
- payload: {
- ...PaginationHelper.defaultPayload,
- },
- });
- }
- },
-
- *delete({ payload }, { call, put }) {
- // 请求
- const response = yield call(deleteAdmin, payload);
- // 响应
- if (response.code === 0) {
- message.info('删除成功!');
- // 刷新列表
- yield put({
- type: 'query',
- payload: {
- ...PaginationHelper.defaultPayload,
- },
- });
- }
- },
-
- *queryRoleList({ payload }, { call, put }) {
- // 显示加载中
- yield put({
- type: 'changeRoleAssignLoading',
- payload: true,
- });
-
- // 请求
- const response = yield call(queryAdminRoleList, payload);
- // 响应
- if (response.code === 0) {
- const roleList = response.data;
- const roleTreeData = buildTreeNode(roleList, 'name', 'id');
- const roleCheckedKeys = findCheckedKeys(roleList);
- yield put({
- type: 'setAll',
- payload: {
- roleList: roleTreeData,
- roleCheckedKeys,
- },
- });
- }
-
- // 隐藏加载中
- yield put({
- type: 'changeRoleAssignLoading',
- payload: false,
- });
- },
-
- *roleAssign({ payload }, { call, put }) {
- const { callback, body } = payload;
- // 显示加载中
- yield put({
- type: 'changeRoleAssignLoading',
- payload: true,
- });
-
- // 请求
- const response = yield call(adminRoleAssign, {
- id: body.id,
- roleIds: arrayToStringParams(body.roleIds),
- });
- // 响应
- if (response.code === 0) {
- if (callback) {
- callback(response);
- }
- }
-
- // 隐藏加载中
- yield put({
- type: 'changeRoleAssignLoading',
- payload: false,
- });
- },
- },
-
- reducers: {
- treeSuccess(state, { payload }) {
- const resultData = payload;
- const treeData = buildSelectTree(resultData);
-
- // // value 要保护 displayName 不然,搜索会失效
- // const rootNode = [
- // {
- // title: '根节点',
- // value: `根节点-0`,
- // key: 0,
- // children: [],
- // },
- // ];
-
- // const deptSelectTree = rootNode.concat(treeData);
- return {
- ...state,
- // list: resultData,
- deptSelectTree: treeData,
- };
- },
- changeRoleCheckedKeys(state, { payload }) {
- return {
- ...state,
- roleCheckedKeys: payload,
- };
- },
- // 修改加载中的状态
- changeRoleAssignLoading(state, { payload }) {
- return {
- ...state,
- roleAssignLoading: payload,
- };
- },
- changeModalLoading(state, { payload }) {
- return {
- ...state,
- modalLoading: payload,
- };
- },
- changeListLoading(state, { payload }) {
- return {
- ...state,
- listLoading: payload,
- };
- },
- // 设置所有属性
- setAll(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- },
- },
-};
diff --git a/admin-web/src/models/admin/deptmentList.js b/admin-web/src/models/admin/deptmentList.js
deleted file mode 100644
index b659beca0..000000000
--- a/admin-web/src/models/admin/deptmentList.js
+++ /dev/null
@@ -1,110 +0,0 @@
-import { message } from 'antd';
-import {
- deptTreePage,
- deptTreeAll,
- addDeptment,
- updateDeptment,
- deleteDeptment,
-} from '../../services/admin';
-
-const buildSelectTree = list => {
- return list.map(item => {
- let children = [];
- if (item.children) {
- children = buildSelectTree(item.children);
- }
- return {
- title: item.name,
- value: `${item.name}-${item.id}`,
- key: item.id,
- children,
- };
- });
-};
-
-export default {
- namespace: 'deptmentList',
-
- state: {
- list: [],
- selectTree: [],
- deptmentData: {
- list: [],
- },
- },
-
- effects: {
- *add({ payload }, { call, put }) {
- const { onSuccess, body } = payload;
- const response = yield call(addDeptment, body);
- if (response && response.code === 0) {
- onSuccess && onSuccess();
- }
- },
- *delete({ payload }, { call, put }) {
- const { onSuccess, body } = payload;
- const response = yield call(deleteDeptment, body);
- if (response && response.code === 0) {
- onSuccess && onSuccess();
- }
- },
- *update({ payload }, { call, put }) {
- const { onSuccess, body } = payload;
- const response = yield call(updateDeptment, body);
- if (response && response.code === 0) {
- onSuccess && onSuccess();
- }
- },
- *getDeptmentAll({ payload }, { call, put }) {
- const result = yield call(deptTreeAll, payload);
- yield put({
- type: 'treeSuccess',
- payload: result.data,
- });
- },
- *getDeptmentList({ payload }, { call, put }) {
- const result = yield call(deptTreePage, payload);
- let deptmentData = {};
- if (result.code === 0) {
- deptmentData = result.data;
- }
- yield put({
- type: 'save',
- payload: {
- deptmentData,
- },
- });
- },
- },
-
- reducers: {
- save(state, action) {
- return {
- ...state,
- ...action.payload,
- };
- },
-
- treeSuccess(state, { payload }) {
- const resultData = payload;
- const treeData = buildSelectTree(resultData);
-
- // value 要保护 displayName 不然,搜索会失效
- const rootNode = [
- {
- title: '根节点',
- value: `根节点-0`,
- key: 0,
- children: [],
- },
- ];
-
- const selectTree = rootNode.concat(treeData);
- return {
- ...state,
- list: resultData,
- selectTree,
- };
- },
- },
-};
diff --git a/admin-web/src/models/admin/dictionaryContext.js b/admin-web/src/models/admin/dictionaryContext.js
deleted file mode 100644
index 0052560fe..000000000
--- a/admin-web/src/models/admin/dictionaryContext.js
+++ /dev/null
@@ -1,46 +0,0 @@
-import { dictionaryTree } from '../../services/admin';
-
-export default {
- namespace: 'dictionaryContext',
-
- state: {
- dicTree: [],
- dicTreeMap: {},
- },
-
- effects: {
- *tree({ payload }, { call, put }) {
- const response = yield call(dictionaryTree, payload);
- const dicList = response.data;
-
- const dicTreeMap = {};
- dicList.map(item => {
- const dicKey = item.enumValue;
- const dicTreeItem = {};
- item.values.map(item2 => {
- dicTreeItem[item2.value] = item2.displayName;
- return true;
- });
- dicTreeMap[dicKey] = dicTreeItem;
- return true;
- });
-
- yield put({
- type: 'treeSuccess',
- payload: {
- dicTree: dicList,
- dicTreeMap,
- },
- });
- },
- },
-
- reducers: {
- treeSuccess(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- },
- },
-};
diff --git a/admin-web/src/models/admin/dictionaryList.js b/admin-web/src/models/admin/dictionaryList.js
deleted file mode 100644
index ea004ad49..000000000
--- a/admin-web/src/models/admin/dictionaryList.js
+++ /dev/null
@@ -1,95 +0,0 @@
-import {message} from 'antd';
-import {dictionaryAdd, dictionaryDelete, dictionaryList, dictionaryUpdate} from '../../services/admin';
-
-export default {
- namespace: 'dictionaryList',
-
- state: {
- list: [],
- },
-
- effects: {
- *add({ payload }, { call, put }) {
- const { callback, body } = payload;
- const response = yield call(dictionaryAdd, body);
- if (callback) {
- callback(response);
- }
- yield put({
- type: 'tree',
- payload: {},
- });
- },
- *update({ payload }, { call, put }) {
- const { callback, body } = payload;
- const response = yield call(dictionaryUpdate, body);
- if (callback) {
- callback(response);
- }
- yield put({
- type: 'tree',
- payload: {},
- });
- },
- *delete({ payload }, { call, put }) {
- const response = yield call(dictionaryDelete, payload);
- message.info('删除成功!');
- // yield put({
- // type: 'treeSuccess',
- // payload: {
- // list: response.data,
- // },
- // });
- yield put({
- type: 'tree',
- payload: {},
- });
- },
- *tree({ payload }, { call, put }) {
- const { queryParams } = payload;
- const response = yield call(dictionaryList, queryParams);
- message.info('查询成功!');
-
- // 将数据格式化成 tree 格式
- // debugger;
- let treeNodeMap = new Map(); // key: enumValue value: Node
- for(let i = 0, len = response.data.length; i < len; i++){
- let dataDict = response.data[i];
- let treeNode = treeNodeMap.get(dataDict.enumValue);
- if (!treeNode) {
- treeNode = {
- enumValue: dataDict.enumValue,
- children: [dataDict]
- };
- treeNodeMap.set(dataDict.enumValue, treeNode);
- treeNode.index = dataDict.enumValue; // 因为 Table 必须要有 rowKey ,所以这里需要处理下。主要是数据字典的结构特殊
- } else {
- treeNode.children.push(dataDict);
- }
- dataDict.index = dataDict.id; // 因为 Table 必须要有 rowKey ,所以这里需要处理下。主要是数据字典的结构特殊
- }
- // 因为不支持 Map.values() 返回的结果,所以这里进行转换。
- let list = [];
- treeNodeMap.forEach(function (value, key, map) {
- list.push(value)
- });
- // console.log(list);
-
- yield put({
- type: 'treeSuccess',
- payload: {
- list: list,
- },
- });
- },
- },
-
- reducers: {
- treeSuccess(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- },
- },
-};
diff --git a/admin-web/src/models/admin/resourceList.js b/admin-web/src/models/admin/resourceList.js
deleted file mode 100644
index c6071d4fd..000000000
--- a/admin-web/src/models/admin/resourceList.js
+++ /dev/null
@@ -1,92 +0,0 @@
-import { message } from 'antd';
-import { resourceTree, resourceCreate, resourceUpdate, resourceDelete } from '../../services/system';
-
-const buildSelectTree = list => {
- return list.map(item => {
- let children = [];
- if (item.children) {
- children = buildSelectTree(item.children);
- }
- return {
- title: item.name,
- value: `${item.name}-${item.id}`,
- key: item.id,
- children,
- };
- });
-};
-
-export default {
- namespace: 'resourceList',
-
- state: {
- list: [],
- selectTree: [],
- },
-
- effects: {
- *add({ payload }, { call, put }) {
- const { callback, body } = payload;
- const response = yield call(resourceCreate, body);
- if (callback) {
- callback(response);
- }
- yield put({
- type: 'tree',
- payload: {},
- });
- },
- *update({ payload }, { call, put }) {
- const { callback, body } = payload;
- const response = yield call(resourceUpdate, body);
- if (callback) {
- callback(response);
- }
- yield put({
- type: 'tree',
- payload: {},
- });
- },
- *delete({ payload }, { call, put }) {
- yield call(resourceDelete, payload);
- message.info('删除成功!');
- yield put({
- type: 'tree',
- payload: {},
- });
- },
- *tree({ payload }, { call, put }) {
- const { queryParams } = payload;
- const response = yield call(resourceTree, queryParams);
- message.info('查询成功!');
- yield put({
- type: 'treeSuccess',
- payload: response.data,
- });
- },
- },
-
- reducers: {
- treeSuccess(state, { payload }) {
- const resultData = payload;
- const treeData = buildSelectTree(resultData);
-
- // value 要保护 name 不然,搜索会失效
- const rootNode = [
- {
- title: '根节点',
- value: `根节点-0`,
- key: 0,
- children: [],
- },
- ];
-
- const selectTree = rootNode.concat(treeData);
- return {
- ...state,
- list: resultData,
- selectTree,
- };
- },
- },
-};
diff --git a/admin-web/src/models/admin/roleList.js b/admin-web/src/models/admin/roleList.js
deleted file mode 100644
index 7efc7cad3..000000000
--- a/admin-web/src/models/admin/roleList.js
+++ /dev/null
@@ -1,138 +0,0 @@
-import { message } from 'antd';
-import { arrayToStringParams } from '../../utils/request.qs';
-import { buildTreeNode, findAllNodes, findCheckedKeys } from '../../utils/tree.utils';
-import {
- authorizationRoleResourceTree,
- authorizationRoleAssignResource,
-} from '../../services/system';
-import {
- rolePage,
- roleCreate,
- roleUpdate,
- roleDelete,
-} from '../../services/system';
-
-
-export default {
- namespace: 'roleList',
-
- state: {
- list: [],
- count: 0,
- pageNo: 0,
- pageSize: 10,
-
- roleTreeData: [],
- checkedKeys: [],
- assignModalLoading: true,
- },
-
- effects: {
- *add({ payload }, { call, put }) {
- const { callback, body, queryParams } = payload;
- const response = yield call(roleCreate, body);
- if (callback) {
- callback(response);
- }
- yield put({
- type: 'query',
- payload: {
- ...queryParams,
- },
- });
- },
- *update({ payload }, { call, put }) {
- const { callback, body, queryParams } = payload;
- const response = yield call(roleUpdate, body);
- if (callback) {
- callback(response);
- }
- yield put({
- type: 'query',
- payload: {
- ...queryParams,
- },
- });
- },
- *delete({ payload }, { call, put }) {
- const { queryParams, body } = payload;
- yield call(roleDelete, body);
- message.info('删除成功!');
- yield put({
- type: 'query',
- payload: {
- ...queryParams,
- },
- });
- },
- *query({ payload }, { call, put }) {
- const response = yield call(rolePage, payload);
- message.info('查询成功!');
- const { total, list } = response.data;
- yield put({
- type: 'querySuccess',
- payload: {
- list: list,
- count: total,
- },
- });
- },
- *queryRoleAssign({ payload }, { call, put }) {
- yield put({
- type: 'changeAssignModalLoading',
- payload: true,
- });
-
- const response = yield call(authorizationRoleResourceTree, payload);
- const roleResourceTree = response.data;
- const roleTreeData = buildTreeNode(roleResourceTree, 'name', 'id');
- const checkedKeys = findCheckedKeys(roleResourceTree);
-
- yield put({
- type: 'querySuccess',
- payload: {
- checkedKeys,
- roleTreeData,
- },
- });
-
- yield put({
- type: 'changeAssignModalLoading',
- payload: false,
- });
- },
- *roleAssignResource({ payload }, { call }) {
- const { roleId, resourceIds, roleTreeData } = payload;
- const assignNodes = findAllNodes(resourceIds, roleTreeData);
- const params = {
- roleId,
- resourceIds: arrayToStringParams(assignNodes),
- };
- const response = yield call(authorizationRoleAssignResource, params);
- if (response.code === 0) {
- message.info('操作成功!');
- }
- },
- },
-
- reducers: {
- querySuccess(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- },
- changeCheckedKeys(state, { payload }) {
- return {
- ...state,
- checkedKeys: payload,
- };
- },
- changeAssignModalLoading(state, { payload }) {
- return {
- ...state,
- assignModalLoading: payload,
- };
- },
- },
-};
diff --git a/admin-web/src/models/global.js b/admin-web/src/models/global.js
deleted file mode 100644
index 42895b592..000000000
--- a/admin-web/src/models/global.js
+++ /dev/null
@@ -1,141 +0,0 @@
-import { queryNotices } from '@/services/api';
-
-export default {
- namespace: 'global',
-
- state: {
- collapsed: false,
- notices: [],
- loadedAllNotices: false,
- },
-
- effects: {
- *fetchNotices(_, { call, put, select }) {
- const data = yield call(queryNotices);
- const loadedAllNotices = data && data.length && data[data.length - 1] === null;
- yield put({
- type: 'setLoadedStatus',
- payload: loadedAllNotices,
- });
- yield put({
- type: 'saveNotices',
- payload: data.filter(item => item),
- });
- const unreadCount = yield select(
- state => state.global.notices.filter(item => !item.read).length
- );
- yield put({
- type: 'user/changeNotifyCount',
- payload: {
- totalCount: data.length,
- unreadCount,
- },
- });
- },
- *fetchMoreNotices({ payload }, { call, put, select }) {
- const data = yield call(queryNotices, payload);
- const loadedAllNotices = data && data.length && data[data.length - 1] === null;
- yield put({
- type: 'setLoadedStatus',
- payload: loadedAllNotices,
- });
- yield put({
- type: 'pushNotices',
- payload: data.filter(item => item),
- });
- const unreadCount = yield select(
- state => state.global.notices.filter(item => !item.read).length
- );
- yield put({
- type: 'user/changeNotifyCount',
- payload: {
- totalCount: data.length,
- unreadCount,
- },
- });
- },
- *clearNotices({ payload }, { put, select }) {
- yield put({
- type: 'saveClearedNotices',
- payload,
- });
- const count = yield select(state => state.global.notices.length);
- const unreadCount = yield select(
- state => state.global.notices.filter(item => !item.read).length
- );
- yield put({
- type: 'user/changeNotifyCount',
- payload: {
- totalCount: count,
- unreadCount,
- },
- });
- },
- *changeNoticeReadState({ payload }, { put, select }) {
- const notices = yield select(state =>
- state.global.notices.map(item => {
- const notice = { ...item };
- if (notice.id === payload) {
- notice.read = true;
- }
- return notice;
- })
- );
- yield put({
- type: 'saveNotices',
- payload: notices,
- });
- yield put({
- type: 'user/changeNotifyCount',
- payload: {
- totalCount: notices.length,
- unreadCount: notices.filter(item => !item.read).length,
- },
- });
- },
- },
-
- reducers: {
- changeLayoutCollapsed(state, { payload }) {
- return {
- ...state,
- collapsed: payload,
- };
- },
- saveNotices(state, { payload }) {
- return {
- ...state,
- notices: payload,
- };
- },
- saveClearedNotices(state, { payload }) {
- return {
- ...state,
- notices: state.notices.filter(item => item.type !== payload),
- };
- },
- pushNotices(state, { payload }) {
- return {
- ...state,
- notices: [...state.notices, ...payload],
- };
- },
- setLoadedStatus(state, { payload }) {
- return {
- ...state,
- loadedAllNotices: payload,
- };
- },
- },
-
- subscriptions: {
- setup({ history }) {
- // Subscribe history(url) change, trigger `load` action if pathname is `/`
- return history.listen(({ pathname, search }) => {
- if (typeof window.ga !== 'undefined') {
- window.ga('send', 'pageview', pathname + search);
- }
- });
- },
- },
-};
diff --git a/admin-web/src/models/list.js b/admin-web/src/models/list.js
deleted file mode 100644
index 4758edaaa..000000000
--- a/admin-web/src/models/list.js
+++ /dev/null
@@ -1,54 +0,0 @@
-import { queryFakeList, removeFakeList, addFakeList, updateFakeList } from '@/services/api';
-
-export default {
- namespace: 'list',
-
- state: {
- list: [],
- },
-
- effects: {
- *fetch({ payload }, { call, put }) {
- const response = yield call(queryFakeList, payload);
- yield put({
- type: 'queryList',
- payload: Array.isArray(response) ? response : [],
- });
- },
- *appendFetch({ payload }, { call, put }) {
- const response = yield call(queryFakeList, payload);
- yield put({
- type: 'appendList',
- payload: Array.isArray(response) ? response : [],
- });
- },
- *submit({ payload }, { call, put }) {
- let callback;
- if (payload.id) {
- callback = Object.keys(payload).length === 1 ? removeFakeList : updateFakeList;
- } else {
- callback = addFakeList;
- }
- const response = yield call(callback, payload); // post
- yield put({
- type: 'queryList',
- payload: response,
- });
- },
- },
-
- reducers: {
- queryList(state, action) {
- return {
- ...state,
- list: action.payload,
- };
- },
- appendList(state, action) {
- return {
- ...state,
- list: state.list.concat(action.payload),
- };
- },
- },
-};
diff --git a/admin-web/src/models/login.js b/admin-web/src/models/login.js
deleted file mode 100644
index b39cb6e49..000000000
--- a/admin-web/src/models/login.js
+++ /dev/null
@@ -1,89 +0,0 @@
-import { routerRedux } from 'dva/router';
-import { stringify } from 'qs';
-import { getFakeCaptcha } from '@/services/api';
-import { passportLogin } from '@/services/system';
-import { setAuthority } from '@/utils/authority';
-import { getPageQuery } from '@/utils/utils';
-import { reloadAuthorized } from '@/utils/Authorized';
-import { setLoginToken } from '../utils/cache';
-
-export default {
- namespace: 'login',
-
- state: {
- status: undefined,
- },
-
- effects: {
- *login({ payload }, { call, put }) {
- const response = yield call(passportLogin, payload);
- yield put({
- type: 'changeLoginStatus',
- payload: response,
- });
-
- yield put(routerRedux.replace('/'));
-
- // Login successfully
- if (response.code === 0) {
-
- // 保存 token 到 localStorage,发送请求的时候,会自动取 token 放到 header
- setLoginToken(response.data.authorization.accessToken, response.data.authorization.refreshToken);
- // 此处直接设置为 admin、和 user 角色,因为暂时不做服务控制前段 角色
- setAuthority(['admin', 'user']);
-
- reloadAuthorized();
- const urlParams = new URL(window.location.href);
- const params = getPageQuery();
- let { redirect } = params;
- if (redirect) {
- const redirectUrlParams = new URL(redirect);
- if (redirectUrlParams.origin === urlParams.origin) {
- redirect = redirect.substr(urlParams.origin.length);
- if (redirect.match(/^\/.*#/)) {
- redirect = redirect.substr(redirect.indexOf('#') + 1);
- }
- } else {
- window.location.href = redirect;
- return;
- }
- }
- yield put(routerRedux.replace(redirect || '/'));
- }
- },
-
- *getCaptcha({ payload }, { call }) {
- yield call(getFakeCaptcha, payload);
- },
-
- *logout(_, { put }) {
- yield put({
- type: 'changeLoginStatus',
- payload: {
- status: false,
- currentAuthority: 'guest',
- },
- });
- reloadAuthorized();
- yield put(
- routerRedux.push({
- pathname: '/user/login',
- search: stringify({
- redirect: window.location.href,
- }),
- })
- );
- },
- },
-
- reducers: {
- changeLoginStatus(state, { payload }) {
- setAuthority(payload.currentAuthority);
- return {
- ...state,
- status: payload.status,
- type: payload.type,
- };
- },
- },
-};
diff --git a/admin-web/src/models/menu.js b/admin-web/src/models/menu.js
deleted file mode 100644
index de694e5f4..000000000
--- a/admin-web/src/models/menu.js
+++ /dev/null
@@ -1,238 +0,0 @@
-import memoizeOne from 'memoize-one';
-import isEqual from 'lodash/isEqual';
-import { formatMessage } from 'umi/locale';
-import Authorized from '@/utils/Authorized';
-import { menu } from '../defaultSettings';
-import { resourceTreeAdminMenu, authorizationResourcePermissions } from '../services/system';
-
-const { check } = Authorized;
-
-// Conversion router to menu.
-function formatter(data, parentAuthority, parentName) {
- return data
- .map(item => {
- if (!item.name || !item.path) {
- return null;
- }
-
- let locale = 'menu';
- if (parentName) {
- locale = `${parentName}.${item.name}`;
- } else {
- locale = `menu.${item.name}`;
- }
- // if enableMenuLocale use item.name,
- // close menu international
- const name = menu.disableLocal
- ? item.name
- : formatMessage({ id: locale, defaultMessage: item.name });
- const result = {
- ...item,
- name,
- locale,
- authority: item.authority || parentAuthority,
- };
- if (item.routes) {
- const children = formatter(item.routes, item.authority, locale);
- // Reduce memory usage
- result.children = children;
- }
- delete result.routes;
- return result;
- })
- .filter(item => item);
-}
-
-const memoizeOneFormatter = memoizeOne(formatter, isEqual);
-
-/**
- * get SubMenu or Item
- */
-const getSubMenu = item => {
- // doc: add hideChildrenInMenu
- if (item.children && !item.hideChildrenInMenu && item.children.some(child => child.name)) {
- return {
- ...item,
- children: filterMenuData(item.children), // eslint-disable-line
- };
- }
- return item;
-};
-
-/**
- * filter menuData
- */
-const filterMenuData = menuData => {
- if (!menuData) {
- return [];
- }
- return menuData
- .filter(item => item.name && !item.hideInMenu)
- .map(item => check(item.authority, getSubMenu(item)))
- .filter(item => item);
-};
-
-// 用于生成uuid
-function S4() {
- return ((1 + Math.random()) * 0x10000 || 0).toString(16).substring(1);
-}
-function guid() {
- return S4() + S4() + S4() + S4() + S4() + S4() + S4() + S4();
-}
-
-const findRootMenu = (antDataMenus, rootAntDataMenu, requestDataMenu) => {
- let res;
- for (let i = 0; i < antDataMenus.length; i += 1) {
- const antDataMenu = antDataMenus[i];
- if (antDataMenu.path === requestDataMenu.route) {
- res = rootAntDataMenu;
- break;
- }
- if (antDataMenu.children) {
- res = findRootMenu(antDataMenu.children, antDataMenu, requestDataMenu);
- break;
- }
- }
- return res;
-};
-
-const buildTreeMenu = (antMenuData, moveChildrenMenusData, requestDataMenus) => {
- return requestDataMenus.map(item => {
- if (!item.route) {
- // root 节点
- const uuid = `sms${guid()}`;
- const res = {
- icon: 'user',
- name: item.name,
- path: uuid,
- };
-
- // 子节点
- if (item.children) {
- // 通过子节点找到对于的父节点,设置 path,没有则是 uuid
- const rootMenu = findRootMenu(antMenuData, {}, item.children[0]);
- if (rootMenu) {
- res.path = rootMenu.path;
- }
-
- // 开始递归构建数据结构
- const childrenMenus = buildTreeMenu(antMenuData, moveChildrenMenusData, item.children);
- res.children = childrenMenus;
- }
- return res;
- }
-
- // moveChildrenMenusData 是一个 map,对比 url 地址是否存在,不存在就给一个 404 的页面
- const handleMapperData = moveChildrenMenusData[item.route];
- if (handleMapperData) {
- return {
- ...handleMapperData,
- icon: 'user',
- name: item.name,
- path: item.route,
- };
- }
-
- // 没有就返回404页面
- return moveChildrenMenusData['/exception/404'];
- });
-};
-
-const moveChildrenMenus = antDataMenus => {
- let res = {};
- for (let i = 0; i < antDataMenus.length; i += 1) {
- const antDataMenu = antDataMenus[i];
- res[antDataMenu.path] = {
- ...res,
- ...antDataMenu,
- };
-
- if (antDataMenu.children) {
- const childrenMenus = moveChildrenMenus(antDataMenu.children);
- res = {
- ...res,
- ...childrenMenus,
- };
- }
- }
- return res;
-};
-
-/**
- * 获取面包屑映射
- * @param {Object} menuData 菜单配置
- */
-const getBreadcrumbNameMap = menuData => {
- const routerMap = {};
-
- const flattenMenuData = data => {
- data.forEach(menuItem => {
- if (menuItem.children) {
- flattenMenuData(menuItem.children);
- }
- // Reduce memory usage
- routerMap[menuItem.path] = menuItem;
- });
- };
- flattenMenuData(menuData);
- return routerMap;
-};
-
-const memoizeOneGetBreadcrumbNameMap = memoizeOne(getBreadcrumbNameMap, isEqual);
-
-export default {
- namespace: 'menu',
-
- state: {
- menuData: [],
- urlsData: {},
- breadcrumbNameMap: {},
- },
-
- effects: {
- *getMenuData({ payload }, { put, call }) {
- const { data } = yield call(resourceTreeAdminMenu);
- const { routes, authority } = payload;
-
- // authority 已经不适用
- const antMenuData = filterMenuData(memoizeOneFormatter(routes, authority));
- let menuData = antMenuData;
- // const resultMenuData = data;
- if (data !== 'all') {
- const moveChildrenMenusData = moveChildrenMenus(antMenuData);
- const buildTreeMenuData = buildTreeMenu(antMenuData, moveChildrenMenusData, data);
- menuData = buildTreeMenuData;
- }
-
- // 生成 menu 和 router mapping
- const breadcrumbNameMap = memoizeOneGetBreadcrumbNameMap(menuData);
- yield put({
- type: 'save',
- payload: { menuData, breadcrumbNameMap },
- });
- },
- *getUrlsData(state, { put, call }) {
- const { data } = yield call(authorizationResourcePermissions);
-
- // 构建 {'/user': true} 这种 map 结构方便取数据、
- const urlsData = {};
- data.forEach(item => {
- urlsData[item] = true;
- });
-
- yield put({
- type: 'save',
- payload: { urlsData },
- });
- },
- },
-
- reducers: {
- save(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- },
- },
-};
diff --git a/admin-web/src/models/order/orderDelivery.js b/admin-web/src/models/order/orderDelivery.js
deleted file mode 100644
index 2e007a5ad..000000000
--- a/admin-web/src/models/order/orderDelivery.js
+++ /dev/null
@@ -1,67 +0,0 @@
-import { message } from 'antd';
-import { orderItems, getOrderRecipientInfo, orderDeliver } from '../../services/order';
-
-export default {
- namespace: 'orderDelivery',
-
- state: {
- orderId: null,
- visible: false,
- list: [],
- orderRecipient: {},
- selectedRowKeys: [],
- },
-
- effects: {
- *getOrderItems({ payload }, { call, put }) {
- const response1 = yield call(orderItems, payload);
- const response2 = yield call(getOrderRecipientInfo, payload);
-
- yield put({
- type: 'getOrderItemsSuccess',
- payload: {
- list: response1.data,
- orderRecipient: response2.data,
- },
- });
- },
- *deliver({ payload }, { call, put }) {
- const { code } = yield call(orderDeliver, payload);
- if (code === 0) {
- message.info('发货成功!');
- yield put({
- type: 'changeVisible',
- payload: {
- visible: false,
- },
- });
- }
- },
- },
-
- reducers: {
- getOrderItemsSuccess(state, { payload }) {
- const { list, orderRecipient } = payload;
- return {
- ...state,
- list,
- orderRecipient,
- };
- },
- changeVisible(state, { payload }) {
- const { visible, orderId } = payload;
- return {
- ...state,
- visible,
- orderId,
- };
- },
- changeSelectedRowKeys(state, { payload }) {
- const { selectedRowKeys } = payload;
- return {
- ...state,
- selectedRowKeys,
- };
- },
- },
-};
diff --git a/admin-web/src/models/order/orderList.js b/admin-web/src/models/order/orderList.js
deleted file mode 100644
index 4a3468e93..000000000
--- a/admin-web/src/models/order/orderList.js
+++ /dev/null
@@ -1,167 +0,0 @@
-import { message } from 'antd';
-import {
- orderPage,
- updateOrderItem,
- updateOrderItemPayAmount,
- updateRemark,
- cancelOrder,
-} from '../../services/order';
-
-export default {
- namespace: 'orderList',
-
- state: {
- list: {
- pagination: {
- current: 0,
- pageSize: 10,
- total: 0,
- },
- dataSource: [],
- },
- payAmountVisible: false,
- payAmount: 0,
- orderId: 0,
- orderItemId: 0,
- searchParams: {},
-
- remarkVisible: false,
- remark: '',
-
- orderCancelVisible: false,
- orderCancelShowOther: false,
- },
-
- effects: {
- *queryPage({ payload }, { call, put }) {
- const response = yield call(orderPage, payload);
-
- yield put({
- type: 'changeSearchParams',
- payload: {
- searchParams: {
- ...payload,
- },
- },
- });
-
- message.info('查询成功!', response);
- const { total, orders } = response.data;
- yield put({
- type: 'queryPageSuccess',
- payload: {
- list: {
- dataSource: orders,
- pagination: {
- total,
- current: payload.pageNo,
- pageSize: payload.pageSize,
- },
- },
- },
- });
- },
- *updateOrderItem({ payload }, { call, put }) {
- const { params } = payload;
- const response = yield call(updateOrderItem, params);
- message.info('查询成功!');
- yield put({
- type: 'queryPageSuccess',
- payload: {
- list: response.data,
- },
- });
- },
- *updatePayAmount({ payload }, { call, put }) {
- const { searchParams, params } = payload;
- yield call(updateOrderItemPayAmount, params);
- yield put({
- type: 'changePayAmountVisible',
- payload: {
- payAmountVisible: false,
- },
- });
-
- yield put({
- type: 'queryPage',
- payload: {
- ...searchParams,
- },
- });
- },
- *updateRemake({ payload }, { call, put }) {
- const { searchParams, params } = payload;
- yield call(updateRemark, params);
- yield put({
- type: 'changeRemakeVisible',
- payload: {
- remarkVisible: false,
- },
- });
-
- yield put({
- type: 'queryPage',
- payload: {
- ...searchParams,
- },
- });
- },
- *cancelOrder({ payload }, { call, put }) {
- const { searchParams, params } = payload;
- yield call(cancelOrder, params);
- yield put({
- type: 'changeOrderCancelVisible',
- payload: {
- orderCancelVisible: false,
- },
- });
-
- yield put({
- type: 'queryPage',
- payload: {
- ...searchParams,
- },
- });
- },
- },
-
- reducers: {
- queryPageSuccess(state, { payload }) {
- const { list } = payload;
- return {
- ...state,
- list,
- };
- },
- changePayAmountVisible(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- },
- changeSearchParams(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- },
- changeRemakeVisible(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- },
- changeOrderCancelVisible(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- },
- changeOrderCancelShowOther(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- },
- },
-};
diff --git a/admin-web/src/models/orderRefunds/orderRefunds.js b/admin-web/src/models/orderRefunds/orderRefunds.js
deleted file mode 100644
index 87ed12315..000000000
--- a/admin-web/src/models/orderRefunds/orderRefunds.js
+++ /dev/null
@@ -1,84 +0,0 @@
-import { message } from 'antd';
-import { list, agree, refuse, confirmReceipt, confirmRefund } from '../../services/orderRefunds';
-
-export default {
- namespace: 'orderRefunds',
-
- state: {
- index: 0,
- totalCount: 0,
- pageSize: 20,
- list: [],
- },
-
- effects: {
- *list({ payload }, { call, put }) {
- const response = yield call(list, payload);
- yield put({
- type: 'listSuccess',
- payload: response.data,
- });
- },
- *agree({ payload }, { call }) {
- const { callback, params } = payload;
- const response = yield call(agree, params);
- if (response.code !== 0) {
- message.error('操作失败!');
- } else {
- message.success('操作成功!');
- if (callback) {
- callback(response);
- }
- }
- },
- *refuse({ payload }, { call }) {
- const { callback, params } = payload;
- const response = yield call(refuse, params);
- if (response.code !== 0) {
- message.error('操作失败!');
- } else {
- message.success('操作成功!');
- if (callback) {
- callback(response);
- }
- }
- },
- *confirmReceipt({ payload }, { call }) {
- const { callback, params } = payload;
- const response = yield call(confirmReceipt, params);
- if (response.code !== 0) {
- message.error('操作失败!');
- } else {
- message.success('操作成功!');
- if (callback) {
- callback(response);
- }
- }
- },
- *confirmRefund({ payload }, { call }) {
- const { callback, params } = payload;
- const response = yield call(confirmRefund, params);
- if (response.code !== 0) {
- message.error('操作失败!');
- } else {
- message.success('操作成功!');
- if (callback) {
- callback(response);
- }
- }
- },
- },
-
- reducers: {
- listSuccess(state, { payload }) {
- const { index, totalCount, pageSize, data } = payload;
- return {
- ...state,
- index,
- totalCount,
- pageSize,
- list: data,
- };
- },
- },
-};
diff --git a/admin-web/src/models/pay/payRefundList.js b/admin-web/src/models/pay/payRefundList.js
deleted file mode 100644
index 067ff8ad4..000000000
--- a/admin-web/src/models/pay/payRefundList.js
+++ /dev/null
@@ -1,97 +0,0 @@
-import { message } from 'antd';
-import { productSpuPage, productSpuUpdateSort } from '../../services/product';
-import {routerRedux} from "dva/router";
-import PaginationHelper from '../../../helpers/PaginationHelper';
-import {getPromotionActivityPage} from "../../services/promotion";
-import {queryPayRefundPage, queryPayTransactionPage} from "../../services/pay";
-
-const SEARCH_PARAMS_DEFAULT = {
- createBeginTime: undefined,
- createEndTime: undefined,
- finishBeginTime: undefined,
- finishEndTime: undefined,
- status: undefined,
- payChannel: undefined,
-};
-
-export default {
- namespace: 'payRefundList',
-
- state: {
- // 分页列表相关
- list: [],
- listLoading: false,
- pagination: PaginationHelper.defaultPaginationConfig,
- searchParams: SEARCH_PARAMS_DEFAULT,
-
- // 添加 or 修改表单相关
- },
-
- effects: {
- *page({ payload }, { call, put }) {
- // const { queryParams } = payload;
- // const response = yield call(productSpuPage, payload);
- // message.info('查询成功!');
- // yield put({
- // type: 'treeSuccess',
- // payload: {
- // list: response.data,
- // },
- // });
-
- // 显示加载中
- yield put({
- type: 'changeListLoading',
- payload: true,
- });
-
- // 请求
- const response = yield call(queryPayRefundPage, payload);
- // 响应
- yield put({
- type: 'setAll',
- payload: {
- list: response.data.list,
- pagination: PaginationHelper.formatPagination(response.data, payload),
- searchParams: {
- createBeginTime: payload.createBeginTime,
- createEndTime: payload.createEndTime,
- finishBeginTime: payload.finishBeginTime,
- finishEndTime: payload.finishEndTime,
- status: payload.status,
- payChannel: payload.payChannel,
- }
- },
- });
-
- // 隐藏加载中
- yield put({
- type: 'changeListLoading',
- payload: false,
- });
- },
- },
-
- reducers: {
- treeSuccess(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- },
- // 修改加载中的状态
- changeListLoading(state, { payload }) {
- return {
- ...state,
- listLoading: payload,
- };
- },
- // 设置所有属性
- setAll(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- }
- },
-};
diff --git a/admin-web/src/models/pay/payTransactionList.js b/admin-web/src/models/pay/payTransactionList.js
deleted file mode 100644
index 0c0d2e5fc..000000000
--- a/admin-web/src/models/pay/payTransactionList.js
+++ /dev/null
@@ -1,101 +0,0 @@
-import { message } from 'antd';
-import { productSpuPage, productSpuUpdateSort } from '../../services/product';
-import {routerRedux} from "dva/router";
-import PaginationHelper from '../../../helpers/PaginationHelper';
-import {getPromotionActivityPage} from "../../services/promotion";
-import {queryPayTransactionPage} from "../../services/pay";
-
-const SEARCH_PARAMS_DEFAULT = {
- createBeginTime: undefined,
- createEndTime: undefined,
- paymentBeginTime: undefined,
- paymentEndTime: undefined,
- status: undefined,
- hasRefund: undefined,
- payChannel: undefined,
- orderSubject: '',
-};
-
-export default {
- namespace: 'payTransactionList',
-
- state: {
- // 分页列表相关
- list: [],
- listLoading: false,
- pagination: PaginationHelper.defaultPaginationConfig,
- searchParams: SEARCH_PARAMS_DEFAULT,
-
- // 添加 or 修改表单相关
- },
-
- effects: {
- *page({ payload }, { call, put }) {
- // const { queryParams } = payload;
- // const response = yield call(productSpuPage, payload);
- // message.info('查询成功!');
- // yield put({
- // type: 'treeSuccess',
- // payload: {
- // list: response.data,
- // },
- // });
-
- // 显示加载中
- yield put({
- type: 'changeListLoading',
- payload: true,
- });
-
- // 请求
- const response = yield call(queryPayTransactionPage, payload);
- // 响应
- yield put({
- type: 'setAll',
- payload: {
- list: response.data.list,
- pagination: PaginationHelper.formatPagination(response.data, payload),
- searchParams: {
- createBeginTime: payload.createBeginTime,
- createEndTime: payload.createEndTime,
- paymentBeginTime: payload.paymentBeginTime,
- paymentEndTime: payload.paymentEndTime,
- status: payload.status,
- hasRefund: payload.hasRefund,
- payChannel: payload.payChannel,
- orderSubject: payload.orderSubject,
- }
- },
- });
-
- // 隐藏加载中
- yield put({
- type: 'changeListLoading',
- payload: false,
- });
- },
- },
-
- reducers: {
- treeSuccess(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- },
- // 修改加载中的状态
- changeListLoading(state, { payload }) {
- return {
- ...state,
- listLoading: payload,
- };
- },
- // 设置所有属性
- setAll(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- }
- },
-};
diff --git a/admin-web/src/models/product/productAttrList.js b/admin-web/src/models/product/productAttrList.js
deleted file mode 100644
index 80405882d..000000000
--- a/admin-web/src/models/product/productAttrList.js
+++ /dev/null
@@ -1,170 +0,0 @@
-import { message } from 'antd';
-import {
- productAttrTree,
- productAttrValueAdd,
- productAttrPage,
- productAttrAdd,
- productAttrUpdate,
- productAttrUpdateStatus,
- productAttrValueUpdate,
- productAttrValueUpdateStatus,
-} from '../../services/product';
-import PaginationHelper from '../../../helpers/PaginationHelper';
-
-export default {
- namespace: 'productAttrList',
-
- state: {
- list: [],
- // tree: [],
- attrData: [],
- pagination: PaginationHelper.defaultPaginationConfig,
- },
-
- effects: {
- *add({ payload }, { call, put }) {
- const { onSuccess, onFail, body } = payload;
- const response = yield call(productAttrAdd, body);
- if (response && response.code === 0) {
- onSuccess && onSuccess();
- } else {
- onFail && onFail(response);
- }
- },
-
- *update({ payload }, { call, put }) {
- const { onSuccess, onFail, body } = payload;
- const response = yield call(productAttrUpdate, body);
- if (response && response.code === 0) {
- onSuccess && onSuccess();
- } else {
- onFail && onFail(response);
- }
- },
-
- *value_update({ payload }, { call, put }) {
- const { onSuccess, onFail, body } = payload;
- const response = yield call(productAttrValueUpdate, body);
- if (response && response.code === 0) {
- onSuccess && onSuccess();
- } else {
- onFail && onFail(response);
- }
- },
-
- *update_status({ payload }, { call, put }) {
- const { onSuccess, onFail, body } = payload;
- const response = yield call(productAttrUpdateStatus, body);
- if (response && response.code === 0) {
- onSuccess && onSuccess();
- } else {
- onFail && onFail(response);
- }
- },
-
- *value_update_status({ payload }, { call, put }) {
- const { onSuccess, onFail, body } = payload;
- const response = yield call(productAttrValueUpdateStatus, body);
- if (response && response.code === 0) {
- onSuccess && onSuccess();
- } else {
- onFail && onFail(response);
- }
- },
- // *updateStatus({ payload }, { call, put }) {
- // const { callback, body } = payload;
- // const response = yield call(productCategoryUpdateStatus, body);
- // if (callback) {
- // callback(response);
- // }
- // yield put({
- // type: 'tree',
- // payload: {},
- // });
- // },
- // *delete({ payload }, { call, put }) {
- // const response = yield call(productCategoryDelete, payload);
- // message.info('删除成功!');
- // yield put({
- // type: 'tree',
- // payload: {},
- // });
- // },
-
- *page({ payload }, { call, put }) {
- const result = yield call(productAttrPage, payload);
- let attrData = {};
- if (result.code === 0) {
- attrData = result.data;
- }
- yield put({
- type: 'save',
- payload: {
- attrData,
- pagination: PaginationHelper.formatPagination(attrData, payload),
- },
- });
- },
-
- *tree({ payload }, { call, put }) {
- const { queryParams } = payload;
- const response = yield call(productAttrTree, queryParams);
- // message.info('查询成功!');
- yield put({
- type: 'treeSuccess',
- payload: {
- tree: response.data,
- },
- });
- },
-
- *value_add({ payload }, { call, put }) {
- const { onSuccess, onFail, body } = payload;
- const response = yield call(productAttrValueAdd, body);
- if (response && response.code === 0) {
- onSuccess && onSuccess();
- } else {
- onFail && onFail(response);
- }
- },
-
- *addValue({ payload, callback }, { call, put }) {
- // debugger;
- // const {queryParams} = payload;
- const response = yield call(productAttrValueAdd, payload);
- // message.info('查询成功!');
- // yield put({
- // type: 'treeSuccess',
- // payload: {
- // tree: response.data,
- // },
- // });
- if (response.code === 0) {
- // 刷新规格列表
- yield put({
- type: 'tree',
- payload: {},
- });
- // 回调方法
- if (callback) {
- callback(response.data);
- }
- }
- },
- },
-
- reducers: {
- save(state, action) {
- return {
- ...state,
- ...action.payload,
- };
- },
- treeSuccess(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- },
- },
-};
diff --git a/admin-web/src/models/product/productBrandList.js b/admin-web/src/models/product/productBrandList.js
deleted file mode 100644
index fdac47337..000000000
--- a/admin-web/src/models/product/productBrandList.js
+++ /dev/null
@@ -1,130 +0,0 @@
-import { message } from 'antd';
-import { productBrandPage} from '../../services/product';
-import {routerRedux} from "dva/router";
-import PaginationHelper from '../../../helpers/PaginationHelper';
-
-const SEARCH_PARAMS_DEFAULT = {
- name: '',
- status: 1,
- cid: undefined,
-};
-
-export default {
- namespace: 'productBrandList',
-
- state: {
- // 分页列表相关
- list: [],
- listLoading: false,
- pagination: PaginationHelper.defaultPaginationConfig,
- searchParams: SEARCH_PARAMS_DEFAULT,
-
- // 添加 or 修改表单相关
- // modalVisible: false,
- // modalType: undefined, // 'add' or 'update' 表单
- formVals: {}, // 当前表单值
- // modalLoading: false,
-
-
- sortModalVisible: false, // 修改排序弹窗
- sortModalLoading: false, // 修改排序的加载
- },
-
- effects: {
- // *updateStatus({ payload }, { call, put }) {
- // const { callback, body } = payload;
- // const response = yield call(productCategoryUpdateStatus, body);
- // if (callback) {
- // callback(response);
- // }
- // yield put({
- // type: 'tree',
- // payload: {},
- // });
- // },
- // *delete({ payload }, { call, put }) {
- // const response = yield call(productCategoryDelete, payload);
- // message.info('删除成功!');
- // yield put({
- // type: 'tree',
- // payload: {},
- // });
- // },
- *redirectToAdd({ payload }, { call, put }) {
- // const { callback, body } = payload;
- yield put(routerRedux.replace('/product/product-spu-add'));
- },
- *redirectToUpdate({ payload }, { call, put }) {
- // const { callback, body } = payload;
- yield put(routerRedux.replace('/product/product-spu-update?id=' + payload));
- },
- *page({ payload }, { call, put }) {
- // const { queryParams } = payload;
- // const response = yield call(productSpuPage, payload);
- // message.info('查询成功!');
- // yield put({
- // type: 'treeSuccess',
- // payload: {
- // list: response.data,
- // },
- // });
-
- // 显示加载中
- yield put({
- type: 'changeListLoading',
- payload: true,
- });
-
- // 请求
- const response = yield call(productBrandPage, payload);
- // 响应
- yield put({
- type: 'add',
- payload: {
- list: response.data.brands,
- pagination: PaginationHelper.formatPagination(response.data, payload),
- searchParams: {
- name: payload.name,
- status: payload.status,
- cid: payload.cid,
- }
- },
- });
-
- // 隐藏加载中
- yield put({
- type: 'changeListLoading',
- payload: false,
- });
- },
- },
-
- reducers: {
- treeSuccess(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- },
- // 修改加载中的状态
- changeSortModalLoading(state, { payload }) {
- return {
- ...state,
- sortModalLoading: payload,
- };
- },
- changeListLoading(state, { payload }) {
- return {
- ...state,
- listLoading: payload,
- };
- },
- // 设置所有属性
- add(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- }
- },
-};
diff --git a/admin-web/src/models/product/productCategoryList.js b/admin-web/src/models/product/productCategoryList.js
deleted file mode 100644
index 64e1072f0..000000000
--- a/admin-web/src/models/product/productCategoryList.js
+++ /dev/null
@@ -1,162 +0,0 @@
-import { message } from 'antd';
-import { productCategoryTree, productCategoryAdd, productCategoryUpdate, productCategoryUpdateStatus, productCategoryDelete } from '../../services/product';
-
-export default {
- namespace: 'productCategoryList',
-
- state: {
- // 分页列表相关
- list: [],
- listLoading: false,
-
- // 添加 or 修改表单相关
- modalVisible: false,
- modalType: undefined, // 'add' or 'update' 表单
- formVals: {}, // 当前表单值
- modalLoading: false,
-
- },
-
- effects: {
- // 查询列表
- *tree({ payload }, { call, put }) {
- // 显示加载中
- yield put({
- type: 'changeListLoading',
- payload: true,
- });
-
- // 请求
- const { queryParams } = payload;
- // 响应
- const response = yield call(productCategoryTree, queryParams);
- yield put({
- type: 'treeSuccess',
- payload: {
- list: response.data,
- },
- });
-
- // 隐藏加载中
- yield put({
- type: 'changeListLoading',
- payload: false,
- });
- },
- *add({ payload }, { call, put }) {
- // 显示加载中
- yield put({
- type: 'changeModalLoading',
- payload: true,
- });
-
- // 请求
- const { callback, body } = payload;
- const response = yield call(productCategoryAdd, body);
- // 响应
- if (response.code === 0) {
- if (callback) {
- callback(response);
- }
- // 刷新列表
- yield put({
- type: 'tree',
- payload: {},
- });
- }
-
- // 隐藏加载中
- yield put({
- type: 'changeModalLoading',
- payload: false,
- });
- },
- *update({ payload }, { call, put }) {
- // 显示加载中
- yield put({
- type: 'changeModalLoading',
- payload: true,
- });
-
- // 请求
- const { callback, body } = payload;
- const response = yield call(productCategoryUpdate, body);
- // 响应
- if (response.code === 0) {
- if (callback) {
- callback(response);
- }
- // 刷新列表
- yield put({
- type: 'tree',
- payload: {},
- });
- }
-
- // 隐藏加载中
- yield put({
- type: 'changeModalLoading',
- payload: false,
- });
- },
- *updateStatus({ payload }, { call, put }) {
- // 请求
- const { callback, body } = payload;
- // 响应
- const response = yield call(productCategoryUpdateStatus, body);
- if(response.code === 0) {
- message.info('更新状态成功!');
- if (callback) {
- callback(response);
- }
- yield put({
- type: 'tree',
- payload: {},
- });
- }
- },
- *delete({ payload }, { call, put }) {
- // 响应
- const response = yield call(productCategoryDelete, payload);
- if(response.code === 0) {
- message.info('删除成功!');
- if (callback) {
- callback(response);
- }
- yield put({
- type: 'tree',
- payload: {},
- });
- }
- },
- },
-
- reducers: {
- treeSuccess(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- },
- // 修改加载中的状态
- changeModalLoading(state, { payload }) {
- return {
- ...state,
- modalLoading: payload,
- };
- },
- changeListLoading(state, { payload }) {
- return {
- ...state,
- listLoading: payload,
- };
- },
- // 设置所有属性
- setAll(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- }
- },
-};
diff --git a/admin-web/src/models/product/productSpuAddOrUpdate.js b/admin-web/src/models/product/productSpuAddOrUpdate.js
deleted file mode 100644
index 7f2ac9664..000000000
--- a/admin-web/src/models/product/productSpuAddOrUpdate.js
+++ /dev/null
@@ -1,344 +0,0 @@
-import { message } from 'antd';
-import {
- productSpuAdd,
- productSpuUpdate,
- productSpuInfo
-} from '../../services/product';
-import {bool} from "prop-types";
-
-export default {
- namespace: 'productSpuAddOrUpdate',
-
- state: {
- // list: [],
- loading: false,
- spu: { // 商品 SPU
-
- },
-
- attrTree: [ // 商品规格
- // {
- // id: //
- // name: //
- // values: [{
- // id: //
- // name: //
- // }]
- // }
- ],
- skus: [ // 商品 SKU
- // {
- // attrs: [{
- // id: // 规格值编号
- // name: // 规格值名
- // }],
- // price: // 价格
- // quantity: // 数量
- // }
- ],
-
- },
-
- effects: {
- // *update({ payload }, { call, put }) {
- // const { callback, body } = payload;
- // const response = yield call(productCategoryUpdate, body);
- // if (callback) {
- // callback(response);
- // }
- // yield put({
- // type: 'tree',
- // payload: {},
- // });
- // },
- *info({ payload, callback }, { call, put }) {
- // 显示加载中
- yield put({
- type: 'changeLoading',
- payload: true,
- });
-
- // 请求
- const response = yield call(productSpuInfo, {
- id: payload,
- });
- if (response.code !== 0) {
- return;
- }
- // 响应
- let skus = [];
- let attrTree = [];
- // SKU
- for (let i in response.data.skus) {
- let sku = response.data.skus[i];
- // 处理 sku
- {
- let attrs = [];
- for (let j in sku.attrs) {
- let attr = sku.attrs[j];
- attrs.push({
- id: attr.attrValueId,
- name: attr.attrValueName,
- });
- }
- let newSku = {
- ...sku,
- attrs,
- };
- skus.push(newSku);
- }
- // 处理 attrTree
- {
- for (let j in sku.attrs) {
- // debugger;
- let attr = sku.attrs[j];
- let attrTreeNode = undefined;
- for (let k in attrTree) {
- let item = attrTree[k];
- if (item.id === attr.attrId) {
- attrTreeNode = item;
- break;
- }
- }
- if (!attrTreeNode) {
- attrTreeNode = {
- id: attr.attrId,
- name: attr.attrName,
- values: [{
- id: attr.attrValueId,
- name: attr.attrValueName,
- }]
- };
- attrTree.push(attrTreeNode);
- } else {
- let attrValueExists = false;
- let values = attrTreeNode.values;
- for (let k in values) {
- if (values[k].id === attr.attrValueId) {
- attrValueExists = true;
- break;
- }
- }
- if (!attrValueExists) {
- values.push({
- id: attr.attrValueId,
- name: attr.attrValueName,
- });
- }
- }
- }
- }
- }
- // debugger;
- yield put({
- type: 'setAll',
- payload: {
- spu: response.data,
- skus: skus,
- attrTree: attrTree,
- },
- });
-
- // 如果有回调,则执行回调方法
- if (callback) {
- callback(response.data);
- }
-
- // 隐藏加载中
- yield put({
- type: 'changeLoading',
- payload: false,
- });
- },
- *addAttr({ payload }, { call, put }) {
- // const { queryParams } = payload;
- // const response = yield call(productCategoryTree, queryParams);
- // message.info('调试:添加规格成功!');
- yield put({
- type: 'addAttrSuccess',
- payload: {
- attrAdd: {},
- },
- });
- },
- *selectAttr({ payload }, { call, put }) {
- // const { queryParams } = payload;
- // const response = yield call(productCategoryTree, queryParams);
- // message.info('调试:选择规格成功!');
- yield put({
- type: 'selectAttrSuccess',
- payload: payload,
- });
- },
- *selectAttrValues({ payload }, { call, put }) {
- // const { queryParams } = payload;
- // const response = yield call(productCategoryTree, queryParams);
- // message.info('调试:选择规格值成功!');
- yield put({
- type: 'selectAttrValueSuccess',
- payload: payload,
- });
- },
- *inputSkuPrice({ payload }, { call, put }) {
- // debugger;
- yield put({
- type: 'inputSkuPriceSuccess',
- payload: payload,
- });
- },
- *inputSkuQuantity({ payload }, { call, put }) {
- // debugger;
- yield put({
- type: 'inputSkuQuantitySuccess',
- payload: payload,
- });
- },
- *add({ payload }, { call, put }) {
- const { callback, body } = payload;
- const response = yield call(productSpuAdd, body);
- if (response.code !== 0) {
- return;
- }
- if (callback) {
- callback(response);
- }
- // yield put({
- // type: 'tree',
- // payload: {},
- // });
- alert('添加成功!后续改成跳转到手机站的详情');
- },
- *update({ payload }, { call, put }) {
- const { callback, body } = payload;
- const response = yield call(productSpuUpdate, body);
- if (response.code !== 0) {
- return;
- }
- if (callback) {
- callback(response);
- }
- // yield put({
- // type: 'tree',
- // payload: {},
- // });
- alert('修改成功!后续改成跳转到手机站的详情');
- },
- },
-
- reducers: {
- addAttrSuccess(state, {payload}) {
- // debugger;
- // console.log(state.attrTree);
- state.attrTree.push(payload.attrAdd);
- return {
- ...state
- }
- },
- selectAttrSuccess(state, {payload}) {
- // debugger;
- // console.log(state.attrTree);
- state.attrTree[payload.attrIndex] = payload.attr;
- return {
- ...state
- }
- },
- selectAttrValueSuccess(state, {payload}) {
- // debugger;
- // console.log(state);
- // 设置值。
- state.attrTree[payload.attrIndex].values = payload.attrValues;
- // 筛选有效的规格选项
- let attrTree = [];
- for (let i in state.attrTree) {
- let attr = state.attrTree[i];
- if (attr && attr.values && attr.values.length > 0) {
- attrTree.push(attr);
- }
- }
- // 生成 skus 值
- let skus = [];
- let skuSize = 1;
- for (let i in attrTree) { // 先计算 sku 数量
- let attr = attrTree[i];
- skuSize = skuSize * attr.values.length;
- }
- // console.log('skuSize: ' + skuSize);
- for (let i = 0; i < skuSize; i++) { // 初始化 sku 格子
- skus.push({
- attrs: [],
- price: undefined,
- quantity: undefined,
- });
- }
- // let interval = skuSize; // 该间隔,用于下面规格组合
- for (let i = 0; i < attrTree.length; i++) { // 初始化 sku 格子里的 attrs
- if (i === 1) {
- // debugger;
- }
- let values = attrTree[i].values;
- let interval = skuSize / values.length;
- for (let j = 0; j < skuSize; j++) {
- // let values = attrTree[i].values;
- // let attr = values[j % values.length];
- // skus[i].attrs.push({
- // id: attr.id,
- // name: attr.name,
- // });
- // let attr = values[j % values.length];
- let attr = values[parseInt(j / interval)];
- skus[j].attrs.push({
- id: attr.id,
- name: attr.name,
- });
- }
- }
- state.skus = skus;
- // debugger;
- // console.l og('skus: ' + skus);
- return {
- ...state
- }
- },
- inputSkuPriceSuccess(state, {payload}) {
- // debugger;
- state.skus[payload.index].price = payload.price;
- return {
- ...state
- }
- },
- inputSkuQuantitySuccess(state, {payload}) {
- // debugger;
- state.skus[payload.index].quantity = payload.quantity;
- return {
- ...state
- }
- },
- clear(state, {payload}) {
- return {
- ...state,
- skus: [],
- attrTree: [],
- spu: {},
- }
- },
- changeLoading(state, { payload }) {
- return {
- ...state,
- listLoading: payload,
- };
- },
- // 设置所有属性
- setAll(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- }
- // treeSuccess(state, { payload }) {
- // return {
- // ...state,
- // ...payload,
- // };
- // },
- },
-};
diff --git a/admin-web/src/models/product/productSpuList.js b/admin-web/src/models/product/productSpuList.js
deleted file mode 100644
index 9cd6c9338..000000000
--- a/admin-web/src/models/product/productSpuList.js
+++ /dev/null
@@ -1,160 +0,0 @@
-import { message } from 'antd';
-import { productSpuPage, productSpuUpdateSort } from '../../services/product';
-import {routerRedux} from "dva/router";
-import PaginationHelper from '../../../helpers/PaginationHelper';
-
-const SEARCH_PARAMS_DEFAULT = {
- name: '',
- status: 1,
- cid: undefined,
-};
-
-export default {
- namespace: 'productSpuList',
-
- state: {
- // 分页列表相关
- list: [],
- listLoading: false,
- pagination: PaginationHelper.defaultPaginationConfig,
- searchParams: SEARCH_PARAMS_DEFAULT,
-
- // 添加 or 修改表单相关
- // modalVisible: false,
- // modalType: undefined, // 'add' or 'update' 表单
- formVals: {}, // 当前表单值
- // modalLoading: false,
-
-
- sortModalVisible: false, // 修改排序弹窗
- sortModalLoading: false, // 修改排序的加载
- },
-
- effects: {
- // *updateStatus({ payload }, { call, put }) {
- // const { callback, body } = payload;
- // const response = yield call(productCategoryUpdateStatus, body);
- // if (callback) {
- // callback(response);
- // }
- // yield put({
- // type: 'tree',
- // payload: {},
- // });
- // },
- // *delete({ payload }, { call, put }) {
- // const response = yield call(productCategoryDelete, payload);
- // message.info('删除成功!');
- // yield put({
- // type: 'tree',
- // payload: {},
- // });
- // },
- *redirectToAdd({ payload }, { call, put }) {
- // const { callback, body } = payload;
- yield put(routerRedux.replace('/product/product-spu-add'));
- },
- *redirectToUpdate({ payload }, { call, put }) {
- // const { callback, body } = payload;
- yield put(routerRedux.replace('/product/product-spu-update?id=' + payload));
- },
- *page({ payload }, { call, put }) {
- // const { queryParams } = payload;
- // const response = yield call(productSpuPage, payload);
- // message.info('查询成功!');
- // yield put({
- // type: 'treeSuccess',
- // payload: {
- // list: response.data,
- // },
- // });
-
- // 显示加载中
- yield put({
- type: 'changeListLoading',
- payload: true,
- });
-
- // 请求
- const response = yield call(productSpuPage, payload);
- // 响应
- yield put({
- type: 'setAll',
- payload: {
- list: response.data.list,
- pagination: PaginationHelper.formatPagination(response.data, payload),
- searchParams: {
- name: payload.name,
- status: payload.status,
- cid: payload.cid,
- }
- },
- });
-
- // 隐藏加载中
- yield put({
- type: 'changeListLoading',
- payload: false,
- });
- },
- *updateSort({ payload }, { call, put }) {
- // 显示加载中
- yield put({
- type: 'changeSortModalLoading',
- payload: true,
- });
-
- // 请求
- const { callback, body } = payload;
- // 响应
- const response = yield call(productSpuUpdateSort, body);
- if(response.code === 0) {
- if (callback) {
- callback(response);
- }
- yield put({
- type: 'page',
- payload: {
- ...this.state.pagination,
- ...this.state.searchParams,
- },
- });
- }
-
- // 隐藏加载中
- yield put({
- type: 'changeSortModalLoading',
- payload: false,
- });
- },
- },
-
- reducers: {
- treeSuccess(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- },
- // 修改加载中的状态
- changeSortModalLoading(state, { payload }) {
- return {
- ...state,
- sortModalLoading: payload,
- };
- },
- changeListLoading(state, { payload }) {
- return {
- ...state,
- listLoading: payload,
- };
- },
- // 设置所有属性
- setAll(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- }
- },
-};
diff --git a/admin-web/src/models/project.js b/admin-web/src/models/project.js
deleted file mode 100644
index cf894125d..000000000
--- a/admin-web/src/models/project.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import { queryProjectNotice } from '@/services/api';
-
-export default {
- namespace: 'project',
-
- state: {
- notice: [],
- },
-
- effects: {
- *fetchNotice(_, { call, put }) {
- const response = yield call(queryProjectNotice);
- yield put({
- type: 'saveNotice',
- payload: Array.isArray(response) ? response : [],
- });
- },
- },
-
- reducers: {
- saveNotice(state, action) {
- return {
- ...state,
- notice: action.payload,
- };
- },
- },
-};
diff --git a/admin-web/src/models/promotion/bannerList.js b/admin-web/src/models/promotion/bannerList.js
deleted file mode 100644
index 4f139c05a..000000000
--- a/admin-web/src/models/promotion/bannerList.js
+++ /dev/null
@@ -1,177 +0,0 @@
-import {message} from 'antd';import {
- addBanner,
- deleteBanner,
- queryBanner,
- updateBanner,
- updateBannerStatus,
-} from '../../services/promotion';
-import PaginationHelper from '../../../helpers/PaginationHelper';
-
-const SEARCH_PARAMS_DEFAULT = {
- title: '',
-};
-
-export default {
- namespace: 'bannerList',
-
- state: {
- // 分页列表相关
- list: [],
- listLoading: false,
- pagination: PaginationHelper.defaultPaginationConfig,
- searchParams: SEARCH_PARAMS_DEFAULT,
-
- // 添加 or 修改表单相关
- modalVisible: false,
- modalType: undefined, // 'add' or 'update' 表单
- formVals: {}, // 当前表单值
- modalLoading: false,
- },
-
- effects: {
- // 查询列表
- * query({ payload }, { call, put }) {
- // 显示加载中
- yield put({
- type: 'changeListLoading',
- payload: true,
- });
-
- // 请求
- const response = yield call(queryBanner, payload);
- // 响应
- yield put({
- type: 'setAll',
- payload: {
- list: response.data.list,
- pagination: PaginationHelper.formatPagination(response.data, payload),
- searchParams: {
- title: payload.title || ''
- }
- },
- });
-
- // 隐藏加载中
- yield put({
- type: 'changeListLoading',
- payload: false,
- });
- },
- * add({ payload }, { call, put }) {
- const { callback, body } = payload;
- // 显示加载中
- yield put({
- type: 'changeModalLoading',
- payload: true,
- });
-
- // 请求
- const response = yield call(addBanner, body);
- // 响应
- if (response.code === 0) {
- if (callback) {
- callback(response);
- }
- // 刷新列表
- yield put({
- type: 'query',
- payload: {
- ...PaginationHelper.defaultPayload
- },
- });
- }
-
- // 隐藏加载中
- yield put({
- type: 'changeModalLoading',
- payload: false,
- });
- },
- * update({ payload }, { call, put }) {
- const { callback, body } = payload;
- // 显示加载中
- yield put({
- type: 'changeModalLoading',
- payload: true,
- });
-
- // 请求
- const response = yield call(updateBanner, body);
- // 响应
- if (response.code === 0) {
- if (callback) {
- callback(response);
- }
- // 刷新列表
- yield put({
- type: 'query',
- payload: {
- ...PaginationHelper.defaultPayload
- },
- });
- }
-
- // 隐藏加载中
- yield put({
- type: 'changeModalLoading',
- payload: false,
- });
- },
-
- * updateStatus({ payload }, { call, put }) {
- // 请求
- const response = yield call(updateBannerStatus, payload);
- // 响应
- if (response.code === 0) {
- message.info('更新状态成功!');
- // 刷新列表
- yield put({
- type: 'query',
- payload: {
- ...PaginationHelper.defaultPayload
- },
- });
- }
- },
-
- * delete({ payload }, { call, put }) {
- // 请求
- const response = yield call(deleteBanner, payload);
- // 响应
- if (response.code === 0) {
- message.info('删除成功!');
- // 刷新列表
- yield put({
- type: 'query',
- payload: {
- ...PaginationHelper.defaultPayload
- },
- });
- }
- },
-
- },
-
- reducers: {
- // 修改加载中的状态
- changeModalLoading(state, { payload }) {
- return {
- ...state,
- modalLoading: payload,
- };
- },
- changeListLoading(state, { payload }) {
- return {
- ...state,
- listLoading: payload,
- };
- },
- // 设置所有属性
- setAll(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- }
- },
-};
diff --git a/admin-web/src/models/promotion/couponCardTemplateList.js b/admin-web/src/models/promotion/couponCardTemplateList.js
deleted file mode 100644
index 6de270372..000000000
--- a/admin-web/src/models/promotion/couponCardTemplateList.js
+++ /dev/null
@@ -1,209 +0,0 @@
-import {message} from 'antd';
-import {
- addCouponCardTemplate,
- updateCouponCardTemplate,
- updateCouponCardTemplateStatus,
- getCouponCardTemplatePage,
-} from '../../services/promotion';
-import PaginationHelper from '../../../helpers/PaginationHelper';
-import {productSpuList, productSpuSearchList} from "../../services/product";
-
-const SEARCH_PARAMS_DEFAULT = {
- title: '',
-};
-
-export default {
- namespace: 'couponCardTemplateList',
-
- state: {
- // 分页列表相关
- list: [],
- listLoading: false,
- pagination: PaginationHelper.defaultPaginationConfig,
- searchParams: SEARCH_PARAMS_DEFAULT,
-
- // 添加 or 修改表单相关
- modalVisible: false,
- modalType: undefined, // 'add' or 'update' 表单
- formVals: {}, // 当前表单值
- modalLoading: false,
- searchProductSpuList: [],
- },
-
- effects: {
- // 查询列表
- * query({ payload }, { call, put }) {
- // 显示加载中
- yield put({
- type: 'changeListLoading',
- payload: true,
- });
-
- // 请求
- const response = yield call(getCouponCardTemplatePage, {
- ...payload,
- type: 1
- });
- // 响应
- yield put({
- type: 'setAll',
- payload: {
- list: response.data.list,
- pagination: PaginationHelper.formatPagination(response.data, payload),
- searchParams: {
- title: payload.title
- }
- },
- });
-
- // 隐藏加载中
- yield put({
- type: 'changeListLoading',
- payload: false,
- });
- },
- * add({ payload }, { call, put }) {
- const { callback, body } = payload;
- // 显示加载中
- yield put({
- type: 'changeModalLoading',
- payload: true,
- });
-
- // 请求
- const response = yield call(addCouponCardTemplate, body);
- // 响应
- if (response.code === 0) {
- if (callback) {
- callback(response);
- }
- // 刷新列表
- yield put({
- type: 'query',
- payload: {
- ...PaginationHelper.defaultPayload
- },
- });
- }
-
- // 隐藏加载中
- yield put({
- type: 'changeModalLoading',
- payload: false,
- });
- },
- * update({ payload }, { call, put }) {
- const { callback, body } = payload;
- // 显示加载中
- yield put({
- type: 'changeModalLoading',
- payload: true,
- });
-
- // 请求
- const response = yield call(updateCouponCardTemplate, body);
- // 响应
- if (response.code === 0) {
- if (callback) {
- callback(response);
- }
- // 刷新列表
- yield put({
- type: 'query',
- payload: {
- ...PaginationHelper.defaultPayload
- },
- });
- }
-
- // 隐藏加载中
- yield put({
- type: 'changeModalLoading',
- payload: false,
- });
- },
-
- * updateStatus({ payload }, { call, put }) {
- // 请求
- const response = yield call(updateCouponCardTemplateStatus, payload);
- // 响应
- if (response.code === 0) {
- message.info('更新状态成功!');
- // 刷新列表
- yield put({
- type: 'query',
- payload: {
- ...PaginationHelper.defaultPayload
- },
- });
- }
- },
-
- // * delete({ payload }, { call, put }) {
- // // 请求
- // const response = yield call(deleteProductRecommend, payload);
- // // 响应
- // if (response.code === 0) {
- // message.info('删除成功!');
- // // 刷新列表
- // yield put({
- // type: 'query',
- // payload: {
- // ...PaginationHelper.defaultPayload
- // },
- // });
- // }
- // },
-
- * searchProductSpu({ payload }, { call, put }) {
- // 请求
- const response = yield call(productSpuSearchList, payload);
- // 响应
- if (response.code === 0) {
- yield put({
- type: 'setAll',
- payload: {
- searchProductSpuList: response.data,
- },
- });
- }
- },
-
- * getProductSpuList({ payload }, { call, put }) {
- // 请求
- const response = yield call(productSpuList, payload);
- // 响应
- if (response.code === 0) {
- yield put({
- type: 'setAll',
- payload: {
- formSpuValues: response.data,
- },
- });
- }
- }
- },
-
- reducers: {
- // 修改加载中的状态
- changeModalLoading(state, { payload }) {
- return {
- ...state,
- modalLoading: payload,
- };
- },
- changeListLoading(state, { payload }) {
- return {
- ...state,
- listLoading: payload,
- };
- },
- // 设置所有属性
- setAll(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- }
- },
-};
diff --git a/admin-web/src/models/promotion/fullPrivilegeList.js b/admin-web/src/models/promotion/fullPrivilegeList.js
deleted file mode 100644
index 4248c092b..000000000
--- a/admin-web/src/models/promotion/fullPrivilegeList.js
+++ /dev/null
@@ -1,95 +0,0 @@
-import { message } from 'antd';
-import { productSpuPage, productSpuUpdateSort } from '../../services/product';
-import {routerRedux} from "dva/router";
-import PaginationHelper from '../../../helpers/PaginationHelper';
-import {getPromotionActivityPage} from "../../services/promotion";
-
-const SEARCH_PARAMS_DEFAULT = {
- createBeginTime: undefined,
- createEndTime: undefined,
- paymentBeginTime: undefined,
- paymentEndTime: undefined,
- status: undefined,
- hasRefund: undefined,
- payChannel: undefined,
- orderSubject: '',
-};
-
-export default {
- namespace: 'fullPrivilegeList',
-
- state: {
- // 分页列表相关
- list: [],
- listLoading: false,
- pagination: PaginationHelper.defaultPaginationConfig,
- searchParams: SEARCH_PARAMS_DEFAULT,
-
- // 添加 or 修改表单相关
- },
-
- effects: {
- *page({ payload }, { call, put }) {
- // const { queryParams } = payload;
- // const response = yield call(productSpuPage, payload);
- // message.info('查询成功!');
- // yield put({
- // type: 'treeSuccess',
- // payload: {
- // list: response.data,
- // },
- // });
-
- // 显示加载中
- yield put({
- type: 'changeListLoading',
- payload: true,
- });
-
- // 请求
- const response = yield call(getPromotionActivityPage, payload);
- // 响应
- yield put({
- type: 'setAll',
- payload: {
- list: response.data.list,
- pagination: PaginationHelper.formatPagination(response.data, payload),
- searchParams: {
- title: payload.title,
- status: payload.status,
- activityType: payload.activityType,
- }
- },
- });
-
- // 隐藏加载中
- yield put({
- type: 'changeListLoading',
- payload: false,
- });
- },
- },
-
- reducers: {
- treeSuccess(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- },
- // 修改加载中的状态
- changeListLoading(state, { payload }) {
- return {
- ...state,
- listLoading: payload,
- };
- },
- // 设置所有属性
- setAll(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- }
- },
-};
diff --git a/admin-web/src/models/promotion/productRecommendList.js b/admin-web/src/models/promotion/productRecommendList.js
deleted file mode 100644
index c1fd57ded..000000000
--- a/admin-web/src/models/promotion/productRecommendList.js
+++ /dev/null
@@ -1,194 +0,0 @@
-import {message} from 'antd';
-import {
- addProductRecommend,
- deleteProductRecommend,
- queryProductRecommend,
- updateProductRecommend,
- updateProductRecommendStatus,
-} from '../../services/promotion';
-import PaginationHelper from '../../../helpers/PaginationHelper';
-import {productSpuSearchList} from "../../services/product";
-
-const SEARCH_PARAMS_DEFAULT = {
- type: undefined,
-};
-
-export default {
- namespace: 'productRecommendList',
-
- state: {
- // 分页列表相关
- list: [],
- listLoading: false,
- pagination: PaginationHelper.defaultPaginationConfig,
- searchParams: SEARCH_PARAMS_DEFAULT,
-
- // 添加 or 修改表单相关
- modalVisible: false,
- modalType: undefined, // 'add' or 'update' 表单
- formVals: {}, // 当前表单值
- modalLoading: false,
- searchProductSpuList: [], // 搜索商品
- formSpuValues: [], // 编辑时,如果优惠劵选择的是商品,则需要获取该值。
- },
-
- effects: {
- // 查询列表
- * query({ payload }, { call, put }) {
- // 显示加载中
- yield put({
- type: 'changeListLoading',
- payload: true,
- });
-
- // 请求
- const response = yield call(queryProductRecommend, payload);
- // 响应
- yield put({
- type: 'setAll',
- payload: {
- list: response.data.list,
- pagination: PaginationHelper.formatPagination(response.data, payload),
- searchParams: {
- type: payload.type
- }
- },
- });
-
- // 隐藏加载中
- yield put({
- type: 'changeListLoading',
- payload: false,
- });
- },
- * add({ payload }, { call, put }) {
- const { callback, body } = payload;
- // 显示加载中
- yield put({
- type: 'changeModalLoading',
- payload: true,
- });
-
- // 请求
- const response = yield call(addProductRecommend, body);
- // 响应
- if (response.code === 0) {
- if (callback) {
- callback(response);
- }
- // 刷新列表
- yield put({
- type: 'query',
- payload: {
- ...PaginationHelper.defaultPayload
- },
- });
- }
-
- // 隐藏加载中
- yield put({
- type: 'changeModalLoading',
- payload: false,
- });
- },
- * update({ payload }, { call, put }) {
- const { callback, body } = payload;
- // 显示加载中
- yield put({
- type: 'changeModalLoading',
- payload: true,
- });
-
- // 请求
- const response = yield call(updateProductRecommend, body);
- // 响应
- if (response.code === 0) {
- if (callback) {
- callback(response);
- }
- // 刷新列表
- yield put({
- type: 'query',
- payload: {
- ...PaginationHelper.defaultPayload
- },
- });
- }
-
- // 隐藏加载中
- yield put({
- type: 'changeModalLoading',
- payload: false,
- });
- },
-
- * updateStatus({ payload }, { call, put }) {
- // 请求
- const response = yield call(updateProductRecommendStatus, payload);
- // 响应
- if (response.code === 0) {
- message.info('更新状态成功!');
- // 刷新列表
- yield put({
- type: 'query',
- payload: {
- ...PaginationHelper.defaultPayload
- },
- });
- }
- },
-
- * delete({ payload }, { call, put }) {
- // 请求
- const response = yield call(deleteProductRecommend, payload);
- // 响应
- if (response.code === 0) {
- message.info('删除成功!');
- // 刷新列表
- yield put({
- type: 'query',
- payload: {
- ...PaginationHelper.defaultPayload
- },
- });
- }
- },
-
- * searchProductSpu({ payload }, { call, put }) {
- // 请求
- const response = yield call(productSpuSearchList, payload);
- // 响应
- if (response.code === 0) {
- yield put({
- type: 'setAll',
- payload: {
- searchProductSpuList: response.data,
- },
- });
- }
- },
- },
-
- reducers: {
- // 修改加载中的状态
- changeModalLoading(state, { payload }) {
- return {
- ...state,
- modalLoading: payload,
- };
- },
- changeListLoading(state, { payload }) {
- return {
- ...state,
- listLoading: payload,
- };
- },
- // 设置所有属性
- setAll(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- }
- },
-};
diff --git a/admin-web/src/models/promotion/timeLimitedDiscountList.js b/admin-web/src/models/promotion/timeLimitedDiscountList.js
deleted file mode 100644
index d134733fe..000000000
--- a/admin-web/src/models/promotion/timeLimitedDiscountList.js
+++ /dev/null
@@ -1,90 +0,0 @@
-import { message } from 'antd';
-import { productSpuPage, productSpuUpdateSort } from '../../services/product';
-import {routerRedux} from "dva/router";
-import PaginationHelper from '../../../helpers/PaginationHelper';
-import {getPromotionActivityPage} from "../../services/promotion";
-
-const SEARCH_PARAMS_DEFAULT = {
- title: '',
- activityType: 1,
- status: 'ALL',
-};
-
-export default {
- namespace: 'timeLimitedDiscountList',
-
- state: {
- // 分页列表相关
- list: [],
- listLoading: false,
- pagination: PaginationHelper.defaultPaginationConfig,
- searchParams: SEARCH_PARAMS_DEFAULT,
-
- // 添加 or 修改表单相关
- },
-
- effects: {
- *page({ payload }, { call, put }) {
- // const { queryParams } = payload;
- // const response = yield call(productSpuPage, payload);
- // message.info('查询成功!');
- // yield put({
- // type: 'treeSuccess',
- // payload: {
- // list: response.data,
- // },
- // });
-
- // 显示加载中
- yield put({
- type: 'changeListLoading',
- payload: true,
- });
-
- // 请求
- const response = yield call(getPromotionActivityPage, payload);
- // 响应
- yield put({
- type: 'setAll',
- payload: {
- list: response.data.list,
- pagination: PaginationHelper.formatPagination(response.data, payload),
- searchParams: {
- title: payload.title,
- status: payload.status,
- activityType: payload.activityType,
- }
- },
- });
-
- // 隐藏加载中
- yield put({
- type: 'changeListLoading',
- payload: false,
- });
- },
- },
-
- reducers: {
- treeSuccess(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- },
- // 修改加载中的状态
- changeListLoading(state, { payload }) {
- return {
- ...state,
- listLoading: payload,
- };
- },
- // 设置所有属性
- setAll(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- }
- },
-};
diff --git a/admin-web/src/models/setting.js b/admin-web/src/models/setting.js
deleted file mode 100644
index 171da48d1..000000000
--- a/admin-web/src/models/setting.js
+++ /dev/null
@@ -1,123 +0,0 @@
-import { message } from 'antd';
-import defaultSettings from '../defaultSettings';
-
-let lessNodesAppended;
-const updateTheme = primaryColor => {
- // Don't compile less in production!
- if (APP_TYPE !== 'site') {
- return;
- }
- // Determine if the component is remounted
- if (!primaryColor) {
- return;
- }
- const hideMessage = message.loading('正在编译主题!', 0);
- function buildIt() {
- if (!window.less) {
- return;
- }
- setTimeout(() => {
- window.less
- .modifyVars({
- '@primary-color': primaryColor,
- })
- .then(() => {
- hideMessage();
- })
- .catch(() => {
- message.error('Failed to update theme');
- hideMessage();
- });
- }, 200);
- }
- if (!lessNodesAppended) {
- // insert less.js and color.less
- const lessStyleNode = document.createElement('link');
- const lessConfigNode = document.createElement('script');
- const lessScriptNode = document.createElement('script');
- lessStyleNode.setAttribute('rel', 'stylesheet/less');
- lessStyleNode.setAttribute('href', '/color.less');
- lessConfigNode.innerHTML = `
- window.less = {
- async: true,
- env: 'production',
- javascriptEnabled: true
- };
- `;
- lessScriptNode.src = 'https://gw.alipayobjects.com/os/lib/less.js/3.8.1/less.min.js';
- lessScriptNode.async = true;
- lessScriptNode.onload = () => {
- buildIt();
- lessScriptNode.onload = null;
- };
- document.body.appendChild(lessStyleNode);
- document.body.appendChild(lessConfigNode);
- document.body.appendChild(lessScriptNode);
- lessNodesAppended = true;
- } else {
- buildIt();
- }
-};
-
-const updateColorWeak = colorWeak => {
- document.body.className = colorWeak ? 'colorWeak' : '';
-};
-
-export default {
- namespace: 'setting',
- state: defaultSettings,
- reducers: {
- getSetting(state) {
- const setting = {};
- const urlParams = new URL(window.location.href);
- Object.keys(state).forEach(key => {
- if (urlParams.searchParams.has(key)) {
- const value = urlParams.searchParams.get(key);
- setting[key] = value === '1' ? true : value;
- }
- });
- const { primaryColor, colorWeak } = setting;
- if (state.primaryColor !== primaryColor) {
- updateTheme(primaryColor);
- }
- updateColorWeak(colorWeak);
- return {
- ...state,
- ...setting,
- };
- },
- changeSetting(state, { payload }) {
- const urlParams = new URL(window.location.href);
- Object.keys(defaultSettings).forEach(key => {
- if (urlParams.searchParams.has(key)) {
- urlParams.searchParams.delete(key);
- }
- });
- Object.keys(payload).forEach(key => {
- if (key === 'collapse') {
- return;
- }
- let value = payload[key];
- if (value === true) {
- value = 1;
- }
- if (defaultSettings[key] !== value) {
- urlParams.searchParams.set(key, value);
- }
- });
- const { primaryColor, colorWeak, contentWidth } = payload;
- if (state.primaryColor !== primaryColor) {
- updateTheme(primaryColor);
- }
- if (state.contentWidth !== contentWidth && window.dispatchEvent) {
- window.dispatchEvent(new Event('resize'));
- }
- updateColorWeak(colorWeak);
- window.history.replaceState(null, 'setting', urlParams.href);
- return {
- ...state,
- ...payload,
- };
- },
- },
-};
diff --git a/admin-web/src/models/sms/smsSignList.js b/admin-web/src/models/sms/smsSignList.js
deleted file mode 100644
index feefbb0c6..000000000
--- a/admin-web/src/models/sms/smsSignList.js
+++ /dev/null
@@ -1,67 +0,0 @@
-import { addSign, deletedSign, pageSign, updateSign } from '../../services/sms';
-
-export default {
- namespace: 'smsSignList',
-
- state: {
- total: 0,
- index: 1,
- size: 20,
- list: [],
- },
-
- effects: {
- *page({ payload }, { call, put }) {
- const response = yield call(pageSign, payload);
- if (response.code === 0) {
- yield put({
- type: 'pageSuccess',
- payload: {
- data: response.data,
- params: payload,
- },
- });
- }
- },
- *add({ payload }, { call }) {
- const { params, callback } = payload;
- const response = yield call(addSign, params);
- if (response.code === 0) {
- if (callback) {
- callback(response);
- }
- }
- },
- *update({ payload }, { call }) {
- const { params, callback } = payload;
- const response = yield call(updateSign, params);
- if (response.code === 0) {
- if (callback) {
- callback(response);
- }
- }
- },
- *deleted({ payload }, { call }) {
- const { params, callback } = payload;
- const response = yield call(deletedSign, params);
- if (callback) {
- callback(response);
- }
- },
- },
-
- reducers: {
- pageSuccess(state, { payload }) {
- const { data, params } = payload;
- const { pageNo, pageSize } = params;
- const { list, total } = data;
- return {
- ...state,
- size: pageSize,
- index: pageNo,
- total,
- list,
- };
- },
- },
-};
diff --git a/admin-web/src/models/sms/smsTemplateList.js b/admin-web/src/models/sms/smsTemplateList.js
deleted file mode 100644
index 2bc032a5b..000000000
--- a/admin-web/src/models/sms/smsTemplateList.js
+++ /dev/null
@@ -1,67 +0,0 @@
-import { pageTemplate, addTemplate, updateTemplate, deletedTemplate } from '../../services/sms';
-
-export default {
- namespace: 'smsTemplateList',
-
- state: {
- total: 0,
- index: 1,
- size: 20,
- list: [],
- },
-
- effects: {
- *page({ payload }, { call, put }) {
- const response = yield call(pageTemplate, payload);
- if (response.code === 0) {
- yield put({
- type: 'pageSuccess',
- payload: {
- data: response.data,
- params: payload,
- },
- });
- }
- },
- *add({ payload }, { call }) {
- const { params, callback } = payload;
- const response = yield call(addTemplate, params);
- if (response.code === 0) {
- if (callback) {
- callback(response);
- }
- }
- },
- *update({ payload }, { call }) {
- const { params, callback } = payload;
- const response = yield call(updateTemplate, params);
- if (response.code === 0) {
- if (callback) {
- callback(response);
- }
- }
- },
- *deleted({ payload }, { call }) {
- const { params, callback } = payload;
- const response = yield call(deletedTemplate, params);
- if (callback) {
- callback(response);
- }
- },
- },
-
- reducers: {
- pageSuccess(state, { payload }) {
- const { data, params } = payload;
- const { pageNo, pageSize } = params;
- const { list, total } = data;
- return {
- ...state,
- size: pageSize,
- index: pageNo,
- total,
- list,
- };
- },
- },
-};
diff --git a/admin-web/src/models/user.js b/admin-web/src/models/user.js
deleted file mode 100644
index 71df44bf9..000000000
--- a/admin-web/src/models/user.js
+++ /dev/null
@@ -1,54 +0,0 @@
-import { query as queryUsers } from '@/services/user';
-import currentUserData from '../mock-data/currentUserData';
-
-export default {
- namespace: 'user',
-
- state: {
- list: [],
- currentUser: {},
- },
-
- effects: {
- *fetch(_, { call, put }) {
- const response = yield call(queryUsers);
- yield put({
- type: 'save',
- payload: response,
- });
- },
- *fetchCurrent(_, { put }) {
- // const response = yield call(queryCurrent);
- const response = currentUserData;
- yield put({
- type: 'saveCurrentUser',
- payload: response,
- });
- },
- },
-
- reducers: {
- save(state, action) {
- return {
- ...state,
- list: action.payload,
- };
- },
- saveCurrentUser(state, action) {
- return {
- ...state,
- currentUser: action.payload || {},
- };
- },
- changeNotifyCount(state, action) {
- return {
- ...state,
- currentUser: {
- ...state.currentUser,
- notifyCount: action.payload.totalCount,
- unreadCount: action.payload.unreadCount,
- },
- };
- },
- },
-};
diff --git a/admin-web/src/models/user/userList.js b/admin-web/src/models/user/userList.js
deleted file mode 100644
index 26e312457..000000000
--- a/admin-web/src/models/user/userList.js
+++ /dev/null
@@ -1,89 +0,0 @@
-import { message } from 'antd';
-import { productSpuPage, productSpuUpdateSort } from '../../services/product';
-import {routerRedux} from "dva/router";
-import PaginationHelper from '../../../helpers/PaginationHelper';
-import {getPromotionActivityPage} from "../../services/promotion";
-import {queryUserPage} from "../../services/user";
-
-const SEARCH_PARAMS_DEFAULT = {
- nickname: '',
- status: 1,
-};
-
-export default {
- namespace: 'userList',
-
- state: {
- // 分页列表相关
- list: [],
- listLoading: false,
- pagination: PaginationHelper.defaultPaginationConfig,
- searchParams: SEARCH_PARAMS_DEFAULT,
-
- // 添加 or 修改表单相关
- },
-
- effects: {
- *page({ payload }, { call, put }) {
- // const { queryParams } = payload;
- // const response = yield call(productSpuPage, payload);
- // message.info('查询成功!');
- // yield put({
- // type: 'treeSuccess',
- // payload: {
- // list: response.data,
- // },
- // });
-
- // 显示加载中
- yield put({
- type: 'changeListLoading',
- payload: true,
- });
-
- // 请求
- const response = yield call(queryUserPage, payload);
- // 响应
- yield put({
- type: 'setAll',
- payload: {
- list: response.data.list,
- pagination: PaginationHelper.formatPagination(response.data, payload),
- searchParams: {
- nickname: payload.nickname,
- status: payload.status,
- }
- },
- });
-
- // 隐藏加载中
- yield put({
- type: 'changeListLoading',
- payload: false,
- });
- },
- },
-
- reducers: {
- treeSuccess(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- },
- // 修改加载中的状态
- changeListLoading(state, { payload }) {
- return {
- ...state,
- listLoading: payload,
- };
- },
- // 设置所有属性
- setAll(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
- }
- },
-};
diff --git a/admin-web/src/pages/404.js b/admin-web/src/pages/404.js
deleted file mode 100644
index 34921c02b..000000000
--- a/admin-web/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 '@/components/Exception';
-
-export default () => (
-
-);
diff --git a/admin-web/src/pages/Account/Center/Applications.js b/admin-web/src/pages/Account/Center/Applications.js
deleted file mode 100644
index 031686cd1..000000000
--- a/admin-web/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/admin-web/src/pages/Account/Center/Articles.js b/admin-web/src/pages/Account/Center/Articles.js
deleted file mode 100644
index 9bb5ac309..000000000
--- a/admin-web/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/admin-web/src/pages/Account/Center/Articles.less b/admin-web/src/pages/Account/Center/Articles.less
deleted file mode 100644
index 2e51509ba..000000000
--- a/admin-web/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/admin-web/src/pages/Account/Center/Center.js b/admin-web/src/pages/Account/Center/Center.js
deleted file mode 100644
index d2512f95b..000000000
--- a/admin-web/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/admin-web/src/pages/Account/Center/Center.less b/admin-web/src/pages/Account/Center/Center.less
deleted file mode 100644
index f6434fafb..000000000
--- a/admin-web/src/pages/Account/Center/Center.less
+++ /dev/null
@@ -1,97 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.avatarHolder {
- margin-bottom: 24px;
- text-align: center;
-
- & > img {
- width: 104px;
- height: 104px;
- margin-bottom: 20px;
- }
-
- .name {
- margin-bottom: 4px;
- color: @heading-color;
- font-weight: 500;
- font-size: 20px;
- line-height: 28px;
- }
-}
-
-.detail {
- p {
- position: relative;
- margin-bottom: 8px;
- padding-left: 26px;
-
- &:last-child {
- margin-bottom: 0;
- }
- }
-
- i {
- position: absolute;
- top: 4px;
- left: 0;
- width: 14px;
- height: 14px;
- 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 {
- margin-bottom: 12px;
- color: @heading-color;
- font-weight: 500;
-}
-
-.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/admin-web/src/pages/Account/Center/Projects.js b/admin-web/src/pages/Account/Center/Projects.js
deleted file mode 100644
index ac749fdb5..000000000
--- a/admin-web/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 '@/components/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/admin-web/src/pages/Account/Settings/BaseView.js b/admin-web/src/pages/Account/Settings/BaseView.js
deleted file mode 100644
index f2f2b3a92..000000000
--- a/admin-web/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/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png';
- return url;
- }
-
- getViewDom = ref => {
- this.view = ref;
- };
-
- render() {
- const {
- form: { getFieldDecorator },
- } = this.props;
- return (
-
- );
- }
-}
-
-export default BaseView;
diff --git a/admin-web/src/pages/Account/Settings/BaseView.less b/admin-web/src/pages/Account/Settings/BaseView.less
deleted file mode 100644
index e1b09e937..000000000
--- a/admin-web/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 {
- min-width: 224px;
- max-width: 448px;
- }
- .right {
- flex: 1;
- padding-left: 104px;
- .avatar_title {
- height: 22px;
- margin-bottom: 8px;
- color: @heading-color;
- font-size: @font-size-base;
- line-height: 22px;
- }
- .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 {
- display: flex;
- flex-direction: column;
- align-items: center;
- max-width: 448px;
- padding: 20px;
- .avatar_title {
- display: none;
- }
- }
- }
-}
diff --git a/admin-web/src/pages/Account/Settings/BindingView.js b/admin-web/src/pages/Account/Settings/BindingView.js
deleted file mode 100644
index 29a29890c..000000000
--- a/admin-web/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/admin-web/src/pages/Account/Settings/GeographicView.js b/admin-web/src/pages/Account/Settings/GeographicView.js
deleted file mode 100644
index d33cb1387..000000000
--- a/admin-web/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/admin-web/src/pages/Account/Settings/GeographicView.less b/admin-web/src/pages/Account/Settings/GeographicView.less
deleted file mode 100644
index fdc975003..000000000
--- a/admin-web/src/pages/Account/Settings/GeographicView.less
+++ /dev/null
@@ -1,19 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.row {
- .item {
- width: 50%;
- max-width: 220px;
- }
- .item:first-child {
- width: ~'calc(50% - 8px)';
- margin-right: 8px;
- }
-}
-
-@media screen and (max-width: @screen-sm) {
- .item:first-child {
- margin: 0;
- margin-bottom: 8px;
- }
-}
diff --git a/admin-web/src/pages/Account/Settings/Info.js b/admin-web/src/pages/Account/Settings/Info.js
deleted file mode 100644
index ceee506b8..000000000
--- a/admin-web/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/admin-web/src/pages/Account/Settings/Info.less b/admin-web/src/pages/Account/Settings/Info.less
deleted file mode 100644
index b391ad55c..000000000
--- a/admin-web/src/pages/Account/Settings/Info.less
+++ /dev/null
@@ -1,97 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.main {
- display: flex;
- width: 100%;
- height: 100%;
- padding-top: 16px;
- padding-bottom: 16px;
- overflow: auto;
- background-color: @body-background;
- .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-top: 8px;
- padding-right: 40px;
- padding-bottom: 8px;
- padding-left: 40px;
- .title {
- margin-bottom: 12px;
- color: @heading-color;
- font-weight: 500;
- font-size: 20px;
- line-height: 28px;
- }
- }
- :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 {
- display: block;
- color: #ff4000;
- font-size: 48px;
- line-height: 48px;
- border-radius: @border-radius-base;
- }
- .dingding {
- margin: 2px;
- padding: 6px;
- color: #fff;
- font-size: 32px;
- line-height: 32px;
- background-color: #2eabff;
- 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/admin-web/src/pages/Account/Settings/NotificationView.js b/admin-web/src/pages/Account/Settings/NotificationView.js
deleted file mode 100644
index 96677bbd2..000000000
--- a/admin-web/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/admin-web/src/pages/Account/Settings/PhoneView.js b/admin-web/src/pages/Account/Settings/PhoneView.js
deleted file mode 100644
index 266552764..000000000
--- a/admin-web/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/admin-web/src/pages/Account/Settings/PhoneView.less b/admin-web/src/pages/Account/Settings/PhoneView.less
deleted file mode 100644
index ee4328ebf..000000000
--- a/admin-web/src/pages/Account/Settings/PhoneView.less
+++ /dev/null
@@ -1,11 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.area_code {
- width: 30%;
- max-width: 128px;
- margin-right: 8px;
-}
-.phone_number {
- width: ~'calc(70% - 8px)';
- max-width: 312px;
-}
diff --git a/admin-web/src/pages/Account/Settings/SecurityView.js b/admin-web/src/pages/Account/Settings/SecurityView.js
deleted file mode 100644
index 0706bd0b9..000000000
--- a/admin-web/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/admin-web/src/pages/Account/Settings/models/geographic.js b/admin-web/src/pages/Account/Settings/models/geographic.js
deleted file mode 100644
index a501920c7..000000000
--- a/admin-web/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/admin-web/src/pages/Admin/AdminList.js b/admin-web/src/pages/Admin/AdminList.js
deleted file mode 100644
index a78de6e75..000000000
--- a/admin-web/src/pages/Admin/AdminList.js
+++ /dev/null
@@ -1,589 +0,0 @@
-/* eslint-disable */
-
-import React, { PureComponent, Fragment } from 'react';
-import { connect } from 'dva';
-import {
- Card,
- Form,
- Input,
- Button,
- Modal,
- message,
- Table,
- Divider,
- Tree,
- Spin,
- Row,
- Col,
- Select,
- Icon,
- TreeSelect,
-} from 'antd';
-import { checkTypeWithEnglishAndNumbers } from '../../../helpers/validator';
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-
-import styles from './AdminList.less';
-import moment from 'moment';
-import PaginationHelper from '../../../helpers/PaginationHelper';
-
-const FormItem = Form.Item;
-const { TreeNode } = Tree;
-const status = ['未知', '在职', '离职'];
-
-// 列表
-function List({
- dataSource,
- loading,
- pagination,
- searchParams,
- dispatch,
- handleModalVisible,
- handleRoleAssignModalVisible,
-}) {
- function handleRoleAssign(record) {
- // 显示 Modal
- handleRoleAssignModalVisible(true, record);
- // 查询角色列表
- dispatch({
- type: 'adminList/queryRoleList',
- payload: {
- id: record.id,
- },
- });
- }
-
- function handleDelete(record) {
- Modal.confirm({
- title: `确认删除?`,
- content: `${record.username}`,
- onOk() {
- dispatch({
- type: 'adminList/delete',
- payload: {
- id: record.id,
- },
- });
- },
- onCancel() {},
- });
- }
-
- const columns = [
- {
- title: '账号',
- dataIndex: 'username',
- },
- {
- title: '员工姓名',
- dataIndex: 'name',
- },
- {
- title: '部门',
- dataIndex: 'deptment.name',
- },
- {
- title: '角色',
- dataIndex: 'roles',
- render(roles) {
- let text = '';
- if (roles) {
- for (let i in roles) {
- if (i > 0) {
- text += ' ';
- }
- text += roles[i].name;
- }
- }
- return {text};
- },
- },
- {
- title: '在职状态',
- dataIndex: 'status',
- render(val) {
- return {status[val]}; // TODO 芋艿,此处要改
- },
- },
- {
- title: '创建时间',
- dataIndex: 'createTime',
- render: val => {moment(val).format('YYYY-MM-DD HH:mm')},
- },
- {
- title: '操作',
- width: 360,
- render: (text, record) => {
- return (
-
- handleModalVisible(true, 'update', record)}>编辑
-
- handleRoleAssign(record)}>角色分配
-
- {record.status === 2 ? (
-
-
- handleDelete(record)}>
- 删除
-
-
- ) : null}
-
- );
- },
- },
- ];
-
- function onPageChange(page) {
- // 翻页
- dispatch({
- type: 'adminList/query',
- payload: {
- pageNo: page.current,
- pageSize: page.pageSize,
- ...searchParams,
- },
- });
- }
-
- return (
-
- );
-}
-
-// 搜索表单
-const SearchForm = Form.create()(props => {
- const {
- form,
- form: { getFieldDecorator },
- dispatch,
- deptSelectTree,
- } = props;
-
- function search() {
- const fields = form.getFieldsValue();
- if (fields.deptmentId) {
- const deptmentId = fields.deptmentId.split('-')[1];
- fields.deptmentId = deptmentId;
- }
- dispatch({
- type: 'adminList/query',
- payload: {
- ...PaginationHelper.defaultPayload,
- ...fields,
- },
- });
- }
-
- // 提交搜索
- function handleSubmit(e) {
- // 阻止默认事件
- e.preventDefault();
- // 提交搜索
- search();
- }
-
- // 重置搜索
- function handleReset() {
- // 重置表单
- form.resetFields();
- // 执行搜索
- search();
- }
-
- return (
-
- );
-});
-
-// 添加 or 修改 Form 表单
-const AddOrUpdateForm = Form.create()(props => {
- const {
- dispatch,
- modalVisible,
- form,
- handleModalVisible,
- modalType,
- formVals,
- deptSelectTree,
- } = props;
-
- const okHandle = () => {
- form.validateFields((err, fields) => {
- if (err) return;
- // 添加表单
- if (fields.deptmentId) {
- const deptmentId = fields.deptmentId.split('-')[1];
- fields.deptmentId = deptmentId;
- }
- if (modalType === 'add') {
- dispatch({
- type: 'adminList/add',
- payload: {
- body: {
- ...fields,
- },
- callback: () => {
- // 清空表单
- form.resetFields();
- // 提示
- message.success('新建成功');
- // 关闭弹窗
- handleModalVisible();
- },
- },
- });
- // 修改表单
- } else {
- dispatch({
- type: 'adminList/update',
- payload: {
- body: {
- id: formVals.id,
- ...fields,
- },
- callback: () => {
- // 清空表单
- form.resetFields();
- // 提示
- message.success('编辑成功');
- // 关闭弹窗
- handleModalVisible();
- },
- },
- });
- }
- });
- };
-
- const title = modalType === 'add' ? '新建员工' : '更新员工';
- return (
- handleModalVisible()}
- >
-
- {form.getFieldDecorator('name', {
- rules: [
- { required: true, message: '请输入员工姓名!' },
- { max: 10, message: '姓名最大长度为 10' },
- ],
- initialValue: formVals.name,
- })()}
-
-
- {form.getFieldDecorator('deptmentId', {
- rules: [{ required: true, message: '请选择部门' }],
- initialValue:
- formVals.deptmentId && formVals.deptmentId !== 0 ? formVals.deptmentId : null,
- })(
-
- )}
-
-
- {form.getFieldDecorator('username', {
- rules: [
- { required: true, message: '请输入账号!' },
- { max: 16, min: 6, message: '长度为 6-16 位' },
- {
- validator: (rule, value, callback) =>
- checkTypeWithEnglishAndNumbers(rule, value, callback, '数字以及字母'),
- },
- ],
- initialValue: formVals.username,
- })()}
-
-
- {form.getFieldDecorator('password', {
- rules: [
- { required: modalType === 'add', message: '请填写密码' }, // 添加时,必须输入密码
- { max: 16, min: 6, message: '长度为 6-18 位' },
- ],
- initialValue: formVals.password,
- })()}
-
-
- );
-});
-
-// 角色分配 Modal
-const RoleAssignModal = Form.create()(props => {
- const {
- modalVisible,
- form,
- handleModalVisible,
- treeData,
- checkedKeys,
- loading,
- formVals,
- dispatch,
- } = props;
-
- const handleCheckBoxClick = checkedKeys => {
- // 获得新选择
- const newCheckedKeys = checkedKeys.map(item => {
- return parseInt(item);
- });
- // 设置到 model 中
- dispatch({
- type: 'adminList/changeRoleCheckedKeys',
- payload: newCheckedKeys,
- });
- };
-
- const renderTreeNodes = data => {
- return data.map(item => {
- if (item.children) {
- // 递归拼接节点
- return (
-
- {renderTreeNodes(item.children)}
-
- );
- }
- return ;
- });
- };
-
- const renderModalContent = treeData => {
- const RenderTreeNodes = renderTreeNodes(treeData);
- if (RenderTreeNodes) {
- return (
-
- {form.getFieldDecorator('name', {})(
-
- {renderTreeNodes(treeData)}
-
- )}
-
- );
- } else {
- return null;
- }
- };
-
- const okHandle = () => {
- form.validateFields((err, fieldsValue) => {
- if (err) return;
- // debugger;
- dispatch({
- type: 'adminList/roleAssign',
- payload: {
- body: {
- id: formVals.id,
- roleIds: checkedKeys,
- },
- callback: () => {
- // 清空表单
- form.resetFields();
- // 提示
- message.success('分配角色成功');
- // 关闭弹窗
- handleModalVisible(false);
- },
- },
- });
- });
- };
-
- return (
- handleModalVisible()}
- >
- {renderModalContent(treeData)}
-
- );
-});
-
-@connect(({ adminList }) => ({
- // list: adminList.list,
- // pagination: adminList.pagination,
- ...adminList,
-}))
-// 主界面
-@Form.create()
-class AdminList extends PureComponent {
- componentDidMount() {
- const { dispatch } = this.props;
- dispatch({
- type: 'adminList/query',
- payload: {
- ...PaginationHelper.defaultPayload,
- },
- });
- dispatch({
- type: 'adminList/getDeptmentTree',
- payload: {},
- });
- }
-
- handleModalVisible = (modalVisible, modalType, record) => {
- const { dispatch } = this.props;
- dispatch({
- type: 'adminList/setAll',
- payload: {
- modalVisible,
- modalType,
- formVals: record || {},
- },
- });
- };
-
- handleRoleAssignModalVisible = (roleModalVisible, record) => {
- const { dispatch } = this.props;
- dispatch({
- type: 'adminList/setAll',
- payload: {
- roleModalVisible: roleModalVisible,
- formVals: record || {},
- },
- });
- };
-
- render() {
- // let that = this;
- const {
- dispatch,
- list,
- listLoading,
- searchParams,
- pagination,
- modalVisible,
- modalType,
- formVals,
- confirmLoading,
- roleList,
- roleModalVisible,
- roleAssignLoading,
- roleCheckedKeys,
- deptSelectTree,
- } = this.props;
-
- // 列表属性
- const listProps = {
- dataSource: list,
- pagination,
- searchParams,
- dispatch,
- loading: listLoading,
- confirmLoading,
- handleModalVisible: this.handleModalVisible, // Function
- handleRoleAssignModalVisible: this.handleRoleAssignModalVisible, // Function
- };
-
- // 搜索表单属性
- const searchFormProps = {
- dispatch,
- deptSelectTree,
- };
-
- // 添加 or 更新表单属性
- const addOrUpdateFormProps = {
- modalVisible,
- modalType,
- formVals,
- dispatch,
- deptSelectTree,
- handleModalVisible: this.handleModalVisible, // Function
- };
-
- // 分配角色 Modal 属性
- const roleAssignModal = {
- loading: roleAssignLoading,
- treeData: roleList,
- formVals,
- checkedKeys: roleCheckedKeys,
- modalVisible: roleModalVisible,
- dispatch,
- handleModalVisible: this.handleRoleAssignModalVisible, // Function
- };
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default AdminList;
diff --git a/admin-web/src/pages/Admin/AdminList.less b/admin-web/src/pages/Admin/AdminList.less
deleted file mode 100644
index 7ad3dac3f..000000000
--- a/admin-web/src/pages/Admin/AdminList.less
+++ /dev/null
@@ -1,47 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.tableList {
- .tableListOperator {
- margin-bottom: 16px;
- button {
- margin-right: 8px;
- }
- }
-}
-
-.tableDelete {
- color: red;
-}
-
-.tableListForm {
- :global {
- .ant-form-item {
- display: flex;
- margin-right: 0;
- margin-bottom: 24px;
- > .ant-form-item-label {
- width: auto;
- padding-right: 8px;
- line-height: 32px;
- }
- .ant-form-item-control {
- line-height: 32px;
- }
- }
- .ant-form-item-control-wrapper {
- flex: 1;
- }
- }
- .submitButtons {
- display: block;
- margin-bottom: 24px;
- white-space: nowrap;
- }
-}
-
-@media screen and (max-width: @screen-lg) {
- .tableListForm :global(.ant-form-item) {
- margin-right: 24px;
- }
-}
\ No newline at end of file
diff --git a/admin-web/src/pages/Admin/DeptmentList.js b/admin-web/src/pages/Admin/DeptmentList.js
deleted file mode 100644
index 621d86539..000000000
--- a/admin-web/src/pages/Admin/DeptmentList.js
+++ /dev/null
@@ -1,280 +0,0 @@
-import React, { PureComponent, Fragment } from 'react';
-import { Button, Card, Table, Form, Divider, Modal, Input, TreeSelect, message } from 'antd';
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-import { connect } from 'dva';
-import styles from './DeptmentList.less';
-import PaginationHelper from '../../../helpers/PaginationHelper';
-import moment from 'moment';
-const FormItem = Form.Item;
-// 添加 form 表单
-const CreateForm = Form.create()(props => {
- const {
- modalVisible,
- form,
- handleAdd,
- handleModalVisible,
- modalType,
- initValues,
- selectTree,
- } = props;
-
- const okHandle = () => {
- form.validateFields((err, fieldsValue) => {
- if (err) return;
- let pid = fieldsValue.pid;
- if (fieldsValue.pid) {
- pid = pid.split('-')[1];
- fieldsValue.pid = pid;
- }
- form.resetFields();
- handleAdd({
- fields: fieldsValue,
- modalType,
- initValues,
- });
- });
- };
-
- const selectStyle = {
- width: 200,
- };
-
- function onTypeChange(event) {
- initValues.type = parseInt(event.target.value);
- }
-
- // 给 type 赋予初始值
- initValues.type = initValues.type || 1;
-
- const title = modalType === 'add' ? '添加部门' : '编辑部门';
- const okText = modalType === 'add' ? '添加' : '编辑';
- return (
- handleModalVisible()}
- >
-
- {form.getFieldDecorator('name', {
- initialValue: initValues.name,
- rules: [{ required: true, message: '请输入部门名称!', min: 2 }],
- })()}
-
-
- {form.getFieldDecorator('sort', {
- initialValue: initValues.sort,
- })()}
-
-
- {form.getFieldDecorator('pid', {
- rules: [{ required: true, message: '请选择父级编号!' }],
- initialValue:
- initValues.pid === 0
- ? `根节点-${initValues.pid}`
- : initValues.pid
- ? `${initValues.name}-${initValues.pid}`
- : undefined,
- })(
-
- )}
-
-
- );
-});
-
-@connect(({ deptmentList, loading }) => ({
- deptmentList,
- deptmentData: deptmentList.deptmentData,
- loading: loading.models.deptmentList,
-}))
-@Form.create()
-export default class DepetmentList extends PureComponent {
- state = {
- modalVisible: false,
- modalType: 'add', //add or update
- initValues: {},
- };
-
- componentDidMount() {
- const { dispatch } = this.props;
- dispatch({
- type: 'deptmentList/getDeptmentAll',
- payload: {
- ...PaginationHelper.defaultPayload,
- },
- });
- }
-
- initFetch = () => {
- const { dispatch } = this.props;
- dispatch({
- type: 'deptmentList/getDeptmentAll',
- payload: {
- ...PaginationHelper.defaultPayload,
- },
- });
- };
-
- handleModalVisible = (flag, modalType, initValues) => {
- this.setState({
- modalVisible: !!flag,
- initValues: initValues || {},
- modalType: modalType || 'add',
- });
- if (flag) {
- //query treeSelect
- const { dispatch } = this.props;
- dispatch({
- type: 'deptmentList/getDeptmentAll',
- payload: {},
- });
- }
- };
-
- handleDelete(row) {
- const { dispatch } = this.props;
- const _this = this;
- Modal.confirm({
- title: `确认删除?`,
- content: `${row.name}`,
- onOk() {
- dispatch({
- type: 'deptmentList/delete',
- payload: {
- body: {
- id: row.id,
- },
- onSuccess: () => {
- message.success('删除成功');
- _this.initFetch();
- },
- onFail: response => {
- message.warn('删除失败' + response.message);
- },
- },
- });
- },
- onCancel() {},
- });
- }
-
- handleAdd = ({ fields, modalType, initValues }) => {
- const { dispatch } = this.props;
- if (modalType === 'add') {
- dispatch({
- type: 'deptmentList/add',
- payload: {
- body: {
- ...fields,
- },
- onSuccess: () => {
- message.success('添加成功');
- this.handleModalVisible();
- this.initFetch();
- },
- onFail: response => {
- message.warn('添加失败' + response.message);
- },
- },
- });
- } else {
- dispatch({
- type: 'deptmentList/update',
- payload: {
- body: {
- ...initValues,
- ...fields,
- },
- onSuccess: () => {
- message.success('更新成功成功');
- this.handleModalVisible();
- this.initFetch();
- },
- onFail: response => {
- message.warn('更新失败' + response.message);
- },
- },
- });
- }
- };
-
- render() {
- const { deptmentData, deptmentList, loading } = this.props;
- const { selectTree } = deptmentList;
- const { modalVisible, modalType, initValues } = this.state;
- const parentMethods = {
- handleAdd: this.handleAdd,
- handleModalVisible: this.handleModalVisible,
- modalType,
- initValues,
- };
- const columns = [
- {
- title: '部门名称',
- dataIndex: 'name',
- },
- {
- title: '排序',
- dataIndex: 'sort',
- },
- {
- title: '创建时间',
- dataIndex: 'createTime',
- sorter: true,
- render: val => {moment(val).format('YYYY-MM-DD')},
- },
- {
- title: '操作',
- render: (text, record) => (
-
- this.handleModalVisible(true, 'update', record)}>编辑
-
- this.handleDelete(record)}>
- 删除
-
-
- ),
- },
- ];
-
- // const {
- // deptmentList: {deptmentData},
- // loading,
- // } = this.props;
-
- return (
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
diff --git a/admin-web/src/pages/Admin/DeptmentList.less b/admin-web/src/pages/Admin/DeptmentList.less
deleted file mode 100644
index 22e257421..000000000
--- a/admin-web/src/pages/Admin/DeptmentList.less
+++ /dev/null
@@ -1,11 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.tableList {
- .tableListOperator {
- margin-bottom: 16px;
- button {
- margin-right: 8px;
- }
- }
-}
diff --git a/admin-web/src/pages/Admin/DictionaryList.js b/admin-web/src/pages/Admin/DictionaryList.js
deleted file mode 100644
index 720f6fbe7..000000000
--- a/admin-web/src/pages/Admin/DictionaryList.js
+++ /dev/null
@@ -1,240 +0,0 @@
-/* eslint-disable */
-
-import React, { PureComponent, Fragment } from 'react';
-import { connect } from 'dva';
-import moment from 'moment';
-import { Card, Form, Input, InputNumber, Select, Button, Modal, message, Table, Divider } from 'antd';
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-
-import styles from './DictionaryList.less';
-
-const FormItem = Form.Item;
-const { Option } = Select;
-const types = ['未知', '菜单', '链接'];
-
-// 添加 form 表单
-const CreateForm = Form.create()(props => {
- const { modalVisible, form, handleAdd, handleModalVisible, modalType, initValues } = props;
-
- const okHandle = () => {
- form.validateFields((err, fieldsValue) => {
- if (err) return;
- form.resetFields();
- handleAdd({
- fields: fieldsValue,
- modalType,
- initValues,
- });
- });
- };
-
- const selectStyle = {
- width: 200,
- };
-
- const title = modalType === 'add' ? '新建数据字典' : '编辑数据字典';
- const okText = '保存';
- return (
- handleModalVisible()}
- >
-
- {form.getFieldDecorator('enumValue', {
- rules: [{ required: true, message: '请输入大类枚举值!', min: 2 }],
- initialValue: initValues.enumValue,
- })()}
-
-
- {form.getFieldDecorator('value', {
- rules: [{ required: true, message: '请输入小类数值!' }],
- initialValue: initValues.value,
- })()}
-
-
- {form.getFieldDecorator('displayName', {
- rules: [{ required: true, message: '请输入展示名!' }],
- initialValue: initValues.displayName,
- })()}
-
-
- {form.getFieldDecorator('sort', {
- rules: [{ required: true, message: '请输入排序值!' }],
- initialValue: initValues.sort,
- })()}
-
-
- {form.getFieldDecorator('memo', {
- rules: [{ required: true, message: '请输入备注!' }],
- initialValue: initValues.memo,
- })()}
-
-
- );
-});
-
-@connect(({ dictionaryList, loading }) => ({
- dictionaryList,
- list: dictionaryList.list,
- loading: loading.models.dictionaryList,
-}))
-
-@Form.create()
-class DictionaryList extends PureComponent {
- state = {
- modalVisible: false,
- modalType: 'add', //add update
- initValues: {},
- };
-
- componentDidMount() {
- const { dispatch } = this.props;
- dispatch({
- type: 'dictionaryList/tree',
- payload: {},
- });
- }
-
- handleModalVisible = (flag, modalType, initValues) => {
- this.setState({
- modalVisible: !!flag,
- initValues: initValues || {},
- modalType: modalType || 'add',
- });
- };
-
- handleAdd = ({ fields, modalType, initValues }) => {
- const { dispatch } = this.props;
- if (modalType === 'add') {
- dispatch({
- type: 'dictionaryList/add',
- payload: {
- body: {
- ...fields,
- },
- callback: () => {
- message.success('添加成功');
- this.handleModalVisible();
- },
- },
- });
- } else {
- dispatch({
- type: 'dictionaryList/update',
- payload: {
- body: {
- ...initValues,
- ...fields,
- },
- callback: () => {
- message.success('更新成功');
- this.handleModalVisible();
- },
- },
- });
- }
- };
-
- handleDelete(row) {
- const { dispatch } = this.props;
- Modal.confirm({
- title: `确认删除?`,
- content: `${row.displayName}`,
- onOk() {
- dispatch({
- type: 'dictionaryList/delete',
- payload: {
- id: row.id,
- },
- });
- },
- onCancel() {},
- });
- }
-
- render() {
- const { list } = this.props;
- const { modalVisible, modalType, initValues } = this.state;
- const parentMethods = {
- handleAdd: this.handleAdd,
- handleModalVisible: this.handleModalVisible,
- modalType,
- initValues,
- };
- let that = this;
-
- const columns = [
- {
- title: '大类枚举值',
- dataIndex: 'enumValue'
- },
- // {
- // title: '编号',
- // dataIndex: 'id',
- // },
- {
- title: '小类数值',
- dataIndex: 'value'
- },
- {
- title: '展示名',
- dataIndex: 'displayName'
- },
- {
- title: '排序值',
- dataIndex: 'sort'
- },
- {
- title: '备注',
- dataIndex: 'memo'
- },
- {
- title: '创建时间',
- dataIndex: 'createTime',
- sorter: true,
- render: val => {moment(val).format('YYYY-MM-DD')},
- },
- {
- title: '操作',
- render: function(text, record) {
- if (!record.id) {
- return '';
- }
- return
- that.handleModalVisible(true, 'update', record)}>编辑
-
- that.handleDelete(record)}>
- 删除
-
-
- }
- },
- ];
-
- return (
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default DictionaryList;
diff --git a/admin-web/src/pages/Admin/DictionaryList.less b/admin-web/src/pages/Admin/DictionaryList.less
deleted file mode 100644
index ebb45c292..000000000
--- a/admin-web/src/pages/Admin/DictionaryList.less
+++ /dev/null
@@ -1,15 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.tableList {
- .tableListOperator {
- margin-bottom: 16px;
- button {
- margin-right: 8px;
- }
- }
-}
-
-.tableDelete {
- color: red;
-}
diff --git a/admin-web/src/pages/Admin/ResourceList.js b/admin-web/src/pages/Admin/ResourceList.js
deleted file mode 100644
index adfe767cc..000000000
--- a/admin-web/src/pages/Admin/ResourceList.js
+++ /dev/null
@@ -1,312 +0,0 @@
-/* eslint-disable */
-
-import React, { PureComponent, Fragment } from 'react';
-import { connect } from 'dva';
-import moment from 'moment';
-import {
- Card,
- Form,
- Input,
- Select,
- Button,
- Modal,
- message,
- Table,
- TreeSelect,
- Radio,
- Divider,
- Icon, InputNumber,
-} from 'antd';
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-
-import styles from './ResourceList.less';
-
-const RadioGroup = Radio.Group;
-const FormItem = Form.Item;
-const { Option } = Select;
-const TextArea = Input.TextArea;
-const types = ['未知', '菜单', '按钮'];
-
-// 添加 form 表单
-const CreateForm = Form.create()(props => {
- const {
- modalVisible,
- form,
- handleAdd,
- handleModalVisible,
- modalType,
- initValues,
- selectTree,
- } = props;
-
- const okHandle = () => {
- form.validateFields((err, fieldsValue) => {
- if (err) return;
- let pid = fieldsValue.pid;
- if (fieldsValue.pid) {
- pid = pid.split('-')[1];
- fieldsValue.pid = pid;
- }
- form.resetFields();
- handleAdd({
- fields: fieldsValue,
- modalType,
- initValues,
- });
- });
- };
-
- const selectStyle = {
- width: 200,
- };
-
- function onTypeChange(event) {
- initValues.type = parseInt(event.target.value);
- }
-
- // 给 type 赋予初始值
- initValues.type = initValues.type || 1;
-
- const title = modalType === 'add' ? '添加一个权限' : '编辑一个权限';
- const okText = modalType === 'add' ? '添加' : '编辑';
- return (
- handleModalVisible()}
- >
-
- {form.getFieldDecorator('type', {
- initialValue: initValues.type,
- })(
-
- 菜单
- 按钮
-
- )}
-
-
- {form.getFieldDecorator('name', {
- rules: [{ required: true, message: '请输入名称!', min: 2 }],
- initialValue: initValues.name,
- })()}
-
-
- {form.getFieldDecorator('pid', {
- rules: [{ required: true, message: '请选择父级编号!' }],
- initialValue:
- initValues.pid === 0
- ? `根节点`
- : initValues.pid ? `${initValues.name}` : undefined,
- })(
-
- )}
-
-
- {form.getFieldDecorator('sort', {
- rules: [{ required: true, message: '请输入排序!' }],
- initialValue: initValues.sort,
- })()}
-
- {
- initValues.type === 1 ? (
-
- {form.getFieldDecorator('icon', {
- rules: [{ required: true, message: '请输入图标!' }],
- initialValue: initValues.icon,
- })()}
-
- ) : ''
- }
- {
- initValues.type === 1 ? (
-
- {form.getFieldDecorator('route', {
- initialValue: initValues.route,
- })()}
-
- ) : ''
- }
-
- {form.getFieldDecorator('permission', {
- initialValue: initValues.permission,
- })()}
-
-
- );
-});
-
-@connect(({ resourceList, loading }) => ({
- resourceList,
- list: resourceList.list,
- loading: loading.models.resourceList,
-}))
-@Form.create()
-class ResourceList extends PureComponent {
- state = {
- modalVisible: false,
- modalType: 'add', //add update
- initValues: {},
- };
-
- componentDidMount() {
- const { dispatch } = this.props;
- dispatch({
- type: 'resourceList/tree',
- payload: {},
- });
- }
-
- handleModalVisible = (flag, modalType, initValues) => {
- this.setState({
- modalVisible: !!flag,
- initValues: initValues || {},
- modalType: modalType || 'add',
- });
- };
-
- handleAdd = ({ fields, modalType, initValues }) => {
- const { dispatch } = this.props;
- if (modalType === 'add') {
- dispatch({
- type: 'resourceList/add',
- payload: {
- body: {
- ...fields,
- },
- callback: () => {
- message.success('添加成功');
- this.handleModalVisible();
- },
- },
- });
- } else {
- dispatch({
- type: 'resourceList/update',
- payload: {
- body: {
- ...initValues,
- ...fields,
- },
- callback: () => {
- message.success('编辑成功');
- this.handleModalVisible();
- },
- },
- });
- }
- };
-
- handleDelete(row) {
- const { dispatch } = this.props;
- Modal.confirm({
- title: `确认删除?`,
- content: `${row.name}`,
- onOk() {
- dispatch({
- type: 'resourceList/delete',
- payload: {
- resourceId: row.id,
- },
- });
- },
- onCancel() {},
- });
- }
-
- render() {
- const { list, resourceList } = this.props;
- const { selectTree } = resourceList;
- const { modalVisible, modalType, initValues } = this.state;
- const parentMethods = {
- handleAdd: this.handleAdd,
- handleModalVisible: this.handleModalVisible,
- modalType,
- initValues,
- };
-
- const columns = [
- {
- title: '名称',
- dataIndex: 'name',
- },
- {
- title: '图标',
- dataIndex: 'icon',
- render: text => text ? : '',
- },
- {
- title: '类型',
- dataIndex: 'type',
- render(val) {
- return {types[val]};
- },
- },
- {
- title: '排序',
- dataIndex: 'sort',
- },
- {
- title: '路由',
- dataIndex: 'route',
- width: 200,
- render: val => {val},
- },
- {
- title: '权限标识',
- dataIndex: 'permission',
- width: 300,
- render: val => {val},
- },
- {
- title: '创建时间',
- dataIndex: 'createTime',
- sorter: true,
- render: val => {moment(val).format('YYYY-MM-DD')},
- },
- {
- title: '操作',
- render: (text, record) => (
-
- this.handleModalVisible(true, 'update', record)}>编辑
-
- this.handleDelete(record)}>
- 删除
-
-
- ),
- },
- ];
-
- return (
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default ResourceList;
diff --git a/admin-web/src/pages/Admin/ResourceList.less b/admin-web/src/pages/Admin/ResourceList.less
deleted file mode 100644
index ebb45c292..000000000
--- a/admin-web/src/pages/Admin/ResourceList.less
+++ /dev/null
@@ -1,15 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.tableList {
- .tableListOperator {
- margin-bottom: 16px;
- button {
- margin-right: 8px;
- }
- }
-}
-
-.tableDelete {
- color: red;
-}
diff --git a/admin-web/src/pages/Admin/RoleList.js b/admin-web/src/pages/Admin/RoleList.js
deleted file mode 100644
index 0befe716f..000000000
--- a/admin-web/src/pages/Admin/RoleList.js
+++ /dev/null
@@ -1,375 +0,0 @@
-/* eslint-disable */
-
-import React, { PureComponent, Fragment } from 'react';
-import { connect } from 'dva';
-import moment from 'moment';
-import { Card, Form, Input, Spin, Button, Modal, message, Table, Divider, Tree } from 'antd';
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-
-import styles from './RoleList.less';
-
-const FormItem = Form.Item;
-const { TreeNode } = Tree;
-const types = ['未知', '系统角色', '自定义角色'];
-
-// 添加 form 表单
-const CreateForm = Form.create()(props => {
- const { modalVisible, form, handleAdd, handleModalVisible, modalType, initValues } = props;
-
- const okHandle = () => {
- form.validateFields((err, fieldsValue) => {
- if (err) return;
- form.resetFields();
- handleAdd({
- fields: fieldsValue,
- modalType,
- initValues,
- });
- });
- };
-
- const title = modalType === 'add' ? '添加一个 Role' : '更新一个 Role';
- const okText = modalType === 'add' ? '添加' : '更新';
- return (
- handleModalVisible()}
- >
-
- {form.getFieldDecorator('name', {
- rules: [{ required: true, message: '请输入角色名!', min: 2 }],
- initialValue: initValues.name,
- })()}
-
-
- {form.getFieldDecorator('code', {
- rules: [{ required: false }],
- initialValue: initValues.code,
- })()}
-
-
- );
-});
-
-// 角色分配
-const AssignModal = Form.create()(props => {
- const {
- modalVisible,
- form,
- handleOk,
- handleModalVisible,
- treeData,
- checkedKeys,
- loading,
- handleCheckBoxClick,
- } = props;
-
- const renderTreeNodes = data => {
- return data.map(item => {
- if (item.children) {
- return (
-
- {renderTreeNodes(item.children)}
-
- );
- }
- return ;
- });
- };
-
- const renderModalContent = treeData => {
- const RenderTreeNodes = renderTreeNodes(treeData);
- if (RenderTreeNodes) {
- return (
-
- {form.getFieldDecorator('name', {})(
-
- {renderTreeNodes(treeData)}
-
- )}
-
- );
- } else {
- return null;
- }
- };
-
- const okHandle = () => {
- form.validateFields((err, fieldsValue) => {
- if (err) return;
- form.resetFields();
- handleOk({
- fields: fieldsValue,
- });
- });
- };
-
- return (
- handleModalVisible()}
- >
- {renderModalContent(treeData)}
-
- );
-});
-
-// roleList
-@connect(({ roleList, loading }) => ({
- roleList,
- list: roleList.list,
- data: roleList,
- loading: loading.models.resourceList,
-}))
-@Form.create()
-class RoleList extends PureComponent {
- state = {
- modalVisible: false,
- modalType: 'add', //add update
- initValues: {},
- roleAssignVisible: false,
- roleAssignRecord: {},
- };
-
- componentDidMount() {
- const { dispatch } = this.props;
- dispatch({
- type: 'roleList/query',
- payload: {
- name: '',
- pageNo: 1,
- pageSize: 10,
- },
- });
- }
-
- handleModalVisible = (flag, modalType, initValues) => {
- this.setState({
- modalVisible: !!flag,
- initValues: initValues || {},
- modalType: modalType || 'add',
- });
- };
-
- handleAssignModalVisible = (flag, record) => {
- const { dispatch } = this.props;
- dispatch({
- type: 'roleList/queryRoleAssign',
- payload: {
- roleId: record.id,
- },
- });
- this.setState({
- roleAssignVisible: !!flag,
- roleAssignRecord: record,
- });
- };
-
- handleAssignModalVisibleClose(flag) {
- this.setState({
- roleAssignVisible: !!flag,
- });
- }
-
- handleAssignCheckBoxClick = checkedKeys => {
- const { dispatch } = this.props;
- const newCheckedKeys = checkedKeys.map(item => {
- return parseInt(item);
- });
- dispatch({
- type: 'roleList/changeCheckedKeys',
- payload: newCheckedKeys,
- });
- };
-
- handleAssignOK = () => {
- const { dispatch, data } = this.props;
- const { roleAssignRecord } = this.state;
- dispatch({
- type: 'roleList/roleAssignResource',
- payload: {
- roleId: roleAssignRecord.id,
- resourceIds: data.checkedKeys,
- roleTreeData: data.roleTreeData,
- },
- });
- this.handleAssignModalVisibleClose(false);
- };
-
- handleAdd = ({ fields, modalType, initValues }) => {
- const { dispatch, data } = this.props;
- const queryParams = {
- pageNo: data.pageNo,
- pageSize: data.pageSize,
- };
- if (modalType === 'add') {
- dispatch({
- type: 'roleList/add',
- payload: {
- body: {
- ...fields,
- },
- queryParams,
- callback: () => {
- message.success('添加成功');
- this.handleModalVisible();
- },
- },
- });
- } else {
- dispatch({
- type: 'roleList/update',
- payload: {
- body: {
- ...initValues,
- ...fields,
- },
- queryParams,
- callback: () => {
- message.success('更新成功');
- this.handleModalVisible();
- },
- },
- });
- }
- };
-
- handleDelete(row) {
- const { dispatch, data } = this.props;
- const queryParams = {
- pageNo: data.pageNo,
- pageSize: data.pageSize,
- };
- Modal.confirm({
- title: `确认删除?`,
- content: `${row.name}`,
- onOk() {
- dispatch({
- type: 'roleList/delete',
- payload: {
- body: {
- id: row.id,
- },
- queryParams,
- },
- });
- },
- onCancel() {},
- });
- }
-
- render() {
- const { list, data } = this.props;
- const { pageNo, pageSize, count, roleTreeData, checkedKeys, assignModalLoading } = data;
- const { modalVisible, modalType, initValues, roleAssignVisible } = this.state;
-
- const parentMethods = {
- handleAdd: this.handleAdd,
- handleModalVisible: this.handleModalVisible,
- modalType,
- initValues,
- };
-
- const columns = [
- // {
- // title: 'id',
- // dataIndex: 'id',
- // render: text => {text},
- // },
- {
- title: '名称',
- dataIndex: 'name',
- },
- {
- title: '编码',
- dataIndex: 'code',
- },
- {
- title: '类型',
- dataIndex: 'type',
- render(val) {
- return {types[val]};
- },
- },
- {
- title: '创建时间',
- dataIndex: 'createTime',
- // sorter: true,
- render: val => {moment(val).format('YYYY-MM-DD')},
- },
- {
- title: '操作',
- width: 200,
- render: (text, record) => (
-
- {record.type === 2 ? (
-
- this.handleModalVisible(true, 'update', record)}>更新
-
- ) : null}
-
- this.handleAssignModalVisible(true, record)}>分配权限
-
- {record.type === 2 ? (
-
- this.handleDelete(record)}>
- 删除
-
-
- ) : null}
-
- ),
- },
- ];
-
- const paginationProps = {
- current: pageNo,
- pageSize: pageSize,
- total: count,
- };
-
- return (
-
-
-
-
-
-
-
-
-
-
- this.handleAssignModalVisibleClose(false)}
- />
-
- );
- }
-}
-
-export default RoleList;
diff --git a/admin-web/src/pages/Admin/RoleList.less b/admin-web/src/pages/Admin/RoleList.less
deleted file mode 100644
index ebb45c292..000000000
--- a/admin-web/src/pages/Admin/RoleList.less
+++ /dev/null
@@ -1,15 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.tableList {
- .tableListOperator {
- margin-bottom: 16px;
- button {
- margin-right: 8px;
- }
- }
-}
-
-.tableDelete {
- color: red;
-}
diff --git a/admin-web/src/pages/Authorized.js b/admin-web/src/pages/Authorized.js
deleted file mode 100644
index 05d91e45b..000000000
--- a/admin-web/src/pages/Authorized.js
+++ /dev/null
@@ -1,19 +0,0 @@
-import React from 'react';
-import RenderAuthorized from '@/components/Authorized';
-import { getAuthority } from '@/utils/authority';
-import Redirect from 'umi/redirect';
-
-const Authority = getAuthority();
-
-// TODO RenderAuthorized 暂时写死为 admin,次组件集成于 antd-pro 后期有时间处理,(可能有用,可能没用)
-// TODO 可大致分为两种角色,admin 管理员角色,user 代表其他非授权页面,可以公开的
-// const Authorized = RenderAuthorized(['admin', 'user']);
-const Authorized = RenderAuthorized(Authority);
-
-export default ({ children }) => {
- return (
- }>
- {children}
-
- );
-};
diff --git a/admin-web/src/pages/Dashboard/Analysis.js b/admin-web/src/pages/Dashboard/Analysis.js
deleted file mode 100644
index cceab9bdc..000000000
--- a/admin-web/src/pages/Dashboard/Analysis.js
+++ /dev/null
@@ -1,190 +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';
-import { AsyncLoadBizCharts } from '@/components/Charts/AsyncLoadBizCharts';
-
-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 props => (
-
-
-
-);
diff --git a/admin-web/src/pages/Dashboard/Analysis.less b/admin-web/src/pages/Dashboard/Analysis.less
deleted file mode 100644
index f71bd34a7..000000000
--- a/admin-web/src/pages/Dashboard/Analysis.less
+++ /dev/null
@@ -1,198 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.iconGroup {
- i {
- margin-left: 16px;
- color: @text-color-secondary;
- cursor: pointer;
- transition: color 0.32s;
- &:hover {
- color: @text-color;
- }
- }
-}
-
-.rankingList {
- margin: 25px 0 0;
- padding: 0;
- list-style: none;
- li {
- .clearfix();
-
- display: flex;
- align-items: center;
- margin-top: 16px;
- span {
- color: @text-color;
- font-size: 14px;
- line-height: 22px;
- }
- .rankingItemNumber {
- display: inline-block;
- width: 20px;
- height: 20px;
- margin-top: 1.5px;
- margin-right: 16px;
- font-weight: 600;
- font-size: 12px;
- line-height: 20px;
- text-align: center;
- background-color: @background-color-base;
- border-radius: 20px;
- &.active {
- color: #fff;
- background-color: #314659;
- }
- }
- .rankingItemTitle {
- flex: 1;
- margin-right: 8px;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- }
-}
-
-.salesExtra {
- display: inline-block;
- margin-right: 24px;
- a {
- margin-left: 24px;
- color: @text-color;
- &: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-right: 40px;
- padding-left: 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 {
- position: absolute\9;
- right: 0\9;
- height: 100%\9;
- }
- :global {
- .ant-row {
- position: relative\9;
- display: flex;
- display: block\9;
- flex-flow: row wrap;
- }
- }
-}
-
-.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/admin-web/src/pages/Dashboard/IntroduceRow.js b/admin-web/src/pages/Dashboard/IntroduceRow.js
deleted file mode 100644
index 7262826fa..000000000
--- a/admin-web/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 '@/components/Charts';
-import Trend from '@/components/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/admin-web/src/pages/Dashboard/Monitor.js b/admin-web/src/pages/Dashboard/Monitor.js
deleted file mode 100644
index d9bb87c61..000000000
--- a/admin-web/src/pages/Dashboard/Monitor.js
+++ /dev/null
@@ -1,249 +0,0 @@
-import React, { Component } from 'react';
-import { AsyncLoadBizCharts } from '@/components/Charts/AsyncLoadBizCharts';
-import { connect } from 'dva';
-import { formatMessage, FormattedMessage } from 'umi/locale';
-import { Row, Col, Card, Tooltip } from 'antd';
-import { Pie, WaterWave, Gauge, TagCloud } from '@/components/Charts';
-import NumberInfo from '@/components/NumberInfo';
-import CountDown from '@/components/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 Component {
- 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 props => (
-
-
-
-);
diff --git a/admin-web/src/pages/Dashboard/Monitor.less b/admin-web/src/pages/Dashboard/Monitor.less
deleted file mode 100644
index 82d727229..000000000
--- a/admin-web/src/pages/Dashboard/Monitor.less
+++ /dev/null
@@ -1,23 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.mapChart {
- height: 452px;
- padding-top: 24px;
- 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/admin-web/src/pages/Dashboard/OfflineData.js b/admin-web/src/pages/Dashboard/OfflineData.js
deleted file mode 100644
index f7d06ef07..000000000
--- a/admin-web/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 styles from './Analysis.less';
-import { TimelineChart, Pie } from '@/components/Charts';
-import NumberInfo from '@/components/NumberInfo';
-
-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/admin-web/src/pages/Dashboard/ProportionSales.js b/admin-web/src/pages/Dashboard/ProportionSales.js
deleted file mode 100644
index ff16a7d23..000000000
--- a/admin-web/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 '@/components/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/admin-web/src/pages/Dashboard/SalesCard.js b/admin-web/src/pages/Dashboard/SalesCard.js
deleted file mode 100644
index 3ab577757..000000000
--- a/admin-web/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 styles from './Analysis.less';
-import { Bar } from '@/components/Charts';
-
-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/admin-web/src/pages/Dashboard/TopSearch.js b/admin-web/src/pages/Dashboard/TopSearch.js
deleted file mode 100644
index 4e75ea7d5..000000000
--- a/admin-web/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 '@/components/Trend';
-import numeral from 'numeral';
-import styles from './Analysis.less';
-import NumberInfo from '@/components/NumberInfo';
-import { MiniArea } from '@/components/Charts';
-
-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/admin-web/src/pages/Dashboard/Workplace.js b/admin-web/src/pages/Dashboard/Workplace.js
deleted file mode 100644
index 3e7ff986a..000000000
--- a/admin-web/src/pages/Dashboard/Workplace.js
+++ /dev/null
@@ -1,260 +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 { AsyncLoadBizCharts } from '@/components/Charts/AsyncLoadBizCharts';
-import { Radar } from '@/components/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 props => (
-
-
-
-);
diff --git a/admin-web/src/pages/Dashboard/Workplace.less b/admin-web/src/pages/Dashboard/Workplace.less
deleted file mode 100644
index b67e0b64a..000000000
--- a/admin-web/src/pages/Dashboard/Workplace.less
+++ /dev/null
@@ -1,228 +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 {
- display: block;
- width: 72px;
- height: 72px;
- border-radius: 72px;
- }
- }
- .content {
- position: relative;
- top: 4px;
- flex: 1 1 auto;
- margin-left: 24px;
- color: @text-color-secondary;
- line-height: 22px;
- .contentTitle {
- margin-bottom: 12px;
- color: @heading-color;
- font-weight: 500;
- font-size: 20px;
- line-height: 28px;
- }
- }
-}
-
-.extraContent {
- .clearfix();
-
- float: right;
- white-space: nowrap;
- .statItem {
- position: relative;
- display: inline-block;
- padding: 0 32px;
- > p:first-child {
- margin-bottom: 4px;
- color: @text-color-secondary;
- font-size: @font-size-base;
- line-height: 22px;
- }
- > p {
- margin: 0;
- color: @heading-color;
- font-size: 30px;
- line-height: 38px;
- > span {
- color: @text-color-secondary;
- font-size: 20px;
- }
- }
- &::after {
- position: absolute;
- top: 8px;
- right: 0;
- width: 1px;
- height: 40px;
- background-color: @border-color-split;
- content: '';
- }
- &:last-child {
- padding-right: 0;
- &::after {
- display: none;
- }
- }
- }
-}
-
-.members {
- a {
- display: block;
- height: 24px;
- margin: 12px 0;
- color: @text-color;
- transition: all 0.3s;
- .textOverflow();
- .member {
- margin-left: 12px;
- font-size: @font-size-base;
- line-height: 24px;
- vertical-align: top;
- }
- &:hover {
- color: @primary-color;
- }
- }
-}
-
-.projectList {
- :global {
- .ant-card-meta-description {
- height: 44px;
- overflow: hidden;
- color: @text-color-secondary;
- line-height: 22px;
- }
- }
- .cardTitle {
- font-size: 0;
- a {
- display: inline-block;
- height: 24px;
- margin-left: 12px;
- color: @heading-color;
- font-size: @font-size-base;
- line-height: 24px;
- vertical-align: top;
- &:hover {
- color: @primary-color;
- }
- }
- }
- .projectGrid {
- width: 33.33%;
- }
- .projectItemContent {
- display: flex;
- height: 20px;
- margin-top: 8px;
- overflow: hidden;
- font-size: 12px;
- line-height: 20px;
- .textOverflow();
- a {
- display: inline-block;
- flex: 1 1 0;
- color: @text-color-secondary;
- .textOverflow();
- &:hover {
- color: @primary-color;
- }
- }
- .datetime {
- flex: 0 0 auto;
- float: right;
- color: @disabled-color;
- }
- }
-}
-
-.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/admin-web/src/pages/Dashboard/models/activities.js b/admin-web/src/pages/Dashboard/models/activities.js
deleted file mode 100644
index 4e0a11e27..000000000
--- a/admin-web/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/admin-web/src/pages/Dashboard/models/chart.js b/admin-web/src/pages/Dashboard/models/chart.js
deleted file mode 100644
index 8dfe4a93f..000000000
--- a/admin-web/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/admin-web/src/pages/Dashboard/models/monitor.js b/admin-web/src/pages/Dashboard/models/monitor.js
deleted file mode 100644
index e3e832ff8..000000000
--- a/admin-web/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/admin-web/src/pages/Exception/403.js b/admin-web/src/pages/Exception/403.js
deleted file mode 100644
index 35e4ca3a1..000000000
--- a/admin-web/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 '@/components/Exception';
-
-const Exception403 = () => (
-
-);
-
-export default Exception403;
diff --git a/admin-web/src/pages/Exception/404.js b/admin-web/src/pages/Exception/404.js
deleted file mode 100644
index 84c986c5e..000000000
--- a/admin-web/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 '@/components/Exception';
-
-const Exception404 = () => (
-
-);
-
-export default Exception404;
diff --git a/admin-web/src/pages/Exception/500.js b/admin-web/src/pages/Exception/500.js
deleted file mode 100644
index 9d96f2120..000000000
--- a/admin-web/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 '@/components/Exception';
-
-const Exception500 = () => (
-
-);
-
-export default Exception500;
diff --git a/admin-web/src/pages/Exception/TriggerException.js b/admin-web/src/pages/Exception/TriggerException.js
deleted file mode 100644
index 15ace510f..000000000
--- a/admin-web/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/admin-web/src/pages/Exception/models/error.js b/admin-web/src/pages/Exception/models/error.js
deleted file mode 100644
index 1bfd93921..000000000
--- a/admin-web/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/admin-web/src/pages/Exception/style.less b/admin-web/src/pages/Exception/style.less
deleted file mode 100644
index 91ec7dcf5..000000000
--- a/admin-web/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/admin-web/src/pages/Forms/AdvancedForm.js b/admin-web/src/pages/Forms/AdvancedForm.js
deleted file mode 100644
index fbd396893..000000000
--- a/admin-web/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 '@/components/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/admin-web/src/pages/Forms/BasicForm.js b/admin-web/src/pages/Forms/BasicForm.js
deleted file mode 100644
index 55833150a..000000000
--- a/admin-web/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/admin-web/src/pages/Forms/StepForm/Step1.js b/admin-web/src/pages/Forms/StepForm/Step1.js
deleted file mode 100644
index a62e29419..000000000
--- a/admin-web/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/admin-web/src/pages/Forms/StepForm/Step2.js b/admin-web/src/pages/Forms/StepForm/Step2.js
deleted file mode 100644
index 3e3b05bf2..000000000
--- a/admin-web/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/admin-web/src/pages/Forms/StepForm/Step3.js b/admin-web/src/pages/Forms/StepForm/Step3.js
deleted file mode 100644
index 74e1a6b8a..000000000
--- a/admin-web/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 '@/components/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/admin-web/src/pages/Forms/StepForm/index.js b/admin-web/src/pages/Forms/StepForm/index.js
deleted file mode 100644
index 98902a0aa..000000000
--- a/admin-web/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/admin-web/src/pages/Forms/StepForm/style.less b/admin-web/src/pages/Forms/StepForm/style.less
deleted file mode 100644
index 452e1b3fe..000000000
--- a/admin-web/src/pages/Forms/StepForm/style.less
+++ /dev/null
@@ -1,78 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.stepForm {
- max-width: 500px;
- margin: 40px auto 0;
-}
-
-.stepFormText {
- margin-bottom: 24px;
- :global {
- .ant-form-item-label,
- .ant-form-item-control {
- line-height: 22px;
- }
- }
-}
-
-.result {
- max-width: 560px;
- margin: 0 auto;
- padding: 24px 0 8px;
-}
-
-.desc {
- padding: 0 56px;
- color: @text-color-secondary;
- h3 {
- margin: 0 0 12px 0;
- color: @text-color-secondary;
- font-size: 16px;
- 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 {
- padding-right: 8px;
- color: @heading-color;
- text-align: right;
- @media screen and (max-width: @screen-sm) {
- text-align: left;
- }
- }
-}
-
-.money {
- font-weight: 500;
- font-size: 20px;
- font-family: 'Helvetica Neue', sans-serif;
- line-height: 14px;
-}
-
-.uppercase {
- font-size: 12px;
-}
diff --git a/admin-web/src/pages/Forms/TableForm.js b/admin-web/src/pages/Forms/TableForm.js
deleted file mode 100644
index ae2723e7b..000000000
--- a/admin-web/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/admin-web/src/pages/Forms/models/form.js b/admin-web/src/pages/Forms/models/form.js
deleted file mode 100644
index 0b241b133..000000000
--- a/admin-web/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/admin-web/src/pages/Forms/style.less b/admin-web/src/pages/Forms/style.less
deleted file mode 100644
index cb23b0b4c..000000000
--- a/admin-web/src/pages/Forms/style.less
+++ /dev/null
@@ -1,90 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.card {
- margin-bottom: 24px;
-}
-
-.heading {
- margin: 0 0 16px 0;
- font-size: 14px;
- line-height: 22px;
-}
-
-.steps:global(.ant-steps) {
- max-width: 750px;
- margin: 16px auto;
-}
-
-.errorIcon {
- margin-right: 24px;
- color: @error-color;
- cursor: pointer;
- i {
- margin-right: 4px;
- }
-}
-
-.errorPopover {
- :global {
- .ant-popover-inner-content {
- min-width: 256px;
- max-height: 290px;
- padding: 0;
- overflow: auto;
- }
- }
-}
-
-.errorListItem {
- padding: 8px 16px;
- list-style: none;
- border-bottom: 1px solid @border-color-split;
- cursor: pointer;
- transition: all 0.3s;
- &:hover {
- background: @primary-1;
- }
- &:last-child {
- border: 0;
- }
- .errorIcon {
- float: left;
- margin-top: 4px;
- margin-right: 12px;
- padding-bottom: 22px;
- color: @error-color;
- }
- .errorField {
- margin-top: 2px;
- color: @text-color-secondary;
- font-size: 12px;
- }
-}
-
-.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/admin-web/src/pages/Home/Home.js b/admin-web/src/pages/Home/Home.js
deleted file mode 100644
index 42651f51b..000000000
--- a/admin-web/src/pages/Home/Home.js
+++ /dev/null
@@ -1,23 +0,0 @@
-import React, { Component } from 'react';
-import { Button } from 'antd';
-import DictionarySelect from '@/components/Dictionary/DictionarySelect';
-import DictionaryText from '@/components/Dictionary/DictionaryText';
-import AuthorityControl from '@/components/AuthorityControl';
-
-export default class Home extends Component {
- state = {};
-
- render() {
- return (
-
- {/*
*/}
- {/**/}
- {/**/}
-
home...
-
-
-
-
- );
- }
-}
diff --git a/admin-web/src/pages/List/Applications.js b/admin-web/src/pages/List/Applications.js
deleted file mode 100644
index e36012ddd..000000000
--- a/admin-web/src/pages/List/Applications.js
+++ /dev/null
@@ -1,192 +0,0 @@
-import React, { PureComponent } from 'react';
-import numeral from 'numeral';
-import { connect } from 'dva';
-import { FormattedMessage } from 'umi/locale';
-import { Row, Col, Form, Card, Select, Icon, Avatar, List, Tooltip, Dropdown, Menu } from 'antd';
-import TagSelect from '@/components/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 actionsTextMap = {
- expandText: ,
- collapseText: (
-
- ),
- selectAllText: ,
- };
-
- const itemMenu = (
-
- );
-
- return (
-
-
-
-
-
(
-
-
-
- ,
-
-
- ,
-
-
- ,
-
-
- ,
- ]}
- >
- } title={item.title} />
-
-
-
-
-
- )}
- />
-
- );
- }
-}
-
-export default FilterCardList;
diff --git a/admin-web/src/pages/List/Applications.less b/admin-web/src/pages/List/Applications.less
deleted file mode 100644
index b770e127b..000000000
--- a/admin-web/src/pages/List/Applications.less
+++ /dev/null
@@ -1,44 +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;
- float: left;
- width: 50%;
- text-align: left;
- p {
- margin: 0;
- font-size: 24px;
- line-height: 32px;
- }
- p:first-child {
- margin-bottom: 4px;
- color: @text-color-secondary;
- font-size: 12px;
- line-height: 20px;
- }
- }
- }
-}
diff --git a/admin-web/src/pages/List/Articles.js b/admin-web/src/pages/List/Articles.js
deleted file mode 100644
index 5ab311ba0..000000000
--- a/admin-web/src/pages/List/Articles.js
+++ /dev/null
@@ -1,251 +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 { FormattedMessage } from 'umi/locale';
-
-import TagSelect from '@/components/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 actionsTextMap = {
- expandText: ,
- collapseText: (
-
- ),
- selectAllText: ,
- };
-
- const loadMore =
- list.length > 0 ? (
-
-
-
- ) : null;
-
- return (
-
-
-
-
-
- (
- ,
- ,
- ,
- ]}
- extra={}
- >
-
- {item.title}
-
- }
- description={
-
- Ant Design
- 设计语言
- 蚂蚁金服
-
- }
- />
-
-
- )}
- />
-
-
- );
- }
-}
-
-export default SearchList;
diff --git a/admin-web/src/pages/List/Articles.less b/admin-web/src/pages/List/Articles.less
deleted file mode 100644
index 3ec950159..000000000
--- a/admin-web/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/admin-web/src/pages/List/BasicList.js b/admin-web/src/pages/List/BasicList.js
deleted file mode 100644
index 1e33cbce7..000000000
--- a/admin-web/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 '@/components/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/admin-web/src/pages/List/BasicList.less b/admin-web/src/pages/List/BasicList.less
deleted file mode 100644
index fd226b0f4..000000000
--- a/admin-web/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 {
- padding: 24px 0;
- line-height: 32px;
- }
- .ant-card-extra {
- padding: 24px 0;
- }
- .ant-list-pagination {
- margin-top: 24px;
- text-align: right;
- }
- .ant-avatar-lg {
- width: 48px;
- height: 48px;
- line-height: 48px;
- }
- }
- .headerInfo {
- position: relative;
- text-align: center;
- & > span {
- display: inline-block;
- margin-bottom: 4px;
- color: @text-color-secondary;
- font-size: @font-size-base;
- line-height: 22px;
- }
- & > p {
- margin: 0;
- color: @heading-color;
- font-size: 24px;
- line-height: 32px;
- }
- & > em {
- position: absolute;
- top: 0;
- right: 0;
- width: 1px;
- height: 56px;
- background-color: @border-color-split;
- }
- }
- .listContent {
- font-size: 0;
- .listContentItem {
- display: inline-block;
- margin-left: 40px;
- color: @text-color-secondary;
- font-size: @font-size-base;
- vertical-align: middle;
- > span {
- line-height: 20px;
- }
- > p {
- margin-top: 4px;
- margin-bottom: 0;
- line-height: 22px;
- }
- }
- }
- .extraContentSearch {
- width: 272px;
- margin-left: 16px;
- }
-}
-
-@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 {
- width: 100%;
- margin-left: 0;
- }
- .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 {
- margin-bottom: 32px;
- padding-top: 4px;
- }
- }
- }
-}
-
-.formResult {
- width: 100%;
- [class^='title'] {
- margin-bottom: 8px;
- }
-}
diff --git a/admin-web/src/pages/List/CardList.js b/admin-web/src/pages/List/CardList.js
deleted file mode 100644
index a40f74b7e..000000000
--- a/admin-web/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 '@/components/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/admin-web/src/pages/List/CardList.less b/admin-web/src/pages/List/CardList.less
deleted file mode 100644
index 02f806cb8..000000000
--- a/admin-web/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 {
- display: inline-block;
- max-width: 100%;
- color: @heading-color;
- }
- }
- .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 {
- width: 195px;
- margin-top: -60px;
- text-align: center;
- img {
- width: 100%;
- }
-}
-
-.newButton {
- width: 100%;
- height: 188px;
- color: @text-color-secondary;
- background-color: #fff;
- border-color: @border-color-base;
- border-radius: @border-radius-sm;
-}
-
-.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 {
- margin-right: 8px;
- vertical-align: middle;
- }
-}
-
-@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;
- bottom: -4px;
- left: 0;
- width: 1000px;
- a {
- margin-right: 16px;
- }
- img {
- margin-right: 4px;
- }
- }
-}
diff --git a/admin-web/src/pages/List/List.js b/admin-web/src/pages/List/List.js
deleted file mode 100644
index d420af592..000000000
--- a/admin-web/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/admin-web/src/pages/List/Projects.js b/admin-web/src/pages/List/Projects.js
deleted file mode 100644
index 3f4a6e9d7..000000000
--- a/admin-web/src/pages/List/Projects.js
+++ /dev/null
@@ -1,163 +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 { FormattedMessage } from 'umi/locale';
-
-import TagSelect from '@/components/TagSelect';
-import AvatarList from '@/components/AvatarList';
-import Ellipsis from '@/components/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 },
- },
- };
-
- const actionsTextMap = {
- expandText: ,
- collapseText: (
-
- ),
- selectAllText: ,
- };
-
- return (
-
-
-
-
-
{cardList}
-
- );
- }
-}
-
-export default CoverCardList;
diff --git a/admin-web/src/pages/List/Projects.less b/admin-web/src/pages/List/Projects.less
deleted file mode 100644
index 8469fc821..000000000
--- a/admin-web/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 {
- display: inline-block;
- max-width: 100%;
- color: @heading-color;
- }
- }
- .ant-card-meta-description {
- height: 44px;
- overflow: hidden;
- line-height: 22px;
- }
- }
-
- &:hover {
- :global {
- .ant-card-meta-title > a {
- color: @primary-color;
- }
- }
- }
- }
-
- .cardItemContent {
- display: flex;
- height: 20px;
- margin-top: 16px;
- margin-bottom: -4px;
- line-height: 20px;
- & > span {
- flex: 1;
- color: @text-color-secondary;
- 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/admin-web/src/pages/List/TableList.js b/admin-web/src/pages/List/TableList.js
deleted file mode 100644
index 1230c5099..000000000
--- a/admin-web/src/pages/List/TableList.js
+++ /dev/null
@@ -1,691 +0,0 @@
-import React, { PureComponent, Fragment } from 'react';
-import { connect } from 'dva';
-import moment from 'moment';
-import router from 'umi/router';
-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',
- render: text => this.previewItem(text)}>{text},
- },
- {
- title: '描述',
- dataIndex: 'desc',
- },
- {
- title: '服务调用次数',
- dataIndex: 'callNo',
- sorter: true,
- 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,
- });
- };
-
- previewItem = id => {
- router.push(`/profile/basic/${id}`);
- };
-
- 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/admin-web/src/pages/List/TableList.less b/admin-web/src/pages/List/TableList.less
deleted file mode 100644
index bc5601c1a..000000000
--- a/admin-web/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 {
- display: flex;
- margin-right: 0;
- margin-bottom: 24px;
- > .ant-form-item-label {
- width: auto;
- padding-right: 8px;
- line-height: 32px;
- }
- .ant-form-item-control {
- line-height: 32px;
- }
- }
- .ant-form-item-control-wrapper {
- flex: 1;
- }
- }
- .submitButtons {
- display: block;
- margin-bottom: 24px;
- white-space: nowrap;
- }
-}
-
-@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/admin-web/src/pages/List/models/rule.js b/admin-web/src/pages/List/models/rule.js
deleted file mode 100644
index b318dbe36..000000000
--- a/admin-web/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/admin-web/src/pages/Order/OrderCancel.js b/admin-web/src/pages/Order/OrderCancel.js
deleted file mode 100644
index 5a58df109..000000000
--- a/admin-web/src/pages/Order/OrderCancel.js
+++ /dev/null
@@ -1,84 +0,0 @@
-import React from 'react';
-import { Form, Input, Modal } from 'antd';
-import DictionarySelect from '@/components/Dictionary/DictionarySelect';
-import dictionary from '@/utils/dictionary';
-
-const FormItem = Form.Item;
-
-// 订单 - 更新支付金额
-const OrderCancel = Form.create()(props => {
- const { form, dispatch, loading } = props;
- const { orderId, orderCancelVisible, orderCancelShowOther, searchParams } = props.orderList;
- const { getFieldDecorator } = props.form;
-
- const handleOk = e => {
- e.preventDefault();
- form.validateFields((err, fields) => {
- if (err) return;
- dispatch({
- type: 'orderList/cancelOrder',
- payload: {
- params: {
- orderId,
- reasons: fields.reasons,
- otherReasons: fields.otherReasons,
- },
- searchParams,
- },
- });
- });
- };
-
- const handleCancel = () => {
- dispatch({
- type: 'orderList/changeRemakeVisible',
- payload: {
- remarkVisible: false,
- },
- });
- };
-
- const handleReasonsChange = key => {
- dispatch({
- type: 'orderList/changeOrderCancelShowOther',
- payload: {
- orderCancelShowOther: key === '20',
- },
- });
- };
-
- return (
-
-
- {getFieldDecorator('reasons', {
- rules: [{ required: true, message: '请选择取消原因!' }],
- })(
-
- )}
-
- {orderCancelShowOther ? (
-
- {getFieldDecorator('otherReasons', {
- rules: [{ required: true, message: '请输填写退款原因!' }],
- })()}
-
- ) : (
- ''
- )}
-
- );
-});
-
-export default OrderCancel;
diff --git a/admin-web/src/pages/Order/OrderDelivery.js b/admin-web/src/pages/Order/OrderDelivery.js
deleted file mode 100644
index c531bdba1..000000000
--- a/admin-web/src/pages/Order/OrderDelivery.js
+++ /dev/null
@@ -1,163 +0,0 @@
-import React from 'react';
-import { Table, Modal, Card, Form, Input, message } from 'antd';
-import DictionaryText from '@/components/Dictionary/DictionaryText';
-import DictionarySelect from '@/components/Dictionary/DictionarySelect';
-import dictionary from '@/utils/dictionary';
-import styles from './OrderDelivery.less';
-
-const OrderDelivery = Form.create()(props => {
- const columns = [
- {
- title: '商品',
- dataIndex: 'skuName',
- render: (text, row) => {
- return (
-
-
-
{row.skuName}
-
- );
- },
- },
- {
- title: '数量',
- dataIndex: 'quantity',
- render: quantity => {quantity},
- },
- {
- title: '状态',
- dataIndex: 'status',
- sorter: true,
- render: status => ,
- },
- {
- title: '运输号',
- dataIndex: 'orderLogisticsId',
- width: 200,
- render: orderLogisticsId => {
- return {orderLogisticsId || '-'};
- },
- },
- ];
-
- const handleCancel = () => {
- const { dispatch } = props;
- dispatch({
- type: 'orderDelivery/changeVisible',
- payload: {
- visible: false,
- },
- });
- };
-
- const handleOk = e => {
- e.preventDefault();
- const { dispatch, form } = props;
- const { selectedRowKeys, orderId } = props.orderDelivery;
- form.validateFields((err, fields) => {
- if (err) return;
- console.log('fields', fields);
-
- console.log('selectedRowKeys', selectedRowKeys);
- if (selectedRowKeys.length <= 0) {
- message.error('至少选择一个发货的商品!');
- } else {
- dispatch({
- type: 'orderDelivery/deliver',
- payload: {
- ...fields,
- orderId,
- orderItemIds: selectedRowKeys,
- },
- });
- }
- });
- };
-
- const { loading, orderDelivery } = props;
- const { getFieldDecorator } = props.form;
- const { list, visible, orderRecipient } = orderDelivery;
- const { name, mobile, address } = orderRecipient || {};
-
- // rowSelection objects indicates the need for row selection
- const rowSelection = {
- onChange: (selectedRowKeys, selectedRows) => {
- console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
- props.dispatch({
- type: 'orderDelivery/changeSelectedRowKeys',
- payload: {
- selectedRowKeys,
- },
- });
- },
- onSelect: (record, selected, selectedRows) => {
- console.log(record, selected, selectedRows);
- },
- onSelectAll: (selected, selectedRows, changeRows) => {
- console.log(selected, selectedRows, changeRows);
- },
- };
-
- return (
-
-
-
-
-
-
配送信息
{' '}
-
-
- 收货人: {name} ({mobile})
-
- 配件方式: 快递 TODO暂时只有一种
- 收件地址: {address}
-
-
-
-
-
发货方式
{' '}
-
-
- {getFieldDecorator('logistics', {
- rules: [{ required: true, message: '必选!' }],
- })(
-
- )}
-
-
- {getFieldDecorator('logisticsNo', {
- rules: [{ required: true, message: '必选!' }],
- })()}
-
-
- *请仔细填写物流公司及快递单号,发货后24小时内仅支持做一次更正,逾期不可修改
-
-
-
-
- );
-});
-
-export default OrderDelivery;
diff --git a/admin-web/src/pages/Order/OrderDelivery.less b/admin-web/src/pages/Order/OrderDelivery.less
deleted file mode 100644
index cce8ea7ae..000000000
--- a/admin-web/src/pages/Order/OrderDelivery.less
+++ /dev/null
@@ -1,9 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.goodImg {
- @size: 100px;
-
- width: @size;
- height: @size;
-}
diff --git a/admin-web/src/pages/Order/OrderDetails.js b/admin-web/src/pages/Order/OrderDetails.js
deleted file mode 100644
index f1635f53a..000000000
--- a/admin-web/src/pages/Order/OrderDetails.js
+++ /dev/null
@@ -1,691 +0,0 @@
-import React, { PureComponent, Fragment } from 'react';
-import { connect } from 'dva';
-import moment from 'moment';
-import router from 'umi/router';
-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 './OrderDetails.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',
- render: text => this.previewItem(text)}>{text},
- },
- {
- title: '描述',
- dataIndex: 'desc',
- },
- {
- title: '服务调用次数',
- dataIndex: 'callNo',
- sorter: true,
- 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,
- });
- };
-
- previewItem = id => {
- router.push(`/profile/basic/${id}`);
- };
-
- 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/admin-web/src/pages/Order/OrderDetails.less b/admin-web/src/pages/Order/OrderDetails.less
deleted file mode 100644
index 25d472c38..000000000
--- a/admin-web/src/pages/Order/OrderDetails.less
+++ /dev/null
@@ -1,9 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.goodImg {
- @size: 100;
-
- width: @size;
- height: @size;
-}
diff --git a/admin-web/src/pages/Order/OrderList.js b/admin-web/src/pages/Order/OrderList.js
deleted file mode 100644
index 35a0f93c0..000000000
--- a/admin-web/src/pages/Order/OrderList.js
+++ /dev/null
@@ -1,352 +0,0 @@
-import React, { PureComponent } from 'react';
-import moment from 'moment';
-import { connect } from 'dva';
-import { Button, Card, Col, Divider, Form, Input, Row, Tabs, DatePicker, List } from 'antd';
-
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-import DictionaryText from '@/components/Dictionary/DictionaryText';
-import OrderUpdatePayAmount from './OrderUpdatePayAmount';
-import OrderDelivery from './OrderDelivery';
-import OrderRemark from './OrderRemark';
-import OrderCancel from './OrderCancel';
-import dictionary from '@/utils/dictionary';
-
-import styles from './OrderList.less';
-
-const { RangePicker } = DatePicker;
-const FormItem = Form.Item;
-const { TabPane } = Tabs;
-
-const OrderContent = props => {
- const { dispatch, item } = props;
- const { createTime, status, payAmount, id } = item;
- const { name, mobile } = item.orderRecipient || {};
-
- const handleUpdatePayAmount = updateOrderItem => {
- dispatch({
- type: 'orderList/changePayAmountVisible',
- payload: {
- payAmountVisible: true,
- payAmount: updateOrderItem.payAmount,
- orderId: updateOrderItem.orderId,
- orderItemId: updateOrderItem.id,
- },
- });
- };
-
- const handleOrderDelivery = () => {
- dispatch({
- type: 'orderDelivery/changeVisible',
- payload: {
- visible: true,
- orderId: id,
- },
- });
-
- dispatch({
- type: 'orderDelivery/getOrderItems',
- payload: {
- orderId: id,
- },
- });
- };
-
- const handleCancelOrder = () => {
- dispatch({
- type: 'orderList/changeOrderCancelVisible',
- payload: {
- orderCancelVisible: true,
- orderId: id,
- },
- });
- };
-
- const renderStatusButtons = () => {
- let res = '';
- if (status === 1) {
- res = ;
- } else if (status === 2) {
- res = ;
- }
- return res;
- };
-
- const renderGoods = orderItems => {
- return orderItems.map(({ skuName, skuImage, quantity, presentPrice, presentTotal }) => {
- return (
-
-
-
-
-
{quantity}件
-
- {presentPrice / 100.0} 元/{presentTotal / 100.0} 元
-
-
-
- );
- });
- };
-
- return (
-
-
- {renderGoods(item.orderItems)}
-
-
-
-
(下单时间)
-
{moment(createTime).format('YYYY-MM-DD HH:mm')}
-
-
-
-
-
-
-
{renderStatusButtons(props)}
-
-
-
(实付金额)
-
{item.presentPrice / 100}元
-
-
-
- );
-};
-
-const OrderList = props => {
- const { list, dispatch, loading } = props;
- const { pagination, dataSource } = list;
-
- const paginationProps = {
- ...pagination,
- };
-
- const handleRemakeClick = item => {
- const { id, remark } = item;
- dispatch({
- type: 'orderList/changeRemakeVisible',
- payload: {
- remarkVisible: true,
- orderId: id,
- remark,
- },
- });
- };
-
- return (
- (
-
-
-
-
-
订单号: {item.orderNo}
-
-
支付金额: {item.payAmount / 100} 元
-
-
-
-
-
-
-
-
- )}
- />
- );
-};
-
-// SearchForm
-const SearchForm = Form.create()(props => {
- const {
- form: { getFieldDecorator },
- form,
- handleSearch,
- } = props;
-
- const handleFormReset = () => {};
-
- const onSubmit = e => {
- e.preventDefault();
- form.validateFields((err, fields) => {
- const buildTime = (fieldValue, key) => {
- const res = {};
- if (fieldValue && fieldValue.length >= 2) {
- const keySuffix = key.substring(0, 1).toUpperCase() + key.substring(1);
- res[`start${keySuffix}`] = fieldValue[0].format('YYYY-MM-DD HH:mm:ss');
- res[`end${keySuffix}`] = fieldValue[1].format('YYYY-MM-DD HH:mm:ss');
- }
- return res;
- };
-
- const timeFields = ['createTime', 'closingTime'];
- const buildSearchParams = fields2 => {
- let res = {};
- Object.keys(fields).map(objectKey => {
- const fieldValue = fields2[objectKey];
- if (timeFields.indexOf(objectKey) !== -1) {
- // 处理时间
- res = {
- ...res,
- ...buildTime(fieldValue, objectKey),
- };
- } else if (fieldValue !== undefined) {
- res[objectKey] = fieldValue;
- }
- return true;
- });
- return res;
- };
-
- const searchParams = buildSearchParams(fields);
- if (handleSearch) {
- handleSearch(searchParams);
- }
- });
- };
-
- return (
-
- );
-});
-
-@connect(({ orderList, orderDelivery, loading }) => ({
- orderList,
- list: orderList.list,
- loading: loading.models.orderList,
- orderDelivery,
-}))
-class BasicList extends PureComponent {
- componentDidMount() {
- const {
- list: { pagination },
- } = this.props;
-
- this.queryList({
- pageNo: pagination.current,
- pageSize: pagination.pageSize,
- });
- }
-
- queryList = params => {
- const { dispatch } = this.props;
- // 保存每次操作 searchParams
- this.searchParams = params;
- // dispatch
- dispatch({
- type: 'orderList/queryPage',
- payload: {
- ...params,
- },
- });
- };
-
- handleEditorClick = () => {};
-
- handleSearch = fields => {
- const {
- list: { pagination },
- } = this.props;
-
- this.queryList({
- ...fields,
- pageNo: pagination.current,
- pageSize: pagination.pageSize,
- });
- };
-
- handleTabsChange = key => {
- const params = {
- ...this.searchParams,
- status: key,
- };
-
- this.queryList(params);
- };
-
- render() {
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default BasicList;
diff --git a/admin-web/src/pages/Order/OrderList.less b/admin-web/src/pages/Order/OrderList.less
deleted file mode 100644
index afe16ef56..000000000
--- a/admin-web/src/pages/Order/OrderList.less
+++ /dev/null
@@ -1,313 +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 {
- padding: 24px 0;
- line-height: 32px;
- }
- .ant-card-extra {
- padding: 24px 0;
- }
- .ant-list-pagination {
- margin-top: 24px;
- text-align: right;
- }
- .ant-avatar-lg {
- width: 48px;
- height: 48px;
- line-height: 48px;
- }
- }
- .headerInfo {
- position: relative;
- text-align: center;
- & > span {
- display: inline-block;
- margin-bottom: 4px;
- color: @text-color-secondary;
- font-size: @font-size-base;
- line-height: 22px;
- }
- & > p {
- margin: 0;
- color: @heading-color;
- font-size: 24px;
- line-height: 32px;
- }
- & > em {
- position: absolute;
- top: 0;
- right: 0;
- width: 1px;
- height: 56px;
- background-color: @border-color-split;
- }
- }
- .listContent {
- display: flex;
- flex: 1;
- flex-direction: row;
- font-size: 0;
-
- .listContentItem {
- flex: 1;
- margin-left: 40px;
- color: @text-color-secondary;
- font-size: @font-size-base;
- vertical-align: middle;
- > span {
- line-height: 20px;
- }
- > p {
- margin-top: 4px;
- margin-bottom: 0;
- line-height: 22px;
- }
- }
- }
- .extraContentSearch {
- width: 272px;
- margin-left: 16px;
- }
-}
-
-@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 {
- width: 100%;
- margin-left: 0;
- }
- .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 {
- margin-bottom: 32px;
- padding-top: 4px;
- }
- }
- }
-}
-
-.formResult {
- width: 100%;
- [class^='title'] {
- margin-bottom: 8px;
- }
-}
-
-.tableListForm {
- :global {
- .ant-form-item {
- display: flex;
- margin-right: 0;
- margin-bottom: 24px;
- > .ant-form-item-label {
- width: auto;
- padding-right: 8px;
- line-height: 32px;
- }
- .ant-form-item-control {
- line-height: 32px;
- }
- }
- .ant-form-item-control-wrapper {
- flex: 1;
- }
- }
- .submitButtons {
- display: block;
- margin-bottom: 24px;
- white-space: nowrap;
- }
-}
-
-@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;
- }
-}
-
-// 订单content
-.orderGroup {
- @padding-slid: 10px;
- @solid-color: rgba(167, 157, 160, 0.92);
- @header-background: rgba(210, 219, 238, 0.99);
-
- display: flex;
- flex: 1;
- flex-direction: column;
- justify-content: flex-start;
-
- .header {
- display: flex;
- flex: 1;
- justify-content: space-between;
- padding-right: @padding-slid;
- padding-left: @padding-slid;
- font-weight: bold;
- font-size: 15px;
- line-height: 35px;
- background-color: @header-background;
- }
-
- .goodsContainer {
- :first-child {
- border-top: none;
- border-bottom: none;
- }
-
- :last-child {
- border-bottom: none;
- }
- }
-
- .orderGoods {
- display: flex;
- flex: 2;
- flex-direction: row;
- width: 500px;
- border: 1px solid @solid-color;
- }
-
- .order {
- display: flex;
- flex: 1;
- flex-direction: row;
- padding-right: @padding-slid;
- padding-left: @padding-slid;
- line-height: 100px;
- border: 1px solid @solid-color;
-
- .contentItem {
- display: flex;
- flex: 1;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- text-align: center;
-
- > div {
- line-height: 30px;
- }
-
- .columnName {
- font-weight: bold;
- font-size: 12px;
- }
- }
-
- .image {
- width: 80px;
- height: 80px;
- }
- }
-}
diff --git a/admin-web/src/pages/Order/OrderRefunds.js b/admin-web/src/pages/Order/OrderRefunds.js
deleted file mode 100644
index ebceb1eec..000000000
--- a/admin-web/src/pages/Order/OrderRefunds.js
+++ /dev/null
@@ -1,321 +0,0 @@
-import React, { PureComponent } from 'react';
-import moment from 'moment';
-import { connect } from 'dva';
-import { Button, Card, Col, Divider, Form, Input, Row, Tabs, DatePicker, List } from 'antd';
-
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-import DictionaryText from '@/components/Dictionary/DictionaryText';
-import OrderUpdatePayAmount from './OrderUpdatePayAmount';
-import OrderRemark from './OrderRemark';
-import dictionary from '@/utils/dictionary';
-
-import styles from './OrderList.less';
-
-const { RangePicker } = DatePicker;
-const FormItem = Form.Item;
-const { TabPane } = Tabs;
-
-const OrderContent = props => {
- const {
- dispatch,
- skuName,
- skuImage,
- quantity,
- price,
- payAmount,
- createTime,
- status,
- item,
- } = props;
- const { name, mobile } = item.orderLogistics;
-
- const handleUpdatePayAmount = updateOrderItem => {
- dispatch({
- type: 'orderList/changePayAmountVisible',
- payload: {
- payAmountVisible: true,
- payAmount: updateOrderItem.payAmount,
- orderId: updateOrderItem.orderId,
- orderItemId: updateOrderItem.id,
- },
- });
- };
-
- const renderStatusButtons = () => {
- let res = '';
- if (status === 1) {
- res = ;
- } else if (status === 2) {
- res = ;
- }
- return res;
- };
-
- return (
-
-
-
-
-
{quantity}件
-
- {price / 100} 元/{quantity * (price / 100)} 元
-
-
-
-
-
(下单时间)
-
{moment(createTime).format('YYYY-MM-DD HH:mm')}
-
-
-
-
-
-
-
{renderStatusButtons()}
-
-
-
(实付金额)
-
{payAmount / 100}元
-
-
-
- );
-};
-
-const OrderList = props => {
- const { list, dispatch, loading } = props;
- const { pagination, dataSource } = list;
-
- const paginationProps = {
- ...pagination,
- };
-
- const handleRemakeClick = item => {
- const { id, remark } = item;
- dispatch({
- type: 'orderList/changeRemakeVisible',
- payload: {
- remarkVisible: true,
- orderId: id,
- remark,
- },
- });
- };
-
- return (
- (
-
-
-
-
-
订单号: {item.orderNo}
-
-
支付金额: {item.payAmount / 100} 元
-
-
-
-
-
- {item.orderItems.map(orderItem => {
- return (
-
- );
- })}
-
-
- )}
- />
- );
-};
-
-// SearchForm
-const SearchForm = Form.create()(props => {
- const {
- form: { getFieldDecorator },
- form,
- handleSearch,
- } = props;
-
- const handleFormReset = () => {};
-
- const onSubmit = e => {
- e.preventDefault();
- form.validateFields((err, fields) => {
- const buildTime = (fieldValue, key) => {
- const res = {};
- if (fieldValue && fieldValue.length >= 2) {
- const keySuffix = key.substring(0, 1).toUpperCase() + key.substring(1);
- res[`start${keySuffix}`] = fieldValue[0].format('YYYY-MM-DD HH:mm:ss');
- res[`end${keySuffix}`] = fieldValue[1].format('YYYY-MM-DD HH:mm:ss');
- }
- return res;
- };
-
- const timeFields = ['createTime', 'closingTime'];
- const buildSearchParams = fields2 => {
- let res = {};
- Object.keys(fields).map(objectKey => {
- const fieldValue = fields2[objectKey];
- if (timeFields.indexOf(objectKey) !== -1) {
- // 处理时间
- res = {
- ...res,
- ...buildTime(fieldValue, objectKey),
- };
- } else if (fieldValue !== undefined) {
- res[objectKey] = fieldValue;
- }
- return true;
- });
- return res;
- };
-
- const searchParams = buildSearchParams(fields);
- if (handleSearch) {
- handleSearch(searchParams);
- }
- });
- };
-
- return (
-
- );
-});
-
-@connect(({ orderList, loading }) => ({
- orderList,
- list: orderList.list,
- loading: loading.models.orderList,
-}))
-class BasicList extends PureComponent {
- componentDidMount() {
- const {
- list: { pagination },
- } = this.props;
-
- this.queryList({
- pageNo: pagination.current,
- pageSize: pagination.pageSize,
- });
- }
-
- queryList = params => {
- const { dispatch } = this.props;
- // 保存每次操作 searchParams
- this.searchParams = params;
- // dispatch
- dispatch({
- type: 'orderList/queryPage',
- payload: {
- ...params,
- },
- });
- };
-
- handleEditorClick = () => {};
-
- handleSearch = fields => {
- const {
- list: { pagination },
- } = this.props;
-
- this.queryList({
- ...fields,
- pageNo: pagination.current,
- pageSize: pagination.pageSize,
- });
- };
-
- handleTabsChange = key => {
- const params = {
- ...this.searchParams,
- status: key,
- };
-
- this.queryList(params);
- };
-
- render() {
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default BasicList;
diff --git a/admin-web/src/pages/Order/OrderRemark.js b/admin-web/src/pages/Order/OrderRemark.js
deleted file mode 100644
index ae8416f92..000000000
--- a/admin-web/src/pages/Order/OrderRemark.js
+++ /dev/null
@@ -1,56 +0,0 @@
-import React from 'react';
-import { Form, Input, Modal } from 'antd';
-
-const FormItem = Form.Item;
-
-// 订单 - 更新支付金额
-const OrderRemark = Form.create()(props => {
- const { dispatch, loading } = props;
- const { orderId, remark, remarkVisible, searchParams } = props.orderList;
- const { getFieldDecorator, getFieldsValue } = props.form;
-
- const handleOk = e => {
- e.preventDefault();
- const fieldsValue = getFieldsValue();
-
- dispatch({
- type: 'orderList/updateRemake',
- payload: {
- params: {
- remark: fieldsValue.remark,
- orderId,
- },
- searchParams,
- },
- });
- };
-
- const handleCancel = () => {
- dispatch({
- type: 'orderList/changeRemakeVisible',
- payload: {
- remarkVisible: false,
- },
- });
- };
-
- return (
-
-
- {getFieldDecorator('remark', {
- initialValue: remark,
- })()}
-
-
- );
-});
-
-export default OrderRemark;
diff --git a/admin-web/src/pages/Order/OrderUpdatePayAmount.js b/admin-web/src/pages/Order/OrderUpdatePayAmount.js
deleted file mode 100644
index 705a8a097..000000000
--- a/admin-web/src/pages/Order/OrderUpdatePayAmount.js
+++ /dev/null
@@ -1,61 +0,0 @@
-import React from 'react';
-import { Form, InputNumber, Modal } from 'antd';
-
-const FormItem = Form.Item;
-
-// 订单 - 更新支付金额
-const OrderUpdatePayAmount = Form.create()(props => {
- const { dispatch, loading } = props;
- const { orderId, orderItemId, payAmount, payAmountVisible, searchParams } = props.orderList;
- const { getFieldDecorator, getFieldsValue } = props.form;
-
- const handleOk = e => {
- e.preventDefault();
- const fieldsValue = getFieldsValue();
-
- dispatch({
- type: 'orderList/updatePayAmount',
- payload: {
- params: {
- payAmount: fieldsValue.payAmount * 100,
- orderId,
- orderItemId,
- },
- searchParams,
- },
- });
- };
-
- const handleCancel = () => {
- dispatch({
- type: 'orderList/changePayAmountVisible',
- payload: {
- payAmountVisible: false,
- },
- });
- };
-
- return (
-
-
- {getFieldDecorator('payAmount', {
- rules: [
- { required: true, message: '请输入需要修改的金额!' },
- { max: 10000, min: 0, message: '金额值 0 - 100000 元' },
- ],
- initialValue: payAmount / 100,
- })()}
-
-
- );
-});
-
-export default OrderUpdatePayAmount;
diff --git a/admin-web/src/pages/Order/WechatIMG1.png b/admin-web/src/pages/Order/WechatIMG1.png
deleted file mode 100644
index 205d6cafc..000000000
Binary files a/admin-web/src/pages/Order/WechatIMG1.png and /dev/null differ
diff --git a/admin-web/src/pages/OrderRefunds/OrderRefundsList.js b/admin-web/src/pages/OrderRefunds/OrderRefundsList.js
deleted file mode 100644
index 3f4607792..000000000
--- a/admin-web/src/pages/OrderRefunds/OrderRefundsList.js
+++ /dev/null
@@ -1,301 +0,0 @@
-import React, { PureComponent } from 'react';
-import { connect } from 'dva';
-import moment from 'moment';
-import { Card, Tabs, Modal, Table, Divider } from 'antd';
-import PageHeaderWrapper from '../../components/PageHeaderWrapper';
-import DictionaryText from '../../components/Dictionary/DictionaryText';
-import TableSearch from './TableSearch';
-import styles from '../List/TableList.less';
-
-import dictionary from '../../utils/dictionary';
-
-/**
- * 订单售后列表
- */
-@connect(({ orderRefunds, loading }) => ({
- orderRefunds,
- loading: loading.models.orderRefunds,
-}))
-class OrderRefundsList extends PureComponent {
- componentDidMount() {
- // 查询 list
- this.queryList({ index: 1, pageSize: 10 }, {});
- }
-
- handleSearch = searchParams => {
- const { orderRefunds } = this.props;
- const { index, pageSize } = orderRefunds;
- this.queryList(
- { index, pageSize },
- {
- ...searchParams,
- ...this.tabsValue,
- }
- );
- };
-
- queryList = (pageParams, searchParams) => {
- const { dispatch } = this.props;
-
- this.pageParams = pageParams;
- this.searchParams = searchParams;
- dispatch({
- type: 'orderRefunds/list',
- payload: {
- ...pageParams,
- ...searchParams,
- },
- });
- };
-
- handleTabsChange = value => {
- this.tabsValue = {
- status: value,
- };
- this.queryList(
- { index: 1, pageSize: 10 },
- {
- ...this.searchParams,
- status: value,
- }
- );
- };
-
- handleTableChange = pagination => {
- const { pageSize, current } = pagination;
- this.queryList({ pageSize, index: current }, {});
- };
-
- handleAgreeClick = ({ id }) => {
- const { dispatch } = this.props;
- const self = this;
- Modal.confirm({
- title: '提示消息',
- content: '确认同意!',
- onOk() {
- dispatch({
- type: 'orderRefunds/agree',
- payload: {
- params: {
- id,
- },
- callback: () => {
- self.queryList(self.pageParams, self.searchParams);
- },
- },
- });
- },
- onCancel() {
- console.log('Cancel');
- },
- });
- };
-
- handleRefuse = ({ id }) => {
- const { dispatch } = this.props;
- const self = this;
- Modal.confirm({
- title: '提示消息',
- content: '确认拒绝!',
- onOk() {
- dispatch({
- type: 'orderRefunds/refuse',
- payload: {
- params: {
- id,
- },
- callback: () => {
- self.queryList(self.pageParams, self.searchParams);
- },
- },
- });
- },
- onCancel() {
- console.log('Cancel');
- },
- });
- };
-
- handleConfirmReceipt = ({ id }) => {
- const { dispatch } = this.props;
- const self = this;
- Modal.confirm({
- title: '提示消息',
- content: '确认收货!',
- onOk() {
- dispatch({
- type: 'orderRefunds/confirmReceipt',
- payload: {
- params: {
- id,
- },
- callback: () => {
- self.queryList(self.pageParams, self.searchParams);
- },
- },
- });
- },
- onCancel() {
- console.log('Cancel');
- },
- });
- };
-
- handleConfirmRefund = ({ id }) => {
- const { dispatch } = this.props;
- const self = this;
- Modal.confirm({
- title: '提示消息',
- content: '确认退款!',
- onOk() {
- dispatch({
- type: 'orderRefunds/confirmRefund',
- payload: {
- params: {
- id,
- },
- callback: () => {
- self.queryList(self.pageParams, self.searchParams);
- },
- },
- });
- },
- onCancel() {
- console.log('Cancel');
- },
- });
- };
-
- render() {
- const { orderRefunds, loading } = this.props;
- const { list, totalCount, index, pageSize } = orderRefunds;
-
- const columns = [
- {
- title: '订单号',
- dataIndex: 'orderId',
- key: 'orderId',
- },
- {
- title: '服务编号',
- dataIndex: 'serviceNumber',
- key: 'serviceNumber',
- },
- {
- title: '服务类型',
- dataIndex: 'serviceType',
- key: 'serviceType',
- render(serviceType) {
- return (
-
- );
- },
- },
- {
- title: '退货原因',
- dataIndex: 'reason',
- key: 'reason',
- render(reason) {
- return ;
- },
- },
- {
- title: '备注',
- dataIndex: 'describe',
- key: 'describe',
- },
- {
- title: '状态',
- dataIndex: 'status',
- key: 'status',
- render(status) {
- return ;
- },
- },
- {
- title: '同意时间',
- dataIndex: 'approvalTime',
- key: 'approvalTime',
- render(approvalTime) {
- if (approvalTime) {
- return {moment(approvalTime).format('YYYY-MM-DD HH:mm')}
;
- }
- return 无
;
- },
- },
- {
- title: '申请时间',
- dataIndex: 'createTime',
- key: 'createTime',
- render(createTime) {
- return {moment(createTime).format('YYYY-MM-DD HH:mm')}
;
- },
- },
- {
- title: '操作',
- render: row => {
- const { status } = row;
- let buttons;
- if (status === 1) {
- buttons = (
-
- );
- } else if (status === 2) {
- buttons = (
-
- );
- } else if (status === 5) {
- buttons = (
-
- );
- }
- return buttons;
- },
- },
- ];
-
- const pagination = {
- total: totalCount,
- index,
- pageSize,
- };
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default OrderRefundsList;
diff --git a/admin-web/src/pages/OrderRefunds/OrderRefundsList.less b/admin-web/src/pages/OrderRefunds/OrderRefundsList.less
deleted file mode 100644
index bc5601c1a..000000000
--- a/admin-web/src/pages/OrderRefunds/OrderRefundsList.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 {
- display: flex;
- margin-right: 0;
- margin-bottom: 24px;
- > .ant-form-item-label {
- width: auto;
- padding-right: 8px;
- line-height: 32px;
- }
- .ant-form-item-control {
- line-height: 32px;
- }
- }
- .ant-form-item-control-wrapper {
- flex: 1;
- }
- }
- .submitButtons {
- display: block;
- margin-bottom: 24px;
- white-space: nowrap;
- }
-}
-
-@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/admin-web/src/pages/OrderRefunds/TableSearch.js b/admin-web/src/pages/OrderRefunds/TableSearch.js
deleted file mode 100644
index f13d2b154..000000000
--- a/admin-web/src/pages/OrderRefunds/TableSearch.js
+++ /dev/null
@@ -1,100 +0,0 @@
-import React from 'react';
-import { Button, Col, Form, Input, Row, DatePicker } from 'antd';
-
-const FormItem = Form.Item;
-
-/**
- * table 查询
- *
- * @type {React.ComponentClass>}
- */
-const TableSearch = Form.create()(props => {
- const { handleSearch } = props;
- const { getFieldDecorator, validateFields, form } = props.form;
-
- function onSubmit(e) {
- e.preventDefault();
-
- validateFields((err, fields) => {
- const buildTime = (fieldValue, key) => {
- const res = {};
- if (fieldValue && fieldValue.length >= 2) {
- const keySuffix = key.substring(0, 1).toUpperCase() + key.substring(1);
- res[`start${keySuffix}`] = fieldValue[0].format('YYYY-MM-DD HH:mm:ss');
- res[`end${keySuffix}`] = fieldValue[1].format('YYYY-MM-DD HH:mm:ss');
- }
- return res;
- };
-
- const timeFields = ['createTime'];
- const buildSearchParams = fields2 => {
- let res = {};
- Object.keys(fields).map(objectKey => {
- const fieldValue = fields2[objectKey];
- if (timeFields.indexOf(objectKey) !== -1) {
- // 处理时间
- res = {
- ...res,
- ...buildTime(fieldValue, objectKey),
- };
- } else if (fieldValue !== undefined) {
- res[objectKey] = fieldValue;
- }
- return true;
- });
- return res;
- };
-
- const searchParams = buildSearchParams(fields);
- if (handleSearch) {
- handleSearch(searchParams);
- }
- });
- }
-
- function handleFormReset() {
- form.resetFields();
- }
-
- return (
-
- );
-});
-
-export default TableSearch;
diff --git a/admin-web/src/pages/Pay/PayRefundList.js b/admin-web/src/pages/Pay/PayRefundList.js
deleted file mode 100644
index 03bb590af..000000000
--- a/admin-web/src/pages/Pay/PayRefundList.js
+++ /dev/null
@@ -1,319 +0,0 @@
-/* eslint-disable */
-
-import React, { PureComponent, Fragment } from 'react';
-import { connect } from 'dva';
-import moment from 'moment';
-import {
- Card,
- Form,
- Input,
- Row,
- Col,
- Button,
- Modal,
- message,
- Table,
- Divider,
- Tree,
- Tabs,
- TreeSelect,
- Spin,
- InputNumber, DatePicker, Select
-} from 'antd';
-const TabPane = Tabs.TabPane;
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-const { RangePicker } = DatePicker;
-
-import styles from './PayRefundList.less';
-import PaginationHelper from "../../../helpers/PaginationHelper";
-
-const FormItem = Form.Item;
-
-const statuses = {
- 1: '处理中',
- 2: '成功',
- 3: '失败',
-};
-
-const payChannels = {
- 100: '微信 App 支付',
- 101: '微信 JS API 支付',
- 200: '支付宝 App 支付',
- 9999: 'ping++',
-};
-
-// 列表
-function List({ dataSource, loading, pagination, searchParams, dispatch,}) {
-
- function onPageChange(page) { // 翻页
- dispatch({
- type: 'payRefundList/page',
- payload: {
- pageNo: page.current,
- pageSize: page.pageSize,
- ...searchParams
- }
- })
- }
-
- const columns = [
- // {
- // title: 'id',
- // dataIndex: 'id',
- // render: text => {text},
- // },
- {
- title: '创建时间',
- dataIndex: 'createTime',
- render: val => {moment(val).format('YYYY-MM-DD HH:mm:ss')},
- width: 120,
- },
- {
- title: '完成时间',
- dataIndex: 'finishTime',
- render: val => val ? {moment(val).format('YYYY-MM-DD HH:mm:ss')} : '',
- width: 120,
- },
- {
- title: '渠道流水号',
- dataIndex: 'tradeNo',
- },
- {
- title: '退款金额',
- dataIndex: 'price',
- render: val => val / 100.0,
- },
- {
- title: '退款状态',
- dataIndex: 'status',
- render: val => statuses[val + ''],
- },
- {
- title: '支付时间',
- dataIndex: 'transaction.finishTime',
- render: val => val ? {moment(val).format('YYYY-MM-DD HH:mm:ss')} : '',
- width: 120,
- },
- {
- title: '商户订单号',
- dataIndex: 'orderId',
- },
- {
- title: '商品名称',
- dataIndex: 'transaction.orderSubject',
- },
- {
- title: '支付金额',
- dataIndex: 'transaction.price',
- },
- {
- title: '支付渠道',
- dataIndex: 'transaction.payChannel',
- render: val => payChannels[val + ''],
- },
- {
- title: '操作',
- width: 120,
- render: (text, record) => (
-
- {/* this.handleModalVisible(true, 'update', record)}>更新*/}
- alert('正在开发中')}>详情
-
- ),
- },
- ];
-
- // console.log(pagination);
-
- return (
-
- )
-}
-
-// 搜索表单
-const SearchForm = Form.create()(props => {
- const {
- form,
- form: { getFieldDecorator },
- dispatch,
- searchParams,
- } = props;
-
- function search() {
- const getBeginAndEndTime = (key, beginKey, endKey) => {
- let val = form.getFieldsValue()[key];
- if (val && val.length === 2) {
- let res = {};
- res[beginKey] = val[0].format('YYYY-MM-DD HH:mm:ss');
- res[endKey] = val[1].format('YYYY-MM-DD HH:mm:ss');
- return res;
- }
- return {};
- };
-
- dispatch({
- type: 'payRefundList/page',
- payload: {
- ...PaginationHelper.defaultPayload,
- ...searchParams,
- ...form.getFieldsValue(),
- createTime: undefined,
- finishTime: undefined,
- ...getBeginAndEndTime('createTime', 'createBeginTime', 'createEndTime'),
- ...getBeginAndEndTime('finishTime', 'finishBeginTime', 'finishEndTime'),
- }
- })
- }
-
- // 提交搜索
- function handleSubmit(e) {
- // 阻止默认事件
- e.preventDefault();
- // 提交搜索
- search();
- }
-
- // 重置搜索
- function handleReset() {
- // 重置表单
- form.resetFields();
- // 执行搜索
- search();
- }
-
- return (
-
- );
-});
-
-// payRefundList
-@connect(({ payRefundList }) => ({
- ...payRefundList,
- // list: payRefundList.list.spus,
- // loading: loading.models.payRefundList,
-}))
-
-@Form.create()
-class PayTransactionList extends PureComponent {
- state = {
- modalVisible: false,
- modalType: 'add', //add update
- initValues: {},
- };
-
- componentDidMount() {
- const { dispatch, searchParams } = this.props;
- // 查询初始数据
- dispatch({
- type: 'payRefundList/page',
- payload: {
- ...searchParams,
- ...PaginationHelper.defaultPayload,
- },
- });
- }
-
- handleSortModalVisible = (sortModalVisible, record) => {
- const { dispatch } = this.props;
- dispatch({
- type: 'payRefundList/setAll',
- payload: {
- sortModalVisible,
- formVals: record || {}
- },
- });
- };
-
- render() {
- const { dispatch,
- list, listLoading, searchParams, pagination,
- categoryTree, formVals, } = this.props;
-
- // 列表属性
- const listProps = {
- dataSource: list,
- pagination,
- searchParams,
- dispatch,
- categoryTree,
- loading: listLoading,
- handleSortModalVisible: this.handleSortModalVisible, // Func
- };
-
- // 搜索表单属性
- const searchFormProps = {
- dispatch,
- categoryTree,
- searchParams,
- };
-
- return (
-
-
-
-
- {/**/}
-
-
-
-
-
-
- );
- }
-}
-
-export default PayTransactionList;
diff --git a/admin-web/src/pages/Pay/PayRefundList.less b/admin-web/src/pages/Pay/PayRefundList.less
deleted file mode 100644
index ebb45c292..000000000
--- a/admin-web/src/pages/Pay/PayRefundList.less
+++ /dev/null
@@ -1,15 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.tableList {
- .tableListOperator {
- margin-bottom: 16px;
- button {
- margin-right: 8px;
- }
- }
-}
-
-.tableDelete {
- color: red;
-}
diff --git a/admin-web/src/pages/Pay/PayTransactionList.js b/admin-web/src/pages/Pay/PayTransactionList.js
deleted file mode 100644
index 1e2146521..000000000
--- a/admin-web/src/pages/Pay/PayTransactionList.js
+++ /dev/null
@@ -1,328 +0,0 @@
-/* eslint-disable */
-
-import React, { PureComponent, Fragment } from 'react';
-import { connect } from 'dva';
-import moment from 'moment';
-import {
- Card,
- Form,
- Input,
- Row,
- Col,
- Button,
- Modal,
- message,
- Table,
- Divider,
- Tree,
- Tabs,
- TreeSelect,
- Spin,
- InputNumber, DatePicker, Select
-} from 'antd';
-const TabPane = Tabs.TabPane;
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-const { RangePicker } = DatePicker;
-
-import styles from './PayTransactionList.less';
-import PaginationHelper from "../../../helpers/PaginationHelper";
-
-const FormItem = Form.Item;
-
-const statuses = {
- 1: '等待支付',
- 2: '支付成功',
- 3: '取消支付',
-};
-
-const payChannels = {
- 100: '微信 App 支付',
- 101: '微信 JS API 支付',
- 200: '支付宝 App 支付',
- 9999: 'ping++',
-};
-
-// 列表
-function List({ dataSource, loading, pagination, searchParams, dispatch,}) {
-
- function onPageChange(page) { // 翻页
- dispatch({
- type: 'payTransactionList/page',
- payload: {
- pageNo: page.current,
- pageSize: page.pageSize,
- ...searchParams
- }
- })
- }
-
- const columns = [
- // {
- // title: 'id',
- // dataIndex: 'id',
- // render: text => {text},
- // },
- {
- title: '创建时间',
- dataIndex: 'createTime',
- render: val => {moment(val).format('YYYY-MM-DD HH:mm:ss')},
- width: 120,
- },
- {
- title: '支付时间',
- dataIndex: 'paymentTime',
- render: val => val ? {moment(val).format('YYYY-MM-DD HH:mm:ss')} : '',
- width: 120,
- },
- {
- title: '商户订单号',
- dataIndex: 'orderId',
- },
- {
- title: '商品名称',
- dataIndex: 'orderSubject',
- },
- {
- title: '支付金额',
- dataIndex: 'price',
- render: val => val / 100.0,
- },
- {
- title: '支付状态',
- dataIndex: 'status',
- render: val => statuses[val + ''],
- },
- {
- title: '支付渠道',
- dataIndex: 'payChannel',
- render: val => payChannels[val + ''],
- },
- {
- title: '退款情况',
- dataIndex: 'refundTotal',
- render: val => val && val > 0 ? '有退款' : '无退款' ,
- },
- {
- title: '退款金额',
- dataIndex: 'refundTotal',
- render: val => val && val > 0 ? val / 100.0 : undefined ,
- },
- {
- title: '操作',
- width: 120,
- render: (text, record) => (
-
- {/* this.handleModalVisible(true, 'update', record)}>更新*/}
- alert('正在开发中')}>退款
-
- ),
- },
- ];
-
- // console.log(pagination);
-
- return (
-
- )
-}
-
-// 搜索表单
-const SearchForm = Form.create()(props => {
- const {
- form,
- form: { getFieldDecorator },
- dispatch,
- searchParams,
- } = props;
-
- function search() {
- const getBeginAndEndTime = (key, beginKey, endKey) => {
- let val = form.getFieldsValue()[key];
- if (val && val.length === 2) {
- let res = {};
- res[beginKey] = val[0].format('YYYY-MM-DD HH:mm:ss');
- res[endKey] = val[1].format('YYYY-MM-DD HH:mm:ss');
- return res;
- }
- return {};
- };
-
- dispatch({
- type: 'payTransactionList/page',
- payload: {
- ...PaginationHelper.defaultPayload,
- ...searchParams,
- ...form.getFieldsValue(),
- createTime: undefined,
- paymentTime: undefined,
- ...getBeginAndEndTime('createTime', 'createBeginTime', 'createEndTime'),
- ...getBeginAndEndTime('paymentTime', 'paymentBeginTime', 'paymentEndTime'),
- }
- })
- }
-
- // 提交搜索
- function handleSubmit(e) {
- // 阻止默认事件
- e.preventDefault();
- // 提交搜索
- search();
- }
-
- // 重置搜索
- function handleReset() {
- // 重置表单
- form.resetFields();
- // 执行搜索
- search();
- }
-
- return (
-
- );
-});
-
-// payTransactionList
-@connect(({ payTransactionList }) => ({
- ...payTransactionList,
- // list: payTransactionList.list.spus,
- // loading: loading.models.payTransactionList,
-}))
-
-@Form.create()
-class PayTransactionList extends PureComponent {
- state = {
- modalVisible: false,
- modalType: 'add', //add update
- initValues: {},
- };
-
- componentDidMount() {
- const { dispatch, searchParams } = this.props;
- // 查询初始数据
- dispatch({
- type: 'payTransactionList/page',
- payload: {
- ...searchParams,
- ...PaginationHelper.defaultPayload,
- },
- });
- }
-
- handleSortModalVisible = (sortModalVisible, record) => {
- const { dispatch } = this.props;
- dispatch({
- type: 'payTransactionList/setAll',
- payload: {
- sortModalVisible,
- formVals: record || {}
- },
- });
- };
-
- render() {
- const { dispatch,
- list, listLoading, searchParams, pagination,
- categoryTree, formVals, } = this.props;
-
- // 列表属性
- const listProps = {
- dataSource: list,
- pagination,
- searchParams,
- dispatch,
- categoryTree,
- loading: listLoading,
- handleSortModalVisible: this.handleSortModalVisible, // Func
- };
-
- // 搜索表单属性
- const searchFormProps = {
- dispatch,
- categoryTree,
- searchParams,
- };
-
- return (
-
-
-
-
- {/**/}
-
-
-
-
-
-
- );
- }
-}
-
-export default PayTransactionList;
diff --git a/admin-web/src/pages/Pay/PayTransactionList.less b/admin-web/src/pages/Pay/PayTransactionList.less
deleted file mode 100644
index ebb45c292..000000000
--- a/admin-web/src/pages/Pay/PayTransactionList.less
+++ /dev/null
@@ -1,15 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.tableList {
- .tableListOperator {
- margin-bottom: 16px;
- button {
- margin-right: 8px;
- }
- }
-}
-
-.tableDelete {
- color: red;
-}
diff --git a/admin-web/src/pages/Product/ProductAttrList.js b/admin-web/src/pages/Product/ProductAttrList.js
deleted file mode 100644
index fad82cb73..000000000
--- a/admin-web/src/pages/Product/ProductAttrList.js
+++ /dev/null
@@ -1,550 +0,0 @@
-import React, { PureComponent, Fragment, Component } from 'react';
-import {
- Row,
- Col,
- Form,
- Card,
- Table,
- Button,
- Divider,
- Modal,
- Input,
- message,
- Switch,
- Select,
-} from 'antd';
-import moment from 'moment';
-import { connect } from 'dva';
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-import PaginationHelper from '../../../helpers/PaginationHelper';
-import styles from './ProductAttrList.less';
-
-const FormItem = Form.Item;
-const Option = Select.Option;
-
-const ValueCreateForm = Form.create()(props => {
- const {
- valueModalVisible,
- form,
- handleValueAdd,
- handleValueModalVisible,
- modalType,
- initValues,
- tree,
- } = props;
-
- const okHandle = () => {
- form.validateFields((err, fieldsValue) => {
- if (err) return;
- let pid = fieldsValue.pid;
- if (fieldsValue.pid) {
- pid = pid.split('-')[1];
- fieldsValue.pid = pid;
- }
- form.resetFields();
- handleValueAdd({
- fields: fieldsValue,
- modalType,
- initValues,
- });
- });
- };
-
- const selectStyle = {
- width: 200,
- };
-
- function onTypeChange(event) {
- initValues.type = parseInt(event.target.value);
- }
-
- const title = modalType === 'add' ? '添加规格值' : '编辑规格值';
- const okText = modalType === 'add' ? '添加' : '编辑';
- return (
- handleValueModalVisible()}
- >
- {modalType === 'add' ? (
-
- {form.getFieldDecorator('attrId', {
- // initialValue: template.durationHour ? template.durationHour : '3',
- rules: [
- {
- required: true,
- message: '请选择规格',
- },
- ],
- })(
-
- )}
-
- ) : null}
-
- {form.getFieldDecorator('name', {
- initialValue: initValues ? initValues.name : null,
- rules: [{ required: true, message: '请输入规格值!', min: 2 }],
- })()}
-
-
- );
-});
-
-const CreateForm = Form.create()(props => {
- const { modalVisible, form, handleAdd, handleModalVisible, modalType, initValues } = props;
-
- const okHandle = () => {
- form.validateFields((err, fieldsValue) => {
- if (err) return;
- let pid = fieldsValue.pid;
- if (fieldsValue.pid) {
- pid = pid.split('-')[1];
- fieldsValue.pid = pid;
- }
- form.resetFields();
- handleAdd({
- fields: fieldsValue,
- modalType,
- initValues,
- });
- });
- };
-
- const selectStyle = {
- width: 200,
- };
-
- function onTypeChange(event) {
- initValues.type = parseInt(event.target.value);
- }
-
- const title = modalType === 'add' ? '添加规格' : '编辑规格';
- const okText = modalType === 'add' ? '添加' : '编辑';
- return (
- handleModalVisible()}
- >
-
- {form.getFieldDecorator('name', {
- initialValue: initValues ? initValues.name : null,
- rules: [{ required: true, message: '请输入规格名称!', min: 2 }],
- })()}
-
-
- );
-});
-
-@connect(({ productAttrList, loading }) => ({
- productAttrList,
- attrData: productAttrList.attrData,
- tree: productAttrList.tree,
- loading: loading.models.productAttrList,
-}))
-@Form.create()
-export default class ProductAttrList extends PureComponent {
- state = {
- modalVisible: false,
- valueModalVisible: false,
- modalType: 'add', //add or update
- initValues: {},
- current: 1,
- pageSize: 10,
- name: null,
- };
-
- componentDidMount() {
- this.initFetch();
- }
-
- initFetch = () => {
- const { dispatch } = this.props;
- const { current, pageSize, name } = this.state;
- dispatch({
- type: 'productAttrList/page',
- payload: {
- pageNo: current,
- pageSize,
- name,
- },
- });
- // const { dispatch } = this.props;
- dispatch({
- type: 'productAttrList/tree',
- payload: {
- ...PaginationHelper.defaultPayload,
- },
- });
- };
-
- expandedRowRender = record => {
- const columns = [
- {
- title: '规格值',
- dataIndex: 'name',
- },
- {
- title: '状态',
- // dataIndex: 'status',
- render: (text, record) => (
- this.switchValueChange(checked, record)}
- />
- ),
- },
- {
- title: '创建时间',
- dataIndex: 'createTime',
- sorter: true,
- render: val => {moment(val).format('YYYY-MM-DD')},
- },
- {
- title: '操作',
- render: (text, record) => (
-
- this.handleValueModalVisible(true, 'update', record)}>编辑
-
- {/* this.handleDelete(record)}>
- 删除
- */}
-
- ),
- },
- ];
-
- return ;
- };
-
- handleAdd = ({ fields, modalType, initValues }) => {
- const { dispatch } = this.props;
- if (modalType === 'add') {
- dispatch({
- type: 'productAttrList/add',
- payload: {
- body: {
- ...fields,
- },
- onSuccess: () => {
- message.success('添加成功');
- this.handleModalVisible();
- this.initFetch();
- },
- onFail: response => {
- message.warn('添加失败' + response.message);
- },
- },
- });
- } else {
- dispatch({
- type: 'productAttrList/update',
- payload: {
- body: {
- ...initValues,
- ...fields,
- },
- onSuccess: () => {
- message.success('更新成功');
- this.handleModalVisible();
- this.initFetch();
- },
- onFail: response => {
- message.warn('更新失败' + response.message);
- },
- },
- });
- }
- };
-
- handleValueAdd = ({ fields, modalType, initValues }) => {
- const { dispatch } = this.props;
- if (modalType === 'add') {
- dispatch({
- type: 'productAttrList/value_add',
- payload: {
- body: {
- ...fields,
- },
- onSuccess: () => {
- message.success('添加成功');
- this.handleValueModalVisible();
- this.initFetch();
- },
- onFail: response => {
- message.warn('添加失败' + response.message);
- },
- },
- });
- } else {
- dispatch({
- type: 'productAttrList/value_update',
- payload: {
- body: {
- ...initValues,
- ...fields,
- },
- onSuccess: () => {
- message.success('更新成功');
- this.handleValueModalVisible();
- this.initFetch();
- },
- onFail: response => {
- message.warn('更新失败' + response.message);
- },
- },
- });
- }
- };
-
- handleModalVisible = (flag, modalType, initValues) => {
- this.setState({
- modalVisible: !!flag,
- initValues: initValues || {},
- modalType: modalType || 'add',
- });
- };
-
- handleValueModalVisible = (flag, modalType, initValues) => {
- this.setState({
- valueModalVisible: !!flag,
- initValues: initValues || {},
- modalType: modalType || 'add',
- });
- };
-
- handleTableChange = pagination => {
- const { pageSize, current, index } = pagination;
- this.setState(
- {
- current,
- pageSize,
- },
- function() {
- this.initFetch();
- }
- );
- };
-
- switchValueChange = (checked, record) => {
- const { dispatch } = this.props;
- dispatch({
- type: 'productAttrList/value_update_status',
- payload: {
- body: {
- id: record.id,
- status: checked ? 1 : 2,
- },
- onSuccess: () => {
- message.success('修改状态成功');
- this.initFetch();
- },
- },
- });
- };
-
- switchChange = (checked, record) => {
- const { dispatch } = this.props;
- dispatch({
- type: 'productAttrList/update_status',
- payload: {
- body: {
- id: record.id,
- status: checked ? 1 : 2,
- },
- onSuccess: () => {
- message.success('修改状态成功');
- this.initFetch();
- },
- },
- });
- };
-
- handleFormReset = () => {
- const { form, dispatch } = this.props;
- form.resetFields();
- this.setState(
- {
- name: null,
- },
- function() {
- this.initFetch();
- }
- );
- };
-
- handleCondition = e => {
- e.preventDefault();
-
- const { dispatch, form } = this.props;
-
- form.validateFields((err, fieldsValue) => {
- if (err) return;
- const values = {
- ...fieldsValue,
- };
-
- if (values.name) {
- this.setState(
- {
- searched: true,
- name: values.name,
- },
- function() {
- this.initFetch();
- }
- );
- } else {
- this.initFetch();
- }
-
- // dispatch({
- // type: 'fenfa/getCategoryList',
- // payload: {
- // key: values.name
- // },
- // });
- });
- };
-
- renderSimpleForm() {
- const { form } = this.props;
- const { getFieldDecorator } = form;
- return (
-
- );
- }
-
- render() {
- const { attrData, productAttrList, loading, tree } = this.props;
- const columns = [
- {
- title: '规格名称',
- dataIndex: 'name',
- },
- {
- title: '状态',
- // dataIndex: 'status',
- render: (text, record) => (
- this.switchChange(checked, record)}
- />
- ),
- },
- {
- title: '创建时间',
- dataIndex: 'createTime',
- sorter: true,
- render: val => {moment(val).format('YYYY-MM-DD')},
- },
- {
- title: '操作',
- render: (text, record) => (
-
- this.handleModalVisible(true, 'update', record)}>编辑
-
- this.handleValueModalVisible(true, 'add', {})}>新建规格值
- {/* this.handleDelete(record)}>
- 删除
- */}
-
- ),
- },
- ];
-
- const { modalVisible, modalType, initValues, valueModalVisible } = this.state;
-
- const parentMethods = {
- handleAdd: this.handleAdd,
- handleModalVisible: this.handleModalVisible,
- modalType,
- initValues,
- };
-
- const valueFormParentMethods = {
- handleValueAdd: this.handleValueAdd,
- handleValueModalVisible: this.handleValueModalVisible,
- modalType,
- initValues,
- tree: tree,
- };
-
- const pagination = {
- total: attrData.count,
- index: this.state.current,
- pageSize: this.state.pageSize,
- };
-
- return (
-
-
-
-
-
-
-
-
-
- {this.renderSimpleForm()}
-
-
-
-
- this.handleTableChange(pagination)}
- />
-
- {modalVisible ? : null}
- {valueModalVisible ? (
-
- ) : null}
-
- );
- }
-}
diff --git a/admin-web/src/pages/Product/ProductAttrList.less b/admin-web/src/pages/Product/ProductAttrList.less
deleted file mode 100644
index 22e257421..000000000
--- a/admin-web/src/pages/Product/ProductAttrList.less
+++ /dev/null
@@ -1,11 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.tableList {
- .tableListOperator {
- margin-bottom: 16px;
- button {
- margin-right: 8px;
- }
- }
-}
diff --git a/admin-web/src/pages/Product/ProductBrandList.js b/admin-web/src/pages/Product/ProductBrandList.js
deleted file mode 100644
index 11fb120c6..000000000
--- a/admin-web/src/pages/Product/ProductBrandList.js
+++ /dev/null
@@ -1,357 +0,0 @@
-/* eslint-disable */
-
-import React, { PureComponent, Fragment } from 'react';
-import { connect } from 'dva';
-import moment from 'moment';
-import {
- Card,
- Form,
- Input,
- Row,
- Col,
- Button,
- Modal,
- message,
- Table,
- Divider,
- Tree,
- Tabs,
- TreeSelect,
- Spin,
- InputNumber
-} from 'antd';
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-
-import styles from './ProductSpuList.less';
-import PaginationHelper from "../../../helpers/PaginationHelper";
-import PicturesWall from "../../components/Image/PicturesWall";
-
-const FormItem = Form.Item;
-
-const status = ['未知', '开启', '禁用'];
-// 列表
-function List({ dataSource, loading, pagination, searchParams, dispatch,
- categoryTree,handleModalVisible}) {
-
-
- function onPageChange(page) { // 翻页
- dispatch({
- type: 'productBrandList/page',
- payload: {
- pageNo: page.current,
- pageSize: page.pageSize,
- ...searchParams
- }
- })
- }
-
-
- const columns = [
- {
- title: '品牌名称',
- dataIndex: 'name',
- },
- {
- title: '品牌描述',
- dataIndex: 'description'
- },
- {
- title: '品牌图片',
- dataIndex: 'picUrl',
- render(val) {return ;},
- },
- {
- title: '状态',
- dataIndex: 'status',
- render(val) {return {status[val]};},
- },
- {
- title: '创建时间',
- dataIndex: 'createTime',
- render: val => {moment(val).format('YYYY-MM-DD')},
- },
- {
- title: '操作',
- width: 200,
- render: (text, record) => {
- const statusText = record.status === 1 ? '禁用' : '开启';
- return (
-
- handleModalVisible(true, 'update', record)}>编辑
-
- handleStatus(record)}>{statusText}
-
- handleDelete(record)}>删除
-
- );
- },
- },
-];
-
-
- return (
-
-)
-}
-
-// 新建 form 表单
- const AddOrUpdateForm = Form.create()(props => {
- const { dispatch, loading, modalVisible, form, handleModalVisible, modalType, categoryTree, formVals } = props;
- let picturesWall = null;
-
- const okHandle = () => {
- form.validateFields((err, fields) => {
- if (err) return;
- if (modalType === 'add') {
- dispatch({
- type: 'productBrandList/add',
- payload: {
- body: {
- ...fields,
- picUrl: picturesWall ? picturesWall.getUrl() : undefined,
- },
- callback: () => {
- // 清空表单
- form.resetFields();
- // 提示
- message.success('新建成功');
- // 关闭弹窗
- handleModalVisible();
- },
- },
- });
- } else {
- dispatch({
- type: 'productCategoryList/update',
- payload: {
- body: {
- ...formVals,
- ...fields,
- picUrl: picturesWall ? picturesWall.getUrl() : undefined,
- },
- callback: () => {
- // 清空表单
- form.resetFields();
- // 提示
- message.success('编辑成功');
- // 关闭弹窗
- handleModalVisible();
- },
- },
- });
- }
- });
- };
-
-
- const title = modalType === 'add' ? '新建品牌' : '编辑品牌';
- const okText = modalType === 'add' ? '新建' : '编辑';
- return (
- handleModalVisible()}
->
-
-
- {form.getFieldDecorator('name', {
- rules: [{ required: true, message: '请输入品牌名称!', min: 2 }],
- initialValue: formVals.name,
- })()}
-
-
-
- {form.getFieldDecorator('description', {
- rules: [{ required: true, message: '请输入描述!' }],
- initialValue: formVals.description,
- })()}
-
-
-
-);
-});
-
-// 搜索表单
-const SearchForm = Form.create()(props => {
- const {
- form,
- form: { getFieldDecorator },
- dispatch,
- searchParams,
- categoryTree,
- } = props;
-
-function search() {
- dispatch({
- type: 'productBrandList/page',
- payload: {
- ...PaginationHelper.defaultPayload,
- ...searchParams,
- ...form.getFieldsValue(),
-}
-})
-}
-
-// 提交搜索
-function handleSubmit(e) {
- // 阻止默认事件
- e.preventDefault();
- // 提交搜索
- search();
-}
-
-// 重置搜索
-function handleReset() {
- // 重置表单
- form.resetFields();
- // 执行搜索
- search();
-}
-
-
-
-
-return (
-
-);
-});
-
-
-
-
-// productSpuList
-@connect(({ productBrandList}) => ({
- ...productBrandList
-}))
-
-@Form.create()
-class ProductBrandList extends PureComponent {
- state = {
- modalVisible: false,
- modalType: 'add', //add update
- initValues: {},
- roleAssignVisible: false,
- roleAssignRecord: {},
- };
-
- componentDidMount() {
- const { dispatch } = this.props;
- // 查询初始数据
- dispatch({
- type: 'productBrandList/page',
- payload: {
- ...PaginationHelper.defaultPayload,
- },
- });
- }
-
-
-
- handleModalVisible = (modalVisible, modalType, record) => {
- const { dispatch } = this.props;
- dispatch({
- type: 'productBrandList/add',
- payload: {
- modalVisible,
- modalType,
- formVals: record || {}
- },
- });
- };
-
-
-render() {
- const { dispatch,
- list, listLoading, searchParams, pagination,
- categoryTree, modalType,formVals,
- modalVisible,modalLoading} = this.props;
-
- // 列表属性
- const listProps = {
- dataSource: list,
- pagination,
- searchParams,
- dispatch,
- categoryTree,
- loading: listLoading,
- handleModalVisible: this.handleModalVisible, // Function
- };
-
- // 搜索表单属性
- const searchFormProps = {
- dispatch,
- categoryTree,
- searchParams,
- };
-
- // 添加 or 编辑表单属性
- const addOrUpdateFormProps = {
- modalVisible,
- modalType,
- formVals,
- dispatch,
- loading: modalLoading,
- categoryTree: list,
- handleModalVisible: this.handleModalVisible, // Function
- };
-
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-);
-}
-}
-
-export default ProductBrandList;
diff --git a/admin-web/src/pages/Product/ProductCategoryList.js b/admin-web/src/pages/Product/ProductCategoryList.js
deleted file mode 100644
index a2e40be2e..000000000
--- a/admin-web/src/pages/Product/ProductCategoryList.js
+++ /dev/null
@@ -1,341 +0,0 @@
-/* eslint-disable */
-
-import React, { PureComponent, Fragment } from 'react';
-import { connect } from 'dva';
-import moment from 'moment';
-import {Card, Form, Input, Select, Button, Modal, message, Table, Divider, InputNumber, TreeSelect, Spin} from 'antd';
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-
-import styles from './ProductCategoryList.less';
-import PicturesWall from "../../components/Image/PicturesWall";
-
-const FormItem = Form.Item;
-const { Option } = Select;
-const status = ['未知', '开启', '禁用'];
-
-// 列表
-function List({ dataSource, loading, dispatch,
- handleModalVisible}) {
-
- function handleStatus(record) {
- Modal.confirm({
- title: record.status === 1 ? '确认禁用?' : '确认开启?',
- content: `${record.name}`,
- onOk() {
- dispatch({
- type: 'productCategoryList/updateStatus',
- payload: {
- body: {
- id: record.id,
- status: record.status === 1 ? 2 : 1,
- }
- },
- });
- },
- onCancel() {},
- });
- }
-
- function handleDelete(record) {
- Modal.confirm({
- title: `确认删除?`,
- content: `${record.name}`,
- onOk() {
- dispatch({
- type: 'productCategoryList/delete',
- payload: {
- id: record.id,
- },
- });
- },
- onCancel() {},
- });
- }
-
- const columns = [
- // {
- // title: 'id',
- // dataIndex: 'id',
- // render: text => {text},
- // },
- {
- title: '分类名称',
- dataIndex: 'name',
- },
- {
- title: '图片',
- dataIndex: 'picUrl',
- render(val) {
- return ;
- },
- },
- {
- title: '排序值',
- dataIndex: 'sort',
- },
- {
- title: '状态',
- dataIndex: 'status',
- render(val) {
- return {status[val]};
- },
- },
- {
- title: '描述',
- dataIndex: 'description',
- },
- {
- title: '创建时间',
- dataIndex: 'createTime',
- render: val => {moment(val).format('YYYY-MM-DD')},
- },
- {
- title: '操作',
- render: (text, record) => {
- const statusText = record.status === 1 ? '禁用' : '开启';
- return (
-
- handleModalVisible(true, 'update', record)}>编辑
-
- handleStatus(record)}>
- {statusText}
-
-
- {
- record.status === 2 ? (
-
-
- handleDelete(record)}>
- 删除
-
-
- ) : ''
- }
-
- );
- }
- },
- ];
-
- return (
-
- )
-}
-
-// 新建 form 表单
-const AddOrUpdateForm = Form.create()(props => {
- const { dispatch, loading, modalVisible, form, handleModalVisible, modalType, categoryTree, formVals } = props;
- let picturesWall = null;
-
- const okHandle = () => {
- form.validateFields((err, fields) => {
- if (err) return;
- if (modalType === 'add') {
- dispatch({
- type: 'productCategoryList/add',
- payload: {
- body: {
- ...fields,
- picUrl: picturesWall ? picturesWall.getUrl() : undefined,
- },
- callback: () => {
- // 清空表单
- form.resetFields();
- // 提示
- message.success('新建成功');
- // 关闭弹窗
- handleModalVisible();
- },
- },
- });
- } else {
- dispatch({
- type: 'productCategoryList/update',
- payload: {
- body: {
- ...formVals,
- ...fields,
- picUrl: picturesWall ? picturesWall.getUrl() : undefined,
- },
- callback: () => {
- // 清空表单
- form.resetFields();
- // 提示
- message.success('编辑成功');
- // 关闭弹窗
- handleModalVisible();
- },
- },
- });
- }
- });
- };
-
- function onPidChange(value) {
- formVals.pid = parseInt(value);
- }
-
- // 处理分类筛选
- const buildSelectTree = (list) => {
- return list.map(item => {
- let children = [];
- // if (item.children) { // 暂时不允许添加二级分类。
- // children = buildSelectTree(item.children);
- // }
- return {
- title: item.name,
- value: item.id,
- key: item.id,
- children,
- };
- });
- };
- let categoryTreeSelect = buildSelectTree(categoryTree);
- categoryTreeSelect.unshift({
- title: '无父分类',
- value: 0,
- key: 0,
- children: [],
- });
-
- const title = modalType === 'add' ? '新建分类' : '编辑分类';
- const okText = modalType === 'add' ? '新建' : '编辑';
- return (
- handleModalVisible()}
- >
-
-
- {form.getFieldDecorator('name', {
- rules: [{ required: true, message: '请输入分类名称!', min: 2 }],
- initialValue: formVals.name,
- })()}
-
-
- {form.getFieldDecorator('pid', {
- rules: [{ required: true, message: '请选择父分类!' }],
- initialValue: formVals.pid,
- })(
-
- )}
-
- {
- formVals.pid > 0 ? (
-
- picturesWall = node} maxLength={1} />
-
- ) : ''
- }
-
- {form.getFieldDecorator('sort', {
- rules: [{ required: true, message: '请输入排序值!' }],
- initialValue: formVals.sort,
- })()}
-
-
- {form.getFieldDecorator('description', {
- rules: [{ required: true, message: '请输入描述!' }],
- initialValue: formVals.description,
- })()}
-
-
-
- );
-});
-
-@connect(({ productCategoryList, }) => ({
- ...productCategoryList,
- // list: productCategoryList.list,
- // loading: loading.models.productCategoryList,
-}))
-
-@Form.create()
-class ProductCategoryList extends PureComponent {
-
- componentDidMount() {
- const { dispatch } = this.props;
- dispatch({
- type: 'productCategoryList/tree',
- payload: {},
- });
- }
-
- handleModalVisible = (modalVisible, modalType, record) => {
- const { dispatch } = this.props;
- dispatch({
- type: 'productCategoryList/setAll',
- payload: {
- modalVisible,
- modalType,
- formVals: record || {}
- },
- });
- };
-
- render() {
- const { dispatch,
- list,listLoading,
- modalVisible, modalType, formVals, modalLoading,} = this.props;
-
- // 列表属性
- const listProps = {
- dataSource: list,
- dispatch,
- loading: listLoading,
- handleModalVisible: this.handleModalVisible, // Function
- };
-
- // 添加 or 编辑表单属性
- const addOrUpdateFormProps = {
- modalVisible,
- modalType,
- formVals,
- dispatch,
- loading: modalLoading,
- categoryTree: list,
- handleModalVisible: this.handleModalVisible, // Function
- };
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default ProductCategoryList;
diff --git a/admin-web/src/pages/Product/ProductCategoryList.less b/admin-web/src/pages/Product/ProductCategoryList.less
deleted file mode 100644
index ebb45c292..000000000
--- a/admin-web/src/pages/Product/ProductCategoryList.less
+++ /dev/null
@@ -1,15 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.tableList {
- .tableListOperator {
- margin-bottom: 16px;
- button {
- margin-right: 8px;
- }
- }
-}
-
-.tableDelete {
- color: red;
-}
diff --git a/admin-web/src/pages/Product/ProductSpuAddOrUpdate.js b/admin-web/src/pages/Product/ProductSpuAddOrUpdate.js
deleted file mode 100644
index d1741550c..000000000
--- a/admin-web/src/pages/Product/ProductSpuAddOrUpdate.js
+++ /dev/null
@@ -1,303 +0,0 @@
-/* eslint-disable */
-
-import React, {PureComponent, Fragment, Component} from 'react';
-// import crypto from 'crypto';
-// import fs from 'fs';
-import { connect } from 'dva';
-import moment from 'moment';
-import {Card, Form, Input, Radio, Button, Modal, Select, Upload, Icon, Spin, TreeSelect} from 'antd';
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-
-// import * as qiniu from 'qiniu-js'
-// import uuid from 'js-uuid';
-
-import styles from './ProductSpuAddOrUpdate.less';
-import ProductAttrSelectFormItem from "../../components/Product/ProductAttrSelectFormItem";
-import ProductSkuAddOrUpdateTable from "../../components/Product/ProductSkuAddOrUpdateTable";
-// import {fileGetQiniuToken} from "../../services/admin";
-import PicturesWall from "../../components/Image/PicturesWall";
-import {fileGetQiniuToken} from "../../services/admin";
-import uuid from "js-uuid";
-import * as qiniu from "qiniu-js";
-import HtmlEditor from "../../components/Editor/HtmlEditor";
-
-const FormItem = Form.Item;
-const RadioGroup = Radio.Group;
-const Option = Select.Option;
-
-// roleList
-@connect(({ productAttrList, productSpuAddOrUpdate, productCategoryList }) => ({
- // list: productSpuList.list.spus,
- // loading: loading.models.productSpuList,
- productAttrList,
- productSpuAddOrUpdate,
- allAttrTree: productAttrList.tree,
- loading: productSpuAddOrUpdate.loading,
- spu: productSpuAddOrUpdate.spu,
- attrTree: productSpuAddOrUpdate.attrTree,
- skus: productSpuAddOrUpdate.skus,
- categoryTree: productCategoryList.list,
-}))
-
-@Form.create()
-class ProductSpuAddOrUpdate extends Component {
- state = {
- // modalVisible: false,
- modalType: 'add', //add update
- // initValues: {},
- htmlEditor: undefined,
- };
-
- componentDidMount() {
- const { dispatch } = this.props;
- const that = this;
- // 重置表单
- dispatch({
- type: 'productSpuAddOrUpdate/clear',
- });
- // 判断是否是更新
- const params = new URLSearchParams(this.props.location.search);
- if (params.get("id")) {
- let id = params.get("id");
- this.setState({
- modalType: 'update',
- id: id,
- })
- dispatch({
- type: 'productSpuAddOrUpdate/info',
- payload: parseInt(id),
- callback: function (data) {
- that.refs.picturesWall.setUrls(data.picUrls); // TODO 后续找找,有没更合适的做法
- // debugger;
- that.state.htmlEditor.setHtml(data.description);
- }
- })
- }
- // 获得规格列表
- dispatch({
- type: 'productAttrList/tree',
- payload: {
- name: '',
- pageNo: 0,
- pageSize: 10,
- },
- });
- // 获得商品分类
- dispatch({
- type: 'productCategoryList/tree',
- payload: {},
- });
- }
-
- handleAddAttr = e => {
- // alert('你猜');
- const { dispatch } = this.props;
- dispatch({
- type: 'productSpuAddOrUpdate/addAttr',
- payload: {
- },
- });
- };
-
- handleSubmit = e => {
- e.preventDefault();
- const { skus, dispatch } = this.props;
- const { modalType, id } = this.state;
- if (this.state.htmlEditor.isEmpty()) {
- alert('请设置商品描述!');
- return;
- }
- const description = this.state.htmlEditor.getHtml();
- // 获得图片
- let picUrls = this.refs.picturesWall.getUrls(); // TODO 芋艿,后续找找其他做法
- if (picUrls.length === 0) {
- alert('请必须上传一张图片!');
- return;
- }
- // 生成 skuStr 格式
- let skuStr = []; // 因为提交是字符串格式
- for (let i in skus) {
- let sku = skus[i];
- if (!sku.price || !sku.quantity) {
- continue;
- }
- let newAttr = {
- attrs: [],
- price: sku.price * 100,
- quantity: sku.quantity,
- }
- for (let j in sku.attrs) {
- newAttr.attrs.push(sku.attrs[j].id);
- }
- skuStr.push(newAttr);
- }
- if (skuStr.length === 0) {
- alert('请设置商品规格!');
- return;
- }
-
- // debugger;
- this.props.form.validateFields((err, values) => {
- // debugger;
- // 获得富文本编辑的描述
- if (!err) {
- if (modalType === 'add') {
- dispatch({
- type: 'productSpuAddOrUpdate/add',
- payload: {
- body: {
- ...values,
- picUrls: picUrls.join(','),
- skuStr: JSON.stringify(skuStr),
- description,
- }
- },
- });
- } else if (modalType === 'update') {
- dispatch({
- type: 'productSpuAddOrUpdate/update',
- payload: {
- body: {
- ...values,
- id,
- picUrls: picUrls.join(','),
- skuStr: JSON.stringify(skuStr),
- description,
- }
- },
- });
- }
- }
- });
- // console.log(fields);
- };
-
- render() {
- // debugger;
- const { form, skus, attrTree, allAttrTree, loading, spu, categoryTree, dispatch } = this.props;
- // const that = this;
-
- // 处理分类筛选
- const buildSelectTree = (list) => {
- return list.map(item => {
- let children = [];
- if (item.children) {
- children = buildSelectTree(item.children);
- }
- return {
- title: item.name,
- value: item.id,
- key: item.id,
- children,
- selectable: item.pid > 0
- };
- });
- };
- let categoryTreeSelect = buildSelectTree(categoryTree);
-
- // 添加规格
- // debugger;
- let attrTreeHTML = [];
- if (attrTree && attrTree.length > 0) {
- // 已选择的的规格集合
- let selectedAttrIds = new Set();
- for (let i in attrTree) {
- let attr = attrTree[i];
- selectedAttrIds.add(attr.id);
- }
- // 创建每个规格下拉框的 HTML
- for (let i in attrTree) {
- let attr = attrTree[i];
- let itemProps = {
- attr: attr,
- allAttrTree: allAttrTree,
- dispatch: dispatch,
- selectedAttrIds: selectedAttrIds,
- index: i // 位置。不然无法正确修改 Model 指定位置的数据
- };
- attrTreeHTML.push();
- }
- }
-
- // 规格明细
- let productSkuProps = {
- attrTree: attrTree,
- skus: skus,
- dispatch: dispatch,
- };
- // console.log(productSkuProps);
- // let htmlEditor = undefined;
-
- return (
-
-
-
-
-
-
-
- );
- }
-}
-
-export default ProductSpuAddOrUpdate;
diff --git a/admin-web/src/pages/Product/ProductSpuAddOrUpdate.less b/admin-web/src/pages/Product/ProductSpuAddOrUpdate.less
deleted file mode 100644
index ebb45c292..000000000
--- a/admin-web/src/pages/Product/ProductSpuAddOrUpdate.less
+++ /dev/null
@@ -1,15 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.tableList {
- .tableListOperator {
- margin-bottom: 16px;
- button {
- margin-right: 8px;
- }
- }
-}
-
-.tableDelete {
- color: red;
-}
diff --git a/admin-web/src/pages/Product/ProductSpuList.js b/admin-web/src/pages/Product/ProductSpuList.js
deleted file mode 100644
index 096cdec46..000000000
--- a/admin-web/src/pages/Product/ProductSpuList.js
+++ /dev/null
@@ -1,409 +0,0 @@
-/* eslint-disable */
-
-import React, { PureComponent, Fragment } from 'react';
-import { connect } from 'dva';
-import moment from 'moment';
-import {
- Card,
- Form,
- Input,
- Row,
- Col,
- Button,
- Modal,
- message,
- Table,
- Divider,
- Tree,
- Tabs,
- TreeSelect,
- Spin,
- InputNumber
-} from 'antd';
-const TabPane = Tabs.TabPane;
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-
-import styles from './ProductSpuList.less';
-import PaginationHelper from "../../../helpers/PaginationHelper";
-import PicturesWall from "../../components/Image/PicturesWall";
-
-const FormItem = Form.Item;
-const { TreeNode } = Tree;
-
-// 列表
-function List({ dataSource, loading, pagination, searchParams, dispatch,
- categoryTree, handleSortModalVisible}) {
-
- const handleTabsChange = (value) => {
- dispatch({
- type: 'productSpuList/page',
- payload: {
- ...searchParams,
- status: value,
- ...PaginationHelper.defaultPayload,
- }
- })
- };
-
- function onPageChange(page) { // 翻页
- dispatch({
- type: 'productSpuList/page',
- payload: {
- pageNo: page.current,
- pageSize: page.pageSize,
- ...searchParams
- }
- })
- }
-
- const redirectToUpdate = (spuId) => {
- dispatch({
- type: 'productSpuList/redirectToUpdate',
- payload: spuId,
- });
- };
-
- const getCategoryName = (cid, array) => {
- // debugger;
- for (let i in array) {
- // debugger;
- const node = array[i];
- if (node.id === cid) {
- return node.name;
- }
- if (!node.children) {
- continue;
- }
- let name = getCategoryName(cid, node.children);
- if (name) {
- return name;
- }
- }
- return undefined;
- };
-
- const columns = [
- // {
- // title: 'id',
- // dataIndex: 'id',
- // render: text => {text},
- // },
- {
- title: '商品名称',
- dataIndex: 'name',
- },
- {
- title: '商品分类',
- dataIndex: 'cid',
- render: value => getCategoryName(value, categoryTree),
- },
- {
- title: '商品主图',
- dataIndex: 'picUrls',
- render(val) {
- return ;
- },
- },
- {
- title: '商品库存',
- dataIndex: 'quantity'
- },
- {
- title: '排序值',
- dataIndex: 'sort',
- },
- {
- title: '创建时间',
- dataIndex: 'createTime',
- render: val => {moment(val).format('YYYY-MM-DD')},
- },
- {
- title: '操作',
- width: 200,
- render: (text, record) => (
-
- {/* this.handleModalVisible(true, 'update', record)}>更新*/}
- redirectToUpdate(record.id)}>编辑
-
- handleSortModalVisible(true, record)}>
- 排序
-
-
- ),
- },
- ];
-
- // console.log(pagination);
-
- return (
-
- )
-}
-
-// 搜索表单
-const SearchForm = Form.create()(props => {
- const {
- form,
- form: { getFieldDecorator },
- dispatch,
- searchParams,
- categoryTree,
- } = props;
-
- function search() {
- dispatch({
- type: 'productSpuList/page',
- payload: {
- ...PaginationHelper.defaultPayload,
- ...searchParams,
- ...form.getFieldsValue(),
- }
- })
- }
-
- // 提交搜索
- function handleSubmit(e) {
- // 阻止默认事件
- e.preventDefault();
- // 提交搜索
- search();
- }
-
- // 重置搜索
- function handleReset() {
- // 重置表单
- form.resetFields();
- // 执行搜索
- search();
- }
-
- // 处理分类筛选
- const buildSelectTree = (list) => {
- return list.map(item => {
- let children = [];
- if (item.children) {
- children = buildSelectTree(item.children);
- }
- return {
- title: item.name,
- value: item.id,
- key: item.id,
- children,
- selectable: item.pid > 0
- };
- });
- };
- let categoryTreeSelect = buildSelectTree(categoryTree);
-
- return (
-
- );
-});
-
-//
-
-// 新建 form 表单
-const UpdateSortForm = Form.create()(props => {
- const { dispatch, loading, modalVisible, form, handleModalVisible, formVals } = props;
-
- const okHandle = () => {
- form.validateFields((err, fields) => {
- if (err) return;
- dispatch({
- type: 'productSpuList/updateSort',
- payload: {
- body: {
- id: formVals.id,
- ...fields,
- },
- callback: () => {
- // 清空表单
- form.resetFields();
- // 提示
- message.success('编辑排序成功');
- // 关闭弹窗
- handleModalVisible();
- },
- },
- });
- });
- };
-
- const title = '编辑排序值';
- const okText = '确定';
- return (
- handleModalVisible()}
- >
-
-
- {form.getFieldDecorator('sort', {
- rules: [{ required: true, message: '请输入排序值!' }],
- initialValue: formVals.sort,
- })()}
-
-
-
- );
-});
-
-// productSpuList
-@connect(({ productSpuList, productCategoryList }) => ({
- ...productSpuList,
- // list: productSpuList.list.spus,
- // loading: loading.models.productSpuList,
- categoryTree: productCategoryList.list,
-}))
-
-@Form.create()
-class ProductSpuList extends PureComponent {
- state = {
- modalVisible: false,
- modalType: 'add', //add update
- initValues: {},
- roleAssignVisible: false,
- roleAssignRecord: {},
- };
-
- componentDidMount() {
- const { dispatch } = this.props;
- // 查询初始数据
- dispatch({
- type: 'productSpuList/page',
- payload: {
- status: 1,
- ...PaginationHelper.defaultPayload,
- },
- });
- // 获得商品分类
- dispatch({
- type: 'productCategoryList/tree',
- payload: {},
- });
- }
-
- redirectToAdd = () => {
- const { dispatch } = this.props;
- dispatch({
- type: 'productSpuList/redirectToAdd',
- });
- };
-
- handleSortModalVisible = (sortModalVisible, record) => {
- const { dispatch } = this.props;
- dispatch({
- type: 'productSpuList/setAll',
- payload: {
- sortModalVisible,
- formVals: record || {}
- },
- });
- };
-
- render() {
- const { dispatch,
- list, listLoading, searchParams, pagination,
- categoryTree, formVals,
- sortModalLoading, sortModalVisible, } = this.props;
-
- // 列表属性
- const listProps = {
- dataSource: list,
- pagination,
- searchParams,
- dispatch,
- categoryTree,
- loading: listLoading,
- handleSortModalVisible: this.handleSortModalVisible, // Func
- };
-
- // 搜索表单属性
- const searchFormProps = {
- dispatch,
- categoryTree,
- searchParams,
- };
-
- // 添加 or 编辑表单属性
- // debugger;
- const updateSortFormProps = {
- modalVisible: sortModalVisible,
- formVals,
- dispatch,
- loading: sortModalLoading,
- handleModalVisible: this.handleSortModalVisible, // Func
- };
-
- return (
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default ProductSpuList;
diff --git a/admin-web/src/pages/Product/ProductSpuList.less b/admin-web/src/pages/Product/ProductSpuList.less
deleted file mode 100644
index ebb45c292..000000000
--- a/admin-web/src/pages/Product/ProductSpuList.less
+++ /dev/null
@@ -1,15 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.tableList {
- .tableListOperator {
- margin-bottom: 16px;
- button {
- margin-right: 8px;
- }
- }
-}
-
-.tableDelete {
- color: red;
-}
diff --git a/admin-web/src/pages/Profile/AdvancedProfile.js b/admin-web/src/pages/Profile/AdvancedProfile.js
deleted file mode 100644
index 0006f993a..000000000
--- a/admin-web/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 '@/components/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/admin-web/src/pages/Profile/AdvancedProfile.less b/admin-web/src/pages/Profile/AdvancedProfile.less
deleted file mode 100644
index 4ee7621d0..000000000
--- a/admin-web/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;
- font-size: 16px;
- line-height: 64px;
- text-align: center;
- i {
- position: relative;
- top: 3px;
- margin-right: 16px;
- font-size: 24px;
- }
-}
-
-.heading {
- color: @heading-color;
- font-size: 20px;
-}
-
-.stepDescription {
- position: relative;
- left: 38px;
- padding-top: 8px;
- font-size: 14px;
- 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/admin-web/src/pages/Profile/BasicProfile.js b/admin-web/src/pages/Profile/BasicProfile.js
deleted file mode 100644
index c339dba10..000000000
--- a/admin-web/src/pages/Profile/BasicProfile.js
+++ /dev/null
@@ -1,188 +0,0 @@
-import React, { Component } from 'react';
-import { connect } from 'dva';
-import { Card, Badge, Table, Divider } from 'antd';
-import DescriptionList from '@/components/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, match } = this.props;
- const { params } = match;
-
- dispatch({
- type: 'profile/fetchBasic',
- payload: params.id || '1000000000',
- });
- }
-
- render() {
- const { profile = {}, loading } = this.props;
- const { basicGoods = [], basicProgress = [], userInfo = {}, application = {} } = 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 (
-
-
-
- {application.id}
- {application.status}
- {application.orderNo}
- {application.childOrderNo}
-
-
-
- {userInfo.name}
- {userInfo.tel}
- {userInfo.delivery}
- {userInfo.addr}
- {userInfo.remark}
-
-
- 退货商品
-
- 退货进度
-
-
-
- );
- }
-}
-
-export default BasicProfile;
diff --git a/admin-web/src/pages/Profile/BasicProfile.less b/admin-web/src/pages/Profile/BasicProfile.less
deleted file mode 100644
index 5c3f94f5c..000000000
--- a/admin-web/src/pages/Profile/BasicProfile.less
+++ /dev/null
@@ -1,8 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.title {
- margin-bottom: 16px;
- color: @heading-color;
- font-weight: 500;
- font-size: 16px;
-}
diff --git a/admin-web/src/pages/Profile/models/profile.js b/admin-web/src/pages/Profile/models/profile.js
deleted file mode 100644
index 3b9a290c5..000000000
--- a/admin-web/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({ payload }, { call, put }) {
- const response = yield call(queryBasicProfile, payload);
- 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/admin-web/src/pages/Promotion/BannerList.js b/admin-web/src/pages/Promotion/BannerList.js
deleted file mode 100644
index 96a6afcc3..000000000
--- a/admin-web/src/pages/Promotion/BannerList.js
+++ /dev/null
@@ -1,409 +0,0 @@
-/* eslint-disable */
-
-import React, { PureComponent, Fragment } from 'react';
-import { connect } from 'dva';
-import {
- Card,
- Form,
- Input,
- Button,
- Modal,
- message,
- Table,
- Divider,
- Tree,
- Spin,
- Row,
- Col,
- Select,
- Icon,
- InputNumber
-} from 'antd';
-import { checkTypeWithEnglishAndNumbers } from '../../../helpers/validator'
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-
-import styles from './BannerList.less';
-import moment from "moment";
-import PaginationHelper from "../../../helpers/PaginationHelper";
-import PicturesWall from "../../components/Image/PicturesWall";
-
-const FormItem = Form.Item;
-const status = ['未知', '正常', '禁用'];
-
-// 列表
-function List ({ dataSource, loading, pagination, searchParams, dispatch,
- handleModalVisible}) {
-
- function handleStatus(record) {
- Modal.confirm({
- title: record.status === 1 ? '确认禁用' : '取消禁用',
- content: `${record.username}`,
- onOk() {
- dispatch({
- type: 'bannerList/updateStatus',
- payload: {
- id: record.id,
- status: record.status === 1 ? 2 : 1,
- },
- });
- },
- onCancel() {},
- });
- }
-
- function handleDelete(record) {
- Modal.confirm({
- title: `确认删除?`,
- content: `${record.title}`,
- onOk() {
- dispatch({
- type: 'bannerList/delete',
- payload: {
- id: record.id,
- },
- });
- },
- onCancel() {},
- });
- }
-
- const columns = [
- {
- title: '标题',
- dataIndex: 'title',
- width: 120,
- },
- {
- title: '跳转链接',
- dataIndex: 'url',
- width: 120,
- },
- {
- title: '图片',
- dataIndex: 'picUrl',
- render(val) {
- return ;
- },
- },
- {
- title: '排序值',
- dataIndex: 'sort',
- },
- {
- title: '状态',
- dataIndex: 'status',
- render(val) {
- return {status[val]}; // TODO 芋艿,此处要改
- },
- },
- {
- title: '备注',
- dataIndex: 'memo',
- width: 150,
- },
- {
- title: '创建时间',
- dataIndex: 'createTime',
- width: 120,
- render: val => {moment(val).format('YYYY-MM-DD')},
- },
- {
- title: '操作',
- width: 150,
- render: (text, record) => {
- const statusText = record.status === 1 ? '禁用' : '开启'; // TODO 芋艿,此处要改
- return (
-
- handleModalVisible(true, 'update', record)}>编辑
-
- handleStatus(record)}>
- {statusText}
-
- {
- record.status === 2 ?
-
-
- handleDelete(record)}>
- 删除
-
- : null
- }
-
- );
- },
- },
- ];
-
- function onPageChange(page) { // 翻页
- dispatch({
- type: 'bannerList/query',
- payload: {
- pageNo: page.current,
- pageSize: page.pageSize,
- ...searchParams
- }
- })
- }
-
- return (
-
- )
-}
-
-// 搜索表单
-// TODO 芋艿,有没办法换成上面那种写法
-const SearchForm = Form.create()(props => {
- const {
- form,
- form: { getFieldDecorator },
- dispatch
- } = props;
-
- function search() {
- dispatch({
- type: 'bannerList/query',
- payload: {
- ...PaginationHelper.defaultPayload,
- ...form.getFieldsValue()
- }
- })
- }
-
- // 提交搜索
- function handleSubmit(e) {
- // 阻止默认事件
- e.preventDefault();
- // 提交搜索
- search();
- }
-
- // 重置搜索
- function handleReset() {
- // 重置表单
- form.resetFields();
- // 执行搜索
- search();
- }
-
- return (
-
- );
-});
-
-// 添加 or 修改 Form 表单
-const AddOrUpdateForm = Form.create()(props => {
- const { dispatch, modalVisible, form, handleModalVisible, modalType, formVals } = props;
- let picturesWall = null;
-
- const okHandle = () => {
- form.validateFields((err, fields) => {
- if (err) return;
- // 添加表单
- if (modalType === 'add') {
- dispatch({
- type: 'bannerList/add',
- payload: {
- body: {
- ...fields,
- picUrl: picturesWall ? picturesWall.getUrl() : undefined,
- },
- callback: () => {
- // 清空表单
- form.resetFields();
- // 提示
- message.success('添加成功');
- // 关闭弹窗
- handleModalVisible();
- },
- },
- });
- // 修改表单
- } else {
- dispatch({
- type: 'bannerList/update',
- payload: {
- body: {
- id: formVals.id,
- ...fields,
- picUrl: picturesWall ? picturesWall.getUrl() : undefined,
- },
- callback: () => {
- // 清空表单
- form.resetFields();
- // 提示
- message.success('编辑成功');
- // 关闭弹窗
- handleModalVisible();
- },
- },
- });
- }
- });
- };
-
- const title = modalType === 'add' ? '新建广告' : '编辑广告';
- return (
- handleModalVisible()}
- >
-
- {form.getFieldDecorator('title', {
- rules: [{ required: true, message: '请输入标题!'},
- {max: 32, min:2, message: '长度为 2-32 位'},
- ],
- initialValue: formVals.title,
- })()}
-
-
- {form.getFieldDecorator('url', {
- rules: [{ required: true, message: '请输入跳转链接!'},
- { type: 'url', message: '必须是 URL!'},
- {max: 255, message: '最大长度为 255 位'},
- ],
- initialValue: formVals.picUrl,
- })()}
-
-
- picturesWall = node} maxLength={1} />
-
-
- {form.getFieldDecorator('sort', {
- rules: [{ required: true, message: '请输入排序值!' }],
- initialValue: formVals.sort,
- })()}
-
-
- {form.getFieldDecorator('memo', {
- rules: [{ required: false, message: '请输入备注!' },
- {max: 255, message: '最大长度为 255 位'},
- ],
- initialValue: formVals.memo,
- })()}
-
-
- );
-});
-
-@connect(({ bannerList }) => ({
- // list: bannerList.list,
- // pagination: bannerList.pagination,
- ...bannerList,
-}))
-
-// 主界面
-@Form.create()
-class BannerList extends PureComponent {
-
- componentDidMount() {
- const { dispatch } = this.props;
- dispatch({
- type: 'bannerList/query',
- payload: {
- ...PaginationHelper.defaultPayload
- },
- });
- }
-
- handleModalVisible = (modalVisible, modalType, record) => {
- const { dispatch } = this.props;
- dispatch({
- type: 'bannerList/setAll',
- payload: {
- modalVisible,
- modalType,
- formVals: record || {}
- },
- });
- };
-
- render() {
- // let that = this;
- const { dispatch,
- list, listLoading, searchParams, pagination,
- modalVisible, modalType, formVals,
- confirmLoading,} = this.props;
-
- // 列表属性
- const listProps = {
- dataSource: list,
- pagination,
- searchParams,
- dispatch,
- loading: listLoading,
- confirmLoading,
- handleModalVisible: this.handleModalVisible, // Function
- };
-
- // 搜索表单属性
- const searchFormProps = {
- dispatch,
- };
-
- // 添加 or 编辑表单属性
- const addOrUpdateFormProps = {
- modalVisible,
- modalType,
- formVals,
- dispatch,
- handleModalVisible: this.handleModalVisible, // Function
- };
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default BannerList;
diff --git a/admin-web/src/pages/Promotion/BannerList.less b/admin-web/src/pages/Promotion/BannerList.less
deleted file mode 100644
index 7ad3dac3f..000000000
--- a/admin-web/src/pages/Promotion/BannerList.less
+++ /dev/null
@@ -1,47 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.tableList {
- .tableListOperator {
- margin-bottom: 16px;
- button {
- margin-right: 8px;
- }
- }
-}
-
-.tableDelete {
- color: red;
-}
-
-.tableListForm {
- :global {
- .ant-form-item {
- display: flex;
- margin-right: 0;
- margin-bottom: 24px;
- > .ant-form-item-label {
- width: auto;
- padding-right: 8px;
- line-height: 32px;
- }
- .ant-form-item-control {
- line-height: 32px;
- }
- }
- .ant-form-item-control-wrapper {
- flex: 1;
- }
- }
- .submitButtons {
- display: block;
- margin-bottom: 24px;
- white-space: nowrap;
- }
-}
-
-@media screen and (max-width: @screen-lg) {
- .tableListForm :global(.ant-form-item) {
- margin-right: 24px;
- }
-}
\ No newline at end of file
diff --git a/admin-web/src/pages/Promotion/CouponCardTemplateList.js b/admin-web/src/pages/Promotion/CouponCardTemplateList.js
deleted file mode 100644
index d1a2906eb..000000000
--- a/admin-web/src/pages/Promotion/CouponCardTemplateList.js
+++ /dev/null
@@ -1,715 +0,0 @@
-/* eslint-disable */
-
-import React, { PureComponent, Fragment } from 'react';
-import { connect } from 'dva';
-import {
- Card,
- Form,
- Input,
- Button,
- Modal,
- message,
- Table,
- Divider,
- Tree,
- Spin,
- Row,
- Col,
- Select,
- Icon,
- InputNumber,
- DatePicker, TreeSelect
-} from 'antd';
-import { checkTypeWithEnglishAndNumbers } from '../../../helpers/validator'
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-
-import styles from './CouponCardTemplateList.less';
-import moment from "moment";
-import PaginationHelper from "../../../helpers/PaginationHelper";
-
-const FormItem = Form.Item;
-const SelectOption = Select.Option;
-const { TreeNode } = Tree;
-const RangePicker = DatePicker.RangePicker;
-const status = ['未知', '正常', '禁用'];
-const rangeType = {
- 10: '所有可用',
- 20: '部分商品可用',
- 21: '部分商品不可用',
- 30: '部分分类可用',
- 31: '部分分类不可用'};
-const preferentialType = ['未知', '代金卷', '折扣卷'];
-const dateType = ['未知', '固定日期', '领取日期'];
-
-// 列表
-function List ({ dataSource, loading, pagination, searchParams, dispatch,
- handleModalVisible}) {
-
- function handleStatus(record) {
- Modal.confirm({
- title: record.status === 1 ? '确认禁用' : '取消禁用',
- content: `${record.title}`,
- onOk() {
- dispatch({
- type: 'couponCardTemplateList/updateStatus',
- payload: {
- id: record.id,
- status: record.status === 1 ? 2 : 1,
- },
- });
- },
- onCancel() {},
- });
- }
-
- // function handleDelete(record) {
- // Modal.confirm({
- // title: `确认删除?`,
- // content: `${record.productSpuId}`,
- // onOk() {
- // dispatch({
- // type: 'couponCardTemplateList/delete',
- // payload: {
- // id: record.id,
- // },
- // });
- // },
- // onCancel() {},
- // });
- // }
-
- const columns = [
- {
- title: '名称',
- dataIndex: 'title',
- },
- {
- title: '类型',
- dataIndex: 'preferentialType',
- render(val) {
- return {preferentialType[val]};
- },
- },
- {
- title: '优惠内容',
- render(val, record) {
- let content;
- // priceAvailable;
- if (record.priceAvailable === 0) {
- content = '无门槛,';
- } else {
- content = '满 ' + record.priceAvailable / 100 + ' 元,';
- }
- if (record.preferentialType === 1) {
- content += '减 ' + record.priceOff / 100 + ' 元';
- } else {
- content += '打' + record.percentOff / 100.0 + '折';
- if (record.discountPriceLimit) {
- content += ', 最多减 ' + record.discountPriceLimit / 100 + ' 元';
- }
- }
- return content;
- }
- },
- {
- title: '可使用商品',
- dataIndex: 'rangeType',
- render: val => {rangeType[val]},
- },
- {
- title: '有效期',
- render(val, record) {
- let content = dateType[record.dateType] + ' ';
- // priceAvailable;
- if (record.dateType === 1) {
- content += moment(new Date(record.validStartTime)).format('YYYY-MM-DD')
- + '~' + moment(new Date(record.validEndTime)).format('YYYY-MM-DD');
- } else if (record.dateType === 2) {
- content += record.fixedStartTerm + '-' + record.fixedEndTerm + ' 天';
- }
- return content;
- }
- },
- {
- title: '已领取/剩余',
- // 已使用 TODO 芋艿
- // 支付金额(元) TODO 芋艿
- // 客单价(元) TODO 芋艿
- render(val, record) {
- // debugger;
- return `${record.statFetchNum} / ` + (record.total - record.statFetchNum);
- }
- },
- {
- title: '状态',
- dataIndex: 'status',
- render: val => {status[val]},
- },
- // {
- // title: '使用说明',
- // dataIndex: 'description',
- // },
- {
- title: '创建时间',
- dataIndex: 'createTime',
- render: val => {moment(val).format('YYYY-MM-DD HH:mm')},
- },
- {
- title: '操作',
- width: 120,
- render: (text, record) => {
- const statusText = record.status === 1 ? '禁用' : '开启'; // TODO 芋艿,此处要改
- return (
-
- handleModalVisible(true, 'update', record)}>编辑
-
- handleStatus(record)}>
- {statusText}
-
- {/*{*/}
- {/* record.status === 2 ?*/}
- {/* */}
- {/* */}
- {/* handleDelete(record)}>*/}
- {/* 删除*/}
- {/* */}
- {/* : null*/}
- {/*}*/}
-
- );
- },
- },
- ];
-
- function onPageChange(page) { // 翻页
- dispatch({
- type: 'couponCardTemplateList/query',
- payload: {
- pageNo: page.current,
- pageSize: page.pageSize,
- ...searchParams
- }
- })
- }
-
- return (
-
- )
-}
-
-// 搜索表单
-// TODO 芋艿,有没办法换成上面那种写法
-const SearchForm = Form.create()(props => {
- const {
- form,
- form: { getFieldDecorator },
- dispatch
- } = props;
-
- function search() {
- dispatch({
- type: 'couponCardTemplateList/query',
- payload: {
- ...PaginationHelper.defaultPayload,
- ...form.getFieldsValue()
- }
- })
- }
-
- // 提交搜索
- function handleSubmit(e) {
- // 阻止默认事件
- e.preventDefault();
- // 提交搜索
- search();
- }
-
- // 重置搜索
- function handleReset() {
- // 重置表单
- form.resetFields();
- // 执行搜索
- search();
- }
-
- return (
-
- );
-});
-
-// 添加 or 修改 Form 表单
-const AddOrUpdateForm = Form.create()(props => {
- const { dispatch, modalVisible, form, handleModalVisible, modalType, formVals,
- searchProductSpuList, formSpuValues, categoryTree} = props;
-
- const okHandle = () => {
- form.validateFields((err, fields) => {
- if (err) return;
- let newFields = {
- ...fields,
- priceAvailable: fields.priceAvailable ? parseInt(fields.priceAvailable * 100) : undefined,
- priceOff: fields.priceOff ? parseInt(fields.priceOff * 100) : undefined,
- discountPriceLimit: fields.discountPriceLimit ? parseInt(fields.discountPriceLimit * 100) : undefined,
- validStartTime: fields.validStartTime ? fields.validStartTime.format('YYYY-MM-DD') : undefined,
- validEndTime: fields.validEndTime ? fields.validEndTime.format('YYYY-MM-DD') : undefined,
- rangeValues: fields.rangeValues && fields.rangeValues.length > 0 ? fields.rangeValues.join(',') : undefined,
- };
- // 添加表单
- if (modalType === 'add') {
- dispatch({
- type: 'couponCardTemplateList/add',
- payload: {
- body: {
- ...newFields,
- },
- callback: () => {
- // 清空表单
- form.resetFields();
- // 提示
- message.success('添加成功');
- // 关闭弹窗
- handleModalVisible();
- },
- },
- });
- // 修改表单
- } else {
- dispatch({
- type: 'couponCardTemplateList/update',
- payload: {
- body: {
- id: formVals.id,
- ...newFields,
- priceAvailable: undefined,
- dateType: undefined,
- validStartTime: undefined,
- validEndTime: undefined,
- fixedStartTerm: undefined,
- fixedEndTerm: undefined,
- preferentialType: undefined,
- priceOff: undefined,
- percentOff: undefined,
- discountPriceLimit: undefined,
- },
- callback: () => {
- // 清空表单
- form.resetFields();
- // 提示
- message.success('更新成功');
- // 关闭弹窗
- handleModalVisible();
- },
- },
- });
- }
- });
- };
-
- function onRangeTypeChange(value) {
- formVals.rangeType = parseInt(value);
- }
-
- function onDateTypeChange(value) {
- formVals.dateType = parseInt(value);
- }
-
- function onPreferentialTypeChange(value) {
- formVals.preferentialType = parseInt(value);
- }
-
- const searchProductSpu = (value) => {
- if (!value) {
- dispatch({
- type: 'couponCardTemplateList/setAll',
- payload: {
- searchProductSpuList: [],
- },
- });
- return;
- }
- dispatch({
- type: 'couponCardTemplateList/searchProductSpu',
- payload: {
- name: value,
- },
- });
- };
-
- // 处理分类筛选
- const buildSelectTree = (list) => {
- return list.map(item => {
- let children = [];
- if (item.children) {
- children = buildSelectTree(item.children);
- }
- return {
- title: item.name,
- value: item.id,
- key: item.id,
- children,
- selectable: item.pid > 0
- };
- });
- };
- let categoryTreeSelect = buildSelectTree(categoryTree);
-
- const title = modalType === 'add' ? '新建优惠劵' : '更新优惠劵';
- return (
- handleModalVisible()}
- width={720}
- >
-
- {form.getFieldDecorator('title', {
- rules: [{ required: true, message: '请输入标题!' },
- {max: 16, min:2, message: '长度为 2-16 位'},],
- initialValue: formVals.title,
- })()}
-
-
- {form.getFieldDecorator('description', {
- rules: [{ required: false, message: '请输入使用说明!' },
- {max: 255, message: '最大长度为 255 位'},
- ],
- initialValue: formVals.description,
- })()}
-
-
- {form.getFieldDecorator('quota', {
- rules: [{ required: true, message: '请选择每人限领次数!'},
- ],
- initialValue: formVals.quota,
- })(
-
- )}
-
-
- {form.getFieldDecorator('total', {
- rules: [{ required: true, message: '请输入发放总量!' },
- {min: 1, type: 'number', message: '最小值为 1'}],
- initialValue: formVals.total,
- })()}
-
-
- {form.getFieldDecorator('priceAvailable', {
- rules: [{ required: true, message: '请输入使用金额门槛!' },],
- initialValue: formVals.priceAvailable ? formVals.priceAvailable / 100.0 : undefined,
- })()} 元
-
-
- {form.getFieldDecorator('rangeType', {
- rules: [{ required: true, message: '请选择可用范围!'}, // TODO 芋艿,需要修改
- ],
- initialValue: formVals.rangeType ? formVals.rangeType + '' : undefined,
- })(
-
- )}
-
- {/*{*/}
- {/* formVals.rangeType == 20 || formVals.rangeType == 21*/}
- {/* || formVals.rangeType == 30 || formVals.rangeType == 31 ?*/}
- {/* */}
- {/* {form.getFieldDecorator('rangeValues', {*/}
- {/* rules: [{ required: true, message: '请输入具体范围!' }, // TODO 芋艿,做成搜索*/}
- {/* {maxlength: 255, message: '最大长度为 255 位'},*/}
- {/* ],*/}
- {/* initialValue: formVals.rangeValues,*/}
- {/* })()}*/}
- {/* */}
- {/* : ''*/}
- {/*}*/}
- {
- formVals.rangeType == 20 || formVals.rangeType == 21?
-
- {form.getFieldDecorator('rangeValues', {
- rules: [{ required: true, message: '请选择商品!' },
- ],
- initialValue: formVals.rangeValues ? formVals.rangeValues.split(',') : undefined,
- })(
-
- )}
-
- : ''
- }
- {
- formVals.rangeType == 30 || formVals.rangeType == 31 ?
-
- {form.getFieldDecorator('rangeValues', {
- rules: [{ required: true, message: '请选择分类!' },
- ],
- initialValue: formVals.rangeValues ? formVals.rangeValues.split(',') : undefined,
- })(
-
- )}
-
- : ''
- }
-
- {form.getFieldDecorator('dateType', {
- rules: [{ required: true, message: '请选择可用范围!'}, // TODO 芋艿,需要修改
- ],
- initialValue: formVals.dateType ? formVals.dateType + '' : undefined,
- })(
-
- )}
-
- {
- formVals.dateType == 1 ?
-
- {form.getFieldDecorator('validStartTime', {
- rules: [{ required: true, message: '请输入固定日期!' },],
- initialValue: formVals.validStartTime ? moment(formVals.validStartTime) : undefined,
- })()}
- -
- {form.getFieldDecorator('validEndTime', {
- rules: [{ required: true, message: '请输入固定日期!' },],
- initialValue: formVals.validEndTime ? moment(formVals.validEndTime) : undefined,
- })()}
- : ''
- }
- {
- formVals.dateType == 2 ?
-
- {form.getFieldDecorator('fixedStartTerm', {
- rules: [{ required: true, message: '请输入固定日期!' },
- {min: 1, type: 'number', message: '最小值为 1'}],
- initialValue: formVals.fixedStartTerm,
- })()}
- -
- {form.getFieldDecorator('fixedEndTerm', {
- rules: [{ required: true, message: '请输入固定日期!' },
- {min: 1, type: 'number', message: '最小值为 1'}],
- initialValue: formVals.fixedEndTerm,
- })()} 天
- : ''
- }
-
-
- {form.getFieldDecorator('preferentialType', {
- rules: [{ required: true, message: '请选择优惠类型!'}, // TODO 芋艿,需要修改
- ],
- initialValue: formVals.preferentialType ? formVals.preferentialType + '' : undefined,
- })(
-
- )}
-
- {
- formVals.preferentialType == 1 ?
-
- {form.getFieldDecorator('priceOff', {
- rules: [{ required: true, message: '请输入优惠金额!' },
- {min: 0.01, type: 'number', message: '最小值为 0.01'}],
- initialValue: formVals.priceOff ? formVals.priceOff / 100.0 : undefined,
- })()}
- : ''
- }
- {
- formVals.preferentialType == 2 ?
-
-
- {form.getFieldDecorator('percentOff', {
- rules: [{ required: true, message: '请输入折扣百分比!' },
- {min: 1, max: 99, type: 'number', message: '范围为 [1, 99]'},
- ],
- initialValue: formVals.percentOff,
- })()}%
-
-
- {form.getFieldDecorator('discountPriceLimit', {
- rules: [{ required: false, message: '请输入最多优惠!' },
- {min: 0.01, type: 'number', message: '最小值为 0.01'},
- ],
- initialValue: formVals.discountPriceLimit ? formVals.discountPriceLimit / 100.0 : undefineds,
- })()}元
-
- : ''
- }
-
- );
-});
-
-@connect(({ couponCardTemplateList, productCategoryList }) => ({
- // list: productRecommend.list,
- // pagination: productRecommend.pagination,
- ...couponCardTemplateList,
- categoryTree: productCategoryList.list,
-}))
-
-// 主界面
-@Form.create()
-class CouponCardTemplateLists extends PureComponent {
-
- componentDidMount() {
- const { dispatch } = this.props;
- // 获得优惠劵列表
- dispatch({
- type: 'couponCardTemplateList/query',
- payload: {
- ...PaginationHelper.defaultPayload
- },
- });
- }
-
- handleModalVisible = (modalVisible, modalType, record) => {
- const { dispatch } = this.props;
- // 弹窗,并清空一些缓存
- dispatch({
- type: 'couponCardTemplateList/setAll',
- payload: {
- modalVisible,
- modalType,
- formVals: record || {},
- searchProductSpuList: [],
- formSpuValues: [],
- },
- });
- // 如果是指定商品,则获得商品列表
- if (record && record.rangeType &&
- (record.rangeType === 20 || record.rangeType === 21)) {
- dispatch({
- type: 'couponCardTemplateList/getProductSpuList',
- payload: {
- ids: record.rangeValues,
- },
- });
- }
- // 获得商品分类,因为后续可能使用到
- // 获得商品分类
- dispatch({
- type: 'productCategoryList/tree',
- payload: {},
- });
- };
-
- render() {
- // let that = this;
- const { dispatch,
- list, listLoading, searchParams, pagination,
- modalVisible, modalType, formVals, searchProductSpuList, formSpuValues, categoryTree,
- confirmLoading, } = this.props;
-
- // 列表属性
- const listProps = {
- dataSource: list,
- pagination,
- searchParams,
- dispatch,
- loading: listLoading,
- confirmLoading,
- handleModalVisible: this.handleModalVisible, // Function
- };
-
- // 搜索表单属性
- const searchFormProps = {
- dispatch,
- };
-
- // 添加 or 更新表单属性
- const addOrUpdateFormProps = {
- modalVisible,
- modalType,
- formVals,
- dispatch,
- searchProductSpuList,
- formSpuValues,
- categoryTree,
- handleModalVisible: this.handleModalVisible, // Function
- };
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default CouponCardTemplateLists;
diff --git a/admin-web/src/pages/Promotion/CouponCardTemplateList.less b/admin-web/src/pages/Promotion/CouponCardTemplateList.less
deleted file mode 100644
index 7ad3dac3f..000000000
--- a/admin-web/src/pages/Promotion/CouponCardTemplateList.less
+++ /dev/null
@@ -1,47 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.tableList {
- .tableListOperator {
- margin-bottom: 16px;
- button {
- margin-right: 8px;
- }
- }
-}
-
-.tableDelete {
- color: red;
-}
-
-.tableListForm {
- :global {
- .ant-form-item {
- display: flex;
- margin-right: 0;
- margin-bottom: 24px;
- > .ant-form-item-label {
- width: auto;
- padding-right: 8px;
- line-height: 32px;
- }
- .ant-form-item-control {
- line-height: 32px;
- }
- }
- .ant-form-item-control-wrapper {
- flex: 1;
- }
- }
- .submitButtons {
- display: block;
- margin-bottom: 24px;
- white-space: nowrap;
- }
-}
-
-@media screen and (max-width: @screen-lg) {
- .tableListForm :global(.ant-form-item) {
- margin-right: 24px;
- }
-}
\ No newline at end of file
diff --git a/admin-web/src/pages/Promotion/FullPrivilegeList.js b/admin-web/src/pages/Promotion/FullPrivilegeList.js
deleted file mode 100644
index 75b76a266..000000000
--- a/admin-web/src/pages/Promotion/FullPrivilegeList.js
+++ /dev/null
@@ -1,325 +0,0 @@
-/* eslint-disable */
-
-import React, { PureComponent, Fragment } from 'react';
-import { connect } from 'dva';
-import moment from 'moment';
-import {
- Card,
- Form,
- Input,
- Row,
- Col,
- Button,
- Modal,
- message,
- Table,
- Divider,
- Tree,
- Tabs,
- TreeSelect,
- Spin,
- InputNumber
-} from 'antd';
-const TabPane = Tabs.TabPane;
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-
-import styles from './FullPrivilegeList.less';
-import PaginationHelper from "../../../helpers/PaginationHelper";
-
-const FormItem = Form.Item;
-
-const statuses = {
- 10: '未开始',
- 20: '进行中',
- 30: '已结束',
- 40: '已撤销',
- 50: '已删除',
-};
-
-const meetTypes = {
- 1: '满 N 元减/送',
- 2: '满 N 件减/送',
-};
-
-// 列表
-function List({ dataSource, loading, pagination, searchParams, dispatch,}) {
-
- const handleTabsChange = (value) => {
- dispatch({
- type: 'fullPrivilegeList/page',
- payload: {
- ...searchParams,
- status: value,
- ...PaginationHelper.defaultPayload,
- }
- })
- };
-
- function onPageChange(page) { // 翻页
- dispatch({
- type: 'fullPrivilegeList/page',
- payload: {
- pageNo: page.current,
- pageSize: page.pageSize,
- ...searchParams
- }
- })
- }
-
- function formatFullPrivilegeText(activity) {
- let text = '';
- let fullPrivilege = activity.fullPrivilege;
- for (let i in fullPrivilege.privileges) {
- let privilege = fullPrivilege.privileges[i];
- if (i > 0) {
- text += ';';
- }
- if (fullPrivilege.cycled) {
- text += '每';
- }
- if (privilege.meetType === 1) {
- text += '满 ' + privilege.meetValue / 100.0 + ' 元,';
- } else if (privilege.meetType === 2) {
- text += '满 ' + privilege.meetValue + ' 件,';
- }
- if (privilege.preferentialType === 1) {
- text += '减 ' + privilege.preferentialValue / 100.0 + ' 元';
- } else if (privilege.preferentialType === 2) {
- text += '打 ' + privilege.preferentialValue / 10.0 + ' 折';
- }
- }
- return text;
- };
-
- const columns = [
- // {
- // title: 'id',
- // dataIndex: 'id',
- // render: text => {text},
- // },
- {
- title: '活动名称',
- dataIndex: 'title',
- },
- {
- title: '类型',
- dataIndex: 'fullPrivilege',
- render: val => meetTypes[val.privileges[0].meetType + ''],
- },
- {
- title: '活动详情',
- render: (text, record) => formatFullPrivilegeText(record),
- },
- {
- title: '活动时间',
- render: (text, record) => (
-
- {moment(record.startTime).format('YYYY-MM-DD HH:mm:ss')}
- 至
- {moment(record.endTime).format('YYYY-MM-DD HH:mm:ss')}
-
- ),
- },
- {
- title: '状态',
- dataIndex: 'status',
- render: val => statuses[val + ''],
- },
- {
- title: '创建时间',
- dataIndex: 'createTime',
- render: val => {moment(val).format('YYYY-MM-DD')},
- },
- {
- title: '操作',
- width: 300,
- render: (text, record) => (
-
- {/* this.handleModalVisible(true, 'update', record)}>更新*/}
- alert('正在开发中')}>编辑
- {
- record.status === 10 || record.status === 20 ?
-
- alert('正在开发中')}>
- 撤销
-
- : undefined
- }
- {
- record.status !== 50 ?
-
- alert('正在开发中')}>
- 删除
-
- : undefined
- }
-
- ),
- },
- ];
-
- // console.log(pagination);
-
- return (
-
- )
-}
-
-// 搜索表单
-const SearchForm = Form.create()(props => {
- const {
- form,
- form: { getFieldDecorator },
- dispatch,
- searchParams,
- } = props;
-
- function search() {
- dispatch({
- type: 'fullPrivilegeList/page',
- payload: {
- ...PaginationHelper.defaultPayload,
- ...searchParams,
- ...form.getFieldsValue(),
- }
- })
- }
-
- // 提交搜索
- function handleSubmit(e) {
- // 阻止默认事件
- e.preventDefault();
- // 提交搜索
- search();
- }
-
- // 重置搜索
- function handleReset() {
- // 重置表单
- form.resetFields();
- // 执行搜索
- search();
- }
-
- return (
-
- );
-});
-
-// fullPrivilegeList
-@connect(({ fullPrivilegeList }) => ({
- ...fullPrivilegeList,
- // list: fullPrivilegeList.list.spus,
- // loading: loading.models.fullPrivilegeList,
-}))
-
-@Form.create()
-class FullPrivilegeList extends PureComponent {
- state = {
- modalVisible: false,
- modalType: 'add', //add update
- initValues: {},
- };
-
- componentDidMount() {
- const { dispatch, searchParams } = this.props;
- // 查询初始数据
- dispatch({
- type: 'fullPrivilegeList/page',
- payload: {
- ...searchParams,
- ...PaginationHelper.defaultPayload,
- },
- });
- }
-
- handleSortModalVisible = (sortModalVisible, record) => {
- const { dispatch } = this.props;
- dispatch({
- type: 'fullPrivilegeList/setAll',
- payload: {
- sortModalVisible,
- formVals: record || {}
- },
- });
- };
-
- render() {
- const { dispatch,
- list, listLoading, searchParams, pagination,
- categoryTree, formVals, } = this.props;
-
- // 列表属性
- const listProps = {
- dataSource: list,
- pagination,
- searchParams,
- dispatch,
- categoryTree,
- loading: listLoading,
- handleSortModalVisible: this.handleSortModalVisible, // Func
- };
-
- // 搜索表单属性
- const searchFormProps = {
- dispatch,
- categoryTree,
- searchParams,
- };
-
- return (
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default FullPrivilegeList;
diff --git a/admin-web/src/pages/Promotion/FullPrivilegeList.less b/admin-web/src/pages/Promotion/FullPrivilegeList.less
deleted file mode 100644
index ebb45c292..000000000
--- a/admin-web/src/pages/Promotion/FullPrivilegeList.less
+++ /dev/null
@@ -1,15 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.tableList {
- .tableListOperator {
- margin-bottom: 16px;
- button {
- margin-right: 8px;
- }
- }
-}
-
-.tableDelete {
- color: red;
-}
diff --git a/admin-web/src/pages/Promotion/ProductRecommendList.js b/admin-web/src/pages/Promotion/ProductRecommendList.js
deleted file mode 100644
index 8b77d02df..000000000
--- a/admin-web/src/pages/Promotion/ProductRecommendList.js
+++ /dev/null
@@ -1,436 +0,0 @@
-/* eslint-disable */
-
-import React, { PureComponent, Fragment } from 'react';
-import { connect } from 'dva';
-import {
- Card,
- Form,
- Input,
- Button,
- Modal,
- message,
- Table,
- Divider,
- Tree,
- Spin,
- Row,
- Col,
- Select,
- Icon,
- InputNumber
-} from 'antd';
-import { checkTypeWithEnglishAndNumbers } from '../../../helpers/validator'
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-
-import styles from './BannerList.less';
-import moment from "moment";
-import PaginationHelper from "../../../helpers/PaginationHelper";
-
-const FormItem = Form.Item;
-const SelectOption = Select.Option;
-const { TreeNode } = Tree;
-const status = ['未知', '正常', '禁用'];
-const types = ['未知', '新品推荐', '热卖推荐'];
-
-// 列表
-function List ({ dataSource, loading, pagination, searchParams, dispatch,
- handleModalVisible}) {
-
- function handleStatus(record) {
- Modal.confirm({
- title: record.status === 1 ? '确认禁用' : '取消禁用',
- content: `${record.productSpuId}`,
- onOk() {
- dispatch({
- type: 'productRecommendList/updateStatus',
- payload: {
- id: record.id,
- status: record.status === 1 ? 2 : 1,
- },
- });
- },
- onCancel() {},
- });
- }
-
- function handleDelete(record) {
- Modal.confirm({
- title: `确认删除?`,
- content: `${record.productSpuId}`,
- onOk() {
- dispatch({
- type: 'productRecommendList/delete',
- payload: {
- id: record.id,
- },
- });
- },
- onCancel() {},
- });
- }
-
- const columns = [
- {
- title: '推荐类型',
- dataIndex: 'type',
- render(val) {
- return {types[val]}; // TODO 芋艿,此处要改
- },
- },
- {
- title: '商品',
- dataIndex: 'productSpuName',
- },
- {
- title: '排序值',
- dataIndex: 'sort',
- },
- {
- title: '状态',
- dataIndex: 'status',
- render(val) {
- return {status[val]}; // TODO 芋艿,此处要改
- },
- },
- {
- title: '备注',
- dataIndex: 'memo',
- },
- {
- title: '创建时间',
- dataIndex: 'createTime',
- render: val => {moment(val).format('YYYY-MM-DD HH:mm')},
- },
- {
- title: '操作',
- width: 200,
- render: (text, record) => {
- const statusText = record.status === 1 ? '禁用' : '开启'; // TODO 芋艿,此处要改
- return (
-
- handleModalVisible(true, 'update', record)}>编辑
-
- handleStatus(record)}>
- {statusText}
-
- {
- record.status === 2 ?
-
-
- handleDelete(record)}>
- 删除
-
- : null
- }
-
- );
- },
- },
- ];
-
- function onPageChange(page) { // 翻页
- dispatch({
- type: 'productRecommendList/query',
- payload: {
- pageNo: page.current,
- pageSize: page.pageSize,
- ...searchParams
- }
- })
- }
-
- return (
-
- )
-}
-
-// 搜索表单
-// TODO 芋艿,有没办法换成上面那种写法
-const SearchForm = Form.create()(props => {
- const {
- form,
- form: { getFieldDecorator },
- dispatch
- } = props;
-
- function search() {
- dispatch({
- type: 'productRecommendList/query',
- payload: {
- ...PaginationHelper.defaultPayload,
- ...form.getFieldsValue()
- }
- })
- }
-
- // 提交搜索
- function handleSubmit(e) {
- // 阻止默认事件
- e.preventDefault();
- // 提交搜索
- search();
- }
-
- // 重置搜索
- function handleReset() {
- // 重置表单
- form.resetFields();
- // 执行搜索
- search();
- }
-
- return (
-
- );
-});
-
-// 添加 or 修改 Form 表单
-const AddOrUpdateForm = Form.create()(props => {
- const { dispatch, modalVisible, form, handleModalVisible, modalType, formVals,
- searchProductSpuList} = props;
- // let selectedSearchProductSpu = formVals.productSpuId ? {
- // key: formVals.productSpuId,
- // label: formVals.productSpuName,
- // } : {};
-
- const okHandle = () => {
- form.validateFields((err, fields) => {
- if (err) return;
- // 添加表单
- if (modalType === 'add') {
- dispatch({
- type: 'productRecommendList/add',
- payload: {
- body: {
- ...fields,
- },
- callback: () => {
- // 清空表单
- form.resetFields();
- // 提示
- message.success('添加成功');
- // 关闭弹窗
- handleModalVisible();
- },
- },
- });
- // 修改表单
- } else {
- dispatch({
- type: 'productRecommendList/update',
- payload: {
- body: {
- id: formVals.id,
- ...fields,
- },
- callback: () => {
- // 清空表单
- form.resetFields();
- // 提示
- message.success('更新成功');
- // 关闭弹窗
- handleModalVisible();
- },
- },
- });
- }
- });
- };
-
- const searchProductSpu = (value) => {
- if (!value) {
- dispatch({
- type: 'productRecommendList/setAll',
- payload: {
- searchProductSpuList: [],
- },
- });
- return;
- }
- dispatch({
- type: 'productRecommendList/searchProductSpu',
- payload: {
- name: value,
- },
- });
- };
-
- const title = modalType === 'add' ? '新建商品推荐' : '更新商品推荐';
- return (
- handleModalVisible()}
- >
-
- {form.getFieldDecorator('type', {
- rules: [{ required: true, message: '请输入推荐类型!'},
- ],
- initialValue: formVals.type,
- })(
-
- )}
-
-
- {form.getFieldDecorator('productSpuId', {
- rules: [{ required: true, message: '请输入商品!'}, // TODO 芋艿,临时先输入商品编号,后面做成搜索。
- ],
- initialValue: formVals.productSpuId,
- })(
-
- )}
-
-
- {form.getFieldDecorator('sort', {
- rules: [{ required: true, message: '请输入排序值!' }],
- initialValue: formVals.sort,
- })()}
-
-
- {form.getFieldDecorator('memo', {
- rules: [{ required: false, message: '请输入备注!' },
- {max: 255, message: '最大长度为 255 位'},
- ],
- initialValue: formVals.memo,
- })()}
-
-
- );
-});
-
-@connect(({ productRecommendList }) => ({
- // list: productRecommend.list,
- // pagination: productRecommend.pagination,
- ...productRecommendList,
-}))
-
-// 主界面
-@Form.create()
-class BannerList extends PureComponent {
-
- componentDidMount() {
- const { dispatch } = this.props;
- dispatch({
- type: 'productRecommendList/query',
- payload: {
- ...PaginationHelper.defaultPayload
- },
- });
- }
-
- handleModalVisible = (modalVisible, modalType, record) => {
- const { dispatch } = this.props;
- dispatch({
- type: 'productRecommendList/setAll',
- payload: {
- modalVisible,
- modalType,
- formVals: record || {},
- searchProductSpuList: [],
- },
- });
- };
-
- render() {
- // let that = this;
- const { dispatch,
- list, listLoading, searchParams, pagination,
- modalVisible, modalType, formVals, searchProductSpuList,
- confirmLoading, } = this.props;
-
- // 列表属性
- const listProps = {
- dataSource: list,
- pagination,
- searchParams,
- dispatch,
- loading: listLoading,
- confirmLoading,
- handleModalVisible: this.handleModalVisible, // Function
- };
-
- // 搜索表单属性
- const searchFormProps = {
- dispatch,
- };
-
- // 添加 or 更新表单属性
- const addOrUpdateFormProps = {
- modalVisible,
- modalType,
- formVals,
- dispatch,
- searchProductSpuList,
- handleModalVisible: this.handleModalVisible, // Function
- };
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default BannerList;
diff --git a/admin-web/src/pages/Promotion/ProductRecommendList.less b/admin-web/src/pages/Promotion/ProductRecommendList.less
deleted file mode 100644
index 7ad3dac3f..000000000
--- a/admin-web/src/pages/Promotion/ProductRecommendList.less
+++ /dev/null
@@ -1,47 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.tableList {
- .tableListOperator {
- margin-bottom: 16px;
- button {
- margin-right: 8px;
- }
- }
-}
-
-.tableDelete {
- color: red;
-}
-
-.tableListForm {
- :global {
- .ant-form-item {
- display: flex;
- margin-right: 0;
- margin-bottom: 24px;
- > .ant-form-item-label {
- width: auto;
- padding-right: 8px;
- line-height: 32px;
- }
- .ant-form-item-control {
- line-height: 32px;
- }
- }
- .ant-form-item-control-wrapper {
- flex: 1;
- }
- }
- .submitButtons {
- display: block;
- margin-bottom: 24px;
- white-space: nowrap;
- }
-}
-
-@media screen and (max-width: @screen-lg) {
- .tableListForm :global(.ant-form-item) {
- margin-right: 24px;
- }
-}
\ No newline at end of file
diff --git a/admin-web/src/pages/Promotion/TimeLimitedDiscountList.js b/admin-web/src/pages/Promotion/TimeLimitedDiscountList.js
deleted file mode 100644
index 0939327a4..000000000
--- a/admin-web/src/pages/Promotion/TimeLimitedDiscountList.js
+++ /dev/null
@@ -1,290 +0,0 @@
-/* eslint-disable */
-
-import React, { PureComponent, Fragment } from 'react';
-import { connect } from 'dva';
-import moment from 'moment';
-import {
- Card,
- Form,
- Input,
- Row,
- Col,
- Button,
- Modal,
- message,
- Table,
- Divider,
- Tree,
- Tabs,
- TreeSelect,
- Spin,
- InputNumber
-} from 'antd';
-const TabPane = Tabs.TabPane;
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-
-import styles from './TimeLimitedDiscountList.less';
-import PaginationHelper from "../../../helpers/PaginationHelper";
-
-const FormItem = Form.Item;
-
-const statuses = {
- 10: '未开始',
- 20: '进行中',
- 30: '已结束',
- 40: '已撤销',
- 50: '已删除',
-}
-
-// 列表
-function List({ dataSource, loading, pagination, searchParams, dispatch,}) {
-
- const handleTabsChange = (value) => {
- dispatch({
- type: 'timeLimitedDiscountList/page',
- payload: {
- ...searchParams,
- status: value,
- ...PaginationHelper.defaultPayload,
- }
- })
- };
-
- function onPageChange(page) { // 翻页
- dispatch({
- type: 'timeLimitedDiscountList/page',
- payload: {
- pageNo: page.current,
- pageSize: page.pageSize,
- ...searchParams
- }
- })
- }
-
- const columns = [
- // {
- // title: 'id',
- // dataIndex: 'id',
- // render: text => {text},
- // },
- {
- title: '活动名称',
- dataIndex: 'title',
- },
- {
- title: '活动标签', // TODO 芋艿,未来增加
-
- },
- {
- title: '活动时间',
- render: (text, record) => (
-
- {moment(record.startTime).format('YYYY-MM-DD HH:mm:ss')}
- 至
- {moment(record.endTime).format('YYYY-MM-DD HH:mm:ss')}
-
- ),
- },
- {
- title: '状态',
- dataIndex: 'status',
- render: val => statuses[val + ''],
- },
- {
- title: '创建时间',
- dataIndex: 'createTime',
- render: val => {moment(val).format('YYYY-MM-DD')},
- },
- {
- title: '操作',
- width: 300,
- render: (text, record) => (
-
- {/* this.handleModalVisible(true, 'update', record)}>更新*/}
- alert('正在开发中')}>编辑
- {
- record.status === 10 || record.status === 20 ?
-
- alert('正在开发中')}>
- 撤销
-
- : undefined
- }
- {
- record.status !== 50 ?
-
- alert('正在开发中')}>
- 删除
-
- : undefined
- }
-
- ),
- },
- ];
-
- // console.log(pagination);
-
- return (
-
- )
-}
-
-// 搜索表单
-const SearchForm = Form.create()(props => {
- const {
- form,
- form: { getFieldDecorator },
- dispatch,
- searchParams,
- } = props;
-
- function search() {
- dispatch({
- type: 'timeLimitedDiscountList/page',
- payload: {
- ...PaginationHelper.defaultPayload,
- ...searchParams,
- ...form.getFieldsValue(),
- }
- })
- }
-
- // 提交搜索
- function handleSubmit(e) {
- // 阻止默认事件
- e.preventDefault();
- // 提交搜索
- search();
- }
-
- // 重置搜索
- function handleReset() {
- // 重置表单
- form.resetFields();
- // 执行搜索
- search();
- }
-
- return (
-
- );
-});
-
-// timeLimitedDiscountList
-@connect(({ timeLimitedDiscountList }) => ({
- ...timeLimitedDiscountList,
- // list: timeLimitedDiscountList.list.spus,
- // loading: loading.models.timeLimitedDiscountList,
-}))
-
-@Form.create()
-class TimeLimitedDiscountList extends PureComponent {
- state = {
- modalVisible: false,
- modalType: 'add', //add update
- initValues: {},
- };
-
- componentDidMount() {
- const { dispatch, searchParams } = this.props;
- // 查询初始数据
- dispatch({
- type: 'timeLimitedDiscountList/page',
- payload: {
- ...searchParams,
- ...PaginationHelper.defaultPayload,
- },
- });
- }
-
- handleSortModalVisible = (sortModalVisible, record) => {
- const { dispatch } = this.props;
- dispatch({
- type: 'timeLimitedDiscountList/setAll',
- payload: {
- sortModalVisible,
- formVals: record || {}
- },
- });
- };
-
- render() {
- const { dispatch,
- list, listLoading, searchParams, pagination,
- categoryTree, formVals, } = this.props;
-
- // 列表属性
- const listProps = {
- dataSource: list,
- pagination,
- searchParams,
- dispatch,
- categoryTree,
- loading: listLoading,
- handleSortModalVisible: this.handleSortModalVisible, // Func
- };
-
- // 搜索表单属性
- const searchFormProps = {
- dispatch,
- categoryTree,
- searchParams,
- };
-
- return (
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default TimeLimitedDiscountList;
diff --git a/admin-web/src/pages/Promotion/TimeLimitedDiscountList.less b/admin-web/src/pages/Promotion/TimeLimitedDiscountList.less
deleted file mode 100644
index ebb45c292..000000000
--- a/admin-web/src/pages/Promotion/TimeLimitedDiscountList.less
+++ /dev/null
@@ -1,15 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.tableList {
- .tableListOperator {
- margin-bottom: 16px;
- button {
- margin-right: 8px;
- }
- }
-}
-
-.tableDelete {
- color: red;
-}
diff --git a/admin-web/src/pages/Result/Error.js b/admin-web/src/pages/Result/Error.js
deleted file mode 100644
index fba2da6d1..000000000
--- a/admin-web/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 '@/components/Result';
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-
-const extra = (
-
-
-
-
-
-
-
-);
-
-const actions = (
-
-);
-
-export default () => (
-
-
-
-
-
-);
diff --git a/admin-web/src/pages/Result/Success.js b/admin-web/src/pages/Result/Success.js
deleted file mode 100644
index 74d19dc38..000000000
--- a/admin-web/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 '@/components/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/admin-web/src/pages/Result/Success.test.js b/admin-web/src/pages/Result/Success.test.js
deleted file mode 100644
index 9bc9b8dff..000000000
--- a/admin-web/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/admin-web/src/pages/Sms/SignList.js b/admin-web/src/pages/Sms/SignList.js
deleted file mode 100644
index a80441229..000000000
--- a/admin-web/src/pages/Sms/SignList.js
+++ /dev/null
@@ -1,265 +0,0 @@
-import React, { PureComponent } from 'react';
-import { Card, Divider, Table, Modal, Button } from 'antd';
-import { connect } from 'dva';
-
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-import DictionaryText from '../../components/Dictionary/DictionaryText';
-import dictionary from '../../utils/dictionary';
-import styles from '../List/TableList.less';
-import SignListSearch from './SignListSearch';
-import SignListModal from './SignListModal';
-
-@connect(({ smsSignList, loading }) => ({
- smsSignList,
- loading: loading.models.smsSignList,
-}))
-class SignList extends PureComponent {
- state = {
- visible: false,
- title: '添加签名', // 添加签名 修改签名
- type: 'add', // add update
- id: '',
- sign: {},
- };
-
- componentDidMount() {
- // init page 参数
- this.current = 1;
- this.total = 0;
- this.size = 10;
- this.searchParams = {};
-
- // 查询 page
- this.queryPage();
- }
-
- queryPage = () => {
- const { dispatch } = this.props;
- const { current, total, size, searchParams } = this;
-
- dispatch({
- type: 'smsSignList/page',
- payload: {
- pageNo: current,
- total,
- pageSize: size,
- ...searchParams,
- },
- });
- };
-
- handleSearch = searchParams => {
- this.searchParams = searchParams;
- this.queryPage();
- };
-
- handleAddShow = () => {
- this.setState({
- visible: true,
- type: 'add',
- title: '添加签名',
- sign: {},
- });
- };
-
- handleUpdateShow = sign => {
- const { id } = sign;
- this.setState({
- visible: true,
- type: 'update',
- title: '更新签名',
- id,
- sign,
- });
- };
-
- handleDeleted = ({ id, sign }) => {
- const { dispatch } = this.props;
- Modal.confirm({
- title: `提示消息`,
- content: `确认删除 ${sign} 签名吗`,
- okText: '确认',
- cancelText: '取消',
- onOk: () => {
- dispatch({
- type: 'smsSignList/deleted',
- payload: {
- params: {
- id,
- },
- callback: () => {
- this.queryPage();
- },
- },
- });
- },
- onCancel() {
- console.log('Cancel');
- },
- });
- };
-
- handleCancel = () => {
- this.setState({
- visible: false,
- });
- };
-
- handleOk = fields => {
- const { dispatch } = this.props;
- const { type, id } = this.state;
-
- if (type === 'add') {
- dispatch({
- type: 'smsSignList/add',
- payload: {
- params: {
- ...fields,
- },
- callback: () => {
- this.handleCancel();
- this.queryPage();
- },
- },
- });
- } else if (type === 'update') {
- dispatch({
- type: 'smsSignList/update',
- payload: {
- params: {
- id,
- ...fields,
- },
- callback: () => {
- this.handleCancel();
- this.queryPage();
- },
- },
- });
- }
- };
-
- handleTableChange = pagination => {
- const { pageSize, current } = pagination;
- this.size = pageSize;
- this.current = current;
- this.queryPage();
- };
-
- render() {
- // props
- const { loading, smsSignList } = this.props;
- const { list, total, index, size } = smsSignList;
- const { visible, title, type, sign } = this.state;
-
- const columns = [
- {
- title: 'ID',
- dataIndex: 'id',
- key: 'id',
- },
- {
- title: '签名',
- dataIndex: 'sign',
- key: 'sign',
- },
- {
- title: '短信平台',
- dataIndex: 'platform',
- key: 'platform',
- render(platform) {
- return (
-
-
-
- );
- },
- },
- {
- title: '审核状态',
- dataIndex: 'applyStatus',
- key: 'applyStatus',
- render(applyStatus) {
- return (
-
-
-
- );
- },
- },
- {
- title: '更新时间',
- dataIndex: 'updateTime',
- key: 'updateTime',
- width: 200,
- render(updateTime) {
- return {updateTime}
;
- },
- },
- {
- title: '创建时间',
- dataIndex: 'createTime',
- key: 'createTime',
- width: 200,
- render(createTime) {
- return {createTime}
;
- },
- },
- {
- title: '操作',
- render: row => {
- return (
-
- );
- },
- },
- ];
-
- const pagination = {
- total,
- index,
- pageSize: size,
- };
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default SignList;
diff --git a/admin-web/src/pages/Sms/SignList.less b/admin-web/src/pages/Sms/SignList.less
deleted file mode 100644
index 027d7295e..000000000
--- a/admin-web/src/pages/Sms/SignList.less
+++ /dev/null
@@ -1,2 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
diff --git a/admin-web/src/pages/Sms/SignListModal.js b/admin-web/src/pages/Sms/SignListModal.js
deleted file mode 100644
index 6cbd7bc6b..000000000
--- a/admin-web/src/pages/Sms/SignListModal.js
+++ /dev/null
@@ -1,68 +0,0 @@
-import React from 'react';
-import { Form, Input, Modal } from 'antd';
-import DictionarySelect from '../../components/Dictionary/DictionarySelect';
-import dictionary from '../../utils/dictionary';
-
-/**
- * table 查询
- *
- * @type {React.ComponentClass>}
- */
-const SignListModal = Form.create()(props => {
- const { onOk, onCancel, visible, title, form, initData = {} } = props;
- const { getFieldDecorator, validateFields } = props.form;
-
- function handleOk(e) {
- e.preventDefault();
-
- validateFields((err, fields) => {
- const searchParams = fields;
- if (onOk) {
- onOk(searchParams);
- form.resetFields();
- }
- });
- }
-
- function handleCancel() {
- if (onCancel) {
- onCancel();
- }
- }
-
- const formItemLayout = {
- labelCol: { span: 4 },
- wrapperCol: { span: 18 },
- };
-
- return (
-
-
- {getFieldDecorator('sign', {
- rules: [
- {
- required: true,
- message: '请输入签名',
- },
- ],
- initialValue: initData.sign,
- })()}
-
-
- {getFieldDecorator('platform', {
- rules: [
- {
- required: true,
- message: '请选择平台',
- },
- ],
- initialValue: initData.platform,
- })()}
-
-
-
- );
-});
-
-export default SignListModal;
diff --git a/admin-web/src/pages/Sms/SignListSearch.js b/admin-web/src/pages/Sms/SignListSearch.js
deleted file mode 100644
index cbbc4b805..000000000
--- a/admin-web/src/pages/Sms/SignListSearch.js
+++ /dev/null
@@ -1,61 +0,0 @@
-import React from 'react';
-import { Button, Col, Form, Input, Row } from 'antd';
-
-const FormItem = Form.Item;
-
-/**
- * table 查询
- *
- * @type {React.ComponentClass>}
- */
-const SignListSearch = Form.create()(props => {
- const { handleSearch } = props;
- const { getFieldDecorator, validateFields, form } = props.form;
-
- function onSubmit(e) {
- e.preventDefault();
-
- validateFields((err, fields) => {
- const searchParams = fields;
- if (handleSearch) {
- handleSearch(searchParams);
- }
- });
- }
-
- function handleFormReset() {
- form.resetFields();
- }
-
- return (
-
- );
-});
-
-export default SignListSearch;
diff --git a/admin-web/src/pages/Sms/TemplateList.js b/admin-web/src/pages/Sms/TemplateList.js
deleted file mode 100644
index c18ab2b5a..000000000
--- a/admin-web/src/pages/Sms/TemplateList.js
+++ /dev/null
@@ -1,292 +0,0 @@
-import React, { PureComponent } from 'react';
-import { Card, Divider, Table, Modal, Button } from 'antd';
-import { connect } from 'dva';
-
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-import DictionaryText from '../../components/Dictionary/DictionaryText';
-import dictionary from '../../utils/dictionary';
-import styles from '../List/TableList.less';
-import TemplateListSearch from './TemplateListSearch';
-import TemplateListModal from './TemplateListModal';
-
-@connect(({ smsSignList, smsTemplateList, loading }) => ({
- smsSignList,
- smsTemplateList,
- loading: loading.models.smsTemplateList,
-}))
-class TemplateList extends PureComponent {
- state = {
- visible: false,
- title: '添加模板', // 添加签名 修改签名
- type: 'add', // add update
- id: '',
- template: {},
- };
-
- componentDidMount() {
- // init page 参数
- this.current = 1;
- this.total = 0;
- this.size = 10;
- this.searchParams = {};
-
- // 查询 page
- this.queryPage();
-
- // 查询 sign 用于 signList
- this.querySignList();
- }
-
- querySignList = () => {
- const { dispatch } = this.props;
- dispatch({
- type: 'smsSignList/page',
- payload: {
- pageNo: 1,
- total: 0,
- pageSize: 100,
- // ...searchParams,
- },
- });
- };
-
- queryPage = () => {
- const { dispatch } = this.props;
- const { current, total, size, searchParams } = this;
-
- dispatch({
- type: 'smsTemplateList/page',
- payload: {
- pageNo: current,
- total,
- pageSize: size,
- ...searchParams,
- },
- });
- };
-
- handleSearch = searchParams => {
- this.searchParams = searchParams;
- this.queryPage();
- };
-
- handleAddShow = () => {
- this.setState({
- visible: true,
- type: 'add',
- title: '添加模板',
- template: {},
- });
- };
-
- handleUpdateShow = template => {
- const { id } = template;
- this.setState({
- visible: true,
- type: 'update',
- title: '更新模板',
- id,
- template,
- });
- };
-
- handleDeleted = ({ id, template }) => {
- const { dispatch } = this.props;
- Modal.confirm({
- title: `提示消息`,
- content: `确认删除 ${template} 签名吗`,
- okText: '确认',
- cancelText: '取消',
- onOk: () => {
- dispatch({
- type: 'smsTemplateList/deleted',
- payload: {
- params: {
- id,
- },
- callback: () => {
- this.queryPage();
- },
- },
- });
- },
- onCancel() {
- console.log('Cancel');
- },
- });
- };
-
- handleCancel = () => {
- this.setState({
- visible: false,
- });
- };
-
- handleOk = fields => {
- const { dispatch } = this.props;
- const { type, id } = this.state;
-
- if (type === 'add') {
- dispatch({
- type: 'smsTemplateList/add',
- payload: {
- params: {
- ...fields,
- },
- callback: () => {
- this.handleCancel();
- this.queryPage();
- },
- },
- });
- } else if (type === 'update') {
- dispatch({
- type: 'smsTemplateList/update',
- payload: {
- params: {
- id,
- ...fields,
- },
- callback: () => {
- this.handleCancel();
- this.queryPage();
- },
- },
- });
- }
- };
-
- handleTableChange = pagination => {
- const { pageSize, current } = pagination;
- this.size = pageSize;
- this.current = current;
- this.queryPage();
- };
-
- render() {
- // props
- const { loading, smsTemplateList, smsSignList } = this.props;
- const { list, total, index, size } = smsTemplateList;
- const { visible, title, type, template } = this.state;
-
- const columns = [
- {
- title: 'ID',
- dataIndex: 'id',
- key: 'id',
- },
- {
- title: '签名',
- dataIndex: 'sign',
- key: 'sign',
- // eslint-disable-next-line no-shadow
- render({ sign }) {
- return {sign}
;
- },
- },
- {
- title: '模板',
- dataIndex: 'template',
- key: 'template',
- },
- {
- title: '短信平台',
- dataIndex: 'platform',
- key: 'platform',
- render(platform) {
- return (
-
-
-
- );
- },
- },
- {
- title: '审核状态',
- dataIndex: 'applyStatus',
- key: 'applyStatus',
- render(applyStatus) {
- return (
-
-
-
- );
- },
- },
- {
- title: '更新时间',
- dataIndex: 'updateTime',
- key: 'updateTime',
- width: 200,
- render(updateTime) {
- return {updateTime}
;
- },
- },
- {
- title: '创建时间',
- dataIndex: 'createTime',
- key: 'createTime',
- width: 200,
- render(createTime) {
- return {createTime}
;
- },
- },
- {
- title: '操作',
- render: row => {
- return (
-
- );
- },
- },
- ];
-
- const pagination = {
- total,
- index,
- pageSize: size,
- };
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default TemplateList;
diff --git a/admin-web/src/pages/Sms/TemplateList.less b/admin-web/src/pages/Sms/TemplateList.less
deleted file mode 100644
index 027d7295e..000000000
--- a/admin-web/src/pages/Sms/TemplateList.less
+++ /dev/null
@@ -1,2 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
diff --git a/admin-web/src/pages/Sms/TemplateListModal.js b/admin-web/src/pages/Sms/TemplateListModal.js
deleted file mode 100644
index e12d10fe4..000000000
--- a/admin-web/src/pages/Sms/TemplateListModal.js
+++ /dev/null
@@ -1,109 +0,0 @@
-import React from 'react';
-import { Form, Input, Modal, Select } from 'antd';
-import DictionarySelect from '../../components/Dictionary/DictionarySelect';
-import dictionary from '../../utils/dictionary';
-
-/**
- * table 查询
- *
- * @type {React.ComponentClass>}
- */
-const SignListModal = Form.create()(props => {
- const { onOk, onCancel, visible, title, form, signList, initData = {} } = props;
- const { getFieldDecorator, validateFields } = props.form;
-
- function handleOk(e) {
- e.preventDefault();
-
- validateFields((err, fields) => {
- const searchParams = fields;
- if (onOk) {
- onOk(searchParams);
- form.resetFields();
- }
- });
- }
-
- function handleCancel() {
- if (onCancel) {
- onCancel();
- }
- }
-
- const formItemLayout = {
- labelCol: { span: 4 },
- wrapperCol: { span: 18 },
- };
-
- return (
-
-
- {getFieldDecorator('smsSignId', {
- rules: [
- {
- required: true,
- message: '请输入签名',
- },
- ],
- initialValue: initData.sign ? initData.sign.id : null,
- })(
-
- )}
-
-
- {getFieldDecorator('smsType', {
- rules: [
- {
- required: true,
- message: '请选择短信类型',
- },
- ],
- initialValue: initData.smsType,
- })()}
-
-
- {getFieldDecorator('platform', {
- rules: [
- {
- required: true,
- message: '请选择平台',
- },
- ],
- initialValue: initData.platform,
- })()}
-
-
- {getFieldDecorator('templateCode', {
- rules: [
- {
- required: true,
- message: '短信平台的Code',
- },
- ],
- initialValue: initData.templateCode,
- })()}
-
-
- {getFieldDecorator('template', {
- rules: [
- {
- required: true,
- message: '请输入短信模板',
- },
- ],
- initialValue: initData.template,
- })()}
-
-
-
- );
-});
-
-export default SignListModal;
diff --git a/admin-web/src/pages/Sms/TemplateListSearch.js b/admin-web/src/pages/Sms/TemplateListSearch.js
deleted file mode 100644
index 6fc984d8f..000000000
--- a/admin-web/src/pages/Sms/TemplateListSearch.js
+++ /dev/null
@@ -1,69 +0,0 @@
-import React from 'react';
-import { Button, Col, Form, Input, Row, Select } from 'antd';
-
-const FormItem = Form.Item;
-
-/**
- * table 查询
- *
- * @type {React.ComponentClass>}
- */
-const SignListSearch = Form.create()(props => {
- const { handleSearch, signList } = props;
- const { getFieldDecorator, validateFields, form } = props.form;
-
- function onSubmit(e) {
- e.preventDefault();
-
- validateFields((err, fields) => {
- const searchParams = fields;
- if (handleSearch) {
- handleSearch(searchParams);
- }
- });
- }
-
- function handleFormReset() {
- form.resetFields();
- }
-
- return (
-
- );
-});
-
-export default SignListSearch;
diff --git a/admin-web/src/pages/User/Login.js b/admin-web/src/pages/User/Login.js
deleted file mode 100644
index bb734a7c9..000000000
--- a/admin-web/src/pages/User/Login.js
+++ /dev/null
@@ -1,156 +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 '@/components/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(['username'], {}, (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' }))}
-
- {
- e.preventDefault();
- 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/admin-web/src/pages/User/Login.less b/admin-web/src/pages/User/Login.less
deleted file mode 100644
index 341929421..000000000
--- a/admin-web/src/pages/User/Login.less
+++ /dev/null
@@ -1,32 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.main {
- width: 388px;
- margin: 0 auto;
- @media screen and (max-width: @screen-sm) {
- width: 95%;
- }
-
- .icon {
- margin-left: 16px;
- color: rgba(0, 0, 0, 0.2);
- font-size: 24px;
- vertical-align: middle;
- cursor: pointer;
- transition: color 0.3s;
-
- &:hover {
- color: @primary-color;
- }
- }
-
- .other {
- margin-top: 24px;
- line-height: 22px;
- text-align: left;
-
- .register {
- float: right;
- }
- }
-}
diff --git a/admin-web/src/pages/User/Register.js b/admin-web/src/pages/User/Register.js
deleted file mode 100644
index a1fe10b6f..000000000
--- a/admin-web/src/pages/User/Register.js
+++ /dev/null
@@ -1,169 +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 } from 'antd';
-import styles from './Register.less';
-
-const FormItem = Form.Item;
-const { Option } = Select;
-const InputGroup = Input.Group;
-
-@connect(({ register, loading }) => ({
- register,
- submitting: loading.effects['register/submit'],
-}))
-@Form.create()
-class Register extends Component {
- state = {
- count: 0,
- 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);
- };
-
- handleSubmit = e => {
- e.preventDefault();
- const { form, dispatch } = this.props;
- form.validateFields({ force: true }, (err, values) => {
- if (!err) {
- const { prefix } = this.state;
- console.log('123', values);
- dispatch({
- type: 'register/submit',
- payload: {
- ...values,
- prefix,
- },
- });
- }
- });
- };
-
- changePrefix = value => {
- this.setState({
- prefix: value,
- });
- };
-
- render() {
- const { form, submitting } = this.props;
- const { getFieldDecorator } = form;
- const { count, prefix } = this.state;
- return (
-
-
-
-
-
-
- );
- }
-}
-
-export default Register;
diff --git a/admin-web/src/pages/User/Register.less b/admin-web/src/pages/User/Register.less
deleted file mode 100644
index c7e225290..000000000
--- a/admin-web/src/pages/User/Register.less
+++ /dev/null
@@ -1,57 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-
-.main {
- width: 388px;
- margin: 0 auto;
-
- :global {
- .ant-form-item {
- margin-bottom: 24px;
- }
- }
-
- h3 {
- margin-bottom: 20px;
- font-size: 16px;
- }
-
- .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/admin-web/src/pages/User/RegisterResult.js b/admin-web/src/pages/User/RegisterResult.js
deleted file mode 100644
index 6e338b277..000000000
--- a/admin-web/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 '@/components/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/admin-web/src/pages/User/RegisterResult.less b/admin-web/src/pages/User/RegisterResult.less
deleted file mode 100644
index a969a5eee..000000000
--- a/admin-web/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/admin-web/src/pages/User/UserList.js b/admin-web/src/pages/User/UserList.js
deleted file mode 100644
index 4330579e3..000000000
--- a/admin-web/src/pages/User/UserList.js
+++ /dev/null
@@ -1,266 +0,0 @@
-/* eslint-disable */
-
-import React, { PureComponent, Fragment } from 'react';
-import { connect } from 'dva';
-import moment from 'moment';
-import {
- Card,
- Form,
- Input,
- Row,
- Col,
- Button,
- Modal,
- message,
- Table,
- Divider,
- Tree,
- Tabs,
- TreeSelect,
- Spin,
- InputNumber, Select
-} from 'antd';
-const TabPane = Tabs.TabPane;
-import PageHeaderWrapper from '@/components/PageHeaderWrapper';
-
-import styles from './UserList.less';
-import PaginationHelper from "../../../helpers/PaginationHelper";
-
-const FormItem = Form.Item;
-
-const statuses = {
- 1: '开启',
- 2: '关闭',
-};
-
-// 列表
-function List({ dataSource, loading, pagination, searchParams, dispatch,}) {
-
- function onPageChange(page) { // 翻页
- dispatch({
- type: 'userList/page',
- payload: {
- pageNo: page.current,
- pageSize: page.pageSize,
- ...searchParams
- }
- })
- }
-
- const columns = [
- // {
- // title: 'id',
- // dataIndex: 'id',
- // render: text => {text},
- // },
- {
- title: '昵称',
- dataIndex: 'nickname',
- },
- {
- title: '手机号码',
- dataIndex: 'mobile',
- },
- {
- title: '会员卡', // TODO 芋艿,未来增加
- },
- {
- title: '累积交易次数', // TODO 芋艿,未来增加
- },
- {
- title: '累计交易额', // TODO 芋艿,未来增加
- },
- {
- title: '积分', // TODO 芋艿,未来增加
- },
- {
- title: '会员标签', // TODO 芋艿,未来增加
- },
- {
- title: '备注', // TODO 芋艿,未来增加
- },
- {
- title: '状态',
- dataIndex: 'status',
- render: val => statuses[val + ''],
- },
- {
- title: '操作',
- width: 300,
- render: (text, record) => (
-
- {/* this.handleModalVisible(true, 'update', record)}>更新*/}
- alert('正在开发中')}>编辑
-
- ),
- },
- ];
-
- // console.log(pagination);
-
- return (
-
- )
-}
-
-// 搜索表单
-const SearchForm = Form.create()(props => {
- const {
- form,
- form: { getFieldDecorator },
- dispatch,
- searchParams,
- } = props;
-
- function search() {
- dispatch({
- type: 'userList/page',
- payload: {
- ...PaginationHelper.defaultPayload,
- ...searchParams,
- ...form.getFieldsValue(),
- }
- })
- }
-
- // 提交搜索
- function handleSubmit(e) {
- // 阻止默认事件
- e.preventDefault();
- // 提交搜索
- search();
- }
-
- // 重置搜索
- function handleReset() {
- // 重置表单
- form.resetFields();
- // 执行搜索
- search();
- }
-
- return (
-
- );
-});
-
-// userList
-@connect(({ userList }) => ({
- ...userList,
- // list: userList.list.spus,
- // loading: loading.models.userList,
-}))
-
-@Form.create()
-class UserList extends PureComponent {
- state = {
- modalVisible: false,
- modalType: 'add', //add update
- initValues: {},
- };
-
- componentDidMount() {
- const { dispatch, searchParams } = this.props;
- // 查询初始数据
- dispatch({
- type: 'userList/page',
- payload: {
- ...searchParams,
- ...PaginationHelper.defaultPayload,
- },
- });
- }
-
- handleSortModalVisible = (sortModalVisible, record) => {
- const { dispatch } = this.props;
- dispatch({
- type: 'userList/setAll',
- payload: {
- sortModalVisible,
- formVals: record || {}
- },
- });
- };
-
- render() {
- const { dispatch,
- list, listLoading, searchParams, pagination,
- categoryTree, formVals, } = this.props;
-
- // 列表属性
- const listProps = {
- dataSource: list,
- pagination,
- searchParams,
- dispatch,
- categoryTree,
- loading: listLoading,
- handleSortModalVisible: this.handleSortModalVisible, // Func
- };
-
- // 搜索表单属性
- const searchFormProps = {
- dispatch,
- categoryTree,
- searchParams,
- };
-
- return (
-
-
-
-
- {/**/}
-
-
-
-
-
-
- );
- }
-}
-
-export default UserList;
diff --git a/admin-web/src/pages/User/UserList.less b/admin-web/src/pages/User/UserList.less
deleted file mode 100644
index ebb45c292..000000000
--- a/admin-web/src/pages/User/UserList.less
+++ /dev/null
@@ -1,15 +0,0 @@
-@import '~antd/lib/style/themes/default.less';
-@import '~@/utils/utils.less';
-
-.tableList {
- .tableListOperator {
- margin-bottom: 16px;
- button {
- margin-right: 8px;
- }
- }
-}
-
-.tableDelete {
- color: red;
-}
diff --git a/admin-web/src/pages/User/models/register.js b/admin-web/src/pages/User/models/register.js
deleted file mode 100644
index e3e307ec8..000000000
--- a/admin-web/src/pages/User/models/register.js
+++ /dev/null
@@ -1,33 +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 }) {
- console.error(1);
- 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/admin-web/src/pages/document.ejs b/admin-web/src/pages/document.ejs
deleted file mode 100644
index d0d8610c5..000000000
--- a/admin-web/src/pages/document.ejs
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
- 一个商城管理平台
-
-
-
-
-
-
-
diff --git a/admin-web/src/service-worker.js b/admin-web/src/service-worker.js
deleted file mode 100644
index 48d43c254..000000000
--- a/admin-web/src/service-worker.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/* globals workbox */
-/* eslint-disable no-restricted-globals */
-workbox.core.setCacheNameDetails({
- prefix: 'antd-pro',
- suffix: 'v1',
-});
-// Control all opened tabs ASAP
-workbox.clientsClaim();
-
-/**
- * Use precaching list generated by workbox in build process.
- * https://developers.google.com/web/tools/workbox/reference-docs/latest/workbox.precaching
- */
-/* eslint-disable no-underscore-dangle */
-workbox.precaching.precacheAndRoute(self.__precacheManifest || []);
-
-/**
- * Register a navigation route.
- * https://developers.google.com/web/tools/workbox/modules/workbox-routing#how_to_register_a_navigation_route
- */
-workbox.routing.registerNavigationRoute('/index.html');
-
-/**
- * Use runtime cache:
- * https://developers.google.com/web/tools/workbox/reference-docs/latest/workbox.routing#.registerRoute
- *
- * Workbox provides all common caching strategies including CacheFirst, NetworkFirst etc.
- * https://developers.google.com/web/tools/workbox/reference-docs/latest/workbox.strategies
- */
-
-/**
- * Handle API requests
- */
-workbox.routing.registerRoute(/\/api\//, workbox.strategies.networkFirst());
-
-/**
- * Handle third party requests
- */
-workbox.routing.registerRoute(
- /^https:\/\/gw.alipayobjects.com\//,
- workbox.strategies.networkFirst()
-);
-workbox.routing.registerRoute(
- /^https:\/\/cdnjs.cloudflare.com\//,
- workbox.strategies.networkFirst()
-);
-workbox.routing.registerRoute(/\/color.less/, workbox.strategies.networkFirst());
-
-/**
- * Response to client after skipping waiting with MessageChannel
- */
-addEventListener('message', event => {
- const replyPort = event.ports[0];
- const message = event.data;
- if (replyPort && message && message.type === 'skip-waiting') {
- event.waitUntil(
- self
- .skipWaiting()
- .then(
- () => replyPort.postMessage({ error: null }),
- error => replyPort.postMessage({ error })
- )
- );
- }
-});
diff --git a/admin-web/src/services/admin.js b/admin-web/src/services/admin.js
deleted file mode 100644
index 7bac2a5c0..000000000
--- a/admin-web/src/services/admin.js
+++ /dev/null
@@ -1,134 +0,0 @@
-import { stringify } from '@/utils/request.qs';
-import request from '@/utils/request';
-
-// admin
-
-export async function addAdmin(params) {
- return request(`/admin-api/admins/admin/add?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-export async function updateAdmin(params) {
- return request(`/admin-api/admins/admin/update?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-export async function updateAdminStatus(params) {
- return request(`/admin-api/admins/admin/update_status?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-export async function deleteAdmin(params) {
- return request(`/admin-api/admins/admin/delete?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-export async function queryAdminRoleList(params) {
- return request(`/admin-api/admins/admin/role_list?${stringify(params)}`, {
- method: 'GET',
- });
-}
-
-export async function adminRoleAssign(params) {
- return request(`/admin-api/admins/admin/assign_role?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-// deptment
-export async function addDeptment(params) {
- return request('/admin-api/admins/dept/add', {
- method: 'POST',
- body: {
- ...params,
- },
- });
-}
-
-export async function updateDeptment(params) {
- return request('/admin-api/admins/dept/update', {
- method: 'POST',
- body: {
- ...params,
- },
- });
-}
-
-export async function deleteDeptment(params) {
- return request(`/admin-api/admins/dept/delete?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-export async function deptTreePage(params) {
- return request(`/admin-api/admins/dept/tree/page?${stringify(params)}`, {
- method: 'GET',
- });
-}
-
-export async function deptTreeAll() {
- return request('/admin-api/admins/dept/tree/all', {
- method: 'GET',
- });
-}
-
-
-// role
-
-
-
-
-
-
-
-// dictionary
-
-export async function dictionaryTree(params) {
- return request(`/admin-api/admins/data_dict/tree?${stringify(params)}`, {
- method: 'GET',
- });
-}
-
-export async function dictionaryList(params) {
- return request(`/admin-api/admins/data_dict/list?${stringify(params)}`, {
- method: 'GET',
- });
-}
-
-export async function dictionaryAdd(params) {
- return request(`/admin-api/admins/data_dict/add?${stringify(params)}`, {
- method: 'POST',
- body: {},
- });
-}
-
-export async function dictionaryUpdate(params) {
- return request(`/admin-api/admins/data_dict/update?${stringify(params)}`, {
- method: 'POST',
- body: {},
- });
-}
-
-export async function dictionaryDelete(params) {
- return request(`/admin-api/admins/data_dict/delete?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-// file
-
-export async function fileGetQiniuToken() {
- return request(`/admin-api/admins/file/get-qiniu-token`, {
- method: 'GET',
- });
-}
-
-// export async function fileUploadQiniu(fileData) {
-// return request(`/qiniu/upload`, {
-// method: 'POST',
-// });
-// }
diff --git a/admin-web/src/services/api.js b/admin-web/src/services/api.js
deleted file mode 100644
index 379e94c9f..000000000
--- a/admin-web/src/services/api.js
+++ /dev/null
@@ -1,126 +0,0 @@
-import { stringify } from '@/utils/request.qs';
-import request from '@/utils/request';
-
-export async function queryProjectNotice() {
- return request('/api/project/notice');
-}
-
-export async function queryActivities() {
- return request('/api/activities');
-}
-
-export async function queryRule(params) {
- return request(`/api/rule?${stringify(params)}`);
-}
-
-export async function removeRule(params) {
- return request('/api/rule', {
- method: 'POST',
- body: {
- ...params,
- method: 'delete',
- },
- });
-}
-
-export async function addRule(params) {
- return request('/api/rule', {
- method: 'POST',
- body: {
- ...params,
- method: 'post',
- },
- });
-}
-
-export async function updateRule(params = {}) {
- return request(`/api/rule?${stringify(params.query)}`, {
- method: 'POST',
- body: {
- ...params.body,
- method: 'update',
- },
- });
-}
-
-export async function fakeSubmitForm(params) {
- return request('/api/forms', {
- method: 'POST',
- body: params,
- });
-}
-
-export async function fakeChartData() {
- return request('/api/fake_chart_data');
-}
-
-export async function queryTags() {
- return request('/api/tags');
-}
-
-export async function queryBasicProfile(id) {
- return request(`/api/profile/basic?id=${id}`);
-}
-
-export async function queryAdvancedProfile() {
- return request('/api/profile/advanced');
-}
-
-export async function queryFakeList(params) {
- return request(`/api/fake_list?${stringify(params)}`);
-}
-
-export async function removeFakeList(params) {
- const { count = 5, ...restParams } = params;
- return request(`/api/fake_list?count=${count}`, {
- method: 'POST',
- body: {
- ...restParams,
- method: 'delete',
- },
- });
-}
-
-export async function addFakeList(params) {
- const { count = 5, ...restParams } = params;
- return request(`/api/fake_list?count=${count}`, {
- method: 'POST',
- body: {
- ...restParams,
- method: 'post',
- },
- });
-}
-
-export async function updateFakeList(params) {
- const { count = 5, ...restParams } = params;
- return request(`/api/fake_list?count=${count}`, {
- method: 'POST',
- body: {
- ...restParams,
- method: 'update',
- },
- });
-}
-
-export async function fakeAccountLogin(params) {
- return request(`/admin-api/admins/passport/login?${stringify(params)}`, {
- method: 'POST',
- body: params,
- });
-}
-
-export async function fakeRegister(params) {
- return request(`/admin-api/admins/passport/login?${stringify(params)}`, {
- method: 'POST',
- body: params,
- });
-}
-
-export async function queryNotices(params = {}) {
- return request(`/api/notices?${stringify(params)}`);
-}
-
-export async function getFakeCaptcha(mobile) {
- return request(`/api/captcha?mobile=${mobile}`);
-}
diff --git a/admin-web/src/services/error.js b/admin-web/src/services/error.js
deleted file mode 100644
index 13f2e942c..000000000
--- a/admin-web/src/services/error.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import request from '@/utils/request';
-
-export default async function queryError(code) {
- return request(`/api/${code}`);
-}
diff --git a/admin-web/src/services/geographic.js b/admin-web/src/services/geographic.js
deleted file mode 100644
index a5defd87b..000000000
--- a/admin-web/src/services/geographic.js
+++ /dev/null
@@ -1,9 +0,0 @@
-import request from '@/utils/request';
-
-export async function queryProvince() {
- return request('/api/geographic/province');
-}
-
-export async function queryCity(province) {
- return request(`/api/geographic/city/${province}`);
-}
diff --git a/admin-web/src/services/order.js b/admin-web/src/services/order.js
deleted file mode 100644
index 20dcde79f..000000000
--- a/admin-web/src/services/order.js
+++ /dev/null
@@ -1,66 +0,0 @@
-import { stringify } from '@/utils/request.qs';
-import request from '@/utils/request';
-
-// order
-export async function orderPage(params) {
- return request(`/order-api/admins/order/page?${stringify(params)}`, {
- method: 'GET',
- });
-}
-
-export async function orderItems(params) {
- return request(`/order-api/admins/order/order_items?${stringify(params)}`, {
- method: 'GET',
- });
-}
-
-export async function getOrderRecipientInfo(params) {
- return request(`/order-api/admins/order/order_recipient_info?${stringify(params)}`, {
- method: 'GET',
- });
-}
-
-export async function orderDeliver(params) {
- return request(`/order-api/admins/order/order_deliver`, {
- method: 'POST',
- body: {
- ...params,
- },
- });
-}
-
-export async function updateOrderItemPayAmount(params) {
- return request(`/order-api/admins/order/order_item/update_pay_amount?${stringify(params)}`, {
- method: 'PUT',
- });
-}
-
-export async function updateRemark(params) {
- return request(`/order-api/admins/order/update_remark?${stringify(params)}`, {
- method: 'PUT',
- });
-}
-
-export async function cancelOrder(params) {
- return request(`/order-api/admins/order/cancel_order?${stringify(params)}`, {
- method: 'PUT',
- });
-}
-
-export async function updateOrderItem(params) {
- return request(`/order-api/admins/order_item/update?${stringify(params)}`, {
- method: 'PUT',
- body: {
- ...params,
- },
- });
-}
-
-export async function getLogistics(params) {
- return request(`/order-api/admins/order_item/update?${stringify(params)}`, {
- method: 'PUT',
- body: {
- ...params,
- },
- });
-}
diff --git a/admin-web/src/services/orderRefunds.js b/admin-web/src/services/orderRefunds.js
deleted file mode 100644
index 94eb68b40..000000000
--- a/admin-web/src/services/orderRefunds.js
+++ /dev/null
@@ -1,33 +0,0 @@
-import { stringify } from '@/utils/request.qs';
-import request from '@/utils/request';
-
-// order
-export async function list(params) {
- return request(`/order-api/admins/order_return/list?${stringify(params)}`, {
- method: 'GET',
- });
-}
-
-export async function agree(params) {
- return request(`/order-api/admins/order_return/agree?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-export async function refuse(params) {
- return request(`/order-api/admins/order_return/refuse?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-export async function confirmReceipt(params) {
- return request(`/order-api/admins/order_return/confirm_receipt?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-export async function confirmRefund(params) {
- return request(`/order-api/admins/order_return/confirm_refund?${stringify(params)}`, {
- method: 'POST',
- });
-}
diff --git a/admin-web/src/services/pay.js b/admin-web/src/services/pay.js
deleted file mode 100644
index cb99c499c..000000000
--- a/admin-web/src/services/pay.js
+++ /dev/null
@@ -1,18 +0,0 @@
-import { stringify } from '@/utils/request.qs';
-import request from '@/utils/request';
-
-// Transaction
-
-export async function queryPayTransactionPage(params) {
- return request(`/pay-api/admins/transaction/page?${stringify(params)}`, {
- method: 'GET',
- });
-}
-
-// Refund
-
-export async function queryPayRefundPage(params) {
- return request(`/pay-api/admins/refund/page?${stringify(params)}`, {
- method: 'GET',
- });
-}
diff --git a/admin-web/src/services/product.js b/admin-web/src/services/product.js
deleted file mode 100644
index 2236d74fc..000000000
--- a/admin-web/src/services/product.js
+++ /dev/null
@@ -1,168 +0,0 @@
-import { stringify } from '@/utils/request.qs';
-import request from '@/utils/request';
-
-// product category
-
-export async function productCategoryTree(params) {
- return request(`/product-api/admins/category/tree?${stringify(params)}`, {
- method: 'GET',
- });
-}
-
-export async function productCategoryAdd(params) {
- return request(`/product-api/admins/category/add?${stringify(params)}`, {
- method: 'POST',
- body: {},
- });
-}
-
-export async function productCategoryUpdate(params) {
- return request(`/product-api/admins/category/update?${stringify(params)}`, {
- method: 'POST',
- body: {},
- });
-}
-
-export async function productCategoryUpdateStatus(params) {
- return request(`/product-api/admins/category/update_status?${stringify(params)}`, {
- method: 'POST',
- body: {},
- });
-}
-
-export async function productCategoryDelete(params) {
- return request(`/product-api/admins/category/delete?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-// product spu + sku
-
-export async function productSpuPage(params) {
- return request(`/product-api/admins/spu/page?${stringify(params)}`, {
- method: 'GET',
- });
-}
-
-export async function productSpuSearchList(params) {
- return request(`/product-api/admins/spu/search_list?${stringify(params)}`, {
- method: 'GET',
- });
-}
-
-export async function productSpuList(params) {
- return request(`/product-api/admins/spu/list?${stringify(params)}`, {
- method: 'GET',
- });
-}
-
-export async function productSpuAdd(params) {
- return request(`/product-api/admins/spu/add?${stringify(params)}`, {
- method: 'POST',
- body: {},
- });
-}
-
-export async function productSpuUpdate(params) {
- return request(`/product-api/admins/spu/update?${stringify(params)}`, {
- method: 'POST',
- body: {},
- });
-}
-
-export async function productSpuUpdateSort(params) {
- return request(`/product-api/admins/spu/update_sort?${stringify(params)}`, {
- method: 'POST',
- body: {},
- });
-}
-
-export async function productSpuInfo(params) {
- return request(`/product-api/admins/spu/info?${stringify(params)}`, {
- method: 'GET',
- });
-}
-
-// product attr + attr value
-
-export async function productAttrPage(params) {
- return request(`/product-api/admins/attr/page?${stringify(params)}`, {
- method: 'GET',
- });
-}
-
-export async function productAttrAdd(params) {
- return request(`/product-api/admins/attr/add?${stringify(params)}`, {
- method: 'POST',
- body: {},
- });
-}
-
-export async function productAttrUpdate(params) {
- return request(`/product-api/admins/attr/update?${stringify(params)}`, {
- method: 'POST',
- body: {},
- });
-}
-
-export async function productAttrUpdateStatus(params) {
- return request(`/product-api/admins/attr/update_status?${stringify(params)}`, {
- method: 'POST',
- body: {},
- });
-}
-
-export async function productAttrTree(params) {
- return request(`/product-api/admins/attr/tree?${stringify(params)}`, {
- method: 'GET',
- });
-}
-
-export async function productAttrValueUpdate(params) {
- return request(`/product-api/admins/attr_value/update?${stringify(params)}`, {
- method: 'POST',
- body: {},
- });
-}
-
-export async function productAttrValueUpdateStatus(params) {
- return request(`/product-api/admins/attr_value/update_status?${stringify(params)}`, {
- method: 'POST',
- body: {},
- });
-}
-
-export async function productAttrValueAdd(params) {
- return request(`/product-api/admins/attr_value/add?${stringify(params)}`, {
- method: 'POST',
- body: {},
- });
-}
-
-// product brand 2019-05-31
-
-export async function productBrandAdd(params) {
- return request(`/product-api/admins/brand/add?${stringify(params)}`, {
- method: 'POST',
- body: {},
- });
-}
-
-export async function productBrandUpdate(params) {
- return request(`/product-api/admins/brand/update?${stringify(params)}`, {
- method: 'POST',
- body: {},
- });
-}
-
-export async function productBrandGet(params) {
- return request(`/product-api/admins/brand/get?${stringify(params)}`, {
- method: 'GET',
- });
-}
-
-export async function productBrandPage(params) {
- return request(`/product-api/admins/brand/page?${stringify(params)}`, {
- method: 'GET',
- });
-}
diff --git a/admin-web/src/services/promotion.js b/admin-web/src/services/promotion.js
deleted file mode 100644
index 81b6a003e..000000000
--- a/admin-web/src/services/promotion.js
+++ /dev/null
@@ -1,101 +0,0 @@
-import { stringify } from '@/utils/request.qs';
-import request from '@/utils/request';
-
-// banner
-
-export async function queryBanner(params) {
- return request(`/promotion-api/admins/banner/page?${stringify(params)}`, {
- method: 'GET',
- });
-}
-
-export async function addBanner(params) {
- return request(`/promotion-api/admins/banner/add?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-export async function updateBanner(params) {
- return request(`/promotion-api/admins/banner/update?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-export async function updateBannerStatus(params) {
- return request(`/promotion-api/admins/banner/update_status?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-export async function deleteBanner(params) {
- return request(`/promotion-api/admins/banner/delete?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-// product recommend
-
-export async function queryProductRecommend(params) {
- return request(`/promotion-api/admins/product_recommend/page?${stringify(params)}`, {
- method: 'GET',
- });
-}
-
-export async function addProductRecommend(params) {
- return request(`/promotion-api/admins/product_recommend/add?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-export async function updateProductRecommend(params) {
- return request(`/promotion-api/admins/product_recommend/update?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-export async function updateProductRecommendStatus(params) {
- return request(`/promotion-api/admins/product_recommend/update_status?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-export async function deleteProductRecommend(params) {
- return request(`/promotion-api/admins/product_recommend/delete?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-// coupon
-
-export async function getCouponCardTemplatePage(params) {
- return request(`/promotion-api/admins/coupon/template/page?${stringify(params)}`, {
- method: 'GET',
- });
-}
-
-export async function addCouponCardTemplate(params) {
- return request(`/promotion-api/admins/coupon/template/add_card?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-export async function updateCouponCardTemplate(params) {
- return request(`/promotion-api/admins/coupon/template/update_card?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-export async function updateCouponCardTemplateStatus(params) {
- return request(`/promotion-api/admins/coupon/template/update_status?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-// Promotion Activity
-
-export async function getPromotionActivityPage(params) {
- return request(`/promotion-api/admins/promotion_activity/page?${stringify(params)}`, {
- method: 'GET',
- });
-}
-
diff --git a/admin-web/src/services/sms.js b/admin-web/src/services/sms.js
deleted file mode 100644
index 7216143a5..000000000
--- a/admin-web/src/services/sms.js
+++ /dev/null
@@ -1,63 +0,0 @@
-import { stringify } from '@/utils/request.qs';
-import request from '@/utils/request';
-
-// sign
-
-export async function pageSign(params) {
- return request(`/admin-api/admins/sms/sign/page?${stringify(params)}`, {
- method: 'GET',
- });
-}
-
-export async function addSign(params) {
- return request(`/admin-api/admins/sms/sign/add`, {
- method: 'POST',
- body: {
- ...params,
- },
- });
-}
-
-export async function updateSign(params) {
- return request(`/admin-api/admins/sms/sign/update`, {
- method: 'PUT',
- body: {
- ...params,
- },
- });
-}
-
-export async function deletedSign(params) {
- return request(`/admin-api/admins/sms/sign/deleted?${stringify(params)}`, {
- method: 'DELETE',
- });
-}
-
-// template
-
-export async function pageTemplate(params) {
- return request(`/admin-api/admins/sms/template/page`, {
- method: 'POST',
- body: {
- ...params,
- },
- });
-}
-
-export async function addTemplate(params) {
- return request(`/admin-api/admins/sms/template/add?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-export async function updateTemplate(params) {
- return request(`/admin-api/admins/sms/template/update?${stringify(params)}`, {
- method: 'PUT',
- });
-}
-
-export async function deletedTemplate(params) {
- return request(`/admin-api/admins/sms/template/deleted?${stringify(params)}`, {
- method: 'DELETE',
- });
-}
diff --git a/admin-web/src/services/system.js b/admin-web/src/services/system.js
deleted file mode 100644
index b0b5ae026..000000000
--- a/admin-web/src/services/system.js
+++ /dev/null
@@ -1,99 +0,0 @@
-import {stringify} from '@/utils/request.qs';
-import request from '@/utils/request';
-
-// ========== Passport 模块 ==========
-
-export async function passportLogin(params) {
- return request(`/management-api/passport/login?${stringify(params)}`, {
- method: 'POST',
- body: {},
- });
-}
-
-// ========== Authorization 模块 ==========
-
-export async function authorizationResourcePermissions(params) {
- return request(`/system-api/admins/authorization/resource-permissions`, {
- method: 'GET',
- });
-}
-
-export async function authorizationRoleResourceTree(params) {
- return request(`/system-api/admins/authorization/role_resource_tree?${stringify(params)}`, {
- method: 'GET',
- });
-}
-
-export async function authorizationRoleAssignResource(params) {
- return request(`/system-api/admins/authorization/assign_role_resource?${stringify(params)}`, {
- method: 'POST',
- body: {},
- });
-}
-
-// ========== Resource 模块 ==========
-
-export async function resourceTree(params) {
- return request(`/management-api/resource/tree`, {
- method: 'GET',
- });
-}
-
-export async function resourceCreate(params) {
- return request(`/management-api/resource/create?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-export async function resourceUpdate(params) {
- return request(`/management-api/resource/update?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-export async function resourceDelete(params) {
- return request(`/management-api/resource/delete?${stringify(params)}`, {
- method: 'POST',
- });
-}
-
-export async function resourceTreeAdminMenu() {
- return request('/management-api/resource/tree-admin-menu', {
- method: 'GET',
- });
-}
-
-// ========== Role 模块 ==========
-
-export async function rolePage(params) {
- return request(`/management-api/role/page?${stringify(params)}`);
-}
-
-export async function roleDelete(params) {
- return request(`/management-api/role/delete?${stringify(params)}`, {
- method: 'POST',
- body: {},
- });
-}
-
-export async function roleCreate(params) {
- return request(`/management-api/role/create?${stringify(params)}`, {
- method: 'POST',
- body: {},
- });
-}
-
-export async function roleUpdate(params) {
- return request(`/management-api/role/update?${stringify(params)}`, {
- method: 'POST',
- body: {},
- });
-}
-
-// ========== Admin 模块 ==========
-
-export async function adminPage(params) {
- return request(`/management-api/admin/page?${stringify(params)}`, {
- method: 'GET',
- });
-}
diff --git a/admin-web/src/services/user.js b/admin-web/src/services/user.js
deleted file mode 100644
index 2610164df..000000000
--- a/admin-web/src/services/user.js
+++ /dev/null
@@ -1,18 +0,0 @@
-import { stringify } from '@/utils/request.qs';
-import request from '@/utils/request';
-
-export async function query() {
- return request('/api/users');
-}
-
-export async function queryCurrent() {
- return request('/api/currentUser');
-}
-
-// User
-
-export async function queryUserPage(params) {
- return request(`/user-api/admins/user/page?${stringify(params)}`, {
- method: 'GET',
- });
-}
diff --git a/admin-web/src/utils/Authorized.js b/admin-web/src/utils/Authorized.js
deleted file mode 100644
index 8c420cbaa..000000000
--- a/admin-web/src/utils/Authorized.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import RenderAuthorized from '@/components/Authorized';
-import { getAuthority } from './authority';
-
-let Authorized = RenderAuthorized(getAuthority()); // eslint-disable-line
-
-// Reload the rights component
-const reloadAuthorized = () => {
- Authorized = RenderAuthorized(getAuthority());
-};
-
-export { reloadAuthorized };
-export default Authorized;
diff --git a/admin-web/src/utils/Yuan.js b/admin-web/src/utils/Yuan.js
deleted file mode 100644
index 434a57fb7..000000000
--- a/admin-web/src/utils/Yuan.js
+++ /dev/null
@@ -1,31 +0,0 @@
-import React from 'react';
-import { yuan } from '@/components/Charts';
-/**
- * 减少使用 dangerouslySetInnerHTML
- */
-export default class Yuan extends React.PureComponent {
- componentDidMount() {
- this.rendertoHtml();
- }
-
- componentDidUpdate() {
- this.rendertoHtml();
- }
-
- rendertoHtml = () => {
- const { children } = this.props;
- if (this.main) {
- this.main.innerHTML = yuan(children);
- }
- };
-
- render() {
- return (
- {
- this.main = ref;
- }}
- />
- );
- }
-}
diff --git a/admin-web/src/utils/authority.js b/admin-web/src/utils/authority.js
deleted file mode 100644
index 3d2e7b349..000000000
--- a/admin-web/src/utils/authority.js
+++ /dev/null
@@ -1,22 +0,0 @@
-// use localStorage to store the authority info, which might be sent from server in actual project.
-export function getAuthority(str) {
- // return localStorage.getItem('antd-pro-authority') || ['admin', 'user'];
- const authorityString =
- typeof str === 'undefined' ? localStorage.getItem('antd-pro-authority') : str;
- // authorityString could be admin, "admin", ["admin"]
- let authority;
- try {
- authority = JSON.parse(authorityString);
- } catch (e) {
- authority = authorityString;
- }
- if (typeof authority === 'string') {
- return [authority];
- }
- return authority || ['admin'];
-}
-
-export function setAuthority(authority) {
- const proAuthority = typeof authority === 'string' ? [authority] : authority;
- return localStorage.setItem('antd-pro-authority', JSON.stringify(proAuthority));
-}
diff --git a/admin-web/src/utils/authority.test.js b/admin-web/src/utils/authority.test.js
deleted file mode 100644
index 8a6cd41f3..000000000
--- a/admin-web/src/utils/authority.test.js
+++ /dev/null
@@ -1,19 +0,0 @@
-import { getAuthority } from './authority';
-
-describe('getAuthority should be strong', () => {
- it('empty', () => {
- expect(getAuthority(null)).toEqual(['admin']); // default value
- });
- it('string', () => {
- expect(getAuthority('admin')).toEqual(['admin']);
- });
- it('array with double quotes', () => {
- expect(getAuthority('"admin"')).toEqual(['admin']);
- });
- it('array with single item', () => {
- expect(getAuthority('["admin"]')).toEqual(['admin']);
- });
- it('array with multiple items', () => {
- expect(getAuthority('["admin", "guest"]')).toEqual(['admin', 'guest']);
- });
-});
diff --git a/admin-web/src/utils/cache.js b/admin-web/src/utils/cache.js
deleted file mode 100644
index 65b238a00..000000000
--- a/admin-web/src/utils/cache.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/* eslint-disable */
-
-// localStorage 操作
-
-const cacheKeys = {
- ACCESS_TOKEN: 'accessToken',
- REFRESH_TOKEN: 'refreshToken',
-};
-
-///
-/// 设置 loginToken,分为 accessToken 和 refreshToken
-
-export function setLoginToken(accessToken, refreshToken) {
- setLocalStorage(cacheKeys.ACCESS_TOKEN, accessToken);
- setLocalStorage(cacheKeys.REFRESH_TOKEN, refreshToken);
-}
-
-export function getLoginToken() {
- const res = {};
- res[cacheKeys.ACCESS_TOKEN] = getLocalStorage(cacheKeys.ACCESS_TOKEN);
- res[cacheKeys.REFRESH_TOKEN] = getLocalStorage(cacheKeys.REFRESH_TOKEN);
- return res;
-}
-
-
-
-///
-/// 设置 localStorage 公共方法
-
-function setLocalStorage(key, value) {
- try {
- localStorage.setItem(key, value);
- } catch (e) {
- throw new Error(`localStorage 设置错误! ${e}`);
- }
-}
-
-function getLocalStorage(key) {
- try {
- return localStorage.getItem(key);
- } catch (e) {
- throw new Error(`localStorage 获取错误! ${e}`);
- }
-}
-
-function removeLocalStorage(key) {
- try {
- localStorage.removeItem(key);
- } catch (e) {
- throw new Error(`localStorage 设置错误! ${e}`);
- }
-}
diff --git a/admin-web/src/utils/dictionary.js b/admin-web/src/utils/dictionary.js
deleted file mode 100644
index f4460d880..000000000
--- a/admin-web/src/utils/dictionary.js
+++ /dev/null
@@ -1,20 +0,0 @@
-// 字典定义
-
-const DictionaryConstants = {
- GENDER: 'gender',
- ORDER_STATUS: 'order_status',
- ORDER_CANCEL_REASONS: 'order_cancel_reasons',
- LOGISTICS_COMPANY: 'logistics_company',
-
- // order return
- ORDER_RETURN_STATUS: 'order_return_status',
- ORDER_RETURN_REASON: 'order_return_reason',
- ORDER_RETURN_SERVICE_TYPE: 'order_return_service_type',
-
- // sms
- SMS_TYPE: 'sms_type',
- SMS_PLATFORM: 'sms_platform',
- SMS_APPLY_STATUS: 'sms_apply_status',
-};
-
-export default DictionaryConstants;
diff --git a/admin-web/src/utils/getPageTitle.js b/admin-web/src/utils/getPageTitle.js
deleted file mode 100644
index 0dd1e6207..000000000
--- a/admin-web/src/utils/getPageTitle.js
+++ /dev/null
@@ -1,27 +0,0 @@
-import { formatMessage } from 'umi/locale';
-import pathToRegexp from 'path-to-regexp';
-import isEqual from 'lodash/isEqual';
-import memoizeOne from 'memoize-one';
-import { menu, title } from '../defaultSettings';
-
-export const matchParamsPath = (pathname, breadcrumbNameMap) => {
- const pathKey = Object.keys(breadcrumbNameMap).find(key => pathToRegexp(key).test(pathname));
- return breadcrumbNameMap[pathKey];
-};
-
-const getPageTitle = (pathname, breadcrumbNameMap) => {
- const currRouterData = matchParamsPath(pathname, breadcrumbNameMap);
- if (!currRouterData) {
- return title;
- }
- const pageName = menu.disableLocal
- ? currRouterData.name
- : formatMessage({
- id: currRouterData.locale || currRouterData.name,
- defaultMessage: currRouterData.name,
- });
-
- return `${pageName} - ${title}`;
-};
-
-export default memoizeOne(getPageTitle, isEqual);
diff --git a/admin-web/src/utils/request.js b/admin-web/src/utils/request.js
deleted file mode 100644
index c37056d3d..000000000
--- a/admin-web/src/utils/request.js
+++ /dev/null
@@ -1,199 +0,0 @@
-import fetch from 'dva/fetch';
-import { notification } from 'antd';
-import router from 'umi/router';
-import hash from 'hash.js';
-import { isAntdPro } from './utils';
-import { getLoginToken } from './cache';
-import { setAuthority } from './authority';
-
-const codeMessage = {
- 200: '服务器成功返回请求的数据。',
- 201: '新建或修改数据成功。',
- 202: '一个请求已经进入后台排队(异步任务)。',
- 204: '删除数据成功。',
- 400: '发出的请求有错误,服务器没有进行新建或修改数据的操作。',
- 401: '用户没有权限(令牌、用户名、密码错误)。',
- 403: '用户得到授权,但是访问是被禁止的。',
- 404: '发出的请求针对的是不存在的记录,服务器没有进行操作。',
- 406: '请求的格式不可得。',
- 410: '请求的资源被永久删除,且不会再得到的。',
- 422: '当创建一个对象时,发生一个验证错误。',
- 500: '服务器发生错误,请检查服务器。',
- 502: '网关错误。',
- 503: '服务不可用,服务器暂时过载或维护。',
- 504: '网关超时。',
-};
-
-// 需要调整 login 界面的 code
-const redirectLoginCode = {
- 1002001011: '访问令牌不存在',
- 1002001012: '访问令牌已过期',
- 1002001013: '访问令牌已失效',
- 1002001015: '账号未登陆',
-};
-
-function checkStatus(response) {
- if (response.status >= 200 && response.status < 300) {
- return response;
- }
- const errortext = codeMessage[response.status] || response.statusText;
- notification.warning({
- message: `请求错误 ${response.status}: ${response.url}`,
- description: errortext,
- });
-
- const error = new Error(errortext);
- error.name = response.status;
- error.response = response;
- throw error;
-}
-
-function checkCode(result) {
- if (result.code === undefined || result.code === 0) {
- return result;
- }
- notification.warning({
- message: `请求错误 ${result.code}`,
- description: result.message,
- });
-
- // 重定向到登录界面
- if (redirectLoginCode[result.code]) {
- setAuthority('');
- window.location.reload();
- }
-
- const error = new Error(result.message);
- error.result = result;
- throw error;
-}
-
-const cachedSave = (response, hashcode) => {
- /**
- * Clone a response data and store it in sessionStorage
- * Does not support data other than json, Cache only json
- */
- const contentType = response.headers.get('Content-Type');
- if (contentType && contentType.match(/application\/json/i)) {
- // All data is saved as text
- response
- .clone()
- .text()
- .then(content => {
- sessionStorage.setItem(hashcode, content);
- sessionStorage.setItem(`${hashcode}:timestamp`, Date.now());
- });
- }
- return response;
-};
-
-/**
- * Requests a URL, returning a promise.
- *
- * @param {string} url The URL we want to request
- * @param {object} [option] The options we want to pass to "fetch"
- * @return {object} An object containing either "data" or "err"
- */
-export default function request(url, option) {
- const options = {
- expirys: isAntdPro(),
- ...option,
- };
- /**
- * Produce fingerprints based on url and parameters
- * Maybe url has the same parameters
- */
- const fingerprint = url + (options.body ? JSON.stringify(options.body) : '');
- const hashcode = hash
- .sha256()
- .update(fingerprint)
- .digest('hex');
-
- const defaultOptions = {
- credentials: 'include',
- };
-
- const newOptions = { ...defaultOptions, ...options };
- if (
- newOptions.method === 'POST' ||
- newOptions.method === 'PUT' ||
- newOptions.method === 'DELETE'
- ) {
- if (!(newOptions.body instanceof FormData)) {
- newOptions.headers = {
- Accept: 'application/json',
- 'Content-Type': 'application/json; charset=utf-8',
- ...newOptions.headers,
- };
- newOptions.body = JSON.stringify(newOptions.body);
- } else {
- // newOptions.body is FormData
- newOptions.headers = {
- Accept: 'application/json',
- ...newOptions.headers,
- };
- }
- }
-
- // 将登陆的 accessToken 放到 header
- const loginToken = getLoginToken();
- if (loginToken && loginToken.accessToken
- && url.indexOf('/management-api/passport/login') === -1) { // TODO 芋艿,临时这么加,可能不是很优雅
- const headers = {
- ...newOptions.headers,
- Authorization: `Bearer ${loginToken.accessToken}`,
- };
- newOptions.headers = headers;
- }
-
- const expirys = options.expirys && 60;
- // options.expirys !== false, return the cache,
- if (options.expirys !== false) {
- const cached = sessionStorage.getItem(hashcode);
- const whenCached = sessionStorage.getItem(`${hashcode}:timestamp`);
- if (cached !== null && whenCached !== null) {
- const age = (Date.now() - whenCached) / 1000;
- if (age < expirys) {
- const response = new Response(new Blob([cached]));
- return response.json();
- }
- sessionStorage.removeItem(hashcode);
- sessionStorage.removeItem(`${hashcode}:timestamp`);
- }
- }
- return fetch(url, newOptions)
- .then(checkStatus)
- .then(response => cachedSave(response, hashcode))
- .then(response => {
- // DELETE and 204 do not return data by default
- // using .json will report an error.
- if (newOptions.method === 'DELETE' || response.status === 204) {
- return response.text();
- }
- return response.json();
- })
- .then(checkCode)
- .catch(e => {
- const status = e.name;
- if (status === 401) {
- // @HACK
- /* eslint-disable no-underscore-dangle */
- window.g_app._store.dispatch({
- type: 'login/logout',
- });
- return;
- }
- // environment should not be used
- if (status === 403) {
- router.push('/exception/403');
- return;
- }
- if (status <= 504 && status >= 500) {
- router.push('/exception/500');
- return;
- }
- if (status >= 404 && status < 422) {
- router.push('/exception/404');
- }
- });
-}
diff --git a/admin-web/src/utils/request.qs.js b/admin-web/src/utils/request.qs.js
deleted file mode 100644
index 2d277eb35..000000000
--- a/admin-web/src/utils/request.qs.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/* eslint-disable */
-import qs from 'qs';
-
-/**
- * 过滤字符串为 '' 直接不传了
- *
- * @param params
- */
-function filterEmptyStr(params) {
- function filterObject(object) {
- const res = {};
- for (const key in object) {
- const val = object[key];
- if (
- new String(val).length > 0 &&
- val !== undefined &&
- val !== 'undefined' &&
- val !== null &&
- val !== 'null'
- ) {
- res[key] = val;
- }
- }
- return res;
- }
-
- if (typeof params === 'object') {
- return filterObject(params);
- } else if (params instanceof Array) {
- let res = [];
- for (const object in params) {
- res.push(filterObject(params));
- }
- }
-}
-
-export function arrayToStringParams(array) {
- let res = '';
- for (let i = 0; i < array.length; i++) {
- res += array[i];
- if (i < array.length - 1) {
- res += ',';
- }
- }
- return res;
-}
-
-export function stringify(params) {
- return qs.stringify(filterEmptyStr(params));
-}
-
-export default {
- ...qs,
- stringify,
-};
diff --git a/admin-web/src/utils/tree.utils.js b/admin-web/src/utils/tree.utils.js
deleted file mode 100644
index 179e2f5f3..000000000
--- a/admin-web/src/utils/tree.utils.js
+++ /dev/null
@@ -1,67 +0,0 @@
-// tree 工具
-
-export function buildTreeNode(nodes, titleKey, nodeKey) {
- return nodes.map(item => {
- const res = {};
- if (item.children) {
- res.children = buildTreeNode(item.children, titleKey, nodeKey);
- }
- // res.title = `${item.id}-${item[titleKey]}`;
- res.title = `${item[titleKey]}`;
- res.key = item[nodeKey];
- return res;
- });
-}
-
-// @primary
-function findNodes(id, nodes) {
- const res = [];
- for (let i = 0; i < nodes.length; i += 1) {
- const node = nodes[i];
- if (node.key === id) {
- res.push(node.key);
- break;
- } else if (node.children) {
- const childNodes = findNodes(id, node.children);
- for (let j = 0; j < childNodes.length; j += 1) {
- res.push(childNodes[j]);
- }
- }
- }
- return res;
-}
-
-export function findAllNodes(resourceIds, nodes) {
- console.log('resourceIds', resourceIds);
-
- const findNodesArray = [];
- for (let i = 0; i < resourceIds.length; i += 1) {
- const findNodesData = findNodes(resourceIds[i], nodes);
- console.log('findNodesData', findNodesData);
- if (findNodesData) {
- for (let j = 0; j < findNodesData.length; j += 1) {
- const jD = findNodesData[j];
- if (findNodesArray.indexOf(jD) === -1) {
- findNodesArray.push(jD);
- }
- }
- }
- }
- return findNodesArray;
-}
-
-export function findCheckedKeys(nodes) {
- let res = [];
- for (let i = 0; i < nodes.length; i += 1) {
- const node = nodes[i];
- if (node.children) {
- const findChildrenNodes = findCheckedKeys(node.children);
- if (findChildrenNodes) {
- res = res.concat(findChildrenNodes);
- }
- } else if (node.assigned === true) {
- res.push(node.id);
- }
- }
- return res;
-}
diff --git a/admin-web/src/utils/utils.js b/admin-web/src/utils/utils.js
deleted file mode 100644
index 7531af679..000000000
--- a/admin-web/src/utils/utils.js
+++ /dev/null
@@ -1,194 +0,0 @@
-import moment from 'moment';
-import React from 'react';
-import nzh from 'nzh/cn';
-import { parse, stringify } from 'qs';
-
-export function fixedZero(val) {
- return val * 1 < 10 ? `0${val}` : val;
-}
-
-export function getTimeDistance(type) {
- const now = new Date();
- const oneDay = 1000 * 60 * 60 * 24;
-
- if (type === 'today') {
- now.setHours(0);
- now.setMinutes(0);
- now.setSeconds(0);
- return [moment(now), moment(now.getTime() + (oneDay - 1000))];
- }
-
- if (type === 'week') {
- let day = now.getDay();
- now.setHours(0);
- now.setMinutes(0);
- now.setSeconds(0);
-
- if (day === 0) {
- day = 6;
- } else {
- day -= 1;
- }
-
- const beginTime = now.getTime() - day * oneDay;
-
- return [moment(beginTime), moment(beginTime + (7 * oneDay - 1000))];
- }
-
- if (type === 'month') {
- const year = now.getFullYear();
- const month = now.getMonth();
- const nextDate = moment(now).add(1, 'months');
- const nextYear = nextDate.year();
- const nextMonth = nextDate.month();
-
- return [
- moment(`${year}-${fixedZero(month + 1)}-01 00:00:00`),
- moment(moment(`${nextYear}-${fixedZero(nextMonth + 1)}-01 00:00:00`).valueOf() - 1000),
- ];
- }
-
- const year = now.getFullYear();
- return [moment(`${year}-01-01 00:00:00`), moment(`${year}-12-31 23:59:59`)];
-}
-
-export function getPlainNode(nodeList, parentPath = '') {
- const arr = [];
- nodeList.forEach(node => {
- const item = node;
- item.path = `${parentPath}/${item.path || ''}`.replace(/\/+/g, '/');
- item.exact = true;
- if (item.children && !item.component) {
- arr.push(...getPlainNode(item.children, item.path));
- } else {
- if (item.children && item.component) {
- item.exact = false;
- }
- arr.push(item);
- }
- });
- return arr;
-}
-
-export function digitUppercase(n) {
- return nzh.toMoney(n);
-}
-
-function getRelation(str1, str2) {
- if (str1 === str2) {
- console.warn('Two path are equal!'); // eslint-disable-line
- }
- const arr1 = str1.split('/');
- const arr2 = str2.split('/');
- if (arr2.every((item, index) => item === arr1[index])) {
- return 1;
- }
- if (arr1.every((item, index) => item === arr2[index])) {
- return 2;
- }
- return 3;
-}
-
-function getRenderArr(routes) {
- let renderArr = [];
- renderArr.push(routes[0]);
- for (let i = 1; i < routes.length; i += 1) {
- // 去重
- renderArr = renderArr.filter(item => getRelation(item, routes[i]) !== 1);
- // 是否包含
- const isAdd = renderArr.every(item => getRelation(item, routes[i]) === 3);
- if (isAdd) {
- renderArr.push(routes[i]);
- }
- }
- return renderArr;
-}
-
-/**
- * Get router routing configuration
- * { path:{name,...param}}=>Array<{name,path ...param}>
- * @param {string} path
- * @param {routerData} routerData
- */
-export function getRoutes(path, routerData) {
- let routes = Object.keys(routerData).filter(
- routePath => routePath.indexOf(path) === 0 && routePath !== path
- );
- // Replace path to '' eg. path='user' /user/name => name
- routes = routes.map(item => item.replace(path, ''));
- // Get the route to be rendered to remove the deep rendering
- const renderArr = getRenderArr(routes);
- // Conversion and stitching parameters
- const renderRoutes = renderArr.map(item => {
- const exact = !routes.some(route => route !== item && getRelation(route, item) === 1);
- return {
- exact,
- ...routerData[`${path}${item}`],
- key: `${path}${item}`,
- path: `${path}${item}`,
- };
- });
- return renderRoutes;
-}
-
-export function getPageQuery() {
- return parse(window.location.href.split('?')[1]);
-}
-
-export function getQueryPath(path = '', query = {}) {
- const search = stringify(query);
- if (search.length) {
- return `${path}?${search}`;
- }
- return path;
-}
-
-/* eslint no-useless-escape:0 */
-const reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/;
-
-export function isUrl(path) {
- return reg.test(path);
-}
-
-export function formatWan(val) {
- const v = val * 1;
- if (!v || Number.isNaN(v)) return '';
-
- let result = val;
- if (val > 10000) {
- result = Math.floor(val / 10000);
- result = (
-
- {result}
-
- 万
-
-
- );
- }
- return result;
-}
-
-// 给官方演示站点用,用于关闭真实开发环境不需要使用的特性
-export function isAntdPro() {
- return window.location.hostname === 'preview.pro.ant.design';
-}
-
-export const importCDN = (url, name) =>
- new Promise(resolve => {
- const dom = document.createElement('script');
- dom.src = url;
- dom.type = 'text/javascript';
- dom.onload = () => {
- resolve(window[name]);
- };
- document.head.appendChild(dom);
- });
diff --git a/admin-web/src/utils/utils.less b/admin-web/src/utils/utils.less
deleted file mode 100644
index 7be54ba58..000000000
--- a/admin-web/src/utils/utils.less
+++ /dev/null
@@ -1,50 +0,0 @@
-.textOverflow() {
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- word-break: break-all;
-}
-
-.textOverflowMulti(@line: 3, @bg: #fff) {
- position: relative;
- max-height: @line * 1.5em;
- margin-right: -1em;
- padding-right: 1em;
- overflow: hidden;
- line-height: 1.5em;
- text-align: justify;
- &::before {
- position: absolute;
- right: 14px;
- bottom: 0;
- padding: 0 1px;
- background: @bg;
- content: '...';
- }
- &::after {
- position: absolute;
- right: 14px;
- width: 1em;
- height: 1em;
- margin-top: 0.2em;
- background: white;
- content: '';
- }
-}
-
-// mixins for clearfix
-// ------------------------
-.clearfix() {
- zoom: 1;
- &::before,
- &::after {
- content: ' ';
- display: table;
- }
- &::after {
- clear: both;
- height: 0;
- font-size: 0;
- visibility: hidden;
- }
-}
diff --git a/admin-web/src/utils/utils.test.js b/admin-web/src/utils/utils.test.js
deleted file mode 100644
index c97d32546..000000000
--- a/admin-web/src/utils/utils.test.js
+++ /dev/null
@@ -1,62 +0,0 @@
-import { fixedZero, isUrl } from './utils';
-
-describe('fixedZero tests', () => {
- it('should not pad large numbers', () => {
- expect(fixedZero(10)).toEqual(10);
- expect(fixedZero(11)).toEqual(11);
- expect(fixedZero(15)).toEqual(15);
- expect(fixedZero(20)).toEqual(20);
- expect(fixedZero(100)).toEqual(100);
- expect(fixedZero(1000)).toEqual(1000);
- });
-
- it('should pad single digit numbers and return them as string', () => {
- expect(fixedZero(0)).toEqual('00');
- expect(fixedZero(1)).toEqual('01');
- expect(fixedZero(2)).toEqual('02');
- expect(fixedZero(3)).toEqual('03');
- expect(fixedZero(4)).toEqual('04');
- expect(fixedZero(5)).toEqual('05');
- expect(fixedZero(6)).toEqual('06');
- expect(fixedZero(7)).toEqual('07');
- expect(fixedZero(8)).toEqual('08');
- expect(fixedZero(9)).toEqual('09');
- });
-});
-
-describe('isUrl tests', () => {
- it('should return false for invalid and corner case inputs', () => {
- expect(isUrl([])).toBeFalsy();
- expect(isUrl({})).toBeFalsy();
- expect(isUrl(false)).toBeFalsy();
- expect(isUrl(true)).toBeFalsy();
- expect(isUrl(NaN)).toBeFalsy();
- expect(isUrl(null)).toBeFalsy();
- expect(isUrl(undefined)).toBeFalsy();
- expect(isUrl()).toBeFalsy();
- expect(isUrl('')).toBeFalsy();
- });
-
- it('should return false for invalid URLs', () => {
- expect(isUrl('foo')).toBeFalsy();
- expect(isUrl('bar')).toBeFalsy();
- expect(isUrl('bar/test')).toBeFalsy();
- expect(isUrl('http:/example.com/')).toBeFalsy();
- expect(isUrl('ttp://example.com/')).toBeFalsy();
- });
-
- it('should return true for valid URLs', () => {
- expect(isUrl('http://example.com/')).toBeTruthy();
- expect(isUrl('https://example.com/')).toBeTruthy();
- expect(isUrl('http://example.com/test/123')).toBeTruthy();
- expect(isUrl('https://example.com/test/123')).toBeTruthy();
- expect(isUrl('http://example.com/test/123?foo=bar')).toBeTruthy();
- expect(isUrl('https://example.com/test/123?foo=bar')).toBeTruthy();
- expect(isUrl('http://www.example.com/')).toBeTruthy();
- expect(isUrl('https://www.example.com/')).toBeTruthy();
- expect(isUrl('http://www.example.com/test/123')).toBeTruthy();
- expect(isUrl('https://www.example.com/test/123')).toBeTruthy();
- expect(isUrl('http://www.example.com/test/123?foo=bar')).toBeTruthy();
- expect(isUrl('https://www.example.com/test/123?foo=bar')).toBeTruthy();
- });
-});
diff --git a/admin-web/tests/run-tests.js b/admin-web/tests/run-tests.js
deleted file mode 100644
index 5735ada46..000000000
--- a/admin-web/tests/run-tests.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/* eslint-disable no-console */
-const { spawn } = require('child_process');
-const { kill } = require('cross-port-killer');
-
-const env = Object.create(process.env);
-env.BROWSER = 'none';
-env.TEST = true;
-// flag to prevent multiple test
-let once = false;
-
-const startServer = spawn(/^win/.test(process.platform) ? 'npm.cmd' : 'npm', ['start'], {
- env,
-});
-
-startServer.stderr.on('data', data => {
- // eslint-disable-next-line
- console.log(data.toString());
-});
-
-startServer.on('exit', () => {
- kill(process.env.PORT || 8000);
-});
-
-console.log('Starting development server for e2e tests...');
-startServer.stdout.on('data', data => {
- console.log(data.toString());
- // hack code , wait umi
- if (
- (!once && data.toString().indexOf('Compiled successfully') >= 0) ||
- data.toString().indexOf('Theme generated successfully') >= 0
- ) {
- // eslint-disable-next-line
- once = true;
- console.log('Development server is started, ready to run tests.');
- const testCmd = spawn(
- /^win/.test(process.platform) ? 'npm.cmd' : 'npm',
- ['test', '--', '--maxWorkers=1', '--runInBand'],
- {
- stdio: 'inherit',
- }
- );
- testCmd.on('exit', code => {
- startServer.kill();
- process.exit(code);
- });
- }
-});
diff --git a/admin-web/tsconfig.json b/admin-web/tsconfig.json
deleted file mode 100644
index 5be308311..000000000
--- a/admin-web/tsconfig.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "compilerOptions": {
- "outDir": "build/dist",
- "module": "esnext",
- "target": "es2016",
- "lib": ["es6", "dom"],
- "sourceMap": true,
- "baseUrl": ".",
- "jsx": "react",
- "allowSyntheticDefaultImports": true,
- "moduleResolution": "node",
- "rootDirs": ["/src", "/test", "/mock","./typings"],
- "forceConsistentCasingInFileNames": true,
- "noImplicitReturns": true,
- "suppressImplicitAnyIndexErrors": true,
- "noUnusedLocals": true,
- "allowJs": true,
- "experimentalDecorators": true,
- "paths": {
- "@/*": ["./src/*"]
- }
- },
- "include": ["./src"],
- "exclude": [
- "node_modules",
- "build",
- "scripts",
- "acceptance-tests",
- "webpack",
- "jest",
- "src/setupTests.ts",
- "tslint:latest",
- "tslint-config-prettier"
- ]
-}
diff --git a/admin-web/tslint.json b/admin-web/tslint.json
deleted file mode 100644
index 125e217e4..000000000
--- a/admin-web/tslint.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "extends": ["tslint:latest", "tslint-react", "tslint-config-prettier"],
- "rules": {
- "no-var-requires": false,
- "no-submodule-imports": false,
- "object-literal-sort-keys": false,
- "jsx-no-lambda": false,
- "no-implicit-dependencies": false,
- "no-console": false
- }
-}
diff --git a/admin-web/笔记 b/admin-web/笔记
deleted file mode 100644
index 23b4ec1a7..000000000
--- a/admin-web/笔记
+++ /dev/null
@@ -1,4 +0,0 @@
-
-登陆账号
-admin
-nicai
diff --git a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/admin/AdminController.java b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/admin/AdminController.java
index e65d7d461..4332c56f7 100644
--- a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/admin/AdminController.java
+++ b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/admin/AdminController.java
@@ -32,8 +32,6 @@ public class AdminController {
@Autowired
private AdminManager adminManager;
- // =========== 管理员管理 API ===========
-
@ApiOperation(value = "管理员分页")
@GetMapping("/page")
@RequiresPermissions("system.admin.page")
diff --git a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/ResourceController.http b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/ResourceController.http
index 0788782d3..44d32866e 100644
--- a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/ResourceController.http
+++ b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/ResourceController.http
@@ -39,4 +39,9 @@ GET {{baseUrl}}/resource/tree-admin-menu
Content-Type: application/x-www-form-urlencoded
Authorization: Bearer {{accessToken}}
+### /resource/list-admin-permission 成功
+GET {{baseUrl}}/resource/list-admin-permission
+Content-Type: application/x-www-form-urlencoded
+Authorization: Bearer {{accessToken}}
+
###
diff --git a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/ResourceController.java b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/ResourceController.java
index b598184de..404163191 100644
--- a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/ResourceController.java
+++ b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/ResourceController.java
@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
+import java.util.Set;
import static cn.iocoder.common.framework.vo.CommonResult.success;
@@ -72,10 +73,18 @@ public class ResourceController {
return success(resourceManager.treeResource());
}
+ // =========== 当前管理员相关 API ===========
+
@GetMapping("/tree-admin-menu")
@ApiOperation("获得当前登陆的管理员的菜单树")
public CommonResult> treeAdminMenu() {
return success(resourceManager.treeAdminMenu(AdminSecurityContextHolder.getAdminId()));
}
+ @GetMapping("/list-admin-permission")
+ @ApiOperation("获得当前登陆的管理员的权限列表")
+ public CommonResult> listAdminPermission() {
+ return success(resourceManager.listAdminPermission(AdminSecurityContextHolder.getAdminId()));
+ }
+
}
diff --git a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/dto/ResourceCreateDTO.java b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/dto/ResourceCreateDTO.java
index 4bf6175ae..987b8e2a7 100644
--- a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/dto/ResourceCreateDTO.java
+++ b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/dto/ResourceCreateDTO.java
@@ -32,5 +32,7 @@ public class ResourceCreateDTO {
private String route;
@ApiModelProperty(value = "菜单图标", example = "add")
private String icon;
+ @ApiModelProperty(value = "前端界面", example = "@/views/example/edit")
+ private String view;
}
diff --git a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/dto/ResourceUpdateDTO.java b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/dto/ResourceUpdateDTO.java
index fce22ec82..c4f368802 100644
--- a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/dto/ResourceUpdateDTO.java
+++ b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/dto/ResourceUpdateDTO.java
@@ -35,5 +35,7 @@ public class ResourceUpdateDTO {
private String route;
@ApiModelProperty(value = "菜单图标", example = "add")
private String icon;
+ @ApiModelProperty(value = "前端界面", example = "@/views/example/edit")
+ private String view;
}
diff --git a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/vo/AdminMenuTreeNodeVO.java b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/vo/AdminMenuTreeNodeVO.java
index a08dff77e..7ac663d40 100644
--- a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/vo/AdminMenuTreeNodeVO.java
+++ b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/vo/AdminMenuTreeNodeVO.java
@@ -20,6 +20,8 @@ public class AdminMenuTreeNodeVO {
private String route;
@ApiModelProperty(value = "菜单图标", required = true, example = "user")
private String icon;
+ @ApiModelProperty(value = "前端界面", example = "@/views/example/edit")
+ private String view;
@ApiModelProperty(value = "父级资源编号", required = true, example = "1", notes = "如果无父资源,则值为 0")
private Integer pid;
diff --git a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/vo/ResourceTreeNodeVO.java b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/vo/ResourceTreeNodeVO.java
index d33c730ee..6be673b6a 100644
--- a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/vo/ResourceTreeNodeVO.java
+++ b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/vo/ResourceTreeNodeVO.java
@@ -37,6 +37,8 @@ public class ResourceTreeNodeVO {
private String route;
@ApiModelProperty(value = "菜单图标", example = "add")
private String icon;
+ @ApiModelProperty(value = "前端界面", example = "@/views/example/edit")
+ private String view;
@ApiModelProperty(value = "添加时间", required = true)
private Date createTime;
diff --git a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/vo/ResourceVO.java b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/vo/ResourceVO.java
index f2f133dcc..ab1cf1b55 100644
--- a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/vo/ResourceVO.java
+++ b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/permission/vo/ResourceVO.java
@@ -35,6 +35,8 @@ public class ResourceVO {
private String route;
@ApiModelProperty(value = "菜单图标", example = "add")
private String icon;
+ @ApiModelProperty(value = "前端界面", example = "@/views/example/edit")
+ private String view;
@ApiModelProperty(value = "添加时间", required = true)
private Date createTime;
diff --git a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/manager/permission/ResourceManager.java b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/manager/permission/ResourceManager.java
index 9058d9250..c9ad9e5b8 100644
--- a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/manager/permission/ResourceManager.java
+++ b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/manager/permission/ResourceManager.java
@@ -111,9 +111,9 @@ public class ResourceManager {
CommonResult> listAdminRoleIdsResult = roleRpc.listAdminRoleIds(adminId);
listAdminRoleIdsResult.checkError();
if (CollectionUtils.isEmpty(listAdminRoleIdsResult.getData())) {
- return null;
+ return Collections.emptyList();
}
- // 获得角色拥有的资源列表
+ // 获得角色拥有的资源(菜单)列表
CommonResult> resourceVOResult = resourceRpc.listRoleResource(
listAdminRoleIdsResult.getData(), ResourceTypeEnum.MENU.getType());
resourceVOResult.checkError();
@@ -164,4 +164,24 @@ public class ResourceManager {
return treeNodeMap.values().stream().filter(node -> node.getPid().equals(ResourceIdEnum.ROOT.getId())).collect(Collectors.toList());
}
+ /**
+ * 获得指定管理员的权限列表
+ *
+ * @param adminId 管理员编号
+ * @return 权限列表
+ */
+ public Set listAdminPermission(Integer adminId) {
+ // 获得管理员拥有的角色编号列表
+ CommonResult> listAdminRoleIdsResult = roleRpc.listAdminRoleIds(adminId);
+ listAdminRoleIdsResult.checkError();
+ if (CollectionUtils.isEmpty(listAdminRoleIdsResult.getData())) {
+ return Collections.emptySet();
+ }
+ // 获得角色拥有的资源列表
+ CommonResult> resourceVOResult = resourceRpc.listRoleResource(
+ listAdminRoleIdsResult.getData(), null);
+ resourceVOResult.checkError();
+ return CollectionUtils.convertSet(resourceVOResult.getData(), cn.iocoder.mall.systemservice.rpc.permission.vo.ResourceVO::getPermission);
+ }
+
}
diff --git a/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/permission/dto/ResourceCreateDTO.java b/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/permission/dto/ResourceCreateDTO.java
index 3d1903b3d..dbe688c72 100644
--- a/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/permission/dto/ResourceCreateDTO.java
+++ b/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/permission/dto/ResourceCreateDTO.java
@@ -49,6 +49,10 @@ public class ResourceCreateDTO implements Serializable {
* 菜单图标
*/
private String icon;
+ /**
+ * 前端界面
+ */
+ private String view;
/**
* 创建管理员编号
diff --git a/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/permission/dto/ResourceUpdateDTO.java b/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/permission/dto/ResourceUpdateDTO.java
index e7f4e0918..71f02457c 100644
--- a/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/permission/dto/ResourceUpdateDTO.java
+++ b/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/permission/dto/ResourceUpdateDTO.java
@@ -54,5 +54,9 @@ public class ResourceUpdateDTO implements Serializable {
* 菜单图标
*/
private String icon;
+ /**
+ * 前端界面
+ */
+ private String view;
}
diff --git a/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/permission/vo/ResourceVO.java b/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/permission/vo/ResourceVO.java
index 31e8db829..d6601d136 100644
--- a/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/permission/vo/ResourceVO.java
+++ b/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/permission/vo/ResourceVO.java
@@ -45,6 +45,10 @@ public class ResourceVO implements Serializable {
* 菜单图标
*/
private String icon;
+ /**
+ * 前端界面
+ */
+ private String view;
/**
* 添加时间
*/
diff --git a/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/dal/mysql/dataobject/permission/ResourceDO.java b/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/dal/mysql/dataobject/permission/ResourceDO.java
index 2999c4a3e..a46265a5a 100644
--- a/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/dal/mysql/dataobject/permission/ResourceDO.java
+++ b/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/dal/mysql/dataobject/permission/ResourceDO.java
@@ -64,6 +64,13 @@ public class ResourceDO extends DeletableDO {
* 目前当且仅当资源类型为 {@link ResourceTypeEnum#MENU} 时,才会生效
*/
private String icon;
+ /**
+ * 前端界面
+ * 例如说,vue 框架下的 component 对应的 view 页面。
+ *
+ * 目前当且仅当资源类型为 {@link ResourceTypeEnum#MENU} 时,才会生效
+ */
+ private String view;
/**
* 创建管理员编号
diff --git a/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/service/permission/bo/ResourceBO.java b/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/service/permission/bo/ResourceBO.java
index 5e622b7bc..736069c89 100644
--- a/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/service/permission/bo/ResourceBO.java
+++ b/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/service/permission/bo/ResourceBO.java
@@ -41,6 +41,10 @@ public class ResourceBO {
* 菜单图标
*/
private String icon;
+ /**
+ * 前端界面
+ */
+ private String view;
/**
* 添加时间
*/
diff --git a/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/service/permission/bo/ResourceCreateBO.java b/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/service/permission/bo/ResourceCreateBO.java
index 333882547..fd1d3cc26 100644
--- a/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/service/permission/bo/ResourceCreateBO.java
+++ b/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/service/permission/bo/ResourceCreateBO.java
@@ -48,6 +48,10 @@ public class ResourceCreateBO {
* 菜单图标
*/
private String icon;
+ /**
+ * 前端界面
+ */
+ private String view;
/**
* 创建管理员编号
diff --git a/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/service/permission/bo/ResourceUpdateBO.java b/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/service/permission/bo/ResourceUpdateBO.java
index f0fe9d14b..03486d44c 100644
--- a/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/service/permission/bo/ResourceUpdateBO.java
+++ b/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/service/permission/bo/ResourceUpdateBO.java
@@ -50,5 +50,9 @@ public class ResourceUpdateBO {
* 菜单图标
*/
private String icon;
+ /**
+ * 前端界面
+ */
+ private String view;
}