shaogen1995 1 year ago
parent
commit
aabf88d0a1

+ 14 - 40
管理后台/README.md

@@ -1,46 +1,20 @@
-# Getting Started with Create React App
+------ts版本类型问题-------
 
-This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
+找到 import { useDispatch } from "react-redux";
 
-## Available Scripts
+按住 Ctrl 点击 useDispatch 出来 useDispatch.d.ts类型声明文件
+(路径node_modules>react-redux>es>hooks>useDispatch.d.ts)
 
-In the project directory, you can run:
+找到最后面的 AnyAction,按住 Ctrl 点击 进入
+(路径node_modules>redux>index.d.ts)
 
-### `npm start`
+找到
+export interface Action<T = any> {
+  type: T
+}
 
-Runs the app in the development mode.\
-Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
+在type后面加一个 ?   即=>
 
-The page will reload if you make edits.\
-You will also see any lint errors in the console.
-
-### `npm test`
-
-Launches the test runner in the interactive watch mode.\
-See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
-
-### `npm run build`
-
-Builds the app for production to the `build` folder.\
-It correctly bundles React in production mode and optimizes the build for the best performance.
-
-The build is minified and the filenames include the hashes.\
-Your app is ready to be deployed!
-
-See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
-
-### `npm run eject`
-
-**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
-
-If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
-
-Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
-
-You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
-
-## Learn More
-
-You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
-
-To learn React, check out the [React documentation](https://reactjs.org/).
+export interface Action<T = any> {
+  type?: T
+}

+ 371 - 12
管理后台/package-lock.json

@@ -17,6 +17,7 @@
         "@types/react": "^18.0.24",
         "@types/react-dom": "^18.0.8",
         "antd": "^5.0.4",
+        "antd-mobile": "^5.30.0",
         "axios": "^1.1.3",
         "dayjs": "^1.11.7",
         "echarts": "^5.4.0",
@@ -2236,6 +2237,19 @@
         "node": ">=10"
       }
     },
+    "node_modules/@floating-ui/core": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmmirror.com/@floating-ui/core/-/core-1.3.0.tgz",
+      "integrity": "sha512-vX1WVAdPjZg9DkDkC+zEx/tKtnST6/qcNpwcjeBgco3XRNHz5PUA+ivi/yr6G3o0kMR60uKBJcfOdfzOFI7PMQ=="
+    },
+    "node_modules/@floating-ui/dom": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmmirror.com/@floating-ui/dom/-/dom-1.3.0.tgz",
+      "integrity": "sha512-qIAwejE3r6NeA107u4ELDKkH8+VtgRKdXqtSPaKflL2S2V+doyN+Wt9s5oHKXPDo4E8TaVXaHT3+6BbagH31xw==",
+      "dependencies": {
+        "@floating-ui/core": "^1.3.0"
+      }
+    },
     "node_modules/@humanwhocodes/config-array": {
       "version": "0.11.7",
       "resolved": "https://registry.npmmirror.com/@humanwhocodes/config-array/-/config-array-0.11.7.tgz",
@@ -3183,6 +3197,69 @@
       "resolved": "https://registry.npmmirror.com/@react-dnd/shallowequal/-/shallowequal-4.0.2.tgz",
       "integrity": "sha512-/RVXdLvJxLg4QKvMoM5WlwNR9ViO9z8B/qPcc+C0Sa/teJY7QG7kJ441DwzOjMYEY7GmU4dj5EcGHIkKZiQZCA=="
     },
