From 7d2873351fd9cca4c7b1117dafe59db4a546526f Mon Sep 17 00:00:00 2001
From: Mr.Shi <1878285526@qq.com>
Date: 星期二, 22 八月 2023 11:15:18 +0800
Subject: [PATCH] 大屏
---
screen_standard/src/components/AppLayout.vue | 2 +-
screen_standard/src/utils/api.js | 5 +++++
screen_standard/src/views/index.vue | 30 +++++++++++++++++++++---------
3 files changed, 27 insertions(+), 10 deletions(-)
diff --git a/screen_standard/src/components/AppLayout.vue b/screen_standard/src/components/AppLayout.vue
index 55e5471..34290b1 100644
--- a/screen_standard/src/components/AppLayout.vue
+++ b/screen_standard/src/components/AppLayout.vue
@@ -114,7 +114,7 @@
onMounted(() => {
getDepartmentList(8)
.then(res => {
- debugger
+ // debugger
comList = res
data.tempCom = res[0]
diff --git a/screen_standard/src/utils/api.js b/screen_standard/src/utils/api.js
index c1779f5..316267c 100644
--- a/screen_standard/src/utils/api.js
+++ b/screen_standard/src/utils/api.js
@@ -3,4 +3,9 @@
// 鍛樺伐浜у搧缁熻TOP10
export function getTop (companyId, departId) {
return axiosInstance.get(`statistics/userProduceTop/${companyId}/${departId}`)
+}
+
+// 鎴愬搧璁″垝-瀹炴椂浠撳簱浣欓噺缁熻
+export function getStockList (companyId, departId) {
+ return axiosInstance.get(`statistics/getStockList/${companyId}/${departId}`)
}
\ No newline at end of file
diff --git a/screen_standard/src/views/index.vue b/screen_standard/src/views/index.vue
index 122010e..33718ac 100644
--- a/screen_standard/src/views/index.vue
+++ b/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(()=>{
--
Gitblit v1.9.3