Browse Source

(+)权限控制

master
ww664853070 2 years ago
parent
commit
13ec2ce69c
  1. 2
      api/app/lib/controllers/role/index.js
  2. 10
      web/client/src/layout/containers/layout/index.jsx
  3. 11
      web/client/src/sections/humanAffairs/actions/role.js
  4. 20
      web/client/src/sections/humanAffairs/containers/communication/employeeCommunication.jsx
  5. 5
      web/client/src/sections/humanAffairs/containers/departmentTrain/departmentTrainRecord.jsx
  6. 39
      web/client/src/sections/humanAffairs/containers/employeeInformation.jsx
  7. 3
      web/client/src/sections/humanAffairs/containers/highMonthly.jsx
  8. 3
      web/client/src/sections/humanAffairs/containers/highQuarter.jsx
  9. 38
      web/client/src/sections/humanAffairs/containers/leaveStatistics.jsx
  10. 3
      web/client/src/sections/humanAffairs/containers/monthlyProcess.jsx
  11. 38
      web/client/src/sections/humanAffairs/containers/overtimeStatistics.jsx
  12. 13
      web/client/src/sections/humanAffairs/containers/personalTrainRecord.jsx
  13. 54
      web/client/src/sections/humanAffairs/containers/personnelFiles.jsx
  14. 50
      web/client/src/sections/humanAffairs/containers/personnelFilesDetail.jsx
  15. 50
      web/client/src/sections/humanAffairs/containers/pmLog.jsx
  16. 17
      web/client/src/sections/humanAffairs/containers/positionRating.jsx
  17. 3
      web/client/src/sections/humanAffairs/containers/quarter.jsx
  18. 4
      web/client/src/sections/humanAffairs/containers/regularKPI.jsx
  19. 19
      web/client/src/sections/humanAffairs/containers/resourceRepository.jsx
  20. 48
      web/client/src/sections/humanAffairs/containers/saleLog.jsx
  21. 36
      web/client/src/sections/humanAffairs/containers/salersDistribution/personnelDistribution.jsx
  22. 50
      web/client/src/sections/humanAffairs/containers/weeklyManagement.jsx
  23. 230
      web/client/src/sections/humanAffairs/nav-item.jsx
  24. 4
      web/client/src/utils/func.js
  25. 19
      web/client/src/utils/webapi.js

2
api/app/lib/controllers/role/index.js

@ -31,7 +31,7 @@ async function add(ctx) {
throw '当前角色已存在' throw '当前角色已存在'
} }
let storageData = { name } let storageData = { name ,delete:true}
await models.Role.create(storageData) await models.Role.create(storageData)
ctx.status = 204; ctx.status = 204;
} catch (error) { } catch (error) {

10
web/client/src/layout/containers/layout/index.jsx

@ -15,6 +15,7 @@ import { RouteRequest } from '@peace/utils';
import Cookie from 'js-cookie'; import Cookie from 'js-cookie';
import { login, LOGIN_SUCCESS } from '../../../sections/auth/actions/auth'; import { login, LOGIN_SUCCESS } from '../../../sections/auth/actions/auth';
import { error } from 'webpack-dev-server/lib/utils/colors'; 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) document.getElementById('HrApp').clientWidth - (collapsed ? 120 : 240)
)); ));
} }
function deepCopy (data) {// function deepCopy(data) {//
//string,number,bool,null,undefined,symbol //string,number,bool,null,undefined,symbol
//object,array,date //object,array,date
if (data && typeof data === "object") { if (data && typeof data === "object") {
@ -217,6 +218,11 @@ const LayoutContainer = props => {
localStorage.setItem('poms_open_sider', JSON.stringify(["archivesCenter"])) localStorage.setItem('poms_open_sider', JSON.stringify(["archivesCenter"]))
localStorage.setItem('poms_selected_sider', JSON.stringify(["humanAffairs"])) localStorage.setItem('poms_selected_sider', JSON.stringify(["humanAffairs"]))
dispatch(actions.layout.initWebSocket({ ioUrl: apiRoot, token: data.token, hrUserId: data.hrUserInfo && hrUserInfo.id })) 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 { } else {
window.location.href = `${webPepUrl}/signin` window.location.href = `${webPepUrl}/signin`
} }
@ -343,7 +349,7 @@ const LayoutContainer = props => {
) )
} }
function mapStateToProps (state) { function mapStateToProps(state) {
const { global, auth, ajaxResponse, webSocket } = state; const { global, auth, ajaxResponse, webSocket } = state;
return { return {
title: global.title, title: global.title,

11
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 } },
});
}

20
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 { IconSearch } from '@douyinfe/semi-icons';
import DetailModal from './detailModal'; import DetailModal from './detailModal';
import { SkeletonScreen } from "$components"; import { SkeletonScreen } from "$components";
import { isAuthorized } from '$utils'
import '../../style.less' import '../../style.less'
const EmployeeCommunication = (props) => { const EmployeeCommunication = (props) => {
@ -253,14 +254,17 @@ const EmployeeCommunication = (props) => {
getEmployeeCommunicateData({ limit: 10, page: 0 }); getEmployeeCommunicateData({ limit: 10, page: 0 });
}}>查询</Button> }}>查询</Button>
</div> </div>
<div style={{ display: 'flex', marginRight: 20 }}> {
<div style={{ padding: '6px 20px', background: '#0F7EFB', color: '#FFFFFF', fontSize: 14, marginLeft: 18, cursor: "pointer" }} isAuthorized('EXPORTEMPLOYEECOMMUNICATIONSTATISTICS') ? <div style={{ display: 'flex', marginRight: 20 }}>
onClick={() => { <div style={{ padding: '6px 20px', background: '#0F7EFB', color: '#FFFFFF', fontSize: 14, marginLeft: 18, cursor: "pointer" }}
exportAllData() onClick={() => {
}}> exportAllData()
导出 }}>
</div> 导出
</div> </div>
</div>:''
}
</div> </div>
<div style={{ marginTop: 20 }}> <div style={{ marginTop: 20 }}>
<Skeleton <Skeleton

5
web/client/src/sections/humanAffairs/containers/departmentTrain/departmentTrainRecord.jsx

@ -5,6 +5,7 @@ import { Table, Pagination, Skeleton } from '@douyinfe/semi-ui';
import EditModal from './editModal' import EditModal from './editModal'
import ImportModal from './importModal' import ImportModal from './importModal'
import { SkeletonScreen } from "$components"; import { SkeletonScreen } from "$components";
import { isAuthorized } from '$utils'
import '../../style.less' import '../../style.less'
const DepartmentTrainType = ["部门内部培训", "跨部门培训", "外部培训", "公司内训"]; const DepartmentTrainType = ["部门内部培训", "跨部门培训", "外部培训", "公司内训"];
const DepartmentTrainMethod = ["线上", "线下"]; const DepartmentTrainMethod = ["线上", "线下"];
@ -170,10 +171,10 @@ const DepartmentTrainRecord = (props) => {
</div> </div>
<div style={{ display: 'flex', marginRight: 20 }}> <div style={{ display: 'flex', marginRight: 20 }}>
<div style={{ padding: '6px 20px', background: '#0F7EFB', color: '#FFFFFF', fontSize: 14, cursor: "pointer" }} {isAuthorized('IMPORTDEPARTMENTTRAININGRECORDS') ? <div style={{ padding: '6px 20px', background: '#0F7EFB', color: '#FFFFFF', fontSize: 14, cursor: "pointer" }}
onClick={() => { setImportModalV(true); }}> onClick={() => { setImportModalV(true); }}>
导入 导入
</div> </div> : ''}
</div> </div>
</div> </div>

39
web/client/src/sections/humanAffairs/containers/employeeInformation.jsx

@ -7,7 +7,7 @@ import '../style.less'
import { Setup } from "$components"; import { Setup } from "$components";
import moment from 'moment' import moment from 'moment'
import { set } from 'nprogress'; import { set } from 'nprogress';
import { UserAttribute } from '$utils' import { UserAttribute, isAuthorized } from '$utils'
const employeeInformation = (props) => { const employeeInformation = (props) => {
const { dispatch, actions, history, user, loading, socket, xqMembers } = props const { dispatch, actions, history, user, loading, socket, xqMembers } = props
@ -591,24 +591,27 @@ const employeeInformation = (props) => {
</Form.Select> </Form.Select>
</div> </div>
<div style={{ display: 'flex', alignItems: 'center' }}> <div style={{ display: 'flex', alignItems: 'center' }}>
<div style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }} {
onClick={() => { isAuthorized('EXPORTEMPLOYEEINFORMATION') ? <div style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }}
let obj = form.current.getValues() onClick={() => {
if (form.current.getValues().entryTime?.length > 1) { let obj = form.current.getValues()
obj.hiredateStart = moment(form.current.getValues().entryTime[0]).format('YYYY-MM-DD') if (form.current.getValues().entryTime?.length > 1) {
obj.hiredateEnd = moment(form.current.getValues().entryTime[1]).format('YYYY-MM-DD') 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 = '' else {
obj.hiredateEnd = '' 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}`)
}}>
<img src="/assets/images/hrImg/export.png" alt="" style={{ width: '100%', height: '100%' }} />
{
downloadUrl ? <iframe src={`/_api/${downloadUrl}`} style={{ display: 'none' }} /> : ''
} }
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}`) </div> : ''
}}> }
<img src="/assets/images/hrImg/export.png" alt="" style={{ width: '100%', height: '100%' }} />
{
downloadUrl ? <iframe src={`/_api/${downloadUrl}`} style={{ display: 'none' }} /> : ''
}
</div>
<img src="/assets/images/hrImg/newsetup.png" alt="" style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }} <img src="/assets/images/hrImg/newsetup.png" alt="" style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }}
onClick={() => setSetup(true)} onClick={() => setSetup(true)}
/> />

