qb 4 weeks ago
parent
commit
c58fa125a0
  1. 91
      src/page/login/aiqa.vue
  2. 8
      src/views/basicdata/TripartiteMaterial/list.vue

91
src/page/login/aiqa.vue

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

8
src/views/basicdata/TripartiteMaterial/list.vue

@ -70,7 +70,7 @@
<el-form ref="formRef" label-width="100px" :model="details.form"> <el-form ref="formRef" label-width="100px" :model="details.form">
<el-form-item label="品牌" prop="brandName" <el-form-item label="品牌" prop="brandName"
:rules="[{ required: true, message: '请选择品牌', trigger: ['blur'] }]"> :rules="[{ required: true, message: '请选择品牌', trigger: ['blur'] }]">
<el-select class="w100" v-model="details.form.brandName" filterable clearable placeholder="请选择品" <el-select class="w100" v-model="details.form.brandName" filterable clearable placeholder="请选择品"
style="width: 240px" :loading="loadingObj.loading" @change="handleChangeBrand" remote reserve-keyword style="width: 240px" :loading="loadingObj.loading" @change="handleChangeBrand" remote reserve-keyword
default-first-option :remote-method="value => debounce(remoteMethodBrand(value), 500)"> default-first-option :remote-method="value => debounce(remoteMethodBrand(value), 500)">
<el-option v-for="val in details.brandArr" :key="val.id" :label="val.brandName" :value="val.id" /> <el-option v-for="val in details.brandArr" :key="val.id" :label="val.brandName" :value="val.id" />
@ -479,6 +479,11 @@ const handleSubmit = () => {
details.popUpShow.addVisited = false; details.popUpShow.addVisited = false;
details.loadingObj.pageLoading = true; details.loadingObj.pageLoading = true;
const submitData = { ...details.form }; const submitData = { ...details.form };
submitData.brand =details.brandArr.find(item=>item.id == details.form.brandName).brandName
submitData.category =details.materialArr.find(item=>item.id == details.form.categoryName).name
console.log(details.form.categoryName,'details.form.categoryName');
console.log(details.materialArr,'details.materialArr');
let res let res
if (addVisited.value) { if (addVisited.value) {
res = await postSave(submitData); res = await postSave(submitData);
@ -486,6 +491,7 @@ const handleSubmit = () => {
} else { } else {
res = await postUpdate(submitData); res = await postUpdate(submitData);
} }
const { code, msg } = res.data; const { code, msg } = res.data;
if (code !== 200) return; if (code !== 200) return;

Loading…
Cancel
Save