<template>
	<div class="app-list-content">
		<cl-crud class="liu-crud-wrap" @load="onLoad"></cl-crud>
	</div>
</template>

<script>
export default {
	name: 'assets-list',
	methods: {
		// cl-crud 组件ad
		onLoad({ ctx, app }) {
			this.app = app;
			ctx.service({
				page: () => {
					return this.$service.single.capitalList();
				}
			})
				.set('table', {
					columns: [
						{
							prop: 'id',
							label: 'id',
							align: 'center',
							'min-width': 100
						},
						{
							prop: 'userName',
							label: '姓名',
							align: 'center'
						},
						{
							prop: 'event',
							label: '收入类型',
							align: 'center'
						},
						{
							prop: 'payWay',
							label: '支付方式',
							align: 'center'
						},
						{
							prop: 'amount',
							label: '收支',
							align: 'center'
						},
						{
							prop: 'totalIncome',
							label: '累计收入',
							align: 'center'
						},
						{
							prop: 'addTime',
							label: '时间',
							align: 'center'
						}
					],
					// 操作列
					op: {
						visible: false, // 是否显示
						// 同 element-ui Table-column Attributes
						props: {
							width: 100,
							align: 'center',
							fixed: 'right',
							label: '操作'
						},
						// 布局，请移步 `layout`
						layout: []
					}
				})
				.set('layout', [
					['slot-tabs'],
					['flex1', 'refresh-btn', 'slot-add-ad-btn'],
					['data-table'],
					['flex1', 'pagination']
				])
				.done();
			app.refresh({ type: this.tabIndex });
		}
	}
};
</script>

<style lang="stylus" scoped></style>
