shaogen1995 2 yıl önce
ebeveyn
işleme
6577131548

BIN
houtai/src/assets/img/demo.jpg


+ 12 - 9
houtai/src/assets/styles/base.css

@@ -63,7 +63,8 @@ a {
   height: 100vh;
   min-width: 1600px;
   min-height: 900px;
-  overflow-y: auto;
+  overflow: auto;
+  overflow-y: overlay;
   /* 普通文字按钮的颜色 */
   /* 按钮的危险颜色 */
   /* antd分页器样式 */
@@ -72,10 +73,10 @@ a {
   /* antd表格居中 */
 }
 #root .ant-btn-text {
-  color: #409eff;
+  color: #99b8dd;
 }
 #root .ant-btn-text.ant-btn-dangerous {
-  color: var(--themeColor);
+  color: var(--themeColor2);
 }
 #root .ant-pagination .ant-pagination-item {
   border-radius: 50%;
@@ -83,13 +84,13 @@ a {
   background-color: transparent !important;
 }
 #root .ant-pagination .ant-pagination-item-active {
-  background-color: var(--themeColor) !important;
+  background-color: var(--themeColor2) !important;
 }
 #root .ant-pagination .ant-pagination-item-active a {
   color: #fff !important;
 }
 #root .ant-pagination .ant-pagination-item:hover {
-  background-color: var(--themeColor) !important;
+  background-color: var(--themeColor2) !important;
 }
 #root .ant-pagination .ant-pagination-item:hover a {
   color: #fff !important;
@@ -99,7 +100,7 @@ a {
   border: 1px solid #999;
 }
 #root .ant-pagination-prev:hover {
-  background-color: var(--themeColor);
+  background-color: var(--themeColor2);
 }
 #root .ant-pagination-prev:hover button {
   color: #fff;
@@ -109,7 +110,7 @@ a {
   border: 1px solid #999;
 }
 #root .ant-pagination-next:hover {
-  background-color: var(--themeColor);
+  background-color: var(--themeColor2);
 }
 #root .ant-pagination-next:hover button {
   color: #fff;
@@ -135,11 +136,13 @@ a {
 }
 /* 页面的顶部title */
 .pageTitlt {
+  position: absolute;
+  top: 17px;
+  left: 262px;
+  z-index: 100;
   font-size: 20px;
   font-weight: 700;
   color: var(--themeColor2);
-  padding-left: 40px;
-  line-height: 60px;
 }
 #upInput {
   display: none;

+ 12 - 10
houtai/src/assets/styles/base.less

