修改一下

This commit is contained in:
mmc
2026-04-21 08:51:57 +08:00
parent 6122e884fe
commit 713322659c
9 changed files with 1170 additions and 577 deletions

View File

@@ -1,13 +1,16 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My Google AI Studio App</title>
<link rel="icon" type="image/x-icon" href="./src/assets/logo.png" />
<title>机器人智慧服务系统</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
</html>

314
package-lock.json generated
View File

@@ -13,12 +13,13 @@
"@tailwindcss/vite": "^4.1.14",
"@vitejs/plugin-react": "^5.0.4",
"antd": "^5.24.1",
"axios": "^1.15.0",
"axios": "^1.15.1",
"clsx": "^2.1.1",
"dotenv": "^17.2.3",
"express": "^4.21.2",
"lucide-react": "^0.546.0",
"motion": "^12.23.24",
"qrcode": "^1.5.4",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-router-dom": "^7.14.1",
@@ -2058,6 +2059,30 @@
"node": ">= 14"
}
},
"node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"license": "MIT",
"dependencies": {
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/antd": {
"version": "5.24.1",
"resolved": "https://registry.npmjs.org/antd/-/antd-5.24.1.tgz",
@@ -2214,9 +2239,9 @@
}
},
"node_modules/axios": {
"version": "1.15.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.15.0.tgz",
"integrity": "sha512-wWyJDlAatxk30ZJer+GeCWS209sA42X+N5jU2jy6oHTp7ufw8uzUTVFBX9+wTfAlhiJXGS0Bq7X6efruWjuK9Q==",
"version": "1.15.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.15.1.tgz",
"integrity": "sha512-WOG+Jj8ZOvR0a3rAn+Tuf1UQJRxw5venr6DgdbJzngJE3qG7X0kL83CZGpdHMxEm+ZK3seAbvFsw4FfOfP9vxg==",
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.15.11",
@@ -2381,6 +2406,15 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/camelcase": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001788",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001788.tgz",
@@ -2407,6 +2441,17 @@
"integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==",
"license": "MIT"
},
"node_modules/cliui": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
"integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
"license": "ISC",
"dependencies": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^6.2.0"
}
},
"node_modules/clsx": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz",
@@ -2416,6 +2461,24 @@
"node": ">=6"
}
},
"node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"license": "MIT",
"dependencies": {
"color-name": "~1.1.4"
},
"engines": {
"node": ">=7.0.0"
}
},
"node_modules/color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"license": "MIT"
},
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
@@ -2644,6 +2707,15 @@
}
}
},
"node_modules/decamelize": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
"integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/decimal.js-light": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/decimal.js-light/-/decimal.js-light-2.5.1.tgz",
@@ -2687,6 +2759,12 @@
"node": ">=8"
}
},
"node_modules/dijkstrajs": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.3.tgz",
"integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==",
"license": "MIT"
},
"node_modules/dotenv": {
"version": "17.4.2",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.4.2.tgz",
@@ -2734,6 +2812,12 @@
"integrity": "sha512-908qahOGocRMinT2nM3ajCEM99H4iPdv84eagPP3FfZy/1ZGeOy2CZYzjhms81ckOPCXPlW7LkY4XpxD8r1DrA==",
"license": "ISC"
},
"node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"license": "MIT"
},
"node_modules/encodeurl": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
@@ -3023,6 +3107,19 @@
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
"license": "MIT"
},
"node_modules/find-up": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
"license": "MIT",
"dependencies": {
"locate-path": "^5.0.0",
"path-exists": "^4.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/follow-redirects": {
"version": "1.16.0",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz",
@@ -3190,6 +3287,15 @@
"node": ">=6.9.0"
}
},
"node_modules/get-caller-file": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
"license": "ISC",
"engines": {
"node": "6.* || 8.* || >= 10.*"
}
},
"node_modules/get-intrinsic": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
@@ -3402,6 +3508,15 @@
"node": ">= 0.10"
}
},
"node_modules/is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/is-mobile": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/is-mobile/-/is-mobile-5.0.0.tgz",
@@ -3735,6 +3850,18 @@
"url": "https://opencollective.com/parcel"
}
},
"node_modules/locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
"license": "MIT",
"dependencies": {
"p-locate": "^4.1.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/long": {
"version": "5.3.2",
"resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz",
@@ -3979,6 +4106,33 @@
"node": ">= 0.8"
}
},
"node_modules/p-limit": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
"license": "MIT",
"dependencies": {
"p-try": "^2.0.0"
},
"engines": {
"node": ">=6"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/p-locate": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
"license": "MIT",
"dependencies": {
"p-limit": "^2.2.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/p-retry": {
"version": "4.6.2",
"resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz",
@@ -3992,6 +4146,15 @@
"node": ">=8"
}
},
"node_modules/p-try": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/parseurl": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
@@ -4001,6 +4164,15 @@
"node": ">= 0.8"
}
},
"node_modules/path-exists": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/path-to-regexp": {
"version": "0.1.13",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.13.tgz",
@@ -4025,6 +4197,15 @@
"url": "https://github.com/sponsors/jonschlinkert"
}
},
"node_modules/pngjs": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz",
"integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==",
"license": "MIT",
"engines": {
"node": ">=10.13.0"
}
},
"node_modules/postcss": {
"version": "8.5.10",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.10.tgz",
@@ -4106,6 +4287,23 @@
"node": ">=10"
}
},
"node_modules/qrcode": {
"version": "1.5.4",
"resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.4.tgz",
"integrity": "sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==",
"license": "MIT",
"dependencies": {
"dijkstrajs": "^1.0.1",
"pngjs": "^5.0.0",
"yargs": "^15.3.1"
},
"bin": {
"qrcode": "bin/qrcode"
},
"engines": {
"node": ">=10.13.0"
}
},
"node_modules/qs": {
"version": "6.14.2",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.14.2.tgz",
@@ -4913,6 +5111,21 @@
"redux": "^5.0.0"
}
},
"node_modules/require-directory": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
"integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/require-main-filename": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
"license": "ISC"
},
"node_modules/reselect": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/reselect/-/reselect-5.1.1.tgz",
@@ -5092,6 +5305,12 @@
"node": ">= 0.8.0"
}
},
"node_modules/set-blocking": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
"integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==",
"license": "ISC"
},
"node_modules/set-cookie-parser": {
"version": "2.7.2",
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz",
@@ -5200,6 +5419,32 @@
"integrity": "sha512-u/1tdPl4yQnPBjnVrmdLo9gtuLvELKsAoRapekWggdiQNvvvum+jYF329d84NAa660KQw7pB2n36KrIKVoXa3A==",
"license": "MIT"
},
"node_modules/string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"license": "MIT",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"license": "MIT",
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/stylis": {
"version": "4.3.6",
"resolved": "https://registry.npmjs.org/stylis/-/stylis-4.3.6.tgz",
@@ -5968,6 +6213,26 @@
"node": ">= 8"
}
},
"node_modules/which-module": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz",
"integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==",
"license": "ISC"
},
"node_modules/wrap-ansi": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
"integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
"license": "MIT",
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/ws": {
"version": "8.20.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.20.0.tgz",
@@ -5989,11 +6254,52 @@
}
}
},
"node_modules/y18n": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
"integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
"license": "ISC"
},
"node_modules/yallist": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
"license": "ISC"
},
"node_modules/yargs": {
"version": "15.4.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",
"integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",
"license": "MIT",
"dependencies": {
"cliui": "^6.0.0",
"decamelize": "^1.2.0",
"find-up": "^4.1.0",
"get-caller-file": "^2.0.1",
"require-directory": "^2.1.1",
"require-main-filename": "^2.0.0",
"set-blocking": "^2.0.0",
"string-width": "^4.2.0",
"which-module": "^2.0.0",
"y18n": "^4.0.0",
"yargs-parser": "^18.1.2"
},
"engines": {
"node": ">=8"
}
},
"node_modules/yargs-parser": {
"version": "18.1.3",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
"integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
"license": "ISC",
"dependencies": {
"camelcase": "^5.0.0",
"decamelize": "^1.2.0"
},
"engines": {
"node": ">=6"
}
}
}
}

