From aa25f914ab52312cf73f166741c493a7e42baff0 Mon Sep 17 00:00:00 2001 From: BBIT-Kai <2911862937@qq.com> Date: Fri, 5 Sep 2025 09:33:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=89=8D=E7=AB=AFvue?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vue/apps/web-antd/.env.development | 1 + vue/apps/web-antd/.env.production | 1 + vue/apps/web-antd/package.json | 3 + vue/apps/web-antd/src/api/core/index.ts | 2 - vue/apps/web-antd/src/api/core/iva.ts | 28 - vue/apps/web-antd/src/api/core/sca.ts | 19 - vue/apps/web-antd/src/api/index.ts | 2 + vue/apps/web-antd/src/api/model/remote.ts | 12 - vue/apps/web-antd/src/api/request.ts | 9 +- .../src/locales/langs/zh-CN/page.json | 2 +- .../web-antd/src/router/routes/modules/ai.ts | 77 --- .../src/router/routes/modules/dashboard.ts | 4 +- .../src/views/ai/iva/CreateVideoTaskModal.vue | 159 ------ vue/apps/web-antd/src/views/ai/iva/index.vue | 499 ------------------ .../src/views/ai/sca/CreateYSATaskModal.vue | 97 ---- vue/apps/web-antd/src/views/ai/sca/index.vue | 270 ---------- vue/apps/web-antd/src/views/ai/ysa/index.vue | 5 - .../effects/hooks/src/use-app-config.ts | 3 +- vue/packages/types/global.d.ts | 2 + vue/pnpm-lock.yaml | 21 + 20 files changed, 43 insertions(+), 1173 deletions(-) delete mode 100644 vue/apps/web-antd/src/api/core/iva.ts delete mode 100644 vue/apps/web-antd/src/api/core/sca.ts delete mode 100644 vue/apps/web-antd/src/api/model/remote.ts delete mode 100644 vue/apps/web-antd/src/router/routes/modules/ai.ts delete mode 100644 vue/apps/web-antd/src/views/ai/iva/CreateVideoTaskModal.vue delete mode 100644 vue/apps/web-antd/src/views/ai/iva/index.vue delete mode 100644 vue/apps/web-antd/src/views/ai/sca/CreateYSATaskModal.vue delete mode 100644 vue/apps/web-antd/src/views/ai/sca/index.vue delete mode 100644 vue/apps/web-antd/src/views/ai/ysa/index.vue diff --git a/vue/apps/web-antd/.env.development b/vue/apps/web-antd/.env.development index f3f9702..43678fa 100644 --- a/vue/apps/web-antd/.env.development +++ b/vue/apps/web-antd/.env.development @@ -5,6 +5,7 @@ VITE_BASE=/ # 接口地址 VITE_GLOB_API_URL=http://localhost:8089/api +VITE_GLOB_API_URL_PY=http://localhost:13011/api # 是否开启 Nitro Mock服务,true 为开启,false 为关闭 VITE_NITRO_MOCK=false diff --git a/vue/apps/web-antd/.env.production b/vue/apps/web-antd/.env.production index 8a4dd2f..3499670 100644 --- a/vue/apps/web-antd/.env.production +++ b/vue/apps/web-antd/.env.production @@ -2,6 +2,7 @@ VITE_BASE=/ # 接口地址 VITE_GLOB_API_URL=http://s1.ronsunny.cn:8089/api +VITE_GLOB_API_URL_PY=http://s1.ronsunny.cn:13011/api # 是否开启压缩,可以设置为 none, brotli, gzip VITE_COMPRESS=none diff --git a/vue/apps/web-antd/package.json b/vue/apps/web-antd/package.json index a175461..4ebeb07 100644 --- a/vue/apps/web-antd/package.json +++ b/vue/apps/web-antd/package.json @@ -44,6 +44,9 @@ "ant-design-vue": "catalog:", "dayjs": "catalog:", "js-sha256": "^0.11.0", + "markdown-it": "^14.1.0", + "markdown-it-container": "^4.0.0", + "markdown-it-table": "^4.1.1", "pinia": "catalog:", "video.js": "^8.22.0", "vue": "catalog:", diff --git a/vue/apps/web-antd/src/api/core/index.ts b/vue/apps/web-antd/src/api/core/index.ts index ff6ce62..945fc68 100644 --- a/vue/apps/web-antd/src/api/core/index.ts +++ b/vue/apps/web-antd/src/api/core/index.ts @@ -1,6 +1,4 @@ export * from './auth'; -export * from './iva'; export * from './menu'; export * from './remote'; -export * from './sca'; export * from './user'; diff --git a/vue/apps/web-antd/src/api/core/iva.ts b/vue/apps/web-antd/src/api/core/iva.ts deleted file mode 100644 index 828890d..0000000 --- a/vue/apps/web-antd/src/api/core/iva.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { requestClient } from '#/api/request'; - -/** - * 获取已分析的视频列表 - */ -export async function refreshVideoList(name = '') { - return requestClient.get('/iva/getVideoList', { params: { name } }); -} - -/** - * 获取已分析的视频 - */ -export async function refreshVideoDetail(vId = '') { - return requestClient.get('/iva/getAnalyticsDetailByVideoId', { - params: { vId }, - }); -} - -/** - * 上传视频分析任务 - */ -export async function createVideoTask(formData: FormData) { - return requestClient.post('/iva/createVideoTask', formData, { - headers: { - 'Content-Type': 'multipart/form-data', - }, - }); -} diff --git a/vue/apps/web-antd/src/api/core/sca.ts b/vue/apps/web-antd/src/api/core/sca.ts deleted file mode 100644 index f68531a..0000000 --- a/vue/apps/web-antd/src/api/core/sca.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { requestClient } from '#/api/request'; - -/** - * 获取已分析的图片列表 - */ -export async function refreshImageList(name = '') { - return requestClient.get('/sca/getImageList', { params: { name } }); -} - -/** - * 上传图片分析任务 - */ -export async function createImageTask(formData: FormData) { - return requestClient.post('/sca/createImageTask', formData, { - headers: { - 'Content-Type': 'multipart/form-data', - }, - }); -} diff --git a/vue/apps/web-antd/src/api/index.ts b/vue/apps/web-antd/src/api/index.ts index 4b0e041..3361a33 100644 --- a/vue/apps/web-antd/src/api/index.ts +++ b/vue/apps/web-antd/src/api/index.ts @@ -1 +1,3 @@ export * from './core'; +export * from './cv'; +export * from './llm'; diff --git a/vue/apps/web-antd/src/api/model/remote.ts b/vue/apps/web-antd/src/api/model/remote.ts deleted file mode 100644 index 45040df..0000000 --- a/vue/apps/web-antd/src/api/model/remote.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** 用户信息 */ -interface DeviceItem { - /** - * 设备名 - */ - deviceName: string; - /** - * 设备端口 - */ - devicePort: string; -} -export type { DeviceItem }; diff --git a/vue/apps/web-antd/src/api/request.ts b/vue/apps/web-antd/src/api/request.ts index dca7b23..2e8fb93 100644 --- a/vue/apps/web-antd/src/api/request.ts +++ b/vue/apps/web-antd/src/api/request.ts @@ -19,7 +19,10 @@ import { useAuthStore } from '#/store'; import { refreshTokenApi } from './core'; -const { apiURL } = useAppConfig(import.meta.env, import.meta.env.PROD); +const { apiURL, pyApiURL } = useAppConfig( + import.meta.env, + import.meta.env.PROD, +); function createRequestClient(baseURL: string, options?: RequestClientOptions) { const client = new RequestClient({ @@ -110,4 +113,8 @@ export const requestClient = createRequestClient(apiURL, { responseReturn: 'data', }); +export const pyRequestClient = createRequestClient(pyApiURL, { + responseReturn: 'data', +}); + export const baseRequestClient = new RequestClient({ baseURL: apiURL }); diff --git a/vue/apps/web-antd/src/locales/langs/zh-CN/page.json b/vue/apps/web-antd/src/locales/langs/zh-CN/page.json index 8e21502..f19dcbe 100644 --- a/vue/apps/web-antd/src/locales/langs/zh-CN/page.json +++ b/vue/apps/web-antd/src/locales/langs/zh-CN/page.json @@ -9,6 +9,6 @@ "dashboard": { "title": "常规", "analytics": "分析页", - "workspace": "工作台" + "workspace": "首页" } } diff --git a/vue/apps/web-antd/src/router/routes/modules/ai.ts b/vue/apps/web-antd/src/router/routes/modules/ai.ts deleted file mode 100644 index 2086913..0000000 --- a/vue/apps/web-antd/src/router/routes/modules/ai.ts +++ /dev/null @@ -1,77 +0,0 @@ -import type { RouteRecordRaw } from 'vue-router'; - -import { $t } from '#/locales'; - -const IFrameView = () => import('@vben/layouts').then((m) => m.IFrameView); - -const routes: RouteRecordRaw[] = [ - { - meta: { - icon: 'ic:baseline-view-in-ar', - keepAlive: false, - order: 2, - title: $t('ai.title'), - }, - name: 'Ai', - path: '/ai', - children: [ - { - name: 'IVA', - path: '/ai/iva', - meta: { - authority: ['iva'], - icon: 'mdi:video', - title: $t('ai.intelligence_video_analysis'), - keepAlive: true, - }, - component: () => import('#/views/ai/iva/index.vue'), - }, - { - name: 'SCA', - path: '/ai/sca', - meta: { - authority: ['sca'], - icon: 'mdi:ice-cream', - title: $t('ai.silkworm_cocoon_analysis'), - keepAlive: false, - }, - component: () => import('#/views/ai/sca/index.vue'), - }, - { - name: 'YSA', - path: '/ai/ysa', - meta: { - authority: ['ysa'], - icon: 'mdi:account-key-outline', - title: $t('ai.young_silkworm_analysis'), - keepAlive: false, - }, - component: () => import('#/views/ai/ysa/index.vue'), - }, - { - name: 'RAG', - path: '/ai/rag', - component: IFrameView, - meta: { - icon: 'mdi:wall-fire', - iframeSrc: 'http://s1.ronsunny.cn:13010/', - keepAlive: false, - title: '检索增强生成', - }, - }, - { - name: 'CVAT', - path: '/ai/cvat', - component: IFrameView, - meta: { - icon: 'mdi:abjad-arabic', - link: 'http://171.212.101.199:13013/', - keepAlive: true, - title: '标注平台入口', - }, - }, - ], - }, -]; - -export default routes; diff --git a/vue/apps/web-antd/src/router/routes/modules/dashboard.ts b/vue/apps/web-antd/src/router/routes/modules/dashboard.ts index 0a021fe..4c52446 100644 --- a/vue/apps/web-antd/src/router/routes/modules/dashboard.ts +++ b/vue/apps/web-antd/src/router/routes/modules/dashboard.ts @@ -17,7 +17,7 @@ const routes: RouteRecordRaw[] = [ path: '/workspace', component: () => import('#/views/dashboard/workspace/index.vue'), meta: { - icon: 'carbon:workspace', + icon: 'mdi:home', title: $t('page.dashboard.workspace'), }, }, @@ -27,7 +27,7 @@ const routes: RouteRecordRaw[] = [ component: () => import('#/views/remote/index.vue'), meta: { authority: ['remote'], - icon: 'mdi:home', + icon: 'carbon:workspace', title: $t('remote.remote'), }, }, diff --git a/vue/apps/web-antd/src/views/ai/iva/CreateVideoTaskModal.vue b/vue/apps/web-antd/src/views/ai/iva/CreateVideoTaskModal.vue deleted file mode 100644 index 9e312c0..0000000 --- a/vue/apps/web-antd/src/views/ai/iva/CreateVideoTaskModal.vue +++ /dev/null @@ -1,159 +0,0 @@ - - - diff --git a/vue/apps/web-antd/src/views/ai/iva/index.vue b/vue/apps/web-antd/src/views/ai/iva/index.vue deleted file mode 100644 index b8ba8cc..0000000 --- a/vue/apps/web-antd/src/views/ai/iva/index.vue +++ /dev/null @@ -1,499 +0,0 @@ - - - diff --git a/vue/apps/web-antd/src/views/ai/sca/CreateYSATaskModal.vue b/vue/apps/web-antd/src/views/ai/sca/CreateYSATaskModal.vue deleted file mode 100644 index 4210083..0000000 --- a/vue/apps/web-antd/src/views/ai/sca/CreateYSATaskModal.vue +++ /dev/null @@ -1,97 +0,0 @@ - - - diff --git a/vue/apps/web-antd/src/views/ai/sca/index.vue b/vue/apps/web-antd/src/views/ai/sca/index.vue deleted file mode 100644 index 506c09a..0000000 --- a/vue/apps/web-antd/src/views/ai/sca/index.vue +++ /dev/null @@ -1,270 +0,0 @@ - - - diff --git a/vue/apps/web-antd/src/views/ai/ysa/index.vue b/vue/apps/web-antd/src/views/ai/ysa/index.vue deleted file mode 100644 index 6f13bf1..0000000 --- a/vue/apps/web-antd/src/views/ai/ysa/index.vue +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/vue/packages/effects/hooks/src/use-app-config.ts b/vue/packages/effects/hooks/src/use-app-config.ts index 857ac7c..232a1a5 100644 --- a/vue/packages/effects/hooks/src/use-app-config.ts +++ b/vue/packages/effects/hooks/src/use-app-config.ts @@ -15,9 +15,10 @@ export function useAppConfig( ? window._VBEN_ADMIN_PRO_APP_CONF_ : (env as VbenAdminProAppConfigRaw); - const { VITE_GLOB_API_URL } = config; + const { VITE_GLOB_API_URL, VITE_GLOB_API_URL_PY } = config; return { apiURL: VITE_GLOB_API_URL, + pyApiURL: VITE_GLOB_API_URL_PY, }; } diff --git a/vue/packages/types/global.d.ts b/vue/packages/types/global.d.ts index 0c8f019..973dc11 100644 --- a/vue/packages/types/global.d.ts +++ b/vue/packages/types/global.d.ts @@ -9,10 +9,12 @@ declare module 'vue-router' { export interface VbenAdminProAppConfigRaw { VITE_GLOB_API_URL: string; + PY_VITE_GLOB_API_URL: string; } export interface ApplicationConfig { apiURL: string; + pyApiURL: string; } declare global { diff --git a/vue/pnpm-lock.yaml b/vue/pnpm-lock.yaml index fd06ccc..41839bc 100644 --- a/vue/pnpm-lock.yaml +++ b/vue/pnpm-lock.yaml @@ -692,6 +692,15 @@ importers: js-sha256: specifier: ^0.11.0 version: 0.11.1 + markdown-it: + specifier: ^14.1.0 + version: 14.1.0 + markdown-it-container: + specifier: ^4.0.0 + version: 4.0.0 + markdown-it-table: + specifier: ^4.1.1 + version: 4.1.1 pinia: specifier: ^3.0.2 version: 3.0.2(typescript@5.8.3)(vue@3.5.16(typescript@5.8.3)) @@ -7709,6 +7718,13 @@ packages: mark.js@8.11.1: resolution: {integrity: sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ==} + markdown-it-container@4.0.0: + resolution: {integrity: sha512-HaNccxUH0l7BNGYbFbjmGpf5aLHAMTinqRZQAEQbMr2cdD3z91Q6kIo1oUn1CQndkT03jat6ckrdRYuwwqLlQw==} + + markdown-it-table@4.1.1: + resolution: {integrity: sha512-dzFHRwCe97sXD071Gw/LSIwgAcO2vNsT0BcPCmnrKhNW/W57Bnknl8EaC+j4hM3bAqus1CiVPcTQAvLkUfHLhw==} + engines: {node: '>12.6'} + markdown-it@14.1.0: resolution: {integrity: sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==} hasBin: true @@ -9522,6 +9538,7 @@ packages: source-map@0.8.0-beta.0: resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==} engines: {node: '>= 8'} + deprecated: The work that was done in this beta branch won't be included in future versions sourcemap-codec@1.4.8: resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==} @@ -17521,6 +17538,10 @@ snapshots: mark.js@8.11.1: {} + markdown-it-container@4.0.0: {} + + markdown-it-table@4.1.1: {} + markdown-it@14.1.0: dependencies: argparse: 2.0.1