diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 6b0815897eb1479f16e5bc5b228aad325b2d6841..e11caaf372b4f9fadcd9f84458228e125dc73e82 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 196b8928dffaf101cba0de349e3ab4f6333faa26..5a4d2cfb48a43fb5691207db2dbaa590889b6625 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 65c269b1c72c448d16b4d5e3da8e3e2abdb413f7..3fdd8a6ae690db91f33ca96d487c20510ee50b69 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 6a000503fe902d9f56af702ed2b673912787ee97..5f6879beea206c286ec36e548134ca031be8ec43 100644 --- a/src/views/userStatistics/components/record.vue +++ b/src/views/userStatistics/components/record.vue @@ -1,6 +1,6 @@