From 72d814c9131467f9fd1ef887aa7218f8a2a8799c Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Mon, 23 May 2022 18:00:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B9=A1=E6=9D=91=E7=9B=B8=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/saas/AppCountryAlbum/AlbumDetail.vue | 24 +++++----- src/saas/AppCountryAlbum/Attendance.vue | 23 +++++++--- .../AppCountryAlbum/AttendanceFiexdTime.vue | 2 + .../AttendanceFlexibleTime.vue | 2 + src/saas/AppCountryAlbum/PhotoRank.vue | 27 +++++++---- src/saas/AppCountryAlbum/WatermarkConfig.vue | 43 +++++++++++++++--- src/saas/AppCountryAlbum/components/Home.vue | 14 +++++- .../AppCountryAlbum/components/Organize.vue | 45 ++++++++++++------- 8 files changed, 131 insertions(+), 49 deletions(-) diff --git a/src/saas/AppCountryAlbum/AlbumDetail.vue b/src/saas/AppCountryAlbum/AlbumDetail.vue index 9997a9ca..12f4b1e9 100644 --- a/src/saas/AppCountryAlbum/AlbumDetail.vue +++ b/src/saas/AppCountryAlbum/AlbumDetail.vue @@ -29,11 +29,13 @@

照片列表

-
- 所有日期 - -
-
+ +
+ {{ date || '所有日期' }} + +
+
+
所有干部
@@ -70,6 +72,7 @@ type: '', info: {}, name: '', + date: '', coverImg: '', imgList: [], hideStatus: false, @@ -113,6 +116,11 @@ }) }, + onChange (e) { + console.log(e) + this.date = e.detail.value + }, + getInfo (id) { this.$http.post(`/api/appalbum/queryDetailById?id=${id}`).then(res => { if (res.code === 0) { @@ -230,15 +238,11 @@ display: flex; align-items: center; - & > div { + .right-item { display: flex; align-items: center; margin-right: 32px; - &:last-child { - margin-right: 0; - } - span { color: #666666; font-size: 26px; diff --git a/src/saas/AppCountryAlbum/Attendance.vue b/src/saas/AppCountryAlbum/Attendance.vue index c6f6c0e1..f24ef9b0 100644 --- a/src/saas/AppCountryAlbum/Attendance.vue +++ b/src/saas/AppCountryAlbum/Attendance.vue @@ -20,9 +20,9 @@
- 全部 10 - 已出勤 10 - 未出勤 10 + 全部 {{ attendanceCount.all || 0 }} + 已出勤 {{ attendanceCount.hasIn || 0 }} + 未出勤 {{ attendanceCount.hasOut || 0 }}
考勤设置
@@ -55,10 +55,10 @@ data () { return { - photoTotal: {}, date: '', currIndex: 0, - list: [] + list: [], + attendanceCount: {} } }, @@ -83,6 +83,7 @@ created () { this.date = this.$dayjs(new Date).format('YYYY年MM月DD') this.getList() + this.getTotal() }, methods: { @@ -98,13 +99,21 @@ this.$nextTick(() => { this.getList() + this.getTotal() + }) + }, + + getTotal () { + this.$http.post(`/api/appattendancerecord/attendanceCount?queryTime=${this.date.replace(/年|月/g, '-')}`).then(res => { + if (res.code === 0) { + this.attendanceCount = res.data + } }) }, getList () { - this.$http.post(`/api/appattendancerecord/userphotosort?queryTime=${this.date}`).then(res => { + this.$http.post(`/api/appattendancerecord/alldetail?queryTime=${this.date.replace(/年|月/g, '-')}`).then(res => { if (res.code === 0) { - this.list = res.data } }) } diff --git a/src/saas/AppCountryAlbum/AttendanceFiexdTime.vue b/src/saas/AppCountryAlbum/AttendanceFiexdTime.vue index 53357a42..5bbafd60 100644 --- a/src/saas/AppCountryAlbum/AttendanceFiexdTime.vue +++ b/src/saas/AppCountryAlbum/AttendanceFiexdTime.vue @@ -193,6 +193,8 @@ onWorkPointChange (e) { this.form.openWorkPoint = e.detail.value ? '1' : '0' + this.form.workPointDesc = {} + this.address = {} }, save () { diff --git a/src/saas/AppCountryAlbum/AttendanceFlexibleTime.vue b/src/saas/AppCountryAlbum/AttendanceFlexibleTime.vue index e67dc012..ff2c73d4 100644 --- a/src/saas/AppCountryAlbum/AttendanceFlexibleTime.vue +++ b/src/saas/AppCountryAlbum/AttendanceFlexibleTime.vue @@ -180,6 +180,8 @@ onWorkPointChange (e) { this.form.openWorkPoint = e.detail.value ? '1' : '0' + this.form.workPointDesc = {} + this.address = {} }, save () { diff --git a/src/saas/AppCountryAlbum/PhotoRank.vue b/src/saas/AppCountryAlbum/PhotoRank.vue index 6c03a7f2..2b7386d5 100644 --- a/src/saas/AppCountryAlbum/PhotoRank.vue +++ b/src/saas/AppCountryAlbum/PhotoRank.vue @@ -5,17 +5,17 @@

成员拍照排名

-
+
{{ index + 1 > 9 ? index + 1 : '0' + (index + 1) }} -

贡平娟

+

已上传 - 10 + {{ item.num }}
@@ -32,16 +32,27 @@ data () { return { - + list: [] } }, - mounted () { - + onLoad (query) { + this.getList(query.date) }, methods: { - + getList (date) { + this.$http.post(`/api/appattendancerecord/userphotosort?queryTime=${date}`).then(res => { + if (res.code === 0) { + this.list = Object.keys(res.data).map(v => { + return { + name: v, + num: res.data[v] + } + }) + } + }) + } } } @@ -130,4 +141,4 @@ } } } - \ No newline at end of file + diff --git a/src/saas/AppCountryAlbum/WatermarkConfig.vue b/src/saas/AppCountryAlbum/WatermarkConfig.vue index 7e7bea23..6df30ac7 100644 --- a/src/saas/AppCountryAlbum/WatermarkConfig.vue +++ b/src/saas/AppCountryAlbum/WatermarkConfig.vue @@ -4,14 +4,32 @@
-
+
+
+

{{ mapFieldLable(item.type) }}

{{ item.defaultValue || '' }}

-
-
+ +
+
+

{{ mapFieldLable(item.type) }}

+

{{ item.defaultValue || '' }}

+
+ +
+
+ +
+
+

{{ mapFieldLable(item.type) }}

+

{{ item.defaultValue || '' }}

+
+ +
+
保存
@@ -47,6 +65,10 @@ }) }, + onDateChange (e, index) { + this.$set(this.config[index], 'defaultValue', e.detail.value) + }, + onChange (e, index) { this.$set(this.config[index], 'status', e.detail.value ? '1' : '0') }, @@ -120,15 +142,15 @@ border: none; } - .left { + + .right { display: flex; align-items: center; flex: 1; - margin-right: 10px; + margin-left: 36px; - .left-right { + .right-left { flex: 1; - margin-left: 36px; h2 { margin-bottom: 12px; @@ -142,6 +164,13 @@ } } } + + + .left { + display: flex; + align-items: center; + margin-right: 10px; + } } } } diff --git a/src/saas/AppCountryAlbum/components/Home.vue b/src/saas/AppCountryAlbum/components/Home.vue index e11fa905..bd104a45 100644 --- a/src/saas/AppCountryAlbum/components/Home.vue +++ b/src/saas/AppCountryAlbum/components/Home.vue @@ -3,7 +3,7 @@
-

吴小米

+

欢迎使用乡村相册

@@ -81,7 +81,8 @@ countPhotoNo: '', countPhotographer: '', list: [], - msgInfo: {} + msgInfo: {}, + userInfo: {} } }, @@ -89,6 +90,7 @@ this.getCountPhotoNo() this.getAlbumList() this.getMsgList() + this.getUserInfo() }, methods: { @@ -98,6 +100,14 @@ }) }, + getUserInfo () { + this.$http.post('/api/user/info').then(res => { + if (res.code === 0) { + this.userInfo = res.data + } + }) + }, + getCountPhotoNo () { this.$http.post('/api/appalbumphoto/countPhotoNo').then(res => { if (res.code === 0) { diff --git a/src/saas/AppCountryAlbum/components/Organize.vue b/src/saas/AppCountryAlbum/components/Organize.vue index b2a0aadd..ec59ae3b 100644 --- a/src/saas/AppCountryAlbum/components/Organize.vue +++ b/src/saas/AppCountryAlbum/components/Organize.vue @@ -41,7 +41,7 @@ 拍照数

{{ photoTotal.allPhoto }}

- +
@@ -54,34 +54,34 @@
-

8

+

{{ attendanceCount.hasIn || 0 }}

人已打卡 - 共12人 + 共{{ attendanceCount.all || 0 }}人
- 66.6% + {{ rate }}%
-
+

成员拍照排名

- +
-
+
{{ index + 1 > 9 ? index + 1 : '0' + (index + 1) }} -

贡平娟

+

已上传 - 10 + {{ item.num }}
@@ -99,7 +99,8 @@ return { photoTotal: {}, date: '', - list: [] + list: [], + attendanceCount: {} } }, @@ -118,30 +119,44 @@ } return '' + }, + + rate () { + if (!this.attendanceCount.all) { + return '0' + } + + return (this.attendanceCount.hasIn / this.attendanceCount.all * 100).toFixed(2) } }, - onLoad () { + mounted () { this.date = this.$dayjs(new Date).format('YYYY年MM月DD') this.getPhotoTotal() }, methods: { getPhotoTotal () { - this.$http.post(`/api/appattendancerecord/punchclocksum?queryTime=${this.date}`).then(res => { + this.$http.post(`/api/appattendancerecord/punchclocksum?queryTime=${this.date.replace(/年|月/g, '-')}`).then(res => { if (res.code === 0) { this.photoTotal = res.data } }) - this.$http.post(`/api/appattendancerecord/alldetail?queryTime=${this.date}`).then(res => { + this.$http.post(`/api/appattendancerecord/attendanceCount?queryTime=${this.date.replace(/年|月/g, '-')}`).then(res => { if (res.code === 0) { + this.attendanceCount = res.data } }) - this.$http.post(`/api/appattendancerecord/userphotosort?queryTime=${this.date}`).then(res => { + this.$http.post(`/api/appattendancerecord/userphotosort?queryTime=${this.date.replace(/年|月/g, '-')}`).then(res => { if (res.code === 0) { - this.list = res.data + this.list = Object.keys(res.data).map(v => { + return { + name: v, + num: res.data[v] + } + }) } }) },