|
@@ -3,12 +3,13 @@ import TabsContent from '@/components/TabsContent';
|
|
import { MandateType, OrderType } from '@/pages/TaskManage/constent';
|
|
import { MandateType, OrderType } from '@/pages/TaskManage/constent';
|
|
import { getMandateList } from '@/services/TaskManage';
|
|
import { getMandateList } from '@/services/TaskManage';
|
|
import { RightOutlined } from '@ant-design/icons';
|
|
import { RightOutlined } from '@ant-design/icons';
|
|
-import { useLocation, useNavigate, useParams } from '@umijs/max';
|
|
|
|
|
|
+import { connect, useLocation, useNavigate, useParams } from '@umijs/max';
|
|
import { List, Spin } from 'antd';
|
|
import { List, Spin } from 'antd';
|
|
import { useEffect, useState } from 'react';
|
|
import { useEffect, useState } from 'react';
|
|
import styles from './index.less';
|
|
import styles from './index.less';
|
|
|
|
|
|
-const MyTask = () => {
|
|
|
|
|
|
+const MyTask = (props) => {
|
|
|
|
+ const { userList, dispatch } = props;
|
|
const { projectId } = useParams();
|
|
const { projectId } = useParams();
|
|
const project_id = Number(projectId === '' ? '0' : projectId);
|
|
const project_id = Number(projectId === '' ? '0' : projectId);
|
|
|
|
|
|
@@ -55,6 +56,15 @@ const MyTask = () => {
|
|
});
|
|
});
|
|
}, []);
|
|
}, []);
|
|
|
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
+ if (userList.length === 0) {
|
|
|
|
+ dispatch({
|
|
|
|
+ type: 'taskUser/fetchUserList',
|
|
|
|
+ payload: { project_id },
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }, []);
|
|
|
|
+
|
|
const onTabChange = (key) => {
|
|
const onTabChange = (key) => {
|
|
setTab(key);
|
|
setTab(key);
|
|
localStorage.setItem('taskTab', key);
|
|
localStorage.setItem('taskTab', key);
|
|
@@ -161,4 +171,8 @@ const MyTask = () => {
|
|
);
|
|
);
|
|
};
|
|
};
|
|
|
|
|
|
-export default MyTask;
|
|
|
|
|
|
+export default connect(({ taskUser }) => {
|
|
|
|
+ return {
|
|
|
|
+ userList: taskUser.userList,
|
|
|
|
+ };
|
|
|
|
+})(MyTask);
|