Commit c8502300 by wufan

feat:联调员工管理

parent cc180c86
/*
* @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
......@@ -2,14 +2,18 @@
* @Author: wufan
* @Date: 2020-11-25 18:25:02
* @LastEditors: wufan
* @LastEditTime: 2020-12-01 15:30:16
* @LastEditTime: 2020-12-01 18:14:38
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import Service from "@/common/js/service";
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) {
......@@ -18,4 +22,4 @@ export function getUserList(params: object) {
export function getStoreDecorationList(params: object) {
return Service.Apollo("public/businessMicroWebsite/getMicroWebsiteCouponList", params);
}
\ No newline at end of file
}
/*
* @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
......@@ -2,11 +2,11 @@
* @Author: wufan
* @Date: 2020-11-25 18:25:02
* @LastEditors: wufan
* @LastEditTime: 2020-11-30 17:17:01
* @LastEditTime: 2020-12-01 18:13:50
* @Description: Description
* @@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 {
// 获取员工列表
......@@ -14,6 +14,11 @@ export default class StoreService {
return getEmployeeList(params);
}
// 获取店铺角色
static getStoreRole(params: any) {
return getStoreRole(params);
}
// 删除员工
static deleteEmployee(params: any) {
return getUserList(params);
......
......@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Date: 2020-04-27 20:35:34
* @LastEditors: wufan
* @LastEditTime: 2020-12-01 15:23:22
* @LastEditTime: 2020-12-01 17:17:43
* @Description:
*/
......@@ -13,12 +13,10 @@ import { ConfigProvider } from 'antd';
import { createHashHistory } from 'history';
import zh_CN from 'antd/es/locale/zh_CN';
import _ from 'underscore';
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, AxiosPromise } from 'axios';
import { RootRouter } from './routes/index';
import 'antd/dist/antd.less';
import '@/common/less/index.less';
import '@/core/function';
import User from '@/common/js/user';
import '@/common/less/index.less';
const history = createHashHistory();
......@@ -39,22 +37,8 @@ window.RCHistory = _.extend({}, history, {
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(
<RootRouter/>,
document.getElementById('root'));
......
/*
* @Author: 吴文洁
* @Date: 2019-07-10 10:30:49
* @LastEditors: wangyixi
* @LastEditTime: 2020-11-09 19:21:03
* @LastEditors: wufan
* @LastEditTime: 2020-12-01 17:30:13
* @Description:
*/
import React from 'react'
......@@ -13,6 +13,9 @@ import Menu from './Menu'
import Main from './Main'
import { Route, Switch } from 'react-router-dom'
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 {
constructor(props) {
......@@ -22,8 +25,18 @@ class App extends React.Component {
}
}
componentDidMount() {
this.getUserStore()
}
getUserStore = () => {
const userId = User.getUserId();
BaseService.getUserStore({ userId }).then((res) => {
console.log(res.result);
const { storeGroupVOS, storeVOS } = res.result;
});
}
render() {
return [
<div id="home">
......
......@@ -15,6 +15,7 @@ import { QuestionCircleOutlined } from '@ant-design/icons';
import { storeRoleEnum } from "@/domains/store-domain/constants";
import StoreService from "@/domains/store-domain/storeService";
import EmployeeAddOrEditModal from './EmployeeAddOrEditModal';
import User from '@/common/js/user';
import "./EmployeesManagePage.less";
const { confirm } = Modal;
......@@ -29,13 +30,13 @@ interface RecordTypes {
function EmployeesManagePage() {
const [employeeList, setEmployeeList] = useState([
{
name: "赵云",
nickName: "赵云",
phone: "18767118672",
role: "0",
storeUserId: "0"
},
{
name: "吕布",
nickName: "吕布",
phone: "18767118672",
role: "0",
storeUserId: "2"
......@@ -44,20 +45,23 @@ function EmployeesManagePage() {
const [query, setQuery] = useState({
current: 0,
size: 10,
name: "",
nickName: "",
phone: "",
identity: "ALL",
instId: "1837447" || window.currentUserInstInfo.instId,
roleId: [],
storeId: User.getStoreId(),
});
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 [roleIds, setRoleIds] = useState([]);
useEffect(() => {
getEmployeeList();
getStoreRole();
}, [query]);
function getEmployeeList() {
......@@ -70,11 +74,19 @@ function EmployeesManagePage() {
});
}
function getStoreRole() {
const storeId = User.getStoreId();
StoreService.getStoreRole({ storeId }).then((res: any) => {
setRoleIds(res.result);
});
}
function parseColumn() {
return [
{
title: "员工",
dataIndex: "name",
dataIndex: "nickName",
render: (val: string) => {
return (
<div className="coupon-info">
......@@ -188,50 +200,34 @@ function EmployeesManagePage() {
onChange={(event) => {
const val = event.target.value;
const _query = { ...query };
_query.name = val;
_query.nickName = val;
setQuery(_query);
}}
onSearch={() => getEmployeeList()}
/>
{/* <Search placeholder="input search text" style={{ width: 200 }} /> */}
</div>
<div style={{ flex: 1 }}>
身份:
<CheckBox
text="普通讲师"
{_.map(roleIds,((item:any) => {
return <CheckBox
text={item.name}
name={item.roleCode}
onChange={(e: any) => {
const { checked } = e.target;
setIsNormal(checked);
const _query = { ...query };
_query.identity = checked
? isManager
? "ALL"
: "NORMAL"
: isManager
? "MANAGE"
: "NONE";
setQuery(_query);
// const { checked } = e.target;
// setIsNormal(checked);
// const _query = { ...query };
// if(checked){
// _query.roleId.push();
// } else {
// const index = _query.roleId.indexOf();
// _query.roleId.slice(index,1);
// }
// setQuery(_query);
}}
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>
<Button
......
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