12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121 |
- <template>
- <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>
-
- <!-- 左侧文件展示 -->
- <div class="left customize_file" v-show="showLeft">
- <div class="head">
- <div class="head_left">
- <div class="margin-right_10">
- <i v-show="showMenu" class="el-icon-s-fold" @click="showMenu = !showMenu"></i>
- <i v-show="!showMenu" class="el-icon-s-unfold" @click="showMenu = !showMenu"></i>
- </div>
- <div style="font-weight:600">OA答辩</div>
- <el-button size="mini" class="margin-left_10" type="primary" @click="addConversation">添加新OA答辩</el-button>
- <el-button v-if="notice_file.guid && !loading" class="margin-left_10" type="primary" size="mini" @click="regenerate">重新生成</el-button>
- </div>
- <div class="head_right">
- <el-select v-model="current_guid" size="mini" placeholder="请选择">
- <el-option v-if="notice_file.guid" :label="`审查意见通知书-${notice_file.originalName || notice_file.name}`" :value="notice_file.guid" @click.native="handleOptionClick(notice_file,1)"></el-option>
- <el-option v-if="app_file.guid" :label="`申请文件-${app_file.appNo}`" :value="app_file.guid" @click.native="handleOptionClick(app_file,2)"></el-option>
- <el-option v-if="modify_file.guid" :label="`修改对照页`" :value="modify_file.guid" @click.native="handleOptionClick(modify_file,4)"></el-option>
- <template v-if="contrast_file && contrast_file.length>0">
- <el-option
- v-for="(item,index) in contrast_file"
- :key="index"
- :label="`D${item.index}-${item.publicNo}`"
- :value="item.guid"
- @click.native="handleOptionClick(item,3)">
- </el-option>
- </template>
-
- </el-select>
- </div>
-
- </div>
- <div>
- <hr>
- </div>
- <!-- 输入 -->
- <template v-if="add">
- <div >
- <!-- <p>审查意见书:</p>
- <div>
- <el-upload
- ref="upload_file"
- class="upload-demo"
- drag
- action="#"
- :auto-upload="false"
- :limit="1"
- :file-list="notice_file.guid?[notice_file]:[]"
- :on-change="onChange"
- style="width: 100%"
- >
- <i class="el-icon-upload"></i>
- <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
- </el-upload>
- </div>
- <div style="padding: 10px 0;">
- <div><b>相关文件(申请文件和对比文件):(<span style="font-size:18px">非必填</span>)</b></div>
- <div style="font-size:16px;color:red">
- 注:
- <br>
- 1.如果上传了相关文件则优先使用上传的文件,如果不上传则系统会自动获取文件
- <br>
- 2.上传的申请文件要包含本申请号码,对比文件包含对比文件序号或者名称
- </div>
- </div>
- <div>
- <myUpload :file-list="patent_fileUrls" @on-change="onchangeFile" @on-remove="onRemove" style="height: 180px;" :autoUpload="true"></myUpload>
- </div> -->
- <div style="height:calc(100vh - 210px);overflow-y: auto;overflow-x:hidden">
- <div style="display:flex;align-items: center;justify-content:space-between">
- <p class="file_title"><i class="el-icon-star-on"></i>本次需要答复的审查意见通知书</p>
- <div>
- <el-button size="mini" class="margin-right_10" type="primary" @click="batch_upload">批量上传</el-button>
- </div>
- </div>
-
- <div class="upload_file">
- <div v-if="notice_file.guid" class="file_show">
- <myTooltip :content="notice_file.name ? notice_file.name : notice_file.originalName">
- <div class="noWrap file_name">
- <i class="el-icon-document" style="margin-right: 10px"></i>
- <span class="name">{{notice_file.name ? notice_file.name : notice_file.originalName}}</span>
- </div>
- </myTooltip>
- <div class="type">{{ notice_file.guid ? "已上传" : "待上传" }}</div>
- <div class="icon" @click="notice_file = {}">
- <i class="el-icon-close"></i>
- </div>
- </div>
- <el-upload
- v-else
- ref="upload_file"
- class="upload-demo"
- drag
- action="#"
- :auto-upload="false"
- :limit="1"
- :on-change="(file)=>onChange(file,'notice_file')"
- style="width: 100%"
- >
- <i class="el-icon-upload"></i>
- <div class="el-upload__text">
- <div><em>点击上传</em></div>
- <div>或将文件拖到此处上传</div>
- </div>
- </el-upload>
- </div>
- <div style="margin:25px 0;">
- <el-divider content-position="left">相关文件(选填)</el-divider>
- </div>
-
- <p class="file_title">本申请文件</p>
- <div class="upload_file">
- <div v-if="relevant_file.app_file.guid" class="file_show">
- <myTooltip :content="relevant_file.app_file.name ? relevant_file.app_file.name : relevant_file.app_file.originalName">
- <div class="noWrap file_name">
- <i class="el-icon-document" style="margin-right: 10px"></i>
- <span class="name">{{relevant_file.app_file.name ? relevant_file.app_file.name : relevant_file.app_file.originalName}}</span>
- </div>
- </myTooltip>
- <div class="type">{{ relevant_file.app_file.guid ? "已上传" : "待上传" }}</div>
- <div class="icon" @click="relevant_file.app_file = {}">
- <i class="el-icon-close"></i>
- </div>
- </div>
- <el-upload
- v-else
- ref="upload_file"
- class="upload-demo"
- drag
- action="#"
- :auto-upload="false"
- :limit="1"
- :on-change="(file)=>onChange(file,'relevant_file.app_file')"
- style="width: 100%"
- >
- <i class="el-icon-upload"></i>
- <div class="el-upload__text">
- <div><em>点击上传</em></div>
- <div>或将文件拖到此处上传</div>
- </div>
- </el-upload>
- </div>
- <p class="file_title">上一次OA的修改对照页(若有,要包含权利要求和说明书全文内容)</p>
- <div class="upload_file">
- <div v-if="relevant_file.modify_file.guid" class="file_show">
- <myTooltip :content="relevant_file.modify_file.name ? relevant_file.modify_file.name : relevant_file.modify_file.originalName">
- <div class="noWrap file_name">
- <i class="el-icon-document" style="margin-right: 10px"></i>
- <span class="name">{{relevant_file.modify_file.name ? relevant_file.modify_file.name : relevant_file.modify_file.originalName}}</span>
- </div>
- </myTooltip>
- <div class="type">{{ relevant_file.modify_file.guid ? "已上传" : "待上传" }}</div>
- <div class="icon" @click="relevant_file.modify_file = {}">
- <i class="el-icon-close"></i>
- </div>
- </div>
- <el-upload
- v-else
- ref="upload_file"
- class="upload-demo"
- drag
- action="#"
- :auto-upload="false"
- :limit="1"
- :on-change="(file)=>onChange(file,'relevant_file.modify_file')"
- style="width: 100%"
- >
- <i class="el-icon-upload"></i>
- <div class="el-upload__text">
- <div><em>点击上传</em></div>
- <div>或将文件拖到此处上传</div>
- </div>
- </el-upload>
- </div>
- <template v-if="relevant_file.contrast_file">
- <div>
- <div v-for="contrast_file in relevant_file.contrast_file" :key="'D'+contrast_file.order">
- <p class="file_title">对比文件D{{ contrast_file.order }}</p>
- <div class="upload_file">
- <div v-if="contrast_file.file.guid" class="file_show">
- <myTooltip :content="contrast_file.file.name ? contrast_file.file.name : contrast_file.file.originalName">
- <div class="noWrap file_name">
- <i class="el-icon-document" style="margin-right: 10px"></i>
- <span class="name">{{contrast_file.file.name ? contrast_file.file.name : contrast_file.file.originalName}}</span>
- </div>
- </myTooltip>
- <div class="type">{{ contrast_file.file.guid ? "已上传" : "待上传" }}</div>
- <div class="icon" @click="contrast_file.file = {}">
- <i class="el-icon-close"></i>
- </div>
- </div>
- <el-upload
- v-else
- ref="upload_file"
- class="upload-demo"
- drag
- action="#"
- :auto-upload="false"
- :limit="1"
- :on-change="(file)=>onChange(file,'file',contrast_file)"
- style="width: 100%"
- >
- <i class="el-icon-upload"></i>
- <div class="el-upload__text">
- <div><em>点击上传</em></div>
- <div>或将文件拖到此处上传</div>
- </div>
- </el-upload>
- </div>
- </div>
- <div class="addContrastFile">
- <el-button size="medium" @click="add_contrast_file">添加 + </el-button>
- </div>
- </div>
- </template>
- </div>
- <hr style="margin:15px 0;">
- <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>
- </template>
- <hr>
- </div>
- <!-- 中间的线 -->
- <div class="line" v-show="showLeft"></div>
- <!-- 右侧发明点和对话框 -->
- <div class="right" :style="!showLeft?'width:calc(100% - 0px) !important':''">
- <div>
- <div class="head">
- <div class="head_left">
- <div class="margin-right_10">
- <i v-show="showLeft" title="收起左侧内容" class="el-icon-s-fold" @click="showLeft = !showLeft"></i>
- <i v-show="!showLeft" title="展开左侧内容" class="el-icon-s-unfold" @click="showLeft = !showLeft"></i>
- </div>
- <div class="style_starIcon__t_QZN">
- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M3.66699 1.33366C3.66699 0.965469 3.36852 0.666992 3.00033 0.666992C2.63214 0.666992 2.33366 0.965469 2.33366 1.33366V2.33366H1.33366C0.965469 2.33366 0.666992 2.63214 0.666992 3.00033C0.666992 3.36852 0.965469 3.66699 1.33366 3.66699H2.33366V4.66699C2.33366 5.03518 2.63214 5.33366 3.00033 5.33366C3.36852 5.33366 3.66699 5.03518 3.66699 4.66699V3.66699H4.66699C5.03518 3.66699 5.33366 3.36852 5.33366 3.00033C5.33366 2.63214 5.03518 2.33366 4.66699 2.33366H3.66699V1.33366Z" fill="#444CE7"/>
- <path d="M3.66699 11.3337C3.66699 10.9655 3.36852 10.667 3.00033 10.667C2.63214 10.667 2.33366 10.9655 2.33366 11.3337V12.3337H1.33366C0.965469 12.3337 0.666992 12.6321 0.666992 13.0003C0.666992 13.3685 0.965469 13.667 1.33366 13.667H2.33366V14.667C2.33366 15.0352 2.63214 15.3337 3.00033 15.3337C3.36852 15.3337 3.66699 15.0352 3.66699 14.667V13.667H4.66699C5.03518 13.667 5.33366 13.3685 5.33366 13.0003C5.33366 12.6321 5.03518 12.3337 4.66699 12.3337H3.66699V11.3337Z" fill="#444CE7"/>
- <path d="M9.28922 1.76101C9.1902 1.50354 8.94284 1.33366 8.66699 1.33366C8.39114 1.33366 8.14378 1.50354 8.04476 1.76101L6.88864 4.76691C6.68837 5.28761 6.62544 5.43766 6.53936 5.55872C6.45299 5.68019 6.34686 5.78632 6.22539 5.87269C6.10432 5.95878 5.95428 6.02171 5.43358 6.22198L2.42767 7.37809C2.17021 7.47712 2.00033 7.72448 2.00033 8.00033C2.00033 8.27617 2.17021 8.52353 2.42767 8.62256L5.43358 9.77867C5.95428 9.97894 6.10432 10.0419 6.22539 10.128C6.34686 10.2143 6.45299 10.3205 6.53936 10.4419C6.62544 10.563 6.68837 10.713 6.88864 11.2337L8.04476 14.2396C8.14379 14.4971 8.39114 14.667 8.66699 14.667C8.94284 14.667 9.1902 14.4971 9.28922 14.2396L10.4453 11.2337C10.6456 10.713 10.7085 10.563 10.7946 10.4419C10.881 10.3205 10.9871 10.2143 11.1086 10.128C11.2297 10.0419 11.3797 9.97894 11.9004 9.77867L14.9063 8.62256C15.1638 8.52353 15.3337 8.27617 15.3337 8.00033C15.3337 7.72448 15.1638 7.47712 14.9063 7.37809L11.9004 6.22198C11.3797 6.02171 11.2297 5.95878 11.1086 5.87269C10.9871 5.78632 10.881 5.68019 10.7946 5.55872C10.7085 5.43766 10.6456 5.28761 10.4453 4.76691L9.28922 1.76101Z" fill="#444CE7"/>
- </svg>
- </div>
- <div class="title">AI 智能书写 <span v-if="loading"><i class="el-icon-loading margin-left_10"></i></span></div>
- </div>
- <div class="head_right">
- <el-button v-if="!loading && result && result.code != 1001 && !result_file.show" type="primary" size="mini" @click="copy">复制</el-button>
- <el-button v-if="!loading && result && result.code != 1001" type="primary" size="mini" :loading="btnLoading" @click="download_file">下载</el-button>
- </div>
- </div>
- </div>
- <div v-if="!result && loading" class="loading-container">
- <div v-if="loading_text">
- {{ loading_text }} <i class="el-icon-loading margin-left_10"></i>
- </div>
- <div v-else class="loading-text">
- <span>思</span>
- <span>考</span>
- <span>中</span>
- <span>.</span>
- <span>.</span>
- <span>.</span>
- </div>
- </div>
- <div class="result" ref="AIMessage" v-else>
- <template v-if="result_file.show">
- <vabOnlyOffice :option='result_file.option'></vabOnlyOffice>
- </template>
- <!-- 结果 -->
- <template v-else-if="result && result.code == 1001">
- <div>
- <div style="font-size:16px" v-html="result.data.replace('\n','<br>')"></div>
- <div>
- <el-link type="primary" @click="openErrorTip">点击上传</el-link>
- </div>
- </div>
-
- </template>
- <template v-else-if="result && result.code == 1002">
- <div>
- <div style="font-size:16px">
- {{ result.data }},请<el-link type="primary" @click="getResult">重试</el-link>
- </div>
- </div>
-
- </template>
- <template v-else-if="result">
- <div class="answer_warp">
- <div v-for="(item,index) in formateAIAnswer(this.result)" :key="index">
- <div v-if="item.type == 'text'" id='answer'>
- <div v-if="item.content && item.content != 'null'" v-html="renderMarkdown(item.content)"></div>
- </div>
- </div>
- </div>
- </template>
- <div class="jiazai" v-if="result && loading">
- <span style="color:red;">{{loading_text}}</span> <i class="el-icon-loading margin-left_10"></i>
- </div>
- </div>
- </div>
- <!-- 错误提示以及上传文件 -->
- <errorTipDialog ref="errorTip" @submit="reLoadSubmit"></errorTipDialog>
- <!-- 批量上传文件 -->
- <batchFileDialog ref="batchFile" :sign="1" @get_file_obj="get_file_obj"></batchFileDialog>
- </div>
- </template>
-
- <script>
- import vabOnlyOffice from '@/components/VabOnlyOffice/index.vue'
- import mixin from './mixins/index1.js';
- import conversationRecords from '../components/conversationRecords.vue';
- import {renderMarkdown} from '@/utils/markdown'
- import { downLoad2 } from '@/utils'
- import { scrollToBottom } from '../components/mixins/scrollToBottom'
- import errorTipDialog from './dialog/errorTip.vue'
- import batchFileDialog from './dialog/batchFile.vue';
- export default {
- components: {
- conversationRecords,
- vabOnlyOffice,
- errorTipDialog,
- batchFileDialog
- },
- props: {},
- mixins:[mixin,scrollToBottom],
- data() {
- return {
- showMenu:false,//是否显示左侧菜单
- showLeft:true,//展示左侧内容
- currentConversation:{},//当前会话
- confessionSessionList:[],//会话记录
- chat_id:null,
- btnLoading:false,//按钮加载
- loading:false,//生成中
- loading_text:'',
- result:'',//OA答辩结果文本
- show:false,//显示左侧文件
- option:{//左侧文件配置
- url: '',
- isEdit: false,
- fileType: '',
- title: '',
- lang: 'zh-CN',
- isPrint: true,
- user: {
- id: this.$s.getObj('userinfo').id,
- name: this.$s.getObj('userinfo').name
- }
- },
- confession:{},//文件信息
- reLoadSearch:false,//重新生成OA答辩
- add:true,//添加审查通知书
- notice_file:{},//审查通知书文件
- relevant_file:{
- app_file:{},
- modify_file:{},
- contrast_file:[
- {
- order:1,
- file:{}
- },
- {
- order:2,
- file:{}
- },
- {
- order:3,
- file:{}
- },
- ]
- },
- patent_fileUrls:[],//专利文件地址
- result_file:{},//结果文件
- app_file:{},//申请文件
- modify_file:{},//修改对照页文件
- contrast_file:[],//对比文件
- current_guid:'',//左侧当前显示的文件
- };
- },
- watch: {
- result(){
- this.scrollToBottom()
- }
- },
- computed: {},
- created() {
- this.getInit()
- },
- mounted() {},
- methods: {
- renderMarkdown,
- //初始化
- async getInit(){
- this.queryConfessionSession()
- },
- add_contrast_file(){
- let order1 = this.relevant_file.contrast_file[this.relevant_file.contrast_file.length-1].order
- this.relevant_file.contrast_file.push(
- {
- order:order1 + 1,
- file:{}
- }
- )
- },
- //批量上传
- batch_upload(){
- this.$refs.batchFile.open()
- },
- get_file_obj(data){
- if(data.notice_file){
- this.$set(this,'notice_file',data.notice_file)
- }
- if(data.app_file){
- this.$set(this.relevant_file,'app_file',data.app_file)
- }
- if(data.modify_file){
- this.$set(this.relevant_file,'modify_file',data.modify_file)
- }
- if(data.contrast_file && data.contrast_file.length>0){
- let contrast_file = this.relevant_file.contrast_file
- for(let i = 0;i<data.contrast_file.length;i++){
- let item = data.contrast_file[i]
- let order = item.order
- let obj = contrast_file.find(file=>{
- return file.order == order
- })
- if(obj){
- obj.file = item.file
- }else{
- let order1 = contrast_file[contrast_file.length-1].order
- if(order > order1 + 1){
- for(let y = order1 + 1;y < order;y++){
- contrast_file.push(
- {
- order:y,
- file:{}
- }
- )
- }
- }
- contrast_file.push(item)
- }
- }
- }
- },
- //再次提交
- reLoadSubmit(data){
- // if(!data || data.length==0){
- // return
- // }
-
- // for(let i = 0;i<data.length;i++){
- // let name = data[i].name
- // let index = this.patent_fileUrls.findIndex(item=>{
- // return item.name == name
- // })
- // if(index == -1){
- // this.patent_fileUrls.push(data[i])
- // }
- // }
- this.get_file_obj(data)
- let content = this.currentConversation.content
- var params = {
- confessionSessionId:this.currentConversation.id,
- }
- if(!content){
- params.content = JSON.stringify(
- {
- query:{
- // patent_fileUrls:this.patent_fileUrls,
- relevant_file:this.relevant_file,
- }
- }
- )
- }else{
- try{
- let data1 = JSON.parse(content)
- if(data1.data && data1.data.code == 1001){
- data1.data = {}
- }
- // if(data1.query && data1.query.patent_fileUrls){
- // data1.query.patent_fileUrls = this.patent_fileUrls
- // }else{
- // data1.query = {
- // patent_fileUrls:this.patent_fileUrls
- // }
- // }
- if(data1.query && data1.query.relevant_file){
- data1.query.relevant_file = this.relevant_file
- }else{
- data1.query = {
- relevant_file:this.relevant_file
- }
- }
- params.content = JSON.stringify(data1)
-
- }catch(e){
- params.content = JSON.stringify(
- {
- query:{
- // patent_fileUrls:this.patent_fileUrls,
- relevant_file:this.relevant_file
- }
- }
- )
- }
- }
- this.$api.updateConfessionSession(params).then(response=>{
- if(response.code == 200){
- this.reLoadSearch = true
- this.queryConfessionSession()
- this.getResult()
- }
- }).catch(error=>{
-
- })
- },
- //查询技术交底书会话记录
- queryConfessionSession(onlyQuery,request,result){
- var params = {
- type:2
- }
- this.$api.queryConfessionSession(params).then(response=>{
- if(response.code == 200){
- this.confessionSessionList = response.data || []
- if(!onlyQuery && this.confessionSessionList.length>0){
- this.add = false
- let obj = null
- if(this.currentConversation.id){
- obj = this.confessionSessionList.find(item=>{
- return item.id == this.currentConversation.id
- })
- }else{
- obj = this.confessionSessionList[0]
- }
- if(obj){
- this.changeConversation(obj,true)
- }
-
- }else if(this.confessionSessionList.length==0){
- this.addConversation()
- }
- if(request){
- this.getResult()
- }
- if(result){
- if(!this.confessionSessionList || this.confessionSessionList.length==0){
- return
- }
- let obj = this.confessionSessionList.find(item=>{
- return item.id == this.currentConversation.id
- })
- if(!obj){
- obj = this.confessionSessionList[0]
- }
- this.getResultContent(obj)
- }
- }
- })
- },
- run(){
- var params = {
- fileGuid:this.notice_file.guid,
- content:JSON.stringify(
- {
- query:{
- // patent_fileUrls:this.patent_fileUrls,
- relevant_file:this.relevant_file,
- }
- }
- ),
- type:2
- }
- this.$api.addConfessionSession(params).then(response=>{
- if(response.code == 200){
- //查询技术交底书会话记录
- this.currentConversation = {
- id:response.data
- }
- this.queryConfessionSession(false,true)
- }
- }).catch(error=>{
- message.close()
- })
- },
- //结果生成过程中切换、添加、刷新提示
- async loading_change(){
- var isNext = true
- if(this.loading){
- await this.$confirm('结果正在生成中,如果执行当前操作会取消当前的结果生成, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.cancelRun()
- }).catch(() => {
- isNext = false
- });
- }
- return isNext
-
- },
- //添加会话
- async addConversation(){
- let isNext = await this.loading_change()
- if(!isNext){
- return
- }
- this.$set(this,'currentConversation',{})
- this.$set(this,'confession',{})
- this.$set(this,'add',true)
- this.$set(this,'notice_file',{})
- // this.$set(this,'patent_fileUrls',[])
- this.set_relevant_file()
- this.$set(this,'app_file',{})
- this.$set(this,'contrast_file',[])
- this.$set(this,'result_file',{})
- this.$set(this,'current_guid','')
- this.$set(this,'result',null)
- this.$set(this,'loading_text','')
- this.$set(this,'loading',false)
- },
- //设置相关文件初始化
- set_relevant_file(){
- this.$set(this,'relevant_file',
- {
- app_file:{},
- modify_file:{},
- contrast_file:[
- {
- order:1,
- file:{}
- },
- {
- order:2,
- file:{}
- },
- {
- order:3,
- file:{}
- },
- ]
- }
- )
- },
- //切换左侧展示的文件
- handleOptionClick(obj,type){
- switch(type){
- case 1:
- this.confession = obj
- this.getOption()
- case 2:
- case 3:
- case 4:
- if(type == 2){
- obj.originalName = `申请文件-${obj.appNo}`
- }else if(type == 3){
- obj.originalName = `D${obj.index}-${obj.publicNo}`
- }else if(type == 4){
- obj.originalName = "修改对照页"
- }
-
- if(obj.type){
- this.confession = obj
- this.getOption()
- }else{
- this.getFileByGuid(obj)
- }
- break;
- }
- },
- //获取文件信息
- async getFileByGuid(obj){
- if(!obj.guid){
- this.$message.warning('当前文件不存在')
- return
- }
- var fileIds = [obj.guid]
- await this.$api.getFileData(fileIds).then(response=>{
- if(response && response.length>0){
- var data = response[0]
- // obj.originalName = data.originalName
- obj.type = data.type
- this.confession = obj
- this.getOption()
- }
- })
- },
- //切换会话
- async changeConversation(obj,sign){
- if(!sign){
- let isNext = await this.loading_change()
- if(!isNext){
- return
- }
- }
- this.add = false
- if(obj.id == this.currentConversation.id){
- this.currentConversation = obj
- if(sign && !this.reLoadSearch){
- //获取当前会话id
- this.chat_id = obj.conversationId
- this.$set(this,'current_guid',this.notice_file.guid)
- //装载审查意见通知书并展示
- this.confession = obj.systemFile || {}
- this.$set(this,'notice_file',JSON.parse(JSON.stringify(this.confession)))
- this.$set(this,'current_guid',this.notice_file.guid)
- this.getOption()
- this.reLoadSearch = false
- }
- return
- }
- //装载当前会话信息
- this.currentConversation = obj
- //获取当前会话id
- this.chat_id = obj.conversationId
- //装载审查意见通知书并展示
- this.confession = obj.systemFile || {}
- this.$set(this,'notice_file',JSON.parse(JSON.stringify(this.confession)))
- this.$set(this,'current_guid',this.notice_file.guid)
- this.getOption()
-
- //装载结果
- this.getResultContent(obj)
- },
- getResultContent(obj){
- this.result_file = {
- file_message:obj.assoSystemFile || {},
- show:false,
- option:{
- url: '',
- isEdit: false,
- fileType: '',
- title: '',
- lang: 'zh-CN',
- isPrint: true,
- user: {
- id: this.$s.getObj('userinfo').id,
- name: this.$s.getObj('userinfo').name
- }
- }
- }
- this.getResultOption()
- this.$set(this,'result',null)
- // this.$set(this,'patent_fileUrls',[])
- this.set_relevant_file()
- this.contrast_file = []
- this.app_file = {}
- let content = obj.content
- if(!content){
- // this.$set(this,'patent_fileUrls',[])
- this.set_relevant_file()
- return
- }
- try{
- let data = JSON.parse(content)
- // if(data.query && data.query.patent_fileUrls){
- // this.$set(this,'patent_fileUrls',data.query.patent_fileUrls)
- // }
- if(data.query && data.query.relevant_file){
- this.$set(this,'relevant_file',data.query.relevant_file)
- }
- if(data.answer){
- this.$set(this,'result',data.answer)
- }
- if(data.data){
- let answer_data = data.data
- if(answer_data.code == 200){
- this.app_file = answer_data.data.app_file || {}
- this.modify_file = answer_data.data.modify_file || {}
- this.contrast_file = answer_data.data.contrast_file || []
- if(!this.result_file.show){
- let num = answer_data.data.num
- let claim_change = answer_data.data.claim_change
- let defense_opinion = answer_data.data.defense_opinion || []
- let reason = answer_data.data.reason
- let html = `<div style="line-height: 1.8em;"><div style="text-align: center;"><b>意见陈述书</b></div><div style="text-indent: 2em;margin: 0;">尊敬的审查员:</div><div style="text-indent: 2em;margin: 0;">首先,感谢审查员为审查本申请而付出的艰辛劳动!</div><div style="text-indent: 2em;margin: 0;">本意见陈述书是对国家知识产权局发出的第${num}次审查意见通知书所作的答复。</div><div style="text-indent: 2em;margin: 0;">审查意见通知书中指出:${ reason }</div><div style="text-indent: 2em;margin: 0;">申请人在仔细阅读、认真研究审查员的审查意见之后,在原权利要求书的基础上对权利要求进行了修改,并陈述意见如下:</div><div style="text-indent: 2em;margin: 0;"><b>一、修改说明</b></div><div style="text-indent: 2em;margin: 0;">${claim_change}</div><div style="text-indent: 2em;margin: 0;">`
- defense_opinion.forEach(item => {
- html = html + `<p>${item}</p>`
- });
- html = html + `</div><div style="text-indent: 2em;margin: 0;">综上所述,申请人认为,经过上述对原申请文件的陈述,已克服审查员在审查意见通知书中所指出的所有缺陷,希望审查员能以此为基础继续对本发明进行审查,如果审查员认为该申请仍有不符合专利法及其实施细则规定之处,恳请再给予一次陈述意见/修改的机会。</div><div style="text-indent: 2em;margin: 0;">感谢审查员的辛勤工作。</div></div>`
- this.$set(this,'result',html)
- }
- }else if(answer_data.code == 1001){
- this.result = answer_data
- this.$refs.errorTip.open(answer_data)
- }else if(answer_data.code == 1002){
- this.result = answer_data
- }
-
- }
-
- }catch(e){
-
- }
- },
- openErrorTip(){
- this.$refs.errorTip.open(this.result)
- },
- setData(row,field,value){
- var fieldArray = field.split('.')
- let current = row || this;
- // 遍历路径中的每一部分,直到最后一个属性的父对象
- for (let i = 0; i < fieldArray.length - 1; i++) {
- // 确保当前对象有下一个属性,否则创建一个空对象(或你需要的任何默认值)
- if (!current.hasOwnProperty(fieldArray[i])) {
- current[fieldArray[i]] = {};
- }
- current = current[fieldArray[i]];
- }
-
- // 给最后一个属性赋值
- current[fieldArray[fieldArray.length - 1]] = value;
- },
- //上传文件
- onChange(file,field,row){
- let formData = new FormData()
- formData.append('sourceId',this.$constants.sourceId)
- formData.append('files',file.raw)
-
- var notice_file = {
- name:file.raw.name
- }
- var message = this.$message({
- message: '文件上传中...',
- type: 'warning',
- duration:0
- });
- this.$api.uploadFile(formData).then(response=>{
- if(response.code == 200){
- let guid = response.data[0]
- notice_file.guid = guid
- // this.$set(this,field,notice_file)
- this.setData(row,field,notice_file)
- message.close()
- this.$message.success('文件上传成功')
- }
- })
- },
- getOption(data,model='view'){
- let option_data = data || this.confession
- if(!option_data.guid){
- this.$message.warning('文件不存在')
- return
- }
- this.show = false
- this.option.name = option_data.originalName
- this.option.id = option_data.guid
- this.option.title = option_data.originalName
- this.option.url = this.$c.url+ (this.$c.env=='production'?'/api':'')+'/fileManager/downloadFile?fileId=' + option_data.guid
- this.option.fileType = option_data.type
- this.option.key = option_data.guid
-
- this.option.model = model
- this.$nextTick(()=>{
- this.show = true
- })
- },
- getResultOption(model='edit'){
- let option_data = this.result_file.file_message
- if(!option_data.guid){
- // this.$message.warning('文件不存在')
- return
- }
- let option = this.result_file.option
- // this.result_file.show = false
- this.$set(this.result_file,'show',false)
- option.name = option_data.originalName
- option.id = option_data.guid
- option.title = option_data.originalName
- option.url = this.$c.url+ (this.$c.env=='production'?'/api':'')+'/fileManager/downloadFile?fileId=' + option_data.guid
- option.fileType = option_data.type
- option.key = option_data.guid
-
- option.model = model
- this.$nextTick(()=>{
- this.$set(this.result_file,'show',true)
- })
- },
- //下载文件
- async download_file(){
- if(this.currentConversation.assoSystemFile && this.currentConversation.assoSystemFile.guid){
- downLoad2(this.currentConversation.assoSystemFile.guid,this.currentConversation.assoSystemFile.originalName)
- return
- }
- let confessionSessionId = this.currentConversation.id
- let filename = this.currentConversation.conversationName
- this.btnLoading = true
- let html = ''
- let answerDomList = document.querySelectorAll('#answer')
-
- if(answerDomList.length == 0){
- this.btnLoading = false
- return
- }
- let answerDom = answerDomList[answerDomList.length - 1]
- html = answerDom.innerHTML
- let guid = await this.$commonJS.exportToWordByHtml(html,filename,true)
- if(guid){
- this.saveResultFile(confessionSessionId,guid)
- }
- this.btnLoading = false
- },
- //保存下载之后的文件
- saveResultFile(confessionSessionId,guid){
- var params = {
- confessionSessionId:confessionSessionId,
- guid:guid
- }
- this.$api.addConfessionSessionFile(params).then(response=>{
- if(response.code == 200){
- this.queryConfessionSession()
- }
- })
- },
- //重新生成
- regenerate(){
- this.run()
- },
- },
- };
- </script>
- <style lang="scss">
- .OADefense{
- .file_title{
- font-weight: bold;
- i{
- color: red !important;
- }
- }
- .file_show{
- display: flex;
- align-items: center;
- justify-content: space-between;
- line-height: 100px;
- .file_name{
- width: calc(100% - 90px);
- }
- .type {
- min-width:75px;
- display: block;
- color: #57a5f7;
- }
- .icon {
- display: none;
- }
- }
- .file_show:hover {
- background: #f4f4f4;
- .name {
- color: #57a5f7;
- cursor: pointer;
- }
- .type {
- min-width:75px;
- display: none;
- }
- .icon {
- display: block;
- cursor: pointer;
- }
- }
- .customize_file{
- .upload-demo{
- .el-upload{
- width: 100% !important;
- }
-
- .el-upload-dragger {
- width: 100% !important;
- height:100px !important;
- display: flex;
- align-items: center;
- .el-icon-upload{
- font-size: 40px !important;
- margin: 0 25px !important;
- }
- }
- }
- }
-
- }
-
- </style>
- <style lang="scss" scoped>
- .OADefense{
- position: relative;
- display: flex;
- align-items: stretch;
- height: calc(100% - 20px);
- width:calc(100% - 20px);
- padding: 10px;
- .left{
- width:50%;
- height:calc(100% - 0px);
- padding-right: 10px;
- display: flex;
- flex-direction: column;
- .head{
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding-bottom: 10px;
- .head_left{
- display: flex;
- align-items: center;
- }
- i{
- font-size: 20px;
- }
- }
- .addContrastFile{
- margin-top: 10px;
- display: flex;
- justify-content: center;
- width: 100%;
- }
- .run{
- display: flex;
- justify-content: space-between;
- .btn_content{
- font-size: 14px;
- display: flex;
- align-items: center;
- i{
- margin-right: 5px;
- font-size: 16px;
- }
- }
- }
- }
- .line{
- width:2px;
- height: 100%;
- background: #e6e6e6;
- }
- .right{
- width:calc(100% - 50% - 2px);
- min-width: 450px;
- height:100%;
- padding-left: 10px;
- display: flex;
- flex-direction: column;
- .head{
- display: flex;
- align-items: center;
- justify-content: space-between;
- .head_left,.head_right{
- display: flex;
- align-items: center;
- }
- }
- .style_starIcon__t_QZN{
- width: 16px;
- height: 16px;
- }
- .title{
- margin-left: 20px;
- font-weight: 600;
- }
- .result{
- margin-top: 20px;
- height:calc(100% - 20px - 30px);
- overflow: auto;
-
- &:empty::after{
- content: "无结果";
- color:#c2c5c9;
- text-align: center;
- }
- .jiazai{
- display: flex;
- align-items: center;
- height: 20px;
- }
- }
- .loading-container{
- display: flex;
- justify-content: center;
- align-items: center;
- height: 100vh;
- .loading-text {
- font-size: 24px;
- font-family: Arial;
- display: flex;
- gap: 4px;
- }
-
- .loading-text span {
- display: inline-block;
- animation: bounce 1.2s infinite ease-in-out;
- color: black;
- }
-
- .loading-text span:nth-child(2) { animation-delay: 0.1s; }
- .loading-text span:nth-child(3) { animation-delay: 0.2s; }
- .loading-text span:nth-child(4) { animation-delay: 0.3s; }
- .loading-text span:nth-child(5) { animation-delay: 0.4s; }
-
- @keyframes bounce {
- 0%, 40%, 100% {
- transform: translateY(0);
- }
- 20% {
- transform: translateY(-15px);
- }
- }
- }
- }
- }
- </style>
|