mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-31 02:02:48 +00:00
Merge branch 'main' of github.com:maxkb-dev/maxkb
This commit is contained in:
commit
4a707703a3
|
|
@ -14,7 +14,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.27.2",
|
||||
"element-plus": "^2.5.3",
|
||||
"element-plus": "^2.5.6",
|
||||
"install": "^0.13.0",
|
||||
"lodash": "^4.17.21",
|
||||
"markdown-it": "^13.0.2",
|
||||
|
|
|
|||
|
|
@ -1,5 +1 @@
|
|||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M9.33333 1.33337H6.66667V3.33337H7.33333V4.66671H3.66667C2.93029 4.66671 2.33333 5.26366 2.33333 6.00004V13.3334C2.33333 14.0698 2.93029 14.6667 3.66667 14.6667H12.3333C13.0697 14.6667 13.6667 14.0698 13.6667 13.3334V6.00004C13.6667 5.26366 13.0697 4.66671 12.3333 4.66671H8.66667V3.33337H9.33333V1.33337ZM4.66667 8.66671H6.66667V10.6667H4.66667V8.66671ZM11.3333 8.66671V10.6667H9.33333V8.66671H11.3333Z" fill="white"/>
|
||||
<path d="M1.33333 8.00004H0V11.3334H1.33333V8.00004Z" fill="white"/>
|
||||
<path d="M14.6667 8.00004H16V11.3334H14.6667V8.00004Z" fill="white"/>
|
||||
</svg>
|
||||
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 232.4409 232.4409"><defs><style>.cls-1{fill:#fff;}</style></defs><title>MaxKB</title><path class="cls-1" d="M128.4532,177H98.7785L87.78,187.9985a4.6069,4.6069,0,0,0,3.2576,7.8644h45.1569a4.6069,4.6069,0,0,0,3.2575-7.8644Z"/><path class="cls-1" d="M210.0008,90.7042h-5.85v41.1511h5.85a4.4537,4.4537,0,0,0,4.4537-4.4537V95.1579A4.4537,4.4537,0,0,0,210.0008,90.7042Z"/><path class="cls-1" d="M28.29,90.7042H22.44a4.4538,4.4538,0,0,0-4.4538,4.4537v32.2437a4.4538,4.4538,0,0,0,4.4538,4.4537h5.85Z"/><path class="cls-1" d="M138.8087,96.1512a8.33,8.33,0,0,0-8.33,8.33v5.9727a8.33,8.33,0,1,0,16.6607,0v-5.9727A8.33,8.33,0,0,0,138.8087,96.1512Z"/><path class="cls-1" d="M95.3622,96.1512a8.33,8.33,0,0,0-8.33,8.33v5.9727a8.33,8.33,0,1,0,16.6607,0v-5.9727A8.33,8.33,0,0,0,95.3622,96.1512Z"/><path class="cls-1" d="M166.8344,48.8968H65.6064A33.7544,33.7544,0,0,0,31.89,82.6131v57.07A33.7548,33.7548,0,0,0,65.6064,173.4h101.228a33.7549,33.7549,0,0,0,33.7168-33.7168v-57.07A33.7545,33.7545,0,0,0,166.8344,48.8968Zm2.831,90.4457a6.0733,6.0733,0,0,1-6.0732,6.0733H114.2168a43.5922,43.5922,0,0,0-21.3313,5.5757l-16.5647,9.2946v-14.87h-7.472a6.0733,6.0733,0,0,1-6.0733-6.0733v-60.5a6.0733,6.0733,0,0,1,6.0733-6.0733h94.7434a6.0733,6.0733,0,0,1,6.0732,6.0733Z"/></svg>
|
||||
|
Before Width: | Height: | Size: 671 B After Width: | Height: | Size: 1.3 KiB |
|
|
@ -5,7 +5,7 @@
|
|||
<div class="item-content mb-16">
|
||||
<div class="avatar">
|
||||
<AppAvatar class="avatar-gradient">
|
||||
<img src="@/assets/icon_robot.svg" style="width: 54%" alt="" />
|
||||
<img src="@/assets/icon_robot.svg" style="width: 75%" alt="" />
|
||||
</AppAvatar>
|
||||
</div>
|
||||
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
<div class="item-content mb-16 lighter">
|
||||
<div class="avatar">
|
||||
<AppAvatar class="avatar-gradient">
|
||||
<img src="@/assets/icon_robot.svg" style="width: 54%" alt="" />
|
||||
<img src="@/assets/icon_robot.svg" style="width: 75%" alt="" />
|
||||
</AppAvatar>
|
||||
</div>
|
||||
<div class="content">
|
||||
|
|
@ -621,6 +621,7 @@ watch(
|
|||
}
|
||||
.dialog-card {
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<el-button @click="showInput = false" :disabled="loading">取消</el-button>
|
||||
</div>
|
||||
<div v-else @click="quickCreateHandel" class="w-full">
|
||||
<el-button type="primary" link>
|
||||
<el-button type="primary" link class="quich-button">
|
||||
<el-icon><Plus /></el-icon>
|
||||
<span class="ml-4">快速创建空白文档</span>
|
||||
</el-button>
|
||||
|
|
@ -111,5 +111,10 @@ onMounted(() => {
|
|||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.quich-button {
|
||||
&:hover {
|
||||
color: var(--el-button-text-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<el-button class="back-button cursor mr-4" text @click="jump">
|
||||
<el-icon>
|
||||
<el-icon :size="20">
|
||||
<Back />
|
||||
</el-icon>
|
||||
</el-button>
|
||||
|
|
@ -28,8 +28,4 @@ function jump() {
|
|||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.back-button {
|
||||
font-size: 20px;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss"></style>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ defineProps({
|
|||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
min-height: var(--card-min-height);
|
||||
border: 1px dashed var(--el-color-primary);
|
||||
border: 1px dashed var(--el-border-color);
|
||||
background: #eff0f1;
|
||||
border-radius: 8px;
|
||||
|
||||
|
|
@ -38,6 +38,7 @@ defineProps({
|
|||
&:hover {
|
||||
color: var(--el-color-primary);
|
||||
background: #ffffff;
|
||||
border: 1px dashed var(--el-color-primary);
|
||||
.add-icon {
|
||||
background: #ffffff;
|
||||
border-color: var(--el-color-primary);
|
||||
|
|
|
|||
|
|
@ -100,6 +100,12 @@ function removeTag(index: number) {
|
|||
min-height: 70px;
|
||||
border: 1px solid var(--el-border-color);
|
||||
border-radius: var(--el-border-radius-base);
|
||||
&:hover {
|
||||
border: 1px solid var(--el-color-primary);
|
||||
}
|
||||
&:focus-within {
|
||||
border: 1px solid var(--el-color-primary);
|
||||
}
|
||||
:deep(.el-autocomplete) {
|
||||
width: 100%;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,13 +9,13 @@
|
|||
</div>
|
||||
</template>
|
||||
<ul class="about-ui">
|
||||
<li class="flex">
|
||||
<li class="flex mb-16">
|
||||
<span class="label text-right">授权数量:</span><span class="text-center">-</span>
|
||||
</li>
|
||||
<li class="flex">
|
||||
<li class="flex mb-16">
|
||||
<span class="label text-right">过期时间:</span><span class="text-center">-</span>
|
||||
</li>
|
||||
<li class="flex">
|
||||
<li class="flex mb-16">
|
||||
<span class="label text-right">版本:</span><span class="text-center">-</span>
|
||||
</li>
|
||||
<li class="flex">
|
||||
|
|
@ -39,28 +39,38 @@ defineExpose({ open })
|
|||
</script>
|
||||
<style lang="scss" scope>
|
||||
.about-dialog {
|
||||
padding: 0;
|
||||
border-radius: 4px;
|
||||
width: 600px;
|
||||
.el-dialog__header {
|
||||
background: var(--app-header-bg-color);
|
||||
margin-right: 0;
|
||||
height: 45px;
|
||||
height: 140px;
|
||||
border-radius: 4px 4px 0 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.el-dialog__title {
|
||||
line-height: 140px;
|
||||
}
|
||||
.about-title {
|
||||
font-size: 24px;
|
||||
font-size: 40px;
|
||||
}
|
||||
.logo {
|
||||
background-image: url('@/assets/logo.png');
|
||||
background-size: 100% 100%;
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
width: 59px;
|
||||
height: 59px;
|
||||
}
|
||||
.about-ui {
|
||||
width: 200px;
|
||||
padding: 24px;
|
||||
width: 360px;
|
||||
margin: 0 auto;
|
||||
line-height: 30px;
|
||||
span {
|
||||
width: 80px;
|
||||
font-weight: 400;
|
||||
font-size: 16px;
|
||||
.label {
|
||||
width: 180px;
|
||||
text-align: left;
|
||||
color: var(--app-text-color-secondary);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
<template>
|
||||
<el-dialog v-model="resetPasswordDialog" title="修改密码">
|
||||
<el-form
|
||||
class="reset-password-form"
|
||||
class="reset-password-form mb-24"
|
||||
ref="resetPasswordFormRef"
|
||||
:model="resetPasswordForm"
|
||||
:rules="rules"
|
||||
>
|
||||
<p class="mb-8">新密码</p>
|
||||
<p class="mb-8 lighter">新密码</p>
|
||||
<el-form-item prop="password" style="margin-bottom: 8px">
|
||||
<el-input
|
||||
type="password"
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<p class="mb-8">使用邮箱</p>
|
||||
<p class="mb-8 lighter">使用邮箱</p>
|
||||
<el-form-item style="margin-bottom: 8px">
|
||||
<el-input
|
||||
class="input-item"
|
||||
|
|
@ -48,10 +48,10 @@
|
|||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="resetPasswordDialog = false"> 取消 </el-button>
|
||||
<el-button type="primary" @click="resetPassword"> 保存 </el-button>
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
<template>
|
||||
<div class="top-bar-container border-b flex-between">
|
||||
<div class="flex-center h-full">
|
||||
<div class="app-title-container flex-center">
|
||||
<div class="app-title-icon"></div>
|
||||
<div class="app-title-text app-logo-font ml-4">
|
||||
{{ defaultTitle }}
|
||||
<a href="/">
|
||||
<div class="app-title-container flex-center">
|
||||
<div class="app-title-icon"></div>
|
||||
<div class="app-title-text app-logo-font ml-4">
|
||||
{{ defaultTitle }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
<TopMenu></TopMenu>
|
||||
</div>
|
||||
<div class="avatar">
|
||||
|
|
|
|||
|
|
@ -4,11 +4,13 @@
|
|||
--el-menu-item-height: 45px;
|
||||
--el-box-shadow-light: 0px 2px 4px 0px rgba(31, 35, 41, 0.12);
|
||||
--el-border-color: #dee0e3;
|
||||
--el-text-color-regular: #1f2329;
|
||||
--el-color-info: #8F959E
|
||||
}
|
||||
|
||||
.el-button {
|
||||
--el-button-font-weight: 400;
|
||||
padding: 5px 12px;
|
||||
|
||||
&.is-text {
|
||||
padding: 4px !important;
|
||||
font-size: 16px;
|
||||
|
|
@ -46,25 +48,37 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
.el-form-item__label {
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.el-form-item__error {
|
||||
position: unset;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.el-form--label-top .el-form-item .el-form-item__label {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.el-dialog {
|
||||
--el-dialog-title-font-size: 16px;
|
||||
--el-dialog-padding-primary: 24px;
|
||||
--el-dialog-content-font-size: 14px;
|
||||
.dialog-sub-title {
|
||||
color: var(--el-text-color-regular);
|
||||
color: var(--app-text-color-secondary);
|
||||
margin: 5px 0;
|
||||
font-weight: 400;
|
||||
}
|
||||
.el-dialog__body {
|
||||
padding: 16px var(--el-dialog-padding-primary) 8px !important;
|
||||
color: var(--app-text-color);
|
||||
}
|
||||
}
|
||||
.el-dialog__headerbtn {
|
||||
top: 6px;
|
||||
}
|
||||
.el-dialog__header {
|
||||
padding-bottom: 8px;
|
||||
padding-bottom: 24px;
|
||||
}
|
||||
.el-dialog__footer {
|
||||
padding-top: 0;
|
||||
|
|
@ -102,8 +116,8 @@
|
|||
}
|
||||
}
|
||||
.el-message-box__headerbtn {
|
||||
right: -5px;
|
||||
top: -5px;
|
||||
right: 10px;
|
||||
top: 15px;
|
||||
.el-message-box__close {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
|
@ -175,9 +189,6 @@
|
|||
|
||||
.el-text {
|
||||
font-weight: 400;
|
||||
&.el-text--info {
|
||||
color: var(--app-text-color-secondary);
|
||||
}
|
||||
}
|
||||
|
||||
.el-switch {
|
||||
|
|
@ -206,9 +217,16 @@
|
|||
background-color: var(--el-fill-color-blank);
|
||||
}
|
||||
}
|
||||
.el-textarea {
|
||||
--el-input-placeholder-color: var(--app-input-color-placeholder);
|
||||
}
|
||||
.el-textarea__inner {
|
||||
font-size: 14px;
|
||||
}
|
||||
.el-input {
|
||||
--el-input-icon-color: var(--app-text-color-secondary);
|
||||
--el-input-placeholder-color: var(--app-input-color-placeholder);
|
||||
}
|
||||
|
||||
.el-input__inner {
|
||||
font-size: 14px;
|
||||
|
|
@ -224,13 +242,27 @@
|
|||
}
|
||||
}
|
||||
|
||||
.el-select__placeholder.is-transparent {
|
||||
color: var(--app-input-color-placeholder);
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.el-select-group .el-select-dropdown__item {
|
||||
padding-left: 11px;
|
||||
}
|
||||
|
||||
.el-select {
|
||||
min-width: 200px;
|
||||
}
|
||||
.el-select__caret {
|
||||
color: var(--app-text-color-secondary);
|
||||
}
|
||||
.el-tabs__header {
|
||||
margin: 0 0 12px;
|
||||
}
|
||||
.el-tabs__item {
|
||||
padding: 0 14px;
|
||||
}
|
||||
|
||||
.el-drawer {
|
||||
.el-drawer__header {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
--app-text-color-light-1: rgba(31, 35, 41, 0.1);
|
||||
--app-text-color-secondary: #646a73;
|
||||
--app-text-color-disable: #bbbfc4;
|
||||
--app-input-color-placeholder: #8f959e;
|
||||
--app-view-padding: 24px;
|
||||
--app-view-bg-color: #ffffff;
|
||||
--app-border-color-dark: #bbbfc4;
|
||||
|
|
@ -25,10 +26,10 @@
|
|||
/** tag */
|
||||
--tag-deflaut-bg: rgba(51, 112, 255, 0.2);
|
||||
--tag-deflaut-color: #2b5fd9;
|
||||
--tag-success-bg: rgba(52, 199, 36, 0.20);
|
||||
--tag-success-color: #2CA91F;
|
||||
--tag-warning-bg: rgba(255, 136, 0, 0.20);
|
||||
--tag-warning-color: #D97400;
|
||||
--tag-success-bg: rgba(52, 199, 36, 0.2);
|
||||
--tag-success-color: #2ca91f;
|
||||
--tag-warning-bg: rgba(255, 136, 0, 0.2);
|
||||
--tag-warning-color: #d97400;
|
||||
|
||||
/** card */
|
||||
--card-width: 330px;
|
||||
|
|
@ -42,5 +43,10 @@
|
|||
--create-dataset-height: calc(var(--app-main-height) - 70px);
|
||||
|
||||
/** ai-chat */
|
||||
--dialog-bg-gradient-color: linear-gradient(188deg, rgba(235, 241, 255, 0.20) 39.6%, rgba(231, 249, 255, 0.20) 94.3%), #EFF0F1;
|
||||
--dialog-bg-gradient-color: linear-gradient(
|
||||
188deg,
|
||||
rgba(235, 241, 255, 0.2) 39.6%,
|
||||
rgba(231, 249, 255, 0.2) 94.3%
|
||||
),
|
||||
#eff0f1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="100">
|
||||
<el-table-column label="状态" width="60">
|
||||
<template #default="{ row }">
|
||||
<div @click.stop>
|
||||
<el-switch size="small" v-model="row.is_active" @change="changeState($event, row)" />
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
/>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 url-height">
|
||||
<div class="mt-4 mb-16 url-height">
|
||||
<span class="vertical-middle lighter break-all">
|
||||
{{ shareUrl }}
|
||||
</span>
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
<div class="flex">
|
||||
<el-text type="info">API访问凭据</el-text>
|
||||
</div>
|
||||
<div class="mt-4 url-height">
|
||||
<div class="mt-4 mb-16 url-height">
|
||||
<span class="vertical-middle lighter break-all">
|
||||
{{ apiUrl }}
|
||||
</span>
|
||||
|
|
@ -157,7 +157,7 @@ onMounted(() => {
|
|||
top: 21px;
|
||||
}
|
||||
.url-height {
|
||||
min-height: 50px;
|
||||
// min-height: 50px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -102,95 +102,100 @@
|
|||
<template #label>
|
||||
<div class="flex-between">
|
||||
<span>关联知识库</span>
|
||||
<div>
|
||||
<el-popover :visible="popoverVisible" :width="300" trigger="click">
|
||||
<template #reference>
|
||||
<el-button type="primary" link @click="datasetSettingChange('open')"
|
||||
><el-icon class="mr-4"><Operation /></el-icon>参数设置</el-button
|
||||
>
|
||||
</template>
|
||||
<div class="dataset_setting">
|
||||
<div class="form-item mb-16 p-8">
|
||||
<div class="title flex align-center mb-8">
|
||||
<span style="margin-right: 4px">相似度</span>
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
content="相似度越高相关性越强。"
|
||||
placement="right"
|
||||
>
|
||||
<el-icon style="font-size: 16px">
|
||||
<Warning />
|
||||
</el-icon>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div @click.stop>
|
||||
高于
|
||||
<el-input-number
|
||||
v-model="dataset_setting.similarity"
|
||||
:min="0"
|
||||
:max="1"
|
||||
:precision="3"
|
||||
:step="0.1"
|
||||
controls-position="right"
|
||||
style="width: 100px"
|
||||
size="small"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-item mb-16 p-8">
|
||||
<div class="title mb-8">引用分段数</div>
|
||||
<div @click.stop>
|
||||
TOP
|
||||
<el-input-number
|
||||
v-model="dataset_setting.top_n"
|
||||
:min="1"
|
||||
:max="10"
|
||||
controls-position="right"
|
||||
style="width: 100px"
|
||||
size="small"
|
||||
/>
|
||||
个分段
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-popover :visible="popoverVisible" :width="300" trigger="click">
|
||||
<template #reference>
|
||||
<el-button type="primary" link @click="datasetSettingChange('open')"
|
||||
>参数设置</el-button
|
||||
>
|
||||
</template>
|
||||
<div class="dataset_setting">
|
||||
<div class="form-item mb-16 p-8">
|
||||
<div class="title flex align-center mb-8">
|
||||
<span style="margin-right: 4px">相似度</span>
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
content="相似度越高相关性越强。"
|
||||
placement="right"
|
||||
>
|
||||
<el-icon style="font-size: 16px">
|
||||
<Warning />
|
||||
</el-icon>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div @click.stop>
|
||||
高于
|
||||
<el-input-number
|
||||
v-model="dataset_setting.similarity"
|
||||
:min="0"
|
||||
:max="1"
|
||||
:precision="3"
|
||||
:step="0.1"
|
||||
controls-position="right"
|
||||
style="width: 100px"
|
||||
size="small"
|
||||
/>
|
||||
<div class="form-item mb-16 p-8">
|
||||
<div class="title mb-8">最多引用字符数</div>
|
||||
<div class="flex align-center">
|
||||
<el-slider
|
||||
v-model="dataset_setting.max_paragraph_char_number"
|
||||
show-input
|
||||
:show-input-controls="false"
|
||||
:min="500"
|
||||
:max="10000"
|
||||
style="width: 200px"
|
||||
size="small"
|
||||
class="custom-slider"
|
||||
/>
|
||||
<span class="ml-4">个字符</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-item mb-16 p-8">
|
||||
<div class="title mb-8">引用分段数</div>
|
||||
<div @click.stop>
|
||||
TOP
|
||||
<el-input-number
|
||||
v-model="dataset_setting.top_n"
|
||||
:min="1"
|
||||
:max="10"
|
||||
controls-position="right"
|
||||
style="width: 100px"
|
||||
size="small"
|
||||
/>
|
||||
个分段
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<el-button size="small" @click="popoverVisible = false">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="datasetSettingChange('close')"
|
||||
size="small"
|
||||
>确认</el-button
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="form-item mb-16 p-8">
|
||||
<div class="title mb-8">最多引用字符数</div>
|
||||
<div class="flex align-center">
|
||||
<el-slider
|
||||
v-model="dataset_setting.max_paragraph_char_number"
|
||||
show-input
|
||||
:show-input-controls="false"
|
||||
:min="500"
|
||||
:max="10000"
|
||||
style="width: 200px"
|
||||
size="small"
|
||||
class="custom-slider"
|
||||
/>
|
||||
<span class="ml-4">个字符</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<el-button size="small" @click="popoverVisible = false">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="datasetSettingChange('close')"
|
||||
size="small"
|
||||
>确认</el-button
|
||||
>
|
||||
</div>
|
||||
</el-popover>
|
||||
</el-popover>
|
||||
<el-button type="primary" link @click="openDatasetDialog"
|
||||
><el-icon class="mr-4"><Plus /></el-icon>添加</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<div class="w-full">
|
||||
<el-text type="info">关联的知识库展示在这里</el-text>
|
||||
<el-row :gutter="12">
|
||||
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" class="mb-8">
|
||||
<!-- <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" class="mb-8">
|
||||
<CardAdd
|
||||
title="关联知识库"
|
||||
@click="openDatasetDialog"
|
||||
style="min-height: 50px; font-size: 14px"
|
||||
/>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col
|
||||
:xs="24"
|
||||
:sm="24"
|
||||
|
|
@ -241,13 +246,13 @@
|
|||
<el-form-item @click.prevent>
|
||||
<template #label>
|
||||
<div class="flex align-center">
|
||||
<span>问题优化</span>
|
||||
<span class="mr-4">问题优化</span>
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
content="根据历史聊天优化完善当前问题,更利于匹配知识点。"
|
||||
placement="right"
|
||||
>
|
||||
<el-icon style="font-size: 16px">
|
||||
<el-icon :size="16">
|
||||
<Warning />
|
||||
</el-icon>
|
||||
</el-tooltip>
|
||||
|
|
@ -334,27 +339,16 @@ const {
|
|||
} = route as any
|
||||
|
||||
const defaultPrompt = `已知信息:
|
||||
|
||||
{data}
|
||||
|
||||
回答要求:
|
||||
|
||||
- 请简洁和专业的来回答用户的问题。
|
||||
|
||||
- 如果你不知道答案,请回答“没有在知识库中查找到相关信息,建议咨询相关技术支持或参考官方文档进行操作”。
|
||||
|
||||
- 避免提及你是从已知信息中获得的知识。
|
||||
|
||||
- 请保证答案与已知信息中描述的一致。
|
||||
|
||||
- 请使用 Markdown 语法优化答案的格式。
|
||||
|
||||
- 已知信息中的图片、链接地址和脚本语言请直接返回。
|
||||
|
||||
- 请使用与问题相同的语言来回答。
|
||||
|
||||
问题:
|
||||
|
||||
{question}
|
||||
`
|
||||
const createModelRef = ref<InstanceType<typeof CreateModelDialog>>()
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<el-input
|
||||
v-model="searchValue"
|
||||
@change="searchHandle"
|
||||
placeholder="按 名称 搜索"
|
||||
placeholder="按名称搜索"
|
||||
prefix-icon="Search"
|
||||
class="w-240"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ onMounted(() => {
|
|||
height: var(--app-header-height);
|
||||
line-height: var(--app-header-height);
|
||||
box-sizing: border-box;
|
||||
border-bottom: 1px solid rgba(31, 35, 41, 0.15);
|
||||
}
|
||||
&__main {
|
||||
padding-top: calc(var(--app-header-height) + 24px);
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="create-dataset__footer text-right border-t" v-if="active !== 2">
|
||||
<el-button @click="router.go(-1)" :disabled="loading">取 消</el-button>
|
||||
<el-button @click="router.go(-1)" :disabled="loading">取消</el-button>
|
||||
<el-button @click="prev" v-if="active === 1" :disabled="loading">上一步</el-button>
|
||||
<el-button @click="next" type="primary" v-if="active === 0" :disabled="loading">
|
||||
创建并导入
|
||||
|
|
|
|||
|
|
@ -15,18 +15,22 @@
|
|||
<el-form-item label="知识库类型" required>
|
||||
<el-card shadow="never" class="mb-8" v-if="detail.type === '0'">
|
||||
<div class="flex align-center">
|
||||
<el-icon size="32" class="mr-8 info"><Document /></el-icon>
|
||||
<AppAvatar class="mr-8" shape="square" :size="32">
|
||||
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
<div>
|
||||
<p>通用型</p>
|
||||
<div>通用型</div>
|
||||
<el-text type="info">可以通过上传文件或手动录入方式构建知识库</el-text>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mb-8" v-if="detail?.type === '1'">
|
||||
<div class="flex align-center">
|
||||
<el-icon size="32" class="mr-8 info"><Monitor /></el-icon>
|
||||
<AppAvatar class="mr-8 avatar-purple" shape="square" :size="32">
|
||||
<img src="@/assets/icon_web.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
<div>
|
||||
<p>Web 站点</p>
|
||||
<div>Web 站点</div>
|
||||
<el-text type="info"> 通过网站链接同步方式构建知识库 </el-text>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<div>
|
||||
<!-- 编辑分段按钮 -->
|
||||
<el-button link @click="editHandle(child, index, cIndex)">
|
||||
<el-icon><Edit /></el-icon>
|
||||
<el-icon><EditPen /></el-icon>
|
||||
</el-button>
|
||||
<!-- 删除分段按钮 -->
|
||||
<el-button link @click="deleteHandle(child, index, cIndex)">
|
||||
|
|
@ -138,6 +138,6 @@ onMounted(() => {})
|
|||
}
|
||||
}
|
||||
.paragraph-list {
|
||||
height: calc(var(--create-dataset-height) - 95px);
|
||||
height: calc(var(--create-dataset-height) - 131px);
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<el-input
|
||||
v-model="searchValue"
|
||||
@change="searchHandle"
|
||||
placeholder="按 名称 搜索"
|
||||
placeholder="按名称搜索"
|
||||
prefix-icon="Search"
|
||||
class="w-240"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,9 @@
|
|||
<el-card shadow="never" class="mb-16" :class="form.type === '0' ? 'active' : ''">
|
||||
<el-radio label="0" size="large">
|
||||
<div class="flex align-center">
|
||||
<el-icon size="32" class="mr-8 info"><Document /></el-icon>
|
||||
<AppAvatar class="mr-8" shape="square" :size="32">
|
||||
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
<div>
|
||||
<p class="mb-4">通用型</p>
|
||||
<el-text type="info">可以通过上传文件或手动录入方式构建知识库</el-text>
|
||||
|
|
@ -31,10 +33,12 @@
|
|||
<el-card shadow="never" class="mb-16" :class="form.type === '1' ? 'active' : ''">
|
||||
<el-radio label="1" size="large">
|
||||
<div class="flex align-center">
|
||||
<el-icon size="32" class="mr-8 info"><Monitor /></el-icon>
|
||||
<AppAvatar class="mr-8 avatar-purple" shape="square" :size="32">
|
||||
<img src="@/assets/icon_web.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
<div>
|
||||
<p class="mb-4">Web 站点</p>
|
||||
<el-text type="info"> 通过网站链接同步方式构建知识库 </el-text>
|
||||
<el-text type="info">通过网站链接同步方式构建知识库 </el-text>
|
||||
</div>
|
||||
</div>
|
||||
</el-radio>
|
||||
|
|
|
|||
|
|
@ -201,15 +201,16 @@ defineExpose({
|
|||
position: absolute;
|
||||
top: 16px;
|
||||
}
|
||||
:deep(.el-radio__input.is-checked + .el-radio__label) {
|
||||
color: var(--app-text-color);
|
||||
}
|
||||
.active {
|
||||
border: 1px solid var(--el-color-primary);
|
||||
}
|
||||
}
|
||||
|
||||
&__form {
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<LayoutContainer header="对话日志">
|
||||
<div class="p-24">
|
||||
<div class="mb-16">
|
||||
<el-select v-model="history_day" class="mr-12" @change="changeHandle">
|
||||
<el-select v-model="history_day" class="mr-12 w-240" @change="changeHandle">
|
||||
<el-option
|
||||
v-for="item in dayOptions"
|
||||
:key="item.value"
|
||||
|
|
@ -87,7 +87,7 @@
|
|||
<AppIcon iconName="app-like-color"></AppIcon>
|
||||
{{ row.star_num }}
|
||||
</span>
|
||||
<span v-if="row.trample_num" class="ml-4">
|
||||
<span v-if="row.trample_num" class="ml-8">
|
||||
<AppIcon iconName="app-oppose-color"></AppIcon>
|
||||
{{ row.trample_num }}
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
>
|
||||
<el-row v-loading="loading">
|
||||
<el-col :span="16">
|
||||
<el-scrollbar>
|
||||
<div class="p-24" style="height: 350px">
|
||||
<el-scrollbar height="370" wrap-class="paragraph-scrollbar">
|
||||
<div class="p-24" style="padding-bottom: 8px">
|
||||
<div class="flex-between mb-16">
|
||||
<div class="bold title align-center">分段内容</div>
|
||||
<el-button text @click="isEdit = true" v-if="problemId && !isEdit">
|
||||
|
|
@ -19,14 +19,13 @@
|
|||
|
||||
<ParagraphForm ref="paragraphFormRef" :data="detail" :isEdit="isEdit" />
|
||||
</div>
|
||||
|
||||
<div class="text-right p-24 pt-0" v-if="problemId && isEdit">
|
||||
<el-button @click.prevent="isEdit = false"> 取消 </el-button>
|
||||
<el-button type="primary" :disabled="loading" @click="submitHandle"> 保存 </el-button>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
<div class="text-right p-24 pt-0" v-if="problemId && isEdit">
|
||||
<el-button @click.prevent="isEdit = false"> 取消 </el-button>
|
||||
<el-button type="primary" :disabled="loading" @click="submitHandle"> 保存 </el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8" class="border-l p-24">
|
||||
<el-col :span="8" class="border-l">
|
||||
<!-- 关联问题 -->
|
||||
<ProblemComponent
|
||||
:problemId="problemId"
|
||||
|
|
@ -134,17 +133,21 @@ defineExpose({ open })
|
|||
</script>
|
||||
<style lang="scss" scope>
|
||||
.paragraph-dialog {
|
||||
padding: 0 !important;
|
||||
.el-scrollbar {
|
||||
height: auto !important;
|
||||
}
|
||||
.el-dialog__header {
|
||||
padding-bottom: 16px;
|
||||
padding: 16px 24px;
|
||||
}
|
||||
.el-dialog__body {
|
||||
border-top: 1px solid var(--el-border-color);
|
||||
padding: 0 !important;
|
||||
}
|
||||
.el-dialog__footer {
|
||||
padding-top: 16px;
|
||||
padding: 16px 24px;
|
||||
border-top: 1px solid var(--el-border-color);
|
||||
}
|
||||
|
||||
.title {
|
||||
color: var(--app-text-color);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,33 +1,38 @@
|
|||
<template>
|
||||
<p class="bold title mb-16">
|
||||
关联问题 <el-divider direction="vertical" />
|
||||
<el-button text @click="addProblem">
|
||||
<el-icon><Plus /></el-icon>
|
||||
</el-button>
|
||||
<p class="bold title p-24" style="padding-bottom: 0">
|
||||
<span class="flex align-center">
|
||||
<span>关联问题</span>
|
||||
<el-divider direction="vertical" class="mr-4"/>
|
||||
<el-button text @click="addProblem">
|
||||
<el-icon><Plus /></el-icon>
|
||||
</el-button>
|
||||
</span>
|
||||
</p>
|
||||
<div v-loading="loading" style="height: 350px">
|
||||
<el-scrollbar>
|
||||
<el-input
|
||||
ref="inputRef"
|
||||
v-if="isAddProblem"
|
||||
v-model="problemValue"
|
||||
@change="addProblemHandle"
|
||||
placeholder="请输入问题,回车保存"
|
||||
class="mb-8"
|
||||
autofocus
|
||||
/>
|
||||
<div v-loading="loading">
|
||||
<el-scrollbar height="345px">
|
||||
<div class="p-24" style="padding-top: 16px">
|
||||
<el-input
|
||||
ref="inputRef"
|
||||
v-if="isAddProblem"
|
||||
v-model="problemValue"
|
||||
@change="addProblemHandle"
|
||||
placeholder="请输入问题,回车保存"
|
||||
class="mb-8"
|
||||
autofocus
|
||||
/>
|
||||
|
||||
<template v-for="(item, index) in problemList" :key="index">
|
||||
<TagEllipsis
|
||||
@close="delProblemHandle(item, index)"
|
||||
class="question-tag"
|
||||
type="info"
|
||||
effect="plain"
|
||||
closable
|
||||
>
|
||||
{{ item.content }}
|
||||
</TagEllipsis>
|
||||
</template>
|
||||
<template v-for="(item, index) in problemList" :key="index">
|
||||
<TagEllipsis
|
||||
@close="delProblemHandle(item, index)"
|
||||
class="question-tag"
|
||||
type="info"
|
||||
effect="plain"
|
||||
closable
|
||||
>
|
||||
{{ item.content }}
|
||||
</TagEllipsis>
|
||||
</template>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
</template>
|
||||
<div
|
||||
class="document-detail__main p-16"
|
||||
v-loading="paginationConfig.current_page === 1 && loading"
|
||||
v-loading="(paginationConfig.current_page === 1 && loading) || changeStateloading"
|
||||
>
|
||||
<div class="flex-between p-8">
|
||||
<span>{{ paginationConfig.total }} 段落</span>
|
||||
|
|
@ -110,6 +110,7 @@ const {
|
|||
|
||||
const ParagraphDialogRef = ref()
|
||||
const loading = ref(false)
|
||||
const changeStateloading = ref(false)
|
||||
const documentDetail = ref<any>({})
|
||||
const paragraphDetail = ref<any[]>([])
|
||||
const title = ref('')
|
||||
|
|
@ -132,8 +133,7 @@ function changeState(bool: Boolean, row: any) {
|
|||
const obj = {
|
||||
is_active: bool
|
||||
}
|
||||
loading.value = true
|
||||
paragraph.asyncPutParagraph(id, documentId, row.id, obj, loading).then((res) => {})
|
||||
paragraph.asyncPutParagraph(id, documentId, row.id, obj, changeStateloading).then((res) => {})
|
||||
}
|
||||
|
||||
function deleteParagraph(row: any) {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
:close-on-click-modal="false"
|
||||
:destroy-on-close="true"
|
||||
width="600"
|
||||
class="member-dialog"
|
||||
>
|
||||
<template #header="{ titleId, titleClass }">
|
||||
<h4 :id="titleId" :class="titleClass">添加成员</h4>
|
||||
|
|
@ -142,6 +143,11 @@ onMounted(() => {})
|
|||
defineExpose({ open, close })
|
||||
</script>
|
||||
<style lang="scss" scope>
|
||||
.member-dialog {
|
||||
.el-dialog__header {
|
||||
padding-bottom: 19px;
|
||||
}
|
||||
}
|
||||
.custom-select-multiple {
|
||||
width: 200%;
|
||||
.el-input {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,11 @@
|
|||
/>
|
||||
</template> -->
|
||||
<template #default="{ row }">
|
||||
<el-checkbox v-model="row.operate[MANAGE]" @change="checkedOperateChange(MANAGE, row)" />
|
||||
<el-checkbox
|
||||
:disabled="props.manage"
|
||||
v-model="row.operate[MANAGE]"
|
||||
@change="checkedOperateChange(MANAGE, row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="使用" align="center" width="60">
|
||||
|
|
@ -46,7 +50,11 @@
|
|||
/>
|
||||
</template> -->
|
||||
<template #default="{ row }">
|
||||
<el-checkbox v-model="row.operate[USE]" @change="checkedOperateChange(USE, row)" />
|
||||
<el-checkbox
|
||||
:disabled="props.manage"
|
||||
v-model="row.operate[USE]"
|
||||
@change="checkedOperateChange(USE, row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -63,7 +71,8 @@ const props = defineProps({
|
|||
},
|
||||
id: String,
|
||||
type: String,
|
||||
tableHeight: Number
|
||||
tableHeight: Number,
|
||||
manage: Boolean
|
||||
})
|
||||
|
||||
const isDataset = computed(() => props.type === DATASET)
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@
|
|||
:data="item.data"
|
||||
:type="item.value"
|
||||
:tableHeight="tableHeight"
|
||||
:manage="isManage(currentType)"
|
||||
></PermissionSetting>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
|
@ -76,7 +77,7 @@ import type { TeamMember } from '@/api/type/team'
|
|||
import CreateMemberDialog from './component/CreateMemberDialog.vue'
|
||||
import PermissionSetting from './component/PermissionSetting.vue'
|
||||
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
||||
import { DATASET, APPLICATION } from './utils'
|
||||
import { DATASET, APPLICATION, isManage } from './utils'
|
||||
|
||||
const CreateMemberRef = ref<InstanceType<typeof CreateMemberDialog>>()
|
||||
const loading = ref(false)
|
||||
|
|
@ -84,6 +85,8 @@ const rLoading = ref(false)
|
|||
const memberList = ref<TeamMember[]>([]) // 全部成员
|
||||
const filterMember = ref<TeamMember[]>([]) // 搜索过滤后列表
|
||||
const currentUser = ref<String>('')
|
||||
const currentType = ref<String>('')
|
||||
|
||||
const filterText = ref('')
|
||||
|
||||
const activeName = ref(DATASET)
|
||||
|
|
@ -176,12 +179,9 @@ function deleteMember(row: TeamMember) {
|
|||
.catch(() => {})
|
||||
}
|
||||
|
||||
function isManage(type: String) {
|
||||
return type === 'manage'
|
||||
}
|
||||
|
||||
function clickMemberHandle(item: any) {
|
||||
currentUser.value = item.id
|
||||
currentType.value = item.type
|
||||
MemberPermissions(item.id)
|
||||
}
|
||||
function addMember() {
|
||||
|
|
@ -197,6 +197,7 @@ function getMember(id?: string) {
|
|||
|
||||
const user = (id && memberList.value.find((p) => p.user_id === id)) || null
|
||||
currentUser.value = user ? user.id : memberList.value[0].id
|
||||
currentType.value = user ? user.type : memberList.value[0].type
|
||||
MemberPermissions(currentUser.value)
|
||||
loading.value = false
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
export const MANAGE = 'MANAGE'
|
||||
export const USE = 'USE'
|
||||
export const DATASET = 'DATASET'
|
||||
export const APPLICATION = 'APPLICATION'
|
||||
export const APPLICATION = 'APPLICATION'
|
||||
|
||||
export function isManage(type: String) {
|
||||
return type === 'manage'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
ref="dynamicsFormRef"
|
||||
label-position="top"
|
||||
require-asterisk-position="right"
|
||||
class="mb-24"
|
||||
>
|
||||
<template #default>
|
||||
<el-form-item label="模型名称" prop="name" :rules="base_form_data_rule.name">
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
<el-input
|
||||
v-model="model_search_form.name"
|
||||
@change="list_model"
|
||||
placeholder="按 名称 搜索"
|
||||
placeholder="按名称搜索"
|
||||
prefix-icon="Search"
|
||||
style="max-width: 240px"
|
||||
/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue