<template>
    <el-dialog v-el-drag-dialog title="人员情况" :visible.sync="dialogVisible" width="40%" 
        :before-close="handleClose"  @open="handleDialogOpen">
        <div class="info-personInfo">
            <div class="personInfo-content">
                <div v-for="item in personList" class="everyPersonList">
                    <span v-text="item.userId" @click="selectPerson(item);"></span>
                </div>
            </div>
        </div>
    </el-dialog>
</template>


<script>
import elDragDialog from "@/util/directive/el-dragDialog";
export default {
    data() {
        return {
            dialogVisible: false,
            personList: []
        }
    },
    directives: {
        elDragDialog
    },
    props: {
        // visible: Boolean,
        peopleList: Array
    },
    methods: {
        handleClose() {
            this.dialogVisible = false;
            // this.$emit('handleCancel');
        },
        showDialog() {
            this.dialogVisible = true;
        },
        handleDialogOpen() {
            // this.dialogVisible = this.$props.visible;
            this.personList = this.$props.peopleList;
        }
    },
    // mounted() {
    //     this.dialogVisible = this.$props.visible;
    //     this.personList = this.$props.peopleList;
    // }
}
</script>


<style lang="scss">
.info-personInfo {
    width: 100%;
    height: 30%;
    overflow-y: auto;

    .title {
        width: 100%;
        height: 30px;
        line-height: 30px;

        img {
            width: 20px;
            height: 20px;
        }

        span {
            font-size: 16px;
            font-weight: 500;
            color: white;
            vertical-align: text-bottom;
        }
    }

    .personInfo-content {
        width: 100%;
        height: calc(100% - 30px);

        .everyPersonList {
            width: 100%;
            height: 35px;
            line-height: 35px;
            margin-top: 10px;
            padding: 0px 50px;
            font-size: 13px;
            color: #f1f1f7;
            box-sizing: border-box;

            &:nth-child(3n) {
                background-image: url(../../../assets/img/ddkz/12.png);
                background-size: 100% 100%;
            }

            &:nth-child(3n+1) {
                background-image: url(../../../assets/img/ddkz/13.png);
                background-size: 100% 100%;
            }

            &:nth-child(3n+2) {
                background-image: url(../../../assets/img/ddkz/14.png);
                background-size: 100% 100%;
            }

            &>span {
                float: left;
                margin-left: 10px;

                &:hover {
                    color: green;
                    cursor: pointer;
                }

                &>span:first-child {
                    float: left;
                }

                &>span:last-child {
                    width: 10px;
                    height: 10px;
                    border-radius: 50%;
                    display: block;
                    float: left;
                    margin-top: 12.5px;
                    margin-left: 5px;
                }

            }
        }


    }
}
</style>