<template>
    <div>
        <el-dialog title="导入文件" :visible.sync="localtolead" width="400px" @close="handleClose">
            <div class="UPcondition">
                <p>上级单位:</p>
                <el-select v-model="superior" placeholder="请选择">
                    <el-option v-for="item in superiorOptions" :key="item.value" :label="item.label"
                        :value="item.value">
                    </el-option>
                </el-select>
            </div>
     

            <el-upload class="upload-demo" :file-list="fileList" drag
                action="https://jsonplaceholder.typicode.com/posts/" multiple>
                <i class="el-icon-upload"></i>
                <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
                <div class="el-upload__tip" slot="tip">
                    只能上传jpg/png文件，且不超过500kb
                </div>
            </el-upload>
            <span slot="footer" class="dialog-footer">
                <el-button type="primary" @click="filesubmit" size="small">提交</el-button>
            </span>
        </el-dialog>
    </div>
</template>

<script>
export default {
    props: {
        tolead: {
            type: Boolean,
            default: false
        }
    },
    computed: {
        localtolead: {
            get() {
                console.log(this.tolead);
                return this.tolead;
            },
            set(value) {
                // 在这里不进行任何修改
            }
        }
    },
    data() {
        return {
            superior: "",
            superiorOptions: [],
            fileList: [
                {
                    name: "food.jpeg",
                    url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100",
                },

            ],
        }
    },
    methods: {
        rowStyle() {
            return "text-align:center";
        },
        handleClose() {
            this.$emit('handleClose', false, 'tolead');
        }
        ,    // 附件提交
        filesubmit() {
            this.$emit('handleClose', false, 'tolead');
        },
    }
}
</script>

<style lang="scss" scoped>
.UPcondition {
    display: flex;

    p {
        width: 74px;
        text-align: right;
        line-height: 40px;
    }

    .el-select {
        width: 100%;
        margin-bottom: 20px;
    }

    .el-input {
        margin-bottom: 20px;
    }
}
</style>