oak-general-business/app/pages/user/manage/index.tsx

53 lines
1.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import * as React from 'react';
import { Fab, Cell, Tag } from 'tdesign-mobile-react';
import { Icon } from 'tdesign-icons-react';
export default function render() {
const { t } = this;
const {
event
} = this.props;
const { stateColor, userArr } = this.state;
return (
<div style={{ height: '100vh' }}>
{userArr?.map((ele, index) => {
return (
<Cell
key={index}
onClick={() => this.onCellClicked(ele.id, event)}
image={<img className="avatar" src={ele.avatar} />}
title={ele.name || '未设置'}
description={
<div>
<div className="mobile">
{ele.mobile || '未设置'}
</div>
<div style={{ display: 'flex' }}>
<Tag theme={stateColor[ele.userState]}>
{t(`user:v.userState.${ele.userState}`)}
</Tag>
</div>
</div>
}
/>
);
})}
<Fab
style={{
bottom: 50,
right: 16,
}}
buttonProps={{
theme: 'primary',
}}
onClick={(event) => {
this.goNewUser();
}}
icon={<Icon name="add" />}
></Fab>
</div>
);
}