index.ts 834 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. 提示确认类型弹窗
  3. */
  4. import modalFrame from "@/plugin/modalFrame"
  5. import dialogConfirm from "./dialogConfirm.vue"
  6. /**
  7. * @param obj
  8. * text :文字
  9. * btnShow:控制确认按钮显示
  10. * headImg:头部图片
  11. */
  12. type objType = {
  13. text: string
  14. btnShow?: [boolean?, boolean?]
  15. headImg?: string
  16. onCancel?: (...nargs: any[]) => void
  17. onOk?: (...nargs: any[]) => void
  18. onClose?: (...nargs: any[]) => void
  19. }
  20. export default ({ text, onCancel, onOk, onClose, btnShow, headImg }: objType) => {
  21. modalFrame({
  22. maskClose: true,
  23. template: dialogConfirm,
  24. width: 478,
  25. height: 248,
  26. btnShow: [],
  27. modalData: {
  28. text,
  29. btnShow: btnShow || [true, true],
  30. headImg
  31. },
  32. className: "useDialogConfirm",
  33. onCancel,
  34. onOk,
  35. onClose
  36. })
  37. }