|
|
@@ -244,11 +244,42 @@
|
|
|
</div>
|
|
|
<!-- AI对话框 -->
|
|
|
<div class="AIChat" :style="showHistory?'height:100%':'height:auto'">
|
|
|
- <xiaoshiAI style="width:100%;max-width:100%" :AItype="4" :slotDataFunction="slotDataFunction" :chat_id="chat_id" :params="AIParams" :API_KEY="API_KEY" :chatApi="chat_api" :defaultShowHistory="showHistory" @getShowHistory="getShowHistory" @getConversationId="getConversationId">
|
|
|
+ <xiaoshiAI style="width:100%;max-width:100%" :AItype="4" :slotDataFunction="slotDataFunction" :chat_id="chat_id" :params="AIParams" :API_KEY="API_KEY" :chatApi="chat_api" :defaultShowHistory="showHistory" @getShowHistory="getShowHistory" @getConversationId="getConversationId" @sendMessage="hasSendMessage">
|
|
|
+ <template slot="tools" v-if="AIModel == 'chat'">
|
|
|
+ <div class="tools">
|
|
|
+ <!-- <div class="chooseImage" @click="chooseImage">选择附图</div> -->
|
|
|
+ <div class="imgs">
|
|
|
+ <div class="img" v-for="(imgSrc,index) in imgGuids" :key="imgSrc">
|
|
|
+ <div class="operate"><i class="el-icon-error" @click.stop="delImgGuid(imgSrc,index)"></i></div>
|
|
|
+ <el-image style="width: 100%; height: 100%" :src="$commonJS.checkViewer(imgSrc)" fit="contain" :preview-src-list="[$commonJS.checkViewer(imgSrc)]"></el-image>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<template slot="questionBtn">
|
|
|
<div>
|
|
|
- <el-button size="mini" :type="AIModel=='chat'?'success':'info'" round @click="changeAIModel('chat')">AI对话</el-button>
|
|
|
- <el-button size="mini" :type="AIModel=='edit'?'success':'info'" round @click="changeAIModel('edit')">AI修改</el-button>
|
|
|
+ <!-- <el-button v-if="AIModel == 'chat'" size="mini" round @click="chooseImage" class="margin-right_10">选择附图</el-button> -->
|
|
|
+ <!-- <el-button size="mini" :type="AIModel=='chat'?'success':'info'" round @click="changeAIModel('chat')">AI对话</el-button>
|
|
|
+ <el-button size="mini" :type="AIModel=='edit'?'success':'info'" round @click="changeAIModel('edit')">AI修改</el-button> -->
|
|
|
+ <el-popover
|
|
|
+ placement="top-start"
|
|
|
+ title=""
|
|
|
+ width="200"
|
|
|
+ trigger="click"
|
|
|
+ popper-class="technicalDisclosurePopover"
|
|
|
+ ref="btn_popover"
|
|
|
+ >
|
|
|
+ <el-radio-group v-model="AIModel" @input="changeAIModel">
|
|
|
+ <div :class="['radio_btn',AIModel=='chat'?'active':'']">
|
|
|
+ <el-radio label="chat">问问题</el-radio>
|
|
|
+ </div>
|
|
|
+ <div :class="['radio_btn',AIModel=='edit'?'active':'']">
|
|
|
+ <el-radio label="edit">修改技术交底书理解结果</el-radio>
|
|
|
+ </div>
|
|
|
+ </el-radio-group>
|
|
|
+ <el-button title="切换AI对话场景" size="mini" type="success" round slot="reference">{{AIModel=='chat'?'问问题':"修改技术交底书理解结果"}}</el-button>
|
|
|
+ </el-popover>
|
|
|
+ <el-button title="选择附图" v-if="AIModel == 'chat'" size="mini" icon="el-icon-picture-outline-round" circle class="margin-left_10" @click="chooseImage"></el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template v-if="AIModel == 'edit'" v-slot:answer="data">
|
|
|
@@ -396,6 +427,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
+
|
|
|
+ <imageListDialog ref="imageListDialog" :guids="imgGuids" :imageList="imageList" @getImageGuid="getImageGuid" @uploadFileGuid="getUploadFileGuid"></imageListDialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -403,11 +436,13 @@
|
|
|
import vabOnlyOffice from '@/components/VabOnlyOffice/index.vue'
|
|
|
import xiaoshiAI from '@/components/xiaoshi_AI'
|
|
|
import conversationRecords from '../components/conversationRecords.vue';
|
|
|
+import imageListDialog from './dialog/imageList.vue'
|
|
|
export default {
|
|
|
components: {
|
|
|
vabOnlyOffice,
|
|
|
xiaoshiAI,
|
|
|
- conversationRecords
|
|
|
+ conversationRecords,
|
|
|
+ imageListDialog
|
|
|
},
|
|
|
props: {
|
|
|
},
|
|
|
@@ -500,7 +535,9 @@ export default {
|
|
|
show:false,
|
|
|
filename:'',
|
|
|
percentage:0
|
|
|
- }
|
|
|
+ },
|
|
|
+ imgGuids:[],
|
|
|
+ imageList:[],
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -539,13 +576,20 @@ export default {
|
|
|
this.showHistory = val
|
|
|
},
|
|
|
changeAIModel(val){
|
|
|
+ let dom = this.$refs.btn_popover
|
|
|
+ if(dom){
|
|
|
+ dom.doClose()
|
|
|
+ }
|
|
|
this.AIModel = val
|
|
|
if(this.AIModel == 'chat'){
|
|
|
this.chat_id = this.currentConversation.dialogueConversationId
|
|
|
this.AIParams.type = 31
|
|
|
+ this.AIParams.fileGuids = this.imgGuids
|
|
|
}else if(this.AIModel == 'edit'){
|
|
|
this.chat_id = this.currentConversation.aiUpdateConversationId
|
|
|
this.AIParams.type = 32
|
|
|
+ this.imgGuids = []
|
|
|
+ this.AIParams.fileGuids = []
|
|
|
}
|
|
|
},
|
|
|
addData(field,parentData){
|
|
|
@@ -671,6 +715,8 @@ export default {
|
|
|
this.currentConversation = obj
|
|
|
return
|
|
|
}
|
|
|
+ this.$set(this,'imgGuids',[])
|
|
|
+ this.$set(this,'imageList',[])
|
|
|
this.currentConversation = obj
|
|
|
this.AIParams.confessionSessionId = obj.id
|
|
|
this.chat_id = ''
|
|
|
@@ -693,9 +739,53 @@ export default {
|
|
|
this.getOption()
|
|
|
if(generate){
|
|
|
this.generateDiscoveryResult()
|
|
|
+ }else{
|
|
|
+ this.getImageList()
|
|
|
}
|
|
|
|
|
|
},
|
|
|
+ hasSendMessage(){
|
|
|
+ this.imgGuids = []
|
|
|
+ this.AIParams.fileGuids = []
|
|
|
+ },
|
|
|
+ getUploadFileGuid(value){
|
|
|
+ var params = {
|
|
|
+ confessionSessionId:this.currentConversation.id,
|
|
|
+ fileGuids:value.map(item=>item.guid)
|
|
|
+ }
|
|
|
+ this.$api.uploadDiscoveryPicture(params).then(response=>{
|
|
|
+ if(response.code == 200){
|
|
|
+ var addImage = value.map(item=>{
|
|
|
+ return {
|
|
|
+ originalName:item.name,
|
|
|
+ guid:item.guid,
|
|
|
+ type:item.name.substring(item.name.lastIndexOf('.')+1)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.imageList.push(...addImage)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ chooseImage(){
|
|
|
+ this.$refs.imageListDialog.open()
|
|
|
+ },
|
|
|
+ getImageGuid(value){
|
|
|
+ this.imgGuids = value
|
|
|
+ this.AIParams.fileGuids = this.imgGuids
|
|
|
+ },
|
|
|
+ delImgGuid(guid,index){
|
|
|
+ this.imgGuids.splice(index,1)
|
|
|
+ },
|
|
|
+ getImageList(){
|
|
|
+ var params = {
|
|
|
+ confessionSessionId:this.currentConversation.id
|
|
|
+ }
|
|
|
+ this.$api.queryDiscoveryPicture(params).then(response=>{
|
|
|
+ if(response.code == 200){
|
|
|
+ this.$set(this,'imageList', response.data)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
async generateDiscoveryResult(){
|
|
|
let params = {
|
|
|
confessionSessionId:this.currentConversation.id
|
|
|
@@ -711,6 +801,7 @@ export default {
|
|
|
if(response.code == 200){
|
|
|
this.currentConversation.discoveryResult = response.data
|
|
|
this.technicalContent=response.data
|
|
|
+ this.getImageList()
|
|
|
loading.close();
|
|
|
}
|
|
|
}).catch(error=>{
|
|
|
@@ -1116,12 +1207,65 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.kongbai{
|
|
|
- height:176px
|
|
|
+ height:210px;
|
|
|
}
|
|
|
.AIChat{
|
|
|
width: 100%;
|
|
|
position:absolute;
|
|
|
bottom: 5px;
|
|
|
+ .chooseImage{
|
|
|
+ border: 1px solid #e5e5e5;
|
|
|
+ padding: 7px 12px;
|
|
|
+ border-radius: 32px;
|
|
|
+ cursor: pointer;
|
|
|
+ color: #5d5d5f;
|
|
|
+ width: 60px;
|
|
|
+ &:hover{
|
|
|
+ color: #3498db;
|
|
|
+ border-color: #3498db;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .tools{
|
|
|
+ display: flex;
|
|
|
+ align-items: flex-end;
|
|
|
+ flex-wrap: nowrap;
|
|
|
+ padding:0 30px;
|
|
|
+ font-size: 14px;
|
|
|
+ margin-top: 10px;
|
|
|
+ margin-bottom: -10px;
|
|
|
+
|
|
|
+ .imgs{
|
|
|
+ flex:1;
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: flex-end;
|
|
|
+ flex-wrap: nowrap;
|
|
|
+ overflow-x: auto;
|
|
|
+ padding-bottom: 5px;
|
|
|
+ .img{
|
|
|
+ min-width: 50px;
|
|
|
+ max-width: 50px;
|
|
|
+ height:50px;
|
|
|
+ padding: 10px 12px;
|
|
|
+ background: white;
|
|
|
+ border-radius: 12px;
|
|
|
+ margin-right: 8px;
|
|
|
+ position:relative;
|
|
|
+ .operate{
|
|
|
+ position: absolute;
|
|
|
+ right: 5px;
|
|
|
+ top: 5px;
|
|
|
+ z-index: 99999;
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ &:hover{
|
|
|
+ .operate{
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.newConversation{
|
|
|
@@ -1238,6 +1382,18 @@ export default {
|
|
|
}
|
|
|
</style>
|
|
|
<style lang="scss">
|
|
|
+.technicalDisclosurePopover{
|
|
|
+ .radio_btn{
|
|
|
+ padding: 8px;
|
|
|
+ margin-bottom: 2px;
|
|
|
+ border-radius: 10px;
|
|
|
+ width: 100%;
|
|
|
+ cursor: pointer;
|
|
|
+ &:hover{
|
|
|
+ background: #f5f5f5;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
.style3{
|
|
|
.layout_suggestions{
|
|
|
p{
|