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
c8502300
Commit
c8502300
authored
Dec 01, 2020
by
wufan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:联调员工管理
parent
cc180c86
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
99 additions
and
65 deletions
+99
-65
src/data-source/base/request-apis.ts
+14
-0
src/data-source/store/request-apis.ts
+7
-4
src/domains/basic-domain/baseService.ts
+19
-0
src/domains/store-domain/storeService.ts
+7
-2
src/index.tsx
+2
-18
src/modules/root/App.jsx
+16
-3
src/modules/store-manege/EmployeesManagePage.tsx
+34
-38
No files found.
src/data-source/base/request-apis.ts
0 → 100644
View file @
c8502300
/*
* @Author: wufan
* @Date: 2020-12-01 17:21:21
* @LastEditors: wufan
* @LastEditTime: 2020-12-01 18:07:03
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import
Service
from
"@/common/js/service"
;
export
function
getUserStore
(
params
:
object
)
{
return
Service
.
Hades
(
"public/store/getUserStore"
,
params
);
}
\ No newline at end of file
src/data-source/store/request-apis.ts
View file @
c8502300
...
@@ -2,14 +2,18 @@
...
@@ -2,14 +2,18 @@
* @Author: wufan
* @Author: wufan
* @Date: 2020-11-25 18:25:02
* @Date: 2020-11-25 18:25:02
* @LastEditors: wufan
* @LastEditors: wufan
* @LastEditTime: 2020-12-01 1
5:30:16
* @LastEditTime: 2020-12-01 1
8:14:38
* @Description: Description
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
import
Service
from
"@/common/js/service"
;
import
Service
from
"@/common/js/service"
;
export
function
getEmployeeList
(
params
:
object
)
{
export
function
getEmployeeList
(
params
:
object
)
{
return
Service
.
postJSON
(
"appolo/public/businessMicroWebsite/getMicroWebsiteCouponList"
,
params
);
return
Service
.
Hades
(
"public/store/getStoreUserPage"
,
params
);
}
export
function
getStoreRole
(
params
:
object
)
{
return
Service
.
Hades
(
"public/store/getStoreRole"
,
params
);
}
}
export
function
getUserList
(
params
:
object
)
{
export
function
getUserList
(
params
:
object
)
{
...
@@ -18,4 +22,4 @@ export function getUserList(params: object) {
...
@@ -18,4 +22,4 @@ export function getUserList(params: object) {
export
function
getStoreDecorationList
(
params
:
object
)
{
export
function
getStoreDecorationList
(
params
:
object
)
{
return
Service
.
Apollo
(
"public/businessMicroWebsite/getMicroWebsiteCouponList"
,
params
);
return
Service
.
Apollo
(
"public/businessMicroWebsite/getMicroWebsiteCouponList"
,
params
);
}
}
\ No newline at end of file
src/domains/basic-domain/baseService.ts
0 → 100644
View file @
c8502300
/*
* @Author: wufan
* @Date: 2020-12-01 17:20:49
* @LastEditors: wufan
* @LastEditTime: 2020-12-01 17:23:45
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import
{
getUserStore
}
from
'@/data-source/base/request-apis'
;
export
default
class
StoreService
{
// 获取员工列表
static
getUserStore
(
params
:
any
)
{
return
getUserStore
(
params
);
}
}
\ No newline at end of file
src/domains/store-domain/storeService.ts
View file @
c8502300
...
@@ -2,11 +2,11 @@
...
@@ -2,11 +2,11 @@
* @Author: wufan
* @Author: wufan
* @Date: 2020-11-25 18:25:02
* @Date: 2020-11-25 18:25:02
* @LastEditors: wufan
* @LastEditors: wufan
* @LastEditTime: 2020-1
1-30 17:17:01
* @LastEditTime: 2020-1
2-01 18:13:50
* @Description: Description
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
import
{
getEmployeeList
,
getUserList
,
getStoreDecorationList
}
from
'@/data-source/store/request-apis'
;
import
{
getEmployeeList
,
getUserList
,
getStoreDecorationList
,
getStoreRole
}
from
'@/data-source/store/request-apis'
;
export
default
class
StoreService
{
export
default
class
StoreService
{
// 获取员工列表
// 获取员工列表
...
@@ -14,6 +14,11 @@ export default class StoreService {
...
@@ -14,6 +14,11 @@ export default class StoreService {
return
getEmployeeList
(
params
);
return
getEmployeeList
(
params
);
}
}
// 获取店铺角色
static
getStoreRole
(
params
:
any
)
{
return
getStoreRole
(
params
);
}
// 删除员工
// 删除员工
static
deleteEmployee
(
params
:
any
)
{
static
deleteEmployee
(
params
:
any
)
{
return
getUserList
(
params
);
return
getUserList
(
params
);
...
...
src/index.tsx
View file @
c8502300
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Author: 吴文洁
* @Date: 2020-04-27 20:35:34
* @Date: 2020-04-27 20:35:34
* @LastEditors: wufan
* @LastEditors: wufan
* @LastEditTime: 2020-12-01 1
5:23:22
* @LastEditTime: 2020-12-01 1
7:17:43
* @Description:
* @Description:
*/
*/
...
@@ -13,12 +13,10 @@ import { ConfigProvider } from 'antd';
...
@@ -13,12 +13,10 @@ import { ConfigProvider } from 'antd';
import
{
createHashHistory
}
from
'history'
;
import
{
createHashHistory
}
from
'history'
;
import
zh_CN
from
'antd/es/locale/zh_CN'
;
import
zh_CN
from
'antd/es/locale/zh_CN'
;
import
_
from
'underscore'
;
import
_
from
'underscore'
;
import
axios
,
{
AxiosInstance
,
AxiosRequestConfig
,
AxiosResponse
,
AxiosPromise
}
from
'axios'
;
import
{
RootRouter
}
from
'./routes/index'
;
import
{
RootRouter
}
from
'./routes/index'
;
import
'antd/dist/antd.less'
;
import
'antd/dist/antd.less'
;
import
'@/common/less/index.less'
;
import
'@/common/less/index.less'
;
import
'@/core/function'
;
import
'@/core/function'
;
import
User
from
'@/common/js/user'
;
import
'@/common/less/index.less'
;
import
'@/common/less/index.less'
;
const
history
=
createHashHistory
();
const
history
=
createHashHistory
();
...
@@ -39,22 +37,8 @@ window.RCHistory = _.extend({}, history, {
...
@@ -39,22 +37,8 @@ window.RCHistory = _.extend({}, history, {
history
.
replace
(
obj
)
history
.
replace
(
obj
)
}
}
});
});
export
async
function
mount
()
{
// useEffect(()=>{
// fetchUserInsts();
// })
// function fetchUserInsts(){
// const userId = User.getUserId();
// axios.post("hades/public/store/getUserStore",{ userId })
// .then((res: any) => {
// const { storeGroupVOS, storeVOS } = res.result;
// })
// }
export
async
function
mount
()
{
ReactDOM
.
render
(
ReactDOM
.
render
(
<
RootRouter
/>,
<
RootRouter
/>,
document
.
getElementById
(
'root'
));
document
.
getElementById
(
'root'
));
...
...
src/modules/root/App.jsx
View file @
c8502300
/*
/*
* @Author: 吴文洁
* @Author: 吴文洁
* @Date: 2019-07-10 10:30:49
* @Date: 2019-07-10 10:30:49
* @LastEditors: w
angyixi
* @LastEditors: w
ufan
* @LastEditTime: 2020-1
1-09 19:21:0
3
* @LastEditTime: 2020-1
2-01 17:30:1
3
* @Description:
* @Description:
*/
*/
import
React
from
'react'
import
React
from
'react'
...
@@ -13,6 +13,9 @@ import Menu from './Menu'
...
@@ -13,6 +13,9 @@ import Menu from './Menu'
import
Main
from
'./Main'
import
Main
from
'./Main'
import
{
Route
,
Switch
}
from
'react-router-dom'
import
{
Route
,
Switch
}
from
'react-router-dom'
import
zhCN
from
'antd/es/locale/zh_CN'
import
zhCN
from
'antd/es/locale/zh_CN'
import
User
from
'@/common/js/user'
;
import
axios
from
'axios'
;
import
BaseService
from
"@/domains/basic-domain/baseService"
;
class
App
extends
React
.
Component
{
class
App
extends
React
.
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -22,8 +25,18 @@ class App extends React.Component {
...
@@ -22,8 +25,18 @@ class App extends React.Component {
}
}
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
getUserStore
()
}
}
getUserStore
=
()
=>
{
const
userId
=
User
.
getUserId
();
BaseService
.
getUserStore
({
userId
}).
then
((
res
)
=>
{
console
.
log
(
res
.
result
);
const
{
storeGroupVOS
,
storeVOS
}
=
res
.
result
;
});
}
render
()
{
render
()
{
return
[
return
[
<
div
id=
"home"
>
<
div
id=
"home"
>
...
...
src/modules/store-manege/EmployeesManagePage.tsx
View file @
c8502300
...
@@ -15,6 +15,7 @@ import { QuestionCircleOutlined } from '@ant-design/icons';
...
@@ -15,6 +15,7 @@ import { QuestionCircleOutlined } from '@ant-design/icons';
import
{
storeRoleEnum
}
from
"@/domains/store-domain/constants"
;
import
{
storeRoleEnum
}
from
"@/domains/store-domain/constants"
;
import
StoreService
from
"@/domains/store-domain/storeService"
;
import
StoreService
from
"@/domains/store-domain/storeService"
;
import
EmployeeAddOrEditModal
from
'./EmployeeAddOrEditModal'
;
import
EmployeeAddOrEditModal
from
'./EmployeeAddOrEditModal'
;
import
User
from
'@/common/js/user'
;
import
"./EmployeesManagePage.less"
;
import
"./EmployeesManagePage.less"
;
const
{
confirm
}
=
Modal
;
const
{
confirm
}
=
Modal
;
...
@@ -29,13 +30,13 @@ interface RecordTypes {
...
@@ -29,13 +30,13 @@ interface RecordTypes {
function
EmployeesManagePage
()
{
function
EmployeesManagePage
()
{
const
[
employeeList
,
setEmployeeList
]
=
useState
([
const
[
employeeList
,
setEmployeeList
]
=
useState
([
{
{
name
:
"赵云"
,
n
ickN
ame
:
"赵云"
,
phone
:
"18767118672"
,
phone
:
"18767118672"
,
role
:
"0"
,
role
:
"0"
,
storeUserId
:
"0"
storeUserId
:
"0"
},
},
{
{
name
:
"吕布"
,
n
ickN
ame
:
"吕布"
,
phone
:
"18767118672"
,
phone
:
"18767118672"
,
role
:
"0"
,
role
:
"0"
,
storeUserId
:
"2"
storeUserId
:
"2"
...
@@ -44,20 +45,23 @@ function EmployeesManagePage() {
...
@@ -44,20 +45,23 @@ function EmployeesManagePage() {
const
[
query
,
setQuery
]
=
useState
({
const
[
query
,
setQuery
]
=
useState
({
current
:
0
,
current
:
0
,
size
:
10
,
size
:
10
,
name
:
""
,
n
ickN
ame
:
""
,
phone
:
""
,
phone
:
""
,
identity
:
"ALL"
,
roleId
:
[]
,
instId
:
"1837447"
||
window
.
currentUserInstInfo
.
instId
,
storeId
:
User
.
getStoreId
()
,
});
});
const
[
total
,
setTotal
]
=
useState
(
0
);
const
[
total
,
setTotal
]
=
useState
(
0
);
const
[
model
,
setModel
]
=
useState
(
null
);
const
[
model
,
setModel
]
=
useState
(
null
);
const
[
isModalOpen
,
setIsModalOpen
]
=
useState
(
false
);
const
[
isModalOpen
,
setIsModalOpen
]
=
useState
(
false
);
const
[
isManager
,
setIsManager
]
=
useState
(
true
);
const
[
isManager
,
setIsManager
]
=
useState
(
true
);
const
[
isNormal
,
setIsNormal
]
=
useState
(
true
);
const
[
isNormal
,
setIsNormal
]
=
useState
(
true
);
const
[
choosedItem
,
setChooseItem
]
=
useState
({});
const
[
choosedItem
,
setChooseItem
]
=
useState
({});
const
[
roleIds
,
setRoleIds
]
=
useState
([]);
useEffect
(()
=>
{
useEffect
(()
=>
{
getEmployeeList
();
getEmployeeList
();
getStoreRole
();
},
[
query
]);
},
[
query
]);
function
getEmployeeList
()
{
function
getEmployeeList
()
{
...
@@ -70,11 +74,19 @@ function EmployeesManagePage() {
...
@@ -70,11 +74,19 @@ function EmployeesManagePage() {
});
});
}
}
function
getStoreRole
()
{
const
storeId
=
User
.
getStoreId
();
StoreService
.
getStoreRole
({
storeId
}).
then
((
res
:
any
)
=>
{
setRoleIds
(
res
.
result
);
});
}
function
parseColumn
()
{
function
parseColumn
()
{
return
[
return
[
{
{
title
:
"员工"
,
title
:
"员工"
,
dataIndex
:
"name"
,
dataIndex
:
"n
ickN
ame"
,
render
:
(
val
:
string
)
=>
{
render
:
(
val
:
string
)
=>
{
return
(
return
(
<
div
className=
"coupon-info"
>
<
div
className=
"coupon-info"
>
...
@@ -188,50 +200,34 @@ function EmployeesManagePage() {
...
@@ -188,50 +200,34 @@ function EmployeesManagePage() {
onChange=
{
(
event
)
=>
{
onChange=
{
(
event
)
=>
{
const
val
=
event
.
target
.
value
;
const
val
=
event
.
target
.
value
;
const
_query
=
{
...
query
};
const
_query
=
{
...
query
};
_query
.
name
=
val
;
_query
.
n
ickN
ame
=
val
;
setQuery
(
_query
);
setQuery
(
_query
);
}
}
}
}
onSearch=
{
()
=>
getEmployeeList
()
}
onSearch=
{
()
=>
getEmployeeList
()
}
/>
/>
{
/* <Search placeholder="input search text" style={{ width: 200 }} /> */
}
</
div
>
</
div
>
<
div
style=
{
{
flex
:
1
}
}
>
<
div
style=
{
{
flex
:
1
}
}
>
身份:
身份:
<
CheckBox
{
_
.
map
(
roleIds
,((
item
:
any
)
=>
{
text=
"普通讲师"
return
<
CheckBox
text=
{
item
.
name
}
name=
{
item
.
roleCode
}
onChange=
{
(
e
:
any
)
=>
{
onChange=
{
(
e
:
any
)
=>
{
const
{
checked
}
=
e
.
target
;
// const
{
checked
}
=
e
.
target
;
setIsNormal
(
checked
);
// setIsNormal(checked);
const
_query
=
{
...
query
};
// const _query =
{
...
query
};
_query
.
identity
=
checked
// if(checked)
{
?
isManager
// _query.roleId.push();
?
"ALL"
//
}
else
{
:
"NORMAL"
// const index = _query.roleId.indexOf();
:
isManager
// _query.roleId.slice(index,1);
?
"MANAGE"
//
}
:
"NONE"
;
// setQuery(_query);
setQuery
(
_query
);
}
}
}
}
defaultChecked=
{
isNormal
}
defaultChecked=
{
isNormal
}
/>
/>
<
CheckBox
}))
}
text=
"管理员"
onChange=
{
(
e
:
any
)
=>
{
const
{
checked
}
=
e
.
target
;
setIsManager
(
checked
);
const
_query
=
{
...
query
};
_query
.
identity
=
checked
?
isNormal
?
"ALL"
:
"MANAGE"
:
isNormal
?
"NORMAL"
:
"NONE"
;
setQuery
(
_query
);
}
}
defaultChecked=
{
isManager
}
/>
</
div
>
</
div
>
</
div
>
</
div
>
<
Button
<
Button
...
...
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