<template>
  <div class="details" ref="detailsHead">
    <div class="head" >
        <el-dropdown @command="batchAdd">
            <el-button type="primary" size="small">
                批量添加<i class="el-icon-arrow-down el-icon--right"></i>
            </el-button>
            <el-dropdown-menu slot="dropdown">
                <el-dropdown-item command="invalidReasonDetail2" v-if="ifSecondInvalid">第二次无效理由详情</el-dropdown-item>
                <el-dropdown-item command="invalidReasonDetail1" v-else>无效理由详情</el-dropdown-item>
                <el-dropdown-item command="presentOpinions2"  v-if="ifSecondInvalid">第二次答辩意见</el-dropdown-item>
                <el-dropdown-item command="presentOpinions1" v-else>答辩意见</el-dropdown-item>
                <el-dropdown-item command="rbOpinions">{{ifSecondInvalid?'第二次':''}}复审委意见</el-dropdown-item>
                <el-dropdown-item command="rbDecisionKey">{{ifSecondInvalid?'第二次':''}}复审委要点提炼</el-dropdown-item>
                <el-dropdown-item command="a">{{ifSecondInvalid?'第二次':''}}复审委决定详情</el-dropdown-item>
            </el-dropdown-menu>
        </el-dropdown>
        <el-button type="primary" size="small" @click="editContent" class="margin-right_10">{{edit?'完成':'编辑'}}</el-button>
    </div>
    <div class="content" v-if="content.proofGroupMessage">
        <template v-if="['5','4','8'].indexOf(row.statutesId) ==-1">
            <div >
                <div class="left">
                    权要
                </div>
                <div class="right">
                    <div>
                        <span v-html="row.claimText"> </span>
                    </div>
                </div>
            </div>
            <div>
                <div class="left">
                    复审委决定
                </div>
                <div class="right">
                    <div v-if="edit">
                        <el-select v-model="row.rbDecision" @change="(val)=>updatePatentClaimMessage(val,'rbDecision')"  placeholder="请选择">
                            <el-option label="维持有效"  value="维持有效"></el-option>
                            <el-option label="部分有效"  value="部分有效"></el-option>
                            <el-option label="无效"  value="无效"></el-option>
                        </el-select>
                    </div>
                    <div v-else>
                        <span v-html="row.rbDecision"> </span>
                    </div>
                </div>
            </div>
            <div>
                <div class="left">
                    一审法院决定
                </div>
                <div class="right">
                    <div v-if="edit">
                        <el-select v-model="row.courtDecision1" @change="(val)=>updatePatentClaimMessage(val,'courtDecision1')" placeholder="请选择">
                            <el-option label="维持有效"  value="维持有效"></el-option>
                            <el-option label="部分有效"  value="部分有效"></el-option>
                            <el-option label="无效"  value="无效"></el-option>
                        </el-select>
                    </div>
                    <div v-else>
                        <span v-html="row.courtDecision1"> </span>
                    </div>
                </div>
            </div>
            <div>
                <div class="left">
                    二审法院决定
                </div>
                <div class="right">
                    <div v-if="edit">
                        <el-select v-model="row.courtDecision2" @change="(val)=>updatePatentClaimMessage(val,'courtDecision2')" placeholder="请选择">
                            <el-option label="维持有效"  value="维持有效"></el-option>
                            <el-option label="部分有效"  value="部分有效"></el-option>
                            <el-option label="无效"  value="无效"></el-option>
                        </el-select>
                    </div>
                    <div v-else>
                        <span v-html="row.courtDecision2"> </span>
                    </div>
                </div>
            </div>
        </template>
        <template>
            <div>
                <div class="left">
                    无效法条
                </div>
                <div class="right">
                    <div>
                        <span>{{ getProvisionName(row.statutesId) }}</span>
                    </div>
                </div>
            </div>
            <template>
                <div>
                    <div class="left">
                        一审起诉人意见
                    </div>
                    <div class="right">
                        <div v-if="edit">
                            <my-RichText v-model="row.prosecutorOpinions1" style="width:100%" placeholder="请输入" @change="updateInvalidStatutesMessage($event,'prosecutorOpinions1')"></my-RichText>
                        </div>
                        <div v-else>
                            <span v-html="row.prosecutorOpinions1"> </span>
                        </div>
                    </div>
                </div>
                <div>
                    <div class="left">
                        一审被诉人意见
                    </div>
                    <div class="right">
                        <div v-if="edit">
                            <my-RichText v-model="row.respondentOpinions1" style="width:100%" placeholder="请输入" @change="updateInvalidStatutesMessage($event,'respondentOpinions1')"></my-RichText>
                        </div>
                        <div v-else>
                            <span v-html="row.respondentOpinions1"> </span>
                        </div>
                    </div>
                </div>
                <div>
                    <div class="left">
                        一审第三方意见
                    </div>
                    <div class="right">
                        <div v-if="edit">
                            <my-RichText v-model="row.thirdOpinions1" style="width:100%" placeholder="请输入" @change="updateInvalidStatutesMessage($event,'thirdOpinions1')"></my-RichText>
                        </div>
                        <div v-else>
                            <span v-html="row.thirdOpinions1"> </span>
                        </div>
                    </div>
                </div>
                <div>
                    <div class="left">
                        一审法院意见
                    </div>
                    <div class="right">
                        <div v-if="edit">
                            <my-RichText v-model="row.courtOpinions1" style="width:100%" placeholder="请输入" @change="updateInvalidStatutesMessage($event,'courtOpinions1')"></my-RichText>
                        </div>
                        <div v-else>
                            <span v-html="row.courtOpinions1"> </span>
                        </div>
                    </div>
                </div>
            </template>
            <template>
                <div>
                    <div class="left">
                        二审起诉人意见
                    </div>
                    <div class="right">
                        <div v-if="edit">
                            <my-RichText v-model="row.prosecutorOpinions2" style="width:100%" placeholder="请输入" @change="updateInvalidStatutesMessage($event,'prosecutorOpinions2')"></my-RichText>
                        </div>
                        <div v-else>
                            <span v-html="row.prosecutorOpinions2"> </span>
                        </div>
                    </div>
                </div>
                <div>
                    <div class="left">
                        二审被诉人意见
                    </div>
                    <div class="right">
                        <div v-if="edit">
                            <my-RichText v-model="row.respondentOpinions2" style="width:100%" placeholder="请输入" @change="updateInvalidStatutesMessage($event,'respondentOpinions2')"></my-RichText>
                        </div>
                        <div v-else>
                            <span v-html="row.respondentOpinions2"> </span>
                        </div>
                    </div>
                </div>
                <div>
                    <div class="left">
                        二审第三方意见
                    </div>
                    <div class="right">
                        <div v-if="edit">
                            <my-RichText v-model="row.thirdOpinions2" style="width:100%" placeholder="请输入" @change="updateInvalidStatutesMessage($event,'thirdOpinions2')"></my-RichText>
                        </div>
                        <div v-else>
                            <span v-html="row.thirdOpinions2"> </span>
                        </div>
                    </div>
                </div>
                <div>
                    <div class="left">
                        二审法院意见
                    </div>
                    <div class="right">
                        <div v-if="edit">
                            <my-RichText v-model="row.courtOpinions2" style="width:100%" placeholder="请输入" @change="updateInvalidStatutesMessage($event,'courtOpinions2')"></my-RichText>
                        </div>
                        <div v-else>
                            <span v-html="row.courtOpinions2"> </span>
                        </div>
                    </div>
                </div>
            </template>
        </template>
        <template  v-if="['2','3','4','8'].indexOf(row.statutesId) !=-1">
            <div>
                <div class="left">
                    组合
                </div>
                <div class="right">
                    <div>
                        <span v-html="row.proofGroupDescription"> </span>
                    </div>
                </div>
            </div>
            <div v-for="(item, index) in groupValue" :key="index">
                <div class="left">
                    {{item.label}}
                </div>
                <div class="right">
                    <div v-if="edit">
                        <my-RichText v-model="content.proofGroupMessage[item.field]" style="width:100%" placeholder="请输入" @change="updateGroupMessage($event,item.field)"></my-RichText>
                    </div>
                    <div v-else>
                        <span v-html="content.proofGroupMessage[item.field]"> </span>
                    </div>
                </div>
            </div>
            <template>
                <div>
                    <div class="left">
                        一审起诉人意见
                    </div>
                    <div class="right">
                        <div v-if="edit">
                            <my-RichText v-model="content.proofGroupMessage.prosecutorOpinions1" style="width:100%" placeholder="请输入" @change="updateGroupMessage($event,'prosecutorOpinions1')"></my-RichText>
                        </div>
                        <div v-else>
                            <span v-html="content.proofGroupMessage.prosecutorOpinions1"> </span>
                        </div>
                    </div>
                </div>
                <div>
                    <div class="left">
                        一审被诉人意见
                    </div>
                    <div class="right">
                        <div v-if="edit">
                            <my-RichText v-model="content.proofGroupMessage.respondentOpinions1" style="width:100%" placeholder="请输入" @change="updateGroupMessage($event,'respondentOpinions1')"></my-RichText>
                        </div>
                        <div v-else>
                            <span v-html="content.proofGroupMessage.respondentOpinions1"> </span>
                        </div>
                    </div>
                </div>
                <div>
                    <div class="left">
                        一审第三方意见
                    </div>
                    <div class="right">
                        <div v-if="edit">
                            <my-RichText v-model="content.proofGroupMessage.thirdOpinions1" style="width:100%" placeholder="请输入" @change="updateGroupMessage($event,'thirdOpinions1')"></my-RichText>
                        </div>
                        <div v-else>
                            <span v-html="content.proofGroupMessage.thirdOpinions1"> </span>
                        </div>
                    </div>
                </div>
                <div>
                    <div class="left">
                        一审法院意见
                    </div>
                    <div class="right">
                        <div v-if="edit">
                            <my-RichText v-model="content.proofGroupMessage.courtOpinions1" style="width:100%" placeholder="请输入" @change="updateGroupMessage($event,'courtOpinions1')"></my-RichText>
                        </div>
                        <div v-else>
                            <span v-html="content.proofGroupMessage.courtOpinions1"> </span>
                        </div>
                    </div>
                </div>
            </template>
            <template>
                <div>
                    <div class="left">
                        二审起诉人意见
                    </div>
                    <div class="right">
                        <div v-if="edit">
                            <my-RichText v-model="content.proofGroupMessage.prosecutorOpinions2" style="width:100%" placeholder="请输入" @change="updateGroupMessage($event,'prosecutorOpinions2')"></my-RichText>
                        </div>
                        <div v-else>
                            <span v-html="content.proofGroupMessage.prosecutorOpinions2"> </span>
                        </div>
                    </div>
                </div>
                <div>
                    <div class="left">
                        二审被诉人意见
                    </div>
                    <div class="right">
                        <div v-if="edit">
                            <my-RichText v-model="content.proofGroupMessage.respondentOpinions2" style="width:100%" placeholder="请输入" @change="updateGroupMessage($event,'respondentOpinions2')"></my-RichText>
                        </div>
                        <div v-else>
                            <span v-html="content.proofGroupMessage.respondentOpinions2"> </span>
                        </div>
                    </div>
                </div>
                <div>
                    <div class="left">
                        二审第三方意见
                    </div>
                    <div class="right">
                        <div v-if="edit">
                            <my-RichText v-model="content.proofGroupMessage.thirdOpinions2" style="width:100%" placeholder="请输入" @change="updateGroupMessage($event,'thirdOpinions2')"></my-RichText>
                        </div>
                        <div v-else>
                            <span v-html="content.proofGroupMessage.thirdOpinions2"> </span>
                        </div>
                    </div>
                </div>
                <div>
                    <div class="left">
                        二审法院意见
                    </div>
                    <div class="right">
                        <div v-if="edit">
                            <my-RichText v-model="content.proofGroupMessage.courtOpinions2" style="width:100%" placeholder="请输入" @change="updateGroupMessage($event,'courtOpinions2')"></my-RichText>
                        </div>
                        <div v-else>
                            <span v-html="content.proofGroupMessage.courtOpinions2"> </span>
                        </div>
                    </div>
                </div>
            </template>
        </template>
    </div>
    <div v-if="content.showFeature">
        <div v-for="(item,index) in content.FirstEvidenceReason" :key="index">
            <div class="content" style="background:#ffca00">
                <div>
                    <div class="left">
                        特征{{ item.featureOrder }}
                    </div>
                    <div class="right">
                        <span v-html="item.featureText" v-if="['4','8'].indexOf(row.statutesId) ==-1"> </span>
                        <span v-else>
                            <div v-if="item.featureText">
                                <el-image style="width:120px" :src="$commonJS.checkViewer(item.featureText)" :preview-src-list="[$commonJS.checkViewer(item.featureText)]"></el-image>
                            </div>
                        </span>
                    </div>
                </div>
            </div>
           
            <!-- <div class="border" v-if="item.evidenceList && item.evidenceList.length>0">
                <div class="top">无效证据：</div>
                <div>
                    <table class="table">
                        <tr>
                            <td>无效证据</td>
                            <td>无效证据详情</td>
                            <td>答辩意见陈述情况</td>
                            <td>答辩意见</td>
                            <td v-if="!ifSecondInvalid">复审委意见结论</td>
                            <td v-if="!ifSecondInvalid">复审委意见</td>
                            <td v-if="!ifSecondInvalid">复审委要点提炼</td>
                        </tr>
                        <tr v-for="(literature,i) in item.evidenceList" :key="'literatures'+i">
                            <td>
                                <span v-for="(evidence,y) in literature.literatures" :key="'evidence'+y">
                                    <span v-if="evidence.id <= 0">{{ evidence.name }}</span>
                                    <span v-else>D{{ evidence.sysOrder }}</span>
                                    <span v-if="y < literature.literatures.length-1"> + </span>
                                </span>
                            </td>
                            <td>
                                <div v-if="edit">
                                    <my-RichText v-model="literature.evidenceText" placeholder="请输入无效证据详情" @change="updateEvidenceMessage($event,'evidenceText',item)"></my-RichText>
                                </div>
                                <div v-else>
                                   <span v-html="literature.evidenceText"> </span>
                                </div>
                            </td>
                            <td>
                                    <div v-if="edit">
                                        <el-select v-model="literature.erIfPresentOpinions1"  @change="(val)=>updateEvidenceMessage(val,'ifPresentOpinions1',item)" placeholder="请选择">
                                            <el-option label="已陈述"  :value="true"></el-option>
                                            <el-option label="未陈述"  :value="false"></el-option>
                                        </el-select>
                                    </div>
                                    <div v-else>
                                        <span v-if="literature.erIfPresentOpinions1==true">
                                            已陈述
                                        </span>
                                        <span v-else-if="literature.erIfPresentOpinions1==false">
                                            未陈述
                                        </span>
                                        <span v-else>
                                        </span>
                                    </div>
                                </td>
                            <td>
                                <div v-if="edit">
                                    <my-RichText v-model="literature.erPresentOpinions1" placeholder="请输入答辩意见" @change="updateEvidenceMessage($event,'presentOpinions1',item)"></my-RichText>
                                </div>
                                <div v-else>
                                   <span v-html="literature.erPresentOpinions1"> </span>
                                </div>
                            </td>
                            <td v-if="!ifSecondInvalid" >
                                <div v-if="edit">
                                        <el-select v-model="literature.erRbSummary"  @change="(val)=>updateEvidenceMessage(val,'rbSummary',item.secondEvidenceReason)" placeholder="请选择">
                                            <el-option label="认可请求人意见"  value="认可请求人意见"></el-option>
                                            <el-option label="认可权利人意见"  value="认可权利人意见"></el-option>
                                            <el-option label="均不认可"  value="均不认可"></el-option>
                                        </el-select>
                                    </div>
                                    <div v-else>
                                        {{ literature.erRbSummary }}
                                    </div>
                                </td>
                            <td v-if="!ifSecondInvalid">
                                <div v-if="edit">
                                    <my-RichText v-model="literature.erRbOpinions" placeholder="请输入复审委意见" @change="updateEvidenceMessage($event,'rbOpinions',item)"></my-RichText>
                                </div>
                                <div v-else>
                                   <span v-html="literature.erRbOpinions"> </span>
                                </div>
                            </td>
                            <td v-if="!ifSecondInvalid">
                                <div v-if="edit">
                                    <my-RichText v-model="literature.erRbDecisionKey" placeholder="请输入复审委要点提炼" @change="updateEvidenceMessage($event,'rbDecisionKey',item)"></my-RichText>
                                </div>
                                <div v-else>
                                    <span v-html="literature.erRbDecisionKey"> </span>
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </div> -->
            <div class="border"  v-if="['2','3','4','8'].indexOf(row.statutesId) !=-1">
                <div class="top">无效证据</div>
                <div class="content" v-for="(literature,i) in item.evidenceList" :key="'literatures'+i">
                    <div class="content content_item">
                        <div>
                            <div class="left">无效证据</div>
                            <div class="right">
                                <span v-for="(evidence,y) in literature.literatures" :key="'evidence'+y">
                                    <span v-if="evidence.id <= 0">{{ evidence.name }}</span>
                                    <span v-else class="cursor_pointer" @click="checkEvidenceDetails(item)">D{{ evidence.sysOrder }}</span>
                                    <span v-if="y < literature.literatures.length-1"> + </span>
                                </span>
                            </div>
                        </div>
                        <div>
                            <div class="left">无效证据详情</div>
                            <div class="right">
                                <div v-if="edit">
                                    <my-RichText v-model="literature.evidenceText" placeholder="请输入无效证据详情" @change="updateEvidenceMessage($event,'evidenceText',item)"></my-RichText>
                                </div>
                                <div v-else>
                                   <span v-html="literature.evidenceText"> </span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="content content_item">
                        <div>
                            <div class="left">答辩意见陈述情况</div>
                            <div class="right">
                                <div v-if="edit">
                                    <el-select v-model="literature.erIfPresentOpinions1"  @change="(val)=>updateEvidenceMessage(val,'ifPresentOpinions1',item)" placeholder="请选择">
                                        <el-option label="已陈述"  :value="true"></el-option>
                                        <el-option label="未陈述"  :value="false"></el-option>
                                    </el-select>
                                </div>
                                <div v-else>
                                    <span v-if="literature.erIfPresentOpinions1==true"> 已陈述</span>
                                    <span v-else-if="literature.erIfPresentOpinions1==false">未陈述</span>
                                    <span v-else></span>
                                </div>
                            </div>
                        </div>
                        <div>
                            <div class="left">答辩意见</div>
                            <div class="right">
                                <div v-if="edit">
                                    <my-RichText v-model="literature.erPresentOpinions1" placeholder="请输入答辩意见" @change="updateEvidenceMessage($event,'presentOpinions1',item)"></my-RichText>
                                </div>
                                <div v-else>
                                   <span v-html="literature.erPresentOpinions1"> </span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <template v-if="!ifSecondInvalid || !(item.secondEvidenceReason&&item.secondEvidenceReason.evidenceList && item.secondEvidenceReason.evidenceList.length>0)">
                        <div class="content content_item">
                            <div>
                                <div class="left">复审委意见结论</div>
                                <div class="right">
                                    <div v-if="edit">
                                        <el-select v-model="literature.erRbSummary"  @change="(val)=>updateEvidenceMessage(val,'rbSummary',item)" placeholder="请选择">
                                            <el-option label="认可请求人意见"  value="认可请求人意见"></el-option>
                                            <el-option label="认可权利人意见"  value="认可权利人意见"></el-option>
                                            <el-option label="均不认可"  value="均不认可"></el-option>
                                        </el-select>
                                    </div>
                                    <div v-else>
                                        {{ literature.erRbSummary }}
                                    </div>
                                </div>
                            </div>
                            <div>
                                <div class="left">复审委意见</div>
                                <div class="right">
                                    <div v-if="edit">
                                        <my-RichText v-model="literature.erRbOpinions" placeholder="请输入复审委意见" @change="updateEvidenceMessage($event,'rbOpinions',item)"></my-RichText>
                                    </div>
                                    <div v-else>
                                    <span v-html="literature.erRbOpinions"> </span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="content content_item">
                            <div>
                                <div class="left">复审委要点提炼</div>
                                <div class="right">
                                    <div v-if="edit">
                                        <my-RichText v-model="literature.erRbDecisionKey" placeholder="请输入复审委要点提炼" @change="updateEvidenceMessage($event,'rbDecisionKey',item)"></my-RichText>
                                    </div>
                                    <div v-else>
                                        <span v-html="literature.erRbDecisionKey"> </span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <template>
                            <div class="content content_item">
                                <div>
                                    <div class="left">一审起诉人意见</div>
                                    <div class="right">
                                        <div v-if="edit">
                                            <my-RichText v-model="literature.erProsecutorOpinions1" placeholder="请输入复审委意见" @change="updateEvidenceMessage($event,'prosecutorOpinions1',item)"></my-RichText>
                                        </div>
                                        <div v-else>
                                            <span v-html="literature.erProsecutorOpinions1"> </span>
                                        </div>
                                    </div>
                                </div>
                                <div>
                                    <div class="left">一审被诉人意见</div>
                                    <div class="right">
                                        <div v-if="edit">
                                            <my-RichText v-model="literature.erRespondentOpinions1" placeholder="请输入复审委意见" @change="updateEvidenceMessage($event,'respondentOpinions1',item)"></my-RichText>
                                        </div>
                                        <div v-else>
                                            <span v-html="literature.erRespondentOpinions1"> </span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="content content_item">
                                <div>
                                    <div class="left">一审第三方意见</div>
                                    <div class="right">
                                        <div v-if="edit">
                                            <my-RichText v-model="literature.erThirdOpinions1" placeholder="请输入复审委意见" @change="updateEvidenceMessage($event,'thirdOpinions1',item)"></my-RichText>
                                        </div>
                                        <div v-else>
                                            <span v-html="literature.erThirdOpinions1"> </span>
                                        </div>
                                    </div>
                                </div>
                                <div>
                                    <div class="left">一审法院意见</div>
                                    <div class="right">
                                        <div v-if="edit">
                                            <my-RichText v-model="literature.erCourtOpinions1" placeholder="请输入复审委意见" @change="updateEvidenceMessage($event,'courtOpinions1',item)"></my-RichText>
                                        </div>
                                        <div v-else>
                                            <span v-html="literature.erCourtOpinions1"> </span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </template>
                        <template>
                            <div class="content content_item">
                                <div>
                                    <div class="left">二审起诉人意见</div>
                                    <div class="right">
                                        <div v-if="edit">
                                            <my-RichText v-model="literature.erProsecutorOpinions2" placeholder="请输入复审委意见" @change="updateEvidenceMessage($event,'prosecutorOpinions2',item)"></my-RichText>
                                        </div>
                                        <div v-else>
                                            <span v-html="literature.erProsecutorOpinions2"> </span>
                                        </div>
                                    </div>
                                </div>
                                <div>
                                    <div class="left">二审被诉人意见</div>
                                    <div class="right">
                                        <div v-if="edit">
                                            <my-RichText v-model="literature.erRespondentOpinions2" placeholder="请输入复审委意见" @change="updateEvidenceMessage($event,'respondentOpinions2',item)"></my-RichText>
                                        </div>
                                        <div v-else>
                                            <span v-html="literature.erRespondentOpinions2"> </span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="content content_item">
                                <div>
                                    <div class="left">二审第三方意见</div>
                                    <div class="right">
                                        <div v-if="edit">
                                            <my-RichText v-model="literature.erThirdOpinions2" placeholder="请输入复审委意见" @change="updateEvidenceMessage($event,'thirdOpinions2',item)"></my-RichText>
                                        </div>
                                        <div v-else>
                                            <span v-html="literature.erThirdOpinions2"> </span>
                                        </div>
                                    </div>
                                </div>
                                <div>
                                    <div class="left">二审法院意见</div>
                                    <div class="right">
                                        <div v-if="edit">
                                            <my-RichText v-model="literature.erCourtOpinions2" placeholder="请输入复审委意见" @change="updateEvidenceMessage($event,'courtOpinions2',item)"></my-RichText>
                                        </div>
                                        <div v-else>
                                            <span v-html="literature.erCourtOpinions2"> </span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </template>
                    </template>
                </div>
            </div>
            <div class="content">
                <div>
                    <div class="left">
                        无效理由详情
                    </div>
                    <div class="right">
                        <div v-if="edit">
                            <my-RichText v-model="item.feInvalidReasonDetail1" placeholder="请输入" @change="updateFeatureMessage($event,'invalidReasonDetail1',item)"></my-RichText>
                        </div>
                        <div v-else>
                            <span v-html="item.feInvalidReasonDetail1"> </span>
                        </div>
                    </div>
                </div>
                <div  v-if="['2','3','4','8'].indexOf(row.statutesId) ==-1">
                    <div class="left">答辩意见陈述情况</div>
                    <div class="right">
                        <div v-if="edit">
                            <el-select v-model="item.feIfPresentOpinions1"  @change="(val)=>updateFeatureMessage(val,'ifPresentOpinions1',item)" placeholder="请选择">
                                <el-option label="已陈述"  :value="true"></el-option>
                                <el-option label="未陈述"  :value="false"></el-option>
                            </el-select>
                        </div>
                        <div v-else>
                            <span v-if="item.feIfPresentOpinions1==true"> 已陈述</span>
                            <span v-else-if="item.feIfPresentOpinions1==false">未陈述</span>
                            <span v-else></span>
                        </div>
                    </div>
                </div>
                <div>
                    <div class="left">
                        答辩意见
                    </div>
                    <div class="right">
                        <div v-if="edit">
                            <my-RichText v-model="item.fePresentOpinions1" placeholder="请输入" @change="updateFeatureMessage($event,'presentOpinions1',item)"></my-RichText>
                        </div>
                        <div v-else>
                            <span v-html="item.fePresentOpinions1"> </span>
                        </div>
                    </div>
                </div>
            </div>
            <template v-if="ifSecondInvalid">
                <!-- <div class="border" v-if="item.secondEvidenceReason&&item.secondEvidenceReason.evidenceList && item.secondEvidenceReason.evidenceList.length>0">
                    <div class="top">第二次无效证据：</div>
                    <div>
                        <table class="table">
                            <tr>
                                <td>无效证据</td>
                                <td>无效证据详情</td>
                                <td>答辩意见陈述情况</td>
                                <td>答辩意见</td>
                                <td>复审委意见结论</td>
                                <td>复审委意见</td>
                                <td>复审委要点提炼</td>
                            </tr>
                            <tr v-for="(literature,i) in item.secondEvidenceReason.evidenceList" :key="'literatures'+i">
                                <td>
                                    <span v-for="(evidence,y) in literature.literatures" :key="'evidence'+y">
                                        <span v-if="evidence.id <= 0">{{ evidence.name }}</span>
                                        <span v-else>D{{ evidence.sysOrder }}</span>
                                        <span v-if="y < literature.literatures.length-1"> + </span>
                                    </span>
                                </td>
                                <td>
                                    <div v-if="edit">
                                        <my-RichText v-model="literature.evidenceText" placeholder="请输入无效证据详情" @change="updateEvidenceMessage($event,'evidenceText',item.secondEvidenceReason)"></my-RichText>
                                    </div>
                                    <div v-else>
                                        <span v-html="literature.evidenceText"> </span>
                                    </div>
                                </td>
                                <td>
                                    <div v-if="edit">
                                        <el-select v-model="literature.erIfPresentOpinions1"  @change="(val)=>updateEvidenceMessage(val,'ifPresentOpinions1',item.secondEvidenceReason)" placeholder="请选择">
                                            <el-option label="已陈述"  :value="true"></el-option>
                                            <el-option label="未陈述"  :value="false"></el-option>
                                        </el-select>
                                    </div>
                                    <div v-else>
                                        <span v-if="literature.erIfPresentOpinions1==true">
                                            已陈述
                                        </span>
                                        <span v-else-if="literature.erIfPresentOpinions1==false">
                                            未陈述
                                        </span>
                                        <span v-else>
                                        </span>
                                    </div>
                                </td>
                                <td>
                                    <div v-if="edit">
                                        <my-RichText v-model="literature.erPresentOpinions1" placeholder="请输入答辩意见" @change="updateEvidenceMessage($event,'presentOpinions1',item.secondEvidenceReason)"></my-RichText>
                                    </div>
                                    <div v-else>
                                        <span v-html="literature.erPresentOpinions1"> </span>
                                    </div>
                                </td>
                                <td>
                                    <div v-if="edit">
                                        <el-select v-model="literature.erRbSummary"  @change="(val)=>updateEvidenceMessage(val,'rbSummary',item.secondEvidenceReason)" placeholder="请选择">
                                            <el-option label="认可请求人意见"  value="认可请求人意见"></el-option>
                                            <el-option label="认可权利人意见"  value="认可权利人意见"></el-option>
                                            <el-option label="均不认可"  value="均不认可"></el-option>
                                        </el-select>
                                    </div>
                                    <div v-else>
                                        {{ literature.erRbSummary }}
                                    </div>
                                </td>
                                <td>
                                    <div v-if="edit">
                                        <my-RichText v-model="literature.erRbOpinions" placeholder="请输入复审委意见" @change="updateEvidenceMessage($event,'rbOpinions',item.secondEvidenceReason)"></my-RichText>
                                    </div>
                                    <div v-else>
                                        <span v-html="literature.erRbOpinions"> </span>
                                    </div>
                                </td>
                                <td>
                                    <div v-if="edit">
                                        <my-RichText v-model="literature.erRbDecisionKey" placeholder="请输入复审委要点提炼" @change="updateEvidenceMessage($event,'rbDecisionKey',item.secondEvidenceReason)"></my-RichText>
                                    </div>
                                    <div v-else> 
                                        <span v-html="literature.erRbDecisionKey"> </span>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div> -->
                <div class="border" v-if="['2','3','4','8'].indexOf(row.statutesId) !=-1 && item.secondEvidenceReason&&item.secondEvidenceReason.evidenceList && item.secondEvidenceReason.evidenceList.length>0">
                    <div class="top">第二次无效证据</div>
                    <div class="content" v-for="(literature,i) in item.secondEvidenceReason.evidenceList" :key="'literatures'+i">
                        <div class="content content_item">
                            <div>
                                <div class="left">第二次无效证据</div>
                                <div class="right">
                                    <span v-for="(evidence,y) in literature.literatures" :key="'evidence'+y">
                                        <span v-if="evidence.id <= 0">{{ evidence.name }}</span>
                                        <span v-else class="cursor_pointer" @click="checkEvidenceDetails(item)">D{{ evidence.sysOrder }}</span>
                                        <span v-if="y < literature.literatures.length-1"> + </span>
                                    </span>
                                </div>
                            </div>
                            <div>
                                <div class="left">第二次无效证据详情</div>
                                <div class="right">
                                    <div v-if="edit">
                                        <my-RichText v-model="literature.evidenceText" placeholder="请输入无效证据详情" @change="updateEvidenceMessage($event,'evidenceText',item.secondEvidenceReason,2)"></my-RichText>
                                    </div>
                                    <div v-else>
                                    <span v-html="literature.evidenceText"> </span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="content content_item">
                            <div>
                                <div class="left">第二次答辩意见陈述情况</div>
                                <div class="right">
                                    <div v-if="edit">
                                        <el-select v-model="literature.erIfPresentOpinions1"  @change="(val)=>updateEvidenceMessage(val,'ifPresentOpinions1',item.secondEvidenceReason,2)" placeholder="请选择">
                                            <el-option label="已陈述"  :value="true"></el-option>
                                            <el-option label="未陈述"  :value="false"></el-option>
                                        </el-select>
                                    </div>
                                    <div v-else>
                                        <span v-if="literature.erIfPresentOpinions1==true"> 已陈述</span>
                                        <span v-else-if="literature.erIfPresentOpinions1==false">未陈述</span>
                                        <span v-else></span>
                                    </div>
                                </div>
                            </div>
                            <div>
                                <div class="left">第二次答辩意见</div>
                                <div class="right">
                                    <div v-if="edit">
                                        <my-RichText v-model="literature.erPresentOpinions1" placeholder="请输入答辩意见" @change="updateEvidenceMessage($event,'presentOpinions1',item.secondEvidenceReason,2)"></my-RichText>
                                    </div>
                                    <div v-else>
                                    <span v-html="literature.erPresentOpinions1"> </span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <template>
                            <div class="content content_item">
                                <div>
                                    <div class="left">复审委意见结论</div>
                                    <div class="right">
                                        <div v-if="edit">
                                            <el-select v-model="literature.erRbSummary"  @change="(val)=>updateEvidenceMessage(val,'rbSummary',item.secondEvidenceReason,2)" placeholder="请选择">
                                                <el-option label="认可请求人意见"  value="认可请求人意见"></el-option>
                                                <el-option label="认可权利人意见"  value="认可权利人意见"></el-option>
                                                <el-option label="均不认可"  value="均不认可"></el-option>
                                            </el-select>
                                        </div>
                                        <div v-else>
                                            {{ literature.erRbSummary }}
                                        </div>
                                    </div>
                                </div>
                                <div>
                                    <div class="left">复审委意见</div>
                                    <div class="right">
                                        <div v-if="edit">
                                            <my-RichText v-model="literature.erRbOpinions" placeholder="请输入复审委意见" @change="updateEvidenceMessage($event,'rbOpinions',item.secondEvidenceReason,2)"></my-RichText>
                                        </div>
                                        <div v-else>
                                        <span v-html="literature.erRbOpinions"> </span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="content content_item">
                                <div style="border-left:var(--border) !important;">
                                    <div class="left">复审委要点提炼</div>
                                    <div class="right">
                                        <div v-if="edit">
                                            <my-RichText v-model="literature.erRbDecisionKey" placeholder="请输入复审委要点提炼" @change="updateEvidenceMessage($event,'rbDecisionKey',item.secondEvidenceReason,2)"></my-RichText>
                                        </div>
                                        <div v-else>
                                            <span v-html="literature.erRbDecisionKey"> </span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <template>
                                <div class="content content_item">
                                    <div>
                                        <div class="left">一审起诉人意见</div>
                                        <div class="right">
                                            <div v-if="edit">
                                                <my-RichText v-model="literature.erProsecutorOpinions1" placeholder="请输入复审委意见" @change="updateEvidenceMessage($event,'prosecutorOpinions1',item.secondEvidenceReason,2)"></my-RichText>
                                            </div>
                                            <div v-else>
                                                <span v-html="literature.erProsecutorOpinions1"> </span>
                                            </div>
                                        </div>
                                    </div>
                                    <div>
                                        <div class="left">一审被诉人意见</div>
                                        <div class="right">
                                            <div v-if="edit">
                                                <my-RichText v-model="literature.erRespondentOpinions1" placeholder="请输入复审委意见" @change="updateEvidenceMessage($event,'respondentOpinions1',item.secondEvidenceReason,2)"></my-RichText>
                                            </div>
                                            <div v-else>
                                                <span v-html="literature.erRespondentOpinions1"> </span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="content content_item">
                                    <div>
                                        <div class="left">一审第三方意见</div>
                                        <div class="right">
                                            <div v-if="edit">
                                                <my-RichText v-model="literature.erThirdOpinions1" placeholder="请输入复审委意见" @change="updateEvidenceMessage($event,'thirdOpinions1',item.secondEvidenceReason,2)"></my-RichText>
                                            </div>
                                            <div v-else>
                                                <span v-html="literature.erThirdOpinions1"> </span>
                                            </div>
                                        </div>
                                    </div>
                                    <div>
                                        <div class="left">一审法院意见</div>
                                        <div class="right">
                                            <div v-if="edit">
                                                <my-RichText v-model="literature.erCourtOpinions1" placeholder="请输入复审委意见" @change="updateEvidenceMessage($event,'courtOpinions1',item.secondEvidenceReason,2)"></my-RichText>
                                            </div>
                                            <div v-else>
                                                <span v-html="literature.erCourtOpinions1"> </span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </template>
                            <template>
                                <div class="content content_item">
                                    <div>
                                        <div class="left">二审起诉人意见</div>
                                        <div class="right">
                                            <div v-if="edit">
                                                <my-RichText v-model="literature.erProsecutorOpinions2" placeholder="请输入复审委意见" @change="updateEvidenceMessage($event,'prosecutorOpinions2',item.secondEvidenceReason,2)"></my-RichText>
                                            </div>
                                            <div v-else>
                                                <span v-html="literature.erProsecutorOpinions2"> </span>
                                            </div>
                                        </div>
                                    </div>
                                    <div>
                                        <div class="left">二审被诉人意见</div>
                                        <div class="right">
                                            <div v-if="edit">
                                                <my-RichText v-model="literature.erRespondentOpinions2" placeholder="请输入复审委意见" @change="updateEvidenceMessage($event,'respondentOpinions2',item.secondEvidenceReason,2)"></my-RichText>
                                            </div>
                                            <div v-else>
                                                <span v-html="literature.erRespondentOpinions2"> </span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="content content_item">
                                    <div>
                                        <div class="left">二审第三方意见</div>
                                        <div class="right">
                                            <div v-if="edit">
                                                <my-RichText v-model="literature.erThirdOpinions2" placeholder="请输入复审委意见" @change="updateEvidenceMessage($event,'thirdOpinions2',item.secondEvidenceReason,2)"></my-RichText>
                                            </div>
                                            <div v-else>
                                                <span v-html="literature.erThirdOpinions2"> </span>
                                            </div>
                                        </div>
                                    </div>
                                    <div>
                                        <div class="left">二审法院意见</div>
                                        <div class="right">
                                            <div v-if="edit">
                                                <my-RichText v-model="literature.erCourtOpinions2" placeholder="请输入复审委意见" @change="updateEvidenceMessage($event,'courtOpinions2',item.secondEvidenceReason,2)"></my-RichText>
                                            </div>
                                            <div v-else>
                                                <span v-html="literature.erCourtOpinions2"> </span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </template>
                        </template>
                    </div>
                </div>
                <div class="content">
                    <div>
                        <div class="left">
                            第二次无效理由详情
                        </div>
                        <div class="right">
                            <div v-if="edit">
                                <my-RichText v-model="item.feInvalidReasonDetail2" placeholder="请输入" @change="updateFeatureMessage($event,'invalidReasonDetail2',item,2)"></my-RichText>
                            </div>
                            <div v-else>
                                <span v-html="item.feInvalidReasonDetail2"> </span>
                            </div>
                        </div>
                    </div>
                    <div  v-if="['2','3','4','8'].indexOf(row.statutesId) ==-1">
                        <div class="left">第二次答辩意见陈述情况</div>
                        <div class="right">
                            <div v-if="edit">
                                <el-select v-model="item.feIfPresentOpinions2"  @change="(val)=>updateFeatureMessage(val,'ifPresentOpinions2',item,2)" placeholder="请选择">
                                    <el-option label="已陈述"  :value="true"></el-option>
                                    <el-option label="未陈述"  :value="false"></el-option>
                                </el-select>
                            </div>
                            <div v-else>
                                <span v-if="item.feIfPresentOpinions2==true"> 已陈述</span>
                                <span v-else-if="item.feIfPresentOpinions2==false">未陈述</span>
                                <span v-else></span>
                            </div>
                        </div>
                    </div>
                    <div>
                        <div class="left">
                            第二次答辩意见
                        </div>
                        <div class="right">
                            <div v-if="edit">
                                <my-RichText v-model="item.fePresentOpinions2" placeholder="请输入" @change="updateFeatureMessage($event,'presentOpinions2',item,2)"></my-RichText>
                            </div>
                            <div v-else>
                                <span v-html="item.fePresentOpinions2"> </span>
                            </div>
                        </div>
                    </div>
                </div>
            </template>
            <div class="content" >
                <div style="border-top:none !important;" v-if="['2','3','4','8'].indexOf(row.statutesId) ==-1">
                    <div class="left">复审委意见结论</div>
                    <div class="right">
                        <div v-if="edit">
                            <el-select v-model="item.feRbSummary"  @change="(val)=>updateFeatureMessage(val,'rbSummary',item,ifSecondInvalid?'2':'0')" placeholder="请选择">
                                <el-option label="认可请求人意见"  value="认可请求人意见"></el-option>
                                <el-option label="认可权利人意见"  value="认可权利人意见"></el-option>
                                <el-option label="均不认可"  value="均不认可"></el-option>
                            </el-select>
                        </div>
                        <div v-else>
                            {{ item.feRbSummary }}
                        </div>
                    </div>
                </div>
                <div>
                    <div class="left">
                        复审委意见详情
                    </div>
                    <div class="right">
                        <div v-if="edit">
                            <my-RichText v-model="item.feRbOpinions" placeholder="请输入" @change="updateFeatureMessage($event,'rbOpinions',item,ifSecondInvalid?'2':'0')"></my-RichText>
                        </div>
                        <div v-else>
                            <span v-html="item.feRbOpinions"> </span>
                        </div>
                    </div>
                </div>
                <div style="border-bottom:none !important;">
                    <div class="left">
                        复审委要点提炼
                    </div>
                    <div class="right">
                        <div v-if="edit">
                            <my-RichText v-model="item.feRbDecisionKey" placeholder="请输入" @change="updateFeatureMessage($event,'rbDecisionKey',item,ifSecondInvalid?'2':'0')"></my-RichText>
                        </div>
                        <div v-else>
                           <span v-html="item.feRbDecisionKey"> </span>
                        </div>
                    </div>
                </div>
                <!-- <div>
                    <div class="left">
                        复审委决定详情
                    </div>
                    <div class="right">
                        <div v-if="edit">
                            <my-RichText v-model="item.feRbDecisionKey" placeholder="请输入" @change="updateFeatureMessage($event,'rbDecisionKey',item,ifSecondInvalid?'2':'0')"></my-RichText>
                        </div>
                        <div v-else>
                            <span v-html="item.feRbDecisionKey"></span>
                        </div>
                    </div>
                </div> -->
                <template>
                    <div>
                        <div class="left">
                            一审起诉人意见
                        </div>
                        <div class="right">
                            <div v-if="edit">
                                <my-RichText v-model="item.feProsecutorOpinions1" style="width:100%" placeholder="请输入" @change="updateFeatureMessage($event,'prosecutorOpinions1',item,ifSecondInvalid?'2':'0')"></my-RichText>
                            </div>
                            <div v-else>
                                <span v-html="item.feProsecutorOpinions1"> </span>
                            </div>
                        </div>
                    </div>
                    <div>
                        <div class="left">
                            一审被诉人意见
                        </div>
                        <div class="right">
                            <div v-if="edit">
                                <my-RichText v-model="item.feRespondentOpinions1" style="width:100%" placeholder="请输入" @change="updateFeatureMessage($event,'respondentOpinions1',item,ifSecondInvalid?'2':'0')"></my-RichText>
                            </div>
                            <div v-else>
                                <span v-html="item.feRespondentOpinions1"> </span>
                            </div>
                        </div>
                    </div>
                    <div>
                        <div class="left">
                            一审第三方意见
                        </div>
                        <div class="right">
                            <div v-if="edit">
                                <my-RichText v-model="item.feThirdOpinions1" style="width:100%" placeholder="请输入" @change="updateFeatureMessage($event,'thirdOpinions1',item,ifSecondInvalid?'2':'0')"></my-RichText>
                            </div>
                            <div v-else>
                                <span v-html="item.feThirdOpinions1"> </span>
                            </div>
                        </div>
                    </div>
                    <div>
                        <div class="left">
                            一审法院意见
                        </div>
                        <div class="right">
                            <div v-if="edit">
                                <my-RichText v-model="item.feCourtOpinions1" style="width:100%" placeholder="请输入" @change="updateFeatureMessage($event,'courtOpinions1',item,ifSecondInvalid?'2':'0')"></my-RichText>
                            </div>
                            <div v-else>
                                <span v-html="item.feCourtOpinions1"> </span>
                            </div>
                        </div>
                    </div>
                </template>
                <template>
                    <div>
                        <div class="left">
                            二审起诉人意见
                        </div>
                        <div class="right">
                            <div v-if="edit">
                                <my-RichText v-model="item.feProsecutorOpinions2" style="width:100%" placeholder="请输入" @change="updateFeatureMessage($event,'prosecutorOpinions2',item,ifSecondInvalid?'2':'0')"></my-RichText>
                            </div>
                            <div v-else>
                                <span v-html="item.feProsecutorOpinions2"> </span>
                            </div>
                        </div>
                    </div>
                    <div>
                        <div class="left">
                            二审被诉人意见
                        </div>
                        <div class="right">
                            <div v-if="edit">
                                <my-RichText v-model="item.feRespondentOpinions2" style="width:100%" placeholder="请输入" @change="updateFeatureMessage($event,'respondentOpinions2',item,ifSecondInvalid?'2':'0')"></my-RichText>
                            </div>
                            <div v-else>
                                <span v-html="item.feRespondentOpinions2"> </span>
                            </div>
                        </div>
                    </div>
                    <div>
                        <div class="left">
                            二审第三方意见
                        </div>
                        <div class="right">
                            <div v-if="edit">
                                <my-RichText v-model="item.feThirdOpinions2" style="width:100%" placeholder="请输入" @change="updateFeatureMessage($event,'thirdOpinions2',item,ifSecondInvalid?'2':'0')"></my-RichText>
                            </div>
                            <div v-else>
                                <span v-html="item.feThirdOpinions2"> </span>
                            </div>
                        </div>
                    </div>
                    <div>
                        <div class="left">
                            二审法院意见
                        </div>
                        <div class="right">
                            <div v-if="edit">
                                <my-RichText v-model="item.feCourtOpinions2" style="width:100%" placeholder="请输入" @change="updateFeatureMessage($event,'courtOpinions2',item,ifSecondInvalid?'2':'0')"></my-RichText>
                            </div>
                            <div v-else>
                                <span v-html="item.feCourtOpinions2"> </span>
                            </div>
                        </div>
                    </div>
                </template>
            </div>
        </div>
    </div>
    <div class="backtop" @click="toTop"><i class="el-icon-caret-top"></i></div>
    <batchAddMessage ref="batchAddMessage" :ifSecondInvalid="ifSecondInvalid" @save="save"></batchAddMessage>

  </div>
