滚动条处理

This commit is contained in:
骆乐 2022-10-25 15:25:40 +08:00
parent bfc047da2c
commit 4456edbaca

View File

@ -1,20 +1,29 @@
<template> <template>
<div class="container" ref="Process"> <div class="container" ref="Process">
<Process style="transform: translateX(0)" :list="stageList" /> <div class="process">
<vue-scroll :ops="ops" ref="stageScroll">
<Process style="transform: translateX(0)" :list="stageList" />
</vue-scroll>
</div> </div>
</div>
</template> </template>
<script> <script>
import Process from './Process' import Process from "./Process";
import { listProgressOfTheTask } from '@/assets/js/api/zhongjianFourth' import { listProgressOfTheTask } from "@/assets/js/api/zhongjianFourth";
export default { export default {
components: { Process }, components: { Process },
data() { data() {
return { return {
// projectData.constructionStage ops: {
stageList: this.$t('message.companyDiagram.CONSTRUCTIONSTAGE'), vuescroll: {
// wheelScrollDuration: 0,
wheelDirectionReverse: true
}
},
// projectData.constructionStage
stageList: this.$t("message.companyDiagram.CONSTRUCTIONSTAGE"),
list: [ list: [
// { endTime: '2022-01-01', subitemProjectName: '', state: true ,}, // { endTime: '2022-01-01', subitemProjectName: '', state: true ,},
// { endTime: '2022-02-14', subitemProjectName: '', state: true, }, // { endTime: '2022-02-14', subitemProjectName: '', state: true, },
@ -22,29 +31,32 @@ export default {
// { endTime: '2022-07-31', subitemProjectName: '', state: true, }, // { endTime: '2022-07-31', subitemProjectName: '', state: true, },
// { endTime: '2022-21-31', subitemProjectName: '' } // { endTime: '2022-21-31', subitemProjectName: '' }
], ],
index: 0 index: 0,
} };
}, },
mounted() { mounted() {
const progress = this.$refs.Process; const progress = this.$refs.Process;
progress.scrollLeft = 48; progress.scrollLeft = 48;
this.getData() this.getData();
}, },
methods:{ methods: {
getData(){ getData() {
listProgressOfTheTask({ projectSn: this.$store.state.projectSn ,isNoStart: false}).then(res => { listProgressOfTheTask({
projectSn: this.$store.state.projectSn,
isNoStart: false,
}).then((res) => {
// state 0, 1, 2 // state 0, 1, 2
res.result.forEach((item)=>{ res.result.forEach((item) => {
if(item.state == 2){ if (item.state == 2) {
item.state = true item.state = true;
} }
}) });
console.log('进度条的返回值',res) console.log("进度条的返回值", res);
this.list = res.result this.list = res.result;
}) });
} },
} },
} };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@ -53,6 +65,15 @@ export default {
place-items: center; place-items: center;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: auto; // overflow: auto;
.process {
margin-top: 5%;
width: 95%;
height: 85%;
overflow: hidden;
}
.process:hover{
overflow-x: auto;
}
} }
</style> </style>