Merge branch 'main' of github.com:maxkb-dev/maxkb

This commit is contained in:
shaohuzhang1 2024-03-06 13:44:04 +08:00
commit cfc9c4cfd7
7 changed files with 48 additions and 17 deletions

View File

@ -216,6 +216,20 @@ const getApplicationHitTest: (
return get(`${prefix}/${application_id}/hit_test`, data, loading)
}
/**
* 使
* @param application_id
* @param loading
* @query { query_text: string, top_number: number, similarity: number }
* @returns
*/
const getApplicationModel: (
application_id: string,
loading?: Ref<boolean>
) => Promise<Result<Array<any>>> = (application_id, loading) => {
return get(`${prefix}/${application_id}/model`, loading)
}
export default {
getAllAppilcation,
getApplication,
@ -232,5 +246,6 @@ export default {
postAppAuthentication,
getProfile,
putChatVote,
getApplicationHitTest
getApplicationHitTest,
getApplicationModel
}

View File

@ -5,7 +5,7 @@
effect="dark"
placement="bottom"
>
<div ref="tagLabel" class="auto-tooltip">
<div ref="tagLabel" :class="['auto-tooltip', className]" :style="style">
<slot></slot>
</div>
</el-tooltip>
@ -13,6 +13,7 @@
<script setup lang="ts">
import { ref, computed, onMounted, nextTick } from 'vue'
defineOptions({ name: 'AutoTooltip' })
const props = defineProps({ className: String, style: Object })
const tagLabel = ref()
const containerWeight = ref(0)
const contentWeight = ref(0)

View File

@ -8,7 +8,9 @@
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
</AppAvatar>
</slot>
<h4 class="ellipsis-1" style="width: 65%">{{ title }}</h4>
<auto-tooltip :content="title" style="width: 65%">
{{ title }}
</auto-tooltip>
</div>
</slot>
</div>
@ -76,6 +78,7 @@ function cardLeave() {
overflow: hidden;
}
}
.card-footer {
position: absolute;
bottom: 8px;

View File

@ -1,8 +1,8 @@
<template>
<el-tag class="tag-ellipsis flex-between mb-8" effect="plain" v-bind="$attrs">
<AutoTooltip :content="tooltipContent">
<auto-tooltip :content="tooltipContent">
<slot></slot>
</AutoTooltip>
</auto-tooltip>
</el-tag>
</template>
<script setup lang="ts">

View File

@ -211,7 +211,7 @@
<el-col
:xs="24"
:sm="24"
:md="12"
:md="24"
:lg="12"
:xl="12"
class="mb-8"
@ -464,15 +464,27 @@ function getDataset() {
function getModel() {
loading.value = true
model
.asyncGetModel()
.then((res: any) => {
modelOptions.value = groupBy(res?.data, 'provider')
loading.value = false
})
.catch(() => {
loading.value = false
})
if (id) {
applicationApi
.getApplicationModel(id)
.then((res: any) => {
modelOptions.value = groupBy(res?.data, 'provider')
loading.value = false
})
.catch(() => {
loading.value = false
})
} else {
model
.asyncGetModel()
.then((res: any) => {
modelOptions.value = groupBy(res?.data, 'provider')
loading.value = false
})
.catch(() => {
loading.value = false
})
}
}
function getProvider() {

View File

@ -25,7 +25,7 @@
<el-col
:xs="24"
:sm="12"
:md="8"
:md="12"
:lg="8"
:xl="6"
v-for="(item, index) in paragraphDetail"

View File

@ -42,7 +42,7 @@
<el-col
:xs="24"
:sm="24"
:md="12"
:md="24"
:lg="12"
:xl="12"
class="mb-16"