Commit c425abcd by maolipeng

fix:员工学员数显示不准修复

parent abfd7bda
...@@ -69,6 +69,7 @@ function EmployeeManage() { ...@@ -69,6 +69,7 @@ function EmployeeManage() {
}); });
const [total, setTotal] = useState(0); const [total, setTotal] = useState(0);
const [realTotal, setRealTotal] = useState(0)
const [model, setModel] = useState<React.ReactNode>(null); const [model, setModel] = useState<React.ReactNode>(null);
const [employeeModal, setEmployeeModal] = useState(false); const [employeeModal, setEmployeeModal] = useState(false);
const [choosedItem, setChooseItem] = useState<ChoosedItemType>({ const [choosedItem, setChooseItem] = useState<ChoosedItemType>({
...@@ -86,6 +87,17 @@ function EmployeeManage() { ...@@ -86,6 +87,17 @@ function EmployeeManage() {
if (!User.getEnterpriseId()) { if (!User.getEnterpriseId()) {
window.RCHistory.replace('/employees-manage'); window.RCHistory.replace('/employees-manage');
} }
//获取员工数
const _query = {
current: 0,
size: 10,
nickName: "",
phone: "",
roleCodes: [],
}
StoreService.getEmployeeList(_query).then((res: any) => {
setRealTotal(res.result.total);
});
}, []) }, [])
useEffect(() => { useEffect(() => {
...@@ -363,7 +375,7 @@ function EmployeeManage() { ...@@ -363,7 +375,7 @@ function EmployeeManage() {
</Button> </Button>
} }
</div> </div>
<LimitTip type="员工" total={total} tip={()=>{return (<div>数据为当前学院的员工数,若员工存在多个学院,企业人数只统计为1人</div>)}}/> <LimitTip type="员工" total={realTotal} tip={()=>{return (<div>数据为当前学院的员工数,若员工存在多个学院,企业人数只统计为1人</div>)}}/>
<div className="box-body"> <div className="box-body">
<XMTable <XMTable
renderEmpty={{ renderEmpty={{
......
...@@ -43,11 +43,25 @@ function UserManagePage() { ...@@ -43,11 +43,25 @@ function UserManagePage() {
sourceEnum: undefined, sourceEnum: undefined,
}); });
const [total, setTotal] = useState(0); const [total, setTotal] = useState(0);
const [realTotal, setRealTotal] = useState(0)
useEffect(() => { useEffect(() => {
if (!User.getEnterpriseId()) { if (!User.getEnterpriseId()) {
window.RCHistory.replace('/user-manage'); window.RCHistory.replace('/user-manage');
} }
//获取学员数
const _query = {
current: 0,
size: 10,
nickName: "",
phone: "",
registerBegin: null,
registerEnd: null,
sourceEnum: undefined,
}
StoreService.getUserList(_query).then((res: any) => {
setRealTotal(res.result.total);
});
}, []) }, [])
useEffect(() => { useEffect(() => {
...@@ -203,7 +217,7 @@ function UserManagePage() { ...@@ -203,7 +217,7 @@ function UserManagePage() {
}} }}
>添加学员</Button> >添加学员</Button>
} }
<LimitTip type="学员" total={total} tip={()=>{ return (<div><div>1、数据为当前学院的员工数,若学员存在多个学院,企业人数只统计为1人;</div><div>2、若一个学员既用「企业微信」登录学习又用「微信」登录学习,企业人数将统计为2人。</div></div>)}}/> <LimitTip type="学员" total={realTotal} tip={()=>{ return (<div><div>1、数据为当前学院的员工数,若学员存在多个学院,企业人数只统计为1人;</div><div>2、若一个学员既用「企业微信」登录学习又用「微信」登录学习,企业人数将统计为2人。</div></div>)}}/>
<div className="box-body"> <div className="box-body">
<XMTable <XMTable
renderEmpty={{ renderEmpty={{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment