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

<script>
export default {
	data() {
		return {
			// cl-crud
			app: null
		};
	},
	mounted() {},
	methods: {
		// crud
		onLoad({ ctx, app }) {
			this.app = app;
			let applyHost = () => {
				return this.$service.sassShop.shopList();
			};
			ctx.service({
				page: applyHost
			})
				.set('table', {
					columns: [
						{
							prop: 'id',
							label: 'ID',
							align: 'center'
						},
						{
							prop: 'shopName',
							label: '门店名称',
							align: 'center'
						},
						{
							prop: 'merchantName',
							label: '商家',
							align: 'center'
						},
						{
							prop: 'shopProvince',
							label: '省',
							align: 'center'
						},
						{
							prop: 'shopCity',
							label: '市',
							align: 'center',
							emptyText: '无'
						},
						{
							prop: 'shopDist',
							label: '区',
							align: 'center',
							emptyText: '无'
						}
					],
					// 操作列
					op: {
						visible: false, // 是否显示
						// 同 element-ui Table-column Attributes
						props: {
							width: 150,
							align: 'center',
							fixed: 'right',
							label: '操作'
						},
						// 布局，请移步 `layout`
						layout: []
					}
				})
				.set('layout', [
					['slot-tabs'],
					['flex1', 'refresh-btn'],
					['data-table'],
					['flex1', 'pagination']
				])
				.done();
			app.refresh();
		}
	}
};
</script>
