const CmsModalMix = {
  data() {
    return {}
  },
  computed: {
    defaultModelConfig() {
      return Object.assign({
        'show-title-overflow': true,
        'destroy-on-close': true,
        'show-close': true,
        'show-zoom': true,
        'mask-closable': false,
        'esc-closable': true,
        'transfer': true,
        'fullscreen': false,
        'draggable': true,
        'dblclickZoom': true,
        'loading': false,
        'remember': false,
        'storage': false,
      }, this.modalConfig || {})
    }
  },
  props: {
    value: { // modal默认是否显示
      type: Boolean,
      default: () => {
        return false
      }
    },
    // 弹窗相关配置
    modalConfig: {
      type: Object,
      default: () => {
        return {
          showClose: true,
          fullscreen: false
        }
      }
    },
    showFooter: { // modal默认是否显示
      type: Boolean,
      default: () => {
        return true
      }
    },
    modalTitle: { // modal 标题
      type: String,
      default: () => {
        return ''
      }
    },
    modalWidth: { // modal 宽度
      type: [ String, Number ],
      default: () => {
        return '50%'
      }
    },
    modalHeight: { // modal 高度
      type: [ String, Number ],
      default: '50%'
    },
    modalCallback: {
      type: Function,
      required: false,
      default: () => {
        return undefined
      }
    },
    resize: {
      type: Boolean,
      default: () => {
        return true
      }
    },
    destroyOnClose: {
      type: Boolean,
      default: () => {
        return true
      }
    }
  },
  methods: {
    onOk() {
      this.$emit('confirm', false)
    },
  }
}

export { CmsModalMix }
