Browse Source

四维/千寻 环境适配

shaogen1995 1 year ago
parent
commit
ed0a9884ba

BIN
public/favicon2.ico


+ 2 - 1
public/index.html

@@ -9,7 +9,8 @@
       content="Web site created using create-react-app"
     />
     <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
-    <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon">
+    <!-- <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon"> -->
+    <script src="./myEnv.js"></script>
     <!--
       manifest.json provides metadata used when your web app is installed on a
       user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/

+ 15 - 0
public/myEnv.js

@@ -0,0 +1,15 @@
+// 四维 千寻
+const envTxt = '千寻'
+
+// 动态插入
+const faviconurl = `./favicon${envTxt === '千寻' ? '2' : ''}.ico`;//这里可以是动态的获取的favicon的地址                      
+
+const link = document.querySelector("link[rel*='icon']") || document.createElement('link');
+
+link.type = 'image/x-icon';
+
+link.rel = 'shortcut icon';
+
+link.href = faviconurl;
+
+document.getElementsByTagName('head')[0].appendChild(link);

BIN
src/assets/img/loginBac2.png


BIN
src/assets/img/logo2.png


+ 66 - 56
src/pages/B2Scene/index.tsx

@@ -21,6 +21,7 @@ import mapDataAll from "../C1User/AddUser/city";
 import { B1options1, B1options1Obj } from "../B1Plan/data";
 import {
   B2_APIgetlist,
+  B2_APIgetlistAll,
   B2_APIremove,
   B2_APIreset,
 } from "@/store/action/B2Scene";
