diff --git a/api/app/lib/controllers/role/index.js b/api/app/lib/controllers/role/index.js
index d3de073..875b92d 100644
--- a/api/app/lib/controllers/role/index.js
+++ b/api/app/lib/controllers/role/index.js
@@ -31,7 +31,7 @@ async function add(ctx) {
throw '当前角色已存在'
}
- let storageData = { name }
+ let storageData = { name ,delete:true}
await models.Role.create(storageData)
ctx.status = 204;
} catch (error) {
diff --git a/web/client/src/layout/containers/layout/index.jsx b/web/client/src/layout/containers/layout/index.jsx
index 531d5bc..d502115 100644
--- a/web/client/src/layout/containers/layout/index.jsx
+++ b/web/client/src/layout/containers/layout/index.jsx
@@ -15,6 +15,7 @@ import { RouteRequest } from '@peace/utils';
import Cookie from 'js-cookie';
import { login, LOGIN_SUCCESS } from '../../../sections/auth/actions/auth';
import { error } from 'webpack-dev-server/lib/utils/colors';
+import actions from '../../../sections/humanAffairs/actions'
@@ -48,7 +49,7 @@ const LayoutContainer = props => {
document.getElementById('HrApp').clientWidth - (collapsed ? 120 : 240)
));
}
- function deepCopy (data) {//深拷贝
+ function deepCopy(data) {//深拷贝
//string,number,bool,null,undefined,symbol
//object,array,date
if (data && typeof data === "object") {
@@ -217,6 +218,11 @@ const LayoutContainer = props => {
localStorage.setItem('poms_open_sider', JSON.stringify(["archivesCenter"]))
localStorage.setItem('poms_selected_sider', JSON.stringify(["humanAffairs"]))
dispatch(actions.layout.initWebSocket({ ioUrl: apiRoot, token: data.token, hrUserId: data.hrUserInfo && hrUserInfo.id }))
+ dispatch(actions.humanAffairs.getUserResource(res.payload.user.id)).then(res => {
+ if (res.success) {
+ sessionStorage.setItem('userResource', JSON.stringify(res.payload.data))
+ }
+ })
} else {
window.location.href = `${webPepUrl}/signin`
}
@@ -343,7 +349,7 @@ const LayoutContainer = props => {
)
}
-function mapStateToProps (state) {
+function mapStateToProps(state) {
const { global, auth, ajaxResponse, webSocket } = state;
return {
title: global.title,
diff --git a/web/client/src/sections/humanAffairs/actions/role.js b/web/client/src/sections/humanAffairs/actions/role.js
index e25a09b..105230b 100644
--- a/web/client/src/sections/humanAffairs/actions/role.js
+++ b/web/client/src/sections/humanAffairs/actions/role.js
@@ -116,4 +116,13 @@ export function addRoleResource(data) {
});
}
-
+export function getUserResource(userId) {//查询
+ return (dispatch) => basicAction({
+ type: "get",
+ dispatch: dispatch,
+ actionType: "GET_USER_RESOURCE_LIST",
+ url: ApiTable.getUserResource.replace('{userId}',userId),
+ msg: { option: "查询角色权限列表" },
+ reducer: { name: "userResource", params: { noClear: true } },
+ });
+}
diff --git a/web/client/src/sections/humanAffairs/containers/communication/employeeCommunication.jsx b/web/client/src/sections/humanAffairs/containers/communication/employeeCommunication.jsx
index 8c4ff41..e675af2 100644
--- a/web/client/src/sections/humanAffairs/containers/communication/employeeCommunication.jsx
+++ b/web/client/src/sections/humanAffairs/containers/communication/employeeCommunication.jsx
@@ -5,6 +5,7 @@ import { Select, Input, Button, Tooltip, Table, Pagination, Skeleton, DatePicker
import { IconSearch } from '@douyinfe/semi-icons';
import DetailModal from './detailModal';
import { SkeletonScreen } from "$components";
+import { isAuthorized } from '$utils'
import '../../style.less'
const EmployeeCommunication = (props) => {
@@ -253,14 +254,17 @@ const EmployeeCommunication = (props) => {
getEmployeeCommunicateData({ limit: 10, page: 0 });
}}>查询
-
-
{
- exportAllData()
- }}>
- 导出
-
-
+ {
+ isAuthorized('EXPORTEMPLOYEECOMMUNICATIONSTATISTICS') ?
+
{
+ exportAllData()
+ }}>
+ 导出
+
+
:''
+ }
+
{
-
{ setImportModalV(true); }}>
导入
-
+
: ''}
diff --git a/web/client/src/sections/humanAffairs/containers/employeeInformation.jsx b/web/client/src/sections/humanAffairs/containers/employeeInformation.jsx
index 1c8e0be..ec84eb5 100644
--- a/web/client/src/sections/humanAffairs/containers/employeeInformation.jsx
+++ b/web/client/src/sections/humanAffairs/containers/employeeInformation.jsx
@@ -7,7 +7,7 @@ import '../style.less'
import { Setup } from "$components";
import moment from 'moment'
import { set } from 'nprogress';
-import { UserAttribute } from '$utils'
+import { UserAttribute, isAuthorized } from '$utils'
const employeeInformation = (props) => {
const { dispatch, actions, history, user, loading, socket, xqMembers } = props
@@ -591,24 +591,27 @@ const employeeInformation = (props) => {
-
{
- let obj = form.current.getValues()
- if (form.current.getValues().entryTime?.length > 1) {
- obj.hiredateStart = moment(form.current.getValues().entryTime[0]).format('YYYY-MM-DD')
- obj.hiredateEnd = moment(form.current.getValues().entryTime[1]).format('YYYY-MM-DD')
- }
- else {
- obj.hiredateStart = ''
- obj.hiredateEnd = ''
+ {
+ isAuthorized('EXPORTEMPLOYEEINFORMATION') ?
{
+ let obj = form.current.getValues()
+ if (form.current.getValues().entryTime?.length > 1) {
+ obj.hiredateStart = moment(form.current.getValues().entryTime[0]).format('YYYY-MM-DD')
+ obj.hiredateEnd = moment(form.current.getValues().entryTime[1]).format('YYYY-MM-DD')
+ }
+ else {
+ obj.hiredateStart = ''
+ obj.hiredateEnd = ''
+ }
+ setDownloadUrl(`members/export?token=${user.token}&keywordTarget=${obj.keywordTarget ? obj.keywordTarget : ''}&keyword=${obj.keyword ? obj.keyword : ''}&marital=${obj.marital ? obj.marital : ''}&native=${obj.native ? obj.native : ''}&workPlace=${obj.workPlace ? obj.workPlace : ''}&hiredateStart=${obj.hiredateStart}&hiredateEnd=${obj.hiredateEnd}`)
+ }}>
+
+ {
+ downloadUrl ?
: ''
}
- setDownloadUrl(`members/export?token=${user.token}&keywordTarget=${obj.keywordTarget ? obj.keywordTarget : ''}&keyword=${obj.keyword ? obj.keyword : ''}&marital=${obj.marital ? obj.marital : ''}&native=${obj.native ? obj.native : ''}&workPlace=${obj.workPlace ? obj.workPlace : ''}&hiredateStart=${obj.hiredateStart}&hiredateEnd=${obj.hiredateEnd}`)
- }}>
-
- {
- downloadUrl ?
: ''
- }
-
+
: ''
+ }
+
setSetup(true)}
/>
diff --git a/web/client/src/sections/humanAffairs/containers/highMonthly.jsx b/web/client/src/sections/humanAffairs/containers/highMonthly.jsx
index 22fce3f..57dce5d 100644
--- a/web/client/src/sections/humanAffairs/containers/highMonthly.jsx
+++ b/web/client/src/sections/humanAffairs/containers/highMonthly.jsx
@@ -4,6 +4,7 @@ import { Table, Pagination, Skeleton, DatePicker, Button } from '@douyinfe/semi-
import { SkeletonScreen } from "$components";
import '../style.less'
import moment from 'moment'
+import { isAuthorized } from '$utils'
const HighMonthly = (props) => {
const [year, setYear] = useState(null)
@@ -62,7 +63,7 @@ const HighMonthly = (props) => {
width: 120,
render: (text, record) => {
return
- exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载
+ {isAuthorized('DOWNLOADTHEMONTHLYPROCESSASSESSMENTFORSENIORMANAGEMENT')? exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载:''}
}
}];
diff --git a/web/client/src/sections/humanAffairs/containers/highQuarter.jsx b/web/client/src/sections/humanAffairs/containers/highQuarter.jsx
index 71582c1..2792aa6 100644
--- a/web/client/src/sections/humanAffairs/containers/highQuarter.jsx
+++ b/web/client/src/sections/humanAffairs/containers/highQuarter.jsx
@@ -4,6 +4,7 @@ import { Table, Pagination, Skeleton, DatePicker, Button } from '@douyinfe/semi-
import { SkeletonScreen } from "$components";
import '../style.less'
import moment from 'moment'
+import { isAuthorized } from '$utils'
const HighQuarter = (props) => {
const [year, setYear] = useState(null)
@@ -62,7 +63,7 @@ const HighQuarter = (props) => {
width: 120,
render: (text, record) => {
return
- exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载
+ {isAuthorized('DOWNLOADQUARTERLYASSESSMENTSFORSENIORMANAGEMENT')? exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载:''}
}
}];
diff --git a/web/client/src/sections/humanAffairs/containers/leaveStatistics.jsx b/web/client/src/sections/humanAffairs/containers/leaveStatistics.jsx
index 6dc8776..21a3668 100644
--- a/web/client/src/sections/humanAffairs/containers/leaveStatistics.jsx
+++ b/web/client/src/sections/humanAffairs/containers/leaveStatistics.jsx
@@ -7,6 +7,7 @@ import { SkeletonScreen } from "$components";
import '../style.less'
import { Setup } from "$components";
import moment from 'moment'
+import { isAuthorized } from '$utils'
import { set } from 'nprogress';
const leaveStatistics = (props) => {
@@ -371,24 +372,27 @@ const leaveStatistics = (props) => {
-
{
- let obj = form.current.getValues()
- if (form.current.getValues().entryTime?.length > 1) {
- obj.startDate = moment(form.current.getValues().entryTime[0]).format('YYYY-MM-DD')
- obj.endDate = moment(form.current.getValues().entryTime[1]).format('YYYY-MM-DD')
- }
- else {
- obj.startDate = ''
- obj.endDate = ''
+ {
+ isAuthorized('EXPORTLEAVESTATISTICS') ?
{
+ let obj = form.current.getValues()
+ if (form.current.getValues().entryTime?.length > 1) {
+ obj.startDate = moment(form.current.getValues().entryTime[0]).format('YYYY-MM-DD')
+ obj.endDate = moment(form.current.getValues().entryTime[1]).format('YYYY-MM-DD')
+ }
+ else {
+ obj.startDate = ''
+ obj.endDate = ''
+ }
+ setDownloadUrl(`attendance/vacate/export?token=${user.token}&keywordTarget=${obj.keywordTarget ? obj.keywordTarget : ''}&keyword=${obj.keyword ? obj.keyword : ''}&startDate=${obj.startDate}&endDate=${obj.endDate}`)
+ }}>
+
+ {
+ downloadUrl ?
: ''
}
- setDownloadUrl(`attendance/vacate/export?token=${user.token}&keywordTarget=${obj.keywordTarget ? obj.keywordTarget : ''}&keyword=${obj.keyword ? obj.keyword : ''}&startDate=${obj.startDate}&endDate=${obj.endDate}`)
- }}>
-
- {
- downloadUrl ?
: ''
- }
-
+
: ''
+ }
+
setSetup(true)}
/>
diff --git a/web/client/src/sections/humanAffairs/containers/monthlyProcess.jsx b/web/client/src/sections/humanAffairs/containers/monthlyProcess.jsx
index 628def3..710442e 100644
--- a/web/client/src/sections/humanAffairs/containers/monthlyProcess.jsx
+++ b/web/client/src/sections/humanAffairs/containers/monthlyProcess.jsx
@@ -4,6 +4,7 @@ import { Table, Pagination, Skeleton, DatePicker, Button } from '@douyinfe/semi-
import { SkeletonScreen } from "$components";
import '../style.less'
import moment from 'moment'
+import { isAuthorized } from '$utils'
const MonthlyProcess = (props) => {
const [year, setYear] = useState(null)
@@ -62,7 +63,7 @@ const MonthlyProcess = (props) => {
width: 120,
render: (text, record) => {
return
- exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载
+ {isAuthorized('DOWNLOADMIDDLELEVELMONTHLYPROCESSASSESSMENT') ? exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载:''}
}
}];
diff --git a/web/client/src/sections/humanAffairs/containers/overtimeStatistics.jsx b/web/client/src/sections/humanAffairs/containers/overtimeStatistics.jsx
index 22f5b81..4b7ba73 100644
--- a/web/client/src/sections/humanAffairs/containers/overtimeStatistics.jsx
+++ b/web/client/src/sections/humanAffairs/containers/overtimeStatistics.jsx
@@ -6,6 +6,7 @@ import { SkeletonScreen } from "$components";
import '../style.less'
import { Setup } from "$components";
import moment from 'moment'
+import { isAuthorized } from '$utils'
import { set } from 'nprogress';
const overtimeStatistics = (props) => {
@@ -409,24 +410,27 @@ const overtimeStatistics = (props) => {
-
{
- let obj = form.current.getValues()
- if (form.current.getValues().entryTime?.length > 1) {
- obj.startDate = moment(form.current.getValues().entryTime[0]).format('YYYY-MM-DD')
- obj.endDate = moment(form.current.getValues().entryTime[1]).format('YYYY-MM-DD')
- }
- else {
- obj.startDate = ''
- obj.endDate = ''
+ {
+ isAuthorized('EXPORTOVERTIMESTATISTICS')?
{
+ let obj = form.current.getValues()
+ if (form.current.getValues().entryTime?.length > 1) {
+ obj.startDate = moment(form.current.getValues().entryTime[0]).format('YYYY-MM-DD')
+ obj.endDate = moment(form.current.getValues().entryTime[1]).format('YYYY-MM-DD')
+ }
+ else {
+ obj.startDate = ''
+ obj.endDate = ''
+ }
+ setDownloadUrl(`attendance/overtime/export?token=${user.token}&keywordTarget=${obj.keywordTarget ? obj.keywordTarget : ''}&keyword=${obj.keyword ? obj.keyword : ''}&startDate=${obj.startDate}&endDate=${obj.endDate}`)
+ }}>
+
+ {
+ downloadUrl ?
: ''
}
- setDownloadUrl(`attendance/overtime/export?token=${user.token}&keywordTarget=${obj.keywordTarget ? obj.keywordTarget : ''}&keyword=${obj.keyword ? obj.keyword : ''}&startDate=${obj.startDate}&endDate=${obj.endDate}`)
- }}>
-
- {
- downloadUrl ?
: ''
- }
-
+
:''
+ }
+
setSetup(true)}
/>
diff --git a/web/client/src/sections/humanAffairs/containers/personalTrainRecord.jsx b/web/client/src/sections/humanAffairs/containers/personalTrainRecord.jsx
index 6519c92..ea9c4f2 100644
--- a/web/client/src/sections/humanAffairs/containers/personalTrainRecord.jsx
+++ b/web/client/src/sections/humanAffairs/containers/personalTrainRecord.jsx
@@ -1,13 +1,14 @@
-import React, { useEffect, useState,useRef } from 'react';
+import React, { useEffect, useState, useRef } from 'react';
import { connect } from 'react-redux';
import { Table, Pagination, Skeleton } from '@douyinfe/semi-ui';
import { SkeletonScreen } from "$components";
import '../style.less'
import ImportPersonalTrainRecord from './importPersonalTrainRecord'
import moment from 'moment'
+import { isAuthorized } from '$utils'
const PersonalTrainRecord = (props) => {
- const { dispatch, actions ,personalTrainRecordList} = props
+ const { dispatch, actions, personalTrainRecordList } = props
const [limits, setLimits] = useState()//每页实际条数
const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息
const [importModalV, setImportModalV] = useState(false); //页码信息
@@ -122,11 +123,11 @@ const PersonalTrainRecord = (props) => {
-
{ setImportModalV(true); }}
>
导入
-
+
: ''}
@@ -184,11 +185,11 @@ const PersonalTrainRecord = (props) => {
}
function mapStateToProps(state) {
- const { auth, global,personalTrainRecordList } = state;
+ const { auth, global, personalTrainRecordList } = state;
return {
user: auth.user,
actions: global.actions,
- personalTrainRecordList:personalTrainRecordList.data || {}
+ personalTrainRecordList: personalTrainRecordList.data || {}
};
}
diff --git a/web/client/src/sections/humanAffairs/containers/personnelFiles.jsx b/web/client/src/sections/humanAffairs/containers/personnelFiles.jsx
index 7dd5c49..96dd9f7 100644
--- a/web/client/src/sections/humanAffairs/containers/personnelFiles.jsx
+++ b/web/client/src/sections/humanAffairs/containers/personnelFiles.jsx
@@ -6,6 +6,7 @@ import PersonnelModal from '../components/personnelModal';
import ImportMembersModal from './import-members-modal'
import '../style.less'
import moment from 'moment'
+import { isAuthorized } from '$utils'
const Rest = (props) => {
const { dispatch, actions, history, user, loading, socket, xqMembers } = props
@@ -64,15 +65,20 @@ const Rest = (props) => {
EMPLOYEE FILE
-
{
- setPersonnelModal(true);
- }}>
- 新增档案
-
-
setExportModalVs(true)} style={{ padding: '6px 20px', background: '#00BA85', color: '#FFFFFF', fontSize: 14, cursor: "pointer", marginLeft: 20 }}>
- 导入员工信息
-
+ {
+ isAuthorized('ADDINGFILES') ?
{
+ setPersonnelModal(true);
+ }}>
+ 新增档案
+
: ''
+ }
+ {
+ isAuthorized('IMPORTEMPLOYEEINFORMATION') ?
setExportModalVs(true)} style={{ padding: '6px 20px', background: '#00BA85', color: '#FFFFFF', fontSize: 14, cursor: "pointer", marginLeft: 20 }}>
+ 导入员工信息
+
: ''
+ }
+
@@ -135,19 +141,23 @@ const Rest = (props) => {
在职
- {
- setDownloadUrl(`members/export?token=${user.token}&state=${typeChoose}&keywordTarget=${keywordTarget}&keyword=${keyword}&keys=overtimeStatistic,vacateStatistic`)
- }}>
-
-
-
-
- 导出
-
- {
- downloadUrl ?
: ''
- }
-
+ {
+ isAuthorized('EXPORTEMPLOYEEPROFILE') ? {
+ setDownloadUrl(`members/export?token=${user.token}&state=${typeChoose}&keywordTarget=${keywordTarget}&keyword=${keyword}&keys=overtimeStatistic,vacateStatistic`)
+ }}>
+
+
+
+
+ 导出
+
+
+ {
+ downloadUrl ?
: ''
+ }
+
: ''
+ }
+
diff --git a/web/client/src/sections/humanAffairs/containers/personnelFilesDetail.jsx b/web/client/src/sections/humanAffairs/containers/personnelFilesDetail.jsx
index c2b889b..8acf4cb 100644
--- a/web/client/src/sections/humanAffairs/containers/personnelFilesDetail.jsx
+++ b/web/client/src/sections/humanAffairs/containers/personnelFilesDetail.jsx
@@ -8,6 +8,7 @@ import DeleteModal from '../components/deleteModal';
import PersonnelModal from '../components/personnelModal';
import moment from 'moment'
import { UserAttribute } from '$utils'
+import { isAuthorized } from '$utils'
import '../style.less'
@@ -147,14 +148,14 @@ const Rest = (props) => {
getWorkOption()//加班信息
getLeaveOption()//请假信息
}, [startDate, endDate])
- function peopleDetail () {
+ function peopleDetail() {
dispatch(humanAffairs.getMemberList({ keywordTarget: 'number', keyword: history?.location?.search.slice(1).split('-')[0] })).then((res) => {//搜索项企用户
if (res.success) {
setPepObj(res.payload?.data?.rows[0])
}
})
}
- function getWorkOption () {//加班折线图
+ function getWorkOption() {//加班折线图
let date = [];
let showdate = []
let showdate1 = []
@@ -278,7 +279,7 @@ const Rest = (props) => {
}
})
}
- function getLeaveOption () {//请假折线图
+ function getLeaveOption() {//请假折线图
let date = [];
let showdate = []
dispatch(humanAffairs.getMemberVacate({ pepUserId: history?.location?.search.slice(1).split('-')[1], startDate: startDate, endDate: endDate })).then((res) => {//搜索项企用户
@@ -407,7 +408,7 @@ const Rest = (props) => {
}
})
}
- function handleChange (date) {
+ function handleChange(date) {
if (date.length > 1) {
setStartDate(moment(date[0]).format('YYYY-MM-DD'))
setEndDate(moment(date[1]).format('YYYY-MM-DD'))
@@ -441,18 +442,23 @@ const Rest = (props) => {
{pepObj?.userName}的个人档案
-
{
- setPersonnelModal(true);
- }}
- >
- 编辑档案
-
-
{ setDeleteModal(true) }}
- >
- 删除档案
-
+ {
+ isAuthorized('EDITPROFILE') ?
{
+ setPersonnelModal(true);
+ }}
+ >
+ 编辑档案
+
: ''
+ }
+ {
+ isAuthorized('DELETEFILES') ?
{ setDeleteModal(true) }}
+ >
+ 删除档案
+
: ''
+ }
+
@@ -651,11 +657,11 @@ const Rest = (props) => {
{
- pepObj.userJob? UserAttribute.jobDataSource[pepObj.userJob - 1] : '暂无'
+ pepObj.userJob ? UserAttribute.jobDataSource[pepObj.userJob - 1] : '暂无'
}
-
+
员工岗位:
@@ -665,13 +671,13 @@ const Rest = (props) => {
}
-
+
所属机构:
{
- pepObj.userOrganization? UserAttribute.organizationDataSource[pepObj.userOrganization - 1] : '暂无'
+ pepObj.userOrganization ? UserAttribute.organizationDataSource[pepObj.userOrganization - 1] : '暂无'
}
@@ -721,7 +727,7 @@ const Rest = (props) => {
入职年限:
- {pepObj.hiredate ? String(moment(new Date()).diff(pepObj.hiredate, 'years',true)).substring(0,3) + '年' : '暂无'}
+ {pepObj.hiredate ? String(moment(new Date()).diff(pepObj.hiredate, 'years', true)).substring(0, 3) + '年' : '暂无'}
@@ -955,7 +961,7 @@ const Rest = (props) => {
)
}
-function mapStateToProps (state) {
+function mapStateToProps(state) {
const { auth, global, members, webSocket } = state;
return {
// loading: members.isRequesting,
diff --git a/web/client/src/sections/humanAffairs/containers/pmLog.jsx b/web/client/src/sections/humanAffairs/containers/pmLog.jsx
index e6106a3..714b7b4 100644
--- a/web/client/src/sections/humanAffairs/containers/pmLog.jsx
+++ b/web/client/src/sections/humanAffairs/containers/pmLog.jsx
@@ -7,6 +7,7 @@ import '../style.less'
import { Setup } from "$components";
import moment from 'moment'
import { getServiceUrl } from '../actions/service';
+import { isAuthorized } from '$utils'
const PMLog = (props) => {
const { dispatch, actions, history, user, loading, socket } = props;
@@ -264,31 +265,34 @@ const PMLog = (props) => {
setSetup(true)}
/>
-
: ''
+ }
+
diff --git a/web/client/src/sections/humanAffairs/containers/positionRating.jsx b/web/client/src/sections/humanAffairs/containers/positionRating.jsx
index 41b40b2..125d363 100644
--- a/web/client/src/sections/humanAffairs/containers/positionRating.jsx
+++ b/web/client/src/sections/humanAffairs/containers/positionRating.jsx
@@ -3,6 +3,7 @@ import { connect } from 'react-redux';
import { Table, Button, Pagination, Skeleton, Popconfirm, Tooltip } from '@douyinfe/semi-ui';
import { SkeletonScreen, Setup } from "$components";
import ImportPositionRatingModal from '../components/importPositionRating';
+import { isAuthorized } from '$utils'
import '../style.less';
const PositionRating = (props) => {
@@ -198,12 +199,18 @@ const PositionRating = (props) => {
+ {
+
+ }
-
{ handleImportModal(); }}
- >
- 导入
-
+ {
+ isAuthorized('IMPORTJOBRATINGS') ?
{ handleImportModal(); }}
+ >
+ 导入
+
: ''
+ }
+
diff --git a/web/client/src/sections/humanAffairs/containers/quarter.jsx b/web/client/src/sections/humanAffairs/containers/quarter.jsx
index 005d523..806cabd 100644
--- a/web/client/src/sections/humanAffairs/containers/quarter.jsx
+++ b/web/client/src/sections/humanAffairs/containers/quarter.jsx
@@ -4,6 +4,7 @@ import { Table, Pagination, Skeleton, DatePicker, Button } from '@douyinfe/semi-
import { SkeletonScreen } from "$components";
import '../style.less'
import moment from 'moment'
+import { isAuthorized } from '$utils'
const Quarter = (props) => {
const [year, setYear] = useState(null)
@@ -62,7 +63,7 @@ const Quarter = (props) => {
width: 120,
render: (text, record) => {
return
- exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载
+ {isAuthorized('DOWNLOADMIDLEVELQUARTERLYASSESSMENT')? exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载:''}
}
}];
diff --git a/web/client/src/sections/humanAffairs/containers/regularKPI.jsx b/web/client/src/sections/humanAffairs/containers/regularKPI.jsx
index a1cc0e9..4e34577 100644
--- a/web/client/src/sections/humanAffairs/containers/regularKPI.jsx
+++ b/web/client/src/sections/humanAffairs/containers/regularKPI.jsx
@@ -4,6 +4,7 @@ import { Table, Pagination, Skeleton, DatePicker, Button } from '@douyinfe/semi-
import { SkeletonScreen } from "$components";
import moment from 'moment'
import '../style.less'
+import { isAuthorized } from '$utils'
const RegularKPI = (props) => {
const [year, setYear] = useState(null)
@@ -62,7 +63,8 @@ const RegularKPI = (props) => {
width: 120,
render: (text, record) => {
return
- exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载
+
+ {isAuthorized('DOWNLOADOFFICIALEMPLOYEEASSESSMENT') ? exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载:''}
}
}];
diff --git a/web/client/src/sections/humanAffairs/containers/resourceRepository.jsx b/web/client/src/sections/humanAffairs/containers/resourceRepository.jsx
index 3b679e2..e139e1c 100644
--- a/web/client/src/sections/humanAffairs/containers/resourceRepository.jsx
+++ b/web/client/src/sections/humanAffairs/containers/resourceRepository.jsx
@@ -9,6 +9,7 @@ import {
} from '../actions/resourceRepository';
import FolderModal from '../components/resourceRepository/folder-model';
import ResourceUploadModal from '../components/resourceRepository/upload-modal';
+import { isAuthorized } from '$utils'
import '../style.less';
const ResourceRepository = (props) => {
@@ -56,8 +57,12 @@ const ResourceRepository = (props) => {
render: (text, record) => {
return
- 下载
- {currentSelect.includes("公司培训资料") &&
+ {
+ isAuthorized('DOWNLOADTRAININGMATERIALS') ? 下载 : ''
+ }
+
+ {
+ isAuthorized('DELETETRAININGMATERIALS')?currentSelect.includes("公司培训资料") &&
{
position={"leftBottom"}
>
删除
- }
+ :''
+ }
}
@@ -238,6 +244,9 @@ const ResourceRepository = (props) => {
{/* 左侧 */}
+ {
+ isAuthorized('FOLDERMANAGEMENT') ? handleFolderClick("新建", false)}>新建文件夹 : ''
+ }
handleFolderClick("新建", false)}>新建文件夹
} showClear onChange={v => ref.current.search(v)} placeholder="请输入">
@@ -262,9 +271,9 @@ const ResourceRepository = (props) => {
当前文件夹:{currentSelect}
- {currentSelect && currentSelect.includes("公司培训资料") && currentSelect.split("/").length == 3 ?
+ {isAuthorized('UPLOADTRAININGMATERIALS') ? currentSelect && currentSelect.includes("公司培训资料") && currentSelect.split("/").length == 3 ?
{ setUploadModalVisiable(true) }} >上传文件
- : null}
+ : null : ''}
关键字
{
const { dispatch, actions, history, user, loading, socket } = props;
@@ -264,31 +265,32 @@ const SaleLog = (props) => {
setSetup(true)}
/>
- {
- const weeklyRange = form.current.getValue("weeklyRange");
- if (weeklyRange && weeklyRange.length == 2) {
- dispatch(getServiceUrl()).then(res => {
- const { payload } = res;
- if (payload && payload.url) {
+ {
+ isAuthorized('EXPORTSALESLOG') ? {
+ const weeklyRange = form.current.getValue("weeklyRange");
+ if (weeklyRange && weeklyRange.length == 2) {
+ dispatch(getServiceUrl()).then(res => {
+ const { payload } = res;
+ if (payload && payload.url) {
- let url = `${payload.url}/week_report/week`;
- if (weeklyRange && weeklyRange.length == 2) {
- url += `?start=${moment(weeklyRange[0]).format('YYYY-MM-DD HH:mm:ss')}&end=${moment(weeklyRange[1]).format('YYYY-MM-DD HH:mm:ss')}&type=sale`
+ let url = `${payload.url}/week_report/week`;
+ if (weeklyRange && weeklyRange.length == 2) {
+ url += `?start=${moment(weeklyRange[0]).format('YYYY-MM-DD HH:mm:ss')}&end=${moment(weeklyRange[1]).format('YYYY-MM-DD HH:mm:ss')}&type=sale`
+ }
+ console.log(url);
+ setDownloadUrl(url);
+ } else {
+ setWarningBanner("导出地址有误,导出失败");
}
- console.log(url);
- setDownloadUrl(url);
- } else {
- setWarningBanner("导出地址有误,导出失败");
- }
- })
- } else {
- setWarningBanner("请选择查询时间范围");
- }
- }}>导出
+ })
+ } else {
+ setWarningBanner("请选择查询时间范围");
+ }
+ }}>导出 : ''}
diff --git a/web/client/src/sections/humanAffairs/containers/salersDistribution/personnelDistribution.jsx b/web/client/src/sections/humanAffairs/containers/salersDistribution/personnelDistribution.jsx
index 6bc65a2..8033f20 100644
--- a/web/client/src/sections/humanAffairs/containers/salersDistribution/personnelDistribution.jsx
+++ b/web/client/src/sections/humanAffairs/containers/salersDistribution/personnelDistribution.jsx
@@ -6,6 +6,7 @@ import SalesMemberModal from './salesMemberModal'
import ImportSalersModal from './importSalersModal'
import { IconSearch } from '@douyinfe/semi-icons';
import { SkeletonScreen } from "$components";
+import { isAuthorized } from '$utils'
import '../../style.less'
const PersonnelDistribution = (props) => {
@@ -38,7 +39,7 @@ const PersonnelDistribution = (props) => {
let kt = keywordTarget == 'place' ? '' : keywordTarget;
let k = keywordTarget == 'place' ? '' : keyword;
let placeSearch = keywordTarget == 'place' ? keyword : '';
- dispatch(humanAffairs.getSalesList({ keywordTarget: kt, keyword: k,userActiveStatus, placeSearch, ...query })).then(r => {
+ dispatch(humanAffairs.getSalesList({ keywordTarget: kt, keyword: k, userActiveStatus, placeSearch, ...query })).then(r => {
if (r.success) {
setTableData(r.payload?.data?.rows);
setLimits(r.payload?.data?.count)
@@ -118,12 +119,12 @@ const PersonnelDistribution = (props) => {
let arrStr = text.map(t => t.name);
return getMultis(arrStr);
}
- },{
+ }, {
title: '在职状态',
dataIndex: 'userActiveStatus',
key: 'userActiveStatus',
width: 200,
- render: (text, r, index) => text == '1'?'在职':text == '2'?'离职':'特殊账号-特殊状态'
+ render: (text, r, index) => text == '1' ? '在职' : text == '2' ? '离职' : '特殊账号-特殊状态'
}, {
title: '销售区域(省/直辖市)',
dataIndex: 'provinces',
@@ -221,13 +222,17 @@ const PersonnelDistribution = (props) => {
-
{
- setModalV(true);
- setDataToEdit(null);
- }}>
- 新增
-
+ {
+
+ isAuthorized('ADDSALESPERSONNEL') ?
{
+ setModalV(true);
+ setDataToEdit(null);
+ }}>
+ 新增
+
: ''
+ }
+
-
{ setImportModalV(true); }}>
- 导入
-
+ {
+ isAuthorized('IMPORTSALESPERSONNELDISTRIBUTION') ?
{ setImportModalV(true); }}>
+ 导入
+
: ''
+ }
+
{/*
导出
*/}
diff --git a/web/client/src/sections/humanAffairs/containers/weeklyManagement.jsx b/web/client/src/sections/humanAffairs/containers/weeklyManagement.jsx
index 710ebd7..170351c 100644
--- a/web/client/src/sections/humanAffairs/containers/weeklyManagement.jsx
+++ b/web/client/src/sections/humanAffairs/containers/weeklyManagement.jsx
@@ -7,6 +7,7 @@ import '../style.less'
import { Setup } from "$components";
import moment from 'moment'
import { getServiceUrl } from '../actions/service';
+import { isAuthorized } from '$utils'
const WeeklyManagement = (props) => {
const { dispatch, actions, history, user, loading, socket, xqMembers } = props;
@@ -289,31 +290,34 @@ const WeeklyManagement = (props) => {
setSetup(true)}
/>
-
{
- const weeklyRange = form.current.getValue("weeklyRange");
- if (weeklyRange && weeklyRange.length == 2) {
- dispatch(getServiceUrl()).then(res => {
- const { payload } = res;
- if (payload && payload.url) {
+ {
+ isAuthorized('EXPORTWEEKLYREPORT') ? {
+ const weeklyRange = form.current.getValue("weeklyRange");
+ if (weeklyRange && weeklyRange.length == 2) {
+ dispatch(getServiceUrl()).then(res => {
+ const { payload } = res;
+ if (payload && payload.url) {
- let url = `${payload.url}/week_report/week`;
- if (weeklyRange && weeklyRange.length == 2) {
- url += `?start=${moment(weeklyRange[0]).format('YYYY-MM-DD HH:mm:ss')}&end=${moment(weeklyRange[1]).format('YYYY-MM-DD HH:mm:ss')}&type=week`
+ let url = `${payload.url}/week_report/week`;
+ if (weeklyRange && weeklyRange.length == 2) {
+ url += `?start=${moment(weeklyRange[0]).format('YYYY-MM-DD HH:mm:ss')}&end=${moment(weeklyRange[1]).format('YYYY-MM-DD HH:mm:ss')}&type=week`
+ }
+ console.log(url);
+ setDownloadUrl(url);
+ } else {
+ setWarningBanner("导出地址有误,导出失败");
}
- console.log(url);
- setDownloadUrl(url);
- } else {
- setWarningBanner("导出地址有误,导出失败");
- }
- })
- } else {
- setWarningBanner("请选择查询时间范围");
- }
- }}>导出
+ })
+ } else {
+ setWarningBanner("请选择查询时间范围");
+ }
+ }}>导出 : ''
+ }
+
diff --git a/web/client/src/sections/humanAffairs/nav-item.jsx b/web/client/src/sections/humanAffairs/nav-item.jsx
index 9d483b3..e5784e2 100644
--- a/web/client/src/sections/humanAffairs/nav-item.jsx
+++ b/web/client/src/sections/humanAffairs/nav-item.jsx
@@ -1,138 +1,186 @@
import React from 'react';
import { IconCode } from '@douyinfe/semi-icons';
+import { isAuthorized } from '$utils'
export function getNavItem(user, dispatch) {
- return (
- [
- {
- itemKey: 'humanAffairs',
- text: '人事管理',
- icon:
,
- items: [{
+ let hrUser = JSON.parse(sessionStorage.getItem('hrUser'))
+ let admin = false
+ hrUser && hrUser.adminHr.forEach(e => {
+ if (e.id == hrUser.id) {
+ admin = true
+ }
+ })
+ let list = [
+ {
+ itemKey: 'humanAffairs',
+ text: '人事管理',
+ icon:
,
+ items: [
+ isAuthorized('PERSONNELFILEMANAGEMENT') ? {
itemKey: 'personnelArchives',
text: '人员档案',
icon:
,
to: '/humanAffairs/archivesCenter/personnelArchives/personnelFiles',
- items: [{
- itemKey: 'personnelFiles', to: '/humanAffairs/archivesCenter/personnelArchives/personnelFiles', text: '人员档案'
- }, {
- itemKey: 'employeeInformation', to: '/humanAffairs/archivesCenter/personnelArchives/employeeInformation', text: '员工信息'
- }, {
- itemKey: 'positionRating', to: '/humanAffairs/archivesCenter/personnelArchives/positionRating', text: '岗位评级'
- }]
- }, {
+ items: [
+ isAuthorized('PERSONNELFILES') ? {
+ itemKey: 'personnelFiles', to: '/humanAffairs/archivesCenter/personnelArchives/personnelFiles', text: '人员档案'
+ } : {},
+ isAuthorized('EMPLOYEEINFORMATION') ? {
+ itemKey: 'employeeInformation', to: '/humanAffairs/archivesCenter/personnelArchives/employeeInformation', text: '员工信息'
+ } : {},
+ isAuthorized('JOBRATING') ? {
+ itemKey: 'positionRating', to: '/humanAffairs/archivesCenter/personnelArchives/positionRating', text: '岗位评级'
+ } : {}]
+ } : {},
+ isAuthorized('DEPARTMENTARCHIVESMANAGEMENT') ? {
itemKey: 'deptArchives',
text: '部门档案',
icon:
,
to: '/humanAffairs/archivesCenter/deptArchives/department',
- items: [{
- itemKey: 'department', to: '/humanAffairs/archivesCenter/deptArchives/department', text: '部门档案'
- }]
- }, {
+ items: [
+ isAuthorized('DEPARTMENTARCHIVES') ? {
+ itemKey: 'department', to: '/humanAffairs/archivesCenter/deptArchives/department', text: '部门档案'
+ } : {}]
+ } : {},
+ isAuthorized('LEAVEMANAGEMENT') ? {
itemKey: 'leaveManagement',
text: '假勤管理',
icon:
,
to: '/humanAffairs/employeeRelationship/leaveManagement/attendanceStatistics',
- items: [{
- itemKey: 'attendanceStatistics', to: '/humanAffairs/employeeRelationship/leaveManagement/attendanceStatistics', text: '出勤统计'
- }, {
- itemKey: 'leaveStatistics', to: '/humanAffairs/employeeRelationship/leaveManagement/leaveStatistics', text: '请假统计'
- }, {
- itemKey: 'overtimeStatistics', to: '/humanAffairs/employeeRelationship/leaveManagement/overtimeStatistics', text: '加班统计'
- }]
- }, {
+ items: [
+ isAuthorized('ATTENDANCESTATISTICS') ? {
+ itemKey: 'attendanceStatistics', to: '/humanAffairs/employeeRelationship/leaveManagement/attendanceStatistics', text: '出勤统计'
+ } : {},
+ isAuthorized('LEAVESTATISTICS') ? {
+ itemKey: 'leaveStatistics', to: '/humanAffairs/employeeRelationship/leaveManagement/leaveStatistics', text: '请假统计'
+ } : {},
+ isAuthorized('OVERTIMESTATISTICS') ? {
+ itemKey: 'overtimeStatistics', to: '/humanAffairs/employeeRelationship/leaveManagement/overtimeStatistics', text: '加班统计'
+ } : {}]
+ } : {},
+ isAuthorized('EMPLOYEECOMMUNICATION') ? {
itemKey: 'communication',
text: '员工沟通',
icon:
,
to: '/humanAffairs/employeeRelationship/communication/employeeCommunication',
- items: [{
- itemKey: 'employeeCommunication', to: '/humanAffairs/employeeRelationship/communication/employeeCommunication', text: '员工沟通统计'
- }]
- }, {
+ items: [
+ isAuthorized('EMPLOYEECOMMUNICATIONSTATISTICS') ? {
+ itemKey: 'employeeCommunication', to: '/humanAffairs/employeeRelationship/communication/employeeCommunication', text: '员工沟通统计'
+ } : {}
+ ]
+ } : {},
+ isAuthorized('RECRUITMENTRECORDS') ? {
itemKey: 'recruitRecord',
text: '招聘记录',
icon:
,
to: '/humanAffairs/recruit/recruitRecord/appointmentRecords',
- items: [{
- itemKey: 'appointmentRecords', to: '/humanAffairs/recruit/recruitRecord/appointmentRecords', text: '任用记录'
- }]
- }, {
+ items: [
+ isAuthorized('APPOINTMENTRECORD') ? {
+ itemKey: 'appointmentRecords', to: '/humanAffairs/recruit/recruitRecord/appointmentRecords', text: '任用记录'
+ } : {}
+ ]
+ } : {},
+ isAuthorized('SALESSTATISTICS') ? {
itemKey: 'salesStatistics',
text: '销售统计',
icon:
,//wwwtodo
to: '/humanAffairs/recruit/salesStatistics/personnelDistribution',
- items: [{
- itemKey: 'personnelDistribution', to: '/humanAffairs/recruit/salesStatistics/personnelDistribution', text: '销售人员分布'
- }]
- }, {
+ items: [
+ isAuthorized('SALESPERSONNELDISTRIBUTION') ? {
+ itemKey: 'personnelDistribution', to: '/humanAffairs/recruit/salesStatistics/personnelDistribution', text: '销售人员分布'
+ } : {}
+ ]
+ } : {},
+ isAuthorized('TRAININGDOSSIER') ? {
itemKey: 'trainFiles',
text: '培训档案',
icon:
,
to: '/humanAffairs/train/trainFiles/resourceRepository',
- items: [{
- itemKey: 'resourceRepository', to: '/humanAffairs/train/trainFiles/resourceRepository', text: '培训资源储存库'
- }]
- }, {
+ items: [
+ isAuthorized('TRAININGRESOURCEREPOSITORY') ? {
+ itemKey: 'resourceRepository', to: '/humanAffairs/train/trainFiles/resourceRepository', text: '培训资源储存库'
+ } : {}
+ ]
+ } : {},
+ isAuthorized('TRAININGMANAGEMENT') ? {
itemKey: 'trainingManagement',
text: '培训管理',
icon:
,
to: '/humanAffairs/train/trainingManagement/personalTrainRecord',
- items: [{
- itemKey: 'personalTrainRecord', to: '/humanAffairs/train/trainingManagement/personalTrainRecord', text: '个人培训记录'
- }, {
- itemKey: 'departmentTrainRecord', to: '/humanAffairs/train/trainingManagement/departmentTrainRecord', text: '部门培训记录'
- }]
- }, {
+ items: [
+ isAuthorized('PERSONALTRAININGRECORDS') ? {
+ itemKey: 'personalTrainRecord', to: '/humanAffairs/train/trainingManagement/personalTrainRecord', text: '个人培训记录'
+ } : {},
+ isAuthorized('DEPARTMENTTRAININGRECORDS') ? {
+ itemKey: 'departmentTrainRecord', to: '/humanAffairs/train/trainingManagement/departmentTrainRecord', text: '部门培训记录'
+ } : {}]
+ } : {},
+ isAuthorized('BASICACTIONMANAGEMENT') ? {
itemKey: 'basicAction',
text: '基本动作',
icon:
,
to: '/humanAffairs/achievements/basicAction/weeklyManagement',
- items: [{
- itemKey: 'weeklyManagement', to: '/humanAffairs/achievements/basicAction/weeklyManagement', text: '周报管理'
- }, {
- itemKey: 'saleLog', to: '/humanAffairs/achievements/basicAction/saleLog', text: '销售日志'
- }, {
- itemKey: 'pmLog', to: '/humanAffairs/achievements/basicAction/pmLog', text: '工程日志'
- }]
- }, {
+ items: [
+ isAuthorized('WEEKLYREPORTMANAGEMENT') ? {
+ itemKey: 'weeklyManagement', to: '/humanAffairs/achievements/basicAction/weeklyManagement', text: '周报管理'
+ } : {},
+ isAuthorized('SALESLOG') ? {
+ itemKey: 'saleLog', to: '/humanAffairs/achievements/basicAction/saleLog', text: '销售日志'
+ } : {},
+ isAuthorized('ENGINEERINGLOG') ? {
+ itemKey: 'pmLog', to: '/humanAffairs/achievements/basicAction/pmLog', text: '工程日志'
+ } : {}]
+ } : {},
+ isAuthorized('EMPLOYEEASSESSMENT') ? {
itemKey: 'employeeKPI',
text: '员工考核',
icon:
,
to: '/humanAffairs/achievements/employeeKPI/probationer',
- items: [{
- itemKey: 'probationer', to: '/humanAffairs/achievements/employeeKPI/probationer', text: '试用期员工考核'
- }, {
- itemKey: 'regular', to: '/humanAffairs/achievements/employeeKPI/regular', text: '正式员工考核'
- }]
- }, {
+ items: [
+ isAuthorized('EMPLOYEEASSESSMENTDURINGPROBATIONARYPERIOD') ? {
+ itemKey: 'probationer', to: '/humanAffairs/achievements/employeeKPI/probationer', text: '试用期员工考核'
+ } : {},
+ isAuthorized('FORMALEMPLOYEEASSESSMENT') ? {
+ itemKey: 'regular', to: '/humanAffairs/achievements/employeeKPI/regular', text: '正式员工考核'
+ } : {}]
+ } : {},
+ isAuthorized('MIDDLELEVELASSESSMENT') ? {
itemKey: 'middleKPI',
text: '中层考核',
icon:
,
to: '/humanAffairs/achievements/middleKPI/monthlyProcess',
- items: [{
- itemKey: 'monthlyProcess', to: '/humanAffairs/achievements/middleKPI/monthlyProcess', text: '月度过程考核'
- }, {
- itemKey: 'quarter', to: '/humanAffairs/achievements/middleKPI/quarter', text: '季度考核'
- }]
- }, {
+ items: [
+ isAuthorized('MIDDLELEVELMONTHLYPROCESSASSESSMENT') ? {
+ itemKey: 'monthlyProcess', to: '/humanAffairs/achievements/middleKPI/monthlyProcess', text: '月度过程考核'
+ } : {},
+ isAuthorized('MIDLEVELQUARTERLYASSESSMENT') ? {
+ itemKey: 'quarter', to: '/humanAffairs/achievements/middleKPI/quarter', text: '季度考核'
+ } : {}]
+ } : {},
+ isAuthorized('SENIORASSESSMENT') ? {
itemKey: 'highKPI',
text: '高管考核',
icon:
,
to: '/humanAffairs/achievements/highKPI/highMonthly',
- items: [{
- itemKey: 'highMonthly', to: '/humanAffairs/achievements/highKPI/highMonthly', text: '月度过程考核'
- },{
- itemKey: 'Highquarter', to: '/humanAffairs/achievements/highKPI/Highquarter', text: '季度考核'
- }]
- }, {
+ items: [
+ isAuthorized('MONTHLYPROCESSASSESSMENTFORSENIORMANAGEMENT') ? {
+ itemKey: 'highMonthly', to: '/humanAffairs/achievements/highKPI/highMonthly', text: '月度过程考核'
+ } : {},
+ isAuthorized('QUARTERLYASSESSMENTOFSENIORMANAGEMENT') ? {
+ itemKey: 'Highquarter', to: '/humanAffairs/achievements/highKPI/Highquarter', text: '季度考核'
+ } : {}]
+ } : {},
+ isAuthorized('REWARDANDPUNISHMENTMANAGEMENT') ? {
itemKey: 'penalties',
text: '奖惩信息',
icon:
,
to: '/humanAffairs/achievements/penalties/penaltiesRecord',
- items: [{
- itemKey: 'penaltiesRecord', to: '/humanAffairs/achievements/penalties/penaltiesRecord', text: '奖惩信息'
- }]
- }, {
+ items: [
+ isAuthorized('REWARDANDPUNISHMENTINFORMATION') ? {
+ itemKey: 'penaltiesRecord', to: '/humanAffairs/achievements/penalties/penaltiesRecord', text: '奖惩信息'
+ } : {}]
+ } : {},
+ admin ? {
itemKey: 'authCenter',
text: '权限中心',
icon:
,
@@ -142,8 +190,24 @@ export function getNavItem(user, dispatch) {
}, {
itemKey: 'formMaintenance', to: '/humanAffairs/authCenter/formMaintenance', text: '表单维护'
}]
- }]
- },
- ]
- );
+ } : {}
+ ]
+ },
+ ]
+ list[0].items.map(e => {
+ if (e.items != undefined) {
+ e.items = e.items.filter(element => {
+ if (Object.keys(element).length !== 0) {
+ return true;
+ }
+ })
+ }
+ return e
+ })
+ list[0].items = list[0].items.filter(element => {
+ if (Object.keys(element).length !== 0) {
+ return true;
+ }
+ })
+ return list
}
\ No newline at end of file
diff --git a/web/client/src/utils/func.js b/web/client/src/utils/func.js
index 9783a9f..446e5d8 100644
--- a/web/client/src/utils/func.js
+++ b/web/client/src/utils/func.js
@@ -1,8 +1,8 @@
'use strict';
export const isAuthorized = (authcode) => {
- if (JSON.parse(sessionStorage.getItem('user'))) {
- const { resources } = JSON.parse(sessionStorage.getItem('hrUser'));
+ if (JSON.parse(sessionStorage.getItem('userResource'))) {
+ const resources = JSON.parse(sessionStorage.getItem('userResource'));
return resources.includes(authcode);
} else {
return false;
diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js
index 4f2fe88..f3ac832 100644
--- a/web/client/src/utils/webapi.js
+++ b/web/client/src/utils/webapi.js
@@ -67,15 +67,16 @@ export const ApiTable = {
getemployeeAssessmentList: 'employessAssessment/list/{type}',
//权限
- getRoleList:'role/list',
- addRole:'role/add',
- editRole:'role/edit',
- delRole:'role/del',
- getUserRoleList:'roleUser/list',
- addUserRole:'roleUser/add',
- getResource:'resource/list',
- getRoleResource:'roleResource/list',
- addRoleResource:'roleResource/add',
+ getRoleList: 'role/list',
+ addRole: 'role/add',
+ editRole: 'role/edit',
+ delRole: 'role/del',
+ getUserRoleList: 'roleUser/list',
+ addUserRole: 'roleUser/add',
+ getResource: 'resource/list',
+ getRoleResource: 'roleResource/list',
+ addRoleResource: 'roleResource/add',
+ getUserResource: 'user/{userId}/role/resources',
// 请假统计添加备注
createVacateRemark: 'attendance/vacate/creat/remark'