Browse Source

Merge branch 'master' of http://192.168.1.41:3000/outaozhen/cldV2react

# Conflicts:
#	src/components/PopContactForm/index.jsx
outaozhen 4 years ago
parent
commit
0e98fbbeea
100 changed files with 1421 additions and 1389 deletions
  1. 17 11
      .eslintrc.js
  2. 7 6
      .prettierrc.js
  3. 0 15
      .prettierrc.json
  4. 16 2
      .stylelintrc.js
  5. 4 3
      package.json
  6. 6 5
      src/assets/css/common.less
  7. 9 9
      src/components/Authorized/Authorized.jsx
  8. 8 9
      src/components/Authorized/AuthorizedRoute.jsx
  9. 22 22
      src/components/Authorized/CheckPermissions.jsx
  10. 31 32
      src/components/Authorized/PromiseRender.jsx
  11. 23 23
      src/components/Authorized/Secured.jsx
  12. 8 8
      src/components/Authorized/index.jsx
  13. 9 9
      src/components/Authorized/renderAuthorize.js
  14. 22 22
      src/components/GlobalHeader/AvatarDropdown.jsx
  15. 54 56
      src/components/GlobalHeader/NoticeIconView.jsx
  16. 15 17
      src/components/GlobalHeader/RightContent.jsx
  17. 6 6
      src/components/HeaderDropdown/index.jsx
  18. 30 32
      src/components/HeaderSearch/index.jsx
  19. 18 20
      src/components/NoticeIcon/NoticeList.jsx
  20. 48 51
      src/components/NoticeIcon/index.jsx
  21. 2 2
      src/components/PageLoading/index.jsx
  22. 234 142
      src/components/PopContactForm/index.jsx
  23. 1 1
      src/components/PopContactForm/index.less
  24. 1 1
      src/e2e/__mocks__/antd-pro-merge-less.js
  25. 34 38
      src/e2e/baseLayout.e2e.js
  26. 51 52
      src/global.jsx
  27. 47 49
      src/layouts/BasicLayout.jsx
  28. 6 6
      src/layouts/BasicLayout.less
  29. 3 3
      src/layouts/BlankLayout.jsx
  30. 21 21
      src/layouts/SecurityLayout.jsx
  31. 22 25
      src/layouts/UserLayout.jsx
  32. 9 9
      src/locales/en-US.js
  33. 2 2
      src/locales/en-US/component.js
  34. 2 2
      src/locales/en-US/globalHeader.js
  35. 2 2
      src/locales/en-US/menu.js
  36. 2 2
      src/locales/en-US/pages.js
  37. 2 2
      src/locales/en-US/pwa.js
  38. 2 2
      src/locales/en-US/settingDrawer.js
  39. 2 2
      src/locales/en-US/settings.js
  40. 8 8
      src/locales/id-ID.js
  41. 2 2
      src/locales/id-ID/component.js
  42. 2 2
      src/locales/id-ID/globalHeader.js
  43. 2 2
      src/locales/id-ID/menu.js
  44. 2 2
      src/locales/id-ID/pwa.js
  45. 2 2
      src/locales/id-ID/settingDrawer.js
  46. 2 2
      src/locales/id-ID/settings.js
  47. 8 8
      src/locales/pt-BR.js
  48. 2 2
      src/locales/pt-BR/component.js
  49. 2 2
      src/locales/pt-BR/globalHeader.js
  50. 2 2
      src/locales/pt-BR/menu.js
  51. 2 2
      src/locales/pt-BR/pwa.js
  52. 2 2
      src/locales/pt-BR/settingDrawer.js
  53. 2 2
      src/locales/pt-BR/settings.js
  54. 9 9
      src/locales/zh-CN.js
  55. 2 2
      src/locales/zh-CN/component.js
  56. 2 2
      src/locales/zh-CN/globalHeader.js
  57. 2 2
      src/locales/zh-CN/menu.js
  58. 2 2
      src/locales/zh-CN/pages.js
  59. 2 2
      src/locales/zh-CN/pwa.js
  60. 2 2
      src/locales/zh-CN/settingDrawer.js
  61. 2 2
      src/locales/zh-CN/settings.js
  62. 8 8
      src/locales/zh-TW.js
  63. 2 2
      src/locales/zh-TW/component.js
  64. 2 2
      src/locales/zh-TW/globalHeader.js
  65. 2 2
      src/locales/zh-TW/menu.js
  66. 2 2
      src/locales/zh-TW/pwa.js
  67. 2 2
      src/locales/zh-TW/settingDrawer.js
  68. 2 2
      src/locales/zh-TW/settings.js
  69. 11 11
      src/models/contact.js
  70. 44 44
      src/models/global.js
  71. 31 31
      src/models/login.js
  72. 13 13
      src/models/setting.js
  73. 19 19
      src/models/user.js
  74. 5 5
      src/pages/404.jsx
  75. 10 12
      src/pages/Admin.jsx
  76. 5 11
      src/pages/Customer/company.jsx
  77. 69 76
      src/pages/Customer/contact.jsx
  78. 3 2
      src/pages/Customer/customer.less
  79. 8 9
      src/pages/ListTableList/components/CreateForm.jsx
  80. 30 35
      src/pages/ListTableList/components/UpdateForm.jsx
  81. 101 106
      src/pages/ListTableList/index.jsx
  82. 9 9
      src/pages/ListTableList/service.js
  83. 7 9
      src/pages/Product/Cloud/build.jsx
  84. 6 8
      src/pages/Product/Cloud/curing.jsx
  85. 8 8
      src/pages/Product/Lock/lockcount.jsx
  86. 7 9
      src/pages/Product/Lock/lockstore.jsx
  87. 11 14
      src/pages/Welcome.jsx
  88. 8 8
      src/pages/Workbench/workbench.jsx
  89. 8 13
      src/pages/document.ejs
  90. 40 43
      src/pages/user/login/index.jsx
  91. 3 3
      src/pages/user/login/index.less
  92. 21 21
      src/service-worker.js
  93. 4 4
      src/services/contact.js
  94. 8 11
      src/services/login.js
  95. 4 4
      src/services/user.js
  96. 8 8
      src/utils/Authorized.js
  97. 11 11
      src/utils/authority.js
  98. 17 17
      src/utils/request.js
  99. 11 11
      src/utils/utils.js
  100. 0 0
      src/utils/utils.test.js

+ 17 - 11
.eslintrc.js

@@ -3,15 +3,21 @@ module.exports = {
   globals: {
     ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true,
     page: true,
-    REACT_APP_ENV: true
-  }
-  // rules: {
-  //   "semi": ["error", "never"],
-  // "no-multiple-empty-lines": [1, { "max": 2 }], //空行最多不能超过2行
-  // "comma-dangle": [2, "never"],
-  // "react/prop-types": 0,
-  // "array-bracket-spacing": ["error", "always"],
-  // "object-curly-spacing": ["error", "always"],
-  // "react-hooks/rules-of-hooks": "error"
-  // }
+    REACT_APP_ENV: true,
+  },
+  rules: {
+    'semi': ['error', 'never'],
+    'no-console': 0,
+    'comma-dangle': [2, 'never'],
+    'spaced-comment': 'error', // 注释前面必须有空格
+    'react/prop-types': 0,
+    // 'no-unused-vars': ['error', 'always'],
+    'array-bracket-spacing': ['error', 'always'],
+    'object-curly-spacing': ['error', 'always'],
+  },
+  settings: {
+    react: {
+      version: 'detect',
+    },
+  },
 }

+ 7 - 6
.prettierrc.js

@@ -1,13 +1,14 @@
-const fabric = require('@umijs/fabric');
+const fabric = require('@umijs/fabric')
 
 module.exports = {
   ...fabric.prettier,
-  'prettier.eslintIntegration': true,
-  eslintIntegration: true,
-  stylelintIntegration: true,
+  eslintIntegration: false,
+  stylelintIntegration: false,
   semi: false,
   quoteProps: 'consistent',
   htmlWhitespaceSensitivity: 'ignore',
   arrowParens: 'avoid',
-  jsxBracketSameLine: true,
-};
+  jsxBracketSameLine: false,
+  trailingComma: 'non',
+  bracketSpacing: true
+}

+ 0 - 15
.prettierrc.json

@@ -1,15 +0,0 @@
-{
-  "prettier.eslintIntegration": true,
-  "printWidth": 180,
-  "tabWidth": 2,
-  "eslintIntegration": true,
-  "stylelintIntegration": true,
-  "singleQuote": true,
-  "semi": false,
-  "trailingComma": "none",
-  "bracketSpacing": true,
-  "quoteProps": "consistent",
-  "htmlWhitespaceSensitivity": "ignore",
-  "arrowParens": "avoid",
-  "jsxBracketSameLine": true
-}

+ 16 - 2
.stylelintrc.js

@@ -1,5 +1,19 @@
-const fabric = require('@umijs/fabric');
+const fabric = require('@umijs/fabric')
 
 module.exports = {
   ...fabric.stylelint,
-};
+  rules: {
+    "indentation": 2,
+    "block-no-empty": null,
+    "color-no-invalid-hex": true,
+    "max-empty-lines": 2,
+    "rule-empty-line-before": null,
+    "unit-no-unknown": null,
+    "unit-whitelist": ["px", "em", "rem", "s", "rpx", "%", "vw", "vh", "deg"],
+    "selector-max-compound-selectors": 5,
+    "color-hex-length": "long",
+    "at-rule-no-unknown": null,
+    "selector-pseudo-class-no-unknown": [true, { "ignorePseudoClasses": ["global"] }]
+  },
+  ignoreFiles: ['**/*.js', '**/*.ts', 'src/assets/css/**'],
+}

+ 4 - 3
package.json

@@ -88,7 +88,7 @@
     "cross-port-killer": "^1.1.1",
     "detect-installer": "^1.0.1",
     "enzyme": "^3.11.0",
-    "eslint": "^7.1.0",
+    "eslint": "^7.18.0",
     "express": "^4.17.1",
     "gh-pages": "^3.0.0",
     "jsdom-global": "^3.0.2",
@@ -109,5 +109,6 @@
     "src/**/*.less",
     "config/**/*.js*",
     "scripts/**/*.js"
-  ]
-}
+  ],
+  "__npminstall_done": false
+}

+ 6 - 5
src/assets/css/common.less

@@ -1,14 +1,15 @@
 .text-right {
   text-align: right;
 }
-.pr-4{
+.pr-4 {
   padding-right: 1.5rem;
 }
-.pl-4{
+.pl-4 {
   padding-left: 1.5rem;
 }
-.sheet-left-panel,.sheet-right-panel{
+.sheet-left-panel,
+.sheet-right-panel {
   height: 834px;
-  overflow-y: auto;
   overflow-x: hidden;
-}
+  overflow-y: auto;
+}

+ 9 - 9
src/components/Authorized/Authorized.jsx

@@ -1,6 +1,6 @@
-import React from 'react';
-import { Result } from 'antd';
-import check from './CheckPermissions';
+import React from 'react'
+import { Result } from 'antd'
+import check from './CheckPermissions'
 
 const Authorized = ({
   children,
@@ -11,11 +11,11 @@ const Authorized = ({
       title="403"
       subTitle="Sorry, you are not authorized to access this page."
     />
-  ),
+  )
 }) => {
-  const childrenRender = typeof children === 'undefined' ? null : children;
-  const dom = check(authority, childrenRender, noMatch);
-  return <>{dom}</>;
-};
+  const childrenRender = typeof children === 'undefined' ? null : children
+  const dom = check(authority, childrenRender, noMatch)
+  return <>{dom}</>
+}
 
-export default Authorized;
+export default Authorized

+ 8 - 9
src/components/Authorized/AuthorizedRoute.jsx

@@ -1,6 +1,6 @@
-import { Redirect, Route } from 'umi';
-import React from 'react';
-import Authorized from './Authorized';
+import { Redirect, Route } from 'umi'
+import React from 'react'
+import Authorized from './Authorized'
 
 const AuthorizedRoute = ({ component: Component, render, authority, redirectPath, ...rest }) => (
   <Authorized
@@ -11,15 +11,14 @@ const AuthorizedRoute = ({ component: Component, render, authority, redirectPath
         render={() => (
           <Redirect
             to={{
-              pathname: redirectPath,
+              pathname: redirectPath
             }}
           />
         )}
       />
-    }
-  >
-    <Route {...rest} render={(props) => (Component ? <Component {...props} /> : render(props))} />
+    }>
+    <Route {...rest} render={props => (Component ? <Component {...props} /> : render(props))} />
   </Authorized>
-);
+)
 
-export default AuthorizedRoute;
+export default AuthorizedRoute

+ 22 - 22
src/components/Authorized/CheckPermissions.jsx

@@ -1,7 +1,7 @@
-import React from 'react';
-import { CURRENT } from './renderAuthorize'; // eslint-disable-next-line import/no-cycle
+import React from 'react'
+import { CURRENT } from './renderAuthorize' // eslint-disable-next-line import/no-cycle
 
-import PromiseRender from './PromiseRender';
+import PromiseRender from './PromiseRender'
 
 /**
  * 通用权限检查方法
@@ -15,58 +15,58 @@ const checkPermissions = (authority, currentAuthority, target, Exception) => {
   // 没有判定权限.默认查看所有
   // Retirement authority, return target;
   if (!authority) {
-    return target;
+    return target
   } // 数组处理
 
   if (Array.isArray(authority)) {
     if (Array.isArray(currentAuthority)) {
-      if (currentAuthority.some((item) => authority.includes(item))) {
-        return target;
+      if (currentAuthority.some(item => authority.includes(item))) {
+        return target
       }
     } else if (authority.includes(currentAuthority)) {
-      return target;
+      return target
     }
 
-    return Exception;
+    return Exception
   } // string 处理
 
   if (typeof authority === 'string') {
     if (Array.isArray(currentAuthority)) {
-      if (currentAuthority.some((item) => authority === item)) {
-        return target;
+      if (currentAuthority.some(item => authority === item)) {
+        return target
       }
     } else if (authority === currentAuthority) {
-      return target;
+      return target
     }
 
-    return Exception;
+    return Exception
   } // Promise 处理
 
   if (authority instanceof Promise) {
-    return <PromiseRender ok={target} error={Exception} promise={authority} />;
+    return <PromiseRender ok={target} error={Exception} promise={authority} />
   } // Function 处理
 
   if (typeof authority === 'function') {
-    const bool = authority(currentAuthority); // 函数执行后返回值是 Promise
+    const bool = authority(currentAuthority) // 函数执行后返回值是 Promise
 
     if (bool instanceof Promise) {
-      return <PromiseRender ok={target} error={Exception} promise={bool} />;
+      return <PromiseRender ok={target} error={Exception} promise={bool} />
     }
 
     if (bool) {
-      return target;
+      return target
     }
 
-    return Exception;
+    return Exception
   }
 
-  throw new Error('unsupported parameters');
-};
+  throw new Error('unsupported parameters')
+}
 
-export { checkPermissions };
+export { checkPermissions }
 
 function check(authority, target, Exception) {
-  return checkPermissions(authority, CURRENT, target, Exception);
+  return checkPermissions(authority, CURRENT, target, Exception)
 }
 
-export default check;
+export default check

+ 31 - 32
src/components/Authorized/PromiseRender.jsx

@@ -1,64 +1,64 @@
-import React from 'react';
-import { Spin } from 'antd';
-import isEqual from 'lodash/isEqual';
-import { isComponentClass } from './Secured'; // eslint-disable-next-line import/no-cycle
+import React from 'react'
+import { Spin } from 'antd'
+import isEqual from 'lodash/isEqual'
+import { isComponentClass } from './Secured' // eslint-disable-next-line import/no-cycle
 
 export default class PromiseRender extends React.Component {
   state = {
-    component: () => null,
-  };
+    component: () => null
+  }
 
   componentDidMount() {
-    this.setRenderComponent(this.props);
+    this.setRenderComponent(this.props)
   }
 
   shouldComponentUpdate = (nextProps, nextState) => {
-    const { component } = this.state;
+    const { component } = this.state
 
     if (!isEqual(nextProps, this.props)) {
-      this.setRenderComponent(nextProps);
+      this.setRenderComponent(nextProps)
     }
 
-    if (nextState.component !== component) return true;
-    return false;
-  }; // set render Component : ok or error
+    if (nextState.component !== component) return true
+    return false
+  } // set render Component : ok or error
 
   setRenderComponent(props) {
-    const ok = this.checkIsInstantiation(props.ok);
-    const error = this.checkIsInstantiation(props.error);
+    const ok = this.checkIsInstantiation(props.ok)
+    const error = this.checkIsInstantiation(props.error)
     props.promise
       .then(() => {
         this.setState({
-          component: ok,
-        });
-        return true;
+          component: ok
+        })
+        return true
       })
       .catch(() => {
         this.setState({
-          component: error,
-        });
-      });
+          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) => {
+  checkIsInstantiation = target => {
     if (isComponentClass(target)) {
-      const Target = target;
-      return (props) => <Target {...props} />;
+      const Target = target
+      return props => <Target {...props} />
     }
 
     if (React.isValidElement(target)) {
-      return (props) => React.cloneElement(target, props);
+      return props => React.cloneElement(target, props)
     }
 
-    return () => target;
-  };
+    return () => target
+  }
 
   render() {
-    const { component: Component } = this.state;
-    const { ok, error, promise, ...rest } = this.props;
+    const { component: Component } = this.state
+    const { ok, error, promise, ...rest } = this.props
     return Component ? (
       <Component {...rest} />
     ) : (
@@ -68,11 +68,10 @@ export default class PromiseRender extends React.Component {
           height: '100%',
           margin: 'auto',
           paddingTop: 50,
-          textAlign: 'center',
-        }}
-      >
+          textAlign: 'center'
+        }}>
         <Spin size="large" />
       </div>
-    );
+    )
   }
 }

+ 23 - 23
src/components/Authorized/Secured.jsx

@@ -1,34 +1,34 @@
-import React from 'react';
-import CheckPermissions from './CheckPermissions';
+import React from 'react'
+import CheckPermissions from './CheckPermissions'
 /**
  * 默认不能访问任何页面
  * default is "NULL"
  */
 
