mirror of
https://github.com/PlayEdu/backend
synced 2025-07-20 11:29:34 +08:00
commit
2926f31562
@ -19,3 +19,7 @@ export function adminLogList(
|
|||||||
end_time: end_time,
|
end_time: end_time,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function adminLogDetail(id: number) {
|
||||||
|
return client.get(`/backend/v1/admin/log/detail/${id}`, {});
|
||||||
|
}
|
||||||
|
@ -97,12 +97,13 @@ export const CourseUpdate: React.FC<PropInterface> = ({
|
|||||||
short_desc: res.data.course.short_desc,
|
short_desc: res.data.course.short_desc,
|
||||||
hasChapter: chapterType,
|
hasChapter: chapterType,
|
||||||
published_at: res.data.course.published_at
|
published_at: res.data.course.published_at
|
||||||
? dayjs(res.data.course.published_at, "YYYY-MM-DD HH:mm:ss")
|
? dayjs(res.data.course.published_at)
|
||||||
: "",
|
: "",
|
||||||
});
|
});
|
||||||
setType(type);
|
setType(type);
|
||||||
setThumb(res.data.course.thumb);
|
setThumb(res.data.course.thumb);
|
||||||
setInit(false);
|
setInit(false);
|
||||||
|
console.log(dayjs(res.data.course.published_at, "YYYY-MM-DD HH:mm:ss"));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -411,7 +412,7 @@ export const CourseUpdate: React.FC<PropInterface> = ({
|
|||||||
<Space align="baseline" style={{ height: 32 }}>
|
<Space align="baseline" style={{ height: 32 }}>
|
||||||
<Form.Item name="published_at">
|
<Form.Item name="published_at">
|
||||||
<DatePicker
|
<DatePicker
|
||||||
disabledDate={disabledDate}
|
disabledDate={disabledDate}
|
||||||
format="YYYY-MM-DD HH:mm:ss"
|
format="YYYY-MM-DD HH:mm:ss"
|
||||||
style={{ width: 240 }}
|
style={{ width: 240 }}
|
||||||
showTime
|
showTime
|
||||||
|
@ -1,21 +1,35 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import { Modal, Form } from "antd";
|
import { Modal, Form } from "antd";
|
||||||
|
import { adminLog } from "../../../../api";
|
||||||
|
|
||||||
interface PropInterface {
|
interface PropInterface {
|
||||||
param: string;
|
id: number;
|
||||||
result: string;
|
|
||||||
open: boolean;
|
open: boolean;
|
||||||
onCancel: () => void;
|
onCancel: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AdminLogDetailDialog: React.FC<PropInterface> = ({
|
export const AdminLogDetailDialog: React.FC<PropInterface> = ({
|
||||||
param,
|
id,
|
||||||
open,
|
open,
|
||||||
onCancel,
|
onCancel,
|
||||||
result,
|
|
||||||
}) => {
|
}) => {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [loading, setLoading] = useState(true);
|
const [param, setParam] = useState("");
|
||||||
|
const [result, setResult] = useState("");
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (open && id > 0) {
|
||||||
|
getDetail();
|
||||||
|
}
|
||||||
|
}, [open, id]);
|
||||||
|
|
||||||
|
const getDetail = () => {
|
||||||
|
adminLog.adminLogDetail(id).then((res: any) => {
|
||||||
|
setParam(res.data.param);
|
||||||
|
setResult(res.data.result);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const onFinish = (values: any) => {};
|
const onFinish = (values: any) => {};
|
||||||
|
|
||||||
@ -31,18 +45,21 @@ export const AdminLogDetailDialog: React.FC<PropInterface> = ({
|
|||||||
centered
|
centered
|
||||||
forceRender
|
forceRender
|
||||||
open={true}
|
open={true}
|
||||||
width={416}
|
width={600}
|
||||||
onOk={() => onCancel()}
|
onOk={() => onCancel()}
|
||||||
onCancel={() => onCancel()}
|
onCancel={() => onCancel()}
|
||||||
footer={null}
|
footer={null}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
>
|
>
|
||||||
<div className="mt-24">
|
<div
|
||||||
|
className="mt-24"
|
||||||
|
style={{ maxHeight: 600, overflowY: "auto", overflowX: "hidden" }}
|
||||||
|
>
|
||||||
<Form
|
<Form
|
||||||
form={form}
|
form={form}
|
||||||
name="adminlog-detail"
|
name="adminlog-detail"
|
||||||
labelCol={{ span: 5 }}
|
labelCol={{ span: 3 }}
|
||||||
wrapperCol={{ span: 19 }}
|
wrapperCol={{ span: 21 }}
|
||||||
initialValues={{ remember: true }}
|
initialValues={{ remember: true }}
|
||||||
onFinish={onFinish}
|
onFinish={onFinish}
|
||||||
onFinishFailed={onFinishFailed}
|
onFinishFailed={onFinishFailed}
|
||||||
|
@ -37,9 +37,8 @@ const SystemLogPage = () => {
|
|||||||
const [adminName, setAdminName] = useState("");
|
const [adminName, setAdminName] = useState("");
|
||||||
const [created_at, setCreatedAt] = useState<string[]>([]);
|
const [created_at, setCreatedAt] = useState<string[]>([]);
|
||||||
const [createdAts, setCreatedAts] = useState<any>([]);
|
const [createdAts, setCreatedAts] = useState<any>([]);
|
||||||
const [param, setParam] = useState("");
|
|
||||||
const [result, setResult] = useState("");
|
|
||||||
const [visiable, setVisiable] = useState(false);
|
const [visiable, setVisiable] = useState(false);
|
||||||
|
const [admId, setAdmId] = useState(0);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getData();
|
getData();
|
||||||
@ -131,8 +130,7 @@ const SystemLogPage = () => {
|
|||||||
type="link"
|
type="link"
|
||||||
className="b-link c-red"
|
className="b-link c-red"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setParam(record.param);
|
setAdmId(Number(record.id));
|
||||||
setResult(record.result);
|
|
||||||
setVisiable(true);
|
setVisiable(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -215,8 +213,7 @@ const SystemLogPage = () => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<AdminLogDetailDialog
|
<AdminLogDetailDialog
|
||||||
param={param}
|
id={admId}
|
||||||
result={result}
|
|
||||||
open={visiable}
|
open={visiable}
|
||||||
onCancel={() => setVisiable(false)}
|
onCancel={() => setVisiable(false)}
|
||||||
></AdminLogDetailDialog>
|
></AdminLogDetailDialog>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user