shaogen1995 před 3 týdny
revize
0c1d580daa
98 změnil soubory, kde provedl 50269 přidání a 0 odebrání
  1. 12 0
      .editorconfig
  2. 3 0
      .env
  3. 23 0
      .gitignore
  4. 11 0
      .prettierrc.js
  5. 39 0
      .vscode/settings.json
  6. 9 0
      README.md
  7. 10 0
      config-overrides.js
  8. 31293 0
      package-lock.json
  9. 72 0
      package.json
  10. 8 0
      path.tsconfig.json
  11. 17 0
      public/index.html
  12. 65 0
      src/App.tsx
  13. binární
      src/assets/img/IMGerror.png
  14. binární
      src/assets/img/bg.jpg
  15. binární
      src/assets/img/loading.gif
  16. binární
      src/assets/img/user.png
  17. 179 0
      src/assets/styles/base.css
  18. 291 0
      src/assets/styles/base.less
  19. 21 0
      src/components/AsyncSpinLoding/index.module.scss
  20. 15 0
      src/components/AsyncSpinLoding/index.tsx
  21. 32 0
      src/components/AuthRoute/index.tsx
  22. 51 0
      src/components/ImageLazy/index.module.scss
  23. 63 0
      src/components/ImageLazy/index.tsx
  24. 65 0
      src/components/LookDom/index.module.scss
  25. 46 0
      src/components/LookDom/index.tsx
  26. 29 0
      src/components/Message/index.tsx
  27. 49 0
      src/components/MyPopconfirm.tsx
  28. 18 0
      src/components/MyTable/index.module.scss
  29. 205 0
      src/components/MyTable/index.tsx
  30. 22 0
      src/components/NotFound/index.tsx
  31. 9 0
      src/components/SpinLoding/index.module.scss
  32. 13 0
      src/components/SpinLoding/index.tsx
  33. 21 0
      src/components/SpinLodingSon/index.module.scss
  34. 15 0
      src/components/SpinLodingSon/index.tsx
  35. 43 0
      src/components/UpAsyncLoding/index.module.scss
  36. 38 0
      src/components/UpAsyncLoding/index.tsx
  37. 41 0
      src/components/YtableVideo/index.module.scss
  38. 36 0
      src/components/YtableVideo/index.tsx
  39. 64 0
      src/components/Z3upFiles/data.ts
  40. 85 0
      src/components/Z3upFiles/index.module.scss
  41. 310 0
      src/components/Z3upFiles/index.tsx
  42. 82 0
      src/components/ZRichText/index.module.scss
  43. 216 0
      src/components/ZRichText/index.tsx
  44. 195 0
      src/components/ZRichTexts/index.module.scss
  45. 412 0
      src/components/ZRichTexts/index.tsx
  46. 63 0
      src/components/ZupAudio/index.module.scss
  47. 122 0
      src/components/ZupAudio/index.tsx
  48. 101 0
      src/components/ZupOne/index.module.scss
  49. 286 0
      src/components/ZupOne/index.tsx
  50. 215 0
      src/components/ZupTypes/index.module.scss
  51. 627 0
      src/components/ZupTypes/index.tsx
  52. 95 0
      src/components/ZupVideos/index.module.scss
  53. 193 0
      src/components/ZupVideos/index.tsx
  54. 35 0
      src/index.tsx
  55. 298 0
      src/pages/A1atlas/A1add.tsx
  56. 51 0
      src/pages/A1atlas/data.ts
  57. 152 0
      src/pages/A1atlas/index.module.scss
  58. 317 0
      src/pages/A1atlas/index.tsx
  59. 45 0
      src/pages/A2video/A2add/index.module.scss
  60. 96 0
      src/pages/A2video/A2add/index.tsx
  61. 9 0
      src/pages/A2video/data.ts
  62. 8 0
      src/pages/A2video/index.module.scss
  63. 88 0
      src/pages/A2video/index.tsx
  64. 25 0
      src/pages/Layout/data.ts
  65. 164 0
      src/pages/Layout/index.module.scss
  66. 250 0
      src/pages/Layout/index.tsx
  67. 143 0
      src/pages/Login/index.module.scss
  68. 132 0
      src/pages/Login/index.tsx
  69. 19 0
      src/pages/Z1user/UserAdd/index.module.scss
  70. 121 0
      src/pages/Z1user/UserAdd/index.tsx
  71. 86 0
      src/pages/Z1user/index.module.scss
  72. 189 0
      src/pages/Z1user/index.tsx
  73. 5 0
      src/pages/初始化组件/index.module.scss
  74. 14 0
      src/pages/初始化组件/index.tsx
  75. 41 0
      src/store/action/A1atlas.ts
  76. 21 0
      src/store/action/A2video.ts
  77. 68 0
      src/store/action/Z1user.ts
  78. 50 0
      src/store/action/layout.ts
  79. 20 0
      src/store/index.ts
  80. 34 0
      src/store/reducer/A1atlas.ts
  81. 25 0
      src/store/reducer/A2video.ts
  82. 28 0
      src/store/reducer/Z1user.ts
  83. 19 0
      src/store/reducer/index.ts
  84. 63 0
      src/store/reducer/layout.ts
  85. 31 0
      src/types/api/Z1user.d.ts
  86. 11 0
      src/types/api/Z2log.d.ts
  87. 19 0
      src/types/api/layot.d.ts
  88. 11 0
      src/types/declaration.d.ts
  89. 3 0
      src/types/index.d.ts
  90. 35 0
      src/utils/domShow.ts
  91. 31 0
      src/utils/history.ts
  92. 106 0
      src/utils/http.ts
  93. 50 0
      src/utils/message.ts
  94. 100 0
      src/utils/pass.ts
  95. 40 0
      src/utils/storage.ts
  96. 22 0
      src/utils/tableData.ts
  97. 27 0
      tsconfig.json
  98. 11237 0
      yarn.lock

+ 12 - 0
.editorconfig

@@ -0,0 +1,12 @@
+root = true # 控制配置文件 .editorconfig 是否生效的字段
+ 
+[**] # 匹配全部文件
+indent_style = space # 缩进风格,可选space|tab
+indent_size = 2 # 缩进的空格数
+charset = utf-8 # 设置字符集
+trim_trailing_whitespace = true # 删除一行中的前后空格
+insert_final_newline = true # 设为true表示使文件以一个空白行结尾
+end_of_line = lf
+ 
+[**.md] # 匹配md文件
+trim_trailing_whitespace = false

+ 3 - 0
.env

@@ -0,0 +1,3 @@
+# .env.production
+GENERATE_SOURCEMAP = false
+# 关闭映射

+ 23 - 0
.gitignore

@@ -0,0 +1,23 @@
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
+
+# dependencies
+/node_modules
+/.pnp
+.pnp.js
+
+# testing
+/coverage
+
+# production
+/build
+
+# misc
+.DS_Store
+.env.local
+.env.development.local
+.env.test.local
+.env.production.local
+
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*

+ 11 - 0
.prettierrc.js

@@ -0,0 +1,11 @@
+module.exports = {
+  printWidth: 100, // 一行的字符数,如果超过会进行换行
+  tabWidth: 2, // 一个tab代表几个空格数,默认就是2
+  useTabs: false, // 是否启用tab取代空格符缩进,.editorconfig设置空格缩进,所以设置为false
+  semi: false, // 行尾是否使用分号,默认为true
+  singleQuote: true, // 字符串是否使用单引号
+  trailingComma: "none", // 对象或数组末尾是否添加逗号 none| es5| all
+  jsxSingleQuote: true, // 在jsx里是否使用单引号,你看着办
+  bracketSpacing: true, // 对象大括号直接是否有空格,默认为true,效果:{ foo: bar }
+  arrowParens: "avoid", // 箭头函数如果只有一个参数则省略括号
+};

+ 39 - 0
.vscode/settings.json

@@ -0,0 +1,39 @@
+{
+  "search.exclude": {
+    "/node_modules": true,
+    "dist": true,
+    "pnpm-lock.sh": true
+  },
+  "editor.formatOnSave": true,
+  "[javascript]": {
+    "editor.defaultFormatter": "esbenp.prettier-vscode"
+  },
+  "[javascriptreact]": {
+    "editor.defaultFormatter": "esbenp.prettier-vscode"
+  },
+  "[typescript]": {
+    "editor.defaultFormatter": "esbenp.prettier-vscode"
+  },
+  "[typescriptreact]": {
+    "editor.defaultFormatter": "esbenp.prettier-vscode"
+  },
+  "[json]": {
+    "editor.defaultFormatter": "vscode.json-language-features"
+  },
+  "[html]": {
+    "editor.defaultFormatter": "esbenp.prettier-vscode"
+  },
+  "[markdown]": {
+    "editor.defaultFormatter": "esbenp.prettier-vscode"
+  },
+  "[css]": {
+    "editor.defaultFormatter": "esbenp.prettier-vscode"
+  },
+  "[less]": {
+    "editor.defaultFormatter": "esbenp.prettier-vscode"
+  },
+  "[scss]": {
+    "editor.defaultFormatter": "esbenp.prettier-vscode"
+  },
+  "liveServer.settings.port": 5502
+}

+ 9 - 0
README.md

@@ -0,0 +1,9 @@
+1.使用 yarn。 npm 有问题
+
+2.测试后端文档地址:https://sit-jiningbwg.4dage.com/api/doc.html#/home
+
+3.测试堡垒机位置:227/data/data/museum_neimenggu_jining_storage_data
+
+4:测试网址:https://sit-jiningbwg.4dage.com/backstage
+
+5:蓝湖地址:https://lanhuapp.com/web/#/item/project/product?tid=de3e5e3e-a489-4b19-862a-7c87ce113467&pid=b9372812-c1fc-4468-b4df-66d479852d37&image_id=64607cd0-37bc-4303-bd30-18ed52cc6b0d&docId=64607cd0-37bc-4303-bd30-18ed52cc6b0d&docType=axure&versionId=002aa9ce-c05b-489d-9908-d2df106c9942&pageId=94d8a5537a30480f93582ce01f79905c&parentId=6d680122-8ca9-4720-b76b-75e22561a31c&share_type=quickShare

+ 10 - 0
config-overrides.js

@@ -0,0 +1,10 @@
+const path = require('path')
+const { override, addWebpackAlias } = require('customize-cra')
+
+// 添加 @ 别名
+const webpackAlias = addWebpackAlias({
+  '@': path.resolve(__dirname, 'src'),
+})
+
+// 导出要进行覆盖的 webpack 配置
+module.exports = override(webpackAlias)

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 31293 - 0
package-lock.json


+ 72 - 0
package.json

@@ -0,0 +1,72 @@
+{
+  "name": "demo2",
+  "version": "0.1.0",
+  "private": true,
+  "dependencies": {
+    "@ant-design/cssinjs": "^1.5.6",
+    "@dnd-kit/core": "^6.3.1",
+    "@dnd-kit/sortable": "^10.0.0",
+    "@dnd-kit/utilities": "^3.2.2",
+    "@testing-library/jest-dom": "^5.16.5",
+    "@testing-library/react": "^13.4.0",
+    "@testing-library/user-event": "^13.5.0",
+    "@types/jest": "^27.5.2",
+    "@types/node": "^16.18.3",
+    "@types/react": "^18.0.24",
+    "@types/react-dom": "^18.0.8",
+    "antd": "^5.8.3",
+    "antd-mobile": "^5.30.0",
+    "axios": "^1.1.3",
+    "braft-editor": "^2.3.9",
+    "braft-utils": "^3.0.12",
+    "dayjs": "^1.11.10",
+    "echarts": "^6.0.0",
+    "file-saver": "^2.0.5",
+    "js-base64": "^3.7.3",
+    "js-export-excel": "^1.1.4",
+    "react": "^18.2.0",
+    "react-dom": "^18.2.0",
+    "react-redux": "^8.0.4",
+    "react-router-dom": "5.3",
+    "react-scripts": "5.0.1",
+    "react-sortablejs": "^6.1.4",
+    "redux": "^4.2.0",
+    "redux-devtools-extension": "^2.13.9",
+    "redux-thunk": "^2.4.1",
+    "sass": "^1.55.0",
+    "typescript": "^4.8.4",
+    "web-vitals": "^2.1.4",
+    "xlsx": "^0.18.5"
+  },
+  "scripts": {
+    "dev": "react-app-rewired start",
+    "build": "react-app-rewired build",
+    "test": "react-app-rewired test",
+    "eject": "react-scripts eject"
+  },
+  "eslintConfig": {
+    "extends": [
+      "react-app",
+      "react-app/jest"
+    ]
+  },
+  "browserslist": {
+    "production": [
+      ">0.2%",
+      "not dead",
+      "not op_mini all"
+    ],
+    "development": [
+      "last 1 chrome version",
+      "last 1 firefox version",
+      "last 1 safari version"
+    ]
+  },
+  "devDependencies": {
+    "@types/history": "^5.0.0",
+    "@types/react-router-dom": "^5.3.3",
+    "customize-cra": "^1.0.0",
+    "react-app-rewired": "^2.2.1"
+  },
+  "homepage": "."
+}

+ 8 - 0
path.tsconfig.json

@@ -0,0 +1,8 @@
+{
+    "compilerOptions": {
+      "baseUrl": "./",
+      "paths": {
+        "@/*": ["src/*"]
+      }
+    }
+  }

+ 17 - 0
public/index.html

@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="zh">
+  <head>
+    <meta charset="utf-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1" />
+    <meta name="theme-color" content="#000000" />
+    <meta name="description" content="Web site created using create-react-app" />
+    <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
+    <!-- <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon"> -->
+
+    <title>无尽意 东魏程哲碑-虚拟展管理后台</title>
+  </head>
+  <body>
+    <noscript>You need to enable JavaScript to run this app.</noscript>
+    <div id="root"></div>
+  </body>
+</html>

+ 65 - 0
src/App.tsx

@@ -0,0 +1,65 @@
+import '@/assets/styles/base.css'
+// 关于路由
+import React from 'react'
+import { Router, Route, Switch } from 'react-router-dom'
+import history from './utils/history'
+import AuthRoute from './components/AuthRoute'
+import SpinLoding from './components/SpinLoding'
+import AsyncSpinLoding from './components/AsyncSpinLoding'
+import { Image } from 'antd'
+import { useSelector } from 'react-redux'
+import store, { RootState } from './store'
+import UpAsyncLoding from './components/UpAsyncLoding'
+import MessageCom from './components/Message'
+import LookDom from './components/LookDom'
+const Layout = React.lazy(() => import('./pages/Layout'))
+const Login = React.lazy(() => import('./pages/Login'))
+
+export default function App() {
+  // 从仓库中获取查看图片的信息
+  const lookBigImg = useSelector((state: RootState) => state.A0Layout.lookBigImg)
+
+  return (
+    <>
+      {/* 关于路由 */}
+      <Router history={history}>
+        <React.Suspense fallback={<SpinLoding />}>
+          <Switch>
+            {/* 测试页面 */}
+            <Route path='/login' component={Login} />
+            <AuthRoute path='/' component={Layout} />
+          </Switch>
+        </React.Suspense>
+      </Router>
+
+      {/* 发送请求的加载组件 */}
+      <AsyncSpinLoding />
+
+      {/* 所有图片点击预览查看大图 */}
+      {lookBigImg.show ? (
+        <Image
+          preview={{
+            visible: lookBigImg.show,
+            src: lookBigImg.url,
+            onVisibleChange: value => {
+              // 清除仓库信息
+              store.dispatch({
+                type: 'layout/lookBigImg',
+                payload: { url: '', show: false }
+              })
+            }
+          }}
+        />
+      ) : null}
+
+      {/* 上传附件的进度条元素 */}
+      <UpAsyncLoding />
+
+      {/* 查看视频音频 */}
+      <LookDom />
+
+      {/* antd 轻提示 ---兼容360浏览器 */}
+      <MessageCom />
+    </>
+  )
+}

binární
src/assets/img/IMGerror.png


binární
src/assets/img/bg.jpg


binární
src/assets/img/loading.gif


binární
src/assets/img/user.png


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

@@ -0,0 +1,179 @@
+* {
+  margin: 0;
+  padding: 0;
+  box-sizing: border-box;
+}
+html {
+  height: 100%;
+  font-size: 14px;
+}
+body {
+  font: 1em/1.4 'Microsoft Yahei', 'PingFang SC', 'Avenir', 'Segoe UI', 'Hiragino Sans GB', 'STHeiti', 'Microsoft Sans Serif', 'WenQuanYi Micro Hei', sans-serif;
+  height: 100%;
+  color: black;
+}
+i {
+  font-style: normal;
+}
+img {
+  max-width: 100%;
+  max-height: 100%;
+  vertical-align: middle;
+  object-fit: cover;
+}
+ul {
+  list-style: none;
+}
+body {
+  overflow: auto;
+  overflow-y: overlay;
+}
+/* 文本域取消下拉 */
+textarea {
+  resize: none !important;
+  min-height: 100px !important;
+}
+/* 主题色 */
+:root {
+  --themeColor: #a76f4f;
+  --themeColor2: #f9e0ab;
+}
+/* 找不到页面 */
+.noFindPage {
+  opacity: 0;
+  transition: opacity 0.5s;
+}
+.noFindPage .ant-result-title {
+  display: none;
+}
+/* 兼容360浏览器的下拉框 */
+.ant-select-selector {
+  position: relative;
+  background-color: #ffffff;
+  border: 1px solid #d9d9d9;
+  transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
+}
+.ant-popconfirm {
+  width: 240px;
+}
+#root {
+  width: 100vw;
+  height: 100vh;
+  min-width: 1600px;
+  min-height: 900px;
+  overflow: auto;
+  overflow-y: overlay;
+  /* 普通文字按钮的颜色 */
+  /* 按钮的危险颜色 */
+  /* antd分页器样式 */
+  /* 表格的图片居中 */
+  /* antd图片预览组件 */
+  /* antd表格居中 */
+}
+#root a {
+  text-decoration: none;
+  color: black;
+  outline: none;
+}
+#root .iconHoverTit {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+#root .iconHoverTitTxt {
+  background-color: var(--themeColor);
+  color: #fff;
+  width: 16px;
+  height: 16px;
+  line-height: 16px;
+  text-align: center;
+  font-size: 12px;
+  border-radius: 50%;
+}
+#root .ant-btn-text {
+  color: var(--themeColor);
+}
+#root .ant-btn-text:disabled {
+  cursor: not-allowed;
+  color: rgba(0, 0, 0, 0.25);
+}
+#root .ant-btn-text.ant-btn-dangerous {
+  color: #ff4d4d;
+}
+#root .tableImgAuto {
+  display: flex;
+  justify-content: center;
+}
+#root .ant-image {
+  display: none;
+}
+#root .ant-table-cell {
+  text-align: center !important;
+}
+#root #A2Table3 .ant-table-row-expand-icon {
+  background-color: var(--themeColor);
+  color: #fff;
+}
+#root #A2Table3 .ant-table-cell-with-append {
+  display: flex;
+  justify-content: flex-start;
+}
+[hidden] {
+  display: none !important;
+}
+#upInput {
+  display: none;
+}
+#upInput2 {
+  display: none;
+}
+#upInputAudio {
+  display: none;
+}
+.pageTitle {
+  font-size: 18px;
+  font-weight: 700;
+  position: absolute;
+  z-index: 11;
+  top: -56px;
+  left: -18px;
+  padding-left: 40px;
+  color: var(--themeColor);
+}
+.pageTitle::before {
+  position: absolute;
+  left: 20px;
+  top: 50%;
+  transform: translateY(-50%);
+  content: '';
+  width: 6px;
+  height: 20px;
+  background-color: var(--themeColor);
+}
+.mySorrl::-webkit-scrollbar {
+  /*滚动条整体样式*/
+  width: 5px;
+  /*高宽分别对应横竖滚动条的尺寸*/
+  height: 1px;
+}
+.mySorrl::-webkit-scrollbar-thumb {
+  /*滚动条里面小方块*/
+  border-radius: 10px;
+  -webkit-box-shadow: inset 0 0 5px transparent;
+  background: var(--themeColor);
+}
+.mySorrl::-webkit-scrollbar-track {
+  /*滚动条里面轨道*/
+  -webkit-box-shadow: inset 0 0 5px transparent;
+  border-radius: 10px;
+  background: transparent;
+}
+.ant-image-preview-operations {
+  background-color: rgba(0, 0, 0, 0.8) !important;
+}
+.AIdroRow {
+  display: block;
+  width: 100%;
+  height: 100%;
+  text-align: center;
+}

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

@@ -0,0 +1,291 @@
+* {
+  margin: 0;
+  padding: 0;
+  box-sizing: border-box;
+}
+
+html {
+  height: 100%;
+  font-size: 14px;
+  // user-select: none;
+}
+
+body {
+  font: 1em/1.4 'Microsoft Yahei', 'PingFang SC', 'Avenir', 'Segoe UI', 'Hiragino Sans GB',
+    'STHeiti', 'Microsoft Sans Serif', 'WenQuanYi Micro Hei', sans-serif;
+  height: 100%;
+  color: black;
+}
+
+i {
+  font-style: normal;
+}
+
+img {
+  max-width: 100%;
+  max-height: 100%;
+  vertical-align: middle;
+  object-fit: cover;
+}
+
+ul {
+  list-style: none;
+}
+
+body {
+  overflow: auto;
+  overflow-y: overlay;
+}
+
+/* 文本域取消下拉 */
+textarea {
+  resize: none !important;
+  min-height: 100px !important;
+}
+
+/* 主题色 */
+:root {
+  --themeColor: #a76f4f;
+  --themeColor2: #f9e0ab;
+}
+
+/* 找不到页面 */
+.noFindPage {
+  opacity: 0;
+  transition: opacity 0.5s;
+  .ant-result-title {
+    display: none;
+  }
+}
+
+/* 兼容360浏览器的下拉框 */
+.ant-select-selector {
+  position: relative;
+  background-color: #ffffff;
+  border: 1px solid #d9d9d9;
+  transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
+}
+
+// 气泡框闪烁问题
+.ant-popconfirm {
+  width: 240px;
+}
+
+// 重置antd样式
+#root {
+  width: 100vw;
+  height: 100vh;
+  min-width: 1600px;
+  min-height: 900px;
+  overflow: auto;
+  overflow-y: overlay;
+
+  a {
+    text-decoration: none;
+    color: black;
+    outline: none;
+  }
+
+  // ?的提示
+  .iconHoverTit {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+  }
+
+  .iconHoverTitTxt {
+    background-color: var(--themeColor);
+    color: #fff;
+    width: 16px;
+    height: 16px;
+    line-height: 16px;
+    text-align: center;
+    font-size: 12px;
+    border-radius: 50%;
+  }
+
+  // a {
+  //   color: var(--themeColor);
+  // }
+
+  /* 普通文字按钮的颜色 */
+  .ant-btn-text {
+    color: var(--themeColor);
+  }
+
+  .ant-btn-text:disabled {
+    cursor: not-allowed;
+    color: rgba(0, 0, 0, 0.25);
+  }
+
+  /* 按钮的危险颜色 */
+  .ant-btn-text.ant-btn-dangerous {
+    color: #ff4d4d;
+  }
+
+  /* antd分页器样式 */
+  // .ant-pagination .ant-pagination-item {
+  //   border-radius: 50%;
+  //   border: 1px solid #999;
+  //   background-color: transparent !important;
+  // }
+
+  // .ant-pagination .ant-pagination-item-active {
+  //   background-color: var(--themeColor) !important;
+  // }
+
+  // .ant-pagination .ant-pagination-item-active a {
+  //   color: #fff !important;
+  // }
+
+  // .ant-pagination .ant-pagination-item:hover {
+  //   background-color: var(--themeColor) !important;
+  // }
+
+  // .ant-pagination .ant-pagination-item:hover a {
+  //   color: #fff !important;
+  // }
+
+  // .ant-pagination-prev {
+  //   border-radius: 50% !important;
+  //   border: 1px solid #999;
+  // }
+
+  // .ant-pagination-prev:hover {
+  //   background-color: var(--themeColor);
+  // }
+
+  // .ant-pagination-prev:hover button {
+  //   color: #fff;
+  // }
+
+  // .ant-pagination-next {
+  //   border-radius: 50% !important;
+  //   border: 1px solid #999;
+  // }
+
+  // .ant-pagination-next:hover {
+  //   background-color: var(--themeColor);
+  // }
+
+  // .ant-pagination-next:hover button {
+  //   color: #fff;
+  // }
+
+  // .ant-pagination-disabled {
+  //   border: 1px solid #ccc;
+  // }
+
+  // .ant-pagination-disabled:hover {
+  //   background-color: transparent;
+  // }
+
+  /* 表格的图片居中 */
+  .tableImgAuto {
+    display: flex;
+    justify-content: center;
+  }
+
+  /* antd图片预览组件 */
+  .ant-image {
+    display: none;
+  }
+
+  /* antd表格居中 */
+
+  .ant-table-cell {
+    text-align: center !important;
+  }
+
+  // 树型 表格 定制化
+  #A2Table3 {
+    .ant-table-row-expand-icon {
+      background-color: var(--themeColor);
+      color: #fff;
+    }
+
+    .ant-table-cell-with-append {
+      display: flex;
+      justify-content: flex-start;
+    }
+  }
+}
+
+[hidden] {
+  display: none !important;
+}
+
+#upInput {
+  display: none;
+}
+
+#upInput2 {
+  display: none;
+}
+
+#upInputAudio {
+  display: none;
+}
+
+// 页面标题
+.pageTitle {
+  font-size: 18px;
+  font-weight: 700;
+  position: absolute;
+  z-index: 11;
+  top: -56px;
+  left: -18px;
+  padding-left: 40px;
+  color: var(--themeColor);
+
+  &::before {
+    position: absolute;
+    left: 20px;
+    top: 50%;
+    transform: translateY(-50%);
+    content: '';
+    width: 6px;
+    height: 20px;
+    background-color: var(--themeColor);
+  }
+}
+
+// 滚动条
+.mySorrl::-webkit-scrollbar {
+  /*滚动条整体样式*/
+  width: 5px;
+  /*高宽分别对应横竖滚动条的尺寸*/
+  height: 1px;
+}
+
+.mySorrl::-webkit-scrollbar-thumb {
+  /*滚动条里面小方块*/
+  border-radius: 10px;
+  -webkit-box-shadow: inset 0 0 5px transparent;
+  background: var(--themeColor);
+}
+
+.mySorrl::-webkit-scrollbar-track {
+  /*滚动条里面轨道*/
+  -webkit-box-shadow: inset 0 0 5px transparent;
+  border-radius: 10px;
+  background: transparent;
+}
+.ant-image-preview-operations {
+  background-color: rgba(0, 0, 0, 0.8) !important;
+}
+// .ant-image-preview-mask {
+//   z-index: 9999 !important;
+// }
+// .ant-image-preview-wrap {
+//   z-index: 9999 !important;
+// }
+// .ant-image-preview-operations-wrapper {
+//   z-index: 9999 !important;
+// }
+.AIdroRow {
+  display: block;
+  width: 100%;
+  height: 100%;
+  text-align: center;
+}

+ 21 - 0
src/components/AsyncSpinLoding/index.module.scss

@@ -0,0 +1,21 @@
+.AsyncSpinLoding {
+  opacity: 0;
+  pointer-events: none;
+  transition: all .5s;
+  position: fixed;
+  z-index: 9998;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  // background-color: rgba(0, 0, 0, .6);
+  background-color: transparent;
+  :global{
+    .ant-spin-spinning{
+      position: absolute;
+      top: 50%;
+      left: 50%;
+      transform: translate(-50%,-50%);
+    }
+  }
+}

