Commit 28176584 by wufan

feat:联调上传头像

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