<template>
    <a-drawer
    :visible="CVvisible"
    class="drawerStyle CheckWork"
    placement="right"
    width="40%"
    @after-visible-change="afterVisibleChange"
    >
        <div class="drawerMain">
            <div class="headersub">
                <div class="headerTitle">查看投票</div>
                <img 
                style="width:29px;height:29px;cursor:pointer"
                src="../../assets/images/basicinfo/close.png" 
                @click="closeDrawer"
                />
            </div>
            <div class="headersup"><span>评估名称：<span style="color:#999ba3">管理者进阶投票</span></span></div>
            <div class="main">
                <div class="basetext"><span>投票说明</span></div>
                <div class="basequestion">
                    <div class="ques" v-for=" item,index  in queData" :key="index">
                        <div class="quename">{{ index+1 +"."+ item.quename }}</div>
                        <div class="queanswer">
                            <a-radio-group v-model:value="item.value">
                                <div class="queaboxs" :style="{display: item.quetype  ? 'flex' : 'block'}">
                                    <div class="queabox" v-for="items,index in item.answer" :key="index">
                                        <a-radio
                                            v-model:checked="checked"
                                            :value="items.value"
                                        >
                                            {{items.answercontent}}
                                        </a-radio>
                                    </div>
                                </div>
                            </a-radio-group>
                        </div>
                    </div>
                </div>
            </div>
            <div class="btnn">
                <button class="btn1">取消</button>
                <button class="btn2">确定</button>
            </div>
        </div>
    </a-drawer>
</template>

<script>
import { toRefs,reactive } from '@vue/reactivity';
export default {
    name:"CheckWork",
    props:{
        CVvisible:{
            type:Boolean,
            default:false,
        },
    },
    setup(props,ctx){
        const state = reactive({
            valueE1:"",
            queData:[
                {
                    quetype:false,
                    quename:"当前项目对您是否有帮助?",
                    value:1,
                    answer:[
                        {
                            value:1,
                            answercontent:"有帮助"
                        },
                        {   
                            value:2,
                            answercontent:"mei帮助"
                        }
                    ]
                },
                {
                    quetype:true,
                    quename:"当前项目对您是否有帮助memememememeemme?",
                    value:2,
                    answer:[
                        {
                            value:1,
                            answercontent:"有帮助"
                        },
                        {   
                            value:2,
                            answercontent:"mei帮助"
                        }
                    ]
                }
            ],
        })

        const closeDrawer = ()=> {
            ctx.emit("update:CVvisible",false)
        }
        const afterVisibleChange = (bool) => {
            console.log(bool);
        }
        return{
            ...toRefs(state),
            closeDrawer,
            afterVisibleChange,
        }
    }
};
</script>
<style lang="scss">
.CheckWork {
    .drawerMain {
        min-width: 400px;
        margin: 0px 32px 0px 32px;
        display: flex;
        flex-direction: column;
        .headersub {
            height: 73px;
            display: flex;
            justify-content: space-between;
            align-items: center;

            .headerTitle {
                font-size: 18px;
                font-weight: 600;
                color: #333333;
                line-height: 25px;
            }
        }
        .headersup{
            border-bottom: 1px solid #e8e8e8;
            padding-bottom: 20px;
        }
        .main {
            width: 100%;
            overflow-y: auto;
            margin-bottom: 70px;
            .basetext{
                color: #333333;
                line-height: 25px;
                margin-top: 27px ;
                margin-bottom: 27px ;
            }
            .basequestion{
                .ques{
                    .quename{
                        margin: 10px auto ;
                        font-weight: bold;
                    }
                    .queanswer{
                        padding-left: 20px;
                        .queabox{
                            margin-bottom: 10px;
                        }
                    }
                }
            }
        }

        .btnn {
            height: 72px;
            width: 100%;
            position: absolute;
            bottom: 0;
            left: 0;
            background-color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.16);
            .btn1 {
                width: 100px;
                height: 40px;
                border: 1px solid #4ea6ff;
                border-radius: 8px;
                color: #4ea6ff;
                background-color: #fff;
                cursor: pointer;
            }
            .btn2 {
                cursor: pointer;
                width: 100px;
                height: 40px;
                background: #4ea6ff;
                border-radius: 8px;
                border: 0;
                margin-left: 15px;
                color: #fff;
            }
        }
    }
}
</style>