shaogen1995 před 3 roky
rodič
revize
dbe277dd02

+ 1 - 1
src/pages/Exhibit/Edit.tsx

@@ -184,7 +184,7 @@ function ExhibitEdit({ id, closeFu, upList }: Props) {
                 </Popconfirm>
               </div>
               <div className="fileBoxRow_r_tit">
-                格式要求:支持png、jpg和jpeg的图片格式;最大支持20M。
+                支持png、jpg和jpeg的图片格式;最大支持20M。
                 <br />
                 <div
                   className={classNames(

+ 11 - 1
src/pages/Exhibit/index.tsx

@@ -45,7 +45,17 @@ function Exhibit() {
       {
         title: "展馆简介",
         render: (item: ExhibitTableType) =>
-          item.description ? item.description : "(空)",
+          item.description ? (
+            item.description.length >= 20 ? (
+              <span style={{ cursor: "pointer" }} title={item.description}>
+                {item.description.substring(0, 20) + "..."}
+              </span>
+            ) : (
+              item.description
+            )
+          ) : (
+            "(空)"
+          ),
       },
       {
         title: "展馆封面",

+ 56 - 25
src/pages/GoodsAdd/index.tsx

@@ -8,7 +8,7 @@ import {
   CloseCircleOutlined,
   UploadOutlined,
   PlayCircleOutlined,
-  CloseOutlined
+  CloseOutlined,
 } from "@ant-design/icons";
 import { useDispatch, useSelector } from "react-redux";
 import styles from "./index.module.scss";
@@ -50,20 +50,17 @@ function GoodsAdd({
 
   const getInfoInAPIFu = useCallback(async (id: number) => {
     const res = await goodsDetailById(id);
-    const data: GoodsTableSearch = res.data;
+    const data: GoodsTableSearch = res.data.entity;
+    const fileFata: ImgFileType[] = res.data.file;
     FormBoxRef.current.setFieldsValue(data);
-
+    setDirCode(data.dirCode!);
     setCover(data.thumb!);
     setType(data.type!);
 
-    // if (data.type === "model") {
-    //   setModelFile({ fileName: data.fileName!, filePath: data.filePath! });
-    // } else if (data.type === "img")
-    //   setImgFile({ fileName: data.fileName!, filePath: data.filePath! });
-    // else if (data.type === "audio")
-    //   setAudioFile({ fileName: data.fileName!, filePath: data.filePath! });
-    // else if (data.type === "video")
-    //   setVideoFile({ fileName: data.fileName!, filePath: data.filePath! });
+    if (data.type === "model") setModelFile(fileFata[0]);
+    else if (data.type === "img") setImgFile(fileFata);
+    else if (data.type === "audio") setAudioFile(fileFata[0]);
+    else if (data.type === "video") setVideoFile(fileFata[0]);
 
     console.log("是编辑,在这里发请求拿数据", res);
   }, []);
@@ -78,7 +75,7 @@ function GoodsAdd({
     else {
       setDirCode(Date.now() + "");
       FormBoxRef.current.setFieldsValue({
-        topic: 1,
+        display: 1,
       });
     }
   }, [getInfoInAPIFu, id]);
@@ -98,21 +95,43 @@ function GoodsAdd({
   // 文件的dirCode码
   const [dirCode, setDirCode] = useState("");
 
-  // 模型的链接输入
+  // 模型的上传
   const [modelFile, setModelFile] = useState({
     fileName: "",
     filePath: "",
     id: "",
   });
 
-  // 图片的附件信息
-  const [imgFile, setImgFile] = useState<
-    {
-      fileName: string;
-      filePath: string;
-      id: string;
-    }[]
-  >([]);
+  // 多张图片的附件信息和拖拽
+  type ImgFileType = {
+    fileName: string;
+    filePath: string;
+    id: string;
+  };
+
+  const [imgFile, setImgFile] = useState<ImgFileType[]>([]);
+
+  const [dragImg, setDragImg] = useState<any>(null);
+
+  const handleDragOver = useCallback(
+    (e: React.DragEvent<HTMLDivElement>, item: ImgFileType) => {
+      e.dataTransfer.dropEffect = "move";
+    },
+    []
+  );
+
+  const handleDragEnter = useCallback(
+    (e: React.DragEvent<HTMLDivElement>, item: ImgFileType) => {
+      e.dataTransfer.effectAllowed = "move";
+      if (item === dragImg) return;
+      const newItems = [...imgFile]; //拷贝一份数据进行交换操作。
+      const src = newItems.indexOf(dragImg); //获取数组下标
+      const dst = newItems.indexOf(item);
+      newItems.splice(dst, 0, ...newItems.splice(src, 1)); //交换位置
+      setImgFile(newItems);
+    },
+    [dragImg, imgFile]
+  );
 
   // 删除某一张图片
   const delImgListFu = useCallback(
@@ -382,7 +401,11 @@ function GoodsAdd({
               />
             </Form.Item>
 
-            <Form.Item label="简历" name="description">
+            <Form.Item
+              label="简介"
+              name="description"
+              getValueFromEvent={(e) => e.target.value.trim()}
+            >
               <TextArea
                 rows={4}
                 placeholder="请输入内容"
@@ -442,7 +465,7 @@ function GoodsAdd({
               </div>
             </div>
             <div className="fileBoxRow_r_tit">
-              格式要求:支持png、jpg和jpeg的图片格式;最大支持20M。
+              支持png、jpg和jpeg的图片格式;最大支持20M。
             </div>
 
             {/* 文件类型 */}
@@ -513,7 +536,15 @@ function GoodsAdd({
                     <PlusOutlined />
                   </div>
                   {imgFile.map((v) => (
-                    <div className="fileBoxRow_r_img" key={v.id} >
+                    <div
+                      className="fileBoxRow_r_img"
+                      key={v.id}
+                      draggable="true"
+                      onDragStart={() => setDragImg(v)}
+                      onDragOver={(e) => handleDragOver(e, v)}
+                      onDragEnter={(e) => handleDragEnter(e, v)}
+                      onDragEnd={() => setDragImg(null)}
+                    >
                       {v.filePath ? (
                         <ImageLazy width={100} height={100} src={v.filePath} />
                       ) : null}
@@ -525,7 +556,7 @@ function GoodsAdd({
                         onConfirm={() => delImgListFu(v.id)}
                       >
                         <div className="clearCover">
-                        <CloseOutlined />
+                          <CloseOutlined />
                         </div>
                       </Popconfirm>
                     </div>

+ 4 - 4
src/pages/Log/index.module.scss

@@ -1,11 +1,11 @@
 .Log{
   :global{
     .logTop{
-      height: 100px;
+      margin-top: 15px;
       border-radius: 10px;
       background-color: #fff;
       .tableSelectBox{
-        padding: 8px 24px 0;
+        padding: 20px 24px;
         display: flex;
         align-items: center;
         .row{
@@ -15,8 +15,8 @@
     }
     .tableMain{
       border-radius: 10px;
-      margin-top: 20px;
-      height: calc(100% - 117px);
+      margin-top: 15px;
+      height: calc(100% - 128px);
       background-color: #fff;
     }
   }

+ 1 - 1
src/pages/Log/index.tsx

@@ -86,8 +86,8 @@ function Log() {
 
   return (
     <div className={styles.Log}>
-      <div className="logTop">
         <div className="pageTitlt">操作日志</div>
+      <div className="logTop">
         <div className="tableSelectBox">
           <div className="row">
             <span>账号:</span>

+ 0 - 49
src/pages/Role/RoleAdd/index.css

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

+ 0 - 66
src/pages/Role/RoleAdd/index.less

@@ -1,66 +0,0 @@
-.roleAdd {
-  .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;
-      }
-
-      .bs {
-        &::before {
-          content: '*';
-          position: absolute;
-          top: 2px;
-          left: 2px;
-          z-index: 10;
-          color: #ff4d4f;
-        }
-      }
-
-      .inputBox {
-        width: calc(100% - 90px);
-
-      }
-
-      .inputBoxCheck {
-        width: 155px;
-
-        .rowCheck {
-          display: block;
-          display: flex;
-          margin-left: 4px;
-          margin-top: 5px;
-        }
-      }
-    }
-
-    .rowThree {
-      margin-top: -26px;
-    }
-
-    .roleAddButton {
-      text-align: center;
-    }
-  }
-
-  .lookRole {
-    .row {
-      pointer-events: none;
-    }
-  }
-}

+ 0 - 170
src/pages/Role/RoleAdd/index.tsx

@@ -1,170 +0,0 @@
-import { getRoleInfoByIdAPI, roleSaveAPI } from "@/store/action/role";
-
-import { Button, Checkbox, Input, message, Modal, Popconfirm } from "antd";
-import React, { useCallback, useEffect, useState } from "react";
-import classNames from "classnames";
-import "./index.css";
-import { AddRoleType, PermissionsAPIType, RoleTableType } from "@/types";
-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 [list, setList] = useState<PermissionsAPIType[]>([
-    { id: 100, name: "热度统计", authority: true },
-    { id: 200, name: "万物墙管理", authority: true },
-    { id: 300, name: "馆藏管理", authority: true },
-  ]);
-
-  const checkChangeFu = useCallback(
-    (checked: boolean, id: number) => {
-      const newList = list.map((v) => {
-        return {
-          ...v,
-          authority: v.id === id ? checked : v.authority,
-        };
-      });
-      setList(newList);
-    },
-    [list]
-  );
-
-  const getRoleInfoByIdFu = useCallback(async (id: number) => {
-    const res = await getRoleInfoByIdAPI(id);
-    const info: RoleTableType = res.data.role;
-    const authPageArr: PermissionsAPIType[] = res.data.permission;
-    setRoleName(info.roleName);
-    setRoleDesc(info.roleDesc);
-    setList(authPageArr);
-  }, []);
-  // 如果是编辑
-  useEffect(() => {
-    if (id) getRoleInfoByIdFu(id);
-  }, [getRoleInfoByIdFu, id]);
-
-  // 点击提交
-  const btnOkFu = useCallback(async () => {
-    if (roleName === "") return message.warning("请输入角色名称!");
-    const obj: AddRoleType = {
-      id: id ? id : null,
-      resources: list.filter((v) => v.authority).map((v) => v.id),
-      roleDesc: roleDesc,
-      roleName: roleName,
-    };
-    const res: any = await roleSaveAPI(obj);
-
-    if (res.code === 0) {
-      message.success(id ? "编辑成功!" : "新增成功!");
-      closePage();
-      if (id) addTableList();
-      else upTableList();
-    }
-  }, [addTableList, closePage, id, list, roleDesc, roleName, upTableList]);
-
-  return (
-    <Modal
-      wrapClassName="roleAdd"
-      destroyOnClose
-      open={true}
-      title={id ? (id === 1 ? "查看角色" : "编辑角色") : "新增角色"}
-      footer={
-        [] // 设置footer为空,去掉 取消 确定默认按钮
-      }
-    >
-      <div className={classNames("roleAddMain", id === 1 ? "lookRole" : "")}>
-        <div className="row">
-          <span className="bs rowSpan">角色名称:</span>
-          <div className="inputBox">
-            <Input
-              maxLength={8}
-              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="row rowThree">
-          <span className="rowSpan">权限设置:</span>
-          <div className="inputBox inputBoxCheck">
-            {list.map((v) => (
-              <Checkbox
-                className="rowCheck"
-                key={v.id}
-                checked={v.authority}
-                onChange={(e) => checkChangeFu(e.target.checked, v.id)}
-              >
-                {v.name}
-              </Checkbox>
-            ))}
-            {id === 1 ? (
-              <>
-                <Checkbox className="rowCheck" defaultChecked={true}>
-                  用户管理
-                </Checkbox>
-                <Checkbox className="rowCheck" defaultChecked={true}>
-                  角色管理
-                </Checkbox>
-                <Checkbox className="rowCheck" defaultChecked={true}>
-                  操作日志
-                </Checkbox>
-              </>
-            ) : null}
-          </div>
-        </div>
-
-        <div className="roleAddButton">
-          {id !== 1 ? (
-            <>
-              <Button type="primary" onClick={btnOkFu}>
-                提交
-              </Button>
-              &emsp;
-              <Popconfirm
-                title="放弃编辑后,信息将不会保存!"
-                okText="放弃"
-                cancelText="取消"
-                onConfirm={closePage}
-              >
-                <Button>取消</Button>
-              </Popconfirm>
-            </>
-          ) : (
-            <Button onClick={closePage}>关闭</Button>
-          )}
-        </div>
-      </div>
-    </Modal>
-  );
-}
-
-const MemoRoleAdd = React.memo(RoleAdd);
-
-export default MemoRoleAdd;

+ 0 - 21
src/pages/Role/index.module.scss

@@ -1,21 +0,0 @@
-.Role{
-  :global{
-    .roleTop{
-      height: 95px;
-      border-radius: 10px;
-      background-color: #fff;
-      .searchTop{
-        display: flex;
-        justify-content: space-between;
-        align-items: center;
-        padding: 5px 40px 5px 24px;
-      }
-    }
-    .roleMain{
-      margin-top: 15px;
-      height: calc(100% - 105px);
-      border-radius: 10px;
-      background-color: #fff;
-    }
-  }
-}

+ 0 - 237
src/pages/Role/index.tsx

@@ -1,237 +0,0 @@
-import { RootState } from "@/store";
-import {
-  getRoleListAPI,
-  roleDisplayAPI,
-  roleRemoveAPI,
-} from "@/store/action/role";
-import { RoleTableType } from "@/types";
-import { Button, Input, message, Popconfirm, Switch, Table } from "antd";
-import React, {
-  useCallback,
-  useEffect,
-  useMemo,
-  useRef,
-  useState,
-} from "react";
-import { useDispatch, useSelector } from "react-redux";
-import styles from "./index.module.scss";
-import RoleAdd from "./RoleAdd";
-function Role() {
-  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 isEnabledClickFu = useCallback(
-    async (val: boolean, id: number) => {
-      const isDisable = val ? 1 : 0;
-      const res: any = await roleDisplayAPI(id, isDisable);
-      if (res.code === 0) dispatch(getRoleListAPI(tableSelect));
-    },
-    [dispatch, tableSelect]
-  );
-
-  // 点击删除
-  const delTableFu = useCallback(
-    async (id: number) => {
-      const res: any = await roleRemoveAPI(id);
-      if (res.code === 0) {
-        message.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.RoleReducer.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: "启用状态",
-        render: (item: RoleTableType) => (
-          <Switch
-            disabled={item.roleKey === "sys_admin"}
-            checkedChildren="启用"
-            unCheckedChildren="停用"
-            checked={item.isEnabled === 1}
-            onChange={(val) => isEnabledClickFu(val, item.id!)}
-          />
-        ),
-      },
-
-      {
-        title: "操作",
-        render: (item: RoleTableType) => {
-          return (
-            <>
-              <Button
-                size="small"
-                type="text"
-                onClick={() => openEditPageFu(item.id!)}
-              >
-                {item.roleKey === "sys_admin" ? "查看" : "编辑"}
-              </Button>
-              {item.roleKey !== "sys_admin" ? (
-                <Popconfirm
-                  title="删除后无法恢复,是否删除?"
-                  okText="删除"
-                  cancelText="取消"
-                  onConfirm={() => delTableFu(item.id!)}
-                >
-                  <Button size="small" type="text" danger>
-                    删除
-                  </Button>
-                </Popconfirm>
-              ) : null}
-            </>
-          );
-        },
-      },
-    ];
-  }, [delTableFu, isEnabledClickFu, openEditPageFu]);
-
-  return (
-    <div className={styles.Role}>
-      <div className="roleTop">
-        <div className="pageTitlt">角色管理</div>
-        <div className="searchTop">
-          <div className="row">
-            <span>角色名:</span>
-            <Input
-              key={inputKey}
-              maxLength={8}
-              style={{ width: 200 }}
-              placeholder="请输入"
-              allowClear
-              onChange={(e) => nameChange(e)}
-            />
-          </div>
-          <div className="row">
-            <Button type="primary" onClick={() => openEditPageFu(0)}>
-              新增
-            </Button>
-          </div>
-        </div>
-      </div>
-
-      <div className="roleMain">
-        <Table
-          scroll={{ y: 575 }}
-          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 MemoRole = React.memo(Role);
-
-export default MemoRole;

+ 0 - 87
src/pages/Wall/WallAdd/index.css

@@ -1,87 +0,0 @@
-.wallAdd .ant-modal-close {
-  display: none;
-}
-.wallAdd .wallAddMain {
-  border-top: 1px solid #999999;
-  padding-top: 15px;
-  width: 100%;
-}
-.wallAdd .wallAddMain .fileBoxRow_up {
-  cursor: pointer;
-  font-size: 30px;
-  width: 100px;
-  height: 100px;
-  background-color: #fafafa;
-  border: 1px dashed #ccc;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-}
-.wallAdd .wallAddMain .fileBoxRow_r_img {
-  width: 120px;
-  height: 120px;
-  position: relative;
-}
-.wallAdd .wallAddMain .fileBoxRow_r_img .clearCover {
-  cursor: pointer;
-  z-index: 10;
-  position: absolute;
-  width: 50px;
-  height: 50px;
-  top: 50%;
-  transform: translateY(-50%);
-  right: -50px;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  font-size: 24px;
-}
-.wallAdd .wallAddMain .fileBoxRow_r_tit {
-  margin-top: 5px;
-  font-size: 14px;
-  color: #7e7c7c;
-}
-.wallAdd .wallAddMain .row {
-  position: relative;
-  margin-bottom: 15px;
-  display: flex;
-}
-.wallAdd .wallAddMain .row .lable {
-  line-height: 30px;
-  width: 54px;
-  text-align: right;
-  font-weight: 700;
-}
-.wallAdd .wallAddMain .row .bs {
-  position: absolute;
-  top: 7px;
-  left: 0px;
-  z-index: 10;
-  color: #ff4d4f;
-}
-.wallAdd .wallAddMain .upBox .upVideoSucc {
-  display: flex;
-  flex-wrap: wrap;
-  align-items: center;
-  margin: 10px 30px 10px 0;
-}
-.wallAdd .wallAddMain .upBox .upVideoSucc .upVideoSuccTxt {
-  max-width: 280px;
-  overflow: hidden;
-  text-overflow: ellipsis;
-  white-space: nowrap;
-}
-.wallAdd .wallAddMain .upBox .upVideoSucc > div {
-  margin-right: 20px;
-}
-.wallAdd .wallAddMain .upBox .upVideoSucc .lookVideoIncoBox {
-  cursor: pointer;
-  font-size: 20px;
-}
-.wallAdd .wallAddMain .upBox .upVideoSucc .clearCover {
-  cursor: pointer;
-  font-size: 20px;
-}
-.wallAdd .wallAddBtn {
-  text-align: center;
-}

+ 0 - 109
src/pages/Wall/WallAdd/index.less

@@ -1,109 +0,0 @@
-.wallAdd {
-  .ant-modal-close {
-    display: none;
-  }
-
-  .wallAddMain {
-    border-top: 1px solid #999999;
-    padding-top: 15px;
-    width: 100%;
-
-
-
-    .fileBoxRow_up {
-      cursor: pointer;
-      font-size: 30px;
-      width: 100px;
-      height: 100px;
-      background-color: #fafafa;
-      border: 1px dashed #ccc;
-      display: flex;
-      justify-content: center;
-      align-items: center;
-
-
-    }
-
-    .fileBoxRow_r_img {
-      width: 120px;
-      height: 120px;
-      position: relative;
-
-      .clearCover {
-        cursor: pointer;
-        z-index: 10;
-        position: absolute;
-        width: 50px;
-        height: 50px;
-        top: 50%;
-        transform: translateY(-50%);
-        right: -50px;
-        display: flex;
-        justify-content: center;
-        align-items: center;
-        font-size: 24px;
-      }
-    }
-
-    .fileBoxRow_r_tit {
-      margin-top: 5px;
-      font-size: 14px;
-      color: rgb(126, 124, 124);
-    }
-
-    .row {
-      position: relative;
-      margin-bottom: 15px;
-      display: flex;
-
-      .lable {
-        line-height: 30px;
-        width: 54px;
-        text-align: right;
-        font-weight: 700;
-      }
-
-      .bs {
-        position: absolute;
-        top: 7px;
-        left: 0px;
-        z-index: 10;
-        color: #ff4d4f;
-      }
-    }
-
-    .upBox {
-      .upVideoSucc {
-        display: flex;
-        flex-wrap: wrap;
-        align-items: center;
-        margin: 10px 30px 10px 0;
-
-        .upVideoSuccTxt {
-          max-width: 280px;
-          overflow: hidden;
-          text-overflow: ellipsis;
-          white-space: nowrap;
-        }
-
-        &>div {
-          margin-right: 20px;
-        }
-
-        .lookVideoIncoBox {
-          cursor: pointer;
-          font-size: 20px;
-        }
-
-        .clearCover {
-          cursor: pointer;
-          font-size: 20px;
-        }
-      }
-    }
-  }
-
-  .wallAddBtn {
-    text-align: center;
-  }
-}

+ 0 - 313
src/pages/Wall/WallAdd/index.tsx

@@ -1,313 +0,0 @@
-import { Button, Input, message, Modal, Popconfirm, Select } from "antd";
-import React, { useCallback, useEffect, useRef, useState } from "react";
-import {
-  PlusOutlined,
-  CloseCircleOutlined,
-  UploadOutlined,
-  PlayCircleOutlined,
-} from "@ant-design/icons";
-import "./index.css";
-import ImageLazy from "@/components/ImageLazy";
-import {
-  getWallDetailByIdAPI,
-  wallUploadAPI,
-  wallUpSaveAPI,
-} from "@/store/action/wall";
-import { WallUpSaveAPI } from "@/types";
-import { useDispatch } from "react-redux";
-
-type Props = {
-  id: number;
-  closeFu: () => void;
-  upList: () => void;
-};
-
-// 上传附件的进度条
-const UpAsyncLodingDom: any = document.querySelector("#UpAsyncLoding");
-const progressDom: any = document.querySelector("#progress");
-
-function WallAdd({ id, closeFu, upList }: Props) {
-  const dispatch = useDispatch();
-
-  // 上传的inputRef
-  const myInput = useRef<HTMLInputElement>(null);
-
-  // 类型
-  const [type, setType] = useState<"img" | "video">("img");
-
-  // 名称
-  const [name, setName] = useState("");
-
-  // 图片
-  const [cover, setCover] = useState({ fileName: "", filePath: "" });
-
-  // 视频
-  const [video, setVideo] = useState({ fileName: "", filePath: "" });
-
-  // 通过id获取详情
-  const getInfoById = useCallback(async () => {
-    const res = await getWallDetailByIdAPI(id);
-
-    setType(res.data.type);
-
-    setName(res.data.name);
-
-    if (res.data.type === "img")
-      setCover({ fileName: res.data.fileName, filePath: res.data.filePath });
-    else setVideo({ fileName: res.data.fileName, filePath: res.data.filePath });
-  }, [id]);
-  // 进来看看是不是编辑
-  useEffect(() => {
-    if (id) getInfoById();
-  }, [getInfoById, id]);
-
-  // 上传图片或者视频
-  const handeUpPhoto = useCallback(
-    async (e: React.ChangeEvent<HTMLInputElement>) => {
-      if (e.target.files) {
-        // 拿到files信息
-        const filesInfo = e.target.files[0];
-
-        let typeArr = [] as string[];
-        let tit1 = "";
-        let fileSize = 20 * 1024 * 1024;
-        let tit2 = "最大支持20M!";
-
-        if (type === "img") {
-          typeArr = ["image/jpeg", "image/png", "image/gif"];
-          tit1 = "只支持jpg、png、gif格式!";
-        } else {
-          tit2 = "最大支持500M!";
-          fileSize = 500 * 1024 * 1024;
-          typeArr = ["video/mp4"];
-          tit1 = "只支持mp4格式!";
-        }
-
-        // 校验格式
-        if (!typeArr.includes(filesInfo.type)) {
-          e.target.value = "";
-          return message.warning(tit1);
-        }
-
-        // 校验大小
-        if (filesInfo.size > fileSize) {
-          e.target.value = "";
-          return message.warning(tit2);
-        }
-
-        // 创建FormData对象
-        const fd = new FormData();
-        // 把files添加进FormData对象(‘photo’为后端需要的字段)
-        fd.append("type", type);
-        fd.append("file", filesInfo);
-        e.target.value = "";
-
-        const res: any = await wallUploadAPI(fd);
-        if (res.code === 0) {
-          message.success("上传成功!");
-
-          // 上传的是图片
-          if (type === "img") setCover(res.data);
-          else setVideo(res.data);
-        }
-        UpAsyncLodingDom.style.opacity = 0;
-        progressDom.style.width = "0%";
-      }
-    },
-    [type]
-  );
-
-  // 点击确定
-  const btnOkFu = useCallback(async () => {
-    if (name === "") return message.warning("请输入名称!");
-
-    if (
-      (type === "img" && cover.fileName === "") ||
-      (type === "video" && video.fileName === "")
-    )
-      return message.warning("请上传附件!");
-
-    const obj: WallUpSaveAPI = {
-      fileName: type === "img" ? cover.fileName : video.fileName,
-      filePath: type === "img" ? cover.filePath : video.filePath,
-      id: id ? id : null,
-      name: name,
-      type: type,
-    };
-
-    const res: any = await wallUpSaveAPI(obj);
-
-    if (res.code === 0) {
-      message.success(`${id ? "编辑" : "新增"}成功!`);
-
-      upList();
-      closeFu();
-    }
-  }, [
-    closeFu,
-    cover.fileName,
-    cover.filePath,
-    id,
-    name,
-    type,
-    upList,
-    video.fileName,
-    video.filePath,
-  ]);
-
-  return (
-    <Modal
-      wrapClassName="wallAdd"
-      destroyOnClose
-      open={true}
-      title={id ? "编辑" : "新增"}
-      footer={
-        [] // 设置footer为空,去掉 取消 确定默认按钮
-      }
-    >
-      {/* 主要内容 */}
-      <div className="wallAddMain">
-        <div className="row">
-          <div className="bs">*</div>
-          <div className="lable">类型:</div>
-          <Select
-            value={type}
-            onChange={(val) => setType(val)}
-            style={{ width: 100 }}
-            options={[
-              { value: "img", label: "图片" },
-              { value: "video", label: "视频" },
-            ]}
-          />
-        </div>
-
-        <div className="row">
-          <div className="bs">*</div>
-          <div className="lable">名称:</div>
-          <Input
-            maxLength={15}
-            showCount
-            style={{ width: 300 }}
-            placeholder="请输入"
-            value={name}
-            onChange={(e) => setName(e.target.value.trim())}
-          />
-        </div>
-
-        <div className="row">
-          <div className="bs">*</div>
-          <div className="lable">附件:</div>
-
-          <div className="upBox">
-            <input
-              id="upInput"
-              type="file"
-              accept={type === "img" ? ".png,.jpg,.gif,.jpeg" : ".mp4"}
-              ref={myInput}
-              onChange={(e) => handeUpPhoto(e)}
-            />
-            {type === "img" ? (
-              // 图片上传
-              <>
-                <div
-                  hidden={cover.fileName !== ""}
-                  className="fileBoxRow_up"
-                  onClick={() => myInput.current?.click()}
-                >
-                  <PlusOutlined />
-                </div>
-                <div
-                  className="fileBoxRow_r_img"
-                  hidden={cover.fileName === ""}
-                >
-                  {cover.filePath ? (
-                    <ImageLazy width={120} height={120} src={cover.filePath} />
-                  ) : null}
-
-                  <Popconfirm
-                    title="删除后无法恢复,是否删除?"
-                    okText="删除"
-                    cancelText="取消"
-                    onConfirm={() => setCover({ fileName: "", filePath: "" })}
-                  >
-                    <div className="clearCover">
-                      <CloseCircleOutlined />
-                    </div>
-                  </Popconfirm>
-                </div>
-              </>
-            ) : (
-              // 视频上传
-              <>
-                <div className="upVideo">
-                  <Button
-                    onClick={() => myInput.current?.click()}
-                    icon={<UploadOutlined />}
-                  >
-                    上传
-                  </Button>
-                </div>
-                {/* 视频上传成功之后的信息 */}
-                <div className="upVideoSucc">
-                  <div className="upVideoSuccTxt">{video.fileName}</div>
-                  <div
-                    className="lookVideoIncoBox"
-                    hidden={!video.fileName}
-                    onClick={() =>
-                      dispatch({
-                        type: "login/lookVideo",
-                        payload: video.filePath,
-                      })
-                    }
-                  >
-                    <PlayCircleOutlined />
-                  </div>
-                  <Popconfirm
-                    title="删除后无法恢复,是否删除?"
-                    okText="删除"
-                    cancelText="取消"
-                    onConfirm={() => setVideo({ fileName: "", filePath: "" })}
-                  >
-                    <div className="clearCover" hidden={!video.fileName}>
-                      <CloseCircleOutlined />
-                    </div>
-                  </Popconfirm>
-                </div>
-              </>
-            )}
-
-            {/* 图片上传提示 */}
-            <div className="fileBoxRow_r_tit" hidden={type !== "img"}>
-              图片格式:支持png、jpg、gif和jpeg的图片格式;最大支持20M。
-            </div>
-
-            {/* 视频上传提示 */}
-            <div className="fileBoxRow_r_tit" hidden={type !== "video"}>
-              视频格式:仅支持MP4格式的视频文件,大小不得超过500MB。
-            </div>
-          </div>
-        </div>
-      </div>
-
-      {/* 确定按钮 */}
-      <div className="wallAddBtn">
-        <Button type="primary" onClick={btnOkFu}>
-          提交
-        </Button>
-        &emsp;
-        <Popconfirm
-          title="放弃编辑后,信息将不会保存!"
-          okText="放弃"
-          cancelText="取消"
-          onConfirm={closeFu}
-        >
-          <Button>取消</Button>
-        </Popconfirm>
-      </div>
-    </Modal>
-  );
-}
-
-const MemoWallAdd = React.memo(WallAdd);
-
-export default MemoWallAdd;

+ 0 - 17
src/pages/Wall/WallTable/index.module.scss

@@ -1,17 +0,0 @@
-.WallTable{
-  width: 1200px;
-  height: 100%;
-  :global{
-    .title{
-      display: flex;
-      align-items: center;
-      justify-content: space-between;
-      font-size: 16px;
-      font-weight: 700;
-      width: 100%;
-    }
-    .table{
-      margin-top: 15px;
-    }
-  }
-}

+ 0 - 212
src/pages/Wall/WallTable/index.tsx

@@ -1,212 +0,0 @@
-import ImageLazy from "@/components/ImageLazy";
-import VideoLook from "@/components/VideoLook";
-import { RootState } from "@/store";
-import {
-  awllDisplayAPI,
-  getWallTableListAPI,
-  wallRemoveAPI,
-  wallSortAPI,
-} from "@/store/action/wall";
-import { WallTableList } from "@/types";
-import { Button, message, Popconfirm, Switch, Table } from "antd";
-import React, {
-  useCallback,
-  useEffect,
-  useMemo,
-  useRef,
-  useState,
-} from "react";
-import { useDispatch, useSelector } from "react-redux";
-import WallAdd from "../WallAdd";
-import styles from "./index.module.scss";
-function WallTable() {
-  const dispatch = useDispatch();
-
-  useEffect(() => {
-    dispatch(getWallTableListAPI());
-  }, [dispatch]);
-
-  // 切换表格中的启用停用状态
-  const isEnabledClickFu = useCallback(
-    async (val: boolean, id: number) => {
-      const isDisable = val ? 1 : 0;
-      const res: any = await awllDisplayAPI(id, isDisable);
-      if (res.code === 0) dispatch(getWallTableListAPI());
-    },
-    [dispatch]
-  );
-
-  // 点击删除
-  const delTableFu = useCallback(
-    async (id: number) => {
-      const res: any = await wallRemoveAPI(id);
-      if (res.code === 0) {
-        message.success("删除成功!");
-        dispatch(getWallTableListAPI());
-      }
-    },
-    [dispatch]
-  );
-
-  // 点击上移或者下移
-
-  const srotFu = useCallback(
-    async (id: number, broId: number) => {
-      const res: any = await wallSortAPI(id, broId);
-      if (res.code === 0) {
-        message.success("操作成功!");
-        dispatch(getWallTableListAPI());
-      }
-    },
-    [dispatch]
-  );
-
-  // 从仓库中获取列表数据
-  const results = useSelector((state: RootState) => state.wallReducer.list);
-
-  // 点击新增或者编辑
-  const [open, setOpen] = useState(false);
-
-  const editId = useRef(0);
-
-  const editTableFu = useCallback(
-    (id: number) => {
-      if (id === 0 && results.length >= 20)
-        return message.warning("最多支持上传20个内容!");
-
-      editId.current = id;
-      setOpen(true);
-    },
-    [results.length]
-  );
-
-  const columns = useMemo(() => {
-    return [
-      // {
-      //   width: 80,
-      //   title: "序号",
-      //   render: (text: any, record: any, index: any) => index + 1,
-      // },
-      {
-        width: 100,
-        title: "内容类型",
-        render: (item: WallTableList) =>
-          item.type === "img" ? "图片" : "视频",
-      },
-      {
-        title: "附件名称",
-        dataIndex: "fileName",
-      },
-      {
-        width: 100,
-        title: "附件预览",
-        render: (item: WallTableList) => {
-          if (item.type === "img")
-            return (
-              <div className="tableImgAuto">
-                <ImageLazy width={80} height={80} src={item.filePath} />
-              </div>
-            );
-          else
-            return (
-              <div className="tableImgAuto">
-                <VideoLook width={80} height={80} src={item.filePath} />
-              </div>
-            );
-        },
-      },
-      {
-        title: "名称",
-        dataIndex: "name",
-      },
-      {
-        width: 100,
-        title: "展示状态",
-        render: (item: WallTableList) => (
-          <Switch
-            checkedChildren="启用"
-            unCheckedChildren="停用"
-            checked={item.display === 1}
-            onChange={(val) => isEnabledClickFu(val, item.id)}
-          />
-        ),
-      },
-      {
-        width: 200,
-        title: "操作",
-        render: (item: WallTableList, _: any, index: any) => (
-          <>
-            <Button
-              size="small"
-              type="text"
-              disabled={index === 0}
-              onClick={() => srotFu(item.id, results[index - 1].id)}
-            >
-              上移
-            </Button>
-            <Button
-              size="small"
-              type="text"
-              disabled={index === results.length - 1}
-              onClick={() => srotFu(item.id, results[index + 1].id)}
-            >
-              下移
-            </Button>
-            <Button
-              size="small"
-              type="text"
-              onClick={() => editTableFu(item.id)}
-            >
-              编辑
-            </Button>
-            <Popconfirm
-              title="删除后无法恢复,是否删除?"
-              okText="删除"
-              cancelText="取消"
-              onConfirm={() => delTableFu(item.id)}
-            >
-              <Button size="small" type="text" danger>
-                删除
-              </Button>
-            </Popconfirm>
-          </>
-        ),
-      },
-    ];
-  }, [delTableFu, editTableFu, isEnabledClickFu, results, srotFu]);
-
-  return (
-    <div className={styles.WallTable}>
-      <div className="title">
-        <div className="txt">内容管理</div>
-        <div className="titleButton">
-          <Button type="primary" onClick={() => editTableFu(0)}>
-            新增
-          </Button>
-        </div>
-      </div>
-      <div className="table">
-        <Table
-          size="small"
-          scroll={{ y: 428 }}
-          dataSource={results}
-          columns={columns}
-          rowKey="id"
-          pagination={false}
-        />
-      </div>
-      {/* 点击新增或者编辑 */}
-      {open ? (
-        <WallAdd
-          id={editId.current}
-          closeFu={() => setOpen(false)}
-          upList={() => dispatch(getWallTableListAPI())}
-        />
-      ) : null}
-    </div>
-  );
-}
-
-const MemoWallTable = React.memo(WallTable);
-
-export default MemoWallTable;

+ 0 - 60
src/pages/Wall/index.module.scss

@@ -1,60 +0,0 @@
-.Wall {
-  :global {
-    .wallBox1 {
-      width: 100%;
-      height: 170px;
-      margin: 15px 0;
-      border-radius: 10px;
-      background-color: #fff;
-      padding: 10px 15px 0;
-
-      .wallTit {
-        display: flex;
-        align-items: center;
-        justify-content: space-between;
-        font-size: 16px;
-        font-weight: 700;
-        width: 400px;
-
-        .wallLeft {
-          display: flex;
-          align-items: center;
-        }
-
-        .hotTitleInco {
-          cursor: pointer;
-          position: relative;
-          z-index: 10;
-          width: 16px;
-          height: 16px;
-          border-radius: 50%;
-          background-color: #696969;
-          margin-left: 8px;
-          text-align: center;
-          line-height: 16px;
-          color: #fff;
-          font-size: 12px;
-
-        }
-      }
-
-      .autoPlay {
-        display: flex;
-        align-items: center;
-        margin-top: 20px;
-
-        .bs {
-          margin: 0 8px;
-        }
-      }
-    }
-
-    .wallBox2 {
-      width: 100%;
-      height: calc(100% - 235px);
-      border-radius: 10px;
-      background-color: #fff;
-      padding: 10px 15px 0;
-    }
-  }
-}

+ 0 - 196
src/pages/Wall/index.tsx

@@ -1,196 +0,0 @@
-import {
-  Button,
-  Radio,
-  Tooltip,
-  DatePicker,
-  Select,
-  message,
-  Popconfirm,
-} from "antd";
-import React, { useCallback, useEffect, useState } from "react";
-import styles from "./index.module.scss";
-import { ExclamationOutlined } from "@ant-design/icons";
-import dayjs from "dayjs";
-import { editWallAutoApi, getWallAutoApi } from "@/store/action/wall";
-import { EditWallAutoApi } from "@/types";
-import WallTable from "./WallTable";
-const { RangePicker } = DatePicker;
-function Wall() {
-  // 获取自动播放信息
-  const getWallAutoApiFu = useCallback(async () => {
-    const res = await getWallAutoApi();
-    setValue0(res.data.isAuto);
-    setTime0(res.data.startTime + "," + res.data.endTime);
-    setMove0(res.data.type);
-  }, []);
-
-  useEffect(() => {
-    getWallAutoApiFu();
-  }, [getWallAutoApiFu]);
-
-  // 关于自动播放的修改
-  const [state, setState] = useState(false);
-  // 自动轮播开启关闭的展示
-  const [value0, setValue0] = useState(-1);
-
-  // 自动轮播开启关闭的修改
-  const [value1, setValue1] = useState(0);
-
-  // 自动轮播时间的展示
-  const [time0, setTime0] = useState(" , ");
-
-  // 自动轮播时间的修改
-  const [time1, setTime1] = useState<string[]>([]);
-
-  // 自动轮播动画的展示
-  const [move0, setMove0] = useState("");
-
-  // 自动轮播动画的修改
-  const [move1, setMove1] = useState("");
-
-  // 点击修改
-  const editAutoPlay = useCallback(() => {
-    setValue1(value0);
-    setTime1(time0.split(","));
-    setMove1(move0);
-    setState(true);
-  }, [move0, time0, value0]);
-
-  // 时间选择器改变
-  const timeChange = (date: any, dateString: any) => {
-    setTime1(dateString);
-  };
-
-  // 自动播放点击取消
-  const btnX = useCallback(() => {
-    setState(false);
-  }, []);
-
-  // 自动播放点击确定
-
-  const btnOk = useCallback(async () => {
-    const obj = {
-      endTime: time1[1],
-      startTime: time1[0],
-      isAuto: value1,
-      type: move1,
-    } as EditWallAutoApi;
-    const res: any = await editWallAutoApi(obj);
-    if (res.code === 0) {
-      message.success("修改成功!");
-      getWallAutoApiFu();
-    }
-    btnX();
-  }, [btnX, getWallAutoApiFu, move1, time1, value1]);
-
-  return (
-    <div className={styles.Wall}>
-      <div className="pageTitlt">万物墙管理</div>
-
-      {/* 第一个盒子 */}
-      <div className="wallBox1">
-        {/* 自动播放 */}
-        <div className="wallTit">
-          <div className="wallLeft">
-            自动播放
-            <div className="hotTitleInco">
-              <Tooltip title="当超过15秒未操作时,将按顺序自动播放下列内容">
-                <div className="hotTitleInco1">
-                  <ExclamationOutlined />
-                </div>
-              </Tooltip>
-            </div>
-          </div>
-
-          <div className="awllTitButton">
-            {state ? (
-              <>
-                <Button type="primary" onClick={btnOk}>
-                  确定
-                </Button>
-                &emsp;
-                <Popconfirm
-                  title="放弃编辑后,信息将不会保存!"
-                  okText="放弃"
-                  cancelText="取消"
-                  onConfirm={btnX}
-                >
-                  <Button>取消</Button>
-                </Popconfirm>
-              </>
-            ) : (
-              <Button type="primary" onClick={editAutoPlay}>
-                修改
-              </Button>
-            )}
-          </div>
-        </div>
-
-        <div className="autoPlay">
-          <div>自动轮播:</div>&emsp;&emsp;
-          {state ? (
-            <>
-              <Radio.Group
-                onChange={(e) => setValue1(e.target.value)}
-                value={value1}
-              >
-                <Radio value={0}>关闭</Radio>
-                <Radio value={1}>开启</Radio>
-              </Radio.Group>
-              &emsp;
-              <RangePicker
-                allowClear={false}
-                defaultValue={[
-                  dayjs(time1[0], "YYYY/MM/DD"),
-                  dayjs(time1[1], "YYYY/MM/DD"),
-                ]}
-                onChange={timeChange}
-              />
-            </>
-          ) : (
-            <>
-              <div>{value0 ? "开启" : "关闭"}</div>
-              <div className="bs"> | </div>
-              <div>
-                {time0.split(",")[0]} 至 {time0.split(",")[1]}
-              </div>
-            </>
-          )}
-        </div>
-
-        <div className="autoPlay">
-          <div>动画设置:</div>&emsp;&emsp;
-          {state ? (
-            <>
-              <Select
-                style={{ width: 150 }}
-                value={move1}
-                onChange={(e) => setMove1(e)}
-                options={[
-                  { value: "随机", label: "随机" },
-                  { value: "飞入", label: "飞入" },
-                  { value: "劈裂", label: "劈裂" },
-                  { value: "百叶窗", label: "百叶窗" },
-                  { value: "落叶式", label: "落叶式" },
-                  { value: "规则图形路径", label: "规则图形路径" },
-                  { value: "圆形展开", label: "圆形展开" },
-                ]}
-              />
-            </>
-          ) : (
-            <div>{move0}</div>
-          )}
-        </div>
-      </div>
-
-      {/* 第二个盒子 */}
-      <div className="wallBox2">
-        <WallTable />
-      </div>
-    </div>
-  );
-}
-
-const MemoWall = React.memo(Wall);
-
-export default MemoWall;

+ 0 - 56
src/store/action/role.ts

@@ -1,56 +0,0 @@
-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);
-
-    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");
-    dispatch({ type: "login/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}`);
-};

+ 2 - 2
src/store/action/user.ts

@@ -1,4 +1,4 @@
-import { RoleTableType, SaveUserType, UserTableAPIType } from "@/types";
+import { SaveUserType, UserTableAPIType } from "@/types";
 import http from "@/utils/http";
 import { AppDispatch } from "..";
 /**
@@ -22,7 +22,7 @@ export const getUserListAPI = (data: UserTableAPIType) => {
 export const getUserRoleAPI = () => {
   return async (dispatch: AppDispatch) => {
     const res = await http.get("sys/user/getRole");
-    const data: RoleTableType[] = res.data;
+    const data: any[] = res.data;
     const newData = data.map((v) => ({ label: v.roleName, value: v.id }));
     dispatch({ type: "user/getRoleList", payload: newData });
   };

+ 0 - 83
src/store/action/wall.ts

@@ -1,83 +0,0 @@
-import { EditWallAutoApi, WallUpSaveAPI } from "@/types";
-import http from "@/utils/http";
-import { AppDispatch } from "..";
-
-/**
- * 获取万物墙自动播放数据
- */
-export const getWallAutoApi = () => {
-  return http.get("cms/wall/getInfo");
-};
-
-/**
- * 修改万物墙自动播放数据
- */
-export const editWallAutoApi = (data: EditWallAutoApi) => {
-  return http.post("cms/wall/editInfo", data);
-};
-
-/**
- * 获取列表数据
- */
-export const getWallTableListAPI = () => {
-  return async (dispatch: AppDispatch) => {
-    const res = await http.get("cms/wall/list");
-    dispatch({ type: "wall/getList", payload: res.data });
-  };
-};
-
-/**
- * 内容-是否显示
- */
-export const awllDisplayAPI = (id: number, display: number) => {
-  return http.get(`cms/wall/display/${id}/${display}`);
-};
-
-/**
- * 万物墙上传图片和视频
- */
-
-// 上传附件的进度条
-const UpAsyncLodingDom: any = document.querySelector("#UpAsyncLoding");
-const progressDom: any = document.querySelector("#progress");
-
-export const wallUploadAPI = (data: any) => {
-  UpAsyncLodingDom.style.opacity = 1;
-
-  return http.post("cms/wall/upload", data, {
-    timeout:30000,
-    // 显示进度条
-    onUploadProgress: (e: any) => {
-      const complete = (e.loaded / e.total) * 100 || 0;
-      progressDom.style.width = complete + "%";
-    },
-  });
-};
-
-/**
- * 内容-新增|编辑
- */
-export const wallUpSaveAPI = (data: WallUpSaveAPI) => {
-  return http.post("cms/wall/save", data);
-};
-
-/**
- * 内容-排序
- */
-export const wallSortAPI = (id1: number, id2: number) => {
-  return http.get(`cms/wall/sort/${id1}/${id2}`);
-};
-
-/**
- * 内容-删除
- */
-export const wallRemoveAPI = (id: number) => {
-  return http.get(`cms/wall/remove/${id}`);
-};
-
-/**
- * 内容-详情
- */
-export const getWallDetailByIdAPI = (id: number) => {
-  return http.get(`cms/wall/detail/${id}`);
-};

+ 0 - 4
src/store/reducer/index.ts

@@ -6,18 +6,14 @@ import logReducer from './log'
 
 // 导入 登录 模块的 reducer
 import loginReducer from './login'
-import RoleReducer from './role'
 import userReducer from './user'
-import wallReducer from './wall'
 
 // 合并 reducer
 const rootReducer = combineReducers({
   loginStore: loginReducer,
-  wallReducer:wallReducer,
   goodsReducer:goodsReducer,
   userReducer:userReducer,
   logReducer:logReducer,
-  RoleReducer:RoleReducer,
   ExhibitReducer:ExhibitReducer
 })
 

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

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

+ 0 - 21
src/store/reducer/wall.ts

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

+ 0 - 30
src/types/api/role.d.ts

@@ -1,30 +0,0 @@
-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;
-  children?: null;
-  id: number;
-  name: string;
-  parentId?: null;
-  resourceType?: string;
-}
-
-export type AddRoleType ={
-  id:number|null
-  roleName:string
-  roleDesc:string
-  resources:number[]
-}

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

@@ -1,28 +0,0 @@
-export type EditWallAutoApi = {
-  endTime: string;
-  isAuto: number;
-  startTime: string;
-  type: string;
-};
-
-export type WallTableList = {
-  createTime: string;
-  creatorId: number;
-  creatorName: string;
-  display: number;
-  fileName: string;
-  filePath: string;
-  id: number;
-  name: string;
-  sort: number;
-  type: 'img'|'video';
-  updateTime: string;
-};
-
-export type WallUpSaveAPI ={
-  fileName: string;
-  filePath: string;
-  id: number|null;
-  name: string;
-  type: string;
-}