fix(schema): jsonSchema数组子级空参数值时预览问题修复&批量添加无效问题修复

This commit is contained in:
baiqi 2024-07-17 17:31:54 +08:00 committed by 刘瑞斌
parent 61e7e37530
commit 1fd7e09b1b
1 changed files with 3 additions and 6 deletions

View File

@ -942,6 +942,7 @@
const child = {
...cloneDeep(defaultItem),
id: getGenerateId(),
title: record.type === 'array' ? `${record.children.length}` : '',
parent: record,
};
record.children.push(child);
@ -1014,12 +1015,7 @@
const batchAddCodeEditorRef = ref<InstanceType<typeof MsCodeEditor>>();
const batchAddCurrentJson = ref('');
const batchAddCurrentSchema = ref('');
const batchAddValue = computed({
get: () => (batchAddType.value === 'json' ? batchAddCurrentJson.value : batchAddCurrentSchema.value),
set: (value) => {
return value;
},
});
const batchAddValue = ref(batchAddType.value === 'json' ? batchAddCurrentJson.value : batchAddCurrentSchema.value);
function handleBatchAddTypeChange(value: string | number | boolean) {
if (value === 'json') {
@ -1050,6 +1046,7 @@
// json schema json
const res = await convertJsonSchemaToJson(schema as JsonSchema);
batchAddCurrentJson.value = res;
handleBatchAddTypeChange(batchAddType.value);
} catch (error) {
// eslint-disable-next-line no-console
console.log(error);