-const Exception403 = () => 403;
+const Exception403 = () => 403
 
-export const isComponentClass = (component) => {
-  if (!component) return false;
-  const proto = Object.getPrototypeOf(component);
-  if (proto === React.Component || proto === Function.prototype) return true;
-  return isComponentClass(proto);
-}; // Determine whether the incoming component has been instantiated
+export const isComponentClass = component => {
+  if (!component) return false
+  const proto = Object.getPrototypeOf(component)
+  if (proto === React.Component || proto === Function.prototype) return true
+  return isComponentClass(proto)
+} // 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) => {
+const checkIsInstantiation = target => {
   if (isComponentClass(target)) {
-    const Target = target;
-    return (props) => <Target {...props} />;
+    const Target = target
+    return props => <Target {...props} />
   }
 
   if (React.isValidElement(target)) {
-    return (props) => React.cloneElement(target, props);
+    return props => React.cloneElement(target, props)
   }
 
-  return () => target;
-};
+  return () => target
+}
 /**
  * 用于判断是否拥有权限访问此 view 权限
  * authority 支持传入 string, () => boolean | Promise
@@ -51,20 +51,20 @@ const authorize = (authority, error) => {
    * 防止传入字符串时找不到staticContext造成报错
    * String parameters can cause staticContext not found error
    */
-  let classError = false;
+  let classError = false
 
   if (error) {
-    classError = () => error;
+    classError = () => error
   }
 
   if (!authority) {
-    throw new Error('authority is required');
+    throw new Error('authority is required')
   }
 
   return function decideAuthority(target) {
-    const component = CheckPermissions(authority, target, classError || Exception403);
-    return checkIsInstantiation(component);
-  };
-};
+    const component = CheckPermissions(authority, target, classError || Exception403)
+    return checkIsInstantiation(component)
+  }
+}
 
-export default authorize;
+export default authorize

+ 8 - 8
src/components/Authorized/index.jsx

@@ -1,9 +1,9 @@
-import Authorized from './Authorized';
-import Secured from './Secured';
-import check from './CheckPermissions';
-import renderAuthorize from './renderAuthorize';
+import Authorized from './Authorized'
+import Secured from './Secured'
+import check from './CheckPermissions'
+import renderAuthorize from './renderAuthorize'
 
-Authorized.Secured = Secured;
-Authorized.check = check;
-const RenderAuthorize = renderAuthorize(Authorized);
-export default RenderAuthorize;
+Authorized.Secured = Secured
+Authorized.check = check
+const RenderAuthorize = renderAuthorize(Authorized)
+export default RenderAuthorize

+ 9 - 9
src/components/Authorized/renderAuthorize.js

@@ -1,30 +1,30 @@
 /* eslint-disable eslint-comments/disable-enable-pair */
 
 /* eslint-disable import/no-mutable-exports */
-let CURRENT = 'NULL';
+let CURRENT = 'NULL'
 
 /**
  * use  authority or getAuthority
  * @param {string|()=>String} currentAuthority
  */
-const renderAuthorize = (Authorized) => (currentAuthority) => {
+const renderAuthorize = Authorized => currentAuthority => {
   if (currentAuthority) {
     if (typeof currentAuthority === 'function') {
-      CURRENT = currentAuthority();
+      CURRENT = currentAuthority()
     }
 
     if (
       Object.prototype.toString.call(currentAuthority) === '[object String]' ||
       Array.isArray(currentAuthority)
     ) {
-      CURRENT = currentAuthority;
+      CURRENT = currentAuthority
     }
   } else {
-    CURRENT = 'NULL';
+    CURRENT = 'NULL'
   }
 
-  return Authorized;
-};
+  return Authorized
+}
 
-export { CURRENT };
-export default (Authorized) => renderAuthorize(Authorized);
+export { CURRENT }
+export default Authorized => renderAuthorize(Authorized)

+ 22 - 22
src/components/GlobalHeader/AvatarDropdown.jsx

@@ -1,37 +1,37 @@
-import { LogoutOutlined, SettingOutlined, UserOutlined } from '@ant-design/icons';
-import { Avatar, Menu, Spin } from 'antd';
-import React from 'react';
-import { history, connect } from 'umi';
-import HeaderDropdown from '../HeaderDropdown';
-import styles from './index.less';
+import { LogoutOutlined, SettingOutlined, UserOutlined } from '@ant-design/icons'
+import { Avatar, Menu, Spin } from 'antd'
+import React from 'react'
+import { history, connect } from 'umi'
+import HeaderDropdown from '../HeaderDropdown'
+import styles from './index.less'
 
 class AvatarDropdown extends React.Component {
-  onMenuClick = (event) => {
-    const { key } = event;
+  onMenuClick = event => {
+    const { key } = event
 
     if (key === 'logout') {
-      const { dispatch } = this.props;
+      const { dispatch } = this.props
 
       if (dispatch) {
         dispatch({
-          type: 'login/logout',
-        });
+          type: 'login/logout'
+        })
       }
 
-      return;
+      return
     }
 
-    history.push(`/account/${key}`);
-  };
+    history.push(`/account/${key}`)
+  }
 
   render() {
     const {
       currentUser = {
         avatar: '',
-        name: '',
+        name: ''
       },
-      menu,
-    } = this.props;
+      menu
+    } = this.props
     const menuHeaderDropdown = (
       <Menu className={styles.menu} selectedKeys={[]} onClick={this.onMenuClick}>
         {menu && (
@@ -53,7 +53,7 @@ class AvatarDropdown extends React.Component {
           退出登录
         </Menu.Item>
       </Menu>
-    );
+    )
     return currentUser && currentUser.name ? (
       <HeaderDropdown overlay={menuHeaderDropdown}>
         <span className={`${styles.action} ${styles.account}`}>
@@ -67,14 +67,14 @@ class AvatarDropdown extends React.Component {
           size="small"
           style={{
             marginLeft: 8,
-            marginRight: 8,
+            marginRight: 8
           }}
         />
       </span>
-    );
+    )
   }
 }
 
 export default connect(({ user }) => ({
-  currentUser: user.currentUser,
-}))(AvatarDropdown);
+  currentUser: user.currentUser
+}))(AvatarDropdown)

+ 54 - 56
src/components/GlobalHeader/NoticeIconView.jsx

@@ -1,62 +1,62 @@
-import React, { Component } from 'react';
-import { connect } from 'umi';
-import { Tag, message } from 'antd';
-import groupBy from 'lodash/groupBy';
-import moment from 'moment';
-import NoticeIcon from '../NoticeIcon';
-import styles from './index.less';
+import React, { Component } from 'react'
+import { connect } from 'umi'
+import { Tag, message } from 'antd'
+import groupBy from 'lodash/groupBy'
+import moment from 'moment'
+import NoticeIcon from '../NoticeIcon'
+import styles from './index.less'
 
 class GlobalHeaderRight extends Component {
   componentDidMount() {
-    const { dispatch } = this.props;
+    const { dispatch } = this.props
 
     if (dispatch) {
       dispatch({
-        type: 'global/fetchNotices',
-      });
+        type: 'global/fetchNotices'
+      })
     }
   }
 
-  changeReadState = (clickedItem) => {
-    const { id } = clickedItem;
-    const { dispatch } = this.props;
+  changeReadState = clickedItem => {
+    const { id } = clickedItem
+    const { dispatch } = this.props
 
     if (dispatch) {
       dispatch({
         type: 'global/changeNoticeReadState',
-        payload: id,
-      });
+        payload: id
+      })
     }
-  };
+  }
 
   handleNoticeClear = (title, key) => {
-    const { dispatch } = this.props;
-    message.success(`${'清空了'} ${title}`);
+    const { dispatch } = this.props
+    message.success(`${'清空了'} ${title}`)
 
     if (dispatch) {
       dispatch({
         type: 'global/clearNotices',
-        payload: key,
-      });
+        payload: key
+      })
     }
-  };
+  }
 
   getNoticeData = () => {
-    const { notices = [] } = this.props;
+    const { notices = [] } = this.props
 
     if (!notices || notices.length === 0 || !Array.isArray(notices)) {
-      return {};
+      return {}
     }
 
-    const newNotices = notices.map((notice) => {
-      const newNotice = { ...notice };
+    const newNotices = notices.map(notice => {
+      const newNotice = { ...notice }
 
       if (newNotice.datetime) {
-        newNotice.datetime = moment(notice.datetime).fromNow();
+        newNotice.datetime = moment(notice.datetime).fromNow()
       }
 
       if (newNotice.id) {
-        newNotice.key = newNotice.id;
+        newNotice.key = newNotice.id
       }
 
       if (newNotice.extra && newNotice.status) {
@@ -64,51 +64,50 @@ class GlobalHeaderRight extends Component {
           todo: '',
           processing: 'blue',
           urgent: 'red',
-          doing: 'gold',
-        }[newNotice.status];
+          doing: 'gold'
+        }[newNotice.status]
         newNotice.extra = (
           <Tag
             color={color}
             style={{
-              marginRight: 0,
-            }}
-          >
+              marginRight: 0
+            }}>
             {newNotice.extra}
           </Tag>
-        );
+        )
       }
 
-      return newNotice;
-    });
-    return groupBy(newNotices, 'type');
-  };
+      return newNotice
+    })
+    return groupBy(newNotices, 'type')
+  }
 
-  getUnreadData = (noticeData) => {
-    const unreadMsg = {};
-    Object.keys(noticeData).forEach((key) => {
-      const value = noticeData[key];
+  getUnreadData = noticeData => {
+    const unreadMsg = {}
+    Object.keys(noticeData).forEach(key => {
+      const value = noticeData[key]
 
       if (!unreadMsg[key]) {
-        unreadMsg[key] = 0;
+        unreadMsg[key] = 0
       }
 
       if (Array.isArray(value)) {
-        unreadMsg[key] = value.filter((item) => !item.read).length;
+        unreadMsg[key] = value.filter(item => !item.read).length
       }
-    });
-    return unreadMsg;
-  };
+    })
+    return unreadMsg
+  }
 
   render() {
-    const { currentUser, fetchingNotices, onNoticeVisibleChange } = this.props;
-    const noticeData = this.getNoticeData();
-    const unreadMsg = this.getUnreadData(noticeData);
+    const { currentUser, fetchingNotices, onNoticeVisibleChange } = this.props
+    const noticeData = this.getNoticeData()
+    const unreadMsg = this.getUnreadData(noticeData)
     return (
       <NoticeIcon
         className={styles.action}
         count={currentUser && currentUser.unreadCount}
-        onItemClick={(item) => {
-          this.changeReadState(item);
+        onItemClick={item => {
+          this.changeReadState(item)
         }}
         loading={fetchingNotices}
         clearText="清空"
@@ -116,8 +115,7 @@ class GlobalHeaderRight extends Component {
         onClear={this.handleNoticeClear}
         onPopupVisibleChange={onNoticeVisibleChange}
         onViewMore={() => message.info('Click on view more')}
-        clearClose
-      >
+        clearClose>
         <NoticeIcon.Tab
           tabKey="notification"
           count={unreadMsg.notification}
@@ -143,7 +141,7 @@ class GlobalHeaderRight extends Component {
           showViewMore
         />
       </NoticeIcon>
-    );
+    )
   }
 }
 
@@ -152,5 +150,5 @@ export default connect(({ user, global, loading }) => ({
   collapsed: global.collapsed,
   fetchingMoreNotices: loading.effects['global/fetchMoreNotices'],
   fetchingNotices: loading.effects['global/fetchNotices'],
-  notices: global.notices,
-}))(GlobalHeaderRight);
+  notices: global.notices
+}))(GlobalHeaderRight)

+ 15 - 17
src/components/GlobalHeader/RightContent.jsx

@@ -1,23 +1,21 @@
-import { Tooltip, Tag } from 'antd';
-import { QuestionCircleOutlined } from '@ant-design/icons';
-import React from 'react';
-import { connect, SelectLang } from 'umi';
-import Avatar from './AvatarDropdown';
-import HeaderSearch from '../HeaderSearch';
-import styles from './index.less';
+import React from 'react'
+import { connect } from 'umi'
+import Avatar from './AvatarDropdown'
+import styles from './index.less'
+import { Tag } from 'antd'
 
 const ENVTagColor = {
   dev: 'orange',
   test: 'green',
-  pre: '#87d068',
-};
+  pre: '#87d068'
+}
 
-const GlobalHeaderRight = (props) => {
-  const { theme, layout } = props;
-  let className = styles.right;
+const GlobalHeaderRight = props => {
+  const { theme, layout } = props
+  let className = styles.right
 
   if (theme === 'dark' && layout === 'top') {
-    className = `${styles.right}  ${styles.dark}`;
+    className = `${styles.right}  ${styles.dark}`
   }
 
   return (
@@ -68,10 +66,10 @@ const GlobalHeaderRight = (props) => {
       )}
       {/* <SelectLang className={styles.action} /> */}
     </div>
-  );
-};
+  )
+}
 
 export default connect(({ settings }) => ({
   theme: settings.navTheme,
-  layout: settings.layout,
-}))(GlobalHeaderRight);
+  layout: settings.layout
+}))(GlobalHeaderRight)

+ 6 - 6
src/components/HeaderDropdown/index.jsx

@@ -1,10 +1,10 @@
-import { Dropdown } from 'antd';
-import React from 'react';
-import classNames from 'classnames';
-import styles from './index.less';
+import { Dropdown } from 'antd'
+import React from 'react'
+import classNames from 'classnames'
+import styles from './index.less'
 
 const HeaderDropdown = ({ overlayClassName: cls, ...restProps }) => (
   <Dropdown overlayClassName={classNames(styles.container, cls)} {...restProps} />
-);
+)
 
-export default HeaderDropdown;
+export default HeaderDropdown

+ 30 - 32
src/components/HeaderSearch/index.jsx

@@ -1,11 +1,11 @@
-import { SearchOutlined } from '@ant-design/icons';
-import { AutoComplete, Input } from 'antd';
-import useMergeValue from 'use-merge-value';
-import React, { useRef } from 'react';
-import classNames from 'classnames';
-import styles from './index.less';
+import { SearchOutlined } from '@ant-design/icons'
+import { AutoComplete, Input } from 'antd'
+import useMergeValue from 'use-merge-value'
+import React, { useRef } from 'react'
+import classNames from 'classnames'
+import styles from './index.less'
 
-const HeaderSearch = (props) => {
+const HeaderSearch = props => {
   const {
     className,
     defaultValue,
@@ -14,41 +14,40 @@ const HeaderSearch = (props) => {
     open,
     defaultOpen,
     ...restProps
-  } = props;
-  const inputRef = useRef(null);
-  const [value, setValue] = useMergeValue(defaultValue, {
+  } = props
+  const inputRef = useRef(null)
+  const [ value, setValue ] = useMergeValue(defaultValue, {
     value: props.value,
-    onChange: props.onChange,
-  });
-  const [searchMode, setSearchMode] = useMergeValue(defaultOpen || false, {
+    onChange: props.onChange
+  })
+  const [ searchMode, setSearchMode ] = useMergeValue(defaultOpen || false, {
     value: props.open,
-    onChange: onVisibleChange,
-  });
+    onChange: onVisibleChange
+  })
   const inputClass = classNames(styles.input, {
-    [styles.show]: searchMode,
-  });
+    [styles.show]: searchMode
+  })
   return (
     <div
       className={classNames(className, styles.headerSearch)}
       onClick={() => {
-        setSearchMode(true);
+        setSearchMode(true)
 
         if (searchMode && inputRef.current) {
-          inputRef.current.focus();
+          inputRef.current.focus()
         }
       }}
       onTransitionEnd={({ propertyName }) => {
         if (propertyName === 'width' && !searchMode) {
           if (onVisibleChange) {
-            onVisibleChange(searchMode);
+            onVisibleChange(searchMode)
           }
         }
-      }}
-    >
+      }}>
       <SearchOutlined
         key="Icon"
         style={{
-          cursor: 'pointer',
+          cursor: 'pointer'
         }}
       />
       <AutoComplete
@@ -57,30 +56,29 @@ const HeaderSearch = (props) => {
         value={value}
         style={{
           height: 28,
-          marginTop: -6,
+          marginTop: -6
         }}
         options={restProps.options}
-        onChange={setValue}
-      >
+        onChange={setValue}>
         <Input
           ref={inputRef}
           defaultValue={defaultValue}
           aria-label={placeholder}
           placeholder={placeholder}
-          onKeyDown={(e) => {
+          onKeyDown={e => {
             if (e.key === 'Enter') {
               if (restProps.onSearch) {
-                restProps.onSearch(value);
+                restProps.onSearch(value)
               }
             }
           }}
           onBlur={() => {
-            setSearchMode(false);
+            setSearchMode(false)
           }}
         />
       </AutoComplete>
     </div>
-  );
-};
+  )
+}
 
-export default HeaderSearch;
+export default HeaderSearch

+ 18 - 20
src/components/NoticeIcon/NoticeList.jsx

@@ -1,7 +1,7 @@
-import { Avatar, List } from 'antd';
-import React from 'react';
-import classNames from 'classnames';
-import styles from './NoticeList.less';
+import { Avatar, List } from 'antd'
+import React from 'react'
+import classNames from 'classnames'
+import styles from './NoticeList.less'
 
 const NoticeList = ({
   data = [],
@@ -13,7 +13,7 @@ const NoticeList = ({
   showClear = true,
   clearText,
   viewMoreText,
-  showViewMore = false,
+  showViewMore = false
 }) => {
   if (!data || data.length === 0) {
     return (
@@ -24,7 +24,7 @@ const NoticeList = ({
         />
         <div>{emptyText}</div>
       </div>
-    );
+    )
   }
 
   return (
@@ -34,22 +34,21 @@ const NoticeList = ({
         dataSource={data}
         renderItem={(item, i) => {
           const itemCls = classNames(styles.item, {
-            [styles.read]: item.read,
-          }); // eslint-disable-next-line no-nested-ternary
-
+            [styles.read]: item.read
+          })
+          // eslint-disable-next-line no-nested-ternary
           const leftIcon = item.avatar ? (
             typeof item.avatar === 'string' ? (
               <Avatar className={styles.avatar} src={item.avatar} />
             ) : (
               <span className={styles.iconElement}>{item.avatar}</span>
             )
-          ) : null;
+          ) : null
           return (
             <List.Item
               className={itemCls}
               key={item.key || i}
-              onClick={() => onClick && onClick(item)}
-            >
+              onClick={() => onClick && onClick(item)}>
               <List.Item.Meta
                 className={styles.meta}
                 avatar={leftIcon}
@@ -67,7 +66,7 @@ const NoticeList = ({
                 }
               />
             </List.Item>
-          );
+          )
         }}
       />
       <div className={styles.bottomBar}>
@@ -78,18 +77,17 @@ const NoticeList = ({
         ) : null}
         {showViewMore ? (
           <div
-            onClick={(e) => {
+            onClick={e => {
               if (onViewMore) {
-                onViewMore(e);
+                onViewMore(e)
               }
-            }}
-          >
+            }}>
             {viewMoreText}
           </div>
         ) : null}
       </div>
     </div>
-  );
-};
+  )
+}
 
-export default NoticeList;
+export default NoticeList

+ 48 - 51
src/components/NoticeIcon/index.jsx

@@ -1,15 +1,15 @@
-import { BellOutlined } from '@ant-design/icons';
-import { Badge, Spin, Tabs } from 'antd';
-import useMergeValue from 'use-merge-value';
-import React from 'react';
-import classNames from 'classnames';
-import NoticeList from './NoticeList';
-import HeaderDropdown from '../HeaderDropdown';
-import styles from './index.less';
+import { BellOutlined } from '@ant-design/icons'
+import { Badge, Spin, Tabs } from 'antd'
+import useMergeValue from 'use-merge-value'
+import React from 'react'
+import classNames from 'classnames'
+import NoticeList from './NoticeList'
+import HeaderDropdown from '../HeaderDropdown'
+import styles from './index.less'
 
-const { TabPane } = Tabs;
+const { TabPane } = Tabs
 
-const NoticeIcon = (props) => {
+const NoticeIcon = props => {
   const getNotificationBox = () => {
     const {
       children,
@@ -19,23 +19,23 @@ const NoticeIcon = (props) => {
       onItemClick,
       onViewMore,
       clearText,
-      viewMoreText,
-    } = props;
+      viewMoreText
+    } = props
 
     if (!children) {
-      return null;
+      return null
     }
 
-    const panes = [];
-    React.Children.forEach(children, (child) => {
+    const panes = []
+    React.Children.forEach(children, child => {
       if (!child) {
-        return;
+        return
       }
 
-      const { list, title, count, tabKey, showClear, showViewMore } = child.props;
-      const len = list && list.length ? list.length : 0;
-      const msgCount = count || count === 0 ? count : len;
-      const tabTitle = msgCount > 0 ? `${title} (${msgCount})` : title;
+      const { list, title, count, tabKey, showClear, showViewMore } = child.props
+      const len = list && list.length ? list.length : 0
+      const msgCount = count || count === 0 ? count : len
+      const tabTitle = msgCount > 0 ? `${title} (${msgCount})` : title
       panes.push(
         <TabPane tab={tabTitle} key={tabKey}>
           <NoticeList
@@ -44,52 +44,50 @@ const NoticeIcon = (props) => {
             viewMoreText={viewMoreText}
             data={list}
             onClear={() => onClear && onClear(title, tabKey)}
-            onClick={(item) => onItemClick && onItemClick(item, child.props)}
-            onViewMore={(event) => onViewMore && onViewMore(child.props, event)}
+            onClick={item => onItemClick && onItemClick(item, child.props)}
+            onViewMore={event => onViewMore && onViewMore(child.props, event)}
             showClear={showClear}
             showViewMore={showViewMore}
             title={title}
           />
-        </TabPane>,
-      );
-    });
+        </TabPane>
+      )
+    })
     return (
       <Spin spinning={loading} delay={300}>
         <Tabs className={styles.tabs} onChange={onTabChange}>
           {panes}
         </Tabs>
       </Spin>
-    );
-  };
+    )
+  }
 
-  const { className, count, bell } = props;
-  const [visible, setVisible] = useMergeValue(false, {
+  const { className, count, bell } = props
+  const [ visible, setVisible ] = useMergeValue(false, {
     value: props.popupVisible,
-    onChange: props.onPopupVisibleChange,
-  });
-  const noticeButtonClass = classNames(className, styles.noticeButton);
-  const notificationBox = getNotificationBox();
-  const NoticeBellIcon = bell || <BellOutlined className={styles.icon} />;
+    onChange: props.onPopupVisibleChange
+  })
+  const noticeButtonClass = classNames(className, styles.noticeButton)
+  const notificationBox = getNotificationBox()
+  const NoticeBellIcon = bell || <BellOutlined className={styles.icon} />
   const trigger = (
     <span
       className={classNames(noticeButtonClass, {
-        opened: visible,
-      })}
-    >
+        opened: visible
+      })}>
       <Badge
         count={count}
         style={{
-          boxShadow: 'none',
+          boxShadow: 'none'
         }}
-        className={styles.badge}
-      >
+        className={styles.badge}>
         {NoticeBellIcon}
       </Badge>
     </span>
-  );
+  )
 
   if (!notificationBox) {
-    return trigger;
+    return trigger
   }
 
   return (
@@ -97,17 +95,16 @@ const NoticeIcon = (props) => {
       placement="bottomRight"
       overlay={notificationBox}
       overlayClassName={styles.popover}
-      trigger={['click']}
+      trigger={[ 'click' ]}
       visible={visible}
-      onVisibleChange={setVisible}
-    >
+      onVisibleChange={setVisible}>
       {trigger}
     </HeaderDropdown>
-  );
-};
+  )
+}
 
 NoticeIcon.defaultProps = {
-  emptyImage: 'https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg',
-};
-NoticeIcon.Tab = NoticeList;
-export default NoticeIcon;
+  emptyImage: 'https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg'
+}
+NoticeIcon.Tab = NoticeList
+export default NoticeIcon

+ 2 - 2
src/components/PageLoading/index.jsx

@@ -1,4 +1,4 @@
-import { PageLoading } from '@ant-design/pro-layout'; // loading components from code split
+import { PageLoading } from '@ant-design/pro-layout' // loading components from code split
 // https://umijs.org/plugin/umi-plugin-react.html#dynamicimport
 
-export default PageLoading;
+export default PageLoading

+ 234 - 142
src/components/PopContactForm/index.jsx

@@ -1,10 +1,10 @@
-import { Button, Drawer, Form, Input,Row, Col, Tabs, Cascader, Select, Tag } from 'antd'
+import { Button, Drawer, Form, Input, Row, Col, Tabs, Cascader, Select, Tag } from 'antd'
 import React, { useState, useEffect } from 'react'
 import styles from './index.less'
 
 const Popcontactform = props => {
   // 浏览器实际宽度
-  const [clientWidth, setClientWidth] = useState(document.body.clientWidth * 0.75)
+  const [ clientWidth, setClientWidth ] = useState(document.body.clientWidth * 0.75)
   useEffect(() => {
     window.addEventListener('resize', () => {
       setClientWidth(document.body.clientWidth * 0.7)
@@ -14,10 +14,10 @@ const Popcontactform = props => {
     }
   }, [])
   const { visible, onClose, onCreate } = props
-  const [form] = Form.useForm()
-  const { TabPane } = Tabs;
+  const [ form ] = Form.useForm()
+  const { TabPane } = Tabs
   function callback(key) {
-    console.log(key);
+    console.log(key)
   }
   const residences = [
     {
@@ -30,11 +30,11 @@ const Popcontactform = props => {
           children: [
             {
               value: '香洲区',
-              label: '香洲区',
-            },
-          ],
-        },
-      ],
+              label: '香洲区'
+            }
+          ]
+        }
+      ]
     },
     {
       value: '安徽省',
@@ -46,13 +46,13 @@ const Popcontactform = props => {
           children: [
             {
               value: '庐阳区',
-              label: '庐阳区',
-            },
-          ],
-        },
-      ],
-    },
-  ];
+              label: '庐阳区'
+            }
+          ]
+        }
+      ]
+    }
+  ]
   return (
     <div>
       <div className="sheet-box">
@@ -68,117 +68,11 @@ const Popcontactform = props => {
           <Row>
             <Col span={12} className="sheet-box-left">
               <div className="sheet-left-panel pr-4">
-              <Row>
-                <Col span={12}><h2>刘泽富</h2></Col>
-                <Col span={12} className={["text-right",styles.textMuted]}>陈特 创建于 2019年5月6日 14:55</Col>
-              </Row>
-              <Form layout="vertical" form={form}>
-                <Row gutter={16}>
-                  <Col span={24}>
-                    <Form.Item
-                    label="姓名"
-                    name="clientname"
-                    rules={[{ required: false, message: '姓名' }]}
-                    >
-                    <Input value="刘泽富" />
-                    </Form.Item>
-                  </Col>
-                </Row>
-                <Row gutter={16}>
-                  <Col span={24}>
-                    <Form.Item
-                    label="联系人地区"
-                    name="local"
-                    rules={[{ required: false, message: '地区' }]}
-                    >
-                    <Cascader options={residences} />
-                    </Form.Item>
-                  </Col>
-                </Row>
-                <Row gutter={16}>
-                  <Col span={24}>
-                    <Form.Item
-                    label="客户名称"
-                    name="companyname"
-                    rules={[{ required: false, message: '客户名称' }]}
-                    >
-                    <Input value="刘泽富" />
-                    </Form.Item>
-                  </Col>
-                </Row>
-                <Row gutter={16}>
-                  <Col span={12}>
-                    <Form.Item
-                    label="性别"
-                    name=""
-                    rules={[{ required: false, message: '性别' }]}
-                    >
-                    <Select>
-                      <Select.Option value="男">男</Select.Option>
-                      <Select.Option value="女">女</Select.Option>
-                    </Select>
-                    </Form.Item>
-                  </Col>
-                  <Col span={12}>
-                  <Form.Item
-                    label="昵称"
-                    name=""
-                    rules={[{ required: false, message: '昵称' }]}
-                    >
-                    <Input value="" />
-                    </Form.Item>
-                  </Col>
-                </Row>
-                <Row gutter={16}>
-                  <Col span={12}>
-                    <Form.Item
-                    label="手机"
-                    name=""
-                    rules={[{ required: false, message: '手机' }]}
-                    >
-                    <Input value="" />
-                    </Form.Item>
-                  </Col>
-                  <Col span={12}>
-                  <Form.Item
-                    label="QQ"
-                    name=""
-                    rules={[{ required: false, message: 'QQ' }]}
-                    >
-                    <Input value="" />
-                    </Form.Item>
-                  </Col>
-                </Row>
-                <Row gutter={16}>
-                  <Col span={12}>
-                    <Form.Item
-                    label="电话"
-                    name=""
-                    rules={[{ required: false, message: '电话' }]}
-                    >
-                    <Input value="" />
-                    </Form.Item>
-                  </Col>
+                <Row>
                   <Col span={12}>
-                  <Form.Item
-                    label="邮箱"
-                    name=""
-                    rules={[{ required: false, message: '邮箱' }]}
-                    >
-                    <Input value="" />
-                    </Form.Item>
-                  </Col>
-                </Row>
-                <Row gutter={16}>
-                  <Col span={12}>
-                    <Form.Item
-                    label="传真"
-                    name=""
-                    rules={[{ required: false, message: '传真' }]}
-                    >
-                    <Input value="" />
-                    </Form.Item>
+                    <h2>刘泽富</h2>
                   </Col>
+<<<<<<< HEAD
                   <Col span={12} />
                 </Row>
                 <Row gutter={16}>
@@ -279,24 +173,222 @@ const Popcontactform = props => {
                   <Form.Item label="协作标签">
                       <span className="ant-form-text"><Tag color="#F8AC59">协作标签1</Tag><Tag color="#FF69B4">协作标签2</Tag></span>
                     </Form.Item>
+=======
+                  <Col span={12} className={[ 'text-right', styles.textMuted ]}>
+                    陈特 创建于 2019年5月6日 14:55
+>>>>>>> 767e7591691003ec250a9826a0d768eb69b929d6
                   </Col>
                 </Row>
-              </Form>
-              <Button
-                type="primary"
-                className="ant-btn ant-btn-primary"
-                onClick={() => {
-                  form
-                    .validateFields()
-                    .then(values => {
-                      onCreate(values)
-                    })
-                    .catch(err => {
-                      console.log(err)
-                    })
-                }}>
-                确定
-              </Button>
+                <Form layout="vertical" form={form}>
+                  <Row gutter={16}>
+                    <Col span={24}>
+                      <Form.Item
+                        label="姓名"
+                        name="clientname"
+                        rules={[ { required: false, message: '姓名' } ]}>
+                        <Input value="刘泽富" />
+                      </Form.Item>
+                    </Col>
+                  </Row>
+                  <Row gutter={16}>
+                    <Col span={24}>
+                      <Form.Item
+                        label="联系人地区"
+                        name="local"
+                        rules={[ { required: false, message: '地区' } ]}>
+                        <Cascader options={residences} />
+                      </Form.Item>
+                    </Col>
+                  </Row>
+                  <Row gutter={16}>
+                    <Col span={24}>
+                      <Form.Item
+                        label="客户名称"
+                        name="companyname"
+                        rules={[ { required: false, message: '客户名称' } ]}>
+                        <Input value="刘泽富" />
+                      </Form.Item>
+                    </Col>
+                  </Row>
+                  <Row gutter={16}>
+                    <Col span={12}>
+                      <Form.Item
+                        label="性别"
+                        name=""
+                        rules={[ { required: false, message: '性别' } ]}>
+                        <Select>
+                          <Select.Option value="男">男</Select.Option>
+                          <Select.Option value="女">女</Select.Option>
+                        </Select>
+                      </Form.Item>
+                    </Col>
+                    <Col span={12}>
+                      <Form.Item
+                        label="昵称"
+                        name=""
+                        rules={[ { required: false, message: '昵称' } ]}>
+                        <Input value="" />
+                      </Form.Item>
+                    </Col>
+                  </Row>
+                  <Row gutter={16}>
+                    <Col span={12}>
+                      <Form.Item
+                        label="手机"
+                        name=""
+                        rules={[ { required: false, message: '手机' } ]}>
+                        <Input value="" />
+                      </Form.Item>
+                    </Col>
+                    <Col span={12}>
+                      <Form.Item label="QQ" name="" rules={[ { required: false, message: 'QQ' } ]}>
+                        <Input value="" />
+                      </Form.Item>
+                    </Col>
+                  </Row>
+                  <Row gutter={16}>
+                    <Col span={12}>
+                      <Form.Item
+                        label="电话"
+                        name=""
+                        rules={[ { required: false, message: '电话' } ]}>
+                        <Input value="" />
+                      </Form.Item>
+                    </Col>
+                    <Col span={12}>
+                      <Form.Item
+                        label="邮箱"
+                        name=""
+                        rules={[ { required: false, message: '邮箱' } ]}>
+                        <Input value="" />
+                      </Form.Item>
+                    </Col>
+                  </Row>
+                  <Row gutter={16}>
+                    <Col span={12}>
+                      <Form.Item
+                        label="传真"
+                        name=""
+                        rules={[ { required: false, message: '传真' } ]}>
+                        <Input value="" />
+                      </Form.Item>
+                    </Col>
+                    <Col span={12}></Col>
+                  </Row>
+                  <Row gutter={16}>
+                    <Col span={12}>
+                      <Form.Item
+                        label="部门"
+                        name=""
+                        rules={[ { required: false, message: '部门' } ]}>
+                        <Input value="" />
+                      </Form.Item>
+                    </Col>
+                    <Col span={12}>
+                      <Form.Item
+                        label="职务"
+                        name=""
+                        rules={[ { required: false, message: '职务' } ]}>
+                        <Input value="" />
+                      </Form.Item>
+                    </Col>
+                  </Row>
+                  <Row gutter={16}>
+                    <Col span={24}>
+                      <Form.Item
+                        label="办公室"
+                        name=""
+                        rules={[ { required: false, message: '办公室' } ]}>
+                        <Input value="" />
+                      </Form.Item>
+                    </Col>
+                  </Row>
+                  <Row gutter={16}>
+                    <Col span={24}>
+                      <Form.Item
+                        label="联系人地址"
+                        name=""
+                        rules={[ { required: false, message: '联系人地址' } ]}>
+                        <Input value="" />
+                      </Form.Item>
+                    </Col>
+                  </Row>
+                  <Row gutter={16}>
+                    <Col span={24}>
+                      <Form.Item
+                        label="联系人乘车"
+                        name=""
+                        rules={[ { required: false, message: '联系人乘车' } ]}>
+                        <Input value="" />
+                      </Form.Item>
+                    </Col>
+                  </Row>
+                  <Row gutter={16}>
+                    <Col span={24}>
+                      <Form.Item
+                        label="联系人地标"
+                        name=""
+                        rules={[ { required: false, message: '联系人地标' } ]}>
+                        <Input value="" />
+                      </Form.Item>
+                    </Col>
+                  </Row>
+                  <Row gutter={16}>
+                    <Col span={24}>
+                      <Form.Item
+                        label="联系人住宿"
+                        name=""
+                        rules={[ { required: false, message: '联系人住宿' } ]}>
+                        <Input value="" />
+                      </Form.Item>
+                    </Col>
+                  </Row>
+                  <Row gutter={16}>
+                    <Col span={24}>
+                      <Form.Item
+                        label="备注"
+                        name=""
+                        rules={[ { required: false, message: '备注' } ]}>
+                        <Input value="" />
+                      </Form.Item>
+                    </Col>
+                  </Row>
+                  <Row gutter={16}>
+                    <Col span={24}>
+                      <Form.Item label="个人标签">
+                        <span className="ant-form-text">
+                          <Tag color="#16A085">标签</Tag>
+                          <Tag color="#2980B9">特别关注</Tag>
+                        </span>
+                      </Form.Item>
+                    </Col>
+                  </Row>
+                  <Row gutter={16}>
+                    <Col span={24}>
+                      <Form.Item label="协作标签">
+                        <span className="ant-form-text">
+                          <Tag color="#F8AC59">协作标签1</Tag>
+                          <Tag color="#FF69B4">协作标签2</Tag>
+                        </span>
+                      </Form.Item>
+                    </Col>
+                  </Row>
+                </Form>
+                <Button
+                  type="primary"
+                  className="ant-btn ant-btn-primary"
+                  onClick={() => {
+                    form
+                      .validateFields()
+                      .then(values => {
+                        onCreate(values)
+                      })
+                      .catch(err => {
+                        console.log(err)
+                      })
+                  }}>
+                  确定
+                </Button>
               </div>
             </Col>
             <Col span={12}>

+ 1 - 1
src/components/PopContactForm/index.less

@@ -1,4 +1,4 @@
 @import '~antd/es/style/themes/default.less';
-.textMuted{
+.textMuted {
   color: #868e96;
 }

+ 1 - 1
src/e2e/__mocks__/antd-pro-merge-less.js

@@ -1 +1 @@
-export default undefined;
+export default undefined

+ 34 - 38
src/e2e/baseLayout.e2e.js

@@ -1,57 +1,53 @@
-const { uniq } = require('lodash');
-const RouterConfig = require('../../config/config').default.routes;
+const { uniq } = require('lodash')
+const RouterConfig = require('../../config/config').default.routes
 
-const BASE_URL = `http://localhost:${process.env.PORT || 8000}`;
+const BASE_URL = `http://localhost:${process.env.PORT || 8000}`
 
 function formatter(routes, parentPath = '') {
-  const fixedParentPath = parentPath.replace(/\/{1,}/g, '/');
-  let result = [];
-  routes.forEach((item) => {
+  const fixedParentPath = parentPath.replace(/\/{1,}/g, '/')
+  let result = []
+  routes.forEach(item => {
     if (item.path) {
-      result.push(`${fixedParentPath}/${item.path}`.replace(/\/{1,}/g, '/'));
+      result.push(`${fixedParentPath}/${item.path}`.replace(/\/{1,}/g, '/'))
     }
     if (item.routes) {
       result = result.concat(
-        formatter(item.routes, item.path ? `${fixedParentPath}/${item.path}` : parentPath),
-      );
+        formatter(item.routes, item.path ? `${fixedParentPath}/${item.path}` : parentPath)
+      )
     }
-  });
-  return uniq(result.filter((item) => !!item));
+  })
+  return uniq(result.filter(item => !!item))
 }
 
 beforeEach(async () => {
-  await page.goto(`${BASE_URL}`);
+  await page.goto(`${BASE_URL}`)
   await page.evaluate(() => {
-    localStorage.setItem('antd-pro-authority', '["admin"]');
-  });
-});
+    localStorage.setItem('antd-pro-authority', '["admin"]')
+  })
+})
 
 describe('Ant Design Pro E2E test', () => {
-  const testPage = (path) => async () => {
-    await page.goto(`${BASE_URL}${path}`);
+  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();
-  };
+      timeout: 2000
+    })
+    const haveFooter = await page.evaluate(() => document.getElementsByTagName('footer').length > 0)
+    expect(haveFooter).toBeTruthy()
+  }
 
