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