qinzhipeng_v 5 лет назад
Родитель
Сommit
39f8e28b52
2 измененных файлов с 229 добавлено и 210 удалено
  1. 18 0
      src/api/caseProject.js
  2. 211 210
      src/views/Platform/presentation/testPage.vue

+ 18 - 0
src/api/caseProject.js

@@ -219,3 +219,21 @@ export function updateTestPlan(data) {
     data
   })
 }
+
+// 测试计划管理_导航栏删除
+export function deleteTestPlan(data) {
+  return request({
+    url: mockUrl + '/case/deleteTestPlan',
+    method: 'post',
+    data
+  })
+}
+
+// 测试计划管理_导航栏删除
+export function updateTestPlanCase(data) {
+  return request({
+    url: mockUrl + '/case/updateTestPlanCase',
+    method: 'post',
+    data
+  })
+}

+ 211 - 210
src/views/Platform/presentation/testPage.vue

@@ -8,11 +8,9 @@
           <el-aside width="17%" style=" background: #FFF;margin: 1% 0 1% 1%; border-radius:8px;">
             <div class="nav_Input" style="min-height:90vh;">
               <br>
-              <p v-show="node_Data" style="color: #DCDFE6; margin: 100% 0;font-size:14px; text-align:center;" @click="createFolder">新建文件夹</p>
-              <el-tree v-if="dataShow" :data="data1" :expand-on-click-node="false" node-key="id" @node-click="clickFun">
+              <el-tree :data="data1" :default-expanded-keys="key_arr" :expand-on-click-node="true" node-key="id" @node-click="clickFun">
                 <span slot-scope="{ node, data }" style="width:100%;" class="custom-tree-node" @mouseenter="mouseenter(data)" @mouseleave="mouseleave(data)">
-                  <span :title="data.label" class="span_el" @dblclick="dblclick(data)">{{ node.label }}</span>
-                  <el-input v-if="data.que" ref="get_Input" v-model="node_Name.name" size="mini" @blur="queryNodeName(node_Name.name, data)">输入框</el-input>
+                  <span :title="data.label" class="span_el">{{ node.label }}</span>
                   <el-dropdown v-show="data.del" style="margin-left:10px" trigger="click">
                     <span v-show="data.codes === '1' ? false : true" class="el-dropdown-link">
                       ···<i class="el-icon--right" />
@@ -20,12 +18,11 @@
                     <el-dropdown-menu slot="dropdown">
                       <el-dropdown-item v-show="data.codes !== '2'" @click.native="dblclick(data)">编辑测试计划</el-dropdown-item>
                       <el-dropdown-item v-show="data.codes !== '2'" @click.native="() => remove(node, data)">删除测试计划</el-dropdown-item>
-                      <el-dropdown-item @click.native="dialogFormVisibleUpdate = true">新建测试计划</el-dropdown-item>
+                      <el-dropdown-item v-show="data.codes === '2'" @click.native="createdTest(data)">新建测试计划</el-dropdown-item>
                     </el-dropdown-menu>
                   </el-dropdown>
                 </span>
               </el-tree>
-              <el-input v-if="Folder_Show" ref="input1" v-model="add_Folder.name" size="mini" placeholder="新建文件夹" @blur="hide_input(add_Folder.name)" />
             </div>
           </el-aside>
           <el-container>
@@ -63,10 +60,10 @@
                 <el-table-column prop="creatorName" label="执行状态" min-width="100" align="center">
                   <template slot-scope="scope">
                     <el-row :gutter="20" style="margin: 3%;text-align:center">
