<template>
    <div>
       <el-dialog title="用户选择" width="800px" >
	   </el-dialog>
		
    </div>
</template>
<script>
    import {SystemUserList} from "../../../api/system/user";
    export default {
        data() {
            return {

                detial: {
					time      : "",
					nickname  : "",
					mobile    : "",
					data      : [],
                    page      : 1,
					loading   : true,
                    pageSize  : 0,
                    pageCount : 0,
                },
				loading:false,
				visible:false,
				
				
				options: {
				    shortcuts: [
				        {
				            text: '今天',
				            value() {
				                const end = new Date();
				                const start = new Date();
				                start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()));
				                return [start, end];
				            }
				        },
				        {
				            text: '昨天',
				            value() {
				                const end = new Date();
				                const start = new Date();
				                start.setTime(start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate() - 1)));
				                end.setTime(end.setTime(new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate())));
				                return [start, end];
				            }
				        },
				        {
				            text: '最近7天',
				            value() {
				                const end = new Date();
				                const start = new Date();
				                start.setTime(start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate() - 6)));
				                return [start, end];
				            }
				        },
				        {
				            text: '最近30天',
				            value() {
				                const end = new Date();
				                const start = new Date();
				                start.setTime(start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate() - 29)));
				                return [start, end];
				            }
				        },
				        {
				            text: '本月',
				            value() {
				                const end = new Date();
				                const start = new Date();
				                start.setTime(start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(), 1)));
				                return [start, end];
				            }
				        },
				        {
				            text: '本年',
				            value() {
				                const end = new Date();
				                const start = new Date();
				                start.setTime(start.setTime(new Date(new Date().getFullYear(), 0, 1)));
				                return [start, end];
				            }
				        }
				    ]
				},
            }
        },
		props:{
			selectData:{
				type:Array,
				default:()=>{
					return [];
				}
			},
			//是否单选
			single:{
				type:Boolean,
				default:true
			}
		},

        methods: {
			
            initView:function(){
				
                this.getData();
            },
			statusChange:function(status){
				this.detial.status = status;
				this.detial.page = 1
				this.getData()
			},


            //搜索栏目
            tapSeach:function () {
                this.detial.page = 1;
                this.getData();
            },
            //分页
            tapPage:function (page) {
                this.detial.page = page;
                this.getData();
            },
            getData: function () {
                var data = {};
                this.detial.loading = true;
				data.page      = this.detial.page;
				data.status    = this.detial.status;
				data.uid       = this.detial.uid;
				data.nickname  = this.detial.nickname;
				data.time      = this.detial.time;
				data.mobile    = this.detial.mobile;
				data.parent_uid= this.detial.parent_uid;
                SystemUserList(data)
                    .then(res => {
                        this.detial.loading   = false;
                        this.detial.data      = res.data.list;
                        this.detial.pageSize  = res.data.pageSize;
                        this.detial.pageCount = res.data.pageCount;
						this.detial.waitCount = res.data.waitCount;
                    })
                    .catch(err => {
                        this.detial.loading = false;
                        this.$alert('网络繁忙，加载失败，请稍等片刻在尝试!', '系统提示');
                    });
            },

        }
    }
</script>
<style scoped>

</style>
