shaogen1995 1 年之前
父节点
当前提交
f82b456bfb

二进制
public/favicon.ico


二进制
src/assets/img/loginBac.jpg


二进制
src/assets/img/logo2.png


+ 2 - 2
src/assets/styles/base.css

@@ -40,8 +40,8 @@ textarea {
 }
 }
 /* 主题色 */
 /* 主题色 */
 :root {
 :root {
-  --themeColor: #0A3B40;
-  --themeColor2: #2CD196;
+  --themeColor: #9d4f0b;
+  --themeColor2: #e2d2a9;
 }
 }
 /* 找不到页面 */
 /* 找不到页面 */
 .noFindPage {
 .noFindPage {

+ 2 - 2
src/assets/styles/base.less

@@ -50,8 +50,8 @@ textarea {
 
 
 /* 主题色 */
 /* 主题色 */
 :root {
 :root {
-  --themeColor:  #0A3B40;
-  --themeColor2: #2CD196;
+  --themeColor:  #9d4f0b;
+  --themeColor2: #e2d2a9;
 }
 }
 
 
 
 

+ 2 - 2
src/components/ZupVideos/index.tsx

@@ -23,7 +23,7 @@ type Props = {
   myUrl: string; //请求地址
   myUrl: string; //请求地址
   fileCheck?: boolean; //是否检验
   fileCheck?: boolean; //是否检验
   format?: string[]; //上传格式 默认["video/mp4"]
   format?: string[]; //上传格式 默认["video/mp4"]
-  formatTxt?: string; //上传图片提示
+  formatTxt?: string; //上传提示
   checkTxt?: string;
   checkTxt?: string;
   upTxt?: string;
   upTxt?: string;
   isLook?: boolean; //是不是查看
   isLook?: boolean; //是不是查看
@@ -72,7 +72,7 @@ function ZupVideos(
         const fd = new FormData();
         const fd = new FormData();
 
 
         fd.append("type", "video");
         fd.append("type", "video");
-        fd.append("db", "true");
+        fd.append("isDb", "true");
         fd.append("dirCode", dirCode);
         fd.append("dirCode", dirCode);
         fd.append("file", filesInfo);
         fd.append("file", filesInfo);
 
 

+ 1 - 1
src/index.tsx

@@ -25,7 +25,7 @@ root.render(
     locale={locale}
     locale={locale}
     theme={{
     theme={{
       token: {
       token: {
-        colorPrimary: " #0A3B40",
+        colorPrimary: " #9d4f0b",
       },
       },
     }}
     }}
   >
   >

+ 12 - 12
src/pages/Layout/data.ts

@@ -7,43 +7,43 @@ const tabLeftArr: RouterType = [
     name: "内容发布",
     name: "内容发布",
     son: [
     son: [
       {
       {
-        id: 100,
+        id: 101,
         name: "宁博概览",
         name: "宁博概览",
         path: "/",
         path: "/",
         Com: React.lazy(() => import("../A1survey")),
         Com: React.lazy(() => import("../A1survey")),
       },
       },
       {
       {
-        id: 200,
+        id: 102,
         name: "宁博动态",
         name: "宁博动态",
         path: "/dynamic",
         path: "/dynamic",
         Com: React.lazy(() => import("../A2dynamic")),
         Com: React.lazy(() => import("../A2dynamic")),
       },
       },
       {
       {
-        id: 300,
+        id: 103,
         name: "宁博文创",
         name: "宁博文创",
         path: "/culture",
         path: "/culture",
         Com: React.lazy(() => import("../A3culture")),
         Com: React.lazy(() => import("../A3culture")),
       },
       },
       {
       {
-        id: 400,
+        id: 104,
         name: "宁博藏珍",
         name: "宁博藏珍",
         path: "/goods",
         path: "/goods",
         Com: React.lazy(() => import("../A4goods")),
         Com: React.lazy(() => import("../A4goods")),
       },
       },
       {
       {
-        id: 500,
+        id: 105,
         name: "宁博展览",
         name: "宁博展览",
         path: "/show",
         path: "/show",
         Com: React.lazy(() => import("../A5show")),
         Com: React.lazy(() => import("../A5show")),
       },
       },
       {
       {
-        id: 600,
+        id: 106,
         name: "宁博活动",
         name: "宁博活动",
         path: "/activity",
         path: "/activity",
         Com: React.lazy(() => import("../A6activity")),
         Com: React.lazy(() => import("../A6activity")),
       },
       },
       {
       {
-        id: 700,
+        id: 107,
         name: "志愿者之家",
         name: "志愿者之家",
         path: "/volunteer",
         path: "/volunteer",
         Com: React.lazy(() => import("../A7volunteer")),
         Com: React.lazy(() => import("../A7volunteer")),
@@ -55,19 +55,19 @@ const tabLeftArr: RouterType = [
     name: "预约记录",
     name: "预约记录",
     son: [
     son: [
       {
       {
-        id: 800,
+        id: 201,
         name: "展馆预约",
         name: "展馆预约",
         path: "/orderz",
         path: "/orderz",
         Com: React.lazy(() => import("../B1orderz")),
         Com: React.lazy(() => import("../B1orderz")),
       },
       },
       {
       {
-        id: 900,
+        id: 202,
         name: "活动预约",
         name: "活动预约",
         path: "/orderh",
         path: "/orderh",
         Com: React.lazy(() => import("../B2orderh")),
         Com: React.lazy(() => import("../B2orderh")),
       },
       },
       {
       {
-        id: 1000,
+        id: 203,
         name: "志愿者预约",
         name: "志愿者预约",
         path: "/ordery",
         path: "/ordery",
         Com: React.lazy(() => import("../B3ordery")),
         Com: React.lazy(() => import("../B3ordery")),
@@ -79,7 +79,7 @@ const tabLeftArr: RouterType = [
     name: "预约管理",
     name: "预约管理",
     son: [
     son: [
       {
       {
-        id: 1100,
+        id: 301,
         name: "展馆预约设置",
         name: "展馆预约设置",
         path: "/orderset",
         path: "/orderset",
         Com: React.lazy(() => import("../C1orderset")),
         Com: React.lazy(() => import("../C1orderset")),
@@ -91,7 +91,7 @@ const tabLeftArr: RouterType = [
     name: "系统设置",
     name: "系统设置",
     son: [
     son: [
       {
       {
-        id: 1200,
+        id: 401,
         name: "栏目管理",
         name: "栏目管理",
         path: "/column",
         path: "/column",
         Com: React.lazy(() => import("../Z0column")),
         Com: React.lazy(() => import("../Z0column")),

+ 5 - 5
src/pages/Layout/index.module.scss

@@ -9,15 +9,15 @@
       position: relative;
       position: relative;
       width: 220px;
       width: 220px;
       height: 100%;
       height: 100%;
-      background-color: #0A3B40;
+      background-color: #9d4f0b;
 
 
 
 
       .layoutLeftTop {
       .layoutLeftTop {
         text-align: center;
         text-align: center;
-        padding: 20px 0 20px;
+        padding: 20px 0px 20px;
 
 
         &>img {
         &>img {
-          width: 200px;
+          width: 208px;
         }
         }
       }
       }
 
 
@@ -29,13 +29,13 @@
             height: 50px;
             height: 50px;
             line-height: 50px;
             line-height: 50px;
             padding-left: 40px;
             padding-left: 40px;
-            color: #fff;
+            color: var(--themeColor2);
             // opacity: .8;
             // opacity: .8;
           }
           }
 
 
           .layoutLRowBoxRow {
           .layoutLRowBoxRow {
             opacity: .8;
             opacity: .8;
-            color: #fff;
+            color: var(--themeColor2);
             text-align: center;
             text-align: center;
             cursor: pointer;
             cursor: pointer;
 
 

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

@@ -18,6 +18,8 @@ import NotFound from "@/components/NotFound";
 import { RouterType, RouterTypeRow } from "@/types";
 import { RouterType, RouterTypeRow } from "@/types";
 import tabLeftArr from "./data";
 import tabLeftArr from "./data";
 import MyPopconfirm from "@/components/MyPopconfirm";
 import MyPopconfirm from "@/components/MyPopconfirm";
+import { Z1_APIgetAuthByUserId } from "@/store/action/Z1user";
+import { UserListType } from "../Z1user/Z1auth";
 
 
 function Layout() {
 function Layout() {
   // 当前路径选中的左侧菜单
   // 当前路径选中的左侧菜单
@@ -36,7 +38,18 @@ function Layout() {
   const getUserAuthFu = useCallback(async () => {
   const getUserAuthFu = useCallback(async () => {
     const userInfo = getTokenInfo().user;
     const userInfo = getTokenInfo().user;
 
 
-      const isOkIdArr =[100,200,300,400,500,600,700,800,900,1000,1100,1200]
+    const res = await Z1_APIgetAuthByUserId(userInfo.id);
+    if (res.code === 0) {
+      const isOkIdArr: number[] = [
+        // 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200,
+      ];
+      const tempList: UserListType[] = res.data || [];
+      // console.log(123, tempList);
+      tempList.forEach((v) => {
+        v.children.forEach((c) => {
+          if (c.authority) isOkIdArr.push(c.id);
+        });
+      });
       // 是管理员
       // 是管理员
       if (userInfo.isAdmin === 1) {
       if (userInfo.isAdmin === 1) {
         isOkIdArr.push(2100);
         isOkIdArr.push(2100);
@@ -71,6 +84,7 @@ function Layout() {
       }));
       }));
 
 
       setList(resList);
       setList(resList);
+    }
   }, []);
   }, []);
 
 
   useEffect(() => {
   useEffect(() => {

+ 13 - 12
src/pages/Login/index.module.scss

@@ -7,6 +7,7 @@
   :global {
   :global {
 
 
     .loginLogo {
     .loginLogo {
+      display: none;
       position: absolute;
       position: absolute;
       top: 30%;
       top: 30%;
       left: 5%;
       left: 5%;
@@ -20,7 +21,7 @@
       top: 50%;
       top: 50%;
       transform: translateY(-50%);
       transform: translateY(-50%);
       width: 530px;
       width: 530px;
-      background-color: rgba(10, 59, 64, 0.80);
+      background-color: rgba(226, 210, 169, 0.86);
       display: flex;
       display: flex;
       justify-content: center;
       justify-content: center;
       align-items: center;
       align-items: center;
@@ -39,22 +40,22 @@
 
 
           input::-webkit-input-placeholder {
           input::-webkit-input-placeholder {
             /* WebKit browsers */
             /* WebKit browsers */
-            color: rgba(255, 255, 255, .5);
+            color: rgba(157, 79, 11, 0.6);
           }
           }
 
 
           input:-moz-placeholder {
           input:-moz-placeholder {
             /* Mozilla Firefox 4 to 18 */
             /* Mozilla Firefox 4 to 18 */
-            color: rgba(255, 255, 255, .5);
+            color: rgba(157, 79, 11, 0.6);
           }
           }
 
 
           input::-moz-placeholder {
           input::-moz-placeholder {
             /* Mozilla Firefox 19+ */
             /* Mozilla Firefox 19+ */
-            color: rgba(255, 255, 255, .5);
+            color: rgba(157, 79, 11, 0.6);
           }
           }
 
 
           input:-ms-input-placeholder {
           input:-ms-input-placeholder {
             /* Internet Explorer 10+ */
             /* Internet Explorer 10+ */
-            color: rgba(255, 255, 255, .5);
+            color: rgba(157, 79, 11, 0.6);
           }
           }
 
 
 
 
@@ -63,7 +64,7 @@
             margin: 30px auto;
             margin: 30px auto;
 
 
             .ant-input-suffix .ant-input-password-icon {
             .ant-input-suffix .ant-input-password-icon {
-              color: var(--themeColor2);
+              color: var(--themeColor);
               font-size: 22px;
               font-size: 22px;
             }
             }
           }
           }
@@ -106,7 +107,7 @@
 
 
           input:-webkit-autofill {
           input:-webkit-autofill {
             font-size: 18px !important;
             font-size: 18px !important;
-            -webkit-text-fill-color: #fff !important;
+            -webkit-text-fill-color: var(--themeColor) !important;
             background-image: none;
             background-image: none;
             -webkit-box-shadow: 0 0 0px 1000px transparent inset !important; //填充阴影,可以用来遮住背景色
             -webkit-box-shadow: 0 0 0px 1000px transparent inset !important; //填充阴影,可以用来遮住背景色
             background-color: transparent;
             background-color: transparent;
@@ -120,15 +121,15 @@
             width: 100%;
             width: 100%;
             height: 60px;
             height: 60px;
             border: none;
             border: none;
-            border-bottom: 1px solid var(--themeColor2);
+            border-bottom: 1px solid var(--themeColor);
             border-radius: 0;
             border-radius: 0;
-            color: var(--themeColor2);
+            color: var(--themeColor);
 
 
             .ant-input {
             .ant-input {
               background-color: transparent;
               background-color: transparent;
               width: 100%;
               width: 100%;
               height: 60px;
               height: 60px;
-              color: #fff;
+              color: var(--themeColor);
             }
             }
           }
           }
 
 
@@ -140,8 +141,8 @@
         .loginBtn {
         .loginBtn {
 
 
           .ant-btn {
           .ant-btn {
-            color: black;
-            background-color: var(--themeColor2);
+            color: #fff;
+            background-color: var(--themeColor);
             border-radius: 25px;
             border-radius: 25px;
             font-size: 24px;
             font-size: 24px;
             width: 375px;
             width: 375px;

+ 47 - 17
src/pages/Z1user/Z1auth.tsx

@@ -7,10 +7,13 @@ import classNmaes from "classnames";
 import { MessageFu } from "@/utils/message";
 import { MessageFu } from "@/utils/message";
 
 
 export type UserListType = {
 export type UserListType = {
-  authority: boolean;
   id: number;
   id: number;
   name: string;
   name: string;
-  resourceType: string;
+  children: {
+    id: number;
+    name: string;
+    authority: boolean;
+  }[];
 };
 };
 
 
 type Props = {
 type Props = {
@@ -32,27 +35,39 @@ function Z1auth({ authInfo, closeFu }: Props) {
 
 
   // 多选框变化
   // 多选框变化
   const onChange = useCallback(
   const onChange = useCallback(
-    (val: boolean, id: number) => {
+    (val: boolean, id1: number, id2: number) => {
       setList(
       setList(
         list.map((v) => ({
         list.map((v) => ({
           ...v,
           ...v,
-          authority: v.id === id ? val : v.authority,
+          children:
+            v.id === id1
+              ? v.children.map((c) => ({
+                  ...c,
+                  authority: c.id === id2 ? val : c.authority,
+                }))
+              : v.children,
         }))
         }))
       );
       );
     },
     },
     [list]
     [list]
   );
   );
 
 
-  // 至少选中一个
-  const isOneRes = useMemo(() => {
-    return list.filter((v) => v.authority).length <= 0;
+  // 二级选中的数组id集合
+  const checkIds = useMemo(() => {
+    const arr: number[] = [];
+    list.forEach((v) => {
+      v.children.forEach((c) => {
+        if (c.authority) arr.push(c.id);
+      });
+    });
+    return arr;
   }, [list]);
   }, [list]);
 
 
   // 点击确定
   // 点击确定
   const btnOkFu = useCallback(async () => {
   const btnOkFu = useCallback(async () => {
     const obj = {
     const obj = {
       userId: authInfo.id,
       userId: authInfo.id,
-      resources: list.filter((c) => c.authority).map((v) => v.id),
+      resources: checkIds,
     };
     };
 
 
     const res = await Z1_APIsetAuth(obj);
     const res = await Z1_APIsetAuth(obj);
@@ -61,7 +76,7 @@ function Z1auth({ authInfo, closeFu }: Props) {
       MessageFu.success("授权成功!");
       MessageFu.success("授权成功!");
       closeFu();
       closeFu();
     }
     }
-  }, [authInfo.id, closeFu, list]);
+  }, [authInfo.id, checkIds, closeFu]);
 
 
   return (
   return (
     <Modal
     <Modal
@@ -75,21 +90,36 @@ function Z1auth({ authInfo, closeFu }: Props) {
       <div className="Z1aEmain">
       <div className="Z1aEmain">
         {list.map((v) => (
         {list.map((v) => (
           <div key={v.id} className="Z1aRow">
           <div key={v.id} className="Z1aRow">
-            <Checkbox
-              checked={v.authority}
-              onChange={(e) => onChange(e.target.checked, v.id)}
-            >
-              {v.name}
-            </Checkbox>
+            <div className="Z1aRow1">{v.name}</div>
+            <div className="Z1aRow2">
+              {v.children.map((c) => (
+                <Checkbox
+                  key={c.id}
+                  checked={c.authority}
+                  onChange={(e) => onChange(e.target.checked, v.id, c.id)}
+                >
+                  {c.name}
+                </Checkbox>
+              ))}
+            </div>
           </div>
           </div>
         ))}
         ))}
 
 
-        <div className={classNmaes("Z1aErr", isOneRes ? "Z1aErrAc" : "")}>
+        <div
+          className={classNmaes(
+            "Z1aErr",
+            checkIds.length <= 0 ? "Z1aErrAc" : ""
+          )}
+        >
           至少选中一个
           至少选中一个
         </div>
         </div>
 
 
         <div className="Z1aEbtn">
         <div className="Z1aEbtn">
-          <Button type="primary" onClick={btnOkFu} disabled={isOneRes}>
+          <Button
+            type="primary"
+            onClick={btnOkFu}
+            disabled={checkIds.length <= 0}
+          >
             提交
             提交
           </Button>
           </Button>
           &emsp;
           &emsp;

+ 10 - 0
src/pages/Z1user/index.module.scss

@@ -38,6 +38,16 @@
 
 
       .Z1aRow {
       .Z1aRow {
         margin-bottom: 10px;
         margin-bottom: 10px;
+        display: flex;
+
+        .Z1aRow1 {
+          width: 90px;
+          font-weight: 700;
+        }
+
+        .Z1aRow2 {
+          width: calc(100% - 90px);
+        }
       }
       }
 
 
       .Z1aErr {
       .Z1aErr {

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

@@ -59,3 +59,10 @@ export const Z1_APIgetAuthByUserId = (userId: number) => {
 export const Z1_APIsetAuth = (data: any) => {
 export const Z1_APIsetAuth = (data: any) => {
   return http.post("sys/user/perm/auth", data);
   return http.post("sys/user/perm/auth", data);
 };
 };
+
+/**
+ * 角色授权-获取 初始页面获取
+ */
+export const Z1_APIgetAuthBase = () => {
+  return http.get("sys/user/perm/getTree");
+};