Mr.Shi
2023-08-22 961a54152717ed343a6e16e923c67ef4afc1d5f1
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>
@@ -185,9 +185,13 @@
</template>
<script setup>
    import { reactive, ref, onMounted, onBeforeUnmount, onUnmounted, nextTick } from 'vue'
    import { getTop } from '@/utils/api.js'
    import { reactive, ref, onMounted, onBeforeUnmount, onUnmounted, nextTick, computed } from 'vue'
    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)
@@ -218,7 +222,12 @@
    const enterprise = useCounterStore()
    console.log(enterprise.count++)
    const companyId = computed(() => {
        return enterprise.companyId
    })
    const departId = computed(() => {
        return enterprise.departId
    })
    start()
    start1()
@@ -244,9 +253,17 @@
    
    onMounted(()=> {
        // getSensorData()
        getTop(8, 36)
        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
                }
            })
    })