<template>
    <div>
        <div class="headers">
            <div class="headers-name">专家明细 ｜5</div>
            <div>

                <el-form :inline="true" :model="form" class="demo-form-inline">
                    <el-form-item label="专家来源" size="small" style="position: relative;top: -3px;left: -10px;">
                        <el-select style=" border: 1px solid #DCDFE6;" v-model="form.value" placeholder="请选择"
                            class="selects">
                            <el-option v-for="item in options" :key="item.value" :label="item.label"
                                :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="研究领域" size="small" style="position: relative;top: -3px;">
                        <el-select style=" border: 1px solid #DCDFE6;" v-model="form.value" placeholder="请选择"
                            class="selects">
                            <el-option v-for="item in options" :key="item.value" :label="item.label"
                                :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item>

                        <el-button type="primary" size="small" class="tianjia2" @click="btnExtract">专家抽取</el-button>
                    </el-form-item>
                    <el-form-item>
                        <el-dropdown>
                            <span class="el-dropdown-link">
                                <el-button type="primary" size="small" class="tianjia">添加</el-button>
                            </span>
                            <el-dropdown-menu slot="dropdown">
                                <el-dropdown-item >
                                    <span @click="btnDan">单个添加</span>
                                </el-dropdown-item>
                                <el-dropdown-item>
                                    <span @click="btnpiliang">批量上传</span>
                                </el-dropdown-item>

                            </el-dropdown-menu>
                        </el-dropdown>

                    </el-form-item>
                </el-form>
            </div>
        </div>
        <div class="content-table">
            <el-table :data="tableData2" border style="width: 100%">
                <el-table-column fixed prop="name1" label="序号" align="center">
                </el-table-column>
                <el-table-column prop="name2" label="姓名" align="center">
                </el-table-column>

                <el-table-column prop="name3" label="专家来源" align="center">
                </el-table-column>
                <el-table-column prop="name4" label="研究领域" align="center">
                </el-table-column>
                <el-table-column prop="name5" label="联系方式" align="center">
                </el-table-column>
                <el-table-column prop="name6" label="所属单位" align="center" width="500">
                </el-table-column>

                <el-table-column fixed="right" label="操作" align="center" width="130">
                    <template slot-scope="scope">
                        <el-button @click="handleClick(scope.row)" type="text" size="small">主页</el-button>
                        <el-button @click="handleClick(scope.row)" type="text" size="small" style="color: #F56C6C;">删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
            <div class="footer">
                <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
                    :current-page="currentPage" :page-sizes="[100, 200, 300, 400]" :page-size="100"
                    layout="total, sizes, prev, pager, next, jumper" :total="400">
                </el-pagination>
            </div>
        </div>

        <!-- 添加部门 -->
        <el-dialog :visible.sync="dialogVisible" width="50%">
            <div class="dialog-header">编辑专家信息</div>
            <div class="contents">
                <div class="container">
                    <el-table :data="tableData" border style="width: 100%">
                        <el-table-column prop="date" label="姓名">
                        </el-table-column>
                        <el-table-column prop="name" label="专家来源">
                            <el-select v-model="value" placeholder="请选择">
                                <el-option v-for="item in options" :key="item.value" :label="item.label"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </el-table-column>
                        <el-table-column prop="address" label="研究领域">
                            <el-select v-model="value" placeholder="请选择">
                                <el-option v-for="item in options" :key="item.value" :label="item.label"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </el-table-column>
                        <el-table-column prop="address" label="联系方式">
                            <el-input v-model="input" size="small" placeholder="请输入内容"></el-input>
                        </el-table-column>
                        <el-table-column prop="address" label="所属单位">
                            <el-input v-model="input" size="small" placeholder="请输入内容"></el-input>
                        </el-table-column>
                    </el-table>
                </div>
            </div>
            <div slot="footer" class="dialog-footer">
                <el-button @click="dialogVisible = false" size="small">取 消</el-button>
                <el-button type="primary" style="background-color: #5165f7;" @click="dialogVisible = false"
                    size="small">确
                    定</el-button>
            </div>
        </el-dialog>


    </div>
