<template>
    <div class="examination">
      <el-dialog @close="closeDialog" :visible.sync="dialogTableVisible" customClass="customWidth_testT">
        <div slot="title" class="titleBox" style="display: flex;">
         <i :class="tableType === 0? 'el-icon-document':'el-icon-edit-outline'" style="font-size: 20px"></i>
        <!-- <img style="width: 25px; height: 25px" src='../../../../assets/img/imgScreen/more.png' /> -->
        <span style="margin-left:10px;font-size:18px">{{tableTypeDsc}}</span>
        </div>
        <el-form :model="monitorForm.tableData" label-width="80px" :rules="monitorForm.monitorRules" ref="monitorForm" >
         <table class="common-table-style4">
           <tr>
             <td>
               <el-form-item prop="taskNo" label="任务编号">
               <el-input v-model="taskNo" readonly disabled size="small" style="width: 200px;"></el-input>
               </el-form-item>
             </td>
             <td>
               <el-form-item prop="taskName" label="任务名称">
               <el-input v-model="taskName" readonly disabled size="small" style="width: 200px;"></el-input>
               </el-form-item>
             </td>
             <td>
               <el-form-item prop="testItemNo" label="测试项目编号">
               <el-input v-model="testItemNo" readonly disabled size="small" style="width: 200px;"></el-input>
               </el-form-item>
             </td>
           </tr>
           <tr>  
             <td>
               <el-form-item prop="testPostNameTypeIndex" label="测试岗位">
               <el-select v-model="testPostNameTypeIndex" filterable collapse-tags size="small" style="width: 200px;">
                  <el-option v-for="(item,index) in testPostNameType" :key="index" :label="item.postName"
                    :value="index">
                  </el-option>
                </el-select>
               </el-form-item>
             </td>
             <td>
               <el-form-item prop="isTestTypeIndex" label="是否免检">
               <el-select v-model="isTestTypeIndex" filterable collapse-tags size="small" style="width: 200px;">
                  <el-option v-for="(item,index) in isTestType" :key="index" :label="item.isTest"
                    :value="index">
                  </el-option>
                </el-select>
               </el-form-item>
             </td>
              <td>
              <el-form-item prop="testItemNameTypeIndex" label="测试项目名称">
              <el-select v-model="testItemNameTypeIndex" filterable collapse-tags size="small" style="width: 200px;" @change="selectTrigger(testItemNameTypeIndex)">
                  <el-option v-for="(item,index) in testItemNameType" :key="index" :label="item.testItemName"
                    :value="index">
                  </el-option>
              </el-select>
              </el-form-item>
              </td>
             <!-- <td>
               <el-form-item prop="isIndexTypeIndex" label="是否含指标">
               <el-select v-model="isIndexTypeIndex" filterable collapse-tags size="small" style="width: 200px;">
                  <el-option v-for="(item,index) in isIndexType" :key="index" :label="item.isIndex"
                    :value="index">
                  </el-option>
                </el-select>
               </el-form-item>
             </td> -->
            </tr>
            <tr>
             <td>
               <el-form-item prop="eqpTypeNameTypeIndex" label="测试设备类别">
               <el-select v-model="eqpTypeNameTypeIndex" filterable collapse-tags size="small" style="width: 200px;">
                  <el-option v-for="(item,index) in eqpTypeNameType" :key="index" :label="item.baseName"
                    :value="index">
                  </el-option>
                </el-select>
               </el-form-item>
             </td>
              <td>
               <el-form-item prop="testLocate" label="测试位置">
               <el-input v-model="testLocate" placeholder="请输入" size="small" style="width: 200px;"></el-input>
               </el-form-item>
             </td>
              <td>
               <el-form-item prop="testLimit" label="测试时限(h)">
               <el-input v-model="testLimit" size="small" placeholder="请输入" style="width: 200px;"></el-input>
               </el-form-item>
             </td>
             <!-- <td>
               <el-form-item prop="isCtrlTypeIndex" label="是否控制">
                <el-select v-model="isCtrlTypeIndex" filterable collapse-tags size="small" style="width: 200px;">
                  <el-option v-for="(item,index) in isCtrlType" :key="index" :label="item.isCtrl"
                    :value="index">
                  </el-option>
                </el-select>
               </el-form-item>
             </td> -->
           </tr>
           <!-- <tr> -->
             <!-- <td>
               <el-form-item prop="itemSize" label="测试尺寸">
               <el-input v-model="itemSize" placeholder="请输入" size="small" style="width: 200px;"></el-input>
               </el-form-item>
             </td> -->
             <!-- <td>
               <el-form-item prop="testDirection" label="测试方向">
               <el-input v-model="testDirection" placeholder="请输入" size="small" style="width: 200px;"></el-input>
               </el-form-item>
             </td> -->
             <!-- <td>
               <el-form-item prop="isAutoTypeIndex" label="是否自动执行">
               <el-select v-model="isAutoTypeIndex" filterable collapse-tags size="small" style="width: 200px;">
                  <el-option v-for="(item,index) in isAutoType" :key="index" :label="item.isAuto"
                    :value="index">
                  </el-option>
                </el-select>
               </el-form-item>
             </td> -->
           <!-- </tr> -->
           <tr>
             <!-- <td>测试项目英文</td>
             <td><el-input v-model="testItemEng" placeholder="请输入" size="small" style="width: 200px;"></el-input></td> -->
             <!-- <td>
               <el-form-item prop="isSonTypeIndex" label="是否子任务">
               <el-select v-model="isSonTypeIndex" filterable collapse-tags size="small" style="width: 200px;">
                  <el-option v-for="(item,index) in isSonType" :key="index" :label="item.isSon"
                    :value="index">
                  </el-option>
                </el-select>
               </el-form-item>
             </td> -->
           </tr>
            <tr>
             <td>
               <el-form-item prop="itemTypeNameTypeIndex" label="项目类型">
               <el-select v-model="itemTypeNameTypeIndex" filterable collapse-tags size="small" style="width: 200px;">
                  <el-option v-for="(item,index) in itemTypeNameType" :key="index" :label="item.baseName"
                    :value="index">
                  </el-option>
                </el-select>
               </el-form-item>
             </td>
             <!-- <td>
               <el-form-item prop="doOrder" label="执行顺序">
               <el-input v-model="doOrder" placeholder="请输入" size="small" style="width: 200px;"></el-input>
               </el-form-item>
             </td> -->
             <!-- <td>
               <el-form-item prop="isSynTypeIndex" label="是否同步">
               <el-select v-model="isSynTypeIndex" filterable collapse-tags size="small" style="width: 200px;">
                  <el-option v-for="(item,index) in isSynType" :key="index" :label="item.isSyn"
                    :value="index">
                  </el-option>
                </el-select>
               </el-form-item>
             </td> -->
             <td>
               <el-form-item prop="pointNameTypeIndex" label="作业点">
               <el-select v-model="pointNameTypeIndex" filterable collapse-tags size="small" style="width: 200px;">
                  <el-option v-for="(item,index) in pointNameType" :key="index" :label="item.pointName"
                    :value="index">
                  </el-option>
                </el-select>
               </el-form-item>
             </td>
             <td>
               <el-form-item prop="testCnt" label="测试次数">
               <el-input v-model="testCnt" placeholder="请输入" size="small" style="width: 200px;"></el-input>
               </el-form-item>
             </td>
             <!-- <td>
               <el-form-item prop="itemTemp" label="测试温度">
               <el-input v-model="itemTemp" placeholder="请输入" size="small" style="width: 200px;"></el-input>
               </el-form-item>
             </td> -->
             <!-- <td>
               <el-form-item prop="isMsgTypeIndex" label="是否推送">
               <el-select v-model="isMsgTypeIndex" filterable collapse-tags size="small" style="width: 200px;">
                  <el-option v-for="(item,index) in isMsgType" :key="index" :label="item.isMsg"
                    :value="index">
                  </el-option>
                </el-select>
               </el-form-item>
             </td> -->
             </tr>
             <tr>
             <!-- <td>
               <el-form-item prop="stdNameTypeIndex" label="方法标准名称">
               <el-select v-model="stdNameTypeIndex" filterable collapse-tags size="small" style="width: 200px;">
                  <el-option v-for="(item,index) in stdNameType" :key="index" :label="item.stdName"
                    :value="index">
                  </el-option>
                </el-select>
               </el-form-item>
             </td> -->
             <td>
               <el-form-item prop="isReferTypeIndex" label="是否引用">
               <el-select v-model="isReferTypeIndex" filterable collapse-tags size="small" style="width: 200px;">
                  <el-option v-for="(item,index) in isReferType" :key="index" :label="item.isRefer"
                    :value="index">
                  </el-option>
                </el-select>
               </el-form-item>
             </td>
             <td colspan="2">
               <el-form-item prop="memo" label="备注">
               <el-input v-model="memo" size="small" placeholder="请输入"></el-input>
               </el-form-item>
             </td>
             </tr>
         </table>
       </el-form>
       <span slot="footer" class="dialog-footer">
        <el-button type="goon" icon="el-icon-check" size="mini" @click="tableType === 0 ? addData():modifyData()">确定</el-button>
        <el-button size="mini" type="goon" icon="el-icon-remove-outline" @click="cancel">取消</el-button>
      </span>
    </el-dialog>
    </div>
