Commit 28176584 by wufan

feat:联调上传头像

parent ee3c6e9d
...@@ -1381,13 +1381,6 @@ input:focus { ...@@ -1381,13 +1381,6 @@ input:focus {
} }
} }
// a {
// color: #FF7519 !important;
// &:active{
// border: none;
// }
// }
.xm_alert { .xm_alert {
padding: 5px 11px; padding: 5px 11px;
font-size: 14px; font-size: 14px;
...@@ -1660,3 +1653,9 @@ input:focus { ...@@ -1660,3 +1653,9 @@ input:focus {
.ant-table-tbody > tr.ant-table-row-selected td { .ant-table-tbody > tr.ant-table-row-selected td {
background: transparent !important; background: transparent !important;
} }
.ant-table.ant-table-bordered > .ant-table-container {
border: none !important;
}
.ant-table-bordered .ant-table-content {
border: 1px solid #e8e8e8 !important;
}
...@@ -64,7 +64,7 @@ function EmployeesManagePage() { ...@@ -64,7 +64,7 @@ function EmployeesManagePage() {
size: 10, size: 10,
nickName: "", nickName: "",
phone: "", phone: "",
roleCodes: [], roleCodes: ["StoreManager"],
storeId: User.getStoreId(), storeId: User.getStoreId(),
}); });
...@@ -84,6 +84,7 @@ function EmployeesManagePage() { ...@@ -84,6 +84,7 @@ function EmployeesManagePage() {
const roleMap = { const roleMap = {
CloudManager: "管理员", CloudManager: "管理员",
CloudLecturer: "讲师", CloudLecturer: "讲师",
StoreManager: "店铺管理员",
}; };
const storeId = User.getStoreId(); const storeId = User.getStoreId();
...@@ -104,7 +105,6 @@ function EmployeesManagePage() { ...@@ -104,7 +105,6 @@ function EmployeesManagePage() {
let _query = _.clone(query); let _query = _.clone(query);
_query.current = query.current + 1; _query.current = query.current + 1;
StoreService.getEmployeeList(_query).then((res: any) => { StoreService.getEmployeeList(_query).then((res: any) => {
console.log(res.result.records);
setEmployeeList(res.result.records); setEmployeeList(res.result.records);
setTotal(res.result.total); setTotal(res.result.total);
}); });
...@@ -114,12 +114,18 @@ function EmployeesManagePage() { ...@@ -114,12 +114,18 @@ function EmployeesManagePage() {
StoreService.getStoreRole({ storeId }).then((res: any) => { StoreService.getStoreRole({ storeId }).then((res: any) => {
const data = [...res.result]; const data = [...res.result];
const _query = { ...query }; const _query = { ...query };
const _data = data.map((item: any) => {
let _data = _.filter(data, _item => {
return _item.roleCode !== "StoreManager";
});
_data = _.map(_data, (item: any) => {
item.isChecked = true; item.isChecked = true;
_query.roleCodes.push(item.roleCode); _query.roleCodes.push(item.roleCode);
return item; return item;
}); });
setQuery(_query); setQuery(_query);
setRoleIds(_data); setRoleIds(_data);
}); });
...@@ -181,23 +187,26 @@ function EmployeesManagePage() { ...@@ -181,23 +187,26 @@ function EmployeesManagePage() {
} }
function handleEditEmployee(record: RecordTypes) { function handleEditEmployee(record: RecordTypes) {
const { nickName, phone, roleCodes, avatar } = record; const { nickName, phone, roleCodes, avatar, id } = record;
const _choosesItem = { const _choosesItem = {
nickName: nickName, nickName: nickName,
phone: phone, phone: phone,
role: roleCodes, role: roleCodes,
avatar: avatar, avatar: avatar,
storeUserId: id,
}; };
setChooseItem(_choosesItem); setChooseItem(_choosesItem);
const model:React.ReactNode= <EmployeeAddOrEditModal const model: React.ReactNode = (
isOpen={true} <EmployeeAddOrEditModal
choosedItem={_choosesItem} isOpen={true}
onClose={() => { choosedItem={_choosesItem}
setModel(null); onClose={() => {
getEmployeeList(); setModel(null);
}} getEmployeeList();
/> }}
setModel(model); />
);
setModel(model);
} }
function handleDeleteEmployeeConfirm(record: RecordTypes) { function handleDeleteEmployeeConfirm(record: RecordTypes) {
...@@ -246,7 +255,7 @@ function EmployeesManagePage() { ...@@ -246,7 +255,7 @@ function EmployeesManagePage() {
}} }}
> >
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
{/* 搜索员工: 搜索员工:
<Search <Search
style={{ style={{
width: 300, width: 300,
...@@ -260,9 +269,8 @@ function EmployeesManagePage() { ...@@ -260,9 +269,8 @@ function EmployeesManagePage() {
setQuery(_query); setQuery(_query);
}} }}
onSearch={() => getEmployeeList()} onSearch={() => getEmployeeList()}
/> */} />
{/* <SearchBar
<SearchBar
label="搜索用户" label="搜索用户"
placeholder="搜索用户姓名/手机号" placeholder="搜索用户姓名/手机号"
style={{ style={{
...@@ -272,9 +280,7 @@ function EmployeesManagePage() { ...@@ -272,9 +280,7 @@ function EmployeesManagePage() {
value={valueLike} value={valueLike}
onSearch={(value: any) => { onSearch={(value: any) => {
const _query = { ...query }; const _query = { ...query };
if (value) { if (valu const isPhone = (value || "").match(/^\d+$/);
console.log("value", value);
const isPhone = (value || "").match(/^\d+$/);
const nameLike = isPhone ? "phone" : "nickName"; const nameLike = isPhone ? "phone" : "nickName";
setValueLike(value); setValueLike(value);
_query[nameLike] = value; _query[nameLike] = value;
...@@ -284,7 +290,7 @@ function EmployeesManagePage() { ...@@ -284,7 +290,7 @@ function EmployeesManagePage() {
} }
setQuery(_query); setQuery(_query);
}} }}
/> /> */}
</div> </div>
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
......
/* /*
* @Author: wufan * @Author: wufan
* @Date: 2020-11-27 16:21:49 * @Date: 2020-11-27 16:21:49
* @LastEditors: zhangleyuan * @LastEditors: wufan
* @LastEditTime: 2020-12-04 15:28:43 * @LastEditTime: 2020-12-07 16:00:56
* @Description: Description * @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
......
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