diff --git a/config/dev.env.js b/config/dev.env.js index c21f267..bc033b0 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -6,6 +6,6 @@ // 将两个配置对象合并,最终结果是 NODE_ENV:‘"development"' module.exports = merge(prodEnv, { NODE_ENV: '"development"', - // BASE_API: '"http://139.198.16.38:20005"' - BASE_API: '"http://192.168.0.225:8093"' + BASE_API: '"http://139.198.16.38:20005"' + // BASE_API: '"http://192.168.0.18:8093"' }) diff --git a/config/dev.env.js b/config/dev.env.js index c21f267..bc033b0 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -6,6 +6,6 @@ // 将两个配置对象合并,最终结果是 NODE_ENV:‘"development"' module.exports = merge(prodEnv, { NODE_ENV: '"development"', - // BASE_API: '"http://139.198.16.38:20005"' - BASE_API: '"http://192.168.0.225:8093"' + BASE_API: '"http://139.198.16.38:20005"' + // BASE_API: '"http://192.168.0.18:8093"' }) diff --git a/src/api/attendance.js b/src/api/attendance.js new file mode 100644 index 0000000..c7e9922 --- /dev/null +++ b/src/api/attendance.js @@ -0,0 +1,123 @@ +/** + * 设备管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +export function makeReport() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 获取考勤规则 +export function getRegular() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 保存考勤规则 +export function updateRegular(params) { + return request({ + url: 'device/listAll', + method: 'post', + params + }) +} +// 批量导入特殊考勤日 +export function batchImportSpecialDay(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: 'irisCollect/batchImport', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} + +// 模板下载 +export function downloadTemplate(deviceType) { + return request({ + url: 'device/model', + method: 'get', + params: { + deviceType: deviceType + } + }) +} + +// 添加特殊考勤日 +export function addSpecialDay(params) { + return request({ + url: 'device/add', + method: 'post', + params + }) +} +// 修改特殊考勤日 +export function updateSpecialDay(params) { + return request({ + url: 'device/update', + method: 'post', + params + }) +} +// 删除特殊考勤日 +export function delSpecialDay(ids) { + return request({ + url: 'device/delete', + method: 'post', + params: { + ids: ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +export function getSpecialDayList() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 批量导出 +export function batchExportDevice(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} +// 添加考勤备注 +export function addRemarks(params) { + return request({ + url: 'device/add', + method: 'post', + params + }) +} + +// 获取已备注列表 +export function getRemarksList(params) { + return request({ + url: 'remarks/list', + method: 'get', + params + }) +} + +// 获取可备注的类型 +export function getRemarksTypeList(params) { + return request({ + url: 'remarks/list', + method: 'get', + params + }) +} + diff --git a/config/dev.env.js b/config/dev.env.js index c21f267..bc033b0 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -6,6 +6,6 @@ // 将两个配置对象合并,最终结果是 NODE_ENV:‘"development"' module.exports = merge(prodEnv, { NODE_ENV: '"development"', - // BASE_API: '"http://139.198.16.38:20005"' - BASE_API: '"http://192.168.0.225:8093"' + BASE_API: '"http://139.198.16.38:20005"' + // BASE_API: '"http://192.168.0.18:8093"' }) diff --git a/src/api/attendance.js b/src/api/attendance.js new file mode 100644 index 0000000..c7e9922 --- /dev/null +++ b/src/api/attendance.js @@ -0,0 +1,123 @@ +/** + * 设备管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +export function makeReport() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 获取考勤规则 +export function getRegular() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 保存考勤规则 +export function updateRegular(params) { + return request({ + url: 'device/listAll', + method: 'post', + params + }) +} +// 批量导入特殊考勤日 +export function batchImportSpecialDay(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: 'irisCollect/batchImport', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} + +// 模板下载 +export function downloadTemplate(deviceType) { + return request({ + url: 'device/model', + method: 'get', + params: { + deviceType: deviceType + } + }) +} + +// 添加特殊考勤日 +export function addSpecialDay(params) { + return request({ + url: 'device/add', + method: 'post', + params + }) +} +// 修改特殊考勤日 +export function updateSpecialDay(params) { + return request({ + url: 'device/update', + method: 'post', + params + }) +} +// 删除特殊考勤日 +export function delSpecialDay(ids) { + return request({ + url: 'device/delete', + method: 'post', + params: { + ids: ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +export function getSpecialDayList() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 批量导出 +export function batchExportDevice(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} +// 添加考勤备注 +export function addRemarks(params) { + return request({ + url: 'device/add', + method: 'post', + params + }) +} + +// 获取已备注列表 +export function getRemarksList(params) { + return request({ + url: 'remarks/list', + method: 'get', + params + }) +} + +// 获取可备注的类型 +export function getRemarksTypeList(params) { + return request({ + url: 'remarks/list', + method: 'get', + params + }) +} + diff --git a/src/api/query.js b/src/api/query.js index 2fdedee..5117a9c 100644 --- a/src/api/query.js +++ b/src/api/query.js @@ -99,4 +99,4 @@ params, responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob }) -} \ No newline at end of file +} diff --git a/config/dev.env.js b/config/dev.env.js index c21f267..bc033b0 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -6,6 +6,6 @@ // 将两个配置对象合并,最终结果是 NODE_ENV:‘"development"' module.exports = merge(prodEnv, { NODE_ENV: '"development"', - // BASE_API: '"http://139.198.16.38:20005"' - BASE_API: '"http://192.168.0.225:8093"' + BASE_API: '"http://139.198.16.38:20005"' + // BASE_API: '"http://192.168.0.18:8093"' }) diff --git a/src/api/attendance.js b/src/api/attendance.js new file mode 100644 index 0000000..c7e9922 --- /dev/null +++ b/src/api/attendance.js @@ -0,0 +1,123 @@ +/** + * 设备管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +export function makeReport() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 获取考勤规则 +export function getRegular() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 保存考勤规则 +export function updateRegular(params) { + return request({ + url: 'device/listAll', + method: 'post', + params + }) +} +// 批量导入特殊考勤日 +export function batchImportSpecialDay(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: 'irisCollect/batchImport', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} + +// 模板下载 +export function downloadTemplate(deviceType) { + return request({ + url: 'device/model', + method: 'get', + params: { + deviceType: deviceType + } + }) +} + +// 添加特殊考勤日 +export function addSpecialDay(params) { + return request({ + url: 'device/add', + method: 'post', + params + }) +} +// 修改特殊考勤日 +export function updateSpecialDay(params) { + return request({ + url: 'device/update', + method: 'post', + params + }) +} +// 删除特殊考勤日 +export function delSpecialDay(ids) { + return request({ + url: 'device/delete', + method: 'post', + params: { + ids: ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +export function getSpecialDayList() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 批量导出 +export function batchExportDevice(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} +// 添加考勤备注 +export function addRemarks(params) { + return request({ + url: 'device/add', + method: 'post', + params + }) +} + +// 获取已备注列表 +export function getRemarksList(params) { + return request({ + url: 'remarks/list', + method: 'get', + params + }) +} + +// 获取可备注的类型 +export function getRemarksTypeList(params) { + return request({ + url: 'remarks/list', + method: 'get', + params + }) +} + diff --git a/src/api/query.js b/src/api/query.js index 2fdedee..5117a9c 100644 --- a/src/api/query.js +++ b/src/api/query.js @@ -99,4 +99,4 @@ params, responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob }) -} \ No newline at end of file +} diff --git a/src/main.js b/src/main.js index 3e00bc4..c9354d4 100644 --- a/src/main.js +++ b/src/main.js @@ -64,6 +64,9 @@ import VCharts from 'v-charts' Vue.use(VCharts) +// 配置是否启用考勤功能 +export const attendanceEnable = true + new Vue({ el: '#app', router, diff --git a/config/dev.env.js b/config/dev.env.js index c21f267..bc033b0 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -6,6 +6,6 @@ // 将两个配置对象合并,最终结果是 NODE_ENV:‘"development"' module.exports = merge(prodEnv, { NODE_ENV: '"development"', - // BASE_API: '"http://139.198.16.38:20005"' - BASE_API: '"http://192.168.0.225:8093"' + BASE_API: '"http://139.198.16.38:20005"' + // BASE_API: '"http://192.168.0.18:8093"' }) diff --git a/src/api/attendance.js b/src/api/attendance.js new file mode 100644 index 0000000..c7e9922 --- /dev/null +++ b/src/api/attendance.js @@ -0,0 +1,123 @@ +/** + * 设备管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +export function makeReport() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 获取考勤规则 +export function getRegular() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 保存考勤规则 +export function updateRegular(params) { + return request({ + url: 'device/listAll', + method: 'post', + params + }) +} +// 批量导入特殊考勤日 +export function batchImportSpecialDay(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: 'irisCollect/batchImport', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} + +// 模板下载 +export function downloadTemplate(deviceType) { + return request({ + url: 'device/model', + method: 'get', + params: { + deviceType: deviceType + } + }) +} + +// 添加特殊考勤日 +export function addSpecialDay(params) { + return request({ + url: 'device/add', + method: 'post', + params + }) +} +// 修改特殊考勤日 +export function updateSpecialDay(params) { + return request({ + url: 'device/update', + method: 'post', + params + }) +} +// 删除特殊考勤日 +export function delSpecialDay(ids) { + return request({ + url: 'device/delete', + method: 'post', + params: { + ids: ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +export function getSpecialDayList() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 批量导出 +export function batchExportDevice(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} +// 添加考勤备注 +export function addRemarks(params) { + return request({ + url: 'device/add', + method: 'post', + params + }) +} + +// 获取已备注列表 +export function getRemarksList(params) { + return request({ + url: 'remarks/list', + method: 'get', + params + }) +} + +// 获取可备注的类型 +export function getRemarksTypeList(params) { + return request({ + url: 'remarks/list', + method: 'get', + params + }) +} + diff --git a/src/api/query.js b/src/api/query.js index 2fdedee..5117a9c 100644 --- a/src/api/query.js +++ b/src/api/query.js @@ -99,4 +99,4 @@ params, responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob }) -} \ No newline at end of file +} diff --git a/src/main.js b/src/main.js index 3e00bc4..c9354d4 100644 --- a/src/main.js +++ b/src/main.js @@ -64,6 +64,9 @@ import VCharts from 'v-charts' Vue.use(VCharts) +// 配置是否启用考勤功能 +export const attendanceEnable = true + new Vue({ el: '#app', router, diff --git a/src/router/index.js b/src/router/index.js index fcd1ef5..733af54 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -11,6 +11,7 @@ import { baseRoutes } from './modules/base' import { systemRouters } from './modules/system' import { accessRouters } from './modules/access' +import { attendanceRouters } from './modules/attendance' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -73,6 +74,7 @@ export const asyncRouterMap = [ ...accessRouters, ...baseRoutes, + ...attendanceRouters, ...systemRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/config/dev.env.js b/config/dev.env.js index c21f267..bc033b0 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -6,6 +6,6 @@ // 将两个配置对象合并,最终结果是 NODE_ENV:‘"development"' module.exports = merge(prodEnv, { NODE_ENV: '"development"', - // BASE_API: '"http://139.198.16.38:20005"' - BASE_API: '"http://192.168.0.225:8093"' + BASE_API: '"http://139.198.16.38:20005"' + // BASE_API: '"http://192.168.0.18:8093"' }) diff --git a/src/api/attendance.js b/src/api/attendance.js new file mode 100644 index 0000000..c7e9922 --- /dev/null +++ b/src/api/attendance.js @@ -0,0 +1,123 @@ +/** + * 设备管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +export function makeReport() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 获取考勤规则 +export function getRegular() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 保存考勤规则 +export function updateRegular(params) { + return request({ + url: 'device/listAll', + method: 'post', + params + }) +} +// 批量导入特殊考勤日 +export function batchImportSpecialDay(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: 'irisCollect/batchImport', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} + +// 模板下载 +export function downloadTemplate(deviceType) { + return request({ + url: 'device/model', + method: 'get', + params: { + deviceType: deviceType + } + }) +} + +// 添加特殊考勤日 +export function addSpecialDay(params) { + return request({ + url: 'device/add', + method: 'post', + params + }) +} +// 修改特殊考勤日 +export function updateSpecialDay(params) { + return request({ + url: 'device/update', + method: 'post', + params + }) +} +// 删除特殊考勤日 +export function delSpecialDay(ids) { + return request({ + url: 'device/delete', + method: 'post', + params: { + ids: ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +export function getSpecialDayList() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 批量导出 +export function batchExportDevice(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} +// 添加考勤备注 +export function addRemarks(params) { + return request({ + url: 'device/add', + method: 'post', + params + }) +} + +// 获取已备注列表 +export function getRemarksList(params) { + return request({ + url: 'remarks/list', + method: 'get', + params + }) +} + +// 获取可备注的类型 +export function getRemarksTypeList(params) { + return request({ + url: 'remarks/list', + method: 'get', + params + }) +} + diff --git a/src/api/query.js b/src/api/query.js index 2fdedee..5117a9c 100644 --- a/src/api/query.js +++ b/src/api/query.js @@ -99,4 +99,4 @@ params, responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob }) -} \ No newline at end of file +} diff --git a/src/main.js b/src/main.js index 3e00bc4..c9354d4 100644 --- a/src/main.js +++ b/src/main.js @@ -64,6 +64,9 @@ import VCharts from 'v-charts' Vue.use(VCharts) +// 配置是否启用考勤功能 +export const attendanceEnable = true + new Vue({ el: '#app', router, diff --git a/src/router/index.js b/src/router/index.js index fcd1ef5..733af54 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -11,6 +11,7 @@ import { baseRoutes } from './modules/base' import { systemRouters } from './modules/system' import { accessRouters } from './modules/access' +import { attendanceRouters } from './modules/attendance' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -73,6 +74,7 @@ export const asyncRouterMap = [ ...accessRouters, ...baseRoutes, + ...attendanceRouters, ...systemRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/attendance.js b/src/router/modules/attendance.js new file mode 100644 index 0000000..f7cf021 --- /dev/null +++ b/src/router/modules/attendance.js @@ -0,0 +1,55 @@ +/* Layout */ +import Layout from '../../views/layout/Layout' + +export const attendanceRouters = [ + { + path: '/attendance', + component: Layout, + redirect: '/atd', + name: 'Atd', + meta: { + title: '考勤统计', + icon: 'task', // 图标 + permission: ['/attendance']// 权限名称 + }, + children: [ + { + path: '/listReport', + name: 'ListReport', + component: () => import('@/views/attendance/listReport'), + meta: { title: '查询报表数据', icon: 'function', permission: ['/listReport'] } + }, + { + path: '/makeReport', + name: 'MakeReport', + component: () => import('@/views/attendance/makeReport'), + meta: { title: '生成考勤报表', icon: 'function', permission: ['/makeReport'] } + } + ] + }, + { + path: '/atdSetting', + component: Layout, + redirect: '/atdSetting', + name: 'AtdSetting', + meta: { + title: '考勤设置', + icon: 'task', // 图标 + permission: ['/atdSetting']// 权限名称 + }, + children: [ + { + path: '/regular', + name: 'Regular', + component: () => import('@/views/attendance/regular'), + meta: { title: '考勤规则', icon: 'function', permission: ['/regular'] } + }, + { + path: '/specialDay', + name: 'SpecialDay', + component: () => import('@/views/attendance/specialDay'), + meta: { title: '特殊考勤日管理', icon: 'function', permission: ['/specialDay'] } + } + ] + } +] diff --git a/config/dev.env.js b/config/dev.env.js index c21f267..bc033b0 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -6,6 +6,6 @@ // 将两个配置对象合并,最终结果是 NODE_ENV:‘"development"' module.exports = merge(prodEnv, { NODE_ENV: '"development"', - // BASE_API: '"http://139.198.16.38:20005"' - BASE_API: '"http://192.168.0.225:8093"' + BASE_API: '"http://139.198.16.38:20005"' + // BASE_API: '"http://192.168.0.18:8093"' }) diff --git a/src/api/attendance.js b/src/api/attendance.js new file mode 100644 index 0000000..c7e9922 --- /dev/null +++ b/src/api/attendance.js @@ -0,0 +1,123 @@ +/** + * 设备管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +export function makeReport() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 获取考勤规则 +export function getRegular() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 保存考勤规则 +export function updateRegular(params) { + return request({ + url: 'device/listAll', + method: 'post', + params + }) +} +// 批量导入特殊考勤日 +export function batchImportSpecialDay(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: 'irisCollect/batchImport', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} + +// 模板下载 +export function downloadTemplate(deviceType) { + return request({ + url: 'device/model', + method: 'get', + params: { + deviceType: deviceType + } + }) +} + +// 添加特殊考勤日 +export function addSpecialDay(params) { + return request({ + url: 'device/add', + method: 'post', + params + }) +} +// 修改特殊考勤日 +export function updateSpecialDay(params) { + return request({ + url: 'device/update', + method: 'post', + params + }) +} +// 删除特殊考勤日 +export function delSpecialDay(ids) { + return request({ + url: 'device/delete', + method: 'post', + params: { + ids: ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +export function getSpecialDayList() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 批量导出 +export function batchExportDevice(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} +// 添加考勤备注 +export function addRemarks(params) { + return request({ + url: 'device/add', + method: 'post', + params + }) +} + +// 获取已备注列表 +export function getRemarksList(params) { + return request({ + url: 'remarks/list', + method: 'get', + params + }) +} + +// 获取可备注的类型 +export function getRemarksTypeList(params) { + return request({ + url: 'remarks/list', + method: 'get', + params + }) +} + diff --git a/src/api/query.js b/src/api/query.js index 2fdedee..5117a9c 100644 --- a/src/api/query.js +++ b/src/api/query.js @@ -99,4 +99,4 @@ params, responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob }) -} \ No newline at end of file +} diff --git a/src/main.js b/src/main.js index 3e00bc4..c9354d4 100644 --- a/src/main.js +++ b/src/main.js @@ -64,6 +64,9 @@ import VCharts from 'v-charts' Vue.use(VCharts) +// 配置是否启用考勤功能 +export const attendanceEnable = true + new Vue({ el: '#app', router, diff --git a/src/router/index.js b/src/router/index.js index fcd1ef5..733af54 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -11,6 +11,7 @@ import { baseRoutes } from './modules/base' import { systemRouters } from './modules/system' import { accessRouters } from './modules/access' +import { attendanceRouters } from './modules/attendance' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -73,6 +74,7 @@ export const asyncRouterMap = [ ...accessRouters, ...baseRoutes, + ...attendanceRouters, ...systemRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/attendance.js b/src/router/modules/attendance.js new file mode 100644 index 0000000..f7cf021 --- /dev/null +++ b/src/router/modules/attendance.js @@ -0,0 +1,55 @@ +/* Layout */ +import Layout from '../../views/layout/Layout' + +export const attendanceRouters = [ + { + path: '/attendance', + component: Layout, + redirect: '/atd', + name: 'Atd', + meta: { + title: '考勤统计', + icon: 'task', // 图标 + permission: ['/attendance']// 权限名称 + }, + children: [ + { + path: '/listReport', + name: 'ListReport', + component: () => import('@/views/attendance/listReport'), + meta: { title: '查询报表数据', icon: 'function', permission: ['/listReport'] } + }, + { + path: '/makeReport', + name: 'MakeReport', + component: () => import('@/views/attendance/makeReport'), + meta: { title: '生成考勤报表', icon: 'function', permission: ['/makeReport'] } + } + ] + }, + { + path: '/atdSetting', + component: Layout, + redirect: '/atdSetting', + name: 'AtdSetting', + meta: { + title: '考勤设置', + icon: 'task', // 图标 + permission: ['/atdSetting']// 权限名称 + }, + children: [ + { + path: '/regular', + name: 'Regular', + component: () => import('@/views/attendance/regular'), + meta: { title: '考勤规则', icon: 'function', permission: ['/regular'] } + }, + { + path: '/specialDay', + name: 'SpecialDay', + component: () => import('@/views/attendance/specialDay'), + meta: { title: '特殊考勤日管理', icon: 'function', permission: ['/specialDay'] } + } + ] + } +] diff --git a/src/views/attendance/editRemarks.vue b/src/views/attendance/editRemarks.vue new file mode 100644 index 0000000..58aa8f3 --- /dev/null +++ b/src/views/attendance/editRemarks.vue @@ -0,0 +1,328 @@ + + + + + diff --git a/config/dev.env.js b/config/dev.env.js index c21f267..bc033b0 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -6,6 +6,6 @@ // 将两个配置对象合并,最终结果是 NODE_ENV:‘"development"' module.exports = merge(prodEnv, { NODE_ENV: '"development"', - // BASE_API: '"http://139.198.16.38:20005"' - BASE_API: '"http://192.168.0.225:8093"' + BASE_API: '"http://139.198.16.38:20005"' + // BASE_API: '"http://192.168.0.18:8093"' }) diff --git a/src/api/attendance.js b/src/api/attendance.js new file mode 100644 index 0000000..c7e9922 --- /dev/null +++ b/src/api/attendance.js @@ -0,0 +1,123 @@ +/** + * 设备管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +export function makeReport() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 获取考勤规则 +export function getRegular() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 保存考勤规则 +export function updateRegular(params) { + return request({ + url: 'device/listAll', + method: 'post', + params + }) +} +// 批量导入特殊考勤日 +export function batchImportSpecialDay(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: 'irisCollect/batchImport', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} + +// 模板下载 +export function downloadTemplate(deviceType) { + return request({ + url: 'device/model', + method: 'get', + params: { + deviceType: deviceType + } + }) +} + +// 添加特殊考勤日 +export function addSpecialDay(params) { + return request({ + url: 'device/add', + method: 'post', + params + }) +} +// 修改特殊考勤日 +export function updateSpecialDay(params) { + return request({ + url: 'device/update', + method: 'post', + params + }) +} +// 删除特殊考勤日 +export function delSpecialDay(ids) { + return request({ + url: 'device/delete', + method: 'post', + params: { + ids: ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +export function getSpecialDayList() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 批量导出 +export function batchExportDevice(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} +// 添加考勤备注 +export function addRemarks(params) { + return request({ + url: 'device/add', + method: 'post', + params + }) +} + +// 获取已备注列表 +export function getRemarksList(params) { + return request({ + url: 'remarks/list', + method: 'get', + params + }) +} + +// 获取可备注的类型 +export function getRemarksTypeList(params) { + return request({ + url: 'remarks/list', + method: 'get', + params + }) +} + diff --git a/src/api/query.js b/src/api/query.js index 2fdedee..5117a9c 100644 --- a/src/api/query.js +++ b/src/api/query.js @@ -99,4 +99,4 @@ params, responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob }) -} \ No newline at end of file +} diff --git a/src/main.js b/src/main.js index 3e00bc4..c9354d4 100644 --- a/src/main.js +++ b/src/main.js @@ -64,6 +64,9 @@ import VCharts from 'v-charts' Vue.use(VCharts) +// 配置是否启用考勤功能 +export const attendanceEnable = true + new Vue({ el: '#app', router, diff --git a/src/router/index.js b/src/router/index.js index fcd1ef5..733af54 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -11,6 +11,7 @@ import { baseRoutes } from './modules/base' import { systemRouters } from './modules/system' import { accessRouters } from './modules/access' +import { attendanceRouters } from './modules/attendance' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -73,6 +74,7 @@ export const asyncRouterMap = [ ...accessRouters, ...baseRoutes, + ...attendanceRouters, ...systemRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/attendance.js b/src/router/modules/attendance.js new file mode 100644 index 0000000..f7cf021 --- /dev/null +++ b/src/router/modules/attendance.js @@ -0,0 +1,55 @@ +/* Layout */ +import Layout from '../../views/layout/Layout' + +export const attendanceRouters = [ + { + path: '/attendance', + component: Layout, + redirect: '/atd', + name: 'Atd', + meta: { + title: '考勤统计', + icon: 'task', // 图标 + permission: ['/attendance']// 权限名称 + }, + children: [ + { + path: '/listReport', + name: 'ListReport', + component: () => import('@/views/attendance/listReport'), + meta: { title: '查询报表数据', icon: 'function', permission: ['/listReport'] } + }, + { + path: '/makeReport', + name: 'MakeReport', + component: () => import('@/views/attendance/makeReport'), + meta: { title: '生成考勤报表', icon: 'function', permission: ['/makeReport'] } + } + ] + }, + { + path: '/atdSetting', + component: Layout, + redirect: '/atdSetting', + name: 'AtdSetting', + meta: { + title: '考勤设置', + icon: 'task', // 图标 + permission: ['/atdSetting']// 权限名称 + }, + children: [ + { + path: '/regular', + name: 'Regular', + component: () => import('@/views/attendance/regular'), + meta: { title: '考勤规则', icon: 'function', permission: ['/regular'] } + }, + { + path: '/specialDay', + name: 'SpecialDay', + component: () => import('@/views/attendance/specialDay'), + meta: { title: '特殊考勤日管理', icon: 'function', permission: ['/specialDay'] } + } + ] + } +] diff --git a/src/views/attendance/editRemarks.vue b/src/views/attendance/editRemarks.vue new file mode 100644 index 0000000..58aa8f3 --- /dev/null +++ b/src/views/attendance/editRemarks.vue @@ -0,0 +1,328 @@ + + + + + diff --git a/src/views/attendance/editSpecialDay.vue b/src/views/attendance/editSpecialDay.vue new file mode 100644 index 0000000..b416ddc --- /dev/null +++ b/src/views/attendance/editSpecialDay.vue @@ -0,0 +1,190 @@ + + + + + diff --git a/config/dev.env.js b/config/dev.env.js index c21f267..bc033b0 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -6,6 +6,6 @@ // 将两个配置对象合并,最终结果是 NODE_ENV:‘"development"' module.exports = merge(prodEnv, { NODE_ENV: '"development"', - // BASE_API: '"http://139.198.16.38:20005"' - BASE_API: '"http://192.168.0.225:8093"' + BASE_API: '"http://139.198.16.38:20005"' + // BASE_API: '"http://192.168.0.18:8093"' }) diff --git a/src/api/attendance.js b/src/api/attendance.js new file mode 100644 index 0000000..c7e9922 --- /dev/null +++ b/src/api/attendance.js @@ -0,0 +1,123 @@ +/** + * 设备管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +export function makeReport() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 获取考勤规则 +export function getRegular() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 保存考勤规则 +export function updateRegular(params) { + return request({ + url: 'device/listAll', + method: 'post', + params + }) +} +// 批量导入特殊考勤日 +export function batchImportSpecialDay(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: 'irisCollect/batchImport', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} + +// 模板下载 +export function downloadTemplate(deviceType) { + return request({ + url: 'device/model', + method: 'get', + params: { + deviceType: deviceType + } + }) +} + +// 添加特殊考勤日 +export function addSpecialDay(params) { + return request({ + url: 'device/add', + method: 'post', + params + }) +} +// 修改特殊考勤日 +export function updateSpecialDay(params) { + return request({ + url: 'device/update', + method: 'post', + params + }) +} +// 删除特殊考勤日 +export function delSpecialDay(ids) { + return request({ + url: 'device/delete', + method: 'post', + params: { + ids: ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +export function getSpecialDayList() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 批量导出 +export function batchExportDevice(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} +// 添加考勤备注 +export function addRemarks(params) { + return request({ + url: 'device/add', + method: 'post', + params + }) +} + +// 获取已备注列表 +export function getRemarksList(params) { + return request({ + url: 'remarks/list', + method: 'get', + params + }) +} + +// 获取可备注的类型 +export function getRemarksTypeList(params) { + return request({ + url: 'remarks/list', + method: 'get', + params + }) +} + diff --git a/src/api/query.js b/src/api/query.js index 2fdedee..5117a9c 100644 --- a/src/api/query.js +++ b/src/api/query.js @@ -99,4 +99,4 @@ params, responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob }) -} \ No newline at end of file +} diff --git a/src/main.js b/src/main.js index 3e00bc4..c9354d4 100644 --- a/src/main.js +++ b/src/main.js @@ -64,6 +64,9 @@ import VCharts from 'v-charts' Vue.use(VCharts) +// 配置是否启用考勤功能 +export const attendanceEnable = true + new Vue({ el: '#app', router, diff --git a/src/router/index.js b/src/router/index.js index fcd1ef5..733af54 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -11,6 +11,7 @@ import { baseRoutes } from './modules/base' import { systemRouters } from './modules/system' import { accessRouters } from './modules/access' +import { attendanceRouters } from './modules/attendance' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -73,6 +74,7 @@ export const asyncRouterMap = [ ...accessRouters, ...baseRoutes, + ...attendanceRouters, ...systemRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/attendance.js b/src/router/modules/attendance.js new file mode 100644 index 0000000..f7cf021 --- /dev/null +++ b/src/router/modules/attendance.js @@ -0,0 +1,55 @@ +/* Layout */ +import Layout from '../../views/layout/Layout' + +export const attendanceRouters = [ + { + path: '/attendance', + component: Layout, + redirect: '/atd', + name: 'Atd', + meta: { + title: '考勤统计', + icon: 'task', // 图标 + permission: ['/attendance']// 权限名称 + }, + children: [ + { + path: '/listReport', + name: 'ListReport', + component: () => import('@/views/attendance/listReport'), + meta: { title: '查询报表数据', icon: 'function', permission: ['/listReport'] } + }, + { + path: '/makeReport', + name: 'MakeReport', + component: () => import('@/views/attendance/makeReport'), + meta: { title: '生成考勤报表', icon: 'function', permission: ['/makeReport'] } + } + ] + }, + { + path: '/atdSetting', + component: Layout, + redirect: '/atdSetting', + name: 'AtdSetting', + meta: { + title: '考勤设置', + icon: 'task', // 图标 + permission: ['/atdSetting']// 权限名称 + }, + children: [ + { + path: '/regular', + name: 'Regular', + component: () => import('@/views/attendance/regular'), + meta: { title: '考勤规则', icon: 'function', permission: ['/regular'] } + }, + { + path: '/specialDay', + name: 'SpecialDay', + component: () => import('@/views/attendance/specialDay'), + meta: { title: '特殊考勤日管理', icon: 'function', permission: ['/specialDay'] } + } + ] + } +] diff --git a/src/views/attendance/editRemarks.vue b/src/views/attendance/editRemarks.vue new file mode 100644 index 0000000..58aa8f3 --- /dev/null +++ b/src/views/attendance/editRemarks.vue @@ -0,0 +1,328 @@ + + + + + diff --git a/src/views/attendance/editSpecialDay.vue b/src/views/attendance/editSpecialDay.vue new file mode 100644 index 0000000..b416ddc --- /dev/null +++ b/src/views/attendance/editSpecialDay.vue @@ -0,0 +1,190 @@ + + + + + diff --git a/src/views/attendance/listReport.vue b/src/views/attendance/listReport.vue new file mode 100644 index 0000000..92a5c6a --- /dev/null +++ b/src/views/attendance/listReport.vue @@ -0,0 +1,305 @@ + + + + + + diff --git a/config/dev.env.js b/config/dev.env.js index c21f267..bc033b0 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -6,6 +6,6 @@ // 将两个配置对象合并,最终结果是 NODE_ENV:‘"development"' module.exports = merge(prodEnv, { NODE_ENV: '"development"', - // BASE_API: '"http://139.198.16.38:20005"' - BASE_API: '"http://192.168.0.225:8093"' + BASE_API: '"http://139.198.16.38:20005"' + // BASE_API: '"http://192.168.0.18:8093"' }) diff --git a/src/api/attendance.js b/src/api/attendance.js new file mode 100644 index 0000000..c7e9922 --- /dev/null +++ b/src/api/attendance.js @@ -0,0 +1,123 @@ +/** + * 设备管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +export function makeReport() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 获取考勤规则 +export function getRegular() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 保存考勤规则 +export function updateRegular(params) { + return request({ + url: 'device/listAll', + method: 'post', + params + }) +} +// 批量导入特殊考勤日 +export function batchImportSpecialDay(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: 'irisCollect/batchImport', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} + +// 模板下载 +export function downloadTemplate(deviceType) { + return request({ + url: 'device/model', + method: 'get', + params: { + deviceType: deviceType + } + }) +} + +// 添加特殊考勤日 +export function addSpecialDay(params) { + return request({ + url: 'device/add', + method: 'post', + params + }) +} +// 修改特殊考勤日 +export function updateSpecialDay(params) { + return request({ + url: 'device/update', + method: 'post', + params + }) +} +// 删除特殊考勤日 +export function delSpecialDay(ids) { + return request({ + url: 'device/delete', + method: 'post', + params: { + ids: ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +export function getSpecialDayList() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 批量导出 +export function batchExportDevice(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} +// 添加考勤备注 +export function addRemarks(params) { + return request({ + url: 'device/add', + method: 'post', + params + }) +} + +// 获取已备注列表 +export function getRemarksList(params) { + return request({ + url: 'remarks/list', + method: 'get', + params + }) +} + +// 获取可备注的类型 +export function getRemarksTypeList(params) { + return request({ + url: 'remarks/list', + method: 'get', + params + }) +} + diff --git a/src/api/query.js b/src/api/query.js index 2fdedee..5117a9c 100644 --- a/src/api/query.js +++ b/src/api/query.js @@ -99,4 +99,4 @@ params, responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob }) -} \ No newline at end of file +} diff --git a/src/main.js b/src/main.js index 3e00bc4..c9354d4 100644 --- a/src/main.js +++ b/src/main.js @@ -64,6 +64,9 @@ import VCharts from 'v-charts' Vue.use(VCharts) +// 配置是否启用考勤功能 +export const attendanceEnable = true + new Vue({ el: '#app', router, diff --git a/src/router/index.js b/src/router/index.js index fcd1ef5..733af54 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -11,6 +11,7 @@ import { baseRoutes } from './modules/base' import { systemRouters } from './modules/system' import { accessRouters } from './modules/access' +import { attendanceRouters } from './modules/attendance' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -73,6 +74,7 @@ export const asyncRouterMap = [ ...accessRouters, ...baseRoutes, + ...attendanceRouters, ...systemRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/attendance.js b/src/router/modules/attendance.js new file mode 100644 index 0000000..f7cf021 --- /dev/null +++ b/src/router/modules/attendance.js @@ -0,0 +1,55 @@ +/* Layout */ +import Layout from '../../views/layout/Layout' + +export const attendanceRouters = [ + { + path: '/attendance', + component: Layout, + redirect: '/atd', + name: 'Atd', + meta: { + title: '考勤统计', + icon: 'task', // 图标 + permission: ['/attendance']// 权限名称 + }, + children: [ + { + path: '/listReport', + name: 'ListReport', + component: () => import('@/views/attendance/listReport'), + meta: { title: '查询报表数据', icon: 'function', permission: ['/listReport'] } + }, + { + path: '/makeReport', + name: 'MakeReport', + component: () => import('@/views/attendance/makeReport'), + meta: { title: '生成考勤报表', icon: 'function', permission: ['/makeReport'] } + } + ] + }, + { + path: '/atdSetting', + component: Layout, + redirect: '/atdSetting', + name: 'AtdSetting', + meta: { + title: '考勤设置', + icon: 'task', // 图标 + permission: ['/atdSetting']// 权限名称 + }, + children: [ + { + path: '/regular', + name: 'Regular', + component: () => import('@/views/attendance/regular'), + meta: { title: '考勤规则', icon: 'function', permission: ['/regular'] } + }, + { + path: '/specialDay', + name: 'SpecialDay', + component: () => import('@/views/attendance/specialDay'), + meta: { title: '特殊考勤日管理', icon: 'function', permission: ['/specialDay'] } + } + ] + } +] diff --git a/src/views/attendance/editRemarks.vue b/src/views/attendance/editRemarks.vue new file mode 100644 index 0000000..58aa8f3 --- /dev/null +++ b/src/views/attendance/editRemarks.vue @@ -0,0 +1,328 @@ + + + + + diff --git a/src/views/attendance/editSpecialDay.vue b/src/views/attendance/editSpecialDay.vue new file mode 100644 index 0000000..b416ddc --- /dev/null +++ b/src/views/attendance/editSpecialDay.vue @@ -0,0 +1,190 @@ + + + + + diff --git a/src/views/attendance/listReport.vue b/src/views/attendance/listReport.vue new file mode 100644 index 0000000..92a5c6a --- /dev/null +++ b/src/views/attendance/listReport.vue @@ -0,0 +1,305 @@ + + + + + + diff --git a/src/views/attendance/makeReport.vue b/src/views/attendance/makeReport.vue new file mode 100644 index 0000000..7e4da1b --- /dev/null +++ b/src/views/attendance/makeReport.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/config/dev.env.js b/config/dev.env.js index c21f267..bc033b0 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -6,6 +6,6 @@ // 将两个配置对象合并,最终结果是 NODE_ENV:‘"development"' module.exports = merge(prodEnv, { NODE_ENV: '"development"', - // BASE_API: '"http://139.198.16.38:20005"' - BASE_API: '"http://192.168.0.225:8093"' + BASE_API: '"http://139.198.16.38:20005"' + // BASE_API: '"http://192.168.0.18:8093"' }) diff --git a/src/api/attendance.js b/src/api/attendance.js new file mode 100644 index 0000000..c7e9922 --- /dev/null +++ b/src/api/attendance.js @@ -0,0 +1,123 @@ +/** + * 设备管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +export function makeReport() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 获取考勤规则 +export function getRegular() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 保存考勤规则 +export function updateRegular(params) { + return request({ + url: 'device/listAll', + method: 'post', + params + }) +} +// 批量导入特殊考勤日 +export function batchImportSpecialDay(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: 'irisCollect/batchImport', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} + +// 模板下载 +export function downloadTemplate(deviceType) { + return request({ + url: 'device/model', + method: 'get', + params: { + deviceType: deviceType + } + }) +} + +// 添加特殊考勤日 +export function addSpecialDay(params) { + return request({ + url: 'device/add', + method: 'post', + params + }) +} +// 修改特殊考勤日 +export function updateSpecialDay(params) { + return request({ + url: 'device/update', + method: 'post', + params + }) +} +// 删除特殊考勤日 +export function delSpecialDay(ids) { + return request({ + url: 'device/delete', + method: 'post', + params: { + ids: ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +export function getSpecialDayList() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 批量导出 +export function batchExportDevice(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} +// 添加考勤备注 +export function addRemarks(params) { + return request({ + url: 'device/add', + method: 'post', + params + }) +} + +// 获取已备注列表 +export function getRemarksList(params) { + return request({ + url: 'remarks/list', + method: 'get', + params + }) +} + +// 获取可备注的类型 +export function getRemarksTypeList(params) { + return request({ + url: 'remarks/list', + method: 'get', + params + }) +} + diff --git a/src/api/query.js b/src/api/query.js index 2fdedee..5117a9c 100644 --- a/src/api/query.js +++ b/src/api/query.js @@ -99,4 +99,4 @@ params, responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob }) -} \ No newline at end of file +} diff --git a/src/main.js b/src/main.js index 3e00bc4..c9354d4 100644 --- a/src/main.js +++ b/src/main.js @@ -64,6 +64,9 @@ import VCharts from 'v-charts' Vue.use(VCharts) +// 配置是否启用考勤功能 +export const attendanceEnable = true + new Vue({ el: '#app', router, diff --git a/src/router/index.js b/src/router/index.js index fcd1ef5..733af54 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -11,6 +11,7 @@ import { baseRoutes } from './modules/base' import { systemRouters } from './modules/system' import { accessRouters } from './modules/access' +import { attendanceRouters } from './modules/attendance' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -73,6 +74,7 @@ export const asyncRouterMap = [ ...accessRouters, ...baseRoutes, + ...attendanceRouters, ...systemRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/attendance.js b/src/router/modules/attendance.js new file mode 100644 index 0000000..f7cf021 --- /dev/null +++ b/src/router/modules/attendance.js @@ -0,0 +1,55 @@ +/* Layout */ +import Layout from '../../views/layout/Layout' + +export const attendanceRouters = [ + { + path: '/attendance', + component: Layout, + redirect: '/atd', + name: 'Atd', + meta: { + title: '考勤统计', + icon: 'task', // 图标 + permission: ['/attendance']// 权限名称 + }, + children: [ + { + path: '/listReport', + name: 'ListReport', + component: () => import('@/views/attendance/listReport'), + meta: { title: '查询报表数据', icon: 'function', permission: ['/listReport'] } + }, + { + path: '/makeReport', + name: 'MakeReport', + component: () => import('@/views/attendance/makeReport'), + meta: { title: '生成考勤报表', icon: 'function', permission: ['/makeReport'] } + } + ] + }, + { + path: '/atdSetting', + component: Layout, + redirect: '/atdSetting', + name: 'AtdSetting', + meta: { + title: '考勤设置', + icon: 'task', // 图标 + permission: ['/atdSetting']// 权限名称 + }, + children: [ + { + path: '/regular', + name: 'Regular', + component: () => import('@/views/attendance/regular'), + meta: { title: '考勤规则', icon: 'function', permission: ['/regular'] } + }, + { + path: '/specialDay', + name: 'SpecialDay', + component: () => import('@/views/attendance/specialDay'), + meta: { title: '特殊考勤日管理', icon: 'function', permission: ['/specialDay'] } + } + ] + } +] diff --git a/src/views/attendance/editRemarks.vue b/src/views/attendance/editRemarks.vue new file mode 100644 index 0000000..58aa8f3 --- /dev/null +++ b/src/views/attendance/editRemarks.vue @@ -0,0 +1,328 @@ + + + + + diff --git a/src/views/attendance/editSpecialDay.vue b/src/views/attendance/editSpecialDay.vue new file mode 100644 index 0000000..b416ddc --- /dev/null +++ b/src/views/attendance/editSpecialDay.vue @@ -0,0 +1,190 @@ + + + + + diff --git a/src/views/attendance/listReport.vue b/src/views/attendance/listReport.vue new file mode 100644 index 0000000..92a5c6a --- /dev/null +++ b/src/views/attendance/listReport.vue @@ -0,0 +1,305 @@ + + + + + + diff --git a/src/views/attendance/makeReport.vue b/src/views/attendance/makeReport.vue new file mode 100644 index 0000000..7e4da1b --- /dev/null +++ b/src/views/attendance/makeReport.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/src/views/attendance/regular.vue b/src/views/attendance/regular.vue new file mode 100644 index 0000000..0fac7f8 --- /dev/null +++ b/src/views/attendance/regular.vue @@ -0,0 +1,155 @@ + + + + + diff --git a/config/dev.env.js b/config/dev.env.js index c21f267..bc033b0 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -6,6 +6,6 @@ // 将两个配置对象合并,最终结果是 NODE_ENV:‘"development"' module.exports = merge(prodEnv, { NODE_ENV: '"development"', - // BASE_API: '"http://139.198.16.38:20005"' - BASE_API: '"http://192.168.0.225:8093"' + BASE_API: '"http://139.198.16.38:20005"' + // BASE_API: '"http://192.168.0.18:8093"' }) diff --git a/src/api/attendance.js b/src/api/attendance.js new file mode 100644 index 0000000..c7e9922 --- /dev/null +++ b/src/api/attendance.js @@ -0,0 +1,123 @@ +/** + * 设备管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +export function makeReport() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 获取考勤规则 +export function getRegular() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 保存考勤规则 +export function updateRegular(params) { + return request({ + url: 'device/listAll', + method: 'post', + params + }) +} +// 批量导入特殊考勤日 +export function batchImportSpecialDay(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: 'irisCollect/batchImport', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} + +// 模板下载 +export function downloadTemplate(deviceType) { + return request({ + url: 'device/model', + method: 'get', + params: { + deviceType: deviceType + } + }) +} + +// 添加特殊考勤日 +export function addSpecialDay(params) { + return request({ + url: 'device/add', + method: 'post', + params + }) +} +// 修改特殊考勤日 +export function updateSpecialDay(params) { + return request({ + url: 'device/update', + method: 'post', + params + }) +} +// 删除特殊考勤日 +export function delSpecialDay(ids) { + return request({ + url: 'device/delete', + method: 'post', + params: { + ids: ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +export function getSpecialDayList() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 批量导出 +export function batchExportDevice(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} +// 添加考勤备注 +export function addRemarks(params) { + return request({ + url: 'device/add', + method: 'post', + params + }) +} + +// 获取已备注列表 +export function getRemarksList(params) { + return request({ + url: 'remarks/list', + method: 'get', + params + }) +} + +// 获取可备注的类型 +export function getRemarksTypeList(params) { + return request({ + url: 'remarks/list', + method: 'get', + params + }) +} + diff --git a/src/api/query.js b/src/api/query.js index 2fdedee..5117a9c 100644 --- a/src/api/query.js +++ b/src/api/query.js @@ -99,4 +99,4 @@ params, responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob }) -} \ No newline at end of file +} diff --git a/src/main.js b/src/main.js index 3e00bc4..c9354d4 100644 --- a/src/main.js +++ b/src/main.js @@ -64,6 +64,9 @@ import VCharts from 'v-charts' Vue.use(VCharts) +// 配置是否启用考勤功能 +export const attendanceEnable = true + new Vue({ el: '#app', router, diff --git a/src/router/index.js b/src/router/index.js index fcd1ef5..733af54 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -11,6 +11,7 @@ import { baseRoutes } from './modules/base' import { systemRouters } from './modules/system' import { accessRouters } from './modules/access' +import { attendanceRouters } from './modules/attendance' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -73,6 +74,7 @@ export const asyncRouterMap = [ ...accessRouters, ...baseRoutes, + ...attendanceRouters, ...systemRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/attendance.js b/src/router/modules/attendance.js new file mode 100644 index 0000000..f7cf021 --- /dev/null +++ b/src/router/modules/attendance.js @@ -0,0 +1,55 @@ +/* Layout */ +import Layout from '../../views/layout/Layout' + +export const attendanceRouters = [ + { + path: '/attendance', + component: Layout, + redirect: '/atd', + name: 'Atd', + meta: { + title: '考勤统计', + icon: 'task', // 图标 + permission: ['/attendance']// 权限名称 + }, + children: [ + { + path: '/listReport', + name: 'ListReport', + component: () => import('@/views/attendance/listReport'), + meta: { title: '查询报表数据', icon: 'function', permission: ['/listReport'] } + }, + { + path: '/makeReport', + name: 'MakeReport', + component: () => import('@/views/attendance/makeReport'), + meta: { title: '生成考勤报表', icon: 'function', permission: ['/makeReport'] } + } + ] + }, + { + path: '/atdSetting', + component: Layout, + redirect: '/atdSetting', + name: 'AtdSetting', + meta: { + title: '考勤设置', + icon: 'task', // 图标 + permission: ['/atdSetting']// 权限名称 + }, + children: [ + { + path: '/regular', + name: 'Regular', + component: () => import('@/views/attendance/regular'), + meta: { title: '考勤规则', icon: 'function', permission: ['/regular'] } + }, + { + path: '/specialDay', + name: 'SpecialDay', + component: () => import('@/views/attendance/specialDay'), + meta: { title: '特殊考勤日管理', icon: 'function', permission: ['/specialDay'] } + } + ] + } +] diff --git a/src/views/attendance/editRemarks.vue b/src/views/attendance/editRemarks.vue new file mode 100644 index 0000000..58aa8f3 --- /dev/null +++ b/src/views/attendance/editRemarks.vue @@ -0,0 +1,328 @@ + + + + + diff --git a/src/views/attendance/editSpecialDay.vue b/src/views/attendance/editSpecialDay.vue new file mode 100644 index 0000000..b416ddc --- /dev/null +++ b/src/views/attendance/editSpecialDay.vue @@ -0,0 +1,190 @@ + + + + + diff --git a/src/views/attendance/listReport.vue b/src/views/attendance/listReport.vue new file mode 100644 index 0000000..92a5c6a --- /dev/null +++ b/src/views/attendance/listReport.vue @@ -0,0 +1,305 @@ + + + + + + diff --git a/src/views/attendance/makeReport.vue b/src/views/attendance/makeReport.vue new file mode 100644 index 0000000..7e4da1b --- /dev/null +++ b/src/views/attendance/makeReport.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/src/views/attendance/regular.vue b/src/views/attendance/regular.vue new file mode 100644 index 0000000..0fac7f8 --- /dev/null +++ b/src/views/attendance/regular.vue @@ -0,0 +1,155 @@ + + + + + diff --git a/src/views/attendance/specialDay.vue b/src/views/attendance/specialDay.vue new file mode 100644 index 0000000..5ab4934 --- /dev/null +++ b/src/views/attendance/specialDay.vue @@ -0,0 +1,260 @@ + + + + + diff --git a/config/dev.env.js b/config/dev.env.js index c21f267..bc033b0 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -6,6 +6,6 @@ // 将两个配置对象合并,最终结果是 NODE_ENV:‘"development"' module.exports = merge(prodEnv, { NODE_ENV: '"development"', - // BASE_API: '"http://139.198.16.38:20005"' - BASE_API: '"http://192.168.0.225:8093"' + BASE_API: '"http://139.198.16.38:20005"' + // BASE_API: '"http://192.168.0.18:8093"' }) diff --git a/src/api/attendance.js b/src/api/attendance.js new file mode 100644 index 0000000..c7e9922 --- /dev/null +++ b/src/api/attendance.js @@ -0,0 +1,123 @@ +/** + * 设备管理接口 + */ +import request from '@/utils/request' +import qs from 'qs' + +export function makeReport() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 获取考勤规则 +export function getRegular() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 保存考勤规则 +export function updateRegular(params) { + return request({ + url: 'device/listAll', + method: 'post', + params + }) +} +// 批量导入特殊考勤日 +export function batchImportSpecialDay(fileobj) { + const param = new FormData() + param.append('file', fileobj) + return request({ + url: 'irisCollect/batchImport', + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + data: param + }) +} + +// 模板下载 +export function downloadTemplate(deviceType) { + return request({ + url: 'device/model', + method: 'get', + params: { + deviceType: deviceType + } + }) +} + +// 添加特殊考勤日 +export function addSpecialDay(params) { + return request({ + url: 'device/add', + method: 'post', + params + }) +} +// 修改特殊考勤日 +export function updateSpecialDay(params) { + return request({ + url: 'device/update', + method: 'post', + params + }) +} +// 删除特殊考勤日 +export function delSpecialDay(ids) { + return request({ + url: 'device/delete', + method: 'post', + params: { + ids: ids + }, + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } + }) +} + +export function getSpecialDayList() { + return request({ + url: 'device/list', + method: 'get' + }) +} +// 批量导出 +export function batchExportDevice(params) { + return request({ + url: 'device/batchExport', + method: 'get', + timeout: 120000, + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} +// 添加考勤备注 +export function addRemarks(params) { + return request({ + url: 'device/add', + method: 'post', + params + }) +} + +// 获取已备注列表 +export function getRemarksList(params) { + return request({ + url: 'remarks/list', + method: 'get', + params + }) +} + +// 获取可备注的类型 +export function getRemarksTypeList(params) { + return request({ + url: 'remarks/list', + method: 'get', + params + }) +} + diff --git a/src/api/query.js b/src/api/query.js index 2fdedee..5117a9c 100644 --- a/src/api/query.js +++ b/src/api/query.js @@ -99,4 +99,4 @@ params, responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob }) -} \ No newline at end of file +} diff --git a/src/main.js b/src/main.js index 3e00bc4..c9354d4 100644 --- a/src/main.js +++ b/src/main.js @@ -64,6 +64,9 @@ import VCharts from 'v-charts' Vue.use(VCharts) +// 配置是否启用考勤功能 +export const attendanceEnable = true + new Vue({ el: '#app', router, diff --git a/src/router/index.js b/src/router/index.js index fcd1ef5..733af54 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -11,6 +11,7 @@ import { baseRoutes } from './modules/base' import { systemRouters } from './modules/system' import { accessRouters } from './modules/access' +import { attendanceRouters } from './modules/attendance' /** * hidden: true if `hidden:true` will not show in the sidebar(default is false) @@ -73,6 +74,7 @@ export const asyncRouterMap = [ ...accessRouters, ...baseRoutes, + ...attendanceRouters, ...systemRouters, { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/router/modules/attendance.js b/src/router/modules/attendance.js new file mode 100644 index 0000000..f7cf021 --- /dev/null +++ b/src/router/modules/attendance.js @@ -0,0 +1,55 @@ +/* Layout */ +import Layout from '../../views/layout/Layout' + +export const attendanceRouters = [ + { + path: '/attendance', + component: Layout, + redirect: '/atd', + name: 'Atd', + meta: { + title: '考勤统计', + icon: 'task', // 图标 + permission: ['/attendance']// 权限名称 + }, + children: [ + { + path: '/listReport', + name: 'ListReport', + component: () => import('@/views/attendance/listReport'), + meta: { title: '查询报表数据', icon: 'function', permission: ['/listReport'] } + }, + { + path: '/makeReport', + name: 'MakeReport', + component: () => import('@/views/attendance/makeReport'), + meta: { title: '生成考勤报表', icon: 'function', permission: ['/makeReport'] } + } + ] + }, + { + path: '/atdSetting', + component: Layout, + redirect: '/atdSetting', + name: 'AtdSetting', + meta: { + title: '考勤设置', + icon: 'task', // 图标 + permission: ['/atdSetting']// 权限名称 + }, + children: [ + { + path: '/regular', + name: 'Regular', + component: () => import('@/views/attendance/regular'), + meta: { title: '考勤规则', icon: 'function', permission: ['/regular'] } + }, + { + path: '/specialDay', + name: 'SpecialDay', + component: () => import('@/views/attendance/specialDay'), + meta: { title: '特殊考勤日管理', icon: 'function', permission: ['/specialDay'] } + } + ] + } +] diff --git a/src/views/attendance/editRemarks.vue b/src/views/attendance/editRemarks.vue new file mode 100644 index 0000000..58aa8f3 --- /dev/null +++ b/src/views/attendance/editRemarks.vue @@ -0,0 +1,328 @@ + + + + + diff --git a/src/views/attendance/editSpecialDay.vue b/src/views/attendance/editSpecialDay.vue new file mode 100644 index 0000000..b416ddc --- /dev/null +++ b/src/views/attendance/editSpecialDay.vue @@ -0,0 +1,190 @@ + + + + + diff --git a/src/views/attendance/listReport.vue b/src/views/attendance/listReport.vue new file mode 100644 index 0000000..92a5c6a --- /dev/null +++ b/src/views/attendance/listReport.vue @@ -0,0 +1,305 @@ + + + + + + diff --git a/src/views/attendance/makeReport.vue b/src/views/attendance/makeReport.vue new file mode 100644 index 0000000..7e4da1b --- /dev/null +++ b/src/views/attendance/makeReport.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/src/views/attendance/regular.vue b/src/views/attendance/regular.vue new file mode 100644 index 0000000..0fac7f8 --- /dev/null +++ b/src/views/attendance/regular.vue @@ -0,0 +1,155 @@ + + + + + diff --git a/src/views/attendance/specialDay.vue b/src/views/attendance/specialDay.vue new file mode 100644 index 0000000..5ab4934 --- /dev/null +++ b/src/views/attendance/specialDay.vue @@ -0,0 +1,260 @@ + + + + + diff --git a/src/views/memberManage/addPerson.vue b/src/views/memberManage/addPerson.vue index da6fca2..deb53a9 100644 --- a/src/views/memberManage/addPerson.vue +++ b/src/views/memberManage/addPerson.vue @@ -1,6 +1,6 @@