fix: optimization chart operation style

This commit is contained in:
wangdan-fit2cloud 2025-04-01 19:41:01 +08:00 committed by GitHub
parent 2991f0b640
commit 02611588fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 41 additions and 26 deletions

View File

@ -23,9 +23,8 @@
{{ message }} {{ message }}
</span> </span>
</p> </p>
<div class="close"> <el-avatar :size="isTouching ? 43 : 50" icon="Close" class="close" />
<el-icon><Close /></el-icon> <!-- <div class="close"></div> -->
</div>
<p class="lighter" :style="{ visibility: isTouching ? 'visible' : 'hidden' }"> <p class="lighter" :style="{ visibility: isTouching ? 'visible' : 'hidden' }">
{{ message }} {{ message }}
</p> </p>
@ -40,6 +39,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch } from 'vue' import { ref, watch } from 'vue'
// import { Close } from '@element-plus/icons-vue'
const props = defineProps({ const props = defineProps({
time: { time: {
type: Number, type: Number,
@ -143,12 +143,8 @@ function onTouchEnd() {
box-shadow: 0px 4px 8px 0px rgba(31, 35, 41, 0.1); box-shadow: 0px 4px 8px 0px rgba(31, 35, 41, 0.1);
border: 1px solid rgba(222, 224, 227, 1); border: 1px solid rgba(222, 224, 227, 1);
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
border-radius: 100px; color: var(--app-text-color-secondary);
display: inline-block; font-size: 1.6rem;
width: 43px;
height: 43px;
line-height: 50px;
font-size: 1.8rem;
margin: 20px 0; margin: 20px 0;
} }
.speech-img { .speech-img {
@ -163,9 +159,7 @@ function onTouchEnd() {
.close { .close {
background: #f54a45; background: #f54a45;
color: #ffffff; color: #ffffff;
width: 50px; border: none;
height: 50px;
line-height: 57px;
font-size: 2rem; font-size: 2rem;
} }
.speech-img { .speech-img {

View File

@ -113,7 +113,7 @@
</el-space> </el-space>
</div> </div>
</el-scrollbar> </el-scrollbar>
<div class="flex"> <div class="flex" :style="{ alignItems: isMicrophone ? 'center' : 'end' }">
<TouchChat <TouchChat
v-if="isMicrophone" v-if="isMicrophone"
@TouchStart="startRecording" @TouchStart="startRecording"
@ -554,7 +554,7 @@ class RecorderManage {
MsgAlert( MsgAlert(
t('common.tip'), t('common.tip'),
`${err} `${err}
<div style="width: 100%;height:1px;border-top:1px var(--el-border-color) var(--el-border-style);margin:10px 0;"></div> <div style="width: 100%;height:1px;border-top:1px var(--el-border-color) var(--el-border-style);margin:10px 0;"></div>
${t('chat.tip.recorderTip')} ${t('chat.tip.recorderTip')}
<img src="${new URL(`@/assets/tipIMG.jpg`, import.meta.url).href}" style="width: 100%;" />`, <img src="${new URL(`@/assets/tipIMG.jpg`, import.meta.url).href}" style="width: 100%;" />`,
{ {
@ -653,13 +653,23 @@ function autoSendMessage() {
audio_list: uploadAudioList.value, audio_list: uploadAudioList.value,
video_list: uploadVideoList.value video_list: uploadVideoList.value
}) })
inputValue.value = ''
uploadImageList.value = [] if (
uploadDocumentList.value = [] props.sendMessage(inputValue.value, {
uploadAudioList.value = [] image_list: uploadImageList.value,
uploadVideoList.value = [] document_list: uploadDocumentList.value,
if (quickInputRef.value) { audio_list: uploadAudioList.value,
quickInputRef.value.textareaStyle.height = '45px' video_list: uploadVideoList.value
}) !== undefined
) {
inputValue.value = ''
uploadImageList.value = []
uploadDocumentList.value = []
uploadAudioList.value = []
uploadVideoList.value = []
if (quickInputRef.value) {
quickInputRef.value.textareaStyle.height = '45px'
}
} }
} }

View File

@ -5,10 +5,7 @@
:class="type" :class="type"
:style="{ height: firsUserInput ? '100%' : undefined }" :style="{ height: firsUserInput ? '100%' : undefined }"
> >
<div <div v-if="showUserInputContent" :class="firsUserInput ? 'firstUserInput' : 'popperUserInput'">
v-show="showUserInputContent"
:class="firsUserInput ? 'firstUserInput' : 'popperUserInput'"
>
<UserForm <UserForm
v-model:api_form_data="api_form_data" v-model:api_form_data="api_form_data"
v-model:form_data="form_data" v-model:form_data="form_data"
@ -16,7 +13,7 @@
:type="type" :type="type"
:first="firsUserInput" :first="firsUserInput"
@confirm="UserFormConfirm" @confirm="UserFormConfirm"
@cancel="() => (showUserInput = false)" @cancel="UserFormCancel"
ref="userFormRef" ref="userFormRef"
></UserForm> ></UserForm>
</div> </div>
@ -150,6 +147,9 @@ const userFormRef = ref<InstanceType<typeof UserForm>>()
// //
const firsUserInput = ref(true) const firsUserInput = ref(true)
const showUserInput = ref(false) const showUserInput = ref(false)
//
const initialFormData = ref({})
const initialApiFormData = ref({})
const isUserInput = computed( const isUserInput = computed(
() => () =>
@ -193,6 +193,11 @@ watch(
const toggleUserInput = () => { const toggleUserInput = () => {
showUserInput.value = !showUserInput.value showUserInput.value = !showUserInput.value
if (showUserInput.value) {
//
initialFormData.value = JSON.parse(JSON.stringify(form_data.value))
initialApiFormData.value = JSON.parse(JSON.stringify(api_form_data.value))
}
} }
function UserFormConfirm() { function UserFormConfirm() {
@ -201,6 +206,12 @@ function UserFormConfirm() {
showUserInput.value = false showUserInput.value = false
} }
} }
function UserFormCancel() {
//
form_data.value = JSON.parse(JSON.stringify(initialFormData.value))
api_form_data.value = JSON.parse(JSON.stringify(initialApiFormData.value))
showUserInput.value = false
}
function sendMessage(val: string, other_params_data?: any, chat?: chatType) { function sendMessage(val: string, other_params_data?: any, chat?: chatType) {
if (!userFormRef.value?.checkInputParam()) { if (!userFormRef.value?.checkInputParam()) {