Compare commits

...

4 Commits

  1. 6
      .env.development
  2. 6
      .env.production
  3. 18
      src/App.vue
  4. 15
      src/components/List/List.vue
  5. 10
      src/config/api.js
  6. 2
      src/plugins/axios.js
  7. 27
      src/store/modules/home/mutations.js
  8. 3
      src/store/modules/home/state.js

6
.env.development

@ -1,10 +1,10 @@
VUE_APP_MODE=development VUE_APP_MODE=development
VUE_APP_NODE_ENV=development VUE_APP_NODE_ENV=development
VUE_APP_SCENE=checkwork VUE_APP_SCENE=checkwork
VUE_APP_BASE_URL=https://test.tall.wiki VUE_APP_BASE_URL=http://101.201.226.163
VUE_APP_API_URL=https://test.tall.wiki/checkwork/gateway VUE_APP_API_URL=http://101.201.226.163/checkwork/gateway
VUE_APP_PROXY_URL=/gateway VUE_APP_PROXY_URL=/gateway
VUE_APP_PUBLIC_PATH=/checkwork VUE_APP_PUBLIC_PATH=/checkwork
VUE_APP_MSG_URL=wss://test.tall.wiki/websocket/message/v4.0/ws VUE_APP_MSG_URL=wss://101.201.226.163/websocket/message/v4.0/ws
VUE_APP_TITLE=考勤管理 VUE_APP_TITLE=考勤管理
VUE_APP_DESCRIPTION=考勤管理 VUE_APP_DESCRIPTION=考勤管理

6
.env.production

@ -1,10 +1,10 @@
VUE_APP_MODE=production VUE_APP_MODE=production
VUE_APP_NODE_ENV=production VUE_APP_NODE_ENV=production
VUE_APP_SCENE=checkwork VUE_APP_SCENE=checkwork
VUE_APP_BASE_URL=https://www.tall.wiki VUE_APP_BASE_URL=http://101.201.226.163
VUE_APP_API_URL=https://www.tall.wiki/checkwork/gateway VUE_APP_API_URL=http://101.201.226.163//checkwork/gateway
VUE_APP_PROXY_URL=/gateway VUE_APP_PROXY_URL=/gateway
VUE_APP_PUBLIC_PATH=/checkwork VUE_APP_PUBLIC_PATH=/checkwork
VUE_APP_MSG_URL=wss://www.tall.wiki/websocket/message/v4.0/ws VUE_APP_MSG_URL=wss://101.201.226.163/websocket/message/v4.0/ws
VUE_APP_TITLE=考勤管理 VUE_APP_TITLE=考勤管理
VUE_APP_DESCRIPTION=考勤管理 VUE_APP_DESCRIPTION=考勤管理

18
src/App.vue

@ -20,17 +20,27 @@ export default {
this.$router.onReady(async () => { this.$router.onReady(async () => {
const userId = this.$route.query.uid; const userId = this.$route.query.uid;
const roleId = this.$route.query.rid; const roleId = this.$route.query.rid;
const params = { userId }; const token = this.$route.query.token;
await this.getUserId(params); 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.setRoleId(roleId);
await this.setUrl(url);
await this.setLongitude(longitude);
await this.setLatitude(latitude);
await this.getAllMembers({ projectId: this.$route.query.pid }); await this.getAllMembers({ projectId: this.$route.query.pid });
this.setProjectId(this.$route.query.pid); this.setProjectId(this.$route.query.pid);
}); });
}, },
methods: { methods: {
...mapMutations('home', ['setProjectId', 'setMembers', 'setRoleId']), ...mapMutations('home', ['setProjectId', 'setMembers', 'setRoleId', 'setUrl', 'setLongitude', 'setLatitude']),
...mapActions('user', ['getUserId']), ...mapMutations('user', ['sign']),
// ...mapActions('user', ['getUserId']),
...mapActions('home', ['getAllMembers']), ...mapActions('home', ['getAllMembers']),
}, },
}; };

15
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() { mounted() {
this.timer = setInterval(async () => { this.timer = setInterval(async () => {
@ -426,6 +436,9 @@ export default {
params.param.remark = this.remark; params.param.remark = this.remark;
} }
params.param.longitude = this.longitude;
params.param.latitude = this.latitude;
const res = await clockPunch(params); const res = await clockPunch(params);
const { code, msg } = res.data; const { code, msg } = res.data;
if (code === 200) { if (code === 200) {

10
src/config/api.js

@ -4,19 +4,19 @@ const baseUrl = process.env.VUE_APP_BASE_URL;
const defaultwbs = `${baseUrl}/gateway/defaultwbs`; const defaultwbs = `${baseUrl}/gateway/defaultwbs`;
// 查询考勤信息 // 查询考勤信息
export const clockQuery = params => axios.post(`${defaultwbs}/clock/query`, params); export const clockQuery = params => axios.post(`clock/query`, params);
// 查询考勤信息 // 查询考勤信息
export const clockPunch = params => axios.post(`${defaultwbs}/clock/punch`, params); export const clockPunch = params => axios.post(`clock/punch`, params);
// 查询所有成员 // 查询所有成员
export const queryChecker = params => axios.post(`${defaultwbs}/deliver/queryChecker`, params); export const queryChecker = params => axios.post(`deliver/queryChecker`, params);
// 查询所有成员 // 查询所有成员
export const clockAudit = params => axios.post(`${defaultwbs}/clock/audit`, params); export const clockAudit = params => axios.post(`clock/audit`, params);
// 导出考勤excel // 导出考勤excel
export const clockExport = params => axios.post(`${defaultwbs}/clock/export`, params); export const clockExport = params => axios.post(`clock/export`, params);
// 查询所有成员工资信息 // 查询所有成员工资信息
export const queryMemberSalary = params => axios.post(`${defaultwbs}/salary/queryMemberSalary`, params); export const queryMemberSalary = params => axios.post(`${defaultwbs}/salary/queryMemberSalary`, params);

2
src/plugins/axios.js

@ -19,6 +19,8 @@ const _axios = axios.create(config);
axios.interceptors.request.use( axios.interceptors.request.use(
function(config) { function(config) {
let token = store.state.anyringToken || sessionStorage.getItem('anyringToken'); let token = store.state.anyringToken || sessionStorage.getItem('anyringToken');
config.url = store.state.home.url + '/' + config.url;
console.log(config)
if (token) { if (token) {
config.headers.Authorization = `Bearer ${token}`; config.headers.Authorization = `Bearer ${token}`;

27
src/store/modules/home/mutations.js

@ -69,6 +69,33 @@ const mutations = {
setRoleId(state, data) { setRoleId(state, data) {
state.roleId = data; state.roleId = data;
}, },
/**
* 设置url信息
* @param {object} state
* @param {String} data
*/
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; export default mutations;

3
src/store/modules/home/state.js

@ -14,6 +14,9 @@ const state = {
memberIdList: [], memberIdList: [],
roleId: '', roleId: '',
checkers: [], // 审核人列表 checkers: [], // 审核人列表
url: '',
longitude: '',
latitude: ''
}; };
export default state; export default state;

Loading…
Cancel
Save