popup.js
1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* @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()
}