shaogen1995 2 years ago
parent
commit
f733d57a62

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

@@ -72,6 +72,7 @@ textarea {
 #root .iconHoverTit {
   display: flex;
   align-items: center;
+  justify-content: center;
 }
 #root .iconHoverTit .iconHoverTitTxt {
   background-color: var(--themeColor);

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

@@ -86,6 +86,7 @@ textarea {
   .iconHoverTit{
     display: flex;
     align-items: center;
+    justify-content: center;
     .iconHoverTitTxt{
       background-color: var(--themeColor);
       color: #fff;

+ 0 - 3
src/pages/A1Project/A1Outer/A1ORenFile/index.module.scss

@@ -4,9 +4,6 @@
       display: none;
     }
 
-    .ant-modal {
-      width: 800px !important;
-    }
 
     .A1ORMain {
       width: 100%;

+ 19 - 0
src/pages/A3User/UserAdd/index.module.scss

@@ -0,0 +1,19 @@
+.userAdd {
+  :global {
+    .ant-modal-close {
+      display: none;
+    }
+
+    .userAddMain {
+      border-top: 1px solid #999999;
+      padding-top: 15px;
+      width: 100%;
+
+      .passTit {
+        color: #ff4d4f;
+        font-size: 14px;
+        padding-left: 98px;
+      }
+    }
+  }
+}

+ 159 - 0
src/pages/A3User/UserAdd/index.tsx

@@ -0,0 +1,159 @@
+import { RootState } from "@/store";
+import { getUserInfoByIdAPI, userSaveAPI } from "@/store/action/A3User";
+import { SaveUserType } from "@/types";
+import { MessageFu } from "@/utils/message";
+import {
+  Button,
+  Form,
+  FormInstance,
+  Input,
+  Modal,
+  Popconfirm,
+  Select,
+} from "antd";
+import React, { useCallback, useEffect, useRef } from "react";
+import { useSelector } from "react-redux";
+import styles from "./index.module.scss";
+
+type Props = {
+  id: any;
+  closePage: () => void;
+  upTableList: () => void;
+  addTableList: () => void;
+};
+
+function UserAdd({ id, closePage, upTableList, addTableList }: Props) {
+  // 设置表单初始数据(区分编辑和新增)
+  const FormBoxRef = useRef<FormInstance>(null);
+
+  const getInfoInAPIFu = useCallback(async (id: number) => {
+    const res = await getUserInfoByIdAPI(id);
+    FormBoxRef.current?.setFieldsValue(res.data);
+    console.log("是编辑,在这里发请求拿数据", res);
+  }, []);
+
+  // 没有通过校验
+  const onFinishFailed = useCallback(() => {
+    // return MessageFu.warning("有表单不符号规则!");
+  }, []);
+
+  useEffect(() => {
+    if (id) getInfoInAPIFu(id);
+    else {
+      FormBoxRef.current?.setFieldsValue({});
+    }
+  }, [getInfoInAPIFu, id]);
+
+  // 从仓库获取角色下拉列表信息
+  const roleList = useSelector(
+    (state: RootState) => state.A3User.roleList
+  );
+
+  // 通过校验点击确定
+  const onFinish = useCallback(
+    async (values: any) => {
+      const obj: SaveUserType = {
+        ...values,
+        id: id ? id : null,
+      };
+
+      const res: any = await userSaveAPI(obj);
+
+      if (res.code === 0) {
+        MessageFu.success(id ? "编辑成功!" : "新增成功!");
+        if (id) upTableList();
+        else addTableList();
+
+        closePage();
+      }
+      console.log("通过校验,点击确定");
+    },
+    [addTableList, closePage, id, upTableList]
+  );
+
+  return (
+    <Modal
+      wrapClassName={styles.userAdd}
+      destroyOnClose
+      open={true}
+      title={id ? "编辑用户" : "新增用户"}
+      footer={
+        [] // 设置footer为空,去掉 取消 确定默认按钮
+      }
+    >
+      <div className="userAddMain">
+        <Form
+          ref={FormBoxRef}
+          name="basic"
+          labelCol={{ span: 5 }}
+          onFinish={onFinish}
+          onFinishFailed={onFinishFailed}
+          autoComplete="off"
+        >
+          <Form.Item
+            label="账号名"
+            name="userName"
+            rules={[{ required: true, message: "请输入账号名!" }]}
+            getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
+          >
+            <Input
+              disabled={id}
+              maxLength={15}
+              showCount
+              placeholder="请输入内容"
+            />
+          </Form.Item>
+
+          <Form.Item
+            label="用户昵称"
+            name="nickName"
+            rules={[{ required: true, message: "请输入用户昵称!" }]}
+            getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
+          >
+            <Input maxLength={8} showCount placeholder="请输入内容" />
+          </Form.Item>
+
+          <Form.Item
+            label="用户角色"
+            name="roleId"
+            rules={[{ required: true, message: "请选择角色!" }]}
+          >
+            <Select placeholder="请选择" options={roleList} />
+          </Form.Item>
+
+          <Form.Item
+            label="真实姓名"
+            name="realName"
+            rules={[{ required: true, message: "请输入真实姓名!" }]}
+            getValueFromEvent={(e) => e.target.value.replace(/\s+/g, "")}
+          >
+            <Input maxLength={8} showCount placeholder="请输入内容" />
+          </Form.Item>
+
+          {id ? null : <div className="passTit">* 默认密码 123456</div>}
+
+          {/* 确定和取消按钮 */}
+          <br />
+          <Form.Item wrapperCol={{ offset: 9, span: 16 }}>
+            <Button type="primary" htmlType="submit">
+              提交
+            </Button>
+            &emsp;
+            <Popconfirm
+              title="放弃编辑后,信息将不会保存!"
+              okText="放弃"
+              cancelText="取消"
+              onConfirm={closePage}
+            >
+              <Button>取消</Button>
+            </Popconfirm>
+          </Form.Item>
+        </Form>
+      </div>
+    </Modal>
+  );
+}
+
+const MemoUserAdd = React.memo(UserAdd);
+
+export default MemoUserAdd;

+ 30 - 3
src/pages/A3User/index.module.scss

@@ -1,5 +1,32 @@
-.A3User{
-  :global{
-    
+.A3User {
+  :global {
+    .selectBox {
+      border-radius: 10px;
+      padding: 20px 15px;
+      background-color: #fff;
+      display: flex;
+      .selectBoxRow{
+        margin-right: 30px;
+      }
+    }
+    .tableBox {
+      border-radius: 10px;
+      overflow: hidden;
+      margin-top: 15px;
+      height: calc(100% - 85px);
+      background-color: #fff;
+
+      .ant-table-body {
+        height: 617px;
+        overflow-y: auto !important;
+        overflow-y: overlay !important;
+
+        .ant-table-row {
+          .ant-table-cell {
+            padding: 10px;
+          }
+        }
+      }
+    }
   }
 }

+ 289 - 5
src/pages/A3User/index.tsx

@@ -1,12 +1,296 @@
-import React from "react";
+import { RootState } from "@/store";
+import {
+  getUserListAPI,
+  getUserRoleAPI,
+  userPassResetAPI,
+  userRemoveAPI,
+} from "@/store/action/A3User";
+import { UserTableAPIType, UserTableListType } from "@/types";
+import { MessageFu } from "@/utils/message";
+import { Input, Button, Table, Popconfirm, Select } from "antd";
+import React, {
+  useCallback,
+  useEffect,
+  useMemo,
+  useRef,
+  useState,
+} from "react";
+import { useDispatch, useSelector } from "react-redux";
 import styles from "./index.module.scss";
- function A3User() {
-  
+import UserAdd from "./UserAdd";
+
+function A3User() {
+  const dispatch = useDispatch();
+
+  const pageNumRef = useRef(1);
+  const pagePageRef = useRef(10);
+
+  // 顶部筛选
+  const [tableSelect, setTableSelect] = useState<UserTableAPIType>({
+    deptId: "",
+    pageNum: 1,
+    pageSize: 10,
+    roleId: "",
+    searchKey: "",
+  });
+
+  // 进来用户管理页面获取角色的下拉列表
+  useEffect(() => {
+    dispatch(getUserRoleAPI());
+  }, [dispatch]);
+
+  // 封装发送请求的函数
+
+  const getList = useCallback(async () => {
+    const data = {
+      ...tableSelect,
+      pageNum: pageNumRef.current,
+    };
+    dispatch(getUserListAPI(data));
+  }, [dispatch, tableSelect]);
+
+  // 当前页码统一
+  useEffect(() => {
+    pageNumRef.current = tableSelect.pageNum;
+    pagePageRef.current = tableSelect.pageSize;
+  }, [tableSelect.pageNum, tableSelect.pageSize]);
+
+  // 防止发送了2次请求来对应页码
+
+  const getListRef = useRef(-1);
+
+  useEffect(() => {
+    clearTimeout(getListRef.current);
+    getListRef.current = window.setTimeout(() => {
+      getList();
+    }, 100);
+  }, [getList, tableSelect]);
+
+  // 用户昵称的输入
+  const nameTime = useRef(-1);
+  const nameChange = useCallback(
+    (e: React.ChangeEvent<HTMLInputElement>) => {
+      clearTimeout(nameTime.current);
+      nameTime.current = window.setTimeout(() => {
+        setTableSelect({
+          ...tableSelect,
+          searchKey: e.target.value,
+          pageNum: 1,
+        });
+      }, 500);
+    },
+    [tableSelect]
+  );
+
+  // 点击重置
+  const [inputKey, setInputKey] = useState(1);
+  const resetSelectFu = useCallback(() => {
+    // 把2个输入框和时间选择器清空
+    setInputKey(Date.now());
+    setTableSelect({
+      deptId: "",
+      pageNum: 1,
+      pageSize: 10,
+      roleId: "",
+      searchKey: "",
+    });
+  }, []);
+
+  // 从仓库中获取表格数据
+  const tableInfo = useSelector((state: RootState) => state.A3User.tableInfo);
+
+  // 页码变化
+  const paginationChange = useCallback(
+    () => (pageNum: number, pageSize: number) => {
+      pageNumRef.current = pageNum;
+      pagePageRef.current = pageSize;
+      setTableSelect({ ...tableSelect, pageNum, pageSize });
+    },
+    [tableSelect]
+  );
+
+  // 点击删除
+  const delTableFu = useCallback(
+    async (id: number) => {
+      const res: any = await userRemoveAPI(id);
+      if (res.code === 0) {
+        MessageFu.success("删除成功!");
+        getList();
+      }
+    },
+    [getList]
+  );
+
+  // 点击重置密码
+  const resetPassFu = useCallback(async (id: number) => {
+    const res: any = await userPassResetAPI(id);
+    if (res.code === 0) MessageFu.success("重置成功!");
+  }, []);
+
+  // 0------------点击新增或者编辑出来的页面
+  const [editPageShow, setEditPageShow] = useState(false);
+  const editId = useRef(0);
+
+  const openEditPageFu = useCallback(
+    (id: number) => {
+      if (id === 0 && tableInfo.list.length >= 50)
+        return MessageFu.warning("最多支持50个用户!");
+
+      editId.current = id;
+      setEditPageShow(true);
+    },
+    [tableInfo.list.length]
+  );
+
+  const columns = useMemo(() => {
+    return [
+      // {
+      //   width: 80,
+      //   title: "序号",
+      //   render: (text: any, record: any, index: any) =>
+      //     index + 1 + (pageNumRef.current - 1) * pagePageRef.current,
+      // },
+      {
+        title: "用户名",
+        dataIndex: "userName",
+      },
+      {
+        title: "所属部门",
+        dataIndex: "nickName",
+      },
+      {
+        title: "角色",
+        dataIndex: "roleName",
+      },
+      {
+        title: "真实姓名",
+        dataIndex: "realName",
+      },
+      {
+        title: "创建日期",
+        dataIndex: "createTime",
+      },
+
+      {
+        title: "操作",
+        render: (item: UserTableListType) => {
+          return item.isAdmin === 1 ? (
+            "-"
+          ) : (
+            <>
+              <Popconfirm
+                title="密码重制后为123456,是否重置?"
+                okText="重置"
+                cancelText="取消"
+                onConfirm={() => resetPassFu(item.id!)}
+              >
+                <Button size="small" type="text">
+                  重置密码
+                </Button>
+              </Popconfirm>
+
+              <Button
+                size="small"
+                type="text"
+                onClick={() => openEditPageFu(item.id!)}
+              >
+                编辑
+              </Button>
+              <Popconfirm
+                title="删除后无法恢复,是否删除?"
+                okText="删除"
+                cancelText="取消"
+                onConfirm={() => delTableFu(item.id!)}
+              >
+                <Button size="small" type="text" danger>
+                  删除
+                </Button>
+              </Popconfirm>
+            </>
+          );
+        },
+      },
+    ];
+  }, [delTableFu, openEditPageFu, resetPassFu]);
+
   return (
     <div className={styles.A3User}>
-      <h1>A3User</h1>
+      <div className="pageTitle">用户管理</div>
+      <div className="userTop">
+        <div className="selectBox">
+          <div className="selectBoxRow">
+            <span>搜索项:</span>
+            <Input
+              key={inputKey}
+              maxLength={15}
+              style={{ width: 240 }}
+              placeholder="请输入用户名/真实姓名"
+              allowClear
+              onChange={(e) => nameChange(e)}
+            />
+          </div>
+
+          <div className="selectBoxRow">
+            <span>所属部门:</span>
+            <Select
+              style={{ width: 220 }}
+              placeholder="请选择"
+              value={tableSelect.deptId}
+              onChange={(e) => setTableSelect({ ...tableSelect, deptId: e })}
+              options={[{ value: "", label: "全部" }]}
+            />
+          </div>
+
+          <div className="selectBoxRow">
+            <span>角色:</span>
+            <Select
+              style={{ width: 220 }}
+              placeholder="请选择"
+              value={tableSelect.roleId}
+              onChange={(e) => setTableSelect({ ...tableSelect, roleId: e })}
+              options={[{ value: "", label: "全部" }]}
+            />
+          </div>
+
+          <div className="selectBoxRow">
+            &emsp;&emsp;<Button onClick={resetSelectFu}>重置</Button>
+            &emsp;&emsp;
+            <Button type="primary" onClick={() => openEditPageFu(0)}>
+              新增
+            </Button>
+          </div>
+        </div>
+      </div>
+      {/* 表格主体 */}
+      <div className="tableBox">
+        <Table
+          scroll={{ y: 617 }}
+          dataSource={tableInfo.list}
+          columns={columns}
+          rowKey="id"
+          pagination={{
+            showQuickJumper: true,
+            position: ["bottomCenter"],
+            showSizeChanger: true,
+            current: tableSelect.pageNum,
+            pageSize: tableSelect.pageSize,
+            total: tableInfo.total,
+            onChange: paginationChange(),
+          }}
+        />
+      </div>
+
+      {/* 点击新增或者编辑 */}
+      {editPageShow ? (
+        <UserAdd
+          id={editId.current}
+          closePage={() => setEditPageShow(false)}
+          upTableList={getList}
+          addTableList={resetSelectFu}
+        />
+      ) : null}
     </div>
-  )
+  );
 }
 
 const MemoA3User = React.memo(A3User);

+ 70 - 0
src/pages/A4Role/RoleAdd/index.module.scss

@@ -0,0 +1,70 @@
+.roleAdd {
+  :global {
+    .ant-modal-close {
+      display: none;
+    }
+
+    .roleAddMain {
+      border-top: 1px solid #999999;
+      padding-top: 15px;
+      width: 100%;
+
+      .row {
+        margin-bottom: 20px;
+        position: relative;
+        display: flex;
+        padding: 0 24px 0 0px;
+        text-align: right;
+
+        .rowSpan {
+          display: inline-block;
+          width: 80px;
+          line-height: 32px;
+
+          &>span {
+            position: relative;
+            top: 2px;
+            color: #ff4d4f;
+          }
+        }
+
+        .bs {
+          &::before {
+            content: '*';
+            position: absolute;
+            top: 2px;
+            left: 1px;
+            z-index: 10;
+            color: #ff4d4f;
+          }
+        }
+
+        .inputBox {
+          width: calc(100% - 90px);
+
+        }
+
+        .inputBoxCheck {
+          width: 155px;
+
+          .rowCheck {
+            display: block;
+            display: flex;
+            margin-left: 4px;
+            margin-top: 5px;
+          }
+        }
+      }
+
+      .roleAddButton {
+        text-align: center;
+      }
+    }
+
+    .lookRole {
+      .row {
+        pointer-events: none;
+      }
+    }
+  }
+}

+ 116 - 0
src/pages/A4Role/RoleAdd/index.tsx

@@ -0,0 +1,116 @@
+import { getRoleInfoByIdAPI, roleSaveAPI } from "@/store/action/A4Role";
+
+import { Button, Input, Modal, Popconfirm } from "antd";
+import React, { useCallback, useEffect, useState } from "react";
+import classNames from "classnames";
+import styles from "./index.module.scss";
+import { AddRoleType, RoleTableType } from "@/types";
+import { MessageFu } from "@/utils/message";
+const { TextArea } = Input;
+
+type Props = {
+  id: any;
+  closePage: () => void;
+  upTableList: () => void;
+  addTableList: () => void;
+};
+
+function RoleAdd({ id, closePage, upTableList, addTableList }: Props) {
+  // 角色名称
+  const [roleName, setRoleName] = useState("");
+
+  // 角色描述
+  const [roleDesc, setRoleDesc] = useState("");
+
+  const getRoleInfoByIdFu = useCallback(async (id: number) => {
+    const res = await getRoleInfoByIdAPI(id);
+    const info: RoleTableType = res.data.role;
+    setRoleName(info.roleName);
+    setRoleDesc(info.roleDesc);
+  }, []);
+
+  // 如果是编辑
+  useEffect(() => {
+    if (id) getRoleInfoByIdFu(id);
+  }, [getRoleInfoByIdFu, id]);
+
+  // 点击提交
+  const btnOkFu = useCallback(async () => {
+    if (roleName === "") return MessageFu.warning("请输入角色名称!");
+
+    const obj: AddRoleType = {
+      id: id ? id : null,
+      roleDesc: roleDesc,
+      roleName: roleName,
+    };
+    const res: any = await roleSaveAPI(obj);
+
+    if (res.code === 0) {
+      MessageFu.success(id ? "编辑成功!" : "新增成功!");
+      closePage();
+      if (id) addTableList();
+      else upTableList();
+    }
+  }, [addTableList, closePage, id, roleDesc, roleName, upTableList]);
+
+  return (
+    <Modal
+      wrapClassName={styles.roleAdd}
+      destroyOnClose
+      open={true}
+      title={id ? "编辑角色" : "新增角色"}
+      footer={
+        [] // 设置footer为空,去掉 取消 确定默认按钮
+      }
+    >
+      <div className={classNames("roleAddMain", id === 1 ? "lookRole" : "")}>
+        <div className="row">
+          <span className="bs rowSpan">角色名称:</span>
+          <div className="inputBox">
+            <Input
+              disabled={id === 2}
+              maxLength={10}
+              value={roleName}
+              onChange={(e) => setRoleName(e.target.value.replace(/\s+/g, ""))}
+              showCount
+              placeholder="请输入内容,不能重复"
+            />
+          </div>
+        </div>
+
+        <div className="row">
+          <span className="rowSpan">角色说明:</span>
+          <div className="inputBox">
+            <TextArea
+              rows={4}
+              placeholder="请输入内容"
+              maxLength={100}
+              showCount
+              value={roleDesc}
+              onChange={(e) => setRoleDesc(e.target.value.replace(/\s+/g, ""))}
+            />
+          </div>
+        </div>
+
+        <div className="roleAddButton">
+          <Button type="primary" onClick={btnOkFu}>
+            提交
+          </Button>
+          &emsp;
+          <Popconfirm
+            title="放弃编辑后,信息将不会保存!"
+            okText="放弃"
+            cancelText="取消"
+            onConfirm={closePage}
+          >
+            <Button>取消</Button>
+          </Popconfirm>
+        </div>
+      </div>
+    </Modal>
+  );
+}
+
+const MemoRoleAdd = React.memo(RoleAdd);
+
+export default MemoRoleAdd;

+ 32 - 3
src/pages/A4Role/index.module.scss

@@ -1,5 +1,34 @@
-.A4Role{
-  :global{
-    
+.A4Role {
+  :global {
+    .searchTop {
+      border-radius: 10px;
+      padding: 20px 15px;
+      background-color: #fff;
+      display: flex;
+
+      .searchTopRow {
+        margin-right: 30px;
+      }
+    }
+
+    .tableBox {
+      border-radius: 10px;
+      overflow: hidden;
+      margin-top: 15px;
+      height: calc(100% - 85px);
+      background-color: #fff;
+
+      .ant-table-body {
+        height: 617px;
+        overflow-y: auto !important;
+        overflow-y: overlay !important;
+
+        .ant-table-row {
+          .ant-table-cell {
+            padding: 10px;
+          }
+        }
+      }
+    }
   }
 }

+ 207 - 5
src/pages/A4Role/index.tsx

@@ -1,12 +1,214 @@
-import React from "react";
+import { RootState } from "@/store";
+import { getRoleListAPI, roleRemoveAPI } from "@/store/action/A4Role";
+import { RoleTableType } from "@/types";
+import { MessageFu } from "@/utils/message";
+import { Button, Input, Popconfirm, Table } from "antd";
+import React, {
+  useCallback,
+  useEffect,
+  useMemo,
+  useRef,
+  useState,
+} from "react";
+import { useDispatch, useSelector } from "react-redux";
 import styles from "./index.module.scss";
- function A4Role() {
-  
+import RoleAdd from "./RoleAdd";
+function A4Role() {
+  const dispatch = useDispatch();
+
+  // 顶部筛选
+
+  type TableListType = {
+    pageNum: number;
+    pageSize: number;
+    searchKey: string;
+  };
+
+  const [tableSelect, setTableSelect] = useState<TableListType>({
+    pageNum: 1,
+    pageSize: 10,
+    searchKey: "",
+  });
+
+  useEffect(() => {
+    dispatch(getRoleListAPI(tableSelect));
+  }, [dispatch, tableSelect]);
+
+  // 角色名的输入
+  const nameTime = useRef(-1);
+  const nameChange = useCallback(
+    (e: React.ChangeEvent<HTMLInputElement>) => {
+      clearTimeout(nameTime.current);
+      nameTime.current = window.setTimeout(() => {
+        setTableSelect({
+          ...tableSelect,
+          searchKey: e.target.value,
+          pageNum: 1,
+        });
+      }, 500);
+    },
+    [tableSelect]
+  );
+
+  // 角色名的重置
+  const [inputKey, setInputKey] = useState(1);
+  const resetSelectFu = useCallback(() => {
+    // 把2个输入框和时间选择器清空
+    setInputKey(Date.now());
+    setTableSelect({
+      pageNum: 1,
+      pageSize: 10,
+      searchKey: "",
+    });
+  }, []);
+
+  // 点击删除
+  const delTableFu = useCallback(
+    async (id: number) => {
+      const res: any = await roleRemoveAPI(id);
+      if (res.code === 0) {
+        MessageFu.success("删除成功!");
+        dispatch(getRoleListAPI(tableSelect));
+      }
+    },
+    [dispatch, tableSelect]
+  );
+
+  // 点击新增和编辑
+  const [editPageShow, setEditPageShow] = useState(false);
+  const editId = useRef(0);
+  const openEditPageFu = useCallback((id: number) => {
+    editId.current = id;
+    setEditPageShow(true);
+  }, []);
+
+  // 从仓库中获取表格数据
+  const tableInfo = useSelector((state: RootState) => state.A4Role.tableInfo);
+
+  // 页码变化
+  const paginationChange = useCallback(
+    () => (pageNum: number, pageSize: number) => {
+      setTableSelect({ ...tableSelect, pageNum, pageSize });
+    },
+    [tableSelect]
+  );
+
+  const columns = useMemo(() => {
+    return [
+      // {
+      //   width: 80,
+      //   title: "序号",
+      //   render: (text: any, record: any, index: any) =>
+      //     index + 1 + (pageNumRef.current - 1) * pagePageRef.current,
+      // },
+      {
+        title: "角色名称",
+        dataIndex: "roleName",
+      },
+      {
+        title: "角色说明",
+        render: (item: RoleTableType) =>
+          item.roleDesc ? item.roleDesc : "(空)",
+      },
+      {
+        title: "功能权限",
+        dataIndex: "count",
+      },
+      {
+        title: "应用权限",
+        dataIndex: "updateTime",
+      },
+      {
+        title: "内控文件权限",
+        dataIndex: "updateTime",
+      },
+
+      {
+        title: "操作",
+        render: (item: RoleTableType) => {
+          return (
+            <>
+              <Button size="small" type="text">
+                授权
+              </Button>
+
+              <Button
+                size="small"
+                type="text"
+                onClick={() => openEditPageFu(item.id)}
+              >
+                编辑
+              </Button>
+              {item.roleKey === "sys_common" ? null : (
+                <Popconfirm
+                  title="删除后无法恢复,是否删除?"
+                  okText="删除"
+                  cancelText="取消"
+                  onConfirm={() => delTableFu(item.id!)}
+                >
+                  <Button size="small" type="text" danger>
+                    删除
+                  </Button>
+                </Popconfirm>
+              )}
+            </>
+          );
+        },
+      },
+    ];
+  }, [delTableFu, openEditPageFu]);
+
   return (
     <div className={styles.A4Role}>
-      <h1>A4Role</h1>
+      <div className="pageTitle">角色管理</div>
+      <div className="searchTop">
+        <div className="searchTopRow">
+          <span>角色名:</span>
+          <Input
+            key={inputKey}
+            maxLength={8}
+            style={{ width: 200 }}
+            placeholder="请输入"
+            allowClear
+            onChange={(e) => nameChange(e)}
+          />
+        </div>
+        <div className="searchTopRow">
+          &emsp;&emsp;
+          <Button type="primary" onClick={() => openEditPageFu(0)}>
+            新增
+          </Button>
+        </div>
+      </div>
+
+      <div className="tableBox">
+        <Table
+          scroll={{ y: 617 }}
+          dataSource={tableInfo.list}
+          columns={columns}
+          rowKey="id"
+          pagination={{
+            showQuickJumper: true,
+            position: ["bottomCenter"],
+            showSizeChanger: true,
+            current: tableSelect.pageNum,
+            pageSize: tableSelect.pageSize,
+            total: tableInfo.total,
+            onChange: paginationChange(),
+          }}
+        />
+      </div>
+      {/* 点击新增或者编辑 */}
+      {editPageShow ? (
+        <RoleAdd
+          id={editId.current}
+          closePage={() => setEditPageShow(false)}
+          upTableList={() => dispatch(getRoleListAPI(tableSelect))}
+          addTableList={resetSelectFu}
+        />
+      ) : null}
     </div>
-  )
+  );
 }
 
 const MemoA4Role = React.memo(A4Role);

+ 38 - 3
src/pages/A5Section/index.module.scss

@@ -1,5 +1,40 @@
-.A5Section{
-  :global{
-    
+.A5Section {
+  :global {
+    .A5Main {
+      width: 100%;
+      height: calc(100% + 2px);
+      background-color: #fff;
+      border-radius: 10px;
+
+      .A5Top {
+        position: absolute;
+        top: -60px;
+        left: 160px;
+        z-index: 101;
+      }
+
+      .A5tableBox {
+        width: 100%;
+        height: 100%;
+        overflow: hidden;
+
+        .ant-table-body {
+          height: 575px;
+          overflow-y: auto !important;
+
+          .ant-table-row {
+            .ant-table-cell {
+              padding: 10px;
+            }
+          }
+
+          .A5Sort{
+            .A5Sort1{
+              cursor: pointer;
+            }
+          }
+        }
+      }
+    }
   }
 }

+ 172 - 5
src/pages/A5Section/index.tsx

@@ -1,12 +1,179 @@
-import React from "react";
+import React, { useCallback, useEffect, useMemo } from "react";
 import styles from "./index.module.scss";
- function A5Section() {
-  
+import { Button, Popconfirm, Table } from "antd";
+import { useDispatch, useSelector } from "react-redux";
+import { A5_APIgetList, A5_APIsort } from "@/store/action/A5Section";
+import { RootState } from "@/store";
+import { A5TableType } from "@/types";
+import { MessageFu } from "@/utils/message";
+
+function A5Section() {
+  const dispatch = useDispatch();
+
+  const getListFu = useCallback(() => {
+    dispatch(A5_APIgetList());
+  }, [dispatch]);
+
+  useEffect(() => {
+    getListFu();
+  }, [getListFu]);
+
+  // 获取表格数据
+  const tableList = useSelector(
+    (state: RootState) => state.A5Section.tableList
+  );
+
+  // 树型数组扁平化
+  const arrAllArr = useMemo(() => {
+    const arr: A5TableType[] = [...tableList];
+    const arr1: A5TableType[] = [];
+    arr.forEach((v) => {
+      arr1.push(v);
+      if (v.children && v.children.length) {
+        v.children.forEach((v2) => {
+          arr1.push(v2);
+          if (v2.children && v2.children.length) {
+            v2.children.forEach((v3) => {
+              arr1.push(v3);
+              if (v3.children && v3.children.length) {
+                v3.children.forEach((v4) => {
+                  arr1.push(v4);
+                });
+              }
+            });
+          }
+        });
+      }
+    });
+    return arr1;
+  }, [tableList]);
+
+  // 拿到当前点击 级别的 数组
+  const sonArrFu = useCallback(
+    (fId: string) => {
+      const arr: A5TableType[] = arrAllArr.filter((v) => v.parentId === fId);
+      return arr;
+    },
+    [arrAllArr]
+  );
+
+  // 点击删除
+  const delById = useCallback((id: string) => {}, []);
+
+  // 点击新增子部门
+  const addTree = useCallback((item: A5TableType) => {
+    console.log("----", item);
+  }, []);
+
+  // 点击 上移 和下移
+  const sortMoveFu = useCallback(
+    async (flag: 1 | -1, index: number, oldId: string, fId: string) => {
+      const arr = sonArrFu(fId);
+      const newId = arr[index + flag].id;
+
+      const res = await A5_APIsort(oldId, newId);
+
+      if (res.code === 0) {
+        getListFu();
+        MessageFu.success("排序修改成功!");
+      }
+    },
+    [getListFu, sonArrFu]
+  );
+
+  const columns = useMemo(() => {
+    return [
+      {
+        title: <>&emsp;&nbsp;部门名称</>,
+        dataIndex: "name",
+      },
+      {
+        title: "说明",
+        render: (item: A5TableType) =>
+          item.description ? (
+            item.description.length >= 30 ? (
+              <span style={{ cursor: "pointer" }} title={item.description}>
+                {item.description.substring(0, 30) + "..."}
+              </span>
+            ) : (
+              item.description
+            )
+          ) : (
+            "(空)"
+          ),
+      },
+      {
+        title: "同级排序",
+        dataIndex: "sort",
+      },
+      {
+        title: "操作",
+        render: (item: A5TableType, _: any, index: number) => (
+          <>
+            <Button size="small" type="text" onClick={() => addTree(item)}>
+              新增子部门
+            </Button>
+            <Button size="small" type="text">
+              编辑
+            </Button>
+            {index === 0 ? null : (
+              <Button
+                size="small"
+                type="text"
+                onClick={() => sortMoveFu(-1, index, item.id, item.parentId)}
+              >
+                上移
+              </Button>
+            )}
+
+            {sonArrFu(item.parentId).length - 1 === index ? null : (
+              <Button
+                size="small"
+                type="text"
+                onClick={() => sortMoveFu(1, index, item.id, item.parentId)}
+              >
+                下移
+              </Button>
+            )}
+
+            <Popconfirm
+              title="删除后无法恢复,是否删除?"
+              okText="删除"
+              cancelText="取消"
+              onConfirm={() => delById(item.id)}
+              okButtonProps={{ loading: false }}
+            >
+              <Button size="small" type="text" danger>
+                删除
+              </Button>
+            </Popconfirm>
+          </>
+        ),
+      },
+    ];
+  }, [addTree, delById, sonArrFu, sortMoveFu]);
+
   return (
     <div className={styles.A5Section}>
-      <h1>A5Section</h1>
+      <div className="pageTitle">部门管理</div>
+      <div className="A5Main">
+        <div className="A5Top">
+          <Button type="primary">新增</Button>
+        </div>
+
+        {/* 表格主体 */}
+        <div className="A5tableBox">
+          <Table
+            scroll={{ y: 575 }}
+            dataSource={tableList}
+            columns={columns}
+            rowKey="id"
+            pagination={false}
+          />
+        </div>
+      </div>
     </div>
-  )
+  );
 }
 
 const MemoA5Section = React.memo(A5Section);

+ 30 - 3
src/pages/A6Log/index.module.scss

@@ -1,5 +1,32 @@
-.A6Log{
-  :global{
-    
+.A6Log {
+  :global {
+    .logTop {
+      border-radius: 10px;
+      background-color: #fff;
+
+      .tableSelectBox {
+        padding: 15px 24px;
+        display: flex;
+        align-items: center;
+
+        .row {
+          margin-right: 20px;
+        }
+      }
+    }
+
+    .tableMain {
+      border-radius: 10px;
+      margin-top: 15px;
+      height: calc(100% - 75px);
+      background-color: #fff;
+
+      .ant-table-body {
+        height: 630px;
+        overflow-y: auto !important;
+        overflow-y: overlay !important;
+
+      }
+    }
   }
 }

+ 129 - 5
src/pages/A6Log/index.tsx

@@ -1,12 +1,136 @@
-import React from "react";
+import { RootState } from "@/store";
+import { getLogListAPI } from "@/store/action/A6Log";
+import { Input, DatePicker, Table } from "antd";
+import React, { useEffect, useMemo, useRef, useState } from "react";
+import { useDispatch, useSelector } from "react-redux";
+
 import styles from "./index.module.scss";
- function A6Log() {
-  
+
+const { RangePicker } = DatePicker;
+
+function A6Log() {
+  const dispatch = useDispatch();
+
+  const pageNumRef = useRef(1);
+  const pagePageRef = useRef(10);
+  // 筛选和分页
+  const [tableSelect, setTableSelect] = useState({
+    searchKey: "",
+    pageSize: 10,
+    pageNum: 1,
+    startTime: "",
+    endTime: "",
+  });
+
+  // 账号的输入
+  const nameTime = useRef(-1);
+  const nameChange = (e: React.ChangeEvent<HTMLInputElement>) => {
+    clearTimeout(nameTime.current);
+    nameTime.current = window.setTimeout(() => {
+      setTableSelect({ ...tableSelect, searchKey: e.target.value, pageNum: 1 });
+    }, 500);
+  };
+  // 时间选择器改变
+  const timeChange = (date: any, dateString: any) => {
+    let startTime = "";
+    let endTime = "";
+    if (dateString[0] && dateString[1]) {
+      startTime = dateString[0] + " 00:00:00";
+      endTime = dateString[1] + " 23:59:59";
+    }
+    setTableSelect({ ...tableSelect, startTime, endTime, pageNum: 1 });
+  };
+
+  useEffect(() => {
+    pageNumRef.current = tableSelect.pageNum;
+    pagePageRef.current = tableSelect.pageSize;
+    dispatch(getLogListAPI(tableSelect));
+  }, [dispatch, tableSelect]);
+
+  // ---------关于表格
+
+  // 页码变化
+  const paginationChange = (pageNum: number, pageSize: number) => {
+    pageNumRef.current = pageNum;
+    pagePageRef.current = pageSize;
+    setTableSelect({ ...tableSelect, pageNum, pageSize });
+  };
+
+  const results = useSelector((state: RootState) => state.A6Log.tableInfo);
+
+  const columns = useMemo(() => {
+    return [
+      {
+        width: 100,
+        title: "序号",
+        render: (text: any, record: any, index: any) =>
+          index + 1 + (pageNumRef.current - 1) * pagePageRef.current,
+      },
+      {
+        title: "操作者",
+        dataIndex: "userName",
+      },
+      {
+        title: "操作日期",
+        dataIndex: "createTime",
+      },
+      {
+        title: "IP记录",
+        dataIndex: "ip",
+      },
+      {
+        title: "操作模块",
+        dataIndex: "type",
+      },
+      {
+        title: "操作事件",
+        dataIndex: "description",
+      },
+    ];
+  }, []);
+
   return (
     <div className={styles.A6Log}>
-      <h1>A6Log</h1>
+      <div className="pageTitle">系统日志</div>
+      <div className="logTop">
+        <div className="tableSelectBox">
+          <div className="row">
+            <span>账号:</span>
+            <Input
+              maxLength={15}
+              style={{ width: 150 }}
+              placeholder="请输入"
+              allowClear
+              onChange={(e) => nameChange(e)}
+            />
+          </div>
+          <div className="row">
+            <span>操作日期:</span>
+            <RangePicker onChange={timeChange} />
+          </div>
+        </div>
+      </div>
+
+      {/* 表格主体 */}
+      <div className="tableMain">
+        <Table
+          scroll={{ y: 630 }}
+          dataSource={results.list}
+          columns={columns}
+          rowKey="id"
+          pagination={{
+            showQuickJumper: true,
+            position: ["bottomCenter"],
+            showSizeChanger: true,
+            current: tableSelect.pageNum,
+            pageSize: tableSelect.pageSize,
+            total: results.total,
+            onChange: paginationChange,
+          }}
+        />
+      </div>
     </div>
-  )
+  );
 }
 
 const MemoA6Log = React.memo(A6Log);

+ 68 - 0
src/store/action/A3User.ts

@@ -0,0 +1,68 @@
+import { RoleTableType, SaveUserType, UserTableAPIType } from "@/types";
+import http from "@/utils/http";
+import { AppDispatch } from "..";
+/**
+ * 获取用户管理表格列表
+ */
+export const getUserListAPI = (data: UserTableAPIType) => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.post("sys/user/pageList", data);
+    if (res.code === 0) {
+      const obj = {
+        list: res.data.records,
+        total: res.data.total,
+      };
+
+      dispatch({ type: "user/getList", payload: obj });
+    }
+  };
+};
+
+/**
+ * 获取用户管理-角色列表
+ */
+export const getUserRoleAPI = () => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.get("sys/user/getRole");
+    if (res.code === 0) {
+      const data: RoleTableType[] = res.data;
+      const newData = data.map((v) => ({ label: v.roleName, value: v.id }));
+      dispatch({ type: "user/getRoleList", payload: newData });
+    }
+  };
+};
+
+/**
+ * 用户-是否显示
+ */
+// export const userDisplayAPI = (id: number, display: number) => {
+//   return http.get(`sys/user/editStatus/${id}/${display}`);
+// };
+
+/**
+ * 删除用户
+ */
+export const userRemoveAPI = (id: number) => {
+  return http.get(`sys/user/removes/${id}`);
+};
+
+/**
+ * 重置密码
+ */
+export const userPassResetAPI = (id: number) => {
+  return http.get(`sys/user/resetPass/${id}`);
+};
+
+/**
+ * 新增/修改用户信息
+ */
+export const userSaveAPI = (data: SaveUserType) => {
+  return http.post("sys/user/save", data);
+};
+
+/**
+ * 通过id获取角色详情
+ */
+export const getUserInfoByIdAPI = (id: number) => {
+  return http.get(`sys/user/detail/${id}`);
+};

+ 58 - 0
src/store/action/A4Role.ts

@@ -0,0 +1,58 @@
+import { AddRoleType } from "@/types";
+import http from "@/utils/http";
+import { AppDispatch } from "..";
+/**
+ * 获取角色表格列表数据
+ */
+export const getRoleListAPI = (data: any) => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.post("sys/role/listCountPage", data);
+    if (res.code === 0) {
+      const obj = {
+        list: res.data.records,
+        total: res.data.total,
+      };
+
+      dispatch({ type: "Role/getList", payload: obj });
+    }
+  };
+};
+
+/**
+ * 删除角色
+ */
+export const roleRemoveAPI = (id: number) => {
+  return http.get(`sys/role/remove/${id}`);
+};
+
+/**
+ * 用户-是否显示
+ */
+// export const roleDisplayAPI = (id: number, display: number) => {
+//   return http.get(`sys/role/editStatus/${id}/${display}`);
+// };
+
+/**
+ * 获取用户的权限信息
+ */
+export const getPermissionsAPI = () => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.get("sys/resource/getTreePermissions");
+    if (res.code === 0)
+      dispatch({ type: "layout/setAuthPageArr", payload: res.data });
+  };
+};
+
+/**
+ * 新增或修改角色
+ */
+export const roleSaveAPI = (data: AddRoleType) => {
+  return http.post("sys/role/save", data);
+};
+
+/**
+ * 通过id获取角色详情
+ */
+export const getRoleInfoByIdAPI = (id: number) => {
+  return http.get(`sys/role/detail/${id}`);
+};

+ 42 - 0
src/store/action/A5Section.ts

@@ -0,0 +1,42 @@
+import http from "@/utils/http";
+import { AppDispatch } from "..";
+import { A5TableType } from "@/types";
+
+/**
+ * 获取部门管理树型数据
+ */
+export const A5_APIgetList = () => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.get("sys/dept/getTree");
+    if (res.code === 0) {
+      const arr: A5TableType[] = res.data;
+      arr.forEach((v) => {
+        v.level = 1;
+        if (v.children && v.children.length) {
+          v.children.forEach((v2) => {
+            v2.level = 2;
+            if (v2.children && v2.children.length) {
+              v2.children.forEach((v3) => {
+                v3.level = 3;
+                if (v3.children && v3.children.length) {
+                  v3.children.forEach((v4) => {
+                    v4.level = 4;
+                  });
+                }
+              });
+            }
+          });
+        }
+      });
+
+      dispatch({ type: "Section/getList", payload: arr });
+    }
+  };
+};
+
+/**
+ * 获取部门管理树型数据
+ */
+export const A5_APIsort = (id1: string, id2: string) => {
+  return http.get(`sys/dept/sort/${id1}/${id2}`);
+};

+ 17 - 0
src/store/action/A6Log.ts

@@ -0,0 +1,17 @@
+import http from "@/utils/http";
+import { AppDispatch } from "..";
+/**
+ * 获取日志表格列表
+ */
+export const getLogListAPI = (data: any) => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.post("sys/log/list", data);
+    if (res.code === 0) {
+      const obj = {
+        list: res.data.records,
+        total: res.data.total,
+      };
+      dispatch({ type: "log/getList", payload: obj });
+    }
+  };
+};