+    "node_modules/@react-spring/animated": {
+      "version": "9.6.1",
+      "resolved": "https://registry.npmmirror.com/@react-spring/animated/-/animated-9.6.1.tgz",
+      "integrity": "sha512-ls/rJBrAqiAYozjLo5EPPLLOb1LM0lNVQcXODTC1SMtS6DbuBCPaKco5svFUQFMP2dso3O+qcC4k9FsKc0KxMQ==",
+      "dependencies": {
+        "@react-spring/shared": "~9.6.1",
+        "@react-spring/types": "~9.6.1"
+      },
+      "peerDependencies": {
+        "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+      }
+    },
+    "node_modules/@react-spring/core": {
+      "version": "9.6.1",
+      "resolved": "https://registry.npmmirror.com/@react-spring/core/-/core-9.6.1.tgz",
+      "integrity": "sha512-3HAAinAyCPessyQNNXe5W0OHzRfa8Yo5P748paPcmMowZ/4sMfaZ2ZB6e5x5khQI8NusOHj8nquoutd6FRY5WQ==",
+      "dependencies": {
+        "@react-spring/animated": "~9.6.1",
+        "@react-spring/rafz": "~9.6.1",
+        "@react-spring/shared": "~9.6.1",
+        "@react-spring/types": "~9.6.1"
+      },
+      "peerDependencies": {
+        "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+      }
+    },
+    "node_modules/@react-spring/rafz": {
+      "version": "9.6.1",
+      "resolved": "https://registry.npmmirror.com/@react-spring/rafz/-/rafz-9.6.1.tgz",
+      "integrity": "sha512-v6qbgNRpztJFFfSE3e2W1Uz+g8KnIBs6SmzCzcVVF61GdGfGOuBrbjIcp+nUz301awVmREKi4eMQb2Ab2gGgyQ=="
+    },
+    "node_modules/@react-spring/shared": {
+      "version": "9.6.1",
+      "resolved": "https://registry.npmmirror.com/@react-spring/shared/-/shared-9.6.1.tgz",
+      "integrity": "sha512-PBFBXabxFEuF8enNLkVqMC9h5uLRBo6GQhRMQT/nRTnemVENimgRd+0ZT4yFnAQ0AxWNiJfX3qux+bW2LbG6Bw==",
+      "dependencies": {
+        "@react-spring/rafz": "~9.6.1",
+        "@react-spring/types": "~9.6.1"
+      },
+      "peerDependencies": {
+        "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+      }
+    },
+    "node_modules/@react-spring/types": {
+      "version": "9.6.1",
+      "resolved": "https://registry.npmmirror.com/@react-spring/types/-/types-9.6.1.tgz",
+      "integrity": "sha512-POu8Mk0hIU3lRXB3bGIGe4VHIwwDsQyoD1F394OK7STTiX9w4dG3cTLljjYswkQN+hDSHRrj4O36kuVa7KPU8Q=="
+    },
+    "node_modules/@react-spring/web": {
+      "version": "9.6.1",
+      "resolved": "https://registry.npmmirror.com/@react-spring/web/-/web-9.6.1.tgz",
+      "integrity": "sha512-X2zR6q2Z+FjsWfGAmAXlQaoUHbPmfuCaXpuM6TcwXPpLE1ZD4A1eys/wpXboFQmDkjnrlTmKvpVna1MjWpZ5Hw==",
+      "dependencies": {
+        "@react-spring/animated": "~9.6.1",
+        "@react-spring/core": "~9.6.1",
+        "@react-spring/shared": "~9.6.1",
+        "@react-spring/types": "~9.6.1"
+      },
+      "peerDependencies": {
+        "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
+        "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
+      }
+    },
     "node_modules/@rollup/plugin-babel": {
       "version": "5.3.1",
       "resolved": "https://registry.npmmirror.com/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz",
@@ -3854,6 +3931,11 @@
         "pretty-format": "^27.0.0"
       }
     },
+    "node_modules/@types/js-cookie": {
+      "version": "2.2.7",
+      "resolved": "https://registry.npmmirror.com/@types/js-cookie/-/js-cookie-2.2.7.tgz",
+      "integrity": "sha512-aLkWa0C0vO5b4Sr798E26QgOkss68Un0bLjs7u9qxzPT5CG+8DuNTffWES58YzJs3hrVAOs1wonycqEBqNJubA=="
+    },
     "node_modules/@types/json-schema": {
       "version": "7.0.11",
       "resolved": "https://registry.npmmirror.com/@types/json-schema/-/json-schema-7.0.11.tgz",
@@ -4233,6 +4315,22 @@
         "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
       }
     },
+    "node_modules/@use-gesture/core": {
+      "version": "10.2.20",
+      "resolved": "https://registry.npmmirror.com/@use-gesture/core/-/core-10.2.20.tgz",
+      "integrity": "sha512-4lFhHc8so4yIHkBEs641DnEsBxPyhJ5GEjB4PURFDH4p/FcZriH6w99knZgI63zN/MBFfylMyb8+PDuj6RIXKQ=="
+    },
+    "node_modules/@use-gesture/react": {
+      "version": "10.2.20",
+      "resolved": "https://registry.npmmirror.com/@use-gesture/react/-/react-10.2.20.tgz",
+      "integrity": "sha512-KnJq9ZSqprWA6uNhWTUHZqTCh+rfa0j8ehTzqeBhktUPrmTj7yVOBvEQ/vSFU/7d72cGgWSsJ0f5T6GQCHXnvg==",
+      "dependencies": {
+        "@use-gesture/core": "10.2.20"
+      },
+      "peerDependencies": {
+        "react": ">= 16.8.0"
+      }
+    },
     "node_modules/@webassemblyjs/ast": {
       "version": "1.11.1",
       "resolved": "https://registry.npmmirror.com/@webassemblyjs/ast/-/ast-1.11.1.tgz",
@@ -4498,6 +4596,34 @@
         "node": ">= 6.0.0"
       }
     },
