flx:修改首页 党建

This commit is contained in:
X_Rian 2024-09-27 18:06:06 +08:00
parent 7703b58530
commit 516c9046ad
3 changed files with 457 additions and 254 deletions

View File

@ -1,279 +1,166 @@
<template>
<div class="leftTop">
<Card title="进度概况">
<div class="progressContent">
<div style="display: flex; padding: 2% 1%; color: #fff; font-size: 16px">
<div style="width: 5px; height: 5px; background: rgba(130, 251, 234, 1); border-radius: 10px; margin: 1%"></div>
<div><i>倒计时</i></div>
</div>
<div class="totalDay">
<div style="line-height: 45px">
项目总天数
<span v-if="!projectData?.totalProjectDay" class="dayImg">0</span>
<span v-else class="dayImg" v-for="item in projectData?.totalProjectDay" :key="item">{{ item }}</span>
<!-- <span class="dayImg">0</span>
<span class="dayImg">4</span>
<span class="dayImg">7</span> -->
<span style="margin-left: 4%"></span>
</div>
</div>
<div class="residueDay">
<div style="line-height: 45px">
项目剩余天数
<span v-if="!projectData?.surplusDay" class="dayImg">0</span>
<span v-else class="dayImg" v-for="item in projectData?.surplusDay" :key="item">{{ item }}</span>
<!-- <span class="dayImg">2</span>
<span class="dayImg">8</span>
<span class="dayImg">6</span> -->
<span style="margin-left: 4%"></span>
</div>
</div>
<div style="display: flex; margin-top: 4%; margin-left: 2%; color: #fff; font-size: 16px; width: 30%">
<div style="width: 5px; height: 5px; background: rgba(130, 251, 234, 1); border-radius: 10px; margin: 1%"></div>
<div><i>里程碑</i></div>
</div>
<el-scrollbar style="width: 94%; margin: 3% 0% 0% 3%; height: 30%" v-if="progressList.length > 0">
<div class="progressData">
<div class="data" v-for="item in progressList" :key="item.id">
<div v-if="item.status == 0" class="text" :title="item.name">{{ item.name }}</div>
<img v-if="item.status == 0" src="@/assets/images/comprehensiveManage/project7.png" alt="" />
<div
v-if="item.status == 1"
style="color: #fff; font-size: 18px; margin-top: -5%"
:title="item.name"
class="statusImg1"
>
<div class="stage-name">{{ item.name }}</div>
<div v-if="item.status == 1" class="statusImg"></div>
</div>
<img
v-if="item.status == 1"
style="width: 40px; margin-top: 1%"
src="@/assets/images/comprehensiveManage/project11.png"
alt=""
/>
<Card :title="textTitle">
<div class="container">
<div class="bottom-left">
<el-scrollbar class="list-content">
<div class="list-detail" v-for="item in memberCareList" :key="item.id">
<div class="detail-pic">
<img v-if="JSON.parse(item.file)[0]" :src="JSON.parse(item.file)[0].url" alt="" />
</div>
<div class="detail-text">
<div class="title" :title="item.title">{{ item.title || " " }}</div>
<div class="time">{{ item.createDate || " " }}</div>
</div>
</div>
</el-scrollbar>
<div class="notoDta" v-else>
<div class="notoDta" v-if="memberCareList.length == 0">
<img src="@/assets/images/noData.png" alt="" />
<div>暂无数据</div>
<p>暂无数据</p>
</div>
</div>
</Card>
</div>
</div>
</Card>
</template>
<script setup lang="ts">
<script lang="ts" setup>
import Card from "@/components/card.vue";
import { ref, watch, onMounted } from "vue";
import { getStageOption } from "@/api/modules/projectOverview";
import { onMounted, ref } from "vue";
import { GlobalStore } from "@/stores";
import { getPartyBuildingGuidancePage } from "@/api/modules/guidancePartyBuilding";
const store = GlobalStore();
const progressList = ref([
// {
// name: "",
// status: 0
// },
// {
// name: "",
// status: 0
// },
// {
// name: "",
// status: 0
// },
// {
// name: "",
// status: 0
// },
// {
// name: "",
// status: 0
// },
// {
// name: "",
// status: 0
// },
// {
// name: "",
// status: 0
// }
] as any);
// ts
type Props = {
projectData?: any; //
};
// withDefaults ()
const props = withDefaults(defineProps<Props>(), {
projectData: {}
});
//
const projectData = ref({} as any);
// const emits = defineEmits(["openDialog"]);
// const companyName = reactive(COMPANY);
let textTitle = ref("党建共建");
watch(
() => props.projectData,
newVal => {
// console.log(newVal, "newVal");
if (newVal) {
// props.xData = newVal;
projectData.value = newVal;
console.log("当前阶段", projectData.value);
console.log("当前阶段", progressList.value);
if (progressList.value.length > 0 && projectData.value.constructionStage) {
progressList.value[projectData.value.constructionStage - 1].status = 1;
}
}
}
);
//option
const getProgressOption = async () => {
const res: any = await getStageOption({ dictionaryEncoding: "project_construction_stage", projectSn: store.sn });
if (res.result.length > 0) {
let newArray = res.result.map((item: any) => {
return {
name: item.name,
status: 0
};
});
progressList.value = newArray;
console.log(projectData.value, "里程碑option", res);
if (projectData.value?.constructionStage) {
progressList.value[projectData.value.constructionStage - 1].status = 1;
}
const memberCareList = ref({} as any);
//
const getMemberCareList = async () => {
const res: any = await getPartyBuildingGuidancePage({
projectSn: store.sn,
pageNo: 1,
pageSize: 10,
type: 4
});
console.log("获取党建共建", res);
if (res.success) {
memberCareList.value = res.result.records;
}
};
//
defineExpose({
getProgressOption
})
onMounted( async () => {
getProgressOption();
onMounted(() => {
getMemberCareList();
});
</script>
<style lang="scss" scoped>
.el-scrollbar__wrap {
overflow-x: auto;
height: calc(100% + 20px); //20px
}
.el-scrollbar {
background: url("@/assets/images/comprehensiveManage/project4.png") no-repeat;
background-size: 100% 40%;
background-position-y: 30%;
}
.leftTop {
.container {
width: 100%;
height: 100%;
display: flex;
}
.progressContent {
.icon_boxs {
width: 40%;
height: 100%;
padding: 0 30px;
display: flex;
align-items: center;
justify-content: space-between;
.icon_box {
width: 50%;
padding: 0 20px;
height: 100px;
display: flex;
flex-direction: column;
align-items: center;
cursor: pointer;
.icon_box_bg {
position: relative;
width: 100%;
height: 100%;
background: url("@/assets/images/smartPartyBuilding/icon_pedestal.png") no-repeat;
background-size: 100% 100%;
.icon_box_icon {
width: 45px;
height: 45px;
background-size: 100% 100%;
position: absolute;
top: -24%;
left: 50%;
transform: translateX(-50%);
}
.icon_box_icon1 {
background: url("@/assets/images/smartPartyBuilding/icon_djgjfa.png") no-repeat;
}
.icon_box_icon2 {
background: url("@/assets/images/smartPartyBuilding/icon_djgjxy.png") no-repeat;
}
}
.icon_box_bg2 {
width: 90%;
height: 30px;
background: url("@/assets/images/smartPartyBuilding/nameBg.png") no-repeat;
background-size: 100% 100%;
color: #fff;
font-size: 14px;
display: flex;
align-items: center;
justify-content: center;
}
}
}
.bottom-left {
width: 100%;
height: 100%;
position: relative;
.totalDay {
width: 40%;
float: left;
color: #ccc;
font-size: 16px;
margin-left: 15%;
}
.residueDay {
width: 40%;
float: right;
color: #ccc;
font-size: 16px;
margin-right: 5%;
}
.dayImg {
margin-left: 2%;
font-size: 26px;
display: inline-block;
width: 35px;
height: 45px;
font-family: sadigitalNumber;
background: url("@/assets/images/comprehensiveManage/project1.png") no-repeat;
background-size: 100% 100%;
text-align: center;
color: #4ac0f3;
}
.progressData {
// position: absolute;
// bottom: 3%;
// left: 3%;
width: 100%;
height: 30%;
display: flex;
cursor: pointer;
text-align: center;
// background: url("@/assets/images/comprehensiveManage/project4.png") no-repeat;
// background-size: 100% 40%;
// background-position-y: 30%;
// .stage-bg {
// height: 50%;
// position: absolute;
// img {
// width: 100%;
// height: 100%;
// }
// }
.data {
color: #ccc;
font-size: 15px;
padding-left: 4%;
padding-right: 1%;
z-index: 1;
.text {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
img {
width: 20px;
margin-top: 18%;
margin-left: 15%;
}
.notoDta {
top: 10%;
width: 50%;
left: 25%;
position: absolute;
img {
width: 40%;
margin: 5% 30%;
}
.statusImg {
position: absolute;
top: 190%;
left: -10%;
width: 120px;
height: 1px;
background: url("@/assets/images/comprehensiveManage/project6.png") no-repeat;
background-size: 100% 100%;
}
.statusImg1 {
position: relative;
background: url("@/assets/images/comprehensiveManage/project5.png") no-repeat;
background-size: 100% 100%;
.stage-name {
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
p {
color: #fff;
font-size: calc(100vw * 14 / 1920);
margin: -6% 37%;
}
}
}
::v-deep .h-card .content {
height: 80%;
margin-top: 1.8%;
}
.notoDta {
bottom: 10%;
width: 20%;
left: 35%;
text-align: center;
position: absolute;
img {
width: 40%;
}
div {
color: #fff;
font-size: 14px;
.list-content {
width: 95%;
height: 100%;
margin: 0 2% 0 5%;
.list-detail {
display: flex;
align-items: center;
width: 100%;
height: 20%;
padding-top: 4%;
.detail-pic {
width: 60px; /* 设置容器的宽度 */
height: 40px; /* 设置容器的高度 */
// overflow: hidden; /* */
img {
width: 100%;
height: 100%;
}
}
.detail-text {
width: 85%;
margin-left: 2%;
.title {
width: 94%;
white-space: nowrap; //
overflow: hidden;
text-overflow: ellipsis;
font-size: 14px;
color: #ffffff;
}
.time {
margin-top: 2%;
font-size: 12px;
color: #a1accb;
}
}
}
}
}
</style>

View File

@ -0,0 +1,279 @@
<template>
<div class="leftTop">
<Card title="进度概况">
<div class="progressContent">
<div style="display: flex; padding: 2% 1%; color: #fff; font-size: 16px">
<div style="width: 5px; height: 5px; background: rgba(130, 251, 234, 1); border-radius: 10px; margin: 1%"></div>
<div><i>倒计时</i></div>
</div>
<div class="totalDay">
<div style="line-height: 45px">
项目总天数
<span v-if="!projectData?.totalProjectDay" class="dayImg">0</span>
<span v-else class="dayImg" v-for="item in projectData?.totalProjectDay" :key="item">{{ item }}</span>
<!-- <span class="dayImg">0</span>
<span class="dayImg">4</span>
<span class="dayImg">7</span> -->
<span style="margin-left: 4%"></span>
</div>
</div>
<div class="residueDay">
<div style="line-height: 45px">
项目剩余天数
<span v-if="!projectData?.surplusDay" class="dayImg">0</span>
<span v-else class="dayImg" v-for="item in projectData?.surplusDay" :key="item">{{ item }}</span>
<!-- <span class="dayImg">2</span>
<span class="dayImg">8</span>
<span class="dayImg">6</span> -->
<span style="margin-left: 4%"></span>
</div>
</div>
<div style="display: flex; margin-top: 4%; margin-left: 2%; color: #fff; font-size: 16px; width: 30%">
<div style="width: 5px; height: 5px; background: rgba(130, 251, 234, 1); border-radius: 10px; margin: 1%"></div>
<div><i>里程碑</i></div>
</div>
<el-scrollbar style="width: 94%; margin: 3% 0% 0% 3%; height: 30%" v-if="progressList.length > 0">
<div class="progressData">
<div class="data" v-for="item in progressList" :key="item.id">
<div v-if="item.status == 0" class="text" :title="item.name">{{ item.name }}</div>
<img v-if="item.status == 0" src="@/assets/images/comprehensiveManage/project7.png" alt="" />
<div
v-if="item.status == 1"
style="color: #fff; font-size: 18px; margin-top: -5%"
:title="item.name"
class="statusImg1"
>
<div class="stage-name">{{ item.name }}</div>
<div v-if="item.status == 1" class="statusImg"></div>
</div>
<img
v-if="item.status == 1"
style="width: 40px; margin-top: 1%"
src="@/assets/images/comprehensiveManage/project11.png"
alt=""
/>
</div>
</div>
</el-scrollbar>
<div class="notoDta" v-else>
<img src="@/assets/images/noData.png" alt="" />
<div>暂无数据</div>
</div>
</div>
</Card>
</div>
</template>
<script setup lang="ts">
import Card from "@/components/card.vue";
import { ref, watch, onMounted } from "vue";
import { getStageOption } from "@/api/modules/projectOverview";
import { GlobalStore } from "@/stores";
const store = GlobalStore();
const progressList = ref([
// {
// name: "",
// status: 0
// },
// {
// name: "",
// status: 0
// },
// {
// name: "",
// status: 0
// },
// {
// name: "",
// status: 0
// },
// {
// name: "",
// status: 0
// },
// {
// name: "",
// status: 0
// },
// {
// name: "",
// status: 0
// }
] as any);
// ts
type Props = {
projectData?: any; //
};
// withDefaults ()
const props = withDefaults(defineProps<Props>(), {
projectData: {}
});
//
const projectData = ref({} as any);
watch(
() => props.projectData,
newVal => {
// console.log(newVal, "newVal");
if (newVal) {
// props.xData = newVal;
projectData.value = newVal;
console.log("当前阶段", projectData.value);
console.log("当前阶段", progressList.value);
if (progressList.value.length > 0 && projectData.value.constructionStage) {
progressList.value[projectData.value.constructionStage - 1].status = 1;
}
}
}
);
//option
const getProgressOption = async () => {
const res: any = await getStageOption({ dictionaryEncoding: "project_construction_stage", projectSn: store.sn });
if (res.result.length > 0) {
let newArray = res.result.map((item: any) => {
return {
name: item.name,
status: 0
};
});
progressList.value = newArray;
console.log(projectData.value, "里程碑option", res);
if (projectData.value?.constructionStage) {
progressList.value[projectData.value.constructionStage - 1].status = 1;
}
}
};
//
defineExpose({
getProgressOption
})
onMounted( async () => {
getProgressOption();
});
</script>
<style lang="scss" scoped>
.el-scrollbar__wrap {
overflow-x: auto;
height: calc(100% + 20px); //20px
}
.el-scrollbar {
background: url("@/assets/images/comprehensiveManage/project4.png") no-repeat;
background-size: 100% 40%;
background-position-y: 30%;
}
.leftTop {
width: 100%;
height: 100%;
}
.progressContent {
width: 100%;
height: 100%;
position: relative;
.totalDay {
width: 40%;
float: left;
color: #ccc;
font-size: 16px;
margin-left: 15%;
}
.residueDay {
width: 40%;
float: right;
color: #ccc;
font-size: 16px;
margin-right: 5%;
}
.dayImg {
margin-left: 2%;
font-size: 26px;
display: inline-block;
width: 35px;
height: 45px;
font-family: sadigitalNumber;
background: url("@/assets/images/comprehensiveManage/project1.png") no-repeat;
background-size: 100% 100%;
text-align: center;
color: #4ac0f3;
}
.progressData {
// position: absolute;
// bottom: 3%;
// left: 3%;
width: 100%;
height: 30%;
display: flex;
cursor: pointer;
text-align: center;
// background: url("@/assets/images/comprehensiveManage/project4.png") no-repeat;
// background-size: 100% 40%;
// background-position-y: 30%;
// .stage-bg {
// height: 50%;
// position: absolute;
// img {
// width: 100%;
// height: 100%;
// }
// }
.data {
color: #ccc;
font-size: 15px;
padding-left: 4%;
padding-right: 1%;
z-index: 1;
.text {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
img {
width: 20px;
margin-top: 18%;
margin-left: 15%;
}
}
.statusImg {
position: absolute;
top: 190%;
left: -10%;
width: 120px;
height: 1px;
background: url("@/assets/images/comprehensiveManage/project6.png") no-repeat;
background-size: 100% 100%;
}
.statusImg1 {
position: relative;
background: url("@/assets/images/comprehensiveManage/project5.png") no-repeat;
background-size: 100% 100%;
.stage-name {
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
}
::v-deep .h-card .content {
height: 80%;
margin-top: 1.8%;
}
.notoDta {
bottom: 10%;
width: 20%;
left: 35%;
text-align: center;
position: absolute;
img {
width: 40%;
}
div {
color: #fff;
font-size: 14px;
}
}
</style>

View File

@ -7,13 +7,17 @@
</div>
<div class="center">
<centerTop :projectData="projectData" class="centerTop" ref="centerTopRef"></centerTop>
<centerBottom :projectData="projectData" class="centerBottom" ref="centerBottomRef"></centerBottom>
<div class="bottomCenter">
<centerBottom class="centerBottom" ref="centerBottomRef"></centerBottom>
<div class="show-more" @click="openPeopleCountDialog(4)">更多</div>
</div>
</div>
<div class="right">
<rightTop class="rightTop" ref="rightTopRef"></rightTop>
<rightCenter class="rightCenter" ref="rightCenterRef"></rightCenter>
<rightBottom class="rightBottom" ref="rightBottomRef"></rightBottom>
</div>
<party-build-dialog ref="partyBuildRef"></party-build-dialog>
</div>
</template>
@ -26,6 +30,7 @@ import centerBottom from "@/views/sevenLargeScreen/comprehensiveManage/projectOv
import rightTop from "@/views/sevenLargeScreen/comprehensiveManage/projectOverview/rightTop.vue";
import rightCenter from "@/views/sevenLargeScreen/comprehensiveManage/projectOverview/rightCenter.vue";
import rightBottom from "@/views/sevenLargeScreen/comprehensiveManage/projectOverview/rightBottom.vue";
import partyBuildDialog from "@/views/sevenLargeScreen/comprehensiveManage/guidancePartyBuilding/party-build-dialog.vue";
import { GlobalStore } from "@/stores";
const store = GlobalStore();
import { getWorkerStatisticsCountApi, getProjectDetail } from "@/api/modules/projectOverview";
@ -33,6 +38,14 @@ import { ref, onMounted, onBeforeUnmount, nextTick } from "vue";
const statisticsCount = ref(null as any);
const projectData = ref(null as any);
//
const partyBuildRef = ref();
const openPeopleCountDialog = (type: any) => {
partyBuildRef.value.openDialog(type);
// console.log(partyBuildRef.value);
};
//
const getProjectInfo = async () => {
const res = await getProjectDetail({ projectSn: store.sn });
@ -57,7 +70,7 @@ const callChildFn = async () => {
nextTick(async () => {
leftTopRef.value.projectTypeEnum();
centerTopRef.value.getQueryBySnData();
centerBottomRef.value.getProgressOption();
// centerBottomRef.value.getProgressOption();
rightTopRef.value.getSafeInfo();
rightCenterRef.value.qualityInfo();
rightBottomRef.value.getList();
@ -83,7 +96,7 @@ const destroyInterval = () => {
onBeforeUnmount(() => {
destroyInterval();
});
window.onbeforeunload = (e) => {
window.onbeforeunload = e => {
destroyInterval();
};
onMounted(async () => {
@ -93,6 +106,7 @@ onMounted(async () => {
});
</script>
<style lang="scss" scoped>
.projectContent {
width: 100%;
height: 100%;
@ -124,8 +138,31 @@ onMounted(async () => {
margin-bottom: 2.1%;
}
.centerBottom {
.bottomCenter {
// margin: 0% 1%;
// width: 45%;
height: 32%;
position: relative;
:deep(.h-card) {
.content {
margin-top: 2% !important;
height: 80% !important;
}
}
.show-more {
position: absolute;
right: 3%;
top: 5%;
cursor: pointer;
font-size: 12px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
color: #4ac0f3;
}
.centerBottom {
// height: 32%;
height: 100%;
}
}
}