fix: 设备联调

This commit is contained in:
xuziqiang
2024-07-05 12:04:17 +08:00
parent 4bbb5c5133
commit 78d49ff16e
9 changed files with 313 additions and 56 deletions

View File

@@ -120,14 +120,8 @@
provide('addChildForm', addChildForm);
const getFormClass = computed(() => {
if (props.formLayout === 'flexVertical') {
return formConfig.formLayout.flexVertical;
}
if (props.formLayout === 'flex') {
return formConfig.formLayout.flex;
}
if (props.formLayout === 'flexv2') {
return formConfig.formLayout.flexv2;
if (props.formLayout) {
return formConfig.formLayout[props.formLayout as keyof typeof formConfig.formLayout];
}
return formConfig.formLayout.vertical;
});

View File

@@ -10,10 +10,10 @@
</div>
</div>
<div style="min-height: 300px">
<div style="min-height: 300px; overflow-y: scroll">
<ns-tree v-if="treeData?.length" v-bind="getBindValue" v-model:selectedKeys="selectedKeys">
<template #[item]="data" v-for="(item, index) in Object.keys($slots)" :key="index">
<slot :name="item" v-bind="data || {}"></slot>
<slot :name="item" v-bind="{ ...data, formModel } || {}"></slot>
</template>
</ns-tree>
<!-- <a-empty v-if="!treeData?.length" /> -->

View File

@@ -11,6 +11,17 @@ export const formConfig = {
gutter: [0, 0],
justify: 'space-around',
},
formVertical: {
layout: 'horizontal',
class: 'ns-vertical-form',
wrapperCol: { span: 24 },
labelCol: { span: 0 },
span: 24,
sm: null, //≥576px <=768
lg: null, //>= 768
gutter: [0, 0],
justify: 'space-around',
},
flex: {
// layout: 'horizontal',
class: 'ns-flex-form ns-flex-form-horizontal',