Mr.Shi
2023-08-22 f18133f734f9b0a668ac1a79ef0a43c62812de38
screen_standard/src/views/index.vue
@@ -190,8 +190,8 @@
</template>
<script setup>
    import { reactive, ref, onBeforeUnmount, onUnmounted, nextTick, computed, watch, onActivated } from 'vue'
    import { getTop, getStockList, getWorkPlansList, getProcedureProcessList, getRecordLogPage, getDeviceCheckPage, getUnqualified7DayData, getUnqualifiedCateData } from '@/utils/api.js'
    import { reactive, ref, onMounted, nextTick, onUnmounted, computed, watch, onActivated } from 'vue'
    import { getPlanData, getTop, getStockList, getWorkPlansList, getProcedureProcessList, getRecordLogPage, getDeviceCheckPage, getUnqualified7DayData, getUnqualifiedCateData } from '@/utils/api.js'
    import { useCounterStore } from '@/stores/counter.js'
    import * as echarts from 'echarts'
    import { useRouter } from 'vue-router'
@@ -255,13 +255,36 @@
            init()
        }
    })
    onActivated(() => {
        console.log('departId', departId.value)
        if (!departId.value) return
        init()
        console.log('onActivated')
    })
    // 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()
@@ -343,6 +366,11 @@
                    })
                    setTypeChart()
                }
            })
        // getPlanData
        getPlanData(companyId.value, departId.value)
            .then(res => {
                enterprise.setNum(res)
            })
    }
@@ -526,13 +554,13 @@
        option && myChart.setOption(option);
    }
    onBeforeUnmount(()=>{
        clearTimeout(timer.value)
        clearTimeout(timer1.value)
        clearTimeout(timer2.value)
        clearTimeout(timer3.value)
        clearTimeout(timer4.value)
    })
    // onBeforeUnmount(()=>{
    //     clearTimeout(timer.value)
    //     clearTimeout(timer1.value)
    //     clearTimeout(timer2.value)
    //     clearTimeout(timer3.value)
    //     clearTimeout(timer4.value)
    // })
    onUnmounted(()=>{
        clearTimeout(timer.value)
        clearTimeout(timer1.value)
@@ -754,6 +782,15 @@
            }
        }
    }
    // onUnmounted(() => {
    // })
    onMounted(() => {
        console.log('11111')
        init()
    })
</script>
<style lang="scss" scoped>
@@ -1260,8 +1297,9 @@
                    position: relative;
                    .content_right_top_nr_bottom_yuan {
                        position: absolute;
                        top: 63%;
                        left: 37%;
                        top: 50%;
                        left: 50%;
                        transform: translate(-50%, 53%);
                        z-index: 999;
                        width: 114px;
                        height: 114px;