diff --git a/src/components/common/CoiEmpty.vue b/src/components/common/CoiEmpty.vue
index 207be03..543b682 100644
--- a/src/components/common/CoiEmpty.vue
+++ b/src/components/common/CoiEmpty.vue
@@ -5,7 +5,12 @@
@@ -30,9 +35,10 @@
class="coi-empty__action-btn"
@click="handleAction"
>
-
+
-
+
+
{{ actionText }}
@@ -65,7 +71,6 @@ export interface CoiEmptyProps {
actionText?: string
actionType?: 'default' | 'primary' | 'info' | 'success' | 'warning' | 'error'
actionSize?: 'tiny' | 'small' | 'medium' | 'large'
- actionIcon?: any
size?: 'small' | 'medium' | 'large'
}
@@ -84,7 +89,6 @@ const props = withDefaults(defineProps(), {
actionText: '',
actionType: 'primary',
actionSize: 'medium',
- actionIcon: undefined,
size: 'medium',
})
@@ -95,37 +99,27 @@ const typeConfigs = {
default: {
title: '暂无数据',
description: '当前没有可显示的数据',
- icon: 'icon-park-outline:inbox',
},
search: {
title: '搜索无结果',
description: '未找到符合条件的数据,请尝试调整搜索条件',
- icon: 'icon-park-outline:search',
},
network: {
title: '网络异常',
description: '网络连接出现问题,请检查网络连接后重试',
- icon: 'icon-park-outline:wifi-error',
},
permission: {
title: '暂无权限',
description: '您没有访问此内容的权限,请联系管理员',
- icon: 'icon-park-outline:lock',
},
custom: {
title: '自定义状态',
description: '这是一个自定义的空状态',
- icon: 'icon-park-outline:folder-close',
},
}
-// 计算图标组件
-const iconComponent = computed(() => {
- if (props.icon) {
- return props.icon
- }
- return typeConfigs[props.type].icon
-})
+// 当前类型
+const currentType = computed(() => props.type)
// 计算标题
const title = computed(() => {
@@ -170,17 +164,6 @@ const actionButtonSize = computed(() => {
return sizeMap[props.size] as any
})
-const actionIconComponent = computed(() => {
- if (props.actionIcon) {
- return props.actionIcon
- }
- // 如果没有传入操作图标,根据类型返回默认图标
- if (props.type === 'search') {
- return 'icon-park-outline:refresh'
- }
- return 'icon-park-outline:plus'
-})
-
// 处理操作按钮点击
function handleAction() {
emit('action')