zhuliu 1 hete
szülő
commit
b363d847a8

+ 33 - 10
src/views/AITools/OADefense/OADefense1.vue

@@ -2,8 +2,9 @@
     <div class="height_100 OADefense">
       <conversationRecords v-show="showMenu" name="OA答辩" :show_add="false" :conversation="currentConversation" :confessionSessionList="confessionSessionList" @addConversation="addConversation" @changeConversation="changeConversation" @updateConversation="queryConfessionSession" ></conversationRecords>
       
+      <myView style="height: 100%;width: 100%;" position="row">
        <!-- 左侧文件展示 -->
-       <div class="left customize_file" v-show="showLeft">
+       <div slot="left" class="left customize_file" v-show="showLeft">
             <div class="head">
                 <div class="head_left">
                     <div class="margin-right_10">
@@ -250,22 +251,22 @@
                             </div>
                         </template>
                     </div>
-                    <hr style="margin:15px 0;">
-                    <div class="run">
+                    <hr >
+                    <div class="run" >
                         <div></div>
                         <el-button type="primary" size="small" @click="run"><div class="btn_content"><i class="el-icon-caret-right"></i>运行</div></el-button>
                     </div>
                 </div>
             </template>
             <template v-else-if="show">
-                <vabOnlyOffice :option='option'></vabOnlyOffice>
+                <vabOnlyOffice class="myIframe" :option='option'></vabOnlyOffice>
             </template>
             <hr>
         </div>
         <!-- 中间的线 -->
-        <div class="line" v-show="showLeft"></div>
+        <!-- <div class="line" v-show="showLeft"></div> -->
         <!-- 右侧发明点和对话框 -->
-        <div class="right" :style="!showLeft?'width:calc(100% - 0px) !important':''">
+        <div slot="right" class="right" :style="!showLeft?'width:calc(100% - 0px) !important':''">
             <div>
                 <div class="head">
                     <div class="head_left">
@@ -303,7 +304,7 @@
             </div>
             <div class="result" ref="AIMessage" v-else>
                 <template v-if="result_file.show">
-                    <vabOnlyOffice :option='result_file.option'></vabOnlyOffice>
+                    <vabOnlyOffice class="myIframe" :option='result_file.option'></vabOnlyOffice>
                 </template>
                 <!-- 缺少信息 -->
                 <template v-else-if="result && result.code == 1001">
@@ -359,6 +360,7 @@
                 </div>
             </div>
         </div>
+      </myView>
         <!-- 错误提示以及上传文件 -->
         <errorTipDialog ref="errorTip" @submit="reLoadSubmit"></errorTipDialog>
         <!-- 批量上传文件 -->
@@ -579,11 +581,11 @@ export default {
             })
         },
         //查询技术交底书会话记录
