1:row(表格行), column(表格列), index(索引)
{
render(h, { row, column, index }) {
let html = ''
switch (row.state) {
case 1:
html = <Badge status="processing" text="排队中" />
break
case 2:
html = <Badge status="success" text="已完成" />
break
case 3:
html = <Badge status="error" text="自己撤单" />
break
}
return html
},
render(h, { row, column, index }) {
let html = ''
{
row.state ? (html = <Badge status="success" text="正常" />) : (html = <Badge status="error" text="禁用" />)
}
return html
},
},
render() {
const arr = [1, 2, 3, 4, 5, 6]
const lis = arr.map((item, index) => <li key={index}>{item}</li>)
return <ul>{lis}</ul>
},
2:row(表格行), column(表格列), index(索引)
const that=this
render(h, { row, column, index }) {
const html = (
<Tooltip placement="left">
<a href="javascript:void(0)">更多</a>
<div slot="content">
{that.util.hasRole('getMemberUsingPOST_1') && (
<Row>
<Button type="info" size="small" onClick={() => that.detailHandle(row)}>
操作1
</Button>
</Row>
)}
{(that.util.hasRole('updatePwdUsingPOST') ||
that.util.hasRole('updatePayPwdUsingPOST') ||
that.util.hasRole('updateLevelUsingPOST')) && (
<Row class="margin-top-10">
<Button type="info" size="small" onClick={() => that.onReaetPwd(row)}>
操作2
</Button>
</Row>
)}
{that.util.hasRole('createUsingPOST_7') && (
<Row class="margin-top-10">
<Button type="error" size="small" onClick={() => that.onAddBlack(row)}>
操作3
</Button>
</Row>
)}
{that.util.hasRole('disabledUserUsingPOST') && row.state == 1 && (
<Row class="margin-top-10">
<Button type="error" size="small" onClick={() => that.onDisabledMember(row, 0)}>
操作4
</Button>
</Row>
)}
{that.util.hasRole('beLiftedUsingPOST') && !row.state && (
<Row class="margin-top-10">
<Button type="info" size="small" onClick={() => that.onDisabledMember(row, 1)}>
操作5
</Button>
</Row>
)}
{that.util.hasRole('getMemberAndGroupAwardUsingPOST') && (
<Row class="margin-top-10">
<Button type="info" size="small" onClick={() => that.onOrganization(row)}>
操作6
</Button>
</Row>
)}
{that.util.hasRole('registerUsingPOST_1') && (
<Row class="margin-top-10">
<Button type="info" size="small" onClick={() => that.registerModel(row)}>
操作7
</Button>
</Row>
)}
{that.util.hasRole('updateLevelUsingPOST') && (
<Row class="margin-top-10">
<Button type="info" size="small" onClick={() => that.updataLeave(row)}>
操作8
</Button>
</Row>
)}
</div>
</Tooltip>
)
return html
},