fix(API数据源): 没有子项的字段置灰

This commit is contained in:
taojinlong 2022-09-27 16:18:57 +08:00
parent 888ca2307b
commit 106958327e
2 changed files with 9 additions and 0 deletions

View File

@ -197,6 +197,14 @@ public class ApiProvider extends Provider {
rootPath = "$";
handleStr(apiDefinition, response, fields, rootPath);
}
for (JSONObject field : fields) {
if(field.containsKey("children") && CollectionUtils.isNotEmpty(field.getJSONArray("children"))){
field.put("disabled", false);
}
if(field.containsKey("children") && CollectionUtils.isEmpty(field.getJSONArray("children"))){
field.put("disabled", true);
}
}
apiDefinition.setJsonFields(fields);
return apiDefinition;
}

View File

@ -513,6 +513,7 @@
<el-checkbox
:key="scope.row.jsonPath"
v-model="scope.row.checked"
:disabled="scope.row.disabled"
@change="handleCheckAllChange(scope.row)"
>
{{ scope.row.originName }}