+ 15 - 0
src/components/AsyncSpinLoding/index.tsx

@@ -0,0 +1,15 @@
+import styles from "./index.module.scss";
+import { Spin } from "antd";
+import React from "react";
+
+function AsyncSpinLoding() {
+  return (
+    <div id="AsyncSpinLoding" className={styles.AsyncSpinLoding}>
+      <Spin size="large" />
+    </div>
+  );
+}
+
+const MemoAsyncSpinLoding = React.memo(AsyncSpinLoding);
+
+export default MemoAsyncSpinLoding;

+ 32 - 0
src/components/AuthRoute/index.tsx

@@ -0,0 +1,32 @@
+import { hasToken } from "@//utils/storage";
+import { MessageFu } from "@/utils/message";
+import React from "react";
+import { Redirect, Route } from "react-router-dom";
+
+type AtahType = {
+  path: string;
+  component: React.FC;
+  [x: string]: any;
+};
+
+export default function AuthRoute({ path, component: Com, ...rest }: AtahType) {
+  return (
+    <Route
+      path={path}
+      {...rest}
+      render={() => {
+        if (hasToken()) return <Com />;
+        else {
+          MessageFu.warning("登录失效!");
+          return (
+            <Redirect
+              to={{
+                pathname: "/login",
+              }}
+            />
+          );
+        }
+      }}
+    />
+  );
+}

+ 51 - 0
src/components/ImageLazy/index.module.scss

@@ -0,0 +1,51 @@
+.ImageLazy {
+  position: relative;
+
+  :global {
+    .lazyBox {
+      width: 100%;
+      height: 100%;
+      position: relative;
+
+      .adm-image {
+        width: 100%;
+        height: 100%;
+
+        img {
+          width: 100%;
+          height: 100%;
+        }
+      }
+
+      .lookImg {
+        cursor: pointer;
+        transition: opacity .3s;
+        opacity: 0;
+        pointer-events: none;
+        position: absolute;
+        top: 0;
+        left: 0;
+        width: 100%;
+        height: 100%;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        font-size: 18px;
+        color: #fff;
+        background-color: rgba(0, 0, 0, .6);
+
+        &>div {
+          font-size: 14px;
+        }
+      }
+
+      &:hover {
+        .lookImg {
+          opacity: 1;
+          pointer-events: auto;
+        }
+      }
+    }
+  }
+
+}

+ 63 - 0
src/components/ImageLazy/index.tsx

@@ -0,0 +1,63 @@
+import React, { useCallback, useState } from 'react'
+import styles from './index.module.scss'
+import { baseURL } from '@/utils/http'
+import imgLoding from '@/assets/img/loading.gif'
+import imgErr from '@/assets/img/IMGerror.png'
+import { EyeOutlined } from '@ant-design/icons'
+import store from '@/store'
+import { Image } from 'antd-mobile'
+
+type Props = {
+  width?: number | string
+  height?: number | string
+  src: string
+  srcBig?: string
+  noLook?: boolean
+  offline?: boolean
+}
+
+function ImageLazy({ width = 100, height = 100, src, srcBig, noLook, offline = false }: Props) {
+  // 默认不能预览图片,加载成功之后能预览
+  const [lookImg, setLookImg] = useState(false)
+
+  // 图片加载完成
+  const onLoad = useCallback(() => {
+    setLookImg(true)
+  }, [])
+
+  // 点击预览图片
+  const lookBigImg = useCallback(() => {
+    store.dispatch({
+      type: 'layout/lookBigImg',
+      payload: { url: offline ? src : baseURL + (srcBig ? srcBig : src), show: true }
+    })
+  }, [offline, src, srcBig])
+
+  return (
+    <div className={styles.ImageLazy} style={{ width: width, height: height }}>
+      <div className='lazyBox'>
+        <Image
+          lazy
+          onLoad={onLoad}
+          src={src ? (offline ? src : baseURL + src) : ''}
+          placeholder={<img src={imgLoding} alt='' />}
+          fallback={<img src={imgErr} alt='' />}
+          fit='cover'
+        />
+
+        {/* 图片预览 */}
+        {noLook || !lookImg ? null : (
+          <div className='lookImg' onClick={lookBigImg}>
+            <EyeOutlined rev={undefined} />
+            &nbsp;
+            <div>预览</div>
+          </div>
+        )}
+      </div>
+    </div>
+  )
+}
+
+const MemoImageLazy = React.memo(ImageLazy)
+
+export default MemoImageLazy

+ 65 - 0
src/components/LookDom/index.module.scss

@@ -0,0 +1,65 @@
+.LookDom {
+  transition: opacity .3s;
+  position: fixed;
+  z-index: 9991;
+  opacity: 0;
+  pointer-events: none;
+  top: 0;
+  left: 0;
+  width: 100vw;
+  height: 100vh;
+  background-color: rgba(0, 0, 0, .6);
+
+  :global {
+    .close {
+      color: #fff;
+      position: absolute;
+      right: 70px;
+      top: 70px;
+      font-size: 30px;
+      cursor: pointer;
+      z-index: 10;
+    }
+
+    .viedoBox {
+      position: absolute;
+      top: 50%;
+      left: 50%;
+      transform: translate(-50%, -50%);
+      width: 800px;
+      height: 500px;
+
+      video {
+        width: 100%;
+        height: 100%;
+      }
+    }
+
+    .audioBox {
+      position: absolute;
+      top: 50%;
+      left: 50%;
+      transform: translate(-50%, -50%);
+      width: 500px;
+      height: 60px;
+
+      audio {
+        width: 100%;
+        height: 100%;
+      }
+    }
+
+    .modelBox {
+      position: absolute;
+      top: 0;
+      left: 0;
+      width: 100%;
+      height: 100%;
+
+      iframe {
+        width: 100%;
+        height: 100%;
+      }
+    }
+  }
+}

+ 46 - 0
src/components/LookDom/index.tsx

@@ -0,0 +1,46 @@
+import React from 'react'
+import { CloseCircleOutlined } from '@ant-design/icons'
+import styles from './index.module.scss'
+import { useSelector } from 'react-redux'
+import store, { RootState } from '@/store'
+import { baseURL } from '@/utils/http'
+function LookDom() {
+  const { src, type, flag } = useSelector((state: RootState) => state.A0Layout.lookDom)
+  return (
+    <div className={styles.LookDom} style={src ? { opacity: 1, pointerEvents: 'auto' } : {}}>
+      {src ? (
+        <>
+          {type === 'video' ? (
+            <div className='viedoBox'>
+              <video autoPlay controls src={flag ? src : baseURL + src}></video>
+            </div>
+          ) : type === 'audio' ? (
+            <div className='audioBox'>
+              <audio autoPlay controls src={flag ? src : baseURL + src}></audio>
+            </div>
+          ) : (
+            <div className='modelBox'>
+              <iframe src={`model.html?m=${src}`} title='model'></iframe>
+            </div>
+          )}
+
+          <div
+            className='close'
+            onClick={() =>
+              store.dispatch({
+                type: 'layout/lookDom',
+                payload: { src: '', type: '', flag: false }
+              })
+            }
+          >
+            <CloseCircleOutlined rev={undefined} />
+          </div>
+        </>
+      ) : null}
+    </div>
+  )
+}
+
+const MemoLookDom = React.memo(LookDom)
+
+export default MemoLookDom

+ 29 - 0
src/components/Message/index.tsx

@@ -0,0 +1,29 @@
+import React, { useEffect } from "react";
+import { message } from "antd";
+import { useSelector } from "react-redux";
+import { RootState } from "@/store";
+
+function MessageCom() {
+  // 从仓库中获取 antd 轻提示信息
+  const messageReducerInfo = useSelector(
+    (state: RootState) => state.A0Layout.message
+  );
+
+  const [messageApi, contextHolder] = message.useMessage();
+
+  useEffect(() => {
+    if (messageReducerInfo.txt) {
+      messageApi.open({
+        type: messageReducerInfo.type,
+        content: messageReducerInfo.txt,
+        duration: messageReducerInfo.duration,
+      });
+    }
+  }, [messageApi, messageReducerInfo]);
+
+  return <>{contextHolder}</>;
+}
+
+const MemoMessage = React.memo(MessageCom);
+
+export default MemoMessage;

+ 49 - 0
src/components/MyPopconfirm.tsx

@@ -0,0 +1,49 @@
+import React, { useMemo } from 'react'
+import { Button, Popconfirm } from 'antd'
+
+type Props = {
+  txtK: '删除' | '删除2' | '取消' | '返回' | '重置密码' | '退出登录' | '重新提交'
+  onConfirm: () => void
+  Dom?: React.ReactNode
+  loc?: 'bottom'
+}
+
+function MyPopconfirm({ txtK, onConfirm, Dom, loc }: Props) {
+  const txt = useMemo(() => {
+    const obj = {
+      删除: ['删除后无法恢复,是否删除?', '删除'],
+      删除2: ['确定发起删除订单吗?', '确定'],
+      取消: ['放弃编辑后,信息将不会保存!', '放弃'],
+      返回: ['放弃编辑后,信息将不会保存!', '放弃'],
+      重置密码: ['密码重制后为Aa147852,是否重置?', '重置'],
+      退出登录: ['确定退出吗?', '确定'],
+      重新提交: ['确定重新提交吗?', '确定']
+    }
+    return Reflect.get(obj, txtK) || ['', '']
+  }, [txtK])
+
+  return (
+    <Popconfirm
+      placement={loc}
+      title={txt[0]}
+      okText={txt[1]}
+      cancelText='取消'
+      onConfirm={onConfirm}
+      okButtonProps={{ loading: false }}
+    >
+      {Dom ? (
+        Dom
+      ) : txtK === '删除' ? (
+        <Button size='small' type='text' danger>
+          {txtK}
+        </Button>
+      ) : (
+        <Button>{txtK}</Button>
+      )}
+    </Popconfirm>
+  )
+}
+
+const MemoMyPopconfirm = React.memo(MyPopconfirm)
+
+export default MemoMyPopconfirm

+ 18 - 0
src/components/MyTable/index.module.scss

@@ -0,0 +1,18 @@
+.MyTable {
+  :global {
+    .ant-table-body {
+      overflow-y: auto !important;
+      overflow-y: overlay !important;
+
+      .ant-table-row {
+        .ant-table-cell {
+          padding: 10px;
+
+          a {
+            color: var(--themeColor) !important;
+          }
+        }
+      }
+    }
+  }
+}

+ 205 - 0
src/components/MyTable/index.tsx

@@ -0,0 +1,205 @@
+import React, { useCallback, useEffect, useMemo } from 'react'
+import styles from './index.module.scss'
+import { Table } from 'antd'
+import ImageLazy from '../ImageLazy'
+import dayjs from 'dayjs'
+
+type Props = {
+  yHeight?: number //设置表格的高度
+  list: any //表格数据
+  columnsTemp: any[][] //表格展示
+  total?: number //总数
+  pageNum?: number
+  pageSize?: number
+  pagingInfo?: any | boolean
+  onChange?: (pageNum: number, pageSize: number) => void
+  staBtn?: any
+  lastBtn?: any
+  classKey?: string //一个组件多次使用的时候要传递,分别设置style
+  // 表格简单的合并
+  merge?: { type: string; num: number; loc: 'rowSpan' | 'colSpan' }
+  // 定制化表头
+  myTitle?: { name: string; Com: React.ReactNode }
+  // 为空的定制字段
+  isNull?: string
+  // 设置宽度
+  widthSet?: any
+}
+
+// 表格内容定制化
+const tableComObj = (key: string, val: string[]) => {
+  const obj = {
+    A: (
+      <a href={val[1]} target='_blank' title={val[1]} rel='noreferrer'>
+        {val[0]}
+      </a>
+    )
+  }
+  return Reflect.get(obj, key)
+}
+
+function MyTable({
+  yHeight,
+  list,
+  columnsTemp,
+  total,
+  pageNum = 1,
+  pageSize = 10,
+  pagingInfo = {
+    showQuickJumper: true,
+    position: ['bottomCenter'],
+    showSizeChanger: true
+  },
+  onChange,
+  lastBtn = [],
+  staBtn = [],
+  classKey = '',
+  merge,
+  myTitle,
+  isNull = '(空)',
+  widthSet
+}: Props) {
+  useEffect(() => {
+    const dom = document.querySelector(`.MyTable${classKey} .ant-table-body`) as HTMLDivElement
+
+    if (dom && yHeight) dom.style.height = yHeight + 'px'
+  }, [classKey, yHeight])
+
+  // 页码变化
+  const paginationChange = useCallback(
+    () => (pageNum: number, pageSize: number) => {
+      if (onChange) {
+        onChange(pageNum, pageSize)
+      }
+    },
+    [onChange]
+  )
+
+  const dataChangeFu = useCallback(
+    (v: any) => {
+      /**
+       * index:序号
+       * txt:正常数据
+       * img:图片
+       * txtChange:判断显示不同字段
+       * text:文字比较多的情况
+       */
+
+      const obj = {
+        index: (_: any, __: any, index: number) => index + 1 + (pageNum - 1) * pageSize,
+        txt: (item: any) => item[v[2]] || isNull,
+        adiutTxt: (item: any) => {
+          let txt1 = item.status === 1 ? '同意' : item.status === 2 ? '不同意' : '待处理'
+          if (item.isUse === 0) txt1 = '(空)'
+          const txt2 = item.isAuto === 1 ? '(自动)' : ''
+          return txt1 + txt2
+        },
+
+        img: (item: any) => (
+          <div className='tableImgAuto'>
+            <ImageLazy
+              width={60}
+              height={60}
+              src={item[v[2]] || item.thumb}
+              srcBig={item.thumbPc}
+            />
+          </div>
+        ),
+        time: (item: any) => {
+          let txt = isNull
+          if (item[v[2]]) {
+            txt = dayjs(item[v[2]]).format('YYYY-MM-DD')
+          }
+          return txt
+        },
+        // 多个字段拼接
+        ping: (item: any) => {
+          let txt = isNull
+          if (item[v[2]]) {
+            txt = item[v[2]]
+            if (item[v[3]]) {
+              const data = v[4]
+              const id = item[v[3]]
+              const obj = data.find((v: any) => v.value === id)
+              if (obj) txt = txt += obj.label
+            }
+          }
+          return txt
+        },
+        select: (item: any) => {
+          let txt = isNull
+          const data = v[3]
+          const id = item[v[2]]
+          const obj = data.find((v: any) => v.value === id)
+          if (obj) txt = obj.label
+          return txt
+        },
+        txtChange: (item: any) => Reflect.get(v[3], item[v[2]]) || v[4] || isNull,
+        text: (item: any) => {
+          let tempCom: any = item[v[2]] || isNull
+
+          if (tempCom.length >= v[3]) {
+            tempCom = tempCom.substring(0, v[3]) + '...'
+          }
+
+          if (v[4]) {
+            tempCom = tableComObj(v[4], [tempCom, item[v[2]]])
+          } else if (item[v[2]] && item[v[2]].length >= v[3]) {
+            tempCom = (
+              <span style={{ cursor: 'pointer' }} title={item[v[2]]}>
+                {tempCom}
+              </span>
+            )
+          }
+
+          return tempCom
+        }
+      }
+
+      return Reflect.get(obj, v[0])
+    },
+    [isNull, pageNum, pageSize]
+  )
+
+  const columns = useMemo(() => {
+    const arr: any = columnsTemp.map((v: any) => ({
+      title: myTitle && v.includes(myTitle.name) ? myTitle.Com : v[1],
+      render: dataChangeFu(v),
+      width: widthSet && Reflect.get(widthSet, v[2]) ? Reflect.get(widthSet, v[2]) : 'auto',
+      onCell:
+        merge && v.includes(merge.type)
+          ? // {rowSpan:3}
+            (item: any, index: number) => ({
+              rowSpan: index === 0 ? merge.num : 0
+            })
+          : ''
+    }))
+
+    return arr
+  }, [columnsTemp, dataChangeFu, merge, myTitle, widthSet])
+
+  return (
+    <Table
+      className={`${styles.MyTable} MyTable${classKey}`}
+      scroll={{ y: yHeight ? yHeight : '' }}
+      dataSource={list}
+      columns={[...staBtn, ...columns, ...lastBtn]}
+      rowKey='id'
+      pagination={
+        pagingInfo
+          ? {
+              ...pagingInfo,
+              current: pageNum,
+              pageSize: pageSize,
+              total: total,
+              onChange: paginationChange()
+            }
+          : false
+      }
+    />
+  )
+}
+
+const MemoMyTable = React.memo(MyTable)
+
+export default MemoMyTable

+ 22 - 0
src/components/NotFound/index.tsx

@@ -0,0 +1,22 @@
+import { Result } from 'antd'
+import { useEffect, useRef } from 'react'
+
+export default function NotFound() {
+  const timeRef = useRef(-1)
+
+  useEffect(() => {
+    timeRef.current = window.setTimeout(() => {
+      const dom: HTMLDivElement = document.querySelector('.noFindPage')!
+      dom.style.opacity = '1'
+    }, 500)
+    return () => {
+      clearTimeout(timeRef.current)
+    }
+  }, [])
+
+  return (
+    <div className='noFindPage'>
+      <Result status='404' title='404' subTitle='找不到页面,或没有权限!' />
+    </div>
+  )
+}

+ 9 - 0
src/components/SpinLoding/index.module.scss

@@ -0,0 +1,9 @@
+.SpinLoding {
+  position: relative;
+  z-index: 9999;
+  width: 100%;
+  height: 100%;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}

+ 13 - 0
src/components/SpinLoding/index.tsx

@@ -0,0 +1,13 @@
+import styles from "./index.module.scss";
+import { Spin } from "antd";
+import React from "react";
+function SpinLoding() {
+  return (
+    <div className={styles.SpinLoding}>
+      <Spin size='large'/>
+    </div>
+  );
+}
+const MemoSpinLoding = React.memo(SpinLoding);
+
+export default MemoSpinLoding;

+ 21 - 0
src/components/SpinLodingSon/index.module.scss

@@ -0,0 +1,21 @@
+.SpinLodingSon {
+  width: 100%;
+  height: 100%;
+  background-color: #fff;
+  border-radius: 10px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  :global {
+    .SpinLodingSon2 {
+      position: fixed;
+      top: 0;
+      left: 0;
+      width: 100%;
+      height: 100%;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+    }
+  }
+}

+ 15 - 0
src/components/SpinLodingSon/index.tsx

@@ -0,0 +1,15 @@
+import { Spin } from 'antd'
+import styles from './index.module.scss'
+import React from 'react'
+function SpinLodingSon() {
+  return (
+    <div className={styles.SpinLodingSon}>
+      <div className='SpinLodingSon2'>
+        <Spin size='large' />
+      </div>
+    </div>
+  )
+}
+const MemoSpinLodingSon = React.memo(SpinLodingSon)
+
+export default MemoSpinLodingSon

+ 43 - 0
src/components/UpAsyncLoding/index.module.scss

@@ -0,0 +1,43 @@
+.UpAsyncLoding {
+  opacity: 0;
+  pointer-events: none;
+  position: fixed;
+  z-index: 10000;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  background-color: rgba(0, 0, 0, .4);
+
+  :global {
+    .progressBox {
+      position: absolute;
+      top: 60%;
+      left: 50%;
+      transform: translate(-50%, -50%);
+      width: 500px;
+      height: 6px;
+      border-radius: 3px;
+      border: 1px solid var(--themeColor);
+      overflow: hidden;
+
+      #progress {
+        position: absolute;
+        top: 0;
+        left: 0;
+        width: 0%;
+        height: 100%;
+        background-color: var(--themeColor);
+      }
+
+    }
+
+    .closeUpBtn {
+      position: absolute;
+      top: 70%;
+      left: 50%;
+      transform: translate(-50%, -50%);
+    }
+
+  }
+}

+ 38 - 0
src/components/UpAsyncLoding/index.tsx

@@ -0,0 +1,38 @@
+import store, { RootState } from "@/store";
+import { Button } from "antd";
+import React, { useCallback } from "react";
+import { useSelector } from "react-redux";
+import styles from "./index.module.scss";
+function UpAsyncLoding() {
+  // 从仓库中获取取消上传的函数
+  const closeUpFile = useSelector(
+    (state: RootState) => state.A0Layout.closeUpFile
+  );
+
+  const btnClose = useCallback(() => {
+    closeUpFile.fu();
+
+    setTimeout(() => {
+      store.dispatch({
+        type: "layout/closeUpFile",
+        payload: { fu: () => {}, state: false },
+      });
+    }, 200);
+  }, [closeUpFile]);
+
+  return (
+    <div id="UpAsyncLoding" className={styles.UpAsyncLoding}>
+      <div className="progressBox">
+        <div id="progress"></div>
+      </div>
+      {/* 手动取消上传按钮 */}
+      <div className="closeUpBtn">
+        <Button onClick={btnClose}>取消上传</Button>
+      </div>
+    </div>
+  );
+}
+
+const MemoUpAsyncLoding = React.memo(UpAsyncLoding);
+
+export default MemoUpAsyncLoding;

+ 41 - 0
src/components/YtableVideo/index.module.scss

@@ -0,0 +1,41 @@
+.YtableVideo {
+  display: flex;
+  justify-content: center;
+  :global {
+    .TvideoBox {
+      cursor: pointer;
+      width: 60px;
+      height: 60px;
+      position: relative;
+      .TvideoBoxLook {
+        position: absolute;
+        z-index: 10;
+        opacity: 0;
+        transition: opacity 0.3s;
+        top: 0;
+        left: 0;
+        width: 100%;
+        height: 100%;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        font-size: 14px;
+        color: #fff;
+        background-color: rgba(0, 0, 0, 0.6);
+        .anticon-eye {
+          font-size: 18px;
+        }
+      }
+      video {
+        width: 100%;
+        height: 100%;
+        object-fit: cover;
+      }
+      &:hover {
+        .TvideoBoxLook {
+          opacity: 1;
+        }
+      }
+    }
+  }
+}

+ 36 - 0
src/components/YtableVideo/index.tsx

@@ -0,0 +1,36 @@
+import React from 'react'
+import styles from './index.module.scss'
+import store from '@/store'
+import { EyeOutlined } from '@ant-design/icons'
+import { baseURL } from '@/utils/http'
+
+type Props = {
+  src: string
+}
+
+function YtableVideo({ src }: Props) {
+  return (
+    <div className={styles.YtableVideo}>
+      <div className='TvideoBox'>
+        <div
+          className='TvideoBoxLook'
+          onClick={() =>
+            store.dispatch({
+              type: 'layout/lookDom',
+              payload: { src: baseURL + src, type: 'video', flag: true }
+            })
+          }
+        >
+          <EyeOutlined />
+          &nbsp;
+          <div>预览</div>
+        </div>
+        <video src={baseURL + src}></video>
+      </div>
+    </div>
+  )
+}
+
+const MemoYtableVideo = React.memo(YtableVideo)
+
+export default MemoYtableVideo

+ 64 - 0
src/components/Z3upFiles/data.ts

@@ -0,0 +1,64 @@
+import store from '@/store'
+import { baseURL } from '@/utils/http'
+
+// 查看 权限 图片 /视频 、音频
+export const authFilesLookFu = (name: string, url: string) => {
+  let flag = false
+
+  const nameRes = name ? name : ''
+
+  // pdf和txt 直接新窗口打开
+  const arr0: ('.pdf' | '.txt')[] = ['.pdf', '.txt']
+  arr0.forEach(v => {
+    if (nameRes.toLowerCase().endsWith(v)) {
+      if (url) window.open(baseURL + url)
+      flag = true
+    }
+  })
+
+  // 图片使用 antd的图片预览组件
+  const arr1 = ['.png', '.jpg', '.jpeg', '.gif']
+  arr1.forEach(v => {
+    if (nameRes.toLowerCase().endsWith(v)) {
+      if (url) {
+        store.dispatch({
+          type: 'layout/lookBigImg',
+
+          payload: {
+            url: baseURL + url,
+            show: true
+          }
+        })
+      }
+
+      flag = true
+    }
+  })
+
+  // 视频和音频 使用自己的封装的组件
+  let type: '' | 'video' | 'audio' = ''
+  const arr2 = ['.mp3', '.wav']
+  arr2.forEach(v => {
+    if (nameRes.toLowerCase().endsWith(v)) {
+      type = 'audio'
+      flag = true
+    }
+  })
+
+  if (nameRes.toLowerCase().endsWith('.mp4')) {
+    type = 'video'
+    flag = true
+  }
+
+  if (type && url) {
+    store.dispatch({
+      type: 'layout/lookDom',
+      payload: {
+        src: url,
+        type
+      }
+    })
+  }
+
+  return flag
+}

+ 85 - 0
src/components/Z3upFiles/index.module.scss

@@ -0,0 +1,85 @@
+// ----------
+.Z3upFiles {
+  a {
+    color: black;
+  }
+
+  .Z3files {
+    .Z3filesRow {
+      display: flex;
+      align-items: center;
+      padding: 8px 12px;
+      border: 1px solid #d9d9d9;
+      border-radius: 6px;
+      margin-bottom: 8px;
+      background: #fff;
+      transition: all 0.3s;
+
+      &:hover {
+        border-color: #40a9ff;
+        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
+      }
+
+      &.dragging {
+        opacity: 0.5;
+        background: #f0f0f0;
+      }
+
+      &.dragOverlay {
+        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
+        transform: rotate(5deg);
+      }
+
+      .dragHandle {
+        cursor: grab;
+        margin-right: 12px;
+        color: #999;
+        padding: 4px;
+
+        &:active {
+          cursor: grabbing;
+        }
+
+        &:hover {
+          color: #40a9ff;
+        }
+      }
+
+      .Z3files1 {
+        flex: 1;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+      }
+
+      .Z3files2 {
+        display: flex;
+        align-items: center;
+
+        .anticon {
+          cursor: pointer;
+          color: #666;
+
+          &:hover {
+            color: #40a9ff;
+          }
+        }
+      }
+    }
+  }
+
+  .fileTit {
+    margin-top: 12px;
+    color: #666;
+    font-size: 12px;
+
+    .noUpThumb {
+      display: none;
+
+      &.noUpThumbAc {
+        display: block;
+        color: #ff4d4f;
+      }
+    }
+  }
+}

+ 310 - 0
src/components/Z3upFiles/index.tsx

@@ -0,0 +1,310 @@
+import React, { useCallback, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import { FileImgListType } from '@/types'
+import { API_upFile } from '@/store/action/layout'
+import { MessageFu } from '@/utils/message'
+import { fileDomInitialFu } from '@/utils/domShow'
+import { forwardRef, useImperativeHandle } from 'react'
+import { Button, Popconfirm } from 'antd'
+import {
+  UploadOutlined,
+  CloseOutlined,
+  DownloadOutlined,
+  EyeOutlined,
+  MenuOutlined
+} from '@ant-design/icons'
+import classNames from 'classnames'
+import { baseURL } from '@/utils/http'
+import { authFilesLookFu } from './data'
+import { DndContext, DragEndEvent, DragOverlay, DragStartEvent, closestCenter } from '@dnd-kit/core'
+import {
+  SortableContext,
+  useSortable,
+  verticalListSortingStrategy,
+  arrayMove
+} from '@dnd-kit/sortable'
+import { CSS } from '@dnd-kit/utilities'
+
+type Props = {
+  isLook: boolean // 是否是查看
+  ref: any // 当前自己的ref,给父组件调用
+  fileCheck: boolean
+  dirCode: string // 文件的code码
+  myUrl: string
+  fromData?: any
+  accept?: string
+  // result:成果 | list:清单
+  type?: string
+  tips?: string
+  // 文件大小
+  size?: number
+  // 最大文件数量
+  maxCount?: number
+}
+
+// 可排序的文件项组件
+interface SortableFileItemProps {
+  file: FileImgListType
+  onDelete: (id: number) => void
+  isLook: boolean
+  index: number
+}
+
+const SortableFileItem = ({ file, onDelete, isLook, index }: SortableFileItemProps) => {
+  const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({
+    id: file.id
+  })
+
+  const style = {
+    transform: CSS.Transform.toString(transform),
+    transition,
+    opacity: isDragging ? 0.5 : 1
+  }
+
+  return (
+    <div
+      ref={setNodeRef}
+      style={style}
+      className={classNames(styles.Z3filesRow, { [styles.dragging]: isDragging })}
+    >
+      {!isLook && (
+        <div className={styles.dragHandle} {...attributes} {...listeners}>
+          <MenuOutlined rev={undefined} />
+        </div>
+      )}
+      <div className={styles.Z3files1} title={file.fileName}>
+        {file.fileName}
+      </div>
+      <div className={styles.Z3files2}>
+        {authFilesLookFu(file.fileName, '') ? (
+          <>
+            <EyeOutlined
+              rev={undefined}
+              title='查看'
+              onClick={() => authFilesLookFu(file.fileName, file.filePath)}
+            />
+            &emsp;
+          </>
+        ) : null}
+        <a
+          title='下载'
+          href={baseURL + file.filePath}
+          download={file.fileName}
+          target='_blank'
+          rel='noreferrer'
+        >
+          <DownloadOutlined rev={undefined} />
+        </a>
+        &emsp;
+        {!isLook && (
+          <Popconfirm
+            title='删除后无法恢复,是否删除?'
+            okText='删除'
+            cancelText='取消'
+            onConfirm={() => onDelete(file.id)}
+            okButtonProps={{ loading: false }}
+          >
+            <CloseOutlined rev={undefined} title='删除' />
+          </Popconfirm>
+        )}
+      </div>
+    </div>
+  )
+}
+
+function Z3upFiles(
+  {
+    isLook,
+    type = 'doc',
+    fileCheck,
+    dirCode,
+    myUrl,
+    fromData,
+    accept = '.zip',
+    tips = '单个附件不得超过500M',
+    size
+  }: Props,
+  ref: any
+) {
+  const [fileList, setFileList] = useState<FileImgListType[]>([])
+  const [activeId, setActiveId] = useState<number | null>(null)
+  const myInput = useRef<HTMLInputElement>(null)
+
+  // 给父组件调用 回显
+  const showList = useCallback((list: FileImgListType[]) => {
+    setFileList(list)
+  }, [])
+
+  // 上传多个文件
+  const handeUpPhoto = useCallback(
+    async (e: React.ChangeEvent<HTMLInputElement>) => {
+      if (!e.target.files || e.target.files.length === 0) return
+
+      const files = Array.from(e.target.files)
+
+      const uploadedFiles: FileImgListType[] = []
+      let hasError = false
+
+      // 逐个上传文件
+      for (const file of files) {
+        // 校验大小
+        if (size && file.size > size * 1024 * 1024) {
+          MessageFu.warning(`文件"${file.name}"超过${size}M限制!`)
+          hasError = true
+          continue
+        }
+
+        // 创建FormData对象
+        const fd = new FormData()
+        fd.append('type', type)
+        fd.append('dirCode', dirCode)
+        fd.append('isCompress', 'true')
+        fd.append('isDb', 'true')
+        fd.append('file', file)
+
+        if (fromData) {
+          for (const k in fromData) {
+            if (fromData[k]) fd.append(k, fromData[k])
+          }
+        }
+
+        try {
+          const res = await API_upFile(fd, myUrl)
+          if (res.code === 0) {
+            uploadedFiles.push(res.data)
+          } else {
+            MessageFu.error(`文件"${file.name}"上传失败`)
+            hasError = true
+          }
+        } catch (error) {
+          MessageFu.error(`文件"${file.name}"上传失败`)
+          hasError = true
+        }
+      }
+
+      // 清空input值
+      e.target.value = ''
+
+      if (uploadedFiles.length > 0) {
+        setFileList(prev => [...prev, ...uploadedFiles])
+        MessageFu.success(`成功上传${uploadedFiles.length}个文件`)
+      }
+
+      if (!hasError && uploadedFiles.length === files.length) {
+        fileDomInitialFu()
+      }
+    },
+    [dirCode, fromData, myUrl, size, type]
+  )
+
+  // 拖拽开始
+  const handleDragStart = useCallback((event: DragStartEvent) => {
+    setActiveId(Number(event.active.id))
+  }, [])
+
+  // 拖拽结束
+  const handleDragEnd = useCallback((event: DragEndEvent) => {
+    const { active, over } = event
+    setActiveId(null)
+
+    if (over && active.id !== over.id) {
+      setFileList(items => {
+        const oldIndex = items.findIndex(item => item.id === active.id)
+        const newIndex = items.findIndex(item => item.id === over.id)
+
+        return arrayMove(items, oldIndex, newIndex)
+      })
+    }
+  }, [])
+
+  // 列表删除某一个文件
+  const delImgListFu = useCallback((id: number) => {
+    setFileList(prev => prev.filter(v => v.id !== id))
+  }, [])
+
+  // 让父组件调用,拿到附件信息
+  const filesRes = useCallback(() => {
+    return fileList || []
+  }, [fileList])
+
+  // 获取当前拖拽的文件
+  const activeFile = activeId ? fileList.find(file => file.id === activeId) : null
+
+  // 可以让父组件调用子组件的方法
+  useImperativeHandle(ref, () => ({
+    filesRes,
+    showList
+  }))
+
+  return (
+    <div className={styles.Z3upFiles}>
+      <input
+        id='upInput'
+        type='file'
+        ref={myInput}
+        onChange={handeUpPhoto}
+        multiple // 支持多选
+      />
+      <div className={styles.Z3Btn}>
+        {!isLook && (
+          <Button
+            onClick={() => myInput.current?.click()}
+            icon={<UploadOutlined rev={undefined} />}
+          >
+            上传文件
+          </Button>
+        )}
+
+        <div className={styles.Z3files} style={{ marginTop: isLook ? '0' : '16px' }}>
+          <DndContext
+            collisionDetection={closestCenter}
+            onDragStart={handleDragStart}
+            onDragEnd={handleDragEnd}
+          >
+            <SortableContext items={fileList.map(f => f.id)} strategy={verticalListSortingStrategy}>
+              {fileList.map((file, index) => (
+                <SortableFileItem
+                  key={file.id}
+                  file={file}
+                  onDelete={delImgListFu}
+                  isLook={isLook}
+                  index={index}
+                />
+              ))}
+            </SortableContext>
+            <DragOverlay>
+              {activeFile ? (
+                <div className={classNames(styles.Z3filesRow, styles.dragOverlay)}>
+                  <div className={styles.dragHandle}>
+                    <MenuOutlined rev={undefined} />
+                  </div>
+                  <div className={styles.Z3files1} title={activeFile.fileName}>
+                    {activeFile.fileName}
+                  </div>
+                  <div className={styles.Z3files2}>{/* 拖拽时隐藏操作按钮 */}</div>
+                </div>
+              ) : null}
+            </DragOverlay>
+          </DndContext>
+        </div>
+
+        <div className={styles.fileTit} hidden={isLook}>
+          {tips};支持按住Ctrl键选择多个文件;拖动附件左侧图标可调整顺序
+          <div
+            className={classNames(
+              styles.noUpThumb,
+              fileList.length <= 0 && fileCheck ? styles.noUpThumbAc : ''
+            )}
+          >
+            请上传文件!
+          </div>
+        </div>
+      </div>
+      {isLook && fileList.length <= 0 ? (
+        <div style={{ height: 32, lineHeight: '32px' }}>(空)</div>
+      ) : null}
+    </div>
+  )
+}
+
+export default forwardRef(Z3upFiles)

+ 82 - 0
src/components/ZRichText/index.module.scss

@@ -0,0 +1,82 @@
+.ZRichText {
+  width: 1000px;
+  height: 100%;
+
+  :global {
+    .txtBox {
+      width: 100%;
+      height: 100%;
+      border: 1px solid #ccc;
+
+      a{
+        color: #fff !important;
+      }
+
+      // 隐藏媒体功能
+      .control-item.media {
+        display: none;
+      }
+
+      .bf-container {
+        height:100%;
+      }
+
+      .bf-content {
+        height: calc(100% - 92px);
+        padding-bottom: 0px;
+      }
+
+
+
+      .bf-controlbar {
+        position: relative;
+
+        .upImgBox {
+          position: absolute;
+          bottom: 13px;
+          right: 15px;
+          cursor: pointer;
+          color: var(--themeColor);
+          // display: none;
+        }
+
+        .upImgBoxNo {
+          display: none;
+        }
+
+      }
+    }
+
+    .noUpThumb {
+      position: relative;
+      overflow: hidden;
+      opacity: 0;
+      transition: top .2s;
+      color: #ff4d4f;
+      top: -10px;
+    }
+
+    .noUpThumbAc {
+      top: 0;
+      opacity: 1;
+    }
+
+    .bf-media .bf-image {
+      float: initial !important;
+      display: block;
+      margin: 10px auto;
+      text-align: center;
+
+      // 不让拖动放大缩小图片(会报错)
+      .bf-csize-icon {
+        display: none !important;
+      }
+
+      img {
+        max-width: 500px;
+        max-height: 300px;
+      }
+    }
+
+  }
+}

+ 216 - 0
src/components/ZRichText/index.tsx

@@ -0,0 +1,216 @@
+import React, {
+  useCallback,
+  useEffect,
+  useMemo,
+  useRef,
+  useState,
+} from "react";
+import styles from "./index.module.scss";
+
+// 引入编辑器组件
+
+// 安装---npm install braft-editor --save --force
+// npm install braft-utils --save --force
+import { ContentUtils } from "braft-utils";
+import BraftEditor from "braft-editor";
+// 引入编辑器样式
+import "braft-editor/dist/index.css";
+
+import classNames from "classnames";
+import { MessageFu } from "@/utils/message";
+import { fileDomInitialFu } from "@/utils/domShow";
+import { baseURL } from "@/utils/http";
+
+import { forwardRef, useImperativeHandle } from "react";
+import { API_upFile } from "@/store/action/layout";
+
+type Props = {
+  check: boolean; //表单校验,为fasle表示不校验
+  dirCode: string; //文件的code码
+  isLook: boolean; //是否是查看进来
+  ref: any; //当前自己的ref,给父组件调用
+  myUrl: string; //上传的api地址
+  full?: boolean;
+};
+
+function ZRichText({ check, dirCode, isLook, myUrl, full }: Props, ref: any) {
+  // 添加 上传 图片的dom
+  useEffect(() => {
+    setTimeout(() => {
+      const dom = document.querySelector(".bf-controlbar")!;
+      const div = document.createElement("div");
+      div.className = "upImgBox";
+      // div.title = "上传图片";
+      div.innerHTML = "上传图片/视频";
+      div.onclick = async () => {
+        myInput.current?.click();
+      };
+      dom.appendChild(div);
+    }, 20);
+
+    // 监听 富文本 的 class 变化,在全屏的时候会 富文本会添加上 fullscreen 的类
+    // 修复顶部样式冲突问题
+
+    const editorDom = document.querySelector(".bf-container") as HTMLDivElement;
+
+    const observer = new MutationObserver(() => {
+      // console.log("change");
+      const dom = document.querySelector(".layoutRightTop") as HTMLDivElement;
+
+      if (editorDom.className.includes("fullscreen")) dom.style.zIndex = "-1";
+      else dom.style.zIndex = "100";
+    });
+
+    observer.observe(editorDom, {
+      attributes: true,
+    });
+
+    // 销毁监听
+    return () => {
+      observer.disconnect();
+    };
+  }, []);
+
+  useEffect(() => {
+    const controlbarDom = document.querySelectorAll(".txtBox .bf-controlbar ");
+    const contentDom = document.querySelectorAll(".txtBox .bf-content ");
+    if (controlbarDom) {
+      controlbarDom.forEach((v: any) => {
+        v.style.display = isLook ? "none" : "block";
+      });
+      contentDom.forEach((v: any) => {
+        v.style.height = isLook ? "100%" : "";
+      });
+    }
+  }, [isLook]);
+
+  // 编辑器文本
+  const [editorValue, setEditorValue] = useState(
+    // 初始内容
+    BraftEditor.createEditorState("")
+  );
+
+  // 判断 富文本是否为空
+  const isTxtFlag = useMemo(() => {
+    const txt: string = editorValue.toHTML();
+    if (
+      txt.replaceAll("<p>", "").replaceAll("</p>", "").replaceAll(" ", "") ===
+      ""
+    ) {
+      return true;
+    } else return false;
+  }, [editorValue]);
+
+  const myInput = useRef<HTMLInputElement>(null);
+
+  // 上传图片
+  const handeUpPhoto = useCallback(
+    async (e: React.ChangeEvent<HTMLInputElement>) => {
+      if (e.target.files) {
+        // 拿到files信息
+        const filesInfo = e.target.files[0];
+
+        let type = ["image/jpeg", "image/png", "video/mp4"];
+        let size = 5;
+        let txt = "图片只支持png、jpg和jpeg格式!";
+        let txt2 = "图片最大支持5M!";
+
+        const isVideoFlag = filesInfo.name.endsWith(".mp4");
+
+        // 校验格式
+        if (!type.includes(filesInfo.type)) {
+          e.target.value = "";
+          if (isVideoFlag) {
+            // 上传视频
+            size = 500;
+            txt = "视频只支持mp4格式!";
+            txt2 = "视频最大支持500M!";
+          }
+
+          return MessageFu.warning(txt);
+        }
+        // 校验大小
+        if (filesInfo.size > size * 1024 * 1024) {
+          e.target.value = "";
+          return MessageFu.warning(txt2);
+        }
+        // 创建FormData对象
+        const fd = new FormData();
+        // 把files添加进FormData对象(‘photo’为后端需要的字段)
+        fd.append("type", isVideoFlag ? "video" : "img");
+        fd.append("dirCode", dirCode);
+        fd.append("file", filesInfo);
+
+        e.target.value = "";
+
+        try {
+          const res = await API_upFile(fd, myUrl);
+          if (res.code === 0) {
+            MessageFu.success("上传成功!");
+            // 在光标位置插入图片
+            const newTxt = ContentUtils.insertMedias(editorValue, [
+              {
+                type: "IMAGE",
+                url: baseURL + res.data.filePath,
+              },
+            ]);
+
+            setEditorValue(newTxt);
+          }
+          fileDomInitialFu();
+        } catch (error) {
+          fileDomInitialFu();
+        }
+      }
+    },
+    [dirCode, editorValue, myUrl]
+  );
+
+  // 让父组件调用的 回显 富文本
+  const ritxtShowFu = useCallback((val: string) => {
+    setEditorValue(BraftEditor.createEditorState(val));
+  }, []);
+
+  // 让父组件调用的返回 富文本信息 和 表单校验 isTxtFlag为ture表示未通过校验
+  const fatherBtnOkFu = useCallback(() => {
+    return { val: editorValue.toHTML(), flag: isTxtFlag };
+  }, [editorValue, isTxtFlag]);
+
+  // 可以让父组件调用子组件的方法
+  useImperativeHandle(ref, () => ({
+    ritxtShowFu,
+    fatherBtnOkFu,
+  }));
+
+  return (
+    <div className={styles.ZRichText} style={{ width: full ? "100%" : "" }}>
+      <input
+        id="upInput"
+        type="file"
+        accept=".png,.jpg,.jpeg,.mp4"
+        ref={myInput}
+        onChange={(e) => handeUpPhoto(e)}
+      />
+
+      <div className="txtBox">
+        <BraftEditor
+          readOnly={isLook}
+          placeholder="请输入内容"
+          value={editorValue}
+          onChange={(e) => setEditorValue(e)}
+          imageControls={["remove"]}
+        />
+      </div>
+      <div
+        className={classNames(
+          "noUpThumb",
+          check && isTxtFlag ? "noUpThumbAc" : ""
+        )}
+      >
+        请输入正文!
+      </div>
+    </div>
+  );
+}
+
+export default forwardRef(ZRichText);

+ 195 - 0
src/components/ZRichTexts/index.module.scss

@@ -0,0 +1,195 @@
+.ZRichTexts {
+  width: 1000px;
+
+  :global {
+    // 正文
+    .formRightZW {
+      width: 1000px;
+      top: -3px;
+      position: relative;
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      height: 32px;
+
+      .formRightZWRR {
+        display: flex;
+      }
+    }
+
+    // 从查看进来
+    .formRightZWLook {
+      .ant-checkbox-wrapper {
+        pointer-events: none;
+      }
+    }
+
+    .txtBox {
+      width: 100%;
+      position: relative;
+
+      a {
+        color: #fff !important;
+      }
+
+      // 隐藏媒体功能
+      .control-item.media {
+        display: none;
+      }
+
+      button {
+        &:nth-of-type(7) {
+          display: none !important;
+        }
+        &:nth-of-type(8) {
+          display: none !important;
+        }
+        &:nth-of-type(18) {
+          display: none !important;
+        }
+        &:nth-of-type(19) {
+          display: none !important;
+        }
+      }
+
+      .bf-container {
+        height: 100%;
+      }
+
+      .bf-content {
+        height: 300px;
+        padding-bottom: 0px;
+      }
+
+      .bf-controlbar {
+        position: relative;
+
+        .upImgBox {
+          position: absolute;
+          bottom: 13px;
+          right: 15px;
+          cursor: pointer;
+          color: var(--themeColor);
+          // display: none;
+        }
+
+        .upImgBoxNo {
+          display: none;
+        }
+      }
+
+      .zztxtRow {
+        margin-bottom: 20px;
+        border: 1px solid #ccc;
+
+        .zztxtRow1 {
+          padding: 0 20px;
+          height: 40px;
+          display: flex;
+          align-items: center;
+          justify-content: space-between;
+          background-color: #e8e8e8;
+
+          .zztxtRow1_1 {
+            display: flex;
+            align-items: center;
+
+            .zztxtRow1_1_1 {
+              font-weight: 700;
+              font-size: 16px;
+              margin-right: 20px;
+            }
+
+            .zztxtRow1_1_2 {
+              display: flex;
+              align-items: center;
+              width: 580px;
+              height: 32px;
+            }
+          }
+        }
+
+        .zztxtRow1_2 {
+          display: flex;
+          align-items: center;
+
+          .anticon {
+            cursor: pointer;
+            font-size: 18px;
+          }
+
+          .zztxtRow1_2Icon {
+            position: relative;
+            top: 2px;
+          }
+
+          .zztxtRow1_2IconNo {
+            pointer-events: none;
+            opacity: 0.2;
+          }
+        }
+      }
+
+      .zztxtRowErr {
+        border-color: #ff4d4f;
+      }
+    }
+
+    // 从查看进来
+    .txtBoxLook {
+      .button-remove {
+        display: none !important;
+      }
+      .bf-controlbar {
+        pointer-events: auto !important;
+        display: flex;
+        justify-content: flex-end;
+        button {
+          display: none;
+          &:last-child {
+            display: inline-block;
+          }
+        }
+        div {
+          display: none;
+        }
+        .separator-line {
+          display: none;
+        }
+      }
+    }
+
+    .noUpThumb {
+      position: relative;
+      overflow: hidden;
+      opacity: 0;
+      transition: top 0.2s;
+      color: #ff4d4f;
+      top: -20px;
+    }
+
+    .noUpThumbAc {
+      top: -10px;
+      opacity: 1;
+    }
+
+    .bf-media .bf-image {
+      float: initial !important;
+      display: block;
+      margin: 0px auto;
+      text-align: center;
+
+      // 不让拖动放大缩小图片(会报错)
+      .bf-csize-icon {
+        display: none !important;
+      }
+
+      img {
+        max-width: 500px;
+        max-height: 300px;
+      }
+    }
+
+    // .bf-video-wrap
+  }
+}

+ 412 - 0
src/components/ZRichTexts/index.tsx

@@ -0,0 +1,412 @@
+import React, { useCallback, useMemo, useRef, useState } from 'react'
+import styles from './index.module.scss'
+
+// 引入编辑器组件
+
+// 安装---npm install braft-editor --save --force
+// npm install braft-utils --save --force
+import { ContentUtils } from 'braft-utils'
+import BraftEditor from 'braft-editor'
+// 引入编辑器样式
+import 'braft-editor/dist/index.css'
+
+import classNames from 'classnames'
+import { MessageFu } from '@/utils/message'
+import { fileDomInitialFu } from '@/utils/domShow'
+import { baseURL } from '@/utils/http'
+
+import { forwardRef, useImperativeHandle } from 'react'
+import { API_upFile } from '@/store/action/layout'
+import ZupAudio, { ZupAudioType } from '../ZupAudio'
+import { Button, Checkbox, Input } from 'antd'
+import { ArrowDownOutlined, DeleteOutlined, ArrowUpOutlined } from '@ant-design/icons'
+import MyPopconfirm from '../MyPopconfirm'
+
+export type SectionArrType = {
+  id: number
+  name: string
+  txt: any
+  fileInfo: ZupAudioType
+}
+
+type Props = {
+  check: boolean //表单校验,为fasle表示不校验
+  dirCode: string //文件的code码
+  isLook: boolean //是否是查看进来
+  ref: any //当前自己的ref,给父组件调用
+  myUrl: string //上传的api地址
+  isOne?: boolean //只显示单个富文本
+  upAudioBtnNone?: boolean //是否能上传无障碍音频
+}
+
+function ZRichTexts(
+  { check, dirCode, isLook, myUrl, isOne = false, upAudioBtnNone = false }: Props,
+  ref: any
+) {
+  const [sectionArr, setSectionArr] = useState<SectionArrType[]>([
+    {
+      id: Date.now(),
+      name: '',
+      txt: BraftEditor.createEditorState(''),
+      fileInfo: { fileName: '', filePath: '' }
+    }
+  ])
+
+  // 是否按章节发布
+  const [isSection, setIsSection] = useState(false)
+
+  // 当前上传 图片 视频的索引
+  const nowIndexRef = useRef(0)
+
+  // 判断 富文本是否为空
+  const isTxtFlag = useMemo(() => {
+    let flag = false
+
+    // 不是按章节发布,检查第一个富文本
+    if (!isSection) {
+      const txt = sectionArr[0].txt.toText()
+      const txtHtml = sectionArr[0].txt.toHTML()
+      const txtRes = txt.replaceAll('\n', '').replaceAll(' ', '')
+      if (!txtRes && !txtHtml.includes('class="media-wrap')) flag = true
+    } else {
+      // 按章节发布  检查 所有的 标题 和富文本
+      sectionArr.forEach(v => {
+        if (!v.name) flag = true
+        const txt = v.txt.toText()
+        const txtHtml = sectionArr[0].txt.toHTML()
+        const txtRes = txt.replaceAll('\n', '').replaceAll(' ', '')
+        if (!txtRes && !txtHtml.includes('class="media-wrap')) flag = true
+      })
+    }
+
+    return flag
+  }, [isSection, sectionArr])
+
+  const myInput = useRef<HTMLInputElement>(null)
+
+  // 上传图片、视频
+  const handeUpPhoto = useCallback(
+    async (e: React.ChangeEvent<HTMLInputElement>) => {
+      if (e.target.files) {
+        // 拿到files信息
+        const filesInfo = e.target.files[0]
+
+        let type = ['image/jpeg', 'image/png', 'video/mp4']
+        let size = 5
+        let txt = '图片只支持png、jpg和jpeg格式!'
+        let txt2 = '图片最大支持5M!'
+
+        const isVideoFlag = filesInfo.name.endsWith('.mp4') || filesInfo.name.endsWith('.MP4')
+
+        if (isVideoFlag) {
+          // 上传视频
+          size = 500
+          txt = '视频只支持mp4格式!'
+          txt2 = '视频最大支持500M!'
+        }
+
+        // 校验格式
+        if (!type.includes(filesInfo.type)) {
+          e.target.value = ''
+          return MessageFu.warning(txt)
+        }
+
+        // 校验大小
+        if (filesInfo.size > size * 1024 * 1024) {
+          e.target.value = ''
+          return MessageFu.warning(txt2)
+        }
+
+        // 创建FormData对象
+        const fd = new FormData()
+        // 把files添加进FormData对象(‘photo’为后端需要的字段)
+        fd.append('type', isVideoFlag ? 'video' : 'img')
+        fd.append('dirCode', dirCode)
+        fd.append('file', filesInfo)
+
+        e.target.value = ''
+
+        try {
+          const res = await API_upFile(fd, myUrl)
+          if (res.code === 0) {
+            MessageFu.success('上传成功!')
+            // 在光标位置插入图片
+            const newTxt = ContentUtils.insertMedias(sectionArr[nowIndexRef.current].txt, [
+              {
+                type: isVideoFlag ? 'VIDEO' : 'IMAGE',
+                url: baseURL + res.data.filePath
+              }
+            ])
+            const arr = [...sectionArr]
+            arr[nowIndexRef.current].txt = newTxt
+            setSectionArr(arr)
+          }
+          fileDomInitialFu()
+        } catch (error) {
+          fileDomInitialFu()
+        }
+      }
+    },
+    [dirCode, myUrl, sectionArr]
+  )
+
+  // 让父组件调用的 回显 富文本
+  const ritxtShowFu = useCallback((val: any) => {
+    if (val) {
+      setIsSection(val.isSection || false)
+      if (val.txtArr) {
+        const arr = val.txtArr.map((v: any) => ({
+          ...v,
+          txt: BraftEditor.createEditorState(v.txt)
+        }))
+        setSectionArr(arr)
+      }
+    }
+  }, [])
+
+  // 让父组件调用的返回 富文本信息 和 表单校验 isTxtFlag为ture表示未通过校验
+  const fatherBtnOkFu = useCallback(() => {
+    const arr: any[] = []
+
+    sectionArr.forEach((v, i) => {
+      arr.push({
+        ...v,
+        txt: v.txt.toHTML()
+      })
+    })
+
+    const obj = {
+      isSection: isSection, //是否按章节发布
+      txtArr: arr
+    }
+
+    return { val: obj, flag: isTxtFlag }
+  }, [isSection, isTxtFlag, sectionArr])
+
+  // 可以让父组件调用子组件的方法
+  useImperativeHandle(ref, () => ({
+    ritxtShowFu,
+    fatherBtnOkFu
+  }))
+
+  // 点击新增章节
+  const addSectionFu = useCallback(() => {
+    if (sectionArr.length >= 20) return MessageFu.warning('最多存在20个章节')
+    setSectionArr([
+      ...sectionArr,
+      {
+        id: Date.now(),
+        name: '',
+        txt: BraftEditor.createEditorState(''),
+        fileInfo: { fileName: '', filePath: '' }
+      }
+    ])
+  }, [sectionArr])
+
+  // 章节音频上传成功
+  const upSectionFu = useCallback(
+    (info: ZupAudioType, index: number) => {
+      const arr = [...sectionArr]
+      arr[index].fileInfo = info
+      setSectionArr(arr)
+    },
+    [sectionArr]
+  )
+
+  // 章节音频删除
+  const delSectionFu = useCallback(
+    (index: number) => {
+      // console.log("ppppppppp", index);
+
+      const arr = [...sectionArr]
+      arr[index].fileInfo = { fileName: '', filePath: '' }
+      setSectionArr(arr)
+    },
+    [sectionArr]
+  )
+
+  // 整个章节的删除
+  const delSectionAllFu = useCallback(
+    (id: number) => {
+      setSectionArr(sectionArr.filter(v => v.id !== id))
+    },
+    [sectionArr]
+  )
+
+  // 整个章节的位移
+  const moveSectionFu = useCallback(
+    (index: number, num: number) => {
+      const arr = [...sectionArr]
+      const temp = arr[index]
+      arr[index] = arr[index + num]
+      arr[index + num] = temp
+      setSectionArr(arr)
+    },
+    [sectionArr]
+  )
+
+  // 单个富文本是否输入完整
+  const isOneTxtFlag = useCallback(
+    (name: string, txt: any) => {
+      let flag = false
+      if (!name && isSection) flag = true
+      const txt2 = txt.toText()
+      const txtHtml = txt.toHTML()
+      const txtRes = txt2.replaceAll('\n', '').replaceAll(' ', '')
+      if (!txtRes && !txtHtml.includes('class="media-wrap')) flag = true
+      return flag
+    },
+    [isSection]
+  )
+
+  return (
+    <div className={styles.ZRichTexts}>
+      <input
+        id='upInput'
+        type='file'
+        accept='.png,.jpg,.jpeg,.mp4'
+        ref={myInput}
+        onChange={e => handeUpPhoto(e)}
+      />
+
+      <div className={classNames('formRightZW', isLook ? 'formRightZWLook' : '')}>
+        {isOne ? null : (
+          <Checkbox checked={isSection} onChange={e => setIsSection(e.target.checked)}>
+            按章节发布
+          </Checkbox>
+        )}
+
+        {isSection ? (
+          <Button hidden={isLook} type='primary' onClick={addSectionFu}>
+            新增章节
+          </Button>
+        ) : (
+          <div className='formRightZWRR'>
+            {upAudioBtnNone ? null : (
+              <ZupAudio
+                fileInfo={sectionArr[0].fileInfo}
+                upDataFu={info => upSectionFu(info, 0)}
+                delFu={() => delSectionFu(0)}
+                dirCode={dirCode}
+                myUrl={myUrl}
+                isLook={isLook}
+              />
+            )}
+
+            <div hidden={isLook}>
+              <Button
+                onClick={() => {
+                  nowIndexRef.current = 0
+                  myInput.current?.click()
+                }}
+              >
+                上传图片/视频
+              </Button>
+            </div>
+          </div>
+        )}
+      </div>
+
+      <div className={classNames('txtBox', isLook ? 'txtBoxLook' : '')}>
+        {sectionArr.map((item, index) => (
+          <div
+            className={classNames(
+              'zztxtRow',
+              isOneTxtFlag(item.name, item.txt) && check ? 'zztxtRowErr' : ''
+            )}
+            key={item.id}
+            hidden={!isSection && index > 0}
+          >
+            {/* 顶部 */}
+            <div className='zztxtRow1' hidden={!isSection && index === 0}>
+              <div className='zztxtRow1_1'>
+                <div className='zztxtRow1_1_1'>章节 {index + 1}</div>
+                <div className='zztxtRow1_1_2'>
+                  标题:
+                  <Input
+                    readOnly={isLook}
+                    value={item.name}
+                    placeholder='请输入内容'
+                    maxLength={100}
+                    showCount
+                    style={{ width: 400 }}
+                    onChange={e => {
+                      const arr = [...sectionArr]
+                      // arr[index].name = e.target.value.replace(/\s+/g, '')
+                      arr[index].name = e.target.value
+                      setSectionArr(arr)
+                    }}
+                  />
+                  &emsp;
+                  <Button
+                    hidden={isLook}
+                    onClick={() => {
+                      nowIndexRef.current = index
+                      myInput.current?.click()
+                    }}
+                  >
+                    上传图片/视频
+                  </Button>
+                </div>
+              </div>
+              <div className='zztxtRow1_2'>
+                <ZupAudio
+                  fileInfo={item.fileInfo}
+                  upDataFu={info => upSectionFu(info, index)}
+                  delFu={() => delSectionFu(index)}
+                  dirCode={dirCode}
+                  myUrl={myUrl}
+                  isLook={isLook}
+                />
+                &emsp;
+                <div
+                  hidden={isLook}
+                  className={classNames('zztxtRow1_2Icon', index === 0 ? 'zztxtRow1_2IconNo' : '')}
+                  onClick={() => moveSectionFu(index, -1)}
+                >
+                  <ArrowUpOutlined title='上移' />
+                </div>
+                &emsp;
+                <div
+                  hidden={isLook}
+                  className={classNames(
+                    'zztxtRow1_2Icon',
+                    index === sectionArr.length - 1 ? 'zztxtRow1_2IconNo' : ''
+                  )}
+                  onClick={() => moveSectionFu(index, 1)}
+                >
+                  <ArrowDownOutlined title='下移' />
+                </div>
+                &emsp;
+                {isLook || sectionArr.length <= 1 ? null : (
+                  <MyPopconfirm
+                    txtK='删除'
+                    onConfirm={() => delSectionAllFu(item.id)}
+                    Dom={<DeleteOutlined title='删除' className='ZTbox2X' />}
+                  />
+                )}
+              </div>
+            </div>
+            {/* 主体 */}
+            <BraftEditor
+              readOnly={isLook}
+              placeholder='请输入内容'
+              value={item.txt}
+              onChange={e => {
+                const arr = [...sectionArr]
+                arr[index].txt = e
+                setSectionArr(arr)
+              }}
+              imageControls={['remove']}
+            />
+          </div>
+        ))}
+      </div>
+      <div className={classNames('noUpThumb', check && isTxtFlag ? 'noUpThumbAc' : '')}>
+        {`请完整输入${isSection ? '标题/' : ''}正文!`}
+      </div>
+    </div>
+  )
+}
+
+export default forwardRef(ZRichTexts)

+ 63 - 0
src/components/ZupAudio/index.module.scss

@@ -0,0 +1,63 @@
+// 上传无障碍音频的样式
+.ZupAudio {
+  margin-left: 20px;
+  width: 180px;
+  height: 32px;
+  // position: relative;
+  // top: -4px;
+  border: 1px solid #ccc;
+  border-radius: 16px;
+  background-color: #fff;
+
+  :global {
+
+    .ZupAudio1 {
+      cursor: pointer;
+
+      display: flex;
+      justify-content: center;
+
+      .anticon-upload {
+        font-size: 20px;
+      }
+
+      .ZupAudio1_1 {
+        line-height: 15px;
+        color: #aaa5cb;
+        margin-left: 10px;
+
+        &>p {
+          &:nth-of-type(2) {
+            font-size: 10px;
+            // color: red;
+            opacity: .7;
+          }
+        }
+      }
+    }
+
+    .ZupAudio2 {
+      padding: 0 10px;
+      height: 100%;
+      display: flex;
+      align-items: center;
+
+      .anticon {
+        font-size: 18px;
+        cursor: pointer;
+
+      }
+
+      &>div {
+        height: 100%;
+        line-height: 30px;
+        width: calc(100% - 35px);
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+      }
+    }
+
+
+  }
+}

+ 122 - 0
src/components/ZupAudio/index.tsx

@@ -0,0 +1,122 @@
+import React, { useCallback, useRef } from 'react'
+import styles from './index.module.scss'
+import { MessageFu } from '@/utils/message'
+import { API_upFile } from '@/store/action/layout'
+import { fileDomInitialFu } from '@/utils/domShow'
+import { UploadOutlined, DeleteOutlined, EyeOutlined } from '@ant-design/icons'
+import store from '@/store'
+import MyPopconfirm from '../MyPopconfirm'
+
+export type ZupAudioType = {
+  fileName: string
+  filePath: string
+}
+
+type Props = {
+  fileInfo: ZupAudioType
+  upDataFu: (info: ZupAudioType) => void
+  delFu: () => void
+  dirCode: string
+  myUrl: string
+  size?: number
+  isLook?: boolean
+}
+
+function ZupAudio({ size = 10, isLook = false, fileInfo, upDataFu, delFu, dirCode, myUrl }: Props) {
+  // 上传 无障碍音频的 点击
+  const handeUpAudio = useCallback(
+    async (e: React.ChangeEvent<HTMLInputElement>) => {
+      if (e.target.files) {
+        // 拿到files信息
+        const filesInfo = e.target.files[0]
+        // console.log("-----", filesInfo);
+
+        // 校验格式
+        const type = ['audio/mpeg']
+        if (!type.includes(filesInfo.type)) {
+          e.target.value = ''
+          return MessageFu.warning(`只支持.mp3格式!`)
+        }
+
+        // 校验大小
+        if (filesInfo.size > size * 1024 * 1024) {
+          e.target.value = ''
+          return MessageFu.warning(`最大支持${size}M!`)
+        }
+        // 创建FormData对象
+        const fd = new FormData()
+
+        fd.append('type', 'audio')
+        fd.append('dirCode', dirCode)
+        fd.append('file', filesInfo)
+        e.target.value = ''
+
+        try {
+          const res = await API_upFile(fd, myUrl)
+          if (res.code === 0) {
+            MessageFu.success('上传成功!')
+            // console.log(res);
+            upDataFu(res.data)
+          }
+          fileDomInitialFu()
+        } catch (error) {
+          fileDomInitialFu()
+        }
+      }
+    },
+    [dirCode, myUrl, size, upDataFu]
+  )
+
+  // 上传附件的ref
+  const myInput = useRef<HTMLInputElement>(null)
+
+  return (
+    <div className={styles.ZupAudio} id='upInputAudioBox' hidden={isLook && !fileInfo.filePath}>
+      {/* 上传无障碍音频 */}
+      <input
+        id='upInputAudio'
+        type='file'
+        accept='.mp3'
+        onChange={e => handeUpAudio(e)}
+        ref={myInput}
+      />
+      {fileInfo.filePath ? (
+        <div className='ZupAudio2'>
+          <div title={fileInfo.fileName}>{fileInfo.fileName}</div>
+          <EyeOutlined
+            title='预览'
+            onClick={() =>
+              store.dispatch({
+                type: 'layout/lookDom',
+                payload: { src: fileInfo.filePath, type: 'audio' }
+              })
+            }
+          />
+
+          {isLook ? null : (
+            <>
+              &nbsp;
+              <MyPopconfirm
+                txtK='删除'
+                onConfirm={delFu}
+                Dom={<DeleteOutlined title='删除' className='ZTbox2X' rev={undefined} />}
+              />
+            </>
+          )}
+        </div>
+      ) : (
+        <div className='ZupAudio1' onClick={() => myInput.current?.click()}>
+          <UploadOutlined />
+          <div className='ZupAudio1_1'>
+            <p>上传无障碍音频</p>
+            <p>支持{size}MB以下mp3格式</p>
+          </div>
+        </div>
+      )}
+    </div>
+  )
+}
+
+const MemoZupAudio = React.memo(ZupAudio)
+
+export default MemoZupAudio

+ 101 - 0
src/components/ZupOne/index.module.scss

@@ -0,0 +1,101 @@
+.ZupOne {
+  width: 100%;
+  height: 100%;
+  position: relative;
+
+  :global {
+
+    .file_upIcon {
+      color: #a6a6a6;
+      border-radius: 3px;
+      cursor: pointer;
+      font-size: 30px;
+      width: 100px;
+      height: 100px;
+      border: 1px dashed #797979;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+
+
+    }
+
+    .file_img {
+      width: 100px;
+      height: 126px;
+      position: relative;
+      margin-top: 10px;
+
+      .file_closeBox {
+        position: absolute;
+        right: -10px;
+        top: -10px;
+        z-index: 99;
+        background-color: rgba(0, 0, 0, 0.8);
+        width: 20px;
+        height: 20px;
+        border-radius: 50%;
+        font-size: 16px;
+        color: #fff;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+      }
+
+
+
+      .file_lookBox {
+        width: 100%;
+        background-color: rgba(0, 0, 0, .6);
+        color: #fff;
+        display: flex;
+        justify-content: space-around;
+
+        &>a {
+          color: #fff !important;
+        }
+
+        font-size: 16px;
+      }
+    }
+
+    .fileInfo {
+      display: flex;
+      align-items: center;
+      font-size: 16px;
+
+      .clearCover {
+        margin-left: 20px;
+        cursor: pointer;
+        font-size: 16px;
+      }
+
+      &>a {
+        color: black;
+      }
+    }
+
+    .fileBoxRow_r_tit {
+      height: 46px;
+      margin-top: 5px;
+      font-size: 14px;
+      color: rgb(126, 124, 124);
+
+
+    }
+
+    .noUpThumb {
+      position: relative;
+      overflow: hidden;
+      opacity: 0;
+      transition: top .2s;
+      color: #ff4d4f;
+      top: -10px;
+    }
+
+    .noUpThumbAc {
+      top: 0;
+      opacity: 1;
+    }
+  }
+}

+ 286 - 0
src/components/ZupOne/index.tsx

@@ -0,0 +1,286 @@
+import React, { useCallback, useMemo, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import ImageLazy from '@/components/ImageLazy'
+import {
+  PlusOutlined,
+  EyeOutlined,
+  CloseOutlined,
+  DownloadOutlined,
+  UploadOutlined
+} from '@ant-design/icons'
+import store from '@/store'
+import { baseURL } from '@/utils/http'
+import classNames from 'classnames'
+import { Button } from 'antd'
+import { MessageFu } from '@/utils/message'
+import { fileDomInitialFu } from '@/utils/domShow'
+import { API_upFile } from '@/store/action/layout'
+import { forwardRef, useImperativeHandle } from 'react'
+import MyPopconfirm from '../MyPopconfirm'
+
+type MyTypeType = 'thumb' | 'video' | 'audio' | 'model' | 'pdf'
+
+// 这个组件 只处理 上传 一张图片或者 视频 音频 模型 pdf 的情况
+
+type Props = {
+  fileCheck: boolean //有没有点击过确定
+  size: number //上传附件大小(M)
+  dirCode: string //文件的code码
+  myUrl: string //请求地址
+  format: string[] //上传格式 ["image/jpeg", "image/png"] ["video/mp4"] ,application/pdf
+  formatTxt: string //上传图片提示
+  checkTxt: string
+  upTxt: string
+  myType: MyTypeType
+  isLook?: boolean //是不是查看
+  fromData?: any
+  ref: any //当前自己的ref,给父组件调用
+}
+
+function ZupOne(
+  {
+    fileCheck,
+    size,
+    dirCode,
+    myUrl,
+    format,
+    formatTxt,
+    checkTxt,
+    upTxt,
+    myType,
+    isLook = false,
+    fromData
+  }: Props,
+  ref: any
+) {
+  const [fileUrl, setFileUrl] = useState({
+    fileName: '',
+    filePath: '',
+    thumb: ''
+  })
+
+  const myInput = useRef<HTMLInputElement>(null)
+
+  // 上传封面图
+  const handeUpPhoto = useCallback(
+    async (e: React.ChangeEvent<HTMLInputElement>) => {
+      if (e.target.files) {
+        // 拿到files信息
+        const filesInfo = e.target.files[0]
+        // console.log("-----", filesInfo.type);
+
+        // 校验格式
+        const type = format
+
+        if (myType === 'pdf') {
+          if (!filesInfo.type.includes('pdf')) {
+            e.target.value = ''
+            return MessageFu.warning(`只支持${formatTxt}格式!`)
+          }
+        } else {
+          if (!type.includes(filesInfo.type)) {
+            e.target.value = ''
+            return MessageFu.warning(`只支持${formatTxt}格式!`)
+          }
+        }
+
+        // 校验大小
+        if (filesInfo.size > size * 1024 * 1024) {
+          e.target.value = ''
+          return MessageFu.warning(`最大支持${size}M!`)
+        }
+        // 创建FormData对象
+        const fd = new FormData()
+        // 把files添加进FormData对象(‘photo’为后端需要的字段)
+        let myTypeRes: string = myType
+        if (['pdf'].includes(myTypeRes)) myTypeRes = 'doc'
+        fd.append('type', myTypeRes)
+        fd.append('dirCode', dirCode)
+        fd.append('file', filesInfo)
+
+        if (myType === 'thumb') {
+          // 开启压缩图片
+          fd.append('isCompress', 'true')
+        }
+
+        if (fromData) {
+          for (const k in fromData) {
+            if (fromData[k]) fd.append(k, fromData[k])
+          }
+        }
+
+        e.target.value = ''
+
+        try {
+          const res = await API_upFile(fd, myUrl)
+          if (res.code === 0) {
+            MessageFu.success('上传成功!')
+            setFileUrl(res.data)
+          }
+          fileDomInitialFu()
+        } catch (error) {
+          fileDomInitialFu()
+        }
+      }
+    },
+    [dirCode, format, formatTxt, fromData, myType, myUrl, size]
+  )
+
+  // 让父组件调用的 回显 附件 地址
+  const setFileComFileFu = useCallback(
+    (valObj: { fileName: string; filePath: string; thumb: string }) => {
+      setFileUrl(valObj)
+    },
+    []
+  )
+
+  // 让父组件调用的返回 附件 名字和路径
+  const fileComFileResFu = useCallback(() => {
+    return fileUrl
+  }, [fileUrl])
+
+  // 可以让父组件调用子组件的方法
+  useImperativeHandle(ref, () => ({
+    setFileComFileFu,
+    fileComFileResFu
+  }))
+
+  const acceptRes = useMemo(() => {
+    let accept = '.png,.jpg,.jpeg'
+    if (myType === 'video') accept = '.mp4'
+    else if (myType === 'audio') accept = '.mp3'
+    else if (myType === 'model') accept = '.4dage'
+    else if (myType === 'pdf') accept = '.pdf'
+    return accept
+  }, [myType])
+
+  // 点击 预览(除了图片)
+  const lookFileNoImgFu = useCallback(
+    (type: MyTypeType) => {
+      if (type === 'pdf' || type === 'thumb') {
+        // 新窗口打开
+        window.open(baseURL + fileUrl.filePath)
+      } else {
+        store.dispatch({
+          type: 'layout/lookDom',
+          payload: { src: fileUrl.filePath, type }
+        })
+      }
+
+      // if (type === "pdf") {
+      // } else {
+      // }
+    },
+    [fileUrl.filePath]
+  )
+
+  return (
+    <div className={styles.ZupOne}>
+      <input
+        id='upInput'
+        type='file'
+        accept={acceptRes}
+        ref={myInput}
+        onChange={e => handeUpPhoto(e)}
+      />
+      {myType === 'thumb' ? (
+        <div
+          hidden={fileUrl.filePath !== ''}
+          className='file_upIcon'
+          onClick={() => myInput.current?.click()}
+        >
+          <PlusOutlined rev={undefined} />
+        </div>
+      ) : (
+        <Button
+          hidden={fileUrl.filePath !== ''}
+          onClick={() => myInput.current?.click()}
+          icon={<UploadOutlined rev={undefined} />}
+        >
+          上传
+        </Button>
+      )}
+
+      {/* 为图片的情况-------------- */}
+      {myType === 'thumb' ? (
+        <div className='file_img' hidden={fileUrl.filePath === ''}>
+          {fileUrl ? (
+            <ImageLazy
+              width={100}
+              height={100}
+              src={fileUrl.thumb || fileUrl.filePath}
+              srcBig={fileUrl.filePath || fileUrl.thumb || ''}
+              noLook
+            />
+          ) : null}
+
+          {/* 删除 */}
+          <div className='file_closeBox' hidden={isLook}>
+            <MyPopconfirm
+              txtK='删除'
+              onConfirm={() => setFileUrl({ fileName: '', filePath: '', thumb: '' })}
+              Dom={<CloseOutlined rev={undefined} />}
+            />
+          </div>
+
+          {/* 预览 下载 */}
+          <div className='file_lookBox'>
+            <EyeOutlined
+              onClick={() =>
+                store.dispatch({
+                  type: 'layout/lookBigImg',
+                  payload: { url: baseURL + fileUrl.filePath, show: true }
+                })
+              }
+              rev={undefined}
+            />
+            <a href={baseURL + fileUrl.filePath} download target='_blank' rel='noreferrer'>
+              <DownloadOutlined rev={undefined} />
+            </a>
+          </div>
+        </div>
+      ) : fileUrl.filePath ? (
+        <div className='fileInfo'>
+          <div className='upSuccTxt'>{fileUrl.fileName}</div>
+          {/* 视频预览 */}
+          <div
+            className='clearCover'
+            hidden={!fileUrl.filePath}
+            onClick={() => lookFileNoImgFu(myType)}
+          >
+            <EyeOutlined rev={undefined} />
+          </div>
+          {/* 视频下载 */}
+          <a
+            href={baseURL + fileUrl.filePath}
+            download
+            target='_blank'
+            className='clearCover'
+            rel='noreferrer'
+          >
+            <DownloadOutlined rev={undefined} />
+          </a>
+          {/* 视频删除 */}
+
+          <MyPopconfirm
+            txtK='删除'
+            onConfirm={() => setFileUrl({ fileName: '', filePath: '', thumb: '' })}
+            Dom={<CloseOutlined className='clearCover' rev={undefined} />}
+          />
+        </div>
+      ) : null}
+
+      <div className='fileBoxRow_r_tit' hidden={isLook}>
+        格式要求:支持{formatTxt}格式;最大支持{size}M。{upTxt}
+        <br />
+        <div
+          className={classNames('noUpThumb', !fileUrl.filePath && fileCheck ? 'noUpThumbAc' : '')}
+        >
+          {checkTxt}
+        </div>
+      </div>
+    </div>
+  )
+}
+
+export default forwardRef(ZupOne)

+ 215 - 0
src/components/ZupTypes/index.module.scss

@@ -0,0 +1,215 @@
+.ZupTypes {
+  padding-top: 3px;
+
+  :global {
+    .ZTboxTit {
+      margin-left: 10px;
+      font-size: 14px;
+      color: rgb(126, 124, 124);
+      position: relative;
+      top: 4px;
+    }
+
+    .ZTbox {
+      margin-top: 20px;
+      display: flex;
+
+      .ZTbox1 {
+        position: relative;
+        top: 3px;
+        width: 60px;
+
+        & > span {
+          color: #ff4d4f;
+        }
+      }
+
+      .ZTbox2 {
+        width: calc(100% - 60px);
+        margin-left: 5px;
+        display: flex;
+        font-size: 16px;
+        align-items: center;
+
+        .ZTbox2Look {
+          margin-left: 20px;
+          cursor: pointer;
+        }
+
+        .ZTbox2Down {
+          margin-left: 15px;
+          color: black;
+        }
+
+        .ZTbox2X {
+          cursor: pointer;
+          margin-left: 15px;
+        }
+      }
+    }
+
+    // 图片
+    .ZTboxImgMain {
+      margin-top: 20px;
+
+      .ZTboxImgBox {
+        display: flex;
+
+        .ZTbox1 {
+          position: relative;
+          top: 3px;
+          width: 60px;
+
+          & > span {
+            color: #ff4d4f;
+          }
+        }
+
+        .ZTbox1Img {
+          width: calc(100% - 60px);
+          display: flex;
+          flex-wrap: wrap;
+
+          .ZTbox1ImgIcon {
+            margin-right: 20px;
+            color: #a6a6a6;
+            border-radius: 3px;
+            cursor: pointer;
+            font-size: 30px;
+            width: 100px;
+            height: 100px;
+            border: 1px dashed #797979;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+          }
+
+          .ZTbox1ImgRow {
+            // content-visibility:auto;
+            margin-right: 20px;
+            width: 100px;
+            height: 125px;
+            position: relative;
+            margin-bottom: 20px;
+            cursor: move;
+            position: relative;
+
+            // 第一张作为封面
+            .ZTbox1ImgRowCover {
+              font-size: 12px;
+              line-height: 22px;
+              position: absolute;
+              left: 0;
+              top: 0;
+              width: 100%;
+              height: 24px;
+              background-color: rgba(0, 0, 0, 0.8);
+              color: #fff;
+              text-align: center;
+              pointer-events: none;
+            }
+
+            // 修改图片名字
+            .ZTbox1ImgRowName {
+              font-size: 12px;
+              line-height: 22px;
+              position: absolute;
+              left: 0;
+              bottom: 25px;
+              width: 100%;
+              cursor: pointer;
+              height: 24px;
+              padding: 0 3px;
+              background-color: rgba(0, 0, 0, 0.8);
+              color: #fff;
+              text-align: center;
+              overflow: hidden;
+              text-overflow: ellipsis;
+              white-space: nowrap;
+
+              &:hover {
+                color: var(--themeColor);
+              }
+            }
+
+            .ZTbox1ImgRowIcon {
+              width: 100%;
+              background-color: rgba(0, 0, 0, 0.6);
+              color: #fff;
+              display: flex;
+              justify-content: space-around;
+              font-size: 16px;
+
+              a {
+                color: #fff !important;
+              }
+            }
+
+            .ZTbox1ImgRowX {
+              cursor: pointer;
+              position: absolute;
+              right: -10px;
+              top: -10px;
+              z-index: 99;
+              background-color: rgba(0, 0, 0, 0.8);
+              width: 20px;
+              height: 20px;
+              border-radius: 50%;
+              font-size: 16px;
+              color: #fff;
+              display: flex;
+              justify-content: center;
+              align-items: center;
+            }
+          }
+        }
+      }
+    }
+
+    .ZcheckTxt {
+      position: relative;
+      overflow: hidden;
+      opacity: 0;
+      transition: top 0.2s;
+      color: #ff4d4f;
+      top: -10px;
+    }
+
+    .ZcheckTxtAc {
+      top: 2px;
+      opacity: 1;
+    }
+  }
+}
+
+// 查看情况
+.ZupTypesLook {
+  :global {
+    .ZTbox1ImgRowName {
+      cursor: default !important;
+      color: #fff !important;
+    }
+
+    .ZTbox1ImgRow {
+      cursor: default !important;
+    }
+
+    .ZTbox1ImgRowX {
+      display: none !important;
+    }
+  }
+}
+
+// 修改图片名字的弹窗
+.ZupTypesMo {
+  :global {
+    .ant-modal-close {
+      display: none;
+    }
+
+    .ZupTypesMoBtn {
+      margin-top: 24px;
+      text-align: center;
+    }
+  }
+}

+ 627 - 0
src/components/ZupTypes/index.tsx

@@ -0,0 +1,627 @@
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import { Button, Checkbox, Input, Modal } from 'antd'
+import { forwardRef, useImperativeHandle } from 'react'
+import { baseURL } from '@/utils/http'
+import {
+  PlusOutlined,
+  CloseCircleOutlined,
+  UploadOutlined,
+  CloseOutlined,
+  DownloadOutlined,
+  EyeOutlined
+} from '@ant-design/icons'
+import { MessageFu } from '@/utils/message'
+import { API_upFile } from '@/store/action/layout'
+import { fileDomInitialFu } from '@/utils/domShow'
+import store from '@/store'
+import ImageLazy from '../ImageLazy'
+import classNames from 'classnames'
+import MyPopconfirm from '../MyPopconfirm'
+// import { A2_APIchangeImgName } from "@/store/action/A2exhibition";
+
+export type FileListType = {
+  fileName: string
+  thumb?: string
+  filePath: string
+  id: number
+  type: 'model' | 'img' | 'audio' | 'video'
+  imgName: string
+}
+
+type Props = {
+  ref: any //当前自己的ref,给父组件调用
+  selecFlag: string //筛选的字符串 模型/图片/音频/视频
+  fileCheck: boolean //有没有点击过确定
+  dirCode: string //文件的code码
+  myUrl: string //请求地址
+  isLook?: boolean //是不是查看
+  modelSize?: number //模型文件大小限制
+  imgSize?: number //图片大小限制
+  imgLength?: number //图片数量限制
+  audioSize?: number //音频大小限制
+  videoSize?: number //视频大小限制
+  videoTit?: string //视频上传的提示语
+  isTypeShow?: boolean //默认就选中(只有一个类型的时候)
+  isUpName?: boolean //是否能修改图片名字
+  lastImgTxt?: string //加载最后面的上传提示
+  oneIsCover?: boolean //是否将第一张作为封面
+  multipleImg?: boolean // 新增参数:是否支持多张图片同时上传
+}
+
+function ZupTypes(
+  {
+    selecFlag,
+    fileCheck,
+    dirCode,
+    myUrl,
+    isLook = false,
+    modelSize = 500,
+    imgSize = 5,
+    imgLength = 9,
+    audioSize = 10,
+    videoSize = 500,
+    videoTit = '',
+    isTypeShow = false,
+    isUpName = false,
+    lastImgTxt = '',
+    oneIsCover = false,
+    multipleImg = false
+  }: Props,
+  ref: any
+) {
+  // 筛选
+  const [typeCheck, setTypeCheck] = useState<string[]>([])
+
+  // 筛选数组
+  const typeCheckArr = useMemo(() => {
+    const arr = [
+      { label: '模型', value: 'model' },
+      { label: '图片', value: 'img' },
+      { label: '音频', value: 'audio' },
+      { label: '视频', value: 'video' }
+    ]
+
+    const arrRes = arr.filter(v => selecFlag.includes(v.label))
+    if (arrRes.length <= 1 && isTypeShow) {
+      setTypeCheck([arrRes[0].value])
+      // 默认就选中(只有一个类型的时候)
+    }
+
+    return arrRes
+  }, [isTypeShow, selecFlag])
+
+  // 上传附件的信息
+  const [fileList, setFileList] = useState({
+    model: {} as FileListType,
+    img: [] as FileListType[],
+    audio: {} as FileListType,
+    video: {} as FileListType
+  })
+
+  // 附件信息的校验,不满足返回 true
+  const fileCheckFu = useMemo(() => {
+    let flag = false
+    if (typeCheck.length === 0) flag = true
+    if (typeCheck.includes('model') && !fileList.model.id) flag = true
+    if (typeCheck.includes('img') && fileList.img.length === 0) flag = true
+    if (typeCheck.includes('audio') && !fileList.audio.id) flag = true
+    if (typeCheck.includes('video') && !fileList.video.id) flag = true
+    return flag
+  }, [fileList, typeCheck])
+
+  // 点击上传附件按钮
+  const myInput = useRef<HTMLInputElement>(null)
+
+  const [fileOneType, setFileOneType] = useState('')
+
+  useEffect(() => {
+    if (fileOneType) myInput.current?.click()
+  }, [fileOneType])
+
+  const upFileFu = useCallback((type: string) => {
+    setFileOneType('')
+    window.setTimeout(() => {
+      setFileOneType(type)
+    }, 100)
+  }, [])
+
+  // 上传附件的处理函数
+  const handeUpPhoto2 = useCallback(
+    async (e: React.ChangeEvent<HTMLInputElement>) => {
+      if (!e.target.files || e.target.files.length === 0) return
+
+      // 新增:多选模式下获取所有文件 [2,6](@ref)
+      let files =
+        multipleImg && fileOneType === 'img' ? Array.from(e.target.files) : [e.target.files[0]]
+
+      // 新增:检查图片数量限制 [4](@ref)
+      if (fileOneType === 'img' && multipleImg) {
+        const remainingSlots = imgLength - fileList.img.length
+        if (files.length > remainingSlots) {
+          MessageFu.warning(`最多还能上传${remainingSlots}张图片`)
+          files = files.slice(0, remainingSlots)
+        }
+      }
+
+      // 批量处理文件 [4](@ref)
+      for (const file of files) {
+        // 原有的校验逻辑(格式、大小等)保持不变...
+        let anType = ['image/jpeg', 'image/png']
+        let anTit1 = '只支持png、jpg格式!'
+        let anTit2 = `最大支持${imgSize}M!`
+        let anSize = imgSize * 1024 * 1024
+
+        if (fileOneType === 'audio') {
+          anType = ['audio/mpeg']
+          anTit1 = '只支持mp3格式!'
+          anTit2 = `最大支持${audioSize}M!`
+          anSize = audioSize * 1024 * 1024
+        } else if (fileOneType === 'video') {
+          anType = ['video/mp4']
+          anTit1 = '只支持mp4格式!'
+          anTit2 = `最大支持${videoSize}M!`
+          anSize = videoSize * 1024 * 1024
+        } else if (fileOneType === 'model') {
+          anType = ['']
+          anTit1 = '只支持4dage格式!'
+          anTit2 = `最大支持${modelSize}M!`
+          anSize = modelSize * 1024 * 1024
+        }
+
+        // 校验格式
+        if (fileOneType !== 'model') {
+          if (!anType.includes(file.type)) {
+            e.target.value = ''
+            return MessageFu.warning(anTit1)
+          }
+        } else {
+          if (!file.name.includes('.4dage')) {
+            e.target.value = ''
+            return MessageFu.warning(anTit1)
+          }
+        }
+
+        // 校验大小
+        if (file.size > anSize) {
+          e.target.value = ''
+          return MessageFu.warning(anTit2)
+        }
+        // 创建FormData
+        const fd = new FormData()
+        fd.append('type', fileOneType)
+        fd.append('dirCode', dirCode)
+        fd.append('isDb', 'true')
+        //初始图片 fileName为:未命名
+        if (isUpName) {
+          fd.append('isDefaultName', 'false')
+        }
+
+        fd.append('file', file)
+
+        if (fileOneType === 'img' && file.size > 1 * 1024 * 1024) {
+          // 开启压缩图片
+          fd.append('isCompress', 'true')
+        }
+
+        e.target.value = ''
+
+        try {
+          const res = await API_upFile(fd, myUrl)
+          if (res.code === 0) {
+            MessageFu.success(
+              `上传成功${files.length > 1 ? `(${files.indexOf(file) + 1}/${files.length})` : ''}`
+            )
+
+            // 更新状态
+            if (fileOneType === 'img') {
+              setFileList(prev => ({
+                ...prev,
+                img: [...prev.img, { ...res.data, imgName: '未命名' }]
+              }))
+            } else {
+              setFileList(prev => ({ ...prev, [fileOneType]: res.data }))
+            }
+            fileDomInitialFu()
+          }
+        } catch (error) {
+          // 错误处理
+          fileDomInitialFu()
+        }
+      }
+    },
+    [
+      audioSize,
+      dirCode,
+      fileList.img.length,
+      fileOneType,
+      imgLength,
+      imgSize,
+      isUpName,
+      modelSize,
+      multipleImg,
+      myUrl,
+      videoSize
+    ]
+  )
+
+  // 附件图片的拖动
+  const [dragImg, setDragImg] = useState<any>(null)
+
+  const handleDragOver = useCallback(
+    (e: React.DragEvent<HTMLDivElement>, item: FileListType) => {
+      if (isLook) return
+      e.dataTransfer.dropEffect = 'move'
+    },
+    [isLook]
+  )
+
+  const handleDragEnter = useCallback(
+    (e: React.DragEvent<HTMLDivElement>, item: FileListType) => {
+      if (isLook) return
+
+      e.dataTransfer.effectAllowed = 'move'
+      if (item === dragImg) return
+      const newItems = [...fileList.img] //拷贝一份数据进行交换操作。
+      const src = newItems.indexOf(dragImg) //获取数组下标
+      const dst = newItems.indexOf(item)
+      newItems.splice(dst, 0, ...newItems.splice(src, 1)) //交换位置
+      setFileList({ ...fileList, img: newItems })
+    },
+    [dragImg, fileList, isLook]
+  )
+
+  // 删除某一张图片
+  const delImgListFu = useCallback(
+    (id: number) => {
+      const newItems = fileList.img.filter(v => v.id !== id)
+      setFileList({ ...fileList, img: newItems })
+    },
+    [fileList]
+  )
+
+  // 模型 音频 视频 的 dom
+  const resOneDivDom = useCallback(
+    (type: 'model' | 'audio' | 'video') => {
+      const dom = (
+        <div className='ZTbox' hidden={!typeCheck.includes(type)}>
+          <div className='ZTbox1'>
+            <span> </span>
+            {type === 'model' ? '模型' : type === 'audio' ? '音频' : '视频'}:
+          </div>
+          {fileList[type].id ? (
+            <div className='ZTbox2'>
+              <div className='ZTbox2Name'>{fileList[type].fileName}</div>
+
+              <div
+                className='ZTbox2Look'
+                onClick={() =>
+                  store.dispatch({
+                    type: 'layout/lookDom',
+                    payload: { src: fileList[type].filePath, type }
+                  })
+                }
+              >
+                <EyeOutlined rev={undefined} />
+              </div>
+
+              <a
+                href={baseURL + fileList[type].filePath}
+                download
+                target='_blank'
+                className='ZTbox2Down'
+                rel='noreferrer'
+              >
+                <DownloadOutlined rev={undefined} />
+              </a>
+
+              <MyPopconfirm
+                txtK='删除'
+                onConfirm={() => setFileList({ ...fileList, [type]: {} as FileListType })}
+                Dom={<CloseCircleOutlined className='ZTbox2X' rev={undefined} />}
+              />
+            </div>
+          ) : (
+            <>
+              <Button onClick={() => upFileFu(type)} icon={<UploadOutlined rev={undefined} />}>
+                上传
+              </Button>
+
+              <div className='ZTboxTit'>
+                {type === 'model'
+                  ? `仅支持4dage格式的模型文件,大小不能超过${modelSize}M。`
+                  : type === 'audio'
+                  ? `仅支持mp3格式的音频文件,大小不得超过${audioSize}MB。`
+                  : `仅支持mp4格式的视频文件,大小不得超过${videoSize}MB。${videoTit}`}
+              </div>
+            </>
+          )}
+        </div>
+      )
+      return dom
+    },
+    [audioSize, fileList, modelSize, typeCheck, upFileFu, videoSize, videoTit]
+  )
+
+  // ------------让父组件调用的 回显
+  const setFileComFileFu = useCallback((info: any) => {
+    if (info.type) setTypeCheck(info.type.split(','))
+
+    if (info.fileList && info.fileList.length) {
+      const data: FileListType[] = info.fileList
+      const obj = {
+        model: {} as FileListType,
+        img: [] as FileListType[],
+        audio: {} as FileListType,
+        video: {} as FileListType
+      }
+
+      data.forEach(v => {
+        if (v.type === 'img') {
+          obj.img.push({ ...v, imgName: v.fileName })
+        } else obj[v.type!] = v
+      })
+      setFileList(obj)
+    }
+  }, [])
+
+  // --------------让父组件调用的返回 附件 信息
+  const fileComFileResFu = useCallback(() => {
+    let coverUrl = ''
+    let coverUrlBig = ''
+    const fileIds = []
+    if (fileList.model.id && typeCheck.includes('model')) fileIds.push(fileList.model.id)
+    if (fileList.audio.id && typeCheck.includes('audio')) fileIds.push(fileList.audio.id)
+    if (fileList.video.id && typeCheck.includes('video')) fileIds.push(fileList.video.id)
+    if (typeCheck.includes('img')) {
+      fileList.img.forEach((v, i) => {
+        if (v.id) {
+          fileIds.push(v.id)
+          if (oneIsCover && i === 0) {
+            // 返回 第一张图的url 作为封面
+            coverUrl = v.thumb || v.filePath
+            coverUrlBig = v.filePath || v.thumb!
+          }
+        }
+      })
+    }
+    return {
+      sonType: typeCheck,
+      sonFileIds: fileIds,
+      sonIsOk: fileCheckFu,
+      coverUrl,
+      coverUrlBig
+    }
+  }, [
+    fileCheckFu,
+    fileList.audio.id,
+    fileList.img,
+    fileList.model.id,
+    fileList.video.id,
+    oneIsCover,
+    typeCheck
+  ])
+
+  // 可以让父组件调用子组件的方法
+  useImperativeHandle(ref, () => ({
+    setFileComFileFu,
+    fileComFileResFu
+  }))
+
+  // 修改图片名称
+  const [isNameChange, setIsNameChange] = useState({
+    id: 0,
+    oldName: '',
+    newName: ''
+  })
+
+  // 关闭弹窗
+  const isNameChangeXFu = useCallback(() => {
+    setIsNameChange({ id: 0, oldName: '', newName: '' })
+  }, [])
+
+  // 点击图片名字-出来弹窗
+  const isNameChangeFu = useCallback(
+    (item: FileListType) => {
+      if (isLook) return
+      setIsNameChange({ id: item.id, oldName: item.imgName, newName: '' })
+    },
+    [isLook]
+  )
+
+  // 修改完这点击 确定修改
+  // const isNameChangeOkFu = useCallback(async () => {
+  //   if (!isNameChange.newName) return MessageFu.warning("图片名不能为空!");
+
+  //   const res = await A2_APIchangeImgName({
+  //     id: isNameChange.id,
+  //     fileName: isNameChange.newName,
+  //   });
+
+  //   if (res.code === 0) {
+  //     MessageFu.success("修改图片名成功!");
+  //     setFileList({
+  //       ...fileList,
+  //       img: fileList.img.map((v) => ({
+  //         ...v,
+  //         imgName: v.id === isNameChange.id ? isNameChange.newName : v.imgName,
+  //       })),
+  //     });
+  //     isNameChangeXFu();
+  //   }
+  // }, [fileList, isNameChange.id, isNameChange.newName, isNameChangeXFu]);
+  //
+
+  return (
+    <div className={classNames(styles.ZupTypes, isLook ? styles.ZupTypesLook : '')}>
+      <input
+        id='upInput'
+        type='file'
+        accept={
+          fileOneType === 'img'
+            ? '.png,.jpg,.jpeg'
+            : fileOneType === 'audio'
+            ? '.mp3'
+            : fileOneType === 'model'
+            ? '.4dage'
+            : '.mp4'
+        }
+        ref={myInput}
+        onChange={e => handeUpPhoto2(e)}
+        multiple={fileOneType === 'img' && multipleImg}
+      />
+      <div hidden={isTypeShow}>
+        <Checkbox.Group
+          options={typeCheckArr}
+          value={typeCheck}
+          onChange={e => setTypeCheck(e as string[])}
+        />
+      </div>
+
+      {/* -----------模型 */}
+      {resOneDivDom('model')}
+
+      {/* -----------图片 */}
+      <div className='ZTboxImgMain' hidden={!typeCheck.includes('img')}>
+        <div className='ZTboxImgBox'>
+          <div className='ZTbox1' hidden={isTypeShow}>
+            <span> </span> 图片:
+          </div>
+
+          <div className='ZTbox1Img' style={{ width: isTypeShow ? '100%' : '' }}>
+            <div
+              hidden={(!!fileList.img.length && fileList.img.length >= imgLength) || isLook}
+              className='ZTbox1ImgIcon'
+              onClick={() => upFileFu('img')}
+            >
+              <PlusOutlined rev={undefined} />
+            </div>
+            {fileList.img.map((v, i) => (
+              <div
+                className='ZTbox1ImgRow'
+                key={v.id}
+                draggable='true'
+                onDragStart={() => setDragImg(v)}
+                onDragOver={e => handleDragOver(e, v)}
+                onDragEnter={e => handleDragEnter(e, v)}
+                onDragEnd={() => setDragImg(null)}
+              >
+                {v.thumb || v.filePath ? (
+                  <ImageLazy noLook={true} width={100} height={100} src={v.thumb || v.filePath} />
+                ) : null}
+
+                {oneIsCover && i === 0 ? <div className='ZTbox1ImgRowCover'>封面</div> : null}
+
+                {/* 修改图片名字 */}
+                {isUpName ? (
+                  <div
+                    title={v.imgName}
+                    className='ZTbox1ImgRowName'
+                    onClick={() => isNameChangeFu(v)}
+                  >
+                    {v.imgName}
+                  </div>
+                ) : null}
+
+                <div className='ZTbox1ImgRowIcon'>
+                  <EyeOutlined
+                    onClick={() =>
+                      store.dispatch({
+                        type: 'layout/lookBigImg',
+                        payload: {
+                          url: baseURL + v.filePath,
+                          show: true
+                        }
+                      })
+                    }
+                    rev={undefined}
+                  />
+                  <a href={baseURL + v.filePath} download target='_blank' rel='noreferrer'>
+                    <DownloadOutlined rev={undefined} />
+                  </a>
+                </div>
+
+                <MyPopconfirm
+                  txtK='删除'
+                  onConfirm={() => delImgListFu(v.id!)}
+                  Dom={<CloseOutlined className='ZTbox1ImgRowX' rev={undefined} />}
+                />
+              </div>
+            ))}
+          </div>
+        </div>
+
+        <div className='ZTboxTit' hidden={isLook}>
+          {fileList.img.length && fileList.img.length >= 2 ? (
+            <>
+              按住鼠标可拖动图片调整顺序。
+              <br />
+            </>
+          ) : null}
+          {oneIsCover ? '第一张为封面图;' : ''} 支持png、jpg的图片格式;最大支持{imgSize}
+          M;最多支持{imgLength}张。{multipleImg ? '按住Ctrl可一次性选择多张图片上传' : ''}
+          {lastImgTxt}
+        </div>
+      </div>
+
+      {/* -----------音频 */}
+      {resOneDivDom('audio')}
+
+      {/* -----------视频 */}
+      {resOneDivDom('video')}
+
+      {/* 最后的提示 */}
+      <div className={classNames('ZcheckTxt', fileCheck && fileCheckFu ? 'ZcheckTxtAc' : '')}>
+        请最少上传一张图片!
+      </div>
+
+      {/* 点击修改名字出来的弹窗 */}
+      {isNameChange.id ? (
+        <Modal
+          wrapClassName={styles.ZupTypesMo}
+          open={true}
+          title='修改展品图片名称'
+          footer={
+            [] // 设置footer为空,去掉 取消 确定默认按钮
+          }
+        >
+          <br />
+          <div className='ZupTypesMoRow'>
+            <strong>当前名:</strong>
+            {isNameChange.oldName}
+          </div>
+          <div className='ZupTypesMoRow'>
+            <br />
+            <strong>修改为:</strong>
+            <Input
+              style={{ width: 400 }}
+              placeholder='请输入图片名'
+              maxLength={50}
+              showCount
+              value={isNameChange.newName}
+              onChange={e => {
+                setIsNameChange({
+                  ...isNameChange,
+                  newName: e.target.value.replace(/\s+/g, '')
+                })
+              }}
+            />
+          </div>
+
+          <div className='ZupTypesMoBtn'>
+            <Button onClick={isNameChangeXFu}>取消</Button>
+            &emsp;
+            <Button
+              type='primary'
+              //  onClick={isNameChangeOkFu}
+            >
+              修改
+            </Button>
+          </div>
+        </Modal>
+      ) : null}
+    </div>
+  )
+}
+
+export default forwardRef(ZupTypes)

+ 95 - 0
src/components/ZupVideos/index.module.scss

@@ -0,0 +1,95 @@
+.ZupVideos {
+  width: 100%;
+
+  :global {
+    .zVmain {
+      width: 100%;
+      display: flex;
+      flex-wrap: wrap;
+
+      .file_upIcon {
+        color: #a6a6a6;
+        border-radius: 3px;
+        cursor: pointer;
+        font-size: 30px;
+        width: 100px;
+        height: 100px;
+        border: 1px dashed #797979;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        margin-right: 20px;
+      }
+
+      .zVRow {
+        margin-right: 20px;
+        margin-bottom: 10px;
+
+        .zVRow1 {
+          display: flex;
+          position: relative;
+
+          .zVRow1V {
+            width: 100px;
+            height: 100px;
+            border-radius: 3px;
+
+            video {
+              width: 100%;
+              height: 100%;
+              object-fit: cover;
+            }
+          }
+
+          .zVRow1I {
+            position: absolute;
+            top: 0;
+            right: 0px;
+            height: 100%;
+            display: flex;
+            flex-direction: column;
+            justify-content: space-around;
+            align-items: center;
+            background-color: rgba(0, 0, 0, 0.6);
+            color: #fff;
+            padding: 0 5px;
+            a {
+              color: #fff !important;
+            }
+          }
+        }
+
+        .zVRow2 {
+          margin-top: 3px;
+          font-size: 14px;
+          text-align: center;
+          width: 100px;
+          overflow: hidden;
+          text-overflow: ellipsis;
+          white-space: nowrap;
+        }
+      }
+    }
+
+    .fileBoxRow_r_tit {
+      height: 46px;
+      margin-top: 5px;
+      font-size: 14px;
+      color: rgb(126, 124, 124);
+    }
+
+    .noUpThumb {
+      position: relative;
+      overflow: hidden;
+      opacity: 0;
+      transition: top 0.2s;
+      color: #ff4d4f;
+      top: -10px;
+    }
+
+    .noUpThumbAc {
+      top: 0;
+      opacity: 1;
+    }
+  }
+}

+ 193 - 0
src/components/ZupVideos/index.tsx

@@ -0,0 +1,193 @@
+import React, { useCallback, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import { forwardRef, useImperativeHandle } from 'react'
+import { FileListType } from '../ZupTypes'
+import { MessageFu } from '@/utils/message'
+import { API_upFile } from '@/store/action/layout'
+import { fileDomInitialFu } from '@/utils/domShow'
+import { PlusOutlined, EyeOutlined, CloseOutlined, DownloadOutlined } from '@ant-design/icons'
+import classNames from 'classnames'
+import { baseURL } from '@/utils/http'
+import store from '@/store'
+import MyPopconfirm from '../MyPopconfirm'
+
+type Props = {
+  size: number //视频大小
+  fileNum: number //数量限制
+  dirCode: string //文件的code码
+  myUrl: string //请求地址
+  fileCheck?: boolean //是否检验
+  typeArr?: string[] //上传格式 ['mp4','mov','avi','wmv']
+  checkTxt?: string
+  upTxt?: string
+  isLook?: boolean //是不是查看
+  fromData?: any
+  ref: any //当前自己的ref,给父组件调用
+}
+
+function ZupVideos(
+  {
+    size,
+    fileNum,
+    dirCode,
+    myUrl,
+    fileCheck = false,
+    typeArr = ['mp4', 'mov', 'avi', 'wmv'],
+    checkTxt = '请上传视频!',
+    upTxt = '',
+    isLook = false,
+    fromData
+  }: Props,
+  ref: any
+) {
+  const [fileList, setFileList] = useState<FileListType[]>([])
+
+  // 上传
+  const handeUpPhoto = useCallback(
+    async (e: React.ChangeEvent<HTMLInputElement>) => {
+      if (e.target.files) {
+        // 拿到files信息
+        const filesInfo = e.target.files[0]
+        // console.log('-----', filesInfo.name)
+
+        const fileNameArr = filesInfo.name.split('.')
+        const fileNameLast = fileNameArr[fileNameArr.length - 1]
+
+        // 校验格式
+        if (!typeArr.includes(fileNameLast.toLowerCase())) {
+          e.target.value = ''
+          return MessageFu.warning(`只支持${typeArr.join('/')}格式`)
+        }
+
+        // 校验大小
+        if (filesInfo.size > size * 1024 * 1024) {
+          e.target.value = ''
+          return MessageFu.warning(`最大支持${size}M!`)
+        }
+        // 创建FormData对象
+        const fd = new FormData()
+
+        fd.append('type', 'video')
+        fd.append('isDb', 'true')
+        fd.append('dirCode', dirCode)
+        fd.append('file', filesInfo)
+
+        if (fromData) {
+          for (const k in fromData) {
+            if (fromData[k]) fd.append(k, fromData[k])
+          }
+        }
+
+        e.target.value = ''
+
+        try {
+          const res = await API_upFile(fd, myUrl)
+          if (res.code === 0) {
+            MessageFu.success('上传成功!')
+            setFileList([...fileList, res.data])
+            // console.log(res);
+          }
+          fileDomInitialFu()
+        } catch (error) {
+          fileDomInitialFu()
+        }
+      }
+    },
+    [dirCode, fileList, fromData, myUrl, size, typeArr]
+  )
+
+  // 让父组件调用的 回显 附件 地址
+  const setFileComFileFu = useCallback((valList: FileListType[]) => {
+    setFileList(valList)
+  }, [])
+
+  // 让父组件调用的返回 附件 名字和路径
+  const fileComFileResFu = useCallback(() => {
+    return fileList
+  }, [fileList])
+
+  // 可以让父组件调用子组件的方法
+  useImperativeHandle(ref, () => ({
+    setFileComFileFu,
+    fileComFileResFu
+  }))
+
+  const myInput = useRef<HTMLInputElement>(null)
+
+  // 点击预览
+  const lookFileFu = useCallback((file: string) => {
+    store.dispatch({
+      type: 'layout/lookDom',
+      payload: { src: file, type: 'video' }
+    })
+  }, [])
+
+  return (
+    <div className={styles.ZupVideos}>
+      <input
+        id='upInput'
+        type='file'
+        accept={typeArr.map(v => `.${v}`).join(',')}
+        ref={myInput}
+        onChange={e => handeUpPhoto(e)}
+      />
+
+      <div hidden={!(isLook && fileList.length <= 0)}>(空)</div>
+
+      <div className='zVmain'>
+        <div
+          hidden={fileList.length >= fileNum || isLook}
+          className='file_upIcon'
+          onClick={() => myInput.current?.click()}
+        >
+          <PlusOutlined />
+        </div>
+
+        {fileList.map(v => (
+          <div className='zVRow' key={v.id}>
+            <div className='zVRow1'>
+              <div className='zVRow1V' title={v.fileName}>
+                <video src={baseURL + v.filePath}></video>
+              </div>
+              <div className='zVRow1I'>
+                {/* 视频预览 */}
+                <EyeOutlined onClick={() => lookFileFu(v.filePath)} />
+                {/* 视频下载 */}
+                <a href={baseURL + v.filePath} download target='_blank' rel='noreferrer'>
+                  <DownloadOutlined />
+                </a>
+                {/* 视频删除 */}
+
+                {isLook ? null : (
+                  <MyPopconfirm
+                    txtK='删除'
+                    onConfirm={() => setFileList(fileList.filter(c => c.id !== v.id))}
+                    Dom={<CloseOutlined />}
+                  />
+                )}
+              </div>
+            </div>
+            <div className='zVRow2' title={v.fileName}>
+              {v.fileName}
+            </div>
+          </div>
+        ))}
+      </div>
+
+      <div className='fileBoxRow_r_tit' hidden={isLook}>
+        格式要求:支持{typeArr.join('/')}格式,最大支持{size}M{upTxt}
+        <br />
+        <div
+          className={classNames(
+            'noUpThumb',
+            fileList.length <= 0 && fileCheck ? 'noUpThumbAc' : ''
+          )}
+        >
+          {checkTxt}
+        </div>
+      </div>
+    </div>
+  )
+}
+
+export default forwardRef(ZupVideos)

+ 35 - 0
src/index.tsx

@@ -0,0 +1,35 @@
+// import 'default-passive-events';
+
+import App from './App'
+import store from './store/index'
+
+import { Provider } from 'react-redux'
+import { createRoot } from 'react-dom/client'
+
+import { ConfigProvider } from 'antd'
+
+// 兼容360浏览器
+import { StyleProvider, legacyLogicalPropertiesTransformer } from '@ant-design/cssinjs'
+
+import 'dayjs/locale/zh-cn'
+import locale from 'antd/locale/zh_CN'
+
+const container = document.getElementById('root') as HTMLElement
+const root = createRoot(container)
+
+root.render(
+  <ConfigProvider
+    locale={locale}
+    theme={{
+      token: {
+        colorPrimary: '#a76f4f'
+      }
+    }}
+  >
+    <Provider store={store}>
+      <StyleProvider hashPriority='high' transformers={[legacyLogicalPropertiesTransformer]}>
+        <App />
+      </StyleProvider>
+    </Provider>
+  </ConfigProvider>
+)

+ 298 - 0
src/pages/A1atlas/A1add.tsx

@@ -0,0 +1,298 @@
+import React, { useCallback, useEffect, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import { Button, Cascader, Form, FormInstance, Input, Modal, Radio } from 'antd'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import { useSelector } from 'react-redux'
+import { RootState } from '@/store'
+import { MessageFu } from '@/utils/message'
+import { A1AddInfoType, TypeA1dict } from './data'
+import { A1_APIgetInfo, A1_APIsave } from '@/store/action/A1atlas'
+import TextArea from 'antd/es/input/TextArea'
+import ZRichTexts from '@/components/ZRichTexts'
+
+type Props = {
+  acShuTxt: string
+  addInfo: A1AddInfoType
+  addFu: () => void
+  closeFu: () => void
+  isNoAcIds: string[] //没有数据或者删除了的时候-既右侧没有操作的时候用到
+}
+
+function A1add({ addInfo, addFu, closeFu, isNoAcIds, acShuTxt }: Props) {
+  // 富文本的ref
+  const ZRichTextRef = useRef<any>(null)
+
+  const { dictAll: treeData } = useSelector((state: RootState) => state.A1atlas)
+
+  // 级联选择器改变的时候 筛选当前级联的 信息出来
+  const [acCardInfo, setAcCardInfo] = useState({} as TypeA1dict)
+  const [parentIdArr, setParentIdArr] = useState<string[] | null>(null)
+
+  useEffect(() => {
+    console.log(acCardInfo, parentIdArr)
+  }, [acCardInfo, parentIdArr])
+
+  const saveIdsRef = useRef<string[]>([])
+
+  useEffect(() => {
+    // console.log('xxxxxxxxxx', addInfo)
+    setAcCardInfo(addInfo.acInfo)
+
+    let ids: string[] | null = addInfo.acInfo.id ? [addInfo.acInfo.id] : null
+
+    if (addInfo.acInfo.ancestor) ids = [...addInfo.acInfo.ancestor.split(','), addInfo.acInfo.id]
+
+    let idsRes = ids
+    if (ids && ids.length >= 1 && addInfo.txt === '编辑') {
+      ids.pop()
+    }
+
+    if (idsRes) {
+      // 保存的时候需要补前面3个级别
+      saveIdsRef.current = idsRes.filter((v, i) => i <= 2)
+      // 去掉0和前2级
+      idsRes = idsRes.filter((v, i) => i > 2)
+    }
+
+    setParentIdArr(idsRes)
+  }, [addInfo])
+
+  const cardChange = useCallback((aa: any, bb: any) => {
+    setParentIdArr(aa)
+
+    if (bb && bb.length) setAcCardInfo(bb[bb.length - 1])
+    else setAcCardInfo({} as TypeA1dict)
+  }, [])
+
+  const getInfoFu = useCallback(async (id: string) => {
+    const res = await A1_APIgetInfo(id)
+    if (res.code === 0) {
+      // 设置富文本
+      if (res.data.rtf) ZRichTextRef.current?.ritxtShowFu(JSON.parse(res.data.rtf))
+
+      settypeSon(res.data.typeSon ? res.data.typeSon : '2')
+      FormBoxRef.current?.setFieldsValue({
+        ...res.data,
+        typeSon: res.data.typeSon ? res.data.typeSon : '2'
+      })
+    }
+  }, [])
+  useEffect(() => {
+    if (addInfo.txt === '编辑') getInfoFu(addInfo.id)
+    else {
+      settypeSon('2')
+      FormBoxRef.current?.setFieldsValue({
+        typeSon: '2'
+      })
+    }
+  }, [addInfo.id, addInfo.txt, getInfoFu])
+
+  // 设置表单初始数据(区分编辑和新增)
+  const FormBoxRef = useRef<FormInstance>(null)
+
+  // 没有通过校验
+  const onFinishFailed = useCallback(() => {
+    // return MessageFu.warning("有表单不符号规则!");
+  }, [])
+
+  // 通过校验点击确定
+  const onFinish = useCallback(
+    async (values: any) => {
+      // 富文本
+      const rtf = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
+
+      let ancestor = ''
+      let parentId: string | null = null
+
+      if (parentIdArr && parentIdArr.length >= 8 && addInfo.txt === '新增')
+        return MessageFu.warning('最多支持八级!')
+
+      if (acCardInfo) parentId = addInfo.txt === '编辑' ? acCardInfo.parentId : acCardInfo.id
+      if (parentIdArr && parentId) {
+        let arrTemp = [...saveIdsRef.current, ...parentIdArr.filter(v => v !== addInfo.id)]
+        ancestor = arrTemp.join(',')
+      }
+
+      // 新增并且没有父级
+      if (addInfo.txt === '新增' && !parentId && !ancestor) {
+        // console.log('xxx', saveIdsRef.current)
+
+        parentId = saveIdsRef.current[saveIdsRef.current.length - 1]
+        ancestor = saveIdsRef.current.join(',')
+        // console.log(123, parentId, ancestor)
+
+        // 外层没有选中
+        if (!addInfo.acInfo.id) {
+          parentId = isNoAcIds[isNoAcIds.length - 1]
+          ancestor = isNoAcIds.join(',')
+        }
+      }
+
+      // let level = 1
+      // if (parentIdArr) {
+      //   level = addInfo.txt === '新增' ? acCardInfo.level + 1 : acCardInfo.level
+      // }
+      const obj = {
+        ...values,
+        id: addInfo.txt === '编辑' ? addInfo.id : null,
+        ancestor,
+        // level,
+        parentId,
+        type: 'dict',
+        rtf: JSON.stringify(rtf.val || '')
+      }
+      // console.log(123, obj)
+      // if (1 + 1 === 2) {
+      //   return
+      // }
+
+      const res = await A1_APIsave(obj)
+
+      if (res.code === 0) {
+        MessageFu.success(addInfo.txt + '成功!')
+        addFu()
+        closeFu()
+      }
+    },
+    [acCardInfo, addFu, addInfo.acInfo.id, addInfo.id, addInfo.txt, closeFu, isNoAcIds, parentIdArr]
+  )
+
+  const [typeSon, settypeSon] = useState('2')
+
+  return (
+    <Modal
+      wrapClassName={styles.A1add}
+      open={true}
+      title={addInfo.txt}
+      footer={
+        [] // 设置footer为空,去掉 取消 确定默认按钮
+      }
+    >
+      <div className='A1aMain'>
+        <Form
+          scrollToFirstError={true}
+          ref={FormBoxRef}
+          name='basic'
+          labelCol={{ span: 2 }}
+          onFinish={onFinish}
+          onFinishFailed={onFinishFailed}
+          autoComplete='off'
+        >
+          <div className='fromRow'>
+            <div className='fromRowll'>
+              <span>* </span> 父级节点:
+            </div>
+            <div className='fromRowrr'>
+              <Cascader
+                style={{ width: 658 }}
+                disabled={addInfo.txt === '编辑'}
+                changeOnSelect
+                fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                options={treeData}
+                // placeholder={addInfo.txt === '编辑' ? '空' : '请选择'}
+                placeholder={acShuTxt}
+                value={parentIdArr ? [...parentIdArr] : []}
+                onChange={cardChange}
+              />
+            </div>
+          </div>
+
+          <Form.Item
+            label='节点名称'
+            name='name'
+            rules={[{ required: true, message: '请输入节点名称!' }]}
+            getValueFromEvent={e => e.target.value.replace(/\s+/g, '')}
+          >
+            <Input maxLength={30} showCount placeholder='请输入内容' />
+          </Form.Item>
+
+          <div className='fromRow2'>
+            <Form.Item
+              label='启用状态'
+              name='display'
+              rules={[{ required: true, message: '请选择启用状态!' }]}
+            >
+              <Radio.Group
+                options={[
+                  { value: 1, label: '启用' },
+                  { value: 0, label: '禁用' }
+                ]}
+              />
+            </Form.Item>
+            <div className='fromRowTit'>禁用时,该节点在用户端不可见</div>
+          </div>
+
+          <div className='fromRow2'>
+            <Form.Item
+              label='详情页开关'
+              name='isDetail'
+              rules={[{ required: true, message: '请选择详情页开关!' }]}
+            >
+              <Radio.Group
+                options={[
+                  { value: 1, label: '开启' },
+                  { value: 0, label: '关闭' }
+                ]}
+              />
+            </Form.Item>
+            <div className='fromRowTit'>关闭时,该节点会关闭详情页</div>
+          </div>
+
+          <Form.Item label='详情页类型' name='typeSon'>
+            <Radio.Group
+              onChange={e => settypeSon(e.target.value)}
+              options={[
+                { value: '2', label: '富文本' },
+                { value: '1', label: '外链' }
+              ]}
+            />
+          </Form.Item>
+
+          {typeSon === '1' ? (
+            <Form.Item
+              label='跳转链接'
+              name='thumb'
+              getValueFromEvent={e => e.target.value.replace(/\s+/g, '')}
+            >
+              <TextArea maxLength={100} showCount placeholder='请输入内容' />
+            </Form.Item>
+          ) : (
+            <div className='fromRow fromRow2'>
+              <div className='fromRowll'>详情页内容:</div>
+              <div className='fromRowrr'>
+                <ZRichTexts
+                  check={false}
+                  dirCode='A1atlas'
+                  myUrl='cms/dict/upload'
+                  isLook={false}
+                  ref={ZRichTextRef}
+                  isOne={true}
+                  upAudioBtnNone={true}
+                />
+              </div>
+            </div>
+          )}
+
+          {/* 确定和取消按钮 */}
+          <br />
+          <Form.Item wrapperCol={{ offset: 9, span: 16 }} className='A1Abtn'>
+            <Button
+              type='primary'
+              htmlType='submit'
+              disabled={!(parentIdArr && parentIdArr.length)}
+            >
+              提交
+            </Button>
+            <br />
+            <br />
+            <MyPopconfirm txtK='取消' onConfirm={closeFu} />
+          </Form.Item>
+        </Form>
+      </div>
+    </Modal>
+  )
+}
+
+const MemoA1add = React.memo(A1add)
+
+export default MemoA1add

+ 51 - 0
src/pages/A1atlas/data.ts

@@ -0,0 +1,51 @@
+export type TypeA1dict = {
+  id: string
+  level: number
+  name: string
+  parentId: string
+  rtf: string
+  sort: number
+  ancestor: string
+  // ---
+  display: 0 | 1
+  isDetail: 0 | 1
+  typeSon: '1' | '2'
+  // ---
+  children?: TypeA1dict[]
+}
+
+export type A1AddInfoType = {
+  id: string
+  txt: '新增' | '编辑'
+  acInfo: TypeA1dict
+}
+
+// -------------------树结构的搜索过滤-------------------
+export const filterTreeByName = (tree: TypeA1dict[], searchTemp: string): TypeA1dict[] => {
+  const searchKey = searchTemp.toUpperCase()
+
+  const dfs = (node: TypeA1dict): TypeA1dict | null => {
+    // 先递归处理子节点(深度优先)
+    const filteredChildren = (node.children?.map(dfs).filter(Boolean) as TypeA1dict[]) || []
+
+    // 判断当前节点是否匹配或子节点有匹配项
+
+    const txt = node.name.toUpperCase()
+
+    const isSelfMatch = txt.includes(searchKey)
+
+    // console.log('pppppppp', isSelfMatch, searchKey, node.num)
+
+    const hasChildMatch = filteredChildren.length > 0
+
+    if (isSelfMatch || hasChildMatch) {
+      return {
+        ...node,
+        children: hasChildMatch ? filteredChildren : undefined
+      }
+    }
+    return null
+  }
+
+  return tree.map(dfs).filter(Boolean) as TypeA1dict[]
+}

+ 152 - 0
src/pages/A1atlas/index.module.scss

@@ -0,0 +1,152 @@
+.A1atlas {
+  display: flex;
+  :global {
+    .A1left {
+      width: 500px;
+      background-color: #e8e8e8;
+      padding: 20px 0px 20px 10px;
+      .A1leftTit {
+        display: flex;
+        justify-content: space-between;
+        font-size: 20px;
+        font-weight: 700;
+        padding-right: 10px;
+      }
+      .A1tree {
+        width: 100%;
+        height: calc(100% - 10px);
+
+        .A1Tinp {
+          padding-right: 10px;
+          margin: 10px 0;
+          display: flex;
+        }
+        .A1Tmain {
+          padding-right: 10px;
+          width: 100%;
+          height: calc(100% - 52px);
+          overflow-y: auto;
+          padding: 10px 0;
+          .NODATA {
+            width: 100%;
+            height: 100%;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            font-size: 24px;
+            letter-spacing: 4px;
+            color: var(--themeColor);
+            padding-bottom: 100px;
+          }
+          .ant-tree {
+            background-color: transparent !important;
+          }
+          .ant-tree-node-selected {
+            background-color: var(--themeColor) !important;
+            color: #fff !important;
+            transition: none !important;
+          }
+        }
+      }
+    }
+    .A1right {
+      width: calc(100% - 500px);
+      padding: 20px 40px;
+      .A1Rtit {
+        display: flex;
+        justify-content: space-between;
+        margin-bottom: 25px;
+        & > div {
+          display: flex;
+          align-items: center;
+          font-size: 20px;
+          font-weight: 700;
+          color: var(--themeColor);
+        }
+      }
+      .A1RrowBox {
+        width: 100%;
+        height: calc(100% - 38px);
+        padding-right: 10px;
+        overflow-y: auto;
+      }
+      .A1Rrow {
+        font-size: 16px;
+        display: flex;
+        margin-bottom: 20px;
+        .A1Rrow1 {
+          width: 110px;
+          text-align: right;
+          font-weight: 700;
+        }
+        .A1Rrow2 {
+          width: calc(100% - 110px);
+        }
+      }
+    }
+  }
+}
+
+// 新增弹窗页面
+.A1add {
+  // overflow: hidden !important;
+  :global {
+    .ant-modal-close {
+      display: none;
+    }
+
+    .ant-modal {
+      width: 1250px !important;
+      top: 30px !important;
+    }
+
+    .ant-modal-body {
+      border-top: 1px solid #ccc;
+    }
+
+    .A1aMain {
+      width: 1100px;
+      padding-top: 15px;
+      .fromRow2 {
+        position: relative;
+
+        .fromRowTit {
+          position: absolute;
+          left: 230px;
+          top: 6px;
+          color: #999;
+          font-size: 12px;
+        }
+      }
+      .fromRow {
+        display: flex;
+        align-items: center;
+        margin-bottom: 24px;
+        .fromRowll {
+          width: 94px;
+          text-align: right;
+          position: relative;
+          & > span {
+            color: #ff4d4f;
+          }
+        }
+
+        .fromRowrr {
+          width: calc(100% - 94px);
+        }
+      }
+      .fromRow2 {
+        align-items: self-start;
+        .fromRowll {
+          top: 2px;
+        }
+      }
+      .A1Abtn {
+        position: absolute;
+        top: 50%;
+        right: 60px;
+        transform: translateY(-50%);
+      }
+    }
+  }
+}

+ 317 - 0
src/pages/A1atlas/index.tsx

@@ -0,0 +1,317 @@
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import { QuestionCircleOutlined, FormOutlined, CopyOutlined, StopOutlined } from '@ant-design/icons'
+import { Button, Input, Tooltip, Tree, TreeDataNode } from 'antd'
+import { A1AddInfoType, filterTreeByName, TypeA1dict } from './data'
+import { useDispatch, useSelector } from 'react-redux'
+import { RootState } from '@/store'
+import { A1_APIdel, A1_APIgetInfo, API_A1getTree } from '@/store/action/A1atlas'
+import { MessageFu } from '@/utils/message'
+import A1add from './A1add'
+import MyPopconfirm from '@/components/MyPopconfirm'
+
+function A1atlas() {
+  const [loding, setLoding] = useState(false)
+
+  const dispatch = useDispatch()
+
+  // 传给新增、编辑子组件(没有数据或者删除了的时候-既右侧没有操作的时候)
+  const isNoAcIds = useRef<string[]>([])
+
+  useEffect(() => {
+    isNoAcIds.current = ['0']
+
+    dispatch(
+      API_A1getTree('', data => {
+        setLoding(true)
+        if (data && data.length) {
+          setAcShu(data[0].id)
+          const txtDom: HTMLDivElement = document.querySelector('.ant-select-selection-item')!
+          if (txtDom) {
+            acShuTxtRef.current = txtDom.title
+          }
+        }
+      })
+    )
+  }, [dispatch])
+
+  const { dictAll } = useSelector((state: RootState) => state.A1atlas)
+
+  // 点击重置
+  const resetFu = useCallback(() => {
+    dispatch(API_A1getTree())
+    setValue('')
+    setValue2('')
+  }, [dispatch])
+
+  // 当前选中的树节点ID
+  const [acShu, setAcShu] = useState('1')
+  // 树节点文字信息
+  const acShuTxtRef = useRef('')
+
+  // 点击树节点
+  const onSelect = useCallback((id: any) => {
+    // console.log('点击树节点', id)
+    if (id[0]) {
+      setAcShu(id[0])
+    }
+  }, [])
+
+  const [value, setValue] = useState('')
+  const [value2, setValue2] = useState('')
+
+  const timeRef = useRef(-1)
+  const valueChange = useCallback((val: string) => {
+    setValue(val.trim())
+    clearTimeout(timeRef.current)
+    timeRef.current = window.setTimeout(() => {
+      setValue2(val.trim())
+    }, 500)
+  }, [])
+
+  // value变化的时候获取所有dom 设置隐藏
+  const treeDataTemp = useMemo(() => {
+    if (value2) {
+      return filterTreeByName(dictAll, value2)
+    } else return dictAll
+  }, [dictAll, value2])
+
+  // 搜索高亮
+  const treeData = useMemo(() => {
+    const loop = (dataTemp: any[]): TreeDataNode[] => {
+      const data: TypeA1dict[] = dataTemp || []
+
+      return data.map(item => {
+        const strTitle = item.name as string
+        const strTitleD = strTitle.toUpperCase()
+
+        const valueD = value.toUpperCase()
+        const index = strTitleD.indexOf(valueD)
+
+        const beforeStr = strTitle.substring(0, index)
+        const afterStr = strTitle.slice(index + value.length)
+        let title =
+          index > -1 ? (
+            <span key={item.id}>
+              {beforeStr}
+              <span className='site-tree-search-value'>{value}</span>
+              {afterStr}
+            </span>
+          ) : (
+            <span key={item.id}>{strTitle}</span>
+          )
+
+        // 待完善
+
+        title = (
+          <>
+            {/* <FormOutlined />
+            &ensp; */}
+            {item.isDetail === 1 ? (
+              <>
+                <CopyOutlined />
+                &nbsp;
+              </>
+            ) : null}
+            {item.display === 0 ? (
+              <>
+                <StopOutlined />
+                &nbsp;
+              </>
+            ) : null}
+            {title}
+          </>
+        )
+        if (item.children) {
+          return { title, key: item.id, children: loop(item.children) }
+        }
+        return {
+          title,
+          key: item.id
+        }
+      })
+    }
+
+    return loop(treeDataTemp)
+  }, [treeDataTemp, value])
+
+  // 右侧信息
+  const [rightData, setRightData] = useState({} as TypeA1dict)
+
+  const rightDataFu = useCallback(async () => {
+    const res = await A1_APIgetInfo(acShu)
+    if (res.code === 0) {
+      setRightData(res.data)
+    }
+  }, [acShu])
+
+  useEffect(() => {
+    rightDataFu()
+  }, [rightDataFu])
+
+  // 点击新增和编辑
+  const [addInfo, setAddInfo] = useState({} as A1AddInfoType)
+
+  const addSonFu = useCallback(
+    (id: string) => {
+      setAddInfo({
+        id,
+        txt: id === '-1' ? '新增' : '编辑',
+        acInfo: rightData
+      })
+    },
+    [rightData]
+  )
+
+  // 点击删除
+  const delTree = useCallback(
+    async (id: string) => {
+      const res = await A1_APIdel(id)
+      if (res.code === 0) {
+        MessageFu.success('删除成功!')
+        resetFu()
+      }
+    },
+    [resetFu]
+  )
+
+  // 点击效果预览
+  const lookFu = useCallback(() => {
+    // 待完善
+    MessageFu.warning('正在开发中')
+  }, [])
+
+  return (
+    <div className={styles.A1atlas}>
+      <div className='A1left'>
+        <div className='A1leftTit'>
+          节点管理
+          <Tooltip
+            title={
+              <div>
+                <div>
+                  <FormOutlined />
+                  &nbsp; 自定义节点(可编辑)
+                </div>
+                <div>
+                  <CopyOutlined />
+                  &nbsp; 开启详情页的节点
+                </div>
+                <div>
+                  <StopOutlined />
+                  &nbsp; 已禁用的节点
+                </div>
+              </div>
+            }
+          >
+            <QuestionCircleOutlined />
+          </Tooltip>
+        </div>
+
+        {/* 树主体 */}
+        <div className='A1tree'>
+          <div className='A1Tinp'>
+            <Input
+              placeholder='请输入节点名称'
+              maxLength={10}
+              value={value}
+              onChange={e => valueChange(e.target.value)}
+            />
+            &emsp;
+            <Button
+              type='primary'
+              onClick={() =>
+                setAddInfo({
+                  id: '-1',
+                  txt: '新增',
+                  acInfo: rightData
+                })
+              }
+            >
+              新增节点
+            </Button>
+          </div>
+          <div className='A1Tmain'>
+            {treeDataTemp && treeDataTemp.length ? (
+              <Tree
+                // 默认全部展开
+                defaultExpandAll={true}
+                // 数据
+                treeData={treeData}
+                // 自定义字段
+                // fieldNames={{ title: 'name', key: 'id', children: 'children' }}
+                // 选中
+                selectedKeys={[acShu]}
+                // 点击
+                onSelect={onSelect}
+              />
+            ) : null}
+
+            {loding && treeDataTemp.length === 0 ? <div className='NODATA'>暂无数据</div> : null}
+          </div>
+        </div>
+      </div>
+      <div className='A1right'>
+        <div className='A1Rtit'>
+          <div>
+            {rightData.name}&emsp;
+            <Button type='primary' onClick={() => addSonFu(rightData.id)}>
+              编辑
+            </Button>
+            &emsp;
+            <MyPopconfirm
+              txtK='删除'
+              onConfirm={() => delTree(rightData.id)}
+              // disabled={noIdArr.includes(rightData.id)}
+              Dom={<Button danger>删除</Button>}
+            />
+          </div>
+          <Button type='primary' onClick={lookFu}>
+            效果预览
+          </Button>
+        </div>
+
+        {rightData.id ? (
+          <div className='A1RrowBox'>
+            <div className='A1Rrow'>
+              <div className='A1Rrow1'>启用状态:</div>
+              <div className='A1Rrow2'>
+                {rightData.display === 1 ? '启用' : rightData.display === 0 ? '禁用' : '(空)'}
+              </div>
+            </div>
+            <div className='A1Rrow'>
+              <div className='A1Rrow1'>详情页开关:</div>
+              <div className='A1Rrow2'>
+                {rightData.isDetail === 1 ? '开启' : rightData.display === 0 ? '关闭' : '(空)'}
+              </div>
+            </div>
+            <div className='A1Rrow'>
+              <div className='A1Rrow1'>详情页类型:</div>
+              <div className='A1Rrow2'>{rightData.typeSon === '2' ? '富文本' : '外链'}</div>
+            </div>
+
+            <div className='A1Rrow'>
+              <div className='A1Rrow1'>详情页内容:</div>
+              <div className='A1Rrow2'>{rightData.typeSon === '2' ? '富文本' : '外链'}</div>
+            </div>
+          </div>
+        ) : null}
+      </div>
+
+      {/* 新增/编辑页面 中图法分类 */}
+      {addInfo.id ? (
+        <A1add
+          acShuTxt={acShuTxtRef.current}
+          addInfo={addInfo}
+          addFu={() => resetFu()}
+          closeFu={() => setAddInfo({} as A1AddInfoType)}
+          isNoAcIds={isNoAcIds.current}
+        />
+      ) : null}
+    </div>
+  )
+}
+
+const MemoA1atlas = React.memo(A1atlas)
+
+export default MemoA1atlas

+ 45 - 0
src/pages/A2video/A2add/index.module.scss

@@ -0,0 +1,45 @@
+.A2add {
+  :global {
+    .ant-modal-close {
+      display: none;
+    }
+
+    .ant-modal {
+      width: 600px !important;
+      min-width: 600px !important;
+    }
+
+    .ant-modal-header {
+      border-bottom: 1px solid #ccc !important;
+      padding-bottom: 15px !important;
+    }
+
+    .formRow {
+      display: flex;
+      margin: 20px 0;
+
+      .formLeft {
+        position: relative;
+        // top: 5px;
+        width: 81px;
+        text-align: right;
+
+        & > span {
+          color: #ff4d4f;
+        }
+      }
+      .formLeft2 {
+        top: 3px;
+      }
+
+      .formRight {
+        width: calc(100% - 81px);
+        position: relative;
+      }
+    }
+
+    .A2Abtn {
+      text-align: center;
+    }
+  }
+}

+ 96 - 0
src/pages/A2video/A2add/index.tsx

@@ -0,0 +1,96 @@
+import React, { useCallback, useEffect, useRef } from 'react'
+import styles from './index.module.scss'
+import { Button, Modal } from 'antd'
+import ZupOne from '@/components/ZupOne'
+import { A2tableType } from '../data'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import { MessageFu } from '@/utils/message'
+import { A2_APIedit } from '@/store/action/A2video'
+
+type Props = {
+  info: A2tableType
+  addTableFu: () => void
+  closeFu: () => void
+}
+
+function A2add({ info, addTableFu, closeFu }: Props) {
+  useEffect(() => {
+    ZupThumbRef.current?.setFileComFileFu({
+      fileName: '',
+      filePath: info.filePath || '',
+      thumb: info.filePath || ''
+    })
+  }, [info.filePath])
+
+  // 封面图的ref
+  const ZupThumbRef = useRef<any>(null)
+
+  // 点击确定
+  const btnOk = useCallback(async () => {
+    const coverUrl = ZupThumbRef.current?.fileComFileResFu()
+    if (!coverUrl.filePath) MessageFu.warning('请上传视频文件')
+    const obj = {
+      id: info.id,
+      name: info.name,
+      filePath: coverUrl.filePath || ''
+    }
+    const res = await A2_APIedit(obj)
+    if (res.code === 0) {
+      MessageFu.success('修改成功')
+      addTableFu()
+      closeFu()
+    }
+  }, [addTableFu, closeFu, info.id, info.name])
+
+  return (
+    <Modal
+      wrapClassName={styles.A2add}
+      destroyOnClose
+      open={true}
+      title='修改视频'
+      footer={
+        [] // 设置footer为空,去掉 取消 确定默认按钮
+      }
+    >
+      <div className='formRow'>
+        <div className='formLeft'>
+          <span>* </span>视频名称:
+        </div>
+        <div className='formRight'>{info.name}</div>
+      </div>
+
+      <div className='formRow'>
+        <div className='formLeft formLeft2'>
+          <span>* </span>视频文件:
+        </div>
+        <div className='formRight'>
+          <ZupOne
+            ref={ZupThumbRef}
+            isLook={false}
+            fileCheck={false}
+            size={500}
+            dirCode='A2video'
+            myUrl='cms/video/upload'
+            format={['video/mp4']}
+            formatTxt='mp4'
+            checkTxt='请上传视频'
+            upTxt='最多1个'
+            myType='video'
+          />
+        </div>
+      </div>
+
+      <div className='A2Abtn'>
+        <Button type='primary' onClick={btnOk}>
+          提交
+        </Button>
+        &emsp;
+        <MyPopconfirm txtK='取消' onConfirm={closeFu} />
+      </div>
+    </Modal>
+  )
+}
+
+const MemoA2add = React.memo(A2add)
+
+export default MemoA2add

+ 9 - 0
src/pages/A2video/data.ts

@@ -0,0 +1,9 @@
+export type A2tableType = {
+  createTime: string
+  creatorId?: any
+  creatorName?: any
+  filePath?: any
+  id: number
+  name: string
+  updateTime: string
+}

+ 8 - 0
src/pages/A2video/index.module.scss

@@ -0,0 +1,8 @@
+.A2video {
+  :global {
+    .A2tableLook {
+      cursor: pointer;
+      color: var(--themeColor);
+    }
+  }
+}

+ 88 - 0
src/pages/A2video/index.tsx

@@ -0,0 +1,88 @@
+import React, { useCallback, useEffect, useMemo, useState } from 'react'
+import styles from './index.module.scss'
+import MyTable from '@/components/MyTable'
+import { useDispatch, useSelector } from 'react-redux'
+import { A2_APIgetList } from '@/store/action/A2video'
+import { A2tableType } from './data'
+import { Button } from 'antd'
+import store, { RootState } from '@/store'
+import A2add from './A2add'
+
+import { EyeOutlined } from '@ant-design/icons'
+
+function A2video() {
+  const dispatch = useDispatch()
+
+  const getListFu = useCallback(async () => {
+    dispatch(A2_APIgetList())
+  }, [dispatch])
+
+  useEffect(() => {
+    getListFu()
+  }, [getListFu])
+
+  const list = useSelector((state: RootState) => state.A2video.list)
+
+  const [editObj, setEditObj] = useState({} as A2tableType)
+
+  const filePathRes = useCallback((filePath: string) => {
+    let txt: React.ReactNode = '(空)'
+    if (filePath) {
+      const resArr = filePath.split('/')
+      const res = resArr[resArr.length - 1]
+      txt = (
+        <div
+          className='A2tableLook'
+          onClick={() =>
+            store.dispatch({
+              type: 'layout/lookDom',
+              payload: { src: filePath, type: 'video' }
+            })
+          }
+        >
+          {res}&emsp;
+          <EyeOutlined />
+        </div>
+      )
+    }
+    return txt
+  }, [])
+
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        title: '视频文件',
+        render: (item: A2tableType) => filePathRes(item.filePath)
+      },
+      {
+        title: '操作',
+        render: (item: A2tableType) => (
+          <Button size='small' type='text' onClick={() => setEditObj(item)}>
+            修改
+          </Button>
+        )
+      }
+    ]
+  }, [filePathRes])
+  return (
+    <div className={styles.A2video}>
+      <MyTable
+        list={list}
+        columnsTemp={[['txt', '视频名称', 'name']]}
+        lastBtn={tableLastBtn}
+        pagingInfo={false}
+      />
+      {editObj.id ? (
+        <A2add
+          info={editObj}
+          addTableFu={getListFu}
+          closeFu={() => setEditObj({} as A2tableType)}
+        />
+      ) : null}
+    </div>
+  )
+}
+
+const MemoA2video = React.memo(A2video)
+
+export default MemoA2video

+ 25 - 0
src/pages/Layout/data.ts

@@ -0,0 +1,25 @@
+import { RouterType } from '@/types'
+import React from 'react'
+
+const tabLeftArr: RouterType[] = [
+  {
+    id: 1,
+    name: '知识图谱',
+    path: '/',
+    Com: React.lazy(() => import('../A1atlas'))
+  },
+  {
+    id: 2,
+    name: '视频管理',
+    path: '/video',
+    Com: React.lazy(() => import('../A2video'))
+  },
+  {
+    id: 2100,
+    name: '用户管理',
+    path: '/user',
+    Com: React.lazy(() => import('../Z1user'))
+  }
+]
+
+export default tabLeftArr

+ 164 - 0
src/pages/Layout/index.module.scss

@@ -0,0 +1,164 @@
+.Layout {
+  width: 100%;
+  height: 100%;
+  background-color: #f1f2f6;
+  overflow: hidden;
+
+  :global {
+    .layoutLeft {
+      position: relative;
+      width: 100%;
+      height: 60px;
+      display: flex;
+      box-shadow: 1px 1px 1px #ccc;
+      background-color: #fff;
+
+      .layoutLeftTit {
+        width: 240px;
+        height: 100%;
+        display: flex;
+        flex-direction: column;
+        justify-content: center;
+        align-items: center;
+        & > p {
+          &:nth-of-type(1) {
+            font-size: 18px;
+            font-weight: 700;
+          }
+        }
+      }
+
+      .layoutLeftMain {
+        display: flex;
+
+        .layoutLRowBox {
+          font-size: 18px;
+          font-weight: 700;
+          display: flex;
+          justify-content: center;
+          align-items: center;
+          padding: 0 30px;
+          background-color: #f8f8f8;
+          border-left: 1px solid #ccc;
+          border-right: 1px solid #ccc;
+          border-bottom: 5px solid transparent;
+          transition: all 0.5s;
+
+          cursor: pointer;
+          &:hover {
+            border-bottom: 5px solid var(--themeColor);
+          }
+        }
+        .active {
+          pointer-events: none;
+
+          border-bottom: 5px solid var(--themeColor);
+        }
+      }
+
+      .layoutRightTop {
+        height: 60px;
+        width: auto;
+        position: absolute;
+        right: 0;
+        top: 0;
+
+        .user {
+          position: relative;
+          right: -150px;
+          top: 0;
+          height: 100%;
+          display: flex;
+          align-items: center;
+          font-size: 16px;
+          color: black;
+          transition: all 0.3s;
+
+          .userNameBox {
+            width: auto;
+            cursor: pointer;
+            background: url('../../assets/img/user.png') no-repeat left center;
+            background-size: 40px 40px;
+            padding-left: 46px;
+            height: 60px;
+            display: flex;
+            align-items: center;
+            color: var(--themeColor);
+          }
+
+          .userInco {
+            margin-left: 10px;
+            color: var(--themeColor);
+          }
+
+          .userInco1 {
+            // display: none;
+            opacity: 0 !important;
+          }
+
+          .userSet {
+            position: relative;
+            top: 10px;
+            margin-left: 40px;
+            width: 140px;
+            opacity: 1;
+            height: 74px;
+
+            & > div {
+              box-shadow: 1px 1px 4px 4px #ccc;
+              border-radius: 10px;
+              overflow: hidden;
+
+              & > span {
+                cursor: pointer;
+                background-color: #fff;
+                display: block;
+                width: 100%;
+                text-align: center;
+                height: 35px;
+                line-height: 35px;
+
+                &:hover {
+                  color: var(--themeColor);
+                }
+              }
+            }
+          }
+        }
+
+        .userShow {
+          right: 20px;
+        }
+      }
+    }
+
+    .layoutRight {
+      height: calc(100% - 60px);
+      width: 100%;
+      overflow: hidden;
+      padding: 20px;
+
+      .layoutRightMain {
+        border-radius: 14px;
+        overflow: hidden;
+        height: 100%;
+        background-color: #fff;
+
+        .mainBoxR {
+          width: 100%;
+          height: 100%;
+          // overflow: hidden;
+          position: relative;
+
+          & > div {
+            width: 100%;
+            height: 100%;
+            // background-color: #fff;
+            // border-radius: 10px;
+            // padding: 20px;
+          }
+        }
+      }
+    }
+  }
+}

+ 250 - 0
src/pages/Layout/index.tsx

@@ -0,0 +1,250 @@
+import React, { useCallback, useEffect, useRef, useState } from 'react'
+import { CaretRightOutlined } from '@ant-design/icons'
+import styles from './index.module.scss'
+import { Route, Switch, useLocation } from 'react-router-dom'
+import AuthRoute from '@/components/AuthRoute'
+import history from '@/utils/history'
+import { Button, Form, Input, Modal } from 'antd'
+import { Base64 } from 'js-base64'
+import encodeStr from '@/utils/pass'
+import { passWordEditAPI } from '@/store/action/layout'
+import { getTokenInfo, removeTokenInfo } from '@/utils/storage'
+import { MessageFu } from '@/utils/message'
+import NotFound from '@/components/NotFound'
+import classNames from 'classnames'
+import { RouterType } from '@/types'
+import tabLeftArr from './data'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import SpinLodingSon from '@/components/SpinLodingSon'
+
+function Layout() {
+  // 当前路径选中的左侧菜单
+  const location = useLocation()
+  const [path, setPath] = useState('')
+
+  useEffect(() => {
+    const arr = location.pathname.split('/')
+    let pathTemp = '/'
+    if (arr[1]) pathTemp = '/' + arr[1]
+
+    setPath(pathTemp)
+  }, [location])
+
+  // 获取用户权限信息
+  const getUserAuthFu = useCallback(async () => {
+    const userInfo = getTokenInfo().user
+
+    const isOkIdArr: number[] = [1, 2]
+
+    // 是管理员
+    if (userInfo.isAdmin === 1) {
+      isOkIdArr.push(2100)
+    }
+
+    const tempArr: RouterType[] = []
+
+    tabLeftArr.forEach(v1 => {
+      if (isOkIdArr.includes(v1.id)) {
+        tempArr.push(v1)
+      }
+    })
+
+    setRouterCom(tempArr)
+
+    // 如果当前页面没有权限了,跳转有权限的第一个页面
+    const urlAll = window.location.hash
+    const isNowPath = urlAll.replace('#', '')
+    const pathArr = tempArr.map(v => v.path)
+    if (!pathArr.includes(isNowPath)) {
+      history.push(pathArr[0])
+    }
+
+    const resList = tabLeftArr.filter(c => isOkIdArr.includes(c.id))
+
+    setList(resList)
+  }, [])
+
+  useEffect(() => {
+    getUserAuthFu()
+  }, [getUserAuthFu])
+
+  // 左侧菜单 信息
+  const [list, setList] = useState<RouterType[]>([])
+
+  // 路由信息(过滤之后的)
+  const [RouterCom, setRouterCom] = useState<RouterType[]>([])
+
+  // useEffect(() => {
+  //   console.log(123, list);
+  // }, [list]);
+
+  // 点击跳转
+  // 点击跳转
+  const pathCutFu = useCallback((path: string) => {
+    history.push(path)
+  }, [])
+
+  // 修改密码相关
+  const [open, setOpen] = useState(false)
+
+  // 拿到新密码的输入框的值
+  const oldPasswordValue = useRef('')
+
+  const checkPassWord = (rule: any, value: any = '') => {
+    if (value !== oldPasswordValue.current) return Promise.reject('新密码不一致!')
+    else return Promise.resolve(value)
+  }
+
+  const onFinish = async (values: any) => {
+    // 通过校验之后发送请求
+    if (values.oldPassword === values.newPassword) return MessageFu.warning('新旧密码不能相同!')
+    const obj = {
+      oldPassword: encodeStr(Base64.encode(values.oldPassword)),
+      newPassword: encodeStr(Base64.encode(values.newPassword))
+    }
+    const res: any = await passWordEditAPI(obj)
+    if (res.code === 0) {
+      MessageFu.success('修改成功!')
+      loginExit()
+    }
+  }
+
+  // 点击退出登录
+  const loginExit = () => {
+    removeTokenInfo()
+    history.push('/login')
+  }
+
+  // 点击用户 出来 退出登录 修改密码
+  const [isUserBtnShow, setIsUserBtnShow] = useState(false)
+
+  return (
+    <div className={styles.Layout}>
+      {/* 左边 */}
+      <div className='layoutLeft'>
+        <div className='layoutLeftTit'>
+          <p>无尽意 东魏程哲碑</p>
+          <p>虚拟展管理后台</p>
+        </div>
+        {/* 左边主体 */}
+        <div className='layoutLeftMain'>
+          {list.map(v => (
+            <div
+              className={classNames('layoutLRowBox', path === v.path ? 'active' : '')}
+              key={v.id}
+              onClick={() => pathCutFu(v.path)}
+            >
+              {v.name}
+            </div>
+          ))}
+        </div>
+
+        {/* 用户相关 */}
+        <div className='layoutRightTop'>
+          <div
+            className={classNames('user', isUserBtnShow ? 'userShow' : '')}
+            onMouseLeave={() => setIsUserBtnShow(false)}
+          >
+            <div className='userNameBox' onClick={() => setIsUserBtnShow(!isUserBtnShow)}>
+              {getTokenInfo().user.realName || getTokenInfo().user.userName || '匿名'}
+
+              <div className='userInco userInco2'>
+                <CaretRightOutlined />
+              </div>
+            </div>
+
+            <div className='userSet'>
+              <div>
+                <span onClick={() => setOpen(true)}>修改密码</span>
+                <MyPopconfirm txtK='退出登录' onConfirm={loginExit} Dom='退出登录' loc='bottom' />
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+      {/* 右边 */}
+      <div className='layoutRight'>
+        {/* 右边主体 */}
+        <div className='layoutRightMain'>
+          {/* 二级路由页面 */}
+          <div className='mainBoxR'>
+            <React.Suspense fallback={<SpinLodingSon />}>
+              <Switch>
+                {RouterCom.map(v => (
+                  <AuthRoute key={v.id} exact path={v.path} component={v.Com} />
+                ))}
+
+                <Route path='*' component={NotFound} />
+              </Switch>
+            </React.Suspense>
+          </div>
+        </div>
+      </div>
+
+      {/* 点击修改密码打开的对话框 */}
+      <Modal
+        destroyOnClose
+        open={open}
+        title='修改密码'
+        onCancel={() => setOpen(false)}
+        footer={
+          [] // 设置footer为空,去掉 取消 确定默认按钮
+        }
+      >
+        <Form
+          scrollToFirstError={true}
+          name='basic'
+          labelCol={{ span: 5 }}
+          wrapperCol={{ span: 16 }}
+          onFinish={onFinish}
+          autoComplete='off'
+        >
+          <Form.Item
+            label='旧密码'
+            name='oldPassword'
+            rules={[{ required: true, message: '不能为空!' }]}
+            getValueFromEvent={e => e.target.value.replace(/\s+/g, '')}
+          >
+            <Input.Password maxLength={20} />
+          </Form.Item>
+
+          <Form.Item
+            label='新密码'
+            name='newPassword'
+            rules={[
+              { required: true, message: '不能为空!' },
+              { min: 6, max: 15, message: '密码长度为6-15个字符!' }
+            ]}
+            getValueFromEvent={e => e.target.value.replace(/\s+/g, '')}
+          >
+            <Input.Password
+              maxLength={15}
+              onChange={e => (oldPasswordValue.current = e.target.value)}
+            />
+          </Form.Item>
+
+          <Form.Item
+            label='确定新密码'
+            name='checkPass'
+            rules={[{ validator: checkPassWord }]}
+            getValueFromEvent={e => e.target.value.replace(/\s+/g, '')}
+          >
+            <Input.Password maxLength={15} />
+          </Form.Item>
+
+          <Form.Item wrapperCol={{ offset: 14, span: 16 }}>
+            <Button onClick={() => setOpen(false)}>取消</Button>
+            &emsp;
+            <Button type='primary' htmlType='submit'>
+              确定
+            </Button>
+          </Form.Item>
+        </Form>
+      </Modal>
+    </div>
+  )
+}
+
+// 使用 React.memo 来优化组件,避免组件的无效更新,类似 类组件里面的PureComponent
+const MemoLayout = React.memo(Layout)
+export default MemoLayout

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

@@ -0,0 +1,143 @@
+.Login {
+  width: 100%;
+  height: 100%;
+  display: flex;
+  justify-content: center;
+  padding: 8%;
+  background-image: url('../../assets/img/bg.jpg');
+  background-size: 100% 100%;
+
+  :global {
+    .mainRight {
+      border-radius: 10px;
+      width: 530px;
+      display: flex;
+      flex-direction: column;
+      justify-content: center;
+      align-items: center;
+      background-color: rgba(255, 255, 255, 0.6);
+      backdrop-filter: blur(4px);
+
+      .LogoImg {
+        font-size: 24px;
+        color: var(--themeColor);
+        text-align: center;
+        font-weight: 700;
+      }
+
+      .inputBox {
+        padding: 30px 0 60px;
+        width: 100%;
+
+        input::-webkit-input-placeholder {
+          /* WebKit browsers */
+          color: #999;
+        }
+
+        input:-moz-placeholder {
+          /* Mozilla Firefox 4 to 18 */
+          color: #999;
+        }
+
+        input::-moz-placeholder {
+          /* Mozilla Firefox 19+ */
+          color: #999;
+        }
+
+        input:-ms-input-placeholder {
+          /* Internet Explorer 10+ */
+          color: #999;
+        }
+
+        .inputBoxRow {
+          width: 370px;
+          margin: 30px auto;
+
+          .ant-input-suffix .ant-input-password-icon {
+            color: var(--themeColor);
+            font-size: 22px;
+          }
+        }
+
+        .inputBoxRow2 {
+          position: relative;
+
+          .loginCode {
+            z-index: 110;
+            cursor: pointer;
+            position: absolute;
+            top: 50%;
+            right: 10px;
+            transform: translateY(-50%);
+          }
+        }
+
+        .ant-input-prefix {
+          margin-right: 10px;
+
+          .anticon {
+            padding-right: 10px;
+            width: 36px;
+            height: 36px;
+
+            svg {
+              width: 100%;
+              height: 100%;
+            }
+          }
+        }
+
+        .ant-input {
+          font-size: 18px;
+          width: 45%;
+          height: 60px;
+          line-height: 60px;
+          background-clip: content-box;
+        }
+
+        input:-webkit-autofill {
+          font-size: 18px !important;
+          -webkit-text-fill-color: var(--themeColor) !important;
+          background-image: none;
+          -webkit-box-shadow: 0 0 0px 1000px transparent inset !important; //填充阴影,可以用来遮住背景色
+          background-color: transparent;
+          transition: background-color 50000s ease-in-out 0s; //背景色透明  生效时长  过渡效果  启用时延迟的时间
+        }
+
+        .ant-input-affix-wrapper {
+          background-color: transparent;
+          padding: 0 11px;
+          width: 100%;
+          height: 60px;
+          border: 1px solid var(--themeColor);
+          border-radius: 4px;
+          color: var(--themeColor);
+
+          .ant-input {
+            background-color: transparent;
+
+            width: 100%;
+            height: 60px;
+            color: var(--themeColor);
+          }
+        }
+
+        .ant-input-affix-wrapper-focused {
+          box-shadow: none;
+        }
+
+        .loginBtn {
+          text-align: center;
+          .ant-btn {
+            color: #fff;
+            background-color: var(--themeColor);
+            border-radius: 25px;
+            font-size: 18px;
+            width: 375px;
+            height: 50px;
+          }
+        }
+      }
+    }
+  }
+}

+ 132 - 0
src/pages/Login/index.tsx

@@ -0,0 +1,132 @@
+import styles from './index.module.scss'
+
+import { Input, Button } from 'antd'
+import { UserOutlined, LockOutlined, NumberOutlined } from '@ant-design/icons'
+import { useCallback, useEffect, useState } from 'react'
+import { Base64 } from 'js-base64'
+import encodeStr from '@/utils/pass'
+import { setTokenInfo } from '@/utils/storage'
+import history from '@/utils/history'
+import { MessageFu } from '@/utils/message'
+import { API_LoginGetCode, userLoginAPI } from '@/store/action/layout'
+
+export default function Login() {
+  // 获取验证码
+  const LoginGetCodeFu = useCallback(async () => {
+    const res: any = await API_LoginGetCode()
+    const reader = new FileReader()
+    reader.readAsDataURL(res)
+    reader.onload = () => {
+      setCodeImg(reader.result)
+    }
+  }, [])
+
+  useEffect(() => {
+    LoginGetCodeFu()
+  }, [LoginGetCodeFu])
+
+  // 账号密码 - 验证码
+  const [userName, setUserName] = useState('')
+  const [passWord, setPassWord] = useState('')
+  const [code, setCode] = useState<any>('')
+  const [codeImg, setCodeImg] = useState<any>('')
+
+  useEffect(() => {
+    //进入登录页 重置 权限信息为空
+  }, [])
+
+  // 键盘按下回车事件
+  const keyUpEntFu = (e: React.KeyboardEvent<HTMLInputElement>) => {
+    if (e.key === 'Enter') loginClickFu()
+  }
+  // 点击登录
+  const loginClickFu = useCallback(async () => {
+    // 非空判断
+    if (userName === '') return MessageFu.warning('请输入账号!')
+    else if (passWord === '') return MessageFu.warning('请输入密码!')
+    const obj = {
+      userName,
+      password: encodeStr(Base64.encode(passWord)),
+      randCode: code
+    }
+    const res: any = await userLoginAPI(obj)
+    if (res.code === 0) {
+      MessageFu.success('登录成功')
+
+      // 检查密码是不是默认密码,是的话给提示
+      if (passWord === 'Aa147852') {
+        window.setTimeout(() => {
+          MessageFu.warning('您的密码还是默认密码,请尽快修改!')
+        }, 1000)
+      }
+
+      // 用户信息存到本地
+      setTokenInfo({ ...res.data, token: res.data.satoken })
+      const urlAll = window.location.href
+      if (urlAll.includes('?back=')) {
+        const url = urlAll.split('?back=')[1]
+        if (url) history.push(`/${url}`)
+        else history.push('/')
+      } else history.push('/')
+    } else if (res.code === 3014) {
+      MessageFu.warning('账号不存在或密码错误,请联系管理员!')
+    } else if (res.code === -1 && res.msg === '验证码有误') {
+      LoginGetCodeFu()
+    }
+  }, [LoginGetCodeFu, code, passWord, userName])
+
+  return (
+    <div className={styles.Login}>
+      <div className='mainRight'>
+        {/* logg */}
+        <div className='LogoImg'>
+          <p>无尽意 东魏程哲碑</p>
+          <p>虚拟展管理后台</p>
+        </div>
+
+        {/* 账号密码输入框 */}
+        <div className='inputBox'>
+          <div className='inputBoxRow'>
+            <Input
+              onKeyUp={e => keyUpEntFu(e)}
+              value={userName}
+              onChange={e => setUserName(e.target.value.trim())}
+              prefix={<UserOutlined rev={undefined} />}
+              placeholder='请输入账号'
+              maxLength={15}
+            />
+          </div>
+          <div className='inputBoxRow'>
+            <Input.Password
+              onKeyUp={e => keyUpEntFu(e)}
+              value={passWord}
+              onChange={e => setPassWord(e.target.value.trim())}
+              prefix={<LockOutlined rev={undefined} />}
+              placeholder='请输入密码'
+              maxLength={20}
+            />
+          </div>
+          <div className='inputBoxRow inputBoxRow2'>
+            <Input
+              onKeyUp={e => keyUpEntFu(e)}
+              value={code}
+              onChange={e => setCode(e.target.value.trim())}
+              prefix={<NumberOutlined rev={undefined} />}
+              placeholder='请输入验证码'
+              maxLength={5}
+            />
+            {codeImg ? (
+              <img onClick={LoginGetCodeFu} className='loginCode' src={codeImg} alt='' />
+            ) : null}
+          </div>
+          {/* 登录按钮 */}
+          <div className='loginBtn'>
+            <Button type='primary' size='large' onClick={loginClickFu}>
+              登 录
+            </Button>
+          </div>
+        </div>
+      </div>
+    </div>
+  )
+}

+ 19 - 0
src/pages/Z1user/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;
+      }
+    }
+  }
+}

+ 121 - 0
src/pages/Z1user/UserAdd/index.tsx

@@ -0,0 +1,121 @@
+import { getUserInfoByIdAPI, userSaveAPI } from '@/store/action/Z1user'
+import { SaveUserType } from '@/types'
+import { MessageFu } from '@/utils/message'
+import { Button, Form, FormInstance, Input, Modal } from 'antd'
+import React, { useCallback, useEffect, useRef } from 'react'
+import styles from './index.module.scss'
+import MyPopconfirm from '@/components/MyPopconfirm'
+
+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 onFinish = useCallback(
+    async (values: any) => {
+      const obj: SaveUserType = {
+        ...values,
+        id: id ? id : null,
+        roleId: 2
+      }
+
+      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
+          scrollToFirstError={true}
+          ref={FormBoxRef}
+          name='basic'
+          labelCol={{ span: 5 }}
+          onFinish={onFinish}
+          onFinishFailed={onFinishFailed}
+          autoComplete='off'
+        >
+          <Form.Item
+            label='账号名'
+            name='userName'
+            rules={[
+              { required: true, message: '请输入账号名!' },
+              { min: 6, message: '最少6个字!' }
+            ]}
+            getValueFromEvent={e => e.target.value.replace(/\s+/g, '')}
+          >
+            <Input disabled={id} maxLength={15} showCount placeholder='请输入内容' />
+          </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'>* 默认密码 Aa147852</div>}
+
+          {/* 确定和取消按钮 */}
+          <br />
+          <Form.Item wrapperCol={{ offset: 9, span: 16 }}>
+            <Button type='primary' htmlType='submit'>
+              提交
+            </Button>
+            &emsp;
+            <MyPopconfirm txtK='取消' onConfirm={closePage} />
+          </Form.Item>
+        </Form>
+      </div>
+    </Modal>
+  )
+}
+
+const MemoUserAdd = React.memo(UserAdd)
+
+export default MemoUserAdd

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

@@ -0,0 +1,86 @@
+.Z1user {
+  :global {
+    .selectBox {
+      padding: 15px 24px;
+      background-color: #fff;
+      display: flex;
+      justify-content: space-between;
+    }
+
+    .tableBox {
+      border-radius: 10px;
+      overflow: hidden;
+      margin-top: 15px;
+      height: calc(100% - 77px);
+      background-color: #fff;
+    }
+  }
+}
+
+// 授权
+.Z1auth {
+  :global {
+    .ant-modal-close {
+      display: none;
+    }
+
+    .ant-modal {
+      width: 800px !important;
+    }
+
+    .ant-modal-body {
+      border-top: 1px solid #ccc;
+    }
+
+    .Z1aEmain {
+      max-height: 500px;
+      overflow-y: auto;
+      padding-top: 15px;
+
+      .Z1aRow {
+        margin-bottom: 10px;
+        display: flex;
+        .Z1aRowll {
+          font-weight: 700;
+          text-align: right;
+          width: 100px;
+        }
+        .Z1aRowrr {
+          width: calc(100% - 100px);
+        }
+        .Z1aRowrr2 {
+          .ant-checkbox-wrapper {
+            width: 200px;
+            & > span {
+              &:nth-of-type(2) {
+                width: calc(100% - 20px);
+                overflow: hidden;
+                text-overflow: ellipsis;
+                white-space: nowrap;
+              }
+            }
+          }
+        }
+      }
+
+      .Z1aErr {
+        margin-bottom: 20px;
+        text-align: center;
+        color: #ff4d4f;
+        opacity: 0;
+        pointer-events: none;
+        transition: all 0.3s;
+        position: relative;
+        top: -10px;
+      }
+
+      .Z1aErrAc {
+        opacity: 1;
+        top: 0;
+      }
+    }
+    .Z1aEbtn {
+      text-align: center;
+    }
+  }
+}

+ 189 - 0
src/pages/Z1user/index.tsx

@@ -0,0 +1,189 @@
+import { RootState } from '@/store'
+import { getUserListAPI, userPassResetAPI, userRemoveAPI } from '@/store/action/Z1user'
+import { UserTableAPIType, UserTableListType } from '@/types'
+import { MessageFu } from '@/utils/message'
+import { Input, Button } from 'antd'
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import { useDispatch, useSelector } from 'react-redux'
+import styles from './index.module.scss'
+import UserAdd from './UserAdd'
+import MyTable from '@/components/MyTable'
+import { Z1tableC } from '@/utils/tableData'
+import MyPopconfirm from '@/components/MyPopconfirm'
+
+function Z1user() {
+  const dispatch = useDispatch()
+
+  // 顶部筛选
+  const [fromData, setFromData] = useState<UserTableAPIType>({
+    pageNum: 1,
+    pageSize: 10,
+    searchKey: ''
+  })
+
+  // 封装发送请求的函数
+
+  const getList = useCallback(async () => {
+    dispatch(getUserListAPI(fromData))
+  }, [dispatch, fromData])
+
+  useEffect(() => {
+    getList()
+  }, [getList])
+
+  const timeRef = useRef(-1)
+  // 用户名
+  const txtChangeFu = useCallback(
+    (e: React.ChangeEvent<HTMLInputElement>, key: 'searchKey') => {
+      clearTimeout(timeRef.current)
+      timeRef.current = window.setTimeout(() => {
+        setFromData({
+          ...fromData,
+          [key]: e.target.value,
+          pageNum: 1
+        })
+      }, 500)
+    },
+    [fromData]
+  )
+
+  // 点击重置
+  const [inputKey, setInputKey] = useState(1)
+  const resetSelectFu = useCallback(() => {
+    // 把2个输入框和时间选择器清空
+    setInputKey(Date.now())
+    setFromData({
+      pageNum: 1,
+      pageSize: 10,
+      searchKey: ''
+    })
+  }, [])
+
+  // 从仓库中获取表格数据
+  const tableInfo = useSelector((state: RootState) => state.Z1user.tableInfo)
+
+  // 点击删除
+  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 >= 20) return MessageFu.warning('最多支持20个用户!')
+
+      editId.current = id
+      setEditPageShow(true)
+    },
+    [tableInfo.list.length]
+  )
+
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        title: '操作',
+        render: (item: UserTableListType) => {
+          return item.isAdmin === 1 ? (
+            '-'
+          ) : (
+            <>
+              <MyPopconfirm
+                txtK='重置密码'
+                onConfirm={() => resetPassFu(item.id)}
+                Dom={
+                  <Button size='small' type='text'>
+                    重置密码
+                  </Button>
+                }
+              />
+
+              <Button size='small' type='text' onClick={() => openEditPageFu(item.id)}>
+                编辑
+              </Button>
+              <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
+            </>
+          )
+        }
+      }
+    ]
+  }, [delTableFu, openEditPageFu, resetPassFu])
+
+  return (
+    <div className={styles.Z1user}>
+      <div className='pageTitle'>用户管理</div>
+      <div className='userTop'>
+        <div className='selectBox'>
+          <div className='selectBoxRow'>
+            <span>搜索项:</span>
+            <Input
+              key={inputKey}
+              maxLength={10}
+              showCount
+              style={{ width: 300 }}
+              placeholder='请输入用户名'
+              allowClear
+              onChange={e => txtChangeFu(e, 'searchKey')}
+            />
+          </div>
+
+          <div className='selectBoxRow'>
+            &emsp;&emsp;<Button onClick={resetSelectFu}>重置</Button>
+            &emsp;&emsp;
+            <Button
+              type='primary'
+              onClick={() => {
+                if (tableInfo.total >= 30) return MessageFu.warning('最多30个账号!')
+                openEditPageFu(0)
+              }}
+            >
+              新增
+            </Button>
+          </div>
+        </div>
+      </div>
+      {/* 表格主体 */}
+      <div className='tableBox'>
+        <MyTable
+          yHeight={620}
+          list={tableInfo.list}
+          columnsTemp={Z1tableC}
+          lastBtn={tableLastBtn}
+          pageNum={fromData.pageNum}
+          pageSize={fromData.pageSize}
+          total={tableInfo.total}
+          onChange={(pageNum, pageSize) => setFromData({ ...fromData, pageNum, pageSize })}
+        />
+      </div>
+
+      {/* 点击新增或者编辑 */}
+      {editPageShow ? (
+        <UserAdd
+          id={editId.current}
+          closePage={() => setEditPageShow(false)}
+          upTableList={getList}
+          addTableList={resetSelectFu}
+        />
+      ) : null}
+    </div>
+  )
+}
+
+const MemoZ1user = React.memo(Z1user)
+
+export default MemoZ1user

+ 5 - 0
src/pages/初始化组件/index.module.scss

@@ -0,0 +1,5 @@
+.AAAAA{
+  :global{
+    
+  }
+}

+ 14 - 0
src/pages/初始化组件/index.tsx

@@ -0,0 +1,14 @@
+import React from "react";
+import styles from "./index.module.scss";
+ function AAAAA() {
+  
+  return (
+    <div className={styles.AAAAA}>
+      <h1>AAAAA</h1>
+    </div>
+  )
+}
+
+const MemoAAAAA = React.memo(AAAAA);
+
+export default MemoAAAAA;

+ 41 - 0
src/store/action/A1atlas.ts

@@ -0,0 +1,41 @@
+import http from '@/utils/http'
+import { AppDispatch } from '..'
+import { TypeA1dict } from '@/pages/A1atlas/data'
+
+/**
+ * 获取树列表信息
+ */
+
+export const API_A1getTree = (id?: string, backFu?: (data: TypeA1dict[]) => void): any => {
+  return async (dispatch: AppDispatch) => {
+    let url = 'cms/dict/getTree'
+    if (id) url = url + `?parentId=${id}`
+    const res = await http.get(url)
+    if (res.code === 0) {
+      const caseStr = id ? 'A1/getDictAll' : 'A1/getDictAll'
+      dispatch({ type: caseStr, payload: res.data })
+      backFu && backFu(res.data)
+    }
+  }
+}
+
+/**
+ * 获取详情
+ */
+export const A1_APIgetInfo = (id: string) => {
+  return http.get(`cms/dict/detail/${id}`)
+}
+
+/**
+ * 新增、编辑
+ */
+export const A1_APIsave = (data: any) => {
+  return http.post('cms/dict/save', data)
+}
+
+/**
+ * 删除
+ */
+export const A1_APIdel = (id: string) => {
+  return http.get(`cms/dict/remove/${id}`)
+}

