Merge branch 'pr@main@model_embedding' of github.com:1Panel-dev/MaxKB into pr@main@model_embedding
This commit is contained in:
commit
2619ca6d39
@ -99,7 +99,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="isDataset">
|
<template v-else-if="isDataset">
|
||||||
<div class="w-full text-left cursor" @click="router.push({ path: '/dataset/create' })">
|
<div class="w-full text-left cursor" @click="openCreateDialog">
|
||||||
<el-button link>
|
<el-button link>
|
||||||
<el-icon class="mr-4"><Plus /></el-icon> 创建知识库
|
<el-icon class="mr-4"><Plus /></el-icon> 创建知识库
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -110,12 +110,14 @@
|
|||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
<CreateApplicationDialog ref="CreateApplicationDialogRef" @refresh="refresh" />
|
<CreateApplicationDialog ref="CreateApplicationDialogRef" @refresh="refresh" />
|
||||||
|
<CreateDatasetDialog ref="CreateDatasetDialogRef" @refresh="refresh" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, computed } from 'vue'
|
import { ref, onMounted, computed } from 'vue'
|
||||||
import { onBeforeRouteLeave, useRouter, useRoute } from 'vue-router'
|
import { onBeforeRouteLeave, useRouter, useRoute } from 'vue-router'
|
||||||
import CreateApplicationDialog from '@/views/application/component/CreateApplicationDialog.vue'
|
import CreateApplicationDialog from '@/views/application/component/CreateApplicationDialog.vue'
|
||||||
|
import CreateDatasetDialog from '@/views/dataset/component/CreateDatasetDialog.vue'
|
||||||
import { isAppIcon, isWorkFlow } from '@/utils/application'
|
import { isAppIcon, isWorkFlow } from '@/utils/application'
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
const { common, dataset, application } = useStore()
|
const { common, dataset, application } = useStore()
|
||||||
@ -130,6 +132,7 @@ onBeforeRouteLeave((to, from) => {
|
|||||||
common.saveBreadcrumb(null)
|
common.saveBreadcrumb(null)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const CreateDatasetDialogRef = ref()
|
||||||
const CreateApplicationDialogRef = ref()
|
const CreateApplicationDialogRef = ref()
|
||||||
const list = ref<any[]>([])
|
const list = ref<any[]>([])
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
@ -148,7 +151,11 @@ const isDataset = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
function openCreateDialog() {
|
function openCreateDialog() {
|
||||||
CreateApplicationDialogRef.value.open()
|
if (isDataset.value) {
|
||||||
|
CreateDatasetDialogRef.value.open()
|
||||||
|
} else if (isApplication.value) {
|
||||||
|
CreateApplicationDialogRef.value.open()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeMenu(id: string) {
|
function changeMenu(id: string) {
|
||||||
|
|||||||
@ -89,6 +89,8 @@ import { MsgSuccess, MsgAlert } from '@/utils/message'
|
|||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
import { ValidType, ValidCount } from '@/enums/common'
|
import { ValidType, ValidCount } from '@/enums/common'
|
||||||
|
|
||||||
|
const emit = defineEmits(['refresh'])
|
||||||
|
|
||||||
const { common, user } = useStore()
|
const { common, user } = useStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const BaseFormRef = ref()
|
const BaseFormRef = ref()
|
||||||
@ -150,12 +152,14 @@ const submitHandle = async () => {
|
|||||||
datasetApi.postDataset(obj, loading).then((res) => {
|
datasetApi.postDataset(obj, loading).then((res) => {
|
||||||
MsgSuccess('创建成功')
|
MsgSuccess('创建成功')
|
||||||
router.push({ path: `/dataset/${res.data.id}/document` })
|
router.push({ path: `/dataset/${res.data.id}/document` })
|
||||||
|
emit('refresh')
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
const obj = { ...BaseFormRef.value.form, ...datasetForm.value }
|
const obj = { ...BaseFormRef.value.form, ...datasetForm.value }
|
||||||
datasetApi.postWebDataset(obj, loading).then((res) => {
|
datasetApi.postWebDataset(obj, loading).then((res) => {
|
||||||
MsgSuccess('创建成功')
|
MsgSuccess('创建成功')
|
||||||
router.push({ path: `/dataset/${res.data.id}/document` })
|
router.push({ path: `/dataset/${res.data.id}/document` })
|
||||||
|
emit('refresh')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user