-                      <el-col :span="6"><img style=" cursor: pointer;" :src="scope.row.keys === 1 ? clicked_1: Unclicked_1" @click="Unclicked(clicked_1, scope.$index )"></el-col>
-                      <el-col :span="6"><img style=" cursor: pointer;" :src="scope.row.keys === 2 ? clicked_2: Unclicked_2" @click="Unclicked2(clicked_2, scope.$index)"></el-col>
-                      <el-col :span="6"><img style=" cursor: pointer;" :src="scope.row.keys === 3 ? clicked_3: Unclicked_3" @click="Unclicked3(clicked_3, scope.$index)"></el-col>
-                      <el-col :span="6"><img style=" cursor: pointer;" :src="scope.row.keys === 0 ? clicked_4: Unclicked_4" @click="Unclicked4(clicked_4, scope.$index)"></el-col>
+                      <el-col :span="6"><img style=" cursor: pointer;" :src="scope.row.keys === 1 ? clicked_1: Unclicked_1" @click="Unclicked(clicked_1, scope.$index, scope.row )"></el-col>
+                      <el-col :span="6"><img style=" cursor: pointer;" :src="scope.row.keys === 2 ? clicked_2: Unclicked_2" @click="Unclicked2(clicked_2, scope.$index, scope.row)"></el-col>
+                      <el-col :span="6"><img style=" cursor: pointer;" :src="scope.row.keys === 3 ? clicked_3: Unclicked_3" @click="Unclicked3(clicked_3, scope.$index, scope.row)"></el-col>
+                      <el-col :span="6"><img style=" cursor: pointer;" :src="scope.row.keys === 0 ? clicked_4: Unclicked_4" @click="Unclicked4(clicked_4, scope.$index, scope.row)"></el-col>
                     </el-row>
                   </template>
                 </el-table-column>
@@ -74,7 +71,7 @@
                 <el-table-column label="操作" min-width="200" align="center" fixed="right">
                   <template slot-scope="scope">
                     <el-button size="mini" type="primary" plain @click="go_Bug(scope.row)">提bug</el-button>
-                    <el-button size="mini" type="danger" plain @click="deleteCaseData(scope.row.id)">删除</el-button>
+                    <el-button size="mini" type="danger" plain @click="deleteCaseData(scope.row)">删除</el-button>
                   </template>
                 </el-table-column>
               </el-table>
@@ -89,20 +86,20 @@
         <!-- 新建测试计划 -->
         <el-dialog title="新建测试计划" :visible.sync="dialogFormVisibleUpdate" width="30%" center>
           <el-form ref="caseData" label-position="left" :model="caseData" label-width="120px" :rules="createFormData">
-            <el-form-item label="测试计划名称" prop="caseName">
-              <el-input v-model="caseData.caseName" clearable autocomplete="off" placeholder="请输入测试计划名称" style="width: 90%" />
+            <el-form-item label="测试计划名称" prop="testPlanName">
+              <el-input v-model="caseData.testPlanName" clearable autocomplete="off" placeholder="请输入测试计划名称" style="width: 90%" />
             </el-form-item>
             <el-form-item label="测试计划类型" prop="projectType">
-              <el-select v-model="caseData.caserojectType" clearable placeholder="请选择【准入计划】【非准入计划】" style="width: 90%">
+              <el-select v-model="caseData.caserojectType" placeholder="请选择【准入计划】【非准入计划】" style="width: 90%">
                 <el-option v-for="item in testPlanTypeEnum" :key="item.code" :label="item.msg" :value="item.code" />
               </el-select>
             </el-form-item>
-            <!-- <el-form-item label="端类型" prop="taskType">
-              <el-select v-model="caseData.taskType" clearable placeholder="请选择【服务端】【客户端】" style="width: 90%">
-                <el-option v-for="item in taskTypeStrings" :key="item.value" :label="item.name" :value="item.value" />
+            <el-form-item label="端类型" prop="taskType">
+              <el-select v-model="caseData.taskType" placeholder="请选择【服务端】【客户端】" style="width: 90%">
+                <el-option v-for="item in taskTypeStrings" :key="item.code" :label="item.msg" :value="item.code" />
               </el-select>
             </el-form-item>