</template>
<script>
import {
  getCookie
} from '@/utils/util.js';
import {
  cookieUserId,
  cookieUserName
} from '@/config/config.js';
let userName = getCookie(cookieUserName);
let userId = getCookie(cookieUserId);
export default {
  props: ['showFlag', 'Params', 'Params2'],
    data () {
        return {
            dialogTableVisible: false,
            tableTypeDsc: '新增测试任务',
            tableType: 0,
            seen: true,
            seenNo: true,
            beInvalid: false,
            taskNo: '',
            taskName: '',
            seenRule: true,
            testItemNo: '',
            testItemName: '',
            testDirection: '',
            itemSize: '',
            // testItemEng: '',
            testLimit: '',
            memo: '',
            itemTemp: '',
            doOrder: '',
            testLocate: '',
            testCnt: '',
            testPostNameTypeIndex: 0,//测试岗位
            isTestTypeIndex: 1,//是否免检
            eqpTypeNameTypeIndex: 0,//测试设备
            isCtrlTypeIndex: 1,//是否控制
            isIndexTypeIndex: 1,//是否含指标
            isAutoTypeIndex: 1,//是否自动执行
            isReferTypeIndex: 1,//是否引用
            isSonTypeIndex: 1,//是否子任务
            itemTypeNameTypeIndex: 0,//项目类型
            isSynTypeIndex: 1,//是否同步
            isMsgTypeIndex: 1,//是否推送
            pointNameTypeIndex: 0,//作业点
            testItemNameTypeIndex: 0,//测试项目名称
            stdNameTypeIndex: 0,
            testPostNameType: [],
            testItemNameType: [],
            stdNameType: [],
            isTestType: [
              {id: '0', isTest: '否'},
              {id: '1', isTest: '是'}
            ],
            eqpTypeNameType: [],
            isCtrlType: [
              {id: '0', isCtrl: '否'},
              {id: '1', isCtrl: '是'}
            ],
            isIndexType: [
              {id: '0', isIndex: '否'},
              {id: '1', isIndex: '是'}
            ],
            isAutoType: [
              {id: '0', isAuto: '否'},
              {id: '1', isAuto: '是'}
            ],
            isReferType: [
              {id: '0', isRefer: '否'},
              {id: '1', isRefer: '是'}
            ],
            isSonType: [
              {id: '0', isSon: '否'},
              {id: '1', isSon: '是'}
            ],
            itemTypeNameType: [],
            isSynType: [
              {id: '0', isSyn: '否'},
              {id: '1', isSyn: '是'}
            ],
            isMsgType: [
              {id: '0', isMsg: '否'},
              {id: '1', isMsg: '是'}
            ],
            pointNameType: [],
            monitorForm: {
            tableData: [{}]
            }
        }
    },
    mounted () {
      this.gettestPostNameTypeList ()
      this.geteqpTypeNameType ()
      this.getItemTypeNameType ()
      this.getTestItemNameType ()
      this.getpointNameType ()
      this.getstdNameType ()
    },
    methods: {
       selectTrigger (val) {
        let _this = this;
        _this.testItemNo = _this.testItemNameType[val].testItemNo
      },
      cancel () {
        let _this = this;
        _this.monitorForm.tableData = [{}]
        _this.dialogTableVisible = false
        _this.taskNo = '',
        _this.taskName = '',
        _this.testItemNo = '',
        _this.testItemName = '',
        _this.testDirection = '',
        _this.itemSize = '',
        _this.testLimit = '',
        _this.memo = '',
        _this.itemTemp = '',
        _this.doOrder = '',
        _this.testLocate = '',
        _this.testCnt = '',
        _this.testPostNameTypeIndex = 0,//测试岗位
        _this.isTestTypeIndex = 1,//是否免检
        _this.eqpTypeNameTypeIndex = 0,//测试设备
        _this.isCtrlTypeIndex = 1,//是否控制
        _this.isIndexTypeIndex = 1,//是否含指标
        _this.isAutoTypeIndex = 1,//是否自动执行
        _this.isReferTypeIndex = 1,//是否引用
        _this.isSonTypeIndex = 1,//是否子任务
        _this.itemTypeNameTypeIndex = 0,//项目类型
        _this.isSynTypeIndex = 1,//是否同步
        _this.isMsgTypeIndex = 1,//是否推送
        _this.pointNameTypeIndex = 0,//作业点
        _this.testItemNameTypeIndex = 0,//测试项目名称
        _this.stdNameTypeIndex = 0,
        _this.$emit('refresh')
      },
      gettestPostNameTypeList () {
          let obj ={
        'object':{validFlag:1},
        'pageIndex':1,
        'pageSize':99999
      }
        this.axios.post('pass/baseManagement/v1/limsbaseposts/queryLimsBasePostPage/',obj, {individualType: 'json'}).then(res => {
              this.testPostNameType = res.data.list;
            })
      },
      geteqpTypeNameType () {
        this.axios.post("pass/baseManagement/v1/limsbaseinfos/queryBaseInfoByBaseCode",{validFlag:1,baseCode:4808}, {individualType: 'json'}).then(res => {
              this.eqpTypeNameType = res.data
            })
      },
      getItemTypeNameType () {
        this.axios.post("pass/baseManagement/v1/limsbaseinfos/queryBaseInfoByBaseCode",{validFlag:1,baseCode:4804}, {individualType: 'json'}).then(res => {
              this.itemTypeNameType = res.data
            })
      },
      getpointNameType () {
        this.axios.get('pass/baseManagement/v1/limsbasepoints/'+ '?validFlag=1')
            .then(res => {
              this.pointNameType = res.data.list;
            })
      },
      getTestItemNameType () {
         this.axios.get('pass/baseManagement/v1/limsstdtestitems/'+ '?validFlag=1')
            .then(res => {
              this.testItemNameType = res.data.list;
            })
      },
      getstdNameType () {
         this.axios.get('pass/baseManagement/v1/limsstdinfos/'+ '?validFlag=1')
            .then(res => {
              this.stdNameType = res.data.list;
            })
      },
      addData () {
        let _this = this;
        //  _this.$refs['monitorForm'].validate((valid) => {
        //   if (valid) {
             _this.dialogTableVisible = false;
             for (var i = 0; i < _this.monitorForm.tableData.length; i++) {
             _this.monitorForm.tableData[i].createMan = userName;
             _this.monitorForm.tableData[i].createNo = userId;
             }
             _this.monitorForm.tableData[0].stdNo = _this.stdNameType[_this.stdNameTypeIndex].stdNo;
             _this.monitorForm.tableData[0].stdName= _this.stdNameType[_this.stdNameTypeIndex].stdName;
             _this.monitorForm.tableData[0].testItemNo = _this.testItemNameType[_this.testItemNameTypeIndex].testItemNo;
             _this.monitorForm.tableData[0].testItemName= _this.testItemNameType[_this.testItemNameTypeIndex].testItemName;
             _this.monitorForm.tableData[0].testPostCode = _this.testPostNameType[_this.testPostNameTypeIndex].postNo;
             _this.monitorForm.tableData[0].testPostName = _this.testPostNameType[_this.testPostNameTypeIndex].postName;
             _this.monitorForm.tableData[0].eqpTypeCode= _this.eqpTypeNameType[_this.eqpTypeNameTypeIndex].baseCode;
             _this.monitorForm.tableData[0].eqpTypeName = _this.eqpTypeNameType[_this.eqpTypeNameTypeIndex].baseName;
             _this.monitorForm.tableData[0].itemTypeCode = _this.itemTypeNameType[_this.itemTypeNameTypeIndex].baseCode;
             _this.monitorForm.tableData[0].itemTypeName = _this.itemTypeNameType[_this.itemTypeNameTypeIndex].baseName;
             _this.monitorForm.tableData[0].pointNo = _this.pointNameType[_this.pointNameTypeIndex].pointNo;
             _this.monitorForm.tableData[0].pointName= _this.pointNameType[_this.pointNameTypeIndex].pointName;
             _this.monitorForm.tableData[0].testDirection = _this.testDirection;
             _this.monitorForm.tableData[0].itemSize = _this.itemSize;
            //  _this.monitorForm.tableData[0].testItemEng = _this.testItemEng;
             _this.monitorForm.tableData[0].testLimit = _this.testLimit;
             _this.monitorForm.tableData[0].itemTemp = _this.itemTemp;
             _this.monitorForm.tableData[0].memo = _this.memo;
             _this.monitorForm.tableData[0].doOrder = _this.doOrder;
             _this.monitorForm.tableData[0].taskNo = _this.taskNo;
             _this.monitorForm.tableData[0].taskName = _this.taskName;
             _this.monitorForm.tableData[0].testLocate = _this.testLocate;
             _this.monitorForm.tableData[0].isTest = _this.isTestTypeIndex;
             _this.monitorForm.tableData[0].isCtrl = _this.isCtrlTypeIndex;
             _this.monitorForm.tableData[0].isIndex = _this.isIndexTypeIndex;
             _this.monitorForm.tableData[0].isAuto = _this.isAutoTypeIndex;
             _this.monitorForm.tableData[0].isRefer = _this.isReferTypeIndex;
             _this.monitorForm.tableData[0].isSon = _this.isSonTypeIndex;
             _this.monitorForm.tableData[0].isSyn = _this.isSynTypeIndex;
             _this.monitorForm.tableData[0].isMsg = _this.isMsgTypeIndex;
             _this.monitorForm.tableData[0].testCnt = _this.testCnt;
             _this.axios.post('pass/baseManagement/v1/limsstdtaskds/', _this.monitorForm.tableData, {individualType: 'json'}).then(res => {
                if (res.succeed) {
                 this.$message.success('添加成功')
                 _this.$emit('refresh')
                } else {
                 this.$message.error(res.message)
                }
                }).catch(e => {
                 this.$message.error(e.message)
               })
      //    }
      //  })
      },
      modifyData () {
        let _this = this;
        // _this.$refs['monitorForm'].validate((valid) => {
        // if (valid) {
        _this.dialogTableVisible = false;
         for (var i = 0; i < _this.monitorForm.tableData.length; i++) {
        _this.monitorForm.tableData[i].updateMan = userName;
        _this.monitorForm.tableData[i].updateNo = userId;
        }
       _this.monitorForm.tableData[0].stdNo = _this.stdNameType[_this.stdNameTypeIndex].stdNo;
       _this.monitorForm.tableData[0].stdName= _this.stdNameType[_this.stdNameTypeIndex].stdName;
       _this.monitorForm.tableData[0].testItemNo = _this.testItemNameType[_this.testItemNameTypeIndex].testItemNo;
       _this.monitorForm.tableData[0].testItemName= _this.testItemNameType[_this.testItemNameTypeIndex].testItemName;
       _this.monitorForm.tableData[0].testPostCode = _this.testPostNameType[_this.testPostNameTypeIndex].postNo;
       _this.monitorForm.tableData[0].testPostName = _this.testPostNameType[_this.testPostNameTypeIndex].postName;
       _this.monitorForm.tableData[0].eqpTypeCode= _this.eqpTypeNameType[_this.eqpTypeNameTypeIndex].baseCode;
       _this.monitorForm.tableData[0].eqpTypeName = _this.eqpTypeNameType[_this.eqpTypeNameTypeIndex].baseName;
       _this.monitorForm.tableData[0].itemTypeCode = _this.itemTypeNameType[_this.itemTypeNameTypeIndex].baseCode;
       _this.monitorForm.tableData[0].itemTypeName = _this.itemTypeNameType[_this.itemTypeNameTypeIndex].baseName;
       _this.monitorForm.tableData[0].pointNo = _this.pointNameType[_this.pointNameTypeIndex].pointNo;
       _this.monitorForm.tableData[0].pointName= _this.pointNameType[_this.pointNameTypeIndex].pointName;
      //  _this.monitorForm.tableData[0].testItemNo = _this.testItemNo;
       _this.monitorForm.tableData[0].testDirection = _this.testDirection;
       _this.monitorForm.tableData[0].itemSize = _this.itemSize;
      //  _this.monitorForm.tableData[0].testItemEng = _this.testItemEng;
       _this.monitorForm.tableData[0].testLimit = _this.testLimit;
       _this.monitorForm.tableData[0].itemTemp = _this.itemTemp;
       _this.monitorForm.tableData[0].memo = _this.memo;
       _this.monitorForm.tableData[0].taskNo = _this.taskNo;
       _this.monitorForm.tableData[0].taskName = _this.taskName;
       _this.monitorForm.tableData[0].doOrder = _this.doOrder;
       _this.monitorForm.tableData[0].testLocate = _this.testLocate;
       _this.monitorForm.tableData[0].isTest = _this.isTestTypeIndex;
       _this.monitorForm.tableData[0].isCtrl = _this.isCtrlTypeIndex;
       _this.monitorForm.tableData[0].isIndex = _this.isIndexTypeIndex;
       _this.monitorForm.tableData[0].isAuto = _this.isAutoTypeIndex;
       _this.monitorForm.tableData[0].isRefer = _this.isReferTypeIndex;
       _this.monitorForm.tableData[0].isSon = _this.isSonTypeIndex;
       _this.monitorForm.tableData[0].isSyn = _this.isSynTypeIndex;
       _this.monitorForm.tableData[0].isMsg = _this.isMsgTypeIndex;
       _this.monitorForm.tableData[0].testCnt = _this.testCnt;
       console.log(_this.monitorForm.tableData[0])
       _this.axios.put('pass/baseManagement/v1/limsstdtaskds/', _this.monitorForm.tableData[0], {individualType: 'json'}).then(res => {
           if (res.succeed) {
            this.$message.success('修改成功')
            _this.$emit('refresh')
           } else {
            this.$message.error(res.message)
           }
           }).catch(e => {
            this.$message.error(e.message)
          })
        // }
        // })
      },
      renderHeader (h) {
         return (
             <div style="cursor: pointer ;line-height:20px" onClick={() => this.addRow()}>
             <i class="el-icon-plus" style="font-size:20px; color:rgb(18, 52, 243)"></i>
             </div>
         )
      },
     closeDialog () {
       let _this = this;
       _this.monitorForm.tableData = [{}];
       _this.seen = true;
       _this.seenNo = true;
       _this.beInvalid = false;
       _this.taskNo = '',
       _this.taskName = '',
       _this.testItemNo = '',
       _this.testItemName = '',
       _this.testDirection = '',
       _this.itemSize = '',
       _this.testLimit = '',
       _this.memo = '',
       _this.itemTemp = '',
       _this.doOrder = '',
       _this.testLocate = '',
       _this.testCnt = '',
       _this.testPostNameTypeIndex = 0,//测试岗位
       _this.isTestTypeIndex = 1,//是否免检
       _this.eqpTypeNameTypeIndex = 0,//测试设备
       _this.isCtrlTypeIndex = 1,//是否控制
       _this.isIndexTypeIndex = 1,//是否含指标
       _this.isAutoTypeIndex = 1,//是否自动执行
       _this.isReferTypeIndex = 1,//是否引用
       _this.isSonTypeIndex = 1,//是否子任务
       _this.itemTypeNameTypeIndex = 0,//项目类型
       _this.isSynTypeIndex = 1,//是否同步
       _this.isMsgTypeIndex = 1,//是否推送
       _this.pointNameTypeIndex = 0,//作业点
       _this.testItemNameTypeIndex = 0,//测试项目名称
       _this.stdNameTypeIndex = 0,
       _this.$emit('refresh')
     },
      tableHeaderCellStyle () {
      return 'background-color: rgb(249,249,249) !important;color: rgb(73, 72, 72);border-bottom: 1px solid #DCDFE7;border-top:3px solid #3ac1ea;'
      }
    },
    watch: {
      showFlag (arg) {
        let _this = this;
        _this.dialogTableVisible = true;
        if (_this.Params !== null) {
          _this.monitorForm.tableData[0] = _this.Params[0];
          _this.tableType = 1;
          _this.tableTypeDsc = '修改测试任务';
          _this.seen = false;
          _this.beInvalid = true;
          _this.seenRule = false;
          _this.taskNo = _this.monitorForm.tableData[0].taskNo;
          _this.taskName = _this.monitorForm.tableData[0].taskName;
          _this.testItemNo = _this.monitorForm.tableData[0].testItemNo;
          _this.testDirection = _this.monitorForm.tableData[0].testDirection;
          _this.itemSize = _this.monitorForm.tableData[0].itemSize;
          _this.testCnt = _this.monitorForm.tableData[0].testCnt;
          // _this.testItemEng  = _this.monitorForm.tableData[0].testItemEng;
          // _this.testItemName = _this.monitorForm.tableData[0].testItemName;
          _this.testLimit = _this.monitorForm.tableData[0].testLimit;
          _this.itemTemp = _this.monitorForm.tableData[0].itemTemp;
          _this.memo = _this.monitorForm.tableData[0].memo;
          _this.doOrder = _this.monitorForm.tableData[0].doOrder;
          _this.testLocate = _this.monitorForm.tableData[0].testLocate;
          for (let j = 0; j < _this.testPostNameType.length; j++) {
           if (_this.testPostNameType[j].baseName === _this.monitorForm.tableData[0].testPostName) {
              _this.testPostNameTypeIndex = j;
           }
          }
          for (let j = 0; j < _this.isTestType.length; j++) {
           if (_this.isTestType[j].id === _this.monitorForm.tableData[0].isTest) {
              _this.isTestTypeIndex = j;
           }
          }
          for (let j = 0; j < _this.eqpTypeNameType.length; j++) {
           if (_this.eqpTypeNameType[j].baseName === _this.monitorForm.tableData[0].eqpTypeName) {
              _this.eqpTypeNameTypeIndex = j;
           }
          }
          for (let j = 0; j < _this.isCtrlType.length; j++) {
           if (_this.isCtrlType[j].id === _this.monitorForm.tableData[0].isCtrl) {
              _this.isCtrlTypeIndex = j;
           }
          }
          for (let j = 0; j < _this.isIndexType.length; j++) {
           if (_this.isIndexType[j].id === _this.monitorForm.tableData[0].isIndex) {
              _this.isIndexTypeIndex = j;
           }
          }
          for (let j = 0; j < _this.isAutoType.length; j++) {
           if (_this.isAutoType[j].id === _this.monitorForm.tableData[0].isAuto) {
              _this.isAutoTypeIndex = j;
           }
          }
          for (let j = 0; j < _this.isReferType.length; j++) {
           if (_this.isReferType[j].id === _this.monitorForm.tableData[0].isRefer) {
              _this.isReferTypeIndex = j;
           }
          }
          for (let j = 0; j < _this.isSonType.length; j++) {
           if (_this.isSonType[j].id === _this.monitorForm.tableData[0].isSon) {
              _this.isSonTypeIndex = j;
           }
          }
          for (let j = 0; j < _this.itemTypeNameType.length; j++) {
           if (_this.itemTypeNameType[j].baseName === _this.monitorForm.tableData[0].itemTypeName) {
              _this.itemTypeNameTypeIndex = j;
           }
          }
          for (let j = 0; j < _this.isSynType.length; j++) {
           if (_this.isSynType[j].id === _this.monitorForm.tableData[0].isSyn) {
              _this.isSynTypeIndex = j;
           }
          }
          for (let j = 0; j < _this.isMsgType.length; j++) {
           if (_this.isMsgType[j].id === _this.monitorForm.tableData[0].isMsg) {
              _this.isMsgTypeIndex = j;
           }
          }
          for (let j = 0; j < _this.pointNameType.length; j++) {
           if (_this.pointNameType[j].pointName === _this.monitorForm.tableData[0].pointName) {
              _this.pointNameTypeIndex = j;
           }
          }
           for (let j = 0; j < _this.testItemNameType.length; j++) {
           if (_this.testItemNameType[j].testItemNo === _this.monitorForm.tableData[0].testItemNo) {
              _this.testItemNameTypeIndex = j;
           }
          }
          for (let j = 0; j < _this.stdNameType.length; j++) {
           if (_this.stdNameType[j].stdName === _this.monitorForm.tableData[0].stdName) {
              _this.stdNameTypeIndex = j;
           }
          }
        } else {
          _this.tableType = 0;
          _this.seenNo = false;
          _this.tableTypeDsc = '新增测试任务';
          _this.seenRule = true,
          _this.taskNo = _this.Params2[0].taskNo;
          _this.taskName = _this.Params2[0].taskName;
        }
      }
    }
}
</script>
<style lang="less">
.customWidth_testT{
  width: 1000px !important
}
</style>
