<template>
<div :class="type">
  <el-dialog :visible.sync="visible" :center="true" :width="width" :before-close="handleClose" :close-on-click-modal="clickModalClose">
    <div slot="title" class="dialog-title">
      <span class="dialog-title-name">{{titleName}}</span>
    </div>
   <div :class="{'text-center':type != 'right'}" >
      <slot name='content'></slot>
    </div>
    <div v-if="showBtns" class="dialog-footer-btn" :style="{'width':width}">
        <slot name='footer'></slot>
    </div>

  </el-dialog>
 </div>
</template>

<script>

export default {
  name:"syDialog",
  data() {
    return {
    }
  },
  watch: {
   
  },
 props:{
     titleName:String,
     visible:Boolean,
     clickModalClose:{type:Boolean,default:true},
     width:{type:String,default:'40%'},
     type:{type:String,default:'down'},
     shopIcon:{type:Boolean,default:false},
     showBtns:{type:Boolean,default:true},
    },
  methods: {
      handleClose(done) {
         this.$emit('close');
      },
      handleCommand(command){
        this.$emit('eventclick', {value:command});
      }
  }
}
</script>
<style type="text/scss" lang="scss">
.right .dialog-fade-enter-active {
  -webkit-animation: dialog-fade-right-in .3s;
  animation: dialog-fade-right-in .3s; }

.right .dialog-fade-leave-active {
  -webkit-animation: dialog-fade-right-out .3s;
  animation: dialog-fade-right-out .3s; }

@keyframes dialog-fade-right-in {
  0% {
    transform: translate3d(100%, 0, 0);
    opacity: 0;
  }
  100% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}
@keyframes dialog-fade-right-out {
  0% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
  100% {
    transform: translate3d(100%, 0, 0);
    opacity: 0;
  }
}
.el-dialog{
  background-color:#FAFBFF!important;
}
.right .el-dialog{
  min-height:100%;
    margin: 0 auto 0;
    position: absolute;
    top: 0;
    left:auto;
    right:0;
    margin-top: 0!important;
}
.more_operation{
  position: absolute;
    top: 13px;
    right: 50px;
    padding: 0;
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    font-size: 16px;
    color: #909399;
}


.content{
  padding:25px 0;
}
.text-center{
  text-align: center;
}
.el-dialog__header{
    padding-bottom: 19px;
    border-bottom: 1px solid #DDE0EB;
}
.dialog-title{
    height: 33px;
    line-height: 33px;
    .dialog-title-name{
      font-size:24px;
      color:#808080;
    }
}

.rightNum {
	    line-height: 15px;
    position: absolute;
    color: #fff;
    z-index: 99;
    font-size: 12px;
    background-color: red;
    width: 15px;
    height: 15px;
    left: 80%;
    top: -1px;
    text-align: center;
    border-radius: 50%;
}
.dialog-footer-btn{
  position: fixed;
    bottom: 0;
    background-color: #fff;
    z-index: 10;
    margin-left: -25px;
    text-align: center;
    height: 65px;
    line-height: 65px;
    border: 1px solid #DDE0EB;
}


</style>