Mr.Shi
2023-08-22 7d2873351fd9cca4c7b1117dafe59db4a546526f
大屏
已修改3个文件
37 ■■■■ 文件已修改
screen_standard/src/components/AppLayout.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen_standard/src/utils/api.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen_standard/src/views/index.vue 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen_standard/src/components/AppLayout.vue
@@ -114,7 +114,7 @@
onMounted(() => {
  getDepartmentList(8)
    .then(res => {
      debugger
      // debugger
      comList = res
      
      data.tempCom = res[0]
screen_standard/src/utils/api.js
@@ -4,3 +4,8 @@
export function getTop (companyId, departId) {
    return axiosInstance.get(`statistics/userProduceTop/${companyId}/${departId}`)
}
// 成品计划-实时仓库余量统计
export function getStockList (companyId, departId) {
    return axiosInstance.get(`statistics/getStockList/${companyId}/${departId}`)
}
screen_standard/src/views/index.vue
@@ -7,18 +7,18 @@
                    <span>当日员工产量TOP10</span>
                </div>
                <div class="content_left_item1_content">
                    <div class="content_left_item1_content_row" v-for="(item, index) in 10" :key="index">
                    <div class="content_left_item1_content_row" v-for="(item, index) in data.production" :key="index">
                        <div class="content_left_item1_content_row_name">
                            <div :class="index > 2 ? 'num bg1' : 'num bg2'">{{ index + 1 }}</div>
                            <span>赵立{{ index }}</span>
                            <span>{{item.userName}}</span>
                        </div>
                        <div class="content_left_item1_content_row_line">
                            <el-progress
                                :show-text="false"
                                :percentage="50">
                                :percentage="item.doneNum">
                            </el-progress>
                        </div>
                        <div class="content_left_item1_content_row_num">342</div>
                        <div class="content_left_item1_content_row_num">{{ item.doneNum }}</div>
                    </div>
                </div>
            </div>
@@ -186,8 +186,12 @@
<script setup>
    import { reactive, ref, onMounted, onBeforeUnmount, onUnmounted, nextTick, computed } from 'vue'
    import { getTop } from '@/utils/api.js'
    import { getTop, getStockList } from '@/utils/api.js'
    import { useCounterStore } from '@/stores/counter.js'
    let data = reactive({
        production: []
    })
    let timer = ref(null)
    let timer1 = ref(null)
@@ -249,10 +253,18 @@
    
    onMounted(()=> {
        // getSensorData()
        // getTop(8, 36)
        //     .then(res => {
        //         console.log(res)
        //     })
        getTop(companyId.value, departId.value)
            .then(res => {
                console.log(res)
                if (res.length > 0) {
                    res.forEach((item, index) => {
                        if (index > 1) {
                            item.doneNum1 = res[0].doneNum / item.doneNum
                        }
                    })
                    data.production = res
                }
            })
    })
    onBeforeUnmount(()=>{