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
e1a94760
Commit
e1a94760
authored
Dec 08, 2020
by
wufan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:修复员工和用户管理问题
parent
db9068cd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
52 deletions
+23
-52
src/modules/store-manege/EmployeeAddOrEditModal.tsx
+4
-6
src/modules/store-manege/EmployeesManagePage.tsx
+15
-30
src/modules/store-manege/UserManagePage.tsx
+4
-16
No files found.
src/modules/store-manege/EmployeeAddOrEditModal.tsx
View file @
e1a94760
...
...
@@ -2,7 +2,7 @@
* @Author: wufan
* @Date: 2020-11-27 16:21:49
* @LastEditors: wufan
* @LastEditTime: 2020-12-0
7 16:24:5
1
* @LastEditTime: 2020-12-0
8 10:38:2
1
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -20,10 +20,8 @@ import {
}
from
"antd"
;
import
_
,
{
values
}
from
"underscore"
;
import
"./EmployeeAddOrEditModal.less"
;
import
baseImg
from
"@/common/images/xiaomai-IMG.png"
;
import
{
CropperModal
}
from
"@/components/"
;
import
StoreService
from
"@/domains/store-domain/storeService"
;
import
UpLoad
from
"../common/UpLoad"
;
import
$
from
"jquery"
;
import
User
from
"@/common/js/user"
;
...
...
@@ -46,9 +44,9 @@ function AddEmployeeModal(props: AddEmployeeModalProps) {
const
[
nickName
,
setName
]
=
useState
(
""
);
const
[
phone
,
setPhone
]
=
useState
(
""
);
const
[
role
,
setRole
]
=
useState
(
"CloudLecturer"
);
const
[
avatar
,
setAvatar
]
=
useState
(
baseImg
);
const
[
avatar
,
setAvatar
]
=
useState
(
"https://image.xiaomaiketang.com/xm/rJeQaZxtc7.png"
);
const
storeUserId
=
props
.
choosedItem
.
storeUserId
;
const
[
imgUrl
,
setImgUrl
]
=
useState
(
avatar
);
const
[
imgUrl
,
setImgUrl
]
=
useState
(
avatar
||
'https://image.xiaomaiketang.com/xm/rJeQaZxtc7.png'
);
const
[
nameErrorMsg
,
setNameErrorMsg
]
=
useState
(
""
);
const
[
nameStatus
,
setNameStatus
]
=
useState
<
""
|
"error"
|
"success"
|
"warning"
|
"validating"
|
undefined
...
...
@@ -66,7 +64,7 @@ function AddEmployeeModal(props: AddEmployeeModalProps) {
setName
(
props
.
choosedItem
.
nickName
);
props
.
choosedItem
.
phone
&&
setPhone
(
props
.
choosedItem
.
phone
);
props
.
choosedItem
.
role
&&
setRole
(
props
.
choosedItem
.
role
[
0
]);
props
.
choosedItem
.
avatar
&&
setAvatar
(
props
.
choosedItem
.
avatar
||
baseImg
);
props
.
choosedItem
.
avatar
&&
setAvatar
(
props
.
choosedItem
.
avatar
);
const
_role
=
props
.
choosedItem
.
role
[
0
]
===
"讲师"
?
"CloudLecturer"
:
"CloudManager"
;
form
.
setFieldsValue
({
nickName
:
props
.
choosedItem
.
nickName
,
...
...
src/modules/store-manege/EmployeesManagePage.tsx
View file @
e1a94760
...
...
@@ -64,7 +64,7 @@ function EmployeesManagePage() {
size
:
10
,
nickName
:
""
,
phone
:
""
,
roleCodes
:
[
"StoreManager"
],
roleCodes
:
[],
storeId
:
User
.
getStoreId
(),
});
...
...
@@ -98,7 +98,6 @@ function EmployeesManagePage() {
async
function
getListInfo
()
{
await
getStoreRole
();
await
getEmployeeList
();
}
function
getEmployeeList
()
{
...
...
@@ -119,14 +118,14 @@ function EmployeesManagePage() {
return
_item
.
roleCode
!==
"StoreManager"
;
});
_data
=
_
.
map
(
_data
,
(
item
:
any
)
=>
{
item
.
isChecked
=
true
;
_query
.
roleCodes
.
push
(
item
.
roleCode
);
return
item
;
});
//
_data = _.map(_data, (item: any) => {
//
item.isChecked = true;
//
_query.roleCodes.push(item.roleCode);
//
return item;
//
});
setQuery
(
_query
);
//
setQuery(_query);
setRoleIds
(
_data
);
});
}
...
...
@@ -262,35 +261,21 @@ function EmployeesManagePage() {
marginRight
:
40
,
}
}
placeholder=
"搜索员工姓名/手机号"
onChange=
{
(
event
)
=>
{
const
val
=
event
.
target
.
value
;
const
_query
=
{
...
query
};
_query
.
nickName
=
val
;
setQuery
(
_query
);
}
}
onSearch=
{
()
=>
getEmployeeList
()
}
/>
{
/* <SearchBar
label="搜索用户"
placeholder="搜索用户姓名/手机号"
style={{
width: 300,
marginRight: 40,
}}
value={valueLike}
onSearch={(value: any) => {
onSearch=
{
(
value
)
=>
{
const
_query
=
{
...
query
};
if (valu const isPhone = (value || "").match(/^\d+$/);
const nameLike = isPhone ? "phone" : "nickName";
setValueLike(value);
_query[nameLike] = value;
if
(
value
)
{
const
isPhone
=
(
value
||
""
).
match
(
/^
\d
+$/
);
const
name
=
isPhone
?
"phone"
:
"nickName"
;
const
otherName
=
isPhone
?
"nickName"
:
"phone"
;
_query
[
name
]
=
value
;
_query
[
otherName
]
=
''
;
}
else
{
_query
.
nickName
=
""
;
_query
.
phone
=
""
;
}
setQuery
(
_query
);
}
}
/
>
*/}
/>
</
div
>
<
div
style=
{
{
flex
:
1
}
}
>
...
...
src/modules/store-manege/UserManagePage.tsx
View file @
e1a94760
...
...
@@ -2,7 +2,7 @@
* @Author: wufan
* @Date: 2020-11-30 10:47:38
* @LastEditors: wufan
* @LastEditTime: 2020-12-0
3 11:37:42
* @LastEditTime: 2020-12-0
8 10:42:20
* @Description: 用户管理页面
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -11,7 +11,7 @@ import React, { useEffect, useState } from "react";
import
{
withRouter
}
from
"react-router-dom"
;
import
_
from
"underscore"
;
import
{
PageControl
}
from
"@/components"
;
import
{
Table
,
Modal
,
message
,
Row
,
Col
,
Input
,
DatePicker
}
from
"antd"
;
import
{
Table
,
Input
,
DatePicker
}
from
"antd"
;
import
StoreService
from
"@/domains/store-domain/storeService"
;
import
User
from
"@/common/js/user"
;
...
...
@@ -34,13 +34,6 @@ function UserManagePage() {
registerEnd
:
null
,
});
const
[
total
,
setTotal
]
=
useState
(
0
);
const
[
model
,
setModel
]
=
useState
(
null
);
const
[
isModalOpen
,
setIsModalOpen
]
=
useState
(
false
);
const
[
isManager
,
setIsManager
]
=
useState
(
true
);
const
[
isNormal
,
setIsNormal
]
=
useState
(
true
);
const
[
choosedItem
,
setChooseItem
]
=
useState
({});
const
[
nickName
,
setNickName
]
=
useState
(
""
);
const
[
phone
,
setPhone
]
=
useState
(
""
);
useEffect
(()
=>
{
getUserList
();
...
...
@@ -115,10 +108,6 @@ function UserManagePage() {
marginRight
:
40
,
}
}
placeholder=
"搜索用户姓名/手机号"
// onChange={(event) => {
// const val = event.target.value;
// }}
onSearch=
{
(
value
)
=>
{
const
_query
=
{
...
query
};
if
(
value
)
{
...
...
@@ -158,9 +147,8 @@ function UserManagePage() {
_query
.
registerBegin
=
dates
?
dates
[
0
].
valueOf
()
:
null
;
_query
.
registerEnd
=
dates
?
dates
[
1
].
valueOf
()
:
null
;
setQuery
({
...
_query
,
current
:
1
,
});
...
_query
});
}
}
/>
</
div
>
...
...
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