<!-- 品质 -->
<script setup lang="ts">
import HomeHead from '@/views/home/components/HomeHead.vue'
// import HomeHeadSearch from '@/views/home/components/HomeHeadSearch.vue'
import { useDate } from '@/views/home/hooks/useDate'
// import { NTimeline, NTimelineItem } from 'naive-ui'
import { useMessage } from 'naive-ui'
import { cateFileList } from '@/api/daikin/base'

const { day, week } = useDate()
const { push } = useRouter()
const array = ref<any[]>([
	{
		content1: '将扩大的机遇转为成果 更强更大地展翅飞翔',
		content2: 'ひろがるチャンスを 成果につなげ 強く大きく 羽ばたこう',
		year: '2023年'
	},
	{ content1: '领先时代的变化 开创崭新的未来', content2: '', year: '2022年' },
	{
		content1: '以“重大变化”为契机 向新课题发起挑战',
		content2: '',
		year: '2021年'
	},
	{
		content1: '加速推进三个协创 决胜于变化的时代',
		content2: '',
		year: '2020年'
	},
	{
		content1: '以三个协创为轴心 人人迅速果断行动',
		content2: '',
		year: '2016年'
	},
	{
		content1: '突破壁垒 集中优势 不断挑战新课题',
		content2: '',
		year: '2018年'
	},
	{
		content1: '坚持以人为轴心，融合新的力量',
		content2: '集团上下齐心协力提升企业价值',
		year: '2017年'
	},
	{ content1: '站稳脚跟 强化优势 大步迈进', content2: '', year: '2016年' },
	{ content1: '创造未来，决胜于变化的时代', content2: '', year: '2015年' }
])

const fileItem = ref<any>({})
const message = useMessage()
const getFile = async () => {
	const { rows }: any = await cateFileList({
		cateId: 261,
		pageNum: 1,
		pageSize: 100
	})
	fileItem.value = rows.find((item: any) => item.id == 1693) || {}
}
const goFile = () => {
	const { isSelect, filePath } = fileItem.value
	if (!isSelect || isSelect === 2) {
		message.info('没有访问权限!')
		return
	}
	if (!filePath) {
		message.info('暂无文件')
	}
	window.open(filePath)
}

getFile()
</script>

<template>
	<HomeHead class="top">
		<template #content>
			<!-- <HomeHeadSearch /> -->
		</template>
	</HomeHead>
	<!-- <div class="h-full relative flex flex-col">
        <div class="font-600 flex items-end mt27px">
            <div class="text-36px">集团方针</div>
            <div class="text-18px ml40px mr25px">{{ day }}</div>
            <div class="text-18px">{{ week }}</div>
        </div>
        <div class="g-wrapper flex-1 mt30px">
            <div class="timeline mt35px ml178px">
                <NTimeline size="large">
                    <NTimelineItem class="h92px one" v-for="item in array" :key="item.year">
                        <div class="flex gap-60px justify-between">
                            <div class="year absolute">{{ item.year }}</div>
                            <div class="content1">{{ item.content1 }}</div>
                            <div class="content2  pr50px">{{ item.content2 }}</div>
                        </div>
                    </NTimelineItem>
                </NTimeline>
            </div>
        </div>
    </div> -->
	<div class="mt30px mr20px flex w100% relative">
		<!-- <img src="../../assets/images/fangz.png" class="w100%"/> -->
		<img src="../../assets/images/fzqiet.png" class="w100%" />
		<div
			class="absolute py10px left-1160px top-270px pb-0px z-100 text-20px text-#285FE9 flex justify-center items-center hover:border-b-1px hover:border-b-solid hover:border-b-#285FE9 hover:cursor-pointer"
			@click="goFile"
		>
			<img src="../../assets/images/wjqq@2x.png" class="w18px h20px mr8px" />
			2024年グループ年頭方针
		</div>
	</div>
</template>

<style scoped lang="less">
.top {
	position: absolute;
	right: 30px;
	top: -92px;
}

.g-wrapper {
	border-radius: 18px;
	border: 1px solid #e7ebf5;
	box-shadow: inset 1px 2px 12px rgba(14, 86, 221, 0.32);
	overflow: hidden;

	.timeline {
		font-size: 20px;
		font-weight: bold;
		color: #142142;

		.one {
			position: relative;
			.year {
				left: -132px;
				top: -14px;
				color: #003cb7;
				font-size: 26px;
				font-weight: normal;
				text-align: center;
				line-height: 50px;
			}
		}
	}
}
</style>
