mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-24 18:40:22 +08:00
parent
44f2b1c644
commit
5425dc241f
@ -61,7 +61,7 @@
|
||||
|
||||
<CardMeta>
|
||||
<template #title>
|
||||
<TypographyText :content="item.name" :ellipsis="{ tooltip: item.address }" />
|
||||
<TypographyParagraph :content="item.name" :ellipsis="{ tooltip: item.address }" />
|
||||
</template>
|
||||
<template #avatar>
|
||||
<Avatar :src="item.avatar" />
|
||||
@ -93,7 +93,7 @@
|
||||
|
||||
const ListItem = List.Item;
|
||||
const CardMeta = Card.Meta;
|
||||
const TypographyText = Typography.Text;
|
||||
const TypographyParagraph = Typography.Paragraph;
|
||||
// 获取slider属性
|
||||
const sliderProp = computed(() => useSlider(4));
|
||||
// 组件接收参数
|
||||
|
@ -94,9 +94,7 @@ export function useFormEvents({
|
||||
formModel[field] = defaultValueObj![field];
|
||||
});
|
||||
}
|
||||
const isInput = schema?.component && defaultValueComponents.includes(schema.component);
|
||||
const defaultValue = cloneDeep(defaultValueRef.value[key]);
|
||||
formModel[key] = isInput ? defaultValue || '' : defaultValue;
|
||||
formModel[key] = getDefaultValue(schema, defaultValueRef, key);
|
||||
});
|
||||
nextTick(() => clearValidate());
|
||||
|
||||
@ -407,3 +405,29 @@ export function useFormEvents({
|
||||
scrollToField,
|
||||
};
|
||||
}
|
||||
|
||||
function getDefaultValue(
|
||||
schema: FormSchema | undefined,
|
||||
defaultValueRef: UseFormActionContext['defaultValueRef'],
|
||||
key: string,
|
||||
) {
|
||||
let defaultValue = cloneDeep(defaultValueRef.value[key]);
|
||||
const isInput = checkIsInput(schema);
|
||||
if (isInput) {
|
||||
return defaultValue || '';
|
||||
}
|
||||
if (!defaultValue && schema && checkIsRangeSlider(schema)) {
|
||||
defaultValue = [0, 0];
|
||||
}
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
function checkIsRangeSlider(schema: FormSchema) {
|
||||
if (schema.component === 'Slider' && schema.componentProps && schema.componentProps.range) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function checkIsInput(schema?: FormSchema) {
|
||||
return schema?.component && defaultValueComponents.includes(schema.component);
|
||||
}
|
||||
|
@ -131,15 +131,16 @@
|
||||
}
|
||||
|
||||
.draggable-box {
|
||||
height: calc(100vh - 200px);
|
||||
// width: 100%;
|
||||
overflow: auto;
|
||||
|
||||
.drag-move {
|
||||
min-height: 62px;
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.list-main {
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
// 列表动画
|
||||
.list-enter-active {
|
||||
transition: all 0.5s;
|
||||
|
Loading…
Reference in New Issue
Block a user