popup.js 1.15 KB
/*
 * @Description: 弹框组件的封装
 * @Autor: renchao
 * @LastEditTime: 2023-07-12 09:58:13
 */
import ywPopup from '@/components/ywPopup/index'
import Popup1 from '@/components/Popup1/index'
export function popupDialog (title, url, params, width = '75%', isMain, height, btnShow = false, callback, cancel) {
  // Popup.install
  Popup1(title, url, {
    height: height,
    width: width,
    formData: params,
    btnShow: btnShow,
    isMain: isMain,
    cancel: () => {
      cancel()
    },
    confirm: () => {
      callback()
    },
    popupDialog: popupDialog // 将 popupDialog 方法传递给弹框组件
  })
}

export function ywPopupDialog (title, url, params, width = '75%', isMain, height, btnShow = true, callback, cancel) {
  // Popup.install
  ywPopup(title, url, {
    height: height,
    width: width,
    formData: params,
    btnShow: btnShow,
    isMain: isMain,
    cancel: () => {
      cancel()
    },
    confirm: () => {
      callback()
    },
    popupDialog: popupDialog // 将 popupDialog 方法传递给弹框组件
  })
}

export function popupCacel () {
  Popup1().close()
}
export function ywPopupCacel () {
  ywPopupDialog().close()
}