From a380b433e22309cc1b96fe713122b30fe6d29c54 Mon Sep 17 00:00:00 2001 From: liuxin Date: Fri, 22 Apr 2022 17:28:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/user.js | 2 + src/utils/filters.js | 65 ++++++-- .../components/medicalWasteTypes.vue | 140 +++++++++-------- .../components/realTimeMedicalWaste.vue | 77 ++++++++-- .../userStatistics/components/record.vue | 2 +- .../components/recoveryTrend.vue | 12 +- src/views/userStatistics/index.vue | 142 ++++++++++++++---- 7 files changed, 323 insertions(+), 117 deletions(-) diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 6b08158..e11caaf 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -65,6 +65,7 @@ const actions = { let userInfo = JSON.parse(JSON.stringify(data)) delete userInfo.menuVoList setUserInfo(JSON.stringify(userInfo)) + debugger JSON.stringify(data.menuVoList) // setToken(JSON.stringify(data.token)); sessionStorage.setItem('token',data.token) @@ -118,6 +119,7 @@ const actions = { let userInfoData = JSON.parse(JSON.stringify(data)) delete userInfoData.menuVoList setUserInfo(JSON.stringify(userInfoData)) + JSON.stringify(data.menuVoList) // setToken(JSON.stringify(data.token)); sessionStorage.setItem('token',data.token) diff --git a/src/utils/filters.js b/src/utils/filters.js index 196b892..5a4d2cf 100644 --- a/src/utils/filters.js +++ b/src/utils/filters.js @@ -104,29 +104,29 @@ export function filter_alarm_type_img(val) { if (!val) return ""; switch (val) { case "out_depot_time_red": - return require('@/assets/time_red.png'); + return require("@/assets/time_red.png"); case "out_depot_time_yellow": - return require('@/assets/time_yellow.png'); + return require("@/assets/time_yellow.png"); case "do_collect_weight_red": - return require('@/assets/weight_red.png'); + return require("@/assets/weight_red.png"); case "do_collect_weight_yellow": - return require('@/assets/weight_yellow.png'); + return require("@/assets/weight_yellow.png"); case "in_depot_weight_red": - return require('@/assets/weight_red.png'); + return require("@/assets/weight_red.png"); case "in_depot_weight_yellow": - return require('@/assets/weight_yellow.png'); + return require("@/assets/weight_yellow.png"); case "out_depot_weight_red": - return require('@/assets/weight_red.png'); + return require("@/assets/weight_red.png"); case "out_depot_weight_yellow": - return require('@/assets/weight_yellow.png'); + return require("@/assets/weight_yellow.png"); case "do_collect_time_red": - return require('@/assets/time_red.png'); + return require("@/assets/time_red.png"); case "do_collect_time_yellow": - return require('@/assets/time_yellow.png'); + return require("@/assets/time_yellow.png"); case "in_depot_time_red": - return require('@/assets/time_red.png'); + return require("@/assets/time_red.png"); case "in_depot_time_yellow": - return require('@/assets/time_yellow.png'); + return require("@/assets/time_yellow.png"); } } @@ -175,3 +175,44 @@ export function timeFn(d1) { return `${seconds}秒`; } } + +export function timeFormat(value, format) { + if (!value) return; + let date = new Date(value); + let y = date.getFullYear(); + let m = date.getMonth() + 1; + let d = date.getDate(); + let h = date.getHours(); + let min = date.getMinutes(); + let s = date.getSeconds(); + let result = ""; + if (format == undefined) { + result = `${y}-${m < 10 ? "0" + m : m}-${d < 10 ? "0" + d : d} ${ + h < 10 ? "0" + h : h + }:${min < 10 ? "0" + min : min}:${s < 10 ? "0" + s : s}`; + } + if (format == "yyyy-mm-dd") { + result = `${y}-${m < 10 ? "0" + m : m}-${d < 10 ? "0" + d : d}`; + } + if (format == "yyyy-mm-dd HH:mm") { + result = `${y}-${m < 10 ? "0" + m : m}-${d < 10 ? "0" + d : d} ${ + h < 10 ? "0" + h : h + }:${min < 10 ? "0" + min : min}`; + } + if (format == "yyyy/mm/dd") { + result = `${y}-${m < 10 ? "0" + m : m}-${d < 10 ? "0" + d : d}`; + } + if (format == "yyyy-mm") { + result = `${y}-${m < 10 ? "0" + m : m}`; + } + if (format == "mm-dd") { + result = ` ${mm < 10 ? "0" + mm : mm}:${ddmin < 10 ? "0" + dd : dd}`; + } + if (format == "hh:mm") { + result = ` ${h < 10 ? "0" + h : h}:${min < 10 ? "0" + min : min}`; + } + if (format == "yyyy") { + result = `${y}`; + } + return result; +} diff --git a/src/views/userStatistics/components/medicalWasteTypes.vue b/src/views/userStatistics/components/medicalWasteTypes.vue index 65c269b..3fdd8a6 100644 --- a/src/views/userStatistics/components/medicalWasteTypes.vue +++ b/src/views/userStatistics/components/medicalWasteTypes.vue @@ -17,7 +17,7 @@
@@ -25,6 +25,7 @@ \ No newline at end of file diff --git a/src/views/userStatistics/components/record.vue b/src/views/userStatistics/components/record.vue index 6a00050..5f6879b 100644 --- a/src/views/userStatistics/components/record.vue +++ b/src/views/userStatistics/components/record.vue @@ -1,6 +1,6 @@