<%inherit file="/base_index.html"/>
<%block name='content'>
<style>
    .colorSucStyle {
        color: #44b549;

    }

    .colorErrStyle {
        color: orangered;
    }

    .lable_color {
        color: rgba(0, 0, 0, 0.70);
    }

    .important .el-form-item__label {
        color: red;
        font-weight: bolder;

    }

    .normal .el-form-item__label {
        color: #333333;
        font-weight: bolder;
    }



</style>
<div class="tab-content mb20">

    <div id="eventEdit">
        <div class="eventEdit" v-cloak>
            <div style=" padding-left: 20px;" >
                <el-form label-width="90px"  :model="formLine" >
                    <div class="bk-panel" style="padding-bottom: 10px; padding-top: 25px">
                                <el-form-item label="事件发生时间" label-width="96px" class="important" style="display:inline-block; ">
                                    <el-date-picker v-model="formLine.event_happened_time" type="datetime"
                                            placeholder="必填" style="width:200px;" :disabled="editStatus">
                                    </el-date-picker>
                                </el-form-item>

                                <el-form-item label="报障时间" label-width="90px" class="normal" style="display:inline-block; ">
                                    <el-date-picker
                                            v-model="formLine.user_reporting_time"
                                            type="datetime" style="width:200px;" :disabled="editStatus">
                                    </el-date-picker>
                                </el-form-item>

                                <el-form-item label="受理时间" label-width="90px" class="normal" style="display:inline-block; ">
                                    <el-date-picker
                                            v-model="formLine.event_accept_time"
                                            type="datetime" style="width:200px;" :disabled="editStatus">
                                    </el-date-picker>
                                </el-form-item>

                                <el-form-item label="恢复时间" label-width="90px" class="normal" style="display:inline-block; ">
                                    <el-date-picker
                                            v-model="formLine.failure_recovery_time"
                                            type="datetime"
                                            style="width:200px;" :disabled="editStatus">
                                    </el-date-picker>
                                </el-form-item>
                    </div>


                    <div class="bk-panel">
                        <div>
                            <el-form-item label="故障系统" label-width="97px" class="normal" style="display:inline-block;">
                                <el-select v-model="formLine.failure_sys_name" clearable filterable style="width:200px;" :disabled="editStatus">
                                    <el-option v-for="item in systemList"
                                               :key="item.value"
                                               :label="item.label"
                                               :value="item.label">
                                    </el-option>
                                </el-select>
                            </el-form-item>

                            <el-form-item label="受影响系统" label-width="90px" class="normal"
                                    style="display:inline-block;" >
                                <el-select v-model="formLine.influenced_sys_name" multiple filterable
                                               style="width:210px;" :disabled="editStatus">
                                    <el-option v-for="item in systemList"
                                               :key="item.value"
                                               :label="item.label"
                                               :value="item.label"></el-option>
                                </el-select>
                            </el-form-item>

                                <el-form-item label="事件类型" label-width="80px" class="normal"
                                    style="display:inline-block;">
                                    <el-select v-model="formLine.event_type" clearable style="width:110px;" :disabled="editStatus">
                                        <el-option v-for="item in eventTypeOp"
                                                   :key="item.value"
                                                   :label="item.label"
                                                   :value="item.value"></el-option>
                                    </el-select>
                                </el-form-item>

                                <el-form-item label="现象" label-width="60px" class="normal" style="display:inline-block;">
                                    <el-input v-model="formLine.phenomenon" style="width: 320px" :disabled="editStatus"></el-input>
                                </el-form-item>

                            </div>
                        <div>
                            <el-form-item label="摘要" label-width="97px" class="important" style="display:inline-block;">
                                <el-input v-model="formLine.event_summary" placeholder="必填" style="width: 500px" :disabled="editStatus"></el-input>
                            </el-form-item>

                            <el-form-item label="对应紧急变更单号" label-width="140px"  class="normal" style="display:inline-block;">
                                <el-input v-model="formLine.change_number" style="width: 300px" :disabled="showStatus"></el-input>
                            </el-form-item>
                        </div>

                    </div>
                    <div class="bk-panel">
                        <el-row>
                            <div>
                                <el-form-item label="一级分类" label-width="97px" class="normal" style="display:inline-block;">
                                    <el-select v-model="formLine.first_category" clearable placeholder=""
                                               @change="project_team_change"  style="width:200px;" :disabled="editStatus">
                                        <el-option v-for="item in firstOptions"
                                                   :key="item"
                                                   :label="item"
                                                   :value="item"></el-option>
                                    </el-select>
                                </el-form-item>

                                <el-form-item label="二级分类" label-width="90px" class="normal" style="display:inline-block; ">
                                    <el-select v-model="formLine.second_category" clearable placeholder=""
                                               @change="project_team_change2" style="width:200px;" :disabled="editStatus">
                                        <el-option v-for="item in secondOptions"
                                                   :key="item"
                                                   :label="item"
                                                   :value="item">
                                        </el-option>
                                    </el-select>
                                </el-form-item>

                                <el-form-item label="三级分类" label-width="90px" class="normal" style="display:inline-block;">
                                    <el-select v-model="formLine.third_category" clearable style="width:200px;" :disabled="editStatus">
                                        <el-option v-for="item in thirdOptions"
                                                   :key="item"
                                                   :label="item"
                                                   :value="item">
                                        </el-option>
                                    </el-select>
                                </el-form-item>

                                <el-form-item label="故障原因初步分析" label-width="130px" class="normal" style="display:inline-block;">
                                    <el-select v-model="formLine.failure_cause_preliminary_analysis" clearable style="width:200px" :disabled="editStatus">
                                        <el-option v-for="item in primaryOptions"
                                                   :key="item"
                                                   :label="item"
                                                   :value="item">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </div>

                            <div>
                                <el-form-item label="影响度" label-width="97px" class="normal" style="display:inline-block;">
                                    <el-select style="  width:100px;" v-model="formLine.impact_degree"  clearable :disabled="editStatus">
                                        <el-option v-for="item in urgency_degreeOp"
                                                   :key="item.value"
                                                   :label="item.label"
                                                   :value="item.value">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                                <el-form-item label="紧急度" label-width="190px" class="normal" style="display:inline-block;">
                                    <el-select style="width:100px;" v-model="formLine.urgency_degree"  clearable :disabled="editStatus">
                                        <el-option v-for="item in urgency_degreeOp"
                                                   :key="item.value"
                                                   :label="item.label"
                                                   :value="item.value">
                                        </el-option>
                                    </el-select>
                                </el-form-item>

                                <el-form-item label="优先级" label-width="190px" class="important" style="display:inline-block;">
                                    <el-select style="width:100px;" v-model="formLine.priority"  clearable placeholder="必填" :disabled="editStatus">
                                        <el-option v-for="item in priorityOp"
                                                   :key="item.value"
                                                   :label="item.label"
                                                   :value="item.value">
                                        </el-option>
                                    </el-select>
                                </el-form-item>

                                <el-form-item label="报告来源" label-width="230px" class="normal" style="display:inline-block;">
                                    <el-select style="width:200px;" v-model="formLine.report_source"  clearable style="width:180px;" :disabled="editStatus">
                                        <el-option v-for="item in report_source"
                                                   :key="item.value"
                                                   :label="item.label"
                                                   :value="item.label">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </div>


                            <div>
                                <el-form-item label="事件标签" label-width="97px" class="normal" style="display:inline-block;">
                                    <el-select v-model="formLine.labelname" multiple filterable style="width: 250px"
                                               :disabled="showStatus">
                                        <el-option v-for="item in labelList"
                                                   :key="item.value"
                                                   :label="item.label"
                                                   :value="item.label">
                                         <span style="float: left" >{{ item.label }}</span>
                                        <el-button size="mini" icon="el-icon-close" style="float: right"
                                        @click="dellabeldialog($event,item.label)"></el-button>
                                        </el-option>
                                    </el-select>
                                </el-form-item>

                                <el-button type="primary" size="medium"
                                           @click="addlabelshow = true" style="margin-left: 40px">新建标签
                                </el-button>
                            </div>
                        </el-row>
                    </div>
                    <div class="chooseMachine">
                <el-dialog v-cloak title="新建标签" :visible.sync="addlabelshow"
                           width="20%" style="height: 50%" :show-close="false" custom-class="dialogHeight">
                    <div  style="overflow-y: scroll;" class="animated fadeIn">
                        <el-form-item label="输入标签名称：" label-width="120px" style="font-weight: bolder;">
                             <el-input v-model="newlabel" ></el-input>
                        </el-form-item>
                    </div>
                    <span slot="footer" class="dialog-footer">
                        <el-button type="primary" size="small" @click="addlabel()">确 定</el-button>
                      <el-button size="small" @click="addlabelshow = false">取 消</el-button>
                    </span>
                </el-dialog>
            </div>
                    <div class="chooseMachine">
                <el-dialog  v-cloak title="删除标签" :visible.sync="dellabelshow"
                           width="20%" style="height: 50%" :close-on-click-modal="false" :show-close="false" custom-class="dialogHeight">
                    <div class="animated fadeIn">
                        <span>是否删除标签 <strong>{{ dellabelname }}</strong></span>
                    </div>
                    <span slot="footer" class="dialog-footer">
                        <el-button type="primary" size="small" @click="dellabel()">确 定</el-button>
                      <el-button size="small" @click="dellabelshow = false">取 消</el-button>
                    </span>
                </el-dialog>
            </div>

                </el-form>
                <el-form :model="formLine">
                    <div style="background:#ffffff;border-radius: 3px;   margin-top: 10px;padding: 20px">
                        <el-tabs v-model="activeName" type="card">
                            <el-tab-pane label="处理过程" name="first">
                                <el-form :disabled="showStatus">
                                    <div class="bk-tab-panel">
                                        <el-row>
                                            <el-col :span="8" class="disabledClass">
                                                <el-form-item label="处理人" class="normal">
                                                    <el-input v-model="formLine.dealer" placeholder=""
                                                              :disabled="dealerStatus"></el-input>
                                                </el-form-item>
                                            </el-col>
                                        </el-row>
                                        <el-row>
                                            <el-col>
                                                <el-form-item label="处理过程" class="normal">
                                                    <el-col :span="23">
                                                        <el-input v-model="formLine.deal_processing" type="textarea"
                                                                  :rows="5" placeholder=""></el-input>
                                                    </el-col>
                                                </el-form-item>

                                            </el-col>
                                        </el-row>

                                    </div>
                                </el-form>
                            </el-tab-pane>
                            <el-tab-pane label="关联性分析" name="two">
                                <div class="bk-tab-panel">
                                    <el-table :data="formLine.relevance_analysis">
                                        <el-table-column prop="relevance_type" label="关联类型"></el-table-column>
                                        <el-table-column prop="request_type" label="请求类型"></el-table-column>
                                        <el-table-column prop="relevance_result_change"
                                                         label="关联事件引发的变更"></el-table-column>

                                    </el-table>
                                </div>
                            </el-tab-pane>

                            <el-tab-pane label="改进措施" name="third">
                                <el-form :disabled="showStatus">
                                    <div class="bk-tab-panel">
                                        <el-row>
                                            <div style="    border-bottom: 1px solid rgba(128, 128, 128, 0.55);
                                                                     width: 98%;
                                                                     margin-left: 10px;">
                                                <el-form-item label="根因分析" label-width="70px" class="normal" style="margin-bottom:0px">
                                                </el-form-item>
                                            </div>
                                            <el-form-item label="" style="margin-top:20px" label-width="40px">
                                                <el-row>
                                                    <el-col :span="23">
                                                        <el-input v-model="formLine.failuremeasure.root_analysis"
                                                                  type="textarea" :rows="5" placeholder="">
                                                        </el-input>
                                                    </el-col>
                                                </el-row>
                                            </el-form-item>
                                            <div style="    border-bottom: 1px solid rgba(128, 128, 128, 0.55);
                                                                      width: 98%;
                                                                      margin-left: 10px;">
                                                <el-form-item label="解决方案措施" class="normal"  style="margin-bottom:0px">
                                                </el-form-item>
                                            </div>
                                            <el-form-item label="" style="margin-top:20px" label-width="40px">
                                                <el-row>
                                                    <el-col :span="23">
                                                        <el-input v-model="formLine.failuremeasure.solve_measure"
                                                                  type="textarea" :rows="5" placeholder=""></el-input>
                                                    </el-col>
                                                </el-row>
                                            </el-form-item>
                                        </el-row>
                                    </div>
                                </el-form>
                            </el-tab-pane>
                            <el-tab-pane label="故障分析" name="four">
                                <el-form :disabled="showStatus">
                                    <div class="bk-tab-panel">
                                        <el-row>
                                                <el-form-item label="故障表象" class="normal" style="margin-left: 28px">
                                                    <el-input v-model="formLine.failure_analysis.failure_surface" style="width: 500px">
                                                    </el-input>
                                                </el-form-item>
                                                <el-form-item label="目标机器所属系统" class="normal" style="margin-left: 28px">
                                                    <el-select v-model="machineBiz" filterable clearable
                                                               placeholder="" style="width: 275px"
                                                               @change="project_team_autosys">
                                                        <el-option v-for="item in autosysOptions"
                                                                   :key="item.value"
                                                                   :label="item.label"
                                                                   :value="item.value"></el-option>
                                                    </el-select>

             <el-button type="primary" size="small" icon="el-icon-circle-plus-outline"
                               @click="chooseMachine">选择机器
             </el-button>

            <div class="chooseMachine">
                <el-dialog v-cloak title="" :visible.sync="centerDialogVisible"
                           width="60%" :show-close="false" custom-class="dialogHeight">
                    <div  style="height: 390px; overflow-y: scroll;" class="animated fadeIn">
                        <el-tree
                                :data="configureData"
                                show-checkbox
                                default-expand-all
                                node-key="id"
                                ref="tree"
                                highlight-current
                                :props="defaultProps"
                                :render-content="renderContent"
                                @check-change="checkedChange"
                                @check="checked">
                        </el-tree>
                    </div>
                    <span slot="footer" class="dialog-footer">
                        <el-button type="primary" size="small" @click="chooseErrorMachine">确 定</el-button>
                      <el-button size="small" @click="centerDialogVisible = false">取 消</el-button>
                    </span>
                </el-dialog>
            </div>
        <el-table :data="formLine.failure_analysis.actual_phenomenon" border
                                          style="width: 60%"  v-loading="loading"
                                          ref="table" @select="handleSelectionChange"
                                          @select-all="handleSelectionChange"
                                          stripe
                                          :header-cell-style="{background:'#409EFF',color:'white'}">
                                    <el-table-column width="200px" prop="machine_ip" label="机器ip" align="center"></el-table-column>
                                </el-table>
                                        </el-form-item>
                                                <el-row style="border-top: 2px dashed darkgray;">
                                                    <el-col :span="70">
                                                        <el-form-item label="-告警相关-" class="normal">
                                                            <el-radio-group
                                                                    style="margin-left: 20px"
                                                                    v-model="formLine.failure_analysis.related_alarm_info"
                                                                    placeholder="" @change="changeAlarm">
                                                                <el-radio :label="1">有监控有报警</el-radio>
                                                                <el-radio :label="7">有监控有报警(非一体化平台)</el-radio>
                                                                <el-radio :label="2">有监控无报警</el-radio>
                                                                <el-radio :label="3">无监控无报警</el-radio>
                                                            </el-radio-group>
                                                        </el-form-item>
                                                    </el-col>
                                                </el-row>


                                                <el-row v-if="alarmchange">
                                                    <el-form-item label="系统编码" label-width="80px"
                                                                  style="display:inline-block">
                                                        <el-row>
                                                            <el-select style="width:300px;" clearable
                                                                       v-model="formLine.failure_analysis.system_code"
                                                                       clearable filterable placeholder="">
                                                                <el-option v-for="item in systemList"
                                                                           :key="item.value"
                                                                           :label="item.label"
                                                                           :value="item.value">
                                                                </el-option>
                                                            </el-select>
                                                        </el-row>

                                                    </el-form-item>

                                                    <el-form-item label="告警类型" label-width="140px"
                                                                  style="display:inline-block" placeholder="必选">
                                                        <el-row>
                                                            <el-select v-model="formLine.failure_analysis.alarm_type"
                                                                       clearable placeholder="" style="width: 205px">
                                                                <el-option v-for="item in alarmTypeOp"
                                                                           :key="item.value"
                                                                           :label="item.label"
                                                                           :value="item.value"></el-option>
                                                            </el-select>
                                                        </el-row>
                                                    </el-form-item>


                                                    <el-form-item label="主机名称" label-width="80px"
                                                                  style="display:inline-block">
                                                        <el-row>
                                                            <el-input style="width:300px;"
                                                                      v-model="formLine.failure_analysis.host_computer"
                                                                      placeholder="请输入主机名称"></el-input>
                                                        </el-row>
                                                    </el-form-item>


                                                    <el-form-item style="display:inline-block" label="开始时间"
                                                                  label-width="140px">
                                                        <el-row>
                                                            <el-date-picker style="width:205px"
                                                                            v-model="formLine.failure_analysis.start_time"
                                                                            type="datetime"
                                                                            placeholder="选择日期时间"
                                                                            value-format="yyyy-MM-dd HH:mm:ss"
                                                                            format="yyyy-MM-dd HH:mm:ss">
                                                            </el-date-picker>
                                                        </el-row>
                                                    </el-form-item>
                                                    <el-form-item label="关键字" label-width="80px"
                                                                  style="display:inline-block">
                                                        <el-row>
                                                            <el-input style="width:300px; "
                                                                      v-model="formLine.failure_analysis.key_word"
                                                                      placeholder="请输入关键字名称"></el-input>
                                                        </el-row>
                                                    </el-form-item>


                                                    <el-form-item style="display:inline-block" label="结束时间"
                                                                  label-width="140px">
                                                        <el-row>
                                                            <el-date-picker style="width:205px"
                                                                            v-model="formLine.failure_analysis.end_time"
                                                                            type="datetime"
                                                                            placeholder="选择日期时间"
                                                                            value-format="yyyy-MM-dd HH:mm:ss"
                                                                            format="yyyy-MM-dd HH:mm:ss">
                                                            </el-date-picker>
                                                        </el-row>
                                                    </el-form-item>

                                                    <el-popover placement="right" width="900" trigger="manual"
                                                                v-model='popshow'>
                                                        <div>
                                                            <el-table :data="gridData" border
                                                                      height="500"
                                                                      style="width: 100%" style="width: 100%"
                                                                      element-loading-text="拼命加载中"
                                                                      element-loading-spinner="el-icon-loading"
                                                                      element-loading-background="rgba(0, 0, 0, 0.8)"
                                                                      ref="table" @select="handleSelectionChange"
                                                                      @select-all="handleSelectionChange">
                                                                <el-table-column
                                                                        type="selection"
                                                                        width="30">
                                                                </el-table-column>
                                                                <el-table-column width="270" prop="alarm_info" label="告警内容"
                                                                                 align="center"></el-table-column>
                                                                <el-table-column width="270" prop="alarm_title" label="告警标题"
                                                                                 align="center"></el-table-column>
                                                                <el-table-column width="270" prop="alarm_time" label="告警时间"
                                                                                 align="center"></el-table-column>
                                                            </el-table>
                                                            <div>
                                                                <el-button size="small" slot="reference" type="primary"
                                                                           style="margin-left: 700px"
                                                                           @click="pophide()">返回
                                                                </el-button>
                                                                <el-button size="small" slot="reference" type="success"
                                                                           style="float:right" @click="save()">保存
                                                                </el-button>
                                                            </div>
                                                        </div>
                                                        <el-button size="small" slot="reference" type="primary"
                                                                   id="search"
                                                                   @click="search">查询
                                                        </el-button>

                                                    </el-popover>
                                                </el-row>

                                                <row v-if="alarmchange">
                                                    <div style="line-height: 50px ;width:1000px;">
                                                        <template>
                                                            <el-table :data="alarmDisplay" style="width:100%"
                                                                      max-height="300">
                                                                <el-table-column fixed prop="alarm_info" label="告警内容"
                                                                                 width="300"
                                                                                 align="center"></el-table-column>
                                                                <el-table-column fixed prop="alarm_title" label="告警标题"
                                                                                 width="300"
                                                                                 align="center"></el-table-column>
                                                                <el-table-column fixed prop="alarm_time" label="告警时间"
                                                                                 width="300"
                                                                                 align="center"></el-table-column>
                                                            </el-table>
                                                        </template>
                                                    </div>
                                                </row>

                                                <el-form-item label="非一体化平台告警信息" class="normal" v-if="notbkalarm">
                                                    <el-input v-model="formLine.failure_analysis.notbkalarminfo" style="width: 60%"
                                                              placeholder="请输入：XX监控系统的XX监控项">
                                                    </el-input>
                                                </el-form-item>

                                                <el-form-item label="查询监控" label-width="80px" style="display:inline-block"
                                                              v-if="havemonitor">
                                                    <el-select v-model="formLine.failure_analysis.havemonitorinfo"
                                                               filterable clearable placeholder="" style="width: 275px"
                                                               @change="project_team_autosys">
                                                        <el-option v-for="(item,i) in monitor_info"
                                                                   :key="i"
                                                                   :label="item.label"
                                                                   :value="item.label"></el-option>
                                                    </el-select>
                                                </el-form-item>

                                                <el-form-item label="完善监控计划" v-if="notmonitor">
                                                    <el-input v-model="formLine.failure_analysis.notmonitorinfo" style="width: 60%"
                                                              placeholder="请输入针对该事件的监控配置计划">
                                                    </el-input>
                                                </el-form-item>

                                                <el-form-item label="-自动化相关-" style="border-top: 2px dashed darkgray;padding-top: 20px;"></el-form-item>

                                                <el-form-item label="应急方案" class="normal" label-width="140px">
                                                    <el-input v-model="formLine.urgency.urgency_info" style="width: 60%"
                                                              placeholder="填写应急方案文档名">
                                                    </el-input>
                                                </el-form-item>

                                                <el-form-item label="应急方案自动化" class="normal" label-width="140px">
                                                    <el-radio-group style="margin-left: 5px;" @change="changeAuto"
                                                                    v-model="formLine.urgency.urgency_auto_info">
                                                        <el-radio :label="4">已自动化</el-radio>
                                                        <el-radio :label="8">已自动化(非一体化平台)</el-radio>
                                                        <el-radio :label="5" style="margin-left: 58px">不可自动化</el-radio>
                                                        <el-radio :label="6" style="margin-left: 47px">未自动化</el-radio>
                                                    </el-radio-group>
                                                </el-form-item>

                                                <el-form-item label="系统所属名称" label-width="140px" class="normal" style="display:inline-block"
                                                              v-if="autochange">
                                                    <el-select v-model="formLine.urgency.auto_sys" filterable clearable style="width: 275px"
                                                               @change="project_team_autosys">
                                                        <el-option v-for="item in autosysOptions"
                                                                   :key="item.value"
                                                                   :label="item.label"
                                                                   :value="item.label"></el-option>
                                                    </el-select>
                                                </el-form-item>
                                                <el-form-item label="自动化方案" label-width="100px" class="normal" style="display:inline-block"
                                                              v-if="autochange">
                                                    <el-select style="width:275px;" v-model="formLine.urgency.script_name" filterable clearable>
                                                        <el-option v-for="item in computedAutosysOptions"
                                                                   :key="item.value"
                                                                   :label="item.label"
                                                                   :value="item.label"></el-option>
                                                    </el-select>
                                                </el-form-item>

                                                <el-form-item label="非一体化" label-width="120px" class="normal" v-if="notbkauto">
                                                    <el-input v-model="formLine.urgency.notbkautoinfo"
                                                              placeholder="请输入其他平台自动化名称"></el-input>
                                                </el-form-item>

                                                <el-form-item label="不可自动化原因" label-width="120px" class="normal" v-if="cantauto">
                                                    <el-input v-model="formLine.urgency.cantautoinfo"
                                                              placeholder="请输入该事件不可由自动化任务解决的原因"></el-input>
                                                </el-form-item>

                                                <el-form-item label="未自动化" label-width="120px" class="normal" v-if="notautoyet">
                                                    <el-input v-model="formLine.urgency.notautoyetinfo"
                                                              placeholder="请输入该事件纳入自动化计划"></el-input>
                                                </el-form-item>

                                                <el-form-item label="故障修复版本" label-width="120px"
                                                              v-if="formLine.if_cause =='1'">
                                                    <el-input v-model="formLine.failure_analysis.failure_recovery_version">
                                                    </el-input>
                                                </el-form-item>

                                                <el-form-item label="故障植入版本" label-width="120px"
                                                              v-if="formLine.if_cause =='1'">
                                                    <el-input v-model="formLine.failure_analysis.failure_in_version">
                                                    </el-input>
                                                </el-form-item>

                                                <el-form-item label="是否解决" label-width="140px" class="normal" sytle="border-top: 2px dashed darkgray;">
                                                    <el-radio-group style="margin-left: 5px;" v-model="formLine.failure_analysis.solve_detail">
                                                        <el-radio :label="10">是</el-radio>
                                                        <el-radio :label="11">否</el-radio>
                                                    </el-radio-group>
                                                </el-form-item>

                                            </el-col>
                                        </el-row>
                                    </div>
                                </el-form>
                            </el-tab-pane>
                        </el-tabs>
                    </div>
                </el-form>
                <el-row style="margin-top: 10px">
                    <el-col :offset="30" :span="20">
                        <el-button size="small" type="primary" @click="returnn" style="margin-left: 800px">返回
                        </el-button>
                        <el-button size="small" type="primary" @click="submit"
                                   v-if="formLine.dealer==user || !formLine.dealer">提交
                        </el-button>
                    </el-col>

                </el-row>

            </div>
        </div>


    </div>

    <script type="text/javascript">
var unique= function (array) {
            let obj = {};
            return array.filter(function(item, index, array){
                return obj.hasOwnProperty(item.bk_host_innerip) ? false : (obj[item.bk_host_innerip] = true)
            })
        }

        var keyArray = {
            programLevel: [
                {label: '数据库', value: '1'},
                {label: '中间件', value: '2'},
                {label: '其它程序', value: '3'},
            ],
            alarmTotalType: [
                {label: '日志', value: '1'},
                {label: '指标', value: '2'},
                {label: '模式识别', value: '3'},
            ],
            alarmType: [
                {label: '日志告警', value: '2'},
                {label: '指标告警', value: '1'},
                {label: '日志和指标告警', value: '0'},
            ],

            influenceLevel: [
                {label: '低', value: '1'},
                {label: '中', value: '2'},
                {label: '高', value: '3'}
            ],
            //优先级
            priority: [
                {label: '1级', value: '1'},
                {label: '2级', value: '2'},
                {label: '3级', value: '3'},
                {label: '4级', value: '4'},
                {label: '5级', value: '5'}
            ],
            //报告来源
            ReportSource: [
                {label: '电话', value: '1'},
                {label: '微信', value: '2'},
                {label: 'qq群', value: '3'},
                {label: '机房人工巡检', value: '4'},
                {label: '人工监控', value: '5'},
                {label: '程序自动监控', value: '6'},
                {label: '其他', value: '7'}
            ],
            //事件类型
            eventType: [
                {label: '故障事件', value: '1'},
                {label: '预警事件', value: '2'},
            ]


        }
        var formatToId = function (item, itemArray) {
            for (let i of itemArray) {
                if (item == i.label) {
                    return i.value
                    break;
                }
            }
        }
        var formatToText = function (item, itemArray) {
            for (let i of itemArray) {
                if (item == i.value) {
                    return i.label
                    break;
                }
            }
        }

        var vm = new Vue({
            el: "#eventEdit",
            data() {
                return {
                    taskData2: {
                slectValue: "",
                tabelData: [],
                description:'',
                options:[],
                tabelshowData:[]
            },
                    errorMachine:[],
                    machineBiz:"",
                    machineListFlag:1,
                    machineList:[],
                    NodeMachineList:[],
                    currentPage2:1,
                    dialogContent:'machine',
                    alarmchange: false,
                    notbkalarm: false,
                    havemonitor: false,
                    notmonitor: false,
                    autochange: false,
                            notbkauto: false,
                            cantauto: false,
                            notautoyet: false,
                    newlabel: "",
                    addlabelshow: false,
                    dellabelshow: false,
                    dellabelname: "",
                    configureData:[],
                    defaultProps: {
                        children: 'children',
                        label: 'label',
                        required:false
                                    },
                    loading:false,
                    centerDialogVisible:false,
                    user: '',
                    popshow: false,
                    auto_radio: '',
                    activeName: "first",
                    activeClass: '',
                    options: [],
                    firstOptions: [],  // 所有一级列表
                    secondOriginalList: [], // 所有二级列表
                    thirdOriginalList: [],  // 所有三级列表
                    autotaskOptions: [],
                    autosysOptions: [],
                    monitor_info: [],
                    partAlarmList: [],// 具体指标
                    preliminaryAnalysisOptions: [],//事件初步原因列表
                    systemList: [],
                    labelList: [],
                    eventTypeOp: keyArray.eventType,
                    urgency_degreeOp: keyArray.influenceLevel,
                    programOp: keyArray.programLevel,
                    alarmTotalOp: keyArray.alarmTotalType,
                    priorityOp: keyArray.priority,
                    report_source: keyArray.ReportSource,
                    alarmTypeOp: keyArray.alarmType,
                    selectData: [],
                    gridData: [],
                    alarmDisplay: [],
                    formLine: {
                        report_source: '',
                        data_src: "",
                        show_src: "",
                        deal_processing: "",//处理过程
                        dealer: "",//处理人
                        event_accept_time: "",//受理时间
                        event_analysis_state: "",//分析状态
                        event_happened_time: "",//事件发生时间
                        event_number: "",//事件编号
                        event_summary: "",//摘要
                        change_number: "",//紧急变更单号
                        event_type: "",//事件类型
                        failure_analysis: {
                            notbkalarminfo: "",
                            havemonitorinfo: "",
                            notmonitorinfo: "",
                            failure_surface: "",
                            solve_detail: "",
                            related_alarm_info: "",
                            monitor_src: "",
                            actual_phenomenon: [],
                            failure_recovery_version: '',
                            failure_in_version: '',
                            system_code: '',
                            host_computer: '',
                            alarm_type: '',
                            key_word: '',
                            start_time: '',
                            end_time: '',
                            alarm_info: '',
                            alarm_title: '',
                            alarm_time: '',
                            program: '',//根据相关程序生成监控
                            alarm_total_type: '',//告警总类型指标
                            detail_alarm: '',//具体告警指标
                        },
                        failure_sys_name: "",//故障系统名称
                        failure_recovery_time: "",//故障恢复时间
                        failuremeasure: {solve_measure: "", root_analysis: ""},//故障改进措施
                        first_category: "",//事件一级分类
                        impact_degree: "",//影响度
                        influenced_sys_name: "",//受影响的系统
                        labelname: [],
                        phenomenon: "",//现象
                        priority: "",//优先级
                        relevance_analysis: [
                            {
                                relevance_result_change: "",
                                relevance_type: "",
                                request_type: ""
                            }
                        ],//相关性分析
                        report_src: "",//报告来源
                        second_category: "",//事件二级分类
                        third_category: "",//事件三级分类
                        urgency: {
                            urgency_auto_info: "", auto_sys: "",
                            urgency_info: "",
                            script_name: "",
                            notbkautoinfo: "",
                            cantautoinfo: "",
                            notautoyetinfo: "",

                        },//脚本名称
                        urgency_degree: "",//紧急度
                        user_reporting_time: "",//用户报障时间
                        failure_cause_preliminary_analysis: '',//故障原因初步分析
                        if_cause: ''
                    },
                    editStatus: false,
                    dealerStatus: true,
                    showStatus: '',
                    type: '',
                    checking_one: '1',
                    checking_two: ''
                }

            },

            mounted() {
                let vm = this
                let data = JSON.parse(window.localStorage.getItem('event_number'))
                if (!!data) {
                    this.type = "edit"
                    if (data.show_src == 1) {
                        //同步数据
                        this.showStatus = true
                        this.editStatus = true
                        //this.activeClass = "disabledClass"
                    } else if (data.show_src == 0 && data.data_src == 1) {
                        this.editStatus = true
                        this.showStatus = false
                        //this.activeClass = "disabledClass"
                    } else {
                        this.showStatus = false
                        this.editStatus = false
                        //this.activeClass = "activeClass"
                    }
                    data.urgency_degree = formatToId(data.urgency_degree, keyArray.influenceLevel)
                    data.priority = formatToId(data.priority, keyArray.priority)
                    data.event_type = formatToId(data.event_type, keyArray.eventType)
                    this.formLine = data

                    if (data.urgency.autochange == 1) {
                        this.autochange = true
                    } else if (data.urgency.notbkauto == 1) {
                        this.notbkauto = true
                    } else if (data.urgency.cantauto == 1) {
                        this.cantauto = true
                    } else if (data.urgency.notautoyet == 1) {
                        this.notautoyet = true
                    }

                    if (data.failure_analysis.alarmchange == 1) {
                        this.alarmchange = true
                    } else if (data.failure_analysis.notbkalarm == 1) {
                        this.notbkalarm = true
                    } else if (data.failure_analysis.havemonitor == 1) {
                        this.havemonitor = true
                    } else if (data.failure_analysis.notmonitor == 1) {
                        this.notmonitor = true
                    }

                } else {
                    this.type = "new"
                    this.editStatus = false
                    this.showStatus = false
                    this.activeClass = "activeClass"
                }
                this.getuser()
                this.getTridList()
                this.getAutoList()
                this.getPrimaryList()
                this.getAlarmInfo()
                this.getSystem()
                this.getAlarmTitle()
                this.getLabel()
            },

            computed: {
                //计算初步原因分类
                primaryOptions: function () {
                    return this.preliminaryAnalysisOptions[this.formLine.first_category]
                },
                // 计算当前二级列表
                secondOptions: function () {
                    return this.secondOriginalList[this.formLine.first_category]
                },
                // 计算当前三级列表
                thirdOptions: function () {
                    return this.thirdOriginalList[this.formLine.second_category]
                },
                //计算具体指标

                computedAutosysOptions() {
                    for (let i of this.autotaskOptions) {
                        if (i.value == this.formLine.urgency.auto_sys) {
                            return i.label
                            break;
                        }
                    }
                }

            },


            methods: {
                dellabeldialog(e,label){
                    e = e|| window.event
                    e.stopPropagation()
                    this.dellabelshow = true
                    this.dellabelname = label
                },
                dellabel(){
                    console.log(this.dellabelname)
                    axios.post('${SITE_URL}del_label/', this.dellabelname).then(res => {
                        if(res.code==0){
                                this.$message({
                                type: 'success',
                                message: res.message
                                });
                            this.dellabelshow = false
                            this.getLabel()
                            }else{
                                this.$message({
                                type: 'error',
                                message: res.message
                                 });
                                this.dellabelshow = false
                            }
                    })
                },
                changeAlarm(value) {
                    this.formLine.failure_analysis.notbkalarminfo = ''
                    this.formLine.failure_analysis.havemonitorinfo = ''
                    this.formLine.failure_analysis.notmonitorinfo = ''
                    this.alarmDisplay = ''
                    if (value == '1') {
                        this.alarmchange = true
                        this.notbkalarm = false
                        this.havemonitor = false
                        this.notmonitor = false
                    } else if (value == '7') {
                        this.alarmchange = false
                        this.notbkalarm = true
                        this.havemonitor = false
                        this.notmonitor = false
                    } else if (value == '2') {
                        this.alarmchange = false
                        this.notbkalarm = false
                        this.havemonitor = true
                        this.notmonitor = false
                    } else if (value == '3') {
                        this.alarmchange = false
                        this.notbkalarm = false
                        this.havemonitor = false
                        this.notmonitor = true
                    }
                },
                addlabel(){
                    axios.post('${SITE_URL}create_label/', this.newlabel).then(res => {
                            if(res.code==0){
                                this.$message({
                                type: 'success',
                                message: res.message
                                });
                            this.addlabelshow = false;
                            this.newlabel = '';
                            this.getLabel()
                            }else{
                                this.$message({
                                type: 'error',
                                message: res.message
                                 });
                                this.addlabelshow = false;
                                this.newlabel = ''
                            }
                    })
                },
                getLabel(){
                    axios.post('${SITE_URL}get_label/').then(res => {
                        this.labelList=res.data
                    })
                },

                // 自动化单选切换组件
                changeAuto(value) {
                    this.formLine.urgency.notbkautoinfo = ''
                    this.formLine.urgency.cantautoinfo = ''
                    this.formLine.urgency.notautoyetinfo = ''
                    this.formLine.urgency.auto_sys = ''
                    this.formLine.urgency.script_name = ''
                    if (value == '4') {
                        this.autochange = true
                        this.notbkauto = false
                        this.cantauto = false
                        this.notautoyet = false
                    } else if (value == '8') {
                        this.autochange = false
                        this.notbkauto = true
                        this.cantauto = false
                        this.notautoyet = false
                    } else if (value == '5') {
                        this.autochange = false
                        this.notbkauto = false
                        this.cantauto = true
                        this.notautoyet = false
                    } else if (value == '6') {
                        this.autochange = false
                        this.notbkauto = false
                        this.cantauto = false
                        this.notautoyet = true
                    }
                },

                handleSelectionChange(selection) {
                    this.selectData[0] = []
                    selection.map((item, index) => {
                        this.selectData[0].push({
                            alarm_info: item.alarm_info,
                            alarm_title: item.alarm_title,
                            alarm_time: item.alarm_time
                        })
                    })
                },
                chooseErrorMachine(){
                    this.machineList =[]
                    newKeys = this.$refs.tree.getCheckedKeys(true)
                 const removeDuplicateItems = arr => [...new Set(arr)];
                newKeys = removeDuplicateItems(newKeys)
                this.NodeMachineList = unique( this.NodeMachineList)
                for(let i of newKeys){
                    this.NodeMachineList.map(item=>{
                        if(item.bk_host_innerip== i){
                            this.machineList.push(item)
                        }
                    })
                }
                let errorMachineList = []
                for (var i = 0; i <newKeys.length; i++) {
                    errorMachineList.push({machine_ip:newKeys[i]})
                }
                this.formLine.failure_analysis.actual_phenomenon = errorMachineList
                    this.centerDialogVisible = false
                },

                project_team_change() {
                    if (this.formLine.second_category && this.formLine.third_category) {
                        this.formLine.second_category = ''
                        this.formLine.third_category = ''
                    }
                    if (this.formLine.second_category) {
                        this.formLine.second_category = ''
                    }
                    if (this.formLine.failure_cause_preliminary_analysis) {
                        this.formLine.failure_cause_preliminary_analysis = ''
                    }
                },

                project_team_change2() {
                    if (this.formLine.third_category) {
                        this.formLine.third_category = ''
                    }
                },

                project2() {
                    if (this.formLine.failure_analysis.detail_alarm) {
                        this.formLine.failure_analysis.detail_alarm = ''
                    }
                },

                project_team_autosys() {
                    if (this.formLine.urgency.script_name) {
                        this.formLine.urgency.script_name = ''
                    }
                },


                //获取自动化平台
                getAutoList() {
                    axios.get('${SITE_URL}auto/').then(res => {
                        res = res.data
                        this.autotaskOptions = res.job_list
                        this.autosysOptions = res.plat_form
                    })

                },
                getAlarmTitle() {
                    axios.get('${SITE_URL}getalarminfo/').then(res => {
                        this.monitor_info = res.data
                    })
                },
                //获取初步分析列表
                getPrimaryList() {
                    axios.get('${SITE_URL}firstcate_analysis/').then(res => {
                        res = res.data
                        this.preliminaryAnalysisOptions = res[1]
                    })
                },
                getSystem() {
                    axios.get('${SITE_URL}system/').then(res => {
                        res = res.data
                        this.systemList = res
                    })
                },
                getAlarmInfo() {
                    let vm = this
                    vm.alarmDisplay = []
                    vm.alarmDisplay = this.formLine.failure_analysis.monitor_src
                },

                sureDelete(id) {
                    let vm = this
                    let data = {item: id, event_number: this.formLine.event_number}
                    axios.post('${SITE_URL}delete_search/', data).then((res) => {
                        vm.alarmDisplay = []
                        vm.alarmDisplay = res.data
                        vm.$message({
                            type: 'success',
                            message: '删除成功!'
                        });
                    })
                },


                //////////////////////////////////////////
                //选择机器弹框
           chooseMachine(){
           this.$nextTick(()=>{
            this.taskData2.slectValue=""
            this.taskData2.slectValue=$("#plugin3_demo3.select2_box").select2("val")
            this.currentPage2=1
            this.getmoduleTree()
           })
           },

            //单个选中
            checked(data){
                let dataNodes = this.$refs.tree.getNode(data.id)
                if(dataNodes.level==2 && dataNodes.checked){
                    this.getNodeMachineChild(data)
                }

            },

           //配置平台checkBox选中状态触发
           checkedChange(data){
               //事件过滤防止选中触发请求
                //required为已经求过的
                if(data.required){
                    return false
                } else {
                    if( data.children==null && data.children==undefined){
                    return false
                    }
                }
                //在dom渲染完成后进行选中节点的获取
                this.$nextTick(()=>{
                 //配置平台
                 //获取所选中的节点
                 let  nodes =  this.$refs.tree.getCheckedNodes()
                 let node
                 //对选中的节点进行遍历
                for(let i of nodes ){
                    node =""
                    //得到Node节点的状态
                    node=this.$refs.tree.getNode(i.id)
                    //当且仅当节点为选中状态和节点的层级为2，且节点的childeren节点长度为0时请求
                    if( node.checked && node.level ==2 && node.childNodes.length==0 && !node.data.required  ){
                        //请求节点下的ip数据
                        this.getNodeMachineChild(i)
                    }
                }
            })
            },

             //获取树
             getmoduleTree(){
                if(this.machineBiz.length==0){
                    this.$message(
                             {
                                 type:'error',
                                 message:'请选择机器所属系统'
                             }
                         )
                }else{
                    this.centerDialogVisible = true
                    axios.post('${SITE_URL}getCCModuleTree/',this.machineBiz).then(res=>{
                   this.configureData = res.data
                    console.log(res.data)
                }, err=>{
                     this.$message(
                             {
                                 type:'error',
                                 message:'获取机器数据失败！'
                             }
                         )
                })
                }
            },
             //el-tree渲染属性方法
              renderContent(h, { node, data, store }) {
                let classname = '';
                if(node.level == 3){
                    if(data.label.substring(data.label.indexOf('['))=="[Agent状态正常]"){
                        classname = 'colorSucStyle';
                    }else classname = 'colorErrStyle';
                     return h('span',{},[
                   h('span', data.label.substring(0,data.label.indexOf('['))),
                   h("span",{
                    class:classname,
                    domProps:{
                        innerHTML:data.label.substring(data.label.indexOf('['))
                    }
                })
                ])  
                }else{
                         classname=""
                          return h('span',{},[
                   h('span', data.label),
                ])
                }
            },

              //获取业务下的主机ip列表
              getNodeMachineChild(subData){
                //请求参数为Node节点
                  let data={
                    moduleID:subData.id,
                    bizID:''
                }
                data.bizID= this.machineBiz
                axios.post('${SITE_URL}searchHostByModule/',data).then(res=>{
                    let newChild =[]
                    if(res.data.length==0){
                        this.$set(subData,'required', true);
                        return false
                    }
                   //获取节点列表，用于后续筛选作
                    this.NodeMachineList = this.NodeMachineList.concat(res.data)
                    //对请求到的数据进行遍历拼接数据形式
                    res.data.map(item=>{
                        let newItem ={id:'',label:''}
                        newItem.id = item.bk_host_innerip
                        newItem.label = item.bk_host_innerip
                        newItem.label += item.status =="0" ?'[Agent未安装]' :'[Agent状态正常]'
                        newChild.push(newItem)
                    })
                       //将获取的ip数据追加到当前请求节点下
                        this.$set(subData,'children', newChild);
                         //当前节点已请求过标记为required为true,防止重复请求
                        this.$set(subData,'required', true);
                        //节点渲染后将请求得到的ipList设置为选中状态
                        this.$nextTick(()=>{
                            //对获取的节点进行遍历进行选中
                            for(let i of newChild){
                             this.$refs.tree.setChecked(i,true,false)
                            }
                       })
                },err=>{
                    this.$message({
                            type:'error',
                            message:'获取机器列表失败！！！'
                        })
                })


            },
            handleSelectionChange2 (selection) {
                this.selectData[this.currentPage2] = []
                selection.map((item, index) => {
                this.selectData[this.currentPage2].push(item.bk_host_innerip)
                })
            },
            handleCurPageChange2(){
                let arr =[];
                if(!!this.selectData[this.currentPage2]){
                    this.selectData[this.currentPage2].map(item=>{
                        arr = arr.concat(this.taskData2.tabelshowData.filter(item2=>{
                             return  item2.bk_host_innerip ==item
                        }))
                    })
                }
                   this.toggleSelection(arr)
            },


            toggleSelection(rows){
                if(rows){
                    rows.forEach(row=>{
                        this.$refs.table.toggleRowSelection(row)
                    })
                }else{
                    this.$refs.table.clearSelection();
                }
            },


  handleCurrentChange0(val) {
        if(this.currentPage0 != val){
            this.currentPage0 = val
        }if(val == 1){
            this.tabelshowData = this.machineList.slice(0,this.pageSize0)
        }else{
            let prev =(this.pageSize0)*(val-1),
            next =((this.pageSize0)*val)
            this.tabelshowData =[]
            this.tabelshowData = this.machineList.slice(prev,next)
        }
  },

  handleCurrentChange1(val) {
        if(this.currentPage1 != val){
            this.currentPage1 = val
        }
        if(val == 1){
            this.tabelshowData = this.machineList.slice(0,this.pageSize1)
        }else{
            let prev =(this.pageSize1)*(val-1),
            next =((this.pageSize1)*val)
            this.tabelshowData =[]
            this.tabelshowData = this.machineList.slice(prev,next)
        }
  },
            handleCurrentChange2(val) {
            if(this.currentPage2 != val){
                this.currentPage2 = val
            }
            if(val == 1){
                this.taskData2.tabelshowData = this.taskData2.tabelData.slice(0,this.pageSize2)
            }else{
                let prev =(this.pageSize2)*(val-1),
                next =((this.pageSize2)*val)
                this.taskData2.tabelshowData =[]
                this.taskData2.tabelshowData = this.taskData2.tabelData.slice(prev,next)
            }
            setTimeout(() => {
                this.handleCurPageChange2()
            }, 50);
      },
////////////////////////////////////////////////////////////////////////
                //获取三级列表
                getTridList() {
                    axios.get('${SITE_URL}event_category/').then(res => {
                        res = res.data
                        this.firstOptions = res[0]; // 一级列表选项
                        this.secondOriginalList = res[1];  // 二级所有列表
                        this.thirdOriginalList = res[2]; // 三级所有列表
                    })
                },

                //查询
                search() {
                    if (this.formLine.failure_analysis.alarm_type && this.formLine.failure_analysis.start_time
                        && this.formLine.failure_analysis.end_time) {
                        let vm = this
                        let data = this.formLine
                        vm.popshow = true
                        axios.post('${SITE_URL}search/', data).then(res => {
                            vm.gridData = []
                            vm.gridData = res.data
                            if (res.result) {
                                this.$message({
                                    type: "success",
                                    message: '查询成功'
                                })
                            } else {
                                this.$message({
                                    type: "error",
                                    message: '查询失败' + res.message
                                })
                                this.formLine = data
                            }
                        })
                    } else {
                        vm.$message({
                            type: 'error',
                            message: '查询失败，请完善必填项'
                        });
                    }
                },
                pophide() {
                    this.popshow = false
                },
                getuser() {
                    axios.get('${SITE_URL}getuser/').then(res => {
                        res = res.data
                        this.user = res
                    })
                },
//筛选数据的保存
                save() {
                    let event_number = this.formLine.event_number
                    let alarmList = []
                    for (let i in this.selectData) {
                        alarmList = alarmList.concat(this.selectData[i])
                    }
                    let vm = this
                    let data = this.formLine
                    axios.post("${SITE_URL}save/", {alarmList: alarmList, event_number: event_number}).then(res => {
                        vm.alarmDisplay = []
                        vm.alarmDisplay = res.data
                        // $("#search").click()
                    }, err => {
                        vm.$message({
                            type: 'error',
                            message: '查询失败'
                        });
                    })
                    vm.popshow = false
                },
                returnn() {
                    window.history.go(-1)
                },

                submit() {
                    let alarmList = []
                    for (let i in this.selectData) {
                        alarmList = alarmList.concat(this.selectData[i])
                    }
                    let data = this.formLine
                    data.urgency_degree = formatToText(data.urgency_degree, keyArray.influenceLevel)
                    data.priority = formatToText(data.priority, keyArray.priority)
                    data.event_type = formatToText(data.event_type, keyArray.eventType)
                    if (this.type == "edit") {
                        axios.post('${SITE_URL}event_save_and_update/', {
                            data: data,
                            alarmList: alarmList,
                            errorMachine:this.machineList
                        }).then(res => {
                            if (res.result) {
                                if (res.data.editflag) {
                                    this.$notify.info({
                                        title: "提交成功",
                                        message: "事件状态为'未分析'，以下字段未填写：" + res.data.notedit
                                    })
                                } else {
                                    this.$notify.info({
                                        title: "提交成功",
                                        message: "事件状态为'已分析'"
                                    })
                                }
                                window.setTimeout(() => {
                                    window.history.go(-1)
                                }, 3000)
                            } else {
                                this.$message({
                                    type: "error",
                                    message: '编辑失败,' + res.message
                                })
                                data.urgency_degree = formatToId(data.urgency_degree, keyArray.influenceLevel)
                                data.priority = formatToId(data.priority, keyArray.priority)
                                // data.report_src= formatToId(data.report_src, keyArray.ReportSource)
                                data.event_type = formatToId(data.event_type, keyArray.eventType)
                                this.formLine = data
                            }
                        })
                    } else {
                        //新建
                        axios.post('${SITE_URL}new_create/', {data: data, alarmList: alarmList, errorMachine:this.machineList}).then(res => {
                            if (res.result) {
                                if (res.data.editflag) {
                                    this.$notify.info({
                                        title: "提交成功",
                                        message: "事件状态为'未分析'，以下字段未填写：" + res.data.notedit
                                    })
                                } else {
                                    this.$notify.info({
                                        title: "提交成功",
                                        message: "事件状态为'已分析'"
                                    })
                                }
                                window.setTimeout(() => {
                                    window.history.go(-1)
                                }, 3000)
                            } else {
                                this.$message({
                                    type: "error",
                                    message: '编辑失败,' + res.message
                                })
                                data.urgency_degree = formatToId(data.urgency_degree, keyArray.influenceLevel)
                                data.priority = formatToId(data.priority, keyArray.priority)
                                // data.report_src= formatToId(data.report_src, keyArray.ReportSource)
                                data.event_type = formatToId(data.event_type, keyArray.eventType)
                                this.formLine = data
                            }
                        })
                    }
                },
            }
        })


    </script>


</%block>
