|
@@ -73,9 +73,10 @@
|
|
max-width="300"
|
|
max-width="300"
|
|
attach=".chart-content-chat-box"
|
|
attach=".chart-content-chat-box"
|
|
>
|
|
>
|
|
- <template v-slot:activator>
|
|
|
|
|
|
+ <template v-slot:activator="{ on , attrs}">
|
|
<v-btn
|
|
<v-btn
|
|
- @click="item.showMenu = true"
|
|
|
|
|
|
+ v-on="on"
|
|
|
|
+ v-bind="attrs"
|
|
text
|
|
text
|
|
color="primary"
|
|
color="primary"
|
|
>我要画图</v-btn>
|
|
>我要画图</v-btn>
|
|
@@ -179,6 +180,13 @@
|
|
</div>
|
|
</div>
|
|
<div class="pa-3 chart-content-chat-btn">
|
|
<div class="pa-3 chart-content-chat-btn">
|
|
<div class="send">
|
|
<div class="send">
|
|
|
|
+ <div class="pa-3 text-center" v-if="conversationId">
|
|
|
|
+ <v-btn color="indigo" outlined small @click="onNew">
|
|
|
|
+ <v-icon left>
|
|
|
|
+ mdi-chat-plus-outline
|
|
|
|
+ </v-icon>新对话
|
|
|
|
+ </v-btn>
|
|
|
|
+ </div>
|
|
<div class="send-box">
|
|
<div class="send-box">
|
|
<v-textarea
|
|
<v-textarea
|
|
v-model="question"
|
|
v-model="question"
|
|
@@ -214,41 +222,6 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <!-- <v-dialog
|
|
|
|
- v-model="show"
|
|
|
|
- persistent
|
|
|
|
- max-width="290"
|
|
|
|
- >
|
|
|
|
- <v-card>
|
|
|
|
- <v-card-title class="text-h5">
|
|
|
|
- 提示
|
|
|
|
- </v-card-title>
|
|
|
|
- <v-card-text>是否添加到训练集</v-card-text>
|
|
|
|
- <v-card-actions>
|
|
|
|
- <v-spacer></v-spacer>
|
|
|
|
- <v-btn
|
|
|
|
- text
|
|
|
|
- @click="show = false"
|
|
|
|
- >
|
|
|
|
- 取消
|
|
|
|
- </v-btn>
|
|
|
|
- <v-btn
|
|
|
|
- color="error darken-1"
|
|
|
|
- text
|
|
|
|
- @click="onSure(false)"
|
|
|
|
- >
|
|
|
|
- 不添加
|
|
|
|
- </v-btn>
|
|
|
|
- <v-btn
|
|
|
|
- color="green darken-1"
|
|
|
|
- text
|
|
|
|
- @click="onSure(true)"
|
|
|
|
- >
|
|
|
|
- 添加
|
|
|
|
- </v-btn>
|
|
|
|
- </v-card-actions>
|
|
|
|
- </v-card>
|
|
|
|
- </v-dialog> -->
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -283,6 +256,7 @@ export default {
|
|
]
|
|
]
|
|
}
|
|
}
|
|
],
|
|
],
|
|
|
|
+ abortController: null,
|
|
conversationId: undefined
|
|
conversationId: undefined
|
|
// trueData: false
|
|
// trueData: false
|
|
}
|
|
}
|
|
@@ -291,6 +265,12 @@ export default {
|
|
...mapGetters(['userInfo'])
|
|
...mapGetters(['userInfo'])
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ onNew () {
|
|
|
|
+ this.abortController.abort('')
|
|
|
|
+ this.abortController = null
|
|
|
|
+ this.items.splice(1, this.items.length - 1)
|
|
|
|
+ this.conversationId = undefined
|
|
|
|
+ },
|
|
handleKeyCode (event) {
|
|
handleKeyCode (event) {
|
|
if (event.keyCode === 13) {
|
|
if (event.keyCode === 13) {
|
|
if (!event.ctrlKey) {
|
|
if (!event.ctrlKey) {
|
|
@@ -336,11 +316,14 @@ export default {
|
|
this.items.push(ask)
|
|
this.items.push(ask)
|
|
this.question = ''
|
|
this.question = ''
|
|
try {
|
|
try {
|
|
|
|
+ this.abortController = new AbortController()
|
|
const { data } = await getAsk({
|
|
const { data } = await getAsk({
|
|
question,
|
|
question,
|
|
user_id: this.userInfo.id,
|
|
user_id: this.userInfo.id,
|
|
routing_mode: this.routingMode,
|
|
routing_mode: this.routingMode,
|
|
conversation_id: this.conversationId
|
|
conversation_id: this.conversationId
|
|
|
|
+ }, {
|
|
|
|
+ signal: this.abortController.signal
|
|
})
|
|
})
|
|
ask.content = data
|
|
ask.content = data
|
|
this.conversationId = data.conversation_id
|
|
this.conversationId = data.conversation_id
|