Commit cc25eb90 authored by wuhao's avatar wuhao 🎯

asder

parent 172f4201
Pipeline #4329 passed with stages
in 3 minutes and 32 seconds
...@@ -78,7 +78,7 @@ const AutoTable = (props) => { ...@@ -78,7 +78,7 @@ const AutoTable = (props) => {
total = result?.data?.dataList?.length; total = result?.data?.dataList?.length;
} }
setparams(total); setparams?.(total);
return { return {
data, data,
success, success,
......
...@@ -3,12 +3,51 @@ import PremButton from "@/components/PremButton"; ...@@ -3,12 +3,51 @@ import PremButton from "@/components/PremButton";
import { Box, Container, Stack, Typography } from "@mui/material"; import { Box, Container, Stack, Typography } from "@mui/material";
import { useParams } from "@umijs/max"; import { useParams } from "@umijs/max";
import { useMemo, useRef } from "react"; import { useMemo, useRef } from "react";
import { useRequest } from "ahooks";
import { doFetch } from "@/utils/doFetch";
import "./index.less"; import "./index.less";
function Record() { function Record() {
const actionRef = useRef(); const actionRef = useRef();
const params = useParams(); const params = useParams();
const { runAsync, loading } = useRequest(doFetch, {
manual: true,
onSuccess: (res) => {
if (res?.code == "0000") {
message.success("操作成功");
}
},
});
const rollback = (text, row, action) => {
return (
<PremButton
pop={{
disabled: row?.reviewType !== 1,
title: "是否退回该实训?",
okText: "确认",
cancelText: "取消",
onConfirm: async () => {
await runAsync({
url: "/studentExperiment/remake",
params: { id: row?.id },
});
},
}}
btn={{
disabled: row?.reviewType !== 1,
size: "small",
color: "error",
}}
>
撤回
</PremButton>
);
};
const columns = useMemo(() => { const columns = useMemo(() => {
let res = [ let res = [
{ title: "课程名称", dataIndex: "courseName", key: "courseName" }, { title: "课程名称", dataIndex: "courseName", key: "courseName" },
...@@ -42,6 +81,14 @@ function Record() { ...@@ -42,6 +81,14 @@ function Record() {
{ label: "已批阅", value: "2" }, { label: "已批阅", value: "2" },
], ],
}, },
{
title: "操作",
valueType: "option",
width: 88,
render: (text, row, _, action) => [
rollback(text, row, _, action),
],
},
]; ];
return res; return res;
}, []); }, []);
......
...@@ -8,6 +8,7 @@ import dayjs from "dayjs"; ...@@ -8,6 +8,7 @@ import dayjs from "dayjs";
import duration from "dayjs/plugin/duration"; import duration from "dayjs/plugin/duration";
import { useMemo, useRef, useState } from "react"; import { useMemo, useRef, useState } from "react";
import "./index.less"; import "./index.less";
import { useRequest } from "ahooks";
dayjs.extend(duration); dayjs.extend(duration);
...@@ -22,6 +23,7 @@ function Record() { ...@@ -22,6 +23,7 @@ function Record() {
open: false, open: false,
})); }));
}; };
const detailcolumns = [ const detailcolumns = [
{ {
title: "分数", title: "分数",
...@@ -65,6 +67,15 @@ function Record() { ...@@ -65,6 +67,15 @@ function Record() {
}, },
]; ];
const { runAsync, loading } = useRequest(doFetch, {
manual: true,
onSuccess: (res) => {
if (res?.code == "0000") {
message.success("操作成功");
}
},
});
const detail = (text, row, _, action) => { const detail = (text, row, _, action) => {
return ( return (
<PremButton <PremButton
...@@ -93,6 +104,32 @@ function Record() { ...@@ -93,6 +104,32 @@ function Record() {
); );
}; };
const rollback = (text, row, action) => {
return (
<PremButton
pop={{
disabled: row?.reviewType !== 1,
title: "是否退回该实训?",
okText: "确认",
cancelText: "取消",
onConfirm: async () => {
await runAsync({
url: "/studentExperiment/remake",
params: { id: row?.id },
});
},
}}
btn={{
disabled: row?.reviewType !== 1,
size: "small",
color: "error",
}}
>
撤回
</PremButton>
);
};
const columns = useMemo(() => { const columns = useMemo(() => {
let res = [ let res = [
{ title: "课程名称", dataIndex: "courseName", key: "courseName" }, { title: "课程名称", dataIndex: "courseName", key: "courseName" },
...@@ -129,8 +166,11 @@ function Record() { ...@@ -129,8 +166,11 @@ function Record() {
{ {
title: "操作", title: "操作",
valueType: "option", valueType: "option",
width: 78, width: 128,
render: (text, row, _, action) => [detail(text, row, _, action)], render: (text, row, _, action) => [
detail(text, row, _, action),
rollback(text, row, _, action),
],
}, },
]; ];
return res; return res;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment