shaogen1995 2 лет назад
Родитель
Сommit
5103725de2

+ 5 - 0
src/pages/B2Scene/index.module.scss

@@ -41,6 +41,11 @@
           color: #1677ff
         }
 
+        .B2auditNo {
+          pointer-events: none;
+          color: #999;
+        }
+
         .anticon-question-circle {
           color: #1677ff;
         }

+ 39 - 6
src/pages/B2Scene/index.tsx

@@ -19,7 +19,11 @@ import { useDispatch, useSelector } from "react-redux";
 import { B2FromDataType, B2ResNum } from "./data";
 import mapDataAll from "../C1User/AddUser/city";
 import { B1options1, B1options1Obj } from "../B1Plan/data";
-import { B2_APIgetlist, B2_APIremove } from "@/store/action/B2Scene";
+import {
+  B2_APIgetlist,
+  B2_APIremove,
+  B2_APIreset,
+} from "@/store/action/B2Scene";
 import store, { RootState } from "@/store";
 import { B2tableType } from "@/types";
 import { MessageFu } from "@/utils/message";
@@ -27,6 +31,7 @@ import { QuestionCircleOutlined } from "@ant-design/icons";
 import ExportJsonExcel from "js-export-excel";
 import dayjs from "dayjs";
 import AuditMo from "./AuditMo";
+import clasNames from "classnames";
 
 function B2Scene() {
   const dispatch = useDispatch();
@@ -107,6 +112,18 @@ function B2Scene() {
     [getListFu]
   );
 
+  // 点击重置
+  const resByIdFu = useCallback(
+    async (id: number) => {
+      const res = await B2_APIreset(id);
+      if (res.code === 0) {
+        MessageFu.success("重置成功!");
+        getListFu();
+      }
+    },
+    [getListFu]
+  );
+
   const columns = useMemo(() => {
     return [
       {
@@ -192,15 +209,19 @@ function B2Scene() {
         render: (item: B2tableType) => (
           <>
             <span
-              className="B2audit"
-              onClick={() =>
+              className={clasNames(
+                "B2audit",
+                item.auditStatus === 2 ? "B2auditNo" : ""
+              )}
+              onClick={() => {
+                if (item.auditStatus === 2) return;
                 setAuditInfo({
                   oldState: item.auditStatus,
                   id: item.id,
                   sceneCode: item.sceneCode,
                   auditDesc: item.auditDesc,
-                })
-              }
+                });
+              }}
             >
               {Reflect.get(B1options1Obj, item.auditStatus) || "(空)"}
             </span>
@@ -230,6 +251,18 @@ function B2Scene() {
             </a>
 
             <Popconfirm
+              title="将重置该场景的审核状态,推送状态,请谨慎操作。"
+              okText="重置"
+              cancelText="取消"
+              onConfirm={() => resByIdFu(item.id)}
+              okButtonProps={{ loading: false }}
+            >
+              <Button size="small" type="text">
+                重置
+              </Button>
+            </Popconfirm>
+
+            <Popconfirm
               title="删除后无法恢复,是否删除?"
               okText="删除"
               cancelText="取消"
@@ -244,7 +277,7 @@ function B2Scene() {
         ),
       },
     ];
-  }, [delByIdFu]);
+  }, [delByIdFu, resByIdFu]);
 
   // 点击导出
   const deriveFu = useCallback(async () => {

+ 21 - 3
src/pages/B3Push/index.tsx

@@ -162,10 +162,28 @@ function B3Push() {
         render: (item: B3tableType) => item.pushTime || "(空)",
       },
       {
-        title: "Json类型",
-        render: (item: B3tableType) =>
-          item.jsonType === 1 ? "算法" : "人工" || "(空)",
+        title: "链接推送状态",
+        render: (item: B3tableType) => (
+          <>
+            {Reflect.get(B1options2Obj, item.pushLinkStatus) || "(空)"}
+            <span style={{ cursor: "pointer" }} hidden={!item.pushLinkDesc}>
+              <Tooltip title={item.pushLinkDesc}>
+                &nbsp;
+                <QuestionCircleOutlined rev={undefined} />
+              </Tooltip>
+            </span>
+          </>
+        ),
+      },
+      {
+        title: "链接推送时间",
+        render: (item: B3tableType) => item.pushLinkTime || "(空)",
       },
+      // {
+      //   title: "Json类型",
+      //   render: (item: B3tableType) =>
+      //     item.jsonType === 1 ? "算法" : "人工" || "(空)",
+      // },
       {
         title: "Json更新时间",
         render: (item: B3tableType) => item.jsonUpdateTime || "(空)",

+ 7 - 0
src/store/action/B2Scene.ts

@@ -24,6 +24,13 @@ export const B2_APIremove = (id: number) => {
 };
 
 /**
+ * 重置 单个表格数据
+ */
+export const B2_APIreset = (id: number) => {
+  return http.get(`cms/scene/reset/${id}`);
+};
+
+/**
  * 审核
  */
 export const B2_APIAudit = (data: any) => {

+ 4 - 0
src/types/api/B3Push.d.ts

@@ -17,4 +17,8 @@ export type B3tableType = {
   sceneCode: string;
   updateTime: string;
   jsonUpdateTime:string
+  // 后面加的3个字段
+  pushLinkStatus:number
+  pushLinkTime:string
+  pushLinkDesc:string
 };