添加首页

main
junhong 2 weeks ago
parent 82d3b5c675
commit 07c98707a8
  1. BIN
      web/src/assets/images/datacontentbj.png
  2. BIN
      web/src/assets/images/datatitle.png
  3. BIN
      web/src/assets/images/jg.png
  4. BIN
      web/src/assets/images/riqi.png
  5. 41
      web/src/echarts.js
  6. 165
      web/src/views/large-screen/echartsOptions.js
  7. 395
      web/src/views/large-screen/index.vue

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -0,0 +1,41 @@
import * as echarts from "echarts";
export function echart({
id,
grid,
fn,
changbs,
val,
chat
}) {
// let myChart = chat ? chat : null
let myChart = null
// if (val) {
// }
let dom = document.getElementById(id)
dom.removeAttribute('_echarts_instance_');
myChart = echarts.init(document.getElementById(id));
// myChart.clear()
const option = grid
myChart.on('click', function (params) {
if (fn) fn(params, myChart)
});
myChart.on('geoRoam', function (params) {
var option = myChart.getOption();
if (option.geo) {
var geo = option.series[0]; // 获取当前地图的配置
// 更新其他地图的 zoom 和 center 属性
// option.series[1].label.rich.name.fontSize = 16 * geo.zoom
// option.series[1].label.rich.pt.fontSize = 14 * geo.zoom
// option.series[1].label.fontSize = 14 * geo.zoom
option.geo[0].zoom = geo.zoom;
option.geo[0].center = geo.center;
myChart.setOption(option, true, false);
}
});
myChart.setOption(option, true);
window.addEventListener("resize", function () {
myChart.resize();
});
return myChart;
}

@ -0,0 +1,165 @@
import * as echarts from "echarts";
// import 'echarts-liquidfill/src/liquidFill.js'; //在这里引入
export function echartsBing({ }) {
return {
color: ['#fff17d', '#23BDF9'],
// 图表标题
title: {
text: '总数',
subtext: 15,
textStyle: {
color: '#fff',
fontSize: 14,
align: 'center'
},
subtextStyle: {
fontSize: 14,
color: ['#fff'],
verticalAlign: 'center' // 副标题垂直居中
},
left: '25%', // 整体标题水平居中放置,这里用center替代x属性
top: '48%' // 整体标题垂直居中放置,这里用top替代y属性
},
// 图例
legend: [{
center: 'position',
top: '43%',
right: '20%',
icon: 'circle',
itemWidth: 12,
itemHeight: 12,
textStyle: {
color: '#fff',
padding: [0, 0, 0, 5]
},
data: ['施工机械数']
},
{
center: 'position',
top: '57%',
right: '20%',
icon: 'circle',
itemWidth: 12,
itemHeight: 12,
textStyle: {
color: '#fff',
padding: [0, 0, 0, 5]
},
data: ['运输车辆数']
}],
// 系列列表,每个系列通过 type 决定图表类型
series: [{
name: '车辆机械设备分布',
type: 'pie',
radius: ['40%', '60%'], // 环形图内外半径
center: ['30%', '60%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
labelLine: {
show: false
},
data: [
{ value: 75, name: '施工机械数' },
{ value: 25, name: '运输车辆数' }
]
}]
}
}
export function echartsZhu({
ydata,
xdata,
}) {
return {
tooltip: {
trigger: "axis",
},
// 设置折线颜色
// color:['linear-gradient( 90deg, rgba(10,254,239,0) 0%, #0AFEEF 100%'],
xAxis: {
// 类目
type: 'category',
data: xdata ? xdata : [],
// 文字
axisLabel: {
color: '#CEE0E0',
fontSize: 10,
},
// 线
axisLine: {
show: true,
lineStyle: {
color: 'rgba(0,0,0,0.1)',
}
}
},
yAxis: [{
// 值
name: '单位:人',
nameTextStyle: { // 添加这个属性设置名称样式
color: '#CEE0E0',
fontSize: 12, // 可选:设置字体大小
fontWeight: 'normal' // 可选:设置字体粗细
},
type: 'value',
axisLabel: {
color: '#CEE0E0',
},
axisLine: {
show: true,
lineStyle: {
color: 'rgba(0,0,0,0.1)',
}
},
splitLine: { //改变横向网格线的颜色
show: true,
lineStyle: {
color: ['rgb(206,224,224,0.15)'],
width: 1,
type: 'solid'
},
},
}],
grid: {
top: '15%',
left: '7.5%',
bottom: '12%',
right: '3%',
},
series: [{
data: ydata ? ydata : [],
type: 'bar',
name: '人数',
// 柱子宽度
barWidth: 15,
// 柱子间距
barGap: 1,
itemStyle: {
normal: {
label: {
show: true, //开启显示
position: 'top', //在上方显示
textStyle: { //数值样式
color: 'white',
fontSize: 12
}
},
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#0AA0FE',
}, {
offset: 0.5,
color: '#0964a1'
}, {
offset: 1,
color: '#092b48'
}]),
opacity: 1,
}
}
}]
}
}