+ 44 - 0
src/store/reducer/A3User.ts

@@ -0,0 +1,44 @@
+import { UserTableListType } from "@/types";
+
+// 初始化状态
+const initState = {
+  // 列表数据
+  tableInfo: {
+    list: [] as UserTableListType[],
+    total: 0,
+  },
+  // 角色列表数据
+  roleList: [] as {
+    label: string;
+    value: number;
+  }[],
+};
+
+// 定义 action 类型
+type Props =
+  | {
+      type: "user/getList";
+      payload: { list: UserTableListType[]; total: number };
+    }
+  | {
+      type: "user/getRoleList";
+      payload: {
+        label: string;
+        value: number;
+      }[];
+    };
+
+// 频道 reducer
+export default function userReducer(state = initState, action: Props) {
+  switch (action.type) {
+    // 获取列表数据
+    case "user/getList":
+      return { ...state, tableInfo: action.payload };
+    // 获取角色列表数据
+    case "user/getRoleList":
+      return { ...state, roleList: action.payload };
+
+    default:
+      return state;
+  }
+}

+ 27 - 0
src/store/reducer/A4Role.ts

@@ -0,0 +1,27 @@
+import { RoleTableType } from "@/types";
+
+// 初始化状态
+const initState = {
+  // 列表数据
+  tableInfo: {
+    list: [] as RoleTableType[],
+    total: 0,
+  },
+};
+
+// 定义 action 类型
+type Props = {
+  type: "Role/getList";
+  payload: { list: RoleTableType[]; total: number };
+};
+
+// 频道 reducer
+export default function RoleReducer(state = initState, action: Props) {
+  switch (action.type) {
+    // 获取列表数据
+    case "Role/getList":
+      return { ...state, tableInfo: action.payload };
+    default:
+      return state;
+  }
+}

