tianheng-ui 0.0.70 → 0.0.72
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.
package/package.json
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
<template>
|
2
2
|
<el-dialog
|
3
3
|
class="th-dialog"
|
4
|
+
:class="[customClass]"
|
4
5
|
:visible.sync="visible"
|
6
|
+
:width="width"
|
7
|
+
:top="top"
|
5
8
|
:fullscreen="dialogFullscreen"
|
6
|
-
:close-on-click-modal="
|
9
|
+
:close-on-click-modal="closeOnClickModal"
|
10
|
+
:close-on-press-escape="closeOnPressEscape"
|
7
11
|
:show-close="false"
|
8
|
-
:
|
12
|
+
:modal="modal"
|
13
|
+
:modal-append-to-body="modalAppendToBody"
|
14
|
+
:append-to-body="appendToBody"
|
15
|
+
:before-close="handleBeforeClose"
|
16
|
+
:destroy-on-close="destroyOnClose"
|
9
17
|
>
|
10
|
-
<div slot="title">
|
11
|
-
<div
|
12
|
-
|
13
|
-
<
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
></i>
|
26
|
-
</div>
|
18
|
+
<div slot="title" class="th-dialog__header">
|
19
|
+
<div class="th-dialog__title">{{ title }}</div>
|
20
|
+
<div class="th-dialog__action">
|
21
|
+
<i
|
22
|
+
v-if="showFullscreen"
|
23
|
+
class="th-dialog__action_item"
|
24
|
+
:class="fullscreenIcon"
|
25
|
+
@click="handleFullscreenChange"
|
26
|
+
></i>
|
27
|
+
<i
|
28
|
+
v-if="showClose"
|
29
|
+
class="th-dialog__action_item "
|
30
|
+
:class="closeIcon"
|
31
|
+
@click="handleBeforeClose"
|
32
|
+
></i>
|
27
33
|
</div>
|
28
34
|
</div>
|
29
35
|
<slot />
|
@@ -57,6 +63,17 @@ export default {
|
|
57
63
|
visible: Boolean,
|
58
64
|
loading: Boolean,
|
59
65
|
title: { type: String, default: "" },
|
66
|
+
width: { type: String, default: "800px" },
|
67
|
+
fullscreen: { type: Boolean, default: false },
|
68
|
+
top: { type: String, default: "15vh" },
|
69
|
+
modal: { type: Boolean, default: true },
|
70
|
+
modalAppendToBody: { type: Boolean, default: true },
|
71
|
+
appendToBody: { type: Boolean, default: false },
|
72
|
+
customClass: String,
|
73
|
+
closeOnClickModal: { type: Boolean, default: false },
|
74
|
+
closeOnPressEscape: { type: Boolean, default: false },
|
75
|
+
beforeClose: Function,
|
76
|
+
destroyOnClose: { type: Boolean, default: false },
|
60
77
|
|
61
78
|
showAffirm: { type: Boolean, default: true },
|
62
79
|
affirmText: { type: String, default: "确 认" },
|
@@ -67,7 +84,6 @@ export default {
|
|
67
84
|
showClose: { type: Boolean, default: true },
|
68
85
|
closeIcon: { type: String, default: "el-icon-close" },
|
69
86
|
|
70
|
-
fullscreen: { type: Boolean, default: false },
|
71
87
|
showFullscreen: { type: Boolean, default: true },
|
72
88
|
fullscreenIcon: { type: String, default: "el-icon-full-screen" },
|
73
89
|
|
@@ -89,6 +105,16 @@ export default {
|
|
89
105
|
this.$emit("input", !this.visible);
|
90
106
|
this.$emit("on-close");
|
91
107
|
},
|
108
|
+
handleBeforeClose(done) {
|
109
|
+
if (this.beforeClose) {
|
110
|
+
const callback = () => {
|
111
|
+
this.handleClose();
|
112
|
+
};
|
113
|
+
this.beforeClose(callback);
|
114
|
+
} else {
|
115
|
+
this.handleClose();
|
116
|
+
}
|
117
|
+
},
|
92
118
|
handleAffirm() {
|
93
119
|
this.$emit("on-affirm");
|
94
120
|
},
|
@@ -112,7 +112,7 @@
|
|
112
112
|
</div>
|
113
113
|
<slot name="action"> </slot>
|
114
114
|
<el-popover
|
115
|
-
placement="
|
115
|
+
placement="bottom"
|
116
116
|
trigger="hover"
|
117
117
|
style="margin:0 10px;"
|
118
118
|
>
|
@@ -230,6 +230,7 @@
|
|
230
230
|
<th-dialog
|
231
231
|
title="导入JSON"
|
232
232
|
:visible="dialog.import.visible"
|
233
|
+
:modal-append-to-body="false"
|
233
234
|
@on-close="dialog.import.visible = false"
|
234
235
|
@on-affirm="handleUploadJson"
|
235
236
|
@on-fullscreen="$refs.valueCodeEditor.resize()"
|
@@ -247,7 +248,8 @@
|
|
247
248
|
<!-- 预览 -->
|
248
249
|
<th-dialog
|
249
250
|
title="预览"
|
250
|
-
|
251
|
+
v-model="dialog.preview.visible"
|
252
|
+
:modal-append-to-body="false"
|
251
253
|
@on-close="dialog.preview.visible = false"
|
252
254
|
>
|
253
255
|
<generate-form
|
@@ -278,6 +280,7 @@
|
|
278
280
|
<th-dialog
|
279
281
|
title="获取数据"
|
280
282
|
:visible="dialog.data.visible"
|
283
|
+
:modal-append-to-body="false"
|
281
284
|
@on-close="dialog.data.visible = false"
|
282
285
|
@on-fullscreen="$refs.dataCodeEditor.resize()"
|
283
286
|
>
|
@@ -300,6 +303,7 @@
|
|
300
303
|
<th-dialog
|
301
304
|
title="生成JSON"
|
302
305
|
:visible="dialog.config.visible"
|
306
|
+
:modal-append-to-body="false"
|
303
307
|
@on-close="dialog.config.visible = false"
|
304
308
|
@on-fullscreen="$refs.jsonCodeEditor.resize()"
|
305
309
|
>
|
@@ -324,6 +328,7 @@
|
|
324
328
|
title="生成代码"
|
325
329
|
:visible="dialog.code.visible"
|
326
330
|
:showFooter="false"
|
331
|
+
:modal-append-to-body="false"
|
327
332
|
@on-close="dialog.code.visible = false"
|
328
333
|
@on-fullscreen="handleDialogFullscreen"
|
329
334
|
>
|