diff --git a/vue/apps/web-antd/src/api/cv/index.ts b/vue/apps/web-antd/src/api/cv/index.ts new file mode 100644 index 0000000..20530e9 --- /dev/null +++ b/vue/apps/web-antd/src/api/cv/index.ts @@ -0,0 +1,2 @@ +export * from './iva'; +export * from './sca'; diff --git a/vue/apps/web-antd/src/api/cv/iva.ts b/vue/apps/web-antd/src/api/cv/iva.ts new file mode 100644 index 0000000..828890d --- /dev/null +++ b/vue/apps/web-antd/src/api/cv/iva.ts @@ -0,0 +1,28 @@ +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/cv/sca.ts b/vue/apps/web-antd/src/api/cv/sca.ts new file mode 100644 index 0000000..f68531a --- /dev/null +++ b/vue/apps/web-antd/src/api/cv/sca.ts @@ -0,0 +1,19 @@ +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/llm/bot.ts b/vue/apps/web-antd/src/api/llm/bot.ts new file mode 100644 index 0000000..fc36901 --- /dev/null +++ b/vue/apps/web-antd/src/api/llm/bot.ts @@ -0,0 +1,36 @@ +import { pyRequestClient } from '#/api/request'; +/** + * 获取AI列表 + */ +export async function getAIList() { + return pyRequestClient.get('/llm/aiList'); +} + +/** + * 获取对话列表 + */ +export async function getSessions() { + return pyRequestClient.get('/llm/sessions'); +} + +/** + * 获取聊天记录 + */ +export async function getHistory(sessionId: string) { + return pyRequestClient.get('/llm/history', { params: { sessionId } }); +} + +/** + * 聊天 + */ +export async function chat( + aiId: string, + sessionId: null | string, + userInput: string, +) { + return pyRequestClient.post('/llm/chat', { + aiId, + sessionId, + userInput, + }); +} diff --git a/vue/apps/web-antd/src/api/llm/index.ts b/vue/apps/web-antd/src/api/llm/index.ts new file mode 100644 index 0000000..859d4b8 --- /dev/null +++ b/vue/apps/web-antd/src/api/llm/index.ts @@ -0,0 +1,2 @@ +export * from './bot'; +export * from './report'; diff --git a/vue/apps/web-antd/src/api/llm/report.ts b/vue/apps/web-antd/src/api/llm/report.ts new file mode 100644 index 0000000..e69de29 diff --git a/vue/apps/web-antd/src/router/routes/modules/cv.ts b/vue/apps/web-antd/src/router/routes/modules/cv.ts new file mode 100644 index 0000000..5b1cf7b --- /dev/null +++ b/vue/apps/web-antd/src/router/routes/modules/cv.ts @@ -0,0 +1,54 @@ +import type { RouteRecordRaw } from 'vue-router'; + +import { $t } from '#/locales'; + +const routes: RouteRecordRaw[] = [ + { + meta: { + icon: 'ic:round-remove-red-eye', + authority: ['iva', 'sca', 'ysa'], + keepAlive: false, + order: 2, + title: $t('计算机视觉'), + }, + name: 'Ai', + path: '/cv', + children: [ + { + name: 'IVA', + path: '/cv/iva', + meta: { + authority: ['iva'], + icon: 'mdi:video', + title: $t('ai.intelligence_video_analysis'), + keepAlive: true, + }, + component: () => import('#/views/cv/iva/index.vue'), + }, + { + name: 'SCA', + path: '/cv/sca', + meta: { + authority: ['sca'], + icon: 'mdi:ice-cream', + title: $t('ai.silkworm_cocoon_analysis'), + keepAlive: false, + }, + component: () => import('#/views/cv/sca/index.vue'), + }, + { + name: 'YSA', + path: '/cv/ysa', + meta: { + authority: ['ysa'], + icon: 'mdi:waveform', + title: $t('ai.young_silkworm_analysis'), + keepAlive: false, + }, + component: () => import('#/views/cv/ysa/index.vue'), + }, + ], + }, +]; + +export default routes; diff --git a/vue/apps/web-antd/src/router/routes/modules/llm.ts b/vue/apps/web-antd/src/router/routes/modules/llm.ts new file mode 100644 index 0000000..2347ab6 --- /dev/null +++ b/vue/apps/web-antd/src/router/routes/modules/llm.ts @@ -0,0 +1,43 @@ +import type { RouteRecordRaw } from 'vue-router'; + +import { $t } from '#/locales'; + +const routes: RouteRecordRaw[] = [ + { + meta: { + icon: 'ic:baseline-view-in-ar', + authority: ['bot', 'report'], + keepAlive: false, + order: 2, + title: $t('大语言模型'), + }, + name: 'Llm', + path: '/llm', + children: [ + { + name: 'Bot', + path: '/llm/bot', + meta: { + authority: ['bot'], + icon: 'mdi:face-woman-shimmer', + title: $t('智能体对话'), + keepAlive: true, + }, + component: () => import('#/views/llm/bot/index.vue'), + }, + { + name: 'SDP', + path: '/llm/report', + meta: { + authority: ['report'], + icon: 'mdi:hoop-house', + title: $t('智农观数阁'), + keepAlive: false, + }, + component: () => import('#/views/llm/report/index.vue'), + }, + ], + }, +]; + +export default routes; diff --git a/vue/apps/web-antd/src/router/routes/modules/out.ts b/vue/apps/web-antd/src/router/routes/modules/out.ts new file mode 100644 index 0000000..0816029 --- /dev/null +++ b/vue/apps/web-antd/src/router/routes/modules/out.ts @@ -0,0 +1,45 @@ +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:round-handyman', + keepAlive: false, + authority: ['user'], + order: 2, + title: $t('其他平台'), + }, + name: 'Out', + path: '/out', + children: [ + { + name: 'RAG', + path: '/out/rag', + component: IFrameView, + meta: { + icon: 'mdi:wall-fire', + iframeSrc: 'http://s1.ronsunny.cn:13010/', + keepAlive: false, + title: '检索增强生成', + }, + }, + { + name: 'CVAT', + path: '/out/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/views/cv/iva/CreateVideoTaskModal.vue b/vue/apps/web-antd/src/views/cv/iva/CreateVideoTaskModal.vue new file mode 100644 index 0000000..05c1a1f --- /dev/null +++ b/vue/apps/web-antd/src/views/cv/iva/CreateVideoTaskModal.vue @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ fileName || '点击选择文件' }} + + + + + + diff --git a/vue/apps/web-antd/src/views/cv/iva/index.vue b/vue/apps/web-antd/src/views/cv/iva/index.vue new file mode 100644 index 0000000..b8ba8cc --- /dev/null +++ b/vue/apps/web-antd/src/views/cv/iva/index.vue @@ -0,0 +1,499 @@ + + + + + + + + + + + + + 新建任务 + + 刷新列表 + + + + + + + {{ item.v_name }} + {{ item.v_a_time }} + + + + + + + + + + {{ tab.label }} + + + + + + + 请先选择左侧列表中的分析任务 + + + + + + + + + + + + {{ key }}: + + + {{ value || '—' }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 事件 + 时间点 + + + + + + {{ video.action }} + {{ video.time }} + + + + + + + + + + diff --git a/vue/apps/web-antd/src/views/cv/sca/CreateYSATaskModal.vue b/vue/apps/web-antd/src/views/cv/sca/CreateYSATaskModal.vue new file mode 100644 index 0000000..67e1b4a --- /dev/null +++ b/vue/apps/web-antd/src/views/cv/sca/CreateYSATaskModal.vue @@ -0,0 +1,97 @@ + + + + + + + + + + + + {{ fileName || '点击选择文件' }} + + + + + + diff --git a/vue/apps/web-antd/src/views/cv/sca/index.vue b/vue/apps/web-antd/src/views/cv/sca/index.vue new file mode 100644 index 0000000..506c09a --- /dev/null +++ b/vue/apps/web-antd/src/views/cv/sca/index.vue @@ -0,0 +1,270 @@ + + + + + + + + + + + + + 新建任务 + + 刷新列表 + + + + + + + {{ item.name }} + {{ item.upload_datetime }} + + + + + + + + 请先选择左侧列表中的分析任务 + + + + + + + + + + + + {{ key }}: + + + {{ value || '—' }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vue/apps/web-antd/src/views/cv/ysa/index.vue b/vue/apps/web-antd/src/views/cv/ysa/index.vue new file mode 100644 index 0000000..6f13bf1 --- /dev/null +++ b/vue/apps/web-antd/src/views/cv/ysa/index.vue @@ -0,0 +1,5 @@ + + + 正在开发中,敬请期待 + + diff --git a/vue/apps/web-antd/src/views/llm/bot/index.vue b/vue/apps/web-antd/src/views/llm/bot/index.vue new file mode 100644 index 0000000..7c2ee55 --- /dev/null +++ b/vue/apps/web-antd/src/views/llm/bot/index.vue @@ -0,0 +1,312 @@ + + + + + + + + + + + + 新聊天 + + + + + + {{ item.name }} + + + + + + + {{ conv.title }} + {{ conv.updatedAt }} + + + + + + + + + + + + + + {{ selectedAI?.welcomeWords }} + + + + + + + + + + + + + + + + + + + + 发送 + + + + + + + diff --git a/vue/apps/web-antd/src/views/llm/report/index.vue b/vue/apps/web-antd/src/views/llm/report/index.vue new file mode 100644 index 0000000..6f13bf1 --- /dev/null +++ b/vue/apps/web-antd/src/views/llm/report/index.vue @@ -0,0 +1,5 @@ + + + 正在开发中,敬请期待 + + diff --git a/vue/docker-compose.yml b/vue/docker-compose.yml new file mode 100644 index 0000000..8438495 --- /dev/null +++ b/vue/docker-compose.yml @@ -0,0 +1,90 @@ +services: + vue: + container_name: ce_vue + image: ce-vue:latest + ports: + - "8090:8090" # 映射到宿主机的 8090 端口 + restart: always + networks: + - ce_network + + backend: + container_name: ce-pybackend + image: ce-pybackend:latest + ports: + - "13011:13011" + restart: unless-stopped + networks: + - ce_network + depends_on: + - vue + + postgres: + image: postgres:15-alpine + container_name: ce_postgres + environment: + POSTGRES_DB: ktor + POSTGRES_USER: postgres + POSTGRES_PASSWORD: 123456 + volumes: + - postgres_data:/var/lib/postgresql/data + ports: + - "5432:5432" + networks: + - ce_network + restart: unless-stopped + + redis: + image: redis:7.2.3-alpine + container_name: ce_redis + volumes: + - redis_data:/data + ports: + - "6379:6379" + networks: + - ce_network + restart: unless-stopped + + minio: + image: minio/minio:RELEASE.2025-03-12T18-04-18Z + container_name: ce_minio + environment: + MINIO_ACCESS_KEY: minioadmin + MINIO_SECRET_KEY: minioadmin + volumes: + - minio_data:/data + ports: + - "9000:9000" + - "9001:9001" + command: server /data --console-address ":9001" + networks: + - ce_network + restart: unless-stopped + +# ollama: +# image: ollama/ollama +# container_name: ce_ollama +# deploy: +# resources: +# reservations: +# devices:7 +# - capabilities: [gpu] # 启用 GPU 支持 +# volumes: +# - ollama_data:/root/.ollama # 持久化 ollama 数据 +# ports: +# - "11434:11434" # 暴露 ollama 的端口 +# networks: +# - ce_network +# restart: unless-stopped + +# 定义数据卷 +volumes: + postgres_data: + redis_data: + minio_data: + ollama_data: # 定义 ollama 的数据卷 + +# 定义网络 +networks: + ce_network: + driver: bridge