diff --git a/resources/assets/js/functions/common.js b/resources/assets/js/functions/common.js index 717832327..55afa7a62 100755 --- a/resources/assets/js/functions/common.js +++ b/resources/assets/js/functions/common.js @@ -1890,12 +1890,17 @@ const timezone = require("dayjs/plugin/timezone"); /** * 设置时区 * @param tz + * @returns {number} */ setTimezone(tz) { const local = $A.dayjs().startOf('hour'); const server = local.tz(tz); - $A.timezoneDifference = local.startOf('hour').diff(server.format("YYYY-MM-DD HH:mm:ss"), 'hour') + return $A.timezoneDifference = local.startOf('hour').diff(server.format("YYYY-MM-DD HH:mm:ss"), 'hour') }, + + /** + * 本地时间与服务器时间差(小时) + */ timezoneDifference: 0, /** diff --git a/resources/assets/js/pages/manage/dashboard.vue b/resources/assets/js/pages/manage/dashboard.vue index 9b50bd846..ba1253cc0 100644 --- a/resources/assets/js/pages/manage/dashboard.vue +++ b/resources/assets/js/pages/manage/dashboard.vue @@ -8,6 +8,7 @@
{{$L('欢迎您,' + userInfo.nickname)}}
{{$L('以下是你当前的任务统计数据')}} +
@@ -129,7 +130,7 @@ export default { }, computed: { - ...mapState(['userInfo', 'userIsAdmin', 'cacheTasks', 'taskCompleteTemps', 'loadDashboardTasks']), + ...mapState(['systemConfig', 'userInfo', 'userIsAdmin', 'cacheTasks', 'taskCompleteTemps', 'loadDashboardTasks']), ...mapGetters(['dashboardTask', 'assistTask', 'transforTasks']), @@ -203,17 +204,23 @@ export default { }, scrollTo(type) { - let refs = this.$refs[`type_${type}`] + const refs = this.$refs[`type_${type}`] if (refs) { - $A.scrollToView(refs[0], { - behavior: 'smooth', - inline: 'end', - }); + const index = this.hiddenColumns.indexOf(type); + if (index !== -1) { + this.hiddenColumns.splice(index, 1) + } + this.$nextTick(_ => { + $A.scrollToView(refs[0], { + behavior: 'smooth', + inline: 'end', + }); + }) } }, onDashboardHidden(type) { - let index = this.hiddenColumns.indexOf(type); + const index = this.hiddenColumns.indexOf(type); if (index === -1) { this.hiddenColumns.push(type) } else { diff --git a/resources/assets/js/store/actions.js b/resources/assets/js/store/actions.js index dda230f1e..13bb484b5 100644 --- a/resources/assets/js/store/actions.js +++ b/resources/assets/js/store/actions.js @@ -340,8 +340,8 @@ export default { dispatch("call", { url: "system/setting", }).then(({data}) => { - $A.setTimezone(data.server_timezone); state.systemConfig = Object.assign(data, { + timezoneDifference: $A.setTimezone(data.server_timezone), __state: "success", }) resolve(state.systemConfig)