<template>
    <div class="authorityDialog">
        <el-dialog width="380px" style="min-width: ;" center title="数据权限" :visible.sync="authorityData.dialogVisible">
            <el-radio-group v-model="authorityData.dictValue">
                <el-radio v-for="item in authorityData.data" :label="item.dictValue">{{ item.dictLabel }}</el-radio>
            </el-radio-group>
            <span slot="footer" class="dialog-footer">
                <!-- <el-button @click="cancel()">取 消</el-button>
                <el-button type="primary" @click="updateAuthority()">确 定</el-button> -->
                <div class="search"  @click="updateAuthority()">保 存</div> 
                <div class="reset" @click="cancel()">取 消</div>                   
            </span>
        </el-dialog>
    </div>
</template>
<script>
export default {
    name: 'authorityDialog',
    props: {
        authorityData: {
            type: Object,
            default: {}
        }
    },
    created(){                    
    },
    data() {
        return {
            radio: ''
        }
    },
    methods:{
        updateAuthority(){               
            let payload = {
                dataPermission:this.authorityData.dictValue,
                id:this.authorityData.id
            }
            this.$emit('updateAuthority',payload)
            this.radio = ''
        },
        cancel(){
            this.radio = ''
            this.authorityData.dialogVisible = false
        }
    }
}
</script>
<style lang="scss" scoped>
.authorityDialog{
    .el-radio-group{
        display: block;        
        .el-radio{
            margin: 10px 0;
            display: block;
            position: relative;
            left: 50px;
        }
    }
}.dialog-footer{    
    div {        
        display: inline-block;
        width: 80px;
        height: 40px;
        border-radius: 2px;
        font-size: 14px;
        line-height: 40px;
        text-align: center;
      }

      div:hover {
        cursor: pointer;
      }
      .search {
        margin: 0 12px;
        background-color: #2766DD;
        color: #fff;
      }

      .search:hover {
        background-color: #4D85F4;
      }
      .reset {
        color: #333334;
        border: 1px solid #D7D7D7;
      }

      .reset:hover {
        color: #1F9FFF;
        border: 1px solid #1F9FFF;
      }
}
</style>