@@ -296,62 +297,71 @@ function B2Scene() {
       return MessageFu.warning("当前搜索条件没有数据!");
     const name = "场景审核" + dayjs(new Date()).format("YYYY-MM-DD HH:mm");
 
-    const option = {
-      fileName: name,
-      datas: [
-        {
-          sheetData: B2TableList.list.map((v) => ({
-            roomNum: v.roomNum || "(空)",
-            myCity:
-              !v.province && !v.city ? "(空)" : `${v.province} - ${v.city}`,
-            pmName: v.creatorId === 1 ? "管理员" : v.pmName || "(空)",
-            sceneName: v.sceneName || "(空)",
-            link: v.link || "(空)",
-            sceneCode: v.sceneCode || "(空)",
-            cameraSn: v.cameraSn || "(空)",
-            shootTime: v.shootTime || "(空)",
-            snapUseDept: v.snapUseDept || "(空)",
-            snapUseName: v.snapUseName || "(空)",
-            auditStatus: Reflect.get(B1options1Obj, v.auditStatus) || "(空)",
-            auditTime: v.auditTime || "(空)",
-          })),
-          sheetName: name,
-          sheetFilter: [
-            "roomNum",
-            "myCity",
-            "pmName",
-            "sceneName",
-            "link",
-            "sceneCode",
-            "cameraSn",
-            "shootTime",
-            "snapUseDept",
-            "snapUseName",
-            "auditStatus",
-            "auditTime",
-          ],
-          sheetHeader: [
-            "机房编码",
-            "站址地区",
-            "项目经理",
-            "场景名称",
-            "场景链接",
-            "场景码",
-            "相机SN码",
-            "拍摄时间",
-            "领用单位",
-            "领用人员",
-            "审核状态",
-            "审核时间",
-          ],
-          columnWidths: [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10],
-        },
-      ],
-    };
+    const res = await B2_APIgetlistAll({
+      ...tableSelect,
+      site: tableSelect.site ? tableSelect.site[1] : null,
+      pageNum: 1,
+      pageSize: 99999,
+    });
+    if (res.code === 0) {
+      const option = {
+        fileName: name,
+        datas: [
+          {
+            sheetData: res.data.records.map((v: B2tableType) => ({
+              roomNum: v.roomNum || "(空)",
+              myCity:
+                !v.province && !v.city ? "(空)" : `${v.province} - ${v.city}`,
+              pmName: v.creatorId === 1 ? "管理员" : v.pmName || "(空)",
+              sceneName: v.sceneName || "(空)",
+              link: v.link || "(空)",
+              sceneCode: v.sceneCode || "(空)",
+              cameraSn: v.cameraSn || "(空)",
+              shootTime: v.shootTime || "(空)",
+              snapUseDept: v.snapUseDept || "(空)",
+              snapUseName: v.snapUseName || "(空)",
+              auditStatus:
+                Reflect.get(B1options1Obj, v.auditStatus) || "(空)",
+              auditTime: v.auditTime || "(空)",
+            })),
+            sheetName: name,
+            sheetFilter: [
+              "roomNum",
+              "myCity",
+              "pmName",
+              "sceneName",
+              "link",
+              "sceneCode",
+              "cameraSn",
+              "shootTime",
+              "snapUseDept",
+              "snapUseName",
+              "auditStatus",
+              "auditTime",
+            ],
+            sheetHeader: [
+              "机房编码",
+              "站址地区",
+              "项目经理",
+              "场景名称",
+              "场景链接",
+              "场景码",
+              "相机SN码",
+              "拍摄时间",
+              "领用单位",
+              "领用人员",
+              "审核状态",
+              "审核时间",
+            ],
+            columnWidths: [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10],
+          },
+        ],
+      };
 
-    const toExcel = new ExportJsonExcel(option); //new
-    toExcel.saveExcel(); //保存
-  }, [B2TableList.list]);
+      const toExcel = new ExportJsonExcel(option); //new
+      toExcel.saveExcel(); //保存
+    }
+  }, [B2TableList.list, tableSelect]);
 
   // 审核弹窗的信息
   const [auditInfo, setAuditInfo] = useState({
@@ -436,7 +446,7 @@ function B2Scene() {
           pagination={{
             showQuickJumper: true,
             position: ["bottomCenter"],
-            // showSizeChanger: true,
+            showSizeChanger: true,
             current: tableSelect.pageNum,
             pageSize: tableSelect.pageSize,
             total: B2TableList.total,

+ 4 - 4
src/pages/B3Push/index.tsx

@@ -280,9 +280,9 @@ function B3Push() {
               <span>场景推送状态:</span>
               <Select
                 style={{ width: 194 }}
-                value={tableSelect.jsonStatus}
+                value={tableSelect.pushStatus}
                 onChange={(e) =>
-                  setTableSelect({ ...tableSelect, jsonStatus: e, pageNum: 1 })
+                  setTableSelect({ ...tableSelect, pushStatus: e, pageNum: 1 })
                 }
                 options={B1options2}
               />
@@ -291,9 +291,9 @@ function B3Push() {
               <span>Json推送状态:</span>
               <Select
                 style={{ width: 194 }}
-                value={tableSelect.pushStatus}
+                value={tableSelect.jsonStatus}
                 onChange={(e) =>
-                  setTableSelect({ ...tableSelect, pushStatus: e, pageNum: 1 })
+                  setTableSelect({ ...tableSelect, jsonStatus: e, pageNum: 1 })
                 }
                 options={B1options2}
               />

+ 3 - 1
src/pages/Layout/index.tsx

@@ -19,11 +19,13 @@ import { passWordEditAPI } from "@/store/action/layout";
 import { getTokenInfo, removeTokenInfo } from "@/utils/storage";
 import { MessageFu } from "@/utils/message";
 import logoImg from "@/assets/img/logo.png";
+import logoImg2 from "@/assets/img/logo2.png";
 import NotFound from "@/components/NotFound";
 
 import { RouterType, RouterTypeRow } from "@/types";
 import tabLeftArr from "./data";
 import { C1_APIgetInfo } from "@/store/action/C1User";
+import { envTxtRes } from "@/utils/envTxt";
 
 function Layout() {
   // 左侧菜单 和 路由 信息
@@ -144,7 +146,7 @@ function Layout() {
       {/* 左边 */}
       <div className="layoutLeft">
         <div className="layoutLeftTop">
-          <img src={logoImg} alt="" />
+          <img src={envTxtRes === "四维" ? logoImg : logoImg2} alt="" />
         </div>
         {/* 左边主体 */}
         <div className="layoutLeftMain">

+ 4 - 0
src/pages/Login/index.module.scss

@@ -11,6 +11,10 @@
       background-size: 100% 100%;
     }
 
+    .mainLeft2{
+      background-image: url("../../assets/img/loginBac2.png");
+    }
+
 
     .mainRight {
       width: 50%;

+ 15 - 3
src/pages/Login/index.tsx

@@ -10,6 +10,9 @@ import history from "@/utils/history";
 import { MessageFu } from "@/utils/message";
 import { userLoginAPI } from "@/store/action/layout";
 import loginLogoImg from "@/assets/img/logo.png";
+import loginLogoImg2 from "@/assets/img/logo2.png";
+import { envTxtRes } from "@/utils/envTxt";
+import classNames from "classnames";
 
 export default function Login() {
   // 账号密码
@@ -38,7 +41,7 @@ export default function Login() {
       MessageFu.success("登录成功");
 
       // 检查密码是不是默认密码,是的话给提示
-      if (passWord === '123456') {
+      if (passWord === "123456") {
         window.setTimeout(() => {
           MessageFu.warning("您的密码还是默认密码,请尽快修改!");
         }, 1000);
@@ -53,10 +56,19 @@ export default function Login() {
 
   return (
     <div className={styles.Login}>
-      <div className="mainLeft"></div>
+      <div
+        className={classNames(
+          "mainLeft",
+          envTxtRes === "四维" ? "" : "mainLeft2"
+        )}
+      ></div>
       <div className="mainRight">
         <div className="rightMain">
-          <img className="loginLogo" src={loginLogoImg} alt="" />
+          <img
+            className="loginLogo"
+            src={envTxtRes === "四维" ? loginLogoImg : loginLogoImg2}
+            alt=""
+          />
           <div className="mainTitle">铁塔3D数据管理</div>
           {/* 账号密码输入框 */}
           <div className="inputBox">

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

@@ -17,6 +17,14 @@ export const B2_APIgetlist = (data: any) => {
 };
 
 /**
+ * 获取 进度统计 表格列表(导出表格)
+ */
+export const B2_APIgetlistAll = (data:any) => {
+  return http.post("cms/scene/pageList", data);
+};
+
+
+/**
  * 删除 单个表格数据
  */
 export const B2_APIremove = (id: number) => {

+ 3 - 0
src/utils/envTxt.ts

@@ -0,0 +1,3 @@
+// 千寻还是四维的环境
+// @ts-ignore
+export const envTxtRes = envTxt;

+ 3 - 3
src/utils/history.ts

@@ -1,3 +1,3 @@
-import { createHashHistory  } from 'history'
-const history = createHashHistory()
-export default history
+import { createHashHistory } from "history";
+const history = createHashHistory();
+export default history;