@@ -81,18 +81,18 @@ a {
   height: 100vh;
   min-width: 1600px;
   min-height: 900px;
-  overflow-y: auto;
-
+  overflow: auto;
+  overflow-y: overlay;
 
 
   /* 普通文字按钮的颜色 */
   .ant-btn-text {
-    color: #409eff;
+    color: #99b8dd;
   }
 
   /* 按钮的危险颜色 */
   .ant-btn-text.ant-btn-dangerous {
-    color: var(--themeColor);
+    color: var(--themeColor2);
   }
 
   /* antd分页器样式 */
@@ -103,7 +103,7 @@ a {
   }
 
   .ant-pagination .ant-pagination-item-active {
-    background-color: var(--themeColor) !important;
+    background-color: var(--themeColor2) !important;
   }
 
 
@@ -112,7 +112,7 @@ a {
   }
 
   .ant-pagination .ant-pagination-item:hover {
-    background-color: var(--themeColor) !important;
+    background-color: var(--themeColor2) !important;
   }
 
   .ant-pagination .ant-pagination-item:hover a {
@@ -125,7 +125,7 @@ a {
   }
 
   .ant-pagination-prev:hover {
-    background-color: var(--themeColor);
+    background-color: var(--themeColor2);
   }
 
   .ant-pagination-prev:hover button {
@@ -141,7 +141,7 @@ a {
 
 
   .ant-pagination-next:hover {
-    background-color: var(--themeColor);
+    background-color: var(--themeColor2);
   }
 
   .ant-pagination-next:hover button {
@@ -186,11 +186,13 @@ a {
 
 /* 页面的顶部title */
 .pageTitlt {
+  position: absolute;
+  top: 17px;
+  left: 262px;
+  z-index: 100;
   font-size: 20px;
   font-weight: 700;
   color: var(--themeColor2);
-  padding-left: 40px;
-  line-height: 60px;
 }
 
 

+ 14 - 7
houtai/src/components/ImageLazy/index.tsx

@@ -8,13 +8,20 @@ import { EyeOutlined } from "@ant-design/icons";
 import { useDispatch } from "react-redux";
 
 type Props = {
-  width?: number;
+  width?: number | string;
   height?: number;
   src: string;
   noLook?: boolean;
+  offline?: boolean;
 };
 
-function ImageLazy({ width = 100, height = 100, src, noLook }: Props) {
+function ImageLazy({
+  width = 100,
+  height = 100,
+  src,
+  noLook,
+  offline = false,
+}: Props) {
   const dispatch = useDispatch();
 
   // 图片占位符
@@ -30,7 +37,7 @@ function ImageLazy({ width = 100, height = 100, src, noLook }: Props) {
       // 进页面查看图片的加载情况
       // 创建一个img标签
       const imgDom = document.createElement("img");
-      imgDom.src = baseURL + src;
+      imgDom.src = offline ? src : baseURL + src;
 
       // 不管图片加载成功或者失败,都删除掉,提高性能
       // 图片加载成功
@@ -49,21 +56,21 @@ function ImageLazy({ width = 100, height = 100, src, noLook }: Props) {
         imgDom.remove();
       };
     }
-  }, [src]);
+  }, [offline, src]);
 
   // 点击预览图片
   const lookBigImg = useCallback(() => {
     dispatch({
       type: "login/lookBigImg",
-      payload: { url: baseURL + src, show: true },
+      payload: { url: offline ? src : baseURL + src, show: true },
     });
-  }, [dispatch, src]);
+  }, [dispatch, offline, src]);
 
   return (
     <div className={styles.ImageLazy} style={{ width: width, height: height }}>
       <div className="lazyBox">
         <Lazyimg
-          src={src ? baseURL + src : ""}
+          src={src ? (offline ? src : baseURL + src) : ""}
           width={width}
           height={height}
           placeholder={placeholderUrl}

+ 1 - 1
houtai/src/pages/A1Hot/index.module.scss

@@ -275,7 +275,7 @@
           width: 30%;
           border-radius: 10px;
           background-color: #fff;
-          height: 100%;
+          height: calc(100% - 2px);
           padding: 10px 20px 0 15px;
 
           .downBoxRBox {

+ 3 - 0
houtai/src/pages/A1Hot/index.tsx

@@ -278,6 +278,9 @@ function Hot() {
 
   return (
     <div className={styles.Hot}>
+
+      <div className="pageTitlt">热度统计</div>
+
       <div className="hotMainBox">
         {/* 上面 */}
         <div className="topBox">

+ 70 - 3
houtai/src/pages/B1Scene/index.module.scss

@@ -1,5 +1,72 @@
-.Scene{
-  :global{
-    
+.Scene {
+  overflow: auto;
+  overflow-y: overlay;
+
+  :global {
+    .titleTxt {
+      padding-left: 15px;
+      position: relative;
+      z-index: 10;
+      font-weight: 700;
+      font-size: 16px;
+
+
+      &::before {
+        content: '';
+        position: absolute;
+        left: 0;
+        top: 0;
+        width: 5px;
+        height: 22px;
+        background-color: var(--themeColor2);
+      }
+    }
+
+    .box1 {
+      border-radius: 10px;
+      background-color: #fff;
+      padding: 10px 15px 0;
+      margin-bottom: 20px;
+
+      .box1RowBox {
+        margin-top: 15px;
+        display: flex;
+        flex-wrap: wrap;
+
+        .box1Row {
+          border: 1px solid var(--themeColor2);
+          border-radius: 5px;
+          overflow: hidden;
+          width: calc(16.66% - 8px);
+          height: 275px;
+          margin-right: 8px;
+          margin-bottom: 15px;
+
+          &>img {
+            width: 100%;
+            height: 180px;
+          }
+
+          .txt {
+            padding: 5px;
+            height: 50px;
+            display: flex;
+            flex-wrap: wrap;
+            align-items: center;
+          }
+
+          .button {
+            text-align: center;
+            height: 45px;
+
+          }
+
+          &:nth-of-type(6n) {
+            margin-right: 0;
+          }
+        }
+      }
+    }
+
   }
 }

+ 61 - 5
houtai/src/pages/B1Scene/index.tsx

@@ -1,12 +1,68 @@
-import React from "react";
+import React, { useMemo } from "react";
 import styles from "./index.module.scss";
- function Scene() {
-  
+import demoImg from "@/assets/img/demo.jpg";
+import { Button } from "antd";
+import ImageLazy from "@/components/ImageLazy";
+function Scene() {
+  const list1 = useMemo(() => {
+    return [
+      { id: 1, name: "鸦片战争博物馆", img: demoImg },
+      { id: 2, name: "海战博物馆A厅", img: demoImg },
+      { id: 3, name: "海战博物馆B厅", img: demoImg },
+      { id: 4, name: "海战博物馆C厅海战博物馆C厅海战博物馆C厅", img: demoImg },
+      { id: 5, name: "海战博物馆D厅", img: demoImg },
+      { id: 6, name: "虎门故事展厅", img: demoImg },
+    ];
+  }, []);
+
+  const list2 = useMemo(() => {
+    return [
+      { id: 1, name: "威远+靖远炮台", img: demoImg },
+      { id: 2, name: "靖远炮台1", img: demoImg },
+      { id: 3, name: "靖远炮台2", img: demoImg },
+      { id: 4, name: "靖远炮台3", img: demoImg },
+      { id: 5, name: "靖远炮台2靖远炮台2靖远炮台2靖远炮台2靖远炮台2靖远炮台2靖远炮台2", img: demoImg },
+      { id: 6, name: "靖远炮台A", img: demoImg },
+    ];
+  }, []);
+
   return (
     <div className={styles.Scene}>
-      <h1>Scene</h1>
+      <div className="pageTitlt">场景管理</div>
+      {/* 场景编辑器 */}
+      <div className="box1">
+        <div className="titleTxt">场景编辑器</div>
+        <div className="box1RowBox">
+          {list1.map((v) => (
+            <div className="box1Row" key={v.id}>
+              <ImageLazy src={v.img} width="100%" height={180} offline={true} />
+              <div className="txt">{v.name}</div>
+              <div className="button">
+                <Button type="primary">预览</Button>&emsp;
+                <Button>编辑</Button>
+              </div>
+            </div>
+          ))}
+        </div>
+      </div>
+
+      {/* 数字场景档案 */}
+      <div className="box1">
+        <div className="titleTxt">数字场景档案</div>
+        <div className="box1RowBox">
+          {list2.map((v) => (
+            <div className="box1Row" key={v.id}>
+              <ImageLazy src={v.img} width="100%" height={180} offline={true} />
+              <div className="txt">{v.name}</div>
+              <div className="button">
+                <Button type="primary">预览</Button>
+              </div>
+            </div>
+          ))}
+        </div>
+      </div>
     </div>
-  )
+  );
 }
 
 const MemoScene = React.memo(Scene);

+ 23 - 1
houtai/src/pages/B2Goods/index.module.scss

@@ -1,5 +1,27 @@
 .Goods{
   :global{
-    
+    .searchBox{
+      padding: 14px 15px 0;
+      display: flex;
+      flex-wrap: wrap;
+      border-radius: 10px;
+      background-color: #fff;
+      .searchRow{
+        margin-bottom: 14px;
+        margin-right: 20px;
+      }
+    }
+    .tableBox{
+      border-radius: 10px;
+      overflow: hidden;
+      margin-top: 20px;
+      height: calc(100% - 128px);
+      background-color: #fff;
+      .ant-table-body{
+        height: 560px;
+        overflow-y: auto !important;
+        overflow-y: overlay !important;
+      }
+    }
   }
 }

+ 526 - 5
houtai/src/pages/B2Goods/index.tsx

@@ -1,12 +1,533 @@
-import React from "react";
+import { RootState } from "@/store";
+import {
+  getGoodsListDeriveAPI,
+  getGoodsListAPI,
+  goodsDisplayAPI,
+  goodsRemoveAPI,
+} from "@/store/action/B2Goods";
+import { MessageFu } from "@/utils/message";
+import {
+  Input,
+  Select,
+  DatePicker,
+  Button,
+  Table,
+  Switch,
+  Popconfirm,
+} from "antd";
+import dayjs from "dayjs";
+import React, {
+  useCallback,
+  useEffect,
+  useMemo,
+  useRef,
+  useState,
+} from "react";
+import { useDispatch, useSelector } from "react-redux";
 import styles from "./index.module.scss";
- function Goods() {
-  
+import ExportJsonExcel from "js-export-excel";
+import ImageLazy from "@/components/ImageLazy";
+
+const { RangePicker } = DatePicker;
+function Goods() {
+  const dispatch = useDispatch();
+  const pageNumRef = useRef(1);
+  const pagePageRef = useRef(10);
+
+  // 从仓库获取下拉列表数据
+  const dictList = useSelector((state: RootState) => state.loginStore.dictList);
+
+  // 从仓库获取表格列表信息
+  const tableInfo = useSelector(
+    (state: RootState) => state.goodsReducer.tableInfo
+  );
+
+  // 顶部筛选
+  const [tableSelect, setTableSelect] = useState({
+    name: "",
+    num: "",
+    dictTexture: "",
+    dictAge: "",
+    dictLevel: "",
+    dictSource: "",
+    startTime: "",
+    endTime: "",
+    topic: -1,
+    display: -1,
+    pageSize: 10,
+    pageNum: 1,
+    aaaaa: -1,
+  });
+
+  // 封装发送请求的函数
+
+  const getList = useCallback(async () => {
+    const data = {
+      ...tableSelect,
+      topic: tableSelect.topic === -1 ? null : tableSelect.topic,
+      display: tableSelect.display === -1 ? null : tableSelect.display,
+      aaaaa: tableSelect.aaaaa === -1 ? null : tableSelect.aaaaa,
+      pageNum: pageNumRef.current,
+    };
+    dispatch(getGoodsListAPI(data));
+  }, [dispatch, tableSelect]);
+
+  // 当前页码统一
+  useEffect(() => {
+    pageNumRef.current = tableSelect.pageNum;
+    pagePageRef.current = tableSelect.pageSize;
+  }, [tableSelect.pageNum, tableSelect.pageSize]);
+
+  useEffect(() => {
+    getList();
+  }, [getList]);
+
+  // 名称的输入
+  const nameTime = useRef(-1);
+  const nameChange = useCallback(
+    (e: React.ChangeEvent<HTMLInputElement>) => {
+      clearTimeout(nameTime.current);
+      nameTime.current = window.setTimeout(() => {
+        setTableSelect({
+          ...tableSelect,
+          name: e.target.value,
+          pageNum: 1,
+        });
+      }, 500);
+    },
+    [tableSelect]
+  );
+
+  // 登记编号的输入
+  const numTime = useRef(-1);
+  const numChange = useCallback(
+    (e: React.ChangeEvent<HTMLInputElement>) => {
+      clearTimeout(numTime.current);
+      numTime.current = window.setTimeout(() => {
+        setTableSelect({
+          ...tableSelect,
+          num: e.target.value,
+          pageNum: 1,
+        });
+      }, 500);
+    },
+    [tableSelect]
+  );
+
+  // 时间选择器改变
+  const timeChange = (date: any, dateString: any) => {
+    let startTime = "";
+    let endTime = "";
+    if (dateString[0] && dateString[1]) {
+      startTime = dateString[0] + " 00:00:00";
+      endTime = dateString[1] + " 23:59:59";
+    }
+    setTableSelect({ ...tableSelect, startTime, endTime, pageNum: 1 });
+  };
+
+  // 点击重置
+  const [inputKey, setInputKey] = useState(1);
+  const resetSelectFu = useCallback(() => {
+    // 把2个输入框和时间选择器清空
+    setInputKey(Date.now());
+    setTableSelect({
+      name: "",
+      num: "",
+      dictTexture: "",
+      dictAge: "",
+      dictLevel: "",
+      dictSource: "",
+      startTime: "",
+      endTime: "",
+      topic: -1,
+      display: -1,
+      pageSize: 10,
+      pageNum: 1,
+      aaaaa: -1,
+    });
+  }, []);
+
+  // 点击导出
+  const deriveFu = useCallback(async () => {
+    if (tableInfo.list.length === 0)
+      return MessageFu.warning("当前搜索条件没有数据!");
+
+    const data = {
+      ...tableSelect,
+      topic: tableSelect.topic === -1 ? null : tableSelect.topic,
+      display: tableSelect.display === -1 ? null : tableSelect.display,
+      aaaaa: tableSelect.aaaaa === -1 ? null : tableSelect.aaaaa,
+      pageNum: 1,
+      pageSize: 9999,
+    };
+
+    const res = await getGoodsListDeriveAPI(data);
+
+    if (res.code === 0) {
+      const name = dayjs(new Date()).format("YYYYMMDD");
+
+      const resData = res.data.records;
+
+      const option = {
+        fileName: name,
+        datas: [
+          {
+            sheetData: resData.map((v: any, i: number) => {
+              return {
+                index: i + 1,
+                ...v,
+              };
+            }),
+            sheetName: name,
+            sheetFilter: [
+              "index",
+              "name",
+              "num",
+              "dictTexture",
+              "dictAge",
+              "dictLevel",
+              "dictSource",
+              "description",
+              "updateTime",
+              "topic",
+              "display",
+              "aaaaa",
+            ],
+            sheetHeader: [
+              "序号",
+              "名称",
+              "登记编号",
+              "类别",
+              "年代",
+              "级别",
+              "来源",
+              "简介",
+              "最近编辑时间",
+              "万物墙主题",
+              "展示状态",
+              "弹幕留言",
+            ],
+            // columnWidths: [5, 20, 5],
+          },
+        ],
+      };
+
+      const toExcel = new ExportJsonExcel(option); //new
+      toExcel.saveExcel(); //保存
+    }
+  }, [tableInfo.list.length, tableSelect]);
+
+  // ----------关于表格的数据
+
+  // 页码变化
+  const paginationChange = useCallback(
+    () => (pageNum: number, pageSize: number) => {
+      pageNumRef.current = pageNum;
+      pagePageRef.current = pageSize;
+      setTableSelect({ ...tableSelect, pageNum, pageSize });
+    },
+    [tableSelect]
+  );
+
+  // 切换表格中的启用停用状态
+  const isEnabledClickFu = useCallback(
+    async (val: boolean, id: number) => {
+      const isDisable = val ? 1 : 0;
+      const res: any = await goodsDisplayAPI(id, isDisable);
+      if (res.code === 0) getList();
+    },
+    [getList]
+  );
+
+  // 点击编辑
+  const openEditPageFu = useCallback((id: number) => {
+    console.log("点击了编辑", id);
+  }, []);
+
+  // 点击删除
+  const delTableFu = useCallback(
+    async (id: number) => {
+      const res: any = await goodsRemoveAPI(id);
+      if (res.code === 0) {
+        MessageFu.success("删除成功!");
+        getList();
+      }
+    },
+    [getList]
+  );
+
+  const columns = useMemo(() => {
+    return [
+      // {
+      //   width: 80,
+      //   title: "序号",
+      //   render: (text: any, record: any, index: any) =>
+      //     index + 1 + (pageNumRef.current - 1) * pagePageRef.current,
+      // },
+      {
+        title: "名称",
+        dataIndex: "name",
+      },
+      {
+        title: "登记编号",
+        render:(item:any)=>(item.num?item.num:'(空)')
+      },
+      {
+        title: "类别",
+        dataIndex: "dictTexture",
+      },
+      {
+        title: "年代",
+        dataIndex: "dictAge",
+      },
+      {
+        title: "级别",
+        dataIndex: "dictLevel",
+      },
+      {
+        title: "来源",
+        dataIndex: "dictSource",
+      },
+      {
+        title: "简介",
+        render: (item: any) =>
+          item.description ? (
+            item.description.length >= 20 ? (
+              <span style={{ cursor: "pointer" }} title={item.description}>
+                {item.description.substring(0, 20) + "..."}
+              </span>
+            ) : (
+              item.description
+            )
+          ) : (
+            "(空)"
+          ),
+      },
+      {
+        title: "封面图",
+        render: (item: any) => (
+          <div className="tableImgAuto">
+            <ImageLazy width={60} height={60} src={item.thumb!} />
+          </div>
+        ),
+      },
+      // {
+      //   title: "类型",
+      //   render: (item: any) => typeChangeObj[item.type!],
+      // },
+      {
+        title: "最近编辑时间",
+        dataIndex: "updateTime",
+      },
+      {
+        title: "展示状态",
+        render: (item: any) => (
+          <Switch
+            checkedChildren="启用"
+            unCheckedChildren="停用"
+            checked={item.display === 1}
+            onChange={(val) => isEnabledClickFu(val, item.id!)}
+          />
+        ),
+      },
+      {
+        title: "万物墙主题",
+        render: (item: any) => (item.topic === 1 ? "珍品" : "精品"),
+      },
+      {
+        title: "操作",
+        render: (item: any) => (
+          <>
+            <Button
+              size="small"
+              type="text"
+              onClick={() => openEditPageFu(item.id!)}
+            >
+              编辑
+            </Button>
+            <Popconfirm
+              title="删除后无法恢复,是否删除?"
+              okText="删除"
+              cancelText="取消"
+              onConfirm={() => delTableFu(item.id!)}
+            >
+              <Button size="small" type="text" danger>
+                删除
+              </Button>
+            </Popconfirm>
+          </>
+        ),
+      },
+    ];
+  }, [delTableFu, isEnabledClickFu, openEditPageFu]);
+
   return (
     <div className={styles.Goods}>
-      <h1>Goods</h1>
+      <div className="pageTitlt">馆藏管理</div>
+      {/* 搜索信息 */}
+      <div className="searchBox">
+        <div className="searchRow">
+          <span>名称:</span>
+          <Input
+            key={inputKey}
+            maxLength={10}
+            style={{ width: 150 }}
+            placeholder="请输入"
+            allowClear
+            onChange={(e) => nameChange(e)}
+          />
+        </div>
+
+        <div className="searchRow">
+          <span>登记编号:</span>
+          <Input
+            key={inputKey}
+            maxLength={20}
+            style={{ width: 150 }}
+            placeholder="请输入"
+            allowClear
+            onChange={(e) => numChange(e)}
+          />
+        </div>
+
+        <div className="searchRow">
+          <span>类别:</span>
+          <Select
+            placeholder="请选择"
+            style={{ width: 160 }}
+            value={tableSelect.dictTexture}
+            onChange={(e) =>
+              setTableSelect({ ...tableSelect, dictTexture: e, pageNum: 1 })
+            }
+            options={dictList["texture"]}
+          />
+        </div>
+
+        <div className="searchRow">
+          <span>年代:</span>
+          <Select
+            placeholder="请选择"
+            style={{ width: 150 }}
+            value={tableSelect.dictAge}
+            onChange={(e) =>
+              setTableSelect({ ...tableSelect, dictAge: e, pageNum: 1 })
+            }
+            options={dictList["age"]}
+          />
+        </div>
+        <div className="searchRow">
+          <span>级别:</span>
+          <Select
+            placeholder="请选择"
+            style={{ width: 135 }}
+            value={tableSelect.dictLevel}
+            onChange={(e) =>
+              setTableSelect({ ...tableSelect, dictLevel: e, pageNum: 1 })
+            }
+            options={dictList["level"]}
+          />
+        </div>
+        <div className="searchRow">
+          <span>来源:</span>
+          <Select
+            placeholder="请选择"
+            style={{ width: 135 }}
+            value={tableSelect.dictSource}
+            onChange={(e) =>
+              setTableSelect({ ...tableSelect, dictSource: e, pageNum: 1 })
+            }
+            options={dictList["source"]}
+          />
+        </div>
+
+        <div className="searchRow">
+          <span>最近编辑日期:</span>
+          <RangePicker
+            style={{ width: 240 }}
+            key={inputKey}
+            onChange={timeChange}
+          />
+        </div>
+
+        <div className="searchRow">
+          <span>万物墙:</span>
+          <Select
+            placeholder="请选择"
+            style={{ width: 100 }}
+            value={tableSelect.topic}
+            onChange={(e) =>
+              setTableSelect({ ...tableSelect, topic: e, pageNum: 1 })
+            }
+            options={[
+              { value: -1, label: "全部" },
+              { value: 1, label: "战争" },
+              { value: 2, label: "生活" },
+              { value: 3, label: "不展示" },
+            ]}
+          />
+        </div>
+
+        <div className="searchRow">
+          <span>展示状态:</span>
+          <Select
+            placeholder="请选择"
+            style={{ width: 100 }}
+            value={tableSelect.display}
+            onChange={(e) =>
+              setTableSelect({ ...tableSelect, display: e, pageNum: 1 })
+            }
+            options={[
+              { value: -1, label: "全部" },
+              { value: 1, label: "开启" },
+              { value: 0, label: "关闭" },
+            ]}
+          />
+        </div>
+
+        <div className="searchRow">
+          <span>弹幕留言:</span>
+          <Select
+            placeholder="请选择"
+            style={{ width: 100 }}
+            value={tableSelect.aaaaa}
+            onChange={(e) =>
+              setTableSelect({ ...tableSelect, aaaaa: e, pageNum: 1 })
+            }
+            options={[
+              { value: -1, label: "全部" },
+              { value: 1, label: "开启" },
+              { value: 0, label: "关闭" },
+            ]}
+          />
+        </div>
+
+        <div className="searchRow">
+          <Button onClick={resetSelectFu}>重置</Button>&emsp;
+          <Button onClick={deriveFu}>批量导出</Button>&emsp;
+          <Button>弹幕设置</Button>&emsp;
+          <Button type="primary">新增</Button>
+        </div>
+      </div>
+      {/* 表格主体 */}
+      <div className="tableBox">
+        <Table
+          scroll={{ y: 560 }}
+          dataSource={tableInfo.list}
+          columns={columns}
+          rowKey="id"
+          pagination={{
+            showQuickJumper: true,
+            position: ["bottomCenter"],
+            showSizeChanger: true,
+            current: tableSelect.pageNum,
+            pageSize: tableSelect.pageSize,
+            total: tableInfo.total,
+            onChange: paginationChange(),
+          }}
+        />
+      </div>
     </div>
-  )
+  );
 }
 
 const MemoGoods = React.memo(Goods);

+ 1 - 1
houtai/src/pages/C3Log/index.tsx

@@ -1,5 +1,5 @@
 import { RootState } from "@/store";
-import { getLogListAPI } from "@/store/action/log";
+import { getLogListAPI } from "@/store/action/C3log";
 import { Input, DatePicker, Table } from "antd";
 import React, { useEffect, useMemo, useRef, useState } from "react";
 import { useDispatch, useSelector } from "react-redux";

+ 1 - 1
houtai/src/pages/Layout/index.module.scss

@@ -115,7 +115,7 @@
         background-color: #f5f4ed;
         height: 60px;
         display: flex;
-        justify-content: space-between;
+        justify-content: flex-end;
         position: relative;
         z-index: 20;
 

+ 0 - 12
houtai/src/pages/Layout/index.tsx

@@ -192,17 +192,6 @@ function Layout() {
     setPath(pathTemp);
   }, [location]);
 
-  // 页面title信息文字
-  const pageTitlt = useMemo(() => {
-    let txt = "";
-    list.forEach((v1) => {
-      v1.son.forEach((v2) => {
-        if (v2.path === path) txt = v2.name;
-      });
-    });
-    return txt;
-  }, [list, path]);
-
   // 第一级菜单选中高亮
   const row1ActiveFu = useCallback(
     (title: string) => {
@@ -296,7 +285,6 @@ function Layout() {
       {/* 右边 */}
       <div className="layoutRight">
         <div className="layoutRightTop">
-          <div className="pageTitlt">{pageTitlt}</div>
           {/* 用户相关 */}
           <div className="user">
             {userInfo.realName}

+ 37 - 0
houtai/src/store/action/B2Goods.ts

@@ -0,0 +1,37 @@
+import http from "@/utils/http";
+import { AppDispatch } from "..";
+/**
+ * 获取列表数据
+ */
+export const getGoodsListAPI = (data: any) => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.post("cms/goods/pageList", data);
+    dispatch({
+      type: "goods/getList",
+      payload: { list: res.data.records, total: res.data.total },
+    });
+  };
+};
+
+/**
+ * 点击导出的列表数据
+ */
+export const getGoodsListDeriveAPI = (data: any) => {
+  return http.post("cms/goods/pageList", data);
+};
+
+
+/**
+ * 内容-是否显示
+ */
+export const goodsDisplayAPI = (id: number, display: number) => {
+  return http.get(`cms/goods/display/${id}/${display}`);
+};
+
+
+/**
+ * 删除藏品
+ */
+export const goodsRemoveAPI = (id: number) => {
+  return http.get(`cms/goods/remove/${id}`);
+};

+ 1 - 1
houtai/src/store/action/log.ts

@@ -1,7 +1,7 @@
 import http from "@/utils/http";
 import { AppDispatch } from "..";
 /**
- * 获取用户管理表格列表
+ * 获取日志表格列表
  */
 export const getLogListAPI = (data: any) => {
   return async (dispatch: AppDispatch) => {

+ 29 - 0
houtai/src/store/reducer/B2Goods.ts

@@ -0,0 +1,29 @@
+
+// 初始化状态
+const initState = {
+  // 列表数据
+  tableInfo: {
+    list: [] as any[],
+    total: 0,
+  },
+};
+
+// 定义 action 类型
+type GoodsActionType = {
+  type: "goods/getList";
+  payload: { list: any[]; total: number };
+};
+
+// 频道 reducer
+export default function goodsReducer(
+  state = initState,
+  action: GoodsActionType
+) {
+  switch (action.type) {
+    // 获取列表数据
+    case "goods/getList":
+      return { ...state, tableInfo: action.payload };
+    default:
+      return state;
+  }
+}

houtai/src/store/reducer/log.ts → houtai/src/store/reducer/C3log.ts


+ 3 - 1
houtai/src/store/reducer/index.ts

@@ -1,6 +1,7 @@
 // 导入合并reducer的依赖
 import { combineReducers } from 'redux'
-import logReducer from './log'
+import goodsReducer from './B2Goods'
+import logReducer from './C3log'
 
 // 导入 登录 模块的 reducer
 import loginReducer from './login'
@@ -9,6 +10,7 @@ import loginReducer from './login'
 const rootReducer = combineReducers({
   loginStore: loginReducer,
   logReducer:logReducer,
+  goodsReducer:goodsReducer
 })
 
 // 默认导出

+ 1 - 0
houtai/src/types/declaration.d.ts

@@ -1,5 +1,6 @@
 declare module "history";
 declare module "*.scss";
 declare module "*.png";
+declare module "*.jpg";
 declare module "*.gif";
 declare module "js-export-excel";