index.tsx 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772
  1. import {
  2. Button,
  3. Cascader,
  4. Form,
  5. Input,
  6. InputNumber,
  7. message,
  8. Modal,
  9. Popconfirm,
  10. Select,
  11. Table,
  12. } from "antd";
  13. import { PlusOutlined, CloseCircleOutlined } from "@ant-design/icons";
  14. import TextArea from "antd/es/input/TextArea";
  15. import React, {
  16. useCallback,
  17. useEffect,
  18. useMemo,
  19. useRef,
  20. useState,
  21. } from "react";
  22. import styles from "./index.module.scss";
  23. import classNames from "classnames";
  24. import "./index.css";
  25. import { useDispatch, useSelector } from "react-redux";
  26. import { RootState } from "@/store";
  27. import ImageLazy from "../ImageLazy";
  28. import {
  29. delInfileAPI,
  30. getInfoInAPI,
  31. goodsSonAddAPI,
  32. object1AddUpFileAPI,
  33. } from "@/store/action/object1";
  34. const { Option } = Select;
  35. type Props = {
  36. id: any;
  37. colsePage: any;
  38. editId?: any;
  39. dirCode: any;
  40. };
  41. function ObjectAdd({ id, colsePage, editId, dirCode }: Props) {
  42. const dispatch = useDispatch();
  43. // 没有通过校验
  44. const onFinishFailed = () => {
  45. setTitSelect("tit1");
  46. return message.warning("有表单不符号规则!");
  47. };
  48. // --------通过校验之后发送请求----------点击确定
  49. const onFinish = async (values: any) => {
  50. const oldObj = {} as any;
  51. for (const k in values) {
  52. if (values[k]) oldObj[k] = values[k];
  53. }
  54. // 外形尺寸 3个 字段 变成一个组数
  55. const size = [values.size1, values.size2, values.size3];
  56. // 具体质量 + 单位
  57. let quality = [] as any;
  58. if (values.quality) quality = [values.quality, danweiValue];
  59. // 文件id
  60. const fileIds = [] as any;
  61. for (const k in results) {
  62. results[k].forEach((v: any) => {
  63. fileIds.push(v.id);
  64. });
  65. }
  66. // 年代
  67. const dictAge = values.dictAge.join("/");
  68. // 文物质地
  69. const dictTexture = values.dictTexture.join("/");
  70. const obj = {
  71. ...oldObj,
  72. id: id ? id : null,
  73. size: size.join(","),
  74. quality: quality.join(","),
  75. thumb: cover,
  76. dirCode: dirCode + "",
  77. fileIds: fileIds.join(","),
  78. registerId: dirCode,
  79. dictAge,
  80. dictTexture,
  81. };
  82. await dispatch(goodsSonAddAPI(obj, id));
  83. // 真正的删除
  84. if (delFileList.current.length) {
  85. await delInfileAPI(delFileList.current.join(","));
  86. }
  87. // 关闭弹窗
  88. colsePage();
  89. // console.log('------封面信息',cover);
  90. // console.log('-------附件信息',results);
  91. };
  92. // 选择商品信息还是附近(默认商品信息)
  93. const [titSelect, setTitSelect] = useState("tit1");
  94. // 从仓库中获取各下拉数据
  95. const options1 = useSelector(
  96. (state: RootState) => state.loginStore.selectAll["藏品编号名称"]
  97. );
  98. const options2 = useSelector(
  99. (state: RootState) => state.loginStore.selectAll["年代"]
  100. );
  101. const options3 = useSelector(
  102. (state: RootState) => state.loginStore.selectAll["质地"]
  103. );
  104. const options4 = useSelector(
  105. (state: RootState) => state.loginStore.selectAll["文物类别"]
  106. );
  107. const options5 = useSelector(
  108. (state: RootState) => state.loginStore.selectAll["文物级别"]
  109. );
  110. const options6 = useSelector(
  111. (state: RootState) => state.loginStore.selectAll["质量范围"]
  112. );
  113. const options7 = useSelector(
  114. (state: RootState) => state.loginStore.selectAll["完残程度"]
  115. );
  116. const options8 = useSelector(
  117. (state: RootState) => state.loginStore.selectAll["保存状态"]
  118. );
  119. const options9 = useSelector(
  120. (state: RootState) => state.loginStore.selectAll["入藏时间范围"]
  121. );
  122. // 单位选择
  123. const [danweiValue, setDanweiValue] = useState("kg");
  124. // 设置表单初始数据(区分编辑和新增)
  125. const FormBoxRef = useRef<any>({});
  126. const getInfoInAPIFu = useCallback(
  127. async (id: number) => {
  128. const res = await getInfoInAPI(id);
  129. const data = res.data.entity;
  130. const size = data.size.split(",");
  131. const quality = data.quality.split(",");
  132. const dictAge = data.dictAge.split(",");
  133. const dictTexture = data.dictTexture.split(",");
  134. FormBoxRef.current.setFieldsValue({
  135. ...data,
  136. size1: size[0],
  137. size2: size[1],
  138. size3: size[2],
  139. quality: quality[0],
  140. dictAge,
  141. dictTexture,
  142. });
  143. // 具体质量的单位
  144. setDanweiValue(quality[1]);
  145. // 藏品图片
  146. setCover(data.thumb);
  147. const fileData = {
  148. img: [],
  149. video: [],
  150. audio: [],
  151. model: [],
  152. doc: [],
  153. } as any;
  154. res.data.file.forEach((v: any) => {
  155. fileData[v.type].push(v);
  156. });
  157. // 修改附件仓库信息
  158. dispatch({ type: "login/setFileData", payload: fileData });
  159. },
  160. [dispatch]
  161. );
  162. // 进页面看看是编辑就 从仓库获取信息,新增就设置默认值
  163. useEffect(() => {
  164. if (id) {
  165. getInfoInAPIFu(id);
  166. } else {
  167. FormBoxRef.current.setFieldsValue({
  168. dictNum: options1[0].name ? options1[0].name : null,
  169. dictAge: ["地质年代", "显生宙", "新生代", "第四纪"],
  170. dictTexture: ["单一质地", "有机质", "竹"],
  171. dictGoodType: options4[0].name ? options4[0].name : null,
  172. dictLevel: options5[0].name ? options5[0].name : null,
  173. dictQualityScope: options6[0].name ? options6[0].name : null,
  174. complete: options7[0].name ? options7[0].name : null,
  175. dictCheckInScope: options9[0].name ? options9[0].name : null,
  176. });
  177. // 初始化附件仓库信息
  178. dispatch({
  179. type: "login/setFileData",
  180. payload: {
  181. img: [],
  182. video: [],
  183. audio: [],
  184. model: [],
  185. doc: [],
  186. },
  187. });
  188. }
  189. }, [
  190. dispatch,
  191. getInfoInAPIFu,
  192. id,
  193. options1,
  194. options4,
  195. options5,
  196. options6,
  197. options7,
  198. options9,
  199. ]);
  200. // -----------关于藏品附件的信息
  201. const [fileSelect, setFileSelect] = useState("img");
  202. const fileSelectChangeFu = (value: string) => {
  203. setFileSelect(value);
  204. };
  205. const results = useSelector((state: RootState) => state.loginStore.fileData);
  206. // 点击表格里面的删除
  207. const delOne = useCallback(
  208. (id: number) => {
  209. const data = {
  210. ...results,
  211. [fileSelect]: results[fileSelect].filter((v: any) => v.id !== id),
  212. };
  213. dispatch({ type: "login/setFileData", payload: data });
  214. // 把删除的id存起来
  215. delFileList.current.push(id);
  216. },
  217. [dispatch, fileSelect, results]
  218. );
  219. // 表格格式
  220. const columns = useMemo(() => {
  221. const tempArr = [
  222. {
  223. title: "附件名称",
  224. dataIndex: "name",
  225. },
  226. {
  227. title: "上传时间",
  228. dataIndex: "createTime",
  229. },
  230. {
  231. title: "操作",
  232. render: (item: any) => (
  233. <>
  234. <Button type="text" danger onClick={() => upFileFu(item.id)}>
  235. 重传
  236. </Button>
  237. <Popconfirm
  238. title="确定删除吗?"
  239. okText="确定"
  240. cancelText="取消"
  241. onConfirm={() => delOne(item.id)}
  242. >
  243. <Button type="text" danger>
  244. 删除
  245. </Button>
  246. </Popconfirm>
  247. </>
  248. ),
  249. },
  250. ];
  251. if (fileSelect === "img") {
  252. tempArr.unshift({
  253. title: "缩略图",
  254. render: (item: any) => (
  255. <div className="tableImg">
  256. <ImageLazy width={120} height={70} src={item.filePath} />
  257. </div>
  258. ),
  259. });
  260. }
  261. return tempArr;
  262. }, [delOne, fileSelect]);
  263. // 封面地址
  264. const [cover, setCover] = useState("");
  265. const fileSelectList = useMemo(() => {
  266. return [
  267. { id: 1, value: "img", label: "高清图片" },
  268. { id: 2, value: "video", label: "视频文件" },
  269. { id: 3, value: "audio", label: "音频文件" },
  270. { id: 4, value: "model", label: "三维模型" },
  271. { id: 5, value: "doc", label: "文档资料" },
  272. ];
  273. }, []);
  274. // 上传封面
  275. const myInput = useRef<HTMLInputElement>(null);
  276. const handeUpPhoto = async (e: React.ChangeEvent<HTMLInputElement>) => {
  277. if (e.target.files) {
  278. // 拿到files信息
  279. const filesInfo = e.target.files[0];
  280. // 校验格式
  281. const type = ["image/jpeg", "image/png"];
  282. if (!type.includes(filesInfo.type)) {
  283. e.target.value = "";
  284. return message.warning("只支持jpg、png格式!");
  285. }
  286. // 校验大小
  287. if (filesInfo.size > 10 * 1024 * 1024) {
  288. e.target.value = "";
  289. return message.warning("最大支持10M!");
  290. }
  291. // 创建FormData对象
  292. const fd = new FormData();
  293. // 把files添加进FormData对象(‘photo’为后端需要的字段)
  294. fd.append("type", "thumb");
  295. fd.append("dirCode", dirCode);
  296. fd.append("file", filesInfo);
  297. const res: any = await object1AddUpFileAPI(fd);
  298. if (res.code === 0) {
  299. message.success("上传成功!");
  300. setCover(res.data.filePath);
  301. }
  302. }
  303. };
  304. // 上传附件
  305. const myInput2 = useRef<HTMLInputElement>(null);
  306. const upFileFlagRef = useRef(false);
  307. const delFileList = useRef<any>([]);
  308. const upFileFu = (flag?: any) => {
  309. upFileFlagRef.current = flag ? flag : 0;
  310. myInput2.current?.click();
  311. };
  312. const handeUpPhoto2 = useCallback(
  313. async (e: React.ChangeEvent<HTMLInputElement>) => {
  314. if (e.target.files) {
  315. // 拿到files信息
  316. const filesInfo = e.target.files[0];
  317. // 创建FormData对象
  318. const fd = new FormData();
  319. // 把files添加进FormData对象(‘photo’为后端需要的字段)
  320. fd.append("type", fileSelect);
  321. fd.append("dirCode", dirCode);
  322. fd.append("file", filesInfo);
  323. const res: any = await object1AddUpFileAPI(fd);
  324. e.target.value = "";
  325. if (res.code === 0) {
  326. message.success("上传成功!");
  327. if (upFileFlagRef.current) {
  328. // 重新上传
  329. const id = upFileFlagRef.current;
  330. const data = {
  331. ...results,
  332. [fileSelect]: results[fileSelect].map((v: any) => {
  333. if (id !== v.id) return v;
  334. else
  335. return {
  336. ...res.data,
  337. };
  338. }),
  339. };
  340. dispatch({ type: "login/setFileData", payload: data });
  341. // 把删除的id存起来
  342. delFileList.current.push(upFileFlagRef.current);
  343. } else {
  344. // 新上传
  345. const data = {
  346. ...results,
  347. [fileSelect]: [
  348. {
  349. ...res.data,
  350. },
  351. ...results[fileSelect],
  352. ],
  353. };
  354. dispatch({ type: "login/setFileData", payload: data });
  355. }
  356. }
  357. }
  358. },
  359. [dirCode, dispatch, fileSelect, results]
  360. );
  361. return (
  362. <div className={styles.ObjectAdd}>
  363. <Modal
  364. wrapClassName="ObjectAdd"
  365. destroyOnClose
  366. open={true}
  367. title={id ? "编辑藏品" : "添加藏品"}
  368. footer={
  369. [] // 设置footer为空,去掉 取消 确定默认按钮
  370. }
  371. >
  372. {/* 商品信息和附件切换 */}
  373. <div className="ObjectAddTit">
  374. <div
  375. onClick={() => setTitSelect("tit1")}
  376. className={classNames(titSelect === "tit1" ? "active" : "")}
  377. >
  378. 藏品信息
  379. </div>
  380. <div
  381. onClick={() => setTitSelect("tit2")}
  382. className={classNames(
  383. "ObjectAddTitTow",
  384. titSelect === "tit2" ? "active" : ""
  385. )}
  386. >
  387. 附件
  388. </div>
  389. </div>
  390. <Form
  391. ref={FormBoxRef}
  392. name="basic"
  393. onFinish={onFinish}
  394. onFinishFailed={onFinishFailed}
  395. autoComplete="off"
  396. >
  397. {/* -----------------------表单信息 */}
  398. <div className="formBox" hidden={titSelect === "tit2"}>
  399. {/* 藏品名称----------原名 */}
  400. <div className="formRow">
  401. <Form.Item
  402. label="藏品名称"
  403. name="name"
  404. rules={[{ required: true, message: "不能为空!" }]}
  405. >
  406. <Input maxLength={50} showCount placeholder="请输入" />
  407. </Form.Item>
  408. <Form.Item label="原名" name="namePrimitive">
  409. <Input maxLength={50} showCount placeholder="请输入" />
  410. </Form.Item>
  411. </div>
  412. {/* 藏品编号名称----------藏品编号 */}
  413. <div className="formRow">
  414. <div className="bs">*</div>
  415. <Form.Item label="藏品编号名称" name="dictNum">
  416. <Select
  417. placeholder="请选择"
  418. options={options1.map((v: any) => ({
  419. label: v.name,
  420. value: v.name,
  421. }))}
  422. />
  423. </Form.Item>
  424. <Form.Item label="藏品编号" name="num">
  425. <Input maxLength={50} showCount placeholder="请输入" />
  426. </Form.Item>
  427. </div>
  428. {/* 年代----------文物质地 */}
  429. <div className="formRow">
  430. <div className="bs bs2">*</div>
  431. <div className="bs bs3">*</div>
  432. <Form.Item label="年代" name="dictAge">
  433. <Cascader
  434. allowClear={false}
  435. fieldNames={{
  436. label: "name",
  437. value: "name",
  438. children: "children",
  439. }}
  440. options={options2}
  441. placeholder="请选择"
  442. />
  443. </Form.Item>
  444. <Form.Item label="文物质地" name="dictTexture">
  445. <Cascader
  446. allowClear={false}
  447. fieldNames={{
  448. label: "name",
  449. value: "name",
  450. children: "children",
  451. }}
  452. options={options3}
  453. placeholder="请选择"
  454. />
  455. </Form.Item>
  456. </div>
  457. {/* 具体年代----------文物类别 */}
  458. <div className="formRow">
  459. <div className="bs bs3">*</div>
  460. <Form.Item label="具体年代" name="ageSpecific">
  461. <Input maxLength={50} showCount placeholder="请输入" />
  462. </Form.Item>
  463. <Form.Item label="文物类别" name="dictGoodType">
  464. <Select
  465. placeholder="请选择"
  466. options={options4.map((v: any) => ({
  467. label: v.name,
  468. value: v.name,
  469. }))}
  470. />
  471. </Form.Item>
  472. </div>
  473. {/* 实际数量----------文物级别 */}
  474. <div className="formRow">
  475. <div className="bs bs3">*</div>
  476. <Form.Item
  477. rules={[{ required: true, message: "不能为空!" }]}
  478. label="实际数量"
  479. name="pcs"
  480. >
  481. <InputNumber min={1} maxLength={8} placeholder="请输入数字" />
  482. </Form.Item>
  483. <Form.Item label="文物级别" name="dictLevel">
  484. <Select
  485. placeholder="请选择"
  486. options={options5.map((v: any) => ({
  487. label: v.name,
  488. value: v.name,
  489. }))}
  490. />
  491. </Form.Item>
  492. </div>
  493. {/* 外形尺寸----------通长,宽,高 */}
  494. <div className="formRow formRowThree">
  495. <Form.Item
  496. rules={[{ required: true, message: "不能为空!" }]}
  497. label="外形尺寸"
  498. name="size1"
  499. >
  500. <InputNumber
  501. min={1}
  502. maxLength={8}
  503. placeholder="通长"
  504. addonAfter="cm"
  505. />
  506. </Form.Item>
  507. <Form.Item
  508. rules={[{ required: true, message: "不能为空!" }]}
  509. label=""
  510. name="size2"
  511. >
  512. <InputNumber
  513. min={1}
  514. maxLength={8}
  515. placeholder="通宽"
  516. addonAfter="cm"
  517. />
  518. </Form.Item>
  519. <Form.Item
  520. className="formRowThreeRow"
  521. rules={[{ required: true, message: "不能为空!" }]}
  522. label=""
  523. name="size3"
  524. >
  525. <InputNumber
  526. min={1}
  527. maxLength={8}
  528. placeholder="通高"
  529. addonAfter="cm"
  530. />
  531. </Form.Item>
  532. </div>
  533. {/* 具体尺寸*/}
  534. <div className="formRow formRowFull">
  535. <Form.Item
  536. label="具体尺寸"
  537. name="sizeSpecific"
  538. rules={[{ required: true, message: "不能为空!" }]}
  539. >
  540. <Input maxLength={50} showCount placeholder="请输入" />
  541. </Form.Item>
  542. </div>
  543. {/* 质量范围----------具体质量 */}
  544. <div className="formRow">
  545. <div className="bs bs4">*</div>
  546. <Form.Item label="质量范围" name="dictQualityScope">
  547. <Select
  548. placeholder="请选择"
  549. options={options6.map((v: any) => ({
  550. label: v.name,
  551. value: v.name,
  552. }))}
  553. />
  554. </Form.Item>
  555. <Form.Item
  556. className="formRowSelec"
  557. label="具体质量"
  558. name="quality"
  559. >
  560. <InputNumber
  561. min={1}
  562. maxLength={8}
  563. placeholder="请输入数字"
  564. addonAfter={
  565. <Select
  566. value={danweiValue}
  567. onChange={(val) => setDanweiValue(val)}
  568. >
  569. <Option value="kg">kg</Option>
  570. <Option value="g">g</Option>
  571. </Select>
  572. }
  573. />
  574. {/* <div className="formRowSelecSon">
  575. </div> */}
  576. </Form.Item>
  577. </div>
  578. {/* 完残程度----------保存状态 */}
  579. <div className="formRow">
  580. <div className="bs bs4">*</div>
  581. <Form.Item label="完残程度" name="complete">
  582. <Select
  583. placeholder="请选择"
  584. options={options7.map((v: any) => ({
  585. label: v.name,
  586. value: v.name,
  587. }))}
  588. />
  589. </Form.Item>
  590. <Form.Item label="保存状态" name="repair">
  591. <Select
  592. placeholder="请选择"
  593. options={options8.map((v: any) => ({
  594. label: v.name,
  595. value: v.name,
  596. }))}
  597. />
  598. </Form.Item>
  599. </div>
  600. {/* 入藏时间范围----------入藏年度 */}
  601. <div className="formRow">
  602. <div className="bs">*</div>
  603. <Form.Item label="入藏时间范围" name="dictCheckInScope">
  604. <Select
  605. placeholder="请选择"
  606. options={options9.map((v: any) => ({
  607. label: v.name,
  608. value: v.name,
  609. }))}
  610. />
  611. </Form.Item>
  612. <Form.Item label="入藏年度" name="checkInYear">
  613. <InputNumber
  614. min={1000}
  615. maxLength={4}
  616. placeholder="请输入数字"
  617. />
  618. </Form.Item>
  619. </div>
  620. {/* 著者----------版本 */}
  621. <div className="formRow">
  622. <Form.Item label="著者" name="author">
  623. <Input maxLength={50} showCount placeholder="请输入" />
  624. </Form.Item>
  625. <Form.Item label="版本" name="vision">
  626. <Input maxLength={50} showCount placeholder="请输入" />
  627. </Form.Item>
  628. </div>
  629. {/* 存卷*/}
  630. <div className="formRow formRowFull">
  631. <Form.Item label="存卷" name="onFile">
  632. <Input maxLength={50} showCount placeholder="请输入" />
  633. </Form.Item>
  634. </div>
  635. {/* 来源说明*/}
  636. <div className="formRow formRowFull">
  637. <Form.Item label="来源说明" name="description">
  638. <TextArea
  639. rows={3}
  640. placeholder="请输入"
  641. showCount
  642. maxLength={255}
  643. />
  644. </Form.Item>
  645. </div>
  646. </div>
  647. {/* -----------------------附件信息 */}
  648. <div hidden={titSelect === "tit1"}>
  649. <div className="fileBox">
  650. {/* 封面上传 */}
  651. <div className="fileBoxRow">
  652. <div className="fileBoxRow_tit">藏品图片:</div>
  653. <div className="fileBoxRow_r">
  654. <div
  655. hidden={cover !== ""}
  656. className="fileBoxRow_up"
  657. onClick={() => myInput.current?.click()}
  658. >
  659. <PlusOutlined />
  660. <input
  661. type="file"
  662. accept=".png,.jpg"
  663. ref={myInput}
  664. onChange={(e) => handeUpPhoto(e)}
  665. />
  666. </div>
  667. <div className="fileBoxRow_r_img" hidden={cover === ""}>
  668. <ImageLazy width={120} height={120} src={cover} />
  669. <Popconfirm
  670. title="确定删除吗?"
  671. okText="确定"
  672. cancelText="取消"
  673. onConfirm={() => setCover("")}
  674. >
  675. <div className="clearCover">
  676. <CloseCircleOutlined />
  677. </div>
  678. </Popconfirm>
  679. </div>
  680. <div className="fileBoxRow_r_tit">
  681. 支持上传jpg,png格式,大小&lt;10M
  682. </div>
  683. </div>
  684. </div>
  685. {/* 附件上传 */}
  686. <div className="fileBoxRow">
  687. <div className="fileBoxRow_tit fileBoxRow_tit2">上传附件:</div>
  688. <div className="fileBoxRow_r">
  689. <input
  690. type="file"
  691. ref={myInput2}
  692. onChange={(e) => handeUpPhoto2(e)}
  693. />
  694. <Select
  695. style={{ width: 150 }}
  696. value={fileSelect}
  697. onChange={fileSelectChangeFu}
  698. options={fileSelectList}
  699. />
  700. &emsp;
  701. <Button onClick={() => upFileFu()}>上传附件</Button>
  702. </div>
  703. </div>
  704. {/* 表格主体 */}
  705. <div className="addTableBox_table">
  706. <Table
  707. size="small"
  708. scroll={{ y: 300 }}
  709. dataSource={results[fileSelect]}
  710. columns={columns}
  711. rowKey="id"
  712. pagination={false}
  713. />
  714. </div>
  715. </div>
  716. </div>
  717. <br />
  718. <Form.Item wrapperCol={{ offset: 20 }}>
  719. <Button onClick={colsePage}>取消</Button>
  720. &emsp;
  721. <Button type="primary" htmlType="submit">
  722. 确定
  723. </Button>
  724. </Form.Item>
  725. </Form>
  726. </Modal>
  727. </div>
  728. );
  729. }
  730. const MemoObjectAdd = React.memo(ObjectAdd);
  731. export default MemoObjectAdd;