diff --git a/src/router/modules/compliance.js b/src/router/modules/compliance.js new file mode 100644 index 00000000..26cfd95f --- /dev/null +++ b/src/router/modules/compliance.js @@ -0,0 +1,53 @@ + +/** 通讯录路由 */ +import Layout from '@/views/layout/compliance' +const layout = function(meta = {}) { + return { + path: '/compliance', + component: Layout, + meta: { + requiresAuth: false, + ...meta + } + } +} + +export default [ + { + ...layout(true), + children: [ + { + path: 'statistics', + component: () => import('@/views/compliance/statistics/index'), + meta: { + title: '申报自检结果统计' + } + } + ] + }, + { + ...layout(false), + children: [ + { + path: 'keypoint', + component: () => import('@/views/compliance/keypoint/index'), + meta: { + title: '重点企风险排名统计' + } + } + ] + }, + { + ...layout(false), + children: [ + { + path: 'warningStatistics', + component: () => import('@/views/compliance/warningStatistics/index'), + meta: { + title: '指标预警排名统计' + } + } + ] + } +] + diff --git a/src/store/modules/compliance.js b/src/store/modules/compliance.js new file mode 100644 index 00000000..7788dae4 --- /dev/null +++ b/src/store/modules/compliance.js @@ -0,0 +1,90 @@ +import { + hrmEmployeeQueryLoginEmployeeAPI, + hrmEmployeeAllListAPI +} from '@/api/hrm/employee' +import { + hrmDeptQueryTreeListAPI +} from '@/api/hrm/dept' + +import { debounce } from 'throttle-debounce' + +const hrm = { + state: { + hrmUserInfo: null, // 人资用户信息 + hrmShowType: 1, // 1 管理 2 员工 + hrmUserList: [], // 人力资源员工和部门 + hrmDeptList: [] + }, + + mutations: { + SET_HRMUSERINFO: (state, hrmUserInfo) => { + state.hrmUserInfo = hrmUserInfo + }, + SET_HRMSHOWTYPE: (state, hrmShowType) => { + state.hrmShowType = hrmShowType + }, + SET_HRMUSERLIST: (state, data) => { + state.hrmUserList = data + }, + SET_HRMDEPTLIST: (state, data) => { + state.hrmDeptList = data + } + }, + + actions: { + // 获取人资用户信息 + GetHrmUserInfo({ + commit + }) { + return new Promise((resolve, reject) => { + hrmEmployeeQueryLoginEmployeeAPI().then(res => { + const resData = res.data || {} + commit('SET_HRMUSERINFO', resData) + resolve(res) + }).catch(error => { + reject(error) + }) + }) + }, + + debounceGetHrmUserList: debounce(3000, ({ dispatch }) => { + dispatch('GetHrmUserList') + }), + + // 管理后台员工列表 + GetHrmUserList({ + commit + }) { + return new Promise((resolve, reject) => { + hrmEmployeeAllListAPI({ + pageType: 0 + }).then(res => { + commit('SET_HRMUSERLIST', res.data || []) + resolve() + }).catch(error => { + reject(error) + }) + }) + }, + + debounceGetHrmDeptList: debounce(3000, ({ dispatch }) => { + dispatch('GetHrmDeptList') + }), + + // 管理后台部门列表 + GetHrmDeptList({ + commit + }) { + return new Promise((resolve, reject) => { + hrmDeptQueryTreeListAPI({}).then(res => { + commit('SET_HRMDEPTLIST', res.data || []) + resolve() + }).catch(error => { + reject(error) + }) + }) + } + } +} + +export default hrm diff --git a/src/views/compliance/keypoint/index.vue b/src/views/compliance/keypoint/index.vue new file mode 100644 index 00000000..55e259f7 --- /dev/null +++ b/src/views/compliance/keypoint/index.vue @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/src/views/compliance/statistics/index.vue b/src/views/compliance/statistics/index.vue new file mode 100644 index 00000000..8e829185 --- /dev/null +++ b/src/views/compliance/statistics/index.vue @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/src/views/compliance/warningStatistics/index.vue b/src/views/compliance/warningStatistics/index.vue new file mode 100644 index 00000000..c549b726 --- /dev/null +++ b/src/views/compliance/warningStatistics/index.vue @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/src/views/layout/compliance.vue b/src/views/layout/compliance.vue new file mode 100644 index 00000000..0b60036e --- /dev/null +++ b/src/views/layout/compliance.vue @@ -0,0 +1,62 @@ + + + + +