123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891 |
- import { RootState } from "@/store";
- import {
- Button,
- Checkbox,
- Form,
- Input,
- Popconfirm,
- Radio,
- Select,
- Switch,
- } from "antd";
- import React, {
- useCallback,
- useEffect,
- useMemo,
- useRef,
- useState,
- } from "react";
- import { useDispatch, useSelector } from "react-redux";
- import TextArea from "antd/es/input/TextArea";
- import styles from "./index.module.scss";
- import { MessageFu } from "@/utils/message";
- import ImageLazy from "@/components/ImageLazy";
- import classNames from "classnames";
- import {
- PlusOutlined,
- CloseCircleOutlined,
- UploadOutlined,
- CloseOutlined,
- PlayCircleOutlined,
- } from "@ant-design/icons";
- import {
- getGoodsInfoByIdAPI,
- getGoodsSaveAPI,
- goodsUploadAPI,
- setGoodsImgBoderAPI,
- } from "@/store/action/B2Goods";
- import { baseURL } from "@/utils/http";
- import { FileListType, GoodsTableType } from "@/types";
- type Props = {
- id: number;
- closeMoalFu: () => void;
- addListFu: () => void;
- editListFu: () => void;
- };
- // 上传附件的进度条
- const UpAsyncLodingDom: any = document.querySelector("#UpAsyncLoding");
- const progressDom: any = document.querySelector("#progress");
- function GoodsAdd({ id, closeMoalFu, addListFu, editListFu }: Props) {
- const dispatch = useDispatch();
- // 后面添加的的知识驿站
- const [valueZS1, setValueZS1] = useState("");
- const [valueZS2, setValueZS2] = useState<any>([]);
- // 上传附件的信息
- const [fileList, setFileList] = useState({
- model: {} as FileListType,
- img: [] as FileListType[],
- audio: {} as FileListType,
- video: {} as FileListType,
- });
- // 表单的ref
- const FormBoxRef = useRef<any>({});
- // 文件的dirCode码
- const [dirCode, setDirCode] = useState("");
- const getInfoInAPIFu = useCallback(async (id: number) => {
- const res = await getGoodsInfoByIdAPI(id);
- FormBoxRef.current.setFieldsValue(res.data.entity);
- setCover(res.data.entity.thumb);
- if (res.data.entity.type) setTypeCheck(res.data.entity.type.split(","));
- setValueZS1(res.data.entity.tagType);
- if (res.data.entity.tagCountry)
- setValueZS2(res.data.entity.tagCountry.split(","));
- const data: FileListType[] = res.data.file;
- const obj = {
- model: {} as FileListType,
- img: [] as FileListType[],
- audio: {} as FileListType,
- video: {} as FileListType,
- };
- data.forEach((v) => {
- if (v.type === "img") obj.img.push(v);
- else obj[v.type!] = v;
- });
- setFileList(obj);
- setDirCode(res.data.entity.dirCode);
- }, []);
- useEffect(() => {
- if (id > 0) getInfoInAPIFu(id);
- else {
- setDirCode(Date.now() + "");
- FormBoxRef.current.setFieldsValue({
- topic: "不展示",
- display: 1,
- isBarrage: 0,
- });
- }
- }, [getInfoInAPIFu, id]);
- // 从仓库获取下拉列表数据
- const dictList = useSelector((state: RootState) => state.loginStore.dictList);
- // 上传封面图的ref
- const [coverCheck, setCoverCheck] = useState(false);
- const [cover, setCover] = useState("");
- const myInput = useRef<HTMLInputElement>(null);
- // 上传封面图
- const handeUpPhoto = useCallback(
- async (e: React.ChangeEvent<HTMLInputElement>) => {
- if (e.target.files) {
- // 拿到files信息
- const filesInfo = e.target.files[0];
- // 校验格式
- const type = ["image/jpeg", "image/png"];
- if (!type.includes(filesInfo.type)) {
- e.target.value = "";
- return MessageFu.warning("只支持jpg、png格式!");
- }
- // 校验大小
- if (filesInfo.size > 20 * 1024 * 1024) {
- e.target.value = "";
- return MessageFu.warning("最大支持20M!");
- }
- // 创建FormData对象
- const fd = new FormData();
- // 把files添加进FormData对象(‘photo’为后端需要的字段)
- fd.append("type", "thumb");
- fd.append("dirCode", dirCode);
- fd.append("file", filesInfo);
- e.target.value = "";
- const res: any = await goodsUploadAPI(fd);
- if (res.code === 0) {
- MessageFu.success("上传成功!");
- setCover(res.data.filePath);
- }
- UpAsyncLodingDom.style.opacity = 0;
- progressDom.style.width = "0%";
- }
- },
- [dirCode]
- );
- // 选中附件类型
- const [typeCheck, setTypeCheck] = useState<any>([]);
- const [typeOk, setTypeOk] = useState(false);
- const typeCheckArr = useMemo(() => {
- return [
- { label: "模型", value: "model" },
- { label: "图片", value: "img" },
- { label: "音频", value: "audio" },
- { label: "视频", value: "video" },
- ];
- }, []);
- // 上传附件图片的有无边框的选择
- const upImgDoneFu = useCallback(
- async (val: boolean, id: number) => {
- const res = await setGoodsImgBoderAPI(id, val ? 1 : 0);
- if (res.code === 0) {
- const newData = {
- ...fileList,
- img: fileList.img.map((v) => {
- return {
- ...v,
- isFrame: v.id === id ? val : v.isFrame,
- };
- }),
- };
- setFileList(newData);
- }
- },
- [fileList]
- );
- // 附件信息的校验
- const fileCheckFu = useMemo(() => {
- let flag = false;
- if (typeCheck.length === 0) flag = true;
- if (typeCheck.includes("model") && !fileList.model.id) flag = true;
- if (typeCheck.includes("img") && fileList.img.length === 0) flag = true;
- if (typeCheck.includes("audio") && !fileList.audio.id) flag = true;
- if (typeCheck.includes("video") && !fileList.video.id) flag = true;
- return flag;
- }, [fileList, typeCheck]);
- // 点击上传附件按钮
- const myInput2 = useRef<HTMLInputElement>(null);
- const [fileOneType, setFileOneType] = useState("");
- useEffect(() => {
- if (fileOneType) myInput2.current?.click();
- }, [fileOneType]);
- const upFileFu = useCallback((type: string) => {
- setFileOneType("");
- window.setTimeout(() => {
- setFileOneType(type);
- }, 100);
- }, []);
- // 上传附件的处理函数
- const handeUpPhoto2 = useCallback(
- async (e: React.ChangeEvent<HTMLInputElement>) => {
- if (e.target.files) {
- // 拿到files信息
- const filesInfo = e.target.files[0];
- let anType = ["image/jpeg", "image/png", "image/gif"];
- let anTit1 = "只支持png、jpg、gif和jpeg格式!";
- let anTit2 = "最大支持20M!";
- let anSize = 20 * 1024 * 1024;
- if (fileOneType === "audio") {
- anType = ["audio/mpeg"];
- anTit1 = "只支持mp3格式!";
- anTit2 = "最大支持10M!";
- anSize = 10 * 1024 * 1024;
- } else if (fileOneType === "video") {
- anType = ["video/mp4"];
- anTit1 = "只支持mp4格式!";
- anTit2 = "最大支持500M!";
- anSize = 500 * 1024 * 1024;
- } else if (fileOneType === "model") {
- anType = [""];
- anTit1 = "只支持4dage格式!";
- anTit2 = "最大支持500M!";
- anSize = 500 * 1024 * 1024;
- }
- // 校验格式
- if (fileOneType !== "model") {
- if (!anType.includes(filesInfo.type)) {
- e.target.value = "";
- return MessageFu.warning(anTit1);
- }
- } else {
- if (!filesInfo.name.includes(".4dage")) {
- e.target.value = "";
- return MessageFu.warning(anTit1);
- }
- }
- // 校验大小
- if (filesInfo.size > anSize) {
- e.target.value = "";
- return MessageFu.warning(anTit2);
- }
- // 创建FormData对象
- const fd = new FormData();
- // 把files添加进FormData对象(‘photo’为后端需要的字段)
- fd.append("type", fileOneType);
- fd.append("dirCode", dirCode);
- fd.append("file", filesInfo);
- e.target.value = "";
- const res: any = await goodsUploadAPI(fd);
- if (res.code === 0) {
- MessageFu.success("上传成功!");
- if (fileOneType === "img")
- setFileList({ ...fileList, img: [res.data, ...fileList.img] });
- else setFileList({ ...fileList, [fileOneType]: res.data });
- }
- UpAsyncLodingDom.style.opacity = 0;
- progressDom.style.width = "0%";
- }
- },
- [dirCode, fileList, fileOneType]
- );
- // 附件图片的拖动
- const [dragImg, setDragImg] = useState<any>(null);
- const handleDragOver = useCallback(
- (e: React.DragEvent<HTMLDivElement>, item: FileListType) => {
- e.dataTransfer.dropEffect = "move";
- },
- []
- );
- const handleDragEnter = useCallback(
- (e: React.DragEvent<HTMLDivElement>, item: FileListType) => {
- e.dataTransfer.effectAllowed = "move";
- if (item === dragImg) return;
- const newItems = [...fileList.img]; //拷贝一份数据进行交换操作。
- const src = newItems.indexOf(dragImg); //获取数组下标
- const dst = newItems.indexOf(item);
- newItems.splice(dst, 0, ...newItems.splice(src, 1)); //交换位置
- setFileList({ ...fileList, img: newItems });
- },
- [dragImg, fileList]
- );
- // 删除某一张图片
- const delImgListFu = useCallback(
- (id: number) => {
- const newItems = fileList.img.filter((v) => v.id !== id);
- setFileList({ ...fileList, img: newItems });
- },
- [fileList]
- );
- // 没有通过校验
- const onFinishFailed = useCallback(() => {
- setCoverCheck(true);
- setTypeOk(true);
- return MessageFu.warning("有表单不符号规则!");
- }, []);
- // 通过校验点击确定
- const onFinish = useCallback(
- async (value: GoodsTableType) => {
- console.log("通过校验,点击确定");
- setCoverCheck(true);
- setTypeOk(true);
- if (typeCheck.length === 0 || cover === "" || fileCheckFu)
- return MessageFu.warning("有表单不符号规则!");
- const fileIds = [];
- if (fileList.model.id && typeCheck.includes("model"))
- fileIds.push(fileList.model.id);
- if (fileList.audio.id && typeCheck.includes("audio"))
- fileIds.push(fileList.audio.id);
- if (fileList.video.id && typeCheck.includes("video"))
- fileIds.push(fileList.video.id);
- if (typeCheck.includes("img")) {
- fileList.img.forEach((v) => {
- if (v.id) fileIds.push(v.id);
- });
- }
- const obj = {
- ...value,
- id: id > 0 ? id : null,
- dirCode,
- fileIds: fileIds.join(","),
- thumb: cover,
- type: typeCheck.join(","),
- tagType: valueZS1,
- tagCountry: valueZS2.join(","),
- } as GoodsTableType;
- const res = await getGoodsSaveAPI(obj);
- if (res.code === 0) {
- MessageFu.success(id > 0 ? "编辑成功!" : "新增成功!");
- closeMoalFu();
- if (id > 0) editListFu();
- else addListFu();
- }
- },
- [
- typeCheck,
- cover,
- fileCheckFu,
- fileList.model.id,
- fileList.audio.id,
- fileList.video.id,
- fileList.img,
- id,
- dirCode,
- valueZS1,
- valueZS2,
- closeMoalFu,
- editListFu,
- addListFu,
- ]
- );
- return (
- <div className={styles.GoodsAdd}>
- <div className="main">
- <Form
- ref={FormBoxRef}
- name="basic"
- labelCol={{ span: 3 }}
- onFinish={onFinish}
- onFinishFailed={onFinishFailed}
- autoComplete="off"
- >
- <Form.Item
- label="名称"
- name="name"
- rules={[{ required: true, message: "请输入名称!" }]}
- getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
- >
- <Input maxLength={25} showCount placeholder="请输入内容" />
- </Form.Item>
- <Form.Item
- label="登记编号"
- name="num"
- getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
- >
- <Input maxLength={25} showCount placeholder="请输入内容" />
- </Form.Item>
- <Form.Item
- label="类别"
- name="dictTexture"
- rules={[{ required: true, message: "请选择类别!" }]}
- >
- <Select
- placeholder="请选择"
- style={{ width: 400 }}
- options={dictList["texture"].slice(1)}
- />
- </Form.Item>
- <Form.Item
- label="年代"
- name="dictAge"
- rules={[{ required: true, message: "请选择年代!" }]}
- >
- <Select
- placeholder="请选择"
- style={{ width: 400 }}
- options={dictList["age"].slice(1)}
- />
- </Form.Item>
- <Form.Item
- label="级别"
- name="dictLevel"
- rules={[{ required: true, message: "请选择级别!" }]}
- >
- <Select
- placeholder="请选择"
- style={{ width: 400 }}
- options={dictList["level"].slice(1)}
- />
- </Form.Item>
- <Form.Item
- label="来源"
- name="dictSource"
- rules={[{ required: true, message: "请选择来源!" }]}
- >
- <Select
- placeholder="请选择"
- style={{ width: 400 }}
- options={dictList["source"].slice(1)}
- />
- </Form.Item>
- <Form.Item
- label="万物墙主题"
- name="topic"
- rules={[{ required: true, message: "请选择万物墙主题!" }]}
- >
- <Select
- placeholder="请选择"
- style={{ width: 400 }}
- options={[
- { value: "战争", label: "战争" },
- { value: "生活", label: "生活" },
- { value: "不展示", label: "不展示" },
- ]}
- />
- </Form.Item>
- <Form.Item
- label="简介"
- name="description"
- getValueFromEvent={(e) => e.target.value.trim()}
- >
- <TextArea
- rows={4}
- placeholder="请输入内容"
- showCount
- maxLength={200}
- />
- </Form.Item>
- {/* -----上传封面图片 */}
- <div className="myformBox myformBox0">
- <input
- id="upInput"
- type="file"
- accept=".png,.jpg,.jpeg"
- ref={myInput}
- onChange={(e) => handeUpPhoto(e)}
- />
- <input
- id="upInput2"
- type="file"
- accept={
- fileOneType === "img"
- ? ".gif,.png,.jpg,.jpeg"
- : fileOneType === "audio"
- ? ".mp3"
- : fileOneType === "model"
- ? ".4dage"
- : ".mp4"
- }
- ref={myInput2}
- onChange={(e) => handeUpPhoto2(e)}
- />
- <div className="label">
- <span>*</span> 封面图:
- </div>
- <div className="fileBoxRow_r">
- <div
- hidden={cover !== ""}
- className="fileBoxRow_up"
- onClick={() => myInput.current?.click()}
- >
- <PlusOutlined />
- </div>
- <div className="fileBoxRow_r_img" hidden={cover === ""}>
- {cover ? (
- <ImageLazy width={100} height={100} src={cover} />
- ) : null}
- <Popconfirm
- title="删除后无法恢复,是否删除?"
- okText="删除"
- cancelText="取消"
- onConfirm={() => setCover("")}
- >
- <div className="clearCover">
- <CloseCircleOutlined />
- </div>
- </Popconfirm>
- </div>
- <div className="fileBoxRow_r_tit">
- 支持png、jpg和jpeg的图片格式;最大支持20M。
- <br />
- <div
- className={classNames(
- "noUpThumb",
- !cover && coverCheck ? "noUpThumbAc" : ""
- )}
- >
- 请上传封面图!
- </div>
- </div>
- </div>
- </div>
- {/* 选中文件类型和上传附件 */}
- <div className="myformBox">
- <div className="label">
- <span>*</span> 文件类型:
- </div>
- <div className="myformBoxR">
- <Checkbox.Group
- options={typeCheckArr}
- value={typeCheck}
- onChange={(e) => setTypeCheck(e)}
- // onChange={(e) => console.log(e)}
- />
- </div>
- </div>
- {/* -----------模型上传 */}
- <div
- className="myformBox myformBox2"
- hidden={!typeCheck.includes("model")}
- >
- <div className="label">
- <span>*</span> 模型:
- </div>
- {fileList.model.id ? (
- <div className="fileInfo">
- <a
- href={baseURL + fileList.model.filePath}
- download
- target="_blank"
- className="upSuccTxt"
- rel="noreferrer"
- >
- {fileList.model.fileName}
- </a>
- <Popconfirm
- title="删除后无法恢复,是否删除?"
- okText="删除"
- cancelText="取消"
- onConfirm={() => setFileList({ ...fileList, model: {} })}
- >
- <div className="clearCover">
- <CloseCircleOutlined />
- </div>
- </Popconfirm>
- </div>
- ) : (
- <>
- <Button
- onClick={() => upFileFu("model")}
- icon={<UploadOutlined />}
- >
- 上传
- </Button>
- <div className="fileTit">
- 仅支持4dage格式的模型文件,大小不能超过500M。
- </div>
- </>
- )}
- </div>
- {/* -----------图片上传 */}
- <div
- className="myformBox myformBox3"
- hidden={!typeCheck.includes("img")}
- >
- <div className="label">
- <span>*</span> 图片:
- </div>
- <>
- <div className="fileBoxRow_r">
- <div className="upImgBox">
- <div
- hidden={!!fileList.img.length && fileList.img.length >= 30}
- className="fileBoxRow_up"
- onClick={() => upFileFu("img")}
- >
- <PlusOutlined />
- </div>
- {fileList.img.map((v) => (
- <div
- className="fileBoxRow_r_img"
- key={v.id}
- draggable="true"
- onDragStart={() => setDragImg(v)}
- onDragOver={(e) => handleDragOver(e, v)}
- onDragEnter={(e) => handleDragEnter(e, v)}
- onDragEnd={() => setDragImg(null)}
- >
- {/* 选择有没有边框 */}
- <div className="upImgDoneBox">
- 边框:
- <Switch
- checkedChildren="有"
- unCheckedChildren="无"
- checked={v.isFrame}
- onChange={(val) => upImgDoneFu(val, v.id!)}
- />
- </div>
- {v.filePath ? (
- <ImageLazy
- noLook={dragImg ? true : false}
- width={100}
- height={100}
- src={v.filePath}
- />
- ) : null}
- <Popconfirm
- title="删除后无法恢复,是否删除?"
- okText="删除"
- cancelText="取消"
- onConfirm={() => delImgListFu(v.id!)}
- >
- <div className="clearCover">
- <CloseOutlined />
- </div>
- </Popconfirm>
- </div>
- ))}
- </div>
- <div className="fileTit">
- {fileList.img.length && fileList.img.length >= 2 ? (
- <>
- 按住鼠标可拖动图片调整顺序。
- <br />
- </>
- ) : null}
- 支持png、jpg、gif和jpeg的图片格式;最大支持20M;最多支持30张。
- </div>
- </div>
- </>
- </div>
- {/* -----------音频上传 */}
- <div
- className="myformBox myformBox2"
- hidden={!typeCheck.includes("audio")}
- >
- <div className="label">
- <span>*</span> 音频:
- </div>
- {fileList.audio.id ? (
- <div className="fileInfo">
- <a
- href={baseURL + fileList.audio.filePath}
- download
- target="_blank"
- className="upSuccTxt"
- rel="noreferrer"
- >
- {fileList.audio.fileName}
- </a>
- <Popconfirm
- title="删除后无法恢复,是否删除?"
- okText="删除"
- cancelText="取消"
- onConfirm={() => setFileList({ ...fileList, audio: {} })}
- >
- <div className="clearCover">
- <CloseCircleOutlined />
- </div>
- </Popconfirm>
- </div>
- ) : (
- <>
- <Button
- onClick={() => upFileFu("audio")}
- icon={<UploadOutlined />}
- >
- 上传
- </Button>
- <div className="fileTit">
- 仅支持MP3格式的音频文件,大小不得超过10MB。
- </div>
- </>
- )}
- </div>
- {/* -----------视频上传 */}
- <div
- className="myformBox myformBox2"
- hidden={!typeCheck.includes("video")}
- >
- <div className="label">
- <span>*</span> 视频:
- </div>
- {fileList.video.id ? (
- <div className="fileInfo">
- <div className="upSuccTxt">{fileList.video.fileName}</div>
- <div
- className="clearCover"
- hidden={!fileList.video.filePath}
- onClick={() =>
- dispatch({
- type: "login/lookVideo",
- payload: fileList.video.filePath,
- })
- }
- >
- <PlayCircleOutlined />
- </div>
- <Popconfirm
- title="删除后无法恢复,是否删除?"
- okText="删除"
- cancelText="取消"
- onConfirm={() => setFileList({ ...fileList, video: {} })}
- >
- <div className="clearCover">
- <CloseCircleOutlined />
- </div>
- </Popconfirm>
- </div>
- ) : (
- <>
- <Button
- onClick={() => upFileFu("video")}
- icon={<UploadOutlined />}
- >
- 上传
- </Button>
- <div className="fileTit">
- 仅支持MP4格式的视频文件,大小不得超过500MB。
- </div>
- </>
- )}
- </div>
- <div
- className={classNames(
- "noUpThumb noUpThumb2",
- fileCheckFu && typeOk ? "noUpThumbAc" : ""
- )}
- >
- 请至少选择一个文件类型,并上传对应附件!
- </div>
- <Form.Item
- label="展示状态"
- name="display"
- rules={[{ required: true, message: "请选择展示状态!" }]}
- >
- <Select
- placeholder="请选择"
- style={{ width: 400 }}
- options={[
- { value: 1, label: "展示" },
- { value: 0, label: "不展示" },
- ]}
- />
- </Form.Item>
- <Form.Item
- label="弹幕留言"
- name="isBarrage"
- rules={[{ required: true, message: "请选择弹幕留言!" }]}
- >
- <Select
- placeholder="请选择"
- style={{ width: 400 }}
- options={[
- { value: 1, label: "开启" },
- { value: 0, label: "关闭" },
- ]}
- />
- </Form.Item>
- <div className="myformBox">
- <div className="label">知识驿站:</div>
- <div className="laseFormRight">
- <div className="laseFormRightRow">
- <div className="laseFormRightLabel">类别标签:</div>
- <Radio.Group
- onChange={(e) => setValueZS1(e.target.value)}
- value={valueZS1}
- >
- <Radio value={"军事"}>军事</Radio>
- <Radio value={"历史"}>历史</Radio>
- <Radio value={"人物"}>人物</Radio>
- <Radio value={"科学"}>科学</Radio>
- <Radio value={"教育"}>教育</Radio>
- <Radio value={"经济"}>经济</Radio>
- </Radio.Group>
- </div>
- <div className="laseFormRightTit">
- 如需文物关联知识驿站,请至少标注类别标签
- </div>
- <br />
- <div className="laseFormRightRow">
- <div className="laseFormRightLabel">国家标签:</div>
- <Checkbox.Group
- value={valueZS2}
- onChange={(e) => setValueZS2(e)}
- options={[
- { label: "清朝", value: "清朝", disabled: !valueZS1 },
- { label: "美国", value: "美国", disabled: !valueZS1 },
- { label: "西方", value: "西方", disabled: !valueZS1 },
- ]}
- />
- </div>
- </div>
- </div>
- {/* 确定和取消按钮 */}
- <br />
- <Form.Item wrapperCol={{ offset: 9, span: 16 }}>
- <Button type="primary" htmlType="submit">
- 提交
- </Button>
-  
- <Popconfirm
- title="放弃编辑后,信息将不会保存!"
- okText="放弃"
- cancelText="取消"
- onConfirm={closeMoalFu}
- >
- <Button>取消</Button>
- </Popconfirm>
- </Form.Item>
- </Form>
- </div>
- </div>
- );
- }
- const MemoGoodsAdd = React.memo(GoodsAdd);
- export default MemoGoodsAdd;
|