ai助手-拖动

This commit is contained in:
lyc 2024-09-11 16:50:47 +08:00
parent 82bed1be03
commit ec3b978185
2 changed files with 34 additions and 35 deletions

View File

@ -3,21 +3,20 @@
<svg class="icon ai-icon" aria-hidden="true" @click="isOpen = true; isMax = false" v-if="!isOpen"> <svg class="icon ai-icon" aria-hidden="true" @click="isOpen = true; isMax = false" v-if="!isOpen">
<use xlink:href="#icon-aijiqiren"></use> <use xlink:href="#icon-aijiqiren"></use>
</svg> </svg>
<el-card v-else shadow="always" class="chart-card" :class="[isMax ? 'card-max' : '']"> <div v-else v-drag shadow="always" class="chart-card" :class="[isMax ? 'card-max' : '']">
<template #header> <div class="flex chart-header">
<div class="flex chart-header"> <div class="header-name flex">
<div class="header-name flex"> <svg class="icon header-icon" aria-hidden="true">
<svg class="icon header-icon" aria-hidden="true"> <use xlink:href="#icon-aijiqiren"></use>
<use xlink:href="#icon-aijiqiren"></use> </svg>
</svg> <span>教学助手</span>
<span>教学助手</span>
</div>
<div class="header-tool">
<i class="iconfont icon-window-max_line icon-tool" @click="isMax = !isMax"></i>
<i class="iconfont icon-close icon-tool" @click="closeChart"></i>
</div>
</div> </div>
</template> <div class="header-tool">
<i class="iconfont icon-window-max_line icon-tool" @click="isMax = !isMax"></i>
<i class="iconfont icon-close icon-tool" @click="closeChart"></i>
</div>
</div>
<div class="chart-body"> <div class="chart-body">
<el-scrollbar ref="chatref"> <el-scrollbar ref="chatref">
<div class="default-chart flex"> <div class="default-chart flex">
@ -55,12 +54,13 @@
</div> </div>
</div> </div>
</el-scrollbar> </el-scrollbar>
<div class="chart-input">
<el-input v-model="msgVal" size="large" class="chart-ipt" @keyup.enter="sendMsg" @focus="isFocus = true" @blur="isFocus = false" />
<i class="iconfont icon-tujing" :class="[isFocus ? 'icon-focus' : '']" @click="sendMsg"></i>
</div>
</div> </div>
<div class="chart-input">
<el-input v-model="msgVal" size="large" class="chart-ipt" @keyup.enter="sendMsg" @focus="isFocus = true" @blur="isFocus = false" /> </div>
<i class="iconfont icon-tujing" :class="[isFocus ? 'icon-focus' : '']" @click="sendMsg"></i>
</div>
</el-card>
</div> </div>
</template> </template>
@ -75,7 +75,6 @@ import vDrag from '@/views/tool/directive/drag'
const { ipcRenderer } = window.electron || {} const { ipcRenderer } = window.electron || {}
const userStore = useUserStore().user const userStore = useUserStore().user
@ -218,6 +217,7 @@ onMounted(() => {
} }
.page-ai-chart { .page-ai-chart {
.ai-icon { .ai-icon {
position: fixed; position: fixed;
right: 30px; right: 30px;
@ -227,6 +227,7 @@ onMounted(() => {
} }
.chart-card { .chart-card {
background-color: #fff;
position: fixed; position: fixed;
bottom: 20px; bottom: 20px;
right: 20px; right: 20px;
@ -234,34 +235,30 @@ onMounted(() => {
height: calc(100% - 110px); height: calc(100% - 110px);
border-radius: 10px; border-radius: 10px;
z-index: 10; z-index: 10;
:deep(.el-card__header) { box-shadow: 0px 0px 12px rgba(0, 0, 0, .12);
padding: 10px;
}
:deep(.el-card__body) {
height: calc(100% - 50px);
padding: 10px 15px;
}
.chart-body { .chart-body {
height: calc(100% - 60px); padding: 10px 15px;
height: calc(100% - 110px);
-webkit-app-region: no-drag;
} }
} }
.card-max { .card-max {
width: 100%; width: 100%;
height: 100%; height: 100%;
left: 0; left: 0 !important;
top: 0; top: 0 !important;
} }
.chart-header { .chart-header {
justify-content: space-between; justify-content: space-between;
font-size: 14px; font-size: 14px;
padding: 10px;
border-bottom: 1px solid #e4e7ed;
-webkit-app-region: no-drag;
.header-name { .header-name {
align-items: center; align-items: center;
.header-icon { .header-icon {
font-size: 28px; font-size: 28px;
align-items: center; align-items: center;
@ -354,7 +351,10 @@ onMounted(() => {
} }
.chart-input { .chart-input {
position: relative; position: absolute;
width: 90%;
left: 5%;
bottom: 15px;
display: flex; display: flex;
align-items: center; align-items: center;
padding-top: 15px; padding-top: 15px;

View File

@ -197,7 +197,6 @@ const changeSubject = async (command) =>{
edustage: command.edustage, edustage: command.edustage,
edusubject: command.edusubject edusubject: command.edusubject
} }
console.log(data,'data')
await updateUserInfo(data) await updateUserInfo(data)
await userStore.login({username: phonenumber, password: plainpwd}) await userStore.login({username: phonenumber, password: plainpwd})
await userStore.getInfo() await userStore.getInfo()