View File

@@ -16,12 +16,13 @@
"@tailwindcss/vite": "^4.1.14",
"@vitejs/plugin-react": "^5.0.4",
"antd": "^5.24.1",
"axios": "^1.15.0",
"axios": "^1.15.1",
"clsx": "^2.1.1",
"dotenv": "^17.2.3",
"express": "^4.21.2",
"lucide-react": "^0.546.0",
"motion": "^12.23.24",
"qrcode": "^1.5.4",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-router-dom": "^7.14.1",

BIN
src/assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

View File

@@ -25,7 +25,7 @@ import {
TeamOutlined
} from '@ant-design/icons';
import { MOCK_USER } from '../constants';
import logo from '../assets/logo.png';
const { Header, Sider, Content } = Layout;
export default function AppLayout() {
@@ -58,6 +58,7 @@ export default function AppLayout() {
{ key: '/downloads', icon: <DownloadOutlined />, label: '视频下载', roles: ['admin', 'operator'] },
{ key: '/users', icon: <TeamOutlined />, label: '用户管理', roles: ['admin'] },
{ key: '/roles', icon: <UserOutlined />, label: '角色权限', roles: ['admin'] },
{ key: '/serialNumGenerate', icon: <UserOutlined />, label: '序列号生成', roles: ['admin'] },
];
const filteredMenu = menuItems.filter(item => item.roles.includes(user.role));
@@ -85,11 +86,11 @@ export default function AppLayout() {
}}
>
<Layout style={{ minHeight: '100vh' }}>
<Sider trigger={null} collapsible collapsed={collapsed} width={200} theme="dark">
<Sider trigger={null} collapsible collapsed={collapsed} width={220} theme="dark">
<div className="h-16 flex items-center justify-center border-b border-white/10 overflow-hidden">
<Space size="small" className="px-2">
<GlobalOutlined style={{ fontSize: 24, color: '#1890ff' }} />
{!collapsed && <span className="text-white font-bold text-lg whitespace-nowrap">RobotMaster AI</span>}
<img src={logo} alt="Logo" style={{ width: "24px", height: "24px" }} />
{!collapsed && <span className="text-white font-bold text-lg whitespace-nowrap">机器人智慧服务系统</span>}
</Space>
</div>
<Menu

