mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: 修复已关联知识库问题
This commit is contained in:
parent
3266e405c7
commit
d7fb585bce
|
|
@ -39,7 +39,10 @@
|
|||
<span class="label">备注</span><span>{{ licenseInfo?.remark || '-' }}</span>
|
||||
</div>
|
||||
|
||||
<div class="mt-16 flex align-center" v-if="user.isXPack">
|
||||
<div
|
||||
class="mt-16 flex align-center"
|
||||
v-hasPermission="new ComplexPermission(['ADMIN'], ['x-pack'], 'OR')"
|
||||
>
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
action="#"
|
||||
|
|
@ -59,6 +62,7 @@
|
|||
import { ref, computed } from 'vue'
|
||||
import licenseApi from '@/api/license'
|
||||
import { fromNowDate } from '@/utils/time'
|
||||
import { ComplexPermission } from '@/utils/permission/type'
|
||||
import useStore from '@/stores'
|
||||
const { user } = useStore()
|
||||
const isDefaultTheme = computed(() => {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { Role, ComplexPermission } from '@/utils/permission/type'
|
|||
const settingRouter = {
|
||||
path: '/setting',
|
||||
name: 'setting',
|
||||
meta: { icon: 'Setting', title: '系统管理', permission: 'SETTING:READ' },
|
||||
meta: { icon: 'Setting', title: '系统设置', permission: 'SETTING:READ' },
|
||||
redirect: () => {
|
||||
if (hasPermission(new Role('ADMIN'), 'AND')) {
|
||||
return '/user'
|
||||
|
|
@ -59,7 +59,7 @@ const settingRouter = {
|
|||
meta: {
|
||||
icon: 'app-setting',
|
||||
iconActive: 'app-setting-active',
|
||||
title: '系统管理',
|
||||
title: '系统设置',
|
||||
activeMenu: '/setting',
|
||||
parentPath: '/setting',
|
||||
parentName: 'setting',
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@
|
|||
margin-right: calc(var(--app-base-px) + 4px);
|
||||
}
|
||||
.el-slider__input {
|
||||
width: 60px;
|
||||
width: 72px;
|
||||
}
|
||||
|
||||
.input-with-select {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
width="600"
|
||||
append-to-body
|
||||
class="addDataset-dialog"
|
||||
align-center
|
||||
>
|
||||
<template #header="{ titleId, titleClass }">
|
||||
<div class="flex-between mb-8">
|
||||
|
|
@ -23,19 +24,23 @@
|
|||
所选知识库必须使用相同的 Embedding 模型
|
||||
</el-text>
|
||||
</template>
|
||||
<el-row :gutter="12" v-loading="loading">
|
||||
<el-col :span="12" v-for="(item, index) in filterData" :key="index" class="mb-16">
|
||||
<CardCheckbox value-field="id" :data="item" v-model="checkList" @change="changeHandle">
|
||||
<span class="ellipsis">
|
||||
{{ item.name }}
|
||||
</span>
|
||||
</CardCheckbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-scrollbar>
|
||||
<div class="max-height">
|
||||
<el-row :gutter="12" v-loading="loading">
|
||||
<el-col :span="12" v-for="(item, index) in filterData" :key="index" class="mb-16">
|
||||
<CardCheckbox value-field="id" :data="item" v-model="checkList" @change="changeHandle">
|
||||
<span class="ellipsis">
|
||||
{{ item.name }}
|
||||
</span>
|
||||
</CardCheckbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
<template #footer>
|
||||
<div class="flex-between">
|
||||
<div>
|
||||
<el-text type="info" class="color-secondary" v-if="checkList.length > 0">
|
||||
<div class="flex">
|
||||
<el-text type="info" class="color-secondary mr-8" v-if="checkList.length > 0">
|
||||
已选 {{ checkList.length }} 个知识库
|
||||
</el-text>
|
||||
<el-button link type="primary" v-if="checkList.length > 0" @click="clearCheck">
|
||||
|
|
@ -87,6 +92,8 @@ function changeHandle() {
|
|||
currentEmbedding.value = props.data.filter(
|
||||
(v) => v.id === checkList.value[0]
|
||||
)[0].embedding_mode_id
|
||||
} else if (checkList.value.length === 0) {
|
||||
currentEmbedding.value = ''
|
||||
}
|
||||
}
|
||||
function clearCheck() {
|
||||
|
|
@ -96,6 +103,12 @@ function clearCheck() {
|
|||
|
||||
const open = (checked: any) => {
|
||||
checkList.value = checked
|
||||
if (checkList.value.length > 0) {
|
||||
currentEmbedding.value = props.data.filter(
|
||||
(v) => v.id === checkList.value[0]
|
||||
)[0].embedding_mode_id
|
||||
}
|
||||
|
||||
dialogVisible.value = true
|
||||
}
|
||||
const submitHandle = () => {
|
||||
|
|
@ -111,11 +124,25 @@ defineExpose({ open })
|
|||
</script>
|
||||
<style lang="scss" scope>
|
||||
.addDataset-dialog {
|
||||
padding: 0;
|
||||
.el-dialog__header {
|
||||
padding: 24px 24px 8px 24px;
|
||||
}
|
||||
.el-dialog__body {
|
||||
padding: 8px !important;
|
||||
}
|
||||
.el-dialog__footer {
|
||||
padding: 8px 24px 24px 24px;
|
||||
}
|
||||
.el-dialog__header.show-close {
|
||||
padding-right: 15px;
|
||||
padding-right: 34px;
|
||||
}
|
||||
.el-dialog__headerbtn {
|
||||
top: 13px;
|
||||
}
|
||||
.max-height {
|
||||
max-height: calc(100vh - 260px);
|
||||
padding: 0 16px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@
|
|||
@blur="form.desc = form.desc.trim()"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="Embedding模型" prop="embedding_mode_id">
|
||||
<el-form-item label="向量模型" prop="embedding_mode_id">
|
||||
<el-select
|
||||
v-model="form.embedding_mode_id"
|
||||
placeholder="请选择Embedding模型"
|
||||
placeholder="请选择向量模型"
|
||||
class="w-full"
|
||||
popper-class="select-model"
|
||||
:clearable="true"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<el-dialog title="创建知识库" v-model="dialogVisible" width="650" append-to-body>
|
||||
<el-dialog title="创建知识库" v-model="dialogVisible" width="680" append-to-body>
|
||||
<!-- 基本信息 -->
|
||||
<BaseForm ref="BaseFormRef" v-if="dialogVisible" />
|
||||
<el-form
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
</AppAvatar>
|
||||
<div>
|
||||
<p class="mb-4">通用型</p>
|
||||
<el-text type="info">可以通过上传文件或手动录入方式构建知识库</el-text>
|
||||
<el-text type="info">上传本地文件或手动录入</el-text>
|
||||
</div>
|
||||
</div>
|
||||
</el-radio>
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
</AppAvatar>
|
||||
<div>
|
||||
<p class="mb-4">Web 站点</p>
|
||||
<el-text type="info">通过网站链接同步方式构建知识库 </el-text>
|
||||
<el-text type="info">同步Web网站文本数据 </el-text>
|
||||
</div>
|
||||
</div>
|
||||
</el-radio>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<el-tag v-if="model.permission_type === 'PRIVATE'" type="danger" class="danger-tag"
|
||||
>私有</el-tag
|
||||
>
|
||||
<el-tag v-else type="info" class="info-tag">公有</el-tag>
|
||||
<el-tag v-else type="info" class="info-tag">公用</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -59,7 +59,7 @@
|
|||
</div>
|
||||
|
||||
<template #mouseEnter>
|
||||
<div class="operation-button">
|
||||
<div class="operation-button" v-if="model.permission_type === 'PUBLIC'">
|
||||
<el-tooltip effect="dark" content="修改" placement="top">
|
||||
<el-button text :disabled="!is_permisstion" @click.stop="openEditModel">
|
||||
<el-icon>
|
||||
|
|
|
|||
Loading…
Reference in New Issue