-  const routers = formatter(RouterConfig);
-  routers.forEach((route) => {
-    it(`test pages ${route}`, testPage(route));
-  });
+  const routers = formatter(RouterConfig)
+  routers.forEach(route => {
+    it(`test pages ${route}`, testPage(route))
+  })
 
   it('topmenu should have footer', async () => {
-    const params = '?navTheme=light&layout=topmenu';
-    await page.goto(`${BASE_URL}${params}`);
+    const params = '?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();
-  });
-});
+      timeout: 2000
+    })
+    const haveFooter = await page.evaluate(() => document.getElementsByTagName('footer').length > 0)
+    expect(haveFooter).toBeTruthy()
+  })
+})

+ 51 - 52
src/global.jsx

@@ -1,103 +1,102 @@
-import { Button, message, notification } from 'antd';
-import React from 'react';
-import { useIntl } from 'umi';
-import defaultSettings from '../config/defaultSettings';
+import { Button, message, notification } from 'antd'
+import React from 'react'
+import { useIntl } from 'umi'
+import defaultSettings from '../config/defaultSettings'
 
-const { pwa } = defaultSettings;
-const isHttps = document.location.protocol === 'https:'; // if pwa is true
+const { pwa } = defaultSettings
+const isHttps = document.location.protocol === 'https:' // if pwa is true
 
 if (pwa) {
   // Notify user if offline now
   window.addEventListener('sw.offline', () => {
     message.warning(
       useIntl().formatMessage({
-        id: 'app.pwa.offline',
-      }),
-    );
-  }); // Pop up a prompt on the page asking the user if they want to use the latest version
+        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', (event) => {
-    const e = event;
+  window.addEventListener('sw.updated', event => {
+    const e = event
 
     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;
+      const worker = e.detail && e.detail.waiting
 
       if (!worker) {
-        return true;
+        return true
       } // Send skip-waiting event to waiting SW with MessageChannel
 
       await new Promise((resolve, reject) => {
-        const channel = new MessageChannel();
+        const channel = new MessageChannel()
 
-        channel.port1.onmessage = (msgEvent) => {
+        channel.port1.onmessage = msgEvent => {
           if (msgEvent.data.error) {
-            reject(msgEvent.data.error);
+            reject(msgEvent.data.error)
           } else {
-            resolve(msgEvent.data);
+            resolve(msgEvent.data)
           }
-        };
+        }
 
         worker.postMessage(
           {
-            type: 'skip-waiting',
+            type: 'skip-waiting'
           },
-          [channel.port2],
-        );
-      }); // Refresh current page to use the updated HTML and other assets after SW has skiped 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;
-    };
+      window.location.reload(true)
+      return true
+    }
 
-    const key = `open${Date.now()}`;
+    const key = `open${Date.now()}`
     const btn = (
       <Button
         type="primary"
         onClick={() => {
-          notification.close(key);
-          reloadSW();
-        }}
-      >
+          notification.close(key)
+          reloadSW()
+        }}>
         {useIntl().formatMessage({
-          id: 'app.pwa.serviceworker.updated.ok',
+          id: 'app.pwa.serviceworker.updated.ok'
         })}
       </Button>
-    );
+    )
     notification.open({
       message: useIntl().formatMessage({
-        id: 'app.pwa.serviceworker.updated',
+        id: 'app.pwa.serviceworker.updated'
       }),
       description: useIntl().formatMessage({
-        id: 'app.pwa.serviceworker.updated.hint',
+        id: 'app.pwa.serviceworker.updated.hint'
       }),
       btn,
       key,
-      onClose: async () => {},
-    });
-  });
+      onClose: async () => {}
+    })
+  })
 } else if ('serviceWorker' in navigator && isHttps) {
   // unregister service worker
-  const { serviceWorker } = navigator;
+  const { serviceWorker } = navigator
 
   if (serviceWorker.getRegistrations) {
-    serviceWorker.getRegistrations().then((sws) => {
-      sws.forEach((sw) => {
-        sw.unregister();
-      });
-    });
+    serviceWorker.getRegistrations().then(sws => {
+      sws.forEach(sw => {
+        sw.unregister()
+      })
+    })
   }
 
-  serviceWorker.getRegistration().then((sw) => {
-    if (sw) sw.unregister();
-  }); // remove all caches
+  serviceWorker.getRegistration().then(sw => {
+    if (sw) sw.unregister()
+  }) // remove all caches
 
   if (window.caches && window.caches.keys) {
-    caches.keys().then((keys) => {
-      keys.forEach((key) => {
-        caches.delete(key);
-      });
-    });
+    caches.keys().then(keys => {
+      keys.forEach(key => {
+        caches.delete(key)
+      })
+    })
   }
 }

+ 47 - 49
src/layouts/BasicLayout.jsx

@@ -3,16 +3,15 @@
  * You can view component api by:
  * https://github.com/ant-design/ant-design-pro-layout
  */
-import ProLayout, { DefaultFooter } from '@ant-design/pro-layout';
-import React, { useEffect, useMemo, useRef } from 'react';
-import { Link, useIntl, connect, history } from 'umi';
-import { GithubOutlined } from '@ant-design/icons';
-import { Result, Button } from 'antd';
-import Authorized from '@/utils/Authorized';
-import RightContent from '@/components/GlobalHeader/RightContent';
-import { getMatchMenu } from '@umijs/route-utils';
-import logo from '../assets/logo.svg';
-import styles from './BasicLayout.less';
+import ProLayout from '@ant-design/pro-layout'
+import React, { useEffect, useMemo, useRef } from 'react'
+import { Link, useIntl, connect, history } from 'umi'
+import { Result, Button } from 'antd'
+import Authorized from '@/utils/Authorized'
+import RightContent from '@/components/GlobalHeader/RightContent'
+import { getMatchMenu } from '@umijs/route-utils'
+import logo from '../assets/logo.svg'
+import styles from './BasicLayout.less'
 
 const noMatch = (
   <Result
@@ -25,19 +24,19 @@ const noMatch = (
       </Button>
     }
   />
-);
+)
 
 /**
  * use Authorized check all menu item
  */
-const menuDataRender = (menuList) =>
-  menuList.map((item) => {
+const menuDataRender = menuList =>
+  menuList.map(item => {
     const localItem = {
       ...item,
-      children: item.children ? menuDataRender(item.children) : undefined,
-    };
-    return Authorized.check(item.authority, localItem, null);
-  });
+      children: item.children ? menuDataRender(item.children) : undefined
+    }
+    return Authorized.check(item.authority, localItem, null)
+  })
 
 // const defaultFooterDom = (
 //   <DefaultFooter
@@ -65,44 +64,44 @@ const menuDataRender = (menuList) =>
 //   />
 // );
 
-const BasicLayout = (props) => {
+const BasicLayout = props => {
   const {
     dispatch,
     children,
     settings,
     location = {
-      pathname: '/',
-    },
-  } = props;
-  const menuDataRef = useRef([]);
+      pathname: '/'
+    }
+  } = props
+  const menuDataRef = useRef([])
   useEffect(() => {
     if (dispatch) {
       dispatch({
-        type: 'user/fetchCurrent',
-      });
+        type: 'user/fetchCurrent'
+      })
     }
-  }, []);
+  }, [ dispatch ])
   /**
    * init variables
    */
 
-  const handleMenuCollapse = (payload) => {
+  const handleMenuCollapse = payload => {
     if (dispatch) {
       dispatch({
         type: 'global/changeLayoutCollapsed',
-        payload,
-      });
+        payload
+      })
     }
-  }; // get children authority
+  } // get children authority
 
   const authorized = useMemo(
     () =>
       getMatchMenu(location.pathname || '/', menuDataRef.current).pop() || {
-        authority: undefined,
+        authority: undefined
       },
-    [location.pathname],
-  );
-  const { formatMessage } = useIntl();
+    [ location.pathname ]
+  )
+  const { formatMessage } = useIntl()
   return (
     <ProLayout
       className={styles.layoutBg}
@@ -114,44 +113,43 @@ const BasicLayout = (props) => {
       onMenuHeaderClick={() => history.push('/')}
       menuItemRender={(menuItemProps, defaultDom) => {
         if (menuItemProps.isUrl || !menuItemProps.path) {
-          return defaultDom;
+          return defaultDom
         }
 
-        return <Link to={menuItemProps.path}>{defaultDom}</Link>;
+        return <Link to={menuItemProps.path}>{defaultDom}</Link>
       }}
       breadcrumbRender={(routers = []) => [
         {
           path: '/',
           breadcrumbName: formatMessage({
-            id: 'menu.home',
-          }),
+            id: 'menu.home'
+          })
         },
-        ...routers,
+        ...routers
       ]}
       itemRender={(route, params, routes, paths) => {
-        const first = routes.indexOf(route) === 0;
+        const first = routes.indexOf(route) === 0
         return first ? (
           <Link to={paths.join('/')}>{route.breadcrumbName}</Link>
         ) : (
           <span>{route.breadcrumbName}</span>
-        );
+        )
       }}
       // footerRender={() => defaultFooterDom}
       menuDataRender={menuDataRender}
       rightContentRender={() => <RightContent />}
-      postMenuData={(menuData) => {
-        menuDataRef.current = menuData || [];
-        return menuData || [];
-      }}
-    >
+      postMenuData={menuData => {
+        menuDataRef.current = menuData || []
+        return menuData || []
+      }}>
       <Authorized authority={authorized.authority} noMatch={noMatch}>
         {children}
       </Authorized>
     </ProLayout>
-  );
-};
+  )
+}
 
 export default connect(({ global, settings }) => ({
   collapsed: global.collapsed,
-  settings,
-}))(BasicLayout);
+  settings
+}))(BasicLayout)

+ 6 - 6
src/layouts/BasicLayout.less

@@ -1,9 +1,9 @@
 @import '~antd/es/style/themes/default.less';
-.layoutBg{
-  :global(.ant-pro-sider){
-    background: #554B7D;
+.layoutBg {
+  :global(.ant-pro-sider) {
+    background: #554b7d;
   }
-  :gloabl(.ant-menu-dark .ant-menu-inline.ant-menu-sub){
-      background:#4A4573 ;
+  :gloabl(.ant-menu-dark .ant-menu-inline.ant-menu-sub) {
+    background: #4a4573;
   }
-}
+}

+ 3 - 3
src/layouts/BlankLayout.jsx

@@ -1,5 +1,5 @@
-import React from 'react';
+import React from 'react'
 
-const Layout = ({ children }) => <>{children}</>;
+const Layout = ({ children }) => <>{children}</>
 
-export default Layout;
+export default Layout

+ 21 - 21
src/layouts/SecurityLayout.jsx

@@ -1,49 +1,49 @@
-import React from 'react';
-import { PageLoading } from '@ant-design/pro-layout';
-import { Redirect, connect } from 'umi';
-import { stringify } from 'querystring';
+import React from 'react'
+import { PageLoading } from '@ant-design/pro-layout'
+import { Redirect, connect } from 'umi'
+import { stringify } from 'querystring'
 
 class SecurityLayout extends React.Component {
   state = {
-    isReady: false,
-  };
+    isReady: false
+  }
 
   componentDidMount() {
     this.setState({
-      isReady: true,
-    });
-    const { dispatch } = this.props;
+      isReady: true
+    })
+    const { dispatch } = this.props
 
     if (dispatch) {
       dispatch({
-        type: 'user/fetchCurrent',
-      });
+        type: 'user/fetchCurrent'
+      })
     }
   }
 
   render() {
-    const { isReady } = this.state;
-    const { children, loading, currentUser } = this.props; // You can replace it to your authentication rule (such as check token exists)
+    const { isReady } = this.state
+    const { children, loading, currentUser } = this.props // You can replace it to your authentication rule (such as check token exists)
     // 你可以把它替换成你自己的登录认证规则(比如判断 token 是否存在)
 
-    const isLogin = currentUser && currentUser.userid;
+    const isLogin = currentUser && currentUser.userid
     const queryString = stringify({
-      redirect: window.location.href,
-    });
+      redirect: window.location.href
+    })
 
     if ((!isLogin && loading) || !isReady) {
-      return <PageLoading />;
+      return <PageLoading />
     }
 
     if (!isLogin && window.location.pathname !== '/user/login') {
-      return <Redirect to={`/user/login?${queryString}`} />;
+      return <Redirect to={`/user/login?${queryString}`} />
     }
 
-    return children;
+    return children
   }
 }
 
 export default connect(({ user, loading }) => ({
   currentUser: user.currentUser,
-  loading: loading.models.user,
-}))(SecurityLayout);
+  loading: loading.models.user
+}))(SecurityLayout)

+ 22 - 25
src/layouts/UserLayout.jsx

@@ -1,31 +1,31 @@
-import { DefaultFooter, getMenuData, getPageTitle } from '@ant-design/pro-layout';
-import { Helmet, HelmetProvider } from 'react-helmet-async';
-import { Link, SelectLang, useIntl, connect, FormattedMessage } from 'umi';
-import React from 'react';
-import logo from '../assets/logo.svg';
-import styles from './UserLayout.less';
+import { getMenuData, getPageTitle } from '@ant-design/pro-layout'
+import { Helmet, HelmetProvider } from 'react-helmet-async'
+import { Link, SelectLang, useIntl, connect, FormattedMessage } from 'umi'
+import React from 'react'
+import logo from '../assets/logo.svg'
+import styles from './UserLayout.less'
 
-const UserLayout = (props) => {
+const UserLayout = props => {
   const {
     route = {
-      routes: [],
-    },
-  } = props;
-  const { routes = [] } = route;
+      routes: []
+    }
+  } = props
+  const { routes = [] } = route
   const {
     children,
     location = {
-      pathname: '',
-    },
-  } = props;
-  const { formatMessage } = useIntl();
-  const { breadcrumb } = getMenuData(routes);
+      pathname: ''
+    }
+  } = props
+  const { formatMessage } = useIntl()
+  const { breadcrumb } = getMenuData(routes)
   const title = getPageTitle({
     pathname: location.pathname,
     formatMessage,
     breadcrumb,
-    ...props,
-  });
+    ...props
+  })
   return (
     <HelmetProvider>
       <Helmet>
@@ -46,10 +46,7 @@ const UserLayout = (props) => {
               </Link>
             </div>
             <div className={styles.desc}>
-              <FormattedMessage
-                id="pages.layouts.userLayout.title"
-                defaultMessage="纵横办公系统"
-              />
+              <FormattedMessage id="pages.layouts.userLayout.title" defaultMessage="纵横办公系统" />
             </div>
           </div>
           {children}
@@ -57,7 +54,7 @@ const UserLayout = (props) => {
         {/* <DefaultFooter /> */}
       </div>
     </HelmetProvider>
-  );
-};
+  )
+}
 
-export default connect(({ settings }) => ({ ...settings }))(UserLayout);
+export default connect(({ settings }) => ({ ...settings }))(UserLayout)

+ 9 - 9
src/locales/en-US.js