+    "node_modules/ahooks": {
+      "version": "3.7.7",
+      "resolved": "https://registry.npmmirror.com/ahooks/-/ahooks-3.7.7.tgz",
+      "integrity": "sha512-5e5WlPq81Y84UnTLOKIQeq2cJw4aa7yj8fR2Nb/oMmXPrWMjIMCbPS1o+fpxSfCaNA3AzOnnMc8AehWRZltkJQ==",
+      "dependencies": {
+        "@babel/runtime": "^7.21.0",
+        "@types/js-cookie": "^2.x.x",
+        "ahooks-v3-count": "^1.0.0",
+        "dayjs": "^1.9.1",
+        "intersection-observer": "^0.12.0",
+        "js-cookie": "^2.x.x",
+        "lodash": "^4.17.21",
+        "resize-observer-polyfill": "^1.5.1",
+        "screenfull": "^5.0.0",
+        "tslib": "^2.4.1"
+      },
+      "engines": {
+        "node": ">=8.0.0"
+      },
+      "peerDependencies": {
+        "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+      }
+    },
+    "node_modules/ahooks-v3-count": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmmirror.com/ahooks-v3-count/-/ahooks-v3-count-1.0.0.tgz",
+      "integrity": "sha512-V7uUvAwnimu6eh/PED4mCDjE7tokeZQLKlxg9lCTMPhN+NjsSbtdacByVlR1oluXQzD3MOw55wylDmQo4+S9ZQ=="
+    },
     "node_modules/ajv": {
       "version": "6.12.6",
       "resolved": "https://registry.npmmirror.com/ajv/-/ajv-6.12.6.tgz",
@@ -4649,6 +4775,48 @@
         "react-dom": ">=16.9.0"
       }
     },
+    "node_modules/antd-mobile": {
+      "version": "5.30.0",
+      "resolved": "https://registry.npmmirror.com/antd-mobile/-/antd-mobile-5.30.0.tgz",
+      "integrity": "sha512-M42VrDvFNzTr1OovLa9HezkD2oXmkDERolha9292FNNTvF1QikIcLZA/o1PDP9+0oWvuz59PW1ZfhjTNx6rUyg==",
+      "dependencies": {
+        "@floating-ui/dom": "^1.2.6",
+        "@rc-component/mini-decimal": "^1.0.1",
+        "@react-spring/web": "~9.6.1",
+        "@use-gesture/react": "10.2.20",
+        "ahooks": "^3.7.6",
+        "antd-mobile-icons": "^0.3.0",
+        "antd-mobile-v5-count": "^1.0.1",
+        "classnames": "^2.3.2",
+        "dayjs": "^1.11.7",
+        "lodash": "^4.17.21",
+        "rc-field-form": "~1.27.4",
+        "rc-util": "^5.30.0",
+        "react-is": "^18.2.0",
+        "runes2": "^1.1.2",
+        "staged-components": "^1.1.3",
+        "tslib": "^2.5.0",
+        "use-sync-external-store": "^1.2.0"
+      },
+      "peerDependencies": {
+        "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+      }
+    },
+    "node_modules/antd-mobile-icons": {
+      "version": "0.3.0",
+      "resolved": "https://registry.npmmirror.com/antd-mobile-icons/-/antd-mobile-icons-0.3.0.tgz",
+      "integrity": "sha512-rqINQpJWZWrva9moCd1Ye695MZYWmqLPE+bY8d2xLRy7iSQwPsinCdZYjpUPp2zL/LnKYSyXxP2ut2A+DC+whQ=="
+    },
+    "node_modules/antd-mobile-v5-count": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmmirror.com/antd-mobile-v5-count/-/antd-mobile-v5-count-1.0.1.tgz",
+      "integrity": "sha512-YGsiEDCPUDz3SzfXi6gLZn/HpeSMW+jgPc4qiYUr1fSopg3hkUie2TnooJdExgfiETHefH3Ggs58He0OVfegLA=="
+    },
+    "node_modules/antd-mobile/node_modules/react-is": {
+      "version": "18.2.0",
+      "resolved": "https://registry.npmmirror.com/react-is/-/react-is-18.2.0.tgz",
+      "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w=="
+    },
     "node_modules/anymatch": {
       "version": "3.1.2",
       "resolved": "https://registry.npmmirror.com/anymatch/-/anymatch-3.1.2.tgz",
@@ -10894,6 +11062,11 @@
       "resolved": "https://registry.npmmirror.com/js-base64/-/js-base64-3.7.5.tgz",
       "integrity": "sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA=="
     },
