|
@@ -33,9 +33,17 @@
|
|
</v-btn>
|
|
</v-btn>
|
|
</template>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
- <div class="mt-2" :class="{ 'indigo lighten-5 pa-3 rounded': item.type !== 1 }">
|
|
|
|
|
|
+ <div class="mt-2" :class="{ 'indigo lighten-5 pa-3 rounded': item.type === 2 }">
|
|
<template v-if="typeof item.content === 'string'">
|
|
<template v-if="typeof item.content === 'string'">
|
|
- {{ item.content }}
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <span v-if="item.welcome" class="mdi mdi-hand-wave"></span>
|
|
|
|
+ {{item.content}}
|
|
|
|
+ </div>
|
|
|
|
+ <div v-if="item.welcome">
|
|
|
|
+ <div class="mt-1" v-for="_item in item.items" :key="_item">
|
|
|
|
+ <span class="defaultLink" @click="onSend(_item)">{{_item}}</span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
<template v-else-if="Object.keys(item.content).length === 0">
|
|
<template v-else-if="Object.keys(item.content).length === 0">
|
|
<span>
|
|
<span>
|
|
@@ -242,7 +250,13 @@ export default {
|
|
items: [
|
|
items: [
|
|
{
|
|
{
|
|
type: 1,
|
|
type: 1,
|
|
- content: '您好,我是AI助手,请问有什么可以帮助您的吗?'
|
|
|
|
|
|
+ welcome: true,
|
|
|
|
+ content: '你好,我是您的数据查询小助手,支持查询“高速公路服务区”的相关信息。您可以这样提问: ',
|
|
|
|
+ items: [
|
|
|
|
+ '现在一共有多少个服务区?分别归属于哪些管理公司?',
|
|
|
|
+ '哪个服务区的档口数量最多?',
|
|
|
|
+ '赣州分公司下,餐饮类档口的日均订单量是多少?'
|
|
|
|
+ ]
|
|
}
|
|
}
|
|
]
|
|
]
|
|
// trueData: false
|
|
// trueData: false
|
|
@@ -259,6 +273,13 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ onSend (str) {
|
|
|
|
+ if (this.disabled) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.question = str
|
|
|
|
+ this.handleSendMsg()
|
|
|
|
+ },
|
|
async handleSendMsg () {
|
|
async handleSendMsg () {
|
|
if (!this.question || this.disabled) {
|
|
if (!this.question || this.disabled) {
|
|
return
|
|
return
|