Mr.Shi
2023-08-22 f18133f734f9b0a668ac1a79ef0a43c62812de38
大屏
已修改3个文件
85 ■■■■ 文件已修改
screen_standard/src/components/AppLayout.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen_standard/src/utils/api.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen_standard/src/views/index.vue 74 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen_standard/src/components/AppLayout.vue
@@ -16,7 +16,7 @@
          </template>
        </el-dropdown>
        <img v-else src="@/assets/img/btn_back@2x.png" style="width: 108px;height: 34px; margin-top: 14px;" @click="router.replace('/')">
        <img v-else src="@/assets/img/btn_back@2x.png" style="width: 108px;height: 34px; margin-top: 14px;" @click="router.go(-1)">
      </div>
      
      <div class="title">DM云工厂车间大屏</div>
@@ -47,7 +47,7 @@
      </div>
    </div>
    <KeepAlive>
      <RouterView />
      <router-view></router-view>
    </KeepAlive>
  </div>
</template>
@@ -58,7 +58,7 @@
import { getDepartmentList } from '@/utils/api.js'
import { reactive, toRefs, onMounted, computed } from 'vue';
import { useCounterStore } from '@/stores/counter.js'
import { RouterView, useRoute, useRouter } from 'vue-router'
import { useRoute, useRouter } from 'vue-router'
const enterprise = useCounterStore()
const route = useRoute()
const router = useRouter()
screen_standard/src/utils/api.js
@@ -54,4 +54,9 @@
// 数据统计-成品计划,执行中、延期计划数、今日生产人数、今日生产设备数、今日不良品
export function getProcedurePlanData (companyId, departId, params) {
  return axiosInstance.get(`statistics/getProcedurePlanData/${companyId}/${departId}`, {params} )
}
// 数据统计-成品计划,执行中、延期计划数、今日生产人数、今日生产设备数、今日不良品
export function getPlanData (companyId, departId) {
    return axiosInstance.get(`statistics/getPlanData/${companyId}/${departId}`)
}
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;