From 553f674c21dc131ca1edc8557c5c173248ab494b Mon Sep 17 00:00:00 2001 From: taojinlong Date: Mon, 1 Aug 2022 16:18:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E6=BA=90):=20api=20?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E9=A2=84=E8=A7=88=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/dataease/provider/datasource/ApiProvider.java | 12 ++++++------ .../src/views/system/datasource/DsConfiguration.vue | 9 ++------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/backend/src/main/java/io/dataease/provider/datasource/ApiProvider.java b/backend/src/main/java/io/dataease/provider/datasource/ApiProvider.java index 9bd5ef02a1..e09e82f343 100644 --- a/backend/src/main/java/io/dataease/provider/datasource/ApiProvider.java +++ b/backend/src/main/java/io/dataease/provider/datasource/ApiProvider.java @@ -317,15 +317,15 @@ public class ApiProvider extends Provider { } } - static void mergeValue(JSONObject object, ApiDefinition apiDefinition, JSONObject item) { + static void mergeValue(JSONObject field, ApiDefinition apiDefinition, JSONObject item) { - JSONArray array = object.getJSONArray("value"); + JSONArray array = field.getJSONArray("value"); if (array != null && item.getString("value") != null && array.size() < apiDefinition.getPreviewNum()) { array.add(item.getJSONArray("value").get(0).toString()); - object.put("value", array); + field.put("value", array); } - if(object.getJSONArray("children") != null && item.getJSONArray("children") != null){ - JSONArray objectChildren = object.getJSONArray("children"); + if(CollectionUtils.isNotEmpty(field.getJSONArray("children"))&& CollectionUtils.isNotEmpty(item.getJSONArray("children"))){ + JSONArray objectChildren = field.getJSONArray("children"); JSONArray jsonArrayChildren = new JSONArray(); JSONArray itemChildren = item.getJSONArray("children"); for (Object objectChild : objectChildren) { @@ -338,7 +338,7 @@ public class ApiProvider extends Provider { } } } - object.put("children", jsonArrayChildren); + field.put("children", jsonArrayChildren); } } diff --git a/frontend/src/views/system/datasource/DsConfiguration.vue b/frontend/src/views/system/datasource/DsConfiguration.vue index 3c2a79f108..016b6fea30 100644 --- a/frontend/src/views/system/datasource/DsConfiguration.vue +++ b/frontend/src/views/system/datasource/DsConfiguration.vue @@ -676,13 +676,7 @@ export default { required: true, message: i18n.t("datasource.input_name"), trigger: "blur", - }, - { - min: 2, - max: 25, - message: i18n.t("datasource.input_limit_2_25", [2, 25]), - trigger: "blur", - }, + } ], desc: [ { @@ -938,6 +932,7 @@ export default { return; } this.$refs.apiItem.validate((valid) => { + console.log(valid) if (valid) { const data = JSON.parse(JSON.stringify(this.apiItem)); this.loading = true;