| | |
| | | </script> |
| | | |
| | | <template> |
| | | <div class="h-full"> |
| | | <div class="flex h-full flex-col overflow-hidden"> |
| | | <Input |
| | | v-model:value="filterText" |
| | | :placeholder="filterPlaceholder" |
| | | allow-clear |
| | | class="w-full" |
| | | class="w-full shrink-0" |
| | | > |
| | | <template #prefix> |
| | | <IconifyIcon class="size-4" icon="lucide:search" /> |
| | | </template> |
| | | </Input> |
| | | <Spin :spinning="loading" wrapper-class-name="w-full"> |
| | | <Tree |
| | | v-if="itemTypeTree.length > 0" |
| | | :default-expand-all="true" |
| | | :field-names="{ title: 'name', key: 'id', children: 'children' }" |
| | | :selected-keys="selectedKeys" |
| | | :tree-data="itemTypeTree" |
| | | class="pt-2" |
| | | @select="handleSelect" |
| | | /> |
| | | <div v-else-if="!loading" class="py-4 text-center text-gray-500"> |
| | | 暂无数据 |
| | | </div> |
| | | </Spin> |
| | | <div class="min-h-0 flex-1 overflow-y-auto pt-2"> |
| | | <Spin :spinning="loading" wrapper-class-name="w-full"> |
| | | <Tree |
| | | v-if="itemTypeTree.length > 0" |
| | | :default-expand-all="true" |
| | | :field-names="{ title: 'name', key: 'id', children: 'children' }" |
| | | :selected-keys="selectedKeys" |
| | | :tree-data="itemTypeTree" |
| | | @select="handleSelect" |
| | | /> |
| | | <div v-else-if="!loading" class="py-4 text-center text-gray-500"> |
| | | 暂无数据 |
| | | </div> |
| | | </Spin> |
| | | </div> |
| | | </div> |
| | | </template> |