+ 24 - 0
src/store/reducer/A5Section.ts

@@ -0,0 +1,24 @@
+import { A5TableType } from "@/types";
+
+// 初始化状态
+const initState = {
+  // 列表数据
+  tableList: [] as A5TableType[],
+};
+
+// 定义 action 类型
+type Props = {
+  type: "Section/getList";
+  payload: A5TableType[];
+};
+
+// 频道 reducer
+export default function A5Reducer(state = initState, action: Props) {
+  switch (action.type) {
+    // 获取列表数据
+    case "Section/getList":
+      return { ...state, tableList: action.payload };
+    default:
+      return state;
+  }
+}

+ 27 - 0
src/store/reducer/A6Log.ts

@@ -0,0 +1,27 @@
+import { LogTableType } from "@/types";
+
+// 初始化状态
+const initState = {
+  // 列表数据
+  tableInfo: {
+    list: [] as LogTableType[],
+    total: 0,
+  },
+};
+
+// 定义 action 类型
+type Props = {
+  type: "log/getList";
+  payload: { list: LogTableType[]; total: number };
+};
+
+// 频道 reducer
+export default function logReducer(state = initState, action: Props) {
+  switch (action.type) {
+    // 获取列表数据
+    case "log/getList":
+      return { ...state, tableInfo: action.payload };
+    default:
+      return state;
+  }
+}

