Quellcode durchsuchen

写不动了裤😭

shaogen1995 vor 2 Jahren
Ursprung
Commit
f3eddbd582

+ 4 - 0
src/assets/styles/base.css

@@ -148,6 +148,10 @@ textarea {
 #root .ant-table-cell {
   text-align: center !important;
 }
+#root .ant-table-body {
+  overflow-y: auto !important;
+  overflow-y: overlay !important;
+}
 #root #A2Table3 .ant-table-row-expand-icon {
   background-color: var(--themeColor);
   color: #fff;

+ 7 - 1
src/assets/styles/base.less

@@ -198,6 +198,12 @@ textarea {
     text-align: center !important;
   }
 
+  // 表格滚动条
+  .ant-table-body {
+    overflow-y: auto !important;
+    overflow-y: overlay !important;
+  }
+
 
   // 树型 表格 定制化
   #A2Table3 {
@@ -278,4 +284,4 @@ textarea {
 .globalTit{
   cursor: pointer;
   color: var(--themeColor);
-}
+}

+ 73 - 0
src/components/ZlistTable.tsx

@@ -0,0 +1,73 @@
+import React, { useEffect, useMemo } from "react";
+import { Table } from "antd";
+import { A2tableType } from "@/types";
+import { statusTxtObj, storageStatusTxtObj } from "@/pages/A2Goods/data";
+import ImageLazy from "./ImageLazy";
+
+type Props = {
+  list: A2tableType[];
+  btnDom: any;
+  y: number;
+};
+
+function ZlistTable({ btnDom, list, y }: Props) {
+  useEffect(() => {
+    const dom = document.querySelector(
+      "#ZlistTable .ant-table-body"
+    ) as HTMLDivElement;
+    if (dom) dom.style.height = y + "px";
+  }, [y]);
+
+  const columns = useMemo(() => {
+    let arr = [
+      {
+        title: "缩略图",
+        render: (item: A2tableType) => (
+          <div className="tableImgAuto">
+            <ImageLazy width={60} height={60} src={item.thumb} />
+          </div>
+        ),
+      },
+      {
+        title: "编号",
+        dataIndex: "num",
+      },
+      {
+        title: "名称",
+        dataIndex: "name",
+      },
+      {
+        title: "级别",
+        dataIndex: "dictLevel",
+      },
+      {
+        title: "藏品状态",
+        render: (item: A2tableType) =>
+          Reflect.get(statusTxtObj, item.status) || "-",
+      },
+      {
+        title: "库存状态",
+        render: (item: A2tableType) =>
+          Reflect.get(storageStatusTxtObj, item.storageStatus) || "-",
+      },
+    ] as any[];
+    arr.push(btnDom);
+    return arr;
+  }, [btnDom]);
+
+  return (
+    <Table
+      id="ZlistTable"
+      size="small"
+      scroll={{ y }}
+      dataSource={list}
+      columns={columns}
+      rowKey="id"
+      pagination={false}
+    />
+  );
+}
+
+const MemoZlistTable = React.memo(ZlistTable);
+
+export default MemoZlistTable;

+ 22 - 95
src/pages/A1Stat/index.module.scss

