shaogen1995 1 年之前
父節點
當前提交
afa8bf0531

+ 1 - 0
src/components/ZupOne/index.module.scss

@@ -24,6 +24,7 @@
       width: 100px;
       height: 126px;
       position: relative;
+      margin-top: 10px;
 
       .file_closeBox {
         position: absolute;

+ 2 - 1
src/components/ZupTypes/index.module.scss

@@ -95,6 +95,7 @@
             height: 125px;
             position: relative;
             margin-bottom: 20px;
+            cursor: move;
 
             .ZTbox1ImgRowIcon {
               width: 100%;
@@ -105,7 +106,7 @@
               font-size: 16px;
 
               a {
-                color: #fff;
+                color: #fff !important;
               }
             }
 

+ 1 - 0
src/components/ZupTypes/index.tsx

@@ -164,6 +164,7 @@ function ZupTypes(
         // 把files添加进FormData对象(‘photo’为后端需要的字段)
         fd.append("type", fileOneType);
         fd.append("dirCode", dirCode);
+        fd.append("isDb", "true");
         fd.append("file", filesInfo);
 
         e.target.value = "";

+ 15 - 22
src/pages/A2dynamic/A2edit/index.tsx

@@ -3,9 +3,6 @@ import styles from "./index.module.scss";
 import { Button, DatePicker, Form, FormInstance, Input } from "antd";
 import { A2_APIgetInfo, A2_APIsave } from "@/store/action/A2dynamic";
 import dayjs from "dayjs";
-import { useDispatch, useSelector } from "react-redux";
-import { Z0_APIgetList } from "@/store/action/Z0column";
-import { RootState } from "@/store";
 import { Select } from "antd/lib";
 import TextArea from "antd/es/input/TextArea";
 import MyPopconfirm from "@/components/MyPopconfirm";
@@ -13,27 +10,25 @@ import ZRichText from "@/components/ZRichText";
 import ZupOne from "@/components/ZupOne";
 import ZupVideos from "@/components/ZupVideos";
 import { MessageFu } from "@/utils/message";
+import { Z0tableType } from "@/types";
 
 type Props = {
   editId: number;
+  dynamicList: Z0tableType[];
   addTableFu: () => void;
   editTableFu: () => void;
   closeFu: () => void;
 };
 
-function A2edit({ editId, addTableFu, editTableFu, closeFu }: Props) {
+function A2edit({
+  editId,
+  dynamicList,
+  addTableFu,
+  editTableFu,
+  closeFu,
+}: Props) {
   const [dirCode, setDirCode] = useState("");
 
-  const dispatch = useDispatch();
-  // 获取所属栏目列表,用于下拉框
-  useEffect(() => {
-    dispatch(Z0_APIgetList());
-  }, [dispatch]);
-
-  const { dynamic } = useSelector(
-    (state: RootState) => state.Z0column.tableInfo
-  );
-
   // 表单的ref
   const FormBoxRef = useRef<FormInstance>(null);
 
@@ -71,9 +66,9 @@ function A2edit({ editId, addTableFu, editTableFu, closeFu }: Props) {
 
   useEffect(() => {
     if (editId > 0) {
-      setDirCode(Date.now() + "");
       getInfoFu(editId);
     } else {
+      setDirCode(Date.now() + "");
       FormBoxRef.current?.setFieldsValue({
         myTime: dayjs(Date.now()),
       });
@@ -88,8 +83,6 @@ function A2edit({ editId, addTableFu, editTableFu, closeFu }: Props) {
     setFileCheck(true);
   }, []);
 
-  // 待完善 type 所属栏目
-
   //  通过校验点击确定
   const onFinish = useCallback(
     async (values: any) => {
@@ -110,7 +103,7 @@ function A2edit({ editId, addTableFu, editTableFu, closeFu }: Props) {
         id: editId > 0 ? editId : null,
         publishDate,
         thumb: coverUrl1.filePath,
-        rtf: rtf.val,
+        rtf: rtf.val || "",
         fileIds: flieList.map((v: any) => v.id).join(","),
       };
 
@@ -155,13 +148,13 @@ function A2edit({ editId, addTableFu, editTableFu, closeFu }: Props) {
 
           <Form.Item
             label="所属栏目"
-            name="type"
-            rules={[{ required: true, message: "请选择发布日期!" }]}
+            name="dictId"
+            rules={[{ required: true, message: "请选择所属栏目!" }]}
           >
             <Select
               placeholder="请选择"
               style={{ width: 200 }}
-              options={dynamic.map((v) => ({ value: v.id, label: v.name }))}
+              options={dynamicList.map((v) => ({ value: v.id, label: v.name }))}
             />
           </Form.Item>
 
@@ -211,7 +204,7 @@ function A2edit({ editId, addTableFu, editTableFu, closeFu }: Props) {
           {/* 富文本 */}
           <div className="formRow">
             <div className="formLeft">正文:</div>
-            <div className="formRight" style={{height:450}}>
+            <div className="formRight" style={{ height: 450 }}>
               <ZRichText
                 check={false}
                 dirCode={dirCode}

+ 6 - 0
src/pages/A2dynamic/index.module.scss

@@ -7,6 +7,12 @@
       background-color: #fff;
       display: flex;
       justify-content: space-between;
+      .A2topLeft{
+        display: flex;
+        .A2topRow{
+          margin-right: 20px;
+        }
+      }
     }
 
     .A2tableBox {

+ 40 - 12
src/pages/A2dynamic/index.tsx

@@ -10,19 +10,28 @@ import { useDispatch, useSelector } from "react-redux";
 import { A2_APIdel, A2_APIgetList } from "@/store/action/A2dynamic";
 import { RootState } from "@/store";
 import { A2tableType } from "@/types";
-import { Button, Input } from "antd";
+import { Button, Input, Select } from "antd";
 import MyTable from "@/components/MyTable";
 import { A2tableC } from "@/utils/tableData";
 import MyPopconfirm from "@/components/MyPopconfirm";
 import { MessageFu } from "@/utils/message";
 import A2edit from "./A2edit";
+import { Z0_APIgetList } from "@/store/action/Z0column";
 function A2dynamic() {
   const dispatch = useDispatch();
+  // 获取所属栏目列表,用于下拉框
+  useEffect(() => {
+    dispatch(Z0_APIgetList());
+  }, [dispatch]);
+  const { dynamic } = useSelector(
+    (state: RootState) => state.Z0column.tableInfo
+  );
 
   const [fromData, setFromData] = useState({
     pageNum: 1,
     pageSize: 10,
     searchKey: "",
+    dictId: "",
   });
 
   const getListFu = useCallback(() => {
@@ -54,6 +63,7 @@ function A2dynamic() {
       pageNum: 1,
       pageSize: 10,
       searchKey: "",
+      dictId: "",
     });
   }, []);
 
@@ -99,17 +109,34 @@ function A2dynamic() {
 
       {/* 顶部筛选 */}
       <div className="A2top">
-        <div>
-          <span>标题:</span>
-          <Input
-            key={inputKey}
-            maxLength={10}
-            showCount
-            style={{ width: 300 }}
-            placeholder="请输入"
-            allowClear
-            onChange={(e) => fromKeyChangeFu(e, "searchKey")}
-          />
+        <div className="A2topLeft">
+          <div className="A2topRow">
+            <span>标题:</span>
+            <Input
+              key={inputKey}
+              maxLength={10}
+              showCount
+              style={{ width: 300 }}
+              placeholder="请输入"
+              allowClear
+              onChange={(e) => fromKeyChangeFu(e, "searchKey")}
+            />
+          </div>
+          <div className="A2topRow">
+            <span>所属栏目:</span>
+            <Select
+              placeholder="请选择"
+              style={{ width: 200 }}
+              value={fromData.dictId}
+              onChange={(e) =>
+                setFromData({ ...fromData, pageNum: 1, dictId: e })
+              }
+              options={[
+                { value: "", label: "全部" },
+                ...dynamic.map((v) => ({ value: v.id, label: v.name })),
+              ]}
+            />
+          </div>
         </div>
         <div>
           <Button onClick={resetSelectFu}>重置</Button>&emsp;
@@ -139,6 +166,7 @@ function A2dynamic() {
       {editId ? (
         <A2edit
           editId={editId}
+          dynamicList={dynamic}
           closeFu={() => setEditId(0)}
           addTableFu={resetSelectFu}
           editTableFu={getListFu}

+ 59 - 0
src/pages/A4goods/A4edit/index.module.scss

@@ -0,0 +1,59 @@
+.A4edit {
+  position: absolute;
+  top: 0;
+  left: 0;
+  z-index: 12;
+  width: 100%;
+  height: 100%;
+  background-color: #fff;
+  border-radius: 10px;
+  padding: 24px;
+
+  :global {
+    .A4eMain {
+      width: 100%;
+      height: 100%;
+      overflow-y: auto;
+
+      .A4link {
+        textarea {
+          min-height: 60px !important;
+        }
+      }
+
+      .ant-form {
+        width: 800px;
+
+        // .ant-input-affix-wrapper{
+        //   width: 800px;
+        // }
+        .formRow {
+          display: flex;
+
+          .formLeft {
+            position: relative;
+            top: 3px;
+            width: 100px;
+            text-align: right;
+
+            &>span {
+              color: #ff4d4f;
+            }
+          }
+
+          .formRight {
+            width: calc(100% - 100px);
+          }
+        }
+
+        .A4Ebtn {
+          position: absolute;
+          z-index: 10;
+          left: 1200px;
+          top: 50%;
+          transform: translateY(-50%);
+        }
+      }
+    }
+  }
+}

+ 269 - 0
src/pages/A4goods/A4edit/index.tsx

@@ -0,0 +1,269 @@
+import React, { useCallback, useEffect, useRef, useState } from "react";
+import styles from "./index.module.scss";
+import { Z0tableType } from "@/types";
+import { Button, DatePicker, Form, FormInstance, Input, Select } from "antd";
+import ZupOne from "@/components/ZupOne";
+import dayjs from "dayjs";
+import { A4_APIgetInfo, A4_APIsave } from "@/store/action/A4goods";
+import { MessageFu } from "@/utils/message";
+import MyPopconfirm from "@/components/MyPopconfirm";
+import TextArea from "antd/es/input/TextArea";
+import ZupTypes from "@/components/ZupTypes";
+
+type Props = {
+  editId: number;
+  goodsList: Z0tableType[];
+  addTableFu: () => void;
+  editTableFu: () => void;
+  closeFu: () => void;
+};
+
+function A4edit({
+  editId,
+  goodsList,
+  addTableFu,
+  editTableFu,
+  closeFu,
+}: Props) {
+  const [dirCode, setDirCode] = useState("");
+
+  // 表单的ref
+  const FormBoxRef = useRef<FormInstance>(null);
+  // 封面图的ref
+  const ZupThumbRef = useRef<any>(null);
+  // 文件 类型的ref
+  const ZupFilesRef = useRef<any>(null);
+
+  const getInfoFu = useCallback(async (id: number) => {
+    const res = await A4_APIgetInfo(id);
+    if (res.code === 0) {
+      const data = res.data;
+
+      const entity = data.entity;
+      const file = data.file;
+
+      setDirCode(entity.dirCode);
+
+      FormBoxRef.current?.setFieldsValue({
+        ...entity,
+        myTime: dayjs(entity.publishDate),
+      });
+
+      // 设置封面图
+      ZupThumbRef.current?.setFileComFileFu({
+        fileName: "",
+        filePath: entity.thumb,
+      });
+
+      // 设置文件类型
+      const sonInfo = {
+        type: entity.fileTypes,
+        fileList: file,
+      };
+      ZupFilesRef.current?.setFileComFileFu(sonInfo);
+    }
+  }, []);
+
+  useEffect(() => {
+    if (editId > 0) {
+      getInfoFu(editId);
+    } else {
+      setDirCode(Date.now() + "");
+
+      FormBoxRef.current?.setFieldsValue({
+        myTime: dayjs(Date.now()),
+      });
+    }
+  }, [editId, getInfoFu]);
+
+  // 附件 是否 已经点击过确定
+  const [fileCheck, setFileCheck] = useState(false);
+
+  // 没有通过校验
+  const onFinishFailed = useCallback(() => {
+    setFileCheck(true);
+  }, []);
+
+  //  通过校验点击确定
+  const onFinish = useCallback(
+    async (values: any) => {
+      setFileCheck(true);
+
+      const coverUrl1 = ZupThumbRef.current?.fileComFileResFu();
+      // 没有传 封面图
+      if (!coverUrl1.filePath) return;
+
+      // 附件组件的 type 数组 和 附件id数组
+      const { sonType, sonFileIds, sonIsOk } =
+        ZupFilesRef.current?.fileComFileResFu();
+
+      if (sonIsOk) return;
+
+      // 发布日期
+      const publishDate = dayjs(values.myTime).format("YYYY-MM-DD");
+
+      const obj = {
+        ...values,
+        id: editId > 0 ? editId : null,
+        publishDate,
+        thumb: coverUrl1.filePath,
+        fileTypes: sonType ? sonType.join(",") : null,
+        fileIds: sonFileIds ? sonFileIds.join(",") : null,
+      };
+
+      const res = await A4_APIsave(obj);
+
+      if (res.code === 0) {
+        MessageFu.success(editId > 0 ? "编辑成功!" : "新增成功!");
+        editId > 0 ? editTableFu() : addTableFu();
+        closeFu();
+      }
+    },
+    [addTableFu, closeFu, editId, editTableFu]
+  );
+
+  return (
+    <div className={styles.A4edit}>
+      <div className="A4eMain">
+        <Form
+          ref={FormBoxRef}
+          name="basic"
+          labelCol={{ span: 3 }}
+          onFinish={onFinish}
+          onFinishFailed={onFinishFailed}
+          autoComplete="off"
+          scrollToFirstError
+        >
+          <Form.Item
+            label="标题"
+            name="name"
+            rules={[{ required: true, message: "请输入标题!" }]}
+            getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
+          >
+            <Input maxLength={30} showCount placeholder="请输入内容" />
+          </Form.Item>
+
+          <Form.Item
+            label="所属栏目"
+            name="dictId"
+            rules={[{ required: true, message: "请选择所属栏目!" }]}
+          >
+            <Select
+              placeholder="请选择"
+              style={{ width: 200 }}
+              options={goodsList.map((v) => ({ value: v.id, label: v.name }))}
+            />
+          </Form.Item>
+
+          <Form.Item
+            label="发布日期"
+            name="myTime"
+            rules={[{ required: true, message: "请选择发布日期!" }]}
+          >
+            <DatePicker />
+          </Form.Item>
+          {/* 封面 */}
+          <div className="formRow">
+            <div className="formLeft">
+              <span>* </span>
+              封面图:
+            </div>
+            <div className="formRight">
+              <ZupOne
+                ref={ZupThumbRef}
+                isLook={false}
+                fileCheck={fileCheck}
+                size={5}
+                dirCode={dirCode}
+                myUrl="cms/goods/upload"
+                format={["image/jpeg", "image/png"]}
+                formatTxt="png、jpg和jpeg"
+                checkTxt="请上传封面图!"
+                upTxt="最多1张"
+                myType="thumb"
+              />
+            </div>
+          </div>
+
+          <Form.Item
+            label="模型链接"
+            name="modelLink"
+            getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
+          >
+            <TextArea
+              className="A4link"
+              placeholder="请输入内容"
+              showCount
+              maxLength={200}
+            />
+          </Form.Item>
+
+          {/* 文件类型 */}
+          <div className="formRow">
+            <div className="formLeft">
+              <span>* </span>文件类型:
+            </div>
+            <div className="formRight">
+              <ZupTypes
+                ref={ZupFilesRef}
+                // 这个项目没有模型
+                selecFlag="图片/音频/视频"
+                isLook={false}
+                fileCheck={fileCheck}
+                dirCode={dirCode}
+                myUrl="cms/goods/upload"
+              />
+            </div>
+          </div>
+
+          <Form.Item
+            label="时代"
+            name="age"
+            getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
+          >
+            <Input maxLength={20} showCount placeholder="请输入内容" />
+          </Form.Item>
+
+          <Form.Item
+            label="质地"
+            name="texture"
+            getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
+          >
+            <Input maxLength={20} showCount placeholder="请输入内容" />
+          </Form.Item>
+
+          <Form.Item
+            label="尺寸"
+            name="size"
+            getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
+          >
+            <Input maxLength={20} showCount placeholder="请输入内容" />
+          </Form.Item>
+
+          <Form.Item label="简介" name="description">
+            <TextArea
+              className="A4link"
+              maxLength={200}
+              showCount
+              placeholder="请输入内容"
+            />
+          </Form.Item>
+
+          {/* 确定和取消按钮 */}
+          <Form.Item className="A4Ebtn">
+            <Button type="primary" htmlType="submit">
+              提交
+            </Button>
+            <br />
+            <br />
+            <MyPopconfirm txtK="取消" onConfirm={closeFu} />
+          </Form.Item>
+        </Form>
+      </div>
+    </div>
+  );
+}
+
+const MemoA4edit = React.memo(A4edit);
+
+export default MemoA4edit;

+ 22 - 1
src/pages/A4goods/index.module.scss

@@ -1,5 +1,26 @@
 .A4goods{
+  position: relative;
   :global{
-    
+    .A4top {
+      padding: 15px 24px;
+      border-radius: 10px;
+      background-color: #fff;
+      display: flex;
+      justify-content: space-between;
+      .A4topLeft{
+        display: flex;
+        .A4topRow{
+          margin-right: 20px;
+        }
+      }
+    }
+
+    .A4tableBox {
+      border-radius: 10px;
+      overflow: hidden;
+      margin-top: 15px;
+      height: calc(100% - 77px);
+      background-color: #fff;
+    }
   }
 }

+ 166 - 2
src/pages/A4goods/index.tsx

@@ -1,9 +1,173 @@
-import React from "react";
+import React, {
+  useCallback,
+  useEffect,
+  useMemo,
+  useRef,
+  useState,
+} from "react";
 import styles from "./index.module.scss";
+import { useDispatch, useSelector } from "react-redux";
+import { A4_APIdel, A4_APIgetList } from "@/store/action/A4goods";
+import { RootState } from "@/store";
+import { MessageFu } from "@/utils/message";
+import { A4tableType } from "@/types";
+import { Button, Input, Select } from "antd";
+import MyPopconfirm from "@/components/MyPopconfirm";
+import MyTable from "@/components/MyTable";
+import { A4tableC } from "@/utils/tableData";
+import { Z0_APIgetList } from "@/store/action/Z0column";
+import A4edit from "./A4edit";
 function A4goods() {
+  const dispatch = useDispatch();
+  // 获取所属栏目列表,用于下拉框
+  useEffect(() => {
+    dispatch(Z0_APIgetList());
+  }, [dispatch]);
+
+  const { goods } = useSelector((state: RootState) => state.Z0column.tableInfo);
+
+  const [fromData, setFromData] = useState({
+    pageNum: 1,
+    pageSize: 10,
+    searchKey: "",
+    dictId: "",
+  });
+
+  const getListFu = useCallback(() => {
+    dispatch(A4_APIgetList(fromData));
+  }, [dispatch, fromData]);
+
+  useEffect(() => {
+    getListFu();
+  }, [getListFu]);
+
+  const [inputKey, setInputKey] = useState(1);
+
+  // 标题的输入
+  const timeRef = useRef(-1);
+  const fromKeyChangeFu = useCallback(
+    (e: React.ChangeEvent<HTMLInputElement>, key: "searchKey") => {
+      clearTimeout(timeRef.current);
+      timeRef.current = window.setTimeout(() => {
+        setFromData({ ...fromData, [key]: e.target.value, pageNum: 1 });
+      }, 500);
+    },
+    [fromData]
+  );
+
+  // 点击重置
+  const resetSelectFu = useCallback(() => {
+    setInputKey(Date.now());
+    setFromData({
+      pageNum: 1,
+      pageSize: 10,
+      searchKey: "",
+      dictId: "",
+    });
+  }, []);
+
+  const tableInfo = useSelector((state: RootState) => state.A4goods.tableInfo);
+
+  const delTableFu = useCallback(
+    async (id: number) => {
+      const res = await A4_APIdel(id);
+      if (res.code === 0) {
+        MessageFu.success("删除成功!");
+        getListFu();
+      }
+    },
+    [getListFu]
+  );
+
+  // 新增和编辑
+  const [editId, setEditId] = useState(0);
+
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        title: "操作",
+        render: (item: A4tableType) => (
+          <>
+            <Button size="small" type="text" onClick={() => setEditId(item.id)}>
+              编辑
+            </Button>
+            <MyPopconfirm txtK="删除" onConfirm={() => delTableFu(item.id)} />
+          </>
+        ),
+      },
+    ];
+  }, [delTableFu]);
+
   return (
     <div className={styles.A4goods}>
-      <div className="pageTitle">宁博藏珍</div>
+      <div className="pageTitle">
+        宁博藏珍{editId > 0 ? " - 编辑" : editId < 0 ? " - 新增" : ""}
+      </div>
+      {/* 顶部筛选 */}
+      <div className="A4top">
+        <div className="A4topLeft">
+          <div className="A4topRow">
+            <span>标题:</span>
+            <Input
+              key={inputKey}
+              maxLength={10}
+              showCount
+              style={{ width: 300 }}
+              placeholder="请输入"
+              allowClear
+              onChange={(e) => fromKeyChangeFu(e, "searchKey")}
+            />
+          </div>
+          <div className="A4topRow">
+            <span>所属栏目:</span>
+            <Select
+              placeholder="请选择"
+              style={{ width: 200 }}
+              value={fromData.dictId}
+              onChange={(e) =>
+                setFromData({ ...fromData, pageNum: 1, dictId: e })
+              }
+              options={[
+                { value: "", label: "全部" },
+                ...goods.map((v) => ({ value: v.id, label: v.name })),
+              ]}
+            />
+          </div>
+        </div>
+        <div>
+          <Button onClick={resetSelectFu}>重置</Button>&emsp;
+          <Button type="primary" onClick={() => setEditId(-1)}>
+            新增
+          </Button>
+        </div>
+      </div>
+
+      {/* 表格主体 */}
+      <div className="A4tableBox">
+        <MyTable
+          yHeight={625}
+          list={tableInfo.list}
+          columnsTemp={A4tableC}
+          lastBtn={tableLastBtn}
+          pageNum={fromData.pageNum}
+          pageSize={fromData.pageSize}
+          total={tableInfo.total}
+          onChange={(pageNum, pageSize) =>
+            setFromData({ ...fromData, pageNum, pageSize })
+          }
+        />
+      </div>
+
+      {/* 新增和编辑 */}
+      {editId ? (
+        <A4edit
+          editId={editId}
+          goodsList={goods}
+          closeFu={() => setEditId(0)}
+          addTableFu={resetSelectFu}
+          editTableFu={getListFu}
+        />
+      ) : null}
     </div>
   );
 }

+ 41 - 0
src/store/action/A4goods.ts

@@ -0,0 +1,41 @@
+import http from "@/utils/http";
+import { AppDispatch } from "..";
+
+/**
+ *宁博藏珍-列表
+ */
+
+export const A4_APIgetList = (data: any): any => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.post("cms/goods/pageList", data);
+    if (res.code === 0) {
+      const obj = {
+        list: res.data.records,
+        total: res.data.total,
+      };
+      dispatch({ type: "A4/getList", payload: obj });
+    }
+  };
+};
+
+/**
+ * 宁博藏珍-删除
+ */
+export const A4_APIdel = (id: number) => {
+  return http.get(`cms/goods/removes/${id}`);
+};
+
+/**
+ * 宁博藏珍-获取详情
+ */
+export const A4_APIgetInfo = (id: number) => {
+  return http.get(`cms/goods/detail/${id}`);
+};
+
+/**
+ * 宁博藏珍-新增、编辑
+ */
+export const A4_APIsave = (data: any) => {
+  return http.post("cms/goods/save", data);
+};
+

+ 28 - 0
src/store/reducer/A4goods.ts

@@ -0,0 +1,28 @@
+import { A4tableType } from "@/types";
+
+// 初始化状态
+const initState = {
+  // 列表数据
+  tableInfo: {
+    list: [] as A4tableType[],
+    total: 0,
+  },
+};
+
+// 定义 action 类型
+type Props = {
+  type: "A4/getList";
+  payload: { list: A4tableType[]; total: number };
+};
+
+// reducer
+export default function Reducer(state = initState, action: Props) {
+  switch (action.type) {
+    // 获取列表数据
+    case "A4/getList":
+      return { ...state, tableInfo: action.payload };
+
+    default:
+      return state;
+  }
+}

+ 2 - 0
src/store/reducer/index.ts

@@ -5,6 +5,7 @@ import { combineReducers } from "redux";
 import A0Layout from "./layout";
 import A2dynamic from "./A2dynamic";
 import A3culture from "./A3culture";
+import A4goods from "./A4goods";
 import Z0column from "./Z0column";
 import Z1user from "./Z1user";
 import Z2log from "./Z2log";
@@ -14,6 +15,7 @@ const rootReducer = combineReducers({
   A0Layout,
   A2dynamic,
   A3culture,
+  A4goods,
   Z0column,
   Z1user,
   Z2log,

+ 18 - 0
src/types/api/A4goods.d.ts

@@ -0,0 +1,18 @@
+export type A4tableType = {
+  age: string;
+  createTime: string;
+  creatorId: number;
+  creatorName: string;
+  description: string;
+  dictName: string;
+  dirCode: string;
+  fileIds: string;
+  fileTypes: string;
+  id: number;
+  name: string;
+  publishDate: string;
+  size: string;
+  texture: string;
+  thumb: string;
+  updateTime: string;
+};

+ 1 - 0
src/types/index.d.ts

@@ -2,5 +2,6 @@ export * from './api/layot'
 export * from './api/Z0column'
 export * from './api/A2dynamic'
 export * from './api/A3culture'
+export * from './api/A4goods'
 export * from './api/Z1user'
 export * from './api/Z2log'

+ 12 - 2
src/utils/tableData.ts

@@ -11,7 +11,7 @@
 //     ["txt", "标题", "name"],
 //     ["img", type === "video" ? "视频封面" : "海报", "thumb"],
 //     ["txtChange", "自动播放", "display", { 0: "否", 1: "是" }],
-//     ["text", "创建日期",'description', 50],
+//     ["text", "创建日期",'description', 50,A],
 //   ];
 // };
 
@@ -19,7 +19,7 @@ export const A2tableC = [
   ["txt", "标题", "name"],
   ["img", "封面", "thumb"],
   ["txt", "发布日期", "publishDate"],
-  ["txt", "所属栏目", "type"],
+  ["txt", "所属栏目", "dictName"],
   ["text", "摘要", "description", 50],
 ];
 
@@ -30,6 +30,16 @@ export const A3tableC = [
   ["text", "链接", "link", 50, "A"],
 ];
 
+export const A4tableC = [
+  ["txt", "标题", "name"],
+  ["img", "封面", "thumb"],
+  ["txt", "发布日期", "publishDate"],
+  ["txt", "所属栏目", "dictName"],
+  ["txt", "质地", "texture"],
+  ["txt", "年代", "age"],
+  ["text", "简介", "description", 50],
+];
+
 export const Z0tableC = [
   ["txt", "栏目名称", "name"],
   ["text", "说明", "rtf", 50],