+ 9 - 1
src/store/reducer/index.ts

@@ -4,11 +4,19 @@ import { combineReducers } from "redux";
 // 导入 登录 模块的 reducer
 import A0Layout from "./layout";
 import A1Project from "./A1Project";
+import A3User from "./A3User";
+import A4Role from "./A4Role";
+import A5Section from "./A5Section";
+import A6Log from "./A6Log";
 
 // 合并 reducer
 const rootReducer = combineReducers({
   A0Layout,
-  A1Project
+  A1Project,
+  A3User,
+  A4Role,
+  A5Section,
+  A6Log,
 });
 
 // 默认导出

+ 8 - 1
src/store/reducer/layout.ts

@@ -1,4 +1,4 @@
-import { LookDomType } from "@/types";
+import { LookDomType, PermissionsAPIType } from "@/types";
 import { MessageType } from "@/utils/message";
 
 // 初始化状态
@@ -25,6 +25,9 @@ const initState = {
     fu: () => {},
     state: false,
   },
+
+  // 有关权限的信息
+  authPageArr: [] as PermissionsAPIType[],
 };
 
 // 定义 action 类型
@@ -32,6 +35,7 @@ type LayoutActionType =
   | { type: "layout/lookBigImg"; payload: { url: string; show: boolean } }
   | { type: "layout/lookDom"; payload: LookDomType }
   | { type: "layout/message"; payload: MessageType }
