123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- import React from "react";
- import { Button, Card, Popconfirm } from "antd";
- import { useSearchParams } from "react-router-dom";
- import Page from "@/components/Page";
- import Wangeditor from "@/components/Wangeditor";
- import { getTaCheckStandById, putTaCheckStand } from "@/service/tacheckstand";
-
- export default (props) => {
- const [loading, setLoading] = React.useState(false);
- const [editable, setEditAble] = React.useState(false);
- const [detail, setDetail] = React.useState(false);
-
- const [searchParams] = useSearchParams();
- const id = searchParams.get("id");
-
- const onChange = (e) => {
- setDetail({
- ...(detail || {}),
- content: e,
- });
- };
-
- const onSubmit = (e) => {
- setLoading(true);
- putTaCheckStand(id, detail)
- .then(() => {
- setLoading(false);
- })
- .catch(() => {
- setLoading(false);
- });
- };
-
- React.useEffect(() => {
- setLoading(true);
- getTaCheckStandById(id)
- .then((res) => {
- setDetail(res);
- setLoading(false);
- })
- .catch(() => {
- setLoading(false);
- });
- }, []);
-
- return (
- <Page>
- <Card
- loading={loading}
- extra={
- <Button type="primary" onClick={onSubmit}>
- 提交
- </Button>
- }
- >
- <Wangeditor
- value={detail?.content}
- toolbarConfig={{
- toolbarKeys: [
- "headerSelect",
- "blockquote",
- "|",
- "bold",
- "underline",
- "italic",
- "color",
- "fontSize",
- "|",
- "bulletedList",
- "numberedList",
- ],
- }}
- onChange={onChange}
- />
- </Card>
- </Page>
- );
- };
|