+    "node_modules/js-cookie": {
+      "version": "2.2.1",
+      "resolved": "https://registry.npmmirror.com/js-cookie/-/js-cookie-2.2.1.tgz",
+      "integrity": "sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ=="
+    },
     "node_modules/js-sdsl": {
       "version": "4.1.5",
       "resolved": "https://registry.npmmirror.com/js-sdsl/-/js-sdsl-4.1.5.tgz",
@@ -13902,9 +14075,9 @@
       }
     },
     "node_modules/rc-util": {
-      "version": "5.28.0",
-      "resolved": "https://registry.npmmirror.com/rc-util/-/rc-util-5.28.0.tgz",
-      "integrity": "sha512-KYDjhGodswVj29v0TRciKTqRPgumIFvFDndbCD227pitQ+0Cei196rxk+OXb/blu6V8zdTRK5RjCJn+WmHLvBA==",
+      "version": "5.33.0",
+      "resolved": "https://registry.npmmirror.com/rc-util/-/rc-util-5.33.0.tgz",
+      "integrity": "sha512-mq2NkEAnHklq4fgU/JqjiE0PS8+8u33gEWw2bDUNDPck3OroPpSgw/8oEyuFrvPgaZEmt9BgQdh59JfQt2cU+w==",
       "dependencies": {
         "@babel/runtime": "^7.18.3",
         "react-is": "^16.12.0"
@@ -14790,6 +14963,11 @@
         "queue-microtask": "^1.2.2"
       }
     },
+    "node_modules/runes2": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmmirror.com/runes2/-/runes2-1.1.2.tgz",
+      "integrity": "sha512-v6XIdRpUKdFLNhgF2AC9XvntZsDzxyTpVlpQ8HD592XD6vHiW8jEcHFnTV5ztUjWJC5cGOcdi9YKIwxWVh0f9w=="
+    },
     "node_modules/safe-buffer": {
       "version": "5.2.1",
       "resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.2.1.tgz",
@@ -14901,6 +15079,14 @@
         "node": ">= 10.13.0"
       }
     },
+    "node_modules/screenfull": {
+      "version": "5.2.0",
+      "resolved": "https://registry.npmmirror.com/screenfull/-/screenfull-5.2.0.tgz",
+      "integrity": "sha512-9BakfsO2aUQN2K9Fdbj87RJIEZ82Q9IGim7FqM5OsebfoFC6ZHXgDq/KvniuLTPdeM8wY2o6Dj3WQ7KeQCj3cA==",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
     "node_modules/scroll-into-view-if-needed": {
       "version": "3.0.6",
       "resolved": "https://registry.npmmirror.com/scroll-into-view-if-needed/-/scroll-into-view-if-needed-3.0.6.tgz",
@@ -15267,6 +15453,14 @@
       "resolved": "https://registry.npmmirror.com/stackframe/-/stackframe-1.3.4.tgz",
       "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw=="
     },
+    "node_modules/staged-components": {
+      "version": "1.1.3",
+      "resolved": "https://registry.npmmirror.com/staged-components/-/staged-components-1.1.3.tgz",
+      "integrity": "sha512-9EIswzDqjwlEu+ymkV09TTlJfzSbKgEnNteUnZSTxkpMgr5Wx2CzzA9WcMFWBNCldqVPsHVnRGGrApduq2Se5A==",
+      "peerDependencies": {
+        "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+      }
+    },
     "node_modules/statuses": {
       "version": "2.0.1",
       "resolved": "https://registry.npmmirror.com/statuses/-/statuses-2.0.1.tgz",
@@ -15891,9 +16085,9 @@
       }
     },
     "node_modules/tslib": {
-      "version": "2.4.0",
-      "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.4.0.tgz",
-      "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ=="
+      "version": "2.5.3",
+      "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.5.3.tgz",
+      "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w=="
     },
     "node_modules/tsutils": {
       "version": "3.21.0",
@@ -18558,6 +18752,19 @@
         }
       }
     },