@@ -1,10 +1,10 @@
-import component from './en-US/component';
-import globalHeader from './en-US/globalHeader';
-import menu from './en-US/menu';
-import pwa from './en-US/pwa';
-import settingDrawer from './en-US/settingDrawer';
-import settings from './en-US/settings';
-import pages from './en-US/pages';
+import component from './en-US/component'
+import globalHeader from './en-US/globalHeader'
+import menu from './en-US/menu'
+import pwa from './en-US/pwa'
+import settingDrawer from './en-US/settingDrawer'
+import settings from './en-US/settings'
+import pages from './en-US/pages'
 
 export default {
   'navBar.lang': 'Languages',
@@ -20,5 +20,5 @@ export default {
   ...settings,
   ...pwa,
   ...component,
-  ...pages,
-};
+  ...pages
+}

+ 2 - 2
src/locales/en-US/component.js

@@ -1,5 +1,5 @@
 export default {
   'component.tagSelect.expand': 'Expand',
   'component.tagSelect.collapse': 'Collapse',
-  'component.tagSelect.all': 'All',
-};
+  'component.tagSelect.all': 'All'
+}

+ 2 - 2
src/locales/en-US/globalHeader.js

@@ -13,5 +13,5 @@ export default {
   'component.noticeIcon.clear': 'Clear',
   'component.noticeIcon.cleared': 'Cleared',
   'component.noticeIcon.empty': 'No notifications',
-  'component.noticeIcon.view-more': 'View more',
-};
+  'component.noticeIcon.view-more': 'View more'
+}

+ 2 - 2
src/locales/en-US/menu.js

@@ -48,5 +48,5 @@ export default {
   'menu.editor': 'Graphic Editor',
   'menu.editor.flow': 'Flow Editor',
   'menu.editor.mind': 'Mind Editor',
-  'menu.editor.koni': 'Koni Editor',
-};
+  'menu.editor.koni': 'Koni Editor'
+}

+ 2 - 2
src/locales/en-US/pages.js

@@ -20,5 +20,5 @@ export default {
   'pages.login.forgotPassword': 'Forgot Password ?',
   'pages.login.submit': 'Submit',
   'pages.login.loginWith': 'Login with :',
-  'pages.login.registerAccount': 'Register Account',
-};
+  'pages.login.registerAccount': 'Register Account'
+}

+ 2 - 2
src/locales/en-US/pwa.js

@@ -2,5 +2,5 @@ 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',
-};
+  'app.pwa.serviceworker.updated.ok': 'Refresh'
+}

+ 2 - 2
src/locales/en-US/settingDrawer.js

@@ -27,5 +27,5 @@ export default {
   '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',
-};
+    'Setting panel shows in development environment only, please manually modify'
+}

+ 2 - 2
src/locales/en-US/settings.js

@@ -56,5 +56,5 @@ export default {
   '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',
-};
+  'app.settings.close': 'Close'
+}

+ 8 - 8
src/locales/id-ID.js

@@ -1,9 +1,9 @@
-import component from './id-ID/component';
-import globalHeader from './id-ID/globalHeader';
-import menu from './id-ID/menu';
-import pwa from './id-ID/pwa';
-import settingDrawer from './id-ID/settingDrawer';
-import settings from './id-ID/settings';
+import component from './id-ID/component'
+import globalHeader from './id-ID/globalHeader'
+import menu from './id-ID/menu'
+import pwa from './id-ID/pwa'
+import settingDrawer from './id-ID/settingDrawer'
+import settings from './id-ID/settings'
 
 export default {
   'navbar.lang': 'Bahasa',
@@ -19,5 +19,5 @@ export default {
   ...settingDrawer,
   ...settings,
   ...pwa,
-  ...component,
-};
+  ...component
+}

+ 2 - 2
src/locales/id-ID/component.js

@@ -1,5 +1,5 @@
 export default {
   'component.tagSelect.expand': 'Perluas',
   'component.tagSelect.collapse': 'Lipat',
-  'component.tagSelect.all': 'Semua',
-};
+  'component.tagSelect.all': 'Semua'
+}

+ 2 - 2
src/locales/id-ID/globalHeader.js

@@ -13,5 +13,5 @@ export default {
   'component.noticeIcon.clear': 'Kosongkan',
   'component.noticeIcon.cleared': 'Berhasil dikosongkan',
   'component.noticeIcon.empty': 'Tidak ada pemberitahuan',
-  'component.noticeIcon.view-more': 'Melihat lebih',
-};
+  'component.noticeIcon.view-more': 'Melihat lebih'
+}

+ 2 - 2
src/locales/id-ID/menu.js

@@ -48,5 +48,5 @@ export default {
   'menu.editor': 'Penyusun Grafis',
   'menu.editor.flow': 'Penyusun Alur',
   'menu.editor.mind': 'Penyusun Mind',
-  'menu.editor.koni': 'Penyusun Koni',
-};
+  'menu.editor.koni': 'Penyusun Koni'
+}

+ 2 - 2
src/locales/id-ID/pwa.js

@@ -3,5 +3,5 @@ export default {
   'app.pwa.serviceworker.updated': 'Konten baru sudah tersedia',
   'app.pwa.serviceworker.updated.hint':
     'Silahkan klik tombol "Refresh" untuk memuat ulang halaman ini',
-  'app.pwa.serviceworker.updated.ok': 'Memuat ulang',
-};
+  'app.pwa.serviceworker.updated.ok': 'Memuat ulang'
+}

+ 2 - 2
src/locales/id-ID/settingDrawer.js

@@ -29,5 +29,5 @@ export default {
   'app.setting.copyinfo':
     'Berhasil disalin,tolong ubah defaultSettings pada src/models/setting.js',
   'app.setting.production.hint':
-    'Panel pengaturan hanya muncul pada lingkungan pengembangan, silahkan modifikasi secara menual',
-};
+    'Panel pengaturan hanya muncul pada lingkungan pengembangan, silahkan modifikasi secara menual'
+}

+ 2 - 2
src/locales/id-ID/settings.js

@@ -56,5 +56,5 @@ export default {
   'app.settings.notification.todo-description':
     'Daftar to-do akan diberitahukan dalam bentuk surat dari stasiun',
   'app.settings.open': 'Buka',
-  'app.settings.close': 'Tutup',
-};
+  'app.settings.close': 'Tutup'
+}

+ 8 - 8
src/locales/pt-BR.js

@@ -1,9 +1,9 @@
-import component from './pt-BR/component';
-import globalHeader from './pt-BR/globalHeader';
-import menu from './pt-BR/menu';
-import pwa from './pt-BR/pwa';
-import settingDrawer from './pt-BR/settingDrawer';
-import settings from './pt-BR/settings';
+import component from './pt-BR/component'
+import globalHeader from './pt-BR/globalHeader'
+import menu from './pt-BR/menu'
+import pwa from './pt-BR/pwa'
+import settingDrawer from './pt-BR/settingDrawer'
+import settings from './pt-BR/settings'
 
 export default {
   'navBar.lang': 'Idiomas',
@@ -16,5 +16,5 @@ export default {
   ...settingDrawer,
   ...settings,
   ...pwa,
-  ...component,
-};
+  ...component
+}

+ 2 - 2
src/locales/pt-BR/component.js

@@ -1,5 +1,5 @@
 export default {
   'component.tagSelect.expand': 'Expandir',
   'component.tagSelect.collapse': 'Diminuir',
-  'component.tagSelect.all': 'Todas',
-};
+  'component.tagSelect.all': 'Todas'
+}

+ 2 - 2
src/locales/pt-BR/globalHeader.js

@@ -14,5 +14,5 @@ export default {
   'component.noticeIcon.cleared': 'Limpo',
   'component.noticeIcon.empty': 'Sem notificações',
   'component.noticeIcon.loaded': 'Carregado',
-  'component.noticeIcon.view-more': 'Veja mais',
-};
+  'component.noticeIcon.view-more': 'Veja mais'
+}

+ 2 - 2
src/locales/pt-BR/menu.js

@@ -48,5 +48,5 @@ export default {
   'menu.editor': 'Graphic Editor',
   'menu.editor.flow': 'Flow Editor',
   'menu.editor.mind': 'Mind Editor',
-  'menu.editor.koni': 'Koni Editor',
-};
+  'menu.editor.koni': 'Koni Editor'
+}

+ 2 - 2
src/locales/pt-BR/pwa.js

@@ -3,5 +3,5 @@ export default {
   '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',
-};
+  'app.pwa.serviceworker.updated.ok': 'Atualizar'
+}

+ 2 - 2
src/locales/pt-BR/settingDrawer.js

@@ -28,5 +28,5 @@ export default {
   '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',
-};
+    'O painel de configuração apenas é exibido no ambiente de desenvolvimento, por favor modifique manualmente o'
+}

+ 2 - 2
src/locales/pt-BR/settings.js

@@ -56,5 +56,5 @@ export default {
   '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',
-};
+  'app.settings.close': 'Fechado'
+}

+ 9 - 9
src/locales/zh-CN.js

@@ -1,10 +1,10 @@
-import component from './zh-CN/component';
-import globalHeader from './zh-CN/globalHeader';
-import menu from './zh-CN/menu';
-import pwa from './zh-CN/pwa';
-import settingDrawer from './zh-CN/settingDrawer';
-import settings from './zh-CN/settings';
-import pages from './zh-CN/pages';
+import component from './zh-CN/component'
+import globalHeader from './zh-CN/globalHeader'
+import menu from './zh-CN/menu'
+import pwa from './zh-CN/pwa'
+import settingDrawer from './zh-CN/settingDrawer'
+import settings from './zh-CN/settings'
+import pages from './zh-CN/pages'
 
 export default {
   'navBar.lang': '语言',
@@ -20,5 +20,5 @@ export default {
   ...settingDrawer,
   ...settings,
   ...pwa,
-  ...component,
-};
+  ...component
+}

+ 2 - 2
src/locales/zh-CN/component.js

@@ -1,5 +1,5 @@
 export default {
   'component.tagSelect.expand': '展开',
   'component.tagSelect.collapse': '收起',
-  'component.tagSelect.all': '全部',
-};
+  'component.tagSelect.all': '全部'
+}

+ 2 - 2
src/locales/zh-CN/globalHeader.js

@@ -13,5 +13,5 @@ export default {
   'component.noticeIcon.clear': '清空',
   'component.noticeIcon.cleared': '清空了',
   'component.noticeIcon.empty': '暂无数据',
-  'component.noticeIcon.view-more': '查看更多',
-};
+  'component.noticeIcon.view-more': '查看更多'
+}

+ 2 - 2
src/locales/zh-CN/menu.js

@@ -60,5 +60,5 @@ export default {
   'menu.editor': '图形编辑器',
   'menu.editor.flow': '流程编辑器',
   'menu.editor.mind': '脑图编辑器',
-  'menu.editor.koni': '拓扑编辑器',
-};
+  'menu.editor.koni': '拓扑编辑器'
+}

+ 2 - 2
src/locales/zh-CN/pages.js

@@ -20,5 +20,5 @@ export default {
   'pages.login.forgotPassword': '忘记密码 ?',
   'pages.login.submit': '提交',
   'pages.login.loginWith': '其他登录方式 :',
-  'pages.login.registerAccount': '注册账户',
-};
+  'pages.login.registerAccount': '注册账户'
+}

+ 2 - 2
src/locales/zh-CN/pwa.js

@@ -2,5 +2,5 @@ export default {
   'app.pwa.offline': '当前处于离线状态',
   'app.pwa.serviceworker.updated': '有新内容',
   'app.pwa.serviceworker.updated.hint': '请点击“刷新”按钮或者手动刷新页面',
-  'app.pwa.serviceworker.updated.ok': '刷新',
-};
+  'app.pwa.serviceworker.updated.ok': '刷新'
+}

+ 2 - 2
src/locales/zh-CN/settingDrawer.js

@@ -27,5 +27,5 @@ export default {
   'app.setting.copy': '拷贝设置',
   'app.setting.copyinfo': '拷贝成功,请到 src/defaultSettings.js 中替换默认配置',
   'app.setting.production.hint':
-    '配置栏只在开发环境用于预览,生产环境不会展现,请拷贝后手动修改配置文件',
-};
+    '配置栏只在开发环境用于预览,生产环境不会展现,请拷贝后手动修改配置文件'
+}

+ 2 - 2
src/locales/zh-CN/settings.js

@@ -51,5 +51,5 @@ export default {
   'app.settings.notification.todo': '待办任务',
   'app.settings.notification.todo-description': '待办任务将以站内信的形式通知',
   'app.settings.open': '开',
-  'app.settings.close': '关',
-};
+  'app.settings.close': '关'
+}

+ 8 - 8
src/locales/zh-TW.js

@@ -1,9 +1,9 @@
-import component from './zh-TW/component';
-import globalHeader from './zh-TW/globalHeader';
-import menu from './zh-TW/menu';
-import pwa from './zh-TW/pwa';
-import settingDrawer from './zh-TW/settingDrawer';
-import settings from './zh-TW/settings';
+import component from './zh-TW/component'
+import globalHeader from './zh-TW/globalHeader'
+import menu from './zh-TW/menu'
+import pwa from './zh-TW/pwa'
+import settingDrawer from './zh-TW/settingDrawer'
+import settings from './zh-TW/settings'
 
 export default {
   'navBar.lang': '語言',
@@ -16,5 +16,5 @@ export default {
   ...settingDrawer,
   ...settings,
   ...pwa,
-  ...component,
-};
+  ...component
+}

+ 2 - 2
src/locales/zh-TW/component.js

@@ -1,5 +1,5 @@
 export default {
   'component.tagSelect.expand': '展開',
   'component.tagSelect.collapse': '收起',
-  'component.tagSelect.all': '全部',
-};
+  'component.tagSelect.all': '全部'
+}

+ 2 - 2
src/locales/zh-TW/globalHeader.js

@@ -13,5 +13,5 @@ export default {
   'component.noticeIcon.clear': '清空',
   'component.noticeIcon.cleared': '清空了',
   'component.noticeIcon.empty': '暫無資料',
-  'component.noticeIcon.view-more': '查看更多',
-};
+  'component.noticeIcon.view-more': '查看更多'
+}

+ 2 - 2
src/locales/zh-TW/menu.js

@@ -48,5 +48,5 @@ export default {
   'menu.editor': '圖形編輯器',
   'menu.editor.flow': '流程編輯器',
   'menu.editor.mind': '腦圖編輯器',
-  'menu.editor.koni': '拓撲編輯器',
-};
+  'menu.editor.koni': '拓撲編輯器'
+}

+ 2 - 2
src/locales/zh-TW/pwa.js

@@ -2,5 +2,5 @@ export default {
   'app.pwa.offline': '當前處於離線狀態',
   'app.pwa.serviceworker.updated': '有新內容',
   'app.pwa.serviceworker.updated.hint': '請點擊“刷新”按鈕或者手動刷新頁面',
-  'app.pwa.serviceworker.updated.ok': '刷新',
-};
+  'app.pwa.serviceworker.updated.ok': '刷新'
+}

+ 2 - 2
src/locales/zh-TW/settingDrawer.js

@@ -27,5 +27,5 @@ export default {
   'app.setting.copy': '拷貝設置',
   'app.setting.copyinfo': '拷貝成功,請到 src/defaultSettings.js 中替換默認配置',
   'app.setting.production.hint':
-    '配置欄只在開發環境用於預覽,生產環境不會展現,請拷貝後手動修改配置文件',
-};
+    '配置欄只在開發環境用於預覽,生產環境不會展現,請拷貝後手動修改配置文件'
+}

+ 2 - 2
src/locales/zh-TW/settings.js

@@ -51,5 +51,5 @@ export default {
   'app.settings.notification.todo': '待辦任務',
   'app.settings.notification.todo-description': '待辦任務將以站內信的形式通知',
   'app.settings.open': '開',
-  'app.settings.close': '關',
-};
+  'app.settings.close': '關'
+}

+ 11 - 11
src/models/contact.js

@@ -1,19 +1,19 @@
-import { queryContact } from '@/services/contact';
+import { queryContact } from '@/services/contact'
 
 export default {
   namespace: 'contact',
   state: {
-    list: [],
+    list: []
   },
   // 用于处理异步操作和业务逻辑,由action触发,但不能修改state
   effects: {
     *fetch({ payload }, { call, put }) {
-      const response = yield call(queryContact, payload);
+      const response = yield call(queryContact, payload)
       yield put({
         type: 'show',
-        payload: response,
-      });
-    },
+        payload: response
+      })
+    }
   },
   // reducers:用于处理同步操作,由action触发,可修改state
   reducers: {
@@ -21,8 +21,8 @@ export default {
     show(state, action) {
       return {
         ...state,
-        list: action.payload,
-      };
-    },
-  },
-};
+        list: action.payload
+      }
+    }
+  }
+}

+ 44 - 44
src/models/global.js

