@@ -55,13 +55,14 @@ const handleUpdate = async (fields) => { | |||||
* 删除节点 | * 删除节点 | ||||
* @param selectedRows | * @param selectedRows | ||||
*/ | */ | ||||
const handleRemove = async (selectedRows) => { | |||||
const handleRemove = async (record) => { | |||||
const hide = message.loading('正在删除'); | const hide = message.loading('正在删除'); | ||||
if (!selectedRows) return true; | |||||
if (!record) return true; | |||||
try { | try { | ||||
await removeRole(selectedRows.map((row) => row.id)); | |||||
await removeRole([record.id]).then(r => { | |||||
message.success(r.data); | |||||
}) | |||||
hide(); | hide(); | ||||
message.success('删除成功,即将刷新'); | |||||
return true; | return true; | ||||
} catch (error) { | } catch (error) { | ||||
hide(); | hide(); | ||||
@@ -160,9 +161,11 @@ const roleManager = () => { | |||||
disabled={record.code == 'sys_manager_role'} | disabled={record.code == 'sys_manager_role'} | ||||
style={{ pointerEvents: record.code == 'sys_manager_role' ? 'none' : 'auto' }} | style={{ pointerEvents: record.code == 'sys_manager_role' ? 'none' : 'auto' }} | ||||
onClick={() => { | onClick={() => { | ||||
removeRole([record.id]).then(r => { | |||||
actionRef.current.reload(); | |||||
}) | |||||
handleRemove(record); | |||||
// removeRole([record.id]).then(r => { | |||||
// message.success(r); | |||||
// actionRef.current.reload(); | |||||
// }) | |||||
}} | }} | ||||
> | > | ||||
删除 | 删除 | ||||
@@ -28,7 +28,7 @@ export async function add(params) { | |||||
} | } | ||||
//修改 | //修改 | ||||
export async function edit(params) { | export async function edit(params) { | ||||
return request('/kitchen/api/role/update', { | |||||
return request('/kitchen/api/role/update', { | |||||
method: 'POST', | method: 'POST', | ||||
data: { | data: { | ||||
...params, | ...params, | ||||
@@ -88,31 +88,13 @@ const EnterpriseLog = () => { | |||||
}; | }; | ||||
}, | }, | ||||
}; | }; | ||||
const getAvatarURL = () => { | |||||
if (CompanyInfo) { | |||||
if (CompanyInfo.logo) { | |||||
console.log(url); | |||||
setUrl(CompanyInfo.logo); | |||||
return CompanyInfo.logo; | |||||
} | |||||
setUrl('https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png'); | |||||
const url1 = 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png'; | |||||
return url1; | |||||
} | |||||
setUrl(''); | |||||
return ''; | |||||
}; | |||||
return ( | return ( | ||||
<div className={styles.baseView}> | <div className={styles.baseView}> | ||||
{loading ? null : ( | {loading ? null : ( | ||||
<> | <> | ||||
<div className={styles.right}> | <div className={styles.right}> | ||||
<AvatarView | <AvatarView | ||||
avatar={getAvatarURL} | |||||
url={url ? url : CompanyInfo.logo} | |||||
url={CompanyInfo.logo ? CompanyInfo.logo:'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png' } | |||||
uploadProp={uploadProps} | uploadProp={uploadProps} | ||||
/> | /> | ||||
</div> | </div> | ||||
@@ -40,7 +40,7 @@ const CreateForm = (props) => { | |||||
<Input /> | <Input /> | ||||
</Form.Item> | </Form.Item> | ||||
<Form.Item name="account" label="用户账户" rules={[{ required: true, max: 255 }]}> | <Form.Item name="account" label="用户账户" rules={[{ required: true, max: 255 }]}> | ||||
<Input placeholder="请输入用户账户" /> | |||||
<Input placeholder="请输入用户账户" disabled={props.values.id?true:false} /> | |||||
</Form.Item> | </Form.Item> | ||||
<Form.Item name="name" label="用户姓名" rules={[{ required: true, max: 255 }]}> | <Form.Item name="name" label="用户姓名" rules={[{ required: true, max: 255 }]}> | ||||
<Input placeholder="请输入用户姓名" /> | <Input placeholder="请输入用户姓名" /> | ||||