Mr.Shi
2023-08-23 9dca34b089802355a813f57f1e8898af4aefb87d
screen_standard/src/views/index.vue
@@ -261,36 +261,6 @@
            init()
        }
    })
    // router.afterEach((to) => {
    //     if (to.fullPath === '/') {
    //         if (!departId.value) return
    //         // data.production = []
    //         // data.marginStatistics = []
    //         // data.plannedProgress = []
    //         // data.processProgress = []
    //         // data.log = []
    //         // init()
    //     } else {
    //         clearTimeout(timer.value)
    //         clearTimeout(timer1.value)
    //         clearTimeout(timer2.value)
    //         clearTimeout(timer3.value)
    //         clearTimeout(timer4.value)
    //     }
    // })
    // router.beforeEach((to) => {
    //     console.log(to);
    //     if (to.fullPath === '/') {
    //         if (!departId.value) return
    //         init()
    //     } else {
    //         clearTimeout(timer.value)
    //         clearTimeout(timer1.value)
    //         clearTimeout(timer2.value)
    //         clearTimeout(timer3.value)
    //         clearTimeout(timer4.value)
    //     }
    // })
    start1()
@@ -314,6 +284,9 @@
        // 成品计划进度
        getWorkPlansList(companyId.value, departId.value)
            .then(res => {
                res.forEach(item => {
                    item.rate = Math.trunc(item.rate)
                })
                data.plannedProgress = res
                nextTick(() => {
                    start1()
@@ -493,76 +466,67 @@
            //   formatter: '{a} <br/>{b} : {c} ({d}%)'
            // },
            legend: {
            show: false,
            type: 'scroll',
            orient: 'vertical',
            right: 10,
            top: 20,
            bottom: 20,
            data: legendData
                show: false,
                type: 'scroll',
                orient: 'vertical',
                right: 10,
                top: 20,
                bottom: 20,
                data: legendData
            },
            series: [
            {
                // name: '姓名',
                type: 'pie',
                radius: ['60%', '70%'],
                // avoidLabelOverlap: false,
                itemStyle: {
                borderRadius: 4,
                borderColor: 'rgba(52, 88, 159, 0.4)',
                borderWidth: 4
                },
                center: ['50%', '50%'],
                labelLine: {
                show: false
                },
                label: {
                formatter:'{dot| } {title|{b} {c}}\n\n{per|{d}%}',
                rich: {
                    title: {
                    color: '#fff'
                {
                    // name: '姓名',
                    type: 'pie',
                    radius: ['60%', '70%'],
                    // avoidLabelOverlap: false,
                    itemStyle: {
                        borderRadius: 4,
                        borderColor: 'rgba(52, 88, 159, 0.4)',
                        borderWidth: 4
                    },
                    per: {
                    color: '#01D9FE'
                    center: ['50%', '50%'],
                    labelLine: {
                        show: false
                    },
                    dot: {
                    backgroundColor: 'inherit',
                    width: 8,
                    height: 8,
                    borderRadius: 4
                    label: {
                        formatter:'{dot| } {title|{b} {c}}\n\n{per|{d}%}',
                        rich: {
                            title: {
                                color: '#fff'
                            },
                            per: {
                                color: '#01D9FE'
                            },
                            dot: {
                                backgroundColor: 'inherit',
                                width: 8,
                                height: 8,
                                borderRadius: 4
                            }
                        }
                    },
                    // labelLayout: {
                    //   hideOverlap: true
                    // },
                    endLabel: {
                        show: true,
                        distance: 5,
                        color: "red"
                    },
                    data: seriesData,
                    emphasis: {
                        itemStyle: {
                            shadowBlur: 10,
                            shadowOffsetX: 0,
                            shadowColor: 'rgba(0, 0, 0, 1)'
                        }
                    }
                }
                },
                // labelLayout: {
                //   hideOverlap: true
                // },
                endLabel: {
                show: true,
                distance: 5,
                color: "red"
                },
                data: seriesData,
                emphasis: {
                itemStyle: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 1)'
                }
                }
            }
            ]
        }
        option && myChart.setOption(option);
    }
    // onBeforeUnmount(()=>{
    //     clearTimeout(timer.value)
    //     clearTimeout(timer1.value)
    //     clearTimeout(timer2.value)
    //     clearTimeout(timer3.value)
    //     clearTimeout(timer4.value)
    // })
    onUnmounted(()=>{
        clearTimeout(timer.value)
        clearTimeout(timer1.value)