Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
3ef3f08f
Commit
3ef3f08f
authored
Jul 15, 2021
by
zhujian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
‘fix:通讯录优化1’
parent
67055fc7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
19 deletions
+21
-19
src/modules/college-manage/EmployeeManage.tsx
+7
-9
src/modules/root/App.tsx
+14
-10
No files found.
src/modules/college-manage/EmployeeManage.tsx
View file @
3ef3f08f
...
@@ -108,12 +108,10 @@ function EmployeeManage() {
...
@@ -108,12 +108,10 @@ function EmployeeManage() {
useEffect
(()
=>
{
useEffect
(()
=>
{
getListInfo
();
getListInfo
();
// initWechatConfig();
},
[
storeId
]);
},
[
storeId
]);
async
function
initWechatConfig
()
{
WechatApi
.
initConfig
({
isAgentConfig
:
true
,
url
:
window
.
location
.
href
.
split
(
'#'
)[
0
]
})
}
async
function
getListInfo
()
{
async
function
getListInfo
()
{
await
getStoreRole
();
await
getStoreRole
();
...
@@ -162,7 +160,7 @@ function EmployeeManage() {
...
@@ -162,7 +160,7 @@ function EmployeeManage() {
{
/* <span className="title">{val}</span> */
}
{
/* <span className="title">{val}</span> */
}
<
span
className=
"title"
>
<
span
className=
"title"
>
<
WWOpenDataCom
type=
"userName"
openid=
{
val
}
/>
<
WWOpenDataCom
type=
"userName"
openid=
{
val
}
/>
</
span
>
</
span
>
</
div
>
</
div
>
);
);
...
@@ -199,7 +197,7 @@ function EmployeeManage() {
...
@@ -199,7 +197,7 @@ function EmployeeManage() {
<
span
className=
"divider-line"
>
{
" | "
}
</
span
>
<
span
className=
"divider-line"
>
{
" | "
}
</
span
>
<
span
<
span
className=
"delete"
className=
"delete"
onClick=
{
()
=>
{
onClick=
{
()
=>
{
handleDeleteWorkWechatEmployeeConfirm
(
record
)
handleDeleteWorkWechatEmployeeConfirm
(
record
)
}
}
}
}
>
>
...
@@ -248,7 +246,7 @@ function EmployeeManage() {
...
@@ -248,7 +246,7 @@ function EmployeeManage() {
role
:
[],
role
:
[],
avatar
:
""
,
avatar
:
""
,
storeUserId
:
""
,
storeUserId
:
""
,
weChatAccount
:
""
weChatAccount
:
""
});
});
}
}
}
}
isWorkWechat=
{
isWorkWechat
}
isWorkWechat=
{
isWorkWechat
}
...
@@ -279,7 +277,7 @@ function EmployeeManage() {
...
@@ -279,7 +277,7 @@ function EmployeeManage() {
function
handleDeleteEmployee
(
storeUserId
:
string
)
{
function
handleDeleteEmployee
(
storeUserId
:
string
)
{
StoreService
.
deleteEmployee
({
storeUserId
}).
then
((
res
:
any
)
=>
{
StoreService
.
deleteEmployee
({
storeUserId
}).
then
((
res
:
any
)
=>
{
const
msg
=
isWorkWechat
?
"员工已删除"
:
"讲师已删除"
;
const
msg
=
isWorkWechat
?
"员工已删除"
:
"讲师已删除"
;
message
.
success
(
msg
);
message
.
success
(
msg
);
getEmployeeList
();
getEmployeeList
();
});
});
...
@@ -386,7 +384,7 @@ function EmployeeManage() {
...
@@ -386,7 +384,7 @@ function EmployeeManage() {
</
Button
>
</
Button
>
}
}
</
div
>
</
div
>
<
LimitTip
type=
"员工"
total=
{
realTotal
}
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=
{
{
...
...
src/modules/root/App.tsx
View file @
3ef3f08f
...
@@ -15,7 +15,7 @@ import zhCN from 'antd/es/locale/zh_CN'
...
@@ -15,7 +15,7 @@ import zhCN from 'antd/es/locale/zh_CN'
import
User
from
'@/common/js/user'
;
import
User
from
'@/common/js/user'
;
import
BaseService
from
"@/domains/basic-domain/baseService"
;
import
BaseService
from
"@/domains/basic-domain/baseService"
;
import
moment
from
'moment'
;
import
moment
from
'moment'
;
import
WechatApi
from
"@/core/wechatApi"
import
WechatApi
from
'@/common/js/wechatApi'
;
import
{
VersionContext
,
VersionInfo
,
XMContext
}
from
'@/store/context'
;
import
{
VersionContext
,
VersionInfo
,
XMContext
}
from
'@/store/context'
;
import
{
setStoreGroupPermission
,
setStorePermission
,
setStoreGroupList
,
setStoreList
}
from
'@/store/actions/index'
;
import
{
setStoreGroupPermission
,
setStorePermission
,
setStoreGroupList
,
setStoreList
}
from
'@/store/actions/index'
;
import
Service
from
"@/common/js/service"
;
import
Service
from
"@/common/js/service"
;
...
@@ -29,7 +29,7 @@ declare var window: any;
...
@@ -29,7 +29,7 @@ declare var window: any;
const
App
:
React
.
FC
=
(
props
:
any
)
=>
{
const
App
:
React
.
FC
=
(
props
:
any
)
=>
{
const
[
storeUserId
,
setStoreUserId
]
=
useState
(
''
)
const
[
storeUserId
,
setStoreUserId
]
=
useState
(
''
)
const
ctx
:
any
=
useContext
(
XMContext
);
const
ctx
:
any
=
useContext
(
XMContext
);
const
[
versionInfo
,
setVersionInfo
]
=
useState
<
VersionInfo
|
null
>
(
null
)
const
[
versionInfo
,
setVersionInfo
]
=
useState
<
VersionInfo
|
null
>
(
null
)
const
userId
=
User
.
getUserId
();
const
userId
=
User
.
getUserId
();
const
[
menuType
,
setMenuType
]
=
useState
(
true
);
const
[
menuType
,
setMenuType
]
=
useState
(
true
);
const
enterpriseId
=
User
.
getEnterpriseId
();
const
enterpriseId
=
User
.
getEnterpriseId
();
...
@@ -37,7 +37,7 @@ const App: React.FC = (props: any) => {
...
@@ -37,7 +37,7 @@ const App: React.FC = (props: any) => {
useEffect
(()
=>
{
useEffect
(()
=>
{
WechatApi
.
initShare
Config
();
initWechat
Config
();
getStoreAndUserInfo
();
getStoreAndUserInfo
();
getVersion
();
getVersion
();
if
(
window
.
location
.
hash
===
"#/"
)
{
if
(
window
.
location
.
hash
===
"#/"
)
{
...
@@ -47,6 +47,10 @@ const App: React.FC = (props: any) => {
...
@@ -47,6 +47,10 @@ const App: React.FC = (props: any) => {
}
}
},
[])
},
[])
async
function
initWechatConfig
()
{
WechatApi
.
initConfig
({
isAgentConfig
:
true
,
url
:
window
.
location
.
href
.
split
(
'#'
)[
0
]
})
}
useEffect
(()
=>
{
useEffect
(()
=>
{
getStorePermission
();
getStorePermission
();
},
[
window
.
location
.
hash
])
},
[
window
.
location
.
hash
])
...
@@ -68,7 +72,7 @@ const App: React.FC = (props: any) => {
...
@@ -68,7 +72,7 @@ const App: React.FC = (props: any) => {
let
version
=
res
.
result
;
let
version
=
res
.
result
;
User
.
setVersion
(
version
);
User
.
setVersion
(
version
);
User
.
setExpirationTime
(
res
.
result
.
validEndTime
)
User
.
setExpirationTime
(
res
.
result
.
validEndTime
)
let
versioninfo
:
VersionInfo
=
{
let
versioninfo
:
VersionInfo
=
{
dayTime
:
version
.
dayTime
,
dayTime
:
version
.
dayTime
,
stateEnum
:
version
.
stateEnum
,
stateEnum
:
version
.
stateEnum
,
userNum
:
version
.
userNum
===
-
1
?
'不限人数'
:
version
.
userNum
,
userNum
:
version
.
userNum
===
-
1
?
'不限人数'
:
version
.
userNum
,
...
@@ -89,28 +93,28 @@ const App: React.FC = (props: any) => {
...
@@ -89,28 +93,28 @@ const App: React.FC = (props: any) => {
}
}
function
getStoreInfo
()
{
function
getStoreInfo
()
{
console
.
log
(
"currentStoreUserInfo"
,
window
.
currentStoreUserInfo
);
console
.
log
(
"currentStoreUserInfo"
,
window
.
currentStoreUserInfo
);
const
params
=
{
const
params
=
{
storeId
:
User
.
getStoreId
(),
storeId
:
User
.
getStoreId
(),
userId
:
User
.
getUserId
(),
userId
:
User
.
getUserId
(),
};
};
Service
.
Hades
(
'public/customerHades/getStoreAndUserMsg'
,
params
).
then
((
res
)
=>
{
Service
.
Hades
(
'public/customerHades/getStoreAndUserMsg'
,
params
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
if
(
res
.
success
)
{
const
{
id
,
storeUserId
,
storeName
,
userRole
,
storeType
}
=
res
.
result
;
const
{
id
,
storeUserId
,
storeName
,
userRole
,
storeType
}
=
res
.
result
;
User
.
setStoreId
(
id
);
User
.
setStoreId
(
id
);
User
.
setStoreUserId
(
storeUserId
);
User
.
setStoreUserId
(
storeUserId
);
User
.
setStoreName
(
storeName
);
User
.
setStoreName
(
storeName
);
Bus
.
trigger
(
'storeNameChange'
,
storeName
);
Bus
.
trigger
(
'storeNameChange'
,
storeName
);
User
.
setUserRole
(
userRole
);
User
.
setUserRole
(
userRole
);
User
.
setStoreType
(
storeType
);
User
.
setStoreType
(
storeType
);
setCurrentStoreUserInfo
(
id
,
storeUserId
)
setCurrentStoreUserInfo
(
id
,
storeUserId
)
setStoreUserId
(
storeUserId
);
setStoreUserId
(
storeUserId
);
getUserPermission
();
getUserPermission
();
}
}
})
})
}
}
function
setCurrentStoreUserInfo
(
storeId
:
any
,
storeUserId
:
any
)
{
function
setCurrentStoreUserInfo
(
storeId
:
any
,
storeUserId
:
any
)
{
window
.
currentStoreUserInfo
.
storeId
=
storeId
;
window
.
currentStoreUserInfo
.
storeId
=
storeId
;
window
.
currentStoreUserInfo
.
storeUserId
=
storeUserId
;
window
.
currentStoreUserInfo
.
storeUserId
=
storeUserId
;
window
.
currentStoreUserInfo
.
userId
=
User
.
getUserId
();
window
.
currentStoreUserInfo
.
userId
=
User
.
getUserId
();
...
@@ -136,7 +140,7 @@ const App: React.FC = (props: any) => {
...
@@ -136,7 +140,7 @@ const App: React.FC = (props: any) => {
Bus
.
trigger
(
'storeNameChange'
,
storeName
);
Bus
.
trigger
(
'storeNameChange'
,
storeName
);
User
.
setUserRole
(
userRole
);
User
.
setUserRole
(
userRole
);
User
.
setStoreType
(
storeType
);
User
.
setStoreType
(
storeType
);
setCurrentStoreUserInfo
(
id
,
storeUserId
);
setCurrentStoreUserInfo
(
id
,
storeUserId
);
ctx
.
dispatch
(
setStoreGroupList
(
storeGroupVOS
))
ctx
.
dispatch
(
setStoreGroupList
(
storeGroupVOS
))
ctx
.
dispatch
(
setStoreList
(
storeVOS
));
ctx
.
dispatch
(
setStoreList
(
storeVOS
));
setStoreUserId
(
storeUserId
)
setStoreUserId
(
storeUserId
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment