<template>
	<div class="quick-entry">
		<div class="quick-entry-title">{{ t('workbench.quickEntry.title') }}</div>
		<div class="quick-entry-grid">
			<div v-for="(item, index) in entryList" :key="index" class="quick-entry-item" @click="handleClick(item)">
				<img :src="item.icon" alt="" width="54" height="54" />
				<span class="entry-label">{{ t(item.label) }}</span>
			</div>
		</div>
	</div>
</template>

<script lang="ts" setup>
import { useI18n } from 'vue-i18n';
import officeBuilding from '/@/assets/icons/wordIcon/Frame 427318810.svg';
import user from '/@/assets/icons/wordIcon/Frame 427318810 (1).svg';
import briefcase from '/@/assets/icons/wordIcon/Frame 427318810 (2).svg';
import files from '/@/assets/icons/wordIcon/Frame 427318810 (3).svg';
import document from '/@/assets/icons/wordIcon/Frame 427318810 (4).svg';
import folder from '/@/assets/icons/wordIcon/Frame 427318810 (5).svg';
import files1 from '/@/assets/icons/wordIcon/Frame 427318810 (6).svg';
import folderOpened from '/@/assets/icons/wordIcon/Frame 427318810 (7).svg';
import suitcase from '/@/assets/icons/wordIcon/Frame 427318810 (8).svg';
import edit from '/@/assets/icons/wordIcon/Frame 427318810 (9).svg';
import connection from '/@/assets/icons/wordIcon/Frame 427318810 (10).svg';
import setting from '/@/assets/icons/wordIcon/Frame 427318810 (11).svg';
import shares from '/@/assets/icons/wordIcon/Frame 427318810 (12).svg';
import institutionalCenter from '/@/assets/icons/wordIcon/Frame 427318810 (13).svg';
const { t } = useI18n();

const emit = defineEmits<{
	(e: 'click', item: any): void;
}>();

const entryList = [
	{ icon: officeBuilding, label: 'workbench.quickEntry.cooperationUnit', path: '/investment/cooperationUnitLibrary/index' },
	{ icon: user, label: 'workbench.quickEntry.expertLibrary', path: '/investment/expertLibrary/index' },
	{ icon: briefcase, label: 'workbench.quickEntry.investmentReserve', path: '/investment/reserveLibrary/index' },
	{ icon: files, label: 'workbench.quickEntry.investmentProject', path: '/invMid/projectLibrary/index' },
	{ icon: document, label: 'workbench.quickEntry.committeeReview', path: '/invMid/committeeReviewLibrary/index' },
	{ icon: folder, label: 'workbench.quickEntry.postInvestmentManagement', path: '/invBid/postInvestmentManagement/index' },
	{ icon: files1, label: 'workbench.quickEntry.postInvestmentEvaluation', path: '/invBid/postInvestmentEvaluation/index' },
	{ icon: folderOpened, label: 'workbench.quickEntry.progressDeclaration', path: '/invMid/progressReportRecord/index' },
	{ icon: suitcase, label: 'workbench.quickEntry.exitPlan', path: '/invMid/projectExitPlanLibrary/index' },
	{ icon: edit, label: 'workbench.quickEntry.projectExitFeedback', path: '' },
	{ icon: connection, label: 'workbench.quickEntry.propertyManagement', path: '/workbench/propertyManagement/index' },
	{ icon: setting, label: 'workbench.quickEntry.mixedOwnership', path: '/workbench/miOwLibr/index' },
	{ icon: shares, label: 'workbench.quickEntry.shares', path: '/workbench/shares/index' },
	{ icon: institutionalCenter, label: 'workbench.quickEntry.institutionalCenter', path: '/config/institutionalCenter/index?from=workbench' },
];

const handleClick = (item: any) => {
	emit('click', item);
};
</script>

<style scoped>
.quick-entry {
	background: #fff;
	border-radius: 4px;
	padding: 20px;
	height: 100%;
	display: flex;
	flex-direction: column;
}

.quick-entry-title {
	font-size: 16px;
	font-weight: 600;
	margin-bottom: 20px;
	color: var(--el-text-color-primary);
}

.quick-entry-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	flex: 1;
}

.quick-entry-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.3s;
}

.quick-entry-item:hover {
	background: #e4e7ed;
	transform: translateY(-2px);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.entry-icon {
	width: 54px;
	height: 54px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 10px;
}

.entry-label {
	font-size: 12px;
	color: var(--el-text-color-primary);
	font-weight: 700;
	text-align: center;
	line-height: 1.4;
	margin-bottom: 10px;
	margin-top: 5px;
}
</style>
