fix: schema允许清除格式化选项&卡片组件去除返回

This commit is contained in:
baiqi 2024-07-16 15:26:24 +08:00 committed by 刘瑞斌
parent 72542e9cc7
commit be52233bc2
2 changed files with 11 additions and 5 deletions

View File

@ -14,7 +14,6 @@
> >
<a-scrollbar v-if="!props.simple" :style="{ overflow: 'auto' }"> <a-scrollbar v-if="!props.simple" :style="{ overflow: 'auto' }">
<div class="ms-card-header" :style="props.headerMinWidth ? { minWidth: `${props.headerMinWidth}px` } : {}"> <div class="ms-card-header" :style="props.headerMinWidth ? { minWidth: `${props.headerMinWidth}px` } : {}">
<div v-if="!props.hideBack" class="back-btn" @click="back"><icon-arrow-left /></div>
<slot name="headerLeft"> <slot name="headerLeft">
<div class="font-medium text-[var(--color-text-000)]">{{ props.title }}</div> <div class="font-medium text-[var(--color-text-000)]">{{ props.title }}</div>
<div class="text-[var(--color-text-4)]">{{ props.subTitle }}</div> <div class="text-[var(--color-text-4)]">{{ props.subTitle }}</div>
@ -56,9 +55,9 @@
</div> </div>
<slot name="footerRight"> <slot name="footerRight">
<div class="flex justify-end gap-[16px]"> <div class="flex justify-end gap-[16px]">
<a-button :disabled="props.loading" type="secondary" @click="back">{{ <a-button :disabled="props.loading" type="secondary" @click="back">
t('mscard.defaultCancelText') {{ t('mscard.defaultCancelText') }}
}}</a-button> </a-button>
<a-button <a-button
v-if="!props.hideContinue && !props.isEdit" v-if="!props.hideContinue && !props.isEdit"
:loading="props.loading" :loading="props.loading"

View File

@ -252,6 +252,7 @@
v-model:model-value="record.format" v-model:model-value="record.format"
:options="formatOptions" :options="formatOptions"
:disabled="props.disabled" :disabled="props.disabled"
allow-clear
class="ms-form-table-input" class="ms-form-table-input"
@change="emitChange('enumValuesInput')" @change="emitChange('enumValuesInput')"
></a-select> ></a-select>
@ -460,6 +461,7 @@
v-model:model-value="activeRecord.format" v-model:model-value="activeRecord.format"
:placeholder="t('common.pleaseSelect')" :placeholder="t('common.pleaseSelect')"
:options="formatOptions" :options="formatOptions"
allow-clear
@change="handleSettingFormChange" @change="handleSettingFormChange"
/> />
</a-form-item> </a-form-item>
@ -896,6 +898,11 @@
// //
record.children = []; record.children = [];
} }
if (record.type === 'array') {
record.children.forEach((e, i) => {
e.title = `${i}`;
});
}
} else { } else {
record.children = undefined; record.children = undefined;
} }
@ -1046,7 +1053,7 @@
async function validRepeat(value: string, callback: (error?: string) => void) { async function validRepeat(value: string, callback: (error?: string) => void) {
if (activeRecord.value.parent) { if (activeRecord.value.parent) {
(activeRecord.value.parent.children as Record<string, any>[])?.forEach((row) => { (activeRecord.value.parent.children as Record<string, any>[])?.forEach((row) => {
if (row.title.length && row.title === value) { if (row.title.length && row.title === value && row.id !== activeRecord.value.id) {
callback(`${t('ms.json.schema.name')}${t('msFormTable.paramRepeatMessage')}`); callback(`${t('ms.json.schema.name')}${t('msFormTable.paramRepeatMessage')}`);
} }
}); });