From 5f6abeedb7ce43853ad486731a5e99b340ec6392 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期二, 17 九月 2024 18:55:39 +0800 Subject: [PATCH] 新大屏数据对接 --- src/views/system/check/result/index.vue | 25 +++++++++++++++---------- 1 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/views/system/check/result/index.vue b/src/views/system/check/result/index.vue index b43277f..e90e9d4 100644 --- a/src/views/system/check/result/index.vue +++ b/src/views/system/check/result/index.vue @@ -115,7 +115,7 @@ <script> import {areaSelect} from '@/api/system/dept'; -import {listScore, getScore, delScore, addScore, updateScore, publishScore} from "@/api/platform/check-score"; +import {listScore, publishScore} from "@/api/platform/check-score"; import * as echarts from 'echarts'; let observer = null; @@ -188,10 +188,9 @@ }, mounted() { this.queryParams.examineTag = this.activeIndex - this.getList(); - this.areaSelect(); chart = echarts.init(this.$refs.barChart); - this.setChartOption(this.checkScoreList); + this.areaSelect() + // this.setChartOption(this.checkScoreList); }, methods: { jumpDetail(index) { @@ -353,10 +352,12 @@ areaSelect() { areaSelect().then(res => { this.areaList = res.data; + this.getList(); }) }, translateDeptId(deptId) { const department = this.areaList.find(dept => dept.id === deptId); + console.log(deptId,this.areaList) return department ? department.value : '鏈煡'; }, @@ -399,17 +400,21 @@ // 鑾峰彇褰撳墠鏃ユ湡 const today = new Date(); - // 璁$畻鏄ㄥぉ鐨勬棩鏈� - const yesterday = new Date(today); - yesterday.setDate(today.getDate() - 1); + // 灏嗘棩鏈熷噺鍘讳竴澶� + const yesterday = new Date(today.getTime() - 24 * 60 * 60 * 1000); - // 灏嗘槰澶╃殑鏃ユ湡鏍煎紡鍖栦负瀛楃涓诧紝杩欓噷鍋囪鍚庣鏈熸湜鐨勬槸ISO 8601鏍煎紡 - this.queryParams.createTime = yesterday.toISOString().split('T')[0]; + // 鑾峰彇骞淬�佹湀銆佹棩 + const year = yesterday.getFullYear(); + let month = (yesterday.getMonth() + 1).toString().padStart(2, '0'); // 鏈堜唤鏄粠0寮�濮嬬殑锛屾墍浠ュ姞1 + let day = yesterday.getDate().toString().padStart(2, '0'); + + // 鎷兼帴鎴� yyyy-MM-dd 鏍煎紡 + this.queryParams.createTime = `${year}-${month}-${day}` console.log(this.queryParams); listScore(this.queryParams).then(response => { this.checkScoreList = response.data; - console.log(this.checkScoreList); + this.setChartOption(this.checkScoreList); this.loading = false; }); -- Gitblit v1.8.0