756 lines
18 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">
2024-05-10 20:33:26 +08:00
<div class="leftTop">
<div class="header">
2024-05-12 00:30:12 +08:00
<div class="hLeft" @click="openDialogData({ index: 8, title: '人员履职情况分析(整改人)' })">人员履职情况分析</div>
2024-05-10 20:33:26 +08:00
<div class="hRight">
<el-date-picker
style="width: 85%"
v-model="dateRange"
type="daterange"
2024-05-11 02:49:17 +08:00
value-format="YYYY-MM-DD"
2024-05-10 20:33:26 +08:00
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
2024-05-12 00:30:12 +08:00
@change="dateChange"
2024-05-10 20:33:26 +08:00
/>
</div>
2024-04-22 23:02:06 +08:00
</div>
2024-05-10 20:33:26 +08:00
<div class="content">
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane :label="'整改人'" name="first"></el-tab-pane>
<el-tab-pane :label="'检查人'" name="second"></el-tab-pane>
<el-tab-pane :label="'按分包单位分析'" name="third"></el-tab-pane>
</el-tabs>
<div class="tabList">
<div>排名</div>
<div v-if="activeIndex === '0' || activeIndex === '1'">姓名</div>
<div v-if="activeIndex === '2'">分包单位</div>
<div v-if="activeIndex === '0' || activeIndex === '2'">整改数量</div>
<div v-if="activeIndex === '1'">发起隐患数</div>
<div>整改率</div>
<div>及时整改率</div>
</div>
<div class="listBox">
<el-scrollbar height="150">
<div v-for="(item, index) in tabList" :key="index" class="listStyle">
<div>{{ index + 1 }}</div>
<div v-if="activeIndex === '0' || activeIndex === '1'">{{ item.workerName }}</div>
<div v-if="activeIndex === '2'" :title="item.enterpriseName">{{ item.enterpriseName }}</div>
<div v-if="activeIndex === '0' || activeIndex === '2'">{{ item.rectifiedNum }}</div>
<div v-if="activeIndex === '1'">{{ item.createDangerNum }}</div>
<div>{{ item.rectifiedNumRatio }}</div>
<div>{{ item.rectifiedNumRatioTimely }}</div>
</div>
</el-scrollbar>
<div class="notoDta" v-if="tabList.length == 0">
<img src="@/assets/images/noData.png" alt="" />
<p>暂无数据</p>
2024-04-22 23:02:06 +08:00
</div>
</div>
2024-05-10 20:33:26 +08:00
</div>
2024-04-22 23:02:06 +08:00
</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 * as echarts from "echarts";
import { selectQualityStatisticsApi } from "@/api/modules/projectOverview";
2024-05-10 20:33:26 +08:00
import { getMemberJobStatusApi, getInspectManStatusApi, getEnterpriseStatusApi } from "@/api/modules/agjtCommandApi";
2024-05-11 02:49:17 +08:00
import { getPersonTypeAndEduStatisticsApi } from "@/api/modules/labor";
2024-05-10 20:33:26 +08:00
import type { TabsPaneContext, ElMessageBox } from "element-plus";
import { GlobalStore } from "@/stores";
const store = GlobalStore();
2024-05-12 00:30:12 +08:00
const emits = defineEmits(["openDialog"]);
2024-05-10 20:33:26 +08:00
const activeName = ref("first");
const activeIndex = ref("0" as any);
const dateRange = ref([]);
const tabList = ref([] as any);
const inspectTabList = ref([] as any);
2024-04-22 23:02:06 +08:00
let listData = ref([
2024-05-10 20:33:26 +08:00
{ 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%,塔吊间各个设备之间的衔接进行全面检查,以防止" },
{ header: "特种作业人员教育", type: 2, content: "1#塔吊报警频次较上周增长60%,塔吊间各个设备之间的衔接进行全面检查,以防止" },
{ header: "特种作业人员教育", type: 2, content: "1#塔吊报警频次较上周增长60%,塔吊间各个设备之间的衔接进行全面检查,以防止" },
{ header: "特种作业人员教育", type: 2, content: "1#塔吊报警频次较上周增长60%,塔吊间各个设备之间的衔接进行全面检查,以防止" }
]);
2024-04-20 17:26:03 +08:00
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: "未教育人员",
2024-05-12 00:30:12 +08:00
// 设置文本颜色
// textStyle: {
// color: '#038cf5'
// },
2024-04-22 23:02:06 +08:00
itemStyle: {
normal: {
color: "#038cf5",
borderWidth: 20
}
}
},
{
2024-05-11 11:07:32 +08:00
value: 0,
2024-04-22 23:02:06 +08:00
show: true,
name: "完成人员",
2024-05-12 00:30:12 +08:00
// 设置文本颜色
// textStyle: {
// color: '#01d6f4'
// }
2024-04-22 23:02:06 +08:00
itemStyle: {
normal: {
color: "#01d6f4",
borderWidth: 20
}
}
},
{
2024-05-11 11:07:32 +08:00
value: 0,
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-05-11 02:49:17 +08:00
// 打开弹窗
2024-05-12 00:30:12 +08:00
const openDialogData = (obj: any) => {
emits("openDialog", obj);
};
const dateChange = () => {
if (activeIndex.value == "0") {
getMemberJobStatusFn();
} else if (activeIndex.value == "1") {
getInspectManStatusFn();
} else if (activeIndex.value == "2") {
getEnterpriseStatusFn();
}
2024-05-11 02:49:17 +08:00
}
//获取人员数据
const getPersonList = async () => {
2024-05-12 00:30:12 +08:00
const res: any = await getPersonTypeAndEduStatisticsApi({
2024-05-11 02:49:17 +08:00
projectSn: store.sn
});
if (res.result) {
2024-05-12 00:30:12 +08:00
dataList2.value[1].value = res.result.personType.toaltPerson.totalPerson;
dataList2.value[2].value = res.result.personType.toaltPerson.totalPerson;
console.log("安全教育智能分析666", res);
drawEchart2();
2024-05-11 02:49:17 +08:00
}
};
2024-05-10 20:33:26 +08:00
// 获取人员履职情况分析数据--整改人
const getMemberJobStatusFn = async () => {
2024-05-12 00:30:12 +08:00
let requestData: any = {
2024-05-11 11:07:32 +08:00
projectSn: store.sn,
pageSize: 5,
pageNo: 1
2024-05-12 00:30:12 +08:00
};
2024-05-13 00:53:00 +08:00
if (dateRange.value && dateRange.value.length > 0) {
2024-05-11 02:49:17 +08:00
requestData.inspectTime_begin = dateRange.value[0];
requestData.inspectTime_end = dateRange.value[1];
}
2024-05-12 00:30:12 +08:00
const res: any = await getMemberJobStatusApi(requestData);
console.log("人员履职情况res--整改人", res);
if (res.result) {
2024-05-11 11:07:32 +08:00
tabList.value = res.result.records;
2024-05-10 20:33:26 +08:00
} else {
tabList.value = [];
}
2024-05-12 00:30:12 +08:00
};
2024-05-10 20:33:26 +08:00
// 获取人员履职情况分析数据--检查人
const getInspectManStatusFn = async () => {
2024-05-12 00:30:12 +08:00
let requestData: any = {
2024-05-11 11:07:32 +08:00
projectSn: store.sn,
pageSize: 5,
pageNo: 1
2024-05-12 00:30:12 +08:00
};
2024-05-13 00:53:00 +08:00
if (dateRange.value && dateRange.value.length > 0) {
2024-05-11 02:49:17 +08:00
requestData.inspectTime_begin = dateRange.value[0];
requestData.inspectTime_end = dateRange.value[1];
}
2024-05-12 00:30:12 +08:00
const res: any = await getInspectManStatusApi(requestData);
console.log("人员履职情况res--检查人", res);
if (res.result) {
2024-05-11 11:07:32 +08:00
tabList.value = res.result.records;
2024-05-10 20:33:26 +08:00
} else {
tabList.value = [];
}
2024-05-12 00:30:12 +08:00
};
2024-05-10 20:33:26 +08:00
// 获取人员履职情况分析数据--按分包单位分析
const getEnterpriseStatusFn = async () => {
2024-05-12 00:30:12 +08:00
let requestData: any = {
2024-05-11 11:07:32 +08:00
projectSn: store.sn,
pageSize: 5,
pageNo: 1
2024-05-12 00:30:12 +08:00
};
2024-05-13 00:53:00 +08:00
if (dateRange.value && dateRange.value.length > 0) {
2024-05-11 02:49:17 +08:00
requestData.inspectTime_begin = dateRange.value[0];
requestData.inspectTime_end = dateRange.value[1];
}
2024-05-12 00:30:12 +08:00
const res: any = await getEnterpriseStatusApi(requestData);
console.log("人员履职情况res--按分包单位分析", res);
if (res.result) {
2024-05-11 11:07:32 +08:00
tabList.value = res.result.records;
2024-05-10 20:33:26 +08:00
} else {
tabList.value = [];
}
2024-05-12 00:30:12 +08:00
};
2024-05-10 20:33:26 +08:00
const handleClick = (tab: TabsPaneContext, event: Event) => {
activeIndex.value = tab.index;
2024-05-12 00:30:12 +08:00
console.log(tab);
if (tab.index == "0") {
2024-05-10 20:33:26 +08:00
getMemberJobStatusFn();
2024-05-12 00:30:12 +08:00
} else if (tab.index == "1") {
2024-05-10 20:33:26 +08:00
getInspectManStatusFn();
2024-05-12 00:30:12 +08:00
} else if (tab.index == "2") {
2024-05-10 20:33:26 +08:00
getEnterpriseStatusFn();
}
console.log("activeIndex", activeIndex.value);
};
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: {
2024-05-10 20:33:26 +08:00
text: "100%",
2024-04-22 23:02:06 +08:00
subtext: "入场三级教育\n完成率",
x: "24%",
y: "center",
textAlign: "center",
textStyle: {
color: "#fff",
fontSize: 26,
2024-05-12 00:30:12 +08:00
fontWeight: "normal"
2024-04-22 23:02:06 +08:00
// align: "center",
// width: "200px",
2024-05-12 00:30:12 +08:00
// fontFamily: "sadigitalNumber"
2024-04-22 23:02:06 +08:00
},
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: {
2024-05-12 00:30:12 +08:00
// color: "#000",
2024-04-22 23:02:06 +08:00
rich: {
name: {
verticalAlign: "right",
align: "left",
fontSize: 14,
color: "#FFFFFF"
},
2024-05-12 00:30:12 +08:00
value1: {
2024-04-22 23:02:06 +08:00
align: "left",
fontSize: 14,
2024-05-12 00:30:12 +08:00
color: "#FBDC00",
fontFamily: "Source Han Sans CN, Source Han Sans CN",
fontWeight: "bold"
},
value2: {
align: "left",
fontSize: 14,
color: "#0DAF27",
fontFamily: "Source Han Sans CN, Source Han Sans CN",
fontWeight: "bold"
},
value3: {
align: "left",
fontSize: 14,
color: "#047EFF",
fontFamily: "Source Han Sans CN, Source Han Sans CN",
fontWeight: "bold"
2024-04-22 23:02:06 +08:00
}
}
},
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-05-12 00:30:12 +08:00
console.log(data, 666777);
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 + "%";
2024-05-12 00:30:12 +08:00
console.log(value, 888);
if (data == "未教育人员") {
return "{name| " + data + "} {gap| }" + "{value1|" + value + " " + "}";
} else if (data == "完成人员") {
return "{name| " + data + "} {gap| }" + "{value2|" + value + " " + "}";
} else if (data == "现场人员") {
return "{name| " + data + "} {gap| }" + "{value3|" + value + " " + "}";
}
2024-04-22 23:02:06 +08:00
}
}
}
}
},
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();
// })
}
2024-05-10 20:33:26 +08:00
onMounted(async () => {
getMemberJobStatusFn();
2024-05-11 02:49:17 +08:00
getPersonList();
2024-04-22 23:02:06 +08:00
});
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-05-10 20:33:26 +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;
2024-05-10 20:33:26 +08:00
border-right: none;
2024-04-22 23:02:06 +08:00
border-bottom: 1px solid #0059ff;
// height: 10%;
2024-05-10 20:33:26 +08:00
.hLeft {
2024-04-21 14:15:04 +08:00
width: 50%;
2024-05-11 11:07:32 +08:00
font-size: 20px;
font-weight: bold;
2024-05-12 00:30:12 +08:00
background-image: linear-gradient(to bottom left, #c8e3ff, #007aff);
2024-05-11 11:07:32 +08:00
-webkit-background-clip: text;
background-clip: text;
color: transparent;
2024-04-20 17:26:03 +08:00
}
2024-05-10 20:33:26 +08:00
.hRight {
2024-04-21 14:15:04 +08:00
width: 50%;
2024-04-20 17:26:03 +08:00
}
}
2024-05-10 20:33:26 +08:00
.content {
2024-04-22 23:02:06 +08:00
height: 90%;
// background-color: #fff;
2024-05-10 20:33:26 +08:00
.contentTop {
2024-04-22 23:02:06 +08:00
height: 40%;
}
2024-05-10 20:33:26 +08:00
.centerBottom {
2024-04-22 23:02:06 +08:00
// width: 100%;
height: 60%;
// background-color: #fff;
position: relative;
2024-05-10 20:33:26 +08:00
.leftTop {
width: 100%;
height: 35%;
.header {
// width: 100%;
// height: 100%;
2024-04-22 23:02:06 +08:00
display: flex;
2024-05-11 11:07:32 +08:00
align-items: center;
2024-05-10 20:33:26 +08:00
justify-content: space-between;
padding: 20px 20px;
border-bottom: 1px solid #0059ff;
.hLeft {
width: 50%;
2024-05-11 11:07:32 +08:00
font-size: 20px;
font-weight: bold;
2024-05-12 00:30:12 +08:00
background-image: linear-gradient(to bottom left, #c8e3ff, #007aff);
2024-05-11 11:07:32 +08:00
-webkit-background-clip: text;
background-clip: text;
color: transparent;
2024-05-10 20:33:26 +08:00
}
.hRight {
width: 50%;
2024-04-22 23:02:06 +08:00
}
}
2024-05-10 20:33:26 +08:00
.content {
padding: 0 20px;
::v-deep .el-tabs__item {
color: #fff;
}
::v-deep .el-tabs__nav-wrap::after {
background-color: rgba(255, 0, 0, 0);
}
.tabList {
display: flex;
width: 100%;
height: 30%;
// background: url("@/assets/images/dustNoise/rightBottom.png") no-repeat;
background-color: #00224f;
background-size: 100% 100%;
left: 75.5%;
top: 75%;
color: #fff;
font-size: 14px;
line-height: 30px;
justify-content: space-around;
text-align: center;
div {
width: 100px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.listBox {
// height: 10%;
.listStyle {
display: flex;
justify-content: space-around;
color: #fff;
height: 12%;
line-height: 25px;
font-size: 12px;
text-align: center;
div {
width: 100px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.listStyle:hover {
background: #003c84;
}
}
.notoDta {
top: 52%;
width: 45%;
left: 28%;
text-align: center;
position: absolute;
img {
width: 40%;
margin: 5% 30%;
}
p {
color: #fff;
font-size: 14px;
margin: -6% 37%;
}
}
2024-04-22 23:02:06 +08:00
}
}
2024-05-10 20:33:26 +08:00
::v-deep .el-input__inner {
color: #fff;
}
::v-deep .el-select .el-input .el-select__caret {
color: #fff;
}
::v-deep .el-input__wrapper {
width: 85%;
height: 0%;
background: #0d2956;
}
::v-deep .el-range-separator {
color: #ccc;
font-size: 10px;
}
::v-deep .el-range-input {
color: #ccc;
font-size: 10px;
}
.dialogContainer {
padding: 0 50px;
// height: 600px;
::v-deep .el-tabs__item {
color: #fff;
}
::v-deep .el-tabs__nav-wrap::after {
background-color: rgba(255, 0, 0, 0);
}
.tabList {
2024-04-22 23:02:06 +08:00
display: flex;
2024-05-10 20:33:26 +08:00
width: 100%;
height: 14%;
background: url("@/assets/images/dustNoise/rightBottom.png") no-repeat;
// background-color: #00224f;
background-size: 100% 100%;
left: 75.5%;
top: 75%;
2024-04-22 23:02:06 +08:00
color: #fff;
2024-05-10 20:33:26 +08:00
font-size: 14px;
line-height: 30px;
justify-content: space-around;
text-align: center;
div {
width: 100px;
2024-04-22 23:02:06 +08:00
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
2024-05-10 20:33:26 +08:00
.listBox {
// height: 10%;
.listStyle {
display: flex;
justify-content: space-around;
color: #fff;
height: 12%;
line-height: 25px;
font-size: 12px;
text-align: center;
div {
width: 100px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.listStyle:hover {
background: #003c84;
}
}
.notoDta {
top: 40%;
width: 30%;
left: 35%;
text-align: center;
position: absolute;
img {
width: 40%;
margin: 5% 30%;
}
p {
color: #fff;
font-size: 14px;
margin: -6% 37%;
}
}
}
::v-deep .el-dialog {
background: url("@/assets/images/commandScreen/dialog-bg.png") no-repeat;
// background-color: #fff;
background-size: 100% 100%;
margin-top: 12%;
}
::v-deep .el-dialog__headerbtn {
right: 35px;
top: 25px;
}
::v-deep .el-dialog .el-dialog__header .el-dialog__title {
margin-left: 30px;
margin-top: 10px;
font-size: 18px;
color: #fff;
position: absolute;
}
::v-deep el-dialog__header {
margin-top: 20px;
2024-04-22 23:02:06 +08:00
}
}
}
2024-04-20 17:26:03 +08:00
}
</style>