From 5acf2f60e5ad31e6fab5f8eb4cd30d6b48b53362 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Fri, 13 Jun 2025 18:31:22 +0800 Subject: [PATCH] feat: applicaiton --- ui/src/assets/application/icon_import_app.svg | 8 ++++ .../layout/layout-header/workspace/index.vue | 4 +- ui/src/views/application/index.vue | 43 +++++++++++++++++++ 3 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 ui/src/assets/application/icon_import_app.svg diff --git a/ui/src/assets/application/icon_import_app.svg b/ui/src/assets/application/icon_import_app.svg new file mode 100644 index 000000000..2ea41d2ce --- /dev/null +++ b/ui/src/assets/application/icon_import_app.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/ui/src/layout/layout-header/workspace/index.vue b/ui/src/layout/layout-header/workspace/index.vue index 1af771483..acf5e3aa2 100644 --- a/ui/src/layout/layout-header/workspace/index.vue +++ b/ui/src/layout/layout-header/workspace/index.vue @@ -45,7 +45,7 @@ async function getWorkspaceList() { } onBeforeMount(async () => { - await getWorkspaceList() + // await getWorkspaceList() const id = localStorage.getItem('workspace_id') ?? 'default' currentWorkspace.value = workspaceList.value.find(item => item.id === id) }) @@ -75,4 +75,4 @@ function changeWorkspace(item: WorkspaceItem) { :deep(.el-dropdown-menu__item.active) { color: var(--el-color-primary); } - \ No newline at end of file + diff --git a/ui/src/views/application/index.vue b/ui/src/views/application/index.vue index a2693169f..2b6592728 100644 --- a/ui/src/views/application/index.vue +++ b/ui/src/views/application/index.vue @@ -84,6 +84,27 @@ + + +
+ + + +
+
{{ $t('views.application.importApplication') }}
+
+
+
+
@@ -418,6 +439,28 @@ function refreshFolder() { getFolder() getList() } +const elUploadRef = ref() +const importApplication = (file: any) => { + const formData = new FormData() + formData.append('file', file.raw, file.name) + elUploadRef.value.clearFiles() + ApplicaitonApi.importApplication(formData, loading) + .then(async (res: any) => { + if (res?.data) { + getList() + } + }) + .catch((e) => { + if (e.code === 400) { + MsgConfirm(t('common.tip'), t('views.application.tip.professionalMessage'), { + cancelButtonText: t('common.confirm'), + confirmButtonText: t('common.professional'), + }).then(() => { + window.open('https://maxkb.cn/pricing.html', '_blank') + }) + } + }) +} onMounted(() => { getFolder()