</template>
<script>
export default {
    data() {
        return {
            value:"",
            from:{
                value:""
            },
            tableData2: [
                {
                    name1: 1,
                    name2: '小王',
                    name3: '上海专家',
                    name4: '微生物',
                    name5: "18455455",
                    name6: "上海研究所",

                }
            ],
            tableData: [{
                date: '王小虎',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1518 弄'
            }, {
                date: '小李',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1517 弄'
            },],
            listDate: [
                {
                    value1: "",
                    value2: "",
                    value3: "",
                },
                {
                    value1: "",
                    value2: "",
                    value3: "",
                }
            ],
            performanceShow: false,
            input: "",
            dialogVisible: false,
            currentPage: 1,

            options3: [
                {
                    value: 1,
                    label: "有效"
                },
                {
                    value: 2,
                    label: "无效"
                }
            ],
            options2: [
                {
                    value: 1,
                    label: "本年 (期)"
                },
                {
                    value: 2,
                    label: "2025"
                }
            ],
            options: [
                {
                    value: 1,
                    label: "全部"
                },
                {
                    value: 2,
                    label: "2025"
                }
            ],
            form: {
                value3: "",
                value: "全部",
                value2: "本年 (期)"
            }
        }
    },
    beforeDestroy() {
    // 如果子组件有自己的Element UI组件
    if (this.$refs.dropdown) {
      this.$refs.dropdown.hide();
    }
  },
    methods: {
        //抽取
        btnExtract(){
            this.$emit('getExtract')
        },
        //批量
        btnpiliang(){
            this.$emit('getPiliang')
        },
        //单个添加
        btnDan() {
            this.dialogVisible = true
        },
        //提交添加
        btnJixiao() {
            this.performanceShow = true
        },
        //添加
        btnAdd() {
            this.dialogVisible = true
        },
        handleSizeChange() {

        },
        handleCurrentChange() {

        },

        handleClick() {
            this.$emit('getaudit')
        }
    }
}
</script>
<style></style>
<style scoped>
.adds {
    width: 30px;
    height: 20px;
    background: #DCE0FD;
    color: #5065F6;
    position: relative;
    left: 54px;
    font-size: 14px;
    text-align: center;
    line-height: 18px;
    cursor: pointer;
}

.lies:hover .closes {
    opacity: 1;
    ;
    /* 鼠标滑过 .lies 时才显示 */
}

.closes {
    background: #FCF1EB;
    width: 20px;
    height: 30px;
    position: relative;
    top: 5px;
    cursor: pointer;
    text-align: center;
    line-height: 30px;
    color: #F04B4B;
    font-size: 20px;
    opacity: 0;
}

.first-border {
    /* border-top: 1px solid #DCE0FD */
}

.liee {
    background-color: #DCE0FD;
    color: #17192C;
    text-align: center
}

.lie {
    border: 1px solid #3333;
    width: 100px;
    height: 40px;
    line-height: 40px;
    border-right: none;
    border: none;
    border-bottom: 1px solid #EDEFFE
}

.lies {
    display: flex;
    /* border-bottom: 1px solid #EDEFFE */
}

.zhuyi {
    color: #5165f7;
    font-size: 14px;
    text-align: center;
    position: relative;
    top: -12px;
}

:deep(.el-input__wrapper) {
    box-shadow: none !important;
    padding-left: 7 !important;
    background: none !important;
}

/* 去掉内部输入框的padding */
:deep(.el-input__inner) {
    padding-left: 7 !important;
    border: none !important;
    background: none !important;
}

.th1 {
    width: 120px;
    /* 设置固定宽度（可以根据需要调整） */
    font-size: 13px;
    /* 字体大小比默认小 */
    text-align: right;
    /* 右对齐 */
    padding-right: 8px;
    border-right: 1px solid #DCE0FD;
    background: #EDEFFE !important;
    border-bottom: 1px solid #DCE0FD !important;
}

.container {
    width: 72%;
    margin: 0 auto;
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 25px;
    font-weight: 600;
    font-size: 24px;
}

.department-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.department-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.department-table tr {
    border: 1px solid #DCE0FD;
    cursor: pointer;
}

.department-table th {

    /* 淡紫色表头 */
    color: #5a4a6a;
    font-weight: 600;
    text-align: left;
    padding: 16px 20px;

}

.department-table td {
    background-color: white;
    padding: 5px 20px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.department-table tr:last-child td {
    border-bottom: none;
}

.department-table tr:hover td {
    background-color: #f9f9f9;
    transition: background-color 0.2s;
}

.empty-value {
    color: #999;
    font-style: italic;
}

.footer {
    text-align: center;
    margin-top: 25px;
    color: #888;
    font-size: 14px;
}

.contents {
    width: 90%;
    margin: 0 auto;
}

:deep .el-dialog__body {
    padding: 0 !important;
}

.dialog-footer {
    text-align: center;
    margin: 0 auto;
    margin-top: 12px;
}

.dialog-header {
    width: 100%;
    height: 54px;
    background: #F7F7FA;
    text-align: center;
    line-height: 54px;
    position: relative;
    top: -28px;
    color: #363636;
    font-weight: bold;
    font-size: 18px
}

:deep .el-tooltip__popper.is-dark {
    color: #F04B4B !important;
}

.footer {
    display: flex;
    justify-content: end;
    margin-top: 20px;
}

.tianjia {
    position: relative;
    top: -9px;
    background-color: #5065F6;
}

.tianjia2 {
    position: relative;
    top: -9px;
    background-color: #EDEFFE;
    color: #5065F6;
}

::v-deep .el-table thead {
    background-color: #DCE0FD !important;
    color: #363636 !important;
}

::v-deep .el-table__header th {
    background-color: #DCE0FD !important;
    color: #363636 !important;
}

.content-table {}

.formitem {
    position: relative;
    top: -5px;
}

::deep .el-form-item__label {
    font-size: 15px !important;
}

.selects {
    width: 100px;
}

.headers-name {
    font-size: 15px;
    position: relative;
    top: 14px;
}

.tubiao {
    position: relative;
    top: 22px;
    z-index: 99;
    left: -20px;
    cursor: pointer;
}

.headers {
    display: flex;
    justify-content: space-between
}
</style>