shaogen1995 hace 2 años
padre
commit
cfd87e213d

+ 38 - 108
houtai/src/pages/A1Hot/index.tsx

@@ -16,6 +16,7 @@ import {
   getHotGoodsAPI,
   getHotModuleAPI,
 } from "@/store/action/A1Hot";
+import { HotData1Type, HotSelectTimeType, HotSelectType } from "@/types";
 
 echarts.use([
   ToolboxComponent,
@@ -28,16 +29,16 @@ echarts.use([
 
 function Hot() {
   // 日期下拉框
-  const [select1, setSelect1] = useState<1 | 7 | 30 | "">(7);
-  const select1Ref = useRef<1 | 7 | 30 | "">(7);
+  const [select1, setSelect1] = useState<HotSelectTimeType>(7);
+  const select1Ref = useRef<HotSelectTimeType>(7);
 
   // 热门场馆下拉
-  const [select2, setSelect2] = useState<"visit" | "star" | "">("visit");
-  const select2Ref = useRef<"visit" | "star" | "">("");
+  const [select2, setSelect2] = useState<HotSelectType>("visit");
+  const select2Ref = useRef<HotSelectType>("");
 
   // 热门馆藏下拉
-  const [select3, setSelect3] = useState<"visit" | "star" | "">("visit");
-  const select3Ref = useRef<"visit" | "star" | "">("");
+  const [select3, setSelect3] = useState<HotSelectType>("visit");
+  const select3Ref = useRef<HotSelectType>("");
 
   // 获取饼图的函数
   const getEchartsFu = useCallback(
@@ -110,7 +111,7 @@ function Hot() {
   // 时间改变的时候 获取3个数据
   const getInfoAPIFu1 = useCallback(async () => {
     const res1 = await getHotModuleAPI(select1Ref.current);
-    const data1 = res1.data.map((v: any) => {
+    const data1 = res1.data.map((v: HotData1Type) => {
       return {
         value: v.pcs,
         name: v.groupKey,
@@ -131,23 +132,8 @@ function Hot() {
       select1Ref.current,
       select2Ref.current ? select2Ref.current : "visit"
     );
+    const data2: HotData1Type[] = res2.data;
 
-    console.log(res2);
-
-    const data2 = [
-      { id: 1, name: "撒大苏打撒旦", num: 550 },
-      {
-        id: 2,
-        name: "撒大苏打撒旦撒大苏打撒旦sadas撒大苏打撒旦撒大苏打撒旦sadas撒大苏打撒旦撒大苏打撒旦sadas",
-        num: 550,
-      },
-      { id: 3, name: "撒大苏打撒旦", num: 550 },
-      { id: 4, name: "撒大苏打撒旦", num: 550 },
-      { id: 5, name: "撒大苏打撒旦", num: 550 },
-      { id: 6, name: "撒大", num: 550 },
-      { id: 7, name: "撒大苏打撒旦", num: 550 },
-      { id: 8, name: "撒大苏打撒旦", num: 550 },
-    ];
     setList1(data2);
 
     // ---------------
@@ -162,33 +148,8 @@ function Hot() {
       select1Ref.current,
       select2Ref.current ? select2Ref.current : "visit"
     );
+    const data3: HotData1Type[] = res3.data;
 
-    console.log(res3);
-
-    const data3 = [
-      { id: 1, name: "撒大苏打撒旦", num: 550 },
-      {
-        id: 2,
-        name: "撒大苏打撒旦撒大打撒旦撒大苏打撒旦sadas",
-        num: 550,
-      },
-      { id: 3, name: "撒大苏打撒旦", num: 550 },
-      { id: 4, name: "撒大苏打撒旦", num: 550 },
-      { id: 5, name: "撒大苏打撒旦", num: 550 },
-      { id: 6, name: "撒大", num: 550 },
-      { id: 7, name: "撒大苏打撒旦", num: 550 },
-      { id: 8, name: "撒大苏打撒旦", num: 550 },
-      { id: 9, name: "撒大苏打撒旦", num: 550 },
-      {
-        id: 10,
-        name: "撒大苏打撒旦撒大打撒旦撒大苏打撒旦sadas",
-        num: 550,
-      },
-      { id: 11, name: "撒大苏打撒旦", num: 550 },
-      { id: 12, name: "撒大苏打撒旦", num: 550 },
-      { id: 13, name: "撒大苏打撒旦", num: 550 },
-      { id: 14, name: "撒大", num: 550 },
-    ];
     setList2(data3);
 
     // 每次变化馆藏盒子滚动到顶部
@@ -197,62 +158,31 @@ function Hot() {
   }, [getEchartsFu]);
 
   // 获取热门场馆数据
-  const [list1, setList1] = useState([
-    { id: 1, name: "撒大苏打撒旦", num: 550 },
-  ]);
-
-  const getInfoAPIFu2 = useCallback(() => {
-    console.log("2获取场馆数据", select1Ref.current, select2Ref.current);
-
-    const data = [
-      { id: 1, name: "撒大苏打撒旦", num: 550 },
-      {
-        id: 2,
-        name: "撒大苏打撒旦撒大苏打撒旦sadas撒大苏打撒旦撒大苏打撒旦sadas撒大苏打撒旦撒大苏打撒旦sadas",
-        num: 550,
-      },
-      { id: 3, name: "撒大苏打撒旦", num: 550 },
-      { id: 4, name: "撒大苏打撒旦", num: 550 },
-      { id: 5, name: "撒大苏打撒旦", num: 550 },
-      { id: 6, name: "撒大", num: 550 },
-      { id: 7, name: "撒大苏打撒旦", num: 550 },
-      { id: 8, name: "撒大苏打撒旦", num: 550 },
-    ];
+  const [list1, setList1] = useState<HotData1Type[]>([]);
+
+  const getInfoAPIFu2 = useCallback(async () => {
+    // console.log("2获取场馆数据", select1Ref.current, select2Ref.current);
+    const res = await getHotExhibitionAPI(
+      select1Ref.current,
+      select2Ref.current ? select2Ref.current : "visit"
+    );
+    const data: HotData1Type[] = res.data;
+
     setList1(data);
   }, []);
 
   // 获取馆藏数据
 
-  const [list2, setList2] = useState([
-    { id: 1, name: "撒大苏打撒旦", num: 550 },
-  ]);
-
-  const getInfoAPIFu3 = useCallback(() => {
-    console.log("3获取馆藏数据", select1Ref.current, select3Ref.current);
-    const data = [
-      { id: 1, name: "撒大苏打撒旦", num: 550 },
-      {
-        id: 2,
-        name: "撒大苏打撒旦撒大打撒旦撒大苏打撒旦sadas",
-        num: 550,
-      },
-      { id: 3, name: "撒大苏打撒旦", num: 550 },
-      { id: 4, name: "撒大苏打撒旦", num: 550 },
-      { id: 5, name: "撒大苏打撒旦", num: 550 },
-      { id: 6, name: "撒大", num: 550 },
-      { id: 7, name: "撒大苏打撒旦", num: 550 },
-      { id: 8, name: "撒大苏打撒旦", num: 550 },
-      { id: 9, name: "撒大苏打撒旦", num: 550 },
-      {
-        id: 10,
-        name: "撒大苏打撒旦撒大打撒旦撒大苏打撒旦sadas",
-        num: 550,
-      },
-      { id: 11, name: "撒大苏打撒旦", num: 550 },
-      { id: 12, name: "撒大苏打撒旦", num: 550 },
-      { id: 13, name: "撒大苏打撒旦", num: 550 },
-      { id: 14, name: "撒大", num: 550 },
-    ];
+  const [list2, setList2] = useState<HotData1Type[]>([]);
+
+  const getInfoAPIFu3 = useCallback(async () => {
+    // console.log("3获取馆藏数据", select1Ref.current, select3Ref.current);
+    const res = await getHotGoodsAPI(
+      select1Ref.current,
+      select2Ref.current ? select2Ref.current : "visit"
+    );
+    const data: HotData1Type[] = res.data;
+
     setList2(data);
   }, []);
 
@@ -329,11 +259,11 @@ function Hot() {
             {/* 场馆数据 */}
             <div className="hotListBox">
               {list1.map((v) => (
-                <div className="row" key={v.id}>
-                  <div className="rowLeft" title={v.name}>
-                    {v.name}
+                <div className="row" key={v.groupKey}>
+                  <div className="rowLeft" title={v.groupKey}>
+                    {v.groupKey}
                   </div>
-                  <div className="rowRight">{v.num}</div>
+                  <div className="rowRight">{v.pcs}</div>
                 </div>
               ))}
             </div>
@@ -357,11 +287,11 @@ function Hot() {
             <div className="hotListBox mySorrl" id="goodsSroolBox">
               {list2.length ? (
                 list2.slice(0, 20).map((v) => (
-                  <div className="row" key={v.id}>
-                    <div className="rowLeft" title={v.name}>
-                      {v.name}
+                  <div className="row" key={v.groupKey}>
+                    <div className="rowLeft" title={v.groupKey}>
+                      {v.groupKey}
                     </div>
-                    <div className="rowRight">{v.num}</div>
+                    <div className="rowRight">{v.pcs}</div>
                   </div>
                 ))
               ) : (

+ 38 - 12
houtai/src/pages/A2News/NewsAdd/index.tsx

@@ -1,7 +1,19 @@
-import { newSaveAPI, newsUploadAPI } from "@/store/action/A2News";
+import {
+  getNewsDetailAPI,
+  newSaveAPI,
+  newsUploadAPI,
+} from "@/store/action/A2News";
 import { domShowFu, progressDomFu } from "@/utils/domShow";
 import { MessageFu } from "@/utils/message";
-import { Button, DatePicker, Form, Input, Popconfirm, Select } from "antd";
+import {
+  Button,
+  DatePicker,
+  Form,
+  FormInstance,
+  Input,
+  Popconfirm,
+  Select,
+} from "antd";
 import TextArea from "antd/es/input/TextArea";
 import dayjs from "dayjs";
 import React, {
@@ -22,11 +34,11 @@ import {
 import ImageLazy from "@/components/ImageLazy";
 import classNames from "classnames";
 import store from "@/store";
-import { ImgListType } from "@/types";
+import { ImgListType, NewsSaveApiType } from "@/types";
 
 type Props = {
   id: number;
-  tableType: string;
+  tableType: "news" | "video" | "img";
   closePageFu: () => void;
   editTableFu: () => void;
   addTableFu: () => void;
@@ -40,18 +52,31 @@ function NewsAdd({
   tableType,
 }: Props) {
   // 设置表单初始数据(区分编辑和新增)
-  const FormBoxRef = useRef<any>({});
+  const FormBoxRef = useRef<FormInstance>(null);
 
   // 通过id获取详情,回显数据
-  const getInfoFu = useCallback((id: number) => {
-    // setDirCode(res.data.entity.dirCode);
-  }, []);
+  const getInfoFu = useCallback(
+    async (id: number) => {
+      const res = await getNewsDetailAPI(id);
+      const data = res.data.entity;
+      const fileList = res.data.file;
+      setDirCode(data.dirCode);
+
+      FormBoxRef.current?.setFieldsValue({
+        ...data,
+        newsDay: dayjs(data.newsDay, "YYYY-MM-DD"),
+      });
+      if (tableType === "news") setImgList(fileList);
+      else setFileOne(fileList[0]);
+    },
+    [tableType]
+  );
 
   useEffect(() => {
     if (id > 0) getInfoFu(id);
     else {
       setDirCode(Date.now() + "");
-      FormBoxRef.current.setFieldsValue({
+      FormBoxRef.current?.setFieldsValue({
         display: 1,
         // 默认新闻日期为当天
         newsDay:
@@ -123,7 +148,7 @@ function NewsAdd({
 
         e.target.value = "";
 
-        const res: any = await newsUploadAPI(fd);
+        const res = await newsUploadAPI(fd);
 
         if (res.code === 0) {
           MessageFu.success("上传成功!");
@@ -180,14 +205,14 @@ function NewsAdd({
 
   // 通过校验点击确定
   const onFinish = useCallback(
-    async (values: any) => {
+    async (values: NewsSaveApiType) => {
       setTypeOk(true);
 
       if (fileCheckFu) return;
 
       let thumb = "";
       if (tableType === "news") thumb = imgList[0].filePath;
-      else if (tableType === "img") thumb = fileOne.filePath;
+      else thumb = fileOne.filePath;
       const obj = {
         ...values,
         id: id > 0 ? id : null,
@@ -206,6 +231,7 @@ function NewsAdd({
       if (res.code === 0) {
         if (id > 0) editTableFu();
         else addTableFu();
+        MessageFu.success(id > 0 ? "编辑成功!" : "新增成功!");
         closePageFu();
       }
     },

+ 40 - 15
houtai/src/pages/A2News/NewsTable/index.tsx

@@ -2,7 +2,7 @@ import ImageLazy from "@/components/ImageLazy";
 import VideoLook from "@/components/VideoLook";
 import { RootState } from "@/store";
 import { NewsTableType } from "@/types";
-import { Button, Table, Tooltip } from "antd";
+import { Button, Popconfirm, Table, Tooltip } from "antd";
 import React, { useCallback, useEffect, useMemo, useRef } from "react";
 import { useSelector } from "react-redux";
 import { ExclamationOutlined } from "@ant-design/icons";
@@ -11,13 +11,16 @@ import styles from "./index.module.scss";
 // 表格拖动排序-----------------
 import { DndProvider, useDrag, useDrop } from "react-dnd";
 import { HTML5Backend } from "react-dnd-html5-backend";
+import { newRemoveAPI } from "@/store/action/A2News";
+import { MessageFu } from "@/utils/message";
 
 type Porps = {
   tableType: string;
   editInfoFu: (id: number) => void;
+  delInfoFu: () => void;
 };
 
-function NewsTable({ tableType, editInfoFu }: Porps) {
+function NewsTable({ tableType, editInfoFu, delInfoFu }: Porps) {
   // 有关表格数据
   const { tableInfo: results, sroolNum } = useSelector(
     (state: RootState) => state.newsReducer
@@ -30,6 +33,18 @@ function NewsTable({ tableType, editInfoFu }: Porps) {
     }
   }, [sroolNum]);
 
+  // 点击删除
+  const delTableFu = useCallback(
+    async (id: number) => {
+      const res = await newRemoveAPI(id);
+      if (res.code === 0) {
+        MessageFu.success("删除成功!");
+        delInfoFu();
+      }
+    },
+    [delInfoFu]
+  );
+
   const columns = useMemo(() => {
     return [
       {
@@ -50,7 +65,7 @@ function NewsTable({ tableType, editInfoFu }: Porps) {
       },
       {
         title: "标题",
-        dataIndex: "title",
+        dataIndex: "name",
       },
       {
         title:
@@ -61,23 +76,25 @@ function NewsTable({ tableType, editInfoFu }: Porps) {
             : "图片",
         render: (item: NewsTableType) => {
           if (tableType === "news") {
-            return item.txt.length > 35 ? (
-              <span style={{ cursor: "pointer" }} title={item.txt}>
-                {item.txt.substring(0, 35) + "..."}
+            return item.description.length > 35 ? (
+              <span style={{ cursor: "pointer" }} title={item.description}>
+                {item.description.substring(0, 35) + "..."}
               </span>
             ) : (
-              item.txt
+              item.description
             );
           } else if (tableType === "video") {
             return (
               <div className="tableImgAuto">
-                <VideoLook src={item.video} width={60} height={60} />
+                <VideoLook src={item.thumb} width={60} height={60} />
               </div>
             );
           } else {
             return (
               <div className="tableImgAuto">
-                <ImageLazy width={60} height={60} src={item.img} />
+                {item.thumb ? (
+                  <ImageLazy width={60} height={60} src={item.thumb} />
+                ) : null}
               </div>
             );
           }
@@ -85,11 +102,12 @@ function NewsTable({ tableType, editInfoFu }: Porps) {
       },
       {
         title: "最近编辑时间",
-        dataIndex: "time1",
+        dataIndex: "updateTime",
       },
       {
         title: "展示状态",
-        render: (item: NewsTableType) => item.state,
+        render: (item: NewsTableType) =>
+          item.display === 1 ? "展示" : "不展示",
       },
       {
         title: "操作",
@@ -102,14 +120,21 @@ function NewsTable({ tableType, editInfoFu }: Porps) {
             >
               编辑
             </Button>
-            <Button size="small" type="text" danger>
-              删除
-            </Button>
+            <Popconfirm
+              title="删除后无法恢复,是否删除?"
+              okText="删除"
+              cancelText="取消"
+              onConfirm={() => delTableFu(item.id!)}
+            >
+              <Button size="small" type="text" danger>
+                删除
+              </Button>
+            </Popconfirm>
           </>
         ),
       },
     ];
-  }, [editInfoFu, results.length, tableType]);
+  }, [delTableFu, editInfoFu, results.length, tableType]);
 
   // 表格拖动排序-----------------
   interface DraggableBodyRowProps

+ 22 - 11
houtai/src/pages/A2News/index.tsx

@@ -1,4 +1,6 @@
 import store, { RootState } from "@/store";
+import { getNewsListAPI } from "@/store/action/A2News";
+import { NewsButtonType, NewsTableApiType } from "@/types";
 import { MessageFu } from "@/utils/message";
 import { Button, Input, Select } from "antd";
 import React, {
@@ -8,21 +10,23 @@ import React, {
   useRef,
   useState,
 } from "react";
-import { useSelector } from "react-redux";
+import { useDispatch, useSelector } from "react-redux";
 import styles from "./index.module.scss";
 import NewsAdd from "./NewsAdd";
 import NewsTable from "./NewsTable";
 function News() {
+  const dispatch = useDispatch();
+
   // 顶部筛选的数据
-  const [tableSelect, setTableSelect] = useState({
+  const [tableSelect, setTableSelect] = useState<NewsTableApiType>({
     type: "news",
-    name: "",
+    searchKey: "",
     display: -1,
     pageSize: 50,
     pageNum: 1,
   });
 
-  const buttonData = useMemo(() => {
+  const buttonData = useMemo<NewsButtonType[]>(() => {
     return [
       { id: 1, name: "新闻", type: "news" },
       { id: 2, name: "视频", type: "video" },
@@ -30,13 +34,17 @@ function News() {
     ];
   }, []);
 
-  useEffect(() => {
+  const getTableInfoFu = useCallback(() => {
     const obj = {
       ...tableSelect,
       display: tableSelect.display === -1 ? null : tableSelect.display,
     };
-    console.log("发送请求", obj);
-  }, [tableSelect]);
+    dispatch(getNewsListAPI(obj));
+  }, [dispatch, tableSelect]);
+
+  useEffect(() => {
+    getTableInfoFu();
+  }, [getTableInfoFu]);
 
   // 名称的输入
   const nameTime = useRef(-1);
@@ -46,7 +54,7 @@ function News() {
       nameTime.current = window.setTimeout(() => {
         setTableSelect({
           ...tableSelect,
-          name: e.target.value,
+          searchKey: e.target.value,
           pageNum: 1,
         });
       }, 500);
@@ -64,7 +72,7 @@ function News() {
     setInputKey(Date.now());
     setTableSelect({
       type: tableSelect.type,
-      name: "",
+      searchKey: "",
       display: -1,
       pageSize: 50,
       pageNum: 1,
@@ -85,7 +93,9 @@ function News() {
       if (id === -1 && results.length >= 50)
         return MessageFu.warning("最多可录入50条信息!");
 
-      const dom: any = document.querySelector("#NewsTable .ant-table-body");
+      const dom: HTMLDivElement = document.querySelector(
+        "#NewsTable .ant-table-body"
+      )!;
       // 设置当前表格滚动位置
       store.dispatch({ type: "news/setSroolNum", payload: dom.scrollTop });
 
@@ -152,13 +162,14 @@ function News() {
           id={editId}
           tableType={tableSelect.type}
           closePageFu={() => setEditId(0)}
-          editTableFu={() => console.log("编辑完成")}
+          editTableFu={getTableInfoFu}
           addTableFu={resetSelectFu}
         />
       ) : (
         <NewsTable
           tableType={tableSelect.type}
           editInfoFu={(id) => addInfoFu(id)}
+          delInfoFu={getTableInfoFu}
         />
       )}
     </div>

+ 0 - 11
houtai/src/pages/A3Goods/index.tsx

@@ -18,8 +18,6 @@ import GoodsAdd from "./GoodsAdd";
 const { RangePicker } = DatePicker;
 function Goods() {
   const dispatch = useDispatch();
-  const pageNumRef = useRef(1);
-  const pagePageRef = useRef(10);
 
   // 从仓库获取下拉列表数据
   const dictList = useSelector(
@@ -49,17 +47,10 @@ function Goods() {
     const data = {
       ...tableSelect,
       display: tableSelect.display === -1 ? null : tableSelect.display,
-      pageNum: pageNumRef.current,
     };
     dispatch(getGoodsListAPI(data));
   }, [dispatch, tableSelect]);
 
-  // 当前页码统一
-  useEffect(() => {
-    pageNumRef.current = tableSelect.pageNum;
-    pagePageRef.current = tableSelect.pageSize;
-  }, [tableSelect.pageNum, tableSelect.pageSize]);
-
   useEffect(() => {
     getList();
   }, [getList]);
@@ -113,8 +104,6 @@ function Goods() {
   // 页码变化
   const paginationChange = useCallback(
     () => (pageNum: number, pageSize: number) => {
-      pageNumRef.current = pageNum;
-      pagePageRef.current = pageSize;
       setTableSelect({ ...tableSelect, pageNum, pageSize });
     },
     [tableSelect]

+ 7 - 8
houtai/src/store/action/A1Hot.ts

@@ -1,9 +1,10 @@
+import { HotSelectTimeType, HotSelectType } from "@/types";
 import http from "@/utils/http";
 
 /**
  * 统计热门板块
  */
-export const getHotModuleAPI = (dayScope: 1 | 7 | 30 | "") => {
+export const getHotModuleAPI = (dayScope: HotSelectTimeType) => {
   return http.get(`cms/report/ranking/module?dayScope=${dayScope}`);
 };
 
@@ -11,8 +12,8 @@ export const getHotModuleAPI = (dayScope: 1 | 7 | 30 | "") => {
  * 统计-热门场馆
  */
 export const getHotExhibitionAPI = (
-  dayScope: 1 | 7 | 30 | "",
-  type: "visit" | "star" | ""
+  dayScope: HotSelectTimeType,
+  type: HotSelectType
 ) => {
   return http.get(
     `cms/report/ranking/exhibition?dayScope=${dayScope}&type=${type}`
@@ -23,10 +24,8 @@ export const getHotExhibitionAPI = (
  * 统计-热门场馆
  */
 export const getHotGoodsAPI = (
-  dayScope: 1 | 7 | 30 | "",
-  type: "visit" | "star" | ""
+  dayScope: HotSelectTimeType,
+  type: HotSelectType
 ) => {
-  return http.get(
-    `cms/report/ranking/goods?dayScope=${dayScope}&type=${type}`
-  );
+  return http.get(`cms/report/ranking/goods?dayScope=${dayScope}&type=${type}`);
 };

+ 30 - 2
houtai/src/store/action/A2News.ts

@@ -1,7 +1,8 @@
+import { NewsSaveApiType, NewsTableApiType } from "@/types";
 import { domShowFu, progressDomFu } from "@/utils/domShow";
 import http from "@/utils/http";
 import axios from "axios";
-import store from "..";
+import store, { AppDispatch } from "..";
 
 const CancelToken = axios.CancelToken;
 /**
@@ -30,6 +31,33 @@ export const newsUploadAPI = (data: any) => {
 /**
  * 新增|编辑
  */
-export const newSaveAPI = (data: any) => {
+export const newSaveAPI = (data: NewsSaveApiType) => {
   return http.post("cms/news/save", data);
 };
+
+/**
+ * 获取列表数据
+ */
+export const getNewsListAPI = (data: NewsTableApiType) => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.post("cms/news/getList", data);
+    dispatch({
+      type: "news/getList",
+      payload: res.data,
+    });
+  };
+};
+
+/**
+ * 删除
+ */
+export const newRemoveAPI = (id:number) => {
+  return http.get(`cms/news/remove/${id}`);
+};
+
+/**
+ * 详情
+ */
+export const getNewsDetailAPI = (id:number) => {
+  return http.get(`cms/news/detail/${id}`);
+};

+ 1 - 74
houtai/src/store/reducer/A2News.ts

@@ -3,80 +3,7 @@ import { NewsTableType } from "@/types";
 // 初始化状态
 const initState = {
   // 表格数据
-  tableInfo: [
-    {
-      id: 1,
-      title: "标题1",
-      txt: "正文666666",
-      time1: "2020-02-02 12:12",
-      state: "展示",
-      img: "/wall/img/20230209_1519270201.gif",
-      video: "/wall/video/4.mp4",
-    },
-    {
-      id: 2,
-      title: "标题2",
-      txt: "正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文正文66",
-      time1: "2020-02-02 12:12",
-      state: "不展示",
-    },
-    {
-      id: 3,
-      title: "标题3",
-      txt: "正文666666",
-      time1: "2020-02-02 12:12",
-      state: "展示",
-    },
-    {
-      id: 4,
-      title: "标题4",
-      txt: "正文666666",
-      time1: "2020-02-02 12:12",
-      state: "展示",
-    },
-    {
-      id: 5,
-      title: "标题5",
-      txt: "正文666666",
-      time1: "2020-02-02 12:12",
-      state: "展示",
-    },
-    {
-      id: 6,
-      title: "标题6",
-      txt: "正文666666",
-      time1: "2020-02-02 12:12",
-      state: "展示",
-    },
-    {
-      id: 7,
-      title: "标题7",
-      txt: "正文666666",
-      time1: "2020-02-02 12:12",
-      state: "展示",
-    },
-    {
-      id: 8,
-      title: "标题8",
-      txt: "正文666666",
-      time1: "2020-02-02 12:12",
-      state: "展示",
-    },
-    {
-      id: 9,
-      title: "标题9",
-      txt: "正文666666",
-      time1: "2020-02-02 12:12",
-      state: "展示",
-    },
-    {
-      id: 10,
-      title: "标题10",
-      txt: "正文666666",
-      time1: "2020-02-02 12:12",
-      state: "展示",
-    },
-  ] as NewsTableType[],
+  tableInfo: [] as NewsTableType[],
 
   // 表格的滚动位置
   sroolNum: 0,

+ 8 - 5
houtai/src/types/api/A1Hot.d.ts

@@ -1,5 +1,8 @@
-export type HotInfoType ={
-	name: string;
-	value: number;
-  icon:'circle'
-}
+export type HotSelectType = "visit" | "star" | "";
+
+export type HotSelectTimeType = 1 | 7 | 30 | "";
+
+export type HotData1Type = {
+  pcs: number;
+  groupKey: string;
+};

+ 38 - 6
houtai/src/types/api/A2News.d.ts

@@ -1,9 +1,41 @@
 export type NewsTableType = {
+	createTime: string;
+	creatorId: number;
+	creatorName: string;
+	description: string;
+	dirCode: string;
+	display: number;
+	fileIds: string;
+	id: number;
+	name: string;
+	newsDay: string;
+	thumb: string;
+	type: string;
+	updateTime: string;
+}
+
+export type NewsSaveApiType = {
+  description?: string;
+  dirCode: string;
+  display: number;
+  fileIds: string;
+  id: number | null;
+  name: string;
+  newsDay: string;
+  thumb: string;
+  type: "news" | "video" | "img";
+};
+
+export type NewsTableApiType = {
+  type: "news" | "video" | "img";
+  searchKey: string;
+  display: number|null;
+  pageSize: number;
+  pageNum: number;
+};
+
+export type NewsButtonType = {
   id: number;
-  title: string;
-  txt: string;
-  time1: string;
-  state: string;
-  img:string
-  video:string
+  name: string;
+  type: "news" | "video" | "img";
 };