From b13eb798a009ce205a3d0a2c55c083b89aaca250 Mon Sep 17 00:00:00 2001 From: xuesinan <1404152492@qq.com> Date: Fri, 8 Apr 2022 17:40:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=A1=E6=8F=92=E4=BB=B6=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=BD=8D=E7=BD=AE=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 6 +++++- src/components/List/List.vue | 15 ++++++++++++++- src/store/modules/home/mutations.js | 18 ++++++++++++++++++ src/store/modules/home/state.js | 4 +++- 4 files changed, 40 insertions(+), 3 deletions(-) diff --git a/src/App.vue b/src/App.vue index c003d18..1770b8b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -22,19 +22,23 @@ export default { const roleId = this.$route.query.rid; const token = this.$route.query.token; const url = this.$route.query.url; + const longitude = this.$route.query.longitude; + const latitude = this.$route.query.latitude; // const params = { userId }; // await this.getUserId(params); await this.sign(token); await this.setRoleId(roleId); await this.setUrl(url); + await this.setLongitude(longitude); + await this.setLatitude(latitude); await this.getAllMembers({ projectId: this.$route.query.pid }); this.setProjectId(this.$route.query.pid); }); }, methods: { - ...mapMutations('home', ['setProjectId', 'setMembers', 'setRoleId', 'setUrl']), + ...mapMutations('home', ['setProjectId', 'setMembers', 'setRoleId', 'setUrl', 'setLongitude', 'setLatitude']), ...mapMutations('user', ['sign']), // ...mapActions('user', ['getUserId']), ...mapActions('home', ['getAllMembers']), diff --git a/src/components/List/List.vue b/src/components/List/List.vue index 7cd7cc2..52331e5 100644 --- a/src/components/List/List.vue +++ b/src/components/List/List.vue @@ -290,7 +290,17 @@ export default { }; }, - computed: mapState('home', ['projectId', 'members', 'startTime', 'endTime', 'memberIdList', 'roleId', 'checkers']), + computed: mapState('home', [ + 'projectId', + 'members', + 'startTime', + 'endTime', + 'memberIdList', + 'roleId', + 'checkers', + 'longitude', + 'latitude', + ]), mounted() { this.timer = setInterval(async () => { @@ -426,6 +436,9 @@ export default { params.param.remark = this.remark; } + params.param.longitude = this.longitude; + params.param.latitude = this.latitude; + const res = await clockPunch(params); const { code, msg } = res.data; if (code === 200) { diff --git a/src/store/modules/home/mutations.js b/src/store/modules/home/mutations.js index 58cdd52..72dca33 100644 --- a/src/store/modules/home/mutations.js +++ b/src/store/modules/home/mutations.js @@ -78,6 +78,24 @@ const mutations = { setUrl(state, data) { state.url = data; }, + + /** + * 设置经度信息 + * @param {object} state + * @param {String} data + */ + setLongitude(state, data) { + state.longitude = data; + }, + + /** + * 设置纬度信息 + * @param {object} state + * @param {String} data + */ + setLatitude(state, data) { + state.latitude = data; + }, }; export default mutations; diff --git a/src/store/modules/home/state.js b/src/store/modules/home/state.js index acced4c..bbb09a6 100644 --- a/src/store/modules/home/state.js +++ b/src/store/modules/home/state.js @@ -14,7 +14,9 @@ const state = { memberIdList: [], roleId: '', checkers: [], // 审核人列表 - url: '' + url: '', + longitude: '', + latitude: '' }; export default state;