初步完善
This commit is contained in:
		
							
								
								
									
										174
									
								
								src/views/ProjectScreen/components/centerPage.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										174
									
								
								src/views/ProjectScreen/components/centerPage.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,174 @@ | ||||
| <template> | ||||
|   <div class="centerPage"> | ||||
|     <div class="topPage"> | ||||
|       <!-- 暂无 --> | ||||
|     </div> | ||||
|     <div class="endPage"> | ||||
|       <Title title="AI安全巡检" :prefix="true" /> | ||||
|  | ||||
|       <div class="swiper"> | ||||
|         <div class="arrow" :class="{ 'canUse': canLeft }" @click="swiperClick('left')"> | ||||
|           <el-icon size="16" color="skyblue"> | ||||
|             <ArrowLeft /> | ||||
|           </el-icon> | ||||
|         </div> | ||||
|         <div class="swiper_content" ref="swiperContent"> | ||||
|           <div class="swiper_item" v-for="(item, index) in swiperList" :key="index"> | ||||
|             <img src="@/assets/projectLarge/swiper.png" alt="" class="swiper_img"> | ||||
|             <div class="swiper_date">{{ item.date }}</div> | ||||
|             <div class="swiper_tip">{{ item.tip }}</div> | ||||
|           </div> | ||||
|         </div> | ||||
|         <div class="arrow" :class="{ 'canUse': canRight }" @click="swiperClick('right')"> | ||||
|           <el-icon size="16"> | ||||
|             <ArrowRight /> | ||||
|           </el-icon> | ||||
|         </div> | ||||
|       </div> | ||||
|     </div> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script setup lang="ts"> | ||||
| import { ref } from "vue" | ||||
| import Title from './title.vue' | ||||
|  | ||||
| const swiperList = ref([ | ||||
|   { date: '03-18 15:00', tip: '未佩戴安全帽1' }, | ||||
|   { date: '03-18 15:00', tip: '未佩戴安全帽2' }, | ||||
|   { date: '03-18 15:00', tip: '未佩戴安全帽3' }, | ||||
|   { date: '03-18 15:00', tip: '未佩戴安全帽4' }, | ||||
|   { date: '03-18 15:00', tip: '未佩戴安全帽5' }, | ||||
|   { date: '03-18 15:00', tip: '未佩戴安全帽6' }, | ||||
|   { date: '03-18 15:00', tip: '未佩戴安全帽7' }, | ||||
|   { date: '03-18 15:00', tip: '未佩戴安全帽8' }, | ||||
|   { date: '03-18 15:00', tip: '未佩戴安全帽9' }, | ||||
|   { date: '03-18 15:00', tip: '未佩戴安全帽10' }, | ||||
|   { date: '03-18 15:00', tip: '未佩戴安全帽11' }, | ||||
|   { date: '03-18 15:00', tip: '未佩戴安全帽12' }, | ||||
| ]) | ||||
|  | ||||
| const swiperContent = ref<HTMLDivElement>() | ||||
| const swiperItemWidth = ref(100) | ||||
| const canLeft = ref(false) | ||||
| const canRight = ref(true) | ||||
|  | ||||
| const swiperClick = (direction: 'left' | 'right') => { | ||||
|  | ||||
|   if (direction === 'right') { | ||||
|     if (swiperContent.value.scrollLeft >= swiperContent.value.scrollWidth - swiperContent.value.clientWidth) { | ||||
|       canRight.value = false | ||||
|       canLeft.value = true | ||||
|       return | ||||
|     } | ||||
|     swiperContent.value.scrollLeft += swiperItemWidth.value | ||||
|   } else { | ||||
|     if (swiperContent.value.scrollLeft <= 0) { | ||||
|       canLeft.value = false | ||||
|       canRight.value = true | ||||
|       return | ||||
|     } | ||||
|     swiperContent.value.scrollLeft -= swiperItemWidth.value | ||||
|   } | ||||
| } | ||||
|  | ||||
| onMounted(() => { | ||||
|   swiperItemWidth.value = swiperContent.value.children[0].clientWidth + 20 | ||||
| }) | ||||
|  | ||||
| </script> | ||||
|  | ||||
| <style scoped lang="scss"> | ||||
| .centerPage { | ||||
|   display: flex; | ||||
|   flex-direction: column; | ||||
|   width: 50vw; | ||||
|   height: 100%; | ||||
|  | ||||
|   .topPage, | ||||
|   .endPage { | ||||
|     display: flex; | ||||
|     flex-direction: column; | ||||
|     align-items: center; | ||||
|     width: 100%; | ||||
|     padding: 15px 0; | ||||
|     border: 1px solid rgba(29, 214, 255, 0.1); | ||||
|     box-sizing: border-box; | ||||
|   } | ||||
|  | ||||
|   .topPage { | ||||
|     flex: 1; | ||||
|     margin-bottom: 23px; | ||||
|   } | ||||
| } | ||||
|  | ||||
| .swiper { | ||||
|   width: 100%; | ||||
|   display: flex; | ||||
|   align-items: center; | ||||
|   gap: 20px; | ||||
|   padding: 20px 20px 10px 20px; | ||||
|  | ||||
|   .swiper_content { | ||||
|     width: 100%; | ||||
|     display: flex; | ||||
|     gap: 20px; | ||||
|     transition: all 0.3s ease-in-out; | ||||
|     overflow-x: auto; | ||||
|  | ||||
|     &::-webkit-scrollbar { | ||||
|       display: none; | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   .swiper_item { | ||||
|     position: relative; | ||||
|     display: flex; | ||||
|     flex-direction: column; | ||||
|     align-items: center; | ||||
|     width: 133px; | ||||
|     height: 84px; | ||||
|  | ||||
|     .swiper_img { | ||||
|       width: 133px; | ||||
|       height: 84px; | ||||
|       object-fit: cover; | ||||
|     } | ||||
|  | ||||
|     .swiper_date { | ||||
|       position: absolute; | ||||
|       top: 4px; | ||||
|       right: 4px; | ||||
|       font-size: 14px; | ||||
|       font-weight: 400; | ||||
|       color: rgba(230, 247, 255, 1); | ||||
|     } | ||||
|  | ||||
|     .swiper_tip { | ||||
|       position: absolute; | ||||
|       bottom: 0; | ||||
|       width: 100%; | ||||
|       padding: 5px 0; | ||||
|       text-align: center; | ||||
|       font-size: 12px; | ||||
|       font-weight: 400; | ||||
|       color: rgba(230, 247, 255, 1); | ||||
|       background-color: rgba(0, 0, 0, 0.5); | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
| .arrow { | ||||
|   display: grid; | ||||
|   place-items: center; | ||||
|   width: 20px; | ||||
|   height: 20px; | ||||
|   border-radius: 50%; | ||||
|   border: 1px solid skyblue; | ||||
|   color: skyblue; | ||||
|  | ||||
|   &:canUse { | ||||
|     color: #000 !important; | ||||
|   } | ||||
| } | ||||
| </style> | ||||
							
								
								
									
										198
									
								
								src/views/ProjectScreen/components/header.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										198
									
								
								src/views/ProjectScreen/components/header.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,198 @@ | ||||
| <template> | ||||
|   <div class="header"> | ||||
|     <div class="header_left"> | ||||
|       <div class="header_left_img"> | ||||
|         <img src="@/assets/large/secure.png" style="width: 100%; height: 100%" /> | ||||
|       </div> | ||||
|       <div style="font-size: 12px; padding-left: 10px">安全生产天数:</div> | ||||
|       <div class="header_left_text"> | ||||
|         1,235 | ||||
|         <span style="font-size: 12px">天</span> | ||||
|       </div> | ||||
|     </div> | ||||
|     <div class="title"> | ||||
|       <div>XXX智慧工地管理平台</div> | ||||
|       <div>XXX Smart Construction Stic Management Dashboard</div> | ||||
|     </div> | ||||
|     <div class="right"> | ||||
|       <div class="top-bar"> | ||||
|         <!-- 左侧:天气图标 + 日期文字 --> | ||||
|         <div class="left-section"> | ||||
|           <img src="@/assets/large/weather.png" alt="天气图标" /> | ||||
|  | ||||
|           <span> | ||||
|             <span>多云 9°/18°</span> | ||||
|             <span style="padding-left: 20px"> {{ week[date.week] }} ({{ date.ymd }})</span> | ||||
|           </span> | ||||
|         </div> | ||||
|         <!-- 分割线 --> | ||||
|         <div class="divider"> | ||||
|           <div class="top-block"></div> | ||||
|           <div class="bottom-block"></div> | ||||
|         </div> | ||||
|         <!-- 右侧:管理系统图标 + 文字 --> | ||||
|         <div class="right-section"> | ||||
|           <img src="@/assets/large/setting.png" alt="设置图标" /> | ||||
|           <span>管理系统</span> | ||||
|         </div> | ||||
|       </div> | ||||
|     </div> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script setup lang="ts"> | ||||
| const week = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']; | ||||
| const date = ref({ | ||||
|   ymd: '', | ||||
|   hms: '', | ||||
|   week: 0 | ||||
| }); | ||||
|  | ||||
| const setTime = () => { | ||||
|   let date1 = new Date(); | ||||
|   let year: any = date1.getFullYear(); | ||||
|   let month: any = date1.getMonth() + 1; | ||||
|   let day: any = date1.getDate(); | ||||
|   let hours: any = date1.getHours(); | ||||
|   if (hours < 10) { | ||||
|     hours = '0' + hours; | ||||
|   } | ||||
|   let minutes: any = date1.getMinutes(); | ||||
|   if (minutes < 10) { | ||||
|     minutes = '0' + minutes; | ||||
|   } | ||||
|   let seconds: any = date1.getSeconds(); | ||||
|   if (seconds < 10) { | ||||
|     seconds = '0' + seconds; | ||||
|   } | ||||
|   date.value.ymd = year + '-' + month + '-' + day; | ||||
|   date.value.hms = hours + ':' + minutes + ':' + seconds; | ||||
|   date.value.week = date1.getDay(); | ||||
| }; | ||||
|  | ||||
| // 添加定时器,每秒更新一次时间 | ||||
| const timer = setInterval(setTime, 1000); | ||||
|  | ||||
| // 组件卸载时清除定时器 | ||||
| onUnmounted(() => { | ||||
|   clearInterval(timer); | ||||
| }); | ||||
| </script> | ||||
|  | ||||
| <style scoped lang="scss"> | ||||
| .header { | ||||
|   width: 100%; | ||||
|   height: 80px; | ||||
|   box-sizing: border-box; | ||||
|   padding: 10px; | ||||
|   display: grid; | ||||
|   grid-template-columns: 1fr 1fr 1fr; | ||||
|   color: #fff; | ||||
| } | ||||
|  | ||||
| .header_left { | ||||
|   display: flex; | ||||
|   align-items: center; | ||||
|  | ||||
|   .header_left_img { | ||||
|     width: 48px; | ||||
|     height: 48px; | ||||
|     box-sizing: border-box; | ||||
|     // padding-right: 10px; | ||||
|   } | ||||
|  | ||||
|   .header_left_text { | ||||
|     font-weight: 500; | ||||
|     text-shadow: 0px 1.24px 6.21px rgba(25, 179, 250, 1); | ||||
|   } | ||||
| } | ||||
|  | ||||
| .title { | ||||
|   color: #fff; | ||||
|   font-family: 'AlimamaShuHeiTi', sans-serif; | ||||
|   text-align: center; | ||||
| } | ||||
|  | ||||
| .title>div:first-child { | ||||
|   /* 第一个子元素的样式 */ | ||||
|   font-size: 38px; | ||||
|   letter-spacing: 0.1em; | ||||
| } | ||||
|  | ||||
| .title>div:last-child { | ||||
|   /* 最后一个子元素的样式 */ | ||||
|   font-size: 14px; | ||||
| } | ||||
|  | ||||
| .right { | ||||
|   width: 100%; | ||||
|   height: 100%; | ||||
|   display: flex; | ||||
| } | ||||
|  | ||||
| /* 顶部栏容器:Flex 水平布局 + 垂直居中 */ | ||||
| .top-bar { | ||||
|   width: 100%; | ||||
|   height: 100%; | ||||
|   display: flex; | ||||
|   align-items: center; | ||||
|   justify-content: flex-end; | ||||
|   //   background-color: #1e2128; | ||||
|   color: #fff; | ||||
|   padding: 8px 16px; | ||||
|   font-size: 14px; | ||||
| } | ||||
|  | ||||
| /* 左侧区域(天气 + 日期):自身也用 Flex 水平排列,确保元素在一行 */ | ||||
| .left-section { | ||||
|   display: flex; | ||||
|   align-items: center; | ||||
|   //   margin-right: auto; /* 让右侧元素(管理系统)居右 */ | ||||
| } | ||||
|  | ||||
| .left-section img { | ||||
|   width: 32px; | ||||
|   height: 32px; | ||||
|   margin-right: 8px; | ||||
|   /* 图标与文字间距 */ | ||||
| } | ||||
|  | ||||
| /* 分割线(视觉分隔,可根据需求调整样式) */ | ||||
| .divider { | ||||
|   display: grid; | ||||
|   grid-template-rows: 1fr 1fr; | ||||
|   height: 100%; | ||||
|   /* 根据需要调整高度 */ | ||||
|   padding: 14px 10px; | ||||
| } | ||||
|  | ||||
| .divider .top-block { | ||||
|   width: 2px; | ||||
|   height: 7px; | ||||
|   background: #19b5fb; | ||||
|   align-self: start; | ||||
| } | ||||
|  | ||||
| .divider .bottom-block { | ||||
|   width: 2px; | ||||
|   height: 7px; | ||||
|   background: #19b5fb; | ||||
|   align-self: end; | ||||
| } | ||||
|  | ||||
| /* 右侧区域(管理系统):图标 + 文字水平排列 */ | ||||
| .right-section { | ||||
|   display: flex; | ||||
|   align-items: center; | ||||
|   font-family: 'AlimamaShuHeiTi', sans-serif; | ||||
|   font-size: 20px; | ||||
|   cursor: pointer; | ||||
| } | ||||
|  | ||||
| .right-section img { | ||||
|   width: 20px; | ||||
|   height: 20px; | ||||
|   margin-right: 6px; | ||||
|   /* 图标与文字间距 */ | ||||
| } | ||||
| </style> | ||||
							
								
								
									
										204
									
								
								src/views/ProjectScreen/components/leftPage.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										204
									
								
								src/views/ProjectScreen/components/leftPage.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,204 @@ | ||||
| <template> | ||||
|   <div class="leftPage"> | ||||
|     <div class="topPage"> | ||||
|       <Title title="项目公告" /> | ||||
|  | ||||
|       <div class="content"> | ||||
|         <div class="content_item" v-for="item in 6" :key="item"> | ||||
|           <div class="round"> | ||||
|             <div class="sub_round"></div> | ||||
|           </div> | ||||
|           <div class="ellipsis">2025年6月23日 重庆市两江新区广场前期准备与审批完毕区广场前期准备与审批完毕前期准备与审批完毕区广场前期准备与审批完毕</div> | ||||
|         </div> | ||||
|       </div> | ||||
|     </div> | ||||
|     <div class="endPage"> | ||||
|       <Title title="人员情况" /> | ||||
|  | ||||
|       <div class="map"> | ||||
|         <img src="@/assets/projectLarge/map.svg" alt=""> | ||||
|       </div> | ||||
|  | ||||
|       <div class="attendance_tag"> | ||||
|         <div class="tag_item" v-for="(item, index) in tagList" :key="index"> | ||||
|           <img src="@/assets/projectLarge/people.svg" alt=""> | ||||
|           <div class="tag_title">{{ item.title }}</div> | ||||
|           <div class="tag_info"> | ||||
|             {{ item.number }} | ||||
|             <span style="font-size: 14px;">{{ index === 2 ? '%' : '人' }}</span> | ||||
|           </div> | ||||
|         </div> | ||||
|       </div> | ||||
|  | ||||
|       <div class="attendance_list"> | ||||
|         <div class="attendance_item subfont"> | ||||
|           <div class="attendance_item_title"></div> | ||||
|           <div class="attendance_item_title">在岗人数</div> | ||||
|           <div class="attendance_item_title">出勤率</div> | ||||
|           <div class="attendance_item_title">出勤时间</div> | ||||
|         </div> | ||||
|         <div v-for="item in list" :key="item.title" class="attendance_item"> | ||||
|           <div class="attendance_item_title">{{ item.title }}</div> | ||||
|           <div class="attendance_item_number">{{ item.number }} <span class="subfont">人/{{ item.number }}</span></div> | ||||
|           <div class="attendance_item_rate">{{ item.attendanceRate }} %</div> | ||||
|           <div class="attendance_item_date subfont">{{ item.date }}</div> | ||||
|         </div> | ||||
|       </div> | ||||
|     </div> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script setup lang="ts"> | ||||
| import { ref } from "vue" | ||||
| import Title from './title.vue' | ||||
|  | ||||
| const list = ref([ | ||||
|   { title: '智慧系统运维', number: 30, attendanceRate: 100, date: '2025-08-05 08:10' }, | ||||
|   { title: '智慧系统运维', number: 30, attendanceRate: 100, date: '2025-08-05 08:10' }, | ||||
|   { title: '智慧系统运维', number: 30, attendanceRate: 100, date: '2025-08-05 08:10' }, | ||||
|   { title: '智慧系统运维', number: 30, attendanceRate: 100, date: '2025-08-05 08:10' }, | ||||
|   { title: '智慧系统运维', number: 30, attendanceRate: 100, date: '2025-08-05 08:10' }, | ||||
|   { title: '智慧系统运维', number: 30, attendanceRate: 100, date: '2025-08-05 08:10' }, | ||||
| ]) | ||||
|  | ||||
| const tagList = ref([ | ||||
|   { title: '出勤人数', number: 259 }, | ||||
|   { title: '在岗人数', number: 100 }, | ||||
|   { title: '出勤率', number: 100 }, | ||||
| ]) | ||||
| </script> | ||||
|  | ||||
| <style scoped lang="scss"> | ||||
| .leftPage { | ||||
|   display: flex; | ||||
|   flex-direction: column; | ||||
|   width: calc(25vw - 30px); | ||||
|   margin: 0 15px; | ||||
|   height: 100%; | ||||
|  | ||||
|   .topPage, | ||||
|   .endPage { | ||||
|     display: flex; | ||||
|     flex-direction: column; | ||||
|     align-items: center; | ||||
|     width: 100%; | ||||
|     padding: 15px 0; | ||||
|     border: 1px solid rgba(29, 214, 255, 0.1); | ||||
|     box-sizing: border-box; | ||||
|   } | ||||
|  | ||||
|   .endPage { | ||||
|     flex: 1; | ||||
|     margin-top: 23px; | ||||
|   } | ||||
| } | ||||
|  | ||||
| .content { | ||||
|   max-height: 100px; | ||||
|   margin: 0 15px; | ||||
|   padding: 0 10px; | ||||
|   margin-top: 15px; | ||||
|   box-sizing: border-box; | ||||
|   overflow-y: auto; | ||||
|  | ||||
|   &::-webkit-scrollbar-track { | ||||
|     background: rgba(204, 204, 204, 0.1); | ||||
|     border-radius: 10px; | ||||
|   } | ||||
|  | ||||
|   &::-webkit-scrollbar-thumb { | ||||
|     background: rgba(29, 214, 255, 0.78); | ||||
|     border-radius: 10px; | ||||
|   } | ||||
|  | ||||
|   .content_item { | ||||
|     display: flex; | ||||
|     align-items: flex-start; | ||||
|     gap: 10px; | ||||
|     // position: relative; | ||||
|     margin-bottom: 20px; | ||||
|     font-size: 14px; | ||||
|     font-weight: 400; | ||||
|     color: rgba(230, 247, 255, 1); | ||||
|  | ||||
|     .ellipsis { | ||||
|       display: -webkit-box; | ||||
|       -webkit-box-orient: vertical; | ||||
|       -webkit-line-clamp: 2; | ||||
|       overflow: hidden; | ||||
|       text-overflow: ellipsis; | ||||
|       line-height: 1.5; | ||||
|     } | ||||
|  | ||||
|     &:last-child { | ||||
|       margin-bottom: 0; | ||||
|     } | ||||
|  | ||||
|     .round { | ||||
|       display: grid; | ||||
|       place-items: center; | ||||
|       margin-top: 3px; | ||||
|       width: 12px; | ||||
|       height: 12px; | ||||
|       border-radius: 50%; | ||||
|       background: rgba(29, 214, 255, 0.3); | ||||
|  | ||||
|       .sub_round { | ||||
|         width: 6px; | ||||
|         height: 6px; | ||||
|         border-radius: 50%; | ||||
|         background: #1DD6FF; | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
| .map { | ||||
|   margin-top: 15px; | ||||
| } | ||||
|  | ||||
| .attendance_tag { | ||||
|   width: 100%; | ||||
|   display: flex; | ||||
|   justify-content: space-between; | ||||
|   padding: 0 30px; | ||||
|   margin-top: 15px; | ||||
|  | ||||
|   .tag_item { | ||||
|     display: flex; | ||||
|     flex-direction: column; | ||||
|     align-items: center; | ||||
|     gap: 10px; | ||||
|     border: 1px dashed rgba(29, 214, 255, 0.3); | ||||
|     padding: 10px 25px; | ||||
|  | ||||
|     .tag_info { | ||||
|       font-size: 20px; | ||||
|       font-weight: 700; | ||||
|       color: rgba(230, 247, 255, 1); | ||||
|       text-shadow: 0px 1.24px 6.21px rgba(0, 190, 247, 1); | ||||
|     } | ||||
|  | ||||
|     .tag_title { | ||||
|       font-size: 14px; | ||||
|       font-weight: 400; | ||||
|       color: rgba(230, 247, 255, 1); | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
| .attendance_list { | ||||
|   padding: 0px 30px; | ||||
|   font-size: 14px; | ||||
|  | ||||
|   .attendance_item { | ||||
|     display: grid; | ||||
|     grid-template-columns: 3fr 2fr 2fr 3fr; | ||||
|     margin-top: 20px; | ||||
|   } | ||||
| } | ||||
|  | ||||
| .subfont { | ||||
|   color: rgba(138, 149, 165, 1); | ||||
| } | ||||
| </style> | ||||
							
								
								
									
										0
									
								
								src/views/ProjectScreen/components/optionList.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								src/views/ProjectScreen/components/optionList.ts
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										274
									
								
								src/views/ProjectScreen/components/rightPage.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										274
									
								
								src/views/ProjectScreen/components/rightPage.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,274 @@ | ||||
| <template> | ||||
|   <div class="leftPage"> | ||||
|     <div class="topPage"> | ||||
|       <Title title="项目概况" /> | ||||
|  | ||||
|       <div class="content"> | ||||
|         <div class="content_item">项目名称:智慧生态工地社区开发项目</div> | ||||
|         <div class="content_item">项目位置:贵州省贵阳市乌当区(具体地块编号:01-123-11)</div> | ||||
|         <div class="content_item">占地面积:约10000亩</div> | ||||
|         <div class="content_item"> 土地性质:城镇住宅用地(兼容商业用地,容积率≤2.5)</div> | ||||
|       </div> | ||||
|     </div> | ||||
|     <div class="endPage"> | ||||
|       <!-- 饼图容器 --> | ||||
|       <Title title="形象进度" /> | ||||
|  | ||||
|       <div ref="pieChartRef" class="echart" /> | ||||
|       <!-- 折线图容器 --> | ||||
|       <div ref="lineChartRef" class="echart" /> | ||||
|     </div> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script setup lang="ts"> | ||||
| import { ref, onMounted, onUnmounted, nextTick } from "vue" | ||||
| import Title from './title.vue' | ||||
| import * as echarts from 'echarts'; | ||||
|  | ||||
| // 饼图相关 | ||||
| const pieChartRef = ref<HTMLDivElement | null>(null); | ||||
| let pieChart: any = null; | ||||
|  | ||||
| // 折线图相关 | ||||
| const lineChartRef = ref<HTMLDivElement | null>(null); | ||||
| let lineChart: any = null; | ||||
|  | ||||
| // 饼图数据 | ||||
| const pieData = [ | ||||
|   { name: '桩点浇筑', value: 13 }, | ||||
|   { name: '水泥灌注', value: 7 }, | ||||
|   { name: '箱变安装', value: 40 }, | ||||
|   { name: '支架安装', value: 20 }, | ||||
|   { name: '组件安装', value: 20 }, | ||||
| ] | ||||
|  | ||||
| // 折线图数据 | ||||
| const barData = { | ||||
|   xAxis: ['地块1', '地块2', '地块3', '地块4', '地块5', '地块6'], | ||||
|   series: [ | ||||
|     { | ||||
|       name: '计划流转面积', | ||||
|       data: [70, 25, 45, 115, 70, 85] | ||||
|     }, | ||||
|     { | ||||
|       name: '已流转面积', | ||||
|       data: [105, 30, 150, 65, 80, 200] | ||||
|     } | ||||
|   ] | ||||
| } | ||||
|  | ||||
| // 饼图配置 | ||||
| const pieOption = { | ||||
|   series: { | ||||
|     type: 'pie', | ||||
|     data: pieData, | ||||
|     radius: [50, 80], | ||||
|     itemStyle: { | ||||
|       borderColor: '#fff', | ||||
|       borderWidth: 1 | ||||
|     }, | ||||
|     label: { | ||||
|       alignTo: 'edge', | ||||
|       formatter: '{name|{b}}\n{percent|{c} %}', | ||||
|       minMargin: 10, | ||||
|       edgeDistance: 20, | ||||
|       lineHeight: 15, | ||||
|       rich: { | ||||
|         name: { | ||||
|           fontSize: 12, | ||||
|           color: '#fff' | ||||
|         }, | ||||
|         percent: { | ||||
|           fontSize: 12, | ||||
|           color: '#fff' | ||||
|         } | ||||
|       } | ||||
|     }, | ||||
|     legend: { | ||||
|       top: 'bottom' | ||||
|     }, | ||||
|   } | ||||
| }; | ||||
|  | ||||
| // 柱状图配置 | ||||
| const barOption = { | ||||
|   legend: { | ||||
|     data: ['计划流转面积', '已流转面积'], | ||||
|     top: 0 | ||||
|   }, | ||||
|   grid: { | ||||
|     left: '3%', | ||||
|     right: '4%', | ||||
|     bottom: '3%', | ||||
|     containLabel: true | ||||
|   }, | ||||
|   xAxis: { | ||||
|     type: 'category', | ||||
|     data: barData.xAxis | ||||
|   }, | ||||
|   yAxis: { | ||||
|     name: '单位:m²', | ||||
|     type: 'value', | ||||
|     axisLabel: { | ||||
|       formatter: '{value}' | ||||
|     } | ||||
|   }, | ||||
|   series: [ | ||||
|     { | ||||
|       type: 'bar', | ||||
|       data: [], // 空数据,仅用于承载markArea | ||||
|       markArea: { | ||||
|         silent: true, // 背景不响应交互 | ||||
|         data: (() => { | ||||
|           const groupCount = 3; // 共3组(6个月 ÷ 2) | ||||
|           const groupWidth = 1.8; // 每组背景宽度(覆盖2根柱子) | ||||
|           const bgData = []; | ||||
|  | ||||
|           for (let i = 0; i < groupCount; i++) { | ||||
|             const startX = i * 2 - 0.9; // 每组起始位置 | ||||
|             const endX = startX + groupWidth; // 每组结束位置 | ||||
|             bgData.push([ | ||||
|               { xAxis: startX, yAxis: 0 }, | ||||
|               { xAxis: endX, yAxis: 100 } | ||||
|             ]); | ||||
|           } | ||||
|           return bgData; | ||||
|         })(), | ||||
|         itemStyle: { | ||||
|           color: 'rgba(255, 255, 255, 0.05)', | ||||
|           borderRadius: 4 | ||||
|         } | ||||
|       } | ||||
|     }, | ||||
|     { | ||||
|       name: '计划流转面积', | ||||
|       type: 'bar', | ||||
|       data: barData.series[0].data, | ||||
|       barWidth: 15, // 柱形宽度 | ||||
|       itemStyle: { | ||||
|         color: 'rgb(29, 253, 253)' | ||||
|       }, | ||||
|     }, | ||||
|     { | ||||
|       name: '已流转面积', | ||||
|       type: 'bar', | ||||
|       data: barData.series[1].data, | ||||
|       barWidth: 15, | ||||
|       itemStyle: { | ||||
|         color: '#rgb(25, 181, 251)' | ||||
|       }, | ||||
|     } | ||||
|   ] | ||||
| }; | ||||
|  | ||||
| // 初始化饼图 | ||||
| const initPieChart = () => { | ||||
|   if (!pieChartRef.value) { | ||||
|     console.error('未找到饼图容器元素'); | ||||
|     return; | ||||
|   } | ||||
|   pieChart = echarts.init(pieChartRef.value, null, { | ||||
|     renderer: 'canvas', | ||||
|     useDirtyRect: false | ||||
|   }); | ||||
|   pieChart.setOption(pieOption); | ||||
| } | ||||
|  | ||||
| // 初始化折线图 | ||||
| const initLineChart = () => { | ||||
|   if (!lineChartRef.value) { | ||||
|     console.error('未找到折线图容器元素'); | ||||
|     return; | ||||
|   } | ||||
|   lineChart = echarts.init(lineChartRef.value, null, { | ||||
|     renderer: 'canvas', | ||||
|     useDirtyRect: false | ||||
|   }); | ||||
|   lineChart.setOption(barOption); | ||||
| } | ||||
|  | ||||
| // 响应窗口大小变化 | ||||
| const handleResize = () => { | ||||
|   if (pieChart) pieChart.resize(); | ||||
|   if (lineChart) lineChart.resize(); | ||||
| }; | ||||
|  | ||||
| // 组件挂载时初始化图表 | ||||
| onMounted(() => { | ||||
|   nextTick(() => { | ||||
|     initPieChart(); | ||||
|     initLineChart(); | ||||
|     window.addEventListener('resize', handleResize); | ||||
|   }); | ||||
| }); | ||||
|  | ||||
| // 组件卸载时清理 | ||||
| onUnmounted(() => { | ||||
|   window.removeEventListener('resize', handleResize); | ||||
|   if (pieChart) { | ||||
|     pieChart.dispose(); | ||||
|     pieChart = null; | ||||
|   } | ||||
|   if (lineChart) { | ||||
|     lineChart.dispose(); | ||||
|     lineChart = null; | ||||
|   } | ||||
| }); | ||||
| </script> | ||||
|  | ||||
| <style scoped lang="scss"> | ||||
| .leftPage { | ||||
|   display: flex; | ||||
|   flex-direction: column; | ||||
|   width: calc(25vw - 30px); | ||||
|   margin: 0 15px; | ||||
|   height: 100%; | ||||
|  | ||||
|   .topPage, | ||||
|   .endPage { | ||||
|     display: flex; | ||||
|     flex-direction: column; | ||||
|     align-items: center; | ||||
|     width: 100%; | ||||
|     padding: 15px 0; | ||||
|     border: 1px solid rgba(29, 214, 255, 0.1); | ||||
|     box-sizing: border-box; | ||||
|   } | ||||
|  | ||||
|   .endPage { | ||||
|     flex: 1; | ||||
|     margin-top: 23px; | ||||
|  | ||||
|     .echart { | ||||
|       width: 100%; | ||||
|       height: 100%; | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
| .content { | ||||
|   margin: 10px 35px; | ||||
|  | ||||
|   .content_item { | ||||
|     font-size: 14px; | ||||
|     font-weight: 400; | ||||
|     color: rgba(230, 247, 255, 1); | ||||
|     margin-bottom: 10px; | ||||
|  | ||||
|     &:last-child { | ||||
|       margin-bottom: 0; | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
| .ellipse { | ||||
|   overflow: hidden; | ||||
|   text-overflow: ellipsis; | ||||
|   white-space: nowrap; | ||||
| } | ||||
|  | ||||
| .subfont { | ||||
|   color: rgba(138, 149, 165, 1); | ||||
| } | ||||
| </style> | ||||
							
								
								
									
										45
									
								
								src/views/ProjectScreen/components/title.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								src/views/ProjectScreen/components/title.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,45 @@ | ||||
| <template> | ||||
|     <div class="title"> | ||||
|         <div class="title_icon"> | ||||
|             <img src="@/assets/projectLarge/section.svg" alt=""> | ||||
|             <img src="@/assets/projectLarge/border.svg" alt=""> | ||||
|         </div> | ||||
|         <div v-if="prefix"> | ||||
|             <img src="@/assets/projectLarge/robot.svg" alt="" style="width: 20px; height: 20px;margin-right: 5px;"> | ||||
|         </div> | ||||
|         <div>{{ title }}</div> | ||||
|     </div> | ||||
| </template> | ||||
|  | ||||
| <script setup lang="ts"> | ||||
| defineProps({ | ||||
|     title: { | ||||
|         type: String, | ||||
|         default: '标题' | ||||
|     }, | ||||
|     prefix: { | ||||
|         type: Boolean, | ||||
|         default: false | ||||
|     } | ||||
| }) | ||||
| </script> | ||||
|  | ||||
| <style scoped lang="scss"> | ||||
| .title { | ||||
|     width: 100%; | ||||
|     display: flex; | ||||
|     align-items: center; | ||||
|     gap: 3px; | ||||
|     font-family: 'AlimamaShuHeiTi', sans-serif; | ||||
|  | ||||
|     .title_icon { | ||||
|         position: relative; | ||||
|  | ||||
|         &>img:last-child { | ||||
|             position: absolute; | ||||
|             bottom: 4px; | ||||
|             left: 0; | ||||
|         } | ||||
|     } | ||||
| } | ||||
| </style> | ||||
							
								
								
									
										46
									
								
								src/views/ProjectScreen/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								src/views/ProjectScreen/index.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,46 @@ | ||||
| <template> | ||||
|   <div class="large-screen"> | ||||
|     <Header /> | ||||
|     <div class="nav"> | ||||
|       <leftPage /> | ||||
|       <centerPage /> | ||||
|       <rightPage /> | ||||
|     </div> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script setup lang="ts"> | ||||
| import Header from './components/header.vue'; | ||||
| import leftPage from './components/leftPage.vue'; | ||||
| import centerPage from './components/centerPage.vue'; | ||||
| import rightPage from './components/rightPage.vue'; | ||||
|  | ||||
| </script> | ||||
|  | ||||
| <style lang="scss" scoped> | ||||
| .large-screen { | ||||
|   width: 100vw; | ||||
|   height: 100vh; | ||||
|   background: url('@/assets/large/bg.png') no-repeat; | ||||
|   background-size: 100% 100%; | ||||
|   background-color: rgba(4, 7, 17, 1); | ||||
| } | ||||
|  | ||||
| .nav { | ||||
|   display: flex; | ||||
|   gap: 15rpx; | ||||
|   width: 100%; | ||||
|   height: calc(100vh - 100px); | ||||
|   box-sizing: border-box; | ||||
|   color: #fff; | ||||
| } | ||||
|  | ||||
| .nav_left, | ||||
| .nav_right { | ||||
|   margin: 0 15px 15px 15px; | ||||
| } | ||||
|  | ||||
| .nav_center { | ||||
|   margin-bottom: 15px; | ||||
| } | ||||
| </style> | ||||
		Reference in New Issue
	
	Block a user