integrated_traffic_vue/src/views/BI/components/work_safely.vue

288 lines
6.7 KiB
Vue

<template>
<div class="container">
<div class="block1">
<layout-title title="特殊作业状态统计" />
<div class="option">
<div
v-for="(item, index) in data.block1OptionsList"
:key="index"
class="list"
>
<img :src="item.img" alt="" class="img" />
<div class="label">{{ item.label }}</div>
<div class="num">
<count-up :end-val="item.count"></count-up>
</div>
</div>
</div>
</div>
<div class="block2">
<layout-title title="特殊作业类型统计数据" />
<div id="main1" class="option"></div>
</div>
<div class="block3">
<layout-title title="特殊作业记录" />
<div class="option">
<div class="table">
<div class="tr">
<div class="td">序号</div>
<div class="td">作业类型</div>
<div class="td">状态</div>
<div class="td">下一步操作人</div>
</div>
<div v-for="(item, index) in data.block3List" :key="index" class="tr">
<template v-if="index < 10">
<div class="td">{{ index + 1 }}</div>
<div class="td line-1">
<el-tooltip :content="formatWork(item)">{{
formatWork(item)
}}</el-tooltip>
</div>
<div class="td line-1">
<el-tooltip :content="item.STEP_NAME">{{
item.STEP_NAME
}}</el-tooltip>
</div>
<div class="td line-1">
<el-tooltip :content="item.NEXT_STEP_NAME">{{
item.NEXT_STEP_NAME
}}</el-tooltip>
</div>
</template>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup>
import LayoutTitle from "./title.vue";
import CountUp from "vue-countup-v3";
import { reactive } from "vue";
import echarts5 from "../js/echarts5.js";
import { getEightWorks } from "@/request/map";
const data = reactive({
block1OptionsList: [
{
img: new URL("/src/assets/images/map/img4.png", import.meta.url).href,
label: "申请数",
count: 0,
},
{
img: new URL("/src/assets/images/map/img5.png", import.meta.url).href,
label: "审批中",
count: 0,
},
{
img: new URL("/src/assets/images/map/img6.png", import.meta.url).href,
label: "归档数",
count: 0,
},
],
block3List: [],
});
const getData = async () => {
const { staMapCount, monthMapCount, eightworks } = await getEightWorks();
data.block1OptionsList[0].count = staMapCount.total;
data.block1OptionsList[1].count = staMapCount.flowing;
data.block1OptionsList[2].count = staMapCount.finished;
echarts5("main1", monthMapCount);
data.block3List = eightworks.filter((item) => {
return item.NEXT_STEP_ID !== 99 && item.STATUS === 1;
});
};
getData();
const formatWork = (work) => {
let type = "";
switch (work.WORK_TYPE) {
case "HOTWORK":
type = "动火作业";
break;
case "CONFINEDSPACE":
type = "受限空间作业";
break;
case "HIGHWORK":
type = "高处作业";
break;
case "BLINDBOARD":
type = "盲板抽堵作业";
break;
case "CUTROAD":
type = "断路作业";
break;
case "ELECTRICITY":
type = "临时用点作业";
break;
case "HOISTING":
type = "吊装作业";
break;
case "BREAKGROUND":
type = "动土作业";
break;
}
return type + "编号:" + work.CHECK_NO;
};
</script>
<style scoped lang="scss">
.container {
width: 100%;
.block1 {
width: 430px;
.option {
width: 100%;
min-height: 100px;
background-image: linear-gradient(
to bottom,
rgba(0, 0, 0, 0),
rgba(0, 0, 0, 0.8)
);
border: 1px solid;
border-image: linear-gradient(
to bottom,
rgba(58, 122, 149, 0),
rgba(16, 188, 236, 1)
)
1;
border-top: none;
display: flex;
justify-content: space-around;
padding: 20px 0;
text-align: center;
.list {
text-align: center;
width: 33%;
.img {
animation: slideY 2s infinite;
}
.label {
margin-top: 5px;
}
.num {
font-size: 24px;
margin-top: 10px;
background: linear-gradient(to top, #ffffff, #00a8ff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-weight: bold;
font-family: "Pingfang SC", "Microsoft YaHei", "Monospaced Number",
"Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI",
Roboto, "PingFang SC", "Hiragino Sans GB", "Helvetica Neue",
Helvetica, Arial, sans-serif;
text-shadow: 0 0 20px #2c67ec;
}
}
}
}
.block2 {
width: 430px;
margin-top: 10px;
.option {
width: 100%;
min-height: 100px;
background-image: linear-gradient(
to bottom,
rgba(0, 0, 0, 0),
rgba(0, 0, 0, 0.8)
);
border: 1px solid;
border-image: linear-gradient(
to bottom,
rgba(58, 122, 149, 0),
rgba(16, 188, 236, 1)
)
1;
border-top: none;
padding: 20px 0;
height: 225px;
}
}
.block3 {
width: 430px;
margin-top: 10px;
.option {
width: 100%;
min-height: 100px;
background-image: linear-gradient(
to bottom,
rgba(0, 0, 0, 0),
rgba(0, 0, 0, 0.8)
);
border: 1px solid;
border-image: linear-gradient(
to bottom,
rgba(58, 122, 149, 0),
rgba(16, 188, 236, 1)
)
1;
border-top: none;
padding: 10px;
.table {
margin-top: 5px;
.tr {
display: flex;
&:nth-child(odd) {
background-color: rgba(42, 86, 158, 0.53);
}
.td {
flex: 1;
text-align: left;
font-size: 12px;
color: #fff;
padding: 6px 10px;
&:nth-child(1) {
flex-basis: 20px;
}
&:nth-child(2) {
flex-basis: 30%;
}
&:nth-child(4) {
flex-basis: 15%;
}
}
.empty {
flex: 1;
text-align: center;
font-size: 12px;
color: #fff;
padding: 5px;
}
}
}
}
}
@keyframes slideY {
0% {
transform: translateY(0);
}
50% {
transform: translateY(-5px);
}
100% {
transform: translateY(0);
}
}
}
</style>