</template>

<script>
import batchAddMessage from '../dialog/batchAddMessage.vue';
import mixins from './mixins';
export default {
  components: {
    batchAddMessage
  },
  mixins:[mixins],
  props: {
    row:{
        default:()=>{
            return {}
        }
    },
    ifSecondInvalid:{
        default:false
    },
    reportType:{
        default:0
    },
    projectId:{
        default:0
    }
  },
  data() {
    return {
        edit:false,
        content:{
            showFeature:false
        },
        groupValue:[
            {
                label:'总无效理由',
                field:'invalidReasonDetail1'
            },
            {
                label:'总答辩意见',
                field:'presentOpinions1'
            },
            {
                label:'第二次总无效理由',
                field:'invalidReasonDetail2'
            },
            {
                label:'第二次总答辩意见',
                field:'presentOpinions2'
            },
            {
                label:'复审委意见',
                field:'rbOpinions'
            },
            {
                label:'复审委要点提炼',
                field:'rbDecisionKey'
            },
        ]
    };
  },
  watch: {

  },
  computed: {
    provisions(){
        return this.$store.state.dictMessage.dictMessage.STATUTE || []
    }
  },
  created() {},
  mounted() {
        this.getData()
  },
  methods: {
    toTop(){
        let target = this.$refs.detailsHead
        target.scrollTo(
            {
                top: 0 ,
                behavior: "smooth"
            }
        )
    },
    getProvisionName(id){
        return this.provisions.find(item=>{
            return item.value == id
        }).label
    },
    batchAdd(type){
        this.$refs.batchAddMessage.open(type,this.content.FirstEvidenceReason)
    },
    save(val){
        this.row.details = null
        this.getData()
    },
    updateData(field,val,type,row,num){
        var arr = ['ifPresentOpinions1','ifPresentOpinions2','rbSummary']
        var types = 5
        var ifGroup = ['2','3','4','8'].indexOf(this.row.statutesId) !=-1
        if(arr.indexOf(field)!=-1 && type == types){
            this.$emit('update',field,val,row,num,ifGroup)
        }
    },
    //更新权要复审委决定以及法院决定
    updatePatentClaimMessage(val,field){
        var params = [
            {
                claimId:this.row.claimId,
                domainFieldDTOs:[
                    {
                        field:field,
                        value:val,
                    }
                ]
            }
        ]
        this.$api.updatePatentClaimMessage(params).then(response=>{
            if(response.code == 200){
                this.$message.success('编辑成功')
                this.$forceUpdate()
                this.updateData(field,value,1)
            }
        }).catch(error=>{
            // this.$message.error('编辑失败')
        })
    },
    //更新法条信息
    updateInvalidStatutesMessage(val,field){
        var params = {
            ids:[this.row.id],
            fieldList:[{ 
                field:field,
                value:val,
            }]
        }
        this.$api.updateInvalidStatutesMessage(params).then(response=>{
            if(response.code == 200){
                this.$message.success('编辑成功')
                this.$forceUpdate()
                this.updateData(field,val,2)
            }
        }).catch(error=>{
            this.$message.error('编辑失败')
        })
    },
    //更新组合信息
    updateGroupMessage(val,field){
        var params = {
            ids:[this.row.proofGroupId],
            fieldList:[{ 
                field:field,
                value:val,
            }]
        }
        this.$api.updateProofGroupMessage(params).then(response=>{
            if(response.code == 200){
                this.$message.success('编辑成功')
                this.$forceUpdate()
                this.updateData(field,val,3)
            }
        }).catch(error=>{
            this.$message.error('编辑失败')
        })
    },
    //更新特征的信息
    updateFeatureMessage(val,field,row,type){
        if(!type){
            var data = row.featureHistories.filter(item=>{
                return item.featureGen!=2
            })
        }else{
            data = row.featureHistories
        }
        
        var id = data[data.length-1].id
        var params = {
            ids:[id],
            fieldList:[{ 
                field:field,
                value:val,
            }]
        }
        this.$api.updateGroupFeatureMessage(params).then(response=>{
            if(response.code == 200){
                this.$message.success('编辑成功')
                this.$forceUpdate()
                this.updateData(field,val,5,
                {
                    featureGroupId:id
                },type)
            }
        }).catch(error=>{
            this.$message.error('编辑失败')
        })
    },
    //更新证据的信息
    updateEvidenceMessage(val,field,row,num){
        var params = {
            ids:[row.evidenceReasonId],
            fieldList:[{ 
                field:field,
                value:val,
            }]
        }
        this.$api.updateEvidenceReasonMessage(params).then(response=>{
            if(response.code == 200){
                this.$message.success('编辑成功')
                this.$forceUpdate()
                this.updateData(field,val,5,row,num)
            }
        }).catch(error=>{
            this.$message.error('编辑失败')
        })
    },
    editContent(){
        this.edit = !this.edit
    },
    async getData(){
        if(!this.row.details){
            const [proofGroupMessage,FirstEvidenceReason,secondEvidenceReason] = await Promise.allSettled([this.getProofGroupMessage(),this.queryEvidenceReason(0),this.queryEvidenceReason(1)])
            this.content.proofGroupMessage = proofGroupMessage.status == "fulfilled"?proofGroupMessage.value:{}
            var FirstEvidenceReason1 = FirstEvidenceReason.status == "fulfilled"?FirstEvidenceReason.value:[]
            var secondEvidenceReason1 = secondEvidenceReason.status == "fulfilled"?secondEvidenceReason.value:[]
           var obj = this.freightData(FirstEvidenceReason1)
           var obj2 = this.freightData(secondEvidenceReason1)
           var featureOrder = Object.keys(obj)
           featureOrder.forEach(item=>{
            obj[item].secondEvidenceReason = obj2[item]
            obj[item].feRbOpinions = (obj2[item]?obj2[item].feRbOpinions:'') || obj[item].feRbOpinions
            obj[item].feRbDecisionKey = (obj2[item]?obj2[item].feRbDecisionKey:'') || obj[item].feRbDecisionKey
           })
            this.content.FirstEvidenceReason = Object.values(obj)
            this.content.showFeature = false
            this.$nextTick(()=>{
                this.content.showFeature = true
            })
            this.row.details = this.content
        }else{
           this.content = this.row.details 
        }
        
    },
    //装载数据
    freightData(FirstEvidenceReason1){
        var obj = {}
            for(var i = 0;i<FirstEvidenceReason1.length;i++){
                if(obj[FirstEvidenceReason1[i].featureOrder]){
                    obj[FirstEvidenceReason1[i].featureOrder].evidenceList.push(FirstEvidenceReason1[i])
                    
                }else{
                    var evidenceList = []
                    if(FirstEvidenceReason1[i].literatures && FirstEvidenceReason1[i].literatures.length>0){
                        evidenceList = [
                            {
                                ...FirstEvidenceReason1[i]
                            }
                        ]
                    }
                    obj[FirstEvidenceReason1[i].featureOrder] = {
                        ...FirstEvidenceReason1[i],
                        evidenceList:evidenceList
                    }
                }
            }
            return obj
    },
    //获取组合详情
    async getProofGroupMessage(){
        var params = {
            proofGroupId:this.row.proofGroupId
        }
        return await this.$api.queryProofGroupMessage(params).then(response=>response.data.data)
    },
    //查询无效证据
    async queryEvidenceReason(type){
        var params = {
            groupId:this.row.proofGroupId,
            gen:type
        }
        return await this.$api.queryEvidenceReason(params).then(response=>response.data.data)
    },
  },
};
</script>
<style lang="scss" scoped>