-            <el-form-item label="工程模块" prop="casePriority">
+            <!-- <el-form-item label="工程模块" prop="casePriority">
               <el-select v-model="caseData.casePriority" clearable placeholder="请选择【多选组件】" style="width: 90%">
                 <el-option v-for="item in priorityStrings" :key="item.value" :label="item.name" :value="item.value" />
               </el-select>
@@ -122,17 +119,17 @@
                 <el-option v-for="item in case_one" :key="item.id" :label="item.label" :value="item.id" />
               </el-select>
             </el-col>
-            <el-col v-show="caseShwo_two" :span="4">
+            <el-col v-if="caseShwo_two" :span="4">
               <el-select v-model="case_from.two" size="small" clearable placeholder="请选择" @change="case_fromTwo(case_from.two)">
                 <el-option v-for="item in case_two" :key="item.id" :label="item.label" :value="item.id" />
               </el-select>
             </el-col>
-            <el-col v-show="caseShwo_three" :span="4">
+            <el-col v-if="caseShwo_three" :span="4">
               <el-select v-model="case_from.three" size="small" clearable placeholder="请选择" @change="case_fromThree(case_from.three)">
                 <el-option v-for="item in case_three" :key="item.id" :label="item.label" :value="item.id" />
               </el-select>
             </el-col>
-            <el-col v-show="caseShwo_four" :span="4">
+            <el-col v-if="caseShwo_four" :span="4">
               <el-select v-model="case_from.four" size="small" clearable placeholder="请选择" @change="case_fromFour(case_from.four)">
                 <el-option v-for="item in case_four" :key="item.id" :label="item.label" :value="item.id" />
               </el-select>
@@ -168,7 +165,7 @@
 </template>
 
 <script>
-import { queryCasesData, createTestPlan, updateTestPlan, deleteTestPlanCase, caseUpdateFolderName, createFolderData, deleteFolderData, queryTestPlanTree, queryTestPlanCaseList, queryAllFolderData, createTestPlanCaseList, getWebShowMap, passRateOfTestPlan } from '@/api/caseProject.js'
+import { queryCasesData, createTestPlan, updateTestPlan, deleteTestPlanCase, deleteTestPlan, updateTestPlanCase, queryTestPlanTree, queryTestPlanCaseList, queryAllFolderData, createTestPlanCaseList, getWebShowMap, passRateOfTestPlan } from '@/api/caseProject.js'
 import clicked_1 from '@/assets/通过点击后状态.png'
 import clicked_2 from '@/assets/失败点击后状态.png'
 import clicked_3 from '@/assets/阻塞点击后状态.png'
@@ -182,9 +179,6 @@ export default {
   data() {
     return {
       test_plan: {},
-      dataShow: true,
-      Folder_Show: false,
-      node_Data: false,
       caseShwo_two: false,
       caseShwo_three: false,
       caseShwo_four: false,
@@ -198,34 +192,32 @@ export default {
       Unclicked_2: Unclicked_2,
       Unclicked_3: Unclicked_3,
       Unclicked_4: Unclicked_4,
-      // show_click_1: Unclicked_1,
-      // show_click_2: Unclicked_2,
-      // show_click_3: Unclicked_3,
-      // show_click_4: Unclicked_4,
       dialogFormVisibleUpdate: false,
       dialogFormVisibleUpdateOne: false,
       testPlanTypeEnum: [],
       projectTypeStrings: [],
       taskTypeStrings: [],
       userInformation: localStorage.getItem('username'),
-      userNames: localStorage.getItem('realname'),
       bizJson: localStorage.getItem('key'),
       createTimeData: '',
-      userData: '',
       pageSize: 8,
       curIndex: 1,
       startId: '',
+      Parentids: '',
       createParticipation: {},
       gridData: [],
+      pegs: '',
       caseData: {
-        caserojectType: 2
+        caserojectType: 2,
+        taskType: 2
       },
       createFormData: {
-        caseName: [{ required: true, message: '测试计划名称不能为空', trigger: 'change' }],
+        testPlanName: [{ required: true, message: '测试计划名称不能为空', trigger: 'change' }],
         caserojectType: [{ required: true, message: '测试计划类型不能为空', trigger: 'change' }]
       },
       dialogTableVisible: false,
       formData: {},
+      taskids: '',
       data1: [],
       data2: [],
       total: 0,
@@ -243,9 +235,7 @@ export default {
       case_four: [],
       add_Folder: {},
       Selection: [],
-      node_Name: {
-        name: ''
-      },
+      key_arr: [],
       arr: {},
       add: {},
       as: {}
@@ -267,24 +257,21 @@ export default {
           this.data1 = res.data.map(item => ({
             ...item,
             codes: '1',
+            projectIds: item.id,
             label: item.projectName,
             children: item.taskNameMapList.map(eachData => ({
               ...eachData,
+              Parentids: item.id,
               codes: '2',
-              label: eachData.taskName
-              // children: eachData.testPlanInfos.map(key => ({
-              //   ...key
-              // }))
+              label: eachData.taskName,
+              children: eachData.testPlanInfos.map(key => ({
+                ...key,
+                codes: '3',
+                taskids: eachData.id,
+                label: key.testPlanName
+              }))
             }))
           }))
-          console.log(this.data1)
-          if (this.data1.length === 0) {
-            this.node_Data = true
-            this.dataShow = false
-          } else {
-            this.node_Data = false
-            this.dataShow = true
-          }
         } else {
           this.$message({ message: res.msg, type: 'success', duration: 1000, offset: 150 })
         }
@@ -342,14 +329,24 @@ export default {
       })
     },
 
-    // 双击编辑
+    // 导航栏编辑
     dblclick(data) {
+      this.caseData = data
+      this.$set(this.caseData, 'testPlanName', data.testPlanName)
+      this.caseData.caserojectType = data.testPlanType
+      this.titleName = '编辑'
       this.dialogFormVisibleUpdate = true
     },
 
-    // 新建文件夹
-    createFolder() {
-      this.$refs.caseData.resetFields()
+    // 导航栏_新增
+    createdTest(data) {
+      this.caseData = data
+      this.$set(this.caseData, 'testPlanName', '')
+      this.$set(this.caseData, 'caserojectType', 2)
+      this.$set(this.caseData, 'taskType', 2)
+      this.titleName = '新增'
+      // this.$refs['caseData'].clearValidate()
+      this.dialogFormVisibleUpdate = true
     },
 
     // 显示隐藏删除图标
@@ -360,62 +357,6 @@ export default {
       this.$set(data, 'del', false)
     },
 
-    // 更新节点
-    queryNodeName(val, data) {
-      if (val === '') { // 判断用户是否有输入
-        val = this.label // 没有输入拿之前的label替代
-        this.end_Data = { folderName: val, xmindUrl: '', id: data.id, bizId: localStorage.getItem('key'), modifier: this.userInformation, creator: this.userInformation }
-      } else {
-        this.end_Data = { folderName: val, xmindUrl: '', id: data.id, bizId: localStorage.getItem('key'), modifier: this.userInformation, creator: this.userInformation }
-      }
-      this.$set(data, 'que', false) // 失去焦点隐藏input
-      this.$set(this.node_Name, 'name', '') // 清空input
-      caseUpdateFolderName(this.end_Data).then(res => {
-        if (res.code === 200) {
-          this.$message({ type: 'success', message: res.msg, duration: 1000 })
-          this.data1 = []
-          this.AllQueryFolderData(localStorage.getItem('key'))
-        } else {
-          this.$message({ type: 'error', message: res.msg, duration: 1000 })
-          this.data1 = []
-          this.AllQueryFolderData(localStorage.getItem('key'))
-        }
-      })
-    },
-
-    // input失去焦点新增(或取消)
-    hide_input(vel) {
-      if (vel !== '') {
-        this.formData = {
-          bizId: this.bizJson,
-          folderName: vel,
-          xmindUrl: '',
-          parentFolderId: '-1',
-          creator: this.userInformation,
-          modifier: this.userInformation
-        }
-        createFolderData(this.formData).then(res => {
-          if (res.code === 200) {
-            this.$message({ message: res.msg, type: 'success', duration: 1000, offset: 150 })
-            this.dataShow = true
-            this.node_Data = false
-            this.data1 = []
-            this.AllQueryFolderData(this.bizJson)
-            this.created_id = ''
-          } else {
-            this.$message({ message: res.msg, type: 'error', duration: 1000, offset: 150 })
-            this.created_id = ''
-          }
-        })
-        this.Folder_Show = false
-      } else {
-        this.$message({ message: '取消创建文件夹', type: 'success', duration: 1000, offset: 150 })
-        this.Folder_Show = false
-        if (this.data1 === []) {
-          this.node_Data = true
-        }
-      }
-    },
     // 删除
     remove(node, data) {
       this.$confirm('是否确认删除', '确认信息', {
@@ -424,15 +365,18 @@ export default {
         cancelButtonText: '取消'
       })
         .then(() => {
-          this.formData = {
-            id: node.data.id,
-            modifier: node.data.id
+          var caseData = {
+            projectId: data.projectId,
+            modifier: this.userInformation,
+            taskId: data.taskId,
+            bizId: this.bizJson,
+            id: data.id
           }
-          deleteFolderData(this.formData).then(res => {
+          deleteTestPlan(caseData).then(res => {
             if (res.code === 200) {
               this.$message({ type: 'success', message: '已删除' })
               this.data1 = []
-              this.AllQueryFolderData(localStorage.getItem('key'))
+              this.AllQueryFolderData()
             } else {
               this.$message({ type: 'error', message: res.msg, duration: 1000 })
             }
@@ -460,27 +404,33 @@ export default {
 
     // 新增/编辑 提交
     caseCreateCase(vel, e) {
+      this.key_arr = []
       if (e === '编辑') {
-        console.log(vel)
-        // var query_data = {}
-        updateTestPlan(this.caseData).then(res => {
+        var caseData = vel
+        updateTestPlan(caseData).then(res => {
           this.$message({ message: res.msg, type: 'success', duration: 1000, offset: 150 })
           this.dialogFormVisibleUpdate = false
+          this.AllQueryFolderData()
         })
       }
-      if (vel !== '' && e === '新增') {
+      if (e === '新增') {
         this.$refs['caseData'].validate((valid) => {
           if (valid) {
-            this.caseData = vel
-            this.caseData.creator = this.userInformation
-            this.caseData.modifier = this.userInformation
-            this.caseData.caseFolderId = this.startId
-            this.caseData.bizId = this.bizJson
-            createTestPlan(this.caseData).then(res => {
+            caseData = {
+              caserojectType: vel.caserojectType,
+              testPlanName: vel.testPlanName,
+              taskType: vel.taskType,
+              projectId: vel.Parentids,
+              creator: this.userInformation,
+              modifier: this.userInformation,
+              taskId: vel.id,
+              bizId: this.bizJson
+            }
+            createTestPlan(caseData).then(res => {
               if (res.code === 200) {
-                this.gridData = res.data
                 this.$message({ message: res.msg, type: 'success', duration: 1000, offset: 150 })
                 this.dialogFormVisibleUpdate = false
+                this.AllQueryFolderData()
               } else {
                 this.$notify({ title: '提示', message: res.msg, duration: 2000 })
               }
@@ -488,11 +438,12 @@ export default {
           }
         })
       }
+      this.key_arr.push(vel.id)
     },
     // 查询
     queryCaseData(ele) {
-      if (this.createParticipation.caseName === '') return false
-      if (this.startId === '') {
+      if (this.createParticipation.testPlanName === '') return false
+      if (this.pegs !== '3') {
         this.$message({ message: '提示, 👈请选择目录', type: 'success', duration: 1000, offset: 150 })
       } else {
         this.createParticipation.testPlanId = this.startId
@@ -506,32 +457,12 @@ export default {
         })
       }
     },
-    // 查看
-    // queryGetShow(ele) {
-    //   if (this.startId === '') {
-    //     this.$message({ message: '提示, 👈请选择目录', type: 'success', duration: 1000, offset: 150 })
-    //   } else {
-    //     for (var vel of ele) {
-    //       var obj = vel
-    //     }
-    //     // if (obj.taskType === 2) { this.moduleTypeShow = true }
-    //     this.caseData = {}
-    //     this.caseData = obj
-    //   }
-    // },
-    // 编辑
-    // updateGetShow(ele) {
-    //   this.titleName = '编辑'
-    //   this.caseData = ele
-    //   // if (ele.taskType === 2) { this.moduleTypeShow = true }
-    //   this.dialogFormVisibleUpdate = true
-    // },
 
     // 新增
     createGetShow() {
       this.titleName = '新增'
       this.case_from = {}
-      if (this.startId === '') {
+      if (this.pegs !== '3') {
         this.$message({ message: '提示, 👈请选择目录', type: 'success', duration: 1000, offset: 150 })
       } else {
         this.dialogFormVisibleUpdateOne = true
@@ -566,34 +497,53 @@ export default {
     },
     // 改变case_one
     case_fromOne(e) {
-      queryCasesData({ pageSize: this.pageSize, curIndex: this.curIndex, caseFolderId: e }).then(res => {
-        this.grid_Data = res.data.list
-        this.total = res.data.total
-      })
-      for (var one of this.data2) {
-        if (one.id === e) {
-          this.case_two = one.children
-          if (this.case_two.length !== 0) {
-            this.caseShwo_two = true
-          } else {
-            this.caseShwo_two = false
+      if (e === '') {
+        this.caseShwo_two = false
+        this.$set(this.case_from, 'two', '')
+        this.caseShwo_three = false
+        this.$set(this.case_from, 'three', '')
+        this.caseShwo_four = false
+        this.$set(this.case_from, 'four', '')
+        this.grid_Data = []
+      } else {
+        queryCasesData({ pageSize: this.pageSize, curIndex: this.curIndex, caseFolderId: e }).then(res => {
+          this.grid_Data = res.data.list
+          this.total = res.data.total
+        })
+
+        for (var one of this.data2) {
+          if (one.id === e) {
+            this.case_two = one.children
+            if (this.case_two.length !== 0) {
+              this.caseShwo_two = true
+            } else {
+              this.caseShwo_two = false
+            }
           }
         }
       }
     },
     // 改变case_two
     case_fromTwo(e) {
-      queryCasesData({ pageSize: this.pageSize, curIndex: this.curIndex, caseFolderId: e }).then(res => {
-        this.grid_Data = res.data.list
-        this.total = res.data.total
-      })
-      for (var two of this.case_two) {
-        if (two.id === e) {
-          this.case_three = two.children
-          if (this.case_three.length !== 0) {
-            this.caseShwo_three = true
-          } else {
-            this.caseShwo_three = false
+      if (e === '') {
+        this.caseShwo_three = false
+        this.$set(this.case_from, 'three', '')
+        this.caseShwo_four = false
+        this.$set(this.case_from, 'four', '')
+        this.grid_Data = []
+      } else {
+        queryCasesData({ pageSize: this.pageSize, curIndex: this.curIndex, caseFolderId: e }).then(res => {
+          this.grid_Data = res.data.list
+          this.total = res.data.total
+        })
+        for (var two of this.case_two) {
+          if (two.id === e) {
+            this.case_three = two.children
+            if (this.case_three.length !== 0) {
+              this.caseShwo_three = true
+            } else {
+              this.caseShwo_three = false
+            }
           }
         }
       }
@@ -601,23 +551,30 @@ export default {
 
     // 改变case_three
     case_fromThree(e) {
-      queryCasesData({ pageSize: this.pageSize, curIndex: this.curIndex, caseFolderId: e }).then(res => {
-        this.grid_Data = res.data.list
-        this.total = res.data.total
-      })
-      for (var three of this.case_three) {
-        if (three.id === e) {
-          this.case_four = three.children
-          if (this.case_four.length !== 0) {
-            this.caseShwo_four = true
-          } else {
-            this.caseShwo_four = false
+      if (e === '') {
+        this.caseShwo_four = false
+        this.$set(this.case_from, 'four', '')
+        this.grid_Data = []
+      } else {
+        queryCasesData({ pageSize: this.pageSize, curIndex: this.curIndex, caseFolderId: e }).then(res => {
+          this.grid_Data = res.data.list
+          this.total = res.data.total
+        })
+        for (var three of this.case_three) {
+          if (three.id === e) {
+            this.case_four = three.children
+            if (this.case_four.length !== 0) {
+              this.caseShwo_four = true
+            } else {
+              this.caseShwo_four = false
+            }
           }
         }
       }
     },
     // 改变case_four
     case_fromFour(e) {
+      this.grid_Data = []
       queryCasesData({ pageSize: this.pageSize, curIndex: this.curIndex, caseFolderId: e }).then(res => {
         this.grid_Data = res.data.list
         this.total = res.data.total
@@ -627,37 +584,86 @@ export default {
     // 点击节点
     clickFun(e) {
       console.log(e)
+      this.pegs = ''
+      e.codes === '1' ? this.Parentids = e.id : ''
+      e.codes === '2' ? this.taskids = e.id : ''
+      if (e.codes === '3') {
+        this.pegs = '3'
+      }
       this.startId = e.id
       queryTestPlanCaseList({ pageSize: this.pageSize, curIndex: this.curIndex, testPlanId: e.id }).then(res => {
         this.gridData = []
         res.data.map(item => {
+          item.caseInfo.thrr = e.id
           item.caseInfo.ids = item.id
           item.caseInfo.status_case = item.status
           item.caseInfo.keys = item.status
           this.gridData.push(item.caseInfo)
         })
-        this.total = this.gridData.total
+        this.total = this.gridData.length
       })
       this.implement()
     },
 
-    Unclicked(e, index) {
+    Unclicked(e, index, ele) {
       this.gridData[index].keys = 1
+      updateTestPlanCase({ creator: this.userInformation, modifier: this.userInformation, id: ele.ids, status: 1, testPlanId: ele.thrr }).then(res => {
+        if (res.code === 200) {
+          this.$message({ message: res.msg, type: 'success', duration: 1000, offset: 150 })
+        } else {
+          this.$message({ message: res.msg, type: 'error', duration: 1000, offset: 150 })
+        }
+      })
     },
-    Unclicked2(e, index) {
+    Unclicked2(e, index, ele) {
       this.gridData[index].keys = 2
+      updateTestPlanCase({ creator: this.userInformation, modifier: this.userInformation, id: ele.ids, status: 2, testPlanId: ele.thrr }).then(res => {
+        if (res.code === 200) {
+          this.$message({ message: res.msg, type: 'success', duration: 1000, offset: 150 })
+        } else {
+          this.$message({ message: res.msg, type: 'error', duration: 1000, offset: 150 })
+        }
+      })
     },
-    Unclicked3(e, index) {
+    Unclicked3(e, index, ele) {
       this.gridData[index].keys = 3
+      updateTestPlanCase({ creator: this.userInformation, modifier: this.userInformation, id: ele.ids, status: 3, testPlanId: ele.thrr }).then(res => {
+        if (res.code === 200) {
+          this.$message({ message: res.msg, type: 'success', duration: 1000, offset: 150 })
+        } else {
+          this.$message({ message: res.msg, type: 'error', duration: 1000, offset: 150 })
+        }
+      })
     },
-    Unclicked4(e, index) {
+    Unclicked4(e, index, ele) {
       this.gridData[index].keys = 0
+      updateTestPlanCase({ creator: this.userInformation, modifier: this.userInformation, id: ele.ids, status: 0, testPlanId: ele.thrr }).then(res => {
+        if (res.code === 200) {
+          this.$message({ message: res.msg, type: 'success', duration: 1000, offset: 150 })
+        } else {
+          this.$message({ message: res.msg, type: 'error', duration: 1000, offset: 150 })
+        }
+      })
+    },
+
+    // 查询接口list
+    query_get(e) {
+      var data_status = { testPlanId: e, pageSize: this.pageSize, curIndex: this.curIndex }
+      queryTestPlanCaseList(data_status).then(res => {
+        this.gridData = []
+        res.data.map(item => {
+          item.caseInfo.ids = item.id
+          item.caseInfo.status_case = item.status
+          item.caseInfo.keys = item.status
+          this.gridData.push(item.caseInfo)
+        })
+        this.total = this.gridData.total
+      })
     },
 
     // 跳转bug页面
     go_Bug(e) {
-      console.log(e)
-      this.$router.push({ path: '/Platform/defectManagement/bugCreate', query: { id: e.testPlanId }})
+      this.$router.push({ path: '/Platform/defectManagement/bugCreate', query: { ids: e.ids, testPlanId: e.thrr }})
     },
 
     // 跳转查看页面
@@ -670,38 +676,33 @@ export default {
       passRateOfTestPlan({ testPlanId: this.startId }).then(res => {
         this.num = {
           Count1: res.data.successCount,
-          Rate1: res.data.successRate,
+          Rate1: Math.floor(res.data.successRate * 1000) / 1000,
           Count2: res.data.blockCount,
-          Rate2: res.data.blockRate,
+          Rate2: Math.floor(res.data.blockRate * 1000) / 1000,
           Count3: res.data.failCount,
-          Rate3: res.data.failRate,
+          Rate3: Math.floor(res.data.failRate * 1000) / 1000,
           Count4: res.data.defaultCount,
-          Rate4: res.data.defaultRate
+          Rate4: Math.floor(res.data.defaultRate * 1000) / 1000
         }
       })
     },
 
     // 删除table信息
     deleteCaseData(e) {
-      if (this.startId === '') {
-        this.$message({ message: '提示, 👈请选择目录', type: 'success', duration: 1000, offset: 150 })
-      } else {
-        this.$confirm('是否确认删除', '确认信息', {
-          distinguishCancelAndClose: true,
-          confirmButtonText: '确定',
-          cancelButtonText: '取消'
-        }).then(() => {
-          this.formData = { testPlanCaseId: e, operator: this.userInformation }
-          deleteTestPlanCase(this.formData).then(res => {
-            if (res.code === 200) {
-              this.$message({ type: 'success', message: '已删除' })
-              this.queryTestPlanCaseList(e)
-            } else {
-              this.$message({ message: res.msg, type: 'success', duration: 1000, offset: 150 })
-            }
-          })
-        }).catch(action => { this.$message({ message: '已取消', type: 'error', duration: 1000, offset: 150 }) })
-      }
+      this.$confirm('是否确认删除', '确认信息', {
+        distinguishCancelAndClose: true,
+        confirmButtonText: '确定',
+        cancelButtonText: '取消'
+      }).then(() => {
+        deleteTestPlanCase({ id: e.ids, modifier: this.userInformation }).then(res => {
+          if (res.code === 200) {
+            this.query_get(e.thrr)
+            this.$message({ type: 'success', message: '已删除' })
+          } else {
+            this.$message({ message: res.msg, type: 'success', duration: 1000, offset: 150 })
+          }
+        })
+      }).catch(action => { this.$message({ message: '已取消', type: 'error', duration: 1000, offset: 150 }) })
     }
   }
 }