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' }">
<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">
<div class="font-medium text-[var(--color-text-000)]">{{ props.title }}</div>
<div class="text-[var(--color-text-4)]">{{ props.subTitle }}</div>
@ -56,9 +55,9 @@
</div>
<slot name="footerRight">
<div class="flex justify-end gap-[16px]">
<a-button :disabled="props.loading" type="secondary" @click="back">{{
t('mscard.defaultCancelText')
}}</a-button>
<a-button :disabled="props.loading" type="secondary" @click="back">
{{ t('mscard.defaultCancelText') }}
</a-button>
<a-button
v-if="!props.hideContinue && !props.isEdit"
:loading="props.loading"

View File

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