@@ -1,105 +1,105 @@
-import { queryNotices } from '@/services/user';
+import { queryNotices } from '@/services/user'
 
 const GlobalModel = {
   namespace: 'global',
   state: {
     collapsed: false,
-    notices: [],
+    notices: []
   },
   effects: {
     *fetchNotices(_, { call, put, select }) {
-      const data = yield call(queryNotices);
+      const data = yield call(queryNotices)
       yield put({
         type: 'saveNotices',
-        payload: data,
-      });
+        payload: data
+      })
       const unreadCount = yield select(
-        (state) => state.global.notices.filter((item) => !item.read).length,
-      );
+        state => state.global.notices.filter(item => !item.read).length
+      )
       yield put({
         type: 'user/changeNotifyCount',
         payload: {
           totalCount: data.length,
-          unreadCount,
-        },
-      });
+          unreadCount
+        }
+      })
     },
 
     *clearNotices({ payload }, { put, select }) {
       yield put({
         type: 'saveClearedNotices',
-        payload,
-      });
-      const count = yield select((state) => state.global.notices.length);
+        payload
+      })
+      const count = yield select(state => state.global.notices.length)
       const unreadCount = yield select(
-        (state) => state.global.notices.filter((item) => !item.read).length,
-      );
+        state => state.global.notices.filter(item => !item.read).length
+      )
       yield put({
         type: 'user/changeNotifyCount',
         payload: {
           totalCount: count,
-          unreadCount,
-        },
-      });
+          unreadCount
+        }
+      })
     },
 
     *changeNoticeReadState({ payload }, { put, select }) {
-      const notices = yield select((state) =>
-        state.global.notices.map((item) => {
-          const notice = { ...item };
+      const notices = yield select(state =>
+        state.global.notices.map(item => {
+          const notice = { ...item }
 
           if (notice.id === payload) {
-            notice.read = true;
+            notice.read = true
           }
 
-          return notice;
-        }),
-      );
+          return notice
+        })
+      )
       yield put({
         type: 'saveNotices',
-        payload: notices,
-      });
+        payload: notices
+      })
       yield put({
         type: 'user/changeNotifyCount',
         payload: {
           totalCount: notices.length,
-          unreadCount: notices.filter((item) => !item.read).length,
-        },
-      });
-    },
+          unreadCount: notices.filter(item => !item.read).length
+        }
+      })
+    }
   },
   reducers: {
     changeLayoutCollapsed(
       state = {
         notices: [],
-        collapsed: true,
+        collapsed: true
       },
-      { payload },
+      { payload }
     ) {
-      return { ...state, collapsed: payload };
+      return { ...state, collapsed: payload }
     },
 
     saveNotices(state, { payload }) {
       return {
         collapsed: false,
         ...state,
-        notices: payload,
-      };
+        notices: payload
+      }
     },
 
     saveClearedNotices(
       state = {
         notices: [],
-        collapsed: true,
+        collapsed: true
       },
-      { payload },
+      { payload }
     ) {
       return {
         ...state,
         collapsed: false,
-        notices: state.notices.filter((item) => item.type !== payload),
-      };
-    },
-  },
-};
-export default GlobalModel;
+        notices: state.notices.filter(item => item.type !== payload)
+      }
+    }
+  }
+}
+export default GlobalModel

+ 31 - 31
src/models/login.js

@@ -1,67 +1,67 @@
-import { stringify } from 'querystring';
-import { history } from 'umi';
-import { fakeAccountLogin } from '@/services/login';
-import { setAuthority } from '@/utils/authority';
-import { getPageQuery } from '@/utils/utils';
-import { message } from 'antd';
+import { stringify } from 'querystring'
+import { history } from 'umi'
+import { fakeAccountLogin } from '@/services/login'
+import { setAuthority } from '@/utils/authority'
+import { getPageQuery } from '@/utils/utils'
+import { message } from 'antd'
 
 const Model = {
   namespace: 'login',
   state: {
-    status: undefined,
+    status: undefined
   },
   effects: {
     *login({ payload }, { call, put }) {
       // 获取登录接口数据
-      const response = yield call(fakeAccountLogin, payload);
+      const response = yield call(fakeAccountLogin, payload)
       yield put({
         type: 'changeLoginStatus',
-        payload: response,
-      }); // Login successfully
+        payload: response
+      }) // Login successfully
 
       if (response.status === 'ok') {
-        const urlParams = new URL(window.location.href);
-        const params = getPageQuery();
-        message.success('🎉 🎉 🎉  登录成功!');
-        let { redirect } = params;
+        const urlParams = new URL(window.location.href)
+        const params = getPageQuery()
+        message.success('🎉 🎉 🎉  登录成功!')
+        let { redirect } = params
 
         if (redirect) {
-          const redirectUrlParams = new URL(redirect);
+          const redirectUrlParams = new URL(redirect)
 
           if (redirectUrlParams.origin === urlParams.origin) {
-            redirect = redirect.substr(urlParams.origin.length);
+            redirect = redirect.substr(urlParams.origin.length)
 
             if (redirect.match(/^\/.*#/)) {
-              redirect = redirect.substr(redirect.indexOf('#') + 1);
+              redirect = redirect.substr(redirect.indexOf('#') + 1)
             }
           } else {
-            window.location.href = '/';
-            return;
+            window.location.href = '/'
+            return
           }
         }
 
-        history.replace(redirect || '/');
+        history.replace(redirect || '/')
       }
     },
 
     logout() {
-      const { redirect } = getPageQuery(); // Note: There may be security issues, please note
+      const { redirect } = getPageQuery() // Note: There may be security issues, please note
 
       if (window.location.pathname !== '/user/login' && !redirect) {
         history.replace({
           pathname: '/user/login',
           search: stringify({
-            redirect: window.location.href,
-          }),
-        });
+            redirect: window.location.href
+          })
+        })
       }
-    },
+    }
   },
   reducers: {
     changeLoginStatus(state, { payload }) {
-      setAuthority(payload.currentAuthority);
-      return { ...state, status: payload.status, type: payload.type };
-    },
-  },
-};
-export default Model;
+      setAuthority(payload.currentAuthority)
+      return { ...state, status: payload.status, type: payload.type }
+    }
+  }
+}
+export default Model

+ 13 - 13
src/models/setting.js

@@ -1,27 +1,27 @@
-import defaultSettings from '../../config/defaultSettings';
+import defaultSettings from '../../config/defaultSettings'
 
-const updateColorWeak = (colorWeak) => {
-  const root = document.getElementById('root');
+const updateColorWeak = colorWeak => {
+  const root = document.getElementById('root')
 
   if (root) {
-    root.className = colorWeak ? 'colorWeak' : '';
+    root.className = colorWeak ? 'colorWeak' : ''
   }
-};
+}
 
 const SettingModel = {
   namespace: 'settings',
   state: defaultSettings,
   reducers: {
     changeSetting(state = defaultSettings, { payload }) {
-      const { colorWeak, contentWidth } = payload;
+      const { colorWeak, contentWidth } = payload
 
       if (state.contentWidth !== contentWidth && window.dispatchEvent) {
-        window.dispatchEvent(new Event('resize'));
+        window.dispatchEvent(new Event('resize'))
       }
 
-      updateColorWeak(!!colorWeak);
-      return { ...state, ...payload };
-    },
-  },
-};
-export default SettingModel;
+      updateColorWeak(!!colorWeak)
+      return { ...state, ...payload }
+    }
+  }
+}
+export default SettingModel

+ 19 - 19
src/models/user.js

@@ -1,47 +1,47 @@
-import { queryCurrent, query as queryUsers } from '@/services/user';
+import { queryCurrent, query as queryUsers } from '@/services/user'
 
 const UserModel = {
   namespace: 'user',
   state: {
-    currentUser: {},
+    currentUser: {}
   },
   effects: {
     *fetch(_, { call, put }) {
-      const response = yield call(queryUsers);
+      const response = yield call(queryUsers)
       yield put({
         type: 'save',
-        payload: response,
-      });
+        payload: response
+      })
     },
 
     *fetchCurrent(_, { call, put }) {
-      const response = yield call(queryCurrent);
+      const response = yield call(queryCurrent)
       yield put({
         type: 'saveCurrentUser',
-        payload: response,
-      });
-    },
+        payload: response
+      })
+    }
   },
   reducers: {
     saveCurrentUser(state, action) {
-      return { ...state, currentUser: action.payload || {} };
+      return { ...state, currentUser: action.payload || {} }
     },
 
     changeNotifyCount(
       state = {
-        currentUser: {},
+        currentUser: {}
       },
-      action,
+      action
     ) {
       return {
         ...state,
         currentUser: {
           ...state.currentUser,
           notifyCount: action.payload.totalCount,
-          unreadCount: action.payload.unreadCount,
-        },
-      };
-    },
-  },
-};
-export default UserModel;
+          unreadCount: action.payload.unreadCount
+        }
+      }
+    }
+  }
+}
+export default UserModel

+ 5 - 5
src/pages/404.jsx

@@ -1,6 +1,6 @@
-import { Button, Result } from 'antd';
-import React from 'react';
-import { history } from 'umi';
+import { Button, Result } from 'antd'
+import React from 'react'
+import { history } from 'umi'
 
 const NoFoundPage = () => (
   <Result
@@ -13,6 +13,6 @@ const NoFoundPage = () => (
       </Button>
     }
   />
-);
+)
 
-export default NoFoundPage;
+export default NoFoundPage

+ 10 - 12
src/pages/Admin.jsx

@@ -1,7 +1,7 @@
-import React from 'react';
-import { HeartTwoTone, SmileTwoTone } from '@ant-design/icons';
-import { Card, Typography, Alert } from 'antd';
-import { PageHeaderWrapper } from '@ant-design/pro-layout';
+import React from 'react'
+import { HeartTwoTone, SmileTwoTone } from '@ant-design/icons'
+import { Card, Typography, Alert } from 'antd'
+import { PageHeaderWrapper } from '@ant-design/pro-layout'
 
 export default () => (
   <PageHeaderWrapper content=" 这个页面只有 admin 权限才能查看">
@@ -13,24 +13,22 @@ export default () => (
         banner
         style={{
           margin: -12,
-          marginBottom: 48,
+          marginBottom: 48
         }}
       />
       <Typography.Title
         level={2}
         style={{
-          textAlign: 'center',
-        }}
-      >
+          textAlign: 'center'
+        }}>
         <SmileTwoTone /> Ant Design Pro <HeartTwoTone twoToneColor="#eb2f96" /> You
       </Typography.Title>
     </Card>
     <p
       style={{
         textAlign: 'center',
-        marginTop: 24,
-      }}
-    >
+        marginTop: 24
+      }}>
       Want to add more pages? Please refer to{' '}
       <a href="https://pro.ant.design/docs/block-cn" target="_blank" rel="noopener noreferrer">
         use block
@@ -38,4 +36,4 @@ export default () => (
     </p>
   </PageHeaderWrapper>
-);
+)

+ 5 - 11
src/pages/Customer/company.jsx

@@ -1,6 +1,6 @@
-import React from 'react';
+import React from 'react'
 // import { PageHeaderWrapper } from '@ant-design/pro-layout';
-import { Card} from 'antd';
+import { Card } from 'antd'
 // import { PlusOutlined, EllipsisOutlined } from '@ant-design/icons';
 // import ProTable, { TableDropdown } from '@ant-design/pro-table';
 // import request from 'umi-request';
@@ -133,15 +133,9 @@ import { Card} from 'antd';
 
 // export default Lockstore;
 
-
-
 const Company = () => {
   // const { modalVisible, onCancel } = props;
-  return (
-    <Card bordered={false}>
-      dasdasd
-    </Card>
-  );
-};
+  return <Card bordered={false}>dasdasd</Card>
+}
 
-export default Company;
+export default Company

+ 69 - 76
src/pages/Customer/contact.jsx

@@ -10,9 +10,9 @@ import React, { useEffect, useState } from 'react'
 // import request from 'umi-request';
 // import { queryContact } from '@/services/contact';
 