+  | { type: "layout/setAuthPageArr"; payload: PermissionsAPIType[] }
   | {
       type: "layout/closeUpFile";
       payload: {
@@ -56,6 +60,9 @@ export default function layoutReducer(
     // antd轻提示(兼容360浏览器)
     case "layout/message":
       return { ...state, message: action.payload };
+    // 有关权限的信息
+    case "layout/setAuthPageArr":
+      return { ...state, authPageArr: action.payload };
     // 上传文件点击取消
     case "layout/closeUpFile":
       return { ...state, closeUpFile: action.payload };

+ 34 - 0
src/types/api/A3User.d.ts

@@ -0,0 +1,34 @@
+export type UserTableAPIType = {
+  deptId: number | "";
+  pageNum: number;
+  pageSize: number;
+  roleId: number | "";
+  searchKey: string;
+};
+
+export type UserTableListType = {
+  createTime: string;
+  creatorId: number;
+  creatorName: string;
+  deptId: number;
+  id: number;
+  isAdmin: number;
+  isEnabled: number;
+  nickName: string;
+  phone: string;
+  realName: string;
+  roleId: number;
+  roleName: string;
+  sex: string;
+  thumb: string;
+  updateTime: string;
+  userName: string;
+};
+
+export type SaveUserType = {
+  id: number | null;
+  userName: string;
+  nickName: string;
+  roleId: number;
+  realName: string;
+};

+ 28 - 0
src/types/api/A4Role.d.ts

@@ -0,0 +1,28 @@
+export type RoleTableType = {
+  count: number;
+  createTime: string;
+  creatorId: null;
+  creatorName: string;
+  id: number;
+  isEnabled: number;
+  roleDesc: string;
+  roleKey: string;
+  roleName: string;
+  sort: string;
+  updateTime: string;
+};
+
+
+export type PermissionsAPIType = {
+  authority: boolean;
+  id: number;
+  name: string;
+  parentId?: null;
+  resourceType?: string;
+}
+
+export type AddRoleType ={
+  id:number|null
+  roleName:string
+  roleDesc:string
+}

+ 19 - 0
src/types/api/A5Section.d.ts

@@ -0,0 +1,19 @@
+export interface Children {
+  id: string;
+  parentId: string;
+  sort: number;
+  name: string;
+  description: string;
+  level: 1 | 2 | 3 | 4;
+  children?: Children[];
+}
+
+export type A5TableType = {
+  id: string;
+  description: string;
+  parentId: string;
+  sort: number;
+  name: string;
+  level: 1 | 2 | 3 | 4;
+  children?: Children[];
+};

+ 11 - 0
src/types/api/A6Log.d.ts

@@ -0,0 +1,11 @@
+export type LogTableType = {
+  createTime: string;
+  creatorId: null;
+  creatorName: string;
+  description: string;
+  id: number;
+  ip: string;
+  type: string;
+  updateTime: null;
+  userName: string;
+}

+ 4 - 0
src/types/index.d.ts

@@ -1,2 +1,6 @@
 export * from './api/layot'
 export * from './api/A1Project'
+export * from './api/A3User'
+export * from './api/A4Role'
+export * from './api/A5Section'
+export * from './api/A6Log'

+ 6 - 6
src/utils/http.ts

@@ -7,10 +7,10 @@ import { domShowFu } from "./domShow";
 // 请求基地址
 export const baseURL =
   // 线下的图片地址需要加上/api/
-  // process.env.NODE_ENV === "development"
-  //   ? "http://192.168.20.55:8052/api/"
-  //   : "";
-  process.env.NODE_ENV === "development" ? "https://ytxbwg.4dage.com" : "";
+  process.env.NODE_ENV === "development"
+    ? "http://192.168.20.21:8054/api/"
+    : "";
+  // process.env.NODE_ENV === "development" ? "https://ytxbwg.4dage.com" : "";
 
 // 处理  类型“AxiosResponse<any, any>”上不存在属性“code”
 declare module "axios" {
@@ -23,10 +23,10 @@ declare module "axios" {
 // 创建 axios 实例
 const http = axios.create({
   // --------线下的地址不用加/api/
-  // baseURL: baseURL,
+  baseURL: baseURL,
 
   // --------打包或线上环境接口需要加上api/
-  baseURL: baseURL + "/api/",
+  // baseURL: baseURL + "/api/",
   timeout: 5000,
 });