diff --git a/crop-x/next-env.d.ts b/crop-x/next-env.d.ts
new file mode 100644
index 0000000..830fb59
--- /dev/null
+++ b/crop-x/next-env.d.ts
@@ -0,0 +1,6 @@
+///
+///
+///
+
+// NOTE: This file should not be edited
+// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
diff --git a/crop-x/package-lock.json b/crop-x/package-lock.json
index 94c7cdf..416f5a4 100644
--- a/crop-x/package-lock.json
+++ b/crop-x/package-lock.json
@@ -42,11 +42,12 @@
"embla-carousel-react": "^8.6.0",
"input-otp": "^1.4.2",
"lucide-react": "^0.487.0",
+ "next": "^15.5.6",
"next-themes": "^0.4.6",
"qrcode": "*",
- "react": "^18.3.1",
+ "react": "^19.2.0",
"react-day-picker": "^8.10.1",
- "react-dom": "^18.3.1",
+ "react-dom": "^19.2.0",
"react-hook-form": "^7.55.0",
"react-resizable-panels": "^2.1.7",
"recharts": "^2.15.2",
@@ -75,7 +76,7 @@
"prettier": "^3.3.3",
"tailwindcss": "^4.1.14",
"typescript": "^5.6.2",
- "vite": "6.3.5"
+ "vite": "^6.4.0"
}
},
"node_modules/@alloc/quick-lru": {
@@ -99,6 +100,16 @@
"node": ">=6.9.0"
}
},
+ "node_modules/@emnapi/runtime": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.5.0.tgz",
+ "integrity": "sha512-97/BJ3iXHww3djw6hYIfErCZFee7qCtrneuLa20UXFCOTCfBM2cvQHjWJ2EG0s0MtdNwInarqCTz35i4wWXHsQ==",
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.4.0"
+ }
+ },
"node_modules/@esbuild/aix-ppc64": {
"version": "0.25.11",
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.11.tgz",
@@ -820,6 +831,434 @@
"url": "https://github.com/sponsors/nzakas"
}
},
+ "node_modules/@img/colour": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.0.0.tgz",
+ "integrity": "sha512-A5P/LfWGFSl6nsckYtjw9da+19jB8hkJ6ACTGcDfEJ0aE+l2n2El7dsVM7UVHZQ9s2lmYMWlrS21YLy2IR1LUw==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@img/sharp-darwin-arm64": {
+ "version": "0.34.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.4.tgz",
+ "integrity": "sha512-sitdlPzDVyvmINUdJle3TNHl+AG9QcwiAMsXmccqsCOMZNIdW2/7S26w0LyU8euiLVzFBL3dXPwVCq/ODnf2vA==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-darwin-arm64": "1.2.3"
+ }
+ },
+ "node_modules/@img/sharp-darwin-x64": {
+ "version": "0.34.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.4.tgz",
+ "integrity": "sha512-rZheupWIoa3+SOdF/IcUe1ah4ZDpKBGWcsPX6MT0lYniH9micvIU7HQkYTfrx5Xi8u+YqwLtxC/3vl8TQN6rMg==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-darwin-x64": "1.2.3"
+ }
+ },
+ "node_modules/@img/sharp-libvips-darwin-arm64": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.3.tgz",
+ "integrity": "sha512-QzWAKo7kpHxbuHqUC28DZ9pIKpSi2ts2OJnoIGI26+HMgq92ZZ4vk8iJd4XsxN+tYfNJxzH6W62X5eTcsBymHw==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-darwin-x64": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.3.tgz",
+ "integrity": "sha512-Ju+g2xn1E2AKO6YBhxjj+ACcsPQRHT0bhpglxcEf+3uyPY+/gL8veniKoo96335ZaPo03bdDXMv0t+BBFAbmRA==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linux-arm": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.3.tgz",
+ "integrity": "sha512-x1uE93lyP6wEwGvgAIV0gP6zmaL/a0tGzJs/BIDDG0zeBhMnuUPm7ptxGhUbcGs4okDJrk4nxgrmxpib9g6HpA==",
+ "cpu": [
+ "arm"
+ ],
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linux-arm64": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.3.tgz",
+ "integrity": "sha512-I4RxkXU90cpufazhGPyVujYwfIm9Nk1QDEmiIsaPwdnm013F7RIceaCc87kAH+oUB1ezqEvC6ga4m7MSlqsJvQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linux-ppc64": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.3.tgz",
+ "integrity": "sha512-Y2T7IsQvJLMCBM+pmPbM3bKT/yYJvVtLJGfCs4Sp95SjvnFIjynbjzsa7dY1fRJX45FTSfDksbTp6AGWudiyCg==",
+ "cpu": [
+ "ppc64"
+ ],
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linux-s390x": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.3.tgz",
+ "integrity": "sha512-RgWrs/gVU7f+K7P+KeHFaBAJlNkD1nIZuVXdQv6S+fNA6syCcoboNjsV2Pou7zNlVdNQoQUpQTk8SWDHUA3y/w==",
+ "cpu": [
+ "s390x"
+ ],
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linux-x64": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.3.tgz",
+ "integrity": "sha512-3JU7LmR85K6bBiRzSUc/Ff9JBVIFVvq6bomKE0e63UXGeRw2HPVEjoJke1Yx+iU4rL7/7kUjES4dZ/81Qjhyxg==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linuxmusl-arm64": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.3.tgz",
+ "integrity": "sha512-F9q83RZ8yaCwENw1GieztSfj5msz7GGykG/BA+MOUefvER69K/ubgFHNeSyUu64amHIYKGDs4sRCMzXVj8sEyw==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linuxmusl-x64": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.3.tgz",
+ "integrity": "sha512-U5PUY5jbc45ANM6tSJpsgqmBF/VsL6LnxJmIf11kB7J5DctHgqm0SkuXzVWtIY90GnJxKnC/JT251TDnk1fu/g==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-linux-arm": {
+ "version": "0.34.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.4.tgz",
+ "integrity": "sha512-Xyam4mlqM0KkTHYVSuc6wXRmM7LGN0P12li03jAnZ3EJWZqj83+hi8Y9UxZUbxsgsK1qOEwg7O0Bc0LjqQVtxA==",
+ "cpu": [
+ "arm"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linux-arm": "1.2.3"
+ }
+ },
+ "node_modules/@img/sharp-linux-arm64": {
+ "version": "0.34.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.4.tgz",
+ "integrity": "sha512-YXU1F/mN/Wu786tl72CyJjP/Ngl8mGHN1hST4BGl+hiW5jhCnV2uRVTNOcaYPs73NeT/H8Upm3y9582JVuZHrQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linux-arm64": "1.2.3"
+ }
+ },
+ "node_modules/@img/sharp-linux-ppc64": {
+ "version": "0.34.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.4.tgz",
+ "integrity": "sha512-F4PDtF4Cy8L8hXA2p3TO6s4aDt93v+LKmpcYFLAVdkkD3hSxZzee0rh6/+94FpAynsuMpLX5h+LRsSG3rIciUQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linux-ppc64": "1.2.3"
+ }
+ },
+ "node_modules/@img/sharp-linux-s390x": {
+ "version": "0.34.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.4.tgz",
+ "integrity": "sha512-qVrZKE9Bsnzy+myf7lFKvng6bQzhNUAYcVORq2P7bDlvmF6u2sCmK2KyEQEBdYk+u3T01pVsPrkj943T1aJAsw==",
+ "cpu": [
+ "s390x"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linux-s390x": "1.2.3"
+ }
+ },
+ "node_modules/@img/sharp-linux-x64": {
+ "version": "0.34.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.4.tgz",
+ "integrity": "sha512-ZfGtcp2xS51iG79c6Vhw9CWqQC8l2Ot8dygxoDoIQPTat/Ov3qAa8qpxSrtAEAJW+UjTXc4yxCjNfxm4h6Xm2A==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linux-x64": "1.2.3"
+ }
+ },
+ "node_modules/@img/sharp-linuxmusl-arm64": {
+ "version": "0.34.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.4.tgz",
+ "integrity": "sha512-8hDVvW9eu4yHWnjaOOR8kHVrew1iIX+MUgwxSuH2XyYeNRtLUe4VNioSqbNkB7ZYQJj9rUTT4PyRscyk2PXFKA==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linuxmusl-arm64": "1.2.3"
+ }
+ },
+ "node_modules/@img/sharp-linuxmusl-x64": {
+ "version": "0.34.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.4.tgz",
+ "integrity": "sha512-lU0aA5L8QTlfKjpDCEFOZsTYGn3AEiO6db8W5aQDxj0nQkVrZWmN3ZP9sYKWJdtq3PWPhUNlqehWyXpYDcI9Sg==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linuxmusl-x64": "1.2.3"
+ }
+ },
+ "node_modules/@img/sharp-wasm32": {
+ "version": "0.34.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.4.tgz",
+ "integrity": "sha512-33QL6ZO/qpRyG7woB/HUALz28WnTMI2W1jgX3Nu2bypqLIKx/QKMILLJzJjI+SIbvXdG9fUnmrxR7vbi1sTBeA==",
+ "cpu": [
+ "wasm32"
+ ],
+ "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT",
+ "optional": true,
+ "dependencies": {
+ "@emnapi/runtime": "^1.5.0"
+ },
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-win32-arm64": {
+ "version": "0.34.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.4.tgz",
+ "integrity": "sha512-2Q250do/5WXTwxW3zjsEuMSv5sUU4Tq9VThWKlU2EYLm4MB7ZeMwF+SFJutldYODXF6jzc6YEOC+VfX0SZQPqA==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "Apache-2.0 AND LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-win32-ia32": {
+ "version": "0.34.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.4.tgz",
+ "integrity": "sha512-3ZeLue5V82dT92CNL6rsal6I2weKw1cYu+rGKm8fOCCtJTR2gYeUfY3FqUnIJsMUPIH68oS5jmZ0NiJ508YpEw==",
+ "cpu": [
+ "ia32"
+ ],
+ "license": "Apache-2.0 AND LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-win32-x64": {
+ "version": "0.34.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.4.tgz",
+ "integrity": "sha512-xIyj4wpYs8J18sVN3mSQjwrw7fKUqRw+Z5rnHNCy5fYTxigBz81u5mOMPmFumwjcn8+ld1ppptMBCLic1nz6ig==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "Apache-2.0 AND LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
"node_modules/@isaacs/fs-minipass": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz",
@@ -877,6 +1316,140 @@
"@jridgewell/sourcemap-codec": "^1.4.14"
}
},
+ "node_modules/@next/env": {
+ "version": "15.5.6",
+ "resolved": "https://registry.npmjs.org/@next/env/-/env-15.5.6.tgz",
+ "integrity": "sha512-3qBGRW+sCGzgbpc5TS1a0p7eNxnOarGVQhZxfvTdnV0gFI61lX7QNtQ4V1TSREctXzYn5NetbUsLvyqwLFJM6Q==",
+ "license": "MIT"
+ },
+ "node_modules/@next/swc-darwin-arm64": {
+ "version": "15.5.6",
+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.5.6.tgz",
+ "integrity": "sha512-ES3nRz7N+L5Umz4KoGfZ4XX6gwHplwPhioVRc25+QNsDa7RtUF/z8wJcbuQ2Tffm5RZwuN2A063eapoJ1u4nPg==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-darwin-x64": {
+ "version": "15.5.6",
+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.5.6.tgz",
+ "integrity": "sha512-JIGcytAyk9LQp2/nuVZPAtj8uaJ/zZhsKOASTjxDug0SPU9LAM3wy6nPU735M1OqacR4U20LHVF5v5Wnl9ptTA==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-linux-arm64-gnu": {
+ "version": "15.5.6",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.5.6.tgz",
+ "integrity": "sha512-qvz4SVKQ0P3/Im9zcS2RmfFL/UCQnsJKJwQSkissbngnB/12c6bZTCB0gHTexz1s6d/mD0+egPKXAIRFVS7hQg==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-linux-arm64-musl": {
+ "version": "15.5.6",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.5.6.tgz",
+ "integrity": "sha512-FsbGVw3SJz1hZlvnWD+T6GFgV9/NYDeLTNQB2MXoPN5u9VA9OEDy6fJEfePfsUKAhJufFbZLgp0cPxMuV6SV0w==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-linux-x64-gnu": {
+ "version": "15.5.6",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.5.6.tgz",
+ "integrity": "sha512-3QnHGFWlnvAgyxFxt2Ny8PTpXtQD7kVEeaFat5oPAHHI192WKYB+VIKZijtHLGdBBvc16tiAkPTDmQNOQ0dyrA==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-linux-x64-musl": {
+ "version": "15.5.6",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.5.6.tgz",
+ "integrity": "sha512-OsGX148sL+TqMK9YFaPFPoIaJKbFJJxFzkXZljIgA9hjMjdruKht6xDCEv1HLtlLNfkx3c5w2GLKhj7veBQizQ==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-win32-arm64-msvc": {
+ "version": "15.5.6",
+ "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.5.6.tgz",
+ "integrity": "sha512-ONOMrqWxdzXDJNh2n60H6gGyKed42Ieu6UTVPZteXpuKbLZTH4G4eBMsr5qWgOBA+s7F+uB4OJbZnrkEDnZ5Fg==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-win32-x64-msvc": {
+ "version": "15.5.6",
+ "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.5.6.tgz",
+ "integrity": "sha512-pxK4VIjFRx1MY92UycLOOw7dTdvccWsNETQ0kDHkBlcFH1GrTLUjSiHU1ohrznnux6TqRHgv5oflhfIWZwVROQ==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
"node_modules/@nodelib/fs.scandir": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
@@ -2766,6 +3339,18 @@
"dev": true,
"license": "Apache-2.0"
},
+ "node_modules/@swc/helpers": {
+ "version": "0.5.17",
+ "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.17.tgz",
+ "integrity": "sha512-5IKx/Y13RsYd+sauPb2x+U/xZikHjolzfuDgTAl/Tdf3Q8rslRvC19NKDLgAJQ6wsqADk10ntlv08nPFw/gO/A==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "peer": true,
+ "dependencies": {
+ "tslib": "^2.8.0"
+ }
+ },
"node_modules/@swc/types": {
"version": "0.1.25",
"resolved": "https://registry.npmjs.org/@swc/types/-/types-0.1.25.tgz",
@@ -3135,7 +3720,6 @@
"integrity": "sha512-hRnu+5qggKDSyWHlnmThnUqg62l29Aj/6vcYgUaSFL9oc7DVjeWEQN3PRgdSc6F8d9QRMWkf36CLMch1Do/+RQ==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"undici-types": "~6.21.0"
}
@@ -3153,7 +3737,6 @@
"integrity": "sha512-RFA/bURkcKzx/X9oumPG9Vp3D3JUgus/d0b67KB0t5S/raciymilkOa66olh78MUI92QLbEJevO7rvqU/kjwKA==",
"devOptional": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"@types/prop-types": "*",
"csstype": "^3.0.2"
@@ -3165,7 +3748,6 @@
"integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==",
"devOptional": true,
"license": "MIT",
- "peer": true,
"peerDependencies": {
"@types/react": "^18.0.0"
}
@@ -3206,7 +3788,6 @@
"integrity": "sha512-6JSSaBZmsKvEkbRUkf7Zj7dru/8ZCrJxAqArcLaVMee5907JdtEbKGsZ7zNiIm/UAkpGUkaSMZEXShnN2D1HZA==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"@typescript-eslint/scope-manager": "8.46.1",
"@typescript-eslint/types": "8.46.1",
@@ -3426,7 +4007,6 @@
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
"dev": true,
"license": "MIT",
- "peer": true,
"bin": {
"acorn": "bin/acorn"
},
@@ -3622,7 +4202,6 @@
}
],
"license": "MIT",
- "peer": true,
"dependencies": {
"baseline-browser-mapping": "^2.8.9",
"caniuse-lite": "^1.0.30001746",
@@ -3660,7 +4239,6 @@
"version": "1.0.30001751",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001751.tgz",
"integrity": "sha512-A0QJhug0Ly64Ii3eIqHu5X51ebln3k4yTUkY1j8drqpWHVreg/VLijN48cZ1bYPiqOQuqpkIKnzr/Ul8V+p6Cw==",
- "dev": true,
"funding": [
{
"type": "opencollective",
@@ -3748,6 +4326,12 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/client-only": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz",
+ "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==",
+ "license": "MIT"
+ },
"node_modules/cliui": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
@@ -4037,7 +4621,6 @@
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.6.0.tgz",
"integrity": "sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==",
"license": "MIT",
- "peer": true,
"funding": {
"type": "github",
"url": "https://github.com/sponsors/kossnocorp"
@@ -4125,8 +4708,7 @@
"version": "8.6.0",
"resolved": "https://registry.npmjs.org/embla-carousel/-/embla-carousel-8.6.0.tgz",
"integrity": "sha512-SjWyZBHJPbqxHOzckOfo8lHisEaJWmwd23XppYFYVh10bU66/Pn5tkVkbkCMZVdbUE5eTCI2nD8OyIP4Z+uwkA==",
- "license": "MIT",
- "peer": true
+ "license": "MIT"
},
"node_modules/embla-carousel-react": {
"version": "8.6.0",
@@ -4254,7 +4836,6 @@
"integrity": "sha512-XyLmROnACWqSxiGYArdef1fItQd47weqB7iwtfr9JHwRrqIXZdcFMvvEcL9xHCmL0SNsOvF0c42lWyM1U5dgig==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.8.0",
"@eslint-community/regexpp": "^4.12.1",
@@ -5556,6 +6137,58 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/next": {
+ "version": "15.5.6",
+ "resolved": "https://registry.npmjs.org/next/-/next-15.5.6.tgz",
+ "integrity": "sha512-zTxsnI3LQo3c9HSdSf91O1jMNsEzIXDShXd4wVdg9y5shwLqBXi4ZtUUJyB86KGVSJLZx0PFONvO54aheGX8QQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@next/env": "15.5.6",
+ "@swc/helpers": "0.5.15",
+ "caniuse-lite": "^1.0.30001579",
+ "postcss": "8.4.31",
+ "styled-jsx": "5.1.6"
+ },
+ "bin": {
+ "next": "dist/bin/next"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^19.8.0 || >= 20.0.0"
+ },
+ "optionalDependencies": {
+ "@next/swc-darwin-arm64": "15.5.6",
+ "@next/swc-darwin-x64": "15.5.6",
+ "@next/swc-linux-arm64-gnu": "15.5.6",
+ "@next/swc-linux-arm64-musl": "15.5.6",
+ "@next/swc-linux-x64-gnu": "15.5.6",
+ "@next/swc-linux-x64-musl": "15.5.6",
+ "@next/swc-win32-arm64-msvc": "15.5.6",
+ "@next/swc-win32-x64-msvc": "15.5.6",
+ "sharp": "^0.34.3"
+ },
+ "peerDependencies": {
+ "@opentelemetry/api": "^1.1.0",
+ "@playwright/test": "^1.51.1",
+ "babel-plugin-react-compiler": "*",
+ "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0",
+ "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0",
+ "sass": "^1.3.0"
+ },
+ "peerDependenciesMeta": {
+ "@opentelemetry/api": {
+ "optional": true
+ },
+ "@playwright/test": {
+ "optional": true
+ },
+ "babel-plugin-react-compiler": {
+ "optional": true
+ },
+ "sass": {
+ "optional": true
+ }
+ }
+ },
"node_modules/next-themes": {
"version": "0.4.6",
"resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.4.6.tgz",
@@ -5566,6 +6199,43 @@
"react-dom": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc"
}
},
+ "node_modules/next/node_modules/@swc/helpers": {
+ "version": "0.5.15",
+ "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz",
+ "integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "tslib": "^2.8.0"
+ }
+ },
+ "node_modules/next/node_modules/postcss": {
+ "version": "8.4.31",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz",
+ "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==",
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/postcss/"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/postcss"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "nanoid": "^3.3.6",
+ "picocolors": "^1.0.0",
+ "source-map-js": "^1.0.2"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >=14"
+ }
+ },
"node_modules/node-releases": {
"version": "2.0.25",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.25.tgz",
@@ -7989,7 +8659,6 @@
"dev": true,
"inBundle": true,
"license": "MIT",
- "peer": true,
"engines": {
"node": ">=12"
},
@@ -8398,7 +9067,6 @@
}
],
"license": "MIT",
- "peer": true,
"dependencies": {
"nanoid": "^3.3.11",
"picocolors": "^1.1.1",
@@ -8507,14 +9175,10 @@
"license": "MIT"
},
"node_modules/react": {
- "version": "18.3.1",
- "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz",
- "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==",
+ "version": "19.2.0",
+ "resolved": "https://registry.npmjs.org/react/-/react-19.2.0.tgz",
+ "integrity": "sha512-tmbWg6W31tQLeB5cdIBOicJDJRR2KzXsV7uSK9iNfLWQ5bIZfxuPEHp7M8wiHyHnn0DD1i7w3Zmin0FtkrwoCQ==",
"license": "MIT",
- "peer": true,
- "dependencies": {
- "loose-envify": "^1.1.0"
- },
"engines": {
"node": ">=0.10.0"
}
@@ -8534,17 +9198,15 @@
}
},
"node_modules/react-dom": {
- "version": "18.3.1",
- "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz",
- "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==",
+ "version": "19.2.0",
+ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.0.tgz",
+ "integrity": "sha512-UlbRu4cAiGaIewkPyiRGJk0imDN2T3JjieT6spoL2UeSf5od4n5LB/mQ4ejmxhCFT1tYe8IvaFulzynWovsEFQ==",
"license": "MIT",
- "peer": true,
"dependencies": {
- "loose-envify": "^1.1.0",
- "scheduler": "^0.23.2"
+ "scheduler": "^0.27.0"
},
"peerDependencies": {
- "react": "^18.3.1"
+ "react": "^19.2.0"
}
},
"node_modules/react-hook-form": {
@@ -8860,19 +9522,16 @@
}
},
"node_modules/scheduler": {
- "version": "0.23.2",
- "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz",
- "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==",
- "license": "MIT",
- "dependencies": {
- "loose-envify": "^1.1.0"
- }
+ "version": "0.27.0",
+ "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz",
+ "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==",
+ "license": "MIT"
},
"node_modules/semver": {
"version": "7.7.3",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz",
"integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==",
- "dev": true,
+ "devOptional": true,
"license": "ISC",
"bin": {
"semver": "bin/semver.js"
@@ -8887,6 +9546,49 @@
"integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==",
"license": "ISC"
},
+ "node_modules/sharp": {
+ "version": "0.34.4",
+ "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.4.tgz",
+ "integrity": "sha512-FUH39xp3SBPnxWvd5iib1X8XY7J0K0X7d93sie9CJg2PO8/7gmg89Nve6OjItK53/MlAushNNxteBYfM6DEuoA==",
+ "hasInstallScript": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "dependencies": {
+ "@img/colour": "^1.0.0",
+ "detect-libc": "^2.1.0",
+ "semver": "^7.7.2"
+ },
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-darwin-arm64": "0.34.4",
+ "@img/sharp-darwin-x64": "0.34.4",
+ "@img/sharp-libvips-darwin-arm64": "1.2.3",
+ "@img/sharp-libvips-darwin-x64": "1.2.3",
+ "@img/sharp-libvips-linux-arm": "1.2.3",
+ "@img/sharp-libvips-linux-arm64": "1.2.3",
+ "@img/sharp-libvips-linux-ppc64": "1.2.3",
+ "@img/sharp-libvips-linux-s390x": "1.2.3",
+ "@img/sharp-libvips-linux-x64": "1.2.3",
+ "@img/sharp-libvips-linuxmusl-arm64": "1.2.3",
+ "@img/sharp-libvips-linuxmusl-x64": "1.2.3",
+ "@img/sharp-linux-arm": "0.34.4",
+ "@img/sharp-linux-arm64": "0.34.4",
+ "@img/sharp-linux-ppc64": "0.34.4",
+ "@img/sharp-linux-s390x": "0.34.4",
+ "@img/sharp-linux-x64": "0.34.4",
+ "@img/sharp-linuxmusl-arm64": "0.34.4",
+ "@img/sharp-linuxmusl-x64": "0.34.4",
+ "@img/sharp-wasm32": "0.34.4",
+ "@img/sharp-win32-arm64": "0.34.4",
+ "@img/sharp-win32-ia32": "0.34.4",
+ "@img/sharp-win32-x64": "0.34.4"
+ }
+ },
"node_modules/shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
@@ -9042,6 +9744,29 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/styled-jsx": {
+ "version": "5.1.6",
+ "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.6.tgz",
+ "integrity": "sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==",
+ "license": "MIT",
+ "dependencies": {
+ "client-only": "0.0.1"
+ },
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "peerDependencies": {
+ "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0 || ^19.0.0-0"
+ },
+ "peerDependenciesMeta": {
+ "@babel/core": {
+ "optional": true
+ },
+ "babel-plugin-macros": {
+ "optional": true
+ }
+ }
+ },
"node_modules/supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
@@ -9069,8 +9794,7 @@
"version": "4.1.14",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.14.tgz",
"integrity": "sha512-b7pCxjGO98LnxVkKjaZSDeNuljC4ueKUddjENJOADtubtdo8llTaJy7HwBMeLNSSo2N5QIAgklslK1+Ir8r6CA==",
- "license": "MIT",
- "peer": true
+ "license": "MIT"
},
"node_modules/tailwindcss-animate": {
"version": "1.0.7",
@@ -9157,7 +9881,6 @@
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
"dev": true,
"license": "MIT",
- "peer": true,
"engines": {
"node": ">=12"
},
@@ -9216,7 +9939,6 @@
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"dev": true,
"license": "Apache-2.0",
- "peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@@ -9361,12 +10083,11 @@
}
},
"node_modules/vite": {
- "version": "6.3.5",
- "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.5.tgz",
- "integrity": "sha512-cZn6NDFE7wdTpINgs++ZJ4N49W2vRp8LCKrn3Ob1kYNtOo21vfDoaV5GzBfLU4MovSAB8uNRm4jgzVQZ+mBzPQ==",
+ "version": "6.4.0",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.0.tgz",
+ "integrity": "sha512-oLnWs9Hak/LOlKjeSpOwD6JMks8BeICEdYMJBf6P4Lac/pO9tKiv/XhXnAM7nNfSkZahjlCZu9sS50zL8fSnsw==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"esbuild": "^0.25.0",
"fdir": "^6.4.4",
@@ -9460,7 +10181,6 @@
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
"dev": true,
"license": "MIT",
- "peer": true,
"engines": {
"node": ">=12"
},
diff --git a/crop-x/package.json b/crop-x/package.json
index f0e735c..fa6c66e 100644
--- a/crop-x/package.json
+++ b/crop-x/package.json
@@ -5,6 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
+ "next:dev": "next dev --turbopack",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint:fix": "eslint . --ext ts,tsx --fix",
@@ -51,11 +52,12 @@
"embla-carousel-react": "^8.6.0",
"input-otp": "^1.4.2",
"lucide-react": "^0.487.0",
+ "next": "^15.5.6",
"next-themes": "^0.4.6",
"qrcode": "*",
- "react": "^18.3.1",
+ "react": "^19.2.0",
"react-day-picker": "^8.10.1",
- "react-dom": "^18.3.1",
+ "react-dom": "^19.2.0",
"react-hook-form": "^7.55.0",
"react-resizable-panels": "^2.1.7",
"recharts": "^2.15.2",
@@ -84,6 +86,6 @@
"prettier": "^3.3.3",
"tailwindcss": "^4.1.14",
"typescript": "^5.6.2",
- "vite": "6.3.5"
+ "vite": "^6.4.0"
}
}
diff --git a/crop-x/src/App.tsx b/crop-x/src/App.tsx
deleted file mode 100644
index 04db09e..0000000
--- a/crop-x/src/App.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import React from 'react'
-import { useTheme } from '@/hooks/useTheme'
-import Main from '@/components/layouts/Main.tsx'
-function App() {
- return (
-
-
-
- )
-}
-
-export default App
\ No newline at end of file
diff --git a/crop-x/src/app/(auth)/layout.tsx b/crop-x/src/app/(auth)/layout.tsx
new file mode 100644
index 0000000..39fe322
--- /dev/null
+++ b/crop-x/src/app/(auth)/layout.tsx
@@ -0,0 +1,15 @@
+import { ReactNode } from 'react'
+
+export default function AuthLayout({
+ children,
+}: {
+ children: ReactNode
+}) {
+ return (
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/(auth)/login/page.tsx b/crop-x/src/app/(auth)/login/page.tsx
new file mode 100644
index 0000000..f45d758
--- /dev/null
+++ b/crop-x/src/app/(auth)/login/page.tsx
@@ -0,0 +1,84 @@
+import { Metadata } from 'next'
+import Link from 'next/link'
+
+export const metadata: Metadata = {
+ title: '登录 - Crop-X 智慧农业管理系统',
+ description: '用户登录页面',
+}
+
+export default function LoginPage() {
+ return (
+
+
+
🌱
+
+ Crop-X 智慧农业
+
+
+ 登录您的账户
+
+
+
+
+
+
+
+ 还没有账户?{' '}
+
+ 立即注册
+
+
+
+
+
+
+ © 2024 Crop-X. All rights reserved.
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/(auth)/register/page.tsx b/crop-x/src/app/(auth)/register/page.tsx
new file mode 100644
index 0000000..2746a71
--- /dev/null
+++ b/crop-x/src/app/(auth)/register/page.tsx
@@ -0,0 +1,121 @@
+import { Metadata } from 'next'
+import Link from 'next/link'
+
+export const metadata: Metadata = {
+ title: '注册 - Crop-X 智慧农业管理系统',
+ description: '用户注册页面',
+}
+
+export default function RegisterPage() {
+ return (
+
+
+
🌱
+
+ Crop-X 智慧农业
+
+
+ 创建您的账户
+
+
+
+
+
+
+
+ 已有账户?{' '}
+
+ 立即登录
+
+
+
+
+
+
+ © 2024 Crop-X. All rights reserved.
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/agricultural-asset/basic-information/asset-labeling/layout.tsx b/crop-x/src/app/agricultural-asset/basic-information/asset-labeling/layout.tsx
new file mode 100644
index 0000000..39b9e33
--- /dev/null
+++ b/crop-x/src/app/agricultural-asset/basic-information/asset-labeling/layout.tsx
@@ -0,0 +1,15 @@
+"use client"
+import '@/styles/globals.css'
+
+export default function RootLayout({
+
+}: {
+ children: React.ReactNode
+}) {
+ return (
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/agricultural-asset/basic-information/asset-labeling/page.tsx b/crop-x/src/app/agricultural-asset/basic-information/asset-labeling/page.tsx
new file mode 100644
index 0000000..7e1e389
--- /dev/null
+++ b/crop-x/src/app/agricultural-asset/basic-information/asset-labeling/page.tsx
@@ -0,0 +1,8 @@
+
+export default function HomePage() {
+ return (
+
+ 资产标签
+
+ )
+ }
\ No newline at end of file
diff --git a/crop-x/src/app/agricultural-asset/layout.tsx b/crop-x/src/app/agricultural-asset/layout.tsx
new file mode 100644
index 0000000..b38674a
--- /dev/null
+++ b/crop-x/src/app/agricultural-asset/layout.tsx
@@ -0,0 +1,22 @@
+import { ReactNode } from 'react'
+
+export default function AgriculturalAssetLayout({
+ children,
+}: {
+ children: ReactNode
+}) {
+ return (
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/agricultural-asset/page.tsx b/crop-x/src/app/agricultural-asset/page.tsx
new file mode 100644
index 0000000..89146ec
--- /dev/null
+++ b/crop-x/src/app/agricultural-asset/page.tsx
@@ -0,0 +1,147 @@
+import Link from 'next/link'
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '农业资产管理 - Crop-X 智慧农业管理系统',
+ description: '农业资产管理系统主页面',
+}
+
+export default function AgriculturalAssetPage() {
+ return (
+
+
+
+ 农业资产管理系统
+
+
+ 管理农业资产信息、采购库存、物资领用和可视化报表
+
+
+
+
+
+ 📋 基础信息管理
+
+
+ 资产信息录入和分类管理
+
+
+
+
+
+ 🛒 采购管理
+
+
+ 采购计划和供应商管理
+
+
+
+
+
+ 📦 库存管理
+
+
+ 库存监控和调整管理
+
+
+
+
+
+ 📤 物资领用管理
+
+
+ 领用申请和审批流程
+
+
+
+
+
+ 📥 物资归还管理
+
+
+ 归还申请和跟踪管理
+
+
+
+
+
+ 🚜 农资农具管理
+
+
+ 农具农资和维护管理
+
+
+
+
+
+ 📊 可视化报表
+
+
+ 资产库存成本分析报表
+
+
+
+
+
+
+
+
+ 📊 资产概览
+
+
+
+ 总资产数
+ 1,245 项
+
+
+ 库存预警
+ 12 项
+
+
+ 待审批申请
+ 8 项
+
+
+
+
+
+
+ 🔧 快速操作
+
+
+
+ 添加新资产
+
+
+ 领用申请
+
+
+ 生成报表
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/agricultural-machinery/archive/machinery-entry/page.tsx b/crop-x/src/app/agricultural-machinery/archive/machinery-entry/page.tsx
new file mode 100644
index 0000000..98383e7
--- /dev/null
+++ b/crop-x/src/app/agricultural-machinery/archive/machinery-entry/page.tsx
@@ -0,0 +1,94 @@
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '农机档案录入与维护 - Crop-X 智慧农业管理系统',
+ description: '农机设备信息管理',
+}
+
+export default function MachineryEntryPage() {
+ return (
+
+
+
+ 📋 农机档案录入与维护
+
+
+
+
+
+
+
+ 农机列表
+
+
+ {[
+ { id: 'NJ001', type: '拖拉机', status: '运行中', date: '2023-01-15' },
+ { id: 'NJ002', type: '收割机', status: '空闲中', date: '2023-03-20' },
+ { id: 'NJ003', type: '播种机', status: '维护中', date: '2023-02-10' },
+ ].map((machine) => (
+
+
+
+
{machine.id}
+
{machine.type}
+
购买日期: {machine.date}
+
+
+ {machine.status}
+
+
+
+ ))}
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/agricultural-machinery/archive/page.tsx b/crop-x/src/app/agricultural-machinery/archive/page.tsx
new file mode 100644
index 0000000..676d4a7
--- /dev/null
+++ b/crop-x/src/app/agricultural-machinery/archive/page.tsx
@@ -0,0 +1,71 @@
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '农机档案管理 - Crop-X 智慧农业管理系统',
+ description: '农机设备档案信息管理',
+}
+
+export default function MachineryArchivePage() {
+ return (
+
+
+
+ 📋 农机档案管理
+
+
+
+
+
+ 📝 农机档案录入与维护
+
+
+ 管理农机设备的基本信息档案
+
+
+
+
+
+ 🏷️ 农机分类与标签管理
+
+
+ 农机设备分类和标签体系管理
+
+
+
+
+
+ 📱 农机二维码管理
+
+
+ 农机设备二维码生成和管理
+
+
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/agricultural-machinery/error.tsx b/crop-x/src/app/agricultural-machinery/error.tsx
new file mode 100644
index 0000000..8a4889d
--- /dev/null
+++ b/crop-x/src/app/agricultural-machinery/error.tsx
@@ -0,0 +1,35 @@
+'use client'
+
+import { useEffect } from 'react'
+
+export default function AgriculturalMachineryError({
+ error,
+ reset,
+}: {
+ error: Error & { digest?: string }
+ reset: () => void
+}) {
+ useEffect(() => {
+ console.error('农机管理系统错误:', error)
+ }, [error])
+
+ return (
+
+
+
🚙
+
+ 农机系统出现了错误
+
+
+ {error.message || '未知系统错误'}
+
+
+ 重新加载
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/agricultural-machinery/layout.tsx b/crop-x/src/app/agricultural-machinery/layout.tsx
new file mode 100644
index 0000000..73f1b99
--- /dev/null
+++ b/crop-x/src/app/agricultural-machinery/layout.tsx
@@ -0,0 +1,22 @@
+import { ReactNode } from 'react'
+
+export default function AgriculturalMachineryLayout({
+ children,
+}: {
+ children: ReactNode
+}) {
+ return (
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/agricultural-machinery/loading.tsx b/crop-x/src/app/agricultural-machinery/loading.tsx
new file mode 100644
index 0000000..02bf776
--- /dev/null
+++ b/crop-x/src/app/agricultural-machinery/loading.tsx
@@ -0,0 +1,10 @@
+export default function AgriculturalMachineryLoading() {
+ return (
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/agricultural-machinery/monitoring/real-time-location-tracking/page.tsx b/crop-x/src/app/agricultural-machinery/monitoring/real-time-location-tracking/page.tsx
new file mode 100644
index 0000000..c83f6ef
--- /dev/null
+++ b/crop-x/src/app/agricultural-machinery/monitoring/real-time-location-tracking/page.tsx
@@ -0,0 +1,93 @@
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '实时位置追踪 - Crop-X 智慧农业管理系统',
+ description: '农机设备定位监控',
+}
+
+export default function RealTimeLocationTrackingPage() {
+ return (
+
+
+
+ 📍 实时位置追踪
+
+
+
+
+
+
+
🗺️
+
+ 地图视图
+
+
+ 实时显示所有农机的地理位置
+
+
+
+
+
+
+
+
+ 在线农机
+
+
+ {[
+ { id: 'NJ001', name: '拖拉机-001', location: '东区农田', status: '工作中' },
+ { id: 'NJ002', name: '收割机-002', location: '西区农田', status: '工作中' },
+ { id: 'NJ003', name: '播种机-003', location: '南区农田', status: '空闲' },
+ ].map((machine) => (
+
+
+
+
{machine.name}
+
{machine.location}
+
+
+
+
+ ))}
+
+
+
+
+
+ 统计信息
+
+
+
+ 总农机数
+ 12 台
+
+
+ 在线
+ 10 台
+
+
+ 离线
+ 2 台
+
+
+
+
+
+
+
+
+ 🔄 刷新位置
+
+
+ 📍 定位特定农机
+
+
+ 📊 历史轨迹
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/agricultural-machinery/page.tsx b/crop-x/src/app/agricultural-machinery/page.tsx
new file mode 100644
index 0000000..90a62c4
--- /dev/null
+++ b/crop-x/src/app/agricultural-machinery/page.tsx
@@ -0,0 +1,93 @@
+import Link from 'next/link'
+
+export default function AgriculturalMachineryPage() {
+ return (
+
+
+
+ 智能农机管理系统
+
+
+ 管理农机设备档案、监控实时状态、优化调度方案
+
+
+
+
+
+ 📋 农机档案录入与维护
+
+
+ 农机设备信息管理
+
+
+
+
+
+ 📍 实时位置追踪
+
+
+ 农机设备定位监控
+
+
+
+
+
+ 📅 任务分配
+
+
+ 农机作业任务分配
+
+
+
+
+
+
+
+
+ 📊 农机状态概览
+
+
+
+ 运行中
+ 12 台
+
+
+ 空闲中
+ 8 台
+
+
+ 维护中
+ 3 台
+
+
+
+
+
+
+ 🔧 快速操作
+
+
+
+ 添加新农机
+
+
+ 生成报表
+
+
+ 批量操作
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/agricultural-machinery/scheduling/task-assignment/page.tsx b/crop-x/src/app/agricultural-machinery/scheduling/task-assignment/page.tsx
new file mode 100644
index 0000000..e5e2232
--- /dev/null
+++ b/crop-x/src/app/agricultural-machinery/scheduling/task-assignment/page.tsx
@@ -0,0 +1,150 @@
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '任务分配 - Crop-X 智慧农业管理系统',
+ description: '农机作业任务分配',
+}
+
+export default function TaskAssignmentPage() {
+ return (
+
+
+
+ 📅 任务分配
+
+
+
+
+
+
+
+ 待分配任务列表
+
+
+ {[
+ { id: 'T001', name: '东区收割作业', priority: '高', deadline: '2024-10-25' },
+ { id: 'T002', name: '南区犁地作业', priority: '中', deadline: '2024-10-26' },
+ { id: 'T003', name: '北区播种作业', priority: '低', deadline: '2024-10-27' },
+ ].map((task) => (
+
+
+
+
{task.name}
+
任务编号: {task.id}
+
截止日期: {task.deadline}
+
+
+
+ {task.priority}优先级
+
+
+
+ 分配任务
+
+
+
+
+ ))}
+
+
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/ai-crop-model/layout.tsx b/crop-x/src/app/ai-crop-model/layout.tsx
new file mode 100644
index 0000000..59fda22
--- /dev/null
+++ b/crop-x/src/app/ai-crop-model/layout.tsx
@@ -0,0 +1,22 @@
+import { ReactNode } from 'react'
+
+export default function AiCropModelLayout({
+ children,
+}: {
+ children: ReactNode
+}) {
+ return (
+
+
+
+
+ 🤖 AI作物模型精准决策系统
+
+
+
+
+ {children}
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/ai-crop-model/page.tsx b/crop-x/src/app/ai-crop-model/page.tsx
new file mode 100644
index 0000000..58ad07d
--- /dev/null
+++ b/crop-x/src/app/ai-crop-model/page.tsx
@@ -0,0 +1,159 @@
+import Link from 'next/link'
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: 'AI作物模型 - Crop-X 智慧农业管理系统',
+ description: 'AI作物模型精准决策系统主页面',
+}
+
+export default function AiCropModelPage() {
+ return (
+
+
+
+ AI作物模型精准决策系统
+
+
+ 数据感知、模型集成、智能决策和AI知识库管理
+
+
+
+
+
+ 📊 数据感知中心
+
+
+ 实时数据采集和多源融合
+
+
+
+
+
+ 🔗 模型集成中心
+
+
+ 模型接入和版本控制
+
+
+
+
+
+ 🎯 模型应用中心
+
+
+ 预测分析和优化建议
+
+
+
+
+
+ 🧠 智能决策生成
+
+
+ 决策引擎和规则配置
+
+
+
+
+
+ 💡 智能决策支持
+
+
+ 决策可视化和影响评估
+
+
+
+
+
+ ⚡ 决策应用
+
+
+ 自动执行和反馈收集
+
+
+
+
+
+ 📚 AI知识库
+
+
+ 模型文档和案例数据库
+
+
+
+
+
+ 📈 监控中心
+
+
+ 模型性能和系统健康监控
+
+
+
+
+
+
+
+
+ 📊 AI模型状态
+
+
+
+ 活跃模型数
+ 24 个
+
+
+ 今日决策数
+ 156 次
+
+
+ 模型准确率
+ 94.5%
+
+
+
+
+
+
+ 🔧 快速操作
+
+
+
+ 训练新模型
+
+
+ 生成决策
+
+
+ 查看报告
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/layout.tsx b/crop-x/src/app/central-config/layout.tsx
new file mode 100644
index 0000000..05963ad
--- /dev/null
+++ b/crop-x/src/app/central-config/layout.tsx
@@ -0,0 +1,133 @@
+"use client"
+import { ReactNode } from 'react'
+import SideBar from '@/components/layouts/SideBar/SideBar'
+
+// 中心配置路由数据
+const centralConfigData = {
+ versions: ["1.0.0", "2.0.0"],
+ navMain: [
+ {
+ title: "租户管理",
+ url: "/central-config/tenant-management",
+ icon: "🏢",
+ items: [
+ {
+ title: "租户创建管理",
+ url: "/central-config/tenant-management/tenant-creation",
+ isActive: false
+ },
+ {
+ title: "租户配置管理",
+ url: "/central-config/tenant-management/tenant-configuration",
+ isActive: false
+ },
+ {
+ title: "租户授权管理",
+ url: "/central-config/tenant-management/tenant-authorization",
+ isActive: false
+ }
+ ]
+ },
+ {
+ title: "用户管理",
+ url: "/central-config/user-management",
+ icon: "👥",
+ items: [
+ {
+ title: "用户账号管理",
+ url: "/central-config/user-management/user-account-management",
+ isActive: false
+ },
+ {
+ title: "角色权限管理",
+ url: "/central-config/user-management/role-permission-management",
+ isActive: false
+ },
+ {
+ title: "用户行为跟踪",
+ url: "/central-config/user-management/user-behavior-tracking",
+ isActive: false
+ }
+ ]
+ },
+ {
+ title: "系统参数",
+ url: "/central-config/system-parameters",
+ icon: "🔧",
+ items: [
+ {
+ title: "基础配置管理",
+ url: "/central-config/system-parameters/basic-configuration",
+ isActive: false
+ },
+ {
+ title: "业务规则设置",
+ url: "/central-config/system-parameters/business-rule-settings",
+ isActive: false
+ },
+ {
+ title: "接口配置管理",
+ url: "/central-config/system-parameters/interface-configuration",
+ isActive: false
+ }
+ ]
+ },
+ {
+ title: "系统监控",
+ url: "/central-config/system-monitoring",
+ icon: "📈",
+ items: [
+ {
+ title: "性能监控管理",
+ url: "/central-config/system-monitoring/performance-monitoring",
+ isActive: false
+ },
+ {
+ title: "日志管理",
+ url: "/central-config/system-monitoring/log-management",
+ isActive: false
+ },
+ {
+ title: "异常处理管理",
+ url: "/central-config/system-monitoring/exception-handling",
+ isActive: false
+ }
+ ]
+ },
+ {
+ title: "消息中心",
+ url: "/central-config/message-center",
+ icon: "📨",
+ items: [
+ {
+ title: "消息推送管理",
+ url: "/central-config/message-center/message-push-management",
+ isActive: false
+ },
+ {
+ title: "消息发送",
+ url: "/central-config/message-center/message-send",
+ isActive: false
+ },
+ {
+ title: "通知设置管理",
+ url: "/central-config/message-center/notification-settings",
+ isActive: false
+ },
+ {
+ title: "反馈管理",
+ url: "/central-config/message-center/feedback-management",
+ isActive: false
+ }
+ ]
+ }
+ ]
+}
+
+export default function CentralConfigLayout({
+ children,
+}: {
+ children: ReactNode
+}) {
+ return {children}
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/message-center/layout.tsx b/crop-x/src/app/central-config/message-center/layout.tsx
new file mode 100644
index 0000000..1980cba
--- /dev/null
+++ b/crop-x/src/app/central-config/message-center/layout.tsx
@@ -0,0 +1,22 @@
+import { ReactNode } from 'react'
+
+export default function MessageCenterLayout({
+ children,
+}: {
+ children: ReactNode
+}) {
+ return (
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/message-center/message-send/page.tsx b/crop-x/src/app/central-config/message-center/message-send/page.tsx
new file mode 100644
index 0000000..c34efcd
--- /dev/null
+++ b/crop-x/src/app/central-config/message-center/message-send/page.tsx
@@ -0,0 +1,146 @@
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '消息发送 - Crop-X 智慧农业管理系统',
+ description: '消息推送管理页面',
+}
+
+export default function MessageSendPage() {
+ return (
+
+
+
+ 📤 消息发送管理
+
+
+
+
+
+
+
+ 最近发送记录
+
+
+ {[
+ { id: 'MSG001', title: '系统维护通知', recipients: '全体用户', time: '2024-10-20 14:30', status: '已发送' },
+ { id: 'MSG002', title: '农机任务分配', recipients: '农机操作员', time: '2024-10-20 12:15', status: '已发送' },
+ { id: 'MSG003', title: '天气预警', recipients: '农场管理员', time: '2024-10-20 09:45', status: '已发送' },
+ { id: 'MSG004', title: '数据备份提醒', recipients: '系统管理员', time: '2024-10-19 23:00', status: '已发送' },
+ ].map((message) => (
+
+
+
+
{message.title}
+
接收人: {message.recipients}
+
{message.time}
+
+
+ {message.status}
+
+
+
+ ))}
+
+
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/message-center/page.tsx b/crop-x/src/app/central-config/message-center/page.tsx
new file mode 100644
index 0000000..d650ea4
--- /dev/null
+++ b/crop-x/src/app/central-config/message-center/page.tsx
@@ -0,0 +1,111 @@
+import Link from 'next/link'
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '消息中心 - Crop-X 智慧农业管理系统',
+ description: '消息推送管理页面',
+}
+
+export default function MessageCenterPage() {
+ return (
+
+
+
+ 消息中心管理
+
+
+ 管理消息推送、通知设置和反馈处理
+
+
+
+
+
+ 📤 消息推送管理
+
+
+ 创建和发送各类消息通知
+
+
+
+
+
+ 📨 消息发送
+
+
+ 快速发送消息给指定用户
+
+
+
+
+
+ ⚙️ 通知设置管理
+
+
+ 配置系统通知规则和模板
+
+
+
+
+
+ 💬 反馈管理
+
+
+ 处理用户反馈和建议
+
+
+
+
+
+
+
+
+ 📊 消息统计概览
+
+
+
+ 今日发送消息
+ 156 条
+
+
+ 待处理反馈
+ 23 条
+
+
+ 活跃通知规则
+ 8 个
+
+
+
+
+
+
+ 🔧 快速操作
+
+
+
+ 发送系统通知
+
+
+ 配置通知规则
+
+
+ 查看发送记录
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/page.tsx b/crop-x/src/app/central-config/page.tsx
new file mode 100644
index 0000000..1f07602
--- /dev/null
+++ b/crop-x/src/app/central-config/page.tsx
@@ -0,0 +1,123 @@
+import Link from 'next/link'
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '中心配置管理 - Crop-X 智慧农业管理系统',
+ description: '中心配置管理系统主页面',
+}
+
+export default function CentralConfigPage() {
+ return (
+
+
+
+ 中心配置管理系统
+
+
+ 租户管理、用户权限、系统参数和消息中心配置
+
+
+
+
+
+ 🏢 租户管理
+
+
+ 租户创建、配置和授权管理
+
+
+
+
+
+ 👥 用户管理
+
+
+ 用户账号和角色权限管理
+
+
+
+
+
+ 🔧 系统参数
+
+
+ 基础配置和业务规则设置
+
+
+
+
+
+ 📈 系统监控
+
+
+ 性能监控和日志管理
+
+
+
+
+
+ 📨 消息中心
+
+
+ 消息推送和通知设置管理
+
+
+
+
+
+
+
+
+ 📊 系统概览
+
+
+
+ 活跃租户
+ 12 个
+
+
+ 注册用户
+ 248 人
+
+
+ 系统运行时间
+ 99.8%
+
+
+
+
+
+
+ 🔧 快速操作
+
+
+
+ 添加新用户
+
+
+ 系统配置
+
+
+ 查看日志
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/system-monitoring/exception-handling/page.tsx b/crop-x/src/app/central-config/system-monitoring/exception-handling/page.tsx
new file mode 100644
index 0000000..525fc27
--- /dev/null
+++ b/crop-x/src/app/central-config/system-monitoring/exception-handling/page.tsx
@@ -0,0 +1,185 @@
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '异常处理 - Crop-X 智慧农业管理系统',
+ description: '系统异常处理管理页面',
+}
+
+export default function ExceptionHandlingPage() {
+ return (
+
+
+
+ ⚠️ 异常处理管理
+
+
+
+
+
+ 当前异常告警
+
+
+ {[
+ {
+ id: 'ERR001',
+ type: '数据库连接异常',
+ severity: '高',
+ time: '2024-10-20 15:30:25',
+ status: 'active',
+ description: 'MySQL连接池耗尽,无法获取新连接'
+ },
+ {
+ id: 'ERR002',
+ type: 'API超时异常',
+ severity: '中',
+ time: '2024-10-20 15:28:15',
+ status: 'active',
+ description: '第三方天气API调用超时'
+ },
+ {
+ id: 'ERR003',
+ type: '内存溢出警告',
+ severity: '中',
+ time: '2024-10-20 15:25:42',
+ status: 'resolved',
+ description: 'JVM内存使用率超过85%阈值'
+ },
+ ].map((error) => (
+
+
+
+
{error.type}
+
{error.description}
+
{error.time}
+
+
+
+ {error.severity}严重
+
+
+ {error.status === 'active' ? '活跃' : '已解决'}
+
+
+
+
+
+ 查看详情
+
+
+ 标记解决
+
+
+ 查看日志
+
+
+
+ ))}
+
+
+
+
+
+ 异常统计分析
+
+
+
+
今日异常统计
+
+
+ 总异常数
+ 23 次
+
+
+ 已解决
+ 18 次
+
+
+ 处理中
+ 5 次
+
+
+ 平均解决时间
+ 15分钟
+
+
+
+
+
+
异常类型分布
+
+
+ 数据库异常
+ 8 次
+
+
+ 网络异常
+ 6 次
+
+
+ 业务逻辑异常
+ 5 次
+
+
+ 系统资源异常
+ 4 次
+
+
+
+
+
+
+
+
+
+ 🔧 异常处理配置
+
+
+
+
告警规则
+
+
+ 异常自动告警
+ 已启用
+
+
+ 邮件通知
+ 已启用
+
+
+ 短信通知
+ 仅高级异常
+
+
+ 自动恢复检测
+ 已启用
+
+
+
+
+
+
快速操作
+
+
+ 查看所有异常
+
+
+ 导出异常报告
+
+
+ 配置告警规则
+
+
+ 批量处理异常
+
+
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/system-monitoring/layout.tsx b/crop-x/src/app/central-config/system-monitoring/layout.tsx
new file mode 100644
index 0000000..2ba0403
--- /dev/null
+++ b/crop-x/src/app/central-config/system-monitoring/layout.tsx
@@ -0,0 +1,22 @@
+import { ReactNode } from 'react'
+
+export default function SystemMonitoringLayout({
+ children,
+}: {
+ children: ReactNode
+}) {
+ return (
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/system-monitoring/log-management/page.tsx b/crop-x/src/app/central-config/system-monitoring/log-management/page.tsx
new file mode 100644
index 0000000..2bfedb1
--- /dev/null
+++ b/crop-x/src/app/central-config/system-monitoring/log-management/page.tsx
@@ -0,0 +1,160 @@
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '日志管理 - Crop-X 智慧农业管理系统',
+ description: '系统日志管理页面',
+}
+
+export default function LogManagementPage() {
+ return (
+
+
+
+ 📋 日志管理
+
+
+
+
+
+
+ 系统日志查看
+
+
+
+
+ 所有级别
+ ERROR
+ WARN
+ INFO
+ DEBUG
+
+
+
+ 搜索
+
+
+
+
+
+ {[
+ { time: '2024-10-20 15:30:25', level: 'INFO', module: '用户管理', message: '用户登录成功: admin', status: 'normal' },
+ { time: '2024-10-20 15:28:15', level: 'WARN', module: '农机管理', message: '农机NJ001离线超时', status: 'warning' },
+ { time: '2024-10-20 15:25:42', level: 'ERROR', module: '数据同步', message: 'API调用失败: timeout', status: 'error' },
+ { time: '2024-10-20 15:22:18', level: 'INFO', module: '任务调度', message: '定时任务执行完成', status: 'normal' },
+ { time: '2024-10-20 15:20:05', level: 'INFO', module: '系统监控', message: '系统性能指标正常', status: 'normal' },
+ ].map((log, index) => (
+
+
+
+
+
+ {log.level}
+
+ {log.time}
+ [{log.module}]
+
+
{log.message}
+
+
+
+ ))}
+
+
+
+
+
+ 显示 1-5 条,共 1,245 条日志
+
+
+
+ 上一页
+
+
+ 1
+
+
+ 2
+
+
+ 下一页
+
+
+
+
+
+
+
+
+
日志统计
+
+
+ 今日总数
+ 1,245
+
+
+ 错误日志
+ 12
+
+
+ 警告日志
+ 45
+
+
+ 信息日志
+ 1,188
+
+
+
+
+
+
快速操作
+
+
+ 导出日志
+
+
+ 清理旧日志
+
+
+ 日志归档
+
+
+
+
+
+
日志配置
+
+
+ 日志级别
+
+ INFO
+ DEBUG
+ WARN
+ ERROR
+
+
+
+ 保留天数
+ 30天
+
+
+ 自动清理
+ 已启用
+
+
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/system-monitoring/page.tsx b/crop-x/src/app/central-config/system-monitoring/page.tsx
new file mode 100644
index 0000000..e1cfb76
--- /dev/null
+++ b/crop-x/src/app/central-config/system-monitoring/page.tsx
@@ -0,0 +1,103 @@
+import Link from 'next/link'
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '系统监控 - Crop-X 智慧农业管理系统',
+ description: '系统监控管理页面',
+}
+
+export default function SystemMonitoringPage() {
+ return (
+
+
+
+ 系统监控管理
+
+
+ 监控系统性能、管理日志记录和处理异常情况
+
+
+
+
+
+ 📊 性能监控管理
+
+
+ 系统性能指标实时监控
+
+
+
+
+
+ 📋 日志管理
+
+
+ 系统日志查看和管理
+
+
+
+
+
+ ⚠️ 异常处理管理
+
+
+ 系统异常监控和处理
+
+
+
+
+
+
+
+
+ 📊 系统状态概览
+
+
+
+ 系统运行时间
+ 15天 8小时
+
+
+ CPU使用率
+ 45.2%
+
+
+ 内存使用率
+ 68.7%
+
+
+ 今日异常数
+ 3 次
+
+
+
+
+
+
+ 🔧 快速操作
+
+
+
+ 查看实时性能
+
+
+ 导出系统日志
+
+
+ 查看异常报告
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/system-monitoring/performance-monitoring/page.tsx b/crop-x/src/app/central-config/system-monitoring/performance-monitoring/page.tsx
new file mode 100644
index 0000000..3a7785d
--- /dev/null
+++ b/crop-x/src/app/central-config/system-monitoring/performance-monitoring/page.tsx
@@ -0,0 +1,119 @@
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '性能监控 - Crop-X 智慧农业管理系统',
+ description: '系统性能监控管理页面',
+}
+
+export default function PerformanceMonitoringPage() {
+ return (
+
+
+
+ 📊 性能监控管理
+
+
+
+
+
+ 实时性能指标
+
+
+
+
+ CPU 使用率
+ 45.2%
+
+
+
+
+
+
+
+
+
+
+
+ 性能趋势图表
+
+
+
+
📈
+
+ 性能趋势图表
+
+
+ (集成图表库后显示)
+
+
+
+
+
+
+
+
+
响应时间
+
125ms
+
平均响应时间
+
+
+
+
+
+
+
+ ⚡ 性能优化建议
+
+
+
+
+
内存使用率较高,建议清理缓存或增加内存
+
+
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/system-parameters/basic-configuration/page.tsx b/crop-x/src/app/central-config/system-parameters/basic-configuration/page.tsx
new file mode 100644
index 0000000..3a429c0
--- /dev/null
+++ b/crop-x/src/app/central-config/system-parameters/basic-configuration/page.tsx
@@ -0,0 +1,223 @@
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '基础配置 - Crop-X 智慧农业管理系统',
+ description: '基础配置管理页面',
+}
+
+export default function BasicConfigurationPage() {
+ return (
+
+
+
+ ⚙️ 基础配置管理
+
+
+
+
+
+
+ 系统基本参数
+
+
+
+
+ 系统名称
+
+
+
+
+
+ 系统版本
+
+
+
+
+
+ 系统时区
+
+
+ Asia/Shanghai (UTC+8)
+ Asia/Beijing (UTC+8)
+ UTC (UTC+0)
+
+
+
+
+ 系统语言
+
+
+ 简体中文
+ English
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 重置
+
+
+ 保存配置
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/system-parameters/business-rule-settings/page.tsx b/crop-x/src/app/central-config/system-parameters/business-rule-settings/page.tsx
new file mode 100644
index 0000000..34c0c1f
--- /dev/null
+++ b/crop-x/src/app/central-config/system-parameters/business-rule-settings/page.tsx
@@ -0,0 +1,243 @@
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '业务规则设置 - Crop-X 智慧农业管理系统',
+ description: '业务规则设置管理页面',
+}
+
+export default function BusinessRuleSettingsPage() {
+ return (
+
+
+
+ 📋 业务规则设置
+
+
+
+
+
+ 🚙 农机管理规则
+
+
+
+
+
农机在线时间要求
+ 已启用
+
+
农机设备每日最少在线时间要求
+
+
+ 小时/天
+
+ 更新
+
+
+
+
+
+
+
农机维护提醒周期
+ 已启用
+
+
农机设备定期维护提醒设置
+
+
+ 天
+
+ 更新
+
+
+
+
+
+
+
农机任务优先级规则
+ 已启用
+
+
紧急任务自动优先级提升
+
+
+ 自动提升
+ 手动确认
+ 不提升
+
+
+ 更新
+
+
+
+
+
+
+
+
+ 🌾 地块管理规则
+
+
+
+
+
地块面积阈值
+ 已启用
+
+
单块地块最大面积限制
+
+
+ 亩
+
+ 更新
+
+
+
+
+
+
+
地块分级标准
+ 已启用
+
+
根据面积和产出自动分级
+
+
+ A/B/C三级
+ 一级/二级/三级
+ 优/良/中
+
+
+ 更新
+
+
+
+
+
+
+
+
+ 📋 任务管理规则
+
+
+
+
+
任务自动分配规则
+ 已启用
+
+
根据技能和位置自动分配任务
+
+
+ 智能分配
+ 轮询分配
+ 手动分配
+
+
+ 更新
+
+
+
+
+
+
+
任务超时提醒
+ 已启用
+
+
任务超时自动提醒设置
+
+
+ 小时后提醒
+
+ 更新
+
+
+
+
+
+
+
任务完成率阈值
+ 已启用
+
+
员工任务完成率考核标准
+
+
+ % 优秀线
+
+ 更新
+
+
+
+
+
+
+
+
+ 📊 数据管理规则
+
+
+
+
+
数据备份周期
+ 已启用
+
+
系统数据自动备份频率
+
+
+ 每日备份
+ 每周备份
+ 每月备份
+
+
+ 更新
+
+
+
+
+
+
+
日志保留期限
+ 已启用
+
+
系统日志数据保留时间
+
+
+ 天
+
+ 更新
+
+
+
+
+
+
+
+
+
+ 导出规则配置
+
+
+ 保存所有规则
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/system-parameters/interface-configuration/page.tsx b/crop-x/src/app/central-config/system-parameters/interface-configuration/page.tsx
new file mode 100644
index 0000000..b354b07
--- /dev/null
+++ b/crop-x/src/app/central-config/system-parameters/interface-configuration/page.tsx
@@ -0,0 +1,299 @@
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '接口配置 - Crop-X 智慧农业管理系统',
+ description: '接口配置管理页面',
+}
+
+export default function InterfaceConfigurationPage() {
+ return (
+
+
+
+ 🔌 接口配置管理
+
+
+
+
+
+
+ 🌤️ 天气服务接口
+
+
+
+
+ API提供商
+
+
+ 中国天气网
+ 和风天气
+ OpenWeatherMap
+
+
+
+
+ API密钥
+
+
+
+
+
+ 请求频率限制
+
+
+
+ 次/小时
+
+
+
+
+
+ 启用天气预警功能
+
+
+
+ 测试连接
+
+
+
+
+
+
+ 📱 短信服务接口
+
+
+
+
+ 短信服务商
+
+
+ 阿里云短信
+ 腾讯云短信
+ 华为云短信
+
+
+
+
+ Access Key ID
+
+
+
+
+
+ Access Key Secret
+
+
+
+
+
+ 签名名称
+
+
+
+
+ 测试连接
+
+
+
+
+
+
+
+
+
+
+ 🗺️ 地图服务接口
+
+
+
+
+ 地图服务商
+
+
+ 高德地图
+ 百度地图
+ 腾讯地图
+
+
+
+
+ API Key
+
+
+
+
+
+
+ 默认缩放级别
+
+
+ 10 - 城市
+ 12 - 区域
+ 14 - 街区
+ 16 - 建筑
+
+
+
+ 测试连接
+
+
+
+
+
+
+
+
+ 📊 接口状态监控
+
+
+
+
天气服务
+
+ 正常
+ 响应: 125ms
+
+
+
+
短信服务
+
+ 正常
+ 响应: 89ms
+
+
+
+
邮件服务
+
+ 警告
+ 响应: 456ms
+
+
+
+
地图服务
+
+ 正常
+ 响应: 67ms
+
+
+
+
+
+
+
+ 重置配置
+
+
+ 导出配置
+
+
+ 保存配置
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/system-parameters/layout.tsx b/crop-x/src/app/central-config/system-parameters/layout.tsx
new file mode 100644
index 0000000..34fc79e
--- /dev/null
+++ b/crop-x/src/app/central-config/system-parameters/layout.tsx
@@ -0,0 +1,22 @@
+import { ReactNode } from 'react'
+
+export default function SystemParametersLayout({
+ children,
+}: {
+ children: ReactNode
+}) {
+ return (
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/system-parameters/page.tsx b/crop-x/src/app/central-config/system-parameters/page.tsx
new file mode 100644
index 0000000..df3fc8b
--- /dev/null
+++ b/crop-x/src/app/central-config/system-parameters/page.tsx
@@ -0,0 +1,103 @@
+import Link from 'next/link'
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '系统参数 - Crop-X 智慧农业管理系统',
+ description: '系统参数管理页面',
+}
+
+export default function SystemParametersPage() {
+ return (
+
+
+
+ 系统参数管理
+
+
+ 配置基础系统参数、业务规则和接口设置
+
+
+
+
+
+ ⚙️ 基础配置管理
+
+
+ 系统基础参数和通用配置
+
+
+
+
+
+ 📋 业务规则设置
+
+
+ 业务逻辑规则和策略配置
+
+
+
+
+
+ 🔌 接口配置管理
+
+
+ API接口和第三方服务配置
+
+
+
+
+
+
+
+
+ 📊 配置状态概览
+
+
+
+ 基础配置项
+ 45 项
+
+
+ 业务规则数
+ 23 条
+
+
+ 接口配置
+ 12 个
+
+
+ 待审核配置
+ 3 项
+
+
+
+
+
+
+ 🔧 快速操作
+
+
+
+ 系统参数设置
+
+
+ 导出配置文件
+
+
+ 配置版本管理
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/tenant-management/layout.tsx b/crop-x/src/app/central-config/tenant-management/layout.tsx
new file mode 100644
index 0000000..1a2b768
--- /dev/null
+++ b/crop-x/src/app/central-config/tenant-management/layout.tsx
@@ -0,0 +1,22 @@
+import { ReactNode } from 'react'
+
+export default function TenantManagementLayout({
+ children,
+}: {
+ children: ReactNode
+}) {
+ return (
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/tenant-management/page.tsx b/crop-x/src/app/central-config/tenant-management/page.tsx
new file mode 100644
index 0000000..52f1dc1
--- /dev/null
+++ b/crop-x/src/app/central-config/tenant-management/page.tsx
@@ -0,0 +1,163 @@
+import Link from 'next/link'
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '租户管理 - Crop-X 智慧农业管理系统',
+ description: '租户管理页面',
+}
+
+export default function TenantManagementPage() {
+ return (
+
+
+
+ 租户管理
+
+
+ 管理租户创建、配置和授权
+
+
+
+
+
+ ➕ 租户创建管理
+
+
+ 创建新的租户账号
+
+
+
+
+
+ ⚙️ 租户配置管理
+
+
+ 配置租户基本信息和设置
+
+
+
+
+
+ 🔐 租户授权管理
+
+
+ 管理租户权限和访问控制
+
+
+
+
+
+
+
+
+ 📊 租户概览
+
+
+
+ 总租户数
+ 12 个
+
+
+ 活跃租户
+ 10 个
+
+
+ 待审核租户
+ 2 个
+
+
+ 总用户数
+ 1,248 人
+
+
+
+
+
+
+ 🔧 快速操作
+
+
+
+ 创建新租户
+
+
+ 租户批量导入
+
+
+ 导出租户列表
+
+
+
+
+
+
+
+ 📋 最近创建的租户
+
+
+
+
+
+
+ 租户ID
+
+
+ 租户名称
+
+
+ 状态
+
+
+ 创建时间
+
+
+ 操作
+
+
+
+
+ {[
+ { id: 'T001', name: '绿色农业合作社', status: 'active', time: '2024-10-20 10:30' },
+ { id: 'T002', name: '丰收农场', status: 'active', time: '2024-10-19 14:15' },
+ { id: 'T003', name: '智慧农业科技', status: 'pending', time: '2024-10-18 09:45' },
+ { id: 'T004', name: '现代农业示范园', status: 'active', time: '2024-10-17 16:20' },
+ ].map((tenant) => (
+
+
+ {tenant.id}
+
+
+ {tenant.name}
+
+
+
+ {tenant.status === 'active' ? '活跃' : '待审核'}
+
+
+
+ {tenant.time}
+
+
+ 编辑
+ 删除
+
+
+ ))}
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/tenant-management/tenant-authorization/page.tsx b/crop-x/src/app/central-config/tenant-management/tenant-authorization/page.tsx
new file mode 100644
index 0000000..ba431ad
--- /dev/null
+++ b/crop-x/src/app/central-config/tenant-management/tenant-authorization/page.tsx
@@ -0,0 +1,243 @@
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '租户授权 - Crop-X 智慧农业管理系统',
+ description: '租户授权管理页面',
+}
+
+export default function TenantAuthorizationPage() {
+ return (
+
+
+
+ 🔐 租户授权管理
+
+
+
+
+
+ 选择租户
+ T001 - 绿色农业合作社
+ T002 - 丰收农场
+ T003 - 智慧农业科技
+ T004 - 现代农业示范园
+
+
+ 查询
+
+
+
+
+
+
+
+
+ 📋 功能模块权限
+
+
+ {[
+ { module: '智能农机管理', code: 'machinery', enabled: true, features: ['档案管理', '实时监控', '任务调度', '数据分析'] },
+ { module: '地块信息管理', code: 'land', enabled: true, features: ['地块档案', '地图管理', '空间分析', '环境监测'] },
+ { module: '农事操作管理', code: 'farming', enabled: true, features: ['农事计划', '任务管理', '操作执行', '知识库'] },
+ { module: '农业资产管理', code: 'asset', enabled: false, features: ['基础信息', '采购管理', '库存管理', '物资领用'] },
+ { module: 'AI作物模型', code: 'ai-model', enabled: false, features: ['数据感知', '模型应用', '智能决策', '监控中心'] },
+ { module: '水肥控制', code: 'irrigation', enabled: true, features: ['水肥机管理', '智能灌溉', '施肥配方', '实时监测'] },
+ { module: '中心配置', code: 'config', enabled: false, features: ['租户管理', '用户管理', '系统参数', '消息中心'] },
+ ].map((item, index) => (
+
+
+
+
+
{item.module}
+
+ {item.code}
+
+
+
+ 详细设置
+
+
+
+ {item.features.map((feature, featureIndex) => (
+
+
+
+ {feature}
+
+
+ ))}
+
+
+ ))}
+
+
+
+
+
+
+
+ 🔑 API访问权限
+
+
+
+ API访问
+ 已启用
+
+
+
+ API Key
+
+
+
+
+ 重置
+
+
+
+
+
+ 访问频率限制
+
+
+ 1000次/小时
+ 5000次/小时
+ 10000次/小时
+ 无限制
+
+
+
+
+ IP白名单
+
+
+
+
+
+
+
+
+ 📊 权限统计
+
+
+
+ 已启用模块
+ 4 / 7
+
+
+ 功能权限
+ 18 / 28
+
+
+ API权限
+ 已授权
+
+
+ 最后更新
+ 2024-10-20 15:30
+
+
+
+
+
+
+ ⚡ 快速操作
+
+
+
+ 应用默认权限
+
+
+ 导出权限配置
+
+
+ 权限变更历史
+
+
+
+
+
+
+
+
+ 📋 权限变更记录
+
+
+
+
+
+
+ 时间
+
+
+ 操作类型
+
+
+ 操作内容
+
+
+ 操作人
+
+
+
+
+ {[
+ { time: '2024-10-20 15:30', type: '模块授权', content: '启用智能农机管理模块', operator: 'admin' },
+ { time: '2024-10-20 14:15', type: '权限调整', content: '关闭农业资产管理模块', operator: 'admin' },
+ { time: '2024-10-20 10:45', type: 'API配置', content: '重置API密钥', operator: 'admin' },
+ { time: '2024-10-19 16:20', type: '权限调整', content: '启用水肥控制模块', operator: 'admin' },
+ ].map((record, index) => (
+
+
+ {record.time}
+
+
+
+ {record.type}
+
+
+
+ {record.content}
+
+
+ {record.operator}
+
+
+ ))}
+
+
+
+
+
+
+
+ 取消
+
+
+ 保存权限配置
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/tenant-management/tenant-configuration/page.tsx b/crop-x/src/app/central-config/tenant-management/tenant-configuration/page.tsx
new file mode 100644
index 0000000..5600fdf
--- /dev/null
+++ b/crop-x/src/app/central-config/tenant-management/tenant-configuration/page.tsx
@@ -0,0 +1,287 @@
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '租户配置 - Crop-X 智慧农业管理系统',
+ description: '租户配置管理页面',
+}
+
+export default function TenantConfigurationPage() {
+ return (
+
+
+
+ ⚙️ 租户配置管理
+
+
+
+
+
+ 选择租户
+ T001 - 绿色农业合作社
+ T002 - 丰收农场
+ T003 - 智慧农业科技
+ T004 - 现代农业示范园
+
+
+ 查询
+
+
+
+
+
+
+
+
+ 基本信息配置
+
+
+
+
+ 租户名称
+
+
+
+
+
+ 租户Logo
+
+
+
+ Logo
+
+
+ 上传Logo
+
+
+ 删除
+
+
+
+
+
+ 联系人
+
+
+
+
+
+ 联系电话
+
+
+
+
+
+ 租户状态
+
+
+ 正常
+ 暂停
+ 停用
+
+
+
+
+
+
+
+
+
+
+
+ 系统配置
+
+
+
+
+ 系统主题
+
+
+ 默认主题
+ 绿色主题
+ 蓝色主题
+ 暗色主题
+
+
+
+
+ 系统语言
+
+
+ 简体中文
+ English
+ 繁體中文
+
+
+
+
+ 时区设置
+
+
+ Asia/Shanghai (UTC+8)
+ Asia/Beijing (UTC+8)
+ UTC (UTC+0)
+
+
+
+
+ 日期格式
+
+
+ YYYY-MM-DD
+ YYYY/MM/DD
+ DD/MM/YYYY
+ MM/DD/YYYY
+
+
+
+
+ 数字格式
+
+
+ 1,234.56
+ 1.234,56
+ 1234.56
+
+
+
+
+
+
+
+
+
+
+
+ 重置
+
+
+ 保存配置
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/tenant-management/tenant-creation/page.tsx b/crop-x/src/app/central-config/tenant-management/tenant-creation/page.tsx
new file mode 100644
index 0000000..bcde4b3
--- /dev/null
+++ b/crop-x/src/app/central-config/tenant-management/tenant-creation/page.tsx
@@ -0,0 +1,221 @@
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '租户创建 - Crop-X 智慧农业管理系统',
+ description: '租户创建管理页面',
+}
+
+export default function TenantCreationPage() {
+ return (
+
+
+
+ ➕ 租户创建管理
+
+
+
+
+
+
+
+
+ 📋 创建说明
+
+
+
+
+
租户名称必须为中文,长度2-50个字符
+
+
+
+
租户代码必须为英文,长度3-20个字符,只能包含字母和数字
+
+
+
+
联系电话必须是有效的手机号码或座机号码
+
+
+
+
+
创建成功后,系统将自动向管理员邮箱发送登录信息
+
+
+
+
+
+
+ ⚡ 快速操作
+
+
+
+ 📥 批量导入租户
+
+
+ 📄 下载模板文件
+
+
+ 📊 查看导入历史
+
+
+
+
+
+
+ 📈 今日统计
+
+
+
+ 今日创建租户
+ 3 个
+
+
+ 待审核租户
+ 2 个
+
+
+ 已通过租户
+ 1 个
+
+
+ 创建成功率
+ 100%
+
+
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/user-management/layout.tsx b/crop-x/src/app/central-config/user-management/layout.tsx
new file mode 100644
index 0000000..358744c
--- /dev/null
+++ b/crop-x/src/app/central-config/user-management/layout.tsx
@@ -0,0 +1,22 @@
+import { ReactNode } from 'react'
+
+export default function UserManagementLayout({
+ children,
+}: {
+ children: ReactNode
+}) {
+ return (
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/user-management/page.tsx b/crop-x/src/app/central-config/user-management/page.tsx
new file mode 100644
index 0000000..a69ade1
--- /dev/null
+++ b/crop-x/src/app/central-config/user-management/page.tsx
@@ -0,0 +1,178 @@
+import Link from 'next/link'
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '用户管理 - Crop-X 智慧农业管理系统',
+ description: '用户管理页面',
+}
+
+export default function UserManagementPage() {
+ return (
+
+
+
+ 用户管理
+
+
+ 管理用户账号、角色权限和行为跟踪
+
+
+
+
+
+ 👤 用户账号管理
+
+
+ 创建、编辑和管理用户账号
+
+
+
+
+
+ 🔐 角色权限管理
+
+
+ 配置用户角色和权限设置
+
+
+
+
+
+ 📊 用户行为跟踪
+
+
+ 监控用户操作行为和数据
+
+
+
+
+
+
+
+
+ 📊 用户统计概览
+
+
+
+ 总用户数
+ 248 人
+
+
+ 活跃用户
+ 186 人
+
+
+ 新注册用户
+ 12 人
+
+
+ 待审核用户
+ 5 人
+
+
+
+
+
+
+ 🔧 快速操作
+
+
+
+ 创建新用户
+
+
+ 批量导入用户
+
+
+ 用户权限配置
+
+
+
+
+
+
+
+ 📋 最近登录用户
+
+
+
+
+
+
+ 用户名
+
+
+ 姓名
+
+
+ 角色
+
+
+ 租户
+
+
+ 最后登录
+
+
+ 状态
+
+
+ 操作
+
+
+
+
+ {[
+ { username: 'admin', name: '系统管理员', role: '超级管理员', tenant: '系统', lastLogin: '2024-10-20 15:30', status: 'active' },
+ { username: 'zhangsan', name: '张三', role: '农场管理员', tenant: '绿色农业合作社', lastLogin: '2024-10-20 14:15', status: 'active' },
+ { username: 'lisi', name: '李四', role: '农机操作员', tenant: '丰收农场', lastLogin: '2024-10-20 12:45', status: 'active' },
+ { username: 'wangwu', name: '王五', role: '技术员', tenant: '智慧农业科技', lastLogin: '2024-10-19 16:20', status: 'inactive' },
+ { username: 'zhaoliu', name: '赵六', role: '观察员', tenant: '现代农业示范园', lastLogin: '2024-10-18 09:30', status: 'pending' },
+ ].map((user, index) => (
+
+
+ {user.username}
+
+
+ {user.name}
+
+
+ {user.role}
+
+
+ {user.tenant}
+
+
+ {user.lastLogin}
+
+
+
+ {user.status === 'active' ? '活跃' : user.status === 'inactive' ? '未激活' : '待审核'}
+
+
+
+ 编辑
+ 删除
+
+
+ ))}
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/user-management/role-permission-management/page.tsx b/crop-x/src/app/central-config/user-management/role-permission-management/page.tsx
new file mode 100644
index 0000000..d7f4ff6
--- /dev/null
+++ b/crop-x/src/app/central-config/user-management/role-permission-management/page.tsx
@@ -0,0 +1,245 @@
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '角色权限管理 - Crop-X 智慧农业管理系统',
+ description: '角色权限管理页面',
+}
+
+export default function RolePermissionManagementPage() {
+ return (
+
+
+
+ 🔐 角色权限管理
+
+
+
+
+
+
+ 🎭 角色管理
+
+
+
+
现有角色
+
+ ➕ 新建角色
+
+
+ {[
+ { name: '超级管理员', code: 'super_admin', users: 3, description: '拥有系统所有权限' },
+ { name: '农场管理员', code: 'farm_admin', users: 45, description: '管理农场整体运营' },
+ { name: '农机操作员', code: 'machine_operator', users: 89, description: '操作和维护农机设备' },
+ { name: '技术员', code: 'technician', users: 67, description: '负责技术支持和分析' },
+ { name: '观察员', code: 'observer', users: 44, description: '只读权限,查看数据' },
+ ].map((role, index) => (
+
+
+
+
{role.name}
+
{role.description}
+
角色代码: {role.code}
+
+
+
+ {role.users} 用户
+
+
+ 编辑
+
+
+ 删除
+
+
+
+
+ ))}
+
+
+
+
+
+ ➕ 创建新角色
+
+
+
+
+ 角色名称
+
+
+
+
+
+ 角色代码
+
+
+
+
+
+ 角色描述
+
+
+
+
+ 创建角色
+
+
+
+
+
+
+
+
+ 🔑 权限矩阵配置
+
+
+
+ 选择角色进行权限配置
+ 超级管理员
+ 农场管理员
+ 农机操作员
+ 技术员
+ 观察员
+
+
+
+ {[
+ {
+ module: '智能农机管理',
+ permissions: ['查看', '创建', '编辑', '删除', '导出']
+ },
+ {
+ module: '地块信息管理',
+ permissions: ['查看', '创建', '编辑', '删除', '导出']
+ },
+ {
+ module: '农事操作管理',
+ permissions: ['查看', '创建', '编辑', '删除', '导出']
+ },
+ {
+ module: '农业资产管理',
+ permissions: ['查看', '创建', '编辑', '删除', '导出']
+ },
+ {
+ module: 'AI作物模型',
+ permissions: ['查看', '创建', '编辑', '删除', '导出']
+ },
+ {
+ module: '水肥控制',
+ permissions: ['查看', '创建', '编辑', '删除', '导出']
+ },
+ {
+ module: '系统配置',
+ permissions: ['查看', '创建', '编辑', '删除', '导出']
+ },
+ ].map((module, index) => (
+
+ ))}
+
+
+ 保存权限配置
+
+
+
+
+
+ 👥 用户角色分配
+
+
+
+
+ 选择用户
+
+
+ 请选择用户
+ 张三 - 农场管理员
+ 李四 - 农机操作员
+ 王五 - 技术员
+ 赵六 - 观察员
+
+
+
+
+ 分配角色
+
+
+ {['超级管理员', '农场管理员', '农机操作员', '技术员', '观察员'].map((role, index) => (
+
+
+ {role}
+
+ ))}
+
+
+
+ 更新用户角色
+
+
+
+
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/user-management/user-account-management/page.tsx b/crop-x/src/app/central-config/user-management/user-account-management/page.tsx
new file mode 100644
index 0000000..2163421
--- /dev/null
+++ b/crop-x/src/app/central-config/user-management/user-account-management/page.tsx
@@ -0,0 +1,283 @@
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '用户账号管理 - Crop-X 智慧农业管理系统',
+ description: '用户账号管理页面',
+}
+
+export default function UserAccountManagementPage() {
+ return (
+
+
+
+ 👤 用户账号管理
+
+
+
+
+
+
+ 所有角色
+ 超级管理员
+ 农场管理员
+ 农机操作员
+ 技术员
+ 观察员
+
+
+ 所有状态
+ 活跃
+ 未激活
+ 待审核
+ 已禁用
+
+
+ 搜索
+
+
+
+ ➕ 创建用户
+
+
+
+
+
+
+
+ 用户列表
+
+
+
+
+
+
+
+
+
+ 用户信息
+
+
+ 角色
+
+
+ 租户
+
+
+ 状态
+
+
+ 创建时间
+
+
+ 操作
+
+
+
+
+ {[
+ {
+ username: 'admin',
+ name: '系统管理员',
+ email: 'admin@crop-x.com',
+ avatar: '👨💼',
+ role: '超级管理员',
+ tenant: '系统',
+ status: 'active',
+ createTime: '2024-01-01'
+ },
+ {
+ username: 'zhangsan',
+ name: '张三',
+ email: 'zhangsan@green-agri.com',
+ avatar: '👨🌾',
+ role: '农场管理员',
+ tenant: '绿色农业合作社',
+ status: 'active',
+ createTime: '2024-03-15'
+ },
+ {
+ username: 'lisi',
+ name: '李四',
+ email: 'lisi@harvest.com',
+ avatar: '👩🌾',
+ role: '农机操作员',
+ tenant: '丰收农场',
+ status: 'active',
+ createTime: '2024-05-20'
+ },
+ {
+ username: 'wangwu',
+ name: '王五',
+ email: 'wangwu@smart-agri.com',
+ avatar: '👨🔧',
+ role: '技术员',
+ tenant: '智慧农业科技',
+ status: 'inactive',
+ createTime: '2024-07-10'
+ },
+ {
+ username: 'zhaoliu',
+ name: '赵六',
+ email: 'zhaoliu@modern-agri.com',
+ avatar: '👩🔬',
+ role: '观察员',
+ tenant: '现代农业示范园',
+ status: 'pending',
+ createTime: '2024-09-05'
+ },
+ ].map((user, index) => (
+
+
+
+
+
+
+
{user.avatar}
+
+
{user.name}
+
@{user.username}
+
{user.email}
+
+
+
+
+
+ {user.role}
+
+
+
+ {user.tenant}
+
+
+
+ {user.status === 'active' ? '活跃' : user.status === 'inactive' ? '未激活' : '待审核'}
+
+
+
+ {user.createTime}
+
+
+ 编辑
+ 重置密码
+ 删除
+
+
+ ))}
+
+
+
+
+
+
+ 显示 1-5 条,共 248 条用户
+
+
+
+ 上一页
+
+
+ 1
+
+
+ 2
+
+
+ 3
+
+
+ ...
+
+
+ 下一页
+
+
+
+
+
+
+
+
+
+ 📊 用户统计
+
+
+
+ 总用户数
+ 248
+
+
+ 活跃用户
+ 186
+
+
+ 待审核
+ 5
+
+
+ 已禁用
+ 12
+
+
+
+
+
+
+ 🎭 角色分布
+
+
+
+ 超级管理员
+ 3
+
+
+ 农场管理员
+ 45
+
+
+ 农机操作员
+ 89
+
+
+ 技术员
+ 67
+
+
+ 观察员
+ 44
+
+
+
+
+
+
+ ⚡ 批量操作
+
+
+
+ 批量激活用户
+
+
+ 批量重置密码
+
+
+ 批量分配角色
+
+
+ 导出用户列表
+
+
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/central-config/user-management/user-behavior-tracking/page.tsx b/crop-x/src/app/central-config/user-management/user-behavior-tracking/page.tsx
new file mode 100644
index 0000000..fea1ba5
--- /dev/null
+++ b/crop-x/src/app/central-config/user-management/user-behavior-tracking/page.tsx
@@ -0,0 +1,337 @@
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '用户行为跟踪 - Crop-X 智慧农业管理系统',
+ description: '用户行为跟踪管理页面',
+}
+
+export default function UserBehaviorTrackingPage() {
+ return (
+
+
+
+ 📊 用户行为跟踪
+
+
+
+
+
+ 所有行为类型
+ 登录
+ 查看页面
+ 创建数据
+ 编辑数据
+ 删除数据
+ 导出数据
+
+
+
+ 搜索
+
+
+ 导出记录
+
+
+
+
+
+
+
+ 📋 行为记录
+
+
+
+
+
+
+ 时间
+
+
+ 用户
+
+
+ 行为类型
+
+
+ 模块
+
+
+ 描述
+
+
+ IP地址
+
+
+ 状态
+
+
+
+
+ {[
+ {
+ time: '2024-10-20 15:30:25',
+ user: '张三',
+ type: '登录',
+ module: '系统认证',
+ description: '用户登录系统',
+ ip: '192.168.1.100',
+ status: 'success'
+ },
+ {
+ time: '2024-10-20 15:28:15',
+ user: '李四',
+ type: '查看页面',
+ module: '智能农机管理',
+ description: '查看农机列表页面',
+ ip: '192.168.1.101',
+ status: 'success'
+ },
+ {
+ time: '2024-10-20 15:25:42',
+ user: '王五',
+ type: '创建数据',
+ module: '地块信息管理',
+ description: '创建新的地块信息',
+ ip: '192.168.1.102',
+ status: 'success'
+ },
+ {
+ time: '2024-10-20 15:22:18',
+ user: '赵六',
+ type: '编辑数据',
+ module: '农事操作管理',
+ description: '编辑农事任务信息',
+ ip: '192.168.1.103',
+ status: 'success'
+ },
+ {
+ time: '2024-10-20 15:20:05',
+ user: '张三',
+ type: '导出数据',
+ module: '系统配置',
+ description: '导出用户列表',
+ ip: '192.168.1.100',
+ status: 'success'
+ },
+ {
+ time: '2024-10-20 15:18:30',
+ user: '李四',
+ type: '删除数据',
+ module: '农业资产管理',
+ description: '删除资产记录',
+ ip: '192.168.1.101',
+ status: 'warning'
+ },
+ {
+ time: '2024-10-20 15:15:45',
+ user: '王五',
+ type: '登录',
+ module: '系统认证',
+ description: '用户登录失败',
+ ip: '192.168.1.102',
+ status: 'error'
+ },
+ ].map((record, index) => (
+
+
+ {record.time}
+
+
+ {record.user}
+
+
+
+ {record.type}
+
+
+
+ {record.module}
+
+
+ {record.description}
+
+
+ {record.ip}
+
+
+
+ {record.status === 'success' ? '成功' : record.status === 'warning' ? '警告' : '失败'}
+
+
+
+ ))}
+
+
+
+
+
+
+ 显示 1-7 条,共 1,456 条记录
+
+
+
+ 上一页
+
+
+ 1
+
+
+ 2
+
+
+ 3
+
+
+ 下一页
+
+
+
+
+
+
+
+
+
+ 📈 今日统计
+
+
+
+ 总操作数
+ 1,456
+
+
+ 成功操作
+ 1,423
+
+
+ 失败操作
+ 25
+
+
+ 活跃用户
+ 186
+
+
+
+
+
+
+ 🎯 热门模块
+
+
+
+ 智能农机管理
+ 342 次
+
+
+ 地块信息管理
+ 298 次
+
+
+ 农事操作管理
+ 256 次
+
+
+ 系统配置
+ 189 次
+
+
+
+
+
+
+ 👥 活跃用户TOP5
+
+
+
+ 张三
+ 89 次
+
+
+ 李四
+ 76 次
+
+
+ 王五
+ 65 次
+
+
+ 赵六
+ 54 次
+
+
+ 钱七
+ 43 次
+
+
+
+
+
+
+ ⚠️ 异常行为监控
+
+
+
+
+ 频繁登录失败
+ 高
+
+
用户: test@example.com - 5次失败
+
+
+
+ 异常时间段操作
+ 中
+
+
用户: 李四 - 凌晨3点操作
+
+
+
+ 大量数据导出
+ 低
+
+
用户: 王五 - 单日导出10次
+
+
+
+
+
+
+
+
+ 🔍 高级分析
+
+
+
+ 用户行为模式分析
+
+
+ 模块使用热力图
+
+
+ 安全风险评估
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/error.tsx b/crop-x/src/app/error.tsx
new file mode 100644
index 0000000..9f2100b
--- /dev/null
+++ b/crop-x/src/app/error.tsx
@@ -0,0 +1,34 @@
+'use client'
+
+import { useEffect } from 'react'
+
+export default function Error({
+ error,
+ reset,
+}: {
+ error: Error & { digest?: string }
+ reset: () => void
+}) {
+ useEffect(() => {
+ console.error(error)
+ }, [error])
+
+ return (
+
+
+
+ 系统出现了错误
+
+
+ {error.message || '未知错误'}
+
+
+ 重新加载
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/farming-operation/layout.tsx b/crop-x/src/app/farming-operation/layout.tsx
new file mode 100644
index 0000000..77262c9
--- /dev/null
+++ b/crop-x/src/app/farming-operation/layout.tsx
@@ -0,0 +1,22 @@
+import { ReactNode } from 'react'
+
+export default function FarmingOperationLayout({
+ children,
+}: {
+ children: ReactNode
+}) {
+ return (
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/farming-operation/page.tsx b/crop-x/src/app/farming-operation/page.tsx
new file mode 100644
index 0000000..5be0182
--- /dev/null
+++ b/crop-x/src/app/farming-operation/page.tsx
@@ -0,0 +1,159 @@
+import Link from 'next/link'
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '农事操作管理 - Crop-X 智慧农业管理系统',
+ description: '农事操作管理系统主页面',
+}
+
+export default function FarmingOperationPage() {
+ return (
+
+
+
+ 农事操作管理系统
+
+
+ 管理农事计划、任务执行、绩效协作等农事操作全流程
+
+
+
+
+
+ 📅 农事计划管理
+
+
+ 农事计划制定和资源分配
+
+
+
+
+
+ ✅ 农事任务管理
+
+
+ 任务创建、分配和状态监控
+
+
+
+
+
+ 🚜 农事执行管理
+
+
+ 操作记录和日志查询
+
+
+
+
+
+ 📆 农事日历管理
+
+
+ 日历视图和甘特图管理
+
+
+
+
+
+ 📁 农事档案管理
+
+
+ 档案归集和溯源管理
+
+
+
+
+
+ 📚 知识库管理
+
+
+ 内容管理和智能检索
+
+
+
+
+
+ 📊 绩效管理
+
+
+ 人员管理和统计报表
+
+
+
+
+
+ 🤝 问题协同管理
+
+
+ 问题上报和在线协作
+
+
+
+
+
+
+
+
+ 📊 农事操作概览
+
+
+
+ 本月计划任务
+ 86 项
+
+
+ 进行中任务
+ 23 项
+
+
+ 已完成任务
+ 156 项
+
+
+
+
+
+
+ 🔧 快速操作
+
+
+
+ 创建新计划
+
+
+ 分配任务
+
+
+ 生成报告
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/land-information/layout.tsx b/crop-x/src/app/land-information/layout.tsx
new file mode 100644
index 0000000..971da50
--- /dev/null
+++ b/crop-x/src/app/land-information/layout.tsx
@@ -0,0 +1,22 @@
+import { ReactNode } from 'react'
+
+export default function LandInformationLayout({
+ children,
+}: {
+ children: ReactNode
+}) {
+ return (
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/land-information/page.tsx b/crop-x/src/app/land-information/page.tsx
new file mode 100644
index 0000000..6017fda
--- /dev/null
+++ b/crop-x/src/app/land-information/page.tsx
@@ -0,0 +1,147 @@
+import Link from 'next/link'
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '地块信息管理 - Crop-X 智慧农业管理系统',
+ description: '地块信息管理系统主页面',
+}
+
+export default function LandInformationPage() {
+ return (
+
+
+
+ 地块信息管理系统
+
+
+ 管理农田地块档案、空间分析、环境监测和适宜性评价
+
+
+
+
+
+ 🗺️ 地块档案管理
+
+
+ 农田地块信息档案管理
+
+
+
+
+
+ 🗺️ 地图管理
+
+
+ GIS数据和数字化地图管理
+
+
+
+
+
+ 📊 空间分析
+
+
+ 土壤数据和质量评价分析
+
+
+
+
+
+ 🌡️ 环境监测
+
+
+ 气象和环境传感器数据监测
+
+
+
+
+
+ ✅ 适宜性评价
+
+
+ 作物适宜性综合评价分析
+
+
+
+
+
+ 📈 对比分析
+
+
+ 多维指标对比分析报告
+
+
+
+
+
+ ⚠️ 风险预警
+
+
+ 实时监测预警和处置跟踪
+
+
+
+
+
+
+
+
+ 📊 地块状态概览
+
+
+
+ 总地块数
+ 48 块
+
+
+ 已监测地块
+ 35 块
+
+
+ 种植中地块
+ 28 块
+
+
+
+
+
+
+ 🔧 快速操作
+
+
+
+ 添加新地块
+
+
+ 生成地块报告
+
+
+ 批量分析
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/layout.tsx b/crop-x/src/app/layout.tsx
new file mode 100644
index 0000000..c7226c5
--- /dev/null
+++ b/crop-x/src/app/layout.tsx
@@ -0,0 +1,18 @@
+import {Navbar} from "../components/layouts/Navbar"
+import '@/styles/globals.css'
+export default function DashboardLayout({
+ children,
+}: {
+ children: React.ReactNode
+}) {
+ return (
+
+
+
+ {/* 布局 UI */}
+ {/* 将 children 放在您希望渲染页面或嵌套布局的位置 */}
+ {children}
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/loading.tsx b/crop-x/src/app/loading.tsx
new file mode 100644
index 0000000..a397e9e
--- /dev/null
+++ b/crop-x/src/app/loading.tsx
@@ -0,0 +1,10 @@
+export default function Loading() {
+ return (
+
+
+
+
正在加载 Crop-X 智慧农业系统...
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/not-found.tsx b/crop-x/src/app/not-found.tsx
new file mode 100644
index 0000000..dd7c171
--- /dev/null
+++ b/crop-x/src/app/not-found.tsx
@@ -0,0 +1,21 @@
+export default function NotFound() {
+ return (
+
+
+
404
+
+ 页面未找到
+
+
+ 抱歉,您访问的页面不存在
+
+
+ 返回首页
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/page.tsx b/crop-x/src/app/page.tsx
new file mode 100644
index 0000000..86fe74e
--- /dev/null
+++ b/crop-x/src/app/page.tsx
@@ -0,0 +1,8 @@
+
+export default function HomePage() {
+ return (
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/water-fertilizer-control/layout.tsx b/crop-x/src/app/water-fertilizer-control/layout.tsx
new file mode 100644
index 0000000..9619b1b
--- /dev/null
+++ b/crop-x/src/app/water-fertilizer-control/layout.tsx
@@ -0,0 +1,22 @@
+import { ReactNode } from 'react'
+
+export default function WaterFertilizerControlLayout({
+ children,
+}: {
+ children: ReactNode
+}) {
+ return (
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/app/water-fertilizer-control/page.tsx b/crop-x/src/app/water-fertilizer-control/page.tsx
new file mode 100644
index 0000000..de9f331
--- /dev/null
+++ b/crop-x/src/app/water-fertilizer-control/page.tsx
@@ -0,0 +1,123 @@
+import Link from 'next/link'
+import { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: '水肥控制 - Crop-X 智慧农业管理系统',
+ description: '水肥一体化控制系统主页面',
+}
+
+export default function WaterFertilizerControlPage() {
+ return (
+
+
+
+ 水肥一体化控制系统
+
+
+ 水肥机管理、智能灌溉、施肥配方和实时监测控制
+
+
+
+
+
+ 🚰 水肥机管理
+
+
+ 设备注册和状态监控管理
+
+
+
+
+
+ 💦 智能灌溉
+
+
+ 灌溉计划和自动控制管理
+
+
+
+
+
+ 🧪 施肥配方管理
+
+
+ 配置管理和作物专用配方
+
+
+
+
+
+ ⚙️ 水肥一体化控制
+
+
+ 同步控制和精准施用管理
+
+
+
+
+
+ 📊 实时监测与预警
+
+
+ 参数显示和预警系统管理
+
+
+
+
+
+
+
+
+ 📊 系统状态
+
+
+
+ 在线设备
+ 18 / 20
+
+
+ 今日灌溉量
+ 2,450 m³
+
+
+ 施肥次数
+ 8 次
+
+
+
+
+
+
+ 🔧 快速操作
+
+
+
+ 启动灌溉
+
+
+ 配置施肥
+
+
+ 查看数据
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/crop-x/src/components/app-sidebar.tsx b/crop-x/src/components/app-sidebar.tsx
index 2aee537..b5c2a77 100644
--- a/crop-x/src/components/app-sidebar.tsx
+++ b/crop-x/src/components/app-sidebar.tsx
@@ -1,5 +1,6 @@
import * as React from "react"
import { ChevronRight } from "lucide-react"
+import Link from "next/link"
import { SearchForm } from "@/components/search-form"
import { VersionSwitcher } from "@/components/version-switcher"
@@ -21,9 +22,28 @@ import {
SidebarRail,
} from "@/components/ui/sidebar"
-// This is sample data.
-const data = {
- versions: ["1.0.1", "1.1.0-alpha", "2.0.0-beta1"],
+// Define the interface for menu data
+interface MenuItem {
+ title: string
+ url: string
+ isActive?: boolean
+}
+
+interface NavMainItem {
+ title: string
+ url: string
+ icon?: string
+ items: MenuItem[]
+}
+
+interface SidebarData {
+ navMain: NavMainItem[]
+ versions?: string[]
+}
+
+// Default data - used when no external data is provided
+const defaultData: SidebarData = {
+ versions: ["1.0.0", "2.0.0"],
navMain: [
{
title: "Getting Started",
@@ -64,34 +84,6 @@ const data = {
title: "Styling",
url: "#",
},
- {
- title: "Optimizing",
- url: "#",
- },
- {
- title: "Configuring",
- url: "#",
- },
- {
- title: "Testing",
- url: "#",
- },
- {
- title: "Authentication",
- url: "#",
- },
- {
- title: "Deploying",
- url: "#",
- },
- {
- title: "Upgrading",
- url: "#",
- },
- {
- title: "Examples",
- url: "#",
- },
],
},
{
@@ -106,76 +98,31 @@ const data = {
title: "File Conventions",
url: "#",
},
- {
- title: "Functions",
- url: "#",
- },
- {
- title: "next.config.js Options",
- url: "#",
- },
- {
- title: "CLI",
- url: "#",
- },
- {
- title: "Edge Runtime",
- url: "#",
- },
- ],
- },
- {
- title: "Architecture",
- url: "#",
- items: [
- {
- title: "Accessibility",
- url: "#",
- },
- {
- title: "Fast Refresh",
- url: "#",
- },
- {
- title: "Next.js Compiler",
- url: "#",
- },
- {
- title: "Supported Browsers",
- url: "#",
- },
- {
- title: "Turbopack",
- url: "#",
- },
- ],
- },
- {
- title: "Community",
- url: "#",
- items: [
- {
- title: "Contribution Guide",
- url: "#",
- },
],
},
],
}
-export function AppSidebar({ ...props }: React.ComponentProps) {
+export interface AppSidebarProps extends React.ComponentProps {
+ data?: SidebarData
+}
+
+export function AppSidebar({ data, ...props }: AppSidebarProps) {
+ // Use external data if provided, otherwise use default data
+ const sidebarData = data || defaultData
+
return (
{/* We create a collapsible SidebarGroup for each parent. */}
- {data.navMain.map((item) => (
+ {sidebarData.navMain.map((item) => (
) {
className="group/label text-sm text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"
>
- {item.title}{" "}
-
+
+ {item.icon && {item.icon} }
+ {item.title}
+
+
- {item.items.map((item) => (
-
-
- {item.title}
+ {item.items.map((subItem) => (
+
+
+ {subItem.url.startsWith('#') ? (
+ {subItem.title}
+ ) : (
+ {subItem.title}
+ )}
))}
diff --git a/crop-x/src/components/layouts/Main.tsx b/crop-x/src/components/layouts/Main.tsx
index 3a8eb48..fadc7e5 100644
--- a/crop-x/src/components/layouts/Main.tsx
+++ b/crop-x/src/components/layouts/Main.tsx
@@ -8,7 +8,7 @@ function Main() {
)
diff --git a/crop-x/src/components/layouts/Navbar.tsx b/crop-x/src/components/layouts/Navbar.tsx
index 5f41782..ad45c98 100644
--- a/crop-x/src/components/layouts/Navbar.tsx
+++ b/crop-x/src/components/layouts/Navbar.tsx
@@ -23,7 +23,8 @@ import {
SheetTrigger,
} from "@/components/ui/sheet";
-interface MenuItem {
+// 菜单项接口定义
+export interface MenuItem {
title: string;
url: string;
description?: string;
@@ -31,110 +32,104 @@ interface MenuItem {
items?: MenuItem[];
}
-interface Navbar1Props {
- logo?: {
- url: string;
- src: string;
- alt: string;
+// Logo接口定义
+export interface LogoConfig {
+ url: string;
+ src: string;
+ alt: string;
+ title: string;
+}
+
+// 认证接口定义
+export interface AuthConfig {
+ login: {
title: string;
+ url: string;
};
- menu?: MenuItem[];
- auth?: {
- login: {
- title: string;
- url: string;
- };
- signup: {
- title: string;
- url: string;
- };
+ signup: {
+ title: string;
+ url: string;
};
}
-const Navbar1 = ({
- logo = {
- url: "https://www.shadcnblocks.com",
+// Navbar数据接口定义
+export interface NavbarData {
+ logo?: LogoConfig;
+ menu?: MenuItem[];
+ auth?: AuthConfig;
+}
+
+// Navbar组件Props接口定义
+export interface NavbarProps {
+ navbar?: NavbarData;
+}
+
+// 默认Navbar数据
+const defaultNavbar: NavbarData = {
+ logo: {
+ url: "/",
src: "https://deifkwefumgah.cloudfront.net/shadcnblocks/block/logos/shadcnblockscom-icon.svg",
- alt: "logo",
- title: "Shadcnblocks.com",
+ alt: "Crop-X Logo",
+ title: "Crop-X 智慧农业",
},
- menu = [
- { title: "Home", url: "#" },
+ menu: [
{
- title: "Products",
- url: "#",
- items: [
- {
- title: "Blog",
- description: "The latest industry news, updates, and info",
- icon: ,
- url: "#",
- },
- {
- title: "Company",
- description: "Our mission is to innovate and empower the world",
- icon: ,
- url: "#",
- },
- {
- title: "Careers",
- description: "Browse job listing and discover our workspace",
- icon: ,
- url: "#",
- },
- {
- title: "Support",
- description:
- "Get in touch with our support team or visit our community forums",
- icon: ,
- url: "#",
- },
- ],
+ title: "智能农机管理系统",
+ url: "/agricultural-machinery",
+ description: "农机档案、实时监控、精准作业管理",
+ icon: ,
},
{
- title: "Resources",
- url: "#",
- items: [
- {
- title: "Help Center",
- description: "Get all the answers you need right here",
- icon: ,
- url: "#",
- },
- {
- title: "Contact Us",
- description: "We are here to help you with any questions you have",
- icon: ,
- url: "#",
- },
- {
- title: "Status",
- description: "Check the current status of our services and APIs",
- icon: ,
- url: "#",
- },
- {
- title: "Terms of Service",
- description: "Our terms and conditions for using our services",
- icon: ,
- url: "#",
- },
- ],
+ title: "地块信息管理系统",
+ url: "/land-information",
+ description: "地块档案、地图管理、空间分析",
+ icon: ,
},
{
- title: "Pricing",
- url: "#",
+ title: "农事操作管理系统",
+ url: "/farming-operation",
+ description: "农事计划、任务管理、操作执行",
+ icon: ,
},
{
- title: "Blog",
- url: "#",
+ title: "农业资产管理系统",
+ url: "/agricultural-asset",
+ description: "基础信息、采购管理、库存管理",
+ icon: ,
+ },
+ {
+ title: "AI作物模型精准决策系统",
+ url: "/ai-crop-model",
+ description: "数据感知、模型应用、智能决策",
+ icon: ,
+ },
+ {
+ title: "水肥一体化控制系统",
+ url: "/water-fertilizer-control",
+ description: "水肥机管理、智能灌溉、配方管理",
+ icon: ,
+ },
+ {
+ title: "中心配置管理系统",
+ url: "/central-config",
+ description: "租户管理、用户管理、系统监控",
+ icon: ,
},
],
- auth = {
- login: { title: "Login", url: "#" },
- signup: { title: "Sign up", url: "#" },
+ auth: {
+ login: { title: "登录", url: "/login" },
+ signup: { title: "注册", url: "/register" },
},
-}: Navbar1Props) => {
+};
+
+// 新的Navbar组件,支持外部传入navbar参数
+export function Navbar({ navbar }: NavbarProps) {
+ // 使用外部传入的navbar数据,如果没有则使用默认数据
+ const navbarData = navbar || defaultNavbar;
+ const logo = navbarData.logo || defaultNavbar.logo;
+ const menu = navbarData.menu || defaultNavbar.menu;
+ const auth = navbarData.auth || defaultNavbar.auth;
+
return (
@@ -224,8 +219,8 @@ const Navbar1 = ({
);
-};
-
+}
+
const renderMenuItem = (item: MenuItem) => {
if (item.items) {
return (
@@ -295,5 +290,3 @@ const SubMenuLink = ({ item }: { item: MenuItem }) => {
);
};
-
-export {Navbar1} ;
diff --git a/crop-x/src/components/layouts/SideBar/SideBar.tsx b/crop-x/src/components/layouts/SideBar/SideBar.tsx
index 1d243b9..96da639 100644
--- a/crop-x/src/components/layouts/SideBar/SideBar.tsx
+++ b/crop-x/src/components/layouts/SideBar/SideBar.tsx
@@ -1,4 +1,8 @@
-import { AppSidebar } from "@/components/app-sidebar"
+"use client"
+import { ReactNode, useEffect, useState } from 'react'
+import { usePathname } from 'next/navigation'
+import { AppSidebar, AppSidebarProps, SidebarData } from "@/components/app-sidebar"
+
import {
Breadcrumb,
BreadcrumbItem,
@@ -13,31 +17,95 @@ import {
SidebarProvider,
SidebarTrigger,
} from "@/components/ui/sidebar"
+import React from 'react'
+export interface SideBarProps {
+ children: ReactNode
+ data?: AppSidebarProps['data']
+}
+
+export default function SideBar({ children, data }: SideBarProps) {
+ const pathname = usePathname()
+ const [breadcrumbItems, setBreadcrumbItems] = useState>([])
+
+ useEffect(() => {
+ if (!data || !data.navMain) return
+
+ const generateBreadcrumb = () => {
+ const items = [{ title: "首页", url: "/" }]
+
+ // 解析当前路径
+ const pathSegments = pathname.split('/').filter(Boolean)
+
+ if (pathSegments.length === 0) {
+ // 首页
+ items.push({ title: "首页", isPage: true })
+ } else if (pathSegments[0] === 'central-config') {
+ // 中心配置模块
+ items.push({ title: "中心配置", url: "/central-config" })
+
+ if (pathSegments.length === 1) {
+ // 中心配置主页
+ items.push({ title: "中心配置", isPage: true })
+ } else if (pathSegments.length >= 2) {
+ // 查找匹配的一级菜单
+ const mainModule = data.navMain.find(item =>
+ item.url === `/central-config/${pathSegments[1]}`
+ )
+
+ if (mainModule) {
+ items.push({ title: mainModule.title, url: mainModule.url })
+
+ if (pathSegments.length === 2) {
+ // 一级菜单页面
+ items.push({ title: mainModule.title, isPage: true })
+ } else if (pathSegments.length >= 3) {
+ // 查找匹配的二级菜单
+ const subModule = mainModule.items.find(item =>
+ item.url === pathname
+ )
+
+ if (subModule) {
+ items.push({ title: subModule.title, isPage: true })
+ }
+ }
+ }
+ }
+ }
+
+ setBreadcrumbItems(items)
+ }
+
+ generateBreadcrumb()
+ }, [pathname, data])
-export default function Page() {
return (
-
+
-
-
- Building Your Application
-
-
-
-
- Data Fetching
-
+ {breadcrumbItems.map((item, index) => (
+
+ {index > 0 && }
+
+ {item.isPage ? (
+ {item.title}
+ ) : item.url ? (
+ {item.title}
+ ) : (
+ {item.title}
+ )}
+
+
+ ))}
- 我的页面内容
+ {children}
diff --git a/crop-x/src/main.tsx b/crop-x/src/main.tsx
deleted file mode 100644
index 094f408..0000000
--- a/crop-x/src/main.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-import React from 'react'
-import ReactDOM from 'react-dom/client'
-import App from './App'
-import './styles/globals.css'
-
-ReactDOM.createRoot(document.getElementById('root')!).render(
-
-
- ,
-)
\ No newline at end of file
diff --git a/crop-x/src/pages/NotFound.css b/crop-x/src/pages/NotFound.css
deleted file mode 100644
index 533eee3..0000000
--- a/crop-x/src/pages/NotFound.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 404页面样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/NotFound.tsx b/crop-x/src/pages/NotFound.tsx
deleted file mode 100644
index b03cbb8..0000000
--- a/crop-x/src/pages/NotFound.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const NotFound = () => {
- useEffect(() => {
- // TODO: 实现404页面逻辑
- console.log('404页面')
- }, [])
-
- return (
-
-
页面未找到
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/ServerError.css b/crop-x/src/pages/ServerError.css
deleted file mode 100644
index e1d8eb6..0000000
--- a/crop-x/src/pages/ServerError.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 服务器错误页面样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/ServerError.tsx b/crop-x/src/pages/ServerError.tsx
deleted file mode 100644
index 8b210c0..0000000
--- a/crop-x/src/pages/ServerError.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const ServerError = () => {
- useEffect(() => {
- // TODO: 实现服务器错误页面逻辑
- console.log('服务器错误页面')
- }, [])
-
- return (
-
-
服务器错误
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/ai-model/AIModelEntry.css b/crop-x/src/pages/ai-model/AIModelEntry.css
deleted file mode 100644
index 2d71c38..0000000
--- a/crop-x/src/pages/ai-model/AIModelEntry.css
+++ /dev/null
@@ -1 +0,0 @@
-/* AI模型入口样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/ai-model/AIModelEntry.tsx b/crop-x/src/pages/ai-model/AIModelEntry.tsx
deleted file mode 100644
index f8f05f6..0000000
--- a/crop-x/src/pages/ai-model/AIModelEntry.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const AIModelEntry = () => {
- useEffect(() => {
- // TODO: 实现AI模型入口逻辑
- console.log('AI模型入口页面')
- }, [])
-
- return (
-
-
AI模型入口
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/ai-model/ModelTraining.css b/crop-x/src/pages/ai-model/ModelTraining.css
deleted file mode 100644
index 4d83a00..0000000
--- a/crop-x/src/pages/ai-model/ModelTraining.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 模型训练样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/ai-model/ModelTraining.tsx b/crop-x/src/pages/ai-model/ModelTraining.tsx
deleted file mode 100644
index 1072849..0000000
--- a/crop-x/src/pages/ai-model/ModelTraining.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const ModelTraining = () => {
- useEffect(() => {
- // TODO: 实现模型训练逻辑
- console.log('模型训练页面')
- }, [])
-
- return (
-
-
模型训练
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/ai-model/PredictionAnalysis.css b/crop-x/src/pages/ai-model/PredictionAnalysis.css
deleted file mode 100644
index bd7c201..0000000
--- a/crop-x/src/pages/ai-model/PredictionAnalysis.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 预测分析样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/ai-model/PredictionAnalysis.tsx b/crop-x/src/pages/ai-model/PredictionAnalysis.tsx
deleted file mode 100644
index 5826086..0000000
--- a/crop-x/src/pages/ai-model/PredictionAnalysis.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const PredictionAnalysis = () => {
- useEffect(() => {
- // TODO: 实现预测分析逻辑
- console.log('预测分析页面')
- }, [])
-
- return (
-
-
预测分析
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/ai-model/RecommendationSystem.css b/crop-x/src/pages/ai-model/RecommendationSystem.css
deleted file mode 100644
index 790d297..0000000
--- a/crop-x/src/pages/ai-model/RecommendationSystem.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 推荐系统样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/ai-model/RecommendationSystem.tsx b/crop-x/src/pages/ai-model/RecommendationSystem.tsx
deleted file mode 100644
index e900d5f..0000000
--- a/crop-x/src/pages/ai-model/RecommendationSystem.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const RecommendationSystem = () => {
- useEffect(() => {
- // TODO: 实现推荐系统逻辑
- console.log('推荐系统页面')
- }, [])
-
- return (
-
-
推荐系统
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/asset/AssetDepreciation.css b/crop-x/src/pages/asset/AssetDepreciation.css
deleted file mode 100644
index a15df95..0000000
--- a/crop-x/src/pages/asset/AssetDepreciation.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 资产折旧样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/asset/AssetDepreciation.tsx b/crop-x/src/pages/asset/AssetDepreciation.tsx
deleted file mode 100644
index 53b1018..0000000
--- a/crop-x/src/pages/asset/AssetDepreciation.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const AssetDepreciation = () => {
- useEffect(() => {
- // TODO: 实现资产折旧逻辑
- console.log('资产折旧页面')
- }, [])
-
- return (
-
-
资产折旧
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/asset/AssetEntry.css b/crop-x/src/pages/asset/AssetEntry.css
deleted file mode 100644
index 6333826..0000000
--- a/crop-x/src/pages/asset/AssetEntry.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 资产管理入口样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/asset/AssetEntry.tsx b/crop-x/src/pages/asset/AssetEntry.tsx
deleted file mode 100644
index ed16dae..0000000
--- a/crop-x/src/pages/asset/AssetEntry.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const AssetEntry = () => {
- useEffect(() => {
- // TODO: 实现资产管理入口逻辑
- console.log('资产管理入口页面')
- }, [])
-
- return (
-
-
资产管理入口
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/asset/InventoryManagement.css b/crop-x/src/pages/asset/InventoryManagement.css
deleted file mode 100644
index 653ec08..0000000
--- a/crop-x/src/pages/asset/InventoryManagement.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 库存管理样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/asset/InventoryManagement.tsx b/crop-x/src/pages/asset/InventoryManagement.tsx
deleted file mode 100644
index d88092e..0000000
--- a/crop-x/src/pages/asset/InventoryManagement.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const InventoryManagement = () => {
- useEffect(() => {
- // TODO: 实现库存管理逻辑
- console.log('库存管理页面')
- }, [])
-
- return (
-
-
库存管理
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/asset/MaintenanceRecords.css b/crop-x/src/pages/asset/MaintenanceRecords.css
deleted file mode 100644
index e5d93a3..0000000
--- a/crop-x/src/pages/asset/MaintenanceRecords.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 维护记录样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/asset/MaintenanceRecords.tsx b/crop-x/src/pages/asset/MaintenanceRecords.tsx
deleted file mode 100644
index 5971034..0000000
--- a/crop-x/src/pages/asset/MaintenanceRecords.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const MaintenanceRecords = () => {
- useEffect(() => {
- // TODO: 实现维护记录逻辑
- console.log('维护记录页面')
- }, [])
-
- return (
-
-
维护记录
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/auth/Login.css b/crop-x/src/pages/auth/Login.css
deleted file mode 100644
index d29fea4..0000000
--- a/crop-x/src/pages/auth/Login.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 登录页面样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/auth/Login.tsx b/crop-x/src/pages/auth/Login.tsx
deleted file mode 100644
index b49a2ab..0000000
--- a/crop-x/src/pages/auth/Login.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const Login = () => {
- useEffect(() => {
- // TODO: 实现登录逻辑
- console.log('登录页面')
- }, [])
-
- return (
-
-
用户登录
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/config/CentralConfigEntry.css b/crop-x/src/pages/config/CentralConfigEntry.css
deleted file mode 100644
index 0801c8d..0000000
--- a/crop-x/src/pages/config/CentralConfigEntry.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 中心配置入口样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/config/CentralConfigEntry.tsx b/crop-x/src/pages/config/CentralConfigEntry.tsx
deleted file mode 100644
index 1dba6c9..0000000
--- a/crop-x/src/pages/config/CentralConfigEntry.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const CentralConfigEntry = () => {
- useEffect(() => {
- // TODO: 实现中心配置入口逻辑
- console.log('中心配置入口页面')
- }, [])
-
- return (
-
-
中心配置入口
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/config/MessageCenter.css b/crop-x/src/pages/config/MessageCenter.css
deleted file mode 100644
index 6baba80..0000000
--- a/crop-x/src/pages/config/MessageCenter.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 消息中心样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/config/MessageCenter.tsx b/crop-x/src/pages/config/MessageCenter.tsx
deleted file mode 100644
index 3d842d5..0000000
--- a/crop-x/src/pages/config/MessageCenter.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const MessageCenter = () => {
- useEffect(() => {
- // TODO: 实现消息中心逻辑
- console.log('消息中心页面')
- }, [])
-
- return (
-
-
消息中心
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/config/SystemMonitoring.css b/crop-x/src/pages/config/SystemMonitoring.css
deleted file mode 100644
index 5ad546c..0000000
--- a/crop-x/src/pages/config/SystemMonitoring.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 系统监控样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/config/SystemMonitoring.tsx b/crop-x/src/pages/config/SystemMonitoring.tsx
deleted file mode 100644
index bf04228..0000000
--- a/crop-x/src/pages/config/SystemMonitoring.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const SystemMonitoring = () => {
- useEffect(() => {
- // TODO: 实现系统监控逻辑
- console.log('系统监控页面')
- }, [])
-
- return (
-
-
系统监控
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/config/SystemParameters.css b/crop-x/src/pages/config/SystemParameters.css
deleted file mode 100644
index e7fb373..0000000
--- a/crop-x/src/pages/config/SystemParameters.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 系统参数样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/config/SystemParameters.tsx b/crop-x/src/pages/config/SystemParameters.tsx
deleted file mode 100644
index 5cc32dc..0000000
--- a/crop-x/src/pages/config/SystemParameters.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const SystemParameters = () => {
- useEffect(() => {
- // TODO: 实现系统参数逻辑
- console.log('系统参数页面')
- }, [])
-
- return (
-
-
系统参数
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/config/TenantManagement.css b/crop-x/src/pages/config/TenantManagement.css
deleted file mode 100644
index 0110947..0000000
--- a/crop-x/src/pages/config/TenantManagement.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 租户管理样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/config/TenantManagement.tsx b/crop-x/src/pages/config/TenantManagement.tsx
deleted file mode 100644
index d7f132d..0000000
--- a/crop-x/src/pages/config/TenantManagement.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const TenantManagement = () => {
- useEffect(() => {
- // TODO: 实现租户管理逻辑
- console.log('租户管理页面')
- }, [])
-
- return (
-
-
租户管理
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/config/UserManagement.css b/crop-x/src/pages/config/UserManagement.css
deleted file mode 100644
index 46b6e9c..0000000
--- a/crop-x/src/pages/config/UserManagement.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 用户管理样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/config/UserManagement.tsx b/crop-x/src/pages/config/UserManagement.tsx
deleted file mode 100644
index 8fa316f..0000000
--- a/crop-x/src/pages/config/UserManagement.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const UserManagement = () => {
- useEffect(() => {
- // TODO: 实现用户管理逻辑
- console.log('用户管理页面')
- }, [])
-
- return (
-
-
用户管理
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/dashboard/Dashboard.css b/crop-x/src/pages/dashboard/Dashboard.css
deleted file mode 100644
index 92c38dc..0000000
--- a/crop-x/src/pages/dashboard/Dashboard.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 仪表板页面样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/dashboard/Dashboard.tsx b/crop-x/src/pages/dashboard/Dashboard.tsx
deleted file mode 100644
index 086044c..0000000
--- a/crop-x/src/pages/dashboard/Dashboard.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const Dashboard = () => {
- useEffect(() => {
- // TODO: 实现仪表板逻辑
- console.log('仪表板页面')
- }, [])
-
- return (
-
-
系统仪表板
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/irrigation/IrrigationEntry.css b/crop-x/src/pages/irrigation/IrrigationEntry.css
deleted file mode 100644
index 0d3e833..0000000
--- a/crop-x/src/pages/irrigation/IrrigationEntry.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 灌溉控制入口样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/irrigation/IrrigationEntry.tsx b/crop-x/src/pages/irrigation/IrrigationEntry.tsx
deleted file mode 100644
index b29859c..0000000
--- a/crop-x/src/pages/irrigation/IrrigationEntry.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const IrrigationEntry = () => {
- useEffect(() => {
- // TODO: 实现灌溉控制入口逻辑
- console.log('灌溉控制入口页面')
- }, [])
-
- return (
-
-
灌溉控制入口
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/irrigation/MonitoringSystem.css b/crop-x/src/pages/irrigation/MonitoringSystem.css
deleted file mode 100644
index 21779e4..0000000
--- a/crop-x/src/pages/irrigation/MonitoringSystem.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 监控系统样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/irrigation/MonitoringSystem.tsx b/crop-x/src/pages/irrigation/MonitoringSystem.tsx
deleted file mode 100644
index 77390d2..0000000
--- a/crop-x/src/pages/irrigation/MonitoringSystem.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const MonitoringSystem = () => {
- useEffect(() => {
- // TODO: 实现监控系统逻辑
- console.log('监控系统页面')
- }, [])
-
- return (
-
-
监控系统
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/irrigation/SchedulingSystem.css b/crop-x/src/pages/irrigation/SchedulingSystem.css
deleted file mode 100644
index 13d75a7..0000000
--- a/crop-x/src/pages/irrigation/SchedulingSystem.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 调度系统样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/irrigation/SchedulingSystem.tsx b/crop-x/src/pages/irrigation/SchedulingSystem.tsx
deleted file mode 100644
index 9c899e6..0000000
--- a/crop-x/src/pages/irrigation/SchedulingSystem.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const SchedulingSystem = () => {
- useEffect(() => {
- // TODO: 实现调度系统逻辑
- console.log('调度系统页面')
- }, [])
-
- return (
-
-
调度系统
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/irrigation/SystemControl.css b/crop-x/src/pages/irrigation/SystemControl.css
deleted file mode 100644
index 6842493..0000000
--- a/crop-x/src/pages/irrigation/SystemControl.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 系统控制样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/irrigation/SystemControl.tsx b/crop-x/src/pages/irrigation/SystemControl.tsx
deleted file mode 100644
index 0a82848..0000000
--- a/crop-x/src/pages/irrigation/SystemControl.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const SystemControl = () => {
- useEffect(() => {
- // TODO: 实现系统控制逻辑
- console.log('系统控制页面')
- }, [])
-
- return (
-
-
系统控制
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/land/ComparativeAnalysis.css b/crop-x/src/pages/land/ComparativeAnalysis.css
deleted file mode 100644
index ac9e9a5..0000000
--- a/crop-x/src/pages/land/ComparativeAnalysis.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 对比分析样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/land/ComparativeAnalysis.tsx b/crop-x/src/pages/land/ComparativeAnalysis.tsx
deleted file mode 100644
index 1791412..0000000
--- a/crop-x/src/pages/land/ComparativeAnalysis.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const ComparativeAnalysis = () => {
- useEffect(() => {
- // TODO: 实现对比分析逻辑
- console.log('对比分析页面')
- }, [])
-
- return (
-
-
对比分析
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/land/LandArchiveManagement.css b/crop-x/src/pages/land/LandArchiveManagement.css
deleted file mode 100644
index e72c2cd..0000000
--- a/crop-x/src/pages/land/LandArchiveManagement.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 地块档案管理样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/land/LandArchiveManagement.tsx b/crop-x/src/pages/land/LandArchiveManagement.tsx
deleted file mode 100644
index 12cb9b3..0000000
--- a/crop-x/src/pages/land/LandArchiveManagement.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const LandArchiveManagement = () => {
- useEffect(() => {
- // TODO: 实现地块档案管理逻辑
- console.log('地块档案管理页面')
- }, [])
-
- return (
-
-
地块档案管理
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/land/LandClassification.css b/crop-x/src/pages/land/LandClassification.css
deleted file mode 100644
index b1d6bec..0000000
--- a/crop-x/src/pages/land/LandClassification.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 地块分类样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/land/LandClassification.tsx b/crop-x/src/pages/land/LandClassification.tsx
deleted file mode 100644
index e559f1b..0000000
--- a/crop-x/src/pages/land/LandClassification.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const LandClassification = () => {
- useEffect(() => {
- // TODO: 实现地块分类逻辑
- console.log('地块分类页面')
- }, [])
-
- return (
-
-
地块分类
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/land/LandEntry.tsx b/crop-x/src/pages/land/LandEntry.tsx
deleted file mode 100644
index 35cc707..0000000
--- a/crop-x/src/pages/land/LandEntry.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const LandEntry = () => {
- useEffect(() => {
- // TODO: 实现地块管理入口逻辑
- console.log('地块管理入口页面')
- }, [])
-
- return (
-
-
地块管理
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/land/MapManagement.css b/crop-x/src/pages/land/MapManagement.css
deleted file mode 100644
index 6628dfd..0000000
--- a/crop-x/src/pages/land/MapManagement.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 地图管理样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/land/MapManagement.tsx b/crop-x/src/pages/land/MapManagement.tsx
deleted file mode 100644
index 062d108..0000000
--- a/crop-x/src/pages/land/MapManagement.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const MapManagement = () => {
- useEffect(() => {
- // TODO: 实现地图管理逻辑
- console.log('地图管理页面')
- }, [])
-
- return (
-
-
地图管理
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/land/RiskWarning.css b/crop-x/src/pages/land/RiskWarning.css
deleted file mode 100644
index fd030e4..0000000
--- a/crop-x/src/pages/land/RiskWarning.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 风险预警样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/land/RiskWarning.tsx b/crop-x/src/pages/land/RiskWarning.tsx
deleted file mode 100644
index f7ae621..0000000
--- a/crop-x/src/pages/land/RiskWarning.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const RiskWarning = () => {
- useEffect(() => {
- // TODO: 实现风险预警逻辑
- console.log('风险预警页面')
- }, [])
-
- return (
-
-
风险预警
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/land/SpatialAnalysis.css b/crop-x/src/pages/land/SpatialAnalysis.css
deleted file mode 100644
index 0446a03..0000000
--- a/crop-x/src/pages/land/SpatialAnalysis.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 空间分析样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/land/SpatialAnalysis.tsx b/crop-x/src/pages/land/SpatialAnalysis.tsx
deleted file mode 100644
index 216e8e1..0000000
--- a/crop-x/src/pages/land/SpatialAnalysis.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const SpatialAnalysis = () => {
- useEffect(() => {
- // TODO: 实现空间分析逻辑
- console.log('空间分析页面')
- }, [])
-
- return (
-
-
空间分析
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/land/SuitabilityEvaluation.css b/crop-x/src/pages/land/SuitabilityEvaluation.css
deleted file mode 100644
index 26df062..0000000
--- a/crop-x/src/pages/land/SuitabilityEvaluation.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 适宜性评价样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/land/SuitabilityEvaluation.tsx b/crop-x/src/pages/land/SuitabilityEvaluation.tsx
deleted file mode 100644
index 6ad0ac7..0000000
--- a/crop-x/src/pages/land/SuitabilityEvaluation.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const SuitabilityEvaluation = () => {
- useEffect(() => {
- // TODO: 实现适宜性评价逻辑
- console.log('适宜性评价页面')
- }, [])
-
- return (
-
-
适宜性评价
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/CategoryForm/index.css b/crop-x/src/pages/machinery/Archive/MachineryClassification/components/CategoryForm/index.css
deleted file mode 100644
index 146b577..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/CategoryForm/index.css
+++ /dev/null
@@ -1 +0,0 @@
-/* CategoryForm 样式文件 */
diff --git a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/CategoryForm/index.tsx b/crop-x/src/pages/machinery/Archive/MachineryClassification/components/CategoryForm/index.tsx
deleted file mode 100644
index 5a6dc25..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/CategoryForm/index.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from 'react';
-import './index.css';
-
-export function CategoryForm() {
- console.log('CategoryForm component rendered');
- return
CategoryForm ;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/CategoryForm/types.ts b/crop-x/src/pages/machinery/Archive/MachineryClassification/components/CategoryForm/types.ts
deleted file mode 100644
index ed1170d..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/CategoryForm/types.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export interface CategoryFormProps {
- // Props will be defined later
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/CategoryTree/index.css b/crop-x/src/pages/machinery/Archive/MachineryClassification/components/CategoryTree/index.css
deleted file mode 100644
index e381f01..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/CategoryTree/index.css
+++ /dev/null
@@ -1 +0,0 @@
-/* CategoryTree 样式文件 */
diff --git a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/CategoryTree/index.tsx b/crop-x/src/pages/machinery/Archive/MachineryClassification/components/CategoryTree/index.tsx
deleted file mode 100644
index ec14ee8..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/CategoryTree/index.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from 'react';
-import './index.css';
-
-export function CategoryTree() {
- console.log('CategoryTree component rendered');
- return
CategoryTree ;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/CategoryTree/types.ts b/crop-x/src/pages/machinery/Archive/MachineryClassification/components/CategoryTree/types.ts
deleted file mode 100644
index 1e439c1..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/CategoryTree/types.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export interface CategoryTreeProps {
- // Props will be defined later
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagForm/index.css b/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagForm/index.css
deleted file mode 100644
index 75be4d1..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagForm/index.css
+++ /dev/null
@@ -1 +0,0 @@
-/* TagForm 样式文件 */
diff --git a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagForm/index.tsx b/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagForm/index.tsx
deleted file mode 100644
index 15fb2f8..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagForm/index.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from 'react';
-import './index.css';
-
-export function TagForm() {
- console.log('TagForm component rendered');
- return
TagForm ;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagForm/types.ts b/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagForm/types.ts
deleted file mode 100644
index 577a596..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagForm/types.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export interface TagFormProps {
- // Props will be defined later
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagManager/index.css b/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagManager/index.css
deleted file mode 100644
index e8fca43..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagManager/index.css
+++ /dev/null
@@ -1 +0,0 @@
-/* TagManager 样式文件 */
diff --git a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagManager/index.tsx b/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagManager/index.tsx
deleted file mode 100644
index 7025893..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagManager/index.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from 'react';
-import './index.css';
-
-export function TagManager() {
- console.log('TagManager component rendered');
- return
TagManager ;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagManager/types.ts b/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagManager/types.ts
deleted file mode 100644
index 92da1bd..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagManager/types.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export interface TagManagerProps {
- // Props will be defined later
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagSelector/index.css b/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagSelector/index.css
deleted file mode 100644
index 443554e..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagSelector/index.css
+++ /dev/null
@@ -1 +0,0 @@
-/* TagSelector 样式文件 */
diff --git a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagSelector/index.tsx b/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagSelector/index.tsx
deleted file mode 100644
index 687e67a..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagSelector/index.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from 'react';
-import './index.css';
-
-export function TagSelector() {
- console.log('TagSelector component rendered');
- return
TagSelector ;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagSelector/types.ts b/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagSelector/types.ts
deleted file mode 100644
index 55a2161..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryClassification/components/TagSelector/types.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export interface TagSelectorProps {
- // Props will be defined later
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryClassification/constants.tsx b/crop-x/src/pages/machinery/Archive/MachineryClassification/constants.tsx
deleted file mode 100644
index c551521..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryClassification/constants.tsx
+++ /dev/null
@@ -1,6 +0,0 @@
-export const CATEGORY_COLORS = [
- "#1890ff",
- "#52c41a",
- "#fa8c16",
- "#722ed1"
-];
diff --git a/crop-x/src/pages/machinery/Archive/MachineryClassification/hooks/useClassification.tsx b/crop-x/src/pages/machinery/Archive/MachineryClassification/hooks/useClassification.tsx
deleted file mode 100644
index 071ba6d..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryClassification/hooks/useClassification.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import { useState, useCallback } from "react";
-import { Category, Tag } from "../index.types";
-
-export function useClassification() {
- const [selectedCategory, setSelectedCategory] = useState(null);
- const [selectedTags, setSelectedTags] = useState([]);
-
- const handleCategorySelect = useCallback((category: Category) => {
- setSelectedCategory(category);
- }, []);
-
- const handleTagToggle = useCallback((tag: Tag) => {
- setSelectedTags(prev =>
- prev.find(t => t.id === tag.id)
- ? prev.filter(t => t.id \!== tag.id)
- : [...prev, tag]
- );
- }, []);
-
- return { selectedCategory, selectedTags, handleCategorySelect, handleTagToggle };
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryClassification/hooks/usePageActions.tsx b/crop-x/src/pages/machinery/Archive/MachineryClassification/hooks/usePageActions.tsx
deleted file mode 100644
index daa51c4..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryClassification/hooks/usePageActions.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useCallback } from "react";
-import { Category, Tag } from "../index.types";
-
-export function usePageActions(refreshData: () => void) {
- const handleCreateCategory = useCallback((category: Partial) => {
- console.log("Create category:", category);
- }, []);
-
- const handleCreateTag = useCallback((tag: Partial) => {
- console.log("Create tag:", tag);
- }, []);
-
- return { handleCreateCategory, handleCreateTag };
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryClassification/hooks/usePageData.tsx b/crop-x/src/pages/machinery/Archive/MachineryClassification/hooks/usePageData.tsx
deleted file mode 100644
index f552724..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryClassification/hooks/usePageData.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import { useState, useEffect, useCallback } from "react";
-import { Category, Tag } from "../index.types";
-
-export function usePageData() {
- const [categories, setCategories] = useState([]);
- const [tags, setTags] = useState([]);
- const [loading, setLoading] = useState(false);
- const [error, setError] = useState(null);
-
- const fetchData = useCallback(async () => {
- setLoading(true);
- try {
- // 模拟API调用
- setCategories([]);
- setTags([]);
- } catch (err) {
- setError("Failed to fetch data");
- } finally {
- setLoading(false);
- }
- }, []);
-
- useEffect(() => { fetchData(); }, [fetchData]);
-
- return { categories, tags, loading, error, refreshData: fetchData };
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryClassification/index.css b/crop-x/src/pages/machinery/Archive/MachineryClassification/index.css
deleted file mode 100644
index 3da144a..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryClassification/index.css
+++ /dev/null
@@ -1 +0,0 @@
-/* MachineryClassification 样式文件 */
diff --git a/crop-x/src/pages/machinery/Archive/MachineryClassification/index.tsx b/crop-x/src/pages/machinery/Archive/MachineryClassification/index.tsx
deleted file mode 100644
index 3a0a570..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryClassification/index.tsx
+++ /dev/null
@@ -1,6 +0,0 @@
-import React from "react";
-
-export function MachineryClassification() {
- console.log("MachineryClassification component rendered");
- return
农机分类与标签管理 ;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryClassification/index.types.ts b/crop-x/src/pages/machinery/Archive/MachineryClassification/index.types.ts
deleted file mode 100644
index e09b93b..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryClassification/index.types.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-export interface Category {
- id: string;
- name: string;
- parentId?: string;
- description?: string;
-}
-
-export interface Tag {
- id: string;
- name: string;
- color?: string;
- category?: string;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryClassification/utils/categoryHelpers.tsx b/crop-x/src/pages/machinery/Archive/MachineryClassification/utils/categoryHelpers.tsx
deleted file mode 100644
index afc66c9..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryClassification/utils/categoryHelpers.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import { Category } from "../index.types";
-
-export function validateCategoryName(name: string): string | null {
- if (\!name || name.trim() === "") {
- return "分类名称不能为空";
- }
- if (name.length > 50) {
- return "分类名称不能超过50个字符";
- }
- return null;
-}
-
-export function formatCategoryPath(category: Category, allCategories: Category[]): string {
- const path: string[] = [];
- let current = category;
-
- while (current) {
- path.unshift(current.name);
- current = allCategories.find(c => c.id === current.parentId);
- }
-
- return path.join(" / ");
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryClassification/utils/pageHelpers.tsx b/crop-x/src/pages/machinery/Archive/MachineryClassification/utils/pageHelpers.tsx
deleted file mode 100644
index 5139534..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryClassification/utils/pageHelpers.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import { Category, Tag } from "../index.types";
-
-export function buildCategoryTree(categories: Category[]): Category[] {
- const categoryMap = new Map();
- const roots: Category[] = [];
-
- categories.forEach(category => {
- categoryMap.set(category.id, { ...category, children: [] });
- });
-
- categories.forEach(category => {
- const node = categoryMap.get(category.id);
- if (category.parentId) {
- const parent = categoryMap.get(category.parentId);
- if (parent) parent.children.push(node);
- } else {
- roots.push(node);
- }
- });
-
- return roots;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryDetails/index.css b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryDetails/index.css
deleted file mode 100644
index be00ed5..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryDetails/index.css
+++ /dev/null
@@ -1,7 +0,0 @@
-/* MachineryDetails 样式文件 */
-.machinery-details {
- padding: 16px;
- background: white;
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryDetails/index.tsx b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryDetails/index.tsx
deleted file mode 100644
index 36c4aad..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryDetails/index.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import React from 'react';
-import { MachineryRecord } from '../../index.types';
-import './index.css';
-
-interface MachineryDetailsProps {
- machinery: MachineryRecord;
- onClose?: () => void;
- onEdit?: (machinery: MachineryRecord) => void;
-}
-
-export function MachineryDetails({ machinery, onClose, onEdit }: MachineryDetailsProps) {
- console.log('MachineryDetails component rendered', { machineryId: machinery.id });
-
- return (
-
-
农机详情
- {/* 详情内容将在后续实现 */}
-
- );
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryDetails/types.ts b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryDetails/types.ts
deleted file mode 100644
index 3ba1798..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryDetails/types.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { MachineryRecord } from "../../index.types";
-
-export interface MachineryDetailsProps {
- machinery: MachineryRecord;
- onClose?: () => void;
- onEdit?: (machinery: MachineryRecord) => void;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryFilter/index.css b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryFilter/index.css
deleted file mode 100644
index 75113f3..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryFilter/index.css
+++ /dev/null
@@ -1,8 +0,0 @@
-/* MachineryFilter 样式文件 */
-.machinery-filter {
- padding: 16px;
- background: white;
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
- margin-bottom: 16px;
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryFilter/index.tsx b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryFilter/index.tsx
deleted file mode 100644
index 6338b4b..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryFilter/index.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import React from 'react';
-import { MachineryFilters } from '../../index.types';
-import './index.css';
-
-interface MachineryFilterProps {
- filters: MachineryFilters;
- onFilterChange: (filters: MachineryFilters) => void;
-}
-
-export function MachineryFilter({ filters, onFilterChange }: MachineryFilterProps) {
- console.log('MachineryFilter component rendered', { filters });
-
- return (
-
-
农机筛选
- {/* 筛选内容将在后续实现 */}
-
- );
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryFilter/types.ts b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryFilter/types.ts
deleted file mode 100644
index 719f4dc..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryFilter/types.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import { MachineryFilters } from '../../index.types';
-
-export interface MachineryFilterProps {
- filters: MachineryFilters;
- onFilterChange: (filters: MachineryFilters) => void;
- onReset?: () => void;
- loading?: boolean;
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryForm/index.css b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryForm/index.css
deleted file mode 100644
index 3448ca1..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryForm/index.css
+++ /dev/null
@@ -1,7 +0,0 @@
-/* MachineryForm 样式文件 */
-.machinery-form {
- padding: 16px;
- background: white;
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryForm/index.tsx b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryForm/index.tsx
deleted file mode 100644
index 6ba06d7..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryForm/index.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import React from 'react';
-import { MachineryRecord } from '../../index.types';
-import './index.css';
-
-interface MachineryFormProps {
- machinery?: Partial;
- onSubmit?: (data: Partial) => void;
- onCancel?: () => void;
-}
-
-export function MachineryForm({ machinery, onSubmit, onCancel }: MachineryFormProps) {
- console.log('MachineryForm component rendered', { machinery });
-
- return (
-
-
农机表单
- {/* 表单内容将在后续实现 */}
-
- );
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryForm/types.ts b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryForm/types.ts
deleted file mode 100644
index d658674..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryForm/types.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { MachineryRecord } from '../../index.types';
-
-export interface MachineryFormProps {
- machinery?: Partial;
- mode?: 'create' | 'edit' | 'view';
- onSubmit?: (data: Partial) => void;
- onCancel?: () => void;
- loading?: boolean;
-}
-
-export interface FormFieldProps {
- label: string;
- name: keyof MachineryRecord;
- value: any;
- onChange: (value: any) => void;
- error?: string;
- disabled?: boolean;
- required?: boolean;
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryList/index.css b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryList/index.css
deleted file mode 100644
index 5ada334..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryList/index.css
+++ /dev/null
@@ -1,7 +0,0 @@
-/* MachineryList 样式文件 */
-.machinery-list {
- padding: 16px;
- background: white;
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryList/index.tsx b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryList/index.tsx
deleted file mode 100644
index 6293b42..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryList/index.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import React from 'react';
-import { MachineryRecord, PaginationState } from '../../index.types';
-import './index.css';
-
-interface MachineryListProps {
- machinery: MachineryRecord[];
- loading?: boolean;
- error?: string | null;
- pagination?: PaginationState;
- onPageChange?: (page: number) => void;
- onEdit?: (machinery: MachineryRecord) => void;
- onDelete?: (id: string) => void;
- onBatchDelete?: (ids: string[]) => void;
-}
-
-export function MachineryList({
- machinery,
- loading,
- error,
- pagination,
- onPageChange,
- onEdit,
- onDelete,
- onBatchDelete
-}: MachineryListProps) {
- console.log('MachineryList component rendered', { machineryCount: machinery.length });
-
- return (
-
-
农机列表
- {/* 列表内容将在后续实现 */}
-
- );
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryList/types.ts b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryList/types.ts
deleted file mode 100644
index a52c7e2..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryList/types.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { MachineryRecord, PaginationState } from '../../index.types';
-
-export interface MachineryListProps {
- machinery: MachineryRecord[];
- loading?: boolean;
- error?: string | null;
- pagination?: PaginationState;
- onPageChange?: (page: number) => void;
- onEdit?: (machinery: MachineryRecord) => void;
- onDelete?: (id: string) => void;
- onBatchDelete?: (ids: string[]) => void;
- onExport?: () => void;
- selectable?: boolean;
- showActions?: boolean;
-}
-
-export interface MachineryListItemProps {
- machinery: MachineryRecord;
- onEdit?: (machinery: MachineryRecord) => void;
- onDelete?: (id: string) => void;
- selected?: boolean;
- onSelect?: (id: string, selected: boolean) => void;
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryTable/index.css b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryTable/index.css
deleted file mode 100644
index e3a8cee..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryTable/index.css
+++ /dev/null
@@ -1,7 +0,0 @@
-/* MachineryTable 样式文件 */
-.machinery-table {
- padding: 16px;
- background: white;
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryTable/index.tsx b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryTable/index.tsx
deleted file mode 100644
index 5f49137..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryTable/index.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import React from 'react';
-import { MachineryRecord } from '../../index.types';
-import './index.css';
-
-interface MachineryTableProps {
- machinery: MachineryRecord[];
- loading?: boolean;
- onEdit?: (machinery: MachineryRecord) => void;
- onDelete?: (id: string) => void;
-}
-
-export function MachineryTable({ machinery, loading, onEdit, onDelete }: MachineryTableProps) {
- console.log('MachineryTable component rendered', { machineryCount: machinery.length });
-
- return (
-
-
农机表格
- {/* 表格内容将在后续实现 */}
-
- );
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryTable/types.ts b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryTable/types.ts
deleted file mode 100644
index f9bead9..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/MachineryTable/types.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { MachineryRecord } from '../../index.types';
-
-export interface MachineryTableProps {
- machinery: MachineryRecord[];
- loading?: boolean;
- onEdit?: (machinery: MachineryRecord) => void;
- onDelete?: (id: string) => void;
- selectable?: boolean;
- onSelectionChange?: (selectedIds: string[]) => void;
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/Pagination/index.css b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/Pagination/index.css
deleted file mode 100644
index 8abdf2f..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/Pagination/index.css
+++ /dev/null
@@ -1 +0,0 @@
-/* Pagination 样式文件 */
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/Pagination/index.tsx b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/Pagination/index.tsx
deleted file mode 100644
index 23133b7..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/Pagination/index.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import React from "react";
-import "./index.css";
-
-interface PaginationProps {
- current: number;
- total: number;
- pageSize: number;
- onChange?: (page: number) => void;
-}
-
-export function Pagination({ current, total, pageSize, onChange }: PaginationProps) {
- console.log("Pagination component rendered");
- return
分页组件 ;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/Pagination/types.ts b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/Pagination/types.ts
deleted file mode 100644
index affa7da..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/Pagination/types.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-export interface PaginationProps {
- current: number;
- total: number;
- pageSize: number;
- onChange?: (page: number) => void;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/SearchBar/index.css b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/SearchBar/index.css
deleted file mode 100644
index be12df3..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/SearchBar/index.css
+++ /dev/null
@@ -1 +0,0 @@
-/* SearchBar 样式文件 */
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/SearchBar/index.tsx b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/SearchBar/index.tsx
deleted file mode 100644
index 301f01c..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/SearchBar/index.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import React from "react";
-import "./index.css";
-
-interface SearchBarProps {
- placeholder?: string;
- onSearch?: (value: string) => void;
-}
-
-export function SearchBar({ placeholder, onSearch }: SearchBarProps) {
- console.log("SearchBar component rendered");
- return
搜索栏 ;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/SearchBar/types.ts b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/SearchBar/types.ts
deleted file mode 100644
index c2fcef9..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/SearchBar/types.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export interface SearchBarProps {
- placeholder?: string;
- onSearch?: (value: string) => void;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/StatusBadge/index.css b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/StatusBadge/index.css
deleted file mode 100644
index 67b92eb..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/StatusBadge/index.css
+++ /dev/null
@@ -1 +0,0 @@
-/* StatusBadge 样式文件 */
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/StatusBadge/index.tsx b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/StatusBadge/index.tsx
deleted file mode 100644
index a0a42ff..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/StatusBadge/index.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import React from "react";
-import "./index.css";
-
-interface StatusBadgeProps {
- status: string;
- color?: string;
-}
-
-export function StatusBadge({ status, color }: StatusBadgeProps) {
- console.log("StatusBadge component rendered");
- return
状态标签 ;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/StatusBadge/types.ts b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/StatusBadge/types.ts
deleted file mode 100644
index c70c402..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/StatusBadge/types.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export interface StatusBadgeProps {
- status: string;
- color?: string;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/TableActions/index.css b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/TableActions/index.css
deleted file mode 100644
index 70ffaf1..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/TableActions/index.css
+++ /dev/null
@@ -1 +0,0 @@
-/* TableActions 样式文件 */
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/TableActions/index.tsx b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/TableActions/index.tsx
deleted file mode 100644
index 3dbb8e7..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/TableActions/index.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import React from 'react';
-import './index.css';
-
-interface TableActionsProps {
- onCreate?: () => void;
- onEdit?: () => void;
- onDelete?: () => void;
- onExport?: () => void;
- onImport?: () => void;
-}
-
-export function TableActions({ onCreate, onEdit, onDelete, onExport, onImport }: TableActionsProps) {
- console.log('TableActions component rendered');
-
- return (
-
-
表格操作
- {/* 操作按钮将在后续实现 */}
-
- );
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/TableActions/types.ts b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/TableActions/types.ts
deleted file mode 100644
index 3928398..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/TableActions/types.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-export interface TableActionsProps {
- onCreate?: () => void;
- onEdit?: () => void;
- onDelete?: () => void;
- onExport?: () => void;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/common/ConfirmDialog.tsx b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/common/ConfirmDialog.tsx
deleted file mode 100644
index 6e72f62..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/common/ConfirmDialog.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import React from "react";
-
-interface ConfirmDialogProps {
- open: boolean;
- title?: string;
- content?: string;
- onConfirm?: () => void;
- onCancel?: () => void;
-}
-
-export function ConfirmDialog({ open, title, content, onConfirm, onCancel }: ConfirmDialogProps) {
- console.log("ConfirmDialog component rendered");
- if (\!open) return null;
- return
确认对话框 ;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/common/EmptyState.tsx b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/common/EmptyState.tsx
deleted file mode 100644
index 0924e13..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/common/EmptyState.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import React from "react";
-
-interface EmptyStateProps {
- title?: string;
- description?: string;
- action?: React.ReactNode;
-}
-
-export function EmptyState({ title = "暂无数据", description, action }: EmptyStateProps) {
- console.log("EmptyState component rendered");
- return
{title} ;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/common/ErrorBoundary.tsx b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/common/ErrorBoundary.tsx
deleted file mode 100644
index 3fdc63f..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/common/ErrorBoundary.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import React from "react";
-
-interface ErrorBoundaryProps {
- children: React.ReactNode;
- fallback?: React.ReactNode;
-}
-
-interface ErrorBoundaryState {
- hasError: boolean;
- error?: Error;
-}
-
-export class ErrorBoundary extends React.Component {
- constructor(props: ErrorBoundaryProps) {
- super(props);
- this.state = { hasError: false };
- }
-
- static getDerivedStateFromError(error: Error): ErrorBoundaryState {
- return { hasError: true, error };
- }
-
- render() {
- if (this.state.hasError) {
- return 出错了
;
- }
- return this.props.children;
- }
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/common/LoadingSpinner.tsx b/crop-x/src/pages/machinery/Archive/MachineryEntry/components/common/LoadingSpinner.tsx
deleted file mode 100644
index 14b2a09..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/components/common/LoadingSpinner.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import React from "react";
-
-interface LoadingSpinnerProps {
- size?: "small" | "medium" | "large";
- color?: string;
-}
-
-export function LoadingSpinner({ size = "medium", color }: LoadingSpinnerProps) {
- console.log("LoadingSpinner component rendered");
- return 加载中...
;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/constants.tsx b/crop-x/src/pages/machinery/Archive/MachineryEntry/constants.tsx
deleted file mode 100644
index 29c1968..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/constants.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-export const MACHINERY_CATEGORIES = [
- '耕地机械',
- '播种机械',
- '收获机械',
- '植保机械'
-] as const;
-
-export const MACHINERY_STATUS = [
- '运行中',
- '空闲中',
- '待维护',
- '已报废'
-] as const;
-
-export const DEFAULT_PAGE_SIZE = 10;
-export const MAX_PAGE_SIZE = 100;
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/hooks/useMachineryForm.tsx b/crop-x/src/pages/machinery/Archive/MachineryEntry/hooks/useMachineryForm.tsx
deleted file mode 100644
index 4a2b4ee..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/hooks/useMachineryForm.tsx
+++ /dev/null
@@ -1,71 +0,0 @@
-import { useState, useCallback } from 'react';
-import { MachineryRecord } from '../index.types';
-
-export function useMachineryForm() {
- const [formData, setFormData] = useState>({
- name: '',
- model: '',
- category: '耕地机械',
- status: '空闲中',
- manufacturer: '',
- purchaseDate: '',
- price: 0
- });
-
- const [errors, setErrors] = useState>({});
-
- const updateFormData = useCallback((field: keyof MachineryRecord, value: any) => {
- setFormData(prev => ({
- ...prev,
- [field]: value
- }));
-
- // 清除该字段的错误
- if (errors[field]) {
- setErrors(prev => ({
- ...prev,
- [field]: ''
- }));
- }
- }, [errors]);
-
- const validateForm = useCallback(() => {
- const newErrors: Record = {};
-
- if (!formData.name?.trim()) {
- newErrors.name = '农机名称不能为空';
- }
-
- if (!formData.model?.trim()) {
- newErrors.model = '型号不能为空';
- }
-
- if (!formData.manufacturer?.trim()) {
- newErrors.manufacturer = '制造商不能为空';
- }
-
- setErrors(newErrors);
- return Object.keys(newErrors).length === 0;
- }, [formData]);
-
- const resetForm = useCallback(() => {
- setFormData({
- name: '',
- model: '',
- category: '耕地机械',
- status: '空闲中',
- manufacturer: '',
- purchaseDate: '',
- price: 0
- });
- setErrors({});
- }, []);
-
- return {
- formData,
- errors,
- updateFormData,
- validateForm,
- resetForm
- };
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/hooks/usePageActions.tsx b/crop-x/src/pages/machinery/Archive/MachineryEntry/hooks/usePageActions.tsx
deleted file mode 100644
index 2f7e10a..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/hooks/usePageActions.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import { useCallback } from 'react';
-import { MachineryRecord } from '../index.types';
-
-export function usePageActions(refreshData: () => void) {
- const handleCreate = useCallback(() => {
- console.log('Create new machinery');
- // 实现创建逻辑
- }, []);
-
- const handleEdit = useCallback((machinery: MachineryRecord) => {
- console.log('Edit machinery:', machinery.id);
- // 实现编辑逻辑
- }, []);
-
- const handleDelete = useCallback((id: string) => {
- console.log('Delete machinery:', id);
- // 实现删除逻辑
- }, []);
-
- const handleBatchDelete = useCallback((ids: string[]) => {
- console.log('Batch delete machinery:', ids);
- // 实现批量删除逻辑
- }, []);
-
- const handleExport = useCallback(() => {
- console.log('Export machinery data');
- // 实现导出逻辑
- }, []);
-
- return {
- handleCreate,
- handleEdit,
- handleDelete,
- handleBatchDelete,
- handleExport
- };
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/hooks/usePageData.tsx b/crop-x/src/pages/machinery/Archive/MachineryEntry/hooks/usePageData.tsx
deleted file mode 100644
index 90fa269..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/hooks/usePageData.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-import { useState, useEffect, useCallback } from 'react';
-import { MachineryRecord, MachineryFilters, PaginationState } from '../index.types';
-
-export function usePageData() {
- const [machinery, setMachinery] = useState([]);
- const [loading, setLoading] = useState(false);
- const [error, setError] = useState(null);
- const [filters, setFilters] = useState({});
- const [pagination, setPagination] = useState({
- current: 1,
- pageSize: 10,
- total: 0
- });
-
- const fetchData = useCallback(async () => {
- setLoading(true);
- setError(null);
-
- try {
- // 模拟API调用
- await new Promise(resolve => setTimeout(resolve, 1000));
- setMachinery([]);
- setPagination(prev => ({ ...prev, total: 0 }));
- } catch (err) {
- setError('Failed to fetch machinery data');
- } finally {
- setLoading(false);
- }
- }, [filters, pagination.current, pagination.pageSize]);
-
- useEffect(() => {
- fetchData();
- }, [fetchData]);
-
- const handleFilterChange = useCallback((newFilters: MachineryFilters) => {
- setFilters(newFilters);
- setPagination(prev => ({ ...prev, current: 1 }));
- }, []);
-
- const handlePageChange = useCallback((page: number) => {
- setPagination(prev => ({ ...prev, current: page }));
- }, []);
-
- return {
- machinery,
- loading,
- error,
- filters,
- pagination,
- handleFilterChange,
- handlePageChange,
- refreshData: fetchData
- };
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/index.css b/crop-x/src/pages/machinery/Archive/MachineryEntry/index.css
deleted file mode 100644
index 06fbcbb..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/index.css
+++ /dev/null
@@ -1,4 +0,0 @@
-/* MachineryEntry 样式文件 */
-.machinery-entry {
- padding: 20px;
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/index.tsx b/crop-x/src/pages/machinery/Archive/MachineryEntry/index.tsx
deleted file mode 100644
index fb2fb48..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/index.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import React from 'react';
-
-export function MachineryEntry() {
- console.log('MachineryEntry component rendered');
-
- return (
-
-
农机档案录入与维护
-
- );
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/index.types.ts b/crop-x/src/pages/machinery/Archive/MachineryEntry/index.types.ts
deleted file mode 100644
index ea6d80e..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/index.types.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-export interface MachineryRecord {
- id: string;
- name: string;
- model: string;
- category: MachineryCategory;
- status: MachineryStatus;
- manufacturer: string;
- purchaseDate: string;
- price: number;
-}
-
-export type MachineryCategory =
- | '耕地机械'
- | '播种机械'
- | '收获机械'
- | '植保机械';
-
-export type MachineryStatus =
- | '运行中'
- | '空闲中'
- | '待维护'
- | '已报废';
-
-export interface MachineryFilters {
- category?: MachineryCategory;
- status?: MachineryStatus;
- manufacturer?: string;
- dateRange?: [string, string];
-}
-
-export interface PaginationState {
- current: number;
- pageSize: number;
- total: number;
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/utils/formatters.tsx b/crop-x/src/pages/machinery/Archive/MachineryEntry/utils/formatters.tsx
deleted file mode 100644
index ea5bd70..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/utils/formatters.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-import { MachineryRecord, MachineryCategory, MachineryStatus } from '../index.types';
-
-export function formatCurrency(amount: number): string {
- return new Intl.NumberFormat('zh-CN', {
- style: 'currency',
- currency: 'CNY'
- }).format(amount);
-}
-
-export function formatDate(dateString: string): string {
- return new Date(dateString).toLocaleDateString('zh-CN');
-}
-
-export function formatDateTime(dateString: string): string {
- return new Date(dateString).toLocaleString('zh-CN');
-}
-
-export function getCategoryColor(category: MachineryCategory): string {
- const colors = {
- '耕地机械': '#1890ff',
- '播种机械': '#52c41a',
- '收获机械': '#fa8c16',
- '植保机械': '#722ed1'
- };
- return colors[category] || '#666666';
-}
-
-export function getStatusColor(status: MachineryStatus): string {
- const colors = {
- '运行中': '#52c41a',
- '空闲中': '#1890ff',
- '待维护': '#fa8c16',
- '已报废': '#ff4d4f'
- };
- return colors[status] || '#666666';
-}
-
-export function formatMachineryStatus(status: MachineryStatus): string {
- return status;
-}
-
-export function formatMachineryCategory(category: MachineryCategory): string {
- return category;
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/utils/pageHelpers.tsx b/crop-x/src/pages/machinery/Archive/MachineryEntry/utils/pageHelpers.tsx
deleted file mode 100644
index 2a7a0c4..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/utils/pageHelpers.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-import { MachineryRecord, MachineryFilters } from '../index.types';
-
-export function filterMachinery(
- machinery: MachineryRecord[],
- filters: MachineryFilters
-): MachineryRecord[] {
- return machinery.filter(item => {
- if (filters.category && item.category !== filters.category) {
- return false;
- }
-
- if (filters.status && item.status !== filters.status) {
- return false;
- }
-
- if (filters.manufacturer && !item.manufacturer.includes(filters.manufacturer)) {
- return false;
- }
-
- if (filters.dateRange) {
- const [startDate, endDate] = filters.dateRange;
- const purchaseDate = new Date(item.purchaseDate);
- if (purchaseDate < new Date(startDate) || purchaseDate > new Date(endDate)) {
- return false;
- }
- }
-
- return true;
- });
-}
-
-export function sortMachinery(
- machinery: MachineryRecord[],
- sortBy: keyof MachineryRecord,
- order: 'asc' | 'desc' = 'asc'
-): MachineryRecord[] {
- return [...machinery].sort((a, b) => {
- const aValue = a[sortBy];
- const bValue = b[sortBy];
-
- if (aValue < bValue) return order === 'asc' ? -1 : 1;
- if (aValue > bValue) return order === 'asc' ? 1 : -1;
- return 0;
- });
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryEntry/utils/validators.tsx b/crop-x/src/pages/machinery/Archive/MachineryEntry/utils/validators.tsx
deleted file mode 100644
index a91e28a..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryEntry/utils/validators.tsx
+++ /dev/null
@@ -1,74 +0,0 @@
-import { MachineryRecord, MachineryCategory, MachineryStatus } from '../index.types';
-
-export function validateMachineryName(name: string): string | null {
- if (!name || name.trim() === '') {
- return '农机名称不能为空';
- }
- if (name.length > 100) {
- return '农机名称不能超过100个字符';
- }
- return null;
-}
-
-export function validateMachineryModel(model: string): string | null {
- if (!model || model.trim() === '') {
- return '型号不能为空';
- }
- if (model.length > 50) {
- return '型号不能超过50个字符';
- }
- return null;
-}
-
-export function validateManufacturer(manufacturer: string): string | null {
- if (!manufacturer || manufacturer.trim() === '') {
- return '制造商不能为空';
- }
- if (manufacturer.length > 100) {
- return '制造商名称不能超过100个字符';
- }
- return null;
-}
-
-export function validatePurchaseDate(date: string): string | null {
- if (!date) {
- return '购买日期不能为空';
- }
- const purchaseDate = new Date(date);
- const today = new Date();
- if (purchaseDate > today) {
- return '购买日期不能是未来日期';
- }
- return null;
-}
-
-export function validatePrice(price: number): string | null {
- if (price < 0) {
- return '价格不能为负数';
- }
- if (price > 10000000) {
- return '价格不能超过1000万元';
- }
- return null;
-}
-
-export function validateMachineryRecord(record: Partial): Record {
- const errors: Record = {};
-
- const nameError = validateMachineryName(record.name || '');
- if (nameError) errors.name = nameError;
-
- const modelError = validateMachineryModel(record.model || '');
- if (modelError) errors.model = modelError;
-
- const manufacturerError = validateManufacturer(record.manufacturer || '');
- if (manufacturerError) errors.manufacturer = manufacturerError;
-
- const dateError = validatePurchaseDate(record.purchaseDate || '');
- if (dateError) errors.purchaseDate = dateError;
-
- const priceError = validatePrice(record.price || 0);
- if (priceError) errors.price = priceError;
-
- return errors;
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/BatchPrint/index.css b/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/BatchPrint/index.css
deleted file mode 100644
index 23d4ba1..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/BatchPrint/index.css
+++ /dev/null
@@ -1 +0,0 @@
-/* BatchPrint 样式文件 */
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/BatchPrint/index.tsx b/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/BatchPrint/index.tsx
deleted file mode 100644
index 1cd7024..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/BatchPrint/index.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from 'react';
-import './index.css';
-
-export function BatchPrint() {
- console.log('BatchPrint component rendered');
- return
BatchPrint ;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/BatchPrint/types.ts b/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/BatchPrint/types.ts
deleted file mode 100644
index 3046212..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/BatchPrint/types.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export interface BatchPrintProps {
- // Props will be defined later
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/MachinerySelector/index.css b/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/MachinerySelector/index.css
deleted file mode 100644
index 73d6b6c..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/MachinerySelector/index.css
+++ /dev/null
@@ -1 +0,0 @@
-/* MachinerySelector 样式文件 */
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/MachinerySelector/index.tsx b/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/MachinerySelector/index.tsx
deleted file mode 100644
index 878327b..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/MachinerySelector/index.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from 'react';
-import './index.css';
-
-export function MachinerySelector() {
- console.log('MachinerySelector component rendered');
- return
MachinerySelector ;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/MachinerySelector/types.ts b/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/MachinerySelector/types.ts
deleted file mode 100644
index d5c4c53..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/MachinerySelector/types.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export interface MachinerySelectorProps {
- // Props will be defined later
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/PrintPreview/index.css b/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/PrintPreview/index.css
deleted file mode 100644
index 351bd09..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/PrintPreview/index.css
+++ /dev/null
@@ -1 +0,0 @@
-/* PrintPreview 样式文件 */
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/PrintPreview/index.tsx b/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/PrintPreview/index.tsx
deleted file mode 100644
index 9968306..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/PrintPreview/index.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from 'react';
-import './index.css';
-
-export function PrintPreview() {
- console.log('PrintPreview component rendered');
- return
PrintPreview ;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/PrintPreview/types.ts b/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/PrintPreview/types.ts
deleted file mode 100644
index 93e1b3e..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/PrintPreview/types.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export interface PrintPreviewProps {
- // Props will be defined later
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/QRCodeDisplay/index.css b/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/QRCodeDisplay/index.css
deleted file mode 100644
index 91469df..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/QRCodeDisplay/index.css
+++ /dev/null
@@ -1 +0,0 @@
-/* QRCodeDisplay 样式文件 */
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/QRCodeDisplay/index.tsx b/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/QRCodeDisplay/index.tsx
deleted file mode 100644
index 5650fab..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/QRCodeDisplay/index.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from 'react';
-import './index.css';
-
-export function QRCodeDisplay() {
- console.log('QRCodeDisplay component rendered');
- return
QRCodeDisplay ;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/QRCodeDisplay/types.ts b/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/QRCodeDisplay/types.ts
deleted file mode 100644
index cfd8071..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/QRCodeDisplay/types.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export interface QRCodeDisplayProps {
- // Props will be defined later
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/QRCodeGenerator/index.css b/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/QRCodeGenerator/index.css
deleted file mode 100644
index d1ea1a5..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/QRCodeGenerator/index.css
+++ /dev/null
@@ -1 +0,0 @@
-/* QRCodeGenerator 样式文件 */
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/QRCodeGenerator/index.tsx b/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/QRCodeGenerator/index.tsx
deleted file mode 100644
index 1d9c3cd..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/QRCodeGenerator/index.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from 'react';
-import './index.css';
-
-export function QRCodeGenerator() {
- console.log('QRCodeGenerator component rendered');
- return
QRCodeGenerator ;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/QRCodeGenerator/types.ts b/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/QRCodeGenerator/types.ts
deleted file mode 100644
index b706359..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/components/QRCodeGenerator/types.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export interface QRCodeGeneratorProps {
- // Props will be defined later
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/constants.tsx b/crop-x/src/pages/machinery/Archive/MachineryQRCode/constants.tsx
deleted file mode 100644
index 2cf89da..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/constants.tsx
+++ /dev/null
@@ -1,3 +0,0 @@
-export const QR_CODE_SIZES = [100, 150, 200, 250];
-export const PRINT_FORMATS = ["PDF", "PNG", "JPEG"];
-export const DEFAULT_QR_SIZE = 150;
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/hooks/usePageActions.tsx b/crop-x/src/pages/machinery/Archive/MachineryQRCode/hooks/usePageActions.tsx
deleted file mode 100644
index bbd4fe2..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/hooks/usePageActions.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useCallback } from "react";
-import { QRCodeConfig } from "../index.types";
-
-export function usePageActions(refreshData: () => void) {
- const handleGenerateQR = useCallback((machineryIds: string[]) => {
- console.log("Generate QR codes for:", machineryIds);
- }, []);
-
- const handlePrintQR = useCallback((qrCodes: QRCodeConfig[]) => {
- console.log("Print QR codes:", qrCodes);
- }, []);
-
- return { handleGenerateQR, handlePrintQR };
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/hooks/usePageData.tsx b/crop-x/src/pages/machinery/Archive/MachineryQRCode/hooks/usePageData.tsx
deleted file mode 100644
index 9130ed3..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/hooks/usePageData.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import { useState, useEffect, useCallback } from "react";
-import { QRCodeConfig } from "../index.types";
-
-export function usePageData() {
- const [qrCodes, setQrCodes] = useState([]);
- const [loading, setLoading] = useState(false);
- const [error, setError] = useState(null);
-
- const fetchData = useCallback(async () => {
- setLoading(true);
- try {
- // 模拟API调用
- setQrCodes([]);
- } catch (err) {
- setError("Failed to fetch QR codes");
- } finally {
- setLoading(false);
- }
- }, []);
-
- useEffect(() => { fetchData(); }, [fetchData]);
-
- return { qrCodes, loading, error, refreshData: fetchData };
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/hooks/useQRCode.tsx b/crop-x/src/pages/machinery/Archive/MachineryQRCode/hooks/useQRCode.tsx
deleted file mode 100644
index 0b90488..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/hooks/useQRCode.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { useState, useCallback } from "react";
-import { QRCodeConfig } from "../index.types";
-
-export function useQRCode() {
- const [selectedMachinery, setSelectedMachinery] = useState([]);
- const [qrConfig, setQrConfig] = useState>({
- size: 150,
- format: "PNG"
- });
-
- const handleMachinerySelect = useCallback((ids: string[]) => {
- setSelectedMachinery(ids);
- }, []);
-
- const handleConfigChange = useCallback((config: Partial) => {
- setQrConfig(prev => ({ ...prev, ...config }));
- }, []);
-
- return { selectedMachinery, qrConfig, handleMachinerySelect, handleConfigChange };
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/index.css b/crop-x/src/pages/machinery/Archive/MachineryQRCode/index.css
deleted file mode 100644
index e84dc30..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/index.css
+++ /dev/null
@@ -1 +0,0 @@
-/* MachineryQRCode 样式文件 */
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/index.tsx b/crop-x/src/pages/machinery/Archive/MachineryQRCode/index.tsx
deleted file mode 100644
index 6ba79e8..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/index.tsx
+++ /dev/null
@@ -1,6 +0,0 @@
-import React from "react";
-
-export function MachineryQRCode() {
- console.log("MachineryQRCode component rendered");
- return
农机二维码管理 ;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/index.types.ts b/crop-x/src/pages/machinery/Archive/MachineryQRCode/index.types.ts
deleted file mode 100644
index c61cf6a..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/index.types.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-export interface QRCodeConfig {
- id: string;
- machineryId: string;
- content: string;
- size: number;
- format: string;
-}
-
-export interface PrintConfig {
- paperSize: string;
- rows: number;
- columns: number;
- margin: number;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/utils/formatters.tsx b/crop-x/src/pages/machinery/Archive/MachineryQRCode/utils/formatters.tsx
deleted file mode 100644
index c2c3feb..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/utils/formatters.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-export function formatFileSize(bytes: number): string {
- if (bytes === 0) return "0 Bytes";
- const k = 1024;
- const sizes = ["Bytes", "KB", "MB", "GB"];
- const i = Math.floor(Math.log(bytes) / Math.log(k));
- return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
-}
-
-export function formatDateForFilename(date: Date): string {
- return date.toISOString().slice(0, 10).replace(/-/g, "");
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/utils/pageHelpers.tsx b/crop-x/src/pages/machinery/Archive/MachineryQRCode/utils/pageHelpers.tsx
deleted file mode 100644
index 019334b..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/utils/pageHelpers.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import { QRCodeConfig } from "../index.types";
-
-export function generateQRContent(machineryId: string, baseUrl: string = ""): string {
- return `${baseUrl}/machinery/${machineryId}`;
-}
-
-export function validateQRConfig(config: Partial): string | null {
- if (\!config.machineryId) {
- return "请选择农机";
- }
- if (config.size && (config.size < 50 || config.size > 500)) {
- return "二维码尺寸应在50-500之间";
- }
- return null;
-}
diff --git a/crop-x/src/pages/machinery/Archive/MachineryQRCode/utils/qrGenerators.tsx b/crop-x/src/pages/machinery/Archive/MachineryQRCode/utils/qrGenerators.tsx
deleted file mode 100644
index b385ed2..0000000
--- a/crop-x/src/pages/machinery/Archive/MachineryQRCode/utils/qrGenerators.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import { QRCodeConfig } from "../index.types";
-
-export async function generateQRCode(config: QRCodeConfig): Promise {
- // 模拟二维码生成
- console.log("Generating QR code:", config);
- await new Promise(resolve => setTimeout(resolve, 100));
- return "data:image/png;base64,mock-qr-code-data";
-}
-
-export async function generateBatchQRCodes(configs: QRCodeConfig[]): Promise {
- const results = await Promise.all(
- configs.map(config => generateQRCode(config))
- );
- return results;
-}
diff --git a/crop-x/src/pages/machinery/Data/HistoryComparison/index.css b/crop-x/src/pages/machinery/Data/HistoryComparison/index.css
deleted file mode 100644
index 14b651f..0000000
--- a/crop-x/src/pages/machinery/Data/HistoryComparison/index.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.history-comparison { padding: 24px; background: #f5f5f5; min-height: 100vh; }
-.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding: 16px; background: white; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
-.page-header h1 { font-size: 24px; font-weight: 600; color: #333; margin: 0; }
-.loading, .error { display: flex; align-items: center; justify-content: center; height: 200px; color: #666; }
diff --git a/crop-x/src/pages/machinery/Data/HistoryComparison/index.tsx b/crop-x/src/pages/machinery/Data/HistoryComparison/index.tsx
deleted file mode 100644
index 42485aa..0000000
--- a/crop-x/src/pages/machinery/Data/HistoryComparison/index.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import React from 'react';
-import { HistoryQuery } from './components/HistoryQuery';
-import { DataComparison } from './components/DataComparison';
-import { TimeSeriesChart } from './components/TimeSeriesChart';
-import { ComparisonTable } from './components/ComparisonTable';
-import { TrendComparison } from './components/TrendComparison';
-import { useHistoryComparisonData } from './hooks/usePageData';
-import { useHistoryComparisonActions } from './hooks/usePageActions';
-import './index.css';
-
-export function HistoryComparison() {
- console.log('HistoryComparison component rendered');
-
- const { historyData, comparisons, loading, error, refreshData } = useHistoryComparisonData();
- const { queryHistory, compareData, exportComparison } = useHistoryComparisonActions(refreshData);
-
- if (loading) return ;
- if (error) return ;
-
- return (
-
-
-
历史数据查询与对比
- 导出对比
-
-
-
-
-
-
-
- );
-}
diff --git a/crop-x/src/pages/machinery/Data/OperationAnalysis/index.css b/crop-x/src/pages/machinery/Data/OperationAnalysis/index.css
deleted file mode 100644
index 2137257..0000000
--- a/crop-x/src/pages/machinery/Data/OperationAnalysis/index.css
+++ /dev/null
@@ -1,7 +0,0 @@
-.operation-analysis { padding: 24px; background: #f5f5f5; min-height: 100vh; }
-.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding: 16px; background: white; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
-.page-header h1 { font-size: 24px; font-weight: 600; color: #333; margin: 0; }
-.page-actions { display: flex; gap: 12px; }
-.page-actions button { padding: 8px 16px; border-radius: 4px; border: 1px solid #d9d9d9; background: white; cursor: pointer; transition: all 0.2s; font-size: 14px; }
-.page-actions button:hover { background: #f0f0f0; border-color: #40a9ff; }
-.loading, .error { display: flex; align-items: center; justify-content: center; height: 200px; color: #666; }
diff --git a/crop-x/src/pages/machinery/Data/OperationAnalysis/index.tsx b/crop-x/src/pages/machinery/Data/OperationAnalysis/index.tsx
deleted file mode 100644
index 83e46b1..0000000
--- a/crop-x/src/pages/machinery/Data/OperationAnalysis/index.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import React from 'react';
-import { AnalysisDashboard } from './components/AnalysisDashboard';
-import { EfficiencyAnalysis } from './components/EfficiencyAnalysis';
-import { CostAnalysis } from './components/CostAnalysis';
-import { PerformanceAnalysis } from './components/PerformanceAnalysis';
-import { TrendAnalysis } from './components/TrendAnalysis';
-import { useOperationAnalysisData } from './hooks/usePageData';
-import { useOperationAnalysisActions } from './hooks/usePageActions';
-import './index.css';
-
-export function OperationAnalysis() {
- console.log('OperationAnalysis component rendered');
-
- const { analysisData, trends, loading, error, refreshData } = useOperationAnalysisData();
- const { generateReport, exportAnalysis } = useOperationAnalysisActions(refreshData);
-
- if (loading) return ;
- if (error) return ;
-
- return (
-
-
-
作业数据分析
-
- 生成报告
- 导出分析
-
-
-
-
-
-
-
-
- );
-}
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/components/CertificateManager/index.css b/crop-x/src/pages/machinery/Driver/DriverInfo/components/CertificateManager/index.css
deleted file mode 100644
index ea9a0d7..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/components/CertificateManager/index.css
+++ /dev/null
@@ -1 +0,0 @@
-/* CertificateManager 样式文件 */
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/components/CertificateManager/index.tsx b/crop-x/src/pages/machinery/Driver/DriverInfo/components/CertificateManager/index.tsx
deleted file mode 100644
index 853d270..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/components/CertificateManager/index.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from 'react';
-import './index.css';
-
-export function CertificateManager() {
- console.log('CertificateManager component rendered');
- return
CertificateManager ;
-}
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/components/CertificateManager/types.ts b/crop-x/src/pages/machinery/Driver/DriverInfo/components/CertificateManager/types.ts
deleted file mode 100644
index 6bca478..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/components/CertificateManager/types.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export interface CertificateManagerProps {
- // Props will be defined later
-}
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/components/CertificateReminders/index.css b/crop-x/src/pages/machinery/Driver/DriverInfo/components/CertificateReminders/index.css
deleted file mode 100644
index b2e88e6..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/components/CertificateReminders/index.css
+++ /dev/null
@@ -1 +0,0 @@
-/* CertificateReminders 样式文件 */
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/components/CertificateReminders/index.tsx b/crop-x/src/pages/machinery/Driver/DriverInfo/components/CertificateReminders/index.tsx
deleted file mode 100644
index 680f1fb..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/components/CertificateReminders/index.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from 'react';
-import './index.css';
-
-export function CertificateReminders() {
- console.log('CertificateReminders component rendered');
- return
CertificateReminders ;
-}
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/components/CertificateReminders/types.ts b/crop-x/src/pages/machinery/Driver/DriverInfo/components/CertificateReminders/types.ts
deleted file mode 100644
index 71647fb..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/components/CertificateReminders/types.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export interface CertificateRemindersProps {
- // Props will be defined later
-}
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverDetails/index.css b/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverDetails/index.css
deleted file mode 100644
index ed1cc2c..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverDetails/index.css
+++ /dev/null
@@ -1 +0,0 @@
-/* DriverDetails 样式文件 */
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverDetails/index.tsx b/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverDetails/index.tsx
deleted file mode 100644
index 31708bc..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverDetails/index.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from 'react';
-import './index.css';
-
-export function DriverDetails() {
- console.log('DriverDetails component rendered');
- return
DriverDetails ;
-}
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverDetails/types.ts b/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverDetails/types.ts
deleted file mode 100644
index b7611aa..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverDetails/types.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export interface DriverDetailsProps {
- // Props will be defined later
-}
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverForm/index.css b/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverForm/index.css
deleted file mode 100644
index 0a3e969..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverForm/index.css
+++ /dev/null
@@ -1 +0,0 @@
-/* DriverForm 样式文件 */
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverForm/index.tsx b/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverForm/index.tsx
deleted file mode 100644
index d78011b..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverForm/index.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from 'react';
-import './index.css';
-
-export function DriverForm() {
- console.log('DriverForm component rendered');
- return
DriverForm ;
-}
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverForm/types.ts b/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverForm/types.ts
deleted file mode 100644
index fadd757..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverForm/types.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export interface DriverFormProps {
- // Props will be defined later
-}
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverList/index.css b/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverList/index.css
deleted file mode 100644
index 44e898a..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverList/index.css
+++ /dev/null
@@ -1 +0,0 @@
-/* DriverList 样式文件 */
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverList/index.tsx b/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverList/index.tsx
deleted file mode 100644
index 75ae3d2..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverList/index.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from 'react';
-import './index.css';
-
-export function DriverList() {
- console.log('DriverList component rendered');
- return
DriverList ;
-}
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverList/types.ts b/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverList/types.ts
deleted file mode 100644
index f8979c3..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverList/types.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export interface DriverListProps {
- // Props will be defined later
-}
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverStats/index.css b/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverStats/index.css
deleted file mode 100644
index 36d8b3d..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverStats/index.css
+++ /dev/null
@@ -1 +0,0 @@
-/* DriverStats 样式文件 */
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverStats/index.tsx b/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverStats/index.tsx
deleted file mode 100644
index 238f0de..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverStats/index.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from 'react';
-import './index.css';
-
-export function DriverStats() {
- console.log('DriverStats component rendered');
- return
DriverStats ;
-}
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverStats/types.ts b/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverStats/types.ts
deleted file mode 100644
index 49623c6..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverStats/types.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export interface DriverStatsProps {
- // Props will be defined later
-}
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverTable/index.css b/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverTable/index.css
deleted file mode 100644
index 813bbdd..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverTable/index.css
+++ /dev/null
@@ -1 +0,0 @@
-/* DriverTable 样式文件 */
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverTable/index.tsx b/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverTable/index.tsx
deleted file mode 100644
index dec1206..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverTable/index.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from 'react';
-import './index.css';
-
-export function DriverTable() {
- console.log('DriverTable component rendered');
- return
DriverTable ;
-}
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverTable/types.ts b/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverTable/types.ts
deleted file mode 100644
index b98b273..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/components/DriverTable/types.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export interface DriverTableProps {
- // Props will be defined later
-}
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/constants.tsx b/crop-x/src/pages/machinery/Driver/DriverInfo/constants.tsx
deleted file mode 100644
index 5d4141a..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/constants.tsx
+++ /dev/null
@@ -1,6 +0,0 @@
-export const DRIVER_LICENSE_TYPES = [
- "A1", "A2", "B1", "B2", "C1", "C2"
-];
-export const CERTIFICATE_TYPES = [
- "驾驶证", "身份证", "健康证", "操作证"
-];
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/hooks/useDriverForm.tsx b/crop-x/src/pages/machinery/Driver/DriverInfo/hooks/useDriverForm.tsx
deleted file mode 100644
index 4819f32..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/hooks/useDriverForm.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import { useState, useEffect, useCallback } from 'react';
-import { Driver, Certificate } from '../index.types';
-
-export function useDriverForm() {
- console.log('useDriverForm called');
- // Implementation will be added later
- return {};
-}
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/hooks/usePageActions.tsx b/crop-x/src/pages/machinery/Driver/DriverInfo/hooks/usePageActions.tsx
deleted file mode 100644
index ca47629..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/hooks/usePageActions.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import { useState, useEffect, useCallback } from 'react';
-import { Driver, Certificate } from '../index.types';
-
-export function usePageActions() {
- console.log('usePageActions called');
- // Implementation will be added later
- return {};
-}
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/hooks/usePageData.tsx b/crop-x/src/pages/machinery/Driver/DriverInfo/hooks/usePageData.tsx
deleted file mode 100644
index a5b26c3..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/hooks/usePageData.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import { useState, useEffect, useCallback } from 'react';
-import { Driver, Certificate } from '../index.types';
-
-export function usePageData() {
- console.log('usePageData called');
- // Implementation will be added later
- return {};
-}
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/index.css b/crop-x/src/pages/machinery/Driver/DriverInfo/index.css
deleted file mode 100644
index deceff5..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/index.css
+++ /dev/null
@@ -1 +0,0 @@
-/* DriverInfo 样式文件 */
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/index.tsx b/crop-x/src/pages/machinery/Driver/DriverInfo/index.tsx
deleted file mode 100644
index c024ec3..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/index.tsx
+++ /dev/null
@@ -1,6 +0,0 @@
-import React from "react";
-
-export function DriverInfo() {
- console.log("DriverInfo component rendered");
- return
驾驶员信息管理 ;
-}
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/index.types.ts b/crop-x/src/pages/machinery/Driver/DriverInfo/index.types.ts
deleted file mode 100644
index d5217d2..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/index.types.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-export interface Driver {
- id: string;
- name: string;
- phone: string;
- email: string;
- licenseNumber: string;
- licenseType: string;
- licenseExpiry: string;
- status: DriverStatus;
-}
-
-export type DriverStatus = "active" | "inactive" | "suspended";
-
-export interface Certificate {
- id: string;
- driverId: string;
- type: string;
- number: string;
- issueDate: string;
- expiryDate: string;
- issuingAuthority: string;
-}
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/utils/formatters.tsx b/crop-x/src/pages/machinery/Driver/DriverInfo/utils/formatters.tsx
deleted file mode 100644
index 0a10761..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/utils/formatters.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-// formatters utility functions
-export function helperFunction() {
- // Implementation will be added later
- return null;
-}
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/utils/pageHelpers.tsx b/crop-x/src/pages/machinery/Driver/DriverInfo/utils/pageHelpers.tsx
deleted file mode 100644
index 53a5bef..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/utils/pageHelpers.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-// pageHelpers utility functions
-export function helperFunction() {
- // Implementation will be added later
- return null;
-}
diff --git a/crop-x/src/pages/machinery/Driver/DriverInfo/utils/validators.tsx b/crop-x/src/pages/machinery/Driver/DriverInfo/utils/validators.tsx
deleted file mode 100644
index e2640de..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverInfo/utils/validators.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-// validators utility functions
-export function helperFunction() {
- // Implementation will be added later
- return null;
-}
diff --git a/crop-x/src/pages/machinery/Driver/DriverTask/components/TaskList/index.css b/crop-x/src/pages/machinery/Driver/DriverTask/components/TaskList/index.css
deleted file mode 100644
index 30ba425..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverTask/components/TaskList/index.css
+++ /dev/null
@@ -1,157 +0,0 @@
-.task-list {
- background: white;
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
-}
-
-.task-list-error {
- padding: 48px;
- text-align: center;
- background: white;
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
-}
-
-.error-content h3 {
- color: #f5222d;
- margin-bottom: 16px;
-}
-
-.error-content p {
- color: #666;
- margin-bottom: 24px;
-}
-
-.error-content button {
- padding: 8px 16px;
- background: #f5222d;
- color: white;
- border: none;
- border-radius: 4px;
- cursor: pointer;
- transition: background 0.2s;
-}
-
-.error-content button:hover {
- background: #ff4d4f;
-}
-
-.task-list-header {
- padding: 16px;
- border-bottom: 1px solid #f0f0f0;
- display: flex;
- justify-content: space-between;
- align-items: center;
- gap: 16px;
-}
-
-.filters-section {
- display: flex;
- gap: 16px;
- align-items: center;
- flex-wrap: wrap;
-}
-
-.filter-item {
- display: flex;
- align-items: center;
- gap: 8px;
-}
-
-.filter-item label {
- font-size: 14px;
- color: #666;
- white-space: nowrap;
-}
-
-.filter-item select {
- padding: 6px 8px;
- border: 1px solid #d9d9d9;
- border-radius: 4px;
- background: white;
- min-width: 120px;
-}
-
-.search-section input {
- padding: 6px 12px;
- border: 1px solid #d9d9d9;
- border-radius: 4px;
- width: 250px;
-}
-
-.pagination-section {
- padding: 16px;
- border-top: 1px solid #f0f0f0;
- display: flex;
- justify-content: space-between;
- align-items: center;
-}
-
-.pagination-info {
- color: #666;
- font-size: 14px;
-}
-
-.pagination-controls {
- display: flex;
- align-items: center;
- gap: 12px;
-}
-
-.pagination-controls button {
- padding: 6px 12px;
- border: 1px solid #d9d9d9;
- border-radius: 4px;
- background: white;
- cursor: pointer;
- transition: all 0.2s;
-}
-
-.pagination-controls button:hover:not(:disabled) {
- background: #f0f0f0;
- border-color: #40a9ff;
-}
-
-.pagination-controls button:disabled {
- background: #f5f5f5;
- color: #bfbfbf;
- cursor: not-allowed;
-}
-
-.pagination-controls span {
- font-weight: 500;
- color: #1890ff;
-}
-
-/* 响应式设计 */
-@media (max-width: 768px) {
- .task-list-header {
- flex-direction: column;
- align-items: stretch;
- }
-
- .filters-section {
- flex-direction: column;
- align-items: stretch;
- gap: 12px;
- }
-
- .filter-item {
- flex-direction: column;
- align-items: stretch;
- }
-
- .filter-item select {
- min-width: auto;
- }
-
- .search-section input {
- width: 100%;
- }
-
- .pagination-section {
- flex-direction: column;
- gap: 12px;
- text-align: center;
- }
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Driver/DriverTask/components/TaskList/index.tsx b/crop-x/src/pages/machinery/Driver/DriverTask/components/TaskList/index.tsx
deleted file mode 100644
index 09472c9..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverTask/components/TaskList/index.tsx
+++ /dev/null
@@ -1,161 +0,0 @@
-import { memo } from 'react';
-import { DriverTask, TaskFilters, PaginationState } from '../../index.types';
-import { TaskTable } from '../TaskTable';
-import { TaskStatus } from '../TaskStatus';
-import './index.css';
-
-interface TaskListProps {
- tasks: DriverTask[];
- drivers: any[];
- loading: boolean;
- error: string | null;
- pagination: PaginationState;
- filters: TaskFilters;
- onFilterChange: (filters: TaskFilters) => void;
- onPageChange: (page: number) => void;
- onEdit: (data: any) => void;
- onDelete: (id: string) => void;
- onAssign: (taskId: string, driverId: string, machineryId: string) => void;
- onUpdateStatus: (taskId: string, status: DriverTask['status']) => void;
- onBatchDelete: (ids: string[]) => void;
- onSelectTask: (id: string | null) => void;
-}
-
-export const TaskList = memo(({
- tasks,
- drivers,
- loading,
- error,
- pagination,
- filters,
- onFilterChange,
- onPageChange,
- onEdit,
- onDelete,
- onAssign,
- onUpdateStatus,
- onBatchDelete,
- onSelectTask
-}) => {
- if (error) {
- return (
-
-
-
加载失败
-
{error}
-
window.location.reload()}>
- 重新加载
-
-
-
- );
- }
-
- return (
-
-
-
- {/* 这里可以添加筛选组件 */}
-
- 任务状态:
- onFilterChange({
- ...filters,
- status: e.target.value as DriverTask['status'] || undefined
- })}
- >
- 全部状态
- 待分配
- 已分配
- 进行中
- 已暂停
- 已完成
- 已取消
-
-
-
-
- 优先级:
- onFilterChange({
- ...filters,
- priority: e.target.value as DriverTask['priority'] || undefined
- })}
- >
- 全部优先级
- 紧急
- 高
- 中
- 低
-
-
-
-
- 驾驶员:
- onFilterChange({
- ...filters,
- driverId: e.target.value || undefined
- })}
- >
- 全部驾驶员
- {drivers.map(driver => (
-
- {driver.name}
-
- ))}
-
-
-
-
-
- onFilterChange({
- ...filters,
- searchKeyword: e.target.value || undefined
- })}
- />
-
-
-
-
-
-
-
- 共 {pagination.total} 条记录,第 {pagination.current} 页
-
-
- onPageChange(pagination.current - 1)}
- >
- 上一页
-
- {pagination.current}
- = pagination.total}
- onClick={() => onPageChange(pagination.current + 1)}
- >
- 下一页
-
-
-
-
- );
-});
-
-TaskList.displayName = 'TaskList';
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Driver/DriverTask/hooks/usePageActions.tsx b/crop-x/src/pages/machinery/Driver/DriverTask/hooks/usePageActions.tsx
deleted file mode 100644
index efd8cb0..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverTask/hooks/usePageActions.tsx
+++ /dev/null
@@ -1,147 +0,0 @@
-import { useCallback } from 'react';
-import { DriverTask, TaskFormData } from '../index.types';
-
-export function useTaskActions(refreshData: () => void) {
- const handleCreate = useCallback(async (data: TaskFormData) => {
- try {
- // 模拟API调用
- await new Promise(resolve => setTimeout(resolve, 300));
-
- console.log('创建任务:', data);
- // 在实际应用中,这里会调用 API
- // await taskApi.create(data);
-
- refreshData();
- return { success: true };
- } catch (error) {
- console.error('创建任务失败:', error);
- return { success: false, error: error instanceof Error ? error.message : '创建失败' };
- }
- }, [refreshData]);
-
- const handleEdit = useCallback(async (data: TaskFormData) => {
- try {
- // 模拟API调用
- await new Promise(resolve => setTimeout(resolve, 300));
-
- console.log('编辑任务:', data);
- // await taskApi.update(data.id, data);
-
- refreshData();
- return { success: true };
- } catch (error) {
- console.error('编辑任务失败:', error);
- return { success: false, error: error instanceof Error ? error.message : '编辑失败' };
- }
- }, [refreshData]);
-
- const handleDelete = useCallback(async (id: string) => {
- try {
- // 模拟API调用
- await new Promise(resolve => setTimeout(resolve, 200));
-
- console.log('删除任务:', id);
- // await taskApi.delete(id);
-
- refreshData();
- return { success: true };
- } catch (error) {
- console.error('删除任务失败:', error);
- return { success: false, error: error instanceof Error ? error.message : '删除失败' };
- }
- }, [refreshData]);
-
- const handleAssign = useCallback(async (taskId: string, driverId: string, machineryId: string) => {
- try {
- // 模拟API调用
- await new Promise(resolve => setTimeout(resolve, 300));
-
- console.log('分配任务:', { taskId, driverId, machineryId });
- // await taskApi.assign(taskId, { driverId, machineryId });
-
- refreshData();
- return { success: true };
- } catch (error) {
- console.error('分配任务失败:', error);
- return { success: false, error: error instanceof Error ? error.message : '分配失败' };
- }
- }, [refreshData]);
-
- const handleUpdateStatus = useCallback(async (taskId: string, status: DriverTask['status']) => {
- try {
- // 模拟API调用
- await new Promise(resolve => setTimeout(resolve, 200));
-
- console.log('更新任务状态:', { taskId, status });
- // await taskApi.updateStatus(taskId, status);
-
- refreshData();
- return { success: true };
- } catch (error) {
- console.error('更新状态失败:', error);
- return { success: false, error: error instanceof Error ? error.message : '状态更新失败' };
- }
- }, [refreshData]);
-
- const handleBatchDelete = useCallback(async (ids: string[]) => {
- try {
- // 模拟API调用
- await new Promise(resolve => setTimeout(resolve, 400));
-
- console.log('批量删除任务:', ids);
- // await Promise.all(ids.map(id => taskApi.delete(id)));
-
- refreshData();
- return { success: true };
- } catch (error) {
- console.error('批量删除失败:', error);
- return { success: false, error: error instanceof Error ? error.message : '批量删除失败' };
- }
- }, [refreshData]);
-
- const handleExport = useCallback(async () => {
- try {
- // 模拟导出功能
- await new Promise(resolve => setTimeout(resolve, 500));
-
- console.log('导出任务数据');
- // const data = await taskApi.export();
- // 实现文件下载逻辑
-
- return { success: true };
- } catch (error) {
- console.error('导出失败:', error);
- return { success: false, error: error instanceof Error ? error.message : '导出失败' };
- }
- }, []);
-
- const handleStartTask = useCallback(async (taskId: string) => {
- return handleUpdateStatus(taskId, '进行中');
- }, [handleUpdateStatus]);
-
- const handlePauseTask = useCallback(async (taskId: string) => {
- return handleUpdateStatus(taskId, '已暂停');
- }, [handleUpdateStatus]);
-
- const handleCompleteTask = useCallback(async (taskId: string) => {
- return handleUpdateStatus(taskId, '已完成');
- }, [handleUpdateStatus]);
-
- const handleCancelTask = useCallback(async (taskId: string) => {
- return handleUpdateStatus(taskId, '已取消');
- }, [handleUpdateStatus]);
-
- return {
- handleCreate,
- handleEdit,
- handleDelete,
- handleAssign,
- handleUpdateStatus,
- handleBatchDelete,
- handleExport,
- handleStartTask,
- handlePauseTask,
- handleCompleteTask,
- handleCancelTask
- };
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Driver/DriverTask/hooks/usePageData.tsx b/crop-x/src/pages/machinery/Driver/DriverTask/hooks/usePageData.tsx
deleted file mode 100644
index cd7d467..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverTask/hooks/usePageData.tsx
+++ /dev/null
@@ -1,147 +0,0 @@
-import { useState, useEffect, useCallback } from 'react';
-import { DriverTask, TaskFilters, PaginationState } from '../index.types';
-
-const mockTasks: DriverTask[] = [
- {
- id: '1',
- title: '1号田块耕地作业',
- description: '对1号田块进行深度耕地作业,为春播做准备',
- taskType: '耕地作业',
- status: '进行中',
- priority: '高',
- assignedDriverId: 'driver1',
- assignedDriverName: '张师傅',
- assignedMachineryId: 'machinery1',
- assignedMachineryName: '约翰迪尔6M-1654拖拉机',
- fieldId: 'field1',
- fieldName: '1号田块',
- scheduledStartTime: '2024-03-20T08:00:00Z',
- scheduledEndTime: '2024-03-20T17:00:00Z',
- actualStartTime: '2024-03-20T08:15:00Z',
- estimatedDuration: 540,
- progress: 65,
- location: '1号田块北侧',
- requirements: ['需要配备犁具', '检查燃油量'],
- notes: '土壤湿度适中,适合作业',
- createdAt: '2024-03-19T10:00:00Z',
- updatedAt: '2024-03-20T12:00:00Z',
- createdBy: 'admin',
- },
- {
- id: '2',
- title: '2号田块播种作业',
- description: '玉米播种作业,行距75cm,株距30cm',
- taskType: '播种作业',
- status: '待分配',
- priority: '中',
- fieldId: 'field2',
- fieldName: '2号田块',
- scheduledStartTime: '2024-03-21T07:00:00Z',
- scheduledEndTime: '2024-03-21T18:00:00Z',
- estimatedDuration: 660,
- progress: 0,
- location: '2号田块',
- requirements: ['播种机调试', '种子准备'],
- notes: '天气预报显示适合播种',
- createdAt: '2024-03-19T14:00:00Z',
- updatedAt: '2024-03-19T14:00:00Z',
- createdBy: 'admin',
- }
-];
-
-const mockDrivers = [
- { id: 'driver1', name: '张师傅', phone: '13800138001', status: '工作中' },
- { id: 'driver2', name: '李师傅', phone: '13800138002', status: '空闲' },
- { id: 'driver3', name: '王师傅', phone: '13800138003', status: '休息' },
-];
-
-export function useTaskData() {
- const [tasks, setTasks] = useState([]);
- const [drivers, setDrivers] = useState(mockDrivers);
- const [loading, setLoading] = useState(false);
- const [error, setError] = useState(null);
- const [filters, setFilters] = useState({});
- const [pagination, setPagination] = useState({
- current: 1,
- pageSize: 10,
- total: 0
- });
-
- const fetchTasks = useCallback(async () => {
- setLoading(true);
- setError(null);
-
- try {
- // 模拟API调用延迟
- await new Promise(resolve => setTimeout(resolve, 500));
-
- let filteredTasks = mockTasks.filter(task => {
- if (filters.taskType && task.taskType !== filters.taskType) {
- return false;
- }
- if (filters.status && task.status !== filters.status) {
- return false;
- }
- if (filters.priority && task.priority !== filters.priority) {
- return false;
- }
- if (filters.driverId && task.assignedDriverId !== filters.driverId) {
- return false;
- }
- if (filters.searchKeyword) {
- const keyword = filters.searchKeyword.toLowerCase();
- const searchableText = [
- task.title,
- task.description,
- task.assignedDriverName,
- task.fieldName
- ].filter(Boolean).join(' ').toLowerCase();
-
- if (!searchableText.includes(keyword)) {
- return false;
- }
- }
- return true;
- });
-
- const total = filteredTasks.length;
- const startIndex = (pagination.current - 1) * pagination.pageSize;
- const endIndex = startIndex + pagination.pageSize;
- const paginatedTasks = filteredTasks.slice(startIndex, endIndex);
-
- setTasks(paginatedTasks);
- setPagination(prev => ({ ...prev, total }));
- } catch (err) {
- const errorMessage = err instanceof Error ? err.message : '获取任务数据失败';
- setError(errorMessage);
- console.error('Error fetching tasks:', err);
- } finally {
- setLoading(false);
- }
- }, [filters, pagination.current, pagination.pageSize]);
-
- useEffect(() => {
- fetchTasks();
- }, [fetchTasks]);
-
- const handleFilterChange = useCallback((newFilters: TaskFilters) => {
- setFilters(newFilters);
- setPagination(prev => ({ ...prev, current: 1 }));
- }, []);
-
- const handlePageChange = useCallback((page: number) => {
- setPagination(prev => ({ ...prev, current: page }));
- }, []);
-
- return {
- tasks,
- drivers,
- loading,
- error,
- filters,
- pagination,
- handleFilterChange,
- handlePageChange,
- refreshData: fetchTasks
- };
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Driver/DriverTask/index.css b/crop-x/src/pages/machinery/Driver/DriverTask/index.css
deleted file mode 100644
index ef4a228..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverTask/index.css
+++ /dev/null
@@ -1,68 +0,0 @@
-.driver-task {
- padding: 24px;
- background: #f5f5f5;
- min-height: 100vh;
-}
-
-.page-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 24px;
- padding: 16px;
- background: white;
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
-}
-
-.page-header h1 {
- font-size: 24px;
- font-weight: 600;
- color: #333;
- margin: 0;
-}
-
-.page-actions {
- display: flex;
- gap: 12px;
-}
-
-.page-actions button {
- padding: 8px 16px;
- border-radius: 4px;
- border: 1px solid #d9d9d9;
- background: white;
- cursor: pointer;
- transition: all 0.2s;
- font-size: 14px;
-}
-
-.page-actions button:hover {
- background: #f0f0f0;
- border-color: #40a9ff;
-}
-
-.page-actions button.primary {
- background: #40a9ff;
- color: white;
- border-color: #40a9ff;
-}
-
-.page-actions button.primary:hover {
- background: #1890ff;
- border-color: #1890ff;
-}
-
-/* 响应式设计 */
-@media (max-width: 768px) {
- .page-header {
- flex-direction: column;
- align-items: flex-start;
- gap: 16px;
- }
-
- .page-actions {
- width: 100%;
- justify-content: flex-end;
- }
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Driver/DriverTask/index.tsx b/crop-x/src/pages/machinery/Driver/DriverTask/index.tsx
deleted file mode 100644
index 6b3e97f..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverTask/index.tsx
+++ /dev/null
@@ -1,89 +0,0 @@
-import { useState, useEffect, useCallback } from 'react';
-import { TaskList } from './components/TaskList';
-import { TaskForm } from './components/TaskForm';
-import { TaskAssignment } from './components/TaskAssignment';
-import { useTaskData } from './hooks/usePageData';
-import { useTaskActions } from './hooks/usePageActions';
-import './index.css';
-
-export function DriverTask() {
- const [selectedTask, setSelectedTask] = useState(null);
- const [isCreateModalOpen, setIsCreateModalOpen] = useState(false);
- const [isAssignmentModalOpen, setIsAssignmentModalOpen] = useState(false);
-
- const {
- tasks,
- drivers,
- loading,
- error,
- filters,
- pagination,
- handleFilterChange,
- handlePageChange,
- refreshData
- } = useTaskData();
-
- const {
- handleCreate,
- handleEdit,
- handleDelete,
- handleAssign,
- handleUpdateStatus,
- handleBatchDelete,
- handleExport
- } = useTaskActions(refreshData);
-
- return (
-
-
-
驾驶员任务管理
-
- setIsAssignmentModalOpen(true)}>
- 分配任务
-
- setIsCreateModalOpen(true)}>
- 新增任务
-
-
- 导出数据
-
-
-
-
-
-
-
{
- setIsCreateModalOpen(false);
- setSelectedTask(null);
- }}
- onSave={selectedTask ? handleEdit : handleCreate}
- editData={selectedTask ? tasks.find(t => t.id === selectedTask) : undefined}
- />
-
- setIsAssignmentModalOpen(false)}
- onAssign={handleAssign}
- drivers={drivers}
- tasks={tasks.filter(t => t.status === '待分配')}
- />
-
- );
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Driver/DriverTask/index.types.ts b/crop-x/src/pages/machinery/Driver/DriverTask/index.types.ts
deleted file mode 100644
index d16ce8e..0000000
--- a/crop-x/src/pages/machinery/Driver/DriverTask/index.types.ts
+++ /dev/null
@@ -1,113 +0,0 @@
-export interface DriverTask {
- id: string;
- title: string;
- description: string;
- taskType: TaskType;
- status: TaskStatus;
- priority: TaskPriority;
- assignedDriverId?: string;
- assignedDriverName?: string;
- assignedMachineryId?: string;
- assignedMachineryName?: string;
- fieldId?: string;
- fieldName?: string;
- scheduledStartTime: string;
- scheduledEndTime: string;
- actualStartTime?: string;
- actualEndTime?: string;
- estimatedDuration: number; // 预估时长(分钟)
- actualDuration?: number; // 实际时长(分钟)
- progress: number; // 完成进度 0-100
- location?: string;
- requirements?: string[];
- notes?: string;
- createdAt: string;
- updatedAt: string;
- createdBy: string;
- completedAt?: string;
-}
-
-export type TaskType =
- | '耕地作业'
- | '播种作业'
- | '施肥作业'
- | '喷药作业'
- | '灌溉作业'
- | '收获作业'
- | '运输作业'
- | '维护作业'
- | '其他作业';
-
-export type TaskStatus =
- | '待分配'
- | '已分配'
- | '进行中'
- | '已暂停'
- | '已完成'
- | '已取消'
- | '已逾期';
-
-export type TaskPriority =
- | '紧急'
- | '高'
- | '中'
- | '低';
-
-export interface TaskFilters {
- taskType?: TaskType;
- status?: TaskStatus;
- priority?: TaskPriority;
- driverId?: string;
- machineryId?: string;
- fieldId?: string;
- dateRange?: [string, string];
- searchKeyword?: string;
-}
-
-export interface TaskFormData {
- title: string;
- description: string;
- taskType: TaskType;
- priority: TaskPriority;
- assignedDriverId?: string;
- assignedMachineryId?: string;
- fieldId?: string;
- scheduledStartTime: string;
- scheduledEndTime: string;
- estimatedDuration: number;
- location?: string;
- requirements?: string[];
- notes?: string;
-}
-
-export interface TaskAssignment {
- taskId: string;
- driverId: string;
- machineryId: string;
- assignedBy: string;
- assignedAt: string;
-}
-
-export interface TaskPerformance {
- driverId: string;
- driverName: string;
- totalTasks: number;
- completedTasks: number;
- inProgressTasks: number;
- completionRate: number;
- averageCompletionTime: number; // 平均完成时间(分钟)
- onTimeCompletionRate: number; // 按时完成率
- totalWorkingHours: number; // 总工作时长
- efficiency: number; // 工作效率评分
-}
-
-export interface PaginationState {
- current: number;
- pageSize: number;
- total: number;
-}
-
-export interface TaskListAction {
- type: 'view' | 'edit' | 'delete' | 'assign' | 'start' | 'pause' | 'complete' | 'cancel';
- task: DriverTask;
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Fault/FaultWarning/constants.tsx b/crop-x/src/pages/machinery/Fault/FaultWarning/constants.tsx
deleted file mode 100644
index 633f144..0000000
--- a/crop-x/src/pages/machinery/Fault/FaultWarning/constants.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import React from 'react';
-
-export const FAULT_TYPES = [
- { value: 'engine', label: '发动机故障', icon: '⚙️' },
- { value: 'hydraulic', label: '液压系统故障', icon: '🔧' },
- { value: 'electrical', label: '电气系统故障', icon: '⚡' },
- { value: 'mechanical', label: '机械故障', icon: '🔩' },
- { value: 'sensor', label: '传感器故障', icon: '📡' },
- { value: 'software', label: '软件故障', icon: '💻' }
-] as const;
-
-export const FAULT_SEVERITIES = [
- { value: 'low', label: '低', color: '#52c41a' },
- { value: 'medium', label: '中', color: '#faad14' },
- { value: 'high', label: '高', color: '#ff7a45' },
- { value: 'critical', label: '严重', color: '#ff4d4f' }
-] as const;
-
-export const FAULT_STATUSES = [
- { value: 'detected', label: '已检测', color: '#1890ff' },
- { value: 'diagnosing', label: '诊断中', color: '#faad14' },
- { value: 'repairing', label: '维修中', color: '#722ed1' },
- { value: 'resolved', label: '已解决', color: '#52c41a' },
- { value: 'ignored', label: '已忽略', color: '#8c8c8c' }
-] as const;
diff --git a/crop-x/src/pages/machinery/Fault/FaultWarning/index.css b/crop-x/src/pages/machinery/Fault/FaultWarning/index.css
deleted file mode 100644
index e0a553f..0000000
--- a/crop-x/src/pages/machinery/Fault/FaultWarning/index.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.fault-warning { padding: 24px; background: #f5f5f5; min-height: 100vh; }
-.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding: 16px; background: white; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
-.page-header h1 { font-size: 24px; font-weight: 600; color: #333; margin: 0; }
-.loading, .error { display: flex; align-items: center; justify-content: center; height: 200px; color: #666; }
diff --git a/crop-x/src/pages/machinery/Fault/FaultWarning/index.tsx b/crop-x/src/pages/machinery/Fault/FaultWarning/index.tsx
deleted file mode 100644
index 306aec7..0000000
--- a/crop-x/src/pages/machinery/Fault/FaultWarning/index.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import React from 'react';
-import { FaultDashboard } from './components/FaultDashboard';
-import { WarningList } from './components/WarningList';
-import { DiagnosticTool } from './components/DiagnosticTool';
-import { RepairGuide } from './components/RepairGuide';
-import { useFaultWarningData } from './hooks/usePageData';
-import { useFaultWarningActions } from './hooks/usePageActions';
-import './index.css';
-
-export function FaultWarning() {
- console.log('FaultWarning component rendered');
-
- const { faults, warnings, loading, error, refreshData } = useFaultWarningData();
- const { handleDiagnose, handleAcknowledge, handleRepair } = useFaultWarningActions(refreshData);
-
- if (loading) return ;
- if (error) return ;
-
- return (
-
-
-
故障诊断与预警
- 刷新
-
-
-
-
-
-
- );
-}
diff --git a/crop-x/src/pages/machinery/Fault/FaultWarning/index.types.ts b/crop-x/src/pages/machinery/Fault/FaultWarning/index.types.ts
deleted file mode 100644
index a108448..0000000
--- a/crop-x/src/pages/machinery/Fault/FaultWarning/index.types.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-export interface FaultRecord {
- id: string;
- machineryId: string;
- machineryName: string;
- faultCode: string;
- faultType: FaultType;
- severity: FaultSeverity;
- description: string;
- detectedAt: string;
- status: FaultStatus;
- resolvedAt?: string;
- resolvedBy?: string;
-}
-
-export type FaultType = 'engine' | 'hydraulic' | 'electrical' | 'mechanical' | 'sensor' | 'software';
-export type FaultSeverity = 'low' | 'medium' | 'high' | 'critical';
-export type FaultStatus = 'detected' | 'diagnosing' | 'repairing' | 'resolved' | 'ignored';
-
-export interface WarningAlert {
- id: string;
- machineryId: string;
- alertType: string;
- message: string;
- severity: FaultSeverity;
- timestamp: string;
- acknowledged: boolean;
-}
diff --git a/crop-x/src/pages/machinery/Fault/HealthAssessment/index.css b/crop-x/src/pages/machinery/Fault/HealthAssessment/index.css
deleted file mode 100644
index b9b7a3b..0000000
--- a/crop-x/src/pages/machinery/Fault/HealthAssessment/index.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.health-assessment { padding: 24px; background: #f5f5f5; min-height: 100vh; }
-.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding: 16px; background: white; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
-.page-header h1 { font-size: 24px; font-weight: 600; color: #333; margin: 0; }
-.loading, .error { display: flex; align-items: center; justify-content: center; height: 200px; color: #666; }
diff --git a/crop-x/src/pages/machinery/Fault/HealthAssessment/index.tsx b/crop-x/src/pages/machinery/Fault/HealthAssessment/index.tsx
deleted file mode 100644
index a7a064f..0000000
--- a/crop-x/src/pages/machinery/Fault/HealthAssessment/index.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import React from 'react';
-import { HealthScore } from './components/HealthScore';
-import { HealthTrend } from './components/HealthTrend';
-import { MaintenancePlan } from './components/MaintenancePlan';
-import { HealthReport } from './components/HealthReport';
-import { useHealthAssessmentData } from './hooks/usePageData';
-import { useHealthAssessmentActions } from './hooks/usePageActions';
-import './index.css';
-
-export function HealthAssessment() {
- console.log('HealthAssessment component rendered');
-
- const { healthData, trends, plans, loading, error, refreshData } = useHealthAssessmentData();
- const { generateReport, scheduleMaintenance } = useHealthAssessmentActions(refreshData);
-
- if (loading) return ;
- if (error) return ;
-
- return (
-
-
-
健康评估
- generateReport()}>生成报告
-
-
-
-
-
-
- );
-}
diff --git a/crop-x/src/pages/machinery/Fault/ParameterMonitor/index.css b/crop-x/src/pages/machinery/Fault/ParameterMonitor/index.css
deleted file mode 100644
index 663df4c..0000000
--- a/crop-x/src/pages/machinery/Fault/ParameterMonitor/index.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.parameter-monitor { padding: 24px; background: #f5f5f5; min-height: 100vh; }
-.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding: 16px; background: white; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
-.page-header h1 { font-size: 24px; font-weight: 600; color: #333; margin: 0; }
-.loading, .error { display: flex; align-items: center; justify-content: center; height: 200px; color: #666; }
diff --git a/crop-x/src/pages/machinery/Fault/ParameterMonitor/index.tsx b/crop-x/src/pages/machinery/Fault/ParameterMonitor/index.tsx
deleted file mode 100644
index b970712..0000000
--- a/crop-x/src/pages/machinery/Fault/ParameterMonitor/index.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import React from 'react';
-import { ParameterDashboard } from './components/ParameterDashboard';
-import { RealtimeChart } from './components/RealtimeChart';
-import { ParameterAlert } from './components/ParameterAlert';
-import { ParameterConfig } from './components/ParameterConfig';
-import { useParameterMonitorData } from './hooks/usePageData';
-import { useParameterMonitorActions } from './hooks/usePageActions';
-import './index.css';
-
-export function ParameterMonitor() {
- console.log('ParameterMonitor component rendered');
-
- const { parameters, realtimeData, alerts, loading, error, refreshData } = useParameterMonitorData();
- const { updateConfig, acknowledgeAlert } = useParameterMonitorActions(refreshData);
-
- if (loading) return ;
- if (error) return ;
-
- return (
-
-
-
运行参数监测
- 刷新
-
-
-
-
-
-
- );
-}
diff --git a/crop-x/src/pages/machinery/Load/LoadDevice/index.css b/crop-x/src/pages/machinery/Load/LoadDevice/index.css
deleted file mode 100644
index a704dfd..0000000
--- a/crop-x/src/pages/machinery/Load/LoadDevice/index.css
+++ /dev/null
@@ -1,68 +0,0 @@
-.load-device {
- padding: 24px;
- background: #f5f5f5;
- min-height: 100vh;
-}
-
-.page-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 24px;
- padding: 16px;
- background: white;
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
-}
-
-.page-header h1 {
- font-size: 24px;
- font-weight: 600;
- color: #333;
- margin: 0;
-}
-
-.page-actions {
- display: flex;
- gap: 12px;
-}
-
-.page-actions button {
- padding: 8px 16px;
- border-radius: 4px;
- border: 1px solid #d9d9d9;
- background: white;
- cursor: pointer;
- transition: all 0.2s;
- font-size: 14px;
-}
-
-.page-actions button:hover {
- background: #f0f0f0;
- border-color: #40a9ff;
-}
-
-.page-actions button.primary {
- background: #40a9ff;
- color: white;
- border-color: #40a9ff;
-}
-
-.page-actions button.primary:hover {
- background: #1890ff;
- border-color: #1890ff;
-}
-
-/* 响应式设计 */
-@media (max-width: 768px) {
- .page-header {
- flex-direction: column;
- align-items: flex-start;
- gap: 16px;
- }
-
- .page-actions {
- width: 100%;
- justify-content: flex-end;
- }
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Load/LoadDevice/index.tsx b/crop-x/src/pages/machinery/Load/LoadDevice/index.tsx
deleted file mode 100644
index 5de38ed..0000000
--- a/crop-x/src/pages/machinery/Load/LoadDevice/index.tsx
+++ /dev/null
@@ -1,89 +0,0 @@
-import { useState, useEffect, useCallback } from 'react';
-import { LoadDeviceList } from './components/LoadDeviceList';
-import { LoadDeviceForm } from './components/LoadDeviceForm';
-import { LoadMonitor } from './components/LoadMonitor';
-import { useLoadDeviceData } from './hooks/usePageData';
-import { useLoadDeviceActions } from './hooks/usePageActions';
-import './index.css';
-
-export function LoadDevice() {
- const [selectedDevice, setSelectedDevice] = useState(null);
- const [isCreateModalOpen, setIsCreateModalOpen] = useState(false);
- const [isMonitorModalOpen, setIsMonitorModalOpen] = useState(false);
-
- const {
- devices,
- loading,
- error,
- filters,
- pagination,
- handleFilterChange,
- handlePageChange,
- refreshData
- } = useLoadDeviceData();
-
- const {
- handleCreate,
- handleEdit,
- handleDelete,
- handleBatchDelete,
- handleExport,
- handleCalibrate
- } = useLoadDeviceActions(refreshData);
-
- return (
-
-
-
负载管理
-
- setIsMonitorModalOpen(true)}>
- 实时监控
-
- setIsCreateModalOpen(true)}>
- 新增设备
-
-
- 导出数据
-
-
-
-
-
{
- setSelectedDevice(device);
- setIsMonitorModalOpen(true);
- }}
- onCalibrate={handleCalibrate}
- />
-
- {
- setIsCreateModalOpen(false);
- setSelectedDevice(null);
- }}
- onSave={selectedDevice ? handleEdit : handleCreate}
- editData={selectedDevice ? devices.find(d => d.id === selectedDevice) : undefined}
- />
-
- {
- setIsMonitorModalOpen(false);
- setSelectedDevice(null);
- }}
- deviceId={selectedDevice}
- />
-
- );
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Load/LoadParameter/constants.tsx b/crop-x/src/pages/machinery/Load/LoadParameter/constants.tsx
deleted file mode 100644
index 8d79e51..0000000
--- a/crop-x/src/pages/machinery/Load/LoadParameter/constants.tsx
+++ /dev/null
@@ -1,107 +0,0 @@
-import React from 'react';
-
-export const PARAMETER_TYPES = [
- { value: 'weight', label: '重量参数', icon: '⚖️' },
- { value: 'volume', label: '体积参数', icon: '📦' },
- { value: 'pressure', label: '压力参数', icon: '💨' },
- { value: 'temperature', label: '温度参数', icon: '🌡️' },
- { value: 'speed', label: '速度参数', icon: '🚀' },
- { value: 'flow', label: '流量参数', icon: '💧' },
- { value: 'other', label: '其他参数', icon: '⚙️' }
-] as const;
-
-export const PARAMETER_STATUSES = [
- { value: 'normal', label: '正常', color: '#52c41a' },
- { value: 'warning', label: '警告', color: '#faad14' },
- { value: 'critical', label: '严重', color: '#ff4d4f' },
- { value: 'offline', label: '离线', color: '#d9d9d9' }
-] as const;
-
-export const PARAMETER_UNITS = [
- 'kg', 't', 'L', 'm³', 'Pa', 'kPa', '°C', 'km/h', 'm³/h', 'bar', '其他'
-] as const;
-
-export const DEFAULT_ALERT_THRESHOLDS = {
- weight: { warning: 80, critical: 95 },
- volume: { warning: 85, critical: 98 },
- pressure: { warning: 75, critical: 90 },
- temperature: { warning: 70, critical: 85 },
- speed: { warning: 80, critical: 95 },
- flow: { warning: 75, critical: 90 }
-};
-
-export const LOAD_PARAMETER_FORM_SCHEMA = {
- name: {
- required: true,
- maxLength: 100,
- message: '请输入参数名称(最多100字符)'
- },
- description: {
- required: false,
- maxLength: 500,
- message: '描述最多500字符'
- },
- parameterType: {
- required: true,
- message: '请选择参数类型'
- },
- unit: {
- required: true,
- message: '请选择单位'
- },
- minValue: {
- required: true,
- message: '请输入最小值'
- },
- maxValue: {
- required: true,
- message: '请输入最大值'
- },
- defaultValue: {
- required: true,
- message: '请输入默认值'
- },
- alertThreshold: {
- required: true,
- message: '请输入告警阈值'
- },
- loadTypeId: {
- required: true,
- message: '请选择负载类型'
- }
-};
-
-export const LOAD_PARAMETER_MOCK_DATA = [
- {
- id: '1',
- name: '载重参数',
- description: '农机当前载重重量参数',
- parameterType: 'weight' as const,
- unit: 'kg',
- minValue: 0,
- maxValue: 1000,
- defaultValue: 0,
- currentValue: 750,
- status: 'normal' as const,
- loadTypeId: '1',
- alertThreshold: 900,
- createdAt: '2024-01-15T00:00:00Z',
- updatedAt: '2024-01-15T00:00:00Z'
- },
- {
- id: '2',
- name: '燃油容量',
- description: '农机燃油箱容量参数',
- parameterType: 'volume' as const,
- unit: 'L',
- minValue: 0,
- maxValue: 200,
- defaultValue: 50,
- currentValue: 120,
- status: 'warning' as const,
- loadTypeId: '1',
- alertThreshold: 180,
- createdAt: '2024-01-15T00:00:00Z',
- updatedAt: '2024-01-15T00:00:00Z'
- }
-];
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Load/LoadParameter/hooks/usePageActions.tsx b/crop-x/src/pages/machinery/Load/LoadParameter/hooks/usePageActions.tsx
deleted file mode 100644
index 564b0f7..0000000
--- a/crop-x/src/pages/machinery/Load/LoadParameter/hooks/usePageActions.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-import { useCallback } from 'react';
-import { LoadParameterFormData } from '../index.types';
-
-export function useLoadParameterActions(refreshData: () => void) {
- const handleCreate = useCallback(async (data: LoadParameterFormData) => {
- try {
- console.log('Creating parameter:', data);
- await new Promise(resolve => setTimeout(resolve, 1000));
- refreshData();
- return { success: true };
- } catch (error) {
- return { success: false, error: '创建失败' };
- }
- }, [refreshData]);
-
- const handleUpdate = useCallback(async (id: string, data: LoadParameterFormData) => {
- try {
- console.log('Updating parameter:', id, data);
- await new Promise(resolve => setTimeout(resolve, 1000));
- refreshData();
- return { success: true };
- } catch (error) {
- return { success: false, error: '更新失败' };
- }
- }, [refreshData]);
-
- const handleDelete = useCallback(async (id: string) => {
- try {
- console.log('Deleting parameter:', id);
- await new Promise(resolve => setTimeout(resolve, 1000));
- refreshData();
- return { success: true };
- } catch (error) {
- return { success: false, error: '删除失败' };
- }
- }, [refreshData]);
-
- const handleFilter = useCallback((filters: any) => {
- console.log('Filtering parameters:', filters);
- }, []);
-
- const handleExport = useCallback(() => {
- console.log('Exporting parameters');
- }, []);
-
- return {
- handleCreate,
- handleUpdate,
- handleDelete,
- handleFilter,
- handleExport
- };
-}
diff --git a/crop-x/src/pages/machinery/Load/LoadParameter/hooks/usePageData.tsx b/crop-x/src/pages/machinery/Load/LoadParameter/hooks/usePageData.tsx
deleted file mode 100644
index 7f3fdd1..0000000
--- a/crop-x/src/pages/machinery/Load/LoadParameter/hooks/usePageData.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import { useState, useEffect, useCallback } from 'react';
-import { LoadParameterRecord, LoadParameterFilters, PaginationState } from '../index.types';
-
-const MOCK_PARAMETER_DATA: LoadParameterRecord[] = [
- {
- id: '1',
- name: '载重参数',
- description: '农机当前载重重量参数',
- parameterType: 'weight',
- unit: 'kg',
- minValue: 0,
- maxValue: 1000,
- defaultValue: 0,
- currentValue: 750,
- status: 'normal',
- loadTypeId: '1',
- alertThreshold: 900,
- createdAt: '2024-01-15T00:00:00Z',
- updatedAt: '2024-01-15T00:00:00Z'
- }
-];
-
-export function useLoadParameterData() {
- const [parameters, setParameters] = useState([]);
- const [loading, setLoading] = useState(false);
- const [error, setError] = useState(null);
- const [filters, setFilters] = useState({});
-
- const fetchParameters = useCallback(async () => {
- setLoading(true);
- setError(null);
-
- try {
- await new Promise(resolve => setTimeout(resolve, 500));
- setParameters(MOCK_PARAMETER_DATA);
- } catch (err) {
- const errorMessage = err instanceof Error ? err.message : '获取参数数据失败';
- setError(errorMessage);
- } finally {
- setLoading(false);
- }
- }, []);
-
- useEffect(() => {
- fetchParameters();
- }, [fetchParameters]);
-
- return {
- parameters,
- loading,
- error,
- filters,
- refreshData: fetchParameters
- };
-}
diff --git a/crop-x/src/pages/machinery/Load/LoadParameter/index.css b/crop-x/src/pages/machinery/Load/LoadParameter/index.css
deleted file mode 100644
index 4c0a33a..0000000
--- a/crop-x/src/pages/machinery/Load/LoadParameter/index.css
+++ /dev/null
@@ -1,116 +0,0 @@
-.load-parameter {
- padding: 24px;
- background: #f5f5f5;
- min-height: 100vh;
-}
-
-.page-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 24px;
- padding: 16px;
- background: white;
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
-}
-
-.page-header h1 {
- font-size: 24px;
- font-weight: 600;
- color: #333;
- margin: 0;
-}
-
-.page-actions {
- display: flex;
- gap: 12px;
-}
-
-.page-actions button {
- padding: 8px 16px;
- border-radius: 4px;
- border: 1px solid #d9d9d9;
- background: white;
- cursor: pointer;
- transition: all 0.2s;
- font-size: 14px;
-}
-
-.page-actions button:hover {
- background: #f0f0f0;
- border-color: #40a9ff;
-}
-
-.page-actions button.primary {
- background: #40a9ff;
- color: white;
- border-color: #40a9ff;
-}
-
-.page-actions button.primary:hover {
- background: #1890ff;
- border-color: #1890ff;
-}
-
-.page-content {
- display: flex;
- flex-direction: column;
- gap: 16px;
-}
-
-.parameter-overview {
- background: white;
- padding: 16px;
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
-}
-
-.loading-state,
-.error-state {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- height: 200px;
- color: #666;
-}
-
-.spinner {
- width: 40px;
- height: 40px;
- border: 4px solid #f3f3f3;
- border-top: 4px solid #40a9ff;
- border-radius: 50%;
- animation: spin 1s linear infinite;
- margin-bottom: 16px;
-}
-
-@keyframes spin {
- 0% { transform: rotate(0deg); }
- 100% { transform: rotate(360deg); }
-}
-
-.error-state button {
- margin-top: 16px;
- padding: 8px 16px;
- background: #ff4d4f;
- color: white;
- border: none;
- border-radius: 4px;
- cursor: pointer;
-}
-
-/* 响应式设计 */
-@media (max-width: 768px) {
- .page-header {
- flex-direction: column;
- align-items: flex-start;
- gap: 16px;
- }
-
- .page-actions {
- width: 100%;
- justify-content: flex-end;
- }
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Load/LoadParameter/index.tsx b/crop-x/src/pages/machinery/Load/LoadParameter/index.tsx
deleted file mode 100644
index 7b4838e..0000000
--- a/crop-x/src/pages/machinery/Load/LoadParameter/index.tsx
+++ /dev/null
@@ -1,91 +0,0 @@
-import React from 'react';
-import { ParameterForm } from './components/ParameterForm';
-import { ParameterList } from './components/ParameterList';
-import { ParameterTable } from './components/ParameterTable';
-import { ParameterDetails } from './components/ParameterDetails';
-import { ParameterChart } from './components/ParameterChart';
-import { useLoadParameterData } from './hooks/usePageData';
-import { useLoadParameterActions } from './hooks/usePageActions';
-import './index.css';
-
-export function LoadParameter() {
- console.log('LoadParameter component rendered');
-
- const {
- parameters,
- loading,
- error,
- filters,
- refreshData
- } = useLoadParameterData();
-
- const {
- handleCreate,
- handleUpdate,
- handleDelete,
- handleFilter,
- handleExport
- } = useLoadParameterActions(refreshData);
-
- if (loading) {
- return (
-
- );
- }
-
- if (error) {
- return (
-
- );
- }
-
- return (
-
-
-
负载参数管理
-
-
- 新增参数
-
-
- 导出数据
-
-
-
-
-
-
-
-
{}}
- />
-
- console.log('View parameter:', param)}
- />
-
-
-
-
- );
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Load/LoadParameter/index.types.ts b/crop-x/src/pages/machinery/Load/LoadParameter/index.types.ts
deleted file mode 100644
index f587603..0000000
--- a/crop-x/src/pages/machinery/Load/LoadParameter/index.types.ts
+++ /dev/null
@@ -1,72 +0,0 @@
-export interface LoadParameterRecord {
- id: string;
- name: string;
- description: string;
- parameterType: ParameterType;
- unit: string;
- minValue: number;
- maxValue: number;
- defaultValue: number;
- currentValue: number;
- status: ParameterStatus;
- loadTypeId: string;
- alertThreshold: number;
- createdAt: string;
- updatedAt: string;
-}
-
-export type ParameterType =
- | 'weight'
- | 'volume'
- | 'pressure'
- | 'temperature'
- | 'speed'
- | 'flow'
- | 'other';
-
-export type ParameterStatus = 'normal' | 'warning' | 'critical' | 'offline';
-
-export interface LoadParameterFilters {
- name?: string;
- parameterType?: ParameterType;
- status?: ParameterStatus;
- loadTypeId?: string;
- dateRange?: [string, string];
-}
-
-export interface LoadParameterFormData {
- name: string;
- description: string;
- parameterType: ParameterType;
- unit: string;
- minValue: number;
- maxValue: number;
- defaultValue: number;
- alertThreshold: number;
- loadTypeId: string;
-}
-
-export interface ParameterChartData {
- timestamp: string;
- value: number;
- status: ParameterStatus;
-}
-
-export interface ParameterComponentProps {
- parameters: LoadParameterRecord[];
- onEdit?: (parameter: LoadParameterRecord) => void;
- onDelete?: (id: string) => void;
- onView?: (parameter: LoadParameterRecord) => void;
-}
-
-export interface ParameterFormProps {
- initialData?: LoadParameterFormData;
- onSubmit: (data: LoadParameterFormData) => void;
- onCancel: () => void;
- loading?: boolean;
-}
-
-export interface ParameterChartProps {
- parameters: LoadParameterRecord[];
- onParameterSelect?: (parameter: LoadParameterRecord) => void;
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Load/LoadParameter/utils/parameterHelpers.tsx b/crop-x/src/pages/machinery/Load/LoadParameter/utils/parameterHelpers.tsx
deleted file mode 100644
index 44317a6..0000000
--- a/crop-x/src/pages/machinery/Load/LoadParameter/utils/parameterHelpers.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-import { LoadParameterRecord, ParameterStatus } from '../index.types';
-
-export function getParameterStatusColor(status: ParameterStatus): string {
- switch (status) {
- case 'normal': return '#52c41a';
- case 'warning': return '#faad14';
- case 'critical': return '#ff4d4f';
- case 'offline': return '#d9d9d9';
- default: return '#d9d9d9';
- }
-}
-
-export function getParameterStatusText(status: ParameterStatus): string {
- switch (status) {
- case 'normal': return '正常';
- case 'warning': return '警告';
- case 'critical': return '严重';
- case 'offline': return '离线';
- default: return '未知';
- }
-}
-
-export function checkParameterThreshold(
- currentValue: number,
- alertThreshold: number,
- maxValue: number
-): ParameterStatus {
- if (currentValue >= maxValue) return 'critical';
- if (currentValue >= alertThreshold) return 'warning';
- return 'normal';
-}
-
-export function formatParameterValue(value: number, unit: string): string {
- return `${value} ${unit}`;
-}
diff --git a/crop-x/src/pages/machinery/Load/LoadType/components/LoadTypeForm/index.css b/crop-x/src/pages/machinery/Load/LoadType/components/LoadTypeForm/index.css
deleted file mode 100644
index f42a6fb..0000000
--- a/crop-x/src/pages/machinery/Load/LoadType/components/LoadTypeForm/index.css
+++ /dev/null
@@ -1,114 +0,0 @@
-.load-type-form {
- background: white;
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
-}
-
-.form-container {
- padding: 24px;
-}
-
-.form-header {
- margin-bottom: 24px;
- padding-bottom: 16px;
- border-bottom: 1px solid #f0f0f0;
-}
-
-.form-header h3 {
- margin: 0;
- font-size: 18px;
- font-weight: 600;
- color: #333;
-}
-
-.form-content {
- display: flex;
- flex-direction: column;
- gap: 16px;
-}
-
-.form-group {
- display: flex;
- flex-direction: column;
- gap: 8px;
-}
-
-.form-row {
- display: grid;
- grid-template-columns: 1fr 1fr;
- gap: 16px;
-}
-
-.form-group label {
- font-weight: 500;
- color: #333;
- font-size: 14px;
-}
-
-.form-group input,
-.form-group select,
-.form-group textarea {
- padding: 8px 12px;
- border: 1px solid #d9d9d9;
- border-radius: 4px;
- font-size: 14px;
- transition: border-color 0.2s;
-}
-
-.form-group input:focus,
-.form-group select:focus,
-.form-group textarea:focus {
- outline: none;
- border-color: #40a9ff;
- box-shadow: 0 0 0 2px rgba(64, 169, 255, 0.2);
-}
-
-.form-actions {
- display: flex;
- justify-content: flex-end;
- gap: 12px;
- margin-top: 24px;
- padding-top: 16px;
- border-top: 1px solid #f0f0f0;
-}
-
-.form-actions button {
- padding: 8px 16px;
- border-radius: 4px;
- border: 1px solid #d9d9d9;
- background: white;
- cursor: pointer;
- transition: all 0.2s;
- font-size: 14px;
-}
-
-.form-actions button:hover {
- background: #f0f0f0;
- border-color: #40a9ff;
-}
-
-.form-actions button.primary-button {
- background: #40a9ff;
- color: white;
- border-color: #40a9ff;
-}
-
-.form-actions button.primary-button:hover {
- background: #1890ff;
- border-color: #1890ff;
-}
-
-.form-actions button:disabled {
- opacity: 0.6;
- cursor: not-allowed;
-}
-
-@media (max-width: 768px) {
- .form-row {
- grid-template-columns: 1fr;
- }
-
- .form-container {
- padding: 16px;
- }
-}
diff --git a/crop-x/src/pages/machinery/Load/LoadType/components/LoadTypeForm/index.tsx b/crop-x/src/pages/machinery/Load/LoadType/components/LoadTypeForm/index.tsx
deleted file mode 100644
index 55650d1..0000000
--- a/crop-x/src/pages/machinery/Load/LoadType/components/LoadTypeForm/index.tsx
+++ /dev/null
@@ -1,134 +0,0 @@
-import React from 'react';
-import { LoadTypeFormData } from '../../index.types';
-import { LOAD_TYPE_CATEGORIES, LOAD_TYPE_UNITS } from '../../constants';
-import './index.css';
-
-interface LoadTypeFormProps {
- initialData?: LoadTypeFormData;
- onSubmit: (data: LoadTypeFormData) => void;
- onCancel: () => void;
- loading?: boolean;
-}
-
-export function LoadTypeForm({ initialData, onSubmit, onCancel, loading }: LoadTypeFormProps) {
- const [formData, setFormData] = React.useState(
- initialData || {
- name: '',
- description: '',
- category: '',
- maxCapacity: 0,
- unit: 'kg',
- status: 'active',
- compatibleMachinery: []
- }
- );
-
- const handleSubmit = (e: React.FormEvent) => {
- e.preventDefault();
- onSubmit(formData);
- };
-
- const handleChange = (field: keyof LoadTypeFormData, value: any) => {
- setFormData(prev => ({ ...prev, [field]: value }));
- };
-
- return (
-
-
-
-
{initialData ? '编辑负载类型' : '新增负载类型'}
-
-
-
-
- 负载类型名称 *
- handleChange('name', e.target.value)}
- required
- />
-
-
-
- 描述
- handleChange('description', e.target.value)}
- rows={3}
- />
-
-
-
-
- 类别 *
- handleChange('category', e.target.value)}
- required
- >
- 请选择类别
- {LOAD_TYPE_CATEGORIES.map(category => (
- {category}
- ))}
-
-
-
-
- 最大容量 *
- handleChange('maxCapacity', Number(e.target.value))}
- min="0"
- required
- />
-
-
-
-
-
- 单位 *
- handleChange('unit', e.target.value)}
- required
- >
- {LOAD_TYPE_UNITS.map(unit => (
- {unit}
- ))}
-
-
-
-
- 状态
- handleChange('status', e.target.value)}
- >
- 启用
- 停用
- 维护中
-
-
-
-
-
-
-
- 取消
-
-
- {loading ? '保存中...' : '保存'}
-
-
-
-
- );
-}
diff --git a/crop-x/src/pages/machinery/Load/LoadType/components/LoadTypeForm/types.ts b/crop-x/src/pages/machinery/Load/LoadType/components/LoadTypeForm/types.ts
deleted file mode 100644
index d1dc467..0000000
--- a/crop-x/src/pages/machinery/Load/LoadType/components/LoadTypeForm/types.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-export interface LoadTypeFormProps {
- initialData?: {
- name: string;
- description: string;
- category: string;
- maxCapacity: number;
- unit: string;
- status: 'active' | 'inactive' | 'maintenance';
- compatibleMachinery: string[];
- };
- onSubmit: (data: any) => void;
- onCancel: () => void;
- loading?: boolean;
-}
-
-export interface LoadTypeFormState {
- name: string;
- description: string;
- category: string;
- maxCapacity: number;
- unit: string;
- status: 'active' | 'inactive' | 'maintenance';
- compatibleMachinery: string[];
-}
diff --git a/crop-x/src/pages/machinery/Load/LoadType/components/LoadTypeList/index.css b/crop-x/src/pages/machinery/Load/LoadType/components/LoadTypeList/index.css
deleted file mode 100644
index 2207598..0000000
--- a/crop-x/src/pages/machinery/Load/LoadType/components/LoadTypeList/index.css
+++ /dev/null
@@ -1,171 +0,0 @@
-.load-type-list {
- background: white;
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
- overflow: hidden;
-}
-
-.list-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 16px 24px;
- border-bottom: 1px solid #f0f0f0;
- background: #fafafa;
-}
-
-.list-header h3 {
- margin: 0;
- font-size: 16px;
- font-weight: 600;
- color: #333;
-}
-
-.count {
- font-size: 14px;
- color: #666;
-}
-
-.empty-state {
- display: flex;
- align-items: center;
- justify-content: center;
- height: 200px;
- color: #666;
- font-size: 14px;
-}
-
-.list-content {
- padding: 16px 24px;
-}
-
-.list-item {
- display: flex;
- justify-content: space-between;
- align-items: flex-start;
- padding: 16px 0;
- border-bottom: 1px solid #f0f0f0;
-}
-
-.list-item:last-child {
- border-bottom: none;
-}
-
-.item-info {
- flex: 1;
- min-width: 0;
-}
-
-.item-header {
- display: flex;
- align-items: center;
- gap: 12px;
- margin-bottom: 8px;
-}
-
-.item-name {
- margin: 0;
- font-size: 16px;
- font-weight: 500;
- color: #333;
-}
-
-.status-badge {
- padding: 2px 8px;
- border-radius: 12px;
- font-size: 12px;
- color: white;
- font-weight: 500;
-}
-
-.item-description {
- margin: 0 0 12px 0;
- font-size: 14px;
- color: #666;
- line-height: 1.4;
-}
-
-.item-details {
- display: flex;
- gap: 24px;
- flex-wrap: wrap;
-}
-
-.detail-item {
- display: flex;
- align-items: center;
- gap: 4px;
- font-size: 13px;
-}
-
-.detail-item .label {
- color: #999;
-}
-
-.detail-item .value {
- color: #333;
- font-weight: 500;
-}
-
-.item-actions {
- display: flex;
- gap: 8px;
- flex-shrink: 0;
-}
-
-.action-button {
- padding: 6px 12px;
- border-radius: 4px;
- border: 1px solid #d9d9d9;
- background: white;
- cursor: pointer;
- transition: all 0.2s;
- font-size: 13px;
-}
-
-.action-button:hover {
- background: #f0f0f0;
- border-color: #40a9ff;
-}
-
-.action-button.edit-button:hover {
- background: #e6f7ff;
- border-color: #40a9ff;
- color: #1890ff;
-}
-
-.action-button.delete-button:hover {
- background: #fff2f0;
- border-color: #ff4d4f;
- color: #ff4d4f;
-}
-
-.action-button.view-button:hover {
- background: #f6ffed;
- border-color: #52c41a;
- color: #52c41a;
-}
-
-@media (max-width: 768px) {
- .list-header {
- padding: 12px 16px;
- }
-
- .list-content {
- padding: 12px 16px;
- }
-
- .list-item {
- flex-direction: column;
- gap: 12px;
- }
-
- .item-actions {
- width: 100%;
- justify-content: flex-end;
- }
-
- .item-details {
- gap: 16px;
- }
-}
diff --git a/crop-x/src/pages/machinery/Load/LoadType/components/LoadTypeList/index.tsx b/crop-x/src/pages/machinery/Load/LoadType/components/LoadTypeList/index.tsx
deleted file mode 100644
index 1cf1e40..0000000
--- a/crop-x/src/pages/machinery/Load/LoadType/components/LoadTypeList/index.tsx
+++ /dev/null
@@ -1,114 +0,0 @@
-import React from 'react';
-import { LoadTypeRecord } from '../../index.types';
-import { getStatusColor, getStatusText } from '../../../utils/statusHelpers';
-import './index.css';
-
-interface LoadTypeListProps {
- loadTypes: LoadTypeRecord[];
- onEdit?: (loadType: LoadTypeRecord) => void;
- onDelete?: (id: string) => void;
- onView?: (loadType: LoadTypeRecord) => void;
-}
-
-export function LoadTypeList({ loadTypes, onEdit, onDelete, onView }: LoadTypeListProps) {
- if (loadTypes.length === 0) {
- return (
-
- );
- }
-
- return (
-
-
-
负载类型列表
- 共 {loadTypes.length} 条记录
-
-
-
- {loadTypes.map((loadType) => (
-
-
-
-
{loadType.name}
-
- {getStatusText(loadType.status)}
-
-
-
-
{loadType.description}
-
-
-
- 类别:
- {loadType.category}
-
-
- 最大容量:
- {loadType.maxCapacity} {loadType.unit}
-
-
- 创建时间:
-
- {new Date(loadType.createdAt).toLocaleDateString()}
-
-
-
-
-
-
- {onView && (
- onView(loadType)}
- className="action-button view-button"
- >
- 查看
-
- )}
- {onEdit && (
- onEdit(loadType)}
- className="action-button edit-button"
- >
- 编辑
-
- )}
- {onDelete && (
- onDelete(loadType.id)}
- className="action-button delete-button"
- >
- 删除
-
- )}
-
-
- ))}
-
-
- );
-}
-
-function getStatusColor(status: string): string {
- switch (status) {
- case 'active': return '#52c41a';
- case 'inactive': return '#d9d9d9';
- case 'maintenance': return '#faad14';
- default: return '#d9d9d9';
- }
-}
-
-function getStatusText(status: string): string {
- switch (status) {
- case 'active': return '启用';
- case 'inactive': return '停用';
- case 'maintenance': return '维护中';
- default: return '未知';
- }
-}
diff --git a/crop-x/src/pages/machinery/Load/LoadType/components/LoadTypeList/types.ts b/crop-x/src/pages/machinery/Load/LoadType/components/LoadTypeList/types.ts
deleted file mode 100644
index f38a788..0000000
--- a/crop-x/src/pages/machinery/Load/LoadType/components/LoadTypeList/types.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-export interface LoadTypeListProps {
- loadTypes: Array<{
- id: string;
- name: string;
- description: string;
- category: string;
- maxCapacity: number;
- unit: string;
- status: string;
- createdAt: string;
- updatedAt: string;
- }>;
- onEdit?: (loadType: any) => void;
- onDelete?: (id: string) => void;
- onView?: (loadType: any) => void;
-}
diff --git a/crop-x/src/pages/machinery/Load/LoadType/constants.tsx b/crop-x/src/pages/machinery/Load/LoadType/constants.tsx
deleted file mode 100644
index 49c986b..0000000
--- a/crop-x/src/pages/machinery/Load/LoadType/constants.tsx
+++ /dev/null
@@ -1,84 +0,0 @@
-import React from 'react';
-
-export const LOAD_TYPE_CATEGORIES = [
- '耕作负载',
- '播种负载',
- '收获负载',
- '运输负载',
- '喷洒负载',
- '灌溉负载',
- '其他负载'
-] as const;
-
-export const LOAD_TYPE_STATUSES = [
- { value: 'active', label: '启用', color: '#52c41a' },
- { value: 'inactive', label: '停用', color: '#d9d9d9' },
- { value: 'maintenance', label: '维护中', color: '#faad14' }
-] as const;
-
-export const LOAD_TYPE_UNITS = [
- 'kg', 't', 'L', 'm³', '个', '箱', '袋', '其他'
-] as const;
-
-export const DEFAULT_PAGINATION = {
- current: 1,
- pageSize: 20,
- total: 0
-};
-
-export const LOAD_TYPE_FORM_SCHEMA = {
- name: {
- required: true,
- maxLength: 100,
- message: '请输入负载类型名称(最多100字符)'
- },
- description: {
- required: false,
- maxLength: 500,
- message: '描述最多500字符'
- },
- category: {
- required: true,
- message: '请选择负载类别'
- },
- maxCapacity: {
- required: true,
- min: 0,
- message: '请输入有效容量值'
- },
- unit: {
- required: true,
- message: '请选择单位'
- },
- status: {
- required: true,
- message: '请选择状态'
- }
-};
-
-export const LOAD_TYPE_MOCK_DATA = [
- {
- id: '1',
- name: '标准耕作负载',
- description: '适用于标准耕作作业的通用负载配置',
- category: '耕作负载',
- maxCapacity: 500,
- unit: 'kg',
- status: 'active' as const,
- compatibleMachinery: ['拖拉机-001', '拖拉机-002'],
- createdAt: '2024-01-15T00:00:00Z',
- updatedAt: '2024-01-15T00:00:00Z'
- },
- {
- id: '2',
- name: '播种专用负载',
- description: '精量播种作业专用负载配置',
- category: '播种负载',
- maxCapacity: 200,
- unit: 'kg',
- status: 'active' as const,
- compatibleMachinery: ['播种机-001'],
- createdAt: '2024-01-16T00:00:00Z',
- updatedAt: '2024-01-16T00:00:00Z'
- }
-];
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Load/LoadType/hooks/usePageActions.tsx b/crop-x/src/pages/machinery/Load/LoadType/hooks/usePageActions.tsx
deleted file mode 100644
index 08f399f..0000000
--- a/crop-x/src/pages/machinery/Load/LoadType/hooks/usePageActions.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import { useCallback } from 'react';
-import { LoadTypeFormData } from '../index.types';
-
-export function useLoadTypeActions(refreshData: () => void) {
- const handleCreate = useCallback(async (data: LoadTypeFormData) => {
- try {
- console.log('Creating load type:', data);
- // API call to create load type
- await new Promise(resolve => setTimeout(resolve, 1000));
- refreshData();
- return { success: true };
- } catch (error) {
- console.error('Failed to create load type:', error);
- return { success: false, error: '创建失败' };
- }
- }, [refreshData]);
-
- const handleUpdate = useCallback(async (id: string, data: LoadTypeFormData) => {
- try {
- console.log('Updating load type:', id, data);
- // API call to update load type
- await new Promise(resolve => setTimeout(resolve, 1000));
- refreshData();
- return { success: true };
- } catch (error) {
- console.error('Failed to update load type:', error);
- return { success: false, error: '更新失败' };
- }
- }, [refreshData]);
-
- const handleDelete = useCallback(async (id: string) => {
- try {
- console.log('Deleting load type:', id);
- // API call to delete load type
- await new Promise(resolve => setTimeout(resolve, 1000));
- refreshData();
- return { success: true };
- } catch (error) {
- console.error('Failed to delete load type:', error);
- return { success: false, error: '删除失败' };
- }
- }, [refreshData]);
-
- const handleFilter = useCallback((filters: any) => {
- console.log('Filtering load types:', filters);
- // Apply filters logic
- }, []);
-
- return {
- handleCreate,
- handleUpdate,
- handleDelete,
- handleFilter
- };
-}
diff --git a/crop-x/src/pages/machinery/Load/LoadType/hooks/usePageData.tsx b/crop-x/src/pages/machinery/Load/LoadType/hooks/usePageData.tsx
deleted file mode 100644
index c350928..0000000
--- a/crop-x/src/pages/machinery/Load/LoadType/hooks/usePageData.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-import { useState, useEffect, useCallback } from 'react';
-import { LoadTypeRecord, LoadTypeFilters, PaginationState } from '../index.types';
-import { LOAD_TYPE_MOCK_DATA } from '../constants';
-
-export function useLoadTypeData() {
- const [loadTypes, setLoadTypes] = useState([]);
- const [loading, setLoading] = useState(false);
- const [error, setError] = useState(null);
- const [filters, setFilters] = useState({});
- const [pagination, setPagination] = useState({
- current: 1,
- pageSize: 20,
- total: 0
- });
-
- const fetchLoadTypes = useCallback(async () => {
- setLoading(true);
- setError(null);
-
- try {
- // Simulate API call
- await new Promise(resolve => setTimeout(resolve, 500));
- setLoadTypes(LOAD_TYPE_MOCK_DATA);
- setPagination(prev => ({ ...prev, total: LOAD_TYPE_MOCK_DATA.length }));
- } catch (err) {
- const errorMessage = err instanceof Error ? err.message : '获取负载类型数据失败';
- setError(errorMessage);
- } finally {
- setLoading(false);
- }
- }, []);
-
- useEffect(() => {
- fetchLoadTypes();
- }, [fetchLoadTypes]);
-
- return {
- loadTypes,
- loading,
- error,
- filters,
- pagination,
- refreshData: fetchLoadTypes
- };
-}
diff --git a/crop-x/src/pages/machinery/Load/LoadType/index.css b/crop-x/src/pages/machinery/Load/LoadType/index.css
deleted file mode 100644
index 4ad2bd1..0000000
--- a/crop-x/src/pages/machinery/Load/LoadType/index.css
+++ /dev/null
@@ -1,109 +0,0 @@
-.load-type {
- padding: 24px;
- background: #f5f5f5;
- min-height: 100vh;
-}
-
-.page-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 24px;
- padding: 16px;
- background: white;
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
-}
-
-.page-header h1 {
- font-size: 24px;
- font-weight: 600;
- color: #333;
- margin: 0;
-}
-
-.page-actions {
- display: flex;
- gap: 12px;
-}
-
-.page-actions button {
- padding: 8px 16px;
- border-radius: 4px;
- border: 1px solid #d9d9d9;
- background: white;
- cursor: pointer;
- transition: all 0.2s;
- font-size: 14px;
-}
-
-.page-actions button:hover {
- background: #f0f0f0;
- border-color: #40a9ff;
-}
-
-.page-actions button.primary {
- background: #40a9ff;
- color: white;
- border-color: #40a9ff;
-}
-
-.page-actions button.primary:hover {
- background: #1890ff;
- border-color: #1890ff;
-}
-
-.page-content {
- display: flex;
- flex-direction: column;
- gap: 16px;
-}
-
-.loading-state,
-.error-state {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- height: 200px;
- color: #666;
-}
-
-.spinner {
- width: 40px;
- height: 40px;
- border: 4px solid #f3f3f3;
- border-top: 4px solid #40a9ff;
- border-radius: 50%;
- animation: spin 1s linear infinite;
- margin-bottom: 16px;
-}
-
-@keyframes spin {
- 0% { transform: rotate(0deg); }
- 100% { transform: rotate(360deg); }
-}
-
-.error-state button {
- margin-top: 16px;
- padding: 8px 16px;
- background: #ff4d4f;
- color: white;
- border: none;
- border-radius: 4px;
- cursor: pointer;
-}
-
-/* 响应式设计 */
-@media (max-width: 768px) {
- .page-header {
- flex-direction: column;
- align-items: flex-start;
- gap: 16px;
- }
-
- .page-actions {
- width: 100%;
- justify-content: flex-end;
- }
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Load/LoadType/index.tsx b/crop-x/src/pages/machinery/Load/LoadType/index.tsx
deleted file mode 100644
index 6643c91..0000000
--- a/crop-x/src/pages/machinery/Load/LoadType/index.tsx
+++ /dev/null
@@ -1,82 +0,0 @@
-import React from 'react';
-import { LoadTypeForm } from './components/LoadTypeForm';
-import { LoadTypeList } from './components/LoadTypeList';
-import { LoadTypeTable } from './components/LoadTypeTable';
-import { LoadTypeDetails } from './components/LoadTypeDetails';
-import { LoadTypeFilter } from './components/LoadTypeFilter';
-import { useLoadTypeData } from './hooks/usePageData';
-import { useLoadTypeActions } from './hooks/usePageActions';
-import './index.css';
-
-export function LoadType() {
- console.log('LoadType component rendered');
-
- const {
- loadTypes,
- loading,
- error,
- filters,
- refreshData
- } = useLoadTypeData();
-
- const {
- handleCreate,
- handleUpdate,
- handleDelete,
- handleFilter
- } = useLoadTypeActions(refreshData);
-
- if (loading) {
- return (
-
- );
- }
-
- if (error) {
- return (
-
- );
- }
-
- return (
-
-
-
负载类型管理
-
-
- 新增负载类型
-
-
-
-
-
-
-
-
-
-
-
-
- );
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Load/LoadType/index.types.ts b/crop-x/src/pages/machinery/Load/LoadType/index.types.ts
deleted file mode 100644
index 9ed826a..0000000
--- a/crop-x/src/pages/machinery/Load/LoadType/index.types.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-export interface LoadTypeRecord {
- id: string;
- name: string;
- description: string;
- category: string;
- maxCapacity: number;
- unit: string;
- status: LoadTypeStatus;
- compatibleMachinery: string[];
- createdAt: string;
- updatedAt: string;
-}
-
-export type LoadTypeStatus = 'active' | 'inactive' | 'maintenance';
-
-export interface LoadTypeFilters {
- name?: string;
- category?: string;
- status?: LoadTypeStatus;
- dateRange?: [string, string];
-}
-
-export interface LoadTypeFormData {
- name: string;
- description: string;
- category: string;
- maxCapacity: number;
- unit: string;
- status: LoadTypeStatus;
- compatibleMachinery: string[];
-}
-
-export interface PaginationState {
- current: number;
- pageSize: number;
- total: number;
-}
-
-export interface LoadTypeComponentProps {
- loadTypes: LoadTypeRecord[];
- onEdit?: (loadType: LoadTypeRecord) => void;
- onDelete?: (id: string) => void;
- onView?: (loadType: LoadTypeRecord) => void;
-}
-
-export interface LoadTypeFormProps {
- initialData?: LoadTypeFormData;
- onSubmit: (data: LoadTypeFormData) => void;
- onCancel: () => void;
- loading?: boolean;
-}
-
-export interface LoadTypeFilterProps {
- filters: LoadTypeFilters;
- onFilterChange: (filters: LoadTypeFilters) => void;
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Load/LoadType/utils/pageHelpers.tsx b/crop-x/src/pages/machinery/Load/LoadType/utils/pageHelpers.tsx
deleted file mode 100644
index 73d4c9f..0000000
--- a/crop-x/src/pages/machinery/Load/LoadType/utils/pageHelpers.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import { LoadTypeRecord } from '../index.types';
-
-export function formatLoadTypeName(name: string): string {
- return name.trim();
-}
-
-export function validateLoadTypeData(data: Partial): string[] {
- const errors: string[] = [];
-
- if (!data.name || data.name.trim().length === 0) {
- errors.push('负载类型名称不能为空');
- }
-
- if (!data.category) {
- errors.push('请选择负载类别');
- }
-
- if (data.maxCapacity !== undefined && data.maxCapacity <= 0) {
- errors.push('最大容量必须大于0');
- }
-
- return errors;
-}
-
-export function sortLoadTypes(records: LoadTypeRecord[], sortBy: keyof LoadTypeRecord): LoadTypeRecord[] {
- return [...records].sort((a, b) => {
- if (a[sortBy] < b[sortBy]) return -1;
- if (a[sortBy] > b[sortBy]) return 1;
- return 0;
- });
-}
-
-export function filterLoadTypes(records: LoadTypeRecord[], filters: any): LoadTypeRecord[] {
- return records.filter(record => {
- if (filters.name && !record.name.toLowerCase().includes(filters.name.toLowerCase())) {
- return false;
- }
- if (filters.category && record.category !== filters.category) {
- return false;
- }
- if (filters.status && record.status !== filters.status) {
- return false;
- }
- return true;
- });
-}
diff --git a/crop-x/src/pages/machinery/Monitoring/OperationData/constants.tsx b/crop-x/src/pages/machinery/Monitoring/OperationData/constants.tsx
deleted file mode 100644
index a713bd8..0000000
--- a/crop-x/src/pages/machinery/Monitoring/OperationData/constants.tsx
+++ /dev/null
@@ -1,129 +0,0 @@
-import React from 'react';
-
-export const OPERATION_TYPES = [
- { value: 'plowing', label: '耕作', icon: '🚜', color: '#8B4513' },
- { value: 'seeding', label: '播种', icon: '🌱', color: '#228B22' },
- { value: 'harvesting', label: '收获', icon: '🌾', color: '#FFD700' },
- { value: 'irrigation', label: '灌溉', icon: '💧', color: '#4682B4' },
- { value: 'fertilizing', label: '施肥', icon: '🌿', color: '#90EE90' },
- { value: 'pesticide', label: '施药', icon: '🚫', color: '#FF6347' },
- { value: 'transporting', label: '运输', icon: '🚚', color: '#708090' }
-] as const;
-
-export const OPERATION_STATUSES = [
- { value: 'pending', label: '待开始', color: '#d9d9d9', icon: '⏳' },
- { value: 'in_progress', label: '进行中', color: '#40a9ff', icon: '▶️' },
- { value: 'completed', label: '已完成', color: '#52c41a', icon: '✅' },
- { value: 'paused', label: '已暂停', color: '#faad14', icon: '⏸️' },
- { value: 'cancelled', label: '已取消', color: '#ff4d4f', icon: '❌' }
-] as const;
-
-export const OPERATION_QUALITY = [
- { value: 'excellent', label: '优秀', color: '#52c41a', score: 90 },
- { value: 'good', label: '良好', color: '#73d13d', score: 75 },
- { value: 'fair', label: '一般', color: '#faad14', score: 60 },
- { value: 'poor', label: '较差', color: '#ff4d4f', score: 40 }
-] as const;
-
-export const REPORT_TYPES = [
- { value: 'daily', label: '日报', period: '1day' },
- { value: 'weekly', label: '周报', period: '7days' },
- { value: 'monthly', label: '月报', period: '30days' },
- { value: 'custom', label: '自定义', period: 'custom' }
-] as const;
-
-export const OPERATION_THRESHOLDS = {
- efficiency: {
- excellent: 90,
- good: 75,
- fair: 60,
- poor: 40
- },
- fuelConsumption: {
- normal: 10,
- warning: 15,
- high: 20
- },
- duration: {
- maxHours: 12,
- warningHours: 10
- }
-};
-
-export const OPERATION_DATA_MOCK_DATA = [
- {
- id: '1',
- machineryId: 'tractor-001',
- machineryName: '约翰迪尔6M-1654拖拉机',
- operationType: 'plowing' as const,
- startTime: new Date(Date.now() - 7200000).toISOString(),
- endTime: new Date().toISOString(),
- duration: 120,
- areaWorked: 50,
- efficiency: 85,
- fuelConsumed: 15,
- operatorId: 'operator-001',
- operatorName: '张师傅',
- fieldId: 'field-001',
- fieldName: '1号田块',
- status: 'completed' as const,
- quality: 'good' as const
- },
- {
- id: '2',
- machineryId: 'seeder-001',
- machineryName: '精量播种机',
- operationType: 'seeding' as const,
- startTime: new Date(Date.now() - 3600000).toISOString(),
- duration: 60,
- areaWorked: 30,
- efficiency: 92,
- fuelConsumed: 8,
- operatorId: 'operator-002',
- operatorName: '李师傅',
- fieldId: 'field-002',
- fieldName: '2号田块',
- status: 'in_progress' as const,
- quality: 'excellent' as const
- }
-];
-
-export const OPERATION_CHART_MOCK_DATA = [
- {
- period: '2024-01-15',
- totalOperations: 12,
- completedOperations: 10,
- averageEfficiency: 85,
- totalArea: 450,
- fuelConsumption: 180
- },
- {
- period: '2024-01-16',
- totalOperations: 15,
- completedOperations: 13,
- averageEfficiency: 88,
- totalArea: 520,
- fuelConsumption: 195
- }
-];
-
-export const OPERATION_REPORT_MOCK_DATA = [
- {
- id: 'report-1',
- title: '2024年1月15日作业日报',
- type: 'daily' as const,
- period: '2024-01-15',
- generatedAt: new Date().toISOString(),
- data: OPERATION_CHART_MOCK_DATA[0],
- fileUrl: '/reports/daily-2024-01-15.pdf'
- },
- {
- id: 'report-2',
- title: '2024年第3周作业周报',
- type: 'weekly' as const,
- period: '2024-W03',
- generatedAt: new Date(Date.now() - 86400000).toISOString(),
- data: { weekly: 'summary' },
- fileUrl: '/reports/weekly-2024-W03.pdf'
- }
-];
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Monitoring/OperationData/index.css b/crop-x/src/pages/machinery/Monitoring/OperationData/index.css
deleted file mode 100644
index 9106cf1..0000000
--- a/crop-x/src/pages/machinery/Monitoring/OperationData/index.css
+++ /dev/null
@@ -1,92 +0,0 @@
-.operation-data {
- padding: 24px;
- background: #f5f5f5;
- min-height: 100vh;
-}
-
-.page-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 24px;
- padding: 16px;
- background: white;
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
-}
-
-.page-header h1 {
- font-size: 24px;
- font-weight: 600;
- color: #333;
- margin: 0;
-}
-
-.page-actions {
- display: flex;
- gap: 12px;
-}
-
-.page-actions button {
- padding: 8px 16px;
- border-radius: 4px;
- border: 1px solid #d9d9d9;
- background: white;
- cursor: pointer;
- transition: all 0.2s;
- font-size: 14px;
-}
-
-.page-actions button:hover {
- background: #f0f0f0;
- border-color: #40a9ff;
-}
-
-.page-content {
- display: flex;
- flex-direction: column;
- gap: 16px;
-}
-
-.charts-section {
- display: grid;
- grid-template-columns: 1fr 1fr;
- gap: 16px;
-}
-
-.loading-state,
-.error-state {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- height: 200px;
- color: #666;
-}
-
-.spinner {
- width: 40px;
- height: 40px;
- border: 4px solid #f3f3f3;
- border-top: 4px solid #40a9ff;
- border-radius: 50%;
- animation: spin 1s linear infinite;
- margin-bottom: 16px;
-}
-
-@keyframes spin {
- 0% { transform: rotate(0deg); }
- 100% { transform: rotate(360deg); }
-}
-
-@media (max-width: 768px) {
- .page-header {
- flex-direction: column;
- align-items: flex-start;
- gap: 16px;
- }
-
- .charts-section {
- grid-template-columns: 1fr;
- }
-}
diff --git a/crop-x/src/pages/machinery/Monitoring/OperationData/index.tsx b/crop-x/src/pages/machinery/Monitoring/OperationData/index.tsx
deleted file mode 100644
index f0a9e58..0000000
--- a/crop-x/src/pages/machinery/Monitoring/OperationData/index.tsx
+++ /dev/null
@@ -1,106 +0,0 @@
-import React from 'react';
-import { DataDashboard } from './components/DataDashboard';
-import { OperationChart } from './components/OperationChart';
-import { DataFilter } from './components/DataFilter';
-import { DataExport } from './components/DataExport';
-import { DataReport } from './components/DataReport';
-import { useOperationDataData } from './hooks/usePageData';
-import { useOperationDataActions } from './hooks/usePageActions';
-import './index.css';
-
-export function OperationData() {
- console.log('OperationData component rendered');
-
- const {
- operationData,
- charts,
- reports,
- loading,
- error,
- filters,
- refreshData
- } = useOperationDataData();
-
- const {
- handleFilter,
- handleExport,
- handleGenerateReport,
- handleDataRefresh
- } = useOperationDataActions(refreshData);
-
- if (loading) {
- return (
-
- );
- }
-
- if (error) {
- return (
-
- );
- }
-
- return (
-
-
-
作业数据监控
-
-
- 生成报告
-
-
- 导出数据
-
-
- 实时刷新
-
-
-
-
-
-
-
-
console.log('Data detail:', data)}
- />
-
-
-
-
-
-
-
-
-
-
-
- );
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Monitoring/OperationData/index.types.ts b/crop-x/src/pages/machinery/Monitoring/OperationData/index.types.ts
deleted file mode 100644
index 732d396..0000000
--- a/crop-x/src/pages/machinery/Monitoring/OperationData/index.types.ts
+++ /dev/null
@@ -1,92 +0,0 @@
-export interface OperationDataRecord {
- id: string;
- machineryId: string;
- machineryName: string;
- operationType: OperationType;
- startTime: string;
- endTime?: string;
- duration: number;
- areaWorked: number;
- efficiency: number;
- fuelConsumed: number;
- operatorId: string;
- operatorName: string;
- fieldId: string;
- fieldName: string;
- status: OperationStatus;
- quality: OperationQuality;
-}
-
-export type OperationType =
- | 'plowing'
- | 'seeding'
- | 'harvesting'
- | 'irrigation'
- | 'fertilizing'
- | 'pesticide'
- | 'transporting';
-
-export type OperationStatus = 'pending' | 'in_progress' | 'completed' | 'paused' | 'cancelled';
-
-export type OperationQuality = 'excellent' | 'good' | 'fair' | 'poor';
-
-export interface OperationDataFilters {
- machineryId?: string;
- operationType?: OperationType;
- status?: OperationStatus;
- operatorId?: string;
- fieldId?: string;
- quality?: OperationQuality;
- dateRange?: [string, string];
-}
-
-export interface OperationChart {
- period: string;
- totalOperations: number;
- completedOperations: number;
- averageEfficiency: number;
- totalArea: number;
- fuelConsumption: number;
-}
-
-export interface OperationReport {
- id: string;
- title: string;
- type: ReportType;
- period: string;
- generatedAt: string;
- data: any;
- fileUrl?: string;
-}
-
-export type ReportType = 'daily' | 'weekly' | 'monthly' | 'custom';
-
-export interface OperationDataComponentProps {
- data: OperationDataRecord[];
- charts: OperationChart[];
- reports: OperationReport[];
- onDetailClick?: (record: OperationDataRecord) => void;
- onExport?: (data: OperationDataRecord[]) => void;
- onGenerateReport?: (type: ReportType, period: string) => void;
-}
-
-export interface DataDashboardProps {
- data: OperationDataRecord[];
- onDetailClick?: (record: OperationDataRecord) => void;
-}
-
-export interface OperationChartProps {
- data: OperationChart[];
- title: string;
- type: 'line' | 'bar' | 'pie' | 'area';
-}
-
-export interface DataExportProps {
- data: OperationDataRecord[];
- onExport?: (data: OperationDataRecord[]) => void;
-}
-
-export interface DataReportProps {
- reports: OperationReport[];
- onGenerate?: (type: ReportType, period: string) => void;
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Monitoring/RealtimeLocation/index.css b/crop-x/src/pages/machinery/Monitoring/RealtimeLocation/index.css
deleted file mode 100644
index 7799a3f..0000000
--- a/crop-x/src/pages/machinery/Monitoring/RealtimeLocation/index.css
+++ /dev/null
@@ -1,182 +0,0 @@
-.realtime-location {
- padding: 24px;
- background: #f5f5f5;
- min-height: 100vh;
-}
-
-.page-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 24px;
- padding: 16px;
- background: white;
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
-}
-
-.header-left {
- display: flex;
- align-items: center;
- gap: 16px;
-}
-
-.page-header h1 {
- font-size: 24px;
- font-weight: 600;
- color: #333;
- margin: 0;
-}
-
-.connection-status {
- display: flex;
- align-items: center;
- gap: 8px;
- font-size: 14px;
- color: #666;
-}
-
-.status-indicator {
- width: 8px;
- height: 8px;
- border-radius: 50%;
- background: #d9d9d9;
-}
-
-.status-indicator.connected {
- background: #52c41a;
- box-shadow: 0 0 4px rgba(82, 196, 26, 0.5);
-}
-
-.status-indicator.disconnected {
- background: #ff4d4f;
- box-shadow: 0 0 4px rgba(255, 77, 79, 0.5);
-}
-
-.page-actions {
- display: flex;
- gap: 12px;
-}
-
-.page-actions button {
- padding: 8px 16px;
- border-radius: 4px;
- border: 1px solid #d9d9d9;
- background: white;
- cursor: pointer;
- transition: all 0.2s;
- font-size: 14px;
-}
-
-.page-actions button:hover {
- background: #f0f0f0;
- border-color: #40a9ff;
-}
-
-.location-content {
- display: flex;
- gap: 16px;
- height: calc(100vh - 200px);
-}
-
-.main-map {
- flex: 1;
- background: white;
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
- overflow: hidden;
-}
-
-.side-panel {
- width: 300px;
- background: white;
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
- overflow: hidden;
-}
-
-.history-panel,
-.alerts-panel {
- position: fixed;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- width: 800px;
- max-height: 600px;
- background: white;
- border-radius: 8px;
- box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
- z-index: 1000;
- overflow: hidden;
-}
-
-.panel-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 16px;
- border-bottom: 1px solid #f0f0f0;
- background: #fafafa;
-}
-
-.panel-header h3 {
- margin: 0;
- font-size: 16px;
- font-weight: 600;
- color: #333;
-}
-
-.panel-header button {
- background: none;
- border: none;
- font-size: 20px;
- color: #666;
- cursor: pointer;
- padding: 0;
- width: 24px;
- height: 24px;
- display: flex;
- align-items: center;
- justify-content: center;
-}
-
-.panel-header button:hover {
- color: #333;
-}
-
-/* 响应式设计 */
-@media (max-width: 1200px) {
- .location-content {
- flex-direction: column;
- height: auto;
- }
-
- .side-panel {
- width: 100%;
- height: 300px;
- }
-}
-
-@media (max-width: 768px) {
- .page-header {
- flex-direction: column;
- align-items: flex-start;
- gap: 16px;
- }
-
- .header-left {
- width: 100%;
- justify-content: space-between;
- }
-
- .page-actions {
- width: 100%;
- justify-content: flex-end;
- }
-
- .history-panel,
- .alerts-panel {
- width: 90vw;
- height: 80vh;
- }
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Monitoring/RealtimeLocation/index.tsx b/crop-x/src/pages/machinery/Monitoring/RealtimeLocation/index.tsx
deleted file mode 100644
index 032ec64..0000000
--- a/crop-x/src/pages/machinery/Monitoring/RealtimeLocation/index.tsx
+++ /dev/null
@@ -1,120 +0,0 @@
-import { useState, useEffect, useCallback } from 'react';
-import { MapView } from './components/MapView';
-import { MachineryTracker } from './components/MachineryTracker';
-import { LocationHistory } from './components/LocationHistory';
-import { GeofenceAlert } from './components/GeofenceAlert';
-import { useRealtimeLocationData } from './hooks/usePageData';
-import { useRealtimeLocationActions } from './hooks/usePageActions';
-import { useWebSocket } from './hooks/useWebSocket';
-import './index.css';
-
-export function RealtimeLocation() {
- const [selectedMachinery, setSelectedMachinery] = useState(null);
- const [showHistory, setShowHistory] = useState(false);
- const [showAlerts, setShowAlerts] = useState(false);
-
- const {
- machinery,
- locations,
- alerts,
- loading,
- error,
- filters,
- refreshData
- } = useRealtimeLocationData();
-
- const {
- handleCreateGeofence,
- handleDeleteGeofence,
- handleExportLocation,
- handleAcknowledgeAlert
- } = useRealtimeLocationActions(refreshData);
-
- const {
- isConnected,
- lastMessage,
- sendMessage
- } = useWebSocket();
-
- useEffect(() => {
- if (lastMessage) {
- // 处理实时位置更新
- console.log('收到WebSocket消息:', lastMessage);
- refreshData();
- }
- }, [lastMessage, refreshData]);
-
- return (
-
-
-
-
实时位置追踪
-
-
- {isConnected ? '实时连接' : '连接断开'}
-
-
-
- setShowAlerts(!showAlerts)}>
- 围栏告警 {alerts.length > 0 && `(${alerts.length})`}
-
- setShowHistory(!showHistory)}>
- 历史轨迹
-
-
- 导出数据
-
-
-
-
-
-
- {showHistory && (
-
-
-
历史轨迹
- setShowHistory(false)}>×
-
-
setShowHistory(false)}
- />
-
- )}
-
- {showAlerts && (
-
-
-
围栏告警
- setShowAlerts(false)}>×
-
-
setShowAlerts(false)}
- />
-
- )}
-
- );
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Monitoring/WorkStatus/components/StatusMonitor/index.css b/crop-x/src/pages/machinery/Monitoring/WorkStatus/components/StatusMonitor/index.css
deleted file mode 100644
index 1368477..0000000
--- a/crop-x/src/pages/machinery/Monitoring/WorkStatus/components/StatusMonitor/index.css
+++ /dev/null
@@ -1,234 +0,0 @@
-.status-monitor {
- background: white;
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
- padding: 24px;
-}
-
-.monitor-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 24px;
- padding-bottom: 16px;
- border-bottom: 1px solid #f0f0f0;
-}
-
-.monitor-header h3 {
- margin: 0;
- font-size: 18px;
- font-weight: 600;
- color: #333;
-}
-
-.overall-status {
- display: flex;
- align-items: center;
- gap: 8px;
- font-size: 14px;
- color: #666;
-}
-
-.status-indicator {
- width: 8px;
- height: 8px;
- border-radius: 50%;
-}
-
-.status-indicator.running {
- background: #52c41a;
- box-shadow: 0 0 4px rgba(82, 196, 26, 0.5);
-}
-
-.percentage {
- font-weight: 600;
- color: #52c41a;
-}
-
-.status-grid {
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
- gap: 16px;
- margin-bottom: 32px;
-}
-
-.status-card {
- display: flex;
- align-items: center;
- gap: 12px;
- padding: 16px;
- border-radius: 8px;
- border: 1px solid #f0f0f0;
- transition: all 0.2s;
-}
-
-.status-card:hover {
- border-color: #d9d9d9;
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
-}
-
-.status-icon {
- font-size: 24px;
-}
-
-.status-info {
- flex: 1;
-}
-
-.status-count {
- font-size: 24px;
- font-weight: 600;
- color: #333;
- line-height: 1;
-}
-
-.status-label {
- font-size: 14px;
- color: #666;
- margin-top: 4px;
-}
-
-.status-list h4 {
- margin: 0 0 16px 0;
- font-size: 16px;
- font-weight: 600;
- color: #333;
-}
-
-.list-container {
- max-height: 400px;
- overflow-y: auto;
-}
-
-.status-item {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 16px;
- border-bottom: 1px solid #f0f0f0;
- transition: background-color 0.2s;
-}
-
-.status-item:hover {
- background-color: #fafafa;
-}
-
-.status-item:last-child {
- border-bottom: none;
-}
-
-.item-left {
- display: flex;
- align-items: center;
- gap: 12px;
- flex: 1;
- min-width: 0;
-}
-
-.status-dot {
- width: 8px;
- height: 8px;
- border-radius: 50%;
- flex-shrink: 0;
-}
-
-.machinery-info {
- flex: 1;
- min-width: 0;
-}
-
-.machinery-name {
- font-weight: 500;
- color: #333;
- margin-bottom: 4px;
-}
-
-.machinery-details {
- display: flex;
- gap: 12px;
- font-size: 12px;
- color: #666;
-}
-
-.location,
-.operator {
- display: flex;
- align-items: center;
- gap: 4px;
-}
-
-.item-right {
- display: flex;
- flex-direction: column;
- align-items: flex-end;
- gap: 8px;
- flex-shrink: 0;
-}
-
-.status-text {
- font-size: 12px;
- font-weight: 500;
- padding: 2px 8px;
- border-radius: 12px;
- color: white;
-}
-
-.status-metrics {
- display: flex;
- gap: 8px;
- font-size: 11px;
- color: #666;
-}
-
-.metric {
- display: flex;
- align-items: center;
- gap: 2px;
-}
-
-.update-button {
- padding: 4px 8px;
- border-radius: 4px;
- border: 1px solid #d9d9d9;
- background: white;
- cursor: pointer;
- font-size: 11px;
- transition: all 0.2s;
-}
-
-.update-button:hover {
- background: #f0f0f0;
- border-color: #40a9ff;
- color: #40a9ff;
-}
-
-@media (max-width: 768px) {
- .status-monitor {
- padding: 16px;
- }
-
- .monitor-header {
- flex-direction: column;
- align-items: flex-start;
- gap: 12px;
- }
-
- .status-grid {
- grid-template-columns: 1fr 1fr;
- }
-
- .status-item {
- flex-direction: column;
- align-items: flex-start;
- gap: 12px;
- }
-
- .item-right {
- width: 100%;
- align-items: flex-start;
- }
-
- .status-metrics {
- flex-wrap: wrap;
- }
-}
diff --git a/crop-x/src/pages/machinery/Monitoring/WorkStatus/components/StatusMonitor/index.tsx b/crop-x/src/pages/machinery/Monitoring/WorkStatus/components/StatusMonitor/index.tsx
deleted file mode 100644
index b06d696..0000000
--- a/crop-x/src/pages/machinery/Monitoring/WorkStatus/components/StatusMonitor/index.tsx
+++ /dev/null
@@ -1,121 +0,0 @@
-import React from 'react';
-import { MachineryStatusRecord } from '../../index.types';
-import { getStatusColor, getStatusText } from '../../../utils/statusHelpers';
-import './index.css';
-
-interface StatusMonitorProps {
- machineryStatus: MachineryStatusRecord[];
- onStatusUpdate?: (status: MachineryStatusRecord) => void;
-}
-
-export function StatusMonitor({ machineryStatus, onStatusUpdate }: StatusMonitorProps) {
- const statusCounts = machineryStatus.reduce((acc, status) => {
- acc[status.status] = (acc[status.status] || 0) + 1;
- return acc;
- }, {} as Record);
-
- const totalMachinery = machineryStatus.length;
- const runningCount = statusCounts.running || 0;
- const idleCount = statusCounts.idle || 0;
- const maintenanceCount = statusCounts.maintenance || 0;
- const errorCount = statusCounts.error || 0;
- const offlineCount = statusCounts.offline || 0;
-
- const runningPercentage = totalMachinery > 0 ? (runningCount / totalMachinery * 100).toFixed(1) : '0';
-
- return (
-
-
-
设备状态总览
-
-
- {runningPercentage}% 设备在线运行
-
-
-
-
-
-
-
-
-
-
🟡
-
-
{maintenanceCount}
-
维护中
-
-
-
-
-
-
-
-
-
-
设备详细状态
-
- {machineryStatus.map((status) => (
-
-
-
-
-
{status.machineryName}
-
- 📍 {status.location}
- {status.operator && (
- 👤 {status.operator}
- )}
-
-
-
-
-
-
{getStatusText(status.status)}
-
- ⏱️ {status.workingHours}h
- ⛽ {status.fuelLevel}%
- 🌡️ {status.temperature}°C
-
- {onStatusUpdate && (
-
onStatusUpdate(status)}
- className="update-button"
- >
- 更新
-
- )}
-
-
- ))}
-
-
-
- );
-}
diff --git a/crop-x/src/pages/machinery/Monitoring/WorkStatus/components/StatusMonitor/types.ts b/crop-x/src/pages/machinery/Monitoring/WorkStatus/components/StatusMonitor/types.ts
deleted file mode 100644
index 606445e..0000000
--- a/crop-x/src/pages/machinery/Monitoring/WorkStatus/components/StatusMonitor/types.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-export interface StatusMonitorProps {
- machineryStatus: Array<{
- id: string;
- machineryId: string;
- machineryName: string;
- status: string;
- location: string;
- operator?: string;
- workingHours: number;
- fuelLevel: number;
- temperature: number;
- lastUpdateTime: string;
- }>;
- onStatusUpdate?: (status: any) => void;
-}
diff --git a/crop-x/src/pages/machinery/Monitoring/WorkStatus/constants.tsx b/crop-x/src/pages/machinery/Monitoring/WorkStatus/constants.tsx
deleted file mode 100644
index 13078fe..0000000
--- a/crop-x/src/pages/machinery/Monitoring/WorkStatus/constants.tsx
+++ /dev/null
@@ -1,100 +0,0 @@
-import React from 'react';
-
-export const WORK_STATUSES = [
- { value: 'running', label: '运行中', color: '#52c41a', icon: '🟢' },
- { value: 'idle', label: '空闲中', color: '#d9d9d9', icon: '⚪' },
- { value: 'maintenance', label: '维护中', color: '#faad14', icon: '🟡' },
- { value: 'error', label: '故障中', color: '#ff4d4f', icon: '🔴' },
- { value: 'offline', label: '离线', color: '#8c8c8c', icon: '⚫' }
-] as const;
-
-export const ALERT_TYPES = [
- { value: 'low_fuel', label: '燃油不足', severity: 'medium', icon: '⛽' },
- { value: 'high_temperature', label: '温度过高', severity: 'high', icon: '🌡️' },
- { value: 'maintenance_due', label: '需要维护', severity: 'low', icon: '🔧' },
- { value: 'error_code', label: '系统错误', severity: 'critical', icon: '❌' },
- { value: 'offline', label: '设备离线', severity: 'medium', icon: '📴' }
-] as const;
-
-export const ALERT_SEVERITIES = [
- { value: 'low', label: '低', color: '#52c41a', priority: 1 },
- { value: 'medium', label: '中', color: '#faad14', priority: 2 },
- { value: 'high', label: '高', color: '#ff7a45', priority: 3 },
- { value: 'critical', label: '严重', color: '#ff4d4f', priority: 4 }
-] as const;
-
-export const STATUS_UPDATE_INTERVAL = 30000; // 30 seconds
-export const ALERT_CHECK_INTERVAL = 10000; // 10 seconds
-
-export const WORK_STATUS_THRESHOLDS = {
- fuelLevel: {
- critical: 10,
- warning: 25,
- normal: 50
- },
- temperature: {
- critical: 90,
- warning: 75,
- normal: 60
- },
- workingHours: {
- maintenance: 500,
- warning: 450,
- normal: 400
- }
-};
-
-export const WORK_STATUS_MOCK_DATA = [
- {
- id: '1',
- machineryId: 'tractor-001',
- machineryName: '约翰迪尔6M-1654拖拉机',
- status: 'running' as const,
- location: '1号田块',
- operator: '张师傅',
- workingHours: 320,
- fuelLevel: 75,
- temperature: 65,
- lastUpdateTime: new Date().toISOString(),
- coordinates: {
- latitude: 39.9042,
- longitude: 116.4074
- }
- },
- {
- id: '2',
- machineryId: 'harvester-001',
- machineryName: '联合收割机',
- status: 'idle' as const,
- location: '停车场',
- workingHours: 180,
- fuelLevel: 15,
- temperature: 25,
- lastUpdateTime: new Date().toISOString(),
- coordinates: {
- latitude: 39.9042,
- longitude: 116.4074
- }
- }
-];
-
-export const STATUS_ALERT_MOCK_DATA = [
- {
- id: 'alert-1',
- machineryId: 'harvester-001',
- alertType: 'low_fuel' as const,
- severity: 'medium' as const,
- message: '燃油不足,请及时加油',
- timestamp: new Date().toISOString(),
- acknowledged: false
- },
- {
- id: 'alert-2',
- machineryId: 'tractor-001',
- alertType: 'maintenance_due' as const,
- severity: 'low' as const,
- message: '设备需要例行维护',
- timestamp: new Date(Date.now() - 3600000).toISOString(),
- acknowledged: true
- }
-];
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Monitoring/WorkStatus/hooks/usePageActions.tsx b/crop-x/src/pages/machinery/Monitoring/WorkStatus/hooks/usePageActions.tsx
deleted file mode 100644
index 2d45c49..0000000
--- a/crop-x/src/pages/machinery/Monitoring/WorkStatus/hooks/usePageActions.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import { useCallback } from 'react';
-import { MachineryStatusRecord, StatusAlert } from '../index.types';
-
-export function useWorkStatusActions(refreshData: () => void) {
- const handleStatusUpdate = useCallback(async (status: MachineryStatusRecord) => {
- try {
- console.log('Updating status:', status);
- await new Promise(resolve => setTimeout(resolve, 1000));
- refreshData();
- return { success: true };
- } catch (error) {
- return { success: false, error: '更新失败' };
- }
- }, [refreshData]);
-
- const handleAlertAcknowledge = useCallback(async (alertId: string) => {
- try {
- console.log('Acknowledging alert:', alertId);
- await new Promise(resolve => setTimeout(resolve, 500));
- refreshData();
- return { success: true };
- } catch (error) {
- return { success: false, error: '确认失败' };
- }
- }, [refreshData]);
-
- const handleFilter = useCallback((filters: any) => {
- console.log('Filtering status:', filters);
- }, []);
-
- const handleExport = useCallback(() => {
- console.log('Exporting status report');
- }, []);
-
- return {
- handleStatusUpdate,
- handleAlertAcknowledge,
- handleFilter,
- handleExport
- };
-}
diff --git a/crop-x/src/pages/machinery/Monitoring/WorkStatus/hooks/usePageData.tsx b/crop-x/src/pages/machinery/Monitoring/WorkStatus/hooks/usePageData.tsx
deleted file mode 100644
index 3c34bcf..0000000
--- a/crop-x/src/pages/machinery/Monitoring/WorkStatus/hooks/usePageData.tsx
+++ /dev/null
@@ -1,69 +0,0 @@
-import { useState, useEffect, useCallback } from 'react';
-import { MachineryStatusRecord, StatusAlert } from '../index.types';
-
-const MOCK_STATUS_DATA: MachineryStatusRecord[] = [
- {
- id: '1',
- machineryId: 'tractor-001',
- machineryName: '约翰迪尔6M-1654拖拉机',
- status: 'running',
- location: '1号田块',
- operator: '张师傅',
- workingHours: 320,
- fuelLevel: 75,
- temperature: 65,
- lastUpdateTime: new Date().toISOString(),
- coordinates: { latitude: 39.9042, longitude: 116.4074 }
- }
-];
-
-const MOCK_ALERTS: StatusAlert[] = [
- {
- id: 'alert-1',
- machineryId: 'harvester-001',
- alertType: 'low_fuel',
- severity: 'medium',
- message: '燃油不足,请及时加油',
- timestamp: new Date().toISOString(),
- acknowledged: false
- }
-];
-
-export function useWorkStatusData() {
- const [machineryStatus, setMachineryStatus] = useState([]);
- const [alerts, setAlerts] = useState([]);
- const [loading, setLoading] = useState(false);
- const [error, setError] = useState(null);
- const [filters, setFilters] = useState({});
-
- const fetchData = useCallback(async () => {
- setLoading(true);
- setError(null);
-
- try {
- await new Promise(resolve => setTimeout(resolve, 500));
- setMachineryStatus(MOCK_STATUS_DATA);
- setAlerts(MOCK_ALERTS);
- } catch (err) {
- const errorMessage = err instanceof Error ? err.message : '获取状态数据失败';
- setError(errorMessage);
- } finally {
- setLoading(false);
- }
- }, []);
-
- useEffect(() => {
- fetchData();
- const interval = setInterval(fetchData, 30000); // Update every 30 seconds
- return () => clearInterval(interval);
- }, [fetchData]);
-
- return {
- machineryStatus,
- alerts,
- loading,
- error,
- filters,
- refreshData: fetchData
- };
-}
diff --git a/crop-x/src/pages/machinery/Monitoring/WorkStatus/index.css b/crop-x/src/pages/machinery/Monitoring/WorkStatus/index.css
deleted file mode 100644
index 00bd277..0000000
--- a/crop-x/src/pages/machinery/Monitoring/WorkStatus/index.css
+++ /dev/null
@@ -1,93 +0,0 @@
-.work-status {
- padding: 24px;
- background: #f5f5f5;
- min-height: 100vh;
-}
-
-.page-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 24px;
- padding: 16px;
- background: white;
- border-radius: 8px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
-}
-
-.page-header h1 {
- font-size: 24px;
- font-weight: 600;
- color: #333;
- margin: 0;
-}
-
-.page-actions {
- display: flex;
- gap: 12px;
-}
-
-.page-actions button {
- padding: 8px 16px;
- border-radius: 4px;
- border: 1px solid #d9d9d9;
- background: white;
- cursor: pointer;
- transition: all 0.2s;
- font-size: 14px;
-}
-
-.page-actions button:hover {
- background: #f0f0f0;
- border-color: #40a9ff;
-}
-
-.page-content {
- display: flex;
- flex-direction: column;
- gap: 16px;
-}
-
-.status-overview {
- display: grid;
- grid-template-columns: 1fr 1fr;
- gap: 16px;
- margin-bottom: 16px;
-}
-
-.loading-state,
-.error-state {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- height: 200px;
- color: #666;
-}
-
-.spinner {
- width: 40px;
- height: 40px;
- border: 4px solid #f3f3f3;
- border-top: 4px solid #40a9ff;
- border-radius: 50%;
- animation: spin 1s linear infinite;
- margin-bottom: 16px;
-}
-
-@keyframes spin {
- 0% { transform: rotate(0deg); }
- 100% { transform: rotate(360deg); }
-}
-
-@media (max-width: 768px) {
- .page-header {
- flex-direction: column;
- align-items: flex-start;
- gap: 16px;
- }
-
- .status-overview {
- grid-template-columns: 1fr;
- }
-}
diff --git a/crop-x/src/pages/machinery/Monitoring/WorkStatus/index.tsx b/crop-x/src/pages/machinery/Monitoring/WorkStatus/index.tsx
deleted file mode 100644
index e9b6ae5..0000000
--- a/crop-x/src/pages/machinery/Monitoring/WorkStatus/index.tsx
+++ /dev/null
@@ -1,95 +0,0 @@
-import React from 'react';
-import { StatusMonitor } from './components/StatusMonitor';
-import { StatusChart } from './components/StatusChart';
-import { StatusDetails } from './components/StatusDetails';
-import { StatusAlert } from './components/StatusAlert';
-import { StatusFilter } from './components/StatusFilter';
-import { useWorkStatusData } from './hooks/usePageData';
-import { useWorkStatusActions } from './hooks/usePageActions';
-import './index.css';
-
-export function WorkStatus() {
- console.log('WorkStatus component rendered');
-
- const {
- machineryStatus,
- alerts,
- loading,
- error,
- filters,
- refreshData
- } = useWorkStatusData();
-
- const {
- handleStatusUpdate,
- handleAlertAcknowledge,
- handleFilter,
- handleExport
- } = useWorkStatusActions(refreshData);
-
- if (loading) {
- return (
-
- );
- }
-
- if (error) {
- return (
-
- );
- }
-
- return (
-
-
-
工作状态监控
-
-
- 导出报告
-
-
- 刷新数据
-
-
-
-
-
-
-
-
-
- console.log('Status clicked:', status)}
- />
-
-
-
-
-
-
-
- );
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Monitoring/WorkStatus/index.types.ts b/crop-x/src/pages/machinery/Monitoring/WorkStatus/index.types.ts
deleted file mode 100644
index 4f4b1cd..0000000
--- a/crop-x/src/pages/machinery/Monitoring/WorkStatus/index.types.ts
+++ /dev/null
@@ -1,81 +0,0 @@
-export interface MachineryStatusRecord {
- id: string;
- machineryId: string;
- machineryName: string;
- status: WorkStatus;
- location: string;
- operator?: string;
- workingHours: number;
- fuelLevel: number;
- temperature: number;
- lastUpdateTime: string;
- coordinates?: {
- latitude: number;
- longitude: number;
- };
-}
-
-export type WorkStatus =
- | 'running'
- | 'idle'
- | 'maintenance'
- | 'error'
- | 'offline';
-
-export interface StatusAlert {
- id: string;
- machineryId: string;
- alertType: AlertType;
- severity: AlertSeverity;
- message: string;
- timestamp: string;
- acknowledged: boolean;
-}
-
-export type AlertType =
- | 'low_fuel'
- | 'high_temperature'
- | 'maintenance_due'
- | 'error_code'
- | 'offline';
-
-export type AlertSeverity = 'low' | 'medium' | 'high' | 'critical';
-
-export interface WorkStatusFilters {
- status?: WorkStatus;
- machineryId?: string;
- alertType?: AlertType;
- severity?: AlertSeverity;
- dateRange?: [string, string];
-}
-
-export interface StatusChart {
- timestamp: string;
- running: number;
- idle: number;
- maintenance: number;
- error: number;
- offline: number;
-}
-
-export interface WorkStatusComponentProps {
- machineryStatus: MachineryStatusRecord[];
- alerts: StatusAlert[];
- onStatusUpdate?: (status: MachineryStatusRecord) => void;
- onAlertAcknowledge?: (alertId: string) => void;
-}
-
-export interface StatusMonitorProps {
- machineryStatus: MachineryStatusRecord[];
- onStatusUpdate?: (status: MachineryStatusRecord) => void;
-}
-
-export interface StatusChartProps {
- data: MachineryStatusRecord[];
- onStatusClick?: (status: WorkStatus) => void;
-}
-
-export interface StatusAlertProps {
- alerts: StatusAlert[];
- onAcknowledge?: (alertId: string) => void;
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Monitoring/WorkStatus/utils/statusHelpers.tsx b/crop-x/src/pages/machinery/Monitoring/WorkStatus/utils/statusHelpers.tsx
deleted file mode 100644
index 1cbbfc4..0000000
--- a/crop-x/src/pages/machinery/Monitoring/WorkStatus/utils/statusHelpers.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import { WorkStatus, AlertSeverity } from '../index.types';
-
-export function getStatusColor(status: WorkStatus): string {
- switch (status) {
- case 'running': return '#52c41a';
- case 'idle': return '#d9d9d9';
- case 'maintenance': return '#faad14';
- case 'error': return '#ff4d4f';
- case 'offline': return '#8c8c8c';
- default: return '#d9d9d9';
- }
-}
-
-export function getStatusText(status: WorkStatus): string {
- switch (status) {
- case 'running': return '运行中';
- case 'idle': return '空闲中';
- case 'maintenance': return '维护中';
- case 'error': return '故障中';
- case 'offline': return '离线';
- default: return '未知';
- }
-}
-
-export function getSeverityColor(severity: AlertSeverity): string {
- switch (severity) {
- case 'low': return '#52c41a';
- case 'medium': return '#faad14';
- case 'high': return '#ff7a45';
- case 'critical': return '#ff4d4f';
- default: return '#d9d9d9';
- }
-}
-
-export function formatWorkingHours(hours: number): string {
- if (hours < 1) {
- return `${Math.round(hours * 60)}分钟`;
- }
- return `${hours.toFixed(1)}小时`;
-}
-
-export function getFuelLevelColor(level: number): string {
- if (level < 10) return '#ff4d4f';
- if (level < 25) return '#faad14';
- return '#52c41a';
-}
diff --git a/crop-x/src/pages/machinery/Operation/Cockpit/index.css b/crop-x/src/pages/machinery/Operation/Cockpit/index.css
deleted file mode 100644
index e8623c5..0000000
--- a/crop-x/src/pages/machinery/Operation/Cockpit/index.css
+++ /dev/null
@@ -1,15 +0,0 @@
-.cockpit {
- padding: 16px;
- background: #1a1a1a;
- color: #fff;
- min-height: 100vh;
- font-family: 'Inter', system-ui, sans-serif;
-}
-.loading, .error {
- display: flex;
- align-items: center;
- justify-content: center;
- height: 100vh;
- color: #fff;
- font-size: 18px;
-}
diff --git a/crop-x/src/pages/machinery/Operation/Cockpit/index.tsx b/crop-x/src/pages/machinery/Operation/Cockpit/index.tsx
deleted file mode 100644
index 1a80766..0000000
--- a/crop-x/src/pages/machinery/Operation/Cockpit/index.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import React from 'react';
-import { CockpitDisplay } from './components/CockpitDisplay';
-import { OperationPanel } from './components/OperationPanel';
-import { NavigationDisplay } from './components/NavigationDisplay';
-import { StatusPanel } from './components/StatusPanel';
-import { VoiceAssistant } from './components/VoiceAssistant';
-import { AlertPanel } from './components/AlertPanel';
-import { QuickActions } from './components/QuickActions';
-import { useCockpitData } from './hooks/usePageData';
-import { useCockpitActions } from './hooks/usePageActions';
-import './index.css';
-
-export function Cockpit() {
- console.log('Cockpit component rendered');
-
- const { cockpitData, navigation, alerts, loading, error, refreshData } = useCockpitData();
- const { handleAction, voiceCommand, acknowledgeAlert } = useCockpitActions(refreshData);
-
- if (loading) return ;
- if (error) return ;
-
- return (
-
- );
-}
diff --git a/crop-x/src/pages/machinery/Operation/OperationRecord/constants.tsx b/crop-x/src/pages/machinery/Operation/OperationRecord/constants.tsx
deleted file mode 100644
index 096105c..0000000
--- a/crop-x/src/pages/machinery/Operation/OperationRecord/constants.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import React from 'react';
-
-export const OPERATION_TYPES = [
- '耕作', '播种', '收获', '灌溉', '施肥', '施药', '运输'
-] as const;
-
-export const OPERATION_STATUSES = [
- { value: 'pending', label: '待开始', color: '#d9d9d9' },
- { value: 'in_progress', label: '进行中', color: '#40a9ff' },
- { value: 'completed', label: '已完成', color: '#52c41a' }
-] as const;
-
-export const OPERATION_RECORD_MOCK_DATA = [
- {
- id: '1',
- machineryId: 'tractor-001',
- machineryName: '约翰迪尔拖拉机',
- operationType: '耕作',
- startTime: '2024-01-15T08:00:00Z',
- endTime: '2024-01-15T12:00:00Z',
- duration: 240,
- area: 50,
- efficiency: 85,
- operator: '张师傅',
- location: '1号田块',
- status: 'completed' as const,
- notes: '作业顺利',
- createdAt: '2024-01-15T08:00:00Z',
- updatedAt: '2024-01-15T12:00:00Z'
- }
-];
diff --git a/crop-x/src/pages/machinery/Operation/OperationRecord/index.css b/crop-x/src/pages/machinery/Operation/OperationRecord/index.css
deleted file mode 100644
index 6e82b05..0000000
--- a/crop-x/src/pages/machinery/Operation/OperationRecord/index.css
+++ /dev/null
@@ -1,7 +0,0 @@
-.operation-record { padding: 24px; background: #f5f5f5; min-height: 100vh; }
-.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding: 16px; background: white; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
-.page-header h1 { font-size: 24px; font-weight: 600; color: #333; margin: 0; }
-.page-actions { display: flex; gap: 12px; }
-.page-actions button { padding: 8px 16px; border-radius: 4px; border: 1px solid #d9d9d9; background: white; cursor: pointer; transition: all 0.2s; font-size: 14px; }
-.page-actions button:hover { background: #f0f0f0; border-color: #40a9ff; }
-.loading, .error { display: flex; align-items: center; justify-content: center; height: 200px; color: #666; }
diff --git a/crop-x/src/pages/machinery/Operation/OperationRecord/index.tsx b/crop-x/src/pages/machinery/Operation/OperationRecord/index.tsx
deleted file mode 100644
index 193ea05..0000000
--- a/crop-x/src/pages/machinery/Operation/OperationRecord/index.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import React from 'react';
-import { RecordForm } from './components/RecordForm';
-import { RecordList } from './components/RecordList';
-import { RecordTable } from './components/RecordTable';
-import { RecordDetails } from './components/RecordDetails';
-import { OperationChart } from './components/OperationChart';
-import { useOperationRecordData } from './hooks/usePageData';
-import { useOperationRecordActions } from './hooks/usePageActions';
-import './index.css';
-
-export function OperationRecord() {
- console.log('OperationRecord component rendered');
-
- const { records, loading, error, filters, refreshData } = useOperationRecordData();
- const { createRecord, updateRecord, deleteRecord, exportData } = useOperationRecordActions(refreshData);
-
- if (loading) return ;
- if (error) return ;
-
- return (
-
-
-
作业数据记录
-
- createRecord()}>新增记录
- 导出数据
-
-
-
{}} />
-
-
-
-
-
- );
-}
diff --git a/crop-x/src/pages/machinery/Operation/OperationRecord/index.types.ts b/crop-x/src/pages/machinery/Operation/OperationRecord/index.types.ts
deleted file mode 100644
index 7cf6a81..0000000
--- a/crop-x/src/pages/machinery/Operation/OperationRecord/index.types.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-export interface OperationRecordItem {
- id: string;
- machineryId: string;
- machineryName: string;
- operationType: string;
- startTime: string;
- endTime?: string;
- duration: number;
- area: number;
- efficiency: number;
- operator: string;
- location: string;
- status: 'pending' | 'in_progress' | 'completed';
- notes?: string;
- createdAt: string;
- updatedAt: string;
-}
-
-export interface OperationRecordFilters {
- machineryId?: string;
- operationType?: string;
- status?: string;
- operator?: string;
- dateRange?: [string, string];
-}
diff --git a/crop-x/src/pages/machinery/Operation/PlanDispatch/index.css b/crop-x/src/pages/machinery/Operation/PlanDispatch/index.css
deleted file mode 100644
index fd4d14d..0000000
--- a/crop-x/src/pages/machinery/Operation/PlanDispatch/index.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.plan-dispatch { padding: 24px; background: #f5f5f5; min-height: 100vh; }
-.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding: 16px; background: white; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
-.page-header h1 { font-size: 24px; font-weight: 600; color: #333; margin: 0; }
-.loading, .error { display: flex; align-items: center; justify-content: center; height: 200px; color: #666; }
diff --git a/crop-x/src/pages/machinery/Operation/PlanDispatch/index.tsx b/crop-x/src/pages/machinery/Operation/PlanDispatch/index.tsx
deleted file mode 100644
index d60320e..0000000
--- a/crop-x/src/pages/machinery/Operation/PlanDispatch/index.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import React from 'react';
-import { PlanList } from './components/PlanList';
-import { PlanForm } from './components/PlanForm';
-import { PlanTemplate } from './components/PlanTemplate';
-import { TaskAssignment } from './components/TaskAssignment';
-import { DispatchMonitor } from './components/DispatchMonitor';
-import { usePlanDispatchData } from './hooks/usePageData';
-import { usePlanDispatchActions } from './hooks/usePageActions';
-import './index.css';
-
-export function PlanDispatch() {
- console.log('PlanDispatch component rendered');
-
- const { plans, templates, dispatches, loading, error, refreshData } = usePlanDispatchData();
- const { createPlan, dispatchPlan, monitorExecution } = usePlanDispatchActions(refreshData);
-
- if (loading) return ;
- if (error) return ;
-
- return (
-
-
-
作业方案下发
- createPlan()}>创建方案
-
-
-
{}} />
- console.log('Selected template:', template)} />
-
-
-
- );
-}
diff --git a/crop-x/src/pages/machinery/Operation/RoutePlanning/index.css b/crop-x/src/pages/machinery/Operation/RoutePlanning/index.css
deleted file mode 100644
index c3d6632..0000000
--- a/crop-x/src/pages/machinery/Operation/RoutePlanning/index.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.route-planning { padding: 24px; background: #f5f5f5; min-height: 100vh; }
-.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding: 16px; background: white; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
-.page-header h1 { font-size: 24px; font-weight: 600; color: #333; margin: 0; }
-.loading, .error { display: flex; align-items: center; justify-content: center; height: 200px; color: #666; }
diff --git a/crop-x/src/pages/machinery/Operation/RoutePlanning/index.tsx b/crop-x/src/pages/machinery/Operation/RoutePlanning/index.tsx
deleted file mode 100644
index 41db7d9..0000000
--- a/crop-x/src/pages/machinery/Operation/RoutePlanning/index.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import React from 'react';
-import { RouteMap } from './components/RouteMap';
-import { RouteList } from './components/RouteList';
-import { RouteForm } from './components/RouteForm';
-import { RouteOptimizer } from './components/RouteOptimizer';
-import { NavigationGuide } from './components/NavigationGuide';
-import { useRoutePlanningData } from './hooks/usePageData';
-import { useRoutePlanningActions } from './hooks/usePageActions';
-import './index.css';
-
-export function RoutePlanning() {
- console.log('RoutePlanning component rendered');
-
- const { routes, fields, loading, error, refreshData } = useRoutePlanningData();
- const { createRoute, optimizeRoute, startNavigation } = useRoutePlanningActions(refreshData);
-
- if (loading) return ;
- if (error) return ;
-
- return (
-
-
-
作业路线规划
- createRoute()}>创建路线
-
-
-
-
{}} />
-
-
-
- );
-}
diff --git a/crop-x/src/pages/machinery/README.md b/crop-x/src/pages/machinery/README.md
deleted file mode 100644
index f362b95..0000000
--- a/crop-x/src/pages/machinery/README.md
+++ /dev/null
@@ -1,140 +0,0 @@
-# 农机管理模块 (Machinery)
-
-本模块包含农机管理的所有功能,按照AgriculturalMachinery模块页面结构示例.md构建。
-
-## 📁 目录结构
-
-```
-machinery/
-├── 📂 Archive/ # 农机档案模块
-│ ├── 📂 MachineryEntry/ # 农机档案录入与维护
-│ ├── 📂 MachineryClassification/ # 农机分类与标签管理
-│ └── 📂 MachineryQRCode/ # 农机二维码管理
-├── 📂 Driver/ # 驾驶员档案模块
-│ ├── 📂 DriverInfo/ # 驾驶员信息管理
-│ └── 📂 DriverTask/ # 驾驶员任务管理
-├── 📂 Load/ # 农机负载管理模块
-│ └── 📂 LoadDevice/ # 负载管理
-└── 📂 Monitoring/ # 设备实时监控与定位模块
- └── 📂 RealtimeLocation/ # 实时位置追踪
-```
-
-## 🏗️ 模块架构
-
-### 1. 农机档案 (Archive) 模块
-
-#### 1.1 农机档案录入与维护 (MachineryEntry)
-- **主组件**: `index.tsx`
-- **类型定义**: `index.types.ts`
-- **样式文件**: `index.css`
-- **常量定义**: `constants.tsx`
-- **Hooks**: `hooks/`
- - `usePageData.tsx` - 数据管理Hook
- - `usePageActions.tsx` - 操作Hook
- - `useMachineryForm.tsx` - 表单Hook
-- **工具函数**: `utils/`
- - `pageHelpers.tsx` - 页面工具函数
- - `formatters.tsx` - 格式化函数
- - `validators.tsx` - 验证函数
-- **组件**: `components/`
- - `MachineryForm/` - 农机表单组件
- - `MachineryList/` - 农机列表组件
- - `MachineryFilter/` - 筛选组件
- - `MachineryTable/` - 表格组件
- - `MachineryDetails/` - 详情组件
- - `TableActions/` - 表格操作组件
- - `Pagination/` - 分页组件
- - `SearchBar/` - 搜索栏组件
- - `StatusBadge/` - 状态标签组件
- - `common/` - 通用组件
-
-#### 1.2 农机分类与标签管理 (MachineryClassification)
-完整的分类管理功能,包括分类树、标签管理等组件。
-
-#### 1.3 农机二维码管理 (MachineryQRCode)
-完整的二维码生成、展示、批量打印功能。
-
-### 2. 驾驶员档案 (Driver) 模块
-
-#### 2.1 驾驶员信息管理 (DriverInfo)
-完整的驾驶员档案管理功能,包括证件管理、提醒功能等。
-
-#### 2.2 驾驶员任务管理 (DriverTask)
-完整的任务分配、追踪、绩效管理功能。
-
-### 3. 农机负载管理 (Load) 模块
-
-#### 3.1 负载管理 (LoadDevice)
-完整的负载设备管理、监控、告警功能。
-
-### 4. 设备实时监控与定位 (Monitoring) 模块
-
-#### 4.1 实时位置追踪 (RealtimeLocation)
-完整的实时位置追踪、历史轨迹、围栏告警功能,支持WebSocket实时更新。
-
-## 📋 文件统计
-
-- **总文件数**: 132个
-- **组件数**: 80+个
-- **模块数**: 6个子模块
-- **功能覆盖**: 完整覆盖农机管理所有业务场景
-
-## 🎯 开发规范
-
-### 组件结构规范
-- 每个页面都有完整的标准结构
-- 主组件 + 类型定义 + 样式 + Hooks + 工具函数 + 子组件
-- 组件拆分遵循单一职责原则
-
-### 代码质量
-- TypeScript类型安全
-- React Hooks最佳实践
-- 模块化设计
-- 可维护性强
-
-### 样式规范
-- 使用CSS模块化
-- 响应式设计
-- 统一的视觉风格
-- 良好的用户体验
-
-## 🔄 数据流
-
-```
-页面组件 → usePageData → Mock API → 数据处理
- ↓
- usePageActions → 操作处理 → 状态更新 → UI刷新
-```
-
-## 📱 功能特性
-
-- ✅ 完整的CRUD操作
-- ✅ 高级筛选和搜索
-- ✅ 分页和排序
-- ✅ 批量操作
-- ✅ 数据导出
-- ✅ 实时更新 (WebSocket)
-- ✅ 响应式设计
-- ✅ 错误处理
-- ✅ 加载状态
-
-## 🚀 使用方式
-
-每个模块都可以独立使用,遵循统一的接口规范:
-
-```typescript
-import { MachineryEntry } from './Archive/MachineryEntry';
-import { DriverInfo } from './Driver/DriverInfo';
-import { RealtimeLocation } from './Monitoring/RealtimeLocation';
-
-// 在路由中使用
-const routes = [
- {
- path: '/machinery/archive/entry',
- element:
- },
- // ...
-];
-```
-
-这个完整的machinery模块为智慧农业系统提供了全面的农机管理功能,代码结构清晰,易于维护和扩展。
\ No newline at end of file
diff --git a/crop-x/src/pages/machinery/Scheduling/RealtimeDispatch/index.css b/crop-x/src/pages/machinery/Scheduling/RealtimeDispatch/index.css
deleted file mode 100644
index 70e3252..0000000
--- a/crop-x/src/pages/machinery/Scheduling/RealtimeDispatch/index.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.realtime-dispatch { padding: 24px; background: #f5f5f5; min-height: 100vh; }
-.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding: 16px; background: white; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
-.page-header h1 { font-size: 24px; font-weight: 600; color: #333; margin: 0; }
-.loading, .error { display: flex; align-items: center; justify-content: center; height: 200px; color: #666; }
diff --git a/crop-x/src/pages/machinery/Scheduling/RealtimeDispatch/index.tsx b/crop-x/src/pages/machinery/Scheduling/RealtimeDispatch/index.tsx
deleted file mode 100644
index 00ff942..0000000
--- a/crop-x/src/pages/machinery/Scheduling/RealtimeDispatch/index.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import React from 'react';
-import { DispatchDashboard } from './components/DispatchDashboard';
-import { RealtimeMap } from './components/RealtimeMap';
-import { ScheduleTimeline } from './components/ScheduleTimeline';
-import { TaskTracker } from './components/TaskTracker';
-import { DispatchControl } from './components/DispatchControl';
-import { useRealtimeDispatchData } from './hooks/usePageData';
-import { useRealtimeDispatchActions } from './hooks/usePageActions';
-import './index.css';
-
-export function RealtimeDispatch() {
- console.log('RealtimeDispatch component rendered');
-
- const { dispatches, realtimeData, loading, error, refreshData } = useRealtimeDispatchData();
- const { updateDispatch, handleException, monitorProgress } = useRealtimeDispatchActions(refreshData);
-
- if (loading) return ;
- if (error) return ;
-
- return (
-
-
-
实时调度监控
- 刷新
-
-
-
-
-
-
-
- );
-}
diff --git a/crop-x/src/pages/machinery/Scheduling/TaskAssignment/index.css b/crop-x/src/pages/machinery/Scheduling/TaskAssignment/index.css
deleted file mode 100644
index 52f848f..0000000
--- a/crop-x/src/pages/machinery/Scheduling/TaskAssignment/index.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.task-assignment { padding: 24px; background: #f5f5f5; min-height: 100vh; }
-.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding: 16px; background: white; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
-.page-header h1 { font-size: 24px; font-weight: 600; color: #333; margin: 0; }
-.loading, .error { display: flex; align-items: center; justify-content: center; height: 200px; color: #666; }
diff --git a/crop-x/src/pages/machinery/Scheduling/TaskAssignment/index.tsx b/crop-x/src/pages/machinery/Scheduling/TaskAssignment/index.tsx
deleted file mode 100644
index d96ec5c..0000000
--- a/crop-x/src/pages/machinery/Scheduling/TaskAssignment/index.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import React from 'react';
-import { TaskPool } from './components/TaskPool';
-import { MachineryPool } from './components/MachineryPool';
-import { AssignmentMatrix } from './components/AssignmentMatrix';
-import { AssignmentForm } from './components/AssignmentForm';
-import { AssignmentOptimizer } from './components/AssignmentOptimizer';
-import { useTaskAssignmentData } from './hooks/usePageData';
-import { useTaskAssignmentActions } from './hooks/usePageActions';
-import './index.css';
-
-export function TaskAssignment() {
- console.log('TaskAssignment component rendered');
-
- const { tasks, machinery, assignments, loading, error, refreshData } = useTaskAssignmentData();
- const { assignTask, optimizeAssignment, updateAssignment } = useTaskAssignmentActions(refreshData);
-
- if (loading) return ;
- if (error) return ;
-
- return (
-
-
-
任务分配
- 优化分配
-
-
-
-
-
{}} />
-
-
- );
-}
diff --git a/crop-x/src/pages/machinery/Scheduling/TrackPlayback/index.css b/crop-x/src/pages/machinery/Scheduling/TrackPlayback/index.css
deleted file mode 100644
index ba4035d..0000000
--- a/crop-x/src/pages/machinery/Scheduling/TrackPlayback/index.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.track-playback { padding: 24px; background: #f5f5f5; min-height: 100vh; }
-.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding: 16px; background: white; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
-.page-header h1 { font-size: 24px; font-weight: 600; color: #333; margin: 0; }
-.loading, .error { display: flex; align-items: center; justify-content: center; height: 200px; color: #666; }
diff --git a/crop-x/src/pages/machinery/Scheduling/TrackPlayback/index.tsx b/crop-x/src/pages/machinery/Scheduling/TrackPlayback/index.tsx
deleted file mode 100644
index 9d2598d..0000000
--- a/crop-x/src/pages/machinery/Scheduling/TrackPlayback/index.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import React from 'react';
-import { PlaybackMap } from './components/PlaybackMap';
-import { PlaybackController } from './components/PlaybackController';
-import { TrackList } from './components/TrackList';
-import { TrackComparison } from './components/TrackComparison';
-import { TrackStatistics } from './components/TrackStatistics';
-import { useTrackPlaybackData } from './hooks/usePageData';
-import { useTrackPlaybackActions } from './hooks/usePageActions';
-import './index.css';
-
-export function TrackPlayback() {
- console.log('TrackPlayback component rendered');
-
- const { tracks, playbackData, loading, error, refreshData } = useTrackPlaybackData();
- const { startPlayback, pausePlayback, compareTracks, exportTrack } = useTrackPlaybackActions(refreshData);
-
- if (loading) return ;
- if (error) return ;
-
- return (
-
-
-
农机作业轨迹回放
- 导出轨迹
-
-
-
-
console.log('Selected track:', track)} />
-
-
-
- );
-}
diff --git a/crop-x/src/pages/machinery/Security/GeoFence/index.css b/crop-x/src/pages/machinery/Security/GeoFence/index.css
deleted file mode 100644
index 0c53c87..0000000
--- a/crop-x/src/pages/machinery/Security/GeoFence/index.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.geo-fence { padding: 24px; background: #f5f5f5; min-height: 100vh; }
-.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding: 16px; background: white; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
-.page-header h1 { font-size: 24px; font-weight: 600; color: #333; margin: 0; }
-.loading, .error { display: flex; align-items: center; justify-content: center; height: 200px; color: #666; }
diff --git a/crop-x/src/pages/machinery/Security/GeoFence/index.tsx b/crop-x/src/pages/machinery/Security/GeoFence/index.tsx
deleted file mode 100644
index fd93225..0000000
--- a/crop-x/src/pages/machinery/Security/GeoFence/index.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-import React from 'react';
-import { FenceMap } from './components/FenceMap';
-import { FenceList } from './components/FenceList';
-import { FenceForm } from './components/FenceForm';
-import { FenceEditor } from './components/FenceEditor';
-import { ViolationAlert } from './components/ViolationAlert';
-import { FenceMonitor } from './components/FenceMonitor';
-import { useGeoFenceData } from './hooks/usePageData';
-import { useGeoFenceActions } from './hooks/usePageActions';
-import './index.css';
-
-export function GeoFence() {
- console.log('GeoFence component rendered');
-
- const { fences, violations, loading, error, refreshData } = useGeoFenceData();
- const { createFence, updateFence, deleteFence, handleViolation } = useGeoFenceActions(refreshData);
-
- if (loading) return ;
- if (error) return ;
-
- return (
-
-
-
电子围栏
- createFence()}>创建围栏
-
-
-
-
{}} />
-
-
-
-
- );
-}
diff --git a/crop-x/src/pages/operation/FarmingEntry.css b/crop-x/src/pages/operation/FarmingEntry.css
deleted file mode 100644
index 906e468..0000000
--- a/crop-x/src/pages/operation/FarmingEntry.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 农事管理入口样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/operation/FarmingEntry.tsx b/crop-x/src/pages/operation/FarmingEntry.tsx
deleted file mode 100644
index 289ff2f..0000000
--- a/crop-x/src/pages/operation/FarmingEntry.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const FarmingEntry = () => {
- useEffect(() => {
- // TODO: 实现农事管理入口逻辑
- console.log('农事管理入口页面')
- }, [])
-
- return (
-
-
农事管理入口
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/operation/ResourceManagement.css b/crop-x/src/pages/operation/ResourceManagement.css
deleted file mode 100644
index eca34ee..0000000
--- a/crop-x/src/pages/operation/ResourceManagement.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 资源管理样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/operation/ResourceManagement.tsx b/crop-x/src/pages/operation/ResourceManagement.tsx
deleted file mode 100644
index 751950f..0000000
--- a/crop-x/src/pages/operation/ResourceManagement.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const ResourceManagement = () => {
- useEffect(() => {
- // TODO: 实现资源管理逻辑
- console.log('资源管理页面')
- }, [])
-
- return (
-
-
资源管理
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/operation/TaskAnalysis.css b/crop-x/src/pages/operation/TaskAnalysis.css
deleted file mode 100644
index 14230eb..0000000
--- a/crop-x/src/pages/operation/TaskAnalysis.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 任务分析样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/operation/TaskAnalysis.tsx b/crop-x/src/pages/operation/TaskAnalysis.tsx
deleted file mode 100644
index 034afda..0000000
--- a/crop-x/src/pages/operation/TaskAnalysis.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const TaskAnalysis = () => {
- useEffect(() => {
- // TODO: 实现任务分析逻辑
- console.log('任务分析页面')
- }, [])
-
- return (
-
-
任务分析
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/operation/TaskPlanning.css b/crop-x/src/pages/operation/TaskPlanning.css
deleted file mode 100644
index 023cb77..0000000
--- a/crop-x/src/pages/operation/TaskPlanning.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 任务规划样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/operation/TaskPlanning.tsx b/crop-x/src/pages/operation/TaskPlanning.tsx
deleted file mode 100644
index 21f8b56..0000000
--- a/crop-x/src/pages/operation/TaskPlanning.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const TaskPlanning = () => {
- useEffect(() => {
- // TODO: 实现任务规划逻辑
- console.log('任务规划页面')
- }, [])
-
- return (
-
-
任务规划
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/operation/TaskTracking.css b/crop-x/src/pages/operation/TaskTracking.css
deleted file mode 100644
index 73e0de9..0000000
--- a/crop-x/src/pages/operation/TaskTracking.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 任务跟踪样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/operation/TaskTracking.tsx b/crop-x/src/pages/operation/TaskTracking.tsx
deleted file mode 100644
index dbb9ed8..0000000
--- a/crop-x/src/pages/operation/TaskTracking.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const TaskTracking = () => {
- useEffect(() => {
- // TODO: 实现任务跟踪逻辑
- console.log('任务跟踪页面')
- }, [])
-
- return (
-
-
任务跟踪
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/src/pages/operation/WorkflowManagement.css b/crop-x/src/pages/operation/WorkflowManagement.css
deleted file mode 100644
index 6cb43d9..0000000
--- a/crop-x/src/pages/operation/WorkflowManagement.css
+++ /dev/null
@@ -1 +0,0 @@
-/* 工作流管理样式 */
\ No newline at end of file
diff --git a/crop-x/src/pages/operation/WorkflowManagement.tsx b/crop-x/src/pages/operation/WorkflowManagement.tsx
deleted file mode 100644
index 62563e6..0000000
--- a/crop-x/src/pages/operation/WorkflowManagement.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { useEffect } from 'react'
-
-export const WorkflowManagement = () => {
- useEffect(() => {
- // TODO: 实现工作流管理逻辑
- console.log('工作流管理页面')
- }, [])
-
- return (
-
-
工作流管理
-
- )
-}
\ No newline at end of file
diff --git a/crop-x/tsconfig.json b/crop-x/tsconfig.json
index b35a22e..933ad85 100644
--- a/crop-x/tsconfig.json
+++ b/crop-x/tsconfig.json
@@ -2,44 +2,83 @@
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
- "lib": ["ES2020", "DOM", "DOM.Iterable"],
+ "lib": [
+ "ES2020",
+ "DOM",
+ "DOM.Iterable"
+ ],
"module": "ESNext",
"skipLibCheck": true,
-
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
- "jsx": "react-jsx",
-
+ "jsx": "preserve",
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
-
/* Path mapping */
"baseUrl": ".",
"paths": {
- "@/*": ["./src/*"],
- "@config/*": ["./src/config/*"],
- "@router/*": ["./src/router/*"],
- "@api/*": ["./src/apis/*"],
- "@stores/*": ["./src/stores/*"],
- "@pages/*": ["./src/pages/*"],
- "@components/*": ["./src/components/*"],
- "@utils/*": ["./src/utils/*"],
- "@types/*": ["./src/types/*"],
- "@assets/*": ["./src/assets/*"]
- }
- },
- "include": ["src"],
- "references": [{ "path": "./tsconfig.node.json" }],
- "paths": {
"@/*": [
"./src/*"
+ ],
+ "@config/*": [
+ "./src/config/*"
+ ],
+ "@router/*": [
+ "./src/router/*"
+ ],
+ "@api/*": [
+ "./src/apis/*"
+ ],
+ "@stores/*": [
+ "./src/stores/*"
+ ],
+ "@pages/*": [
+ "src/app/*"
+ ],
+ "@components/*": [
+ "./src/components/*"
+ ],
+ "@utils/*": [
+ "./src/utils/*"
+ ],
+ "@types/*": [
+ "./src/types/*"
+ ],
+ "@assets/*": [
+ "./src/assets/*"
]
+ },
+ "allowJs": true,
+ "incremental": true,
+ "esModuleInterop": true,
+ "plugins": [
+ {
+ "name": "next"
+ }
+ ]
+ },
+ "include": [
+ "src",
+ ".next/types/**/*.ts"
+ ],
+ "references": [
+ {
+ "path": "./tsconfig.node.json"
}
-}
\ No newline at end of file
+ ],
+ "paths": {
+ "@/*": [
+ "./src/*"
+ ]
+ },
+ "exclude": [
+ "node_modules"
+ ]
+}
diff --git a/docs/Crop-X-项目完整技术架构方案-Next.js-AppRouter版本.md b/docs/Crop-X-项目完整技术架构方案-Next.js-AppRouter版本.md
new file mode 100644
index 0000000..920898f
--- /dev/null
+++ b/docs/Crop-X-项目完整技术架构方案-Next.js-AppRouter版本.md
@@ -0,0 +1,750 @@
+# Crop-X 项目完整技术架构方案 (Next.js App Router 版本)
+
+**Session Date:** 2025-10-16
+**Facilitator:** Business Analyst Mary
+**Project:** 智慧农业系统 crop-x 重构 (Next.js App Router 版本)
+
+---
+
+## 项目概述
+
+基于现有的智慧农业生产管理系统,在根目录下创建全新的 `crop-x` 项目,采用 **Next.js 14 App Router** + React 19 + Zustand + shadcn + Tailwind CSS 技术栈,实现现代化的路由系统、用户认证模块、API管理系统和完整的业务架构。
+
+## 技术栈
+
+- **前端框架**: Next.js 14 + React 19 + TypeScript
+- **构建工具**: Next.js 内置构建系统
+- **状态管理**: Zustand
+- **UI框架**: shadcn/ui + Tailwind CSS
+- **路由**: Next.js App Router
+- **HTTP客户端**: Axios
+- **图标**: Lucide React
+- **提示组件**: Sonner
+
+## Next.js App Router 目录结构
+
+```
+D:\code\repotest\smart-crop-ui\ # 原项目(保留不变)
+├── 📂 crop-x/ # 🆕 全新的重构项目 (Next.js App Router)
+│ ├── 📂 app/ # 🆕 Next.js App Router 页面组件 - 7大业务模块完整层级结构
+│ │ ├── 📄 layout.tsx # 🆕 根布局组件
+│ │ ├── 📄 page.tsx # 🆕 首页组件
+│ │ ├── 📄 loading.tsx # 🆕 全局加载组件
+│ │ ├── 📄 error.tsx # 🆕 全局错误组件
+│ │ ├── 📄 not-found.tsx # 🆕 404页面组件
+│ │ ├── 📂 (auth)/ # 🆕 认证路由组
+│ │ │ ├── 📄 layout.tsx # 认证布局
+│ │ │ ├── 📂 login/ # 登录页面
+│ │ │ │ └── 📄 page.tsx
+│ │ │ └── 📂 register/ # 注册页面
+│ │ │ └── 📄 page.tsx
+│ │ ├── 📂 agricultural-machinery/ # 🚙 智能农机管理系统页面
+│ │ │ ├── 📄 layout.tsx # 🆕 农机系统布局
+│ │ │ ├── 📄 page.tsx # 🆕 农机系统主页面
+│ │ │ ├── 📄 loading.tsx # 🆕 农机系统加载组件
+│ │ │ ├── 📄 error.tsx # 🆕 农机系统错误组件
+│ │ │ ├── 📂 archive/ # B级:农机档案
+│ │ │ │ ├── 📄 page.tsx # 🆕 档案主页
+│ │ │ │ ├── 📂 machinery-entry/ # C级:农机档案录入与维护
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 classification-management/ # C级:农机分类与标签管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 qr-code-management/ # C级:农机二维码管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 driver-archive/ # B级:驾驶员档案
+│ │ │ │ ├── 📄 page.tsx # 🆕 驾驶员档案主页
+│ │ │ │ ├── 📂 driver-info-management/ # C级:驾驶员信息管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 driver-task-management/ # C级:驾驶员任务管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 monitoring/ # B级:设备实时监控与定位
+│ │ │ │ ├── 📄 page.tsx # 🆕 监控主页
+│ │ │ │ ├── 📂 real-time-location-tracking/ # C级:实时位置追踪
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 work-status-monitoring/ # C级:工作状态监控
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 operation-data-monitoring/ # C级:作业数据监控
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 fault-diagnosis/ # B级:远程诊断与故障预警
+│ │ │ │ ├── 📄 page.tsx # 🆕 故障诊断主页
+│ │ │ │ ├── 📂 fault-warning/ # C级:故障诊断与预警
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 health-assessment/ # C级:健康评估
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 parameter-monitoring/ # C级:运行参数监测
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 precision-operation/ # B级:精准作业管理与支持
+│ │ │ │ ├── 📄 page.tsx # 🆕 精准作业主页
+│ │ │ │ ├── 📂 operation-record/ # C级:作业数据记录
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 route-planning/ # C级:作业路线规划
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 plan-dispatch/ # C级:作业方案下发
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 driving-cockpit/ # C级:农机驾驶舱
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 data-analysis/ # B级:数据管理与分析报告
+│ │ │ │ ├── 📄 page.tsx # 🆕 数据分析主页
+│ │ │ │ ├── 📂 operation-analysis/ # C级:作业数据分析
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 historical-data-comparison/ # C级:历史数据查询与对比
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 scheduling/ # B级:农机管理与调度
+│ │ │ │ ├── 📄 page.tsx # 🆕 调度管理主页
+│ │ │ │ ├── 📂 task-assignment/ # C级:任务分配
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 real-time-dispatch/ # C级:实时调度监控
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 track-playback/ # C级:农机作业轨迹回放
+│ │ │ │ └── 📄 page.tsx
+│ │ │ └── 📂 security/ # B级:安全与安防
+│ │ │ ├── 📄 page.tsx # 🆕 安全安防主页
+│ │ │ └── 📂 geo-fence/ # C级:电子围栏
+│ │ │ └── 📄 page.tsx
+│ │ ├── 📂 land-information/ # 🌾 地块信息管理系统页面
+│ │ │ ├── 📄 layout.tsx # 🆕 地块系统布局
+│ │ │ ├── 📄 page.tsx # 🆕 地块系统主页面
+│ │ │ ├── 📂 field-management/ # B级:地块档案管理
+│ │ │ │ ├── 📄 page.tsx # 🆕 地块档案主页
+│ │ │ │ ├── 📂 field-entry/ # C级:地块信息录入
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 classification-management/ # C级:地块分类管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 batch-operation/ # C级:批量操作
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 map-management/ # B级:地图管理
+│ │ │ │ ├── 📄 page.tsx # 🆕 地图管理主页
+│ │ │ │ ├── 📂 gis-data/ # C级:GIS数据管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 digital-drawing/ # C级:数字化绘制
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 spatial-query/ # C级:空间查询
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 satellite-imagery/ # C级:卫星影像管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 spatial-analysis/ # B级:空间分析
+│ │ │ │ ├── 📄 page.tsx # 🆕 空间分析主页
+│ │ │ │ ├── 📂 soil-data/ # C级:土壤数据分析
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 layered-sampling/ # C级:分层采样分析
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 quality-evaluation/ # C级:质量评价
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 environmental-monitoring/ # B级:环境监测
+│ │ │ │ ├── 📄 page.tsx # 🆕 环境监测主页
+│ │ │ │ ├── 📂 weather-data/ # C级:气象数据监测
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 sensor-data/ # C级:环境传感器数据
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 monitoring-history/ # C级:监测历史记录
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 suitability-evaluation/ # B级:适宜性评价
+│ │ │ │ ├── 📄 page.tsx # 🆕 适宜性评价主页
+│ │ │ │ ├── 📂 comprehensive-evaluation/ # C级:综合评价分析
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 batch-analysis/ # C级:批量分析
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 crop-recommendation/ # C级:作物推荐分析
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 weight-configuration/ # C级:权重配置管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 comparative-analysis/ # B级:对比分析
+│ │ │ │ ├── 📄 page.tsx # 🆕 对比分析主页
+│ │ │ │ ├── 📂 multi-dimensional-metrics/ # C级:多维指标分析
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 chart-analysis/ # C级:图表分析展示
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 report-generation/ # C级:报告生成管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ └── 📂 risk-warning/ # B级:风险预警
+│ │ │ ├── 📄 page.tsx # 🆕 风险预警主页
+│ │ │ ├── 📂 real-time-monitoring/ # C级:实时监测预警
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 early-warning-push/ # C级:预警信息推送
+│ │ │ │ └── 📄 page.tsx
+│ │ │ └── 📂 disposal-tracking/ # C级:处置情况跟踪
+│ │ │ └── 📄 page.tsx
+│ │ ├── 📂 farming-operation/ # 📋 农事操作管理系统页面
+│ │ │ ├── 📄 layout.tsx # 🆕 农事系统布局
+│ │ │ ├── 📄 page.tsx # 🆕 农事系统主页面
+│ │ │ ├── 📂 farm-planning/ # B级:农事计划管理
+│ │ │ │ ├── 📄 page.tsx # 🆕 农事计划主页
+│ │ │ │ ├── 📂 plan-formulation/ # C级:计划制定
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 resource-allocation/ # C级:资源分配管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 progress-tracking/ # C级:进度跟踪管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 task-management/ # B级:农事任务管理
+│ │ │ │ ├── 📄 page.tsx # 🆕 农事任务主页
+│ │ │ │ ├── 📂 task-creation/ # C级:任务创建管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 task-assignment/ # C级:任务分配派发
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 task-status-monitoring/ # C级:任务状态监控
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 task-history-statistics/ # C级:任务历史统计
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 operation-execution/ # B级:农事执行管理
+│ │ │ │ ├── 📄 page.tsx # 🆕 农事执行主页
+│ │ │ │ ├── 📂 operation-type-management/ # C级:操作类型管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 operation-recording/ # C级:操作记录管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 operation-log-query/ # C级:操作日志查询
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 farming-calendar/ # B级:农事日历管理
+│ │ │ │ ├── 📄 page.tsx # 🆕 农事日历主页
+│ │ │ │ ├── 📂 calendar-visualization/ # C级:日历可视化视图
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 gantt-chart-management/ # C级:甘特图管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 progress-visualization/ # C级:进度可视化
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 operation-archive/ # B级:农事档案管理
+│ │ │ │ ├── 📄 page.tsx # 🆕 农事档案主页
+│ │ │ │ ├── 📂 archive-generation/ # C级:档案归集生成
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 full-dimension-view/ # C级:全维视图管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 traceability-tracking/ # C级:追踪溯源管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 knowledge-base/ # B级:知识库管理
+│ │ │ │ ├── 📄 page.tsx # 🆕 知识库主页
+│ │ │ │ ├── 📂 content-management/ # C级:内容管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 classification-tagging/ # C级:分类标签管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 intelligent-search/ # C级:智能检索功能
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 performance-management/ # B级:绩效管理
+│ │ │ │ ├── 📄 page.tsx # 🆕 绩效管理主页
+│ │ │ │ ├── 📂 personnel-management/ # C级:人员管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 work-hour-recording/ # C级:工时记录管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 statistical-reports/ # C级:统计报表管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 scheduling-management/ # C级:排班管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ └── 📂 issue-collaboration/ # B级:问题协同管理
+│ │ │ ├── 📄 page.tsx # 🆕 问题协同主页
+│ │ │ ├── 📂 issue-reporting/ # C级:问题上报管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 processing-assignment/ # C级:处理分派管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ └── 📂 online-collaboration/ # C级:在线协作功能
+│ │ │ └── 📄 page.tsx
+│ │ ├── 📂 agricultural-asset/ # 📦 农业资产管理系统页面
+│ │ │ ├── 📄 layout.tsx # 🆕 资产系统布局
+│ │ │ ├── 📄 page.tsx # 🆕 资产系统主页面
+│ │ │ ├── 📂 basic-information/ # B级:基础信息管理
+│ │ │ │ ├── 📄 page.tsx # 🆕 基础信息主页
+│ │ │ │ ├── 📂 asset-entry/ # C级:资产信息录入
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 asset-classification/ # C级:资产分类管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 asset-labeling/ # C级:资产标签管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 procurement-management/ # B级:采购管理
+│ │ │ │ ├── 📄 page.tsx # 🆕 采购管理主页
+│ │ │ │ ├── 📂 procurement-planning/ # C级:采购计划制定
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 supplier-management/ # C级:供应商管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 procurement-tracking/ # C级:采购跟踪管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 inventory-management/ # B级:库存管理
+│ │ │ │ ├── 📄 page.tsx # 🆕 库存管理主页
+│ │ │ │ ├── 📂 stock-monitoring/ # C级:库存监控管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 stock-adjustment/ # C级:库存调整管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 inventory-report/ # C级:库存报表管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 material-requisition/ # B级:物资领用管理
+│ │ │ │ ├── 📄 page.tsx # 🆕 物资领用主页
+│ │ │ │ ├── 📂 requisition-application/ # C级:领用申请管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 approval-workflow/ # C级:审批流程管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 requisition-tracking/ # C级:领用跟踪管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 material-return/ # B级:物资归还管理
+│ │ │ │ ├── 📄 page.tsx # 🆕 物资归还主页
+│ │ │ │ ├── 📂 return-application/ # C级:归还申请管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 return-approval/ # C级:归还审批管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 return-tracking/ # C级:归还跟踪管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 agricultural-supplies/ # B级:农资农具管理
+│ │ │ │ ├── 📄 page.tsx # 🆕 农资农具主页
+│ │ │ │ ├── 📂 tool-management/ # C级:农具管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 material-management/ # C级:农资管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 maintenance-tracking/ # C级:维护跟踪管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ └── 📂 visualization-reports/ # B级:可视化报表
+│ │ │ ├── 📄 page.tsx # 🆕 可视化报表主页
+│ │ │ ├── 📂 asset-statement/ # C级:资产报表管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 inventory-statement/ # C级:库存报表管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ └── 📂 cost-analysis/ # C级:成本分析管理
+│ │ │ └── 📄 page.tsx
+│ │ ├── 📂 ai-crop-model/ # 🤖 AI作物模型精准决策系统页面
+│ │ │ ├── 📄 layout.tsx # 🆕 AI模型系统布局
+│ │ │ ├── 📄 page.tsx # 🆕 AI模型系统主页面
+│ │ │ ├── 📂 data-perception-center/ # B级:数据感知中心
+│ │ │ │ ├── 📄 page.tsx # 🆕 数据感知主页
+│ │ │ │ ├── 📂 real-time-data-collection/ # C级:实时数据采集
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 historical-data-analysis/ # C级:历史数据分析
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 multi-source-data-fusion/ # C级:多源数据融合
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 model-integration-center/ # B级:模型接入集成中心
+│ │ │ │ ├── 📄 page.tsx # 🆕 模型集成主页
+│ │ │ │ ├── 📂 model-access-management/ # C级:模型接入管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 model-version-control/ # C级:模型版本控制
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 api-service-integration/ # C级:API服务集成
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 model-application-center/ # B级:模型应用中心
+│ │ │ │ ├── 📄 page.tsx # 🆕 模型应用主页
+│ │ │ │ ├── 📂 prediction-analysis/ # C级:预测分析管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 optimization-recommendation/ # C级:优化建议管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 scenario-simulation/ # C级:场景模拟管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 intelligent-decision-generation/ # B级:智能决策生成
+│ │ │ │ ├── 📄 page.tsx # 🆕 智能决策主页
+│ │ │ │ ├── 📂 decision-engine/ # C级:决策引擎管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 rule-configuration/ # C级:规则配置管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 decision-optimization/ # C级:决策优化管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 intelligent-decision-support/ # B级:智能决策支持
+│ │ │ │ ├── 📄 page.tsx # 🆕 智能决策支持主页
+│ │ │ │ ├── 📂 decision-visualization/ # C级:决策可视化
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 impact-assessment/ # C级:影响评估管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 decision-tracking/ # C级:决策跟踪管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 decision-application/ # B级:决策应用
+│ │ │ │ ├── 📄 page.tsx # 🆕 决策应用主页
+│ │ │ │ ├── 📂 automatic-execution/ # C级:自动执行管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 manual-adjustment/ # C级:手动调整管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 feedback-collection/ # C级:反馈收集管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 ai-knowledge-base/ # B级:AI知识库
+│ │ │ │ ├── 📄 page.tsx # 🆕 AI知识库主页
+│ │ │ │ ├── 📂 model-documentation/ # C级:模型文档管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 case-database/ # C级:案例数据库管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 expert-system/ # C级:专家系统管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ └── 📂 monitoring-center/ # B级:监控中心
+│ │ │ ├── 📄 page.tsx # 🆕 监控中心主页
+│ │ │ ├── 📂 model-performance/ # C级:模型性能监控
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 decision-quality/ # C级:决策质量监控
+│ │ │ │ └── 📄 page.tsx
+│ │ │ └── 📂 system-health/ # C级:系统健康监控
+│ │ │ └── 📄 page.tsx
+│ │ ├── 📂 water-fertilizer-control/ # 💧 水肥一体化控制系统页面
+│ │ │ ├── 📄 layout.tsx # 🆕 水肥控制布局
+│ │ │ ├── 📄 page.tsx # 🆕 水肥控制主页面
+│ │ │ ├── 📂 irrigation-system-management/ # B级:水肥机管理
+│ │ │ │ ├── 📄 page.tsx # 🆕 水肥机管理主页
+│ │ │ │ ├── 📂 device-registration/ # C级:设备注册管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 status-monitoring/ # C级:状态监控管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 maintenance-management/ # C级:维护管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 smart-irrigation/ # B级:智能灌溉
+│ │ │ │ ├── 📄 page.tsx # 🆕 智能灌溉主页
+│ │ │ │ ├── 📂 irrigation-planning/ # C级:灌溉计划管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 automated-control/ # C级:自动控制管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 irrigation-optimization/ # C级:灌溉优化管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 fertilizer-formula-management/ # B级:施肥配方管理
+│ │ │ │ ├── 📄 page.tsx # 🆕 施肥配方主页
+│ │ │ │ ├── 📂 formula-configuration/ # C级:配方配置管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 crop-specific-formulas/ # C级:作物专用配方
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 formula-optimization/ # C级:配方优化管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 integrated-control/ # B级:水肥一体化控制
+│ │ │ │ ├── 📄 page.tsx # 🆕 水肥一体化主页
+│ │ │ │ ├── 📂 synchronized-control/ # C级:同步控制管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ ├── 📂 precision-application/ # C级:精准施用管理
+│ │ │ │ │ └── 📄 page.tsx
+│ │ │ │ └── 📂 real-time-adjustment/ # C级:实时调整管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ └── 📂 real-time-monitoring/ # B级:实时监测与预警
+│ │ │ ├── 📄 page.tsx # 🆕 实时监测主页
+│ │ │ ├── 📂 parameter-display/ # C级:参数显示管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 warning-system/ # C级:预警系统管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ └── 📂 historical-analysis/ # C级:历史分析管理
+│ │ │ └── 📄 page.tsx
+│ │ └── 📂 central-config/ # ⚙️ 中心配置管理系统页面
+│ │ ├── 📄 layout.tsx # 🆕 配置系统布局
+│ │ ├── 📄 page.tsx # 🆕 配置系统主页面
+│ │ ├── 📂 tenant-management/ # B级:租户管理
+│ │ │ ├── 📄 page.tsx # 🆕 租户管理主页
+│ │ │ ├── 📂 tenant-creation/ # C级:租户创建管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 tenant-configuration/ # C级:租户配置管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ └── 📂 tenant-authorization/ # C级:租户授权管理
+│ │ │ └── 📄 page.tsx
+│ │ ├── 📂 user-management/ # B级:用户管理
+│ │ │ ├── 📄 page.tsx # 🆕 用户管理主页
+│ │ │ ├── 📂 user-account-management/ # C级:用户账号管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 role-permission-management/ # C级:角色权限管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ └── 📂 user-behavior-tracking/ # C级:用户行为跟踪
+│ │ │ └── 📄 page.tsx
+│ │ ├── 📂 system-parameters/ # B级:系统参数
+│ │ │ ├── 📄 page.tsx # 🆕 系统参数主页
+│ │ │ ├── 📂 basic-configuration/ # C级:基础配置管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 business-rule-settings/ # C级:业务规则设置
+│ │ │ │ └── 📄 page.tsx
+│ │ │ └── 📂 interface-configuration/ # C级:接口配置管理
+│ │ │ └── 📄 page.tsx
+│ │ ├── 📂 system-monitoring/ # B级:系统监控
+│ │ │ ├── 📄 page.tsx # 🆕 系统监控主页
+│ │ │ ├── 📂 performance-monitoring/ # C级:性能监控管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ ├── 📂 log-management/ # C级:日志管理
+│ │ │ │ └── 📄 page.tsx
+│ │ │ └── 📂 exception-handling/ # C级:异常处理管理
+│ │ │ └── 📄 page.tsx
+│ │ └── 📂 message-center/ # B级:消息中心
+│ │ ├── 📄 page.tsx # 🆕 消息中心主页
+│ │ ├── 📂 message-push-management/ # C级:消息推送管理
+│ │ │ └── 📄 page.tsx
+│ │ ├── 📂 notification-settings/ # C级:通知设置管理
+│ │ │ └── 📄 page.tsx
+│ │ └── 📂 feedback-management/ # C级:反馈管理
+│ │ └── 📄 page.tsx
+│ ├── 📂 components/ # 组件库
+│ │ ├── 📂 ui/ # 基础UI组件(shadcn)
+│ │ ├── 📂 layout/ # 布局组件
+│ │ │ ├── 📄 Header.tsx # 顶部导航
+│ │ │ ├── 📄 Sidebar.tsx # 侧边栏
+│ │ │ └── 📄 MainLayout.tsx # 主布局
+│ │ ├── 📂 common/ # 通用业务组件
+│ │ └── 📂 business/ # 业务组件
+│ ├── 📂 lib/ # 🆕 工具库 (Next.js 标准)
+│ │ ├── 📄 utils.ts # 工具函数
+│ │ ├── 📄 validations.ts # 表单验证
+│ │ ├── 📄 constants.ts # 常量定义
+│ │ └── 📄 helpers.ts # 辅助函数
+│ ├── 📂 hooks/ # 自定义Hooks
+│ │ ├── 📄 useAuth.ts # 认证Hook
+│ │ ├── 📄 usePermission.ts # 权限Hook
+│ │ └── 📄 useRouterParams.ts # 路由参数Hook
+│ ├── 📂 store/ # Zustand状态管理
+│ │ ├── 📄 authStore.ts # 认证状态管理
+│ │ ├── 📄 globalStore.ts # 全局状态管理
+│ │ └── 📂 [modules]/ # 各业务模块状态管理
+│ ├── 📂 types/ # TypeScript类型
+│ │ ├── 📄 auth.ts # 认证类型
+│ │ ├── 📄 navigation.ts # 导航类型
+│ │ └── 📄 business.ts # 业务类型
+│ ├── 📂 styles/ # 样式文件
+│ │ ├── 📄 globals.css # 全局样式
+│ │ └── 📄 components.css # 组件样式
+│ ├── 📂 public/ # 🆕 静态资源目录
+│ │ ├── 📄 favicon.ico # 网站图标
+│ │ ├── 📄 logo.png # 应用Logo
+│ │ ├── 📄 manifest.json # PWA配置文件
+│ │ └── 📂 images/ # 图片资源
+│ ├── 📂 config/ # 🆕 特性优先配置系统
+│ │ ├── 📂 types/ # 配置类型定义
+│ │ ├── 📂 environments/ # 环境配置
+│ │ ├── 📂 features/ # 特性配置
+│ │ └── 📄 config-manager.ts # 配置管理器
+│ ├── 📂 apis/ # 🆕 API管理系统
+│ │ ├── 📄 index.ts # API统一入口
+│ │ ├── 📄 interceptor.ts # 请求拦截器
+│ │ └── 📂 subModules/ # 7大业务模块API
+│ ├── 📄 package.json # 项目配置
+│ ├── 📄 next.config.js # Next.js 配置
+│ ├── 📄 tailwind.config.js # Tailwind 配置
+│ ├── 📄 tsconfig.json # TypeScript 配置
+│ ├── 📄 .eslintrc.js # ESLint 配置
+│ ├── 📄 .prettierrc # Prettier 配置
+│ └── 📄 README.md # 项目说明
+```
+
+## Next.js App Router 核心特性
+
+### 1. 路由系统变更
+
+**原 React Router 系统** → **Next.js App Router 系统**
+
+```typescript
+// 原路由方式 (React Router)
+/agricultural-machinery/archive/machinery-entry
+
+// 新路由方式 (Next.js App Router)
+/agricultural-machinery/archive/machinery-entry
+```
+
+### 2. 文件命名规范
+
+| React Router | Next.js App Router | 说明 |
+|-------------|-------------------|------|
+| `index.jsx` | `page.tsx` | 页面组件 |
+| - | `layout.tsx` | 布局组件 |
+| - | `loading.tsx` | 加载组件 |
+| - | `error.tsx` | 错误组件 |
+| - | `not-found.tsx` | 404页面 |
+| - | `route.ts` | API路由 |
+
+### 3. 布局系统
+
+Next.js App Router 提供了嵌套布局系统:
+
+```typescript
+// app/layout.tsx - 根布局
+export default function RootLayout({ children }: { children: React.ReactNode }) {
+ return (
+
+
+ {children}
+
+
+ );
+}
+
+// app/agricultural-machinery/layout.tsx - 农机系统布局
+export default function MachineryLayout({ children }: { children: React.ReactNode }) {
+ return (
+
+ );
+}
+```
+
+### 4. 路由组和权限控制
+
+使用路由组 `(auth)` 实现权限控制:
+
+```typescript
+// app/(auth)/layout.tsx - 认证布局
+export default function AuthLayout({ children }: { children: React.ReactNode }) {
+ return (
+
+ {children}
+
+ );
+}
+
+// app/(auth)/login/page.tsx - 登录页面
+export default function LoginPage() {
+ return ;
+}
+```
+
+### 5. 数据获取方式
+
+```typescript
+// Server Components - 服务器端数据获取
+async function getMachineryData() {
+ const res = await fetch('http://localhost:8080/api/machinery', {
+ cache: 'no-store'
+ });
+ return res.json();
+}
+
+export default async function MachineryPage() {
+ const data = await getMachineryData();
+ return ;
+}
+
+// Client Components - 客户端数据获取
+'use client';
+
+import { useState, useEffect } from 'react';
+
+export default function MachineryPage() {
+ const [data, setData] = useState([]);
+
+ useEffect(() => {
+ fetch('/api/machinery')
+ .then(res => res.json())
+ .then(setData);
+ }, []);
+
+ return ;
+}
+```
+
+### 6. API路由
+
+```typescript
+// app/api/machinery/route.ts
+import { NextRequest, NextResponse } from 'next/server';
+
+export async function GET(request: NextRequest) {
+ // 获取农机列表
+ return NextResponse.json({ machinery: [] });
+}
+
+export async function POST(request: NextRequest) {
+ // 创建农机
+ const body = await request.json();
+ return NextResponse.json({ success: true });
+}
+```
+
+### 7. 错误处理
+
+```typescript
+// app/error.tsx - 全局错误处理
+'use client';
+
+export default function Error({ error, reset }: { error: Error; reset: () => void }) {
+ return (
+
+
出现了错误!
+ reset()}>重试
+
+ );
+}
+
+// app/agricultural-machinery/error.tsx - 农机系统错误处理
+export default function MachineryError({ error }: { error: Error }) {
+ return (
+
+
农机系统错误
+
{error.message}
+
+ );
+}
+```
+
+### 8. 加载状态
+
+```typescript
+// app/agricultural-machinery/loading.tsx
+export default function MachineryLoading() {
+ return (
+
+ );
+}
+```
+
+## Next.js App Router 优势
+
+### 1. **性能优化**
+- 自动代码分割
+- 服务器组件渲染
+- 客户端组件按需加载
+- 流式渲染支持
+
+### 2. **SEO 友好**
+- 服务器端渲染 (SSR)
+- 静态站点生成 (SSG)
+- 增量静态再生 (ISR)
+
+### 3. **开发体验**
+- 文件系统路由
+- 内置类型安全
+- 热模块替换
+- 快速刷新
+
+### 4. **布局系统**
+- 嵌套布局
+- 共享布局
+- 路由组
+- 并行路由
+
+## 迁移指南
+
+### 从 React Router 到 Next.js App Router
+
+1. **目录结构迁移**
+ ```
+ pages/ → app/
+ index.jsx → page.tsx
+ ```
+
+2. **路由配置移除**
+ ```typescript
+ // 移除 React Router 配置
+ // 删除 router/index.js
+ // 删除路由守卫组件
+ ```
+
+3. **布局组件重构**
+ ```typescript
+ // 原 Layout.jsx
+ export default function Layout({ children }) {
+ return {children}
;
+ }
+
+ // 新 layout.tsx
+ export default function RootLayout({ children }: { children: React.ReactNode }) {
+ return (
+
+ {children}
+
+ );
+ }
+ ```
+
+4. **数据获取重构**
+ ```typescript
+ // 原 useEffect 方式
+ useEffect(() => {
+ fetchData().then(setData);
+ }, []);
+
+ // 新 async/await 方式
+ const data = await fetchData();
+ ```
+
+5. **导航方式变更**
+ ```typescript
+ // 原 useNavigate
+ const navigate = useNavigate();
+ navigate('/machinery');
+
+ // 新 useRouter
+ const router = useRouter();
+ router.push('/machinery');
+ ```
+
+---
+
+*本文档基于 Mary 的头脑风暴分析结果生成,为 crop-x 项目提供 Next.js App Router 版本的完整技术架构方案。*
\ No newline at end of file
diff --git a/docs/crop-x-路由系统重构方案.md b/docs/crop-x-路由系统重构方案.md
index f9b5cae..53d2a9e 100644
--- a/docs/crop-x-路由系统重构方案.md
+++ b/docs/crop-x-路由系统重构方案.md
@@ -12,11 +12,11 @@
## 技术栈
-- **前端框架**: React 19 + TypeScript
-- **构建工具**: Vite
+- **前端框架**: Next.js 14 + React 19 + TypeScript
+- **构建工具**: Next.js 内置构建系统
- **状态管理**: Zustand
- **UI框架**: shadcn/ui + Tailwind CSS
-- **路由**: React Router v6
+- **路由**: Next.js App Router
- **HTTP客户端**: Axios
- **图标**: Lucide React
- **提示组件**: Sonner
@@ -128,7 +128,7 @@ D:\code\repotest\smart-crop-x\ # 原项目(保留不变)
│ │ ├── 📄 systemStore.js # 系统参数状态
│ │ ├── 📄 monitorStore.js # 系统监控状态
│ │ └── 📄 messageStore.js # 消息中心状态
-│ ├── 📂 pages/ # 🆕 页面组件 - 7大业务模块完整层级结构
+│ ├── 📂 app/ # 🆕 Next.js App Router 页面组件 - 7大业务模块完整层级结构
│ │ ├── 📂 AgriculturalMachinery/ # 🚙 智能农机管理系统页面
│ │ │ ├── 📂 Archive/ # B级:农机档案
│ │ │ │ ├── 📂 MachineryEntry/ # C级:农机档案录入与维护