浏览代码

补充httpmock修改

longliang_v 5 年之前
父节点
当前提交
12601b2753
共有 2 个文件被更改,包括 27 次插入17 次删除
  1. 15 7
      src/views/mock/httpmock.vue
  2. 12 10
      src/views/mock/httprule.vue

+ 15 - 7
src/views/mock/httpmock.vue

@@ -176,7 +176,8 @@ export default {
         curIndex: 1,
         pageSize: 20,
         sort: '+id',
-        id: null
+        id: null,
+        redirect: ''
       },
       importanceOptions: [1, 2, 3],
       envSelectDataType: '',
@@ -396,9 +397,10 @@ export default {
           this.serviceData.method = rowList.method
           this.serviceData.returnDataTypeStr = rowList.returnDataTypeStr
           this.serviceData.mockUrl = rowList.mockUrl
-          this.serviceData.redirect === response.data.redirect
-          console.log(this.serviceData.redirect + 'aaa')
-          if (this.serviceData.redirect === '1') { this.serviceData.requestForWard = true } else { this.serviceData.requestForWard = false }
+          this.serviceData.redirect = row.redirect
+          if (this.serviceData.redirect === 1) { this.serviceData.requestForWard = true } else { this.serviceData.requestForWard = false }
+          this.serviceData.actualUrl = row.actualUrl
+          this.showTrueUrl()
           this.dialogStatus = 'update'
           this.dialogFormVisible = true
           this.showSubmitBtn = true
@@ -412,7 +414,7 @@ export default {
     // 查看
     handleCheck(row) {
       this.shouldShow = true
-      this.serviceData = row
+      // this.serviceData = row
       // var queryData = { id: row.id }
       // fetchServiceList(queryData).then(response => {
       // var rowData = response.data.mockMethodList
@@ -430,8 +432,12 @@ export default {
       this.dialogStatus = 'update'
       this.dialogFormVisible = true
       this.showSubmitBtn = false
+      // this.serviceData.redirect = 1
       this.serviceData.redirect = row.redirect
-      this.serviceData.requestForWard === 'true' ? this.serviceData.redirect === 1 : this.serviceData.redirect
+      if (this.serviceData.redirect === 1) { this.serviceData.requestForWard = true } else { this.serviceData.requestForWard = false }
+      this.serviceData.actualUrl = row.actualUrl
+      this.showTrueUrl()
+      // this.serviceData.requestForWard === 'true' ? this.serviceData.redirect === 1 : this.serviceData.redirect
       // this.$nextTick(() => {
       //   this.$refs['serviceDataForms'].clearValidate()
       // })
@@ -456,7 +462,9 @@ export default {
       this.dialogFormVisible = true
       this.showSubmitBtn = true
       this.serviceData.redirect = row.redirect
-      this.serviceData.requestForWard === 'true' ? this.serviceData.redirect === 1 : this.serviceData.redirect
+      if (this.serviceData.redirect === 1) { this.serviceData.requestForWard = true } else { this.serviceData.requestForWard = false }
+      this.serviceData.actualUrl = row.actualUrl
+      this.showTrueUrl()
       // this.$nextTick(() => {
       //   this.$refs['serviceDataForms'].clearValidate()
       // })

+ 12 - 10
src/views/mock/httprule.vue

@@ -38,10 +38,10 @@
           <span>{{ scope.row.id }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="规则描述" prop="id" sortable="custom" align="center" min-width="80px">
+      <el-table-column label="规则描述" prop="desc" sortable="custom" align="center" min-width="80px">
         <template slot-scope="scope">
           <span v-show="desc">{{ scope.row.ruleDesc|lengthFilter }}</span>
-          <!--<span v-show="listQuery.ruleDescSeen">{{ scope.row.ruleDesc}}</span>-->
+          <!--<span v-show="listQuery.ruleDescSeen" @mouseleave="descLeave">{{ scope.row.ruleDesc}}</span>-->
         </template>
       </el-table-column>
       <el-table-column label="接口ID" min-width="80px" align="center">
@@ -203,7 +203,7 @@ export default {
         methodName: '',
         methodProtocol: 'http',
         ruleDesc: '',
-        ruleDescSeen: ''
+        ruleDescSeen: false
       },
       showSubmit: true,
       jsonTit: `{ 'code': 200, 'data': { 'crowdComposition': 'U_866', 'campaignId': 789, 'id': 4606, 'class': 'com.didi.prado.config.api.dto.CampaignCrowdDTO'}}`,
@@ -497,14 +497,16 @@ export default {
           this.$refs['ruleDataForm'].clearValidate()
         })
       })
+    },
+    descEnter(index, row) {
+      console.log(index, row + 'sss')
+      this.listQuery.ruleDescSeen = true
+      this.desc = false
+    },
+    descLeave(row) {
+      this.listQuery.ruleDescSeen = false
+      this.desc = true
     }
-    // descEnter() {
-    //   console.log('1111')
-    //   this.listQuery.ruleDescSeen = true
-    // },
-    // descLeave() {
-    //   this.listQuery.ruleDescSeen = false
-    // }
   }
 }
 </script>