vue2-components-plus 1.0.33 → 1.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -141,62 +141,89 @@ const openDialog = (options = {}) => {
|
|
|
141
141
|
proxy.$message.error('NsDialog 尚未挂载到全局')
|
|
142
142
|
return
|
|
143
143
|
}
|
|
144
|
-
const offset = openIndex.value * 24
|
|
145
144
|
const readOnly = !!options.readOnly
|
|
146
|
-
const
|
|
147
|
-
|
|
145
|
+
const dialogConfig = {
|
|
146
|
+
title: options.title || 'NsDialog 示例(setup)',
|
|
147
|
+
class: 'dialog-demo-instance',
|
|
148
|
+
dom: FormDemo,
|
|
149
|
+
width: options.width || '900px',
|
|
150
|
+
height: options.height || '500px',
|
|
151
|
+
dialogPadding: [10, 10],
|
|
152
|
+
modal: options.modal !== undefined ? options.modal : false,
|
|
153
|
+
draggable: true,
|
|
154
|
+
maxSize: () => ({
|
|
155
|
+
width: '100%',
|
|
156
|
+
height: '100%',
|
|
157
|
+
x: 0,
|
|
158
|
+
y: 0,
|
|
159
|
+
}),
|
|
160
|
+
x: `calc(50% - 450px)`,
|
|
161
|
+
y: `calc(50% - 250px)`,
|
|
162
|
+
option: {
|
|
148
163
|
readOnly,
|
|
149
164
|
insideDialog: true,
|
|
150
165
|
hintText: readOnly ? '当前是只读弹窗内容。' : '可以在弹窗中直接编辑表单并触发事件。',
|
|
166
|
+
...(options.option || {}),
|
|
151
167
|
},
|
|
152
|
-
|
|
153
|
-
)
|
|
154
|
-
const baseEvents = Object.assign(
|
|
155
|
-
{
|
|
168
|
+
events: {
|
|
156
169
|
btnClick: handleInnerButtonClick,
|
|
170
|
+
...(options.events || {}),
|
|
157
171
|
},
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
modal: options.modal !== undefined ? options.modal : false,
|
|
171
|
-
draggable: true,
|
|
172
|
-
maxSize: () => ({
|
|
173
|
-
width: '100%',
|
|
174
|
-
height: '100%',
|
|
175
|
-
x: 0,
|
|
176
|
-
y: 0,
|
|
177
|
-
}),
|
|
178
|
-
x: `calc(50% - 450px)`,
|
|
179
|
-
y: `calc(50% - 250px)`,
|
|
180
|
-
domCompleted: (domRef) => {
|
|
181
|
-
if (!options.silent && domRef && typeof domRef.showToast === 'function') {
|
|
182
|
-
domRef.showToast('弹窗内容已加载完成')
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
confirm: (closeFn, componentRef) => {
|
|
186
|
-
if (componentRef && typeof componentRef.showToast === 'function') {
|
|
187
|
-
componentRef.showToast('点击了弹窗底部确认按钮')
|
|
172
|
+
domCompleted: (domRef) => {
|
|
173
|
+
if (!options.silent && domRef && typeof domRef.showToast === 'function') {
|
|
174
|
+
domRef.showToast('弹窗内容已加载完成')
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
confirm: (closeFn, componentRef) => {
|
|
178
|
+
if (componentRef && typeof componentRef.showToast === 'function') {
|
|
179
|
+
componentRef.showToast('点击了弹窗底部确认按钮')
|
|
180
|
+
}
|
|
181
|
+
setTimeout(() => {
|
|
182
|
+
if (typeof closeFn === 'function') {
|
|
183
|
+
closeFn()
|
|
188
184
|
}
|
|
189
|
-
|
|
190
|
-
if (typeof closeFn === 'function') {
|
|
191
|
-
closeFn()
|
|
192
|
-
}
|
|
193
|
-
}, 300)
|
|
194
|
-
},
|
|
195
|
-
close: refreshInstances,
|
|
196
|
-
closed: refreshInstances,
|
|
185
|
+
}, 300)
|
|
197
186
|
},
|
|
198
|
-
|
|
199
|
-
|
|
187
|
+
close: refreshInstances,
|
|
188
|
+
closed: refreshInstances,
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (options.extraConfig) {
|
|
192
|
+
const extraConfig = options.extraConfig
|
|
193
|
+
if (Object.prototype.hasOwnProperty.call(extraConfig, 'modalColor')) {
|
|
194
|
+
dialogConfig.modalColor = extraConfig.modalColor
|
|
195
|
+
}
|
|
196
|
+
if (Object.prototype.hasOwnProperty.call(extraConfig, 'closeOnClickModal')) {
|
|
197
|
+
dialogConfig.closeOnClickModal = extraConfig.closeOnClickModal
|
|
198
|
+
}
|
|
199
|
+
if (Object.prototype.hasOwnProperty.call(extraConfig, 'immediately')) {
|
|
200
|
+
dialogConfig.immediately = extraConfig.immediately
|
|
201
|
+
}
|
|
202
|
+
if (Object.prototype.hasOwnProperty.call(extraConfig, 'headerDom')) {
|
|
203
|
+
dialogConfig.headerDom = extraConfig.headerDom
|
|
204
|
+
}
|
|
205
|
+
if (Object.prototype.hasOwnProperty.call(extraConfig, 'headerOption')) {
|
|
206
|
+
dialogConfig.headerOption = extraConfig.headerOption
|
|
207
|
+
}
|
|
208
|
+
if (Object.prototype.hasOwnProperty.call(extraConfig, 'headerEvents')) {
|
|
209
|
+
dialogConfig.headerEvents = extraConfig.headerEvents
|
|
210
|
+
}
|
|
211
|
+
if (Object.prototype.hasOwnProperty.call(extraConfig, 'footerDom')) {
|
|
212
|
+
dialogConfig.footerDom = extraConfig.footerDom
|
|
213
|
+
}
|
|
214
|
+
if (Object.prototype.hasOwnProperty.call(extraConfig, 'footerOption')) {
|
|
215
|
+
dialogConfig.footerOption = extraConfig.footerOption
|
|
216
|
+
}
|
|
217
|
+
if (Object.prototype.hasOwnProperty.call(extraConfig, 'footerEvents')) {
|
|
218
|
+
dialogConfig.footerEvents = extraConfig.footerEvents
|
|
219
|
+
}
|
|
220
|
+
if (Object.prototype.hasOwnProperty.call(extraConfig, 'footerCloseOnly')) {
|
|
221
|
+
dialogConfig.footerCloseOnly = extraConfig.footerCloseOnly
|
|
222
|
+
}
|
|
223
|
+
if (Object.prototype.hasOwnProperty.call(extraConfig, 'showFooter')) {
|
|
224
|
+
dialogConfig.showFooter = extraConfig.showFooter
|
|
225
|
+
}
|
|
226
|
+
}
|
|
200
227
|
window.NsDialog(
|
|
201
228
|
dialogConfig,
|
|
202
229
|
true,
|