476 lines
11 KiB
Vue
Raw Normal View History

2024-04-20 17:26:03 +08:00
<template>
2024-04-21 14:15:04 +08:00
<div class="leftBottom">
<div class="header">
2024-04-22 23:02:06 +08:00
<div class="hLeft">安全教育智能分析</div>
<div class="hRight"></div>
</div>
<div class="content">
<div class="contentTop">
<div id="echartsEdu" style="width: 100%; height: 100%"></div>
2024-04-20 17:26:03 +08:00
</div>
2024-04-22 23:02:06 +08:00
<div class="centerBottom">
<div class="cbHeader">
<div class="cbHeaderInfo">
<div class="cubeIcon"></div>
2024-04-26 18:06:30 +08:00
<div>隐患智能分析</div>
2024-04-22 23:02:06 +08:00
</div>
<div class="cbHeaderLine"></div>
</div>
<div class="cbContent">
2024-04-26 18:06:30 +08:00
<el-scrollbar height="278">
2024-04-22 23:02:06 +08:00
<div class="item" v-for="(item,index) in listData" :key="index">
<div class="itemHead">
<div class="itemHeadInner" v-if="item.type === 1">{{item.header}}</div>
<div class="itemHeadInner2" v-if="item.type === 2">{{item.header}}</div>
</div>
<div class="itemContent">
2024-04-26 18:06:30 +08:00
<el-tooltip class="box-item" effect="dark" :content="item.content" placement="top-start" >
2024-04-22 23:02:06 +08:00
{{item.content}}
</el-tooltip>
</div>
</div>
</el-scrollbar>
</div>
2024-04-21 14:15:04 +08:00
</div>
</div>
2024-04-20 17:26:03 +08:00
</div>
</template>
<script setup lang="ts">
2024-04-22 23:02:06 +08:00
import { onMounted, ref } from "vue";
import { GlobalStore } from "@/stores";
const store = GlobalStore();
import * as echarts from "echarts";
import { selectQualityStatisticsApi } from "@/api/modules/projectOverview";
let listData = ref([
{header: '重大风险',type: 1,content: '正处于吊装施工重大风险作业阶段,请注意在操作前,应对吊装设备进行安全把控'},
{header: '重大风险',type: 1,content: '正处于吊装施工重大风险作业阶段,请注意在操作前,应对吊装设备进行安全把控'},
{header: '重大风险',type: 1,content: '正处于吊装施工重大风险作业阶段,请注意在操作前,应对吊装设备进行安全把控'},
{header: '特种作业人员教育',type: 2,content: '1#塔吊报警频次较上周增长60%,塔吊间各个设备之间的衔接进行全面检查,以防止'},
{header: '特种作业人员教育',type: 2,content: '1#塔吊报警频次较上周增长60%,塔吊间各个设备之间的衔接进行全面检查,以防止'},
{header: '特种作业人员教育',type: 2,content: '1#塔吊报警频次较上周增长60%,塔吊间各个设备之间的衔接进行全面检查,以防止'},
2024-04-27 22:50:10 +08:00
{header: '特种作业人员教育',type: 2,content: '1#塔吊报警频次较上周增长60%,塔吊间各个设备之间的衔接进行全面检查,以防止'},
{header: '特种作业人员教育',type: 2,content: '1#塔吊报警频次较上周增长60%,塔吊间各个设备之间的衔接进行全面检查,以防止'},
2024-04-22 23:02:06 +08:00
{header: '特种作业人员教育',type: 2,content: '1#塔吊报警频次较上周增长60%,塔吊间各个设备之间的衔接进行全面检查,以防止'},
])
2024-04-20 17:26:03 +08:00
2024-04-22 23:02:06 +08:00
let questionTotal = ref(0 as any);
2024-04-27 13:41:13 +08:00
let dataList2 = ref([
2024-04-22 23:02:06 +08:00
{
2024-04-28 16:48:53 +08:00
value: 0,
2024-04-22 23:02:06 +08:00
show: true,
name: "未教育人员",
itemStyle: {
normal: {
color: "#038cf5",
borderWidth: 20
}
}
},
{
2024-04-28 16:48:53 +08:00
value: 765,
2024-04-22 23:02:06 +08:00
show: true,
name: "完成人员",
itemStyle: {
normal: {
color: "#01d6f4",
borderWidth: 20
}
}
},
{
2024-04-28 16:48:53 +08:00
value: 765,
2024-04-22 23:02:06 +08:00
show: true,
name: "现场人员",
itemStyle: {
normal: {
color: "#03e9f6",
borderWidth: 20
}
2024-04-20 17:26:03 +08:00
}
}
2024-04-22 23:02:06 +08:00
]);
2024-04-27 13:41:13 +08:00
2024-04-22 23:02:06 +08:00
function Pie() {
let dataArr = [];
for (var i = 0; i < 150; i++) {
if (i % 2 === 0) {
dataArr.push({
name: (i + 1).toString(),
value: 10,
itemStyle: {
normal: {
color: "#7cf4f1",
borderWidth: 0,
borderColor: "#7f6546"
}
}
});
} else {
dataArr.push({
name: (i + 1).toString(),
value: 10,
itemStyle: {
normal: {
color: "rgba(0,0,0,0)",
borderWidth: 0,
borderColor: "rgba(0,0,0,0)"
}
}
});
}
}
return dataArr;
}
2024-04-27 13:41:13 +08:00
function drawEchart2() {
2024-04-22 23:02:06 +08:00
let echartsTest = echarts.init(document.getElementById("echartsEdu"));
let option = {
tooltip: {
trigger: "item"
},
title: {
// text: questionTotal.value,
text: '100%',
subtext: "入场三级教育\n完成率",
x: "24%",
y: "center",
textAlign: "center",
textStyle: {
color: "#fff",
fontSize: 26,
fontWeight: "normal",
// align: "center",
// width: "200px",
fontFamily: "sadigitalNumber"
},
subtextStyle: {
color: "#ccc",
fontSize: 12,
fontWeight: "normal"
// align: "center",
}
},
legend: {
selectedMode: false, // 取消图例上的点击事件
icon: "rect",
type: "plain",
orient: "vertical",
left: "55%",
top: "28%",
align: "left",
itemGap: 30,
itemWidth: 8, // 设置宽度
itemHeight: 7, // 设置高度
symbolKeepAspect: false,
textStyle: {
color: "#000",
rich: {
name: {
verticalAlign: "right",
align: "left",
fontSize: 14,
color: "#FFFFFF"
},
value: {
align: "left",
fontSize: 14,
color: "#FFFFFF"
}
}
},
2024-04-27 13:41:13 +08:00
data: dataList2.value.map(item => {
2024-04-22 23:02:06 +08:00
if (item.show) {
return item.name;
}
}),
formatter: function (data) {
2024-04-27 13:41:13 +08:00
if (dataList2.value && dataList2.value.length) {
for (var i = 0; i < dataList2.value.length; i++) {
if (data === dataList2.value[i].name) {
var value = dataList2.value[i].value;
2024-04-22 23:02:06 +08:00
var percentage = value + "%";
return "{name| " + data + "} {gap| }" + "{value|" + value + " " + "}";
}
}
}
}
},
series: [
// 外侧光线
{
name: "",
type: "gauge",
center: ["25%", "55%"],
radius: "90%",
startAngle: 235,
endAngle: -50,
min: 0,
max: 100,
axisLine: {
show: true,
lineStyle: {
width: 2,
color: [
[
100 / 100,
new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{
offset: 0,
color: "#526277"
},
{
offset: 0.25,
color: "rgba(4, 14, 54,0.4)"
},
{
offset: 0.7,
color: "rgba(4, 14, 54,0.4)"
},
{
offset: 1,
color: "#526277"
}
])
],
[1, "rgba(255,255,255,0)"]
]
}
},
axisTick: {
show: 0
},
splitLine: {
show: 0
},
axisLabel: {
show: 0
},
pointer: {
show: 0
},
detail: {
show: 0
}
},
{
name: "",
type: "gauge",
center: ["25%", "55%"],
radius: "80%",
startAngle: 245,
endAngle: -115,
min: 0,
max: 100,
axisLine: {
show: true,
lineStyle: {
width: 2,
color: [
[
200 / 100,
new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{
offset: 0.8,
color: "#52bef0"
},
{
offset: 0.5,
color: "#13356b"
}
])
],
[1, "rgba(255,255,255,0)"]
]
}
},
axisTick: {
show: 0
},
splitLine: {
show: 0
},
axisLabel: {
show: 0
},
pointer: {
show: 0
},
detail: {
show: 0
}
},
{
name: "",
type: "pie",
radius: [65, 75],
center: ["25%", "55%"],
hoverAnimation: true,
itemStyle: {
borderRadius: 10,
borderWidth: 10
},
label: {
show: false,
position: "center"
},
emphasis: {
label: {
show: false
}
},
labelLine: {
show: false
},
2024-04-27 13:41:13 +08:00
data: dataList2.value
2024-04-22 23:02:06 +08:00
},
{
type: "pie",
radius: ["57", "60"],
center: ["25%", "55%"],
label: {
show: false
},
data: Pie()
}
]
};
echartsTest.setOption(option, true);
// window.addEventListener("resize", () => {
// console.log(666)
// echartsTest.resize();
// })
}
//获取质量管理
// const safeData = ref(null as any);
const qualityInfo = async () => {
const res: any = await selectQualityStatisticsApi({ projectSn: store.sn });
2024-04-28 16:48:53 +08:00
// dataList2.value[0].value = res.result.total.rectificationNum;
// dataList2.value[1].value = res.result.total.totalNum - res.result.total.rectificationNum;
2024-04-22 23:02:06 +08:00
questionTotal.value = res.result.total.totalNum;
2024-04-27 13:41:13 +08:00
drawEchart2();
2024-04-22 23:02:06 +08:00
};
//将方法暴露给父组件
defineExpose({
qualityInfo
})
onMounted( async () => {
qualityInfo();
});
2024-04-20 17:26:03 +08:00
</script>
<style lang="scss" scoped>
2024-04-21 14:15:04 +08:00
.leftBottom {
background: url("@/assets/images/commandScreen/card-left-bottom.png") no-repeat;
background-size: 100% 100%;
2024-04-22 23:02:06 +08:00
height: 100%;
2024-04-21 14:15:04 +08:00
.header{
2024-04-20 17:26:03 +08:00
display: flex;
2024-04-21 14:15:04 +08:00
justify-content: space-between;
padding: 20px 20px;
2024-04-22 23:02:06 +08:00
border-top: none;
border-left: none;
border-right: none;
border-bottom: 1px solid #0059ff;
// height: 10%;
2024-04-21 14:15:04 +08:00
.hLeft{
width: 50%;
color: white;
2024-04-20 17:26:03 +08:00
}
2024-04-21 14:15:04 +08:00
.hRight{
width: 50%;
2024-04-20 17:26:03 +08:00
}
}
2024-04-22 23:02:06 +08:00
.content{
height: 90%;
// background-color: #fff;
.contentTop{
height: 40%;
}
.centerBottom{
// width: 100%;
height: 60%;
// background-color: #fff;
padding: 0 20px;
position: relative;
.cbHeader{
width:100%;
height: 40px;
// background-color: darkred;
.cbHeaderInfo{
color: #fff;
display: flex;
justify-content: flex-start;
align-items: center;
.cubeIcon{
width: 36px;
height: 36px;
// background-color: #fff;
background: url("@/assets/images/commandScreen/head-cube.png") no-repeat;
background-size: 100% 100%;
// margin-left: -5px;
margin: 0 3px 0 -5px;
}
}
.cbHeaderLine{
height: 4px;
width: 100%;
// background-color: darkblue;
background: url("@/assets/images/commandScreen/head-line.png") no-repeat;
background-size: 100% 100%;
}
}
.cbContent{
width: 100%;
height: calc(100% - 40px);
// background: #fff;
.item{
width: 100%;
2024-04-26 18:06:30 +08:00
line-height: 130%;
2024-04-22 23:02:06 +08:00
display: flex;
align-items: center;
justify-content: flex-start;
// background-color: green;
color: #fff;
.itemHead{
white-space: nowrap;
.itemHeadInner{
font-size: 16px;
border: 1px solid #f77c7d;
box-shadow: 0 0 0 1px #f77c7d;
background: rgba(247,124,125, 0.4);
border-radius: 3px;
padding: 0 15px;
margin: 9px 0;
margin-left: 2px;
}
.itemHeadInner2{
font-size: 16px;
border: 1px solid #56a8f8;
box-shadow: 0 0 0 1px #56a8f8;
background: rgba(86,168,248, 0.4);
border-radius: 3px;
padding: 0 15px;
margin: 9px 0;
margin-left: 2px;
}
}
.itemContent{
margin-left: 10px;
font-size: 15px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
}
}
2024-04-20 17:26:03 +08:00
}
</style>