From 89e3115c7281edf06fa1cd362ff32071a52b51ce Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期五, 04 七月 2025 08:25:14 +0800
Subject: [PATCH] #

---
 rsf-admin/src/page/task/TaskList.jsx |   52 ++++++++++++++++++++++------------------------------
 1 files changed, 22 insertions(+), 30 deletions(-)

diff --git a/rsf-admin/src/page/task/TaskList.jsx b/rsf-admin/src/page/task/TaskList.jsx
index 93cd799..b460c03 100644
--- a/rsf-admin/src/page/task/TaskList.jsx
+++ b/rsf-admin/src/page/task/TaskList.jsx
@@ -29,16 +29,12 @@
 } from 'react-admin';
 import { Box, Typography, Card, Stack, Drawer } from '@mui/material';
 import { styled } from '@mui/material/styles';
-import TaskCreate from "./TaskCreate";
-import TaskPanel from "./TaskPanel";
-import EmptyData from "../components/EmptyData";
-import MyCreateButton from "../components/MyCreateButton";
-import MyExportButton from '../components/MyExportButton';
 import SwapVertIcon from '@mui/icons-material/SwapVert';
 import AlignVerticalTopIcon from '@mui/icons-material/AlignVerticalTop';
 import TaskAltIcon from '@mui/icons-material/TaskAlt';
 import CancelIcon from '@mui/icons-material/Cancel';
 import PageDrawer from "../components/PageDrawer";
+import TaskPanel from "./TaskPanel";
 import MyField from "../components/MyField";
 import ConfirmButton from "../components/ConfirmButton";
 import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting';
@@ -124,7 +120,7 @@
                 title={"menu.task"}
                 empty={false}
                 filters={filters}
-                sort={{ field: "create_time", order: "desc" }}
+                sort={{ field: "sort", order: "desc" }}
                 actions={(
                     <TopToolbar>
                         <FilterButton />
@@ -135,17 +131,11 @@
             >
                 <StyledDatagrid
                     preferenceKey='task'
-                    bulkActionButtons={
-                        <>
-                            <BulkResortButton />
-                            <BulkCancelButton />
-                            <BulkDeleteButton mutationMode={OPERATE_MODE} />
-                        </>
-                    }
+                    bulkActionButtons={false}
                     rowClick={false}
-                    expand={false}
+                    expand={<TaskPanel />}
                     expandSingle={true}
-                    omit={['id', 'createTime', 'createBy', 'memo', 'robotCode', 'exceStatus', 'expDesc', 'expCode', 'status', 'sort']}
+                    omit={['id', 'createTime', 'createBy', 'memo', 'robotCode', 'exceStatus', 'expDesc', 'expCode', 'status']}
                 >
                     <NumberField source="id" />
                     <TextField source="taskCode" label="table.field.task.taskCode" />
@@ -174,6 +164,7 @@
                         <CancelButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} />
                         <CheckButton />
                         <PickButton />
+                        <SetTopButton />
                     </WrapperField>
                 </StyledDatagrid>
             </List>
@@ -258,7 +249,7 @@
         }
     }
     return (
-        ((record?.taskStatus < 98) || (record?.taskType >= 101 && record?.taskStatus < 198)) ? (<ConfirmButton label={"toolbar.complete"} color="secondary" startIcon={<TaskAltIcon />} onConfirm={clickComplete} />) : (<></>)
+        ((record?.taskStatus < 98) || (record?.taskType >= 101 && record?.taskStatus < 198)) || (record?.taskType == 11 && record?.taskStatus == 101) ? (<ConfirmButton label={"toolbar.complete"} color="secondary" startIcon={<TaskAltIcon />} onConfirm={clickComplete} />) : (<></>)
     )
 }
 
@@ -270,13 +261,11 @@
     const record = useRecordContext();
     const notify = useNotify();
     const refresh = useRefresh();
-    const clickCancel = (event) => {
-        event.stopPropagation();
+    const clickCancel = () => {
         cancleTask(record)
     };
     //鍙栨秷浠诲姟
     const cancleTask = async (row) => {
-        console.log(row);
         const { data: { code, data, msg } } = await request.post(`/task/remove/` + row.id);
         if (code === 200) {
             notify(msg);
@@ -286,12 +275,12 @@
         }
     }
     return (
-        (record.taskStatus == 1 || record.taskStatus == 101) && (record.taskType == 1 || record.taskType == 101 || record.taskType == 10 || record.taskType == 104) ?
-            <Button
-                onClick={clickCancel}
-                label="toolbar.cancel">
-                <CancelIcon />
-            </Button>
+        (record.taskStatus == 1 || record.taskStatus == 101) && (record.taskType == 1 || record.taskType == 101 || record.taskType == 10 || record.taskType == 103 || record.taskType == 11) ?
+            <ConfirmButton
+                onConfirm={clickCancel}
+                startIcon={<CancelIcon />}
+                label={"toolbar.cancel"}>
+            </ConfirmButton>
             :
             <></>
     )
@@ -319,11 +308,14 @@
         }
     }
     return (
-        <Button
-            onClick={clickTop}
-            label="toolbar.top">
-            <AlignVerticalTopIcon />
-        </Button>
+        (record.taskStatus == 1 || record.taskStatus == 101) && (record.taskType == 1 || record.taskType == 101 || record.taskType == 10 || record.taskType == 103 || record.taskType == 11) ?
+            <Button
+                onClick={clickTop}
+                label="toolbar.top">
+                <AlignVerticalTopIcon />
+            </Button>
+            :
+            <></>
     )
 }
 

--
Gitblit v1.9.1