-        queryConfessionSession(onlyQuery,request,result){
+        async queryConfessionSession(onlyQuery,request,result){
             var params = {
                 type:2
             }
-            this.$api.queryConfessionSession(params).then(response=>{
+            await this.$api.queryConfessionSession(params).then(response=>{
             if(response.code == 200){
                 this.confessionSessionList = response.data || []
                 if(!onlyQuery && this.confessionSessionList.length>0){
@@ -621,6 +623,22 @@ export default {
             }
             })
       },
+      //获取生成的技术交底书理解结果
+        async getConversionDetails(){
+            var params = {
+                confessionSessionId:this.currentConversation.id
+            }
+            await this.$api.discoveryResultDetail(params).then(response=>{
+                if(response.code == 200){
+                    let data = response.data || {}
+                    this.currentConversation = {
+                        ...this.currentConversation,
+                        ...data
+                    }
+                }
+            }).catch(error=>{
+            })
+        },
       run(){
         this.$set(this,'result_file',{})
         var params = {
@@ -796,7 +814,7 @@ export default {
         this.$set(this,'notice_file',JSON.parse(JSON.stringify(this.confession)))
         this.$set(this,'current_guid',this.notice_file.guid)
         this.getOption()
-        
+        await this.getConversionDetails()
         //装载结果
         this.getResultContent(obj)
       },
@@ -846,6 +864,11 @@ export default {
           if(data.answer){
             this.$set(this,'result',data.answer)
           }
+          if(data.relevant_file){
+            this.app_file = data.relevant_file.app_file || {}
+            this.modify_file = data.relevant_file.modify_file || {}
+            this.contrast_file = data.relevant_file.contrast_file || []
+          }
           if(data.data){
             let answer_data = data.data
             if(answer_data.code == 200){

+ 62 - 1
src/views/AITools/OADefense/mixins/index1.js

@@ -4,6 +4,7 @@ export default {
     data() {
         return {
             controller:null,
+            hasFiles:null
         }
     },
     computed:{
@@ -93,6 +94,9 @@ export default {
                 const { done, value } = await reader.read();
                 if (done){
                     this.loading = false
+                    if(this.hasFiles){
+                        this.saveAllFiles(this.hasFiles)
+                    }
                     break;
                 } 
                 const chunk = decoder.decode(value);
@@ -122,9 +126,17 @@ export default {
                                 }else if(answer_json.code == 201){//修改后的权利要求输出
                                     this.result = answer_json
                                     this.$set(this.changeClaim,'claim',answer_json.data)
+                                    if(this.app_file && this.app_file.guid){
+                                        this.handleOptionClick(this.app_file,2)
+                                    }
                                 }else if(answer_json.code == 202){//区别技术特征
                                     this.result = answer_json
                                     this.$set(this,'main_claim_reason',answer_json.data)
+                                }else if(answer_json.code == 203){//文件输出
+                                    this.hasFiles = answer_json.data
+                                    this.app_file = answer_json.data.app_file || {}
+                                    this.modify_file = answer_json.data.modify_file || {}
+                                    this.contrast_file = answer_json.data.contrast_file || []
                                 }
                             }catch(e){
                                 if(loading_text!=''){
@@ -157,16 +169,24 @@ export default {
                                             }else if(answer_json.code == 1002){//请求超时
                                                 this.result = answer_json
                                             }else if(answer_json.code == 200){
-                                                this.queryConfessionSession(false,false,true) 
+                                                this.queryConfessionSession(false,false,true)
                                             }else if(answer_json.code == 1003){//中间过程
                                                 this.loading_text = answer_json.data
                                                 loading_text = answer_json.data
                                             }else if(answer_json.code == 201){//修改后的权利要求输出
                                                 this.result = answer_json
                                                 this.$set(this.changeClaim,'claim',answer_json.data)
+                                                if(this.app_file && this.app_file.guid){
+                                                    this.handleOptionClick(this.app_file,2)
+                                                }
                                             }else if(answer_json.code == 202){//区别技术特征
                                                 this.result = answer_json
                                                 this.$set(this,'main_claim_reason',answer_json.data)
+                                            }else if(answer_json.code == 203){//文件输出
+                                                this.hasFiles = answer_json.data
+                                                this.app_file = answer_json.data.app_file || {}
+                                                this.modify_file = answer_json.data.modify_file || {}
+                                                this.contrast_file = answer_json.data.contrast_file || []
                                             }
                                         }catch(e){
                                             if(loading_text!=''){
@@ -192,6 +212,47 @@ export default {
                 }
             }
         },
+
+        //保存文件
+        async saveAllFiles(files){
+            await this.getConversionDetails()
+            let content = this.currentConversation.content
+            var params = {
+                confessionSessionId:this.currentConversation.id,
+            }
+            if(!content){
+                params.content = JSON.stringify(
+                    {
+                        relevant_file:files
+                    }
+                )
+            }else{
+                try{
+                    let data1 = JSON.parse(content)
+                    if(data1.data && data1.data.code == 1001){
+                        data1.data = {}
+                    }
+                    data1.relevant_file = files
+                    params.content = JSON.stringify(data1)
+                    
+                }catch(e){
+                    params.content = JSON.stringify(
+                        {
+                            relevant_file:files
+                        }
+                    ) 
+                }
+            }
+            this.$api.updateConfessionSession(params).then(response=>{
+                if(response.code == 200){
+                    this.queryConfessionSession(true)
+                    this.hasFiles = null
+                }
+            }).catch(error=>{
+                
+            })
+        },
+
         cancelRun(){
             if (this.controller) {
                 this.controller.abort();