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 ( +
+
+ {children} +
+
+ ) +} \ 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 ( +
+
+
+

+ 📦 农业资产管理系统 +

+
+
+
+ {children} +
+
+ ) +} \ 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 ( +
+
+

+ 📋 农机档案管理 +

+ +
+
+

+ 📝 农机档案录入与维护 +

+

+ 管理农机设备的基本信息档案 +

+
+ +
+

+ 🏷️ 农机分类与标签管理 +

+

+ 农机设备分类和标签体系管理 +

+
+ +
+

+ 📱 农机二维码管理 +

+

+ 农机设备二维码生成和管理 +

+
+
+ +
+

+ 📊 档案统计概览 +

+
+
+
156
+
农机总数
+
+
+
12
+
设备分类
+
+
+
89
+
已生成二维码
+
+
+
95%
+
档案完整率
+
+
+
+
+
+ ) +} \ 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 ( +
+
+
+

+ 🚙 智能农机管理系统 +

+
+
+
+ {children} +
+
+ ) +} \ 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}优先级 + +
+ +
+
+
+ ))} +
+
+
+ +
+

+ 当前任务状态 +

+
+
+
8
+
待分配任务
+
+
+
15
+
进行中任务
+
+
+
23
+
已完成任务
+
+
+
+
+
+ ) +} \ 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 ( +
+
+
+

+ 📨 消息中心管理 +

+
+
+
+ {children} +
+
+ ) +} \ 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} + +
+
+ ))} +
+
+
+ +
+

+ 📊 消息统计 +

+
+
+
156
+
今日发送
+
+
+
98.5%
+
发送成功率
+
+
+
1,234
+
总发送量
+
+
+
8
+
待发送
+
+
+
+
+
+ ) +} \ 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 ( +
+
+
+

+ 📈 系统监控管理 +

+
+
+
+ {children} +
+
+ ) +} \ 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 ( +
+
+

+ 📋 日志管理 +

+ +
+
+
+

+ 系统日志查看 +

+ +
+ + + +
+ +
+
+ {[ + { 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,245 +
+
+ 错误日志 + 12 +
+
+ 警告日志 + 45 +
+
+ 信息日志 + 1,188 +
+
+
+ +
+

快速操作

+
+ + + +
+
+ +
+

日志配置

+
+
+ 日志级别 + +
+
+ 保留天数 + 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% +
+
+
+
+
+
+
+ 内存使用率 + 68.7% +
+
+
+
+
+
+
+ 磁盘使用率 + 32.1% +
+
+
+
+
+
+
+ 网络带宽 + 28.5% +
+
+
+
+
+
+
+ +
+

+ 性能趋势图表 +

+
+
+
📈
+

+ 性能趋势图表 +

+

+ (集成图表库后显示) +

+
+
+
+
+ +
+
+

响应时间

+
125ms
+
平均响应时间
+
+
+

吞吐量

+
1,245
+
请求/分钟
+
+
+

可用性

+
99.9%
+
系统可用性
+
+
+ +
+

+ ⚡ 性能优化建议 +

+
+
+
+ 内存使用率较高,建议清理缓存或增加内存 +
+
+
+ CPU使用率正常,系统运行稳定 +
+
+
+ 磁盘空间充足,无需清理 +
+
+
+
+
+ ) +} \ 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 ( +
+
+

+ ⚙️ 基础配置管理 +

+ +
+
+
+

+ 系统基本参数 +

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+

+ 安全配置 +

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ +
+
+

+ 性能配置 +

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+

+ 通知配置 +

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+ +
+ + +
+
+
+ ) +} \ 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 ( +
+
+

+ 📋 业务规则设置 +

+ +
+
+

+ 🚙 农机管理规则 +

+
+
+
+

农机在线时间要求

+ 已启用 +
+

农机设备每日最少在线时间要求

+
+ + 小时/天 + +
+
+ +
+
+

农机维护提醒周期

+ 已启用 +
+

农机设备定期维护提醒设置

+
+ + + +
+
+ +
+
+

农机任务优先级规则

+ 已启用 +
+

紧急任务自动优先级提升

+
+ + +
+
+
+
+ +
+

+ 🌾 地块管理规则 +

+
+
+
+

地块面积阈值

+ 已启用 +
+

单块地块最大面积限制

+
+ + + +
+
+ +
+
+

地块分级标准

+ 已启用 +
+

根据面积和产出自动分级

+
+ + +
+
+
+
+ +
+

+ 📋 任务管理规则 +

+
+
+
+

任务自动分配规则

+ 已启用 +
+

根据技能和位置自动分配任务

+
+ + +
+
+ +
+
+

任务超时提醒

+ 已启用 +
+

任务超时自动提醒设置

+
+ + 小时后提醒 + +
+
+ +
+
+

任务完成率阈值

+ 已启用 +
+

员工任务完成率考核标准

+
+ + % 优秀线 + +
+
+
+
+ +
+

+ 📊 数据管理规则 +

+
+
+
+

数据备份周期

+ 已启用 +
+

系统数据自动备份频率

+
+ + +
+
+ +
+
+

日志保留期限

+ 已启用 +
+

系统日志数据保留时间

+
+ + + +
+
+
+
+
+ +
+ + +
+
+
+ ) +} \ 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 ( +
+
+

+ 🔌 接口配置管理 +

+ +
+
+
+

+ 🌤️ 天气服务接口 +

+
+
+ + +
+
+ + +
+
+ +
+ + 次/小时 +
+
+
+ + +
+ +
+
+ +
+

+ 📱 短信服务接口 +

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
+ +
+
+

+ 📧 邮件服务接口 +

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
+ +
+

+ 🗺️ 地图服务接口 +

+
+
+ + +
+
+ + +
+
+ +
+ + +
+
+
+ + +
+ +
+
+
+
+ +
+

+ 📊 接口状态监控 +

+
+
+

天气服务

+
+ 正常 + 响应: 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 ( +
+
+
+

+ 🔧 系统参数管理 +

+
+
+
+ {children} +
+
+ ) +} \ 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 ( +
+
+
+

+ 🏢 租户管理 +

+
+
+
+ {children} +
+
+ ) +} \ 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: '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) => ( + + + + + + + + ))} + +
+ 租户ID + + 租户名称 + + 状态 + + 创建时间 + + 操作 +
+ {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 ( +
+
+

+ 🔐 租户授权管理 +

+ +
+
+ + +
+
+ +
+
+
+

+ 📋 功能模块权限 +

+
+ {[ + { 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) => ( + + ))} +
+
+ ))} +
+
+
+ +
+
+

