瀏覽代碼

写不动了

shaogen1995 2 年之前
父節點
當前提交
b5577d328f

+ 3 - 5
src/pages/B1Submit/B1Info/index.tsx

@@ -61,7 +61,7 @@ function B1Info({ closeFu, lookId, pageKey, upTableFu }: Props) {
           const tempArr = [] as B1EditTable[];
 
           for (const k in newObj) {
-            if (k !== "id") {
+            if (k !== "id" && k !== "fileIds") {
               const txt = Reflect.get(B1EditKeyObj, k);
               let oldValue = Reflect.get(oldObj, k);
               let newValue = Reflect.get(newObj, k);
@@ -91,6 +91,7 @@ function B1Info({ closeFu, lookId, pageKey, upTableFu }: Props) {
               } as B1EditTable);
             }
           }
+
           setTableListByEdit(tempArr);
         } else {
           // 除了藏品编辑之外的表格数据
@@ -421,10 +422,7 @@ function B1Info({ closeFu, lookId, pageKey, upTableFu }: Props) {
       </div>
       {/* 点击表格里面的查看出来的页面 */}
       {goodsId ? (
-        <B1Look
-          goodsId={goodsId}
-          closeFu={() => setGoodsId(0)}
-        />
+        <B1Look goodsId={goodsId} closeFu={() => setGoodsId(0)} />
       ) : null}
 
       {/* 点击编辑按钮出来的页面 */}

+ 45 - 0
src/pages/B1Submit/B1Look/B1Log.tsx

@@ -0,0 +1,45 @@
+import React, { useCallback, useEffect } from "react";
+import styles from "./index.module.scss";
+import { Button, Modal } from "antd";
+import { A2_APIgetLogList } from "@/store/action/B1Submit";
+
+type Props = {
+  logId: number;
+  closeFu: () => void;
+};
+
+function B1Log({ logId, closeFu }: Props) {
+  const getListFu = useCallback(async (id: number) => {
+    const res = await A2_APIgetLogList(id);
+    if (res.code === 0) {
+      console.log(123, res);
+    }
+  }, []);
+
+  useEffect(() => {
+    getListFu(logId);
+  }, [getListFu, logId]);
+
+// 待完善
+
+  return (
+    <Modal
+      wrapClassName={styles.B1Log}
+      open={true}
+      title="藏品日志"
+      footer={
+        [] // 设置footer为空,去掉 取消 确定默认按钮
+      }
+    >
+      <div className="B1Lmain">
+        <div className="B1Lbtn">
+          <Button onClick={closeFu}>关闭</Button>
+        </div>
+      </div>
+    </Modal>
+  );
+}
+
+const MemoB1Log = React.memo(B1Log);
+
+export default MemoB1Log;

+ 49 - 16
src/pages/B1Submit/B1Look/index.module.scss

@@ -49,50 +49,58 @@
           height: calc(100% - 140px);
           display: flex;
           justify-content: space-between;
-          .B1LcRow{
+
+          .B1LcRow {
             width: 48%;
             height: 100%;
             font-size: 16px;
-  
-            .B1LcRowIn{
+
+            .B1LcRowIn {
               display: flex;
               height: 30px;
               line-height: 30px;
-              &>div{
-                &:nth-of-type(1){
+
+              &>div {
+                &:nth-of-type(1) {
                   width: 50px;
                   text-align: right;
                 }
-                &:nth-of-type(2){
+
+                &:nth-of-type(2) {
                   width: calc(100% - 50px);
                 }
               }
             }
           }
-          .B1LcRow2{
-            .B1LcRowIn{
-              &>div{
-                &:nth-of-type(1){
+
+          .B1LcRow2 {
+            .B1LcRowIn {
+              &>div {
+                &:nth-of-type(1) {
                   width: 80px;
                 }
-                &:nth-of-type(2){
+
+                &:nth-of-type(2) {
                   width: calc(100% - 80px);
                 }
               }
             }
           }
         }
+
         // 简介
-        .B1LcTxt{
+        .B1LcTxt {
           font-size: 16px;
           display: flex;
           margin-top: 5px;
-          &>div{
-            &:nth-of-type(1){
+
+          &>div {
+            &:nth-of-type(1) {
               width: 50px;
               text-align: right;
             }
-            &:nth-of-type(2){
+
+            &:nth-of-type(2) {
               padding-right: 4px;
               width: calc(100% - 50px);
               height: 88px;
@@ -107,10 +115,12 @@
     .B1Lfoll {
       margin-top: 15px;
       height: calc(100% - 335px);
-      .B1LfollTit{
+
+      .B1LfollTit {
         font-size: 20px;
         font-weight: 700;
       }
+
       .B1LfollTable {
         height: calc(100% - 40px);
         margin-top: 12px;
@@ -126,4 +136,27 @@
       }
     }
   }
+}
+
+
+// 藏品日志的弹窗样式
+.B1Log {
+  :global {
+    .ant-modal-close {
+      display: none;
+    }
+
+    .ant-modal {
+      width: 800px !important;
+    }
+
+    .B1Lmain{
+      padding-top: 10px;
+      border-top: 1px solid #ccc;
+      .B1Lbtn{
+        margin-top: 20px;
+        text-align: center;
+      }
+    }
+  }
 }

+ 11 - 1
src/pages/B1Submit/B1Look/index.tsx

@@ -17,6 +17,7 @@ import filesLookFu from "@/utils/filesLook";
 import { baseURL } from "@/utils/http";
 import { B1LbtnKey } from "../data";
 import A2AddModal from "@/pages/A2Goods/A2Register/A2AddModal";
+import B1Log from "./B1Log";
 
 type Props = {
   goodsId: number;
@@ -163,6 +164,9 @@ function B1Look({ closeFu, goodsId }: Props) {
     return <div className="B1LbtnArr">{res}</div>;
   }, [btnClickFu, info.storageStatus]);
 
+  // 藏品日志
+  const [logId, setLogId] = useState(0);
+
   return (
     <div className={styles.B1Look}>
       <div className="B1Ltop">
@@ -184,7 +188,10 @@ function B1Look({ closeFu, goodsId }: Props) {
             </div>
             <div>
               {/* 待完善 */}
-              <Button type="primary">藏品日志</Button>&emsp;
+              <Button type="primary" onClick={() => setLogId(goodsId)}>
+                藏品日志
+              </Button>
+              &emsp;
               {/* 只有已登记的时候才有操作按钮 */}
               {info.status === 2 ? (
                 <>
@@ -277,6 +284,9 @@ function B1Look({ closeFu, goodsId }: Props) {
         </div>
       </div>
 
+      {/* 点击藏品日志出来的弹窗 */}
+      {logId ? <B1Log logId={logId} closeFu={() => setLogId(0)} /> : null}
+
       {/* 点击编辑出现的弹窗 */}
       {btnKey.txt === "编辑" ? (
         <A2AddModal

+ 8 - 0
src/store/action/B1Submit.ts

@@ -30,3 +30,11 @@ export const A2_APIgetInfo = (id: number) => {
 export const A2_APIdelOrder = (id: number) => {
   return http.get(`cms/order/removes/${id}`);
 };
+
+
+/**
+ * 获取藏品日志 列表
+ */
+export const A2_APIgetLogList = (id: number) => {
+  return http.get(`cms/goods/log/${id}`);
+};