3
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 { SkeletonScreen } from "$components";
import '../style.less' import '../style.less'
import moment from 'moment' import moment from 'moment'
import { isAuthorized } from '$utils'
const HighMonthly = (props) => { const HighMonthly = (props) => {
const [year, setYear] = useState(null) const [year, setYear] = useState(null)
@ -62,7 +63,7 @@ const HighMonthly = (props) => {
width: 120, width: 120,
render: (text, record) => { render: (text, record) => {
return <div> return <div>
<span onClick={() => exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载</span> {isAuthorized('DOWNLOADTHEMONTHLYPROCESSASSESSMENTFORSENIORMANAGEMENT')?<span onClick={() => exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载</span>:''}
</div> </div>
} }
}]; }];

3
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 { SkeletonScreen } from "$components";
import '../style.less' import '../style.less'
import moment from 'moment' import moment from 'moment'
import { isAuthorized } from '$utils'
const HighQuarter = (props) => { const HighQuarter = (props) => {
const [year, setYear] = useState(null) const [year, setYear] = useState(null)
@ -62,7 +63,7 @@ const HighQuarter = (props) => {
width: 120, width: 120,
render: (text, record) => { render: (text, record) => {
return <div> return <div>
<span onClick={() => exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载</span> {isAuthorized('DOWNLOADQUARTERLYASSESSMENTSFORSENIORMANAGEMENT')?<span onClick={() => exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载</span>:''}
</div> </div>
} }
}]; }];

38
web/client/src/sections/humanAffairs/containers/leaveStatistics.jsx

@ -7,6 +7,7 @@ import { SkeletonScreen } from "$components";
import '../style.less' import '../style.less'
import { Setup } from "$components"; import { Setup } from "$components";
import moment from 'moment' import moment from 'moment'
import { isAuthorized } from '$utils'
import { set } from 'nprogress'; import { set } from 'nprogress';
const leaveStatistics = (props) => { const leaveStatistics = (props) => {
@ -371,24 +372,27 @@ const leaveStatistics = (props) => {
</div> </div>
<div style={{ display: 'flex', alignItems: 'center' }}> <div style={{ display: 'flex', alignItems: 'center' }}>
<div style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }} {
onClick={() => { isAuthorized('EXPORTLEAVESTATISTICS') ? <div style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }}
let obj = form.current.getValues() onClick={() => {
if (form.current.getValues().entryTime?.length > 1) { let obj = form.current.getValues()
obj.startDate = moment(form.current.getValues().entryTime[0]).format('YYYY-MM-DD') if (form.current.getValues().entryTime?.length > 1) {
obj.endDate = moment(form.current.getValues().entryTime[1]).format('YYYY-MM-DD') 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 = '' else {
obj.endDate = '' 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}`)
}}>
<img src="/assets/images/hrImg/export.png" alt="" style={{ width: '100%', height: '100%' }} />
{
downloadUrl ? <iframe src={`/_api/${downloadUrl}`} style={{ display: 'none' }} /> : ''
} }
setDownloadUrl(`attendance/vacate/export?token=${user.token}&keywordTarget=${obj.keywordTarget ? obj.keywordTarget : ''}&keyword=${obj.keyword ? obj.keyword : ''}&startDate=${obj.startDate}&endDate=${obj.endDate}`) </div> : ''
}}> }
<img src="/assets/images/hrImg/export.png" alt="" style={{ width: '100%', height: '100%' }} />
{
downloadUrl ? <iframe src={`/_api/${downloadUrl}`} style={{ display: 'none' }} /> : ''
}
</div>
<img src="/assets/images/hrImg/newsetup.png" alt="" style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }} <img src="/assets/images/hrImg/newsetup.png" alt="" style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }}
onClick={() => setSetup(true)} onClick={() => setSetup(true)}
/> />

3
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 { SkeletonScreen } from "$components";
import '../style.less' import '../style.less'
import moment from 'moment' import moment from 'moment'
import { isAuthorized } from '$utils'
const MonthlyProcess = (props) => { const MonthlyProcess = (props) => {
const [year, setYear] = useState(null) const [year, setYear] = useState(null)
@ -62,7 +63,7 @@ const MonthlyProcess = (props) => {
width: 120, width: 120,
render: (text, record) => { render: (text, record) => {
return <div> return <div>
<span onClick={() => exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载</span> {isAuthorized('DOWNLOADMIDDLELEVELMONTHLYPROCESSASSESSMENT') ? <span onClick={() => exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载</span>:''}
</div> </div>
} }
}]; }];

38
web/client/src/sections/humanAffairs/containers/overtimeStatistics.jsx

@ -6,6 +6,7 @@ import { SkeletonScreen } from "$components";
import '../style.less' import '../style.less'
import { Setup } from "$components"; import { Setup } from "$components";
import moment from 'moment' import moment from 'moment'
import { isAuthorized } from '$utils'
import { set } from 'nprogress'; import { set } from 'nprogress';
const overtimeStatistics = (props) => { const overtimeStatistics = (props) => {
@ -409,24 +410,27 @@ const overtimeStatistics = (props) => {
</div> </div>
<div style={{ display: 'flex', alignItems: 'center' }}> <div style={{ display: 'flex', alignItems: 'center' }}>
<div style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }} {
onClick={() => { isAuthorized('EXPORTOVERTIMESTATISTICS')?<div style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }}
let obj = form.current.getValues() onClick={() => {
if (form.current.getValues().entryTime?.length > 1) { let obj = form.current.getValues()
obj.startDate = moment(form.current.getValues().entryTime[0]).format('YYYY-MM-DD') if (form.current.getValues().entryTime?.length > 1) {
obj.endDate = moment(form.current.getValues().entryTime[1]).format('YYYY-MM-DD') 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 = '' else {
obj.endDate = '' 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}`)
}}>
<img src="/assets/images/hrImg/export.png" alt="" style={{ width: '100%', height: '100%' }} />
{
downloadUrl ? <iframe src={`/_api/${downloadUrl}`} style={{ display: 'none' }} /> : ''
} }
setDownloadUrl(`attendance/overtime/export?token=${user.token}&keywordTarget=${obj.keywordTarget ? obj.keywordTarget : ''}&keyword=${obj.keyword ? obj.keyword : ''}&startDate=${obj.startDate}&endDate=${obj.endDate}`) </div>:''
}}> }
<img src="/assets/images/hrImg/export.png" alt="" style={{ width: '100%', height: '100%' }} />
{
downloadUrl ? <iframe src={`/_api/${downloadUrl}`} style={{ display: 'none' }} /> : ''
}
</div>
<img src="/assets/images/hrImg/newsetup.png" alt="" style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }} <img src="/assets/images/hrImg/newsetup.png" alt="" style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }}
onClick={() => setSetup(true)} onClick={() => setSetup(true)}
/> />