+    "@floating-ui/core": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmmirror.com/@floating-ui/core/-/core-1.3.0.tgz",
+      "integrity": "sha512-vX1WVAdPjZg9DkDkC+zEx/tKtnST6/qcNpwcjeBgco3XRNHz5PUA+ivi/yr6G3o0kMR60uKBJcfOdfzOFI7PMQ=="
+    },
+    "@floating-ui/dom": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmmirror.com/@floating-ui/dom/-/dom-1.3.0.tgz",
+      "integrity": "sha512-qIAwejE3r6NeA107u4ELDKkH8+VtgRKdXqtSPaKflL2S2V+doyN+Wt9s5oHKXPDo4E8TaVXaHT3+6BbagH31xw==",
+      "requires": {
+        "@floating-ui/core": "^1.3.0"
+      }
+    },
     "@humanwhocodes/config-array": {
       "version": "0.11.7",
       "resolved": "https://registry.npmmirror.com/@humanwhocodes/config-array/-/config-array-0.11.7.tgz",
@@ -19265,6 +19472,56 @@
       "resolved": "https://registry.npmmirror.com/@react-dnd/shallowequal/-/shallowequal-4.0.2.tgz",
       "integrity": "sha512-/RVXdLvJxLg4QKvMoM5WlwNR9ViO9z8B/qPcc+C0Sa/teJY7QG7kJ441DwzOjMYEY7GmU4dj5EcGHIkKZiQZCA=="
     },
+    "@react-spring/animated": {
+      "version": "9.6.1",
+      "resolved": "https://registry.npmmirror.com/@react-spring/animated/-/animated-9.6.1.tgz",
+      "integrity": "sha512-ls/rJBrAqiAYozjLo5EPPLLOb1LM0lNVQcXODTC1SMtS6DbuBCPaKco5svFUQFMP2dso3O+qcC4k9FsKc0KxMQ==",
+      "requires": {
+        "@react-spring/shared": "~9.6.1",
+        "@react-spring/types": "~9.6.1"
+      }
+    },
+    "@react-spring/core": {
+      "version": "9.6.1",
+      "resolved": "https://registry.npmmirror.com/@react-spring/core/-/core-9.6.1.tgz",
+      "integrity": "sha512-3HAAinAyCPessyQNNXe5W0OHzRfa8Yo5P748paPcmMowZ/4sMfaZ2ZB6e5x5khQI8NusOHj8nquoutd6FRY5WQ==",
+      "requires": {
+        "@react-spring/animated": "~9.6.1",
+        "@react-spring/rafz": "~9.6.1",
+        "@react-spring/shared": "~9.6.1",
+        "@react-spring/types": "~9.6.1"
+      }
+    },
+    "@react-spring/rafz": {
+      "version": "9.6.1",
+      "resolved": "https://registry.npmmirror.com/@react-spring/rafz/-/rafz-9.6.1.tgz",
+      "integrity": "sha512-v6qbgNRpztJFFfSE3e2W1Uz+g8KnIBs6SmzCzcVVF61GdGfGOuBrbjIcp+nUz301awVmREKi4eMQb2Ab2gGgyQ=="
+    },
+    "@react-spring/shared": {
+      "version": "9.6.1",
+      "resolved": "https://registry.npmmirror.com/@react-spring/shared/-/shared-9.6.1.tgz",
+      "integrity": "sha512-PBFBXabxFEuF8enNLkVqMC9h5uLRBo6GQhRMQT/nRTnemVENimgRd+0ZT4yFnAQ0AxWNiJfX3qux+bW2LbG6Bw==",
+      "requires": {
+        "@react-spring/rafz": "~9.6.1",
+        "@react-spring/types": "~9.6.1"
+      }
+    },
+    "@react-spring/types": {
+      "version": "9.6.1",
+      "resolved": "https://registry.npmmirror.com/@react-spring/types/-/types-9.6.1.tgz",
+      "integrity": "sha512-POu8Mk0hIU3lRXB3bGIGe4VHIwwDsQyoD1F394OK7STTiX9w4dG3cTLljjYswkQN+hDSHRrj4O36kuVa7KPU8Q=="
+    },
+    "@react-spring/web": {
+      "version": "9.6.1",
+      "resolved": "https://registry.npmmirror.com/@react-spring/web/-/web-9.6.1.tgz",
+      "integrity": "sha512-X2zR6q2Z+FjsWfGAmAXlQaoUHbPmfuCaXpuM6TcwXPpLE1ZD4A1eys/wpXboFQmDkjnrlTmKvpVna1MjWpZ5Hw==",
+      "requires": {
+        "@react-spring/animated": "~9.6.1",
+        "@react-spring/core": "~9.6.1",
+        "@react-spring/shared": "~9.6.1",
+        "@react-spring/types": "~9.6.1"
+      }
+    },
     "@rollup/plugin-babel": {
       "version": "5.3.1",
       "resolved": "https://registry.npmmirror.com/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz",
@@ -19813,6 +20070,11 @@
         "pretty-format": "^27.0.0"
       }
     },
