82 lines
1.6 KiB
Plaintext
82 lines
1.6 KiB
Plaintext
<template>
|
|
<view class="workspace-view">
|
|
<!-- Section header -->
|
|
<view class="workspace-view__header">
|
|
<text class="workspace-view__header-icon">📂</text>
|
|
<text class="workspace-view__header-title">工作空间</text>
|
|
</view>
|
|
|
|
<!-- Empty state -->
|
|
<view v-if="items.length === 0" class="workspace-view__empty">
|
|
<text class="workspace-view__empty-text">暂无工作结果</text>
|
|
</view>
|
|
|
|
<!-- Items list -->
|
|
<view v-else class="workspace-view__items">
|
|
<WorkspaceItem
|
|
v-for="item in items"
|
|
:key="item.id"
|
|
:item="item"
|
|
@tap="onSelect(item.id)"
|
|
/>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script setup lang="uts">
|
|
import type { WorkspaceItem } from '@/types/index'
|
|
import WorkspaceItemComponent from './WorkspaceItem.uvue'
|
|
|
|
const props = defineProps<{
|
|
items: WorkspaceItem[]
|
|
}>()
|
|
|
|
const emit = defineEmits<{
|
|
select: [id: string]
|
|
}>()
|
|
|
|
function onSelect(id: string): void {
|
|
emit('select', id)
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.workspace-view {
|
|
padding: 16rpx 0;
|
|
}
|
|
|
|
.workspace-view__header {
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
padding: 16rpx 24rpx 4rpx;
|
|
}
|
|
|
|
.workspace-view__header-icon {
|
|
font-size: 28rpx;
|
|
margin-right: 10rpx;
|
|
}
|
|
|
|
.workspace-view__header-title {
|
|
font-size: 28rpx;
|
|
font-weight: 600;
|
|
color: rgba(255, 255, 255, 0.7);
|
|
}
|
|
|
|
/* Empty */
|
|
.workspace-view__empty {
|
|
padding: 40rpx 24rpx;
|
|
text-align: center;
|
|
}
|
|
|
|
.workspace-view__empty-text {
|
|
font-size: 24rpx;
|
|
color: rgba(255, 255, 255, 0.3);
|
|
}
|
|
|
|
/* Items */
|
|
.workspace-view__items {
|
|
padding: 8rpx 24rpx;
|
|
}
|
|
</style>
|