tianheng-ui 0.0.33 → 0.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.
- package/lib/index.js +12 -2
- package/lib/theme-chalk/dialog.css +41 -0
- package/lib/theme-chalk/index.css +1 -0
- package/lib/tianheng-ui.js +1 -1
- package/lib/tianheng-ui.js.map +1 -1
- package/package.json +1 -1
- package/packages/dialog/index.js +8 -0
- package/packages/dialog/index.vue +90 -0
- package/packages/table/index.vue +5 -0
package/package.json
CHANGED
@@ -0,0 +1,90 @@
|
|
1
|
+
<template>
|
2
|
+
<el-dialog
|
3
|
+
class="th-dialog"
|
4
|
+
:visible.sync="visible"
|
5
|
+
:fullscreen="dialogFullscreen"
|
6
|
+
:close-on-click-modal="false"
|
7
|
+
:show-close="false"
|
8
|
+
:before-close="handleClose"
|
9
|
+
>
|
10
|
+
<div slot="title" style="font-size: 14px;">
|
11
|
+
<div slot="title" class="th-dialog__header">
|
12
|
+
<div class="th-dialog__title">{{ title }}</div>
|
13
|
+
<div class="th-dialog__action">
|
14
|
+
<i
|
15
|
+
class="th-dialog__action_item"
|
16
|
+
v-if="showFullscreen"
|
17
|
+
:class="fullscreenIcon"
|
18
|
+
@click="handleFullscreenChange"
|
19
|
+
></i>
|
20
|
+
<i
|
21
|
+
class="th-dialog__action_item "
|
22
|
+
v-if="showClose"
|
23
|
+
:class="closeIcon"
|
24
|
+
@click="handleClose"
|
25
|
+
></i>
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
<slot></slot>
|
30
|
+
<span slot="footer">
|
31
|
+
<el-button
|
32
|
+
v-if="showAffirm"
|
33
|
+
type="primary"
|
34
|
+
:loading="loading"
|
35
|
+
@click="handleAffirm"
|
36
|
+
>{{ affirmText }}</el-button
|
37
|
+
>
|
38
|
+
<el-button v-if="showCancel" @click="handleClose">{{
|
39
|
+
cancelText
|
40
|
+
}}</el-button>
|
41
|
+
</span>
|
42
|
+
</el-dialog>
|
43
|
+
</template>
|
44
|
+
|
45
|
+
<script>
|
46
|
+
export default {
|
47
|
+
name: "ThDialog",
|
48
|
+
props: {
|
49
|
+
visible: Boolean,
|
50
|
+
loading: Boolean,
|
51
|
+
title: { type: String, default: "温馨提示" },
|
52
|
+
|
53
|
+
showAffirm: { type: Boolean, default: true },
|
54
|
+
affirmText: { type: String, default: "确 认" },
|
55
|
+
|
56
|
+
showCancel: { type: Boolean, default: true },
|
57
|
+
cancelText: { type: String, default: "取 消" },
|
58
|
+
|
59
|
+
showClose: { type: Boolean, default: true },
|
60
|
+
closeIcon: { type: String, default: "el-icon-close" },
|
61
|
+
|
62
|
+
fullscreen: { type: Boolean, default: false },
|
63
|
+
showFullscreen: { type: Boolean, default: true },
|
64
|
+
fullscreenIcon: { type: String, default: "el-icon-full-screen" }
|
65
|
+
},
|
66
|
+
data() {
|
67
|
+
return {
|
68
|
+
formRules: {},
|
69
|
+
dialogFullscreen: this.fullscreen
|
70
|
+
};
|
71
|
+
},
|
72
|
+
watch: {
|
73
|
+
fullscreen(value) {
|
74
|
+
this.dialogFullscreen = value;
|
75
|
+
}
|
76
|
+
},
|
77
|
+
methods: {
|
78
|
+
handleClose() {
|
79
|
+
this.$emit("on-close");
|
80
|
+
},
|
81
|
+
handleAffirm() {
|
82
|
+
this.$emit("on-affirm");
|
83
|
+
},
|
84
|
+
handleFullscreenChange() {
|
85
|
+
this.dialogFullscreen = !this.dialogFullscreen;
|
86
|
+
this.$emit("fullscreen-change");
|
87
|
+
}
|
88
|
+
}
|
89
|
+
};
|
90
|
+
</script>
|
package/packages/table/index.vue
CHANGED
@@ -10,6 +10,7 @@
|
|
10
10
|
:border="border"
|
11
11
|
:highlight-current-row="selectType === 'single'"
|
12
12
|
:tree-props="treeProps"
|
13
|
+
:span-method="objectSpanMethod"
|
13
14
|
@current-change="handleSingleSelect"
|
14
15
|
@row-dblclick="dblclick"
|
15
16
|
@selection-change="handleSelectionChange"
|
@@ -291,6 +292,9 @@ export default {
|
|
291
292
|
}
|
292
293
|
);
|
293
294
|
return time_str;
|
295
|
+
},
|
296
|
+
objectSpanMethod(data) {
|
297
|
+
this.$emit("span-method", data);
|
294
298
|
}
|
295
299
|
}
|
296
300
|
};
|
@@ -300,6 +304,7 @@ export default {
|
|
300
304
|
.th-table {
|
301
305
|
position: relative;
|
302
306
|
width: 100%;
|
307
|
+
height: 100%;
|
303
308
|
.pagination {
|
304
309
|
margin-top: 20px;
|
305
310
|
}
|