<template>
    <div class="page">
        <div class="top adfac">
            <img src="@/assets/images/agent/arrow_left.png" @click="handleBack">
            <span>{{ questionnaireName }}</span>
        </div>
        <div class="content">
            <div class="c_top adfacjb">
                <div class="ct_l adfac">
                    <div class="cl_title">问卷作答进度</div>
                    <div class="cl_pre">发布时间：<span>{{ '2025-05-02 14:00:00' }}</span></div>
                    <div class="cl_pre">截止时间：<span>{{ '2025-05-02 14:00:00' }}</span></div>
                    <div class="cl_pre">项目名称：<span>{{ 'TechCorp 领导团队评估' }}</span></div>
                </div>
                <div class="ct_r adfac">
                    <template v-if="multipleSelection.length">
                        <p>已选择：<span>{{ multipleSelection.length }}人</span></p>
                        <el-button type="default" style="margin-left: 20px;" @click="handleCancel">取消</el-button>
                    </template>
                    <el-button type="primary" style="margin-left: 20px;" @click="handleReminds">批量提醒</el-button>
                </div>
            </div>
            <div class="c_nums adfac">
                <div class="cn_pre">团队人数：<span>{{ 30 }}</span></div>
                <div class="cn_pre">已作答：<span>{{ 27 }}</span> 人</div>
                <div class="cn_pre">未作答：<span style="color: #E22D48;">{{ 3 }}</span> 人</div>
            </div>
            <el-table :data="userList" border cell-class-name="vertical-top-cell" v-loading="loading" empty-text="暂无人员" max-height="672px" style="margin-top: 16px;" @selection-change="handleSelectionChange">
                <el-table-column type="selection" width="55"></el-table-column>
                <el-table-column label="姓名" prop="aaa"></el-table-column>
                <el-table-column label="性别" prop="bbb">
                    <template #default="{ row }"></template>
                </el-table-column>
                <el-table-column label="手机号码" prop="aaa"></el-table-column>
                <el-table-column label="所属部门" prop="aaa"></el-table-column>
                <el-table-column label="职位" prop="aaa"></el-table-column>
                <el-table-column label="用户标签" prop="aaa"></el-table-column>
                <el-table-column label="发送人" prop="aaa"></el-table-column>
                <el-table-column label="所属上级" prop="aaa"></el-table-column>
                <el-table-column label="状态" prop="status">
                    <template #default="{ row }"></template>
                </el-table-column>
                <el-table-column label="提交时间" prop="aaa"></el-table-column>
                <el-table-column label="操作" width="150">
                    <template #default="scope">
                        <el-button link type="text" size="mini" @click="handleReport(scope.row)" v-if="scope.row.status===1">查看报告</el-button>
                        <el-button link type="text" size="mini" @click="handleRemind(scope.row)" v-if="scope.row.status===0">提醒作答</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </div>
    </div>
</template>

<script setup name="">
    import { ref, getCurrentInstance } from 'vue'
    const { proxy } = getCurrentInstance();
    
    const questionnaireName = proxy.$route.query.questionnaireName;
    const multipleSelection = ref([])
    const userList = ref([{status:1},{status:0}])
    const loading = ref(false)
    const handleBack = () => {
        proxy.$router.go(-1)
    }
    const handleSelectionChange = (val) => {
        multipleSelection.value = val;
    }
    const handleCancel = () => {
        multipleSelection.value = []
    }
    const handleReminds = () => {
        if(!multipleSelection.value.length) return proxy.$message({ type: 'warning', message: '请选择需要提醒的人员' })
        proxy.$confirm('是否确认发送通知提醒？?', '警告', {
            confirmButtonText: '确定',
            confirmButtonColor:'#833478',
            cancelButtonText: '取消',
            type: 'warning'
        }).then(() => {
            
        })
    }

    const handleReport = (row) => {
        proxy.$router.push({ path: '/agentQuestionnaireReport' })
    }
    const handleRemind = (row) => {
        proxy.$confirm('是否确认发送通知提醒？?', '警告', {
            confirmButtonText: '确定',
            confirmButtonColor:'#833478',
            cancelButtonText: '取消',
            type: 'warning'
        }).then(() => {
            
        })
    }
</script>

<style scoped lang="scss">
    :v-deep .el-dialog__wrapper{
        background: rgba(0,0,0,.3) !important;
    }
    ::v-deep .el-dialog__title{
        font-weight: bold !important;
    }
    ::v-deep .el-dialog{
        margin-top: 15vh !important;
    }

    .page{
        background: #FAFAFA;
        
        .top{
            width: 100%;
            height: 64px;
            background: #FFFFFF;
            border-bottom: 1px solid #F3F4F6;
            img{
                width: 36px;
                height: 36px;
                margin-left: 16px;
                cursor: pointer;
            }
            span{
                font-family: PingFangSC, PingFang SC;
                font-weight: 400;
                font-size: 14px;
                color: #252525;
                line-height: 14px;
                margin-left: 27px;
            }
        }

        .content{
            width: calc(100% - 24px);
            height: calc(100vh - 88px);
            margin: 12px;
            background: #FFFFFF;
            border-radius: 6px 6px 0px 0px;
            border: 1px solid #F3F4F6;
            padding: 32px 24px;
            box-sizing: border-box;
            overflow-y: auto;

            .c_top{
                .ct_l{
                    .cl_title{
                        font-family: PingFang-SC, PingFang-SC;
                        font-weight: bold;
                        font-size: 16px;
                        color: #252525;
                        line-height: 16px;
                    }
                    .cl_pre{
                        font-family: PingFang-SC, PingFang-SC;
                        font-weight: bold;
                        font-size: 16px;
                        color: #808080;
                        line-height: 16px;
                        margin-left: 30px;
                        span{
                            color: #252525;
                        }
                    }
                }
                .ct_r{
                    p{
                        font-family: PingFang-SC, PingFang-SC;
                        font-weight: bold;
                        font-size: 16px;
                        color: #808080;
                        line-height: 16px;
                        span{
                            color: #252525;
                        }
                    }
                }
            }

            .c_nums{
                width: 100%;
                height: 68px;
                background: rgba(118,30,106,0.06);
                border-radius: 6px;
                margin-top: 37px;
                padding: 0 25px;
                box-sizing: border-box;
                .cn_pre{
                    font-family: PingFang-SC, PingFang-SC;
                    font-weight: bold;
                    font-size: 14px;
                    color: #808080;
                    margin-right: 153px;
                    span{
                        font-family: DINAlternate, DINAlternate;
                        font-size: 22px;
                        color: #1D2129;
                        line-height: 28px;
                    }
                }
            }
        }
    }
</style>