shaogen1995 1 тиждень тому
коміт
0b437cd456
61 змінених файлів з 43695 додано та 0 видалено
  1. 12 0
      code/.editorconfig
  2. 3 0
      code/.env
  3. 23 0
      code/.gitignore
  4. 11 0
      code/.prettierrc.js
  5. 39 0
      code/.vscode/settings.json
  6. 2 0
      code/README.md
  7. 10 0
      code/config-overrides.js
  8. 30738 0
      code/package-lock.json
  9. 71 0
      code/package.json
  10. 8 0
      code/path.tsconfig.json
  11. 33 0
      code/public/index.html
  12. 2 0
      code/public/myData/data.js
  13. 74 0
      code/src/App.tsx
  14. BIN
      code/src/assets/img/IMGerror.png
  15. BIN
      code/src/assets/img/flooImg.jpg
  16. BIN
      code/src/assets/img/landtip.png
  17. BIN
      code/src/assets/img/loading.gif
  18. BIN
      code/src/assets/img/logo.png
  19. 225 0
      code/src/assets/styles/base.css
  20. 342 0
      code/src/assets/styles/base.less
  21. 21 0
      code/src/components/AsyncSpinLoding/index.module.scss
  22. 15 0
      code/src/components/AsyncSpinLoding/index.tsx
  23. 29 0
      code/src/components/Message/index.tsx
  24. 48 0
      code/src/components/MyPopconfirm.tsx
  25. 26 0
      code/src/components/NotFound/index.tsx
  26. 10 0
      code/src/components/SpinLoding/index.module.scss
  27. 13 0
      code/src/components/SpinLoding/index.tsx
  28. 38 0
      code/src/index.tsx
  29. 11 0
      code/src/pages/A0model/A0btn/index.module.scss
  30. 25 0
      code/src/pages/A0model/A0btn/index.tsx
  31. 145 0
      code/src/pages/A0model/Model.tsx
  32. 30 0
      code/src/pages/A0model/SceneSetup.tsx
  33. 19 0
      code/src/pages/A0model/index.module.scss
  34. 44 0
      code/src/pages/A0model/index.tsx
  35. 4 0
      code/src/pages/A1home/index.module.scss
  36. 13 0
      code/src/pages/A1home/index.tsx
  37. 248 0
      code/src/pages/aaaa.tsx
  38. 5 0
      code/src/pages/初始化组件/index.module.scss
  39. 14 0
      code/src/pages/初始化组件/index.tsx
  40. 30 0
      code/src/store/action/A1list.ts
  41. 28 0
      code/src/store/action/layout.ts
  42. 20 0
      code/src/store/index.ts
  43. 29 0
      code/src/store/reducer/A0model.ts
  44. 15 0
      code/src/store/reducer/index.ts
  45. 65 0
      code/src/store/reducer/layout.ts
  46. 31 0
      code/src/types/api/layot.d.ts
  47. 11 0
      code/src/types/declaration.d.ts
  48. 1 0
      code/src/types/index.d.ts
  49. 35 0
      code/src/utils/domShow.ts
  50. 14 0
      code/src/utils/history.ts
  51. 109 0
      code/src/utils/http.ts
  52. 50 0
      code/src/utils/message.ts
  53. 100 0
      code/src/utils/pass.ts
  54. 40 0
      code/src/utils/storage.ts
  55. 24 0
      code/src/utils/tableData.ts
  56. 27 0
      code/tsconfig.json
  57. 10715 0
      code/yarn.lock
  58. BIN
      静态资源/staticData/0/0_bac.jpg
  59. BIN
      静态资源/staticData/0/model.glb
  60. BIN
      静态资源/staticData/1/1_bac.jpg
  61. BIN
      静态资源/staticData/1/1_bs.png

+ 12 - 0
code/.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
code/.env

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

+ 23 - 0
code/.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
code/.prettierrc.js

@@ -0,0 +1,11 @@
+module.exports = {
+  printWidth: 90, // 一行的字符数,如果超过会进行换行
+  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
code/.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
+}

+ 2 - 0
code/README.md

@@ -0,0 +1,2 @@
+1.使用 yarn。 npm有问题
+

+ 10 - 0
code/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)

Різницю між файлами не показано, бо вона завелика
+ 30738 - 0
code/package-lock.json


+ 71 - 0
code/package.json

