|
@ -1,22 +1,24 @@ |
|
|
<template> |
|
|
<template> |
|
|
<a-spin :spinning="treeState.loading"> |
|
|
<a-spin :spinning="treeState.loading"> |
|
|
<div class="ns-tree-form"> |
|
|
<div class="ns-tree-container"> |
|
|
<div v-if="header" class="ns-tree-title"> |
|
|
<div class="ns-tree-form"> |
|
|
<ns-icon :name="header.icon" size="14" /> |
|
|
<div v-if="header" class="ns-tree-title"> |
|
|
<span>{{ header.title }}</span> |
|
|
<ns-icon :name="header.icon" size="14" /> |
|
|
|
|
|
<span>{{ header.title }}</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div v-if="!formConfig?.schema"> |
|
|
|
|
|
<ns-form ref="formElRef" v-bind="formConfig" :model="formModel" @finish="formFinish" /> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div v-if="!formConfig?.schema"> |
|
|
|
|
|
<ns-form ref="formElRef" v-bind="formConfig" :model="formModel" @finish="formFinish" /> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div style="min-height: 150px; overflow-y: scroll"> |
|
|
<div style="min-height: 150px"> |
|
|
<ns-tree v-if="treeData?.length" v-bind="getBindValue" v-model:selectedKeys="selectedKeys"> |
|
|
<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"> |
|
|
<template #[item]="data" v-for="(item, index) in Object.keys($slots)" :key="index"> |
|
|
<slot :name="item" v-bind="{ ...data, formModel } || {}"></slot> |
|
|
<slot :name="item" v-bind="{ ...data, formModel } || {}"></slot> |
|
|
</template> |
|
|
</template> |
|
|
</ns-tree> |
|
|
</ns-tree> |
|
|
<!-- <a-empty v-if="!treeData?.length" /> --> |
|
|
<!-- <a-empty v-if="!treeData?.length" /> --> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</a-spin> |
|
|
</a-spin> |
|
|
</template> |
|
|
</template> |
|
@ -150,4 +152,12 @@ |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.ns-tree-container { |
|
|
|
|
|
display: flex; |
|
|
|
|
|
flex-direction: column; |
|
|
|
|
|
&:last-child { |
|
|
|
|
|
flex: 1; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
</style> |
|
|
</style> |
|
|