tianheng-ui 0.0.29 → 0.0.32
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 +3 -2
- package/lib/tianheng-ui.js +1 -1
- package/lib/tianheng-ui.js.map +1 -1
- package/package.json +1 -1
- package/packages/table/action.vue +2 -2
- package/packages/table/column.vue +1 -1
- package/packages/table/index.vue +8 -8
- package/packages/table/search.js +8 -0
- package/packages/table/search.vue +37 -35
- package/packages/table/tools.js +4 -4
- package/packages/table/tools.vue +1 -1
package/package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
<template>
|
2
|
-
<div class="
|
2
|
+
<div class="th-table-action" @click.stop>
|
3
3
|
<template v-for="(item, index) in actions">
|
4
4
|
<el-button
|
5
5
|
v-if="item.act === 'edit'"
|
@@ -173,7 +173,7 @@ export default {
|
|
173
173
|
</script>
|
174
174
|
|
175
175
|
<style lang="less">
|
176
|
-
.
|
176
|
+
.th-table-action {
|
177
177
|
width: 100%;
|
178
178
|
display: flex;
|
179
179
|
align-items: center;
|
package/packages/table/index.vue
CHANGED
@@ -57,16 +57,16 @@
|
|
57
57
|
:scope="scope"
|
58
58
|
:option="item"
|
59
59
|
/>
|
60
|
-
<
|
60
|
+
<span v-else-if="item.format">
|
61
61
|
{{
|
62
62
|
handleFormatTime(
|
63
63
|
scope.row[item.alias || item.prop],
|
64
64
|
item.format
|
65
65
|
)
|
66
66
|
}}
|
67
|
-
</
|
68
|
-
<
|
69
|
-
<
|
67
|
+
</span>
|
68
|
+
<span v-else-if="item.alias">{{ scope.row[item.alias] }}</span>
|
69
|
+
<span v-else>{{ scope.row[item.prop] }}</span>
|
70
70
|
</template>
|
71
71
|
</el-table-column>
|
72
72
|
</template>
|
@@ -211,7 +211,7 @@ export default {
|
|
211
211
|
handleSizeChange(val) {
|
212
212
|
this.pageInfo.pageSize = val;
|
213
213
|
this.$emit(
|
214
|
-
"
|
214
|
+
"page-number-change",
|
215
215
|
this.pageInfo.currentPage,
|
216
216
|
this.pageInfo.pageSize
|
217
217
|
);
|
@@ -220,7 +220,7 @@ export default {
|
|
220
220
|
handleCurrentChange(val) {
|
221
221
|
this.pageInfo.currentPage = val;
|
222
222
|
this.$emit(
|
223
|
-
"
|
223
|
+
"page-number-change",
|
224
224
|
this.pageInfo.currentPage,
|
225
225
|
this.pageInfo.pageSize
|
226
226
|
);
|
@@ -230,7 +230,7 @@ export default {
|
|
230
230
|
if (this.pageInfo.currentPage === 1) return;
|
231
231
|
this.pageInfo.currentPage -= 1;
|
232
232
|
this.$emit(
|
233
|
-
"
|
233
|
+
"page-number-change",
|
234
234
|
this.pageInfo.currentPage,
|
235
235
|
this.pageInfo.pageSize
|
236
236
|
);
|
@@ -240,7 +240,7 @@ export default {
|
|
240
240
|
if (this.pageInfo.currentPage === this.pageInfo.pageCount) return;
|
241
241
|
this.pageInfo.currentPage += 1;
|
242
242
|
this.$emit(
|
243
|
-
"
|
243
|
+
"page-number-change",
|
244
244
|
this.pageInfo.currentPage,
|
245
245
|
this.pageInfo.pageSize
|
246
246
|
);
|
@@ -1,45 +1,47 @@
|
|
1
1
|
<template>
|
2
|
-
<div class="table-search">
|
2
|
+
<div class="th-table-search">
|
3
3
|
<template v-for="(item, index) in options">
|
4
|
-
<
|
4
|
+
<div
|
5
|
+
class="th-table-search-item"
|
5
6
|
v-if="item.type === 'input'"
|
6
|
-
class="table-search-item"
|
7
|
-
v-model="params[item.value]"
|
8
7
|
:key="index"
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
8
|
+
>
|
9
|
+
<span class="th-table-search-item-title">{{ item.props.label }}:</span>
|
10
|
+
<el-input
|
11
|
+
v-model="params[item.props.prop]"
|
12
|
+
:style="{ width: item.width + 'px' }"
|
13
|
+
:placeholder="item.placeholder || '请输入'"
|
14
|
+
:size="item.size"
|
15
|
+
clearable
|
16
|
+
></el-input>
|
17
|
+
</div>
|
18
|
+
<div
|
19
|
+
class="th-table-search-item"
|
15
20
|
v-if="item.type === 'date'"
|
16
|
-
class="table-search-item"
|
17
|
-
v-model="params[item.value]"
|
18
21
|
:key="index"
|
19
|
-
:style="{ width: item.width + 'px' }"
|
20
|
-
:type="item.dateType || 'date'"
|
21
|
-
:format="item.format"
|
22
|
-
:value-format="item.valueFormat"
|
23
|
-
:size="item.size || 'mini'"
|
24
|
-
range-separator="至"
|
25
|
-
start-placeholder="开始日期"
|
26
|
-
end-placeholder="结束日期"
|
27
22
|
>
|
28
|
-
|
23
|
+
<span class="th-table-search-item-title">{{ item.props.label }}:</span>
|
24
|
+
<el-date-picker
|
25
|
+
v-model="params[item.props.prop]"
|
26
|
+
:style="{ width: item.width + 'px' }"
|
27
|
+
:type="item.dateType || 'date'"
|
28
|
+
:format="item.format"
|
29
|
+
:value-format="item.valueFormat"
|
30
|
+
:size="item.size"
|
31
|
+
range-separator="至"
|
32
|
+
start-placeholder="开始日期"
|
33
|
+
end-placeholder="结束日期"
|
34
|
+
>
|
35
|
+
</el-date-picker>
|
36
|
+
</div>
|
29
37
|
</template>
|
30
38
|
|
31
|
-
<el-button
|
32
|
-
type="primary"
|
33
|
-
icon="el-icon-search"
|
34
|
-
size="mini"
|
35
|
-
plain
|
36
|
-
@click="doSearch"
|
39
|
+
<el-button type="primary" icon="el-icon-search" plain @click="doSearch"
|
37
40
|
>查询</el-button
|
38
41
|
>
|
39
42
|
<el-button
|
40
43
|
type="primary"
|
41
44
|
icon="el-icon-refresh-right"
|
42
|
-
size="mini"
|
43
45
|
plain
|
44
46
|
@click="doReset"
|
45
47
|
>重置</el-button
|
@@ -84,7 +86,6 @@ export default {
|
|
84
86
|
this.$emit("on-search", this.params);
|
85
87
|
},
|
86
88
|
doReset() {
|
87
|
-
this.params = {};
|
88
89
|
this.$emit("on-reset", this.params);
|
89
90
|
}
|
90
91
|
}
|
@@ -92,15 +93,16 @@ export default {
|
|
92
93
|
</script>
|
93
94
|
|
94
95
|
<style lang="less" scoped>
|
95
|
-
.table-search {
|
96
|
+
.th-table-search {
|
96
97
|
display: flex;
|
97
98
|
align-items: center;
|
98
|
-
margin-bottom:
|
99
|
+
margin-bottom: 20px;
|
99
100
|
&-item {
|
100
|
-
|
101
|
+
display: inline-block;
|
102
|
+
margin-right: 15px;
|
103
|
+
}
|
104
|
+
.th-table-search-item:last-child {
|
105
|
+
margin-right: 20px !important;
|
101
106
|
}
|
102
|
-
}
|
103
|
-
.table-search-item:last-child {
|
104
|
-
margin-right: 20px !important;
|
105
107
|
}
|
106
108
|
</style>
|
package/packages/table/tools.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import
|
1
|
+
import TableTools from "./tools.vue";
|
2
2
|
|
3
3
|
/* istanbul ignore next */
|
4
|
-
|
5
|
-
Vue.component(
|
4
|
+
TableTools.install = function(Vue) {
|
5
|
+
Vue.component(TableTools.name, TableTools);
|
6
6
|
};
|
7
7
|
|
8
|
-
export default
|
8
|
+
export default TableTools;
|