lanjianrong vor 5 Jahren
Ursprung
Commit
a814a01ef1

+ 1 - 8
config/routes.js

@@ -21,17 +21,10 @@ export default [
           {
             path: '/',
             component: '../layouts/BasicLayout',
-            authority: [
-              'admin',
-              'client_access',
-              'company_access',
-              'business_access',
-              'department_access'
-            ],
             routes: [
               {
                 path: '/',
-                redirect: '/customer/contact'
+                redirect: '/workbench'
               },
               {
                 path: '/workbench',

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

@@ -1,8 +1,7 @@
 export default {
   'pages.layouts.userLayout.title': '纵横办公系统',
   'pages.login.accountLogin.tab': '账户密码登录',
-  // 'pages.login.accountLogin.errorMessage': '错误的用户名和密码(admin/ant.design)',
-  'pages.login.accountLogin.errorMessage': '错误的用户名和密码',
+  'pages.login.accountLogin.errorMessage': '错误的用户名或密码',
   'pages.login.username.placeholder': '用户名: admin or user',
   'pages.login.username.required': '用户名是必填项!',
   'pages.login.password.placeholder': '密码: ant.design',

+ 33 - 29
src/pages/workbench/Dashboard/components/ReminderList/index.jsx

@@ -9,33 +9,8 @@ import styles from './index.less'
 
 const ReminderList = props => {
   const dispatch = useDispatch()
-  const { dataType, reminderCyclical, type } = props
-  const dataMap = {
-    1: 'client',
-    2: 'customer',
-    3: 'business'
-  }
-  const [state, setState] = useState({
-    loading: false,
-    client: []
-  })
-  const { run: tryGetList } = useRequest(params => queryReminderList(params), {
-    manual: true,
-    onSuccess: result => {
-      setState({ ...state, loading: false, client: result[dataMap[type]] })
-    }
-  })
-  console.log(state.client)
-  useEffect(() => {
-    tryGetList({ dataType, reminderCyclical, current: 1, pageSize: consts.MAX_PAGE_SIZE })
-  }, [])
-
-  const closeModal = () => {
-    dispatch({
-      type: 'single/changeModal'
-    })
-  }
-  const columns = [
+  const { dataType, reminderCyclical } = props
+  const clientColumns = [
     {
       title: '客户名称',
       dataIndex: 'staffName'
@@ -73,6 +48,34 @@ const ReminderList = props => {
       dataIndex: 'serviceTime'
     }
   ]
+  const dataMap = {
+    0: {
+      key: 'client',
+      columns: clientColumns
+    },
+    1: 'customer',
+    2: 'business'
+  }
+  // const columnsMap = {
+  //   0: 'clientColumns'
+  // }
+  const [dataSource, setDataSource] = useState(null)
+  const { run: tryGetList } = useRequest(params => queryReminderList(params), {
+    manual: true,
+    onSuccess: result => {
+      setDataSource(result[dataMap[dataType].key])
+    }
+  })
+  useEffect(() => {
+    tryGetList({ dataType, reminderCyclical, current: 1, pageSize: consts.MAX_PAGE_SIZE })
+  }, [])
+
+  const closeModal = () => {
+    dispatch({
+      type: 'single/changeModal'
+    })
+  }
+
   return (
     <div className={['ant-modal-content', styles.modalContainer].join(' ')}>
       <div className={styles.modalHeader}>
@@ -82,9 +85,10 @@ const ReminderList = props => {
       </div>
       <div className="mx-4">
         <ProTable
+          size="small"
           rowKey={record => record.rank}
-          columns={columns}
-          dataSource={state.client}
+          columns={dataMap[dataType].columns}
+          dataSource={dataSource}
           search={false}
           toolBarRender={false}
           pagination={false}