View File

@@ -88,6 +88,23 @@ export default function Devices() {
</Space>
),
},
{
title: '类型',
dataIndex: 'battery',
key: 'battery',
render: (percent: number) => (
<Space size="middle">
<Progress
percent={percent}
size={[60, 4]}
showInfo={false}
status={percent < 20 ? 'exception' : 'active'}
strokeColor={percent < 20 ? '#f5222d' : percent < 50 ? '#faad14' : '#52c41a'}
/>
<Text style={{ fontSize: 11, fontFamily: 'monospace' }}>{percent}%</Text>
</Space>
),
},
{
title: '管理',
key: 'action',
@@ -117,7 +134,7 @@ export default function Devices() {
</Space>
</div>
<Row gutter={16} className="flex-1 overflow-hidden" style={{ minHeight: 0 }}>
<Row gutter={16} className="flex-1 " style={{ minHeight: 0, flexWrap: 'nowrap', }}>
<Col flex="auto" className="h-full overflow-hidden">
<Card styles={{ body: { padding: 0 } }} className="h-full overflow-hidden flex flex-col">
<Table

View File

@@ -78,7 +78,7 @@ export default function Login() {
<div className="inline-flex items-center justify-center w-12 h-12 rounded bg-blue-500/10 text-[#1890ff] mb-4 border border-blue-500/20">
<RocketOutlined style={{ fontSize: 24 }} />
</div>
<Title level={4} style={{ color: '#fff', margin: 0, letterSpacing: 1 }}>RobotMaster AI</Title>
<Title level={4} style={{ color: '#fff', margin: 0, letterSpacing: 1 }}>机器人智慧服务系统</Title>
<Text style={{ color: 'rgba(255,255,255,0.45)', fontSize: 10, marginTop: 4, display: 'block', letterSpacing: 2 }}>机器人智慧服务系统</Text>
</div>

View File

@@ -0,0 +1,260 @@
import React, { useState, useRef } from 'react';
import { Form, Select, Input, Button, Space, message, Card, Typography, Row, Col } from 'antd';
import QRCode from 'qrcode';
import axios from 'axios';
const { Text } = Typography;
const SerialNumGenerate = () => {
const [form] = Form.useForm();
const [qrUrl, setQrUrl] = useState('');
const [qrText, setQrText] = useState('');
const [loading, setLoading] = useState(false);
const qrRef = useRef(null);
// 查询状态
const [queryCode, setQueryCode] = useState('');
const [queryLoading, setQueryLoading] = useState(false);
const initialValues = {
model: 'MC700',
config: 'AIR',
country: '中国',
province: '江苏',
code: '',
type: 'mower',
};
// 生成二维码(纯字符串+显示明文)
const generateQRCode = async () => {
try {
const values = await form.validateFields();
const timestamp = new Date().getTime();
const qrContent = `${values.model}-${values.config}-${values.type}-${values.country}-${values.province}-${values.code}-${timestamp}`;
const url = await QRCode.toDataURL(qrContent);
setQrUrl(url);
setQrText(qrContent);
message.success('二维码生成成功!');
} catch (error) {
message.error('请完善信息');
console.error(error);
}
};
// 保存到数据库
const saveToDatabase = async () => {
if (!qrUrl) {
message.warning('先生成二维码');
return;
}
setLoading(true);
try {
const values = await form.validateFields();
const timestamp = new Date().getTime();
const data = { ...values, timestamp, qrCode: qrUrl, qrText: qrText };
await axios.post('/api/save-qrcode', data);
message.success('已保存到数据库!');
} catch (err) {
message.error('保存失败');
} finally {
setLoading(false);
}
};
// 查询二维码
const handleQueryQRCode = async () => {
if (!queryCode) {
message.warning('请输入编号');
return;
}
setQueryLoading(true);
try {
const res = await axios.get('/api/query-qrcode', { params: { code: queryCode } });
if (res.data?.qrCode) {
setQrUrl(res.data.qrCode);
setQrText(res.data.qrText || '');
message.success('查询成功!');
} else {
message.warning('未找到该编号的二维码');
}
} catch (err) {
message.error('查询失败');
} finally {
setQueryLoading(false);
}
};
return (
<div style={{ padding: '40px 20px', background: '#f0f2f5', minHeight: '100vh' }}>
<Card
title="序列号二维码生成器"
style={{
maxWidth: 900,
margin: '0 auto',
borderRadius: 12,
boxShadow: '0 4px 20px rgba(0,0,0,0.08)',
padding: '20px',
}}
headStyle={{
fontSize: '20px',
fontWeight: 600,
textAlign: 'center',
borderBottom: '1px solid #f0f0f0',
paddingBottom: 16,
}}
>
{/* 核心:Row+Col 左右分栏布局 */}
<Row gutter={[32, 24]}>
{/* 左侧:表单区域 */}
<Col xs={24} md={14}>
<Form
form={form}
initialValues={initialValues}
labelCol={{ md: 5 }}
wrapperCol={{ md: 19 }}
size="large"
>
<Form.Item name="model" label="型号" rules={[{ required: true, message: '请选择型号' }]}>
<Select placeholder="选择型号">
<Select.Option value="MC700">MC700</Select.Option>
<Select.Option value="MC800">MC800</Select.Option>
<Select.Option value="MC900">MC900</Select.Option>
</Select>
</Form.Item>
<Form.Item name="config" label="配置" rules={[{ required: true, message: '请选择配置' }]}>
<Select placeholder="选择配置">
<Select.Option value="AIR">AIR</Select.Option>
<Select.Option value="PRO">PRO</Select.Option>
<Select.Option value="MAX">MAX</Select.Option>
</Select>
</Form.Item>
<Form.Item name="type" label="类型" rules={[{ required: true, message: '请选择类型' }]}>
<Select placeholder="选择类型">
<Select.Option value="mower">割草机</Select.Option>
<Select.Option value="vacuum">巡检机</Select.Option>
</Select>
</Form.Item>
<Form.Item name="country" label="国家" rules={[{ required: true, message: '请选择国家' }]}>
<Select placeholder="选择国家">
<Select.Option value="中国">中国</Select.Option>
<Select.Option value="美国">美国</Select.Option>
<Select.Option value="日本">日本</Select.Option>
</Select>
</Form.Item>
<Form.Item name="province" label="省份" rules={[{ required: true, message: '请选择省份' }]}>
<Select placeholder="选择省份">
<Select.Option value="江苏">江苏</Select.Option>
<Select.Option value="浙江">浙江</Select.Option>
<Select.Option value="广东">广东</Select.Option>
</Select>
</Form.Item>
<Form.Item name="code" label="编号" rules={[{ required: true, message: '请输入编号' }]}>
<Input placeholder="请输入唯一编号" />
</Form.Item>
<Form.Item wrapperCol={{ offset: 5 }} style={{ marginTop: 10 }}>
<Button type="primary" onClick={generateQRCode} block>
生成二维码(带时间戳)
</Button>
</Form.Item>
</Form>
{/* 查询区域(放在左侧底部) */}
<div style={{
marginTop: 20,
padding: '16px',
background: '#f9fbfc',
borderRadius: 8,
border: '1px solid #e8e8e8'
}}>
<div style={{ marginBottom: 10, fontWeight: 500, color: '#1677ff' }}>
🔍 查询历史二维码
</div>
<Space.Compact style={{ width: '100%' }}>
<Input
placeholder="输入编号查询"
value={queryCode}
onChange={(e) => setQueryCode(e.target.value)}
/>
<Button type="primary" loading={queryLoading} onClick={handleQueryQRCode}>
查询二维码
</Button>
</Space.Compact>
</div>
</Col>
{/* 右侧:二维码内容+图片区域(固定在右侧,不拉长页面) */}
<Col xs={24} md={10}>
<div style={{
height: '100%',
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
padding: '20px',
background: '#fafafa',
borderRadius: 12,
border: '1px dashed #d9d9d9',
minHeight: 480,
}}>
{/* 二维码内容文字(右侧顶部) */}
{qrText && (
<div style={{
padding: '12px 16px',
background: '#e6f7ff',
borderRadius: 8,
marginBottom: 20,
width: '100%',
textAlign: 'center',
}}>
<Text strong style={{ fontSize: 14, color: '#0050b3', wordBreak: 'break-all' }}>
二维码内容:{qrText}
</Text>
</div>
)}
{/* 二维码图片(右侧中间) */}
{qrUrl ? (
<div style={{ textAlign: 'center' }}>
<img
ref={qrRef}
src={qrUrl}
alt="二维码"
style={{
width: 240,
height: 240,
borderRadius: 8,
boxShadow: '0 2px 12px rgba(0,0,0,0.1)',
}}
/>
</div>
) : (
<div style={{ color: '#999', textAlign: 'center', padding: '60px 0' }}>
请先生成二维码
</div>
)}
{/* 操作按钮(右侧底部) */}
<Space size="middle" style={{ marginTop: 24 }}>
<Button onClick={() => qrRef.current && window.open(qrRef.current.src)}>
下载二维码
</Button>
<Button type="primary" loading={loading} onClick={saveToDatabase}>
保存到数据库
</Button>
</Space>
</div>
</Col>
</Row>
</Card>
</div>
);
};
export default SerialNumGenerate;

View File

@@ -10,6 +10,7 @@ import Alerts from '../pages/Alerts';
import Downloads from '../pages/Downloads';
import Roles from '../pages/Roles';
import Users from '../pages/Users';
import SerialNumGenerate from '../pages/SerialNumGenerate';
export const router = createBrowserRouter([
{
@@ -51,6 +52,10 @@ export const router = createBrowserRouter([
path: 'users',
element: <Users />,
},
{
path: 'serialNumGenerate',
element: <SerialNumGenerate />,
},
{
path: '*',
element: <div className="p-10 text-center font-bold text-gray-400">模块开发中...</div>,