|
@@ -81,11 +81,7 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="返回值data类型" prop="returnDataType">
|
|
|
-<<<<<<< HEAD
|
|
|
- <el-select v-model="serviceData.returnDataTypeStr" :disabled="shouldShow" class="filter-item" filterable clearable placeholder="默认string类型" @change="clickdDtaChange(serviceData.returnDataTypeStr)">
|
|
|
-=======
|
|
|
<el-select v-model="serviceData.returnDataTypeStr" :disabled="shouldShow" class="filter-item" filterable clearable placeholder="data类型">
|
|
|
->>>>>>> http_mock
|
|
|
<el-option v-for="item in envSelectDataType" :key="item.code" :label="item.msg" :value="item.code" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -101,41 +97,6 @@
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogFormVisible = false">取消</el-button>
|
|
|
<el-button v-if="showSubmitBtn" type="primary" @click="dialogStatus==='create'?createData(serviceData):updateData(serviceData)">确定</el-button>
|
|
|
-<<<<<<< HEAD
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
- <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible1" width="65%">
|
|
|
- <el-form ref="serviceDataForms" :rules="serviceDataRules" :model="serviceData" label-position="left" label-width="120px" style="width: 500px; margin-left:80px;">
|
|
|
- <el-form-item label="接口名称" prop="customName">
|
|
|
- <el-input v-model="serviceData.customName" :disabled="shouldShow" placeholder="接口名称" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="url" prop="url">
|
|
|
- <el-input v-model="serviceData.url" :disabled="shouldShow" placeholder="url" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="method" prop="method">
|
|
|
- <el-select v-model="serviceData.method" :disabled="shouldShow" class="filter-item" filterable clearable placeholder="method">
|
|
|
- <el-option v-for="item in envMethod" :key="item.str" :label="item.str" :value="item.str" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="返回值data类型" prop="returnDataType">
|
|
|
- <el-select v-model="serviceData.returnDataTypeStr" :disabled="shouldShow" class="filter-item" filterable clearable placeholder="默认string类型">
|
|
|
- <el-option v-for="item in envSelectDataType" :key="item.code" :label="item.msg" :value="item.code" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="真实服务url" prop="actualUrl">
|
|
|
- <el-input v-model="serviceData.actualUrl" :disabled="shouldShow" placeholder="真实服务url" />
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <span class="showBtn" @mouseover="explain" @mouseout="explain">配置指南</span>
|
|
|
- <div v-if="showexplain" class="showInfo">
|
|
|
- <div class="showZm" />
|
|
|
- <div class="showInfo">配置指南</div>
|
|
|
- </div>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="dialogFormVisible1 = false">取消</el-button>
|
|
|
- <el-button v-if="showSubmitBtn" type="primary" @click="createData1(serviceData)">确定</el-button>
|
|
|
-=======
|
|
|
->>>>>>> http_mock
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<el-dialog :visible.sync="dialogPvVisible" title="Reading statistics">
|
|
@@ -241,7 +202,6 @@ export default {
|
|
|
serviceDataExt: {
|
|
|
id: 0
|
|
|
},
|
|
|
- dialogFormVisible1: false,
|
|
|
dialogFormVisible: false,
|
|
|
dialogStatus: '',
|
|
|
textMap: {
|
|
@@ -255,8 +215,7 @@ export default {
|
|
|
url: [{ required: true, message: 'url不能为空', trigger: 'change' }],
|
|
|
method: [{ required: true, message: 'method不能为空', trigger: 'change' }]
|
|
|
},
|
|
|
- downloadLoading: false,
|
|
|
- getClickData: ''
|
|
|
+ downloadLoading: false
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -299,10 +258,6 @@ export default {
|
|
|
getMethod(val) {
|
|
|
this.listQuery.method = val
|
|
|
},
|
|
|
- clickdDtaChange(e) {
|
|
|
- console.log(e)
|
|
|
- this.getClickData = e
|
|
|
- },
|
|
|
// 获取data数据
|
|
|
mockDataTypes() {
|
|
|
this.envSelectDataType = []
|
|
@@ -379,11 +334,7 @@ export default {
|
|
|
if (valid) {
|
|
|
this.serviceData = ele
|
|
|
this.serviceData.id = ''
|
|
|
-<<<<<<< HEAD
|
|
|
- if (ele.returnDataTypeStr !== '') { this.serviceData.returnDataType = ele.returnDataTypeStr } else { this.serviceData.returnDataType = '128' }
|
|
|
-=======
|
|
|
this.serviceData.returnDataType === '' ? this.serviceData.returnDataType = '512' : this.serviceData.returnDataType = ele.returnDataTypeStr
|
|
|
->>>>>>> http_mock
|
|
|
createService(this.serviceData).then(response => {
|
|
|
if (response.code === 200) {
|
|
|
this.dialogFormVisible = false
|
|
@@ -391,27 +342,6 @@ export default {
|
|
|
this.$notify({ title: 'Success', message: response.msg, type: 'success', duration: 10000 })
|
|
|
} else {
|
|
|
this.$notify({ title: 'Failed', message: response.msg, type: 'error', duration: 10000 })
|
|
|
-<<<<<<< HEAD
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- createData1(ele) {
|
|
|
- this.$refs['serviceDataForms'].validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- this.serviceData = ele
|
|
|
- this.serviceData.id = ''
|
|
|
- this.serviceData.returnDataType = ele.returnDataType
|
|
|
- createService(this.serviceData).then(response => {
|
|
|
- if (response.code === 200) {
|
|
|
- this.dialogFormVisible1 = false
|
|
|
- this.getList()
|
|
|
- this.$notify({ title: 'Success', message: response.msg, type: 'success', duration: 10000 })
|
|
|
- } else {
|
|
|
- this.$notify({ title: 'Failed', message: response.msg, type: 'error', duration: 10000 })
|
|
|
-=======
|
|
|
->>>>>>> http_mock
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -419,16 +349,6 @@ export default {
|
|
|
},
|
|
|
// 编辑
|
|
|
handleUpdate(row) {
|
|
|
-<<<<<<< HEAD
|
|
|
- this.getClickData = row.returnDataType
|
|
|
- this.shouldShow = false
|
|
|
- this.serviceData = row
|
|
|
- this.dialogStatus = 'update'
|
|
|
- this.dialogFormVisible = true
|
|
|
- this.showSubmitBtn = true
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs['serviceDataForms'].clearValidate()
|
|
|
-=======
|
|
|
var queryData = {
|
|
|
id: row.id,
|
|
|
url: row.url,
|
|
@@ -461,21 +381,12 @@ export default {
|
|
|
this.$refs['serviceDataForms'].clearValidate()
|
|
|
})
|
|
|
}
|
|
|
->>>>>>> http_mock
|
|
|
})
|
|
|
},
|
|
|
// 查看
|
|
|
handleCheck(row) {
|
|
|
this.shouldShow = true
|
|
|
this.serviceData = row
|
|
|
-<<<<<<< HEAD
|
|
|
- this.dialogStatus = 'update'
|
|
|
- this.dialogFormVisible = true
|
|
|
- this.showSubmitBtn = false
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs['serviceDataForms'].clearValidate()
|
|
|
- })
|
|
|
-=======
|
|
|
// var queryData = { id: row.id }
|
|
|
// fetchServiceList(queryData).then(response => {
|
|
|
// var rowData = response.data.mockMethodList
|
|
@@ -497,42 +408,10 @@ export default {
|
|
|
// this.$refs['serviceDataForms'].clearValidate()
|
|
|
// })
|
|
|
// })
|
|
|
->>>>>>> http_mock
|
|
|
},
|
|
|
// 复制
|
|
|
handleCopy(row) {
|
|
|
this.serviceData = row
|
|
|
-<<<<<<< HEAD
|
|
|
- this.shouldShow = false
|
|
|
- this.dialogStatus = 'create'
|
|
|
- this.dialogFormVisible1 = true
|
|
|
- this.showSubmitBtn = true
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs['serviceDataForms'].clearValidate()
|
|
|
- })
|
|
|
- },
|
|
|
- updateData(ele) {
|
|
|
- console.log(ele)
|
|
|
- var tempData = {
|
|
|
- id: this.serviceData.id,
|
|
|
- customName: this.serviceData.customName,
|
|
|
- url: this.serviceData.url,
|
|
|
- envChannel: this.serviceData.envChannel,
|
|
|
- method: ele.method,
|
|
|
- actualUrl: this.serviceData.actualUrl,
|
|
|
- status: this.serviceData.status,
|
|
|
- creator: this.serviceData.creator,
|
|
|
- returnDataType: this.getClickData,
|
|
|
- mockUrl: this.serviceData.mockUrl
|
|
|
- }
|
|
|
- updateService(tempData).then(response => {
|
|
|
- if (response.code === 200) {
|
|
|
- this.dialogFormVisible = false
|
|
|
- this.getList()
|
|
|
- this.$notify({ title: 'Success', message: response.msg, type: 'success', duration: 2000 })
|
|
|
- } else {
|
|
|
- this.$notify({ title: 'Failed', message: response.msg, type: 'error', duration: 2000 })
|
|
|
-=======
|
|
|
// var queryData = { id: row.id }
|
|
|
this.shouldShow = false
|
|
|
// changeCopy(queryData.id).then(response => {
|
|
@@ -578,7 +457,6 @@ export default {
|
|
|
this.$notify({ title: 'Failed', message: response.msg, type: 'error', duration: 2000 })
|
|
|
}
|
|
|
})
|
|
|
->>>>>>> http_mock
|
|
|
}
|
|
|
})
|
|
|
},
|