@@ -1,121 +1,48 @@
-.A1Stat{
-  :global{
-    .A1tit{
+.A1Stat {
+  :global {
+    .A1tit {
       font-size: 20px;
       font-weight: 700;
       position: absolute;
       top: 15px;
       left: 15px;
       z-index: 10;
-      &>span{
+
+      &>span {
         font-weight: 400;
         color: #999;
         font-size: 12px;
       }
     }
-    .A1box1{
-      width: 100%;
-      height: calc(48% - 20px);
-      background-color: #fff;
-      border-radius: 10px;
-      margin-bottom: 20px;
-      padding: 20px 15px 0;
-      position: relative;
-      #echarts1{
-        width: 100%;
-        height: 100%;
-        // background-color: red;
-      }
-    }
-    .A1box2{
-      height: 51%;
+
+    .A1box2 {
+      height: 100%;
       display: flex;
-      &>div{
+
+      &>div {
         background-color: #fff;
         border-radius: 10px;
         position: relative;
       }
-      .A1box2_1{
-        width: calc(45% - 20px);
+
+      .A1box2_1 {
+        width: calc(50% - 15px);
         padding: 40px 20px 0px;
-        margin-right: 20px;
-        #echarts2{
+        margin-right: 30px;
+
+        #echarts2 {
           width: 100%;
           height: 100%;
         }
       }
-      .A1box2_2{
-        width: 55%;
-        padding: 90px 20px 20px;
-        .A1box2_2Txt{
+
+      .A1box2_2 {
+        width: calc(50% - 15px);
+        padding: 40px 20px 0px;
+
+        #echarts3 {
           width: 100%;
           height: 100%;
-          display: flex;
-          .A1t2_1{
-            width: 32%;
-            margin-right: 20px;
-            height: 100%;
-            &>div{
-              box-shadow: 0px 0px 3px 3px #ccc;
-              border-radius: 6px;
-              height: 40%;
-              display: flex;
-              justify-content: space-around;
-              align-items: center;
-              font-size: 24px;
-              &>span{
-               color: var(--themeColor);
-              }
-              &:nth-of-type(1){
-                margin-bottom: 20px;
-              }
-            }
-          }
-          .A1t2_2{
-            width: calc(68% - 20px);
-            .A1t2_2_1{
-              width: 100%;
-              height: 40%;
-              margin-bottom: 20px;
-              display: flex;
-              &>div{
-                border-radius: 6px;
-                box-shadow: 0px 0px 3px 3px #ccc;
-                margin-right: 20px;
-                display: flex;
-                justify-content: space-around;
-                align-items: center;
-                font-size: 20px;
-                width: calc(50% - 10px);
-                &>span{
-                 color: var(--themeColor);
-                }
-                &:last-child{
-                  margin-right: 0;
-                }
-              }
-            }
-            .A1t2_2_2{
-              height: 40%;
-              display: flex;
-              &>div{
-                border-radius: 6px;
-                box-shadow: 0px 0px 3px 3px #ccc;
-                margin-right: 20px;
-                display: flex;
-                justify-content: space-around;
-                align-items: center;
-                font-size: 20px;
-                width: calc(24%);
-                &>span{
-                 color: var(--themeColor);
-                }
-                &:last-child{
-                  margin-right: 0;
-                }
-              }
-            }
-          }
         }
       }
     }

+ 82 - 147
src/pages/A1Stat/index.tsx

@@ -12,6 +12,8 @@ import {
 import { LineChart, PieChart } from "echarts/charts";
 import { UniversalTransition, LabelLayout } from "echarts/features";
 import { CanvasRenderer } from "echarts/renderers";
+import { A1_APIgetInfo1, A1_APIgetInfo2 } from "@/store/action/A1Stat";
+import { storageStatusTxtObj } from "../A2Goods/data";
 
 echarts.use([
   TitleComponent,
@@ -26,132 +28,98 @@ echarts.use([
   LabelLayout,
 ]);
 
+type EchDataType = { value: number; name: string }[];
+
 function A1Stat() {
-  const echartRef1 = useRef<HTMLDivElement>(null);
   const echartRef2 = useRef<HTMLDivElement>(null);
-  // 获取藏品统计数据
-  const getInfo1 = useCallback(async () => {
-    // const data =[]
-    const myChart = echarts.init(echartRef1.current);
-    const option = {
-      // color: ["#910000", "#E2CAA3"],
-      tooltip: {
-        trigger: "axis",
-      },
-      legend: {
-        data: ["已登记藏品", "已入库藏品"],
-        // top:'-10'
-      },
-      grid: {
-        left: "-24", //距左边边框的距离
-        right: "10", //距右边边框的距离
-        bottom: "10", //距下面边框的距离
-        top: "30", //距上面边框的距离
-        containLabel: true,
-      },
-      xAxis: {
-        type: "category",
-        splitLine: {
-          show: false, //隐藏背景刻度
-        },
-        boundaryGap: false,
-        data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
-        axisLine: {
-          show: false, //隐藏X轴
-        },
-        axisTick: {
-          show: false, //隐藏刻度线
-        },
-        axisLabel: {
-          show: false, //隐藏X轴文字
-        },
-      },
-      yAxis: {
-        type: "value",
-        splitLine: {
-          show: false, //隐藏背景刻度
-        },
-      },
-      series: [
-        {
-          name: "已登记藏品",
-          type: "line",
-          stack: "Total",
-          data: [120, 132, 101, 134, 90, 230, 210],
+  const echartRef3 = useRef<HTMLDivElement>(null);
+
+  // 生成饼图
+  const baseEchartFu = useCallback(
+    async (dom: HTMLDivElement, data: EchDataType) => {
+      const myChart = echarts.getInstanceByDom(dom) || echarts.init(dom);
+
+      const option = {
+        tooltip: {
+          trigger: "item",
         },
-        {
-          name: "已入库藏品",
-          type: "line",
-          stack: "Total",
-          data: [220, 182, 191, 234, 290, 330, 310],
+        legend: {
+          top: "5%",
+          left: "center",
         },
-      ],
-    };
-    option && myChart.setOption(option);
-  }, []);
-
-  // 获取藏品级别数据
-  const getInfo2 = useCallback(async () => {
-    const myChart = echarts.init(echartRef2.current);
-    const option = {
-      tooltip: {
-        trigger: "item",
-      },
-      legend: {
-        top: "5%",
-        left: "center",
-      },
-      series: [
-        {
-          name: "Access From",
-          type: "pie",
-          radius: ["40%", "70%"],
-          avoidLabelOverlap: false,
-          itemStyle: {
-            borderRadius: 10,
-            borderColor: "#fff",
-            borderWidth: 2,
-          },
-          label: {
-            show: false,
-            position: "center",
-          },
-          emphasis: {
+        series: [
+          {
+            type: "pie",
+            radius: ["50%", "70%"],
+            avoidLabelOverlap: false,
+            itemStyle: {
+              borderRadius: 10,
+              borderColor: "#fff",
+              borderWidth: 2,
+            },
             label: {
-              show: true,
-              fontSize: 40,
-              fontWeight: "bold",
+              show: false,
+              position: "center",
             },
+            emphasis: {
+              //  中间的字
+              // label: {
+              //   show: false,
+              //   fontSize: 40,
+              //   fontWeight: "bold",
+              // },
+            },
+            labelLine: {
+              show: false,
+            },
+            data,
           },
-          labelLine: {
-            show: false,
-          },
-          data: [
-            { value: 1048, name: "Search Engine" },
-            { value: 735, name: "Direct" },
-            { value: 580, name: "Email" },
-            { value: 484, name: "Union Ads" },
-            { value: 300, name: "Video Ads" },
-          ],
-        },
-      ],
-    };
-    option && myChart.setOption(option);
-  }, []);
+        ],
+      };
+      option && myChart.setOption(option);
+    },
+    []
+  );
+
+  // 获取藏品级别数据
+  const getInfoFu1 = useCallback(async () => {
+    const res = await A1_APIgetInfo1();
+    if (res.code === 0) {
+      const data: EchDataType = res.data.map((v: any) => ({
+        value: v.count,
+        name: v.groupKey,
+      }));
+      baseEchartFu(echartRef2.current!, data);
+    }
+  }, [baseEchartFu]);
+
+  // 获取 入库统计 数据
+  const getInfoFu2 = useCallback(async () => {
+    const res = await A1_APIgetInfo2();
+    if (res.code === 0) {
+      const data: EchDataType = res.data.map((v: any) => ({
+        value: v.pcs,
+        name: Reflect.get(storageStatusTxtObj, v.groupKey),
+      }));
+      baseEchartFu(echartRef3.current!, data);
+    }
+  }, [baseEchartFu]);
 
   useEffect(() => {
-    getInfo1();
-    getInfo2();
-  }, [getInfo1, getInfo2]);
+    getInfoFu1();
+    getInfoFu2();
+  }, [getInfoFu1, getInfoFu2]);
+
+  // useEffect(() => {
+  //   baseEchartFu(echartRef2.current!, datacc);
+  //   baseEchartFu(echartRef3.current!, datacc);
+  // }, [baseEchartFu]);
 
   return (
     <div className={styles.A1Stat}>
       <div className="pageTitle">藏品统计</div>
       {/* 藏品数量折线图 */}
-      <div className="A1box1">
-        <div className="A1tit">藏品数量</div>
-        <div id="echarts1" ref={echartRef1}></div>
-      </div>
+
       {/* 藏品级别和统计 */}
       <div className="A1box2">
         <div className="A1box2_1">
@@ -161,41 +129,8 @@ function A1Stat() {
           <div id="echarts2" ref={echartRef2}></div>
         </div>
         <div className="A1box2_2">
-          <div className="A1tit">藏品统计</div>
-          <div className="A1box2_2Txt">
-            <div className="A1t2_1">
-              <div>
-                已登记<span>21</span>
-              </div>
-              <div>
-                已入库<span>22</span>
-              </div>
-            </div>
-            <div className="A1t2_2">
-              <div className="A1t2_2_1">
-                <div>
-                  登记中<span>2111</span>
-                </div>
-                <div>
-                  编辑中<span>22</span>
-                </div>
-              </div>
-              <div className="A1t2_2_2">
-                <div>
-                  未入库<span>21</span>
-                </div>
-                <div>
-                  入库中<span>999</span>
-                </div>
-                <div>
-                  出库中<span>21</span>
-                </div>
-                <div>
-                  移库中<span>22</span>
-                </div>
-              </div>
-            </div>
-          </div>
+          <div className="A1tit">入库统计</div>
+          <div id="echarts3" ref={echartRef3}></div>
         </div>
       </div>
     </div>

+ 123 - 0
src/pages/A1Stat有折线图的版本/index.module.scss

@@ -0,0 +1,123 @@
+.A1Stat{
+  :global{
+    .A1tit{
+      font-size: 20px;
+      font-weight: 700;
+      position: absolute;
+      top: 15px;
+      left: 15px;
+      z-index: 10;
+      &>span{
+        font-weight: 400;
+        color: #999;
+        font-size: 12px;
+      }
+    }
+    .A1box1{
+      width: 100%;
+      height: calc(48% - 20px);
+      background-color: #fff;
+      border-radius: 10px;
+      margin-bottom: 20px;
+      padding: 20px 15px 0;
+      position: relative;
+      #echarts1{
+        width: 100%;
+        height: 100%;
+        // background-color: red;
+      }
+    }
+    .A1box2{
+      height: 51%;
+      display: flex;
+      &>div{
+        background-color: #fff;
+        border-radius: 10px;
+        position: relative;
+      }
+      .A1box2_1{
+        width: calc(45% - 20px);
+        padding: 40px 20px 0px;
+        margin-right: 20px;
+        #echarts2{
+          width: 100%;
+          height: 100%;
+        }
+      }
+      .A1box2_2{
+        width: 55%;
+        padding: 90px 20px 20px;
+        .A1box2_2Txt{
+          width: 100%;
+          height: 100%;
+          display: flex;
+          .A1t2_1{
+            width: 32%;
+            margin-right: 20px;
+            height: 100%;
+            &>div{
+              box-shadow: 0px 0px 3px 3px #ccc;
+              border-radius: 6px;
+              height: 40%;
+              display: flex;
+              justify-content: space-around;
+              align-items: center;
+              font-size: 24px;
+              &>span{
+               color: var(--themeColor);
+              }
+              &:nth-of-type(1){
+                margin-bottom: 20px;
+              }
+            }
+          }
+          .A1t2_2{
+            width: calc(68% - 20px);
+            .A1t2_2_1{
+              width: 100%;
+              height: 40%;
+              margin-bottom: 20px;
+              display: flex;
+              &>div{
+                border-radius: 6px;
+                box-shadow: 0px 0px 3px 3px #ccc;
+                margin-right: 20px;
+                display: flex;
+                justify-content: space-around;
+                align-items: center;
+                font-size: 20px;
+                width: calc(50% - 10px);
+                &>span{
+                 color: var(--themeColor);
+                }
+                &:last-child{
+                  margin-right: 0;
+                }
+              }
+            }
+            .A1t2_2_2{
+              height: 40%;
+              display: flex;
+              &>div{
+                border-radius: 6px;
+                box-shadow: 0px 0px 3px 3px #ccc;
+                margin-right: 20px;
+                display: flex;
+                justify-content: space-around;
+                align-items: center;
+                font-size: 20px;
+                width: calc(24%);
+                &>span{
+                 color: var(--themeColor);
+                }
+                &:last-child{
+                  margin-right: 0;
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+}

+ 207 - 0
src/pages/A1Stat有折线图的版本/index.tsx

@@ -0,0 +1,207 @@
+import React, { useCallback, useEffect, useRef } from "react";
+import styles from "./index.module.scss";
+
+import * as echarts from "echarts/core";
+import {
+  TitleComponent,
+  ToolboxComponent,
+  TooltipComponent,
+  GridComponent,
+  LegendComponent,
+} from "echarts/components";
+import { LineChart, PieChart } from "echarts/charts";
+import { UniversalTransition, LabelLayout } from "echarts/features";
+import { CanvasRenderer } from "echarts/renderers";
+
+echarts.use([
+  TitleComponent,
+  ToolboxComponent,
+  TooltipComponent,
+  GridComponent,
+  LegendComponent,
+  LineChart,
+  CanvasRenderer,
+  UniversalTransition,
+  PieChart,
+  LabelLayout,
+]);
+
+function A1Stat() {
+  const echartRef1 = useRef<HTMLDivElement>(null);
+  const echartRef2 = useRef<HTMLDivElement>(null);
+  // 获取藏品统计数据
+  const getInfo1 = useCallback(async () => {
+    // const data =[]
+    const myChart = echarts.init(echartRef1.current);
+    const option = {
+      // color: ["#910000", "#E2CAA3"],
+      tooltip: {
+        trigger: "axis",
+      },
+      legend: {
+        data: ["已登记藏品", "已入库藏品"],
+        // top:'-10'
+      },
+      grid: {
+        left: "-24", //距左边边框的距离
+        right: "10", //距右边边框的距离
+        bottom: "10", //距下面边框的距离
+        top: "30", //距上面边框的距离
+        containLabel: true,
+      },
+      xAxis: {
+        type: "category",
+        splitLine: {
+          show: false, //隐藏背景刻度
+        },
+        boundaryGap: false,
+        data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
+        axisLine: {
+          show: false, //隐藏X轴
+        },
+        axisTick: {
+          show: false, //隐藏刻度线
+        },
+        axisLabel: {
+          show: false, //隐藏X轴文字
+        },
+      },
+      yAxis: {
+        type: "value",
+        splitLine: {
+          show: false, //隐藏背景刻度
+        },
+      },
+      series: [
+        {
+          name: "已登记藏品",
+          type: "line",
+          stack: "Total",
+          data: [120, 132, 101, 134, 90, 230, 210],
+        },
+        {
+          name: "已入库藏品",
+          type: "line",
+          stack: "Total",
+          data: [220, 182, 191, 234, 290, 330, 310],
+        },
+      ],
+    };
+    option && myChart.setOption(option);
+  }, []);
+
+  // 获取藏品级别数据
+  const getInfo2 = useCallback(async () => {
+    const myChart = echarts.init(echartRef2.current);
+    const option = {
+      tooltip: {
+        trigger: "item",
+      },
+      legend: {
+        top: "5%",
+        left: "center",
+      },
+      series: [
+        {
+          name: "Access From",
+          type: "pie",
+          radius: ["40%", "70%"],
+          avoidLabelOverlap: false,
+          itemStyle: {
+            borderRadius: 10,
+            borderColor: "#fff",
+            borderWidth: 2,
+          },
+          label: {
+            show: false,
+            position: "center",
+          },
+          emphasis: {
+            label: {
+              show: true,
+              fontSize: 40,
+              fontWeight: "bold",
+            },
+          },
+          labelLine: {
+            show: false,
+          },
+          data: [
+            { value: 1048, name: "Search Engine" },
+            { value: 735, name: "Direct" },
+            { value: 580, name: "Email" },
+            { value: 484, name: "Union Ads" },
+            { value: 300, name: "Video Ads" },
+          ],
+        },
+      ],
+    };
+    option && myChart.setOption(option);
+  }, []);
+
+  useEffect(() => {
+    getInfo1();
+    getInfo2();
+  }, [getInfo1, getInfo2]);
+
+  return (
+    <div className={styles.A1Stat}>
+      <div className="pageTitle">藏品统计</div>
+      {/* 藏品数量折线图 */}
+      <div className="A1box1">
+        <div className="A1tit">藏品数量</div>
+        <div id="echarts1" ref={echartRef1}></div>
+      </div>
+      {/* 藏品级别和统计 */}
+      <div className="A1box2">
+        <div className="A1box2_1">
+          <div className="A1tit">
+            藏品级别 <span>以[已登记]的藏品数量为准</span>
+          </div>
+          <div id="echarts2" ref={echartRef2}></div>
+        </div>
+        <div className="A1box2_2">
+          <div className="A1tit">藏品统计</div>
+          <div className="A1box2_2Txt">
+            <div className="A1t2_1">
+              <div>
+                已登记<span>21</span>
+              </div>
+              <div>
+                已入库<span>22</span>
+              </div>
+            </div>
+            <div className="A1t2_2">
+              <div className="A1t2_2_1">
+                <div>
+                  登记中<span>2111</span>
+                </div>
+                <div>
+                  编辑中<span>22</span>
+                </div>
+              </div>
+              <div className="A1t2_2_2">
+                <div>
+                  未入库<span>21</span>
+                </div>
+                <div>
+                  入库中<span>999</span>
+                </div>
+                <div>
+                  出库中<span>21</span>
+                </div>
+                <div>
+                  移库中<span>22</span>
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+  );
+}
+
+const MemoA1Stat = React.memo(A1Stat);
+
+export default MemoA1Stat;

+ 7 - 6
src/pages/A2Goods/A2Register/A2AddModal/index.tsx

@@ -10,7 +10,7 @@ import {
   Popconfirm,
   Select,
 } from "antd";
-import { A2addInfoType, A2inTableType, options1 } from "../../data";
+import { A2addInfoType, options1 } from "../../data";
 import TextArea from "antd/es/input/TextArea";
 import ZupFileOne from "@/components/Z_upFileOne";
 import ZupFileOtherList, { FileListType } from "@/components/Z_upFileOtherList";
@@ -22,10 +22,11 @@ import {
 import { MessageFu } from "@/utils/message";
 import classNmaes from "classnames";
 import history from "@/utils/history";
+import { A2tableType } from "@/types";
 
 type Props = {
   addInfo: A2addInfoType;
-  upTableFu: (item: A2inTableType, flag: "新增" | "编辑") => void;
+  upTableFu: (item: A2tableType, flag: "新增" | "编辑") => void;
   closeFu: () => void;
   idOldToNew?: boolean; //藏品修改,新旧记录
 };
@@ -33,7 +34,7 @@ type Props = {
 function A2AddModal({ addInfo, upTableFu, closeFu, idOldToNew }: Props) {
   // 把旧的 对象信息 和旧的 附件信息
   const oldInfo = useRef({
-    obj: {} as A2inTableType,
+    obj: {} as A2tableType,
     file: [] as FileListType[],
   });
 
@@ -43,7 +44,7 @@ function A2AddModal({ addInfo, upTableFu, closeFu, idOldToNew }: Props) {
   // 获取详情的方法
   const getInfoFu = useCallback(async (id: number) => {
     const res = await A2_APIgetInfoSon(id);
-    const info = res.data.entity as A2inTableType;
+    const info = res.data.entity as A2tableType;
     const file = res.data.file as FileListType[];
 
     // size 参数
@@ -143,9 +144,9 @@ function A2AddModal({ addInfo, upTableFu, closeFu, idOldToNew }: Props) {
         ];
 
         // 有变化的数据---更新前
-        const before = { id: addInfo.id } as A2inTableType;
+        const before = { id: addInfo.id } as A2tableType;
         // 有变化的数据---更新后
-        const after = { id: addInfo.id } as A2inTableType;
+        const after = { id: addInfo.id } as A2tableType;
 
         for (const k in oldInfo.current.obj) {
           if (tempApp.includes(k)) {

+ 13 - 9
src/pages/A2Goods/A2Register/index.module.scss

@@ -13,10 +13,17 @@
       margin-bottom: 15px;
       background-color: #fff;
       border-radius: 10px;
-      padding: 24px 24px 24px 60px;
+      padding: 30px 24px 24px 60px;
       position: relative;
+      .A2RtopTit{
+        position: absolute;
+        top: 8px;
+        left: 60px;
+        font-size: 12px;
+        color: #ff4d4f;
+      }
 
-      .A2RTitle{
+      .A2RTitle {
         position: absolute;
         top: 14px;
         left: 20px;
@@ -36,7 +43,7 @@
     }
 
     .A2Rtable {
-      height: calc(100% - 165px);
+      height: calc(100% - 170px);
       background-color: #fff;
       border-radius: 10px;
       padding: 24px;
@@ -51,13 +58,11 @@
         height: calc(100% - 80px);
 
         .ant-table-body {
-          height: 482px;
-          overflow-y: auto !important;
-          overflow-y: overlay !important;
-          .ant-table-cell{
+          .ant-table-cell {
             padding: 4px 6px !important;
           }
         }
+
       }
 
       .A2Rtable3 {
@@ -66,5 +71,4 @@
       }
     }
   }
-}
-
+}

+ 58 - 87
src/pages/A2Goods/A2Register/index.tsx

@@ -7,30 +7,27 @@ import React, {
 } from "react";
 import styles from "./index.module.scss";
 import TextArea from "antd/es/input/TextArea";
-import { Button, Popconfirm, Table } from "antd";
-import {
-  A2addInfoType,
-  A2inTableType,
-  statusTxtObj,
-  storageStatusTxtObj,
-} from "../data";
+import { Button, Popconfirm } from "antd";
+import { A2addInfoType } from "../data";
 import A2AddModal from "./A2AddModal";
 import { MessageFu } from "@/utils/message";
-import ImageLazy from "@/components/ImageLazy";
 import {
   A2_APIaddWai,
   A2_APIgetInfoWai,
   A2_APIinDels,
 } from "@/store/action/A2Goods";
 import history from "@/utils/history";
+import { A2tableType } from "@/types";
+import ZlistTable from "@/components/ZlistTable";
 
 type Props = {
   closeFu: () => void;
   upInfoFu: () => void;
   outInfo: A2addInfoType;
+  type: "DJ" | "ZX";
 };
 
-function A2Register({ closeFu, outInfo, upInfoFu }: Props) {
+function A2Register({ closeFu, outInfo, upInfoFu, type }: Props) {
   // 记录删除了的所有id集合
   const delIdArr = useRef<number[]>([]);
 
@@ -52,7 +49,7 @@ function A2Register({ closeFu, outInfo, upInfoFu }: Props) {
   }, [getInfoFu, outInfo.id, outInfo.txt]);
 
   // 表格信息
-  const [tableList, setTableList] = useState<A2inTableType[]>([]);
+  const [tableList, setTableList] = useState<A2tableType[]>([]);
 
   // 申请说明字段
   const [topValue, setTopValue] = useState("");
@@ -87,68 +84,37 @@ function A2Register({ closeFu, outInfo, upInfoFu }: Props) {
     [closeFu, outInfo.id, outInfo.txt, tableList, topValue, upInfoFu]
   );
 
-  const columns = useMemo(() => {
-    return [
-      {
-        title: "缩略图",
-        render: (item: A2inTableType) => (
-          <div className="tableImgAuto">
-            <ImageLazy width={60} height={60} src={item.thumb} />
-          </div>
-        ),
-      },
-      {
-        title: "编号",
-        dataIndex: "num",
-      },
-      {
-        title: "名称",
-        dataIndex: "name",
-      },
-      {
-        title: "级别",
-        dataIndex: "dictLevel",
-      },
-      {
-        title: "藏品状态",
-        render: (item: A2inTableType) =>
-          Reflect.get(statusTxtObj, item.status) || "-",
-      },
-      {
-        title: "库存状态",
-        render: (item: A2inTableType) =>
-          Reflect.get(storageStatusTxtObj, item.storageStatus) || "-",
-      },
-      {
-        title: "操作",
-        render: (item: A2inTableType) => (
-          <>
-            <Button
-              size="small"
-              type="text"
-              onClick={() => setAddInfo({ id: item.id, txt: "编辑" })}
-            >
-              编辑
+  // 表格的操作模块的列
+  const listTableBtn = useMemo(() => {
+    return {
+      title: "操作",
+      render: (item: A2tableType) => (
+        <>
+          <Button
+            size="small"
+            type="text"
+            onClick={() => setAddInfo({ id: item.id, txt: "编辑" })}
+          >
+            编辑
+          </Button>
+          <Popconfirm
+            title="删除后无法恢复,是否删除?"
+            okText="删除"
+            cancelText="取消"
+            onConfirm={() => {
+              delIdArr.current.push(item.id);
+              setTableList(tableList.filter((v) => v.id !== item.id));
+              MessageFu.success("删除成功!");
+            }}
+            okButtonProps={{ loading: false }}
+          >
+            <Button size="small" type="text" danger>
+              删除
             </Button>
-            <Popconfirm
-              title="删除后无法恢复,是否删除?"
-              okText="删除"
-              cancelText="取消"
-              onConfirm={() => {
-                delIdArr.current.push(item.id);
-                setTableList(tableList.filter((v) => v.id !== item.id));
-                MessageFu.success("删除成功!");
-              }}
-              okButtonProps={{ loading: false }}
-            >
-              <Button size="small" type="text" danger>
-                删除
-              </Button>
-            </Popconfirm>
-          </>
-        ),
-      },
-    ];
+          </Popconfirm>
+        </>
+      ),
+    };
   }, [tableList]);
 
   // 新增和编辑
@@ -156,7 +122,7 @@ function A2Register({ closeFu, outInfo, upInfoFu }: Props) {
 
   // 从里面的弹窗 新增 / 编辑完工
   const addOrEditSuccFu = useCallback(
-    (item: A2inTableType, flag: "新增" | "编辑") => {
+    (item: A2tableType, flag: "新增" | "编辑") => {
       if (flag === "新增") setTableList([...tableList, item]);
       else {
         setTableList(tableList.map((v) => (v.id === item.id ? item : v)));
@@ -168,7 +134,14 @@ function A2Register({ closeFu, outInfo, upInfoFu }: Props) {
   return (
     <div className={styles.A2Register}>
       <div className="A2Rtop">
-        <div className="A2RTitle">登记申请</div>
+        {type === "ZX" ? (
+          <div className="A2RtopTit">
+            注:注销后,将无法在清单中查询到此藏品;请谨慎操作
+          </div>
+        ) : null}
+        <div className="A2RTitle">
+          {type === "DJ" ? "登记申请" : "注销申请"}
+        </div>
         <div className="A2Rtop1">申请说明:</div>
         <div className="A2Rtop2">
           <TextArea
@@ -191,14 +164,7 @@ function A2Register({ closeFu, outInfo, upInfoFu }: Props) {
           </Button>
         </div>
         <div className="A2Rtable2">
-          <Table
-            size="small"
-            scroll={{ y: 482 }}
-            dataSource={tableList}
-            columns={columns}
-            rowKey="id"
-            pagination={false}
-          />
+          <ZlistTable list={tableList} btnDom={listTableBtn} y={478} />
         </div>
         <div className="A2Rtable3">
           <Button
@@ -225,13 +191,18 @@ function A2Register({ closeFu, outInfo, upInfoFu }: Props) {
         </div>
       </div>
 
-      {/* 点击新增和编辑出来的弹窗 */}
+      {/* 点击新增和编辑出来的弹窗 --- 登记申请*/}
       {addInfo.id ? (
-        <A2AddModal
-          addInfo={addInfo}
-          closeFu={() => setAddInfo({ id: 0, txt: "" })}
-          upTableFu={(item, flag) => addOrEditSuccFu(item, flag)}
-        />
+        <>
+          {type === "DJ" ? (
+            <A2AddModal
+              addInfo={addInfo}
+              closeFu={() => setAddInfo({ id: 0, txt: "" })}
+              upTableFu={(item, flag) => addOrEditSuccFu(item, flag)}
+            />
+          ) : null}
+          {/* 待完善 ZX 新增 和 编辑 的页面*/}
+        </>
       ) : null}
     </div>
   );

+ 0 - 28
src/pages/A2Goods/data.ts

@@ -103,31 +103,3 @@ export const storageStatusTxtObj = {
   3: "出库中",
   4: "移库中",
 };
-
-
-export type A2inTableType ={
-	complete: string;
-	createTime: string;
-	creatorId: number;
-	creatorName: string;
-	description: string;
-	dictAge: string;
-	dictLevel: string;
-	dictTexture: string;
-	dirCode: string;
-	display: string;
-	fileIds: string;
-	id: number;
-	levelTime: string;
-	name: string;
-	num: string;
-	pcs: number;
-	quality: string;
-	size: string;
-	source: string;
-	status: number;
-	storageIds: string;
-	storageStatus: number;
-	thumb: string;
-	updateTime: string;
-}

+ 0 - 2
src/pages/A2Goods/index.module.scss

@@ -25,8 +25,6 @@
 
       .ant-table-body {
         height: 625px;
-        overflow-y: auto !important;
-        overflow-y: overlay !important;
         .ant-table-cell{
           padding: 8px;
         }

+ 25 - 7
src/pages/A2Goods/index.tsx

@@ -72,8 +72,14 @@ function A2Goods() {
     });
   }, []);
 
-  // 点击 申请登记
-  const [outInfo, setOutInfo] = useState<A2addInfoType>({ id: 0, txt: "" });
+  // 点击 申请登记 /申请注销
+  const [outInfo, setOutInfo] = useState<A2addInfoType>({
+    id: 0,
+    txt: "",
+  });
+
+  // 申请登记 和申请注销公用一个页面 type 区分
+  const [outType, setOutType] = useState<"DJ" | "ZX">("DJ");
 
   // 从仓库获取藏品清单 表格列表
   const A2TableList = useSelector(
@@ -206,13 +212,24 @@ function A2Goods() {
           <Button onClick={resetSelectFu}>重置</Button>&emsp;
           <Button
             type="primary"
-            onClick={() => setOutInfo({ id: -1, txt: "新增" })}
+            onClick={() => {
+              setOutInfo({ id: -1, txt: "新增" });
+              setOutType("DJ");
+            }}
           >
-            申请登记
+            登记申请
           </Button>
           &emsp;
-          {/* 待完善 */}
-          <Button type="primary">申请注销</Button>
+          <Button
+            disabled={A2TableList.total <= 0}
+            type="primary"
+            onClick={() => {
+              setOutInfo({ id: -1, txt: "新增" });
+              setOutType("ZX");
+            }}
+          >
+            注销申请
+          </Button>
         </div>
       </div>
       {/* 表格主体 */}
@@ -234,12 +251,13 @@ function A2Goods() {
         />
       </div>
 
-      {/* 申请登记出来的页面 */}
+      {/* 申请登记 /申请注销 出来的页面 */}
       {outInfo.id ? (
         <A2Register
           closeFu={() => setOutInfo({ id: 0, txt: "" })}
           outInfo={outInfo}
           upInfoFu={() => {}}
+          type={outType}
         />
       ) : null}
 

+ 0 - 2
src/pages/A4Roomset/index.module.scss

@@ -24,8 +24,6 @@
 
       .ant-table-body {
         height: 675px;
-        overflow-y: auto !important;
-        overflow-y: overlay !important;
         // .ant-table-cell{
         //   padding: 8px;
         // }

+ 0 - 18
src/pages/B1Submit/B1Info/index.module.scss

@@ -104,24 +104,6 @@
       background-color: #fff;
       border-radius: 10px;
       display: flex;
-
-      // .B1ItableLeft {
-      //   width: 90px;
-      //   text-align: center;
-      //   height: 32px;
-      //   line-height: 32px;
-      //   font-weight: 700;
-      // }
-
-      // .ant-table-wrapper {
-      //   width: calc(100% - 90px);
-      // }
-
-      .ant-table-body {
-        height: 438px;
-        overflow-y: auto !important;
-        overflow-y: overlay !important;
-      }
     }
 
     .B1ItableNoEdit {

+ 50 - 99
src/pages/B1Submit/B1Info/index.tsx

@@ -6,15 +6,10 @@ import React, {
   useState,
 } from "react";
 import styles from "./index.module.scss";
-import { B1tableType } from "@/types";
+import { A2tableType, B1tableType } from "@/types";
 import { B1StatusObj, B1TieleObj, antdTagColorFObj } from "../data";
 import { Button, Popconfirm, Radio, Table, Tag } from "antd";
-import {
-  A2addInfoType,
-  A2inTableType,
-  statusTxtObj,
-  storageStatusTxtObj,
-} from "@/pages/A2Goods/data";
+import { A2addInfoType } from "@/pages/A2Goods/data";
 import ImageLazy from "@/components/ImageLazy";
 import { A2_APIdelOrder, A2_APIgetInfo } from "@/store/action/B1Submit";
 import B1Look from "../B1Look";
@@ -25,6 +20,7 @@ import TextArea from "antd/es/input/TextArea";
 import { B1EditKeyObj, B1EditTable } from "./data";
 import classNames from "classnames";
 import A2AddModal from "@/pages/A2Goods/A2Register/A2AddModal";
+import ZlistTable from "@/components/ZlistTable";
 
 type Props = {
   closeFu: () => void;
@@ -193,92 +189,57 @@ function B1Info({ closeFu, lookId, pageKey, upTableFu }: Props) {
   const [tableListByEdit, setTableListByEdit] = useState<B1EditTable[]>([]);
 
   //  表格信息(除了藏品编辑之外)
-  const [tableList, setTableList] = useState<A2inTableType[]>([]);
+  const [tableList, setTableList] = useState<A2tableType[]>([]);
 
   const columns = useMemo(() => {
-    if (info.type === "BJ")
-      return [
-        {
-          title: "编辑内容",
-          dataIndex: "txt",
-        },
-        {
-          title: "编辑前",
-          render: (item: B1EditTable) =>
-            item.type === "img" ? (
-              <div className="tableImgAuto">
-                <ImageLazy width={60} height={60} src={item.oldValue} />
-              </div>
-            ) : (
-              item.oldValue
-            ),
-        },
-        {
-          title: "编辑后",
-          render: (item: B1EditTable) =>
-            item.type === "img" ? (
-              <div className="tableImgAuto">
-                <ImageLazy width={60} height={60} src={item.newValue} />
-              </div>
-            ) : (
-              item.newValue
-            ),
-        },
-      ];
-    else {
-      return [
-        {
-          title: "缩略图",
-          render: (item: A2inTableType) => (
+    return [
+      {
+        title: "编辑内容",
+        dataIndex: "txt",
+      },
+      {
+        title: "编辑前",
+        render: (item: B1EditTable) =>
+          item.type === "img" ? (
             <div className="tableImgAuto">
-              <ImageLazy width={60} height={60} src={item.thumb} />
+              <ImageLazy width={60} height={60} src={item.oldValue} />
             </div>
+          ) : (
+            item.oldValue
           ),
-        },
-        {
-          title: "编号",
-          dataIndex: "num",
-        },
-        {
-          title: "名称",
-          dataIndex: "name",
-        },
-        {
-          title: "级别",
-          dataIndex: "dictLevel",
-        },
-        {
-          title: "藏品状态",
-          render: (item: A2inTableType) =>
-            Reflect.get(statusTxtObj, item.status) || "-",
-        },
-        {
-          title: "库存状态",
-          render: (item: A2inTableType) =>
-            Reflect.get(storageStatusTxtObj, item.storageStatus) || "-",
-        },
-        {
-          title: "操作",
-          render: (item: A2inTableType) => (
-            <>
-              <Button
-                size="small"
-                type="text"
-                onClick={() => setGoodsId(item.id)}
-              >
-                查看
-              </Button>
-            </>
+      },
+      {
+        title: "编辑后",
+        render: (item: B1EditTable) =>
+          item.type === "img" ? (
+            <div className="tableImgAuto">
+              <ImageLazy width={60} height={60} src={item.newValue} />
+            </div>
+          ) : (
+            item.newValue
           ),
-        },
-      ];
-    }
-  }, [info.type]);
+      },
+    ];
+  }, []);
 
   // 我审核的 待审核的 输入框
   const [auditDesc, setAuditDesc] = useState("");
   const [auditStatus, setAuditStatus] = useState(0);
 
+  // 申请登记 和 申请注销的 表格操作 模块
+  const listTableBtn = useMemo(() => {
+    return {
+      title: "操作",
+      render: (item: A2tableType) => (
+        <>
+          <Button size="small" type="text" onClick={() => setGoodsId(item.id)}>
+            查看
+          </Button>
+        </>
+      ),
+    };
+  }, []);
+
   return (
     <div className={styles.B1Info}>
       {/* 右上角的返回 */}
@@ -394,10 +355,6 @@ function B1Info({ closeFu, lookId, pageKey, upTableFu }: Props) {
           info.type !== "BJ" ? "B1ItableNoEdit" : ""
         )}
       >
-        {/* <div className="B1ItableLeft">
-          {info.type === "BJ" ? "编辑信息" : "藏品清单"}:
-        </div> */}
-
         {/* 藏品编辑表格 */}
         {info.type === "BJ" ? (
           <Table
@@ -408,17 +365,10 @@ function B1Info({ closeFu, lookId, pageKey, upTableFu }: Props) {
             rowKey="id"
             pagination={false}
           />
-        ) : (
-          // 其他表格
-          <Table
-            size="small"
-            scroll={{ y: 438 }}
-            dataSource={tableList}
-            columns={columns}
-            rowKey="id"
-            pagination={false}
-          />
-        )}
+        ) : info.type === "DJ" || info.type === "ZX" ? (
+          // 登记和注销表格
+          <ZlistTable list={tableList} btnDom={listTableBtn} y={438} />
+        ) : null}
       </div>
       {/* 点击表格里面的查看出来的页面 */}
       {goodsId ? (
@@ -434,13 +384,14 @@ function B1Info({ closeFu, lookId, pageKey, upTableFu }: Props) {
             closeFu={() => setOutInfo({ id: 0, txt: "" })}
             idOldToNew={true}
           />
-        ) : (
+        ) : info.type === "DJ" || info.type === "ZX" ? (
           <A2Register
             closeFu={() => setOutInfo({ id: 0, txt: "" })}
             outInfo={outInfo}
             upInfoFu={() => getInfoFu(info.id, true)}
+            type={info.type}
           />
-        )
+        ) : null
       ) : null}
     </div>
   );

+ 0 - 2
src/pages/B1Submit/B1Look/index.module.scss

@@ -127,8 +127,6 @@
 
         .ant-table-body {
           height: 370px;
-          overflow-y: auto !important;
-          overflow-y: overlay !important;
           // .ant-table-cell{
           //   padding: 4px 6px !important;
           // }

+ 3 - 3
src/pages/B1Submit/B1Look/index.tsx

@@ -1,7 +1,6 @@
 import React, { useCallback, useEffect, useMemo, useState } from "react";
 import styles from "./index.module.scss";
 import {
-  A2inTableType,
   antdTagColorFObjIn,
   statusTxtObj,
   storageStatusTxtObj,
@@ -18,6 +17,7 @@ import { baseURL } from "@/utils/http";
 import { B1LbtnKey } from "../data";
 import A2AddModal from "@/pages/A2Goods/A2Register/A2AddModal";
 import B1Log from "./B1Log";
+import { A2tableType } from "@/types";
 
 type Props = {
   goodsId: number;
@@ -30,7 +30,7 @@ function B1Look({ closeFu, goodsId }: Props) {
     (state: RootState) => state.A0Layout.isFileDonw
   );
 
-  const [info, setInfo] = useState({} as A2inTableType);
+  const [info, setInfo] = useState({} as A2tableType);
   const [file, setFile] = useState([] as FileListType[]);
 
   const getInfoFu = useCallback(async (id: number) => {
@@ -107,7 +107,7 @@ function B1Look({ closeFu, goodsId }: Props) {
     [goodsId]
   );
 
-  // 操作按钮出现的逻辑
+  // 操作按钮出现的逻辑(待完善)
   const btnArr = useMemo(() => {
     const btn1 = (
       <div>

+ 0 - 2
src/pages/B1Submit/index.module.scss

@@ -24,8 +24,6 @@
 
       .ant-table-body {
         height: 625px;
-        overflow-y: auto !important;
-        overflow-y: overlay !important;
 
       }
     }

+ 0 - 2
src/pages/B2Audit/index.module.scss

@@ -23,8 +23,6 @@
 
       .ant-table-body {
         height: 625px;
-        overflow-y: auto !important;
-        overflow-y: overlay !important;
 
       }
     }

+ 0 - 2
src/pages/C1User/index.module.scss

@@ -24,8 +24,6 @@
 
       .ant-table-body {
         height: 625px;
-        overflow-y: auto !important;
-        overflow-y: overlay !important;
 
       }
     }

+ 0 - 2
src/pages/C2Log/index.module.scss

@@ -23,8 +23,6 @@
 
       .ant-table-body {
         height: 625px;
-        overflow-y: auto !important;
-        overflow-y: overlay !important;
 
       }
     }

+ 15 - 0
src/store/action/A1Stat.ts

@@ -0,0 +1,15 @@
+import http from "@/utils/http";
+
+/**
+ * 藏品级别
+ */
+export const A1_APIgetInfo1 = () => {
+  return http.get("cms/report/goodsLevel");
+};
+
+/**
+ * 入库统计
+ */
+export const A1_APIgetInfo2 = () => {
+  return http.get("cms/report/groupByCount");
+};

+ 2 - 2
src/utils/http.ts

@@ -8,7 +8,7 @@ import { domShowFu } from "./domShow";
 export const baseURL =
   // 线下的图片地址需要加上/api/
   process.env.NODE_ENV === "development"
-    ? "http://192.168.20.61:8061/api"
+    ? "http://192.168.20.61:8061/api2"
     : "";
   // process.env.NODE_ENV === "development" ? "https://tower3d.4dkankan.com" : "";
 
@@ -26,7 +26,7 @@ const http = axios.create({
   baseURL: baseURL+'/',
 
   // --------打包或线上环境接口需要加上api/
-  // baseURL: baseURL + "/api/",
+  // baseURL: baseURL + "/api2/",
   timeout: 5000,
 });