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
442a3f74
Commit
442a3f74
authored
Dec 08, 2020
by
wufan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:冒烟测试修复若干问题
parent
69755fc9
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
59 additions
and
31 deletions
+59
-31
src/common/js/user.ts
+10
-2
src/modules/root/App.tsx
+3
-3
src/modules/root/Header.less
+10
-2
src/modules/root/Header.tsx
+4
-3
src/modules/store-manege/EmployeeAddOrEditModal.tsx
+3
-5
src/modules/store-manege/EmployeesManagePage.tsx
+29
-15
src/modules/store-manege/StoreDecorationPage.tsx
+0
-1
No files found.
src/common/js/user.ts
View file @
442a3f74
/*
* @Author: 吴文洁
* @Date: 2020-08-31 09:34:25
* @LastEditors:
zhangleyu
an
* @LastEditTime: 2020-12-0
4 11:37:3
3
* @LastEditors:
wuf
an
* @LastEditTime: 2020-12-0
8 15:31:4
3
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -16,6 +16,10 @@ class User {
return
Storage
.
get
(
`
${
PREFIX
}
_storeId`
)
}
getStoreName
(){
return
Storage
.
get
(
`
${
PREFIX
}
_storeName`
)
}
getStoreUserId
(){
return
Storage
.
get
(
`
${
PREFIX
}
_storeUserId`
)
}
...
...
@@ -32,6 +36,10 @@ class User {
return
Storage
.
set
(
`
${
PREFIX
}
_storeId`
,
value
)
}
setStoreName
(
value
:
any
){
return
Storage
.
set
(
`
${
PREFIX
}
_storeName`
,
value
)
}
setStoreUserId
(
value
:
any
){
return
Storage
.
set
(
`
${
PREFIX
}
_storeUserId`
,
value
)
}
...
...
src/modules/root/App.tsx
View file @
442a3f74
...
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Date: 2019-07-10 10:30:49
* @LastEditors: wufan
* @LastEditTime: 2020-12-08 1
3:41:34
* @LastEditTime: 2020-12-08 1
5:34:13
* @Description:
*/
import
React
,
{
useContext
,
useEffect
}
from
'react'
;
...
...
@@ -38,11 +38,11 @@ const App: React.FC = (props: any) => {
BaseService
.
getUserStore
({
userId
}).
then
((
res
)
=>
{
const
{
storeGroupVOS
=
[],
storeVOS
=
[]
}
=
res
.
result
;
const
{
id
,
storeUserId
}
=
storeVOS
[
0
];
const
{
id
,
storeUserId
,
storeName
}
=
storeVOS
[
0
];
User
.
setStoreId
(
id
);
User
.
setStoreUserId
(
storeUserId
);
console
.
log
(
"getUserStore"
,
id
,
storeUserId
)
User
.
setStoreName
(
storeName
);
ctx
.
dispatch
(
setStoreGroupList
(
storeGroupVOS
))
ctx
.
dispatch
(
setStoreList
(
storeVOS
));
...
...
src/modules/root/Header.less
View file @
442a3f74
...
...
@@ -21,7 +21,7 @@
-webkit-flex-direction: row;
align-items: center;
-webkit-align-items: center;
padding: 0
24
px 0 0;
padding: 0
16
px 0 0;
height: 100%;
justify-content: space-between;
-webkit-justify-content: space-between;
...
...
@@ -167,7 +167,15 @@
height: 100%;
flex: 1;
-webkit-flex: 1;
justify-content: flex-end;
justify-content: space-between;
.store-name {
width: 200px;
height: 20px;
font-size: 14px;
color: #666;
line-height: 20px;
margin-left: 36px;
}
.inst-container {
width: calc(~'100% - 420px');
position: relative;
...
...
src/modules/root/Header.tsx
View file @
442a3f74
/*
* @Author: 吴文洁
* @Date: 2019-09-10 18:26:03
* @LastEditors:
zhangleyu
an
* @LastEditTime: 2020-12-0
7 19:36:4
3
* @LastEditors:
wuf
an
* @LastEditTime: 2020-12-0
8 15:48:1
3
* @Description:
*/
import
React
,
{
useContext
,
useEffect
,
useState
}
from
'react'
;
...
...
@@ -66,7 +66,7 @@ function Header(){
content
:
"退出后,需重新登录"
,
icon
:
<
QuestionCircleOutlined
/>,
okText
:
"退出登录"
,
okType
:
"danger
"
,
// okType: ""
",
cancelText
:
"点错了"
,
onOk
:
()
=>
{
handleLogout
();
...
...
@@ -105,6 +105,7 @@ function Header(){
</
span
>
)
}
<
div
className=
"message-help"
>
<
div
className=
"store-name"
>
{
User
.
getStoreName
()
}
</
div
>
<
Dropdown
overlay=
{
userMenu
()
}
>
<
div
className=
"user"
>
<
img
...
...
src/modules/store-manege/EmployeeAddOrEditModal.tsx
View file @
442a3f74
...
...
@@ -2,7 +2,7 @@
* @Author: wufan
* @Date: 2020-11-27 16:21:49
* @LastEditors: wufan
* @LastEditTime: 2020-12-08 1
3:40:35
* @LastEditTime: 2020-12-08 1
6:20:36
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -29,7 +29,6 @@ const RadioGroup = Radio.Group;
declare
let
window
:
any
;
interface
AddEmployeeModalProps
{
isOpen
:
boolean
;
choosedItem
:
{
nickName
?:
string
;
phone
?:
string
;
...
...
@@ -65,7 +64,7 @@ function AddEmployeeModal(props: AddEmployeeModalProps) {
props
.
choosedItem
.
phone
&&
setPhone
(
props
.
choosedItem
.
phone
);
props
.
choosedItem
.
role
&&
setRole
(
props
.
choosedItem
.
role
[
0
]);
props
.
choosedItem
.
avatar
&&
setAvatar
(
props
.
choosedItem
.
avatar
);
const
_role
=
props
.
choosedItem
.
role
[
0
]
===
"
讲师
"
?
"CloudLecturer"
:
"CloudManager"
;
const
_role
=
props
.
choosedItem
.
role
[
0
]
===
"
CloudLecturer
"
?
"CloudLecturer"
:
"CloudManager"
;
form
.
setFieldsValue
({
nickName
:
props
.
choosedItem
.
nickName
,
role
:
_role
,
...
...
@@ -201,10 +200,9 @@ function AddEmployeeModal(props: AddEmployeeModalProps) {
});
}
console
.
log
(
"values"
,
form
,
form
.
getFieldsValue
())
return
(
<
Modal
visible=
{
props
.
isOpen
}
visible=
{
true
}
title=
{
`${props.choosedItem.nickName ? "编辑员工" : "添加员工"}`
}
className=
"employee-add-modal"
width=
{
680
}
...
...
src/modules/store-manege/EmployeesManagePage.tsx
View file @
442a3f74
...
...
@@ -195,11 +195,17 @@ function EmployeesManagePage() {
setChooseItem
(
_choosesItem
);
const
model
:
React
.
ReactNode
=
(
<
EmployeeAddOrEditModal
isOpen=
{
true
}
choosedItem=
{
_choosesItem
}
onClose=
{
()
=>
{
setModel
(
null
);
getEmployeeList
();
setChooseItem
({
nickName
:
""
,
phone
:
""
,
role
:
[],
avatar
:
""
,
storeUserId
:
""
});
}
}
/>
);
...
...
@@ -212,7 +218,6 @@ function EmployeesManagePage() {
content
:
"删除后,讲师将不能登录系统,此操作不能被撤销"
,
icon
:
<
QuestionCircleOutlined
/>,
okText
:
"删除"
,
okType
:
"danger"
,
cancelText
:
"取消"
,
onOk
:
()
=>
{
handleDeleteEmployee
(
record
.
id
);
...
...
@@ -221,8 +226,24 @@ function EmployeesManagePage() {
}
function
handleToAddEmployee
()
{
setIsModalOpen
(
true
);
}
const
model
:
React
.
ReactNode
=
(
<
EmployeeAddOrEditModal
choosedItem=
{
choosedItem
}
onClose=
{
()
=>
{
setModel
(
null
);
getEmployeeList
();
setChooseItem
({
nickName
:
""
,
phone
:
""
,
role
:
[],
avatar
:
""
,
storeUserId
:
""
});
}
}
/>
);
setModel
(
model
);
}
function
handleDeleteEmployee
(
storeUserId
:
string
)
{
StoreService
.
deleteEmployee
({
storeUserId
}).
then
((
res
:
any
)
=>
{
...
...
@@ -267,9 +288,12 @@ function EmployeesManagePage() {
const
otherName
=
isPhone
?
"nickName"
:
"phone"
;
_query
[
name
]
=
value
;
_query
[
otherName
]
=
''
;
_query
.
current
=
0
;
}
else
{
_query
.
nickName
=
""
;
_query
.
phone
=
""
;
_query
.
current
=
0
;
}
setQuery
(
_query
);
}
}
...
...
@@ -287,7 +311,7 @@ function EmployeesManagePage() {
const
{
checked
,
name
}
=
e
.
target
;
const
_query
=
{
...
query
};
_query
.
roleCodes
=
[];
_query
.
current
=
0
;
const
_roleIds
:
Array
<
RoleItemType
>
=
roleIds
.
map
(
(
_item
:
RoleItemType
)
=>
{
if
(
name
===
_item
.
roleCode
)
{
...
...
@@ -346,16 +370,6 @@ function EmployeesManagePage() {
/>
</
div
>
</
div
>
{
isModalOpen
&&
(
<
EmployeeAddOrEditModal
isOpen=
{
isModalOpen
}
choosedItem=
{
choosedItem
}
onClose=
{
()
=>
{
setIsModalOpen
(
false
);
getEmployeeList
();
}
}
/>
)
}
{
model
}
</
div
>
</
div
>
...
...
src/modules/store-manege/StoreDecorationPage.tsx
View file @
442a3f74
...
...
@@ -92,7 +92,6 @@ function StoreDecorationPage() {
title
:
"你确定要删除这个banner吗?"
,
icon
:
<
QuestionCircleOutlined
/>,
okText
:
"删除"
,
okType
:
"danger"
,
cancelText
:
"取消"
,
onOk
:
()
=>
{
handleDeleteDecoration
(
record
);
...
...
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