mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
perf: 优化用户输入样式
This commit is contained in:
parent
7c5fb47b75
commit
8920b71867
|
|
@ -1,5 +1,27 @@
|
|||
<template>
|
||||
<div ref="aiChatRef" class="ai-chat" :class="log ? 'chart-log' : ''">
|
||||
<div v-if="inputFieldList.length > 0" class="mb-16" style="padding: 0 24px">
|
||||
<el-card shadow="always" class="dialog-card">
|
||||
<div class="flex align-center cursor w-full" @click="showUserInput = !showUserInput">
|
||||
<el-icon class="mr-8 arrow-icon" :class="showUserInput ? 'rotate-90' : ''"
|
||||
><CaretRight
|
||||
/></el-icon>
|
||||
用户输入
|
||||
</div>
|
||||
<el-collapse-transition>
|
||||
<DynamicsForm
|
||||
class="mt-16"
|
||||
v-show="showUserInput"
|
||||
v-model="form_data"
|
||||
:model="form_data"
|
||||
label-position="left"
|
||||
require-asterisk-position="right"
|
||||
:render_data="inputFieldList"
|
||||
ref="dynamicsFormRef"
|
||||
/>
|
||||
</el-collapse-transition>
|
||||
</el-card>
|
||||
</div>
|
||||
<el-scrollbar ref="scrollDiv" @scroll="handleScrollTop">
|
||||
<div ref="dialogScrollbar" class="ai-chat__content p-24 chat-width">
|
||||
<div class="item-content mb-16" v-if="!props.available || (props.data?.prologue && !log)">
|
||||
|
|
@ -240,7 +262,7 @@ const props = defineProps({
|
|||
chatId: {
|
||||
type: String,
|
||||
default: ''
|
||||
}, // 历史记录Id
|
||||
} // 历史记录Id
|
||||
})
|
||||
|
||||
const emit = defineEmits(['refresh', 'scroll'])
|
||||
|
|
@ -264,6 +286,8 @@ const apiInputFieldList = ref<FormField[]>([])
|
|||
const form_data = ref<any>({})
|
||||
const api_form_data = ref<any>({})
|
||||
|
||||
const showUserInput = ref(true)
|
||||
|
||||
const isDisabledChart = computed(
|
||||
() => !(inputValue.value.trim() && (props.appId || props.data?.name))
|
||||
)
|
||||
|
|
@ -664,7 +688,7 @@ function chatMessage(chat?: any, problem?: string, re_chat?: boolean) {
|
|||
const obj = {
|
||||
message: chat.problem_text,
|
||||
re_chat: re_chat || false,
|
||||
form_data: {...form_data.value, ...api_form_data.value}
|
||||
form_data: { ...form_data.value, ...api_form_data.value }
|
||||
}
|
||||
// 对话
|
||||
applicationApi
|
||||
|
|
@ -985,6 +1009,7 @@ defineExpose({
|
|||
.dialog-card {
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -254,12 +254,7 @@ const themeForm = ref<any>({
|
|||
loginImage: '',
|
||||
title: 'MaxKB',
|
||||
slogan: '欢迎使用 MaxKB 智能知识库问答系统',
|
||||
showUserManual: false,
|
||||
userManualUrl: '',
|
||||
showForum: false,
|
||||
forumUrl: '',
|
||||
showProject: false,
|
||||
projectUrl: ''
|
||||
...defaultPlatformSetting
|
||||
})
|
||||
const themeRadio = ref('')
|
||||
const customColor = ref('')
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
</MdEditor>
|
||||
</el-form-item>
|
||||
<div class="flex-between mb-8">
|
||||
<h5 class="lighter">输入变量</h5>
|
||||
<h5 class="lighter">全局变量</h5>
|
||||
<el-button link type="primary" @click="openAddDialog()">
|
||||
<el-icon class="mr-4"><Plus /></el-icon> 添加
|
||||
</el-button>
|
||||
|
|
|
|||
Loading…
Reference in New Issue