qinzhipeng_v 5 年之前
父节点
当前提交
f2de0a24db
共有 2 个文件被更改,包括 12 次插入4 次删除
  1. 6 3
      src/views/Platform/testPage.vue
  2. 6 1
      src/views/Platform/useCasePage.vue

+ 6 - 3
src/views/Platform/testPage.vue

@@ -10,9 +10,7 @@
               <br>
               <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)">
-                  <!-- <el-tooltip class="item" effect="dark" :content="data.label" placement="right"> -->
                   <span :title="data.label" class="span_el">{{ node.label }}</span>
-                  <!-- </el-tooltip> -->
                   <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" />
@@ -39,7 +37,6 @@
                   </el-select>
                   <el-button type="primary" @click="queryCaseData(test_plan)">查询</el-button>
                   <el-button type="primary" style="margin: 3% 2%" @click="createGetShow">新增</el-button>
-                  <!-- <el-button @click="implement">执行结果</el-button> -->
                 </el-col>
               </el-row>
             </el-header>
@@ -367,6 +364,7 @@ export default {
         cancelButtonText: '取消'
       })
         .then(() => {
+          this.key_arr = []
           var caseData = {
             projectId: data.projectId,
             modifier: this.userInformation,
@@ -379,6 +377,7 @@ export default {
               this.$message({ type: 'success', message: '已删除' })
               this.data1 = []
               this.AllQueryFolderData()
+              this.key_arr.push(this.startId)
             } else {
               this.$message({ type: 'error', message: res.msg, duration: 1000 })
             }
@@ -431,6 +430,7 @@ export default {
           this.$message({ message: res.msg, type: 'success', duration: 1000, offset: 150 })
           this.dialogFormVisibleUpdate = false
           this.AllQueryFolderData()
+          this.key_arr.push(this.startId)
         })
       }
       if (e === '新增') {
@@ -451,6 +451,7 @@ export default {
                 this.$message({ message: res.msg, type: 'success', duration: 1000, offset: 150 })
                 this.dialogFormVisibleUpdate = false
                 this.AllQueryFolderData()
+                this.key_arr.push(this.startId)
               } else {
                 this.$notify({ title: '提示', message: res.msg, duration: 2000 })
               }
@@ -477,6 +478,7 @@ export default {
             item.caseInfo.ids = item.id
             item.caseInfo.status_case = item.status
             item.caseInfo.keys = item.status
+            item.caseInfo.thrr = this.startId
             this.gridData.push(item.caseInfo)
           })
           this.total = res.data.length
@@ -654,6 +656,7 @@ export default {
       updateTestPlanCase({ creator: this.userInformation, modifier: this.userInformation, id: ele.ids, status: 3, testPlanId: ele.thrr }).then(res => { this.implement() })
     },
     Unclicked4(e, index, ele) {
+      console.log(ele)
       this.gridData[index].keys = 0
       updateTestPlanCase({ creator: this.userInformation, modifier: this.userInformation, id: ele.ids, status: 0, testPlanId: ele.thrr }).then(res => { this.implement() })
     },

+ 6 - 1
src/views/Platform/useCasePage.vue

@@ -291,8 +291,8 @@ export default {
         modifier: this.userInformation
       }
       createFolderData(this.formData).then(res => {
-        console.log(res.data)
         if (res.code === 200) {
+          this.key_arr = []
           const newChild = { id: res.data, label: '新建子节点', children: [] }
           if (!data.children) {
             this.$set(data, 'children', [])
@@ -312,6 +312,7 @@ export default {
 
     // 更新节点
     queryNodeName(val, data) {
+      this.key_arr = []
       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 }
@@ -325,6 +326,7 @@ export default {
           this.$message({ type: 'success', message: res.msg, duration: 1000 })
           this.data1 = []
           this.AllQueryFolderData(localStorage.getItem('key'))
+          this.key_arr.push(this.startId)
         } else {
           this.$message({ type: 'error', message: res.msg, duration: 1000 })
           this.data1 = []
@@ -506,6 +508,7 @@ export default {
         cancelButtonText: '取消'
       })
         .then(() => {
+          this.key_arr = []
           this.formData = {
             id: node.data.id,
             modifier: node.data.id
@@ -515,6 +518,7 @@ export default {
               this.$message({ type: 'success', message: '已删除' })
               this.data1 = []
               this.AllQueryFolderData(localStorage.getItem('key'))
+              this.key_arr.push(this.startId)
             } else {
               this.$message({ type: 'error', message: res.msg, duration: 1000 })
             }
@@ -746,6 +750,7 @@ export default {
         } else {
           this.$refs.im_File.click()
         }
+        if (this.grid_xmind.length === null) { this.$refs.im_File.click() }
       }
     },