byt-ui 0.0.18 → 0.0.20

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,6 +1,6 @@
1
1
  {
2
2
  "name": "byt-ui",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "private": false,
5
5
  "description": "byt组件库",
6
6
  "author": {
@@ -2,8 +2,8 @@
2
2
  * @Description:
3
3
  * @Author: 王国火
4
4
  * @Date: 2022-07-12 17:47:20
5
- * @LastEditTime: 2023-07-11 14:29:31
6
- * @LastEditors: 王国火
5
+ * @LastEditTime: 2023-09-14 12:24:33
6
+ * @LastEditors: hcm
7
7
  -->
8
8
 
9
9
  <template>
@@ -19,7 +19,11 @@
19
19
  @reset="onReset"
20
20
  @init="init"
21
21
  v-model="searchForm"
22
- ></FormView>
22
+ >
23
+ <template #filters>
24
+ <slot name="filters"></slot>
25
+ </template>
26
+ </FormView>
23
27
  </div>
24
28
 
25
29
  <div class="action-view">
@@ -39,6 +43,7 @@
39
43
  :column-config="{resizable: true}"
40
44
  :row-config="{isCurrent: true, isHover: true}"
41
45
  :show-overflow="showOverflow"
46
+ v-bind="vxeTableProp"
42
47
  >
43
48
  <template v-for="(column,index) in columns">
44
49
  <vxe-column
@@ -152,6 +157,11 @@ export default {
152
157
  type: Boolean,
153
158
  default: true
154
159
  },
160
+ // add by hcm 更灵活的修改vxe table组件属性
161
+ vxeTableProp: {
162
+ type: Object,
163
+ default: null
164
+ },
155
165
  /** 表格数据*/
156
166
  tableData: {
157
167
  type: Array,
@@ -262,6 +272,7 @@ export default {
262
272
  onReset() {
263
273
  this.pageOpt.page = 1;
264
274
  this.searchForm = {};
275
+ this.$emit('reset') // add by hcm filters插槽时用到
265
276
  this.fetchData();
266
277
  },
267
278
  clear(){
@@ -2,15 +2,16 @@
2
2
  * @Description:
3
3
  * @Author: 王国火
4
4
  * @Date: 2022-07-13 08:46:34
5
- * @LastEditTime: 2023-06-07 08:53:12
6
- * @LastEditors: 王国火
5
+ * @LastEditTime: 2023-09-14 11:59:28
6
+ * @LastEditors: hcm
7
7
  -->
8
8
  <!-- -->
9
9
  <template>
10
10
  <el-form ref="form" :model="form" :inline="inline" :label-width="`${labelWidth}px`">
11
11
  <el-form-item :label="item.label" :key="index" v-for="(item,index) in searchList">
12
12
  <template v-if="item.type=='input' || !item.type">
13
- <el-input v-model="form[item.key]" clearable :placeholder="`请输入${item.label}`"></el-input>
13
+ <!-- update by hcm 回车触发过滤 -->
14
+ <el-input v-model="form[item.key]" clearable :placeholder="`请输入${item.label}`" @keyup.enter.native="onSearch"></el-input>
14
15
  </template>
15
16
 
16
17
  <template v-if="item.type=='cascader'">
@@ -59,8 +60,25 @@
59
60
  >
60
61
  </el-date-picker>
61
62
  </template>
63
+
64
+ <!-- add by hcm 加时间区间类型-->
65
+ <template v-if="item.type=='datetimerange'">
66
+ <el-date-picker
67
+ v-model="form[item.key]"
68
+ type="datetimerange"
69
+ range-separator="至"
70
+ start-placeholder="开始时间"
71
+ end-placeholder="结束时间"
72
+ value-format="yyyy-MM-dd"
73
+ :picker-options="pickerOptions"
74
+ >
75
+ </el-date-picker>
76
+ </template>
77
+ </el-form-item>
78
+ <el-form-item>
79
+ <!-- add by hcm 加插槽 增加灵活性 -->
80
+ <slot name="filters"></slot>
62
81
  </el-form-item>
63
-
64
82
  <el-form-item>
65
83
  <el-button icon="el-icon-search" type="primary" @click="onSearch">查询</el-button>
66
84
  <el-button icon="el-icon-refresh-right" @click="onReset">重置</el-button>