custom/领悦业务线

This commit is contained in:
lys 2025-02-20 14:58:35 +08:00
parent 9fd83c7b34
commit 344e20799d
3 changed files with 18 additions and 12 deletions

View File

@ -18,6 +18,6 @@ export const PAGE = {
"salaryField": ["/hrmSalary/fieldManagement"], //字段管理
"salaryItem": ["/hrmSalary/salaryItem"], //薪资项目管理
"siScheme": ["/socialSecurityBenefits/programme"], //社保福利方案
"report": ["/hrmSalary/analysisOfSalaryStatistics", "/hrmSalary/reportView"], //报表
"nc": ["lingyue"] //领悦报表业务线权限
"report": ["/hrmSalary/analysisOfSalaryStatistics", "/hrmSalary/reportView"] //报表
};
export const EXCLUDE_PAGE = ["mobilepayroll"];

View File

@ -11,6 +11,8 @@ import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaLocaleProvider, WeaTools } from "ecCom";
import Authority from "./pages/mySalary/authority";
import { EXCLUDE_PAGE } from "./config";
import store from "./stores";
const { ls } = WeaTools;
const { getLabel } = WeaLocaleProvider;
@ -43,8 +45,11 @@ class Layout extends Component {
let header = document.getElementById("container");
header.appendChild(link);
top.$(".ant-message").remove();
(window.location.hash.indexOf("mobilepayroll") === -1 || window.location.hash.indexOf("_lingyue") === -1) && allStore.taxAgentStore.getPermission();
(window.location.hash.indexOf("mobilepayroll") !== -1 && window.location.hash.indexOf("_lingyue") !== -1) && allStore.taxAgentStore.initPageAndOptAuth();
if (_.every(EXCLUDE_PAGE, page => window.location.hash.indexOf(page) === -1)) {
store.taxAgentStore.getPermission();
} else {
store.taxAgentStore.initPageAndOptAuth();
}
}
window.addEventListener("storage", this.setFontSize);
}
@ -73,8 +78,10 @@ class Layout extends Component {
render() {
const { taxAgentStore: { PageAndOptAuth, loading } } = this.props;
// 领悦二开权限
const lingyueRight = window.location.hash.indexOf("lingyue") !== -1;
return (<WeaLocaleProvider>
<Authority store={{ loading, hasRight: PageAndOptAuth.able }}>{this.props.children}</Authority>
<Authority store={{ loading, hasRight: PageAndOptAuth.able || lingyueRight }}>{this.props.children}</Authority>
</WeaLocaleProvider>);
}
}

View File

@ -1,14 +1,10 @@
import React from "react";
import ReactDOM from "react-dom";
import { createHashHistory } from "History";
import { IndexRedirect, Route, Router, useRouterHistory } from "react-router";
import { RouterStore, syncHistoryWithStore } from "mobx-react-router";
import { EXCLUDE_PAGE } from "./config";
import { Provider } from "mobx-react";
import Module from "weaHrmSalary";
const routing = new RouterStore();
@ -37,8 +33,11 @@ class Root extends React.Component {
let header = document.getElementById("container");
header.appendChild(link);
top.$(".ant-message").remove();
(window.location.hash.indexOf("mobilepayroll") === -1 && window.location.hash.indexOf("_lingyue") === -1) && allStore.taxAgentStore.getPermission();
(window.location.hash.indexOf("mobilepayroll") !== -1 || window.location.hash.indexOf("_lingyue") !== -1) && allStore.taxAgentStore.initPageAndOptAuth();
if (_.every(EXCLUDE_PAGE, page => window.location.hash.indexOf(page) === -1)) {
allStore.taxAgentStore.getPermission();
} else {
allStore.taxAgentStore.initPageAndOptAuth();
}
if (window.location.hash.indexOf("payroll") !== -1) {
window.localStorage.removeItem("template-basedata");
window.localStorage.removeItem("salary-showset");