From f18133f734f9b0a668ac1a79ef0a43c62812de38 Mon Sep 17 00:00:00 2001
From: Mr.Shi <1878285526@qq.com>
Date: 星期二, 22 八月 2023 16:46:42 +0800
Subject: [PATCH] 大屏
---
screen_standard/src/components/AppLayout.vue | 6 +-
screen_standard/src/utils/api.js | 5 ++
screen_standard/src/views/index.vue | 74 ++++++++++++++++++++++++++++---------
3 files changed, 64 insertions(+), 21 deletions(-)
diff --git a/screen_standard/src/components/AppLayout.vue b/screen_standard/src/components/AppLayout.vue
index 46790b5..718e0de 100644
--- a/screen_standard/src/components/AppLayout.vue
+++ b/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()
diff --git a/screen_standard/src/utils/api.js b/screen_standard/src/utils/api.js
index 681924e..af29c7b 100644
--- a/screen_standard/src/utils/api.js
+++ b/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}`)
}
\ No newline at end of file
diff --git a/screen_standard/src/views/index.vue b/screen_standard/src/views/index.vue
index ee207a7..edb7242 100644
--- a/screen_standard/src/views/index.vue
+++ b/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;
--
Gitblit v1.9.3