.details{
    position: relative;
    --left:120px;
    --border:1px solid black;
    --padding:10px;
    padding:15px;
    overflow-y: auto;
    
    .head{
        width: 100%;
        display: flex;
        flex-direction: row-reverse;
        padding-bottom:10px;
    }
    .content{
        width:100%;
        &>div{
            border:var(--border);
            border-bottom:none;
            display: flex;
            width:100%;
            .left{
                min-width: var(--left);
                width:var(--left);
                border-right:var(--border);
                padding:var(--padding);
                display: flex;
                align-items: center;
            }
            .right{
                padding:var(--padding);
                width:100%;
            }
        }

        &>div:last-child{
            border-bottom:var(--border);
        }

    }
    .border{
        background: #e6e6e6;
        .top{
            font-weight: bold;
            color: black;
            border-right: var(--border); 
            border-left: var(--border);
            padding:var(--padding);
        }
    }
    .content_item{
        border:none !important;
        &>div:last-child{
            border-bottom:none !important;
            border-left:none !important;
        }
    }
    .table {
        width: 100%;
        border-top: var(--border);
        border-left: var(--border);
        border-spacing: 0;
    }

    .table td {
        padding: 10px 10px;
        border-bottom: var(--border);
        border-right: var(--border);
    }
}

.backtop {
    position: sticky;
    left: 95%;
    bottom: 40px;
    background-color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #409eff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 0 6px rgba(0,0,0,.12);
    cursor: pointer;
    z-index: 5;
}
.backtop:hover {
    background-color: #f2f6fc;
}
</style>