/*
   提示确认类型弹窗
 */

import modalFrame from "@/plugin/modalFrame"
import dialogConfirm from "./dialogConfirm.vue"

/**
 * @param obj
 *  text :文字
 *  btnShow:控制确认按钮显示
 *  headImg:头部图片
 */
type objType = {
   text: string
   btnShow?: [boolean?, boolean?]
   headImg?: string
   onCancel?: (...nargs: any[]) => void
   onOk?: (...nargs: any[]) => void
   onClose?: (...nargs: any[]) => void
}
export default ({ text, onCancel, onOk, onClose, btnShow, headImg }: objType) => {
   modalFrame({
      maskClose: true,
      template: dialogConfirm,
      width: 478,
      height: 248,
      btnShow: [],
      modalData: {
         text,
         btnShow: btnShow || [true, true],
         headImg
      },
      className: "useDialogConfirm",
      onCancel,
      onOk,
      onClose
   })
}