+    "@types/js-cookie": {
+      "version": "2.2.7",
+      "resolved": "https://registry.npmmirror.com/@types/js-cookie/-/js-cookie-2.2.7.tgz",
+      "integrity": "sha512-aLkWa0C0vO5b4Sr798E26QgOkss68Un0bLjs7u9qxzPT5CG+8DuNTffWES58YzJs3hrVAOs1wonycqEBqNJubA=="
+    },
     "@types/json-schema": {
       "version": "7.0.11",
       "resolved": "https://registry.npmmirror.com/@types/json-schema/-/json-schema-7.0.11.tgz",
@@ -20129,6 +20391,19 @@
         "eslint-visitor-keys": "^3.3.0"
       }
     },
+    "@use-gesture/core": {
+      "version": "10.2.20",
+      "resolved": "https://registry.npmmirror.com/@use-gesture/core/-/core-10.2.20.tgz",
+      "integrity": "sha512-4lFhHc8so4yIHkBEs641DnEsBxPyhJ5GEjB4PURFDH4p/FcZriH6w99knZgI63zN/MBFfylMyb8+PDuj6RIXKQ=="
+    },
+    "@use-gesture/react": {
+      "version": "10.2.20",
+      "resolved": "https://registry.npmmirror.com/@use-gesture/react/-/react-10.2.20.tgz",
+      "integrity": "sha512-KnJq9ZSqprWA6uNhWTUHZqTCh+rfa0j8ehTzqeBhktUPrmTj7yVOBvEQ/vSFU/7d72cGgWSsJ0f5T6GQCHXnvg==",
+      "requires": {
+        "@use-gesture/core": "10.2.20"
+      }
+    },
     "@webassemblyjs/ast": {
       "version": "1.11.1",
       "resolved": "https://registry.npmmirror.com/@webassemblyjs/ast/-/ast-1.11.1.tgz",
@@ -20361,6 +20636,28 @@
         "debug": "4"
       }
     },
+    "ahooks": {
+      "version": "3.7.7",
+      "resolved": "https://registry.npmmirror.com/ahooks/-/ahooks-3.7.7.tgz",
+      "integrity": "sha512-5e5WlPq81Y84UnTLOKIQeq2cJw4aa7yj8fR2Nb/oMmXPrWMjIMCbPS1o+fpxSfCaNA3AzOnnMc8AehWRZltkJQ==",
+      "requires": {
+        "@babel/runtime": "^7.21.0",
+        "@types/js-cookie": "^2.x.x",
+        "ahooks-v3-count": "^1.0.0",
+        "dayjs": "^1.9.1",
+        "intersection-observer": "^0.12.0",
+        "js-cookie": "^2.x.x",
+        "lodash": "^4.17.21",
+        "resize-observer-polyfill": "^1.5.1",
+        "screenfull": "^5.0.0",
+        "tslib": "^2.4.1"
+      }
+    },
+    "ahooks-v3-count": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmmirror.com/ahooks-v3-count/-/ahooks-v3-count-1.0.0.tgz",
+      "integrity": "sha512-V7uUvAwnimu6eh/PED4mCDjE7tokeZQLKlxg9lCTMPhN+NjsSbtdacByVlR1oluXQzD3MOw55wylDmQo4+S9ZQ=="
+    },
     "ajv": {
       "version": "6.12.6",
       "resolved": "https://registry.npmmirror.com/ajv/-/ajv-6.12.6.tgz",
@@ -20485,6 +20782,47 @@
         "throttle-debounce": "^5.0.0"
       }
     },