+ 🔑 API访问权限 +

+
+
+ API访问 + 已启用 +
+
+ +
+ + +
+
+
+ + +
+
+ + +
+
+
+ +
+

+ 📊 权限统计 +

+
+
+ 已启用模块 + 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 ( +
+
+

+ ⚙️ 租户配置管理 +

+ +
+
+ + +
+
+ +
+
+
+

+ 基本信息配置 +

+
+
+ + +
+
+ +
+
+ Logo +
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+

+ 业务配置 +

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ +
+
+

+ 系统配置 +

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+

+ 通知配置 +

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+ +
+ + +
+
+
+ ) +} \ 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 ( +
+
+
+

+ 👥 用户管理 +

+
+
+
+ {children} +
+
+ ) +} \ 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) => ( +
+
+

{module.module}

+ +
+
+ {module.permissions.map((permission, permIndex) => ( + + ))} +
+
+ ))} +
+ +
+ +
+

+ 👥 用户角色分配 +

+
+
+ + +
+
+ +
+ {['超级管理员', '农场管理员', '农机操作员', '技术员', '观察员'].map((role, index) => ( + + ))} +
+
+ +
+
+
+
+ +
+

+ 📊 权限使用统计 +

+
+
+
5
+
总角色数
+
+
+
35
+
总权限数
+
+
+
18
+
今日角色变更
+
+
+
42
+
今日权限调整
+
+
+
+
+
+ ) +} \ 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 条用户 +
+
+ + + + + + +
+
+
+
+ +
+
+

+ 📊 用户统计 +

+
+
+ 总用户数 + 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 ( +
+
+

+ 📊 用户行为跟踪 +

+ +
+ + + + + +
+ +
+
+
+

+ 📋 行为记录 +

+
+ + + + + + + + + + + + + + {[ + { + 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) => ( + + + + + + + + + + ))} + +
+ 时间 + + 用户 + + 行为类型 + + 模块 + + 描述 + + IP地址 + + 状态 +
+ {record.time} + + {record.user} + + + {record.type} + + + {record.module} + + {record.description} + + {record.ip} + + + {record.status === 'success' ? '成功' : record.status === 'warning' ? '警告' : '失败'} + +
+
+ +
+
+ 显示 1-7 条,共 1,456 条记录 +
+
+ + + + + +
+
+
+
+ +
+
+

+ 📈 今日统计 +

+
+
+ 总操作数 + 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 ( +
+
+
+

+ 📋 农事操作管理系统 +

+
+
+
+ {children} +
+
+ ) +} \ 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 ( +
+
+
+

+ 🌾 地块信息管理系统 +

+
+
+
+ {children} +
+
+ ) +} \ 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 ( +
+
+
+

+ 💧 水肥一体化控制系统 +

+
+
+
+ {children} +
+
+ ) +} \ 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
加载失败: {error}
; - - 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
分析失败: {error}
; - - 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}

- -
-
- ); - } - - return ( -
-
-
- {/* 这里可以添加筛选组件 */} -
- - -
- -
- - -
- -
- - -
-
- -
- onFilterChange({ - ...filters, - searchKeyword: e.target.value || undefined - })} - /> -
-
- - - -
-
- 共 {pagination.total} 条记录,第 {pagination.current} 页 -
-
- - {pagination.current} - -
-
-
- ); -}); - -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 ( -
-
-

驾驶员任务管理

-
- - - -
-
- - - - { - 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
加载失败: {error}
; - - 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
加载失败: {error}
; - - return ( -
-
-

健康评估

- -
- - - - -
- ); -} 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
加载失败: {error}
; - - 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 ( -
-
-

负载管理

-
- - - -
-
- - { - 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 ( -
-
-

加载失败: {error}

- -
-
- ); - } - - 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 - /> -
- -
- -