소스 검색

Squashed commit of the following:
修改bug
commit 08300ddd2e2b9eec673707ff083b0c3064f47a5c
Author: Renxy <18510891294@163.com>
Date: Fri Mar 1 11:43:53 2024 +0800

修改派遣用户列表

Renxy 1 년 전
부모
커밋
d07dac2104
3개의 변경된 파일37개의 추가작업 그리고 18개의 파일을 삭제
  1. 2 2
      .umirc.ts
  2. 16 14
      src/pages/TaskManage/Detail/TaskDetail/TaskDetail.tsx
  3. 19 2
      src/pages/TaskManage/models/user.js

+ 2 - 2
.umirc.ts

@@ -28,9 +28,9 @@ export default defineConfig({
   proxy: {
     '/api': {
       // target: 'http://47.96.12.136:8888/',
-      target: 'http://47.96.12.136:8788/',
+      // target: 'http://47.96.12.136:8788/',
       // target: 'http://120.55.44.4:8900/',
-      //target: 'https://metawant.greentech.com.cn/',
+      target: 'https://metawant.greentech.com.cn/',
       changeOrigin: true,
     },
   },

+ 16 - 14
src/pages/TaskManage/Detail/TaskDetail/TaskDetail.tsx

@@ -240,7 +240,7 @@ const MandateSelectModal = (props: any) => {
 };
 
 const DispatchTaskModal = (props: any) => {
-  const { open, onCancel, onOK, userList } = props;
+  const { open, onCancel, onOK, userList = [] } = props;
 
   const [form] = Form.useForm();
 
@@ -325,11 +325,12 @@ const DispatchTaskModal = (props: any) => {
 
 interface IPropsType {
   userList: IUserType[];
+  dispatchUserList: IUserType[];
   dispatch: (args: { type: string; payload: object }) => void;
 }
 
 function TaskDetail(props: IPropsType) {
-  const { userList, dispatch } = props;
+  const { userList, dispatchUserList, dispatch } = props;
 
   const location = useLocation();
   const queryParams = new URLSearchParams(location.search);
@@ -519,6 +520,8 @@ function TaskDetail(props: IPropsType) {
     manual: true,
   });
 
+  console.log('0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-', dispatchUserList);
+
   // 忽略
   const onIgnoreTaskConfirm = async (id: any, reason: string) => {
     const params = {
@@ -631,6 +634,10 @@ function TaskDetail(props: IPropsType) {
         payload: { project_id },
       });
     }
+    dispatch({
+      type: 'taskUser/fetchDispatchUserList',
+      payload: { project_id },
+    });
   }, []);
 
   useEffect(() => {
@@ -951,7 +958,7 @@ function TaskDetail(props: IPropsType) {
         />
         <DispatchTaskModal
           open={dispatchModalOpen}
-          userList={userList}
+          userList={dispatchUserList}
           onCancel={() => {
             setDispatchModalOpen(false);
           }}
@@ -962,14 +969,9 @@ function TaskDetail(props: IPropsType) {
   );
 }
 
-export default connect(
-  ({
-    taskUser,
-  }: any): {
-    userList: IUserType[];
-  } => {
-    return {
-      userList: taskUser.userList,
-    };
-  },
-)(TaskDetail);
+export default connect(({ taskUser }: any) => {
+  return {
+    userList: taskUser.userList,
+    dispatchUserList: taskUser.dispatchUserList,
+  };
+})(TaskDetail);

+ 19 - 2
src/pages/TaskManage/models/user.js

@@ -1,13 +1,14 @@
-import { queryDispatchUserList } from '@/services/user';
+import { queryDispatchUserList, queryUserList } from '@/services/user';
 
 export default {
   namespace: 'taskUser',
   state: {
     userList: [],
+    dispatchUserList: [],
   },
   effects: {
     *fetchUserList({ payload }, { call, put }) {
-      const response = yield call(queryDispatchUserList, payload);
+      const response = yield call(queryUserList, payload);
       if (response) {
         yield put({
           type: 'userListHandler',
@@ -15,6 +16,16 @@ export default {
         });
       }
     },
+    *fetchDispatchUserList({ payload }, { call, put }) {
+      const response = yield call(queryDispatchUserList, payload);
+      if (response) {
+        yield put({
+          type: 'save',
+          payload: { dispatchUserList: response.data },
+        });
+      }
+      queryUserList;
+    },
   },
 
   reducers: {
@@ -24,5 +35,11 @@ export default {
         userList: payload,
       };
     },
+    save(state, action) {
+      return {
+        ...state,
+        ...action.payload,
+      };
+    },
   },
 };