项目信息管理详情头部样式优化

yfy
项洋 7 days ago
parent db86a7fa73
commit f8b2ec3593

File diff suppressed because it is too large Load Diff

@ -22,7 +22,7 @@
</div>
</div>
</xiding>
<div class="containerbody" v-if="isContainerVisible">
<div class="containerbody" v-if="isContainerVisible" @srorll="handleScroll">
<!-- 基本信息 -->
<div id="basic">
<Basic :action="action" :basicInfo="basicInformation"
@ -223,11 +223,25 @@ export default {
};
},
created() {
// projectId
this.projectId = Number(this.$route.params.id);
this.loadData();
this.action = this.$route.query.action;
},
// projectId
this.projectId = Number(this.$route.params.id);
this.loadData();
this.action = this.$route.query.action;
this.loadData();
//
window.addEventListener("scroll", this.handleScroll);
const container = document.querySelector(".containerbody");
if (container) {
container.addEventListener("scroll", this.handleScroll);
}
},
beforeDestroy() {
window.removeEventListener("scroll", this.handleScroll);
const container = document.querySelector(".containerbody");
if (container) {
container.removeEventListener("scroll", this.handleScroll);
}
},
methods: {
checkPermi,
checkRole,
@ -262,6 +276,30 @@ export default {
goBack() {
this.$router.go(-1);
},
handleScroll() {
//
const container = document.querySelector(".containerbody");
if (!container) return;
//
const scrollPosition = container.scrollTop; //
//
for (let i = this.sections.length - 1; i >= 0; i--) {
const element = document.getElementById(this.sections[i].id);
if (element) {
//
const elementPosition = element.offsetTop - container.offsetTop;
if (elementPosition <= scrollPosition) {
if (this.activeSection !== this.sections[i].id) {
this.activeSection = this.sections[i].id;
}
break;
}
}
}
},
//
handleDataUpdate(dataKey, updatedData) {
if (dataKey === 'projectOtherInfos' || dataKey === 'wysmxInformations') {

Loading…
Cancel
Save