//表格选择器配置

export default {
	pageSize: 10,													//表格每一页条数
	pageSizes: [10, 20, 30, 40, 50],								//表格可设置的一页条数
	paginationLayout: "total, sizes, prev, pager, next, jumper",	//表格分页布局，可设置"total, sizes, prev, pager, next, jumper"
	parseData: function (res) {
		return {
			data: res.content || res.records || (res.code == "fail" && [] || res.data) || res,				    //分析无分页的数据字段结构
			total: isNUllOrUndefined(res.totalElements) || isNUllOrUndefined(res.total) || "0",		    	//分析总数字段结构
			msg: res.message || "success",  						//分析描述字段结构
			code: res.code || 200
		}
	},
	request: {
		page: "current",					//规定当前分页字段
		pageSize: "size"					//规定一页条数字段
	},
	props: {
		label: "name",					//映射label显示字段
		value: "id"						//映射value值字段
	}
}

function isNUllOrUndefined(column) {
	if (column === null || column == undefined) return undefined
	return column + ""
}