+    "antd-mobile": {
+      "version": "5.30.0",
+      "resolved": "https://registry.npmmirror.com/antd-mobile/-/antd-mobile-5.30.0.tgz",
+      "integrity": "sha512-M42VrDvFNzTr1OovLa9HezkD2oXmkDERolha9292FNNTvF1QikIcLZA/o1PDP9+0oWvuz59PW1ZfhjTNx6rUyg==",
+      "requires": {
+        "@floating-ui/dom": "^1.2.6",
+        "@rc-component/mini-decimal": "^1.0.1",
+        "@react-spring/web": "~9.6.1",
+        "@use-gesture/react": "10.2.20",
+        "ahooks": "^3.7.6",
+        "antd-mobile-icons": "^0.3.0",
+        "antd-mobile-v5-count": "^1.0.1",
+        "classnames": "^2.3.2",
+        "dayjs": "^1.11.7",
+        "lodash": "^4.17.21",
+        "rc-field-form": "~1.27.4",
+        "rc-util": "^5.30.0",
+        "react-is": "^18.2.0",
+        "runes2": "^1.1.2",
+        "staged-components": "^1.1.3",
+        "tslib": "^2.5.0",
+        "use-sync-external-store": "^1.2.0"
+      },
+      "dependencies": {
+        "react-is": {
+          "version": "18.2.0",
+          "resolved": "https://registry.npmmirror.com/react-is/-/react-is-18.2.0.tgz",
+          "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w=="
+        }
+      }
+    },
+    "antd-mobile-icons": {
+      "version": "0.3.0",
+      "resolved": "https://registry.npmmirror.com/antd-mobile-icons/-/antd-mobile-icons-0.3.0.tgz",
+      "integrity": "sha512-rqINQpJWZWrva9moCd1Ye695MZYWmqLPE+bY8d2xLRy7iSQwPsinCdZYjpUPp2zL/LnKYSyXxP2ut2A+DC+whQ=="
+    },
+    "antd-mobile-v5-count": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmmirror.com/antd-mobile-v5-count/-/antd-mobile-v5-count-1.0.1.tgz",
+      "integrity": "sha512-YGsiEDCPUDz3SzfXi6gLZn/HpeSMW+jgPc4qiYUr1fSopg3hkUie2TnooJdExgfiETHefH3Ggs58He0OVfegLA=="
+    },
     "anymatch": {
       "version": "3.1.2",
       "resolved": "https://registry.npmmirror.com/anymatch/-/anymatch-3.1.2.tgz",
@@ -25394,6 +25732,11 @@
       "resolved": "https://registry.npmmirror.com/js-base64/-/js-base64-3.7.5.tgz",
       "integrity": "sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA=="
     },
+    "js-cookie": {
+      "version": "2.2.1",
+      "resolved": "https://registry.npmmirror.com/js-cookie/-/js-cookie-2.2.1.tgz",
+      "integrity": "sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ=="
+    },
     "js-sdsl": {
       "version": "4.1.5",
       "resolved": "https://registry.npmmirror.com/js-sdsl/-/js-sdsl-4.1.5.tgz",
@@ -27513,9 +27856,9 @@
       }
     },
     "rc-util": {
-      "version": "5.28.0",
-      "resolved": "https://registry.npmmirror.com/rc-util/-/rc-util-5.28.0.tgz",
-      "integrity": "sha512-KYDjhGodswVj29v0TRciKTqRPgumIFvFDndbCD227pitQ+0Cei196rxk+OXb/blu6V8zdTRK5RjCJn+WmHLvBA==",
+      "version": "5.33.0",
+      "resolved": "https://registry.npmmirror.com/rc-util/-/rc-util-5.33.0.tgz",
+      "integrity": "sha512-mq2NkEAnHklq4fgU/JqjiE0PS8+8u33gEWw2bDUNDPck3OroPpSgw/8oEyuFrvPgaZEmt9BgQdh59JfQt2cU+w==",
       "requires": {
         "@babel/runtime": "^7.18.3",
         "react-is": "^16.12.0"
@@ -28184,6 +28527,11 @@
         "queue-microtask": "^1.2.2"
       }
     },
+    "runes2": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmmirror.com/runes2/-/runes2-1.1.2.tgz",
+      "integrity": "sha512-v6XIdRpUKdFLNhgF2AC9XvntZsDzxyTpVlpQ8HD592XD6vHiW8jEcHFnTV5ztUjWJC5cGOcdi9YKIwxWVh0f9w=="
+    },
     "safe-buffer": {
       "version": "5.2.1",
       "resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.2.1.tgz",
@@ -28259,6 +28607,11 @@
         "ajv-keywords": "^3.5.2"
       }
     },
+    "screenfull": {
+      "version": "5.2.0",
+      "resolved": "https://registry.npmmirror.com/screenfull/-/screenfull-5.2.0.tgz",
+      "integrity": "sha512-9BakfsO2aUQN2K9Fdbj87RJIEZ82Q9IGim7FqM5OsebfoFC6ZHXgDq/KvniuLTPdeM8wY2o6Dj3WQ7KeQCj3cA=="
+    },
     "scroll-into-view-if-needed": {
       "version": "3.0.6",
       "resolved": "https://registry.npmmirror.com/scroll-into-view-if-needed/-/scroll-into-view-if-needed-3.0.6.tgz",
@@ -28574,6 +28927,12 @@
       "resolved": "https://registry.npmmirror.com/stackframe/-/stackframe-1.3.4.tgz",
       "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw=="
     },
