Browse Source

AI增加问题

dev
马远东 4 weeks ago
parent
commit
5fa9367be5
  1. 91
      src/page/login/aiqa.vue

91
src/page/login/aiqa.vue

@ -6,7 +6,9 @@
<span>货无忧AI智能问答</span>
</div>
<div class="icon-box">
<el-icon @click="close"><CloseBold /></el-icon>
<el-icon @click="close">
<CloseBold />
</el-icon>
</div>
</div>
<div class="content">
@ -14,23 +16,21 @@
<div class="content-box" ref="chatContainer">
<div class="content-time">{{ time }}</div>
<template v-for="(item, index) in Data.ChathistoryList" :key="index">
<div
:class="{
'chat-history': item.state === 'Ai',
'chat-history-user': item.state === 'user',
}"
>
<div :class="{
'chat-history': item.state === 'Ai',
'chat-history-user': item.state === 'user',
}">
<div class="icon">
<el-icon v-if="item.state === 'user'"><Avatar /></el-icon>
<el-icon v-if="item.state === 'user'">
<Avatar />
</el-icon>
<img v-else :src="logotx" />
</div>
<div>
<div
:class="{
'content-header': item.state === 'Ai',
'content-header-user': item.state === 'user',
}"
>
<div :class="{
'content-header': item.state === 'Ai',
'content-header-user': item.state === 'user',
}">
<span>{{ item.name }}</span>
<!-- <span>{{ item.time }}</span> -->
</div>
@ -39,21 +39,11 @@
{{ item.state === 'user' ? item.content : '' }}
</p>
<!-- 图片 -->
<el-image
v-if="item.url"
style="width: 100px; height: 100px"
:src="item.url"
:zoom-rate="1.2"
:max-scale="7"
:min-scale="0.2"
:preview-src-list="item.srcList"
:initial-index="4"
fit="cover"
/>
<el-image v-if="item.url" style="width: 100px; height: 100px" :src="item.url" :zoom-rate="1.2"
:max-scale="7" :min-scale="0.2" :preview-src-list="item.srcList" :initial-index="4" fit="cover" />
<!-- 下载地址 -->
<a v-if="item.link" :href="item.link" target="_blank" rel="noopener noreferrer">
<el-link :underline="false">点击这里下载</el-link></a
>
<el-link :underline="false">点击这里下载</el-link></a>
</div>
</div>
</div>
@ -61,14 +51,8 @@
</div>
<!-- 输入框 -->
<div class="content-input">
<el-input
ref="input"
@keydown.enter="inputData(Data.input)"
v-model="Data.input"
placeholder="请输入问题描述"
type="textarea"
style="height: 100%; resize: none"
/>
<el-input ref="input" @keydown.enter="inputData(Data.input)" v-model="Data.input" placeholder="请输入问题描述"
type="textarea" style="height: 100%; resize: none" />
<el-button type="primary" @click="inputData(Data.input)">发送</el-button>
</div>
</div>
@ -81,8 +65,7 @@
<span :class="{ span: true, [`id${index + 1}`]: index < 4 }">{{
index + 1
}}</span>
<span class="spancontent" @click="inputData(item.content)"
>{{ item.content }}...
<span class="spancontent" @click="inputData(item.content)">{{ item.content }}...
</span>
</div>
</template>
@ -149,6 +132,9 @@ const Data = ref({
{
content: '向日葵下载地址',
},
{
content: '前端仓批量家配模板',
},
],
ChathistoryList: [
// {
@ -335,6 +321,10 @@ const AiData = (value = '') => {
aiResponse = '向日葵下载地址:https://sunlogin.oray.com/,使用教程点击下方立即下载';
data.link =
'http://files.huo5u.com/plugins/%E5%90%91%E6%97%A5%E8%91%B5%E8%BF%9C%E7%A8%8B%E8%BD%AF%E4%BB%B6%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B.docx';
} else if (lowercaseValue.includes('前端仓批量家配模板') || lowercaseValue.includes('家配模板')) {
aiResponse = '前端仓批量家配模板如下,点击下方立即下载';
data.link =
'https://gzhtoss.oss-cn-chengdu.aliyuncs.com/muban/%E6%89%B9%E9%87%8F%E5%AE%B6%E9%85%8D%E5%BA%93%E5%AD%98%E5%93%81%E5%BC%80%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx';
} else {
aiResponse = '我不太理解您的问题,我正在努力学习中,请重新描述或输入其他问题,或联系管理员';
}
@ -356,15 +346,18 @@ AiData(); //初始化AI机器人
.el_problem {
display: flex;
flex-direction: column;
span {
margin: 4px;
}
.box {
font-size: 14px;
display: flex;
height: 50px;
align-items: center;
.span {
width: 20px;
height: 20px;
@ -376,23 +369,28 @@ AiData(); //初始化AI机器人
border-radius: 50%;
color: #fff;
}
.spancontent {
cursor: pointer;
}
.id1 {
border: 1px solid #f45c45;
background-color: #f45c45;
}
.id2 {
border: 1px solid #ed9c43;
background-color: #ed9c43;
}
.id3 {
border: 1px solid #ffd35d;
background-color: #ffd35d;
}
}
}
.page-content {
width: 80%;
height: 80%;
@ -415,23 +413,28 @@ AiData(); //初始化AI机器人
line-height: 40px;
font-size: 16px;
padding: 0 24px;
.logo {
display: flex;
align-items: center;
span {
margin-left: 10px;
}
img {
width: 30px;
height: 30px;
}
}
.icon-box {
display: flex;
.el-icon {
color: #fff;
font-size: 24px;
&:hover {
cursor: pointer;
color: #ff0000;
@ -446,6 +449,7 @@ AiData(); //初始化AI机器人
display: flex;
justify-content: space-between;
overflow-y: hidden;
.left {
width: 66%;
border-right: 1px solid #d3832a;
@ -457,6 +461,7 @@ AiData(); //初始化AI机器人
background-color: #f5f5f6;
padding: 10px;
overflow-y: scroll;
.chat-history,
.chat-history-user {
margin-bottom: 2%;
@ -477,10 +482,12 @@ AiData(); //初始化AI机器人
justify-content: center;
color: #d3832a;
font-size: 3em;
img {
width: 100%;
height: 100%;
}
.el-icon {
font-size: 22px;
}
@ -488,6 +495,7 @@ AiData(); //初始化AI机器人
.content-header {
font-size: 12px;
span {
margin-right: 20px;
}
@ -499,6 +507,7 @@ AiData(); //初始化AI机器人
border: 1px solid #9e9e9e;
padding: 0px 10px;
border-radius: 4px;
p {
font-size: 13px;
margin: 10px 0;
@ -514,11 +523,13 @@ AiData(); //初始化AI机器人
margin-right: 0;
margin-left: 20px;
}
.content-header-user {
font-size: 12px;
text-align: right;
display: flex;
flex-direction: row-reverse;
span {
margin-left: 20px;
}
@ -530,6 +541,7 @@ AiData(); //初始化AI机器人
border-top: 1px solid #c2c2c2;
flex: 1;
position: relative;
.el-input {
width: 100%;
height: 100%;
@ -545,12 +557,15 @@ AiData(); //初始化AI机器人
.is-focus {
box-shadow: none;
}
.el-input__wrapper {
box-shadow: none;
}
.el-input__inner {
font-size: 12px;
}
.el-button {
position: absolute;
right: 10px;
@ -566,6 +581,7 @@ AiData(); //初始化AI机器人
.right {
height: 100%;
width: 34%;
.el-tabs {
height: 100%;
@ -578,6 +594,7 @@ AiData(); //初始化AI机器人
}
}
}
.content-time {
text-align: center;
color: #9a9a9a;

Loading…
Cancel
Save