13
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 { connect } from 'react-redux';
import { Table, Pagination, Skeleton } from '@douyinfe/semi-ui'; import { Table, Pagination, Skeleton } from '@douyinfe/semi-ui';
import { SkeletonScreen } from "$components"; import { SkeletonScreen } from "$components";
import '../style.less' import '../style.less'
import ImportPersonalTrainRecord from './importPersonalTrainRecord' import ImportPersonalTrainRecord from './importPersonalTrainRecord'
import moment from 'moment' import moment from 'moment'
import { isAuthorized } from '$utils'
const PersonalTrainRecord = (props) => { const PersonalTrainRecord = (props) => {
const { dispatch, actions ,personalTrainRecordList} = props const { dispatch, actions, personalTrainRecordList } = props
const [limits, setLimits] = useState()// const [limits, setLimits] = useState()//
const [query, setQuery] = useState({ limit: 10, page: 0 }); // const [query, setQuery] = useState({ limit: 10, page: 0 }); //
const [importModalV, setImportModalV] = useState(false); // const [importModalV, setImportModalV] = useState(false); //
@ -122,11 +123,11 @@ const PersonalTrainRecord = (props) => {
<div style={{ margin: '18px 0px' }}> <div style={{ margin: '18px 0px' }}>
<div style={{ display: 'flex', margin: '16px 0px', justifyContent: 'flex-end' }}> <div style={{ display: 'flex', margin: '16px 0px', justifyContent: 'flex-end' }}>
<div style={{ display: 'flex', marginRight: 20 }}> <div style={{ display: 'flex', marginRight: 20 }}>
<div style={{ padding: '6px 20px', background: '#0F7EFB', color: '#FFFFFF', fontSize: 14, cursor: "pointer" }} {isAuthorized('IMPORTPERSONALTRAININGRECORDS') ? <div style={{ padding: '6px 20px', background: '#0F7EFB', color: '#FFFFFF', fontSize: 14, cursor: "pointer" }}
onClick={() => { setImportModalV(true); }} onClick={() => { setImportModalV(true); }}
> >
导入 导入
</div> </div> : ''}
</div> </div>
</div> </div>
<div style={{ marginTop: 20 }}> <div style={{ marginTop: 20 }}>
@ -184,11 +185,11 @@ const PersonalTrainRecord = (props) => {
} }
function mapStateToProps(state) { function mapStateToProps(state) {
const { auth, global,personalTrainRecordList } = state; const { auth, global, personalTrainRecordList } = state;
return { return {
user: auth.user, user: auth.user,
actions: global.actions, actions: global.actions,
personalTrainRecordList:personalTrainRecordList.data || {} personalTrainRecordList: personalTrainRecordList.data || {}
}; };
} }

54
web/client/src/sections/humanAffairs/containers/personnelFiles.jsx

@ -6,6 +6,7 @@ import PersonnelModal from '../components/personnelModal';
import ImportMembersModal from './import-members-modal' import ImportMembersModal from './import-members-modal'
import '../style.less' import '../style.less'
import moment from 'moment' import moment from 'moment'
import { isAuthorized } from '$utils'
const Rest = (props) => { const Rest = (props) => {
const { dispatch, actions, history, user, loading, socket, xqMembers } = props const { dispatch, actions, history, user, loading, socket, xqMembers } = props
@ -64,15 +65,20 @@ const Rest = (props) => {
<div style={{ marginLeft: 6, fontSize: 12, color: '#969799', fontFamily: "DINExp", }}>EMPLOYEE FILE</div> <div style={{ marginLeft: 6, fontSize: 12, color: '#969799', fontFamily: "DINExp", }}>EMPLOYEE FILE</div>
</div> </div>
<div style={{ display: 'flex', marginRight: 20 }}> <div style={{ display: 'flex', marginRight: 20 }}>
<div style={{ padding: '6px 20px', background: '#0F7EFB', color: '#FFFFFF', fontSize: 14, cursor: "pointer" }} {
onClick={() => { isAuthorized('ADDINGFILES') ? <div style={{ padding: '6px 20px', background: '#0F7EFB', color: '#FFFFFF', fontSize: 14, cursor: "pointer" }}
setPersonnelModal(true); onClick={() => {
}}> setPersonnelModal(true);
新增档案 }}>
</div> 新增档案
<div onClick={() => setExportModalVs(true)} style={{ padding: '6px 20px', background: '#00BA85', color: '#FFFFFF', fontSize: 14, cursor: "pointer", marginLeft: 20 }}> </div> : ''
导入员工信息 }
</div> {
isAuthorized('IMPORTEMPLOYEEINFORMATION') ? <div onClick={() => setExportModalVs(true)} style={{ padding: '6px 20px', background: '#00BA85', color: '#FFFFFF', fontSize: 14, cursor: "pointer", marginLeft: 20 }}>
导入员工信息
</div> : ''
}
</div> </div>
</div> </div>
</div> </div>
@ -135,19 +141,23 @@ const Rest = (props) => {
<Radio value='onJob'>在职</Radio> <Radio value='onJob'>在职</Radio>
</RadioGroup> </RadioGroup>
</div> </div>
<div style={{ display: 'flex', marginLeft: 30, alignItems: 'center', cursor: 'pointer' }} onClick={() => { {
setDownloadUrl(`members/export?token=${user.token}&state=${typeChoose}&keywordTarget=${keywordTarget}&keyword=${keyword}&keys=overtimeStatistic,vacateStatistic`) isAuthorized('EXPORTEMPLOYEEPROFILE') ? <div style={{ display: 'flex', marginLeft: 30, alignItems: 'center', cursor: 'pointer' }} onClick={() => {
}}> setDownloadUrl(`members/export?token=${user.token}&state=${typeChoose}&keywordTarget=${keywordTarget}&keyword=${keyword}&keys=overtimeStatistic,vacateStatistic`)
<div style={{ width: 20, height: 20 }}> }}>
<img src="/assets/images/hrImg/export.png" alt="" style={{ width: '100%', height: '100%' }} /> <div style={{ width: 20, height: 20 }}>
</div> <img src="/assets/images/hrImg/export.png" alt="" style={{ width: '100%', height: '100%' }} />
<div style={{ marginLeft: 4, color: '#005ABD', fontSize: 13 }} > </div>
导出 <div style={{ marginLeft: 4, color: '#005ABD', fontSize: 13 }} >
</div> 导出
{ </div>
downloadUrl ? <iframe src={`/_api/${downloadUrl}`} style={{ display: 'none' }} /> : ''
} {
</div> downloadUrl ? <iframe src={`/_api/${downloadUrl}`} style={{ display: 'none' }} /> : ''
}
</div> : ''
}
</div> </div>
</div> </div>
<div style={{ display: 'flex', flexWrap: 'wrap', marginLeft: 30 }}> <div style={{ display: 'flex', flexWrap: 'wrap', marginLeft: 30 }}>

50
web/client/src/sections/humanAffairs/containers/personnelFilesDetail.jsx

@ -8,6 +8,7 @@ import DeleteModal from '../components/deleteModal';
import PersonnelModal from '../components/personnelModal'; import PersonnelModal from '../components/personnelModal';
import moment from 'moment' import moment from 'moment'
import { UserAttribute } from '$utils' import { UserAttribute } from '$utils'
import { isAuthorized } from '$utils'
import '../style.less' import '../style.less'
@ -147,14 +148,14 @@ const Rest = (props) => {
getWorkOption()// getWorkOption()//
getLeaveOption()// getLeaveOption()//
}, [startDate, endDate]) }, [startDate, endDate])
function peopleDetail () { function peopleDetail() {
dispatch(humanAffairs.getMemberList({ keywordTarget: 'number', keyword: history?.location?.search.slice(1).split('-')[0] })).then((res) => {// dispatch(humanAffairs.getMemberList({ keywordTarget: 'number', keyword: history?.location?.search.slice(1).split('-')[0] })).then((res) => {//
if (res.success) { if (res.success) {
setPepObj(res.payload?.data?.rows[0]) setPepObj(res.payload?.data?.rows[0])
} }
}) })
} }
function getWorkOption () {//线 function getWorkOption() {//线
let date = []; let date = [];
let showdate = [] let showdate = []
let showdate1 = [] let showdate1 = []
@ -278,7 +279,7 @@ const Rest = (props) => {
} }
}) })
} }
function getLeaveOption () {//线 function getLeaveOption() {//线
let date = []; let date = [];
let showdate = [] let showdate = []
dispatch(humanAffairs.getMemberVacate({ pepUserId: history?.location?.search.slice(1).split('-')[1], startDate: startDate, endDate: endDate })).then((res) => {// 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) { if (date.length > 1) {
setStartDate(moment(date[0]).format('YYYY-MM-DD')) setStartDate(moment(date[0]).format('YYYY-MM-DD'))
setEndDate(moment(date[1]).format('YYYY-MM-DD')) setEndDate(moment(date[1]).format('YYYY-MM-DD'))
@ -441,18 +442,23 @@ const Rest = (props) => {
<div style={{ fontFamily: "YouSheBiaoTiHei", fontSize: 24, color: '#033C9A', marginLeft: 8 }}>{pepObj?.userName}的个人档案</div> <div style={{ fontFamily: "YouSheBiaoTiHei", fontSize: 24, color: '#033C9A', marginLeft: 8 }}>{pepObj?.userName}的个人档案</div>
</div> </div>
<div style={{ display: 'flex', marginRight: 20 }}> <div style={{ display: 'flex', marginRight: 20 }}>
<div style={{ padding: '6px 20px', background: '#0F7EFB', color: '#FFFFFF', fontSize: 14, cursor: "pointer" }} {
onClick={() => { isAuthorized('EDITPROFILE') ? <div style={{ padding: '6px 20px', background: '#0F7EFB', color: '#FFFFFF', fontSize: 14, cursor: "pointer" }}
setPersonnelModal(true); onClick={() => {
}} setPersonnelModal(true);
> }}
编辑档案 >
</div> 编辑档案
<div style={{ padding: '6px 20px', background: '#FF5254', color: '#FFFFFF', fontSize: 14, cursor: "pointer", marginLeft: 20 }} </div> : ''
onClick={() => { setDeleteModal(true) }} }
> {
删除档案 isAuthorized('DELETEFILES') ? <div style={{ padding: '6px 20px', background: '#FF5254', color: '#FFFFFF', fontSize: 14, cursor: "pointer", marginLeft: 20 }}
</div> onClick={() => { setDeleteModal(true) }}
>
删除档案
</div> : ''
}
</div> </div>
</div> </div>
<div style={{ borderBottom: '1px solid #DCDEE0', margin: '16px 0px 16px -20px' }}></div> <div style={{ borderBottom: '1px solid #DCDEE0', margin: '16px 0px 16px -20px' }}></div>
@ -651,11 +657,11 @@ const Rest = (props) => {
</div> </div>
<div style={{ color: '#005ABD', fontSize: 13 }}> <div style={{ color: '#005ABD', fontSize: 13 }}>
{ {
pepObj.userJob? UserAttribute.jobDataSource[pepObj.userJob - 1] : '暂无' pepObj.userJob ? UserAttribute.jobDataSource[pepObj.userJob - 1] : '暂无'
} }
</div> </div>
</div> </div>
<div style={{ display: 'flex', width: '17.072%'}}> <div style={{ display: 'flex', width: '17.072%' }}>
<div style={{ color: 'rgba(0, 0, 0,0.6)', fontSize: 12, width: 60 }}> <div style={{ color: 'rgba(0, 0, 0,0.6)', fontSize: 12, width: 60 }}>
员工岗位 员工岗位
</div> </div>
@ -665,13 +671,13 @@ const Rest = (props) => {
} }
</div> </div>
</div> </div>
<div style={{ display: 'flex', width: '32.395%'}}> <div style={{ display: 'flex', width: '32.395%' }}>
<div style={{ color: 'rgba(0, 0, 0,0.6)', fontSize: 12, width: 84, textAlign: 'end' }}> <div style={{ color: 'rgba(0, 0, 0,0.6)', fontSize: 12, width: 84, textAlign: 'end' }}>
所属机构 所属机构
</div> </div>
<div style={{ color: '#4A4A4A', fontSize: 13 }}> <div style={{ color: '#4A4A4A', fontSize: 13 }}>
{ {
pepObj.userOrganization? UserAttribute.organizationDataSource[pepObj.userOrganization - 1] : '暂无' pepObj.userOrganization ? UserAttribute.organizationDataSource[pepObj.userOrganization - 1] : '暂无'
} }
</div> </div>
</div> </div>
@ -721,7 +727,7 @@ const Rest = (props) => {
入职年限 入职年限
</div> </div>
<div style={{ color: '#4A4A4A', fontSize: 13 }}> <div style={{ color: '#4A4A4A', fontSize: 13 }}>
{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) + '年' : '暂无'}
</div> </div>
</div> </div>
<div style={{ marginTop: 9, display: 'flex', width: '32.395%' }}> <div style={{ marginTop: 9, display: 'flex', width: '32.395%' }}>
@ -955,7 +961,7 @@ const Rest = (props) => {
) )
} }
function mapStateToProps (state) { function mapStateToProps(state) {
const { auth, global, members, webSocket } = state; const { auth, global, members, webSocket } = state;
return { return {
// loading: members.isRequesting, // loading: members.isRequesting,

50
web/client/src/sections/humanAffairs/containers/pmLog.jsx

@ -7,6 +7,7 @@ import '../style.less'
import { Setup } from "$components"; import { Setup } from "$components";
import moment from 'moment' import moment from 'moment'
import { getServiceUrl } from '../actions/service'; import { getServiceUrl } from '../actions/service';
import { isAuthorized } from '$utils'
const PMLog = (props) => { const PMLog = (props) => {
const { dispatch, actions, history, user, loading, socket } = props; const { dispatch, actions, history, user, loading, socket } = props;
@ -264,31 +265,34 @@ const PMLog = (props) => {
<img src="/assets/images/hrImg/newsetup.png" alt="" style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }} <img src="/assets/images/hrImg/newsetup.png" alt="" style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }}
onClick={() => setSetup(true)} onClick={() => setSetup(true)}
/> />
<Button theme='solid' {
type='primary' isAuthorized('EXPORTENGINEERINGLOG') ? <Button theme='solid'
style={{ width: 80, borderRadius: 2, height: 32, background: '#DBECFF', color: '#005ABD' }} type='primary'
// disable={btnDisable} style={{ width: 80, borderRadius: 2, height: 32, background: '#DBECFF', color: '#005ABD' }}
onClick={() => { // disable={btnDisable}
const weeklyRange = form.current.getValue("weeklyRange"); onClick={() => {
if (weeklyRange && weeklyRange.length == 2) { const weeklyRange = form.current.getValue("weeklyRange");
dispatch(getServiceUrl()).then(res => { if (weeklyRange && weeklyRange.length == 2) {
const { payload } = res; dispatch(getServiceUrl()).then(res => {
if (payload && payload.url) { const { payload } = res;
if (payload && payload.url) {
let url = `${payload.url}/week_report/week`; let url = `${payload.url}/week_report/week`;
if (weeklyRange && weeklyRange.length == 2) { 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=pm` url += `?start=${moment(weeklyRange[0]).format('YYYY-MM-DD HH:mm:ss')}&end=${moment(weeklyRange[1]).format('YYYY-MM-DD HH:mm:ss')}&type=pm`
}
console.log(url);
setDownloadUrl(url);
} else {
setWarningBanner("导出地址有误,导出失败");
} }
console.log(url); })
setDownloadUrl(url); } else {
} else { setWarningBanner("请选择查询时间范围");
setWarningBanner("导出地址有误,导出失败"); }
} }}>导出</Button> : ''
}) }
} else {
setWarningBanner("请选择查询时间范围");
}
}}>导出</Button>
</div> </div>
</div> </div>
</div> </div>

17
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 { Table, Button, Pagination, Skeleton, Popconfirm, Tooltip } from '@douyinfe/semi-ui';
import { SkeletonScreen, Setup } from "$components"; import { SkeletonScreen, Setup } from "$components";
import ImportPositionRatingModal from '../components/importPositionRating'; import ImportPositionRatingModal from '../components/importPositionRating';
import { isAuthorized } from '$utils'
import '../style.less'; import '../style.less';
const PositionRating = (props) => { const PositionRating = (props) => {
@ -198,12 +199,18 @@ const PositionRating = (props) => {
</div> </div>
<div style={{ marginRight: 20, marginTop: 18 }}> <div style={{ marginRight: 20, marginTop: 18 }}>
<div style={{ display: 'flex', margin: '16px 0px', justifyContent: 'flex-end' }}> <div style={{ display: 'flex', margin: '16px 0px', justifyContent: 'flex-end' }}>
{
}
<div style={{ display: 'flex', marginRight: 20 }}> <div style={{ display: 'flex', marginRight: 20 }}>
<div style={{ padding: '6px 20px', background: '#0F7EFB', color: '#FFFFFF', fontSize: 14, cursor: "pointer" }} {
onClick={() => { handleImportModal(); }} isAuthorized('IMPORTJOBRATINGS') ? <div style={{ padding: '6px 20px', background: '#0F7EFB', color: '#FFFFFF', fontSize: 14, cursor: "pointer" }}
> onClick={() => { handleImportModal(); }}
导入 >
</div> 导入
</div> : ''
}
</div> </div>
</div> </div>
<div style={{ border: '1px solid #C7E1FF', background: '#F4F8FF', borderRadius: 2, height: 32, width: 669, padding: '8px 0px 7px 12px', display: 'flex', alignItems: 'center', color: '#0F7EFB', fontSize: 12 }}> <div style={{ border: '1px solid #C7E1FF', background: '#F4F8FF', borderRadius: 2, height: 32, width: 669, padding: '8px 0px 7px 12px', display: 'flex', alignItems: 'center', color: '#0F7EFB', fontSize: 12 }}>

3
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 { SkeletonScreen } from "$components";
import '../style.less' import '../style.less'
import moment from 'moment' import moment from 'moment'
import { isAuthorized } from '$utils'
const Quarter = (props) => { const Quarter = (props) => {
const [year, setYear] = useState(null) const [year, setYear] = useState(null)
@ -62,7 +63,7 @@ const Quarter = (props) => {
width: 120, width: 120,
render: (text, record) => { render: (text, record) => {
return <div> return <div>
<span onClick={() => exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载</span> {isAuthorized('DOWNLOADMIDLEVELQUARTERLYASSESSMENT')?<span onClick={() => exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载</span>:''}
</div> </div>
} }
}]; }];

4
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 { SkeletonScreen } from "$components";
import moment from 'moment' import moment from 'moment'
import '../style.less' import '../style.less'
import { isAuthorized } from '$utils'
const RegularKPI = (props) => { const RegularKPI = (props) => {
const [year, setYear] = useState(null) const [year, setYear] = useState(null)
@ -62,7 +63,8 @@ const RegularKPI = (props) => {
width: 120, width: 120,
render: (text, record) => { render: (text, record) => {
return <div> return <div>
<span onClick={() => exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载</span>
{isAuthorized('DOWNLOADOFFICIALEMPLOYEEASSESSMENT') ? <span onClick={() => exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载</span>:''}
</div> </div>
} }
}]; }];

19
web/client/src/sections/humanAffairs/containers/resourceRepository.jsx

@ -9,6 +9,7 @@ import {
} from '../actions/resourceRepository'; } from '../actions/resourceRepository';
import FolderModal from '../components/resourceRepository/folder-model'; import FolderModal from '../components/resourceRepository/folder-model';
import ResourceUploadModal from '../components/resourceRepository/upload-modal'; import ResourceUploadModal from '../components/resourceRepository/upload-modal';
import { isAuthorized } from '$utils'
import '../style.less'; import '../style.less';
const ResourceRepository = (props) => { const ResourceRepository = (props) => {
@ -56,8 +57,12 @@ const ResourceRepository = (props) => {
render: (text, record) => { render: (text, record) => {
return <div style={{ color: "#1890FF" }}> return <div style={{ color: "#1890FF" }}>
<Space> <Space>
<a href={'/_file-server/' + record.attachPath + '?filename=' + encodeURIComponent(record.fileName + record.fileType)}>下载</a> {
{currentSelect.includes("公司培训资料") && isAuthorized('DOWNLOADTRAININGMATERIALS') ? <a href={'/_file-server/' + record.attachPath + '?filename=' + encodeURIComponent(record.fileName + record.fileType)}>下载</a> : ''
}
{
isAuthorized('DELETETRAININGMATERIALS')?currentSelect.includes("公司培训资料") &&
<Popconfirm <Popconfirm
style={{ minWidth: "max-content" }} style={{ minWidth: "max-content" }}
title="提示" title="提示"
@ -66,7 +71,8 @@ const ResourceRepository = (props) => {
position={"leftBottom"} position={"leftBottom"}
> >
<a style={{ cursor: 'pointer' }}>删除</a> <a style={{ cursor: 'pointer' }}>删除</a>
</Popconfirm>} </Popconfirm>:''
}
</Space> </Space>
</div> </div>
} }
@ -238,6 +244,9 @@ const ResourceRepository = (props) => {
<Row className='resourceRepository'> <Row className='resourceRepository'>
{/* 左侧 */} {/* 左侧 */}
<Col className='left' span={6}> <Col className='left' span={6}>
{
isAuthorized('FOLDERMANAGEMENT') ? <Button theme='solid' type='primary' onClick={() => handleFolderClick("新建", false)}>新建文件夹</Button> : ''
}
<Button theme='solid' type='primary' onClick={() => handleFolderClick("新建", false)}>新建文件夹</Button> <Button theme='solid' type='primary' onClick={() => handleFolderClick("新建", false)}>新建文件夹</Button>
<br /> <br />
<Input suffix={<IconSearch />} showClear onChange={v => ref.current.search(v)} placeholder="请输入"></Input> <Input suffix={<IconSearch />} showClear onChange={v => ref.current.search(v)} placeholder="请输入"></Input>
@ -262,9 +271,9 @@ const ResourceRepository = (props) => {
<Row> <span className="path-lable"><strong>当前文件夹{currentSelect}</strong></span></Row> <Row> <span className="path-lable"><strong>当前文件夹{currentSelect}</strong></span></Row>
<Row className='search'> <Row className='search'>
<Space> <Space>
{currentSelect && currentSelect.includes("公司培训资料") && currentSelect.split("/").length == 3 ? {isAuthorized('UPLOADTRAININGMATERIALS') ? currentSelect && currentSelect.includes("公司培训资料") && currentSelect.split("/").length == 3 ?
<Button theme='solid' type='primary' onClick={() => { setUploadModalVisiable(true) }} >上传文件</Button> <Button theme='solid' type='primary' onClick={() => { setUploadModalVisiable(true) }} >上传文件</Button>
: null} : null : ''}
<span className='search-label'>关键字</span> <span className='search-label'>关键字</span>
<Input <Input
style={{ width: 160 }} style={{ width: 160 }}

48
web/client/src/sections/humanAffairs/containers/saleLog.jsx

@ -7,6 +7,7 @@ import '../style.less'
import { Setup } from "$components"; import { Setup } from "$components";
import moment from 'moment' import moment from 'moment'
import { getServiceUrl } from '../actions/service'; import { getServiceUrl } from '../actions/service';
import { isAuthorized } from '$utils'
const SaleLog = (props) => { const SaleLog = (props) => {
const { dispatch, actions, history, user, loading, socket } = props; const { dispatch, actions, history, user, loading, socket } = props;
@ -264,31 +265,32 @@ const SaleLog = (props) => {
<img src="/assets/images/hrImg/newsetup.png" alt="" style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }} <img src="/assets/images/hrImg/newsetup.png" alt="" style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }}
onClick={() => setSetup(true)} onClick={() => setSetup(true)}
/> />
<Button theme='solid' {
type='primary' isAuthorized('EXPORTSALESLOG') ? <Button theme='solid'
style={{ width: 80, borderRadius: 2, height: 32, background: '#DBECFF', color: '#005ABD' }} type='primary'
// disable={btnDisable} style={{ width: 80, borderRadius: 2, height: 32, background: '#DBECFF', color: '#005ABD' }}
onClick={() => { // disable={btnDisable}
const weeklyRange = form.current.getValue("weeklyRange"); onClick={() => {
if (weeklyRange && weeklyRange.length == 2) { const weeklyRange = form.current.getValue("weeklyRange");
dispatch(getServiceUrl()).then(res => { if (weeklyRange && weeklyRange.length == 2) {
const { payload } = res; dispatch(getServiceUrl()).then(res => {
if (payload && payload.url) { const { payload } = res;
if (payload && payload.url) {
let url = `${payload.url}/week_report/week`; let url = `${payload.url}/week_report/week`;
if (weeklyRange && weeklyRange.length == 2) { 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` 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 {
} else { setWarningBanner("请选择查询时间范围");
setWarningBanner("导出地址有误,导出失败"); }
} }}>导出</Button> : ''}
})
} else {
setWarningBanner("请选择查询时间范围");
}
}}>导出</Button>
</div> </div>
</div> </div>
</div> </div>

36
web/client/src/sections/humanAffairs/containers/salersDistribution/personnelDistribution.jsx

@ -6,6 +6,7 @@ import SalesMemberModal from './salesMemberModal'
import ImportSalersModal from './importSalersModal' import ImportSalersModal from './importSalersModal'
import { IconSearch } from '@douyinfe/semi-icons'; import { IconSearch } from '@douyinfe/semi-icons';
import { SkeletonScreen } from "$components"; import { SkeletonScreen } from "$components";
import { isAuthorized } from '$utils'
import '../../style.less' import '../../style.less'
const PersonnelDistribution = (props) => { const PersonnelDistribution = (props) => {
@ -38,7 +39,7 @@ const PersonnelDistribution = (props) => {
let kt = keywordTarget == 'place' ? '' : keywordTarget; let kt = keywordTarget == 'place' ? '' : keywordTarget;
let k = keywordTarget == 'place' ? '' : keyword; let k = keywordTarget == 'place' ? '' : keyword;
let placeSearch = 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) { if (r.success) {
setTableData(r.payload?.data?.rows); setTableData(r.payload?.data?.rows);
setLimits(r.payload?.data?.count) setLimits(r.payload?.data?.count)
@ -118,12 +119,12 @@ const PersonnelDistribution = (props) => {
let arrStr = text.map(t => t.name); let arrStr = text.map(t => t.name);
return getMultis(arrStr); return getMultis(arrStr);
} }
},{ }, {
title: '在职状态', title: '在职状态',
dataIndex: 'userActiveStatus', dataIndex: 'userActiveStatus',
key: 'userActiveStatus', key: 'userActiveStatus',
width: 200, width: 200,
render: (text, r, index) => text == '1'?'在职':text == '2'?'离职':'特殊账号-特殊状态' render: (text, r, index) => text == '1' ? '在职' : text == '2' ? '离职' : '特殊账号-特殊状态'
}, { }, {
title: '销售区域(省/直辖市)', title: '销售区域(省/直辖市)',
dataIndex: 'provinces', dataIndex: 'provinces',
@ -221,13 +222,17 @@ const PersonnelDistribution = (props) => {
<div style={{ margin: '18px 0px' }}> <div style={{ margin: '18px 0px' }}>
<div style={{ display: 'flex', margin: '16px 0px', justifyContent: 'space-between' }}> <div style={{ display: 'flex', margin: '16px 0px', justifyContent: 'space-between' }}>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<div style={{ padding: '6px 20px', background: '#0F7EFB', color: '#FFFFFF', fontSize: 14, cursor: "pointer", marginRight: 18 }} {
onClick={() => {
setModalV(true); isAuthorized('ADDSALESPERSONNEL') ? <div style={{ padding: '6px 20px', background: '#0F7EFB', color: '#FFFFFF', fontSize: 14, cursor: "pointer", marginRight: 18 }}
setDataToEdit(null); onClick={() => {
}}> setModalV(true);
新增 setDataToEdit(null);
</div> }}>
新增
</div> : ''
}
<div> <div>
<Select value={keywordTarget} onChange={setKeywordTarget} style={{ width: 100 }} > <Select value={keywordTarget} onChange={setKeywordTarget} style={{ width: 100 }} >
<Select.Option value='dep'>部门</Select.Option> <Select.Option value='dep'>部门</Select.Option>
@ -256,10 +261,13 @@ const PersonnelDistribution = (props) => {
}}>查询</Button> }}>查询</Button>
</div> </div>
<div style={{ display: 'flex', marginRight: 20 }}> <div style={{ display: 'flex', marginRight: 20 }}>
<div style={{ padding: '6px 20px', background: '#0F7EFB', color: '#FFFFFF', fontSize: 14, cursor: "pointer" }} {
onClick={() => { setImportModalV(true); }}> isAuthorized('IMPORTSALESPERSONNELDISTRIBUTION') ? <div style={{ padding: '6px 20px', background: '#0F7EFB', color: '#FFFFFF', fontSize: 14, cursor: "pointer" }}
导入 onClick={() => { setImportModalV(true); }}>
</div> 导入
</div> : ''
}
{/* <div style={{ padding: '6px 20px', background: '#00BA85', color: '#FFFFFF', fontSize: 14, marginLeft: 18 }}> {/* <div style={{ padding: '6px 20px', background: '#00BA85', color: '#FFFFFF', fontSize: 14, marginLeft: 18 }}>
导出 导出
</div> */} </div> */}

50
web/client/src/sections/humanAffairs/containers/weeklyManagement.jsx

@ -7,6 +7,7 @@ import '../style.less'
import { Setup } from "$components"; import { Setup } from "$components";
import moment from 'moment' import moment from 'moment'
import { getServiceUrl } from '../actions/service'; import { getServiceUrl } from '../actions/service';
import { isAuthorized } from '$utils'
const WeeklyManagement = (props) => { const WeeklyManagement = (props) => {
const { dispatch, actions, history, user, loading, socket, xqMembers } = props; const { dispatch, actions, history, user, loading, socket, xqMembers } = props;
@ -289,31 +290,34 @@ const WeeklyManagement = (props) => {
<img src="/assets/images/hrImg/newsetup.png" alt="" style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }} <img src="/assets/images/hrImg/newsetup.png" alt="" style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }}
onClick={() => setSetup(true)} onClick={() => setSetup(true)}
/> />
<Button theme='solid' {
type='primary' isAuthorized('EXPORTWEEKLYREPORT') ? <Button theme='solid'
style={{ width: 80, borderRadius: 2, height: 32, background: '#DBECFF', color: '#005ABD' }} type='primary'
// disable={btnDisable} style={{ width: 80, borderRadius: 2, height: 32, background: '#DBECFF', color: '#005ABD' }}
onClick={() => { // disable={btnDisable}
const weeklyRange = form.current.getValue("weeklyRange"); onClick={() => {
if (weeklyRange && weeklyRange.length == 2) { const weeklyRange = form.current.getValue("weeklyRange");
dispatch(getServiceUrl()).then(res => { if (weeklyRange && weeklyRange.length == 2) {
const { payload } = res; dispatch(getServiceUrl()).then(res => {
if (payload && payload.url) { const { payload } = res;
if (payload && payload.url) {
let url = `${payload.url}/week_report/week`; let url = `${payload.url}/week_report/week`;
if (weeklyRange && weeklyRange.length == 2) { 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` 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 {
} else { setWarningBanner("请选择查询时间范围");
setWarningBanner("导出地址有误,导出失败"); }
} }}>导出</Button> : ''
}) }
} else {
setWarningBanner("请选择查询时间范围");
}
}}>导出</Button>
</div> </div>
</div> </div>
</div> </div>

230
web/client/src/sections/humanAffairs/nav-item.jsx

@ -1,138 +1,186 @@
import React from 'react'; import React from 'react';
import { IconCode } from '@douyinfe/semi-icons'; import { IconCode } from '@douyinfe/semi-icons';
import { isAuthorized } from '$utils'
export function getNavItem(user, dispatch) { export function getNavItem(user, dispatch) {
return ( let hrUser = JSON.parse(sessionStorage.getItem('hrUser'))
[ let admin = false
{ hrUser && hrUser.adminHr.forEach(e => {
itemKey: 'humanAffairs', if (e.id == hrUser.id) {
text: '人事管理', admin = true
icon: <IconCode />, }
items: [{ })
let list = [
{
itemKey: 'humanAffairs',
text: '人事管理',
icon: <IconCode />,
items: [
isAuthorized('PERSONNELFILEMANAGEMENT') ? {
itemKey: 'personnelArchives', itemKey: 'personnelArchives',
text: '人员档案', text: '人员档案',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconcbrengongdangan"></iconpark-icon>, icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconcbrengongdangan"></iconpark-icon>,
to: '/humanAffairs/archivesCenter/personnelArchives/personnelFiles', to: '/humanAffairs/archivesCenter/personnelArchives/personnelFiles',
items: [{ items: [
itemKey: 'personnelFiles', to: '/humanAffairs/archivesCenter/personnelArchives/personnelFiles', text: '人员档案' isAuthorized('PERSONNELFILES') ? {
}, { itemKey: 'personnelFiles', to: '/humanAffairs/archivesCenter/personnelArchives/personnelFiles', text: '人员档案'
itemKey: 'employeeInformation', to: '/humanAffairs/archivesCenter/personnelArchives/employeeInformation', text: '员工信息' } : {},
}, { isAuthorized('EMPLOYEEINFORMATION') ? {
itemKey: 'positionRating', to: '/humanAffairs/archivesCenter/personnelArchives/positionRating', text: '岗位评级' itemKey: 'employeeInformation', to: '/humanAffairs/archivesCenter/personnelArchives/employeeInformation', text: '员工信息'
}] } : {},
}, { isAuthorized('JOBRATING') ? {
itemKey: 'positionRating', to: '/humanAffairs/archivesCenter/personnelArchives/positionRating', text: '岗位评级'
} : {}]
} : {},
isAuthorized('DEPARTMENTARCHIVESMANAGEMENT') ? {
itemKey: 'deptArchives', itemKey: 'deptArchives',
text: '部门档案', text: '部门档案',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconcbbumen"></iconpark-icon>, icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconcbbumen"></iconpark-icon>,
to: '/humanAffairs/archivesCenter/deptArchives/department', to: '/humanAffairs/archivesCenter/deptArchives/department',
items: [{ items: [
itemKey: 'department', to: '/humanAffairs/archivesCenter/deptArchives/department', text: '部门档案' isAuthorized('DEPARTMENTARCHIVES') ? {
}] itemKey: 'department', to: '/humanAffairs/archivesCenter/deptArchives/department', text: '部门档案'
}, { } : {}]
} : {},
isAuthorized('LEAVEMANAGEMENT') ? {
itemKey: 'leaveManagement', itemKey: 'leaveManagement',
text: '假勤管理', text: '假勤管理',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconcbjiaqinguanli"></iconpark-icon>, icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconcbjiaqinguanli"></iconpark-icon>,
to: '/humanAffairs/employeeRelationship/leaveManagement/attendanceStatistics', to: '/humanAffairs/employeeRelationship/leaveManagement/attendanceStatistics',
items: [{ items: [
itemKey: 'attendanceStatistics', to: '/humanAffairs/employeeRelationship/leaveManagement/attendanceStatistics', text: '出勤统计' isAuthorized('ATTENDANCESTATISTICS') ? {
}, { itemKey: 'attendanceStatistics', to: '/humanAffairs/employeeRelationship/leaveManagement/attendanceStatistics', text: '出勤统计'
itemKey: 'leaveStatistics', to: '/humanAffairs/employeeRelationship/leaveManagement/leaveStatistics', text: '请假统计' } : {},
}, { isAuthorized('LEAVESTATISTICS') ? {
itemKey: 'overtimeStatistics', to: '/humanAffairs/employeeRelationship/leaveManagement/overtimeStatistics', text: '加班统计' itemKey: 'leaveStatistics', to: '/humanAffairs/employeeRelationship/leaveManagement/leaveStatistics', text: '请假统计'
}] } : {},
}, { isAuthorized('OVERTIMESTATISTICS') ? {
itemKey: 'overtimeStatistics', to: '/humanAffairs/employeeRelationship/leaveManagement/overtimeStatistics', text: '加班统计'
} : {}]
} : {},
isAuthorized('EMPLOYEECOMMUNICATION') ? {
itemKey: 'communication', itemKey: 'communication',
text: '员工沟通', text: '员工沟通',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconyuangonggoutong"></iconpark-icon>, icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconyuangonggoutong"></iconpark-icon>,
to: '/humanAffairs/employeeRelationship/communication/employeeCommunication', to: '/humanAffairs/employeeRelationship/communication/employeeCommunication',
items: [{ items: [
itemKey: 'employeeCommunication', to: '/humanAffairs/employeeRelationship/communication/employeeCommunication', text: '员工沟通统计' isAuthorized('EMPLOYEECOMMUNICATIONSTATISTICS') ? {
}] itemKey: 'employeeCommunication', to: '/humanAffairs/employeeRelationship/communication/employeeCommunication', text: '员工沟通统计'
}, { } : {}
]
} : {},
isAuthorized('RECRUITMENTRECORDS') ? {
itemKey: 'recruitRecord', itemKey: 'recruitRecord',
text: '招聘记录', text: '招聘记录',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconcbzhaopin"></iconpark-icon>, icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconcbzhaopin"></iconpark-icon>,
to: '/humanAffairs/recruit/recruitRecord/appointmentRecords', to: '/humanAffairs/recruit/recruitRecord/appointmentRecords',
items: [{ items: [
itemKey: 'appointmentRecords', to: '/humanAffairs/recruit/recruitRecord/appointmentRecords', text: '任用记录' isAuthorized('APPOINTMENTRECORD') ? {
}] itemKey: 'appointmentRecords', to: '/humanAffairs/recruit/recruitRecord/appointmentRecords', text: '任用记录'
}, { } : {}
]
} : {},
isAuthorized('SALESSTATISTICS') ? {
itemKey: 'salesStatistics', itemKey: 'salesStatistics',
text: '销售统计', text: '销售统计',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconxiaoshou"></iconpark-icon>,//wwwtodo icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconxiaoshou"></iconpark-icon>,//wwwtodo
to: '/humanAffairs/recruit/salesStatistics/personnelDistribution', to: '/humanAffairs/recruit/salesStatistics/personnelDistribution',
items: [{ items: [
itemKey: 'personnelDistribution', to: '/humanAffairs/recruit/salesStatistics/personnelDistribution', text: '销售人员分布' isAuthorized('SALESPERSONNELDISTRIBUTION') ? {
}] itemKey: 'personnelDistribution', to: '/humanAffairs/recruit/salesStatistics/personnelDistribution', text: '销售人员分布'
}, { } : {}
]
} : {},
isAuthorized('TRAININGDOSSIER') ? {
itemKey: 'trainFiles', itemKey: 'trainFiles',
text: '培训档案', text: '培训档案',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconcbpeixundangan"></iconpark-icon>, icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconcbpeixundangan"></iconpark-icon>,
to: '/humanAffairs/train/trainFiles/resourceRepository', to: '/humanAffairs/train/trainFiles/resourceRepository',
items: [{ items: [
itemKey: 'resourceRepository', to: '/humanAffairs/train/trainFiles/resourceRepository', text: '培训资源储存库' isAuthorized('TRAININGRESOURCEREPOSITORY') ? {
}] itemKey: 'resourceRepository', to: '/humanAffairs/train/trainFiles/resourceRepository', text: '培训资源储存库'
}, { } : {}
]
} : {},
isAuthorized('TRAININGMANAGEMENT') ? {
itemKey: 'trainingManagement', itemKey: 'trainingManagement',
text: '培训管理', text: '培训管理',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="peixgl"></iconpark-icon>, icon: <iconpark-icon style={{ width: 20, height: 20 }} name="peixgl"></iconpark-icon>,
to: '/humanAffairs/train/trainingManagement/personalTrainRecord', to: '/humanAffairs/train/trainingManagement/personalTrainRecord',
items: [{ items: [
itemKey: 'personalTrainRecord', to: '/humanAffairs/train/trainingManagement/personalTrainRecord', text: '个人培训记录' isAuthorized('PERSONALTRAININGRECORDS') ? {
}, { itemKey: 'personalTrainRecord', to: '/humanAffairs/train/trainingManagement/personalTrainRecord', text: '个人培训记录'
itemKey: 'departmentTrainRecord', to: '/humanAffairs/train/trainingManagement/departmentTrainRecord', text: '部门培训记录' } : {},
}] isAuthorized('DEPARTMENTTRAININGRECORDS') ? {
}, { itemKey: 'departmentTrainRecord', to: '/humanAffairs/train/trainingManagement/departmentTrainRecord', text: '部门培训记录'
} : {}]
} : {},
isAuthorized('BASICACTIONMANAGEMENT') ? {
itemKey: 'basicAction', itemKey: 'basicAction',
text: '基本动作', text: '基本动作',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconcbjiben"></iconpark-icon>, icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconcbjiben"></iconpark-icon>,
to: '/humanAffairs/achievements/basicAction/weeklyManagement', to: '/humanAffairs/achievements/basicAction/weeklyManagement',
items: [{ items: [
itemKey: 'weeklyManagement', to: '/humanAffairs/achievements/basicAction/weeklyManagement', text: '周报管理' isAuthorized('WEEKLYREPORTMANAGEMENT') ? {
}, { itemKey: 'weeklyManagement', to: '/humanAffairs/achievements/basicAction/weeklyManagement', text: '周报管理'
itemKey: 'saleLog', to: '/humanAffairs/achievements/basicAction/saleLog', text: '销售日志' } : {},
}, { isAuthorized('SALESLOG') ? {
itemKey: 'pmLog', to: '/humanAffairs/achievements/basicAction/pmLog', text: '工程日志' itemKey: 'saleLog', to: '/humanAffairs/achievements/basicAction/saleLog', text: '销售日志'
}] } : {},
}, { isAuthorized('ENGINEERINGLOG') ? {
itemKey: 'pmLog', to: '/humanAffairs/achievements/basicAction/pmLog', text: '工程日志'
} : {}]
} : {},
isAuthorized('EMPLOYEEASSESSMENT') ? {
itemKey: 'employeeKPI', itemKey: 'employeeKPI',
text: '员工考核', text: '员工考核',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconcbyuangongkaohe"></iconpark-icon>, icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconcbyuangongkaohe"></iconpark-icon>,
to: '/humanAffairs/achievements/employeeKPI/probationer', to: '/humanAffairs/achievements/employeeKPI/probationer',
items: [{ items: [
itemKey: 'probationer', to: '/humanAffairs/achievements/employeeKPI/probationer', text: '试用期员工考核' isAuthorized('EMPLOYEEASSESSMENTDURINGPROBATIONARYPERIOD') ? {
}, { itemKey: 'probationer', to: '/humanAffairs/achievements/employeeKPI/probationer', text: '试用期员工考核'
itemKey: 'regular', to: '/humanAffairs/achievements/employeeKPI/regular', text: '正式员工考核' } : {},
}] isAuthorized('FORMALEMPLOYEEASSESSMENT') ? {
}, { itemKey: 'regular', to: '/humanAffairs/achievements/employeeKPI/regular', text: '正式员工考核'
} : {}]
} : {},
isAuthorized('MIDDLELEVELASSESSMENT') ? {
itemKey: 'middleKPI', itemKey: 'middleKPI',
text: '中层考核', text: '中层考核',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconcbzhongceng"></iconpark-icon>, icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconcbzhongceng"></iconpark-icon>,
to: '/humanAffairs/achievements/middleKPI/monthlyProcess', to: '/humanAffairs/achievements/middleKPI/monthlyProcess',
items: [{ items: [
itemKey: 'monthlyProcess', to: '/humanAffairs/achievements/middleKPI/monthlyProcess', text: '月度过程考核' isAuthorized('MIDDLELEVELMONTHLYPROCESSASSESSMENT') ? {
}, { itemKey: 'monthlyProcess', to: '/humanAffairs/achievements/middleKPI/monthlyProcess', text: '月度过程考核'
itemKey: 'quarter', to: '/humanAffairs/achievements/middleKPI/quarter', text: '季度考核' } : {},
}] isAuthorized('MIDLEVELQUARTERLYASSESSMENT') ? {
}, { itemKey: 'quarter', to: '/humanAffairs/achievements/middleKPI/quarter', text: '季度考核'
} : {}]
} : {},
isAuthorized('SENIORASSESSMENT') ? {
itemKey: 'highKPI', itemKey: 'highKPI',
text: '高管考核', text: '高管考核',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconcbgaojiguanli"></iconpark-icon>, icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconcbgaojiguanli"></iconpark-icon>,
to: '/humanAffairs/achievements/highKPI/highMonthly', to: '/humanAffairs/achievements/highKPI/highMonthly',
items: [{ items: [
itemKey: 'highMonthly', to: '/humanAffairs/achievements/highKPI/highMonthly', text: '月度过程考核' isAuthorized('MONTHLYPROCESSASSESSMENTFORSENIORMANAGEMENT') ? {
},{ itemKey: 'highMonthly', to: '/humanAffairs/achievements/highKPI/highMonthly', text: '月度过程考核'
itemKey: 'Highquarter', to: '/humanAffairs/achievements/highKPI/Highquarter', text: '季度考核' } : {},
}] isAuthorized('QUARTERLYASSESSMENTOFSENIORMANAGEMENT') ? {
}, { itemKey: 'Highquarter', to: '/humanAffairs/achievements/highKPI/Highquarter', text: '季度考核'
} : {}]
} : {},
isAuthorized('REWARDANDPUNISHMENTMANAGEMENT') ? {
itemKey: 'penalties', itemKey: 'penalties',
text: '奖惩信息', text: '奖惩信息',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconcbjiangcheng"></iconpark-icon>, icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconcbjiangcheng"></iconpark-icon>,
to: '/humanAffairs/achievements/penalties/penaltiesRecord', to: '/humanAffairs/achievements/penalties/penaltiesRecord',
items: [{ items: [
itemKey: 'penaltiesRecord', to: '/humanAffairs/achievements/penalties/penaltiesRecord', text: '奖惩信息' isAuthorized('REWARDANDPUNISHMENTINFORMATION') ? {
}] itemKey: 'penaltiesRecord', to: '/humanAffairs/achievements/penalties/penaltiesRecord', text: '奖惩信息'
}, { } : {}]
} : {},
admin ? {
itemKey: 'authCenter', itemKey: 'authCenter',
text: '权限中心', text: '权限中心',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconcbquanxian"></iconpark-icon>, icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconcbquanxian"></iconpark-icon>,
@ -142,8 +190,24 @@ export function getNavItem(user, dispatch) {
}, { }, {
itemKey: 'formMaintenance', to: '/humanAffairs/authCenter/formMaintenance', text: '表单维护' 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
} }

4
web/client/src/utils/func.js

@ -1,8 +1,8 @@
'use strict'; 'use strict';
export const isAuthorized = (authcode) => { export const isAuthorized = (authcode) => {
if (JSON.parse(sessionStorage.getItem('user'))) { if (JSON.parse(sessionStorage.getItem('userResource'))) {
const { resources } = JSON.parse(sessionStorage.getItem('hrUser')); const resources = JSON.parse(sessionStorage.getItem('userResource'));
return resources.includes(authcode); return resources.includes(authcode);
} else { } else {
return false; return false;

19
web/client/src/utils/webapi.js

@ -67,15 +67,16 @@ export const ApiTable = {
getemployeeAssessmentList: 'employessAssessment/list/{type}', getemployeeAssessmentList: 'employessAssessment/list/{type}',
//权限 //权限
getRoleList:'role/list', getRoleList: 'role/list',
addRole:'role/add', addRole: 'role/add',
editRole:'role/edit', editRole: 'role/edit',
delRole:'role/del', delRole: 'role/del',
getUserRoleList:'roleUser/list', getUserRoleList: 'roleUser/list',
addUserRole:'roleUser/add', addUserRole: 'roleUser/add',
getResource:'resource/list', getResource: 'resource/list',
getRoleResource:'roleResource/list', getRoleResource: 'roleResource/list',
addRoleResource:'roleResource/add', addRoleResource: 'roleResource/add',
getUserResource: 'user/{userId}/role/resources',
// 请假统计添加备注 // 请假统计添加备注
createVacateRemark: 'attendance/vacate/creat/remark' createVacateRemark: 'attendance/vacate/creat/remark'

Loading…
Cancel
Save