445 lines
11 KiB
Vue
Raw Normal View History

2024-04-27 18:46:11 +08:00
<template>
<div class="political-outlook">
<div class="content">
<div class="top-data-show">
<div class="top-left">
2024-05-12 00:30:12 +08:00
<el-date-picker v-model="dateTime" type="month" placeholder="请选择日期" value-format="YYYY-MM" :clearable="false" @change="dateChange"/>
2024-05-11 21:21:47 +08:00
<el-calendar v-model="calendarVal" style="width: 95%; margin-top: 15px"/>
2024-04-27 18:46:11 +08:00
</div>
<div class="top-right">
<div class="right-title-data">
<div>
2024-05-11 19:15:44 +08:00
<span>{{ topStatisticData.count }}</span>
2024-04-27 18:46:11 +08:00
<span></span>
</div>
<span>本月影响天数</span>
</div>
<div class="right-inspect-data">
<div class="inspect-data-item">
<div class="inspect-style inspect-one"></div>
2024-05-11 19:15:44 +08:00
<span>人为因素</span>
<span>{{ topStatisticData.data?topStatisticData.data[0].count:0 }}</span>
2024-04-27 18:46:11 +08:00
</div>
<div class="inspect-data-item">
<div class="inspect-style inspect-two"></div>
2024-05-11 19:15:44 +08:00
<span>环境因素</span>
<span>{{ topStatisticData.data?topStatisticData.data[1].count:0 }}</span>
2024-04-27 18:46:11 +08:00
</div>
<div class="inspect-data-item">
<div class="inspect-style inspect-three"></div>
2024-05-11 19:15:44 +08:00
<span>不可抗力因素</span>
<span>{{ topStatisticData.data?topStatisticData.data[2].count:0 }}</span>
2024-04-27 18:46:11 +08:00
</div>
</div>
</div>
</div>
<div class="table-one">
<div class="tabList">
<div>序号</div>
2024-05-11 21:21:47 +08:00
<div>区域</div>
<div>单位名称</div>
<div>延期误工类型</div>
<div>延期误工原因</div>
<div>图片</div>
2024-04-27 18:46:11 +08:00
</div>
<el-scrollbar class="listBox" ref="refScrollbar">
<div v-for="(item, index) in partyMemberList" class="listStyle" :key="item.id">
<div>{{ index + 1 }}</div>
2024-05-11 21:21:47 +08:00
<div>{{ item.regionName }}</div>
<div>{{ item.enterpriseName }}</div>
<div>{{ item.delayEventType == 1 ? "人为因素" : item.personType == 2 ? "环境因素" : "不可抵抗因素" }}</div>
<div>{{ item.delayEventReason }}</div>
2024-04-27 18:46:11 +08:00
<div class="list-img">
<el-image
fit="contain"
class="el-img"
2024-05-11 21:21:47 +08:00
:src="BASEURL + '/image/' + item.image"
:preview-src-list="[BASEURL + '/image/' + item.image]"
2024-04-27 18:46:11 +08:00
>
</el-image>
<!-- <img :src="item.fieldAcquisitionUrl" alt="" srcset=""> -->
</div>
</div>
<div class="notoDta" v-if="partyMemberList.length == 0">
<img src="@/assets/images/noData.png" alt="" />
<p>暂无数据</p>
</div>
</el-scrollbar>
</div>
</div>
</div>
</template>
<script lang="ts" setup>
2024-05-11 21:21:47 +08:00
import { ref, onMounted, watch } from "vue";
2024-04-27 18:46:11 +08:00
import { GlobalStore } from "@/stores";
2024-05-11 21:21:47 +08:00
import { getDelayEventTypeApi, getProgressContentApi } from "@/api/modules/agjtCommandApi";
2024-05-11 19:15:44 +08:00
import moment from "moment";
2024-04-27 18:46:11 +08:00
const store = GlobalStore();
const props = defineProps(["tip"]);
const BASEURL = import.meta.env.VITE_API_URL;
2024-05-11 19:15:44 +08:00
const dateTime:any = ref(null);
2024-05-11 21:21:47 +08:00
const calendarVal:any = ref();
2024-04-27 18:46:11 +08:00
let pageNo = ref(1 as any);
let moreScroll = ref(true as any);
const refScrollbar = ref(null as any); // 绑定到滚动的盒子上
2024-05-11 21:21:47 +08:00
const tableParams = ref({
calendarVal: ""
})
2024-04-27 18:46:11 +08:00
const partyMemberList = ref({} as any);
2024-05-11 19:15:44 +08:00
const topStatisticData = ref({} as any)
2024-05-12 00:30:12 +08:00
// 日期切换
const dateChange = async () => {
calendarVal.value = dateTime.value
};
2024-05-11 19:15:44 +08:00
// 获取顶部数据
const getDelayEventTypeFn = async () => {
let requestData: any = {
2024-04-27 18:46:11 +08:00
projectSn: store.sn,
2024-05-11 21:21:47 +08:00
auditType: 2,
month: dateTime.value
2024-04-27 18:46:11 +08:00
};
2024-05-11 19:15:44 +08:00
const res: any = await getDelayEventTypeApi(requestData);
console.log("获取天气顶部统计数据", res);
topStatisticData.value = res.result;
2024-04-27 18:46:11 +08:00
};
//获取数据
const getMemberCountList = async (tip: any) => {
let requestData: any = {
projectSn: store.sn,
2024-05-11 21:21:47 +08:00
auditType: 2,
date: tableParams.value.calendarVal,
2024-04-27 18:46:11 +08:00
pageNo: tip == "search" ? 1 : pageNo.value,
pageSize: 100
};
2024-05-11 21:21:47 +08:00
const res: any = await getProgressContentApi(requestData);
2024-04-27 18:46:11 +08:00
console.log("获取人员信息列表", res);
if (tip == "more") {
partyMemberList.value = partyMemberList.value.concat(res.result.records);
} else {
partyMemberList.value = res.result.records;
}
// 为图片拼接IP
// partyMemberList.value.map((item:any) => {
// item.fieldAcquisitionUrl = BASEURL + '/image/' + item.fieldAcquisitionUrl
// })
if (res.result.pages == pageNo.value) {
moreScroll.value = false;
} else {
pageNo.value = pageNo.value + 1;
}
};
2024-05-11 21:21:47 +08:00
watch(
() => calendarVal.value,
newVal => {
// console.log(newVal, "newVal");
if (newVal) {
// props.xData = newVal;
2024-05-12 00:30:12 +08:00
console.log(newVal)
2024-05-11 21:21:47 +08:00
tableParams.value.calendarVal = moment(newVal).format("YYYY-MM-DD")
2024-05-12 00:30:12 +08:00
dateTime.value = moment(newVal).format("YYYY-MM-DD")
2024-05-11 21:21:47 +08:00
getMemberCountList("search");
}
}
);
2024-04-27 18:46:11 +08:00
onMounted(async () => {
2024-05-11 21:21:47 +08:00
dateTime.value = moment(new Date()).format("YYYY-MM")
calendarVal.value = moment(new Date()).format("YYYY-MM-DD")
2024-05-11 19:15:44 +08:00
await getDelayEventTypeFn();
2024-04-27 18:46:11 +08:00
await getMemberCountList("search");
refScrollbar.value.wrapRef.addEventListener("scroll", (e: any) => {
// console.log("滚动容器", e);
const scrollTop = e.target.scrollTop;
const scrollHeight = e.target.scrollHeight;
const clientHeight = e.target.clientHeight;
// console.log("滚动容器", scrollTop, scrollHeight, clientHeight);
// 向上加载更多
if (scrollTop >= scrollHeight - clientHeight - 1) {
// console.log("加载更多");
if (moreScroll.value) {
getMemberCountList("more");
}
}
});
});
</script>
<style lang="scss" scoped>
@mixin flex {
display: flex;
align-items: center;
}
.political-outlook {
height: 97%;
margin: 0 60px;
.content {
height: 95%;
width: 100%;
margin-top: 10px;
// background: url("@/assets/images/cardImg.png") no-repeat;
background-size: 100% 100%;
padding: 20px 15px;
.top-statistics {
display: grid;
grid-gap: 20px;
grid-template-columns: repeat(3, 1fr);
color: white;
margin: 0 5%;
.statistics-item {
width: 240px;
height: 95px;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
position: relative;
.title {
position: absolute;
top: 4%;
left: 4%;
}
&-content {
display: inline-block;
width: 50%;
height: auto;
text-indent: 1.5em;
}
&-content:nth-child(2) {
margin-top: 8%;
}
&-content:nth-child(3) {
margin-top: 8%;
}
}
.statistics-item:nth-child(1) {
background: url("@/assets/images/commandScreen/bg6.png") no-repeat;
background-size: 100% 100%;
}
.statistics-item:nth-child(2) {
background: url("@/assets/images/commandScreen/bg2.png") no-repeat;
background-size: 100% 100%;
}
.statistics-item:nth-child(3) {
background: url("@/assets/images/commandScreen/bg4.png") no-repeat;
background-size: 100% 100%;
}
.statistics-item:nth-child(4) {
background: url("@/assets/images/commandScreen/bg1.png") no-repeat;
background-size: 100% 100%;
}
.statistics-item:nth-child(5) {
background: url("@/assets/images/commandScreen/bg3.png") no-repeat;
background-size: 100% 100%;
}
.statistics-item:nth-child(6) {
background: url("@/assets/images/commandScreen/bg5.png") no-repeat;
background-size: 100% 100%;
}
}
.top-data-show {
display: flex;
.top-left {
width: 60%;
display: flex;
flex-direction: column;
:deep() {
.el-calendar {
background-color: transparent;
}
.el-calendar__header {
display: none;
}
.el-calendar__body {
padding: 0px;
}
.el-calendar-table thead {
background-color: #143a85;
th {
color: white;
}
th:nth-child(1) {
border-left: 1px solid #284a8e;
}
th:last-child {
border-right: 1px solid #284a8e;
}
}
.el-calendar-table .el-calendar-day:hover {
color: white;
background-color: #143a85;
}
2024-05-11 19:15:44 +08:00
.el-calendar-table td.is-today,.el-calendar-table td.is-selected {
2024-04-27 18:46:11 +08:00
color: white;
background-color: #143a85;
}
.el-calendar-table tbody {
.el-calendar-table__row {
.prev,
.current,
2024-05-11 19:15:44 +08:00
.next{
2024-04-27 18:46:11 +08:00
border-color: #35538c;
color: white;
.el-calendar-day {
text-align: center;
height: 40px;
}
}
}
}
}
}
.top-right {
width: 40%;
color: white;
.right-title-data {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
> div {
span:nth-child(1) {
font-size: 18px;
margin-right: 5px;
}
}
> span {
margin-top: 5px;
}
}
.right-inspect-data{
margin-top: 12%;
.inspect-data-item{
display: flex;
align-items: center;
margin-bottom: 3%;
.inspect-style{
width: 10px;
height: 10px;
border: 1px solid #fff;
margin-right: 5px;
margin-top: 2px;
}
.inspect-one{
background-color: #EE1A1A;
}
.inspect-two{
background-color: #079CAF;
}
.inspect-three{
background-color: #FFDF00;
}
>span:nth-child(2){
margin-right: auto
}
>span:nth-child(3){
margin-right: 10px;
}
}
}
}
}
.table-one {
height: 50%;
.tabList {
display: flex;
// width: 100%;
height: 10%;
background: url("@/assets/images/vehicleManagement/ListTitleImg.png") no-repeat;
background-size: 100% 100%;
// position: absolute;
left: 75.5%;
top: 75%;
color: #ccc;
font-size: calc(100vw * 14 / 1920);
line-height: 30px;
align-items: center;
margin-top: 1%;
div {
text-align: center;
width: 17%;
}
}
.listBox {
height: 69%;
.listStyle {
display: flex;
align-items: center;
text-align: center;
color: #fff;
font-size: 12px;
margin-bottom: 5px;
.list-img {
.el-img {
width: 30px;
height: 30px;
img {
display: flex;
align-items: center;
width: 100%;
height: 100%;
}
}
}
div {
width: 17%;
white-space: nowrap; //单行
overflow: hidden;
text-overflow: ellipsis;
}
}
.listStyle:hover {
background: #091f3f;
}
}
}
:deep() {
.el-tabs__item {
color: white;
}
.el-tabs__item.is-active {
color: var(--el-color-primary);
}
}
}
}
.notoDta {
2024-05-11 21:21:47 +08:00
top: 15%;
2024-04-27 18:46:11 +08:00
width: 20%;
left: 40%;
position: absolute;
text-align: center;
img {
width: 40%;
margin: 5% 30%;
}
p {
color: #fff;
font-size: calc(100vw * 14 / 1920);
margin: -6% 37%;
}
}
// element 组件样式
:deep() {
.el-date-editor .el-range-input,
.el-range-separator {
color: #fff;
}
.el-input__wrapper {
background: #112d59;
}
.el-input__inner {
color: #fff;
}
.el-button {
background-color: #2758c0;
color: white;
border-color: transparent;
}
}
// ::v-deep .el-select .el-input .el-select__caret {
// color: #fff;
// }
</style>