-const Contact = (props) => {
+const Contact = props => {
   // let tag = Array.from(tag);
-  const [visible, setVisible] = useState(false)
+  const [ visible, setVisible ] = useState(false)
 
   // 展示drawer
   const showDrawer = () => {
@@ -24,8 +24,8 @@ const Contact = (props) => {
     setVisible(false)
   }
 
-  const onCreate = (values) => {
-    console.log(values);
+  const onCreate = values => {
+    console.log(values)
   }
 
   const columns = [
@@ -33,13 +33,13 @@ const Contact = (props) => {
       title: '联系人',
       dataIndex: 'clientname',
       key: 'clientname',
-      render: (clientname) => <a onClick={showDrawer}>{clientname}</a>
+      render: clientname => <a onClick={showDrawer}>{clientname}</a>
     },
     {
       title: '客户名称',
       dataIndex: 'companyname',
       key: 'companyname',
-      render: (companyname) => <a>{companyname}</a>
+      render: companyname => <a>{companyname}</a>
     },
     {
       title: '部门',
@@ -90,36 +90,36 @@ const Contact = (props) => {
       // onFilter: true,
       valueType: 'select',
       valueEnum: {
-          all: { text: '全部', status: 'Default' },
-          green: {
-              text: '个人标签1',
-              status: 'green',
-          },
-          blue: {
-              text: '个人标签2',
-              status: 'blue',
-          },
-          purple: {
-              text: '个人标签3',
-              status: 'purple',
-          },
-          red: {
-            text: '个人标签4',
-            status: 'red',
-          },
-          brown: {
-              text: '个人标签5',
-              status: 'brown',
-          },
-          black: {
-              text: '个人标签6',
-              status: 'black',
-          },
-          yellow: {
-            text: '个人标签7',
-            status: 'yellow',
+        all: { text: '全部', status: 'Default' },
+        green: {
+          text: '个人标签1',
+          status: 'green'
         },
-      },
+        blue: {
+          text: '个人标签2',
+          status: 'blue'
+        },
+        purple: {
+          text: '个人标签3',
+          status: 'purple'
+        },
+        red: {
+          text: '个人标签4',
+          status: 'red'
+        },
+        brown: {
+          text: '个人标签5',
+          status: 'brown'
+        },
+        black: {
+          text: '个人标签6',
+          status: 'black'
+        },
+        yellow: {
+          text: '个人标签7',
+          status: 'yellow'
+        }
+      }
       // render:(_, record) => {
       //   console.log(record);
       // }
@@ -132,35 +132,35 @@ const Contact = (props) => {
       filters: true,
       valueType: 'select',
       valueEnum: {
-          all: { text: '全部', status: 'Default' },
-          green: {
-              text: '协作标签1',
-              status: 'green',
-          },
-          blue: {
-              text: '协作标签2',
-              status: 'blue',
-          },
-          purple: {
-              text: '协作标签3',
-              status: 'purple',
-          },
-          red: {
-            text: '协作标签4',
-            status: 'red',
-          },
-          brown: {
-              text: '协作标签5',
-              status: 'brown',
-          },
-          black: {
-              text: '协作标签6',
-              status: 'black',
-          },
-          yellow: {
-            text: '协作标签7',
-            status: 'yellow',
+        all: { text: '全部', status: 'Default' },
+        green: {
+          text: '协作标签1',
+          status: 'green'
         },
+        blue: {
+          text: '协作标签2',
+          status: 'blue'
+        },
+        purple: {
+          text: '协作标签3',
+          status: 'purple'
+        },
+        red: {
+          text: '协作标签4',
+          status: 'red'
+        },
+        brown: {
+          text: '协作标签5',
+          status: 'brown'
+        },
+        black: {
+          text: '协作标签6',
+          status: 'black'
+        },
+        yellow: {
+          text: '协作标签7',
+          status: 'yellow'
+        }
       }
     },
     {
@@ -192,7 +192,7 @@ const Contact = (props) => {
       title: '软件锁',
       dataIndex: 'keynum',
       key: 'keynum',
-      render: (keynum) => <a>{keynum}</a>
+      render: keynum => <a>{keynum}</a>
     },
     {
       title: '大司空',
@@ -213,10 +213,6 @@ const Contact = (props) => {
   const {
     contactName: { list }
   } = props // 将contact中的pros.list命名为list
-  // const dataSource = [...list];
-  // console.log(props);
-  // console.log(list);
-  // console.log(dataSource);
   const [ columnsStateMap, setColumnsStateMap ] = useState({
     telephone: {
       show: false
@@ -230,9 +226,6 @@ const Contact = (props) => {
     office: {
       show: false
     },
-    // local: {
-    //   show: false
-    // },
     stay: {
       show: false
     },
@@ -249,11 +242,11 @@ const Contact = (props) => {
       const { dispatch } = props
       dispatch({
         type: 'contact/fetch'
-      })// 派发出这个action就会调用contact中的fetch函数,然后就会请求数据
+      }) // 派发出这个action就会调用contact中的fetch函数,然后就会请求数据
     }
     initData()
-  }, [])
-  
+  }, [ props ])
+
   return (
     // <PageHeaderWrapper></PageHeaderWrapper>
     <Card bordered={false}>
@@ -268,7 +261,7 @@ const Contact = (props) => {
         }}
         scroll={{ y: 580 }}
         columnsStateMap={columnsStateMap}
-        onColumnsStateChange={(map) => setColumnsStateMap(map)}
+        onColumnsStateChange={map => setColumnsStateMap(map)}
         headerTitle="联系人"
         toolBarRender={() => [
           <Button key="button" icon={<PlusOutlined />} type="primary">
@@ -276,7 +269,7 @@ const Contact = (props) => {
           </Button>
         ]}
       />
-      <PopContactForm onClose={hideDrawer} visible={visible} onCreate={onCreate}/>
+      <PopContactForm onClose={hideDrawer} visible={visible} onCreate={onCreate} />
     </Card>
   )
 }

+ 3 - 2
src/pages/Customer/customer.less

@@ -1,4 +1,5 @@
 @import '~antd/es/style/themes/default.less';
-.formTextmuted{
+.formTextmuted {
+  height: 1px;
   color: #868e96 !important;
-}
+}

+ 8 - 9
src/pages/ListTableList/components/CreateForm.jsx

@@ -1,19 +1,18 @@
-import React from 'react';
-import { Modal } from 'antd';
+import React from 'react'
+import { Modal } from 'antd'
 
-const CreateForm = (props) => {
-  const { modalVisible, onCancel } = props;
+const CreateForm = props => {
+  const { modalVisible, onCancel } = props
   return (
     <Modal
       destroyOnClose
       title="新建规则"
       visible={modalVisible}
       onCancel={() => onCancel()}
-      footer={null}
-    >
+      footer={null}>
       {props.children}
     </Modal>
-  );
-};
+  )
+}
 
-export default CreateForm;
+export default CreateForm

+ 30 - 35
src/pages/ListTableList/components/UpdateForm.jsx

@@ -1,53 +1,50 @@
-import React from 'react';
-import { Modal } from 'antd';
+import React from 'react'
+import { Modal } from 'antd'
 import {
   ProFormSelect,
   ProFormText,
   ProFormTextArea,
   StepsForm,
   ProFormRadio,
-  ProFormDateTimePicker,
-} from '@ant-design/pro-form';
+  ProFormDateTimePicker
+} from '@ant-design/pro-form'
 
-const UpdateForm = (props) => (
+const UpdateForm = props => (
   <StepsForm
     stepsProps={{
-      size: 'small',
+      size: 'small'
     }}
     stepsFormRender={(dom, submitter) => {
       return (
         <Modal
           width={640}
           bodyStyle={{
-            padding: '32px 40px 48px',
+            padding: '32px 40px 48px'
           }}
           destroyOnClose
           title="规则配置"
           visible={props.updateModalVisible}
           footer={submitter}
-          onCancel={() => props.onCancel()}
-        >
+          onCancel={() => props.onCancel()}>
           {dom}
         </Modal>
-      );
+      )
     }}
-    onFinish={props.onSubmit}
-  >
+    onFinish={props.onSubmit}>
     <StepsForm.StepForm
       initialValues={{
         name: props.values.name,
-        desc: props.values.desc,
+        desc: props.values.desc
       }}
-      title="基本信息"
-    >
+      title="基本信息">
       <ProFormText
         name="name"
         label="规则名称"
         rules={[
           {
             required: true,
-            message: '请输入规则名称!',
-          },
+            message: '请输入规则名称!'
+          }
         ]}
       />
       <ProFormTextArea
@@ -58,24 +55,23 @@ const UpdateForm = (props) => (
           {
             required: true,
             message: '请输入至少五个字符的规则描述!',
-            min: 5,
-          },
+            min: 5
+          }
         ]}
       />
     </StepsForm.StepForm>
     <StepsForm.StepForm
       initialValues={{
         target: '0',
-        template: '0',
+        template: '0'
       }}
-      title="配置规则属性"
-    >
+      title="配置规则属性">
       <ProFormSelect
         name="target"
         label="监控对象"
         valueEnum={{
           0: '表一',
-          1: '表二',
+          1: '表二'
         }}
       />
       <ProFormSelect
@@ -83,7 +79,7 @@ const UpdateForm = (props) => (
         label="规则模板"
         valueEnum={{
           0: '规则模板一',
-          1: '规则模板二',
+          1: '规则模板二'
         }}
       />
       <ProFormRadio.Group
@@ -92,30 +88,29 @@ const UpdateForm = (props) => (
         options={[
           {
             value: '0',
-            label: '强',
+            label: '强'
           },
           {
             value: '1',
-            label: '弱',
-          },
+            label: '弱'
+          }
         ]}
       />
     </StepsForm.StepForm>
     <StepsForm.StepForm
       initialValues={{
         type: '1',
-        frequency: 'month',
+        frequency: 'month'
       }}
-      title="设定调度周期"
-    >
+      title="设定调度周期">
       <ProFormDateTimePicker
         name="time"
         label="开始时间"
         rules={[
           {
             required: true,
-            message: '请选择开始时间!',
-          },
+            message: '请选择开始时间!'
+          }
         ]}
       />
       <ProFormSelect
@@ -124,11 +119,11 @@ const UpdateForm = (props) => (
         width="xs"
         valueEnum={{
           month: '月',
-          week: '周',
+          week: '周'
         }}
       />
     </StepsForm.StepForm>
   </StepsForm>
-);
+)
 
-export default UpdateForm;
+export default UpdateForm

+ 101 - 106
src/pages/ListTableList/index.jsx

@@ -1,84 +1,84 @@
-import { PlusOutlined } from '@ant-design/icons';
-import { Button, Divider, message, Input, Drawer } from 'antd';
-import React, { useState, useRef } from 'react';
-import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
-import ProTable from '@ant-design/pro-table';
-import ProDescriptions from '@ant-design/pro-descriptions';
-import CreateForm from './components/CreateForm';
-import UpdateForm from './components/UpdateForm';
-import { queryRule, updateRule, addRule, removeRule } from './service';
+import { PlusOutlined } from '@ant-design/icons'
+import { Button, Divider, message, Input, Drawer } from 'antd'
+import React, { useState, useRef } from 'react'
+import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'
+import ProTable from '@ant-design/pro-table'
+import ProDescriptions from '@ant-design/pro-descriptions'
+import CreateForm from './components/CreateForm'
+import UpdateForm from './components/UpdateForm'
+import { queryRule, updateRule, addRule, removeRule } from './service'
 /**
  * 添加节点
  * @param fields
  */
 
-const handleAdd = async (fields) => {
-  const hide = message.loading('正在添加');
+const handleAdd = async fields => {
+  const hide = message.loading('正在添加')
 
   try {
-    await addRule({ ...fields });
-    hide();
-    message.success('添加成功');
-    return true;
+    await addRule({ ...fields })
+    hide()
+    message.success('添加成功')
+    return true
   } catch (error) {
-    hide();
-    message.error('添加失败请重试!');
-    return false;
+    hide()
+    message.error('添加失败请重试!')
+    return false
   }
-};
+}
 /**
  * 更新节点
  * @param fields
  */
 
-const handleUpdate = async (fields) => {
-  const hide = message.loading('正在配置');
+const handleUpdate = async fields => {
+  const hide = message.loading('正在配置')
 
   try {
     await updateRule({
       name: fields.name,
       desc: fields.desc,
-      key: fields.key,
-    });
-    hide();
-    message.success('配置成功');
-    return true;
+      key: fields.key
+    })
+    hide()
+    message.success('配置成功')
+    return true
   } catch (error) {
-    hide();
-    message.error('配置失败请重试!');
-    return false;
+    hide()
+    message.error('配置失败请重试!')
+    return false
   }
-};
+}
 /**
  *  删除节点
  * @param selectedRows
  */
 
-const handleRemove = async (selectedRows) => {
-  const hide = message.loading('正在删除');
-  if (!selectedRows) return true;
+const handleRemove = async selectedRows => {
+  const hide = message.loading('正在删除')
+  if (!selectedRows) return true
 
   try {
     await removeRule({
-      key: selectedRows.map((row) => row.key),
-    });
-    hide();
-    message.success('删除成功,即将刷新');
-    return true;
+      key: selectedRows.map(row => row.key)
+    })
+    hide()
+    message.success('删除成功,即将刷新')
+    return true
   } catch (error) {
-    hide();
-    message.error('删除失败,请重试');
-    return false;
+    hide()
+    message.error('删除失败,请重试')
+    return false
   }
-};
+}
 
 const TableList = () => {
-  const [createModalVisible, handleModalVisible] = useState(false);
-  const [updateModalVisible, handleUpdateModalVisible] = useState(false);
-  const [stepFormValues, setStepFormValues] = useState({});
-  const actionRef = useRef();
-  const [row, setRow] = useState();
-  const [selectedRowsState, setSelectedRows] = useState([]);
+  const [ createModalVisible, handleModalVisible ] = useState(false)
+  const [ updateModalVisible, handleUpdateModalVisible ] = useState(false)
+  const [ stepFormValues, setStepFormValues ] = useState({})
+  const actionRef = useRef()
+  const [ row, setRow ] = useState()
+  const [ selectedRowsState, setSelectedRows ] = useState([])
   const columns = [
     {
       title: '规则名称',
@@ -88,25 +88,25 @@ const TableList = () => {
         rules: [
           {
             required: true,
-            message: '规则名称为必填项',
-          },
-        ],
+            message: '规则名称为必填项'
+          }
+        ]
       },
       render: (dom, entity) => {
-        return <a onClick={() => setRow(entity)}>{dom}</a>;
-      },
+        return <a onClick={() => setRow(entity)}>{dom}</a>
+      }
     },
     {
       title: '描述',
       dataIndex: 'desc',
-      valueType: 'textarea',
+      valueType: 'textarea'
     },
     {
       title: '服务调用次数',
       dataIndex: 'callNo',
       sorter: true,
       hideInForm: true,
-      renderText: (val) => `${val} 万`,
+      renderText: val => `${val} 万`
     },
     {
       title: '状态',
@@ -115,21 +115,21 @@ const TableList = () => {
       valueEnum: {
         0: {
           text: '关闭',
-          status: 'Default',
+          status: 'Default'
         },
         1: {
           text: '运行中',
-          status: 'Processing',
+          status: 'Processing'
         },
         2: {
           text: '已上线',
-          status: 'Success',
+          status: 'Success'
         },
         3: {
           text: '异常',
-          status: 'Error',
-        },
-      },
+          status: 'Error'
+        }
+      }
     },
     {
       title: '上次调度时间',
@@ -138,18 +138,18 @@ const TableList = () => {
       valueType: 'dateTime',
       hideInForm: true,
       renderFormItem: (item, { defaultRender, ...rest }, form) => {
-        const status = form.getFieldValue('status');
+        const status = form.getFieldValue('status')
 
         if (`${status}` === '0') {
-          return false;
+          return false
         }
 
         if (`${status}` === '3') {
-          return <Input {...rest} placeholder="请输入异常原因!" />;
+          return <Input {...rest} placeholder="请输入异常原因!" />
         }
 
-        return defaultRender(item);
-      },
+        return defaultRender(item)
+      }
     },
     {
       title: '操作',
@@ -159,18 +159,17 @@ const TableList = () => {
         <>
           <a
             onClick={() => {
-              handleUpdateModalVisible(true);
-              setStepFormValues(record);
-            }}
-          >
+              handleUpdateModalVisible(true)
+              setStepFormValues(record)
+            }}>
             配置
           </a>
           <Divider type="vertical" />
           <a href="">订阅警报</a>
         </>
-      ),
-    },
-  ];
+      )
+    }
+  ]
   return (
     <PageContainer>
       <ProTable
@@ -178,17 +177,17 @@ const TableList = () => {
         actionRef={actionRef}
         rowKey="key"
         search={{
-          labelWidth: 120,
+          labelWidth: 120
         }}
         toolBarRender={() => [
           <Button type="primary" onClick={() => handleModalVisible(true)}>
-            <PlusOutlined /> 新建
-          </Button>,
+            <PlusOutlined /><span>新建</span>
+          </Button>
         ]}
         request={(params, sorter, filter) => queryRule({ ...params, sorter, filter })}
         columns={columns}
         rowSelection={{
-          onChange: (_, selectedRows) => setSelectedRows(selectedRows),
+          onChange: (_, selectedRows) => setSelectedRows(selectedRows)
         }}
       />
       {selectedRowsState?.length > 0 && (
@@ -198,9 +197,8 @@ const TableList = () => {
               已选择{' '}
               <a
                 style={{
-                  fontWeight: 600,
-                }}
-              >
+                  fontWeight: 600
+                }}>
                 {selectedRowsState.length}
               </a>{' '}
               项&nbsp;&nbsp;
@@ -208,15 +206,13 @@ const TableList = () => {
                 服务调用次数总计 {selectedRowsState.reduce((pre, item) => pre + item.callNo, 0)} 万
               </span>
             </div>
-          }
-        >
+          }>
           <Button
             onClick={async () => {
-              await handleRemove(selectedRowsState);
-              setSelectedRows([]);
-              actionRef.current?.reloadAndRest?.();
-            }}
-          >
+              await handleRemove(selectedRowsState)
+              setSelectedRows([])
+              actionRef.current?.reloadAndRest?.()
+            }}>
             批量删除
           </Button>
           <Button type="primary">批量审批</Button>
@@ -224,14 +220,14 @@ const TableList = () => {
       )}
       <CreateForm onCancel={() => handleModalVisible(false)} modalVisible={createModalVisible}>
         <ProTable
-          onSubmit={async (value) => {
-            const success = await handleAdd(value);
+          onSubmit={async value => {
+            const success = await handleAdd(value)
 
             if (success) {
-              handleModalVisible(false);
+              handleModalVisible(false)
 
               if (actionRef.current) {
-                actionRef.current.reload();
+                actionRef.current.reload()
               }
             }
           }}
@@ -242,21 +238,21 @@ const TableList = () => {
       </CreateForm>
       {stepFormValues && Object.keys(stepFormValues).length ? (
         <UpdateForm
-          onSubmit={async (value) => {
-            const success = await handleUpdate(value);
+          onSubmit={async value => {
+            const success = await handleUpdate(value)
 
             if (success) {
-              handleUpdateModalVisible(false);
-              setStepFormValues({});
+              handleUpdateModalVisible(false)
+              setStepFormValues({})
 
               if (actionRef.current) {
-                actionRef.current.reload();
+                actionRef.current.reload()
               }
             }
           }}
           onCancel={() => {
-            handleUpdateModalVisible(false);
-            setStepFormValues({});
+            handleUpdateModalVisible(false)
+            setStepFormValues({})
           }}
           updateModalVisible={updateModalVisible}
           values={stepFormValues}
@@ -267,26 +263,25 @@ const TableList = () => {
         width={600}
         visible={!!row}
         onClose={() => {
-          setRow(undefined);
+          setRow(undefined)
         }}
-        closable={false}
-      >
+        closable={false}>
         {row?.name && (
           <ProDescriptions
             column={2}
             title={row?.name}
             request={async () => ({
-              data: row || {},
+              data: row || {}
             })}
             params={{
-              id: row?.name,
+              id: row?.name
             }}
             columns={columns}
           />
         )}
       </Drawer>
     </PageContainer>
-  );
-};
+  )
+}
 
-export default TableList;
+export default TableList

+ 9 - 9
src/pages/ListTableList/service.js

@@ -1,25 +1,25 @@
-import request from '@/utils/request';
+import request from '@/utils/request'
 
 export async function queryRule(params) {
   return request('/api/rule', {
-    params,
-  });
+    params
+  })
 }
 export async function removeRule(params) {
   return request('/api/rule', {
     method: 'POST',
-    data: { ...params, method: 'delete' },
-  });
+    data: { ...params, method: 'delete' }
+  })
 }
 export async function addRule(params) {
   return request('/api/rule', {
     method: 'POST',
-    data: { ...params, method: 'post' },
-  });
+    data: { ...params, method: 'post' }
+  })
 }
 export async function updateRule(params) {
   return request('/api/rule', {
     method: 'POST',
-    data: { ...params, method: 'update' },
-  });
+    data: { ...params, method: 'update' }
+  })
 }

+ 7 - 9
src/pages/Product/Cloud/build.jsx

@@ -1,12 +1,10 @@
-import React from 'react';
-import { Modal } from 'antd';
+import React from 'react'
+import { Modal } from 'antd'
 
