添加回复默认值,和错误参数兼容

dev
RogerWork 4 months ago
parent 16ac0df5b6
commit 97eb387f10
  1. 14
      src/components/ec_api/TabArea.vue

@ -98,6 +98,8 @@ function initApiData() {
if (param_item['param'] === 'pid') { if (param_item['param'] === 'pid') {
param_item['value'] = UserApiData.value['base_info']['channel'] param_item['value'] = UserApiData.value['base_info']['channel']
} }
//
param_item['default'] = param_item['value']
} }
) )
}) })
@ -120,6 +122,16 @@ function addNewParams() {
}) })
} }
//
function loadDefault(param) {
console.log(param)
UserApiData.value.api[activeTab.value]['params'].forEach( p => {
if (p['param'] === param) {
p['value'] = p['default']
}
})
}
// url // url
function handle_request_data() { function handle_request_data() {
let data = {} let data = {}
@ -254,7 +266,7 @@ onMounted(() => {
</el-table-column> </el-table-column>
<el-table-column label="重置" width="80"> <el-table-column label="重置" width="80">
<template v-slot="scope"> <template v-slot="scope">
<el-button @click="test"> <el-button @click="loadDefault(scope.row.param)">
<el-icon> <el-icon>
<Refresh/> <Refresh/>
</el-icon> </el-icon>

Loading…
Cancel
Save