@@ -0,0 +1,71 @@
+{
+  "name": "demo2",
+  "version": "0.1.0",
+  "private": true,
+  "dependencies": {
+    "@ant-design/cssinjs": "^1.5.6",
+    "@react-three/drei": "^10.7.6",
+    "@react-three/fiber": "^9.3.0",
+    "@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": "^19.1.13",
+    "@types/react-dom": "^19.1.9",
+    "@types/three": "^0.180.0",
+    "@zxing/library": "^0.21.3",
+    "antd": "^5.27.4",
+    "antd-mobile": "^5.30.0",
+    "axios": "^1.1.3",
+    "braft-editor": "^2.3.9",
+    "braft-utils": "^3.0.12",
+    "dayjs": "^1.11.10",
+    "js-base64": "^3.7.3",
+    "react": "^19.1.1",
+    "react-countup": "^6.5.3",
+    "react-dom": "^19.1.1",
+    "react-redux": "^9.2.0",
+    "react-router-dom": "^7.9.2",
+    "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",
+    "three": "^0.180.0",
+    "typescript": "^4.8.4",
+    "web-vitals": "^2.1.4"
+  },
+  "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
code/path.tsconfig.json

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

+ 33 - 0
code/public/index.html

@@ -0,0 +1,33 @@
+<!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" />
+    <meta
+      name="viewport"
+      content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"
+    />
+    <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
+    <!-- <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" /> -->
+    <script src="./myData/data.js"></script>
+
+    <title>楚国第一玉剑数字展</title>
+  </head>
+  <body>
+    <noscript>You need to enable JavaScript to run this app.</noscript>
+    <div id="root"></div>
+  </body>
+
+  <!-- <script>
+    window.onload = function () {
+      var script = document.createElement('script')
+      script.src = 'https://cdn.bootcss.com/eruda/1.5.4/eruda.min.js'
+      document.body.appendChild(script)
+      script.onload = function () {
+        eruda.init()
+      }
+    }
+  </script> -->
+</html>

+ 2 - 0
code/public/myData/data.js

@@ -0,0 +1,2 @@
+// const serverUrlTemp = 'http://192.168.20.55:8080/staticData/'
+const serverUrl = 'http://192.168.20.55:8080/staticData/'

+ 74 - 0
code/src/App.tsx

@@ -0,0 +1,74 @@
+import '@/assets/styles/base.css'
+// 关于路由
+import React, { useCallback, useEffect } from 'react'
+import { createBrowserRouter, RouterProvider } from 'react-router-dom'
+import { isMobileFu } from './utils/history'
+import SpinLoding from './components/SpinLoding'
+import AsyncSpinLoding from './components/AsyncSpinLoding'
+
+import MessageCom from './components/Message'
+
+import screenImg from '@/assets/img/landtip.png'
+import A0model from './pages/A0model'
+
+const A1home = React.lazy(() => import('./pages/A1home'))
+
+export default function App() {
+  // 从仓库中获取查看图片的信息
+  // const lookBigImg = useSelector((state: RootState) => state.A0Layout.lookBigImg)
+
+  const rootDomFu = useCallback(() => {
+    const rootDom: HTMLDivElement = document.querySelector('#root')!
+    if (rootDom) {
+      rootDom.style.height = window.innerHeight + 'px'
+    }
+  }, [])
+
+  useEffect(() => {
+    window.addEventListener('resize', rootDomFu, true)
+    rootDomFu()
+  }, [rootDomFu])
+
+  const router = createBrowserRouter([
+    {
+      path: '/',
+      element: <A1home />
+      // loader: homeLoaderFunction,
+    }
+    // {
+    //   path: '/codeSucc/:id',
+    //   element: <A3codeSucc />,
+    //   // loader: codeSuccLoaderFunction, // 同样可以配置数据加载器
+    // },
+  ])
+
+  return (
+    <>
+      {/* 关于路由 */}
+
+      <React.Suspense fallback={<SpinLoding />}>
+        <RouterProvider
+          router={router}
+          fallbackElement={<SpinLoding />} // 路由自身懒加载时的回退UI
+        />
+      </React.Suspense>
+
+      {/* 发送请求的加载组件 */}
+      <AsyncSpinLoding />
+
+      {/* antd 轻提示 ---兼容360浏览器 */}
+      <MessageCom />
+
+      {/* 模型页面 */}
+      <A0model />
+
+      {/* 横屏提示 */}
+      {isMobileFu() ? (
+        <div id='ScreenChange'>
+          <img src={screenImg} alt='' />
+          <p>请在竖屏模式浏览</p>
+        </div>
+      ) : null}
+    </>
+  )
+}

BIN
code/src/assets/img/IMGerror.png


BIN
code/src/assets/img/flooImg.jpg


BIN
code/src/assets/img/landtip.png


BIN
code/src/assets/img/loading.gif


BIN
code/src/assets/img/logo.png


+ 225 - 0
code/src/assets/styles/base.css

@@ -0,0 +1,225 @@
+* {
+  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;
+}
+ul {
+  list-style: none;
+}
+body {
+  overflow: auto;
+  overflow-y: overlay;
+}
+/* 文本域取消下拉 */
+textarea {
+  resize: none !important;
+  min-height: 100px !important;
+}
+/* 主题色 */
+:root {
+  --themeColor: #fce9ac;
+  --themeColor2: #fffddc;
+}
+/* 找不到页面 */
+.noFindPage {
+  opacity: 0;
+  transition: opacity 0.5s;
+}
+/* 兼容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 {
+  max-width: 500px;
+  margin: 0 auto;
+  width: 100vw;
+  height: 100vh;
+  overflow: auto;
+  overflow-y: overlay;
+  position: relative;
+  /* 普通文字按钮的颜色 */
+  /* 按钮的危险颜色 */
+  /* antd分页器样式 */
+  /* 表格的图片居中 */
+  /* antd图片预览组件 */
+  /* antd表格居中 */
+}
+#root > div {
+  width: 100%;
+  height: 100%;
+}
+#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;
+}
+.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;
+}
+.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;
+}
+.ant-notification-notice {
+  max-height: 500px !important;
+  overflow-y: auto !important;
+}
+.ant-picker-dropdown {
+  text-align: center;
+}
+.ant-picker-selection-item-remove {
+  display: none !important;
+}
+#ScreenChange {
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  z-index: 10000;
+  background-color: rgba(0, 0, 0, 0.8);
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+  opacity: 0;
+  pointer-events: none;
+  transition: all 0.5s;
+}
+#ScreenChange > img {
+  width: 200px;
+}
+#ScreenChange > p {
+  margin-top: 20px;
+  color: #fff;
+  font-size: 18px;
+  height: 40px;
+}
+/*横屏*/
+@media screen and (orientation: landscape) {
+  #ScreenChange {
+    opacity: 1;
+    pointer-events: auto;
+  }
+}

