<template>
	<div class="leftTop">
		<Card title="项目信息">
			<!-- <div class="projectInfo">
				<div><span>项目名称：</span> {{ projectData.projectName || "" }}</div>
				<div :title="projectLocal"><span>项目地址：</span> {{ projectLocal }}</div>
				<div><span>项目经理：</span> {{ projectData.projectManage || "" }}</div>
				<div><span>联系电话：</span> {{ projectData.projectTel || "" }}</div>
				<div><span>建筑面积：</span> {{ projectData.projectAcreage || "" }} ㎡</div>
				<div><span>开工日期：</span> {{ projectData.startWorkDate || "" }}</div>
				<div><span>项目编号：</span> {{ projectData.projectNumber || "" }}</div>
				<div><span>工程类别：</span> {{ projectData.projectType ? projectTypeEnum[projectData.projectType - 1].name : "" }}</div>
			</div> -->
			<div class="projectInfo">
				<div><span>建设地点：</span> 南平市建阳区</div>
				<div><span>变电容量：</span> 2x50兆伏安</div>
				<div><span>间隔名称：</span> 110千伏江坑问隔</div>
				<div><span>架空线路：</span> 67.49公里</div>
				<div><span>电缆长度：</span> 0.31公里</div>
				<div><span>通讯光缆：</span> 74.79公里</div>
				<div><span>总投资：</span> 11762万元</div>
			</div>
		</Card>
	</div>
</template>

<script setup lang="ts">
import Card from "@/components/card.vue";
import { GlobalStore } from "@/stores";
import { ref, onMounted, watch } from "vue";
import { projectTypeEnum } from "@/enums/project/projectTypeEnum";
// ts
type Props = {
	projectData?: any; // 传入项目信息
};
// withDefaults 定义默认值(传入的数据类型同默认值)
const props = withDefaults(defineProps<Props>(), {
	projectData: {}
});
// 项目信息
const projectData = ref({} as any);

const projectLocal = ref("" as any);

watch(
	() => props.projectData,
	newVal => {
		// console.log(newVal, "newVal");
		if (newVal) {
			// props.xData = newVal;
			projectData.value = newVal;
			projectLocal.value =
				projectData.value.provinceName +
				projectData.value.cityName +
				projectData.value.areaName +
				projectData.value.projectAddress;
		}
	}
);
</script>

<style lang="scss" scoped>
.leftTop {
	width: 100%;
	height: 100%;
	.projectInfo {
		width: 100%;
		height: 100%;
		color: #fff;
		padding: 2% 0 0 4%;

		div {
			width: 95%;
			height: 12%;
			font-size: 15px;
			white-space: nowrap; //单行
			overflow: hidden;
			text-overflow: ellipsis;
			span {
				margin-right: 3%;
				color: #ccc;
			}
		}
	}
}
::v-deep .h-card .content {
	height: 80%;
}
</style>
