tianheng-ui 0.0.23 → 0.0.26
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 +1 -1
- package/lib/tianheng-ui.js +1 -1
- package/lib/tianheng-ui.js.map +1 -1
- package/package.json +1 -1
- package/packages/empty/index.vue +1 -1
- package/packages/table/action.vue +55 -7
- package/packages/table/index.vue +1 -0
package/package.json
CHANGED
package/packages/empty/index.vue
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
<template>
|
2
|
-
<div>
|
2
|
+
<div class="thTable-action" @click.stop>
|
3
3
|
<template v-for="(item, index) in actions">
|
4
4
|
<el-button
|
5
5
|
v-if="item.act === 'edit'"
|
@@ -36,10 +36,7 @@
|
|
36
36
|
<el-button type="text" :disabled="loadingDel" @click="doCancel"
|
37
37
|
>取消</el-button
|
38
38
|
>
|
39
|
-
<el-button
|
40
|
-
:loading="loadingDel"
|
41
|
-
type="primary"
|
42
|
-
@click="doDelete(item)"
|
39
|
+
<el-button type="text" :loading="loadingDel" @click="doDelete(item)"
|
43
40
|
>确定</el-button
|
44
41
|
>
|
45
42
|
</div>
|
@@ -53,6 +50,37 @@
|
|
53
50
|
>{{ item.name }}</el-button
|
54
51
|
>
|
55
52
|
</el-popover>
|
53
|
+
<el-dropdown
|
54
|
+
v-else-if="item.act === 'more'"
|
55
|
+
:key="index"
|
56
|
+
:trigger="item.trigger || 'click'"
|
57
|
+
:placement="item.placement || 'bottom-end'"
|
58
|
+
:disabled="btnDisabled(item)"
|
59
|
+
@command="
|
60
|
+
value => {
|
61
|
+
doMore(value, index, item);
|
62
|
+
}
|
63
|
+
"
|
64
|
+
>
|
65
|
+
<el-button
|
66
|
+
:style="item.style"
|
67
|
+
:disabled="loadingDel || btnDisabled(item)"
|
68
|
+
:type="item.type"
|
69
|
+
:icon="item.icon"
|
70
|
+
>{{ item.name }}</el-button
|
71
|
+
>
|
72
|
+
<el-dropdown-menu slot="dropdown">
|
73
|
+
<el-dropdown-item
|
74
|
+
v-for="(btnItem, btnIndex) in item.children"
|
75
|
+
:key="btnIndex"
|
76
|
+
:style="btnItem.style"
|
77
|
+
:command="btnItem.act"
|
78
|
+
:icon="btnItem.icon"
|
79
|
+
:disabled="btnItem.disabled"
|
80
|
+
>{{ btnItem.name }}</el-dropdown-item
|
81
|
+
>
|
82
|
+
</el-dropdown-menu>
|
83
|
+
</el-dropdown>
|
56
84
|
<el-button
|
57
85
|
v-else
|
58
86
|
:key="index"
|
@@ -130,13 +158,33 @@ export default {
|
|
130
158
|
this.pop = !bool;
|
131
159
|
};
|
132
160
|
this.$emit("on-delete", item, callback);
|
161
|
+
},
|
162
|
+
doMore(value, index, item) {
|
163
|
+
for (let i = 0; i < item.children.length; i++) {
|
164
|
+
const element = item.children[i];
|
165
|
+
if (element.act === value) {
|
166
|
+
this.$emit("on-more", element);
|
167
|
+
break;
|
168
|
+
}
|
169
|
+
}
|
133
170
|
}
|
134
171
|
}
|
135
172
|
};
|
136
173
|
</script>
|
137
174
|
|
138
175
|
<style lang="less">
|
139
|
-
.
|
140
|
-
|
176
|
+
.thTable-action {
|
177
|
+
width: 100%;
|
178
|
+
display: flex;
|
179
|
+
align-items: center;
|
180
|
+
justify-content: space-around;
|
181
|
+
|
182
|
+
.el-button + .el-button {
|
183
|
+
margin-left: 0px;
|
184
|
+
}
|
141
185
|
}
|
186
|
+
|
187
|
+
// .el-button + .action-popover {
|
188
|
+
// margin-left: 10px !important;
|
189
|
+
// }
|
142
190
|
</style>
|