From 313f0515b65ab69e6e811c199f4b33eb630509f3 Mon Sep 17 00:00:00 2001
From: Ryan <creaycat@gmail.com>
Date: 星期四, 03 四月 2025 19:09:38 +0800
Subject: [PATCH] Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop

---
 rsf-admin/src/page/task/TaskList.jsx |   39 +++++++++++++++++++++++++++++++--------
 1 files changed, 31 insertions(+), 8 deletions(-)

diff --git a/rsf-admin/src/page/task/TaskList.jsx b/rsf-admin/src/page/task/TaskList.jsx
index 64b1462..72cfe20 100644
--- a/rsf-admin/src/page/task/TaskList.jsx
+++ b/rsf-admin/src/page/task/TaskList.jsx
@@ -1,5 +1,7 @@
 import React, { useState, useRef, useEffect, useMemo, useCallback } from "react";
 import { useNavigate } from 'react-router-dom';
+import request from '@/utils/request';
+
 import {
     List,
     DatagridConfigurable,
@@ -15,6 +17,7 @@
     useRecordContext,
     useTranslate,
     useNotify,
+    useRefresh,
     useListContext,
     FunctionField,
     TextField,
@@ -111,9 +114,9 @@
                     marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0,
                 }}
                 title={"menu.task"}
-                // empty={<EmptyData onClick={() => { setCreateDialog(true) }} />}
+                empty={<EmptyData onClick={() => { }} />}
                 filters={filters}
-                sort={{ field: "create_time", order: "desc" }}
+                sort={{ field: "sort", order: "desc" }}
                 actions={(
                     <TopToolbar>
                         <FilterButton />
@@ -212,11 +215,22 @@
  */
 const CancelButton = () => {
     const record = useRecordContext();
+    const notify = useNotify();
+    const refresh = useRefresh();
     const clickCancel = () => {
-        cancleTask([record])
+        cancleTask(record)
     };
     //鍙栨秷浠诲姟
-    const cancleTask = async (row) => {}
+    const cancleTask = async (row) => {
+        console.log(row);
+        const { data: { code, data, msg } } = await request.post(`/task/remove/` + row.id);
+        if (code === 200) {
+            notify(msg);
+            refresh();
+        } else {
+            notify(msg);
+        }
+    }
     return (
         <Button
             onClick={clickCancel}
@@ -231,11 +245,21 @@
  */
 const SetTopButton = () => {
     const record = useRecordContext();
+    const notify = useNotify();
+    const refresh = useRefresh();
     const clickTop = () => {
-        topTask([record])
+        topTask(record)
     };
     //缃《浠诲姟
-    const topTask = async (row) => { }
+    const topTask = async (row) => {
+        const { data: { code, data, msg } } = await request.post(`/task/top/` + row.id);
+        if (code === 200) {
+            notify(msg);
+            refresh();
+        } else {
+            notify(msg);
+        }
+     }
     return (
         <Button
             onClick={clickTop}
@@ -255,7 +279,7 @@
         cancleTask([record])
     };
     //鍙栨秷浠诲姟
-    const cancleTask = async (row) => {}
+    const cancleTask = async (row) => { }
     return (
         <Button
             onClick={clickCancel}
@@ -283,5 +307,4 @@
             <SwapVertIcon />
         </Button>
     )
-
 }
\ No newline at end of file

--
Gitblit v1.9.1