general-basic-form 1.0.25 → 1.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/README.md +12 -0
- package/package.json +1 -1
- package/src/GeneralBasicForm.vue +7 -1
package/README.md
CHANGED
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
// 外部传入的表单数据,用于回填
|
|
29
29
|
}
|
|
30
30
|
noUrlParameters
|
|
31
|
+
:afterReset="afterReset"
|
|
31
32
|
/>
|
|
32
33
|
|
|
33
34
|
<style lang="scss" scoped>
|
|
@@ -38,6 +39,15 @@
|
|
|
38
39
|
}
|
|
39
40
|
</style>
|
|
40
41
|
|
|
42
|
+
getList会传出默认的参数,首次请求时会有页数和分页大小,重置后会传出默认页数1
|
|
43
|
+
|
|
44
|
+
async getList(
|
|
45
|
+
params = {
|
|
46
|
+
page: Number(this.$route.query.page) || 1,
|
|
47
|
+
limit: Number(this.$route.query.limit) || 10,
|
|
48
|
+
}
|
|
49
|
+
) {}
|
|
50
|
+
|
|
41
51
|
表单数据校验需要拿到内部表单的ref
|
|
42
52
|
|
|
43
53
|
this.$refs["generalBasicForm"].$refs["queryFormRef"]
|
|
@@ -49,12 +59,14 @@
|
|
|
49
59
|
}
|
|
50
60
|
);
|
|
51
61
|
|
|
62
|
+
|
|
52
63
|

|
|
53
64
|
|
|
54
65
|
数据示例:
|
|
55
66
|
|
|
56
67
|
showSearch: true, // 显示搜索条件
|
|
57
68
|
getList(); // 请求数据的函数
|
|
69
|
+
afterReset(); // 在重置按钮点击完后但还没重新请求时触发的的函数
|
|
58
70
|
formOnly:true // 只展示表单不展示按钮
|
|
59
71
|
noUrlParameters:true // 不接受和不改变url的参数
|
|
60
72
|
formItem: [
|
package/package.json
CHANGED
package/src/GeneralBasicForm.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
* @Author: 陈德立*******419287484@qq.com
|
|
3
3
|
* @Date: 2021-08-20 17:14:53
|
|
4
|
-
* @LastEditTime: 2021-11-
|
|
4
|
+
* @LastEditTime: 2021-11-30 17:27:27
|
|
5
5
|
* @LastEditors: 陈德立*******419287484@qq.com
|
|
6
6
|
* @Github: https://github.com/Alan1034
|
|
7
7
|
* @Description:
|
|
@@ -135,6 +135,11 @@ export default {
|
|
|
135
135
|
type: Function,
|
|
136
136
|
default: () => {},
|
|
137
137
|
},
|
|
138
|
+
afterReset: {
|
|
139
|
+
// 在重置按钮点击完后但还没重新请求时触发的的函数
|
|
140
|
+
type: Function,
|
|
141
|
+
default: () => {},
|
|
142
|
+
},
|
|
138
143
|
formItem: {
|
|
139
144
|
// 定义表单的数据
|
|
140
145
|
type: Array,
|
|
@@ -236,6 +241,7 @@ export default {
|
|
|
236
241
|
this.queryParams = {
|
|
237
242
|
...(this.noUrlParameters ? {} : this.$route?.query),
|
|
238
243
|
};
|
|
244
|
+
this.afterReset();
|
|
239
245
|
this.handleQuery();
|
|
240
246
|
},
|
|
241
247
|
currentInputComponent() {
|