mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 10:02:46 +00:00
feat: applicaiton
This commit is contained in:
parent
f4efdca5ed
commit
5acf2f60e5
|
|
@ -0,0 +1,8 @@
|
|||
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M9.33331 11.3334C9.33331 10.9652 9.63179 10.6667 9.99998 10.6667H22C22.3682 10.6667 22.6666 10.9652 22.6666 11.3334V12.6667C22.6666 13.0349 22.3682 13.3334 22 13.3334H9.99998C9.63179 13.3334 9.33331 13.0349 9.33331 12.6667V11.3334Z" fill="white"/>
|
||||
<path d="M14.6666 16.6667C14.6666 16.2986 14.9651 16.0001 15.3333 16.0001H22C22.3682 16.0001 22.6666 16.2986 22.6666 16.6667V23.3334C22.6666 23.7016 22.3682 24.0001 22 24.0001H15.3333C14.9651 24.0001 14.6666 23.7016 14.6666 23.3334V16.6667Z" fill="white"/>
|
||||
<path d="M9.99998 16.0001C9.63179 16.0001 9.33331 16.2986 9.33331 16.6667V23.3334C9.33331 23.7016 9.63179 24.0001 9.99998 24.0001H11.3333C11.7015 24.0001 12 23.7016 12 23.3334V16.6667C12 16.2986 11.7015 16.0001 11.3333 16.0001H9.99998Z" fill="white"/>
|
||||
<path d="M4 2.66659C4 1.93021 4.59695 1.33325 5.33333 1.33325H21.1477C21.3265 1.33325 21.4979 1.40508 21.6232 1.5326L27.8088 7.8258C27.9313 7.95048 28 8.1183 28 8.29312V29.3333C28 30.0696 27.403 30.6666 26.6667 30.6666H5.33333C4.59695 30.6666 4 30.0696 4 29.3333V2.66659Z" fill="#3370FF"/>
|
||||
<path d="M16.1345 19.4365L17.8194 21.0832C17.9747 21.2351 17.9747 21.4813 17.8194 21.6332L17.2567 22.1832C17.1013 22.3351 16.8493 22.3351 16.6939 22.1832L14.1618 19.7083L13.5991 19.1583C13.2883 18.8546 13.2883 18.3621 13.5991 18.0584L16.6939 15.0335C16.8493 14.8817 17.1013 14.8817 17.2567 15.0335L17.8194 15.5835C17.9747 15.7354 17.9747 15.9816 17.8194 16.1335L15.9885 17.9229L23.3781 17.8909L23.3815 17.8909C23.6013 17.8918 23.7787 18.0667 23.7778 18.2814L23.7747 19.0179C23.7738 19.2314 23.5969 19.4043 23.3785 19.4052L16.1345 19.4365ZM18.9653 12.4445H9.81379V24.8889H18.9653C19.185 24.8889 19.3632 25.063 19.3632 25.2778V26.0556C19.3632 26.2704 19.185 26.4445 18.9653 26.4445H9.01801C8.57851 26.4445 8.22223 26.0962 8.22223 25.6667V11.6667C8.22223 11.2371 8.57851 10.8889 9.01801 10.8889H18.9653C19.185 10.8889 19.3632 11.063 19.3632 11.2778V12.0556C19.3632 12.2704 19.185 12.4445 18.9653 12.4445Z" fill="white"/>
|
||||
<path d="M21.3333 1.33325C21.4422 1.36481 21.5423 1.42392 21.6232 1.50624L27.8088 7.79945C27.8594 7.85097 27.9008 7.90986 27.932 7.97357H22.8468C22.0109 7.97357 21.3333 7.29594 21.3333 6.46005V1.33325Z" fill="#2B5FD9"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
|
|
@ -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);
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -84,6 +84,27 @@
|
|||
</div>
|
||||
</div>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item>
|
||||
<el-upload
|
||||
ref="elUploadRef"
|
||||
:file-list="[]"
|
||||
action="#"
|
||||
multiple
|
||||
:auto-upload="false"
|
||||
:show-file-list="false"
|
||||
:limit="1"
|
||||
:on-change="(file: any, fileList: any) => importApplication(file)"
|
||||
>
|
||||
<div class="flex align-center">
|
||||
<el-avatar shape="square" class="mt-4" :size="36" style="background: none">
|
||||
<img src="@/assets/application/icon_import_app.svg" alt="" />
|
||||
</el-avatar>
|
||||
<div class="pre-wrap ml-8">
|
||||
<div class="lighter">{{ $t('views.application.importApplication') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-upload>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click="openCreateFolder" divided>
|
||||
<div class="flex align-center">
|
||||
<AppIcon iconName="app-folder" style="font-size: 32px"></AppIcon>
|
||||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue