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

View File

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