+ 21 - 0
src/store/action/A2video.ts

@@ -0,0 +1,21 @@
+import http from '@/utils/http'
+import { AppDispatch } from '..'
+
+/**
+ * 获取视频列表
+ */
+export const A2_APIgetList = (): any => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.get('cms/video/getList')
+    if (res.code === 0) {
+      dispatch({ type: 'A2/getList', payload: res.data || [] })
+    }
+  }
+}
+
+/**
+ * 修改密码接口
+ */
+export const A2_APIedit = (data: any) => {
+  return http.post('cms/video/edit', data)
+}

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

@@ -0,0 +1,68 @@
+import { SaveUserType, UserTableAPIType } from '@/types'
+import http from '@/utils/http'
+import { AppDispatch } from '..'
+/**
+ * 获取用户管理表格列表
+ */
+export const getUserListAPI = (data: UserTableAPIType): any => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.post('sys/user/list', data)
+    if (res.code === 0) {
+      const obj = {
+        list: res.data.records,
+        total: res.data.total
+      }
+
+      dispatch({ type: 'Z1/getList', payload: obj })
+    }
+  }
+}
+
+/**
+ * 删除用户
+ */
+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}`)
+}
+
+/**
+ * 角色授权-获取
+ */
+export const Z1_APIgetAuthByUserId = (userId: number) => {
+  return http.get(`sys/user/perm/detail/${userId}`)
+}
+
+/**
+ * 角色授权-设置
+ */
+export const Z1_APIsetAuth = (data: any) => {
+  return http.post('sys/user/perm/auth', data)
+}
+
+/**
+ * 角色授权-获取 初始页面获取
+ */
+export const Z1_APIgetAuthBase = () => {
+  return http.get('sys/user/perm/getTree')
+}

+ 50 - 0
src/store/action/layout.ts

@@ -0,0 +1,50 @@
+import { domShowFu, progressDomFu } from '@/utils/domShow'
+import http from '@/utils/http'
+import axios from 'axios'
+import store from '..'
+
+/**
+ * 用户登录接口
+ */
+export const userLoginAPI = (data: any) => {
+  return http.post('admin/login', { ...data })
+}
+
+/**
+ * 修改密码接口
+ */
+export const passWordEditAPI = (data: any) => {
+  return http.post('sys/user/updatePwd', { ...data })
+}
+
+/**
+ * 获取验证码
+ */
+export const API_LoginGetCode = () => {
+  return http.get('admin/getRandCode', { responseType: 'blob' })
+}
+
+const CancelToken = axios.CancelToken
+/**
+ * 上传封面图和附件
+ */
+export const API_upFile = (data: any, url: string) => {
+  domShowFu('#UpAsyncLoding', true)
+
+  return http.post(url, data, {
+    timeout: 0,
+    // 显示进度条
+    onUploadProgress: (e: any) => {
+      const complete = (e.loaded / e.total) * 100 || 0
+      progressDomFu(complete + '%')
+    },
+    // 取消上传
+    cancelToken: new CancelToken(function executor(c) {
+      domShowFu('#UpAsyncLoding', false)
+      store.dispatch({
+        type: 'layout/closeUpFile',
+        payload: { fu: c, state: true }
+      })
+    })
+  })
+}

+ 20 - 0
src/store/index.ts

@@ -0,0 +1,20 @@
+// 导入 redux
+import { applyMiddleware, legacy_createStore as createStore } from 'redux'
+// 导入自己封装的  rootReducer 
+import rootReducer from './reducer'
+// 导入调试工具和 异步的 redux(用来发送异步请求)
+// 调试工具需要下载谷歌 扩展程序 我用的是 Redux DevTools 3.0.17
+import { composeWithDevTools } from 'redux-devtools-extension'
+import thunk from 'redux-thunk'
+
+// 创建仓库实例
+const store = createStore(rootReducer, composeWithDevTools(applyMiddleware(thunk)))
+
+// 声明 RootState,在使用仓库的时候用来使用
+export type RootState = ReturnType<typeof store.getState>
+
+// 声明 AppDispatch,在异步请求的时候来使用
+export type AppDispatch = typeof store.dispatch
+
+// 导出仓库实例
+export default store

+ 34 - 0
src/store/reducer/A1atlas.ts

@@ -0,0 +1,34 @@
+import { TypeA1dict } from '@/pages/A1atlas/data'
+
+// 初始化状态
+const initState = {
+  // 所有字典数据
+  dictAll: [] as TypeA1dict[],
+  // 列表展示的数据
+  dictList: [] as TypeA1dict[]
+}
+
+// 定义 action 类型
+type Props =
+  | {
+      type: 'A1/getDictAll'
+      payload: TypeA1dict[]
+    }
+  | {
+      type: 'A1/getList'
+      payload: TypeA1dict[]
+    }
+
+// reducer
+export default function userReducer(state = initState, action: Props) {
+  switch (action.type) {
+    // 获取字典数据
+    case 'A1/getDictAll':
+      return { ...state, dictAll: action.payload }
+    // 获取展示的数据
+    case 'A1/getList':
+      return { ...state, dictList: action.payload }
+    default:
+      return state
+  }
+}

+ 25 - 0
src/store/reducer/A2video.ts

@@ -0,0 +1,25 @@
+import { A2tableType } from '@/pages/A2video/data'
+
+// 初始化状态
+const initState = {
+  // 列表数据
+  list: [] as A2tableType[]
+}
+
+// 定义 action 类型
+type Props = {
+  type: 'A2/getList'
+  payload: A2tableType[]
+}
+
+// reducer
+export default function userReducer(state = initState, action: Props) {
+  switch (action.type) {
+    // 获取列表数据
+    case 'A2/getList':
+      return { ...state, list: action.payload }
+
+    default:
+      return state
+  }
+}

+ 28 - 0
src/store/reducer/Z1user.ts

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

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

@@ -0,0 +1,19 @@
+// 导入合并reducer的依赖
+import { combineReducers } from 'redux'
+
+// 导入 登录 模块的 reducer
+import A0Layout from './layout'
+import A1atlas from './A1atlas'
+import A2video from './A2video'
+import Z1user from './Z1user'
+
+// 合并 reducer
+const rootReducer = combineReducers({
+  A0Layout,
+  A1atlas,
+  A2video,
+  Z1user
+})
+
+// 默认导出
+export default rootReducer

+ 63 - 0
src/store/reducer/layout.ts

@@ -0,0 +1,63 @@
+import { LookDomType } from '@/types'
+import { MessageType } from '@/utils/message'
+
+// 初始化状态
+const initState = {
+  // 所有图片点击预览查看大图
+  lookBigImg: {
+    url: '',
+    show: false
+  },
+  // 查看视频、音频、模型
+  lookDom: {
+    src: '',
+    type: ''
+  } as LookDomType,
+
+  // antd轻提示(兼容360浏览器)
+  message: {
+    txt: '',
+    type: 'info',
+    duration: 3
+  } as MessageType,
+  // 上传文件点击取消
+  closeUpFile: {
+    fu: () => {},
+    state: false
+  }
+}
+
+// 定义 action 类型
+type LayoutActionType =
+  | { type: 'layout/lookBigImg'; payload: { url: string; show: boolean } }
+  | { type: 'layout/lookDom'; payload: LookDomType }
+  | { type: 'layout/message'; payload: MessageType }
+  | {
+      type: 'layout/closeUpFile'
+      payload: {
+        fu: () => void
+        state: boolean
+      }
+    }
+
+// 频道 reducer
+export default function layoutReducer(state = initState, action: LayoutActionType) {
+  switch (action.type) {
+    // 所有图片点击预览查看大图
+    case 'layout/lookBigImg':
+      return { ...state, lookBigImg: action.payload }
+    // 查看视频
+    case 'layout/lookDom':
+      return { ...state, lookDom: action.payload }
+
+    // antd轻提示(兼容360浏览器)
+    case 'layout/message':
+      return { ...state, message: action.payload }
+    // 上传文件点击取消
+    case 'layout/closeUpFile':
+      return { ...state, closeUpFile: action.payload }
+
+    default:
+      return state
+  }
+}

+ 31 - 0
src/types/api/Z1user.d.ts

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

+ 11 - 0
src/types/api/Z2log.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;
+}

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

@@ -0,0 +1,19 @@
+export type LookDomType = {
+  src: string
+  type: 'video' | 'audio' | 'model' | ''
+  flag?: boolean
+}
+
+export type RouterType = {
+  id: number
+  name: string
+  path: string
+  Com: React.LazyExoticComponent<React.MemoExoticComponent<() => JSX.Element>>
+}
+
+export type FileImgListType = {
+  id: number
+  fileName: string
+  filePath: string
+  type: 'img' | 'video' | 'doc'
+}

+ 11 - 0
src/types/declaration.d.ts

@@ -0,0 +1,11 @@
+declare module 'history'
+declare module '*.scss'
+declare module '*.png'
+declare module '*.jpg'
+declare module '*.gif'
+declare module '*.svg'
+declare module 'js-export-excel'
+declare module 'braft-utils'
+declare module 'file-saver'
+// declare module 'js-base64'
+// declare module 'classnames'

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

@@ -0,0 +1,3 @@
+export * from './api/layot'
+export * from './api/Z1user'
+export * from './api/Z2log'

+ 35 - 0
src/utils/domShow.ts

@@ -0,0 +1,35 @@
+import store from "@/store";
+
+// 加载和上传的盒子的显示隐藏
+export const domShowFu = (ele: string, val: boolean) => {
+  const dom: HTMLDivElement = document.querySelector(ele)!;
+  if (val) {
+    dom.style.opacity = "1";
+    dom.style.pointerEvents = "auto";
+  } else {
+    dom.style.opacity = "0";
+    dom.style.pointerEvents = "none";
+  }
+};
+
+// 上传附件的进度条
+let progressDom: HTMLDivElement = document.querySelector("#progress")!;
+export const progressDomFu = (val: string) => {
+  if (!progressDom) progressDom = document.querySelector("#progress")!;
+  progressDom.style.width = val;
+};
+
+// 上传附件的dom操作
+export const fileDomInitialFu = () => {
+  // 隐藏进度条的dom
+  domShowFu("#UpAsyncLoding", false);
+  progressDomFu("0%");
+  // 初始化 上传附件 的状态
+  setTimeout(() => {
+    if (store.getState().A0Layout.closeUpFile.state)
+      store.dispatch({
+        type: "layout/closeUpFile",
+        payload: { fu: () => {}, state: false },
+      });
+  }, 200);
+};

+ 31 - 0
src/utils/history.ts

@@ -0,0 +1,31 @@
+import { createHashHistory } from 'history'
+const history = createHashHistory()
+export default history
+
+// 权限失效,回登录页,带上回跳路径
+export const loginOutFu = () => {
+  const urlAll = window.location.href
+  const urlArr = urlAll.split('/#/')
+
+  if (!urlAll.includes('/login')) {
+    if (urlArr[1]) {
+      history.push(`/login?back=${urlArr[1]}`)
+    } else history.push('/login')
+  }
+}
+
+// 监听路由
+let routerLength = 0
+history.listen((_: any, listener: any) => {
+  if (listener === 'PUSH') {
+    routerLength += 1
+  } else if (listener === 'POP') {
+    if (routerLength >= 1) routerLength -= 1
+  }
+})
+
+// 点击返回
+export const backPageFu = (path: string) => {
+  if (routerLength) history.go(-1)
+  else history.push(path)
+}

+ 106 - 0
src/utils/http.ts

@@ -0,0 +1,106 @@
+import axios from 'axios'
+import { loginOutFu } from './history'
+import { getTokenInfo, removeTokenInfo } from './storage'
+import store from '@/store'
+import { MessageFu } from './message'
+import { domShowFu } from './domShow'
+
+export const envFlag = process.env.NODE_ENV === 'development'
+
+const baseUrlTemp = 'https://sit-taiyuanczb.4dage.com' // 测试环境
+// const baseUrlTemp = 'http://192.168.20.61:8110' // 线下环境
+
+const baseFlag = baseUrlTemp.includes('https://')
+
+// 请求基地址
+export const baseURL = envFlag ? `${baseUrlTemp}${baseFlag ? '' : '/api'}` : ''
+
+// 处理  类型“AxiosResponse<any, any>”上不存在属性“code”
+declare module 'axios' {
+  interface AxiosResponse {
+    code: number
+    timestamp: string
+    // 这里追加你的参数
+  }
+}
+
+// 创建 axios 实例
+const http = axios.create({
+  baseURL: `${baseURL}${baseFlag ? '/api/' : ''}`,
+  timeout: 30000
+})
+
+let axajInd = 0
+
+// 请求拦截器
+http.interceptors.request.use(
+  function (config: any) {
+    // 发请求前打开加载提示
+    domShowFu('#AsyncSpinLoding', true)
+
+    axajInd++
+
+    const { token } = getTokenInfo()
+    if (token) config.headers.satoken = token
+    return config
+  },
+  function (err) {
+    return Promise.reject(err)
+  }
+)
+
+let timeId = -1
+
+// 响应拦截器
+http.interceptors.response.use(
+  function (response) {
+    // 请求回来的关闭加载提示
+    axajInd--
+    if (axajInd === 0) {
+      domShowFu('#AsyncSpinLoding', false)
+    }
+    if (response.data.code === 401) {
+      removeTokenInfo()
+      loginOutFu()
+      clearTimeout(timeId)
+      timeId = window.setTimeout(() => {
+        MessageFu.warning('登录超时!')
+      }, 200)
+    } else if (response.data.code === 0) {
+      // MessageFu.success(response.data.msg);
+    } else if (response.data.code !== 3014) MessageFu.warning(response.data.msg)
+
+    return response.data
+  },
+  async function (err) {
+    clearTimeout(timeId)
+    timeId = window.setTimeout(() => {
+      axajInd = 0
+      domShowFu('#AsyncSpinLoding', false)
+      // 如果因为网络原因,response没有,给提示消息
+      if (!err.response) {
+        if (store.getState().A0Layout.closeUpFile.state) MessageFu.warning('取消上传!')
+        else MessageFu.error('网络繁忙,请稍后重试!')
+      } else {
+        if (
+          err.response &&
+          err.response.data &&
+          err.response.data.msg &&
+          err.response.data.msg.length < 30
+        ) {
+          MessageFu.error(err.response.data.msg)
+          // 没有权限
+          if (err.response.data.code === 401) {
+            removeTokenInfo()
+            loginOutFu()
+          }
+        } else MessageFu.error('响应错误,请联系管理员!')
+      }
+    }, 100)
+
+    return Promise.reject(err)
+  }
+)
+
+// 导出 axios 实例
+export default http

+ 50 - 0
src/utils/message.ts

@@ -0,0 +1,50 @@
+import store from "@/store";
+
+export type MessageType = {
+  txt: string;
+  type: "info" | "success" | "error" | "warning";
+  duration: number;
+};
+
+export const MessageFu = {
+  info: (txt: string, duration?: number) => {
+    store.dispatch({
+      type: "layout/message",
+      payload: {
+        txt,
+        type: "info",
+        duration: duration === undefined ? 3 : duration,
+      },
+    });
+  },
+  success: (txt: string, duration?: number) => {
+    store.dispatch({
+      type: "layout/message",
+      payload: {
+        txt,
+        type: "success",
+        duration: duration === undefined ? 3 : duration,
+      },
+    });
+  },
+  error: (txt: string, duration?: number) => {
+    store.dispatch({
+      type: "layout/message",
+      payload: {
+        txt,
+        type: "error",
+        duration: duration === undefined ? 3 : duration,
+      },
+    });
+  },
+  warning: (txt: string, duration?: number) => {
+    store.dispatch({
+      type: "layout/message",
+      payload: {
+        txt,
+        type: "warning",
+        duration: duration === undefined ? 3 : duration,
+      },
+    });
+  },
+};

+ 100 - 0
src/utils/pass.ts

@@ -0,0 +1,100 @@
+function randomWord(randomFlag: boolean, min: number, max: number = 15) {
+  let str = "";
+  let range = min;
+  const arr = [
+    "0",
+    "1",
+    "2",
+    "3",
+    "4",
+    "5",
+    "6",
+    "7",
+    "8",
+    "9",
+    "a",
+    "b",
+    "c",
+    "d",
+    "e",
+    "f",
+    "g",
+    "h",
+    "i",
+    "j",
+    "k",
+    "l",
+    "m",
+    "n",
+    "o",
+    "p",
+    "q",
+    "r",
+    "s",
+    "t",
+    "u",
+    "v",
+    "w",
+    "x",
+    "y",
+    "z",
+    "A",
+    "B",
+    "C",
+    "D",
+    "E",
+    "F",
+    "G",
+    "H",
+    "I",
+    "J",
+    "K",
+    "L",
+    "M",
+    "N",
+    "O",
+    "P",
+    "Q",
+    "R",
+    "S",
+    "T",
+    "U",
+    "V",
+    "W",
+    "X",
+    "Y",
+    "Z",
+  ];
+  // 随机产生
+  if (randomFlag) {
+    range = Math.round(Math.random() * (max - min)) + min;
+  }
+  for (var i = 0; i < range; i++) {
+    const pos = Math.round(Math.random() * (arr.length - 1));
+    str += arr[pos];
+  }
+  return str;
+}
+
+const encodeStr = (str: string, strv = "") => {
+  const NUM = 2;
+  const front = randomWord(false, 8);
+  const middle = randomWord(false, 8);
+  const end = randomWord(false, 8);
+
+  const str1 = str.substring(0, NUM);
+  const str2 = str.substring(NUM);
+
+  if (strv) {
+    const strv1 = strv.substring(0, NUM);
+    const strv2 = strv.substring(NUM);
+    return [
+      front + str2 + middle + str1 + end,
+      front + strv2 + middle + strv1 + end,
+    ];
+  }
+
+  return front + str2 + middle + str1 + end;
+};
+
+export default encodeStr;

+ 40 - 0
src/utils/storage.ts

@@ -0,0 +1,40 @@
+// ------------------------------------token的本地存储------------------------------------
+
+// 用户 Token 的本地缓存键名,自己定义
+const TOKEN_KEY = 'CHENG_ZHE_BEI_HOUTAI_USETINFO'
+
+/**
+ * 从本地缓存中获取 用户 信息
+ */
+export const getTokenInfo = (): any => {
+  return JSON.parse(localStorage.getItem(TOKEN_KEY) || '{}')
+}
+
+/**
+ * 将 用户 信息存入缓存
+ * @param {Object} tokenInfo 从后端获取到的 Token 信息
+ */
+export const setTokenInfo = (tokenInfo: any): void => {
+  localStorage.setItem(TOKEN_KEY, JSON.stringify(tokenInfo))
+}
+
+/**
+ * 删除本地缓存中的 用户 信息
+ */
+export const removeTokenInfo = (): void => {
+  localStorage.removeItem(TOKEN_KEY)
+}
+
+/**
+ * 判断本地缓存中是否存在 Token 信息
+ */
+export const hasToken = (): boolean => {
+  return Boolean(getTokenInfo().token)
+}
+
+/**
+ * 获取本地缓存中是否存在 Token 信息
+ */
+export const getTokenFu = (): string => {
+  return getTokenInfo().token
+}

+ 22 - 0
src/utils/tableData.ts

@@ -0,0 +1,22 @@
+/**
+ * index:序号
+ * txt:正常数据
+ * img:图片
+ * txtChange:判断显示不同字段
+ * text:文字比较多的情况、获取使用其他标签(没有的需要自己配置)
+ */
+// export const A1tableCFu = (type: "video" | "poster") => {
+//   return [
+//     ["index", "序号"],
+//     ["txt", "标题", "name"]
+//     ["img", type === "video" ? "视频封面" : "海报", "thumb"],
+//     ["txtChange", "自动播放", "display", { 0: "否", 1: "是" }],
+//     ["text", "创建日期",'description', 50,A],
+//   ];
+
+export const Z1tableC = [
+  ['txt', '用户名', 'userName'],
+  ['txt', '角色', 'roleName'],
+  ['txt', '真实姓名', 'realName'],
+  ['txt', '创建日期', 'createTime']
+]

+ 27 - 0
tsconfig.json

@@ -0,0 +1,27 @@
+{
+  "extends": "./path.tsconfig.json",
+  "compilerOptions": {
+    "target": "es5",
+    "lib": [
+      "dom",
+      "dom.iterable",
+      "esnext"
+    ],
+    "allowJs": true,
+    "skipLibCheck": true,
+    "esModuleInterop": true,
+    "allowSyntheticDefaultImports": true,
+    "strict": true,
+    "forceConsistentCasingInFileNames": true,
+    "noFallthroughCasesInSwitch": true,
+    "module": "esnext",
+    "moduleResolution": "node",
+    "resolveJsonModule": true,
+    "isolatedModules": true,
+    "noEmit": true,
+    "jsx": "react-jsx",
+  },
+  "include": [
+    "src"
+  ]
+}

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 11237 - 0
yarn.lock