@ -1,19 +1,409 @@
<template>
<div class="data-screen" element-loading-text="加载中请稍后..." >
<div class="data-screen" element-loading-text="加载中请稍后...">
<!-- v-loading="state.loading" -->
<div class="topheader">
<div class="gradient">
智慧工地数据大屏
</div>
</div>
<div class="main-box">
<div class="top-box">
<!-- 项目介绍 -->
<div class="top-item">
<div class="boxtitle">项目介绍</div>
<div class="boxcontent" style="display: flex;flex-direction: column;">
<div class="displaybox" style="margin-bottom: 10px;">
<div class="diamond"></div>承包商沈阳市某某某建筑公司
</div>
<div class="displaybox" style="margin-bottom: 15px;">
<div class="diamond" style="background-color: #FFAE3C;"></div>工地负责人李海龙
</div>
<div class="chaochu" style="flex: 1;">
项目简介本工程为综合性建筑项目总建筑面积约XX平方米建筑高度XX米结构形式采用XX如框架结构剪力墙结构钢结构等设计使用年限为XX年工程内
容包括以下分部分项工程
地基与基础工程包括基坑开挖桩基施工筏板基础浇筑及地下室结构施工
</div>
</div>
</div>
<!-- 数据概览 -->
<div class="top-item">
<div class="boxtitle">数据概览</div>
<div class="boxcontent">
<div class="overview-top">
<div class="data-font">
<span class="number-font">105<span></span></span>
<span>总工期</span>
</div>
<div class="data-font jbborder">
<span class="number-font">105<span>%</span></span>
<span>工程进度</span>
</div>
<div class="data-font jbborder">
<span class="number-font">105<span></span></span>
<span>已施工</span>
</div>
</div>
<div class="overview-top" style="grid-template-columns: repeat(2, 1fr);border-bottom: 0;">
<div class="data-font ">
<span class="number-font">5<span></span></span>
<span>施工人员</span>
</div>
<div class="data-font jbborder">
<span class="number-font">5<span></span></span>
<span>管理人员</span>
</div>
</div>
</div>
</div>
<!-- 智能资源调度 -->
<div class="top-item">
<div class="boxtitle">智能资源调度</div>
<div class="boxcontent" style="display: flex;flex-direction: column;justify-content: space-around;">
<div>
<div class="jd-title">
<span style="margin-right: auto;">0#厂房建设</span>
<div>
<span>进度</span>
<span style="margin-left: 10px;font-weight: bold;">78%</span>
</div>
</div>
<div style="width: 100%;margin: 8px 0;"><el-progress class="jdt" color="#1FFFDA"
:text-inside="true" :stroke-width="12" :percentage="50">
<span></span>
</el-progress></div>
<div class="jgbox">
<img src="../../assets/images/jg.png" alt="">
工程滞后建议增派人力投入
</div>
</div>
<div style="margin-top: 10px;">
<div class="jd-title">
<span style="margin-right: auto;">0#厂房建设</span>
<div>
<span>进度</span>
<span style="margin-left: 10px;font-weight: bold;">78%</span>
</div>
</div>
<div style="width: 100%;margin: 8px 0;"><el-progress class="jdt" color="#1FFFDA"
:text-inside="true" :stroke-width="12" :percentage="50">
<span></span>
</el-progress></div>
<div class="jgbox">
<img src="../../assets/images/jg.png" alt="">
工程滞后建议增派人力投入
</div>
</div>
</div>
</div>
<!-- 工程日志 -->
<div class="top-item">
<div class="boxtitle">工程日志</div>
<div class="boxcontent"
style="display: flex;flex-direction: column;justify-content: space-around;padding: 15px 20px;">
<div class="log-top">
<div class="tq-box">
<img src="../../assets/images/riqi.png" alt="">
<span>日期</span>
<span>2025/05/06</span>
</div>
<div class="tq-box">
<img src="../../assets/images/riqi.png" alt="">
<span>温度</span>
<span>18</span>
</div>
<div class="tq-box">
<img src="../../assets/images/riqi.png" alt="">
<span>风力</span>
<span>轻风</span>
</div>
<div class="tq-box">
<img src="../../assets/images/riqi.png" alt="">
<span>天气</span>
<span>16-20 多云</span>
</div>
</div>
<div>
<table class="construction-table">
<thead>
<tr>
<th width="23%">现场负责人</th>
<th>联系方式</th>
<th>施工情况</th>
</tr>
</thead>
<tbody>
<tr>
<td>王大勇</td>
<td>13512212323</td>
<td>此处展示当日的一些简单施工情况描述...</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="bottom-box">
<div></div>
<!-- 门禁记录 -->
<div></div>
<!-- 施工人员工种分析 and 车辆机械设备统计 -->
<div class="right-top-item">
<div class="top-item">
<div class="boxtitle">施工人员工种分析</div>
<div class="boxcontent" id="staff">
</div>
</div>
<div class="top-item">
<div class="boxtitle">车辆机械设备统计</div>
<div class="boxcontent" id="car">
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { ref, onMounted, reactive, nextTick } from 'vue'
import { echartsZhu,echartsBing } from "./echartsOptions";
import { echart } from "../../echarts";
const state = reactive({
echartsBing,
echartsZhu,
echart,
loading: false
})
onMounted(() => {
getEcharts()
})
function getEcharts() {
nextTick(() => {
let staff = state.echart({
id: 'staff',
grid: state.echartsZhu({
ydata: [20, 35, 40, 20, 30, 25, 25, 25],
xdata: ["力工", "木工", "瓦工", "电工", "油漆工", "钢筋工", "防水工", "其他"]
}),
});
let car = state.echart({
id: 'car',
grid: state.echartsBing({
}),
});
})
}
</script>
<style scoped lang='scss'>
.right-top-item {
display: grid;
grid-template-columns: 1fr;
grid-template-rows: 1fr 1fr;
grid-gap: 20px;
}
.bottom-box {
width: 100%;
height: calc(66.66% - 20px);
margin-top: 20px;
display: grid;
grid-template-columns: 1fr 2fr 1fr;
grid-gap: 20px;
}
.construction-table {
width: 100%;
border-collapse: collapse;
font-weight: 400;
font-size: 14px;
color: #FFFFFF;
background-color: #08223b;
/* 深蓝色背景,可根据实际需求调整颜色值 */
}
.construction-table th,
.construction-table td {
border: 1px solid #103B54;
/* 蓝色边框,可根据实际需求调整颜色值 */
text-align: left;
padding: 8px 10px;
}
.construction-table th {
background: rgba(50, 165, 210, 0.4);
font-weight: 400;
font-size: 14px;
color: #FFFFFF;
/* 表头背景色,可根据实际需求调整颜色值 */
}
.log-top {
display: grid;
grid-template-columns: repeat(4, 1fr);
// height: 50%;
}
.tq-box {
display: flex;
flex-direction: column;
align-items: center;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 14px;
color: #FFFFFF;
>img {
width: 24px;
height: 24px;
}
>span:nth-child(2) {
margin-top: 5px;
margin-bottom: 8px;
}
}
:deep(.jdt .el-progress-bar__inner),
:deep(.jdt .el-progress-bar__outer) {
border-radius: 0 !important;
}
.jd-title {
display: flex;
align-items: center;
justify-content: flex-end;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 14px;
color: #FFFFFF;
}
.jgbox {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 12px;
color: #FFFFFF;
display: flex;
align-items: center;
>img {
height: 20px;
width: 20px;
margin-right: 5px
}
}
.chaochu {
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
}
.overview-top {
display: grid;
grid-template-columns: repeat(3, 1fr);
border-bottom: 1px solid;
border-image: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1), rgba(255, 255, 255, 0)) 1 1;
height: 50%;
}
.jbborder {
border-left: 1px solid transparent !important;
/* 必须设置边框宽度 */
border-image-source: linear-gradient(to bottom, transparent, white, transparent);
border-image-width: 1;
/* 边框图像宽度与 border-width 匹配 */
border-image-slice: 1;
/* 切片参数 */
}
.data-font {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 14px;
color: #FFFFFF;
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
justify-content: center;
}
.number-font {
font-family: DIN, DIN;
font-weight: 500;
font-size: 24px;
margin-bottom: 10px;
color: #19F7FF;
}
.displaybox {
display: flex;
align-items: center;
}
.diamond {
width: 5px;
height: 5px;
background-color: #3CFFB1;
transform: rotate(45deg);
transform-origin: top left;
margin-right: 5px;
}
.boxcontent {
width: 100%;
height: calc(100% - 47px);
padding: 20px;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 14px;
background: url('../../assets/images/datacontentbj.png') no-repeat;
background-size: 100% 100%;
color: #FFFFFF;
margin-top: 7px;
}
.boxtitle {
width: 100%;
height: 40px;
background: url('../../assets/images/datatitle.png') no-repeat;
background-size: 100% 100%;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 16px;
color: #FFFFFF;
display: flex;
align-items: center;
padding: 0 25px;
}
.top-item {
height: 100%;
overflow: hidden;
}
.top-box {
width: 100%;
height: 33.33%;
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-gap: 20px;
overflow: hidden;
}
.main-box {
width: 100%;
height: calc(100% - 158px);
padding: 0 37px;
padding-bottom: 28px;
}
.topheader {
width: 100%;
height: 158px;
@ -34,7 +424,8 @@ const state = reactive({
.data-screen {
width: 100%;
height: 100vh;
// height: 100vh;
background: #040614;
height: 1080px;
}
</style>
Loading…
Cancel
Save