湖里大屏(进度计划):抽离获取进度条参数代码
This commit is contained in:
parent
4dde2afbf0
commit
923aad5fef
@ -75,6 +75,7 @@ export default {
|
||||
pName: '地基与基础工程',
|
||||
startTime: '2020/04/06',
|
||||
endTime: '2020/05/09',
|
||||
delay: 5,
|
||||
status: 0,
|
||||
gantts: [],
|
||||
// gantts: [{ left: '420px', width: '100px', status: '' }],
|
||||
@ -91,10 +92,8 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setGantts() {
|
||||
const configGantts = projects => {
|
||||
projects.map(project => {
|
||||
let { startTime, endTime, pName, gantts } = project
|
||||
getGanttStyle(project) {
|
||||
let { startTime, endTime, pName } = project
|
||||
const startArr = startTime.split('/')
|
||||
const endArr = endTime.split('/')
|
||||
let startRef = null
|
||||
@ -121,15 +120,20 @@ export default {
|
||||
const endLeft = endRef.offsetLeft
|
||||
const ganttWidth = endLeft - startLeft + endWidth
|
||||
|
||||
const gantt = { left: startLeft + 'px', width: ganttWidth + 'px', background: this.colors[project.status] }
|
||||
return { left: startLeft + 'px', width: ganttWidth + 'px' }
|
||||
},
|
||||
setGantts() {
|
||||
const configGantts = projects => {
|
||||
projects.map(project => {
|
||||
let { gantts } = project
|
||||
const gantt = this.getGanttStyle(project)
|
||||
gantt.background = this.colors[project.status]
|
||||
if (gantts) {
|
||||
gantts.push(gantt)
|
||||
} else {
|
||||
project.gantts = [gantt]
|
||||
}
|
||||
|
||||
console.log(startLeft, ganttWidth, '丢雷', `${pName}-${endTime}`)
|
||||
|
||||
// debugger
|
||||
project.children && configGantts(project.children)
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user