diff --git a/framework/sdk-parent/frontend/src/utils/custom_field.js b/framework/sdk-parent/frontend/src/utils/custom_field.js index a53d061303..cf3a63de37 100644 --- a/framework/sdk-parent/frontend/src/utils/custom_field.js +++ b/framework/sdk-parent/frontend/src/utils/custom_field.js @@ -208,12 +208,7 @@ export function sortCustomFields(customFields) { // nothing } } - if (customFields[i].type === "richText") { - //循环到是0的位置就删除该元素0并且在arr末尾push进这个元素0,由于splice删除了该位置元素,所以i不用+1,下次循环仍然检查i位置的元素 - customFields.push(customFields.splice(i, 1)[0]); - } else { - i++; //循环到不是0的位置就继续往后循环 - } + i++; //循环到不是0的位置就继续往后循环 } return customFields; } diff --git a/project-management/backend/src/main/java/io/metersphere/base/mapper/ext/ExtCustomFieldTemplateMapper.xml b/project-management/backend/src/main/java/io/metersphere/base/mapper/ext/ExtCustomFieldTemplateMapper.xml index a2fe89266f..11de3a27bb 100644 --- a/project-management/backend/src/main/java/io/metersphere/base/mapper/ext/ExtCustomFieldTemplateMapper.xml +++ b/project-management/backend/src/main/java/io/metersphere/base/mapper/ext/ExtCustomFieldTemplateMapper.xml @@ -24,6 +24,7 @@ select id, field_id fieldId, template_id templateId, scene, required, `order`, default_value defaultValue, custom_data customData, `key` from custom_field_template where custom_field_template.template_id = #{templateId} + order by `order` asc