popup.js
1.74 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
* @Description: 弹框组件的封装
* @Autor: renchao
* @LastEditTime: 2023-07-12 09:58:13
*/
import ywPopup from '@/components/ywPopup/index'
import Popup1 from '@/components/Popup1/index'
/**
* @description: popupDialog
* @param {*} title
* @param {*} url
* @param {*} params
* @param {*} width
* @param {*} isMain
* @param {*} height
* @param {*} btnShow
* @param {*} callback
* @param {*} cancel
* @author: renchao
*/
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 方法传递给弹框组件
})
}
/**
* @description: ywPopupDialog
* @param {*} title
* @param {*} url
* @param {*} params
* @param {*} width
* @param {*} isMain
* @param {*} height
* @param {*} btnShow
* @param {*} callback
* @param {*} cancel
* @author: renchao
*/
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 方法传递给弹框组件
})
}
/**
* @description: popupCacel
* @author: renchao
*/
export function popupCacel () {
Popup1().close()
}
/**
* @description: ywPopupCacel
* @author: renchao
*/
export function ywPopupCacel () {
ywPopupDialog().close()
}