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) => {
total = result?.data?.dataList?.length;
}
setparams(total);
setparams?.(total);
return {
data,
success,
......
......@@ -3,12 +3,51 @@ import PremButton from "@/components/PremButton";
import { Box, Container, Stack, Typography } from "@mui/material";
import { useParams } from "@umijs/max";
import { useMemo, useRef } from "react";
import { useRequest } from "ahooks";
import { doFetch } from "@/utils/doFetch";
import "./index.less";
function Record() {
const actionRef = useRef();
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(() => {
let res = [
{ title: "课程名称", dataIndex: "courseName", key: "courseName" },
......@@ -42,6 +81,14 @@ function Record() {
{ label: "已批阅", value: "2" },
],
},
{
title: "操作",
valueType: "option",
width: 88,
render: (text, row, _, action) => [
rollback(text, row, _, action),
],
},
];
return res;
}, []);
......
......@@ -8,6 +8,7 @@ import dayjs from "dayjs";
import duration from "dayjs/plugin/duration";
import { useMemo, useRef, useState } from "react";
import "./index.less";
import { useRequest } from "ahooks";
dayjs.extend(duration);
......@@ -22,6 +23,7 @@ function Record() {
open: false,
}));
};
const detailcolumns = [
{
title: "分数",
......@@ -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) => {
return (
<PremButton
......@@ -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(() => {
let res = [
{ title: "课程名称", dataIndex: "courseName", key: "courseName" },
......@@ -129,8 +166,11 @@ function Record() {
{
title: "操作",
valueType: "option",
width: 78,
render: (text, row, _, action) => [detail(text, row, _, action)],
width: 128,
render: (text, row, _, action) => [
detail(text, row, _, action),
rollback(text, row, _, action),
],
},
];
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