+ 342 - 0
code/src/assets/styles/base.less

@@ -0,0 +1,342 @@
+* {
+  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: #fce9ac;
+  --themeColor2: #fffddc;
+}
+
+/* 找不到页面 */
+.noFindPage {
+  opacity: 0;
+  transition: opacity 0.5s;
+}
+
+/* 兼容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 {
+  max-width: 500px;
+  margin: 0 auto;
+  width: 100vw;
+  height: 100vh;
+  overflow: auto;
+  overflow-y: overlay;
+  position: relative;
+
+  & > div {
+    width: 100%;
+    height: 100%;
+  }
+
+  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;
+
+  &::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;
+}
+
+.ant-notification-notice {
+  max-height: 500px !important;
+  overflow-y: auto !important;
+}
+
+// 多日期选择器居中 挡住 按钮(即必须失焦才能点击确定)
+.ant-picker-dropdown {
+  text-align: center;
+}
+.ant-picker-selection-item-remove {
+  display: none !important;
+}
+// .ant-picker-year-btn,
+// .ant-picker-header-super-prev-btn,
+// .ant-picker-header-super-next-btn {
+//   display: none;
+// }
+
+// 横屏 竖屏的切换
+#ScreenChange {
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  z-index: 10000;
+  background-color: rgba(0, 0, 0, 0.8);
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+  opacity: 0;
+  pointer-events: none;
+  transition: all 0.5s;
+
+  & > img {
+    width: 200px;
+  }
+
+  & > p {
+    margin-top: 20px;
+    color: #fff;
+    font-size: 18px;
+    height: 40px;
+  }
+}
+
+/*横屏*/
+@media screen and (orientation: landscape) {
+  #ScreenChange {
+    opacity: 1;
+    pointer-events: auto;
+  }
+}

+ 21 - 0
code/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
code/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;

+ 29 - 0
code/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;

+ 48 - 0
code/src/components/MyPopconfirm.tsx

@@ -0,0 +1,48 @@
+import React, { useMemo } from 'react'
+import { Button, Popconfirm } from 'antd'
+
+type Props = {
+  txtK: '删除' | '取消' | '重置密码' | '退出登录' | '清空' | '取消认证'
+  onConfirm: () => void
+  Dom?: React.ReactNode
+  loc?: 'bottom'
+}
+
+function MyPopconfirm({ txtK, onConfirm, Dom, loc }: Props) {
+  const txt = useMemo(() => {
+    const obj = {
+      删除: ['删除后无法恢复,是否删除?', '删除'],
+      取消: ['放弃编辑后,信息将不会保存!', '放弃'],
+      重置密码: ['密码重制后为123456,是否重置?', '重置'],
+      退出登录: ['确定退出吗?', '确定'],
+      清空: ['确定清空吗?', '确定'],
+      取消认证: ['是否移除该用户的团队认证资格及信息?', '移除']
+    }
+    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

+ 26 - 0
code/src/components/NotFound/index.tsx

@@ -0,0 +1,26 @@
+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>
+  );
+}

+ 10 - 0
code/src/components/SpinLoding/index.module.scss

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

+ 13 - 0
code/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;

+ 38 - 0
code/src/index.tsx

@@ -0,0 +1,38 @@
+// 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: '#FCE9AC'
+      }
+    }}
+  >
+    <Provider store={store}>
+      <StyleProvider
+        hashPriority='high'
+        transformers={[legacyLogicalPropertiesTransformer]}
+      >
+        <App />
+      </StyleProvider>
+    </Provider>
+  </ConfigProvider>
+)

+ 11 - 0
code/src/pages/A0model/A0btn/index.module.scss

@@ -0,0 +1,11 @@
+.A0btn {
+  position: absolute;
+  bottom: 20px;
+  left: 0;
+  right: 0;
+  display: 'flex';
+  justify-content: center;
+  gap: '10px';
+  :global {
+  }
+}