+    "staged-components": {
+      "version": "1.1.3",
+      "resolved": "https://registry.npmmirror.com/staged-components/-/staged-components-1.1.3.tgz",
+      "integrity": "sha512-9EIswzDqjwlEu+ymkV09TTlJfzSbKgEnNteUnZSTxkpMgr5Wx2CzzA9WcMFWBNCldqVPsHVnRGGrApduq2Se5A==",
+      "requires": {}
+    },
     "statuses": {
       "version": "2.0.1",
       "resolved": "https://registry.npmmirror.com/statuses/-/statuses-2.0.1.tgz",
@@ -29072,9 +29431,9 @@
       }
     },
     "tslib": {
-      "version": "2.4.0",
-      "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.4.0.tgz",
-      "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ=="
+      "version": "2.5.3",
+      "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.5.3.tgz",
+      "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w=="
     },
     "tsutils": {
       "version": "3.21.0",

+ 1 - 1
管理后台/package.json

@@ -12,6 +12,7 @@
     "@types/react": "^18.0.24",
     "@types/react-dom": "^18.0.8",
     "antd": "^5.0.4",
+    "antd-mobile": "^5.30.0",
     "axios": "^1.1.3",
     "dayjs": "^1.11.7",
     "echarts": "^5.4.0",
@@ -20,7 +21,6 @@
     "react-dnd": "^16.0.1",
     "react-dnd-html5-backend": "^16.0.1",
     "react-dom": "^18.2.0",
-    "react-lazyimg-component": "^1.0.1",
     "react-redux": "^8.0.4",
     "react-router-dom": "5.3",
     "react-scripts": "5.0.1",

+ 22 - 8
管理后台/src/components/ImageLazy/index.module.scss

@@ -1,11 +1,23 @@
-.ImageLazy{
+.ImageLazy {
   position: relative;
-  :global{
-    .lazyBox{
+
+  :global {
+    .lazyBox {
       width: 100%;
       height: 100%;
       position: relative;
-      .lookImg{
+
+      .adm-image {
+        width: 100%;
+        height: 100%;
+
+        img {
+          width: 100%;
+          height: 100%;
+        }
+      }
+
+      .lookImg {
         cursor: pointer;
         transition: opacity .3s;
         opacity: 0;
@@ -20,13 +32,15 @@
         align-items: center;
         font-size: 18px;
         color: #fff;
-        background-color: rgba(0,0,0,.6);
-        &>div{
+        background-color: rgba(0, 0, 0, .6);
+
+        &>div {
           font-size: 14px;
         }
       }
-      &:hover{
-        .lookImg{
+
+      &:hover {
+        .lookImg {
           opacity: 1;
           pointer-events: auto;
         }

+ 13 - 38
管理后台/src/components/ImageLazy/index.tsx

@@ -1,11 +1,11 @@
-import React, { useCallback, useEffect, useState } from "react";
+import React, { useCallback, useState } from "react";
 import styles from "./index.module.scss";
-import Lazyimg from "react-lazyimg-component";
 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;
@@ -22,44 +22,18 @@ function ImageLazy({
   noLook,
   offline = false,
 }: Props) {
-  // 图片占位符
-  const [placeholderUrl, setPlaceholderUrl] = useState(
-    src ? imgLoding : imgErr
-  );
-
   // 默认不能预览图片,加载成功之后能预览
   const [lookImg, setLookImg] = useState(false);
 
-  useEffect(() => {
-    if (src) {
-      // 进页面查看图片的加载情况
-      // 创建一个img标签
-      const imgDom = document.createElement("img");
-      imgDom.src = offline ? src : baseURL + src;
-
-      // 不管图片加载成功或者失败,都删除掉,提高性能
-      // 图片加载成功
-      imgDom.onload = function () {
-        setLookImg(true);
-        imgDom.remove();
-      };
-      // 图片加载失败
-      imgDom.onerror = function () {
-        setPlaceholderUrl(imgErr);
-        imgDom.remove();
-      };
-
-      return () => {
-        // 离开页面也删掉掉元素
-        imgDom.remove();
-      };
-    }
-  }, [offline, src]);
+  // 图片加载完成
+  const onLoad = useCallback(() => {
+    setLookImg(true);
+  }, []);
 
   // 点击预览图片
   const lookBigImg = useCallback(() => {
     store.dispatch({
-      type: "layout/lookBigImg",
+      type: 'layout/lookBigImg',
       payload: { url: offline ? src : baseURL + src, show: true },
     });
   }, [offline, src]);
@@ -67,12 +41,13 @@ function ImageLazy({
   return (
     <div className={styles.ImageLazy} style={{ width: width, height: height }}>
       <div className="lazyBox">
-        <Lazyimg
+        <Image
+          lazy
+          onLoad={onLoad}
           src={src ? (offline ? src : baseURL + src) : ""}
-          width={width}
-          height={height}
-          placeholder={placeholderUrl}
-          alt=""
+          placeholder={<img src={imgLoding} alt="" />}
+          fallback={<img src={imgErr} alt="" />}
+          fit="cover"
         />
 
         {/* 图片预览 */}