From 5bb8d28c175eafcafbf8dc4f82965791a5b1a970 Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Mon, 30 May 2022 11:02:56 +0800 Subject: [PATCH 1/8] 29935 --- src/common/axios.js | 35 +++++++++---------- src/saas/AppCountryAlbum/Attendance.vue | 25 ++++--------- .../AppCountryAlbum/components/Organize.vue | 23 ++++-------- .../components/report/WorkReport.vue | 1 + 4 files changed, 31 insertions(+), 53 deletions(-) diff --git a/src/common/axios.js b/src/common/axios.js index d8aa3fff..97476bdd 100644 --- a/src/common/axios.js +++ b/src/common/axios.js @@ -29,26 +29,23 @@ instance.interceptors.request.use(config => { instance.interceptors.response.use(res => { if (res.data) { - if (res.data.code) { - if (res.data.code == 0) { - return res.data - } else if (res.data.code === 1) { - uni.showToast({ - title: res.data.msg, - duration: 2000, - icon: 'none' - }) - - return res.data - } else if (res.data.code == 401) { - store.commit("logout"); - uni.navigateTo({url: "/pages/login"}) - } else { - console.error(res.data.msg || "请求失败!") - return Promise.reject(res.data.msg) - } - } else { + uni.hideLoading() + if (res.data.code == 0) { return res.data + } else if (res.data.code === 1) { + uni.showToast({ + title: res.data.msg, + duration: 2000, + icon: 'none' + }) + + return res.data + } else if (res.data.code == 401) { + store.commit("logout"); + uni.navigateTo({url: "/pages/login"}) + } else { + console.error(res.data.msg || "请求失败!") + return Promise.reject(res.data.msg) } } else { console.error("服务器异常,请联系管理员!") diff --git a/src/saas/AppCountryAlbum/Attendance.vue b/src/saas/AppCountryAlbum/Attendance.vue index c699df22..42e40add 100644 --- a/src/saas/AppCountryAlbum/Attendance.vue +++ b/src/saas/AppCountryAlbum/Attendance.vue @@ -61,32 +61,18 @@ all: '1', hasIn: '', hasOut: '', + yyyyMM: '', + DD: '', isShow: false, isAdmin: false } }, - computed: { - yyyyMM () { - if (this.date) { - return this.date.substr(0, 8) - } - - return '' - }, - - DD () { - if (this.date) { - return this.date.substr(8) - } - - return '' - } - }, - created () { this.isAdmin = !!this.$store.state.user.adminAuthType this.date = this.$dayjs(new Date).format('YYYY年MM月DD') + this.yyyyMM = this.$dayjs(new Date).format('YYYY年MM') + this.DD = this.$dayjs(new Date).format('DD') this.getList() this.getTotal() }, @@ -121,6 +107,9 @@ onDateChange (e) { this.date = `${e.year}年${e.month}月${e.day}` + this.yyyyMM = `${e.year}年${e.month}月` + this.DD = e.day + this.$nextTick(() => { this.getList() this.getTotal() diff --git a/src/saas/AppCountryAlbum/components/Organize.vue b/src/saas/AppCountryAlbum/components/Organize.vue index 8c9489cd..18ca952e 100644 --- a/src/saas/AppCountryAlbum/components/Organize.vue +++ b/src/saas/AppCountryAlbum/components/Organize.vue @@ -102,27 +102,13 @@ list: [], isMore: false, isShow: false, + yyyyMM: '', + DD: '', attendanceCount: {} } }, computed: { - yyyyMM () { - if (this.date) { - return this.date.substr(0, 8) - } - - return '' - }, - - DD () { - if (this.date) { - return this.date.substr(8) - } - - return '' - }, - rate () { if (!this.attendanceCount.all) { return '0' @@ -134,6 +120,8 @@ mounted () { this.date = this.$dayjs(new Date).format('YYYY年MM月DD') + this.yyyyMM = this.$dayjs(new Date).format('YYYY年MM') + this.DD = this.$dayjs(new Date).format('DD') this.getPhotoTotal() }, @@ -168,6 +156,9 @@ onDateChange (e) { this.date = `${e.year}年${e.month}月${e.day}` + this.yyyyMM = `${e.year}年${e.month}月` + this.DD = e.day + this.$nextTick(() => { this.getPhotoTotal() }) diff --git a/src/saas/AppCountryAlbum/components/report/WorkReport.vue b/src/saas/AppCountryAlbum/components/report/WorkReport.vue index 0e2ce8fe..aec60669 100644 --- a/src/saas/AppCountryAlbum/components/report/WorkReport.vue +++ b/src/saas/AppCountryAlbum/components/report/WorkReport.vue @@ -148,6 +148,7 @@ let formData = new FormData() formData.append('file', res.tempFiles[0]) this.$http.post('/admin/file/add2?type=image', formData).then(res => { + console.log(res) if (res.code === 0) { this.richList.push({ type: 'img', From 7c54c806adcb81401488367fb1cb12fa68bc2ad3 Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Mon, 30 May 2022 11:14:55 +0800 Subject: [PATCH 2/8] 29938 --- src/saas/AppCountryAlbum/components/report/Daily.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/saas/AppCountryAlbum/components/report/Daily.vue b/src/saas/AppCountryAlbum/components/report/Daily.vue index b85b0e3d..4c4b168d 100644 --- a/src/saas/AppCountryAlbum/components/report/Daily.vue +++ b/src/saas/AppCountryAlbum/components/report/Daily.vue @@ -1,22 +1,22 @@