+ 25 - 0
code/src/pages/A0model/A0btn/index.tsx

@@ -0,0 +1,25 @@
+import React from 'react'
+import styles from './index.module.scss'
+function A0btn() {
+  return (
+    <div className={styles.A0btn}>
+      4546
+      {/* <button onClick={() => focusOnPart('bs1')} style={{ padding: '10px' }}>
+        显示 BS1
+      </button>
+      <button onClick={() => focusOnPart('bs2')} style={{ padding: '10px' }}>
+        显示 BS2
+      </button>
+      <button onClick={() => focusOnPart('bs3')} style={{ padding: '10px' }}>
+        显示 BS3
+      </button>
+      <button onClick={showAllModels} style={{ padding: '10px' }}>
+        显示全部
+      </button> */}
+    </div>
+  )
+}
+
+const MemoA0btn = React.memo(A0btn)
+
+export default MemoA0btn

+ 145 - 0
code/src/pages/A0model/Model.tsx

@@ -0,0 +1,145 @@
+import { useThree } from '@react-three/fiber'
+import React, { useCallback, useEffect, useRef, useState } from 'react'
+import * as THREE from 'three'
+import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader'
+import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader'
+
+function Model() {
+  const groupRef = useRef<THREE.Group>(null)
+  const [loadingProgress, setLoadingProgress] = useState(0)
+  const [model, setModel] = useState<THREE.Group | null>(null)
+  const [modelParts, setModelParts] = useState<{ [name: string]: THREE.Object3D }>({})
+  const [activePart, setActivePart] = useState<string | null>(null)
+  const { camera, scene } = useThree()
+
+  const handleModelLoaded = useCallback(
+    (loadedModel: THREE.Group, parts: { [name: string]: THREE.Object3D }) => {
+      setModel(loadedModel)
+      setModelParts(parts)
+      // 初始状态下显示所有模型
+      Object.values(parts).forEach(part => {
+        part.visible = true
+      })
+      scene.add(loadedModel)
+    },
+    [scene]
+  )
+
+  useEffect(() => {
+    const manager = new THREE.LoadingManager()
+    manager.onProgress = (url, itemsLoaded, itemsTotal) => {
+      setLoadingProgress((itemsLoaded / itemsTotal) * 100)
+    }
+
+    const dracoLoader = new DRACOLoader()
+    dracoLoader.setDecoderPath('https://www.gstatic.com/draco/v1/decoders/')
+    dracoLoader.setDecoderConfig({ type: 'js' })
+
+    const loader = new GLTFLoader(manager)
+    loader.setDRACOLoader(dracoLoader)
+
+    loader.load(
+      `${serverUrl}/0/model.glb`, // 替换为你的GLB模型路径
+      gltf => {
+        const model = gltf.scene
+
+        // 设置模型初始位置 (x, y, z)
+        model.position.set(0, 0, 0) // 设置为场景原点
+
+        // // 设置模型初始缩放 (x, y, z)
+        model.scale.set(0.003, 0.003, 0.003) // 原始大小设
+
+        // // 设置模型初始旋转(单位:弧度)(x, y, z)
+        model.rotation.set(0, 0, 0) // 例如,不旋转。绕Y轴旋转90度可设为(0, Math.PI / 2, 0)
+
+        model.traverse((child: any) => {
+          if (child.isMesh) {
+            child.castShadow = true
+            child.receiveShadow = true
+          }
+        })
+
+        // 3. 假设模型中的三个部分分别命名为'bs1', 'bs2', 'bs3'
+        const parts: { [name: string]: THREE.Object3D } = {}
+        model.children.forEach(child => {
+          if (['bs1', 'bs2', 'bs3'].includes(child.name)) {
+            parts[child.name] = child
+          }
+        })
+
+        setModelParts(parts)
+        handleModelLoaded(model, parts)
+      },
+      xhr => {
+        // 加载进度回调已在LoadingManager中处理
+      },
+      error => {
+        console.error('加载模型出错:', error)
+      }
+    )
+  }, [handleModelLoaded])
+
+  // 点击不同部位
+  const focusOnPart = useCallback(
+    (partName: string) => {
+      if (!model || !modelParts[partName]) return
+
+      // 隐藏所有部分,然后显示选中的部分
+      Object.entries(modelParts).forEach(([name, part]) => {
+        part.visible = name === partName
+      })
+
+      // 获取选中部分的包围盒并居中相机
+      const bbox = new THREE.Box3().setFromObject(modelParts[partName])
+      const center = bbox.getCenter(new THREE.Vector3())
+      const size = bbox.getSize(new THREE.Vector3())
+
+      // 计算相机位置,使其能够完整看到模型
+      const maxDim = Math.max(size.x, size.y, size.z)
+      const fov =
+        camera instanceof THREE.PerspectiveCamera ? (camera.fov * Math.PI) / 180 : 0
+      const cameraDistance = maxDim / (2 * Math.tan(fov / 2))
+
+      camera.position.copy(
+        center.clone().add(new THREE.Vector3(0, 0, cameraDistance * 1.5))
+      )
+      camera.lookAt(center)
+
+      setActivePart(partName)
+    },
+    [camera, model, modelParts]
+  )
+
+  // 显示全部模型
+  const showAllModels = useCallback(() => {
+    if (!model) return
+
+    // 显示所有模型部分
+    Object.values(modelParts).forEach(part => {
+      part.visible = true
+    })
+
+    // 将相机定位到整个模型的中心
+    const bbox = new THREE.Box3().setFromObject(model)
+    const center = bbox.getCenter(new THREE.Vector3())
+    const size = bbox.getSize(new THREE.Vector3())
+
+    const maxDim = Math.max(size.x, size.y, size.z)
+    const fov =
+      camera instanceof THREE.PerspectiveCamera ? (camera.fov * Math.PI) / 180 : 0
+    const cameraDistance = maxDim / (2 * Math.tan(fov / 2))
+
+    camera.position.copy(
+      center.clone().add(new THREE.Vector3(0, 0, cameraDistance * 1.5))
+    )
+    camera.lookAt(center)
+
+    setActivePart(null)
+  }, [camera, model, modelParts])
+
+  return <>{groupRef.current ? <primitive object={groupRef.current} /> : null}</>
+}
+
+const MemoModel = React.memo(Model)
+
+export default MemoModel

+ 30 - 0
code/src/pages/A0model/SceneSetup.tsx

@@ -0,0 +1,30 @@
+import React, { useRef } from 'react'
+import { useFrame } from '@react-three/fiber'
+import { OrbitControls } from '@react-three/drei'
+function SceneSetup() {
+  const controlsRef = useRef<any>(null)
+  useFrame(() => {
+    if (controlsRef.current) {
+      controlsRef.current.update() // 启用阻尼效果必须每帧更新控制器
+    }
+  })
+
+  return (
+    <>
+      <ambientLight intensity={4} />
+      <directionalLight position={[10, 10, 10]} intensity={2} castShadow />
+      <OrbitControls
+        ref={controlsRef}
+        enableDamping={true} // 启用阻尼效果
+        dampingFactor={0.05} // 阻尼系数[7](@ref)
+        maxDistance={2} // 根据初始缩放比例调整
+        minDistance={0.5} // 根据初始缩放比例调整[9](@ref)
+        screenSpacePanning={true} // 移动端友好的平移方式
+      />
+    </>
+  )
+}
+
+const MemoSceneSetup = React.memo(SceneSetup)
+
+export default MemoSceneSetup

+ 19 - 0
code/src/pages/A0model/index.module.scss

@@ -0,0 +1,19 @@
+.A0model {
+  opacity: 0;
+  pointer-events: none;
+  transition: all 0.3s;
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  z-index: 99;
+  background-size: 100% 100%;
+  :global {
+  }
+}
+
+.A0modelShow {
+  opacity: 1;
+  pointer-events: auto;
+}

+ 44 - 0
code/src/pages/A0model/index.tsx

@@ -0,0 +1,44 @@
+import React, { Suspense } from 'react'
+import styles from './index.module.scss'
+import { useSelector } from 'react-redux'
+import { RootState } from '@/store'
+import classNames from 'classnames'
+// import * as THREE from 'three'
+import { Canvas } from '@react-three/fiber'
+import SceneSetup from './SceneSetup'
+import Model from './Model'
+import A0btn from './A0btn'
+
+function A0model() {
+  const { isShow } = useSelector((state: RootState) => state.A0model)
+
+  return (
+    <div
+      style={{ backgroundImage: `url(${serverUrl}0/0_bac.jpg)` }}
+      className={classNames(styles.A0model, isShow ? styles.A0modelShow : '')}
+    >
+      <Canvas
+        shadows
+        camera={{ position: [0, 1000, 5], fov: 50 }}
+        gl={{
+          antialias: true, // 开启抗锯齿,使边缘更平滑
+          alpha: true // 允许 Canvas 背景透明
+        }}
+        // onCreated={({ gl }) => {
+        //   gl.setClearColor(new THREE.Color(0x000000))
+        // }}
+      >
+        <Suspense>
+          {/* 场景与控制器 */}
+          <SceneSetup />
+          <Model />
+        </Suspense>
+      </Canvas>
+
+      <A0btn />
+    </div>
+  )
+}
+const MemoA0model = React.memo(A0model)
+
+export default MemoA0model

+ 4 - 0
code/src/pages/A1home/index.module.scss

@@ -0,0 +1,4 @@
+.A1home {
+  :global {
+  }
+}

+ 13 - 0
code/src/pages/A1home/index.tsx

@@ -0,0 +1,13 @@
+import React from 'react'
+import styles from './index.module.scss'
+function A1home() {
+  return (
+    <div className={styles.A1home}>
+      <h1>A1home</h1>
+    </div>
+  )
+}
+
+const MemoA1home = React.memo(A1home)
+
+export default MemoA1home

+ 248 - 0
code/src/pages/aaaa.tsx

@@ -0,0 +1,248 @@
+// `#{serverUrl}0/model.glb`
+// <div className={classNames(styles.A0model, isShow ? styles.A0modelShow : '')}>
+import React, { useRef, useState, useEffect, Suspense } from 'react'
+import * as THREE from 'three'
+import { Canvas, useThree, useFrame } from '@react-three/fiber'
+import { OrbitControls, useProgress, Html, Loader } from '@react-three/drei'
+import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader'
+import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader'
+
+// 1. 加载进度条组件
+function LoadProgress() {
+  const { progress } = useProgress()
+  return (
+    <Html center>
+      <div style={{ color: 'white', fontSize: '14px' }}>
+        加载中: {progress.toFixed(2)}%
+      </div>
+    </Html>
+  )
+}
+// 2. 模型组件
+interface ModelProps {
+  onLoaded: (model: THREE.Group, parts: { [name: string]: THREE.Object3D }) => void
+  onProgress: (progress: number) => void
+}
+
+const Model: React.FC<ModelProps> = ({ onLoaded, onProgress }) => {
+  const groupRef = useRef<THREE.Group>(null)
+  const [modelParts, setModelParts] = useState<{ [name: string]: THREE.Object3D }>({})
+
+  useEffect(() => {
+    const manager = new THREE.LoadingManager()
+    manager.onProgress = (url, itemsLoaded, itemsTotal) => {
+      onProgress((itemsLoaded / itemsTotal) * 100)
+    }
+
+    const dracoLoader = new DRACOLoader()
+    dracoLoader.setDecoderPath('https://www.gstatic.com/draco/v1/decoders/')
+    dracoLoader.setDecoderConfig({ type: 'js' })
+
+    const loader = new GLTFLoader(manager)
+    loader.setDRACOLoader(dracoLoader)
+
+    loader.load(
+      '/path/to/your/model.glb', // 替换为你的GLB模型路径
+      gltf => {
+        const model = gltf.scene
+        model.traverse((child: any) => {
+          if (child.isMesh) {
+            child.castShadow = true
+            child.receiveShadow = true
+          }
+        })
+
+        // 3. 假设模型中的三个部分分别命名为'bs1', 'bs2', 'bs3'
+        const parts: { [name: string]: THREE.Object3D } = {}
+        model.children.forEach(child => {
+          if (['bs1', 'bs2', 'bs3'].includes(child.name)) {
+            parts[child.name] = child
+          }
+        })
+
+        setModelParts(parts)
+        onLoaded(model, parts)
+      },
+      xhr => {
+        // 加载进度回调已在LoadingManager中处理
+      },
+      error => {
+        console.error('加载模型出错:', error)
+      }
+    )
+  }, [onLoaded, onProgress])
+
+  return groupRef.current ? <primitive object={groupRef.current} /> : null
+}
+
+// 4. 场景设置与控制器组件
+function SceneSetup() {
+  const { camera, gl } = useThree()
+  const controlsRef = useRef<any>(null)
+
+  useFrame(() => {
+    if (controlsRef.current) {
+      controlsRef.current.update() // 启用阻尼效果必须每帧更新控制器
+    }
+  })
+
+  return (
+    <>
+      <ambientLight intensity={0.5} />
+      <directionalLight position={[10, 10, 5]} intensity={1} castShadow />
+      <OrbitControls
+        ref={controlsRef}
+        enableDamping={true} // 启用阻尼效果
+        dampingFactor={0.05} // 阻尼系数[7](@ref)
+        maxDistance={2} // 根据初始缩放比例调整
+        minDistance={0.5} // 根据初始缩放比例调整[9](@ref)
+        screenSpacePanning={true} // 移动端友好的平移方式
+      />
+    </>
+  )
+}
+
+// 5. 主组件
+const GLBModelViewer: React.FC = () => {
+  const [loadingProgress, setLoadingProgress] = useState(0)
+  const [model, setModel] = useState<THREE.Group | null>(null)
+  const [modelParts, setModelParts] = useState<{ [name: string]: THREE.Object3D }>({})
+  const [activePart, setActivePart] = useState<string | null>(null)
+  const { camera, scene } = useThree()
+
+  const handleModelLoaded = (
+    loadedModel: THREE.Group,
+    parts: { [name: string]: THREE.Object3D }
+  ) => {
+    setModel(loadedModel)
+    setModelParts(parts)
+    // 初始状态下显示所有模型
+    Object.values(parts).forEach(part => {
+      part.visible = true
+    })
+    scene.add(loadedModel)
+  }
+
+  const focusOnPart = (partName: string) => {
+    if (!model || !modelParts[partName]) return
+
+    // 隐藏所有部分,然后显示选中的部分
+    Object.entries(modelParts).forEach(([name, part]) => {
+      part.visible = name === partName
+    })
+
+    // 获取选中部分的包围盒并居中相机
+    const bbox = new THREE.Box3().setFromObject(modelParts[partName])
+    const center = bbox.getCenter(new THREE.Vector3())
+    const size = bbox.getSize(new THREE.Vector3())
+
+    // 计算相机位置,使其能够完整看到模型
+    const maxDim = Math.max(size.x, size.y, size.z)
+    const fov =
+      camera instanceof THREE.PerspectiveCamera ? (camera.fov * Math.PI) / 180 : 0
+    const cameraDistance = maxDim / (2 * Math.tan(fov / 2))
+
+    camera.position.copy(
+      center.clone().add(new THREE.Vector3(0, 0, cameraDistance * 1.5))
+    )
+    camera.lookAt(center)
+
+    setActivePart(partName)
+  }
+
+  const showAllModels = () => {
+    if (!model) return
+
+    // 显示所有模型部分
+    Object.values(modelParts).forEach(part => {
+      part.visible = true
+    })
+
+    // 将相机定位到整个模型的中心
+    const bbox = new THREE.Box3().setFromObject(model)
+    const center = bbox.getCenter(new THREE.Vector3())
+    const size = bbox.getSize(new THREE.Vector3())
+
+    const maxDim = Math.max(size.x, size.y, size.z)
+    const fov =
+      camera instanceof THREE.PerspectiveCamera ? (camera.fov * Math.PI) / 180 : 0
+    const cameraDistance = maxDim / (2 * Math.tan(fov / 2))
+
+    camera.position.copy(
+      center.clone().add(new THREE.Vector3(0, 0, cameraDistance * 1.5))
+    )
+    camera.lookAt(center)
+
+    setActivePart(null)
+  }
+
+  return (
+    <div style={{ width: '100vw', height: '100vh', position: 'relative' }}>
+      <Canvas
+        shadows
+        camera={{ position: [0, 0, 5], fov: 50 }}
+        onCreated={({ gl }) => {
+          gl.setClearColor(new THREE.Color(0x000000))
+        }}
+      >
+        <Suspense fallback={<LoadProgress />}>
+          <SceneSetup />
+          <Model onLoaded={handleModelLoaded} onProgress={setLoadingProgress} />
+        </Suspense>
+      </Canvas>
+
+      {/* 6. 控制按钮 UI */}
+      <div
+        style={{
+          position: 'absolute',
+          bottom: '20px',
+          left: 0,
+          right: 0,
+          display: 'flex',
+          justifyContent: 'center',
+          gap: '10px'
+        }}
+      >
+        <button onClick={() => focusOnPart('bs1')} style={{ padding: '10px' }}>
+          显示 BS1
+        </button>
+        <button onClick={() => focusOnPart('bs2')} style={{ padding: '10px' }}>
+          显示 BS2
+        </button>
+        <button onClick={() => focusOnPart('bs3')} style={{ padding: '10px' }}>
+          显示 BS3
+        </button>
+        <button onClick={showAllModels} style={{ padding: '10px' }}>
+          显示全部
+        </button>
+      </div>
+
+      {/* 加载进度条 */}
+      {loadingProgress < 100 && (
+        <div
+          style={{
+            position: 'absolute',
+            top: '50%',
+            left: '20%',
+            right: '20%',
+            height: '20px',
+            background: 'rgba(255, 255, 255, 0.2)',
+            borderRadius: '10px'
+          }}
+        >
+          <div
+            style={{
+              height: '100%',
+              width: `${loadingProgress}%`,
+              background: 'linear-gradient(90deg, #4facfe 0%, #00f2fe 100%)',
+              borderRadius: '10px',
+              transition: 'width 0.3s ease'
+            }}
+          />
+        </div>
+      )}
+    </div>
+  )
+}
+
+export default GLBModelViewer

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

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

+ 14 - 0
code/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;

+ 30 - 0
code/src/store/action/A1list.ts

@@ -0,0 +1,30 @@
+/**
+ * 展馆预约记录-列表
+ */
+
+import http from '@/utils/http'
+
+// export const A1_APIgetList = (data: any): any => {
+//   return async (dispatch: AppDispatch) => {
+//     const res = await http.post('cms/applyExhibition/pageList', data)
+//     if (res.code === 0) {
+//       const arr: A1tableType[] = res.data.records
+//       arr.forEach(v => {
+//         v.cityStr = v.province + '-' + v.city
+//       })
+
+//       const obj = {
+//         list: arr,
+//         total: res.data.total
+//       }
+//       dispatch({ type: 'A1/getList', payload: obj })
+//     }
+//   }
+// }
+
+/**
+ * 获取全部访问量
+ */
+export const A1_APIgetNumList = () => {
+  return http.get('visit/getList')
+}

+ 28 - 0
code/src/store/action/layout.ts

@@ -0,0 +1,28 @@
+import { domShowFu, progressDomFu } from '@/utils/domShow'
+import http from '@/utils/http'
+import axios from 'axios'
+import store from '..'
+
+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) {
+      store.dispatch({
+        type: 'layout/closeUpFile',
+        payload: { fu: c, state: true }
+      })
+    })
+  })
+}

