Commit 9f064025 by wufan

feat:完成axios和20%员工管理页

parent db5a63c0
import { Apollo } from "@/common/js/axios";
export function getEmployeeList(params: object) {
return Apollo("public/businessMicroWebsite/getMicroWebsiteCouponList", params);
}
\ No newline at end of file
export const storeRoleEnum = {
"0": "店铺管理员",
"1": "管理员",
"2": "普通讲师"
};
\ No newline at end of file
import { getEmployeeList } from '@/data-source/store/request-apis';
export default class StoreService {
// 获取员工列表
static getEmployeeList(params: any) {
return getEmployeeList(params);
}
}
\ No newline at end of file
/*
* @Author: wufan
* @Date: 2020-07-09 14:03:09
* @Last Modified by: mikey.zhaopeng
* @Last Modified time: 2020-11-25 18:23:40
* 店铺管理-员工管理
*/
import React, { useEffect, useState } from "react";
import { withRouter } from "react-router-dom";
import _ from "underscore";
import PageControl from "@/components/PageControl";
import { Button, Table, Tooltip, Modal, message, Row, Col } from "antd";
import { storeRoleEnum } from "@/domains/store-domain/constants";
import StoreService from "@/domains/store-domain/storeService";
import "./EmployeesManagePage.less";
const { confirm } = Modal;
declare var window: any;
function EmployeesManagePage() {
const [employeeList, setEmployeeList] = useState([
{
name: "赵云",
phone: "18767118672",
identity: "0",
},
]);
const [query, setQuery] = useState({
current: 0,
size: 10,
instId: "1837447" || window.currentUserInstInfo.instId,
});
const [total, setTotal] = useState(0);
const [model, setModel] = useState(null);
useEffect(() => {
getEmployeeList();
}, [query]);
function getEmployeeList() {
let _query = _.clone(query);
_query.current = query.current + 1;
StoreService.getEmployeeList(_query).then((res: any) => {
console.log(res.result.records);
setEmployeeList(res.result.records);
setTotal(res.result.total);
});
}
function parseColumn() {
return [
{
title: "员工",
dataIndex: "name",
render: (val: string) => {
return (
<div className="coupon-info">
<span className="title">{val}</span>
</div>
);
},
},
{
title: "手机号",
dataIndex: "phone",
key: "phone",
render: (val: string) => {
return <div>{val}</div>;
},
},
{
title: "身份",
dataIndex: "identity",
key: "identity",
render: (val: string = "1") => {
return <div>{/* {storeRoleEnum[val]} */}</div>;
},
},
{
title: "操作",
dataIndex: "operation",
render: (val: string, record: { identity: string }) => {
return record.identity === "0" || record.identity === "1" ? (
<div className="no-operate">-</div>
) : (
<div className="operation">
<span
className="opt-item"
onClick={() => handleEditEmployee(record)}
>
编辑
</span>
<span className="divider"></span>
<span
className="opt-item"
onClick={() => handleDeleteEmployee(record)}
>
删除
</span>
</div>
);
},
},
];
}
function handleEditEmployee(record: object) {}
function handleDeleteEmployee(record: object) {}
function handleToAddEmployee() {}
return (
<div className=" page coupon-list-page">
<div className="page-content">
<div className="content-header">员工管理</div>
<div className="box">
<div className="box-header">
{/* <Row type="flex" justify="space-between" align="top">
<Col></Col>
</Row> */}
<Button
onClick={() => {
handleToAddEmployee();
}}
type="primary"
className="add-show-btn"
>
添加员工
</Button>
</div>
<div className="box-body">
<Table
size={"middle"}
pagination={false}
dataSource={employeeList}
columns={parseColumn()}
rowKey={(item: any) => item.id}
bordered
/>
</div>
<div className="box-footer">
<PageControl
current={query.current}
pageSize={query.size}
total={total}
toPage={(page) => {
const queryStates = _.clone(query);
queryStates.current = page;
setQuery(queryStates);
}}
/>
</div>
</div>
{model}
</div>
</div>
);
}
export default withRouter(EmployeesManagePage);
const menuList = [
{
name: "课程管理",
code: "CourseManage",
icon: "&#xe733;",
childrens: [
{
name: "",
code: "StuFile",
hash: "/clue_manage"
},
{
name: "跟进管理",
code: "FollowManage",
hash: "/follow_manage"
}
]
},
{
name: "教务中心",
code: "EduAdministration",
icon: "&#xe734;",
childrens: [
{
name: "学员管理",
code: "StudentManagement",
hash: "/student"
},
{
name: "班级管理",
code: "ClassManagement",
hash: "/class_manager"
},
{
name: "课表管理",
code: "ScheduleManagement",
hash: "/plan/menu"
},
{
name: "上课记录",
code: "ClassRecord",
hash: "/class_record/take_name_record"
},
{
name: "课程管理",
code: "CourseManagement",
hash: "/course_fees_manage/course_manage"
},
{
name: "物品/费用",
code: "ProductExpense",
hash: "/course_fees"
},
{
name: "在线商城",
code: "onlineStore",
hash: "/mall",
isNew: true,
expired: 1600099200000
},
{
name: "老师管理",
code: "TeacherManagement",
hash: "/teacher"
},
{
name: "刷卡考勤",
code: "CardAttendance",
hash: "/attendance_card/record",
isShow: true
},
{
name: "人脸考勤",
code: "FaceAttendance",
hash: "/attendance_face",
isShow: true
}
]
},
{
name: "云课堂",
code: 'LiveCourse',
icon: "&#xe7ae;",
childrens: [
{
name: '大班直播',
code: 'BigLiveBroadcast',
hash: '/cloud_class_large'
},
{
name: '视频课',
code: 'VideoClass',
hash: '/cloudclass/video_course'
},
{
name: '互动班课',
code: 'InteractiveClass',
hash: '/cloud_class_interactive'
},
{
name: '资料云盘',
code: 'ClassBook',
hash: '/cloudclass/prepare_lesson'
// hash: '/cloud_class_prepare_lesson',
}
]
},
{
name: "家校互动",
code: "AfterClass",
icon: "&#xe732;",
childrens: [
{
name: "课后作业",
code: "Homework",
hash: "/home_school_homework"
},
{
name: "课后点评",
code: "StuTeaRating",
hash: "/teacher_student_evaluate/student"
},
{
name: "成长档案",
code: "GrowthFile",
hash: "/archives_list/class_record"
},
{
name: "电子相册",
code: "ElectronAlbums",
hash: "/album"
},
{
name: "成绩单",
code: "ScoreSheet",
hash: "/home_school_achievement"
},
{
name: "通知管理",
code: "NotificationManagement",
hash: "/home_school_notification"
}
]
},
{
name: "营销中心",
code: "MarketingCenter",
icon: "&#xe735;",
childrens: [
{
name: "小麦秀",
code: "XMShow",
hash: "/dynamic"
},
{
name: "麦田表单",
code: "XMForm",
hash: "/e_form"
},
{
name: '转介绍',
code: 'XMReferral',
hash: '/member_market_transfer_event'
},
{
name: "优惠券",
code: "XMCoupon",
hash: "/member_market/coupon"
},
{
name: "小麦粒",
code: ["XMpointsBasic", "XMpoints"],
hash: "/points_manage"
},
{
name: "微官网",
code: "MicoWebsite",
hash: "/new_site"
},
{
name: '礼品集市',
code: 'GiftMarket',
hash: '/market_mall'
}
]
},
{
name: "财务中心",
code: "FinanceCenter",
icon: "&#xe7f5;",
childrens: [
{
name: "订单管理",
code: "OrderManagement",
hash: "/order_manage/order_list"
},
{
name: "收支明细",
code: "IncomeExpenditure",
hash: "/income_expanse_manage/income_expanse_list"
},
{
name: "小麦收银",
code: "XMCounter",
hash: "/cash_list"
},
{
name: "小麦钱包",
code: "XMWallet",
hash: "/xm_finance"
},
{
name: "课消记录",
code: "ClassConsumeRecord",
hash: "/course_consumption_record"
},
{
name: '工资结算',
code: 'XMSalarySettlement',
hash: '/wage_calculation/payroll'
},
{
name: "充值管理",
code: "XMAsset",
hash: "/recharge_manage"
},
{
name: "保险",
code: "InsuranceOrder",
hash: "/insurance_list"
},
{
name: "确认收入报表",
code: "ConfirmIncome",
hash: "/income_confirm_form"
}
]
},
{
name: "数据中心",
code: "DataCenter",
icon: "&#xe6b3;",
childrens: [
{
name: "销售数据",
code: "SalesData",
hash: "/sales_data"
},
{
name: "教务数据",
code: "EduDate",
hash: "/academic_data"
},
{
name: "家校数据",
code: "ZeusData",
hash: "/zeus_data"
},
{
name: "财务数据",
code: "FinanceData",
hash: "/financial_data"
}
]
},
{
name: "机构设置",
code: "InstSetting",
icon: "&#xe6b1;",
childrens: [
{
name: "员工管理",
code: "AccountManagement",
hash: "/orgnization_account"
},
{
name: "规则设置",
code: "RuleSetting",
hash: "/academic_setting"
},
{
name: "机构展示",
code: "InstShow",
hash: "/orgnization_desc"
},
{
name: "操作日志",
code: "OperationLog",
hash: "/operation_log"
},
{
name: "服务订购",
code: "ServiceOrder",
hash: "/current_suit"
},
{
name: "短信管理",
code: "SMSManagement",
hash: "/account_setting"
}
]
}
];
export default menuList;
\ No newline at end of file
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