diff --git a/pc4mobx/organization/apis/newImport.js b/pc4mobx/organization/apis/newImport.js index e334637..eac6738 100644 --- a/pc4mobx/organization/apis/newImport.js +++ b/pc4mobx/organization/apis/newImport.js @@ -1,5 +1,10 @@ import { WeaTools } from 'ecCom' +//导入页面权限 +export const getHasRight = () => { + return WeaTools.callApi(`/api/bs/hrmorganization/commonimport/getHasRight`, 'GET'); +} + //选择导入字段 export const getImportFields = (params) => { return WeaTools.callApi(`/api/bs/hrmorganization/commonimport/getImportFields`, 'GET', params); diff --git a/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js b/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js index c2812e6..26239ac 100644 --- a/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js +++ b/pc4mobx/organization/components/fieldDefinedSet/FieldDefined.js @@ -87,7 +87,8 @@ export default class FieldDefined extends Component { } = this.props, { //containerInitFinished,//权限验证 refreshMainTabComponent, - spinning + spinning, + hasRight } = store, { type: moduleType } = params, { @@ -143,7 +144,6 @@ export default class FieldDefined extends Component { } } let children = []; - const hasRight = true;//todo if (hasRight) { const { data, diff --git a/pc4mobx/organization/components/newImport/index.js b/pc4mobx/organization/components/newImport/index.js index 07a5237..8ce9ed4 100644 --- a/pc4mobx/organization/components/newImport/index.js +++ b/pc4mobx/organization/components/newImport/index.js @@ -21,6 +21,8 @@ import { import '../../style/import.css'; import { addContentPath } from '../../util/index.js'; import StepDialog from './stepDialog'; +import { renderNoright } from '../../util'; + @inject("newImport") @@ -34,12 +36,14 @@ export default class newImport extends React.Component { }) } - componentWillMount() { - + componentDidMount() { + const {newImport} = this.props; + newImport.getHasRight(); } - componentDidMount() { + componentWillMount() { + } @@ -120,13 +124,18 @@ export default class newImport extends React.Component { const { newImport, } = this.props, { - visible + visible, + hasRight } = newImport, { title, } = this.state; + if (hasRight === false) { + return renderNoright(); + } + return ( - } iconBgcolor='#217346' diff --git a/pc4mobx/organization/components/office/officeManage.js b/pc4mobx/organization/components/office/officeManage.js index b8e2535..34b4587 100644 --- a/pc4mobx/organization/components/office/officeManage.js +++ b/pc4mobx/organization/components/office/officeManage.js @@ -422,7 +422,7 @@ export default class OfficeManage extends Component { } return ( -
+ hasRight &&
{ tabConfig.activeTabKey = key || tabConfig.tabs[0].viewCondition; const tabIndex = this.getTabIndex(this.tabConfig.tabs, key); @@ -697,6 +698,7 @@ export class FieldDefinedStore extends HrmBaseStore { datas, selectedData } = this.convertData(res.data.data, 'fieldDef'); + this.hasRight = res.data.hasRight; this.encryptEnable = res.data.encryptEnable; this.tableEditConfig.fieldDef.datas = datas; this.tableEditConfig.fieldDef.columns = this.getColumns(); diff --git a/pc4mobx/organization/stores/jobgrade.js b/pc4mobx/organization/stores/jobgrade.js index 242e4a8..0a69083 100644 --- a/pc4mobx/organization/stores/jobgrade.js +++ b/pc4mobx/organization/stores/jobgrade.js @@ -48,7 +48,7 @@ export class JobGradeStore { @observable topTab = []; @observable topTabCount = {}; @observable lastime = '';// - @observable hasRight = true; + @observable hasRight = ''; @observable treeLoading = true; @observable treeConfig = { diff --git a/pc4mobx/organization/stores/newImport.js b/pc4mobx/organization/stores/newImport.js index fe64764..8ff836e 100644 --- a/pc4mobx/organization/stores/newImport.js +++ b/pc4mobx/organization/stores/newImport.js @@ -40,6 +40,19 @@ import { export class newImportStore { + @observable hasRight = ''; + @action getHasRight(){ + API.getHasRight().then(res => { + if(res.code == 200) { + this.hasRight = res.data.hasRight; + }else { + message.warning(res.msg); + } + },error => { + message.warning(error.msg); + }) + } + /********************* cardConfig *********************/ cardConfig = [ { diff --git a/pc4mobx/organization/stores/officeManage.js b/pc4mobx/organization/stores/officeManage.js index 87c5cd3..1966840 100644 --- a/pc4mobx/organization/stores/officeManage.js +++ b/pc4mobx/organization/stores/officeManage.js @@ -30,7 +30,7 @@ export class OfficeManageStore { @observable dialogLoading = false; @observable schemeId = ""; @observable date = ""; - @observable hasRight = ""; + @observable hasRight = ''; @action setOfficeClassifyId(id) {