From f58f831c42e765c9229122a608e2d9ffddbb106d Mon Sep 17 00:00:00 2001 From: Hu Gang <18768366022@163.com> Date: Wed, 28 May 2025 10:04:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9B=BD=E9=99=85=E5=8C=96=E8=A1=A5?= =?UTF-8?q?=E5=85=85=EF=BC=8C=E8=A7=A3=E5=86=B3=E4=BA=86iframe=E9=80=9A?= =?UTF-8?q?=E4=BF=A1=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/lang/en.ts | 3 +++ src/i18n/lang/zh-cn.ts | 3 +++ src/store/theme.ts | 2 +- src/views/app/index.vue | 20 +++++++++++++------ .../components/AssetLibraryDrawer.vue | 9 +++++++-- .../dialogue/components/DialogueSession.vue | 5 ++--- src/views/tools/index.vue | 3 +-- 7 files changed, 31 insertions(+), 14 deletions(-) diff --git a/src/i18n/lang/en.ts b/src/i18n/lang/en.ts index 287e739..ea96539 100644 --- a/src/i18n/lang/en.ts +++ b/src/i18n/lang/en.ts @@ -118,6 +118,8 @@ export default { }, app: { app_center: 'App Center', + flow: 'Flow', + agent: 'Agent', all_select: 'All', app_name: 'App name', app_introduction: 'App introduction', @@ -145,6 +147,7 @@ export default { app_config: 'App Config', agent_app: 'Agent App', mcp_app: 'MCP App', + confirm_delete_app: 'Are you sure to delete this application?', create_or_edit_workflow_first: 'Please create/edit a workflow first', ui_preview: 'UI Preview', appName: 'Agent Name', diff --git a/src/i18n/lang/zh-cn.ts b/src/i18n/lang/zh-cn.ts index 8958adf..9c524ab 100644 --- a/src/i18n/lang/zh-cn.ts +++ b/src/i18n/lang/zh-cn.ts @@ -117,6 +117,8 @@ export default { }, app: { app_center: '应用中心', + flow: '工作流', + agent: '智能体', all_select: '全部', app_name: '应用名称', app_introduction: '应用简介', @@ -144,6 +146,7 @@ export default { app_config: '界面配置', agent_app: '创建智能体应用', mcp_app: '创建工作流应用', + confirm_delete_app: '确定删除此应用吗?', create_or_edit_workflow_first: '请先创建/编辑工作流', ui_preview: '界面预览', appName: '智能体名称', diff --git a/src/store/theme.ts b/src/store/theme.ts index be0f5c0..9e7facb 100644 --- a/src/store/theme.ts +++ b/src/store/theme.ts @@ -5,7 +5,7 @@ import { onBeforeUnmount, onMounted, ref } from 'vue'; export const useChangeThemeStore = defineStore( 'theme', () => { - const theme = ref<'dark' | 'light'>(); + const theme = ref<'dark' | 'light'>('light'); function updateTheme(t: 'dark' | 'light') { theme.value = t; diff --git a/src/views/app/index.vue b/src/views/app/index.vue index 054efbd..0e4cf4c 100644 --- a/src/views/app/index.vue +++ b/src/views/app/index.vue @@ -17,8 +17,8 @@ :suffix-icon="IconCaretDown" > - - + + @@ -96,7 +96,11 @@ : 'appTypeName__agent' " > - {{ appItem.appType === 'flow' ? '工作流' : '智能体' }} + {{ + appItem.appType === 'flow' + ? $t('app.flow') + : $t('app.agent') + }}
@@ -145,7 +149,7 @@
@@ -170,6 +174,7 @@ import DefaultAppIcon from '../../assets/svgs/defaultIcon.webp'; import CustomLoading from '../customLoading/index.vue'; import SelectAppTypeDialog from './components/SelectAppTypeDialog.vue'; import TextMoreTootip from '@/components/textMoreTootip/index.vue'; +import { useI18n } from 'vue-i18n'; interface App { appId: string; @@ -183,6 +188,7 @@ interface App { } const route = useRoute(); const router = useRouter(); +const { t } = useI18n(); const { currentSelectedSession } = storeToRefs(useHistorySessionStore()); const publishStatus = ref('未发布'); @@ -302,7 +308,9 @@ const handleSearchAppList = (type) => { const handleDelApp = (e, item) => { e.stopPropagation(); - ElMessageBox.confirm('确定删除此应用吗?', '提示', { + ElMessageBox.confirm(t('app.confirm_delete_app'), t('common.tip'), { + confirmButtonText: t('common.confirm'), + cancelButtonText: t('common.cancel'), type: 'warning', icon: markRaw(IconAlarm), }).then(() => { @@ -314,7 +322,7 @@ const handleDelApp = (e, item) => { if (res[1]) { ElMessage({ showClose: true, - message: '删除成功', + message: t('common.delete_success'), icon: IconSuccess, customClass: 'o-message--success', duration: 3000, diff --git a/src/views/createapp/components/AssetLibraryDrawer.vue b/src/views/createapp/components/AssetLibraryDrawer.vue index 4cb9f23..73498da 100644 --- a/src/views/createapp/components/AssetLibraryDrawer.vue +++ b/src/views/createapp/components/AssetLibraryDrawer.vue @@ -4,6 +4,7 @@ import { ref, onMounted } from 'vue'; import { api } from '@/apis'; import type { KnowledgeBase } from '@/apis/appCenter/knowledge'; import { ElMessage } from 'element-plus'; +import i18n from '@/i18n'; defineProps<{ visible: boolean; @@ -109,8 +110,12 @@ onMounted(() => { diff --git a/src/views/dialogue/components/DialogueSession.vue b/src/views/dialogue/components/DialogueSession.vue index 5221103..4883f62 100644 --- a/src/views/dialogue/components/DialogueSession.vue +++ b/src/views/dialogue/components/DialogueSession.vue @@ -34,7 +34,7 @@ const isCreateApp = ref(props?.isCreateApp); const selectedLLM = ref({}); const handleChangeMode = (val: string) => { selectedLLM.value = val; - }; +}; // const isCreateApp = ref(true); const llmOptions = ref([]); const { app } = storeToRefs(useSessionStore()); @@ -682,7 +682,6 @@ const getappMode = (appId: string) => { }; } }); - console.log("getappMode", appId, Form.value); }; watch( @@ -848,7 +847,7 @@ watch( - +
diff --git a/src/views/tools/index.vue b/src/views/tools/index.vue index e011f72..7f5fe2c 100644 --- a/src/views/tools/index.vue +++ b/src/views/tools/index.vue @@ -92,8 +92,7 @@ watch( // 等待DOM更新完成 await nextTick(); - - if (isIframeLoaded.value) { + if (isIframeLoaded.value && iframeTarget.value) { sendMessageToIframe(!isWitchaindRoute); const token = localStorage.getItem('ECSESSION') ?? ''; sendTokenToIframe(token); -- Gitee