<template>
	<div class="empty-container h100 w100">
		<!-- 无数据 -->
		<template v-if="props.type === 'data'">
			<el-empty :description="description ? description : descriptionData" :image="getImageUrl('public/empty.png')">
				<slot></slot>
			</el-empty>
		</template>
		<!-- 无文件夹 -->
		<template v-else-if="props.type === 'file'">
			<el-empty :description="description ? description : descriptionFile" :image="getImageUrl('public/fileEmpty.png')">
				<slot></slot>
			</el-empty>
		</template>
		<!-- 知识库为空 -->
		<template v-else-if="props.type === 'knowledge'">
			<el-empty :description="description ? description : descriptionKnowledge" :image="getImageUrl('public/NoKnowledge.png')">
				<slot></slot>
			</el-empty>
		</template>
		<!-- 无搜索结果 -->
		<template v-else-if="props.type === 'search'">
			<el-empty :description="description ? description : descriptionSearch" :image="getImageUrl('public/noSearch.png')">
				<slot></slot>
			</el-empty>
		</template>
		<!-- 无搜记录 -->
		<template v-else-if="props.type === 'record'">
			<el-empty :description="description ? description : descriptionRecord" :image="getImageUrl('public/noReocrd.png')">
				<slot></slot>
			</el-empty>
		</template>
		<!-- 无信件 -->
		<template v-else-if="props.type === 'letter'">
			<el-empty :description="description ? description : descriptionLetter" :image="getImageUrl('public/leeter.png')">
				<slot></slot>
			</el-empty>
		</template>
	</div>
</template>

<script lang="ts" name="emptyHotline" setup>
import { getImageUrl } from '/@/utils/tools';
// 定义父组件传过来的值
const props = defineProps({
	type: {
		required: false,
		type: String,
		default: 'data',
	},
	description: {
		required: false,
		type: String,
		default: '暂无数据',
	},
	descriptionData: {
		required: false,
		type: String,
		default: '暂无数据',
	},
	descriptionFile: {
		required: false,
		type: String,
		default: '文件夹空',
	},
	descriptionKnowledge: {
		required: false,
		type: String,
		default: '暂无知识库内容',
	},
	descriptionSearch: {
		required: false,
		type: String,
		default: '暂无结果',
	},
	descriptionRecord: {
		required: false,
		type: String,
		default: '暂无记录',
	},
	descriptionLetter: {
		required: false,
		type: String,
		default: '暂无信件',
	},
	hidden: {
		type: Boolean,
		default: false,
	},
});
</script>
