tianheng-ui 0.0.27 → 0.0.30
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 +4 -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 -6
- package/packages/table/index.vue +0 -1
- package/packages/table/search.js +8 -0
- package/packages/table/search.vue +37 -35
- package/packages/table/tools.js +8 -0
- package/packages/table/tools.vue +20 -70
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;
|
@@ -183,8 +183,4 @@ export default {
|
|
183
183
|
margin-left: 0px;
|
184
184
|
}
|
185
185
|
}
|
186
|
-
|
187
|
-
// .el-button + .action-popover {
|
188
|
-
// margin-left: 10px !important;
|
189
|
-
// }
|
190
186
|
</style>
|
package/packages/table/index.vue
CHANGED
@@ -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.vue
CHANGED
@@ -1,48 +1,16 @@
|
|
1
1
|
<template>
|
2
|
-
<div class="
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
<el-button
|
15
|
-
v-if="item.act_type === 'refresh'"
|
16
|
-
:key="index"
|
17
|
-
:style="{ color: item.btn_color }"
|
18
|
-
:type="item.btn_type"
|
19
|
-
:icon="item.btn_icon"
|
20
|
-
:disabled="item.btn_disabled"
|
21
|
-
@click="doRefresh(item)"
|
22
|
-
>{{ item.btn_name }}</el-button
|
23
|
-
>
|
24
|
-
<el-button
|
25
|
-
v-if="item.act_type === 'export'"
|
26
|
-
:key="index"
|
27
|
-
:style="{ color: item.btn_color }"
|
28
|
-
:type="item.btn_type"
|
29
|
-
:icon="item.btn_icon"
|
30
|
-
:disabled="item.btn_disabled"
|
31
|
-
@click="doExport(item)"
|
32
|
-
>{{ item.btn_name }}</el-button
|
33
|
-
>
|
34
|
-
<el-button
|
35
|
-
v-if="item.act_type === 'batch'"
|
36
|
-
:key="index"
|
37
|
-
:style="{ color: item.btn_color }"
|
38
|
-
:type="item.btn_type"
|
39
|
-
:icon="item.btn_icon"
|
40
|
-
:disabled="item.btn_disabled || selectionDisabled"
|
41
|
-
:loading="loadingDel"
|
42
|
-
@click="doBatch(item)"
|
43
|
-
>{{ item.btn_name }}</el-button
|
44
|
-
>
|
45
|
-
</template>
|
2
|
+
<div class="th-tools">
|
3
|
+
<el-button
|
4
|
+
v-for="(item, index) in options"
|
5
|
+
:key="index"
|
6
|
+
:style="item.style"
|
7
|
+
:type="item.type"
|
8
|
+
:icon="item.icon"
|
9
|
+
:disabled="item.disabled || disabled[item.act]"
|
10
|
+
:loading="item.loading"
|
11
|
+
@click="handleClick(item)"
|
12
|
+
>{{ item.name }}</el-button
|
13
|
+
>
|
46
14
|
</div>
|
47
15
|
</template>
|
48
16
|
|
@@ -56,44 +24,26 @@ export default {
|
|
56
24
|
return [];
|
57
25
|
}
|
58
26
|
},
|
59
|
-
|
60
|
-
type:
|
27
|
+
disabled: {
|
28
|
+
type: Object,
|
61
29
|
default: () => {
|
62
|
-
return
|
30
|
+
return {};
|
63
31
|
}
|
64
32
|
}
|
65
33
|
},
|
66
34
|
data() {
|
67
|
-
return {
|
68
|
-
loadingDel: false
|
69
|
-
};
|
35
|
+
return {};
|
70
36
|
},
|
71
37
|
methods: {
|
72
|
-
|
73
|
-
this.$emit("on-
|
74
|
-
},
|
75
|
-
doAdd(item) {
|
76
|
-
this.$emit("on-add", item);
|
77
|
-
},
|
78
|
-
doRefresh(item) {
|
79
|
-
this.$emit("on-refresh", item);
|
80
|
-
},
|
81
|
-
doExport(item) {
|
82
|
-
this.$emit("on-export", item);
|
83
|
-
},
|
84
|
-
doBatch(item) {
|
85
|
-
this.loadingDel = true;
|
86
|
-
const callback = bool => {
|
87
|
-
this.loadingDel = false;
|
88
|
-
};
|
89
|
-
this.$emit("on-batch", item, callback);
|
38
|
+
handleClick(item) {
|
39
|
+
this.$emit("on-click", item);
|
90
40
|
}
|
91
41
|
}
|
92
42
|
};
|
93
43
|
</script>
|
94
44
|
|
95
|
-
<style lang="less">
|
96
|
-
.
|
45
|
+
<style lang="less" scoped>
|
46
|
+
.th-tools {
|
97
47
|
margin-bottom: 10px;
|
98
48
|
}
|
99
49
|
</style>
|