<template>
	<view class="custom-wrap u-padding-30">
		<view class="custom-tabs u-flex box-shadow">
			<view :class="['custom-tabs-tab', tabIndx ? '' : 'custom-tabs-tab_active']" @click="handleChangeTab(0)">
				<u-icon name="anquan" custom-prefix="custom-icon" size="80" />
				<text class="u-margin-top-20">安全生产数据</text>
			</view>
			<view :class="['custom-tabs-tab', tabIndx ? 'custom-tabs-tab_active' : '']" @click="handleChangeTab(1)">
				<u-icon name="zhiliang" custom-prefix="custom-icon" size="80" />
				<text class="u-margin-top-20">质量焊接数据</text>
			</view>
		</view>
		<u-transition :show="tabIndx === 0" name="slide-right">
			<view v-if="tabIndx == 0">
				<!-- 顶部定位数据 -->
				<ProjectCard />
				<view style="margin-top: -60rpx; padding: 0 20rpx 40rpx">
					<template v-for="(i, idx) in safeComponent">
						<!-- 危大工程数 -->
						<BigCrisisCard v-if="i === 7" />
						<!-- 四级风险数据 -->
						<RiskRankingCard v-if="i === 8" />
						<!-- 作业许可数 -->
						<WorkCard v-if="i === 9" />
						<!-- 培训数据  -->
						<EducationCard v-if="i === 3" />
						<!-- 领导级安全检查数 -->
						<SafetyCard v-if="i === 11" />
						<!-- 项目安全检查数据 -->
						<DefectTreatmentCard v-if="i === 4" />
						<!-- 应急数据 -->
						<EmergencyCard v-if="i === 10" />
						<!-- 机具管理 -->
						<SpecialEquipCard v-if="i === 6" />
						<!-- 企业及分支机构人数 -->
						<OrganizerCard v-if="i === 2" />

						<!-- 安全工时 -->
						<!-- <SafeHoursCard v-if="i === 1" /> -->

						<!-- 安全费用 -->
						<!-- <CostCard v-if="i === 5" /> -->
					</template>
				</view>
			</view>
		</u-transition>
		<u-transition :show="tabIndx === 1" name="slide-right">
			<view v-if="tabIndx == 1">
				<!-- 企业和分支机构人数 -->
				<OrgPersonCard />
				<!-- 人员报验、培训及交底数 -->
				<EducationCard1 />
				<!-- 星级标准化工地建设 -->
				<!-- <StarLevelCard /> -->
				<!-- 计量器具数 -->
				<MeasuringCard />
				<!-- 设备材料及机具报验数 -->
				<EquipmentCard />
				<!-- 工程划分数 -->
				<ProjectItem />
				<!-- 领导级质量检查数 -->
				<SafetyCards />
				<!-- 项目质量检查数 -->
				<QualityCard />
				<!-- 控制点验收数 -->
				<AcceptanceData />
				<!-- 优质工程数 -->
				<HighQuality />
				<!-- QC活动数 -->
				<QCActivity />
				<!-- 施工方案数 -->
				<ConstructionScheme />
				<!-- 图纸会审及交底数 -->
				<ReviewAndBriefing />
				<!-- 焊接数 -->
				<WeldingData />
				<!-- 报验记录 -->
				<!-- <InspectionRecord /> -->
			</view>
		</u-transition>
	</view>
</template>

<script setup>
import { defineAsyncComponent, ref } from 'vue';

/* 加载组件
	-------------------------------------------------------------*/
// 安全
import ProjectCard from './safe/projectCard.vue';
import SafeHoursCard from './safe/safeHoursCard.vue';
import OrganizerCard from './safe/organizerCard.vue';
import EducationCard from './safe/educationCard.vue';
import DefectTreatmentCard from './safe/defectTreatmentCard.vue';
import CostCard from './safe/costCard.vue';
import SpecialEquipCard from './safe/specialEquipCard.vue';
import BigCrisisCard from './safe/bigCrisisCard.vue';
import RiskRankingCard from './safe/riskRankingCard.vue';
import WorkCard from './safe/workCard.vue';
import SafetyCard from './safe/safetyCard.vue';
import EmergencyCard from './safe/emergencyCard.vue';
// 质量
import OrgPersonCard from './qms/orgPersonCard.vue';
import StarLevelCard from './qms/starLevelCard.vue';
import EducationCard1 from './qms/educationCard.vue';
import MeasuringCard from './qms/measuringCard.vue';
import EquipmentCard from './qms/equipmentCard.vue';
import InspectionRecord from './qms/inspectionRecord.vue';
import ProjectItem from './qms/projectItemCard.vue';
import HighQuality from './qms/highQuality.vue';
import QCActivity from './qms/QCActivity.vue';
import ConstructionScheme from './qms/constructionScheme.vue';
import ReviewAndBriefing from './qms/reviewAndBriefing.vue';
import QmsInspect from './qms/qmsInspect.vue';
import QualityCard from './qms/qualityCard.vue';
import AcceptanceData from './qms/acceptanceData.vue';
import WeldingData from './qms/weldingData.vue';
import SafetyCards from './qms/safetyCard.vue';

const safeComponent = ref([2, 7, 8, 9, 3, 11, 4, 10, 6, 1, 5]);

const tabIndx = ref(0);

const handleChangeTab = (idx) => {
	tabIndx.value = idx;
};
</script>

<style lang="scss"></style>
