tianheng-ui 0.0.28 → 0.0.31

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,7 +1,7 @@
1
1
  {
2
2
  "name": "tianheng-ui",
3
3
  "description": "A Vue.js project",
4
- "version": "0.0.28",
4
+ "version": "0.0.31",
5
5
  "author": "shu lang <403732931@qq.com>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="thTable-action" @click.stop>
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
- .thTable-action {
176
+ .th-table-action {
177
177
  width: 100%;
178
178
  display: flex;
179
179
  align-items: center;
@@ -211,7 +211,7 @@ export default {
211
211
  handleSizeChange(val) {
212
212
  this.pageInfo.pageSize = val;
213
213
  this.$emit(
214
- "pageNumberChange",
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
- "pageNumberChange",
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
- "pageNumberChange",
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
- "pageNumberChange",
243
+ "page-number-change",
244
244
  this.pageInfo.currentPage,
245
245
  this.pageInfo.pageSize
246
246
  );
@@ -0,0 +1,8 @@
1
+ import TableSearch from "./search.vue";
2
+
3
+ /* istanbul ignore next */
4
+ TableSearch.install = function(Vue) {
5
+ Vue.component(TableSearch.name, TableSearch);
6
+ };
7
+
8
+ export default TableSearch;
@@ -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
- <el-input
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
- :style="{ width: item.width + 'px' }"
10
- :placeholder="item.placeholder || '请输入'"
11
- :size="item.size || 'mini'"
12
- clearable
13
- ></el-input>
14
- <el-date-picker
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
- </el-date-picker>
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: 10px;
99
+ margin-bottom: 20px;
99
100
  &-item {
100
- margin-right: 10px;
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>
@@ -1,8 +1,8 @@
1
- import Tools from "./tools.vue";
1
+ import TableTools from "./tools.vue";
2
2
 
3
3
  /* istanbul ignore next */
4
- Tools.install = function(Vue) {
5
- Vue.component(Tools.name, Tools);
4
+ TableTools.install = function(Vue) {
5
+ Vue.component(TableTools.name, TableTools);
6
6
  };
7
7
 
8
- export default Tools;
8
+ export default TableTools;
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="th-Tools">
2
+ <div class="th-tools">
3
3
  <el-button
4
4
  v-for="(item, index) in options"
5
5
  :key="index"
@@ -16,20 +16,20 @@
16
16
 
17
17
  <script>
18
18
  export default {
19
- name:'ThTools',
19
+ name: "ThTableTools",
20
20
  props: {
21
21
  options: {
22
22
  type: Array,
23
23
  default: () => {
24
24
  return [];
25
- },
25
+ }
26
26
  },
27
27
  disabled: {
28
28
  type: Object,
29
29
  default: () => {
30
30
  return {};
31
- },
32
- },
31
+ }
32
+ }
33
33
  },
34
34
  data() {
35
35
  return {};
@@ -37,7 +37,13 @@ export default {
37
37
  methods: {
38
38
  handleClick(item) {
39
39
  this.$emit("on-click", item);
40
- },
41
- },
40
+ }
41
+ }
42
42
  };
43
43
  </script>
44
+
45
+ <style lang="less" scoped>
46
+ .th-tools {
47
+ margin-bottom: 10px;
48
+ }
49
+ </style>