-class Build extends React.Component{
-    render(){
-      return(
-        <div>build</div>
-      );
-    }
+class Build extends React.Component {
+  render() {
+    return <div>build</div>
+  }
 }
 
-export default Build;
+export default Build

+ 6 - 8
src/pages/Product/Cloud/curing.jsx

@@ -1,11 +1,9 @@
-import React from 'react';
+import React from 'react'
 
-class Curing extends React.Component{
-    render(){
-      return(
-        <div>curing</div>
-      );
-    }
+class Curing extends React.Component {
+  render() {
+    return <div>curing</div>
+  }
 }
 
-export default Curing;
+export default Curing

+ 8 - 8
src/pages/Product/Lock/lockcount.jsx

@@ -1,14 +1,14 @@
-import React from 'react';
-import { PageHeaderWrapper } from '@ant-design/pro-layout';
-import { Card } from 'antd';
+import React from 'react'
+import { PageHeaderWrapper } from '@ant-design/pro-layout'
+import { Card } from 'antd'
 
-class Lockcount extends React.Component{
-  render(){
-    return(
+class Lockcount extends React.Component {
+  render() {
+    return (
       <PageHeaderWrapper>
         <Card bordered={false}>lockcount</Card>
       </PageHeaderWrapper>
-    );
+    )
   }
 }
-export default Lockcount;
+export default Lockcount

+ 7 - 9
src/pages/Product/Lock/lockstore.jsx

@@ -1,17 +1,15 @@
-import React from 'react';
-import { PageHeaderWrapper } from '@ant-design/pro-layout';
-import { Card } from 'antd';
+import React from 'react'
+import { PageHeaderWrapper } from '@ant-design/pro-layout'
+import { Card } from 'antd'
 // import { createFromIconfontCN } from '@ant-design/icons';
 // const IconFont = createFromIconfontCN({
 //   scriptUrl: '//at.alicdn.com/t/font_2276974_y914krojop.js',
 // });
 
-class Lockstore extends React.Component{
-  render(){
-    return(
-      <Card bordered={false}>lockstore</Card>
-    );
+class Lockstore extends React.Component {
+  render() {
+    return <Card bordered={false}>lockstore</Card>
   }
 }
 
-export default Lockstore;
+export default Lockstore

+ 11 - 14
src/pages/Welcome.jsx

@@ -1,7 +1,7 @@
-import React from 'react';
-import { PageContainer } from '@ant-design/pro-layout';
-import { Card, Alert, Typography } from 'antd';
-import styles from './Welcome.less';
+import React from 'react'
+import { PageContainer } from '@ant-design/pro-layout'
+import { Card, Alert, Typography } from 'antd'
+import styles from './Welcome.less'
 
 const CodePreview = ({ children }) => (
   <pre className={styles.pre}>
@@ -9,7 +9,7 @@ const CodePreview = ({ children }) => (
       <Typography.Text copyable>{children}</Typography.Text>
     </code>
   </pre>
-);
+)
 
 export default () => (
   <PageContainer>
@@ -21,7 +21,7 @@ export default () => (
         banner
         style={{
           margin: -12,
-          marginBottom: 24,
+          marginBottom: 24
         }}
       />
       <Typography.Text strong>
@@ -29,8 +29,7 @@ export default () => (
         <a
           href="https://procomponents.ant.design/components/table"
           rel="noopener noreferrer"
-          target="__blank"
-        >
+          target="__blank">
           欢迎使用
         </a>
       </Typography.Text>
@@ -38,19 +37,17 @@ export default () => (
       <Typography.Text
         strong
         style={{
-          marginBottom: 12,
-        }}
-      >
+          marginBottom: 12
+        }}>
         高级布局{' '}
         <a
           href="https://procomponents.ant.design/components/layout"
           rel="noopener noreferrer"
-          target="__blank"
-        >
+          target="__blank">
           欢迎使用
         </a>
       </Typography.Text>
       <CodePreview>yarn add @ant-design/pro-layout</CodePreview>
     </Card>
   </PageContainer>
-);
+)

+ 8 - 8
src/pages/Workbench/workbench.jsx

@@ -1,14 +1,14 @@
-import React from 'react';
-import { PageHeaderWrapper } from '@ant-design/pro-layout';
-import { Card } from 'antd';
+import React from 'react'
+import { PageHeaderWrapper } from '@ant-design/pro-layout'
+import { Card } from 'antd'
 
-class Lockcount extends React.Component{
-  render(){
-    return(
+class Lockcount extends React.Component {
+  render() {
+    return (
       <PageHeaderWrapper>
         <Card bordered={false}>工作台首页</Card>
       </PageHeaderWrapper>
-    );
+    )
   }
 }
-export default Lockcount;
+export default Lockcount

+ 8 - 13
src/pages/document.ejs

@@ -3,10 +3,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta http-equiv="X-UA-Compatible" content="IE=edge" />
-    <meta
-      name="keywords"
-      content="CLD.SystemV2"
-    />
+    <meta name="keywords" content="CLD.SystemV2" />
     <meta
       name="description"
       content="
@@ -193,18 +190,16 @@
         <img src="<%= context.config.publicPath +'pro_icon.svg'%>" alt="logo" width="256" />
         <div class="page-loading-warp">
           <div class="ant-spin ant-spin-lg ant-spin-spinning">
-            <span class="ant-spin-dot ant-spin-dot-spin"
-              ><i class="ant-spin-dot-item"></i><i class="ant-spin-dot-item"></i
-              ><i class="ant-spin-dot-item"></i><i class="ant-spin-dot-item"></i
-            ></span>
+            <span class="ant-spin-dot ant-spin-dot-spin">
+              <i class="ant-spin-dot-item"></i>
+              <i class="ant-spin-dot-item"></i>
+              <i class="ant-spin-dot-item"></i>
+              <i class="ant-spin-dot-item"></i>
+            </span>
           </div>
         </div>
         <div style="display: flex; align-items: center; justify-content: center">
-          <img
-            src="/logo.svg"
-            width="32"
-            style="margin-right: 8px"
-          />
+          <img src="/logo.svg" width="32" style="margin-right: 8px" />
           <!-- <img
             src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg"
             width="32"

+ 40 - 43
src/pages/user/login/index.jsx

@@ -4,7 +4,7 @@ import {
   MailTwoTone,
   MobileTwoTone,
   // TaobaoCircleOutlined,
-  UserOutlined,
+  UserOutlined
   // WeiboCircleOutlined,
 } from '@ant-design/icons'
 import { Alert, message, Tabs } from 'antd'
@@ -17,7 +17,7 @@ import styles from './index.less'
 const LoginMessage = ({ content }) => (
   <Alert
     style={{
-      marginBottom: 24,
+      marginBottom: 24
     }}
     message={content}
     type="error"
@@ -25,17 +25,17 @@ const LoginMessage = ({ content }) => (
   />
 )
 
-const Login = (props) => {
+const Login = props => {
   const { userLogin = {}, submitting } = props
   const { status, type: loginType } = userLogin
-  const [type, setType] = useState('account')
+  const [ type, setType ] = useState('account')
   const intl = useIntl()
 
-  const handleSubmit = (values) => {
+  const handleSubmit = values => {
     const { dispatch } = props
     dispatch({
       type: 'login/login',
-      payload: { ...values, type },
+      payload: { ...values, type }
     })
   }
 
@@ -43,7 +43,7 @@ const Login = (props) => {
     <div className={styles.main}>
       <ProForm
         initialValues={{
-          autoLogin: true,
+          autoLogin: true
         }}
         submitter={{
           render: (_, dom) => dom.pop(),
@@ -51,20 +51,19 @@ const Login = (props) => {
             loading: submitting,
             size: 'large',
             style: {
-              width: '100%',
-            },
-          },
+              width: '100%'
+            }
+          }
         }}
-        onFinish={async (values) => {
+        onFinish={async values => {
           handleSubmit(values)
-        }}
-      >
+        }}>
         <Tabs activeKey={type} onChange={setType} className={styles.tabMargin}>
           <Tabs.TabPane
             key="account"
             tab={intl.formatMessage({
               id: 'pages.login.accountLogin.tab',
-              defaultMessage: '账户密码登录',
+              defaultMessage: '账户密码登录'
             })}
           />
           {/* <Tabs.TabPane
@@ -80,7 +79,7 @@ const Login = (props) => {
           <LoginMessage
             content={intl.formatMessage({
               id: 'pages.login.accountLogin.errorMessage',
-              defaultMessage: '账户或密码错误(admin/ant.design)',
+              defaultMessage: '账户或密码错误(admin/ant.design)'
             })}
           />
         )}
@@ -90,11 +89,11 @@ const Login = (props) => {
               name="userName"
               fieldProps={{
                 size: 'large',
-                prefix: <UserOutlined className={styles.prefixIcon} />,
+                prefix: <UserOutlined className={styles.prefixIcon} />
               }}
               placeholder={intl.formatMessage({
                 id: 'pages.login.username.placeholder',
-                defaultMessage: '用户名: admin or user',
+                defaultMessage: '用户名: admin or user'
               })}
               rules={[
                 {
@@ -104,19 +103,19 @@ const Login = (props) => {
                       id="pages.login.username.required"
                       defaultMessage="请输入用户名!"
                     />
-                  ),
-                },
+                  )
+                }
               ]}
             />
             <ProFormText.Password
               name="password"
               fieldProps={{
                 size: 'large',
-                prefix: <LockTwoTone className={styles.prefixIcon} />,
+                prefix: <LockTwoTone className={styles.prefixIcon} />
               }}
               placeholder={intl.formatMessage({
                 id: 'pages.login.password.placeholder',
-                defaultMessage: '密码: ant.design',
+                defaultMessage: '密码: ant.design'
               })}
               rules={[
                 {
@@ -126,8 +125,8 @@ const Login = (props) => {
                       id="pages.login.password.required"
                       defaultMessage="请输入密码!"
                     />
-                  ),
-                },
+                  )
+                }
               ]}
             />
           </>
@@ -141,12 +140,12 @@ const Login = (props) => {
             <ProFormText
               fieldProps={{
                 size: 'large',
-                prefix: <MobileTwoTone className={styles.prefixIcon} />,
+                prefix: <MobileTwoTone className={styles.prefixIcon} />
               }}
               name="mobile"
               placeholder={intl.formatMessage({
                 id: 'pages.login.phoneNumber.placeholder',
-                defaultMessage: '手机号',
+                defaultMessage: '手机号'
               })}
               rules={[
                 {
@@ -156,7 +155,7 @@ const Login = (props) => {
                       id="pages.login.phoneNumber.required"
                       defaultMessage="请输入手机号!"
                     />
-                  ),
+                  )
                 },
                 {
                   pattern: /^1\d{10}$/,
@@ -165,31 +164,31 @@ const Login = (props) => {
                       id="pages.login.phoneNumber.invalid"
                       defaultMessage="手机号格式错误!"
                     />
-                  ),
-                },
+                  )
+                }
               ]}
             />
             <ProFormCaptcha
               fieldProps={{
                 size: 'large',
-                prefix: <MailTwoTone className={styles.prefixIcon} />,
+                prefix: <MailTwoTone className={styles.prefixIcon} />
               }}
               captchaProps={{
-                size: 'large',
+                size: 'large'
               }}
               placeholder={intl.formatMessage({
                 id: 'pages.login.captcha.placeholder',
-                defaultMessage: '请输入验证码',
+                defaultMessage: '请输入验证码'
               })}
               captchaTextRender={(timing, count) =>
                 timing
                   ? `${count} ${intl.formatMessage({
                       id: 'pages.getCaptchaSecondText',
-                      defaultMessage: '获取验证码',
+                      defaultMessage: '获取验证码'
                     })}`
                   : intl.formatMessage({
                       id: 'pages.login.phoneLogin.getVerificationCode',
-                      defaultMessage: '获取验证码',
+                      defaultMessage: '获取验证码'
                     })
               }
               name="captcha"
@@ -201,10 +200,10 @@ const Login = (props) => {
                       id="pages.login.captcha.required"
                       defaultMessage="请输入验证码!"
                     />
-                  ),
-                },
+                  )
+                }
               ]}
-              onGetCaptcha={async (mobile) => {
+              onGetCaptcha={async mobile => {
                 const result = await getFakeCaptcha(mobile)
 
                 if (result === false) {
@@ -218,17 +217,15 @@ const Login = (props) => {
         )}
         <div
           style={{
-            marginBottom: 24,
-          }}
-        >
+            marginBottom: 24
+          }}>
           <ProFormCheckbox noStyle name="autoLogin">
             <FormattedMessage id="pages.login.rememberMe" defaultMessage="自动登录" />
           </ProFormCheckbox>
           <a
             style={{
-              float: 'right',
-            }}
-          >
+              float: 'right'
+            }}>
             <FormattedMessage id="pages.login.forgotPassword" defaultMessage="忘记密码" />
           </a>
         </div>
@@ -245,5 +242,5 @@ const Login = (props) => {
 
 export default connect(({ login, loading }) => ({
   userLogin: login,
-  submitting: loading.effects['login/login'],
+  submitting: loading.effects['login/login']
 }))(Login)

+ 3 - 3
src/pages/user/login/index.less

@@ -42,9 +42,9 @@
     font-size: @font-size-base;
   }
 
-  .tabMargin{
-    :global(.ant-tabs-tab){
+  .tabMargin {
+    :global(.ant-tabs-tab) {
       margin: 0;
     }
   }
-}
+}

+ 21 - 21
src/service-worker.js

@@ -4,22 +4,22 @@
 /* globals workbox */
 workbox.core.setCacheNameDetails({
   prefix: 'antd-pro',
-  suffix: 'v1',
-});
+  suffix: 'v1'
+})
 // Control all opened tabs ASAP
-workbox.clientsClaim();
+workbox.clientsClaim()
 
 /**
  * Use precaching list generated by workbox in build process.
  * https://developers.google.com/web/tools/workbox/reference-docs/latest/workbox.precaching
  */
-workbox.precaching.precacheAndRoute(self.__precacheManifest || []);
+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');
+workbox.routing.registerNavigationRoute('/index.html')
 
 /**
  * Use runtime cache:
@@ -32,39 +32,39 @@ workbox.routing.registerNavigationRoute('/index.html');
 /**
  * Handle API requests
  */
-workbox.routing.registerRoute(/\/api\//, workbox.strategies.networkFirst());
+workbox.routing.registerRoute(/\/api\//, workbox.strategies.networkFirst())
 
 /**
  * Handle third party requests
  */
 workbox.routing.registerRoute(
   /^https:\/\/gw\.alipayobjects\.com\//,
-  workbox.strategies.networkFirst(),
-);
+  workbox.strategies.networkFirst()
+)
 workbox.routing.registerRoute(
   /^https:\/\/cdnjs\.cloudflare\.com\//,
-  workbox.strategies.networkFirst(),
-);
-workbox.routing.registerRoute(/\/color.less/, workbox.strategies.networkFirst());
+  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;
+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: null
           }),
-        (error) =>
+        error =>
           replyPort.postMessage({
-            error,
-          }),
-      ),
-    );
+            error
+          })
+      )
+    )
   }
-});
+})

+ 4 - 4
src/services/contact.js

@@ -1,5 +1,5 @@
-import request from '@/utils/request';
+import request from '@/utils/request'
 
-export async function queryContact(){
-    return request('/api/contact');// 请求/api/contact 端口数据的函数 queryContact
-}
+export async function queryContact() {
+  return request('/api/contact') // 请求/api/contact 端口数据的函数 queryContact
+}

+ 8 - 11
src/services/login.js

@@ -1,15 +1,12 @@
-import request from '@/utils/request';
+import request from '@/utils/request'
 
 export async function fakeAccountLogin(params) {
-
- 
-
- // 发送接口请求数据
-//  loginSafety
-return request('/api/login/account', {
-  method: 'POST',
-  data:params
-});
+  // 发送接口请求数据
+  //  loginSafety
+  return request('/api/login/account', {
+    method: 'POST',
+    data: params
+  })
 
   // return request('/cld2/login', {
   //   method: 'POST',
@@ -17,5 +14,5 @@ return request('/api/login/account', {
   // });
 }
 export async function getFakeCaptcha(mobile) {
-  return request(`/api/login/captcha?mobile=${mobile}`);
+  return request(`/api/login/captcha?mobile=${mobile}`)
 }

+ 4 - 4
src/services/user.js

@@ -1,11 +1,11 @@
-import request from '@/utils/request';
+import request from '@/utils/request'
 
 export async function query() {
-  return request('/api/users');
+  return request('/api/users')
 }
 export async function queryCurrent() {
-  return request('/api/currentUser');
+  return request('/api/currentUser')
 }
 export async function queryNotices() {
-  return request('/api/notices');
+  return request('/api/notices')
 }

+ 8 - 8
src/utils/Authorized.js

@@ -1,19 +1,19 @@
-import RenderAuthorize from '@/components/Authorized';
-import { getAuthority } from './authority';
+import RenderAuthorize from '@/components/Authorized'
+import { getAuthority } from './authority'
 /* eslint-disable eslint-comments/disable-enable-pair */
 
 /* eslint-disable import/no-mutable-exports */
 
-let Authorized = RenderAuthorize(getAuthority()); // Reload the rights component
+let Authorized = RenderAuthorize(getAuthority()) // Reload the rights component
 
 const reloadAuthorized = () => {
-  Authorized = RenderAuthorize(getAuthority());
-};
+  Authorized = RenderAuthorize(getAuthority())
+}
 /**
  * hard code
  * block need it。
  */
 
-window.reloadAuthorized = reloadAuthorized;
-export { reloadAuthorized };
-export default Authorized;
+window.reloadAuthorized = reloadAuthorized
+export { reloadAuthorized }
+export default Authorized

+ 11 - 11
src/utils/authority.js

@@ -1,33 +1,33 @@
-import { reloadAuthorized } from './Authorized'; // use localStorage to store the authority info, which might be sent from server in actual project.
+import { reloadAuthorized } from './Authorized' // use localStorage to store the authority info, which might be sent from server in actual project.
 
 export function getAuthority(str) {
   const authorityString =
-    typeof str === 'undefined' && localStorage ? localStorage.getItem('antd-pro-authority') : str; // authorityString could be admin, "admin", ["admin"]
+    typeof str === 'undefined' && localStorage ? localStorage.getItem('antd-pro-authority') : str // authorityString could be admin, "admin", ["admin"]
 
-  let authority;
+  let authority
 
   try {
     if (authorityString) {
-      authority = JSON.parse(authorityString);
+      authority = JSON.parse(authorityString)
     }
   } catch (e) {
-    authority = authorityString;
+    authority = authorityString
   }
 
   if (typeof authority === 'string') {
-    return [authority];
+    return [ authority ]
   } // preview.pro.ant.design only do not use in your production.
   // preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。
 
   if (!authority && ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site') {
-    return ['admin'];
+    return [ 'admin' ]
   }
 
-  return authority;
+  return authority
 }
 export function setAuthority(authority) {
-  const proAuthority = typeof authority === 'string' ? [authority] : authority;
-  localStorage.setItem('antd-pro-authority', JSON.stringify(proAuthority)); // auto reload
+  const proAuthority = typeof authority === 'string' ? [ authority ] : authority
+  localStorage.setItem('antd-pro-authority', JSON.stringify(proAuthority)) // auto reload
 
-  reloadAuthorized();
+  reloadAuthorized()
 }

+ 17 - 17
src/utils/request.js

@@ -2,8 +2,8 @@
  * request 网络请求工具
  * 更详细的 api 文档: https://github.com/umijs/umi-request
  */
-import { extend } from 'umi-request';
-import { notification } from 'antd';
+import { extend } from 'umi-request'
+import { notification } from 'antd'
 
 const codeMessage = {
   200: '服务器成功返回请求的数据。',
@@ -20,31 +20,31 @@ const codeMessage = {
   500: '服务器发生错误,请检查服务器。',
   502: '网关错误。',
   503: '服务不可用,服务器暂时过载或维护。',
-  504: '网关超时。',
-};
+  504: '网关超时。'
+}
 /**
  * 异常处理程序
  */
 
-const errorHandler = (error) => {
-  const { response } = error;
+const errorHandler = error => {
+  const { response } = error
 
   if (response && response.status) {
-    const errorText = codeMessage[response.status] || response.statusText;
-    const { status, url } = response;
+    const errorText = codeMessage[response.status] || response.statusText
+    const { status, url } = response
     notification.error({
       message: `请求错误 ${status}: ${url}`,
-      description: errorText,
-    });
+      description: errorText
+    })
   } else if (!response) {
     notification.error({
       description: '您的网络发生异常,无法连接服务器',
-      message: '网络异常',
-    });
+      message: '网络异常'
+    })
   }
 
-  return response;
-};
+  return response
+}
 /**
  * 配置request请求时的默认参数
  */
@@ -52,6 +52,6 @@ const errorHandler = (error) => {
 const request = extend({
   errorHandler,
   // 默认错误处理
-  credentials: 'include', // 默认请求是否带上cookie
-});
-export default request;
+  credentials: 'include' // 默认请求是否带上cookie
+})
+export default request

+ 11 - 11
src/utils/utils.js

@@ -1,23 +1,23 @@
-import { parse } from 'querystring';
+import { parse } from 'querystring'
 /* eslint no-useless-escape:0 import/prefer-default-export:0 */
 
-const reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/;
-export const isUrl = (path) => reg.test(path);
+const reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/
+export const isUrl = path => reg.test(path)
 export const isAntDesignPro = () => {
   if (ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site') {
-    return true;
+    return true
   }
 
-  return window.location.hostname === 'preview.pro.ant.design';
-}; // 给官方演示站点用,用于关闭真实开发环境不需要使用的特性
+  return window.location.hostname === 'preview.pro.ant.design'
+} // 给官方演示站点用,用于关闭真实开发环境不需要使用的特性
 
 export const isAntDesignProOrDev = () => {
-  const { NODE_ENV } = process.env;
+  const { NODE_ENV } = process.env
 
   if (NODE_ENV === 'development') {
-    return true;
+    return true
   }
 
-  return isAntDesignPro();
-};
-export const getPageQuery = () => parse(window.location.href.split('?')[1]);
+  return isAntDesignPro()
+}
+export const getPageQuery = () => parse(window.location.href.split('?')[1])

+ 0 - 0
src/utils/utils.test.js


Some files were not shown because too many files changed in this diff