Forráskód Böngészése

云展-编辑-分类改成多选框

shaogen1995 1 éve
szülő
commit
940bc090f6

+ 19 - 5
src/pages/A4exhibit/A4add/index.tsx

@@ -1,7 +1,14 @@
 import React, { useCallback, useEffect, useRef, useState } from "react";
 import styles from "./index.module.scss";
 import { A4_APIgetInfo, A4_APIsave } from "@/store/action/A4exhibit";
-import { Button, DatePicker, Form, FormInstance, Input, Select } from "antd";
+import {
+  Button,
+  Checkbox,
+  DatePicker,
+  Form,
+  FormInstance,
+  Input,
+} from "antd";
 import TextArea from "antd/es/input/TextArea";
 import ZupOne from "@/components/ZupOne";
 import dayjs from "dayjs";
@@ -24,7 +31,7 @@ function A4add({ addId, closeFu, addTableFu, editTableFu }: Props) {
       FormBoxRef.current?.setFieldsValue({
         ...data,
         myTime: dayjs(data.releaseDate),
-        type: data.type ? data.type : null,
+        type: data.type ? data.type.split(",") : [],
       });
 
       // 设置封面图
@@ -82,7 +89,7 @@ function A4add({ addId, closeFu, addTableFu, editTableFu }: Props) {
         qrCode: qrCodeTemp.filePath ? qrCodeTemp.filePath : "",
         releaseDate,
         thumb: coverUrl1.filePath,
-        type: values.type ? values.type : "",
+        type: values.type ? values.type.join(",") : "",
       };
       const res = await A4_APIsave(obj);
       if (res.code === 0) {
@@ -119,7 +126,14 @@ function A4add({ addId, closeFu, addTableFu, editTableFu }: Props) {
           </Form.Item>
 
           <Form.Item label="分类" name="type">
-            <Select
+            <Checkbox.Group
+              options={[
+                { value: "回顾云展", label: "回顾云展" },
+                { value: "展厅云展", label: "展厅云展" },
+                { value: "馆藏系列云展", label: "馆藏系列云展" },
+              ]}
+            />
+            {/* <Select
               allowClear
               placeholder="请选择"
               style={{ width: 200 }}
@@ -128,7 +142,7 @@ function A4add({ addId, closeFu, addTableFu, editTableFu }: Props) {
                 { value: "展厅云展", label: "展厅云展" },
                 { value: "馆藏系列云展", label: "馆藏系列云展" },
               ]}
-            />
+            /> */}
           </Form.Item>
 
           <Form.Item label="简介" name="description">

+ 7 - 6
src/pages/A6_1ques/A6QInfo/Tab2Look.tsx

@@ -123,7 +123,13 @@ function Tab1Look({ waiId, fatherInfo, colseFu }: Props) {
                             >
                               <div className="T1list5">
                                 {v.type === "排序" ? (
-                                  <div className={classNames(v2.sort?'T1listSort':'')}>{v2.sort}</div>
+                                  <div
+                                    className={classNames(
+                                      v2.sort ? "T1listSort" : ""
+                                    )}
+                                  >
+                                    {v2.sort}
+                                  </div>
                                 ) : null}
                                 {v2.name === "其他"
                                   ? "Z"
@@ -140,11 +146,6 @@ function Tab1Look({ waiId, fatherInfo, colseFu }: Props) {
                         </div>
                       ))
                     : null}
-                  {/* {v.type === "填空" ? (
-                    <div className="T1list2">{v.}</div>
-                  ) : (
-                    <div className="T1list3"></div>
-                  )} */}
                 </div>
               ))
             : null}