diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/DataSetServiceImpl.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/DataSetServiceImpl.java index 7f624167c2..ea88a00f43 100644 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/DataSetServiceImpl.java +++ b/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/DataSetServiceImpl.java @@ -13,11 +13,8 @@ import io.edurt.datacap.common.sql.configure.SqlOrder; import io.edurt.datacap.common.sql.configure.SqlType; import io.edurt.datacap.executor.ExecutorService; -import io.edurt.datacap.executor.common.RunEngine; -import io.edurt.datacap.executor.common.RunMode; import io.edurt.datacap.executor.common.RunProtocol; import io.edurt.datacap.executor.common.RunState; -import io.edurt.datacap.executor.common.RunWay; import io.edurt.datacap.executor.configure.ExecutorConfigure; import io.edurt.datacap.executor.configure.ExecutorRequest; import io.edurt.datacap.executor.configure.ExecutorResponse; @@ -1229,28 +1226,21 @@ private DataSetEntity syncData(DataSetEntity entity, java.util.concurrent.Execut log.warn("Serialize effective executor configure failed: {}", ex.getMessage()); } historyRepository.save(history); - int fetchSize = parseIntOrDefault(executorCfg.get("fetchSize"), 1000); - int batchSize = parseIntOrDefault(executorCfg.get("batchSize"), 1000); - boolean preCount = Boolean.parseBoolean(executorCfg.getOrDefault("preCount", "false")); + // timeout 由各 executor 自己的配置决定:LocalExecutor schema 默认 0(不限时), + // 未声明该字段的 executor(如 Seatunnel)回退到 600 秒,保持原有行为 + int timeout = parseIntOrDefault(executorCfg.get("timeout"), 600); ExecutorRequest request = new ExecutorRequest( taskName, entity.getUser().getUsername(), input, - output, - executorCfg.get("home"), - workHome, - this.pluginManager, - 600, - RunWay.valueOf(executorCfg.getOrDefault("way", "LOCAL")), - RunMode.valueOf(executorCfg.getOrDefault("mode", "CLIENT")), - executorCfg.get("startScript"), - RunEngine.valueOf(executorCfg.getOrDefault("engine", "SPARK")), - null, - fetchSize, - batchSize, - preCount, - null + output ); + request.setWorkHome(workHome); + request.setTimeout(timeout); + request.setPluginManager(this.pluginManager); + // 把该 executor 的 effective 配置整体作为 options,各执行器各取所需: + // Local 读 fetchSize/batchSize/preCount;Seatunnel 读 home/startScript/way/mode/engine + request.setOptions(executorCfg); // 进度回调:每个 batch 写完后更新 datacap_dataset_history 以及数据集自身的 totalRows / totalSize // totalRows 直接用已写入计数;totalSize 必须查 ClickHouse system.parts,开销大且不可控, @@ -1355,8 +1345,9 @@ private DataSetEntity syncData(DataSetEntity entity, java.util.concurrent.Execut history.setProgress(java.math.BigDecimal.valueOf(100.0).setScale(2, java.math.RoundingMode.HALF_UP)); } historyRepository.save(history); - // STOPPED 是用户主动停止,已经把最终状态写入 history,无需当作异常抛出 / 也不刷 table metadata - if (response.getState() == RunState.STOPPED) { + // STOPPED(用户主动停止)与 TIMEOUT(超时取消)都是终态:已把最终状态写入 history, + // 无需当作异常抛出 / 也不刷 table metadata + if (response.getState() == RunState.STOPPED || response.getState() == RunState.TIMEOUT) { return; } Preconditions.checkArgument(response.getSuccessful(), response.getMessage()); diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/WorkflowServiceImpl.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/WorkflowServiceImpl.java index 69f7f138ff..3e1ddcc186 100644 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/WorkflowServiceImpl.java +++ b/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/WorkflowServiceImpl.java @@ -6,10 +6,7 @@ import io.edurt.datacap.common.response.CommonResponse; import io.edurt.datacap.common.utils.NullAwareBeanUtils; import io.edurt.datacap.executor.ExecutorService; -import io.edurt.datacap.executor.common.RunEngine; -import io.edurt.datacap.executor.common.RunMode; import io.edurt.datacap.executor.common.RunState; -import io.edurt.datacap.executor.common.RunWay; import io.edurt.datacap.executor.configure.ExecutorConfigure; import io.edurt.datacap.executor.configure.ExecutorRequest; import io.edurt.datacap.executor.configure.ExecutorResponse; @@ -155,22 +152,18 @@ public CommonResponse saveOrUpdate(BaseRepository=3.0.3' + '@antv/x6-common@2.0.17': resolution: {integrity: sha512-37g7vmRkNdYzZPdwjaMSZEGv/MMH0S4r70/Jwoab1mioycmuIBN73iyziX8m56BvJSDucZ3J/6DU07otWqzS6A==} @@ -136,6 +153,10 @@ packages: engines: {node: '>=6.0.0'} hasBin: true + '@babel/runtime@7.29.7': + resolution: {integrity: sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==} + engines: {node: '>=6.9.0'} + '@babel/types@7.26.0': resolution: {integrity: sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==} engines: {node: '>=6.9.0'} @@ -235,6 +256,16 @@ packages: '@codemirror/view@6.34.1': resolution: {integrity: sha512-t1zK/l9UiRqwUNPm+pdIT0qzJlzuVckbTEMVNFhfWkGiBQClstzg+78vedCvLSX0xJEZ6lwZbPpnljL7L6iwMQ==} + '@ctrl/tinycolor@3.6.1': + resolution: {integrity: sha512-SITSV6aIXsuVNV3f3O0f2n/cgyEDWoSqtZMYiAmcsYHydcKrOz3gUxB/iXd/Qf08+IZX4KpgNbvUdMBmWz+kcA==} + engines: {node: '>=10'} + + '@emotion/hash@0.9.2': + resolution: {integrity: sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g==} + + '@emotion/unitless@0.8.1': + resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} + '@esbuild/aix-ppc64@0.21.5': resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} engines: {node: '>=12'} @@ -540,24 +571,28 @@ packages: engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [glibc] '@resvg/resvg-js-linux-arm64-musl@2.4.1': resolution: {integrity: sha512-6mT0+JBCsermKMdi/O2mMk3m7SqOjwi9TKAwSngRZ/nQoL3Z0Z5zV+572ztgbWr0GODB422uD8e9R9zzz38dRQ==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [musl] '@resvg/resvg-js-linux-x64-gnu@2.4.1': resolution: {integrity: sha512-60KnrscLj6VGhkYOJEmmzPlqqfcw1keDh6U+vMcNDjPhV3B5vRSkpP/D/a8sfokyeh4VEacPSYkWGezvzS2/mg==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [glibc] '@resvg/resvg-js-linux-x64-musl@2.4.1': resolution: {integrity: sha512-0AMyZSICC1D7ge115cOZQW8Pcad6PjWuZkBFF3FJuSxC6Dgok0MQnLTs2MfMdKBlAcwO9dXsf3bv9tJZj8pATA==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [musl] '@resvg/resvg-js-win32-arm64-msvc@2.4.1': resolution: {integrity: sha512-76XDFOFSa3d0QotmcNyChh2xHwk+JTFiEQBVxMlHpHMeq7hNrQJ1IpE1zcHSQvrckvkdfLboKRrlGB86B10Qjw==} @@ -615,46 +650,55 @@ packages: resolution: {integrity: sha512-KRSFHyE/RdxQ1CSeOIBVIAxStFC/hnBgVcaiCkQaVC+EYDtTe4X7z5tBkFyRoBgUGtB6Xg6t9t2kulnX6wJc6A==} cpu: [arm] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.24.3': resolution: {integrity: sha512-h6Q8MT+e05zP5BxEKz0vi0DhthLdrNEnspdLzkoFqGwnmOzakEHSlXfVyA4HJ322QtFy7biUAVFPvIDEDQa6rw==} cpu: [arm] os: [linux] + libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.24.3': resolution: {integrity: sha512-fKElSyXhXIJ9pqiYRqisfirIo2Z5pTTve5K438URf08fsypXrEkVmShkSfM8GJ1aUyvjakT+fn2W7Czlpd/0FQ==} cpu: [arm64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.24.3': resolution: {integrity: sha512-YlddZSUk8G0px9/+V9PVilVDC6ydMz7WquxozToozSnfFK6wa6ne1ATUjUvjin09jp34p84milxlY5ikueoenw==} cpu: [arm64] os: [linux] + libc: [musl] '@rollup/rollup-linux-powerpc64le-gnu@4.24.3': resolution: {integrity: sha512-yNaWw+GAO8JjVx3s3cMeG5Esz1cKVzz8PkTJSfYzE5u7A+NvGmbVFEHP+BikTIyYWuz0+DX9kaA3pH9Sqxp69g==} cpu: [ppc64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-gnu@4.24.3': resolution: {integrity: sha512-lWKNQfsbpv14ZCtM/HkjCTm4oWTKTfxPmr7iPfp3AHSqyoTz5AgLemYkWLwOBWc+XxBbrU9SCokZP0WlBZM9lA==} cpu: [riscv64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-s390x-gnu@4.24.3': resolution: {integrity: sha512-HoojGXTC2CgCcq0Woc/dn12wQUlkNyfH0I1ABK4Ni9YXyFQa86Fkt2Q0nqgLfbhkyfQ6003i3qQk9pLh/SpAYw==} cpu: [s390x] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.24.3': resolution: {integrity: sha512-mnEOh4iE4USSccBOtcrjF5nj+5/zm6NcNhbSEfR3Ot0pxBwvEn5QVUXcuOwwPkapDtGZ6pT02xLoPaNv06w7KQ==} cpu: [x64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-musl@4.24.3': resolution: {integrity: sha512-rMTzawBPimBQkG9NKpNHvquIUTQPzrnPxPbCY1Xt+mFkW7pshvyIS5kYgcf74goxXOQk0CP3EoOC1zcEezKXhw==} cpu: [x64] os: [linux] + libc: [musl] '@rollup/rollup-win32-arm64-msvc@4.24.3': resolution: {integrity: sha512-2lg1CE305xNvnH3SyiKwPVsTVLCg4TmNCF1z7PSHX2uZY2VbUpdkgAllVoISD7JO7zu+YynpWNSKAtOrX3AiuA==} @@ -671,6 +715,9 @@ packages: cpu: [x64] os: [win32] + '@simonwep/pickr@1.8.2': + resolution: {integrity: sha512-/l5w8BIkrpP6n1xsetx9MWPWlU6OblN5YgZZphxan0Tq4BByTCETL6lyIeY8lagalS2Nbt4F2W034KHLIiunKA==} + '@turf/boolean-clockwise@6.5.0': resolution: {integrity: sha512-45+C7LC5RMbRWrxh3Z0Eihsc8db1VGBO5d9BLTOAwU4jR6SgsunTfRWR16X7JUwIDYlCVEmnjcXJNi/kIU3VIw==} @@ -917,12 +964,24 @@ packages: ansi_up@6.0.2: resolution: {integrity: sha512-3G3vKvl1ilEp7J1u6BmULpMA0xVoW/f4Ekqhl8RTrJrhEBkonKn5k3bUc5Xt+qDayA6iDX0jyUh3AbZjB/l0tw==} + ant-design-vue@4.2.6: + resolution: {integrity: sha512-t7eX13Yj3i9+i5g9lqFyYneoIb3OzTvQjq9Tts1i+eiOd3Eva/6GagxBSXM1fOCjqemIu0FYVE1ByZ/38epR3Q==} + engines: {node: '>=12.22.0'} + peerDependencies: + vue: '>=3.2.0' + argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} array-source@0.0.4: resolution: {integrity: sha512-frNdc+zBn80vipY+GdcJkLEbMWj3xmzArYApmUGxoiV8uAu/ygcs9icPdsGdA26h0MkHUMW6EN2piIvVx+M5Mw==} + array-tree-filter@2.1.0: + resolution: {integrity: sha512-4ROwICNlNw/Hqa9v+rk5h22KjmzB1JGTMVKP2AKJBOCgb0yL0ASf0+YvCcLNNwquOHNX48jkeZIJ3a+oOQqKcw==} + + async-validator@4.2.5: + resolution: {integrity: sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==} + asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} @@ -975,6 +1034,9 @@ packages: commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} + compute-scroll-into-view@1.0.20: + resolution: {integrity: sha512-UCB0ioiyj8CRjtrvaceBLqqhZCVP+1B8+NWQhmdsm0VXOJtobBCf1dBQmebCCo34qZmUwZfIH2MZLqNHazrfjg==} + computeds@0.0.1: resolution: {integrity: sha512-7CEBgcMjVmitjYo5q8JTJVra6X5mQ20uTThdK+0kR7UEaDrAWEQcRiBtWJzga4eRpP6afNwwLsX2SET2JhVB1Q==} @@ -993,6 +1055,9 @@ packages: copy-to-clipboard@3.3.3: resolution: {integrity: sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA==} + core-js@3.50.0: + resolution: {integrity: sha512-BRWgOLKkFeCgRudR6zrs8p9XJZcE14grzKMMssoYrk6krtuEZ7MTKPIY5RzOnqsEKIR9kst7wNzphttraT+Yqw==} + core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} @@ -1086,6 +1151,12 @@ packages: dijkstrajs@1.0.3: resolution: {integrity: sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==} + dom-align@1.12.4: + resolution: {integrity: sha512-R8LUSEay/68zE5c8/3BDxiTEvgb4xZTF0RKmAHfiEVN3klfIpXfi2/QCoiWPccVQ0J/ZGdz9OjzL4uJEP/MRAw==} + + dom-scroll-into-view@2.0.1: + resolution: {integrity: sha512-bvVTQe1lfaUr1oFzZX80ce9KLDlZ3iU+XGNE/bz9HnGdklTieqsbmsLHe+rT2XWqopvL0PckkYqN7ksmm5pe3w==} + element-resize-detector@1.2.4: resolution: {integrity: sha512-Fl5Ftk6WwXE0wqCgNoseKWndjzZlDCwuPTcoVZfCP9R3EHQF8qUtr3YUPNETegRBOKqQKPW3n4kiIWngGi8tKg==} @@ -1181,6 +1252,10 @@ packages: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} + is-plain-object@3.0.1: + resolution: {integrity: sha512-Xnpx182SBMrr/aBik8y+GuR4U1L9FqMSojwDQwPMmxyC6bvEqly9UBCxhauBF5vNh2gwWJNX6oDV7O+OM4z34g==} + engines: {node: '>=0.10.0'} + is-what@4.1.16: resolution: {integrity: sha512-ZhMwEosbFJkA0YhFnNDgTM4ZxDRsS6HqTo7qsZM08fehyRYIYa0yHu5R6mgo1n/8MgaPBXiPimPD77baVFYg+A==} engines: {node: '>=12.13'} @@ -1188,6 +1263,9 @@ packages: isarray@0.0.1: resolution: {integrity: sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==} + js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + linkify-it@5.0.0: resolution: {integrity: sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==} @@ -1201,6 +1279,10 @@ packages: lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + loose-envify@1.4.0: + resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} + hasBin: true + lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} @@ -1276,6 +1358,9 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true + nanopop@2.4.2: + resolution: {integrity: sha512-NzOgmMQ+elxxHeIha+OG/Pv3Oc3p4RU2aBhwWwAqDpXrdTbtRylbRLQztLy8dMMwfl6pclznBdfUhccEn9ZIzw==} + p-limit@2.3.0: resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} engines: {node: '>=6'} @@ -1395,6 +1480,9 @@ packages: safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + scroll-into-view-if-needed@2.2.31: + resolution: {integrity: sha512-dGCXy99wZQivjmjIqihaBQNjryrz5rueJY7eHfTdyWEiR4ttYpsajb14rn9s5d4DY4EcY6+4+U/maARBXJedkA==} + select@1.1.2: resolution: {integrity: sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==} @@ -1406,6 +1494,9 @@ packages: set-blocking@2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} + shallow-equal@1.2.1: + resolution: {integrity: sha512-S4vJDjHHMBaiZuT9NPb616CSmLf618jawtv3sufLl6ivK8WocjAo58cXwbRV1cgqxH0Qbv+iUt6m05eqEa2IRA==} + shapefile@0.6.6: resolution: {integrity: sha512-rLGSWeK2ufzCVx05wYd+xrWnOOdSV7xNUW5/XFgx3Bc02hBkpMlrd2F1dDII7/jhWzv0MSyBFh5uJIy9hLdfuw==} hasBin: true @@ -1454,6 +1545,9 @@ packages: style-mod@4.1.2: resolution: {integrity: sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==} + stylis@4.4.0: + resolution: {integrity: sha512-5Z9ZpRzfuH6l/UAvCPAPUo3665Nk2wLaZU3x+TLHKVzIz33+sbJqbtrYoC3KD4/uVOr2Zp+L0LySezP9OHV9yA==} + superjson@2.2.2: resolution: {integrity: sha512-5JRxVqC8I8NuOUjzBbvVJAKNM8qoVuH0O77h4WInc/qC2q5IreqKxYwgkga3PfA22OayK2ikceb/B26dztPl+Q==} engines: {node: '>=16'} @@ -1464,6 +1558,10 @@ packages: text-encoding@0.6.4: resolution: {integrity: sha512-hJnc6Qg3dWoOMkqP53F0dzRIgtmsAge09kxUIqGrEUS4qr5rWLckGYaQAVr+opBrIMRErGgy6f5aPnyPpyGRfg==} + throttle-debounce@5.0.2: + resolution: {integrity: sha512-B71/4oyj61iNH0KeCamLuE2rmKuTO5byTOSVwECM5FA7TiAiAW+UqTKZ9ERueC4qvgSttUhdmq1mXC3kJqGX7A==} + engines: {node: '>=12.22'} + tiny-emitter@2.1.0: resolution: {integrity: sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==} @@ -1579,6 +1677,12 @@ packages: peerDependencies: typescript: '*' + vue-types@3.0.2: + resolution: {integrity: sha512-IwUC0Aq2zwaXqy74h4WCvFCUtoV0iSWr0snWnE9TnU18S66GAQyqQbRf2qfJtUuiFsBf6qp0MEwdonlwznlcrw==} + engines: {node: '>=10.15.0'} + peerDependencies: + vue: ^3.0.0 + vue3-ace-editor@2.2.4: resolution: {integrity: sha512-FZkEyfpbH068BwjhMyNROxfEI8135Sc+x8ouxkMdCNkuj/Tuw83VP/gStFQqZHqljyX9/VfMTCdTqtOnJZGN8g==} peerDependencies: @@ -1604,6 +1708,9 @@ packages: w3c-keyname@2.2.8: resolution: {integrity: sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==} + warning@4.0.3: + resolution: {integrity: sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==} + which-module@2.0.1: resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} @@ -1629,6 +1736,18 @@ packages: snapshots: + '@ant-design/colors@6.0.0': + dependencies: + '@ctrl/tinycolor': 3.6.1 + + '@ant-design/icons-svg@4.6.0': {} + + '@ant-design/icons-vue@7.0.1(vue@3.5.12(typescript@5.2.2))': + dependencies: + '@ant-design/colors': 6.0.0 + '@ant-design/icons-svg': 4.6.0 + vue: 3.5.12(typescript@5.2.2) + '@antv/x6-common@2.0.17': dependencies: lodash-es: 4.17.21 @@ -1650,6 +1769,8 @@ snapshots: dependencies: '@babel/types': 7.26.0 + '@babel/runtime@7.29.7': {} + '@babel/types@7.26.0': dependencies: '@babel/helper-string-parser': 7.25.9 @@ -1910,6 +2031,12 @@ snapshots: style-mod: 4.1.2 w3c-keyname: 2.2.8 + '@ctrl/tinycolor@3.6.1': {} + + '@emotion/hash@0.9.2': {} + + '@emotion/unitless@0.8.1': {} + '@esbuild/aix-ppc64@0.21.5': optional: true @@ -2263,6 +2390,11 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.24.3': optional: true + '@simonwep/pickr@1.8.2': + dependencies: + core-js: 3.50.0 + nanopop: 2.4.2 + '@turf/boolean-clockwise@6.5.0': dependencies: '@turf/helpers': 6.5.0 @@ -2691,10 +2823,40 @@ snapshots: ansi_up@6.0.2: {} + ant-design-vue@4.2.6(vue@3.5.12(typescript@5.2.2)): + dependencies: + '@ant-design/colors': 6.0.0 + '@ant-design/icons-vue': 7.0.1(vue@3.5.12(typescript@5.2.2)) + '@babel/runtime': 7.29.7 + '@ctrl/tinycolor': 3.6.1 + '@emotion/hash': 0.9.2 + '@emotion/unitless': 0.8.1 + '@simonwep/pickr': 1.8.2 + array-tree-filter: 2.1.0 + async-validator: 4.2.5 + csstype: 3.1.3 + dayjs: 1.11.13 + dom-align: 1.12.4 + dom-scroll-into-view: 2.0.1 + lodash: 4.17.21 + lodash-es: 4.17.21 + resize-observer-polyfill: 1.5.1 + scroll-into-view-if-needed: 2.2.31 + shallow-equal: 1.2.1 + stylis: 4.4.0 + throttle-debounce: 5.0.2 + vue: 3.5.12(typescript@5.2.2) + vue-types: 3.0.2(vue@3.5.12(typescript@5.2.2)) + warning: 4.0.3 + argparse@2.0.1: {} array-source@0.0.4: {} + array-tree-filter@2.1.0: {} + + async-validator@4.2.5: {} + asynckit@0.4.0: {} axios@1.7.7: @@ -2757,6 +2919,8 @@ snapshots: commander@2.20.3: {} + compute-scroll-into-view@1.0.20: {} + computeds@0.0.1: {} concat-stream@1.4.11: @@ -2780,6 +2944,8 @@ snapshots: dependencies: toggle-selection: 1.0.6 + core-js@3.50.0: {} + core-util-is@1.0.3: {} crelt@1.0.6: {} @@ -2856,6 +3022,10 @@ snapshots: dijkstrajs@1.0.3: {} + dom-align@1.12.4: {} + + dom-scroll-into-view@2.0.1: {} + element-resize-detector@1.2.4: dependencies: batch-processor: 1.0.0 @@ -2961,10 +3131,14 @@ snapshots: is-fullwidth-code-point@3.0.0: {} + is-plain-object@3.0.1: {} + is-what@4.1.16: {} isarray@0.0.1: {} + js-tokens@4.0.0: {} + linkify-it@5.0.0: dependencies: uc.micro: 2.1.0 @@ -2977,6 +3151,10 @@ snapshots: lodash@4.17.21: {} + loose-envify@1.4.0: + dependencies: + js-tokens: 4.0.0 + lru-cache@10.4.3: {} lucide-vue-next@0.360.0(vue@3.5.12(typescript@5.2.2)): @@ -3052,6 +3230,8 @@ snapshots: nanoid@3.3.7: {} + nanopop@2.4.2: {} + p-limit@2.3.0: dependencies: p-try: 2.2.0 @@ -3185,12 +3365,18 @@ snapshots: safer-buffer@2.1.2: {} + scroll-into-view-if-needed@2.2.31: + dependencies: + compute-scroll-into-view: 1.0.20 + select@1.1.2: {} semver@7.6.3: {} set-blocking@2.0.0: {} + shallow-equal@1.2.1: {} + shapefile@0.6.6: dependencies: array-source: 0.0.4 @@ -3238,6 +3424,8 @@ snapshots: style-mod@4.1.2: {} + stylis@4.4.0: {} + superjson@2.2.2: dependencies: copy-anything: 3.0.5 @@ -3246,6 +3434,8 @@ snapshots: text-encoding@0.6.4: {} + throttle-debounce@5.0.2: {} + tiny-emitter@2.1.0: {} toggle-selection@1.0.6: {} @@ -3334,6 +3524,11 @@ snapshots: semver: 7.6.3 typescript: 5.2.2 + vue-types@3.0.2(vue@3.5.12(typescript@5.2.2)): + dependencies: + is-plain-object: 3.0.1 + vue: 3.5.12(typescript@5.2.2) + vue3-ace-editor@2.2.4(ace-builds@1.36.3)(vue@3.5.12(typescript@5.2.2)): dependencies: ace-builds: 1.36.3 @@ -3373,6 +3568,10 @@ snapshots: w3c-keyname@2.2.8: {} + warning@4.0.3: + dependencies: + loose-envify: 1.4.0 + which-module@2.0.1: {} wrap-ansi@6.2.0: diff --git a/core/datacap-ui/src/App.vue b/core/datacap-ui/src/App.vue index d3b95e045c..60c2b34aa6 100644 --- a/core/datacap-ui/src/App.vue +++ b/core/datacap-ui/src/App.vue @@ -1,8 +1,16 @@ diff --git a/core/datacap-ui/src/composables/useAntdLocale.ts b/core/datacap-ui/src/composables/useAntdLocale.ts new file mode 100644 index 0000000000..2334374803 --- /dev/null +++ b/core/datacap-ui/src/composables/useAntdLocale.ts @@ -0,0 +1,31 @@ +import { computed } from 'vue' +import { useI18n } from 'vue-i18n' +import zhCN from 'ant-design-vue/es/locale/zh_CN' +import enUS from 'ant-design-vue/es/locale/en_US' +import type { Locale } from 'ant-design-vue/es/locale' + +/** + * 把应用当前 vue-i18n 语言映射到 ant-design-vue 的内置 locale, + * 传给 ,让 antd 组件(分页、表格空数据、日期等)文案跟随全局语言。 + * + * 这样迁移后不再需要 view-shadcn-ui 的 setLocale——antd 内置文案与业务 i18n 收敛为同一套来源。 + */ +const LOCALE_MAP: Record = { + zh_cn: zhCN, + 'zh-cn': zhCN, + zh: zhCN, + en: enUS, + en_us: enUS, + 'en-us': enUS +} + +export function useAntdLocale() { + const { locale } = useI18n() + + const antdLocale = computed(() => { + const key = (locale.value || '').toLowerCase() + return LOCALE_MAP[key] || enUS + }) + + return { antdLocale } +} diff --git a/core/datacap-ui/src/composables/useTheme.ts b/core/datacap-ui/src/composables/useTheme.ts new file mode 100644 index 0000000000..87a8d3cdf5 --- /dev/null +++ b/core/datacap-ui/src/composables/useTheme.ts @@ -0,0 +1,63 @@ +import { computed, ref, watch } from 'vue' +import { theme } from 'ant-design-vue' + +/** + * 全局主题(明/暗)composable。 + * + * - 单例状态:模块级 `isDark`,全应用共享,任意组件调用 useTheme() 都拿到同一个开关。 + * - 持久化:写入 localStorage,刷新后保持。 + * - 作用于两处:给 加 `dark` class(供自定义 CSS 用 `.dark xxx` 定制), + * 同时导出 antd 的主题算法给 。 + * + * 迁移到 ant-design-vue 后,暗黑模式由 antd 的 darkAlgorithm 负责组件; + * 自定义(CSS 手写)组件则通过 上的类名做暗色适配。 + */ +const STORAGE_KEY = 'datacap-theme' + +const isDark = ref(localStorage.getItem(STORAGE_KEY) === 'dark') + +function applyToDocument(dark: boolean): void { + const el = document.documentElement + if (dark) { + el.classList.add('dark') + } + else { + el.classList.remove('dark') + } + el.setAttribute('data-theme', dark ? 'dark' : 'light') +} + +// 首次加载即应用一次 +applyToDocument(isDark.value) + +watch(isDark, (value) => { + localStorage.setItem(STORAGE_KEY, value ? 'dark' : 'light') + applyToDocument(value) +}) + +export function useTheme() { + /** 传给 的主题配置。 */ + const antdTheme = computed(() => ({ + algorithm: isDark.value ? theme.darkAlgorithm : theme.defaultAlgorithm, + token: { + // 品牌主色,后续可按 DataCap 设计调整 + colorPrimary: '#1677ff', + borderRadius: 6 + } + })) + + const toggle = (): void => { + isDark.value = !isDark.value + } + + const setDark = (value: boolean): void => { + isDark.value = value + } + + return { + isDark, + antdTheme, + toggle, + setDark + } +} diff --git a/core/datacap-ui/src/main.ts b/core/datacap-ui/src/main.ts index a413fd90ef..7ff1c9b0b6 100644 --- a/core/datacap-ui/src/main.ts +++ b/core/datacap-ui/src/main.ts @@ -5,6 +5,7 @@ import App from './App.vue' import router from '@/router' import i18n from '@/i18n/I18n' import { createIcons } from '@/fontawesome' +import Antd from 'ant-design-vue' // @ts-ignore import ShadcnViewUI from 'view-shadcn-ui' @@ -15,5 +16,9 @@ app.config.warnHandler = () => null app.use(router) app.use(i18n) app.use(createPinia()) +// ant-design-vue 与旧的 view-shadcn-ui 暂时共存:a-* 用 antd,Shadcn* 仍走旧库, +// 逐页迁移完成后再移除 view-shadcn-ui。antd v4 为 CSS-in-JS,无需全局引入 reset.css, +// 以免影响尚未迁移的旧库页面(迁移收尾时再统一引入 reset)。 +app.use(Antd) app.use(ShadcnViewUI) app.provide('$t', i18n.global.t).mount('#app') diff --git a/core/datacap-ui/src/views/auth/signin/AuthSignin.vue b/core/datacap-ui/src/views/auth/signin/AuthSignin.vue index 340ece59c4..58ee1c43d9 100644 --- a/core/datacap-ui/src/views/auth/signin/AuthSignin.vue +++ b/core/datacap-ui/src/views/auth/signin/AuthSignin.vue @@ -2,99 +2,98 @@
- + - +
+ {{ $t('user.auth.signinTip') }} +
- - - - - - - - - - - +
+ +
+ + + + + + + + + +
- - + + - +
-
+ - - + + {{ $t('user.common.signin') }} - + - + + {{ $t('user.auth.notUserTip') }} + - + {{ $t('user.common.signup') }} - - -
+ + +
-
+
- \ No newline at end of file + finally { + submitting.value = false + } +} + +// created 等价:setup 阶段立即初始化验证码 +loading.value = true +initCaptcha() + diff --git a/core/datacap-ui/src/views/auth/signup/AuthSignup.vue b/core/datacap-ui/src/views/auth/signup/AuthSignup.vue index 1ee3b327d9..ec37eca4be 100644 --- a/core/datacap-ui/src/views/auth/signup/AuthSignup.vue +++ b/core/datacap-ui/src/views/auth/signup/AuthSignup.vue @@ -2,111 +2,109 @@
- + - +
+ {{ $t('user.auth.signupTip') }} +
- - - - - - - - - - - - - - - +
+ +
+ + + + + + + + + + + + + +
- - + + - +
-
+ - - + + {{ $t('user.common.signup') }} - + - + + {{ $t('user.auth.hasUserTip') }} + - + {{ $t('user.common.signin') }} - - -
+ + +
-
+
- diff --git a/core/datacap-ui/src/views/common/error/NotAuthorized.vue b/core/datacap-ui/src/views/common/error/NotAuthorized.vue index b80f87b128..8441f22daa 100644 --- a/core/datacap-ui/src/views/common/error/NotAuthorized.vue +++ b/core/datacap-ui/src/views/common/error/NotAuthorized.vue @@ -1,29 +1,27 @@