+ 20 - 0
code/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

+ 29 - 0
code/src/store/reducer/A0model.ts

@@ -0,0 +1,29 @@
+// 初始化状态
+const initState = {
+  isShow: true,
+  plan: 0
+}
+
+// 定义 action 类型
+type Props =
+  | {
+      type: 'A1/isShow'
+      payload: boolean
+    }
+  | {
+      type: 'A1/plan'
+      payload: number
+    }
+
+// reducer
+export default function Reducer(state = initState, action: Props) {
+  switch (action.type) {
+    case 'A1/isShow':
+      return { ...state, isShow: action.payload }
+    case 'A1/plan':
+      return { ...state, plan: action.payload }
+
+    default:
+      return state
+  }
+}

+ 15 - 0
code/src/store/reducer/index.ts

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

+ 65 - 0
code/src/store/reducer/layout.ts

@@ -0,0 +1,65 @@
+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
code/src/types/api/layot.d.ts

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

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

@@ -0,0 +1,11 @@
+declare module 'history'
+declare module '*.scss'
+declare module '*.png'
+declare module '*.mp3'
+declare module '*.jpg'
+declare module '*.gif'
+declare module '*.svg'
+declare module 'js-export-excel'
+declare module 'braft-utils'
+
+declare const serverUrl: string

+ 1 - 0
code/src/types/index.d.ts

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

+ 35 - 0
code/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);
+};

+ 14 - 0
code/src/utils/history.ts

@@ -0,0 +1,14 @@
+import { createHashHistory } from 'history'
+const history = createHashHistory()
+export default history
+
+// 判断是手机端还是pc端
+export const isMobileFu = () => {
+  if (
+    window.navigator.userAgent.match(
+      /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
+    )
+  ) {
+    return true
+  } else return false
+}

+ 109 - 0
code/src/utils/http.ts

@@ -0,0 +1,109 @@
+import axios from 'axios'
+import history from './history'
+import { getTokenInfo, removeTokenInfo } from './storage'
+import store from '@/store'
+import { MessageFu } from './message'
+import { domShowFu } from './domShow'
+
+const envFlag = process.env.NODE_ENV === 'development'
+
+const baseUrlTemp = 'https://sit-cctvyunzhan.4dage.com' // 测试环境
+// const baseUrlTemp = 'http://192.168.20.61:8097' // 线下环境
+
+const baseFlag = baseUrlTemp.includes('https://')
+
+// 请求基地址
+export const baseURL = envFlag
+  ? `${baseUrlTemp}${baseFlag ? '' : '/api/'}`
+  : // ''
+    baseUrlTemp
+
+// 处理  类型“AxiosResponse<any, any>”上不存在属性“code”
+declare module 'axios' {
+  interface AxiosResponse {
+    code: number
+    timestamp: string
+    // 这里追加你的参数
+  }
+}
+
+// 创建 axios 实例
+const http = axios.create({
+  baseURL: `${baseURL}${baseFlag ? '/api/' : ''}`,
+  timeout: 10000
+})
+
+let axajInd = 0
+
+// 请求拦截器
+http.interceptors.request.use(
+  function (config: any) {
+    // 发请求前打开加载提示
+    domShowFu('#AsyncSpinLoding', true)
+
+    axajInd++
+
+    const { token } = getTokenInfo()
+    if (token) config.headers.token = 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 === 5001 || response.data.code === 5002) {
+      removeTokenInfo()
+      history.replace('/login')
+      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 === 5003) {
+            removeTokenInfo()
+            history.replace('/login')
+          }
+        } else MessageFu.error('响应错误,请联系管理员!')
+      }
+    }, 100)
+
+    return Promise.reject(err)
+  }
+)
+
+// 导出 axios 实例
+export default http

+ 50 - 0
code/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
code/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
code/src/utils/storage.ts

@@ -0,0 +1,40 @@
+// ------------------------------------token的本地存储------------------------------------
+
+// 用户 Token 的本地缓存键名,自己定义
+const TOKEN_KEY = 'HQMSSWJ_HT_YY_CODE_USER_INFO'
+
+/**
+ * 从本地缓存中获取 用户 信息
+ */
+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
+}

+ 24 - 0
code/src/utils/tableData.ts

@@ -0,0 +1,24 @@
+/**
+ * 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 A1tableC = [
+  ['txtChange', '类型', 'type', { person: '个人预约', team: '团队预约' }],
+  ['txt', '姓名', 'name'],
+  ['txt', '联系电话', 'phone'],
+  ['txt', '人数', 'pcs'],
+  ['txt', '预约日期', 'bookDate'],
+  ['txt', '预约时段', 'time']
+]

+ 27 - 0
code/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"
+  ]
+}

Різницю між файлами не показано, бо вона завелика
+ 10715 - 0
code/yarn.lock


BIN
静态资源/staticData/0/0_bac.jpg


BIN
静态资源/staticData/0/model.glb


BIN
静态资源/staticData/1/1_bac.jpg


BIN
静态资源/staticData/1/1_bs.png