general-basic-form 1.0.22 → 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 +31 -2
- package/package.json +1 -1
- package/src/GeneralBasicForm.vue +12 -6
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,21 +39,34 @@
|
|
|
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
|
-
this.$refs["generalBasicForm"].$["queryFormRef"]
|
|
53
|
+
this.$refs["generalBasicForm"].$refs["queryFormRef"]
|
|
44
54
|
.validate(
|
|
45
55
|
async (valid) => {
|
|
46
|
-
if (valid) {
|
|
56
|
+
if (valid) {
|
|
57
|
+
console.log(this.$refs["generalBasicForm"]["queryParams"]);
|
|
58
|
+
}
|
|
47
59
|
}
|
|
48
60
|
);
|
|
49
61
|
|
|
62
|
+
|
|
50
63
|

|
|
51
64
|
|
|
52
65
|
数据示例:
|
|
53
66
|
|
|
54
67
|
showSearch: true, // 显示搜索条件
|
|
55
68
|
getList(); // 请求数据的函数
|
|
69
|
+
afterReset(); // 在重置按钮点击完后但还没重新请求时触发的的函数
|
|
56
70
|
formOnly:true // 只展示表单不展示按钮
|
|
57
71
|
noUrlParameters:true // 不接受和不改变url的参数
|
|
58
72
|
formItem: [
|
|
@@ -79,6 +93,7 @@
|
|
|
79
93
|
label: "二次工艺",
|
|
80
94
|
prop: "spName",
|
|
81
95
|
type: "select",
|
|
96
|
+
multiple:true, //多选
|
|
82
97
|
option: [
|
|
83
98
|
{ value: "3", desc: "满印" },
|
|
84
99
|
{ value: "1", desc: "区域印花" },
|
|
@@ -91,6 +106,20 @@
|
|
|
91
106
|
type: "date-picker",
|
|
92
107
|
"value-format": "yyyyMMdd"
|
|
93
108
|
},
|
|
109
|
+
{
|
|
110
|
+
label: "二次工艺成本价格(人民币分)",
|
|
111
|
+
prop: "spCost",
|
|
112
|
+
type: "input-number",
|
|
113
|
+
"controls-position": "right",
|
|
114
|
+
min: 0,
|
|
115
|
+
rules: [
|
|
116
|
+
{
|
|
117
|
+
required: true,
|
|
118
|
+
message: "请输入二次工艺成本价格",
|
|
119
|
+
trigger: "blur",
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
},
|
|
94
123
|
{
|
|
95
124
|
label: "分类",
|
|
96
125
|
prop: "分类",
|
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:
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
v-model="queryParams[item.prop]"
|
|
52
52
|
:size="size"
|
|
53
53
|
v-bind="selectSetting"
|
|
54
|
+
:multiple="item.multiple"
|
|
54
55
|
:placeholder="item.placeholder || selectSetting.placeholder"
|
|
55
56
|
>
|
|
56
57
|
<el-option
|
|
@@ -90,6 +91,7 @@
|
|
|
90
91
|
:min="item.min"
|
|
91
92
|
:max="item.max"
|
|
92
93
|
:controls-position="item['controls-position']"
|
|
94
|
+
:step-strictly="item['step-strictly']"
|
|
93
95
|
/>
|
|
94
96
|
</el-form-item>
|
|
95
97
|
<slot></slot>
|
|
@@ -133,6 +135,11 @@ export default {
|
|
|
133
135
|
type: Function,
|
|
134
136
|
default: () => {},
|
|
135
137
|
},
|
|
138
|
+
afterReset: {
|
|
139
|
+
// 在重置按钮点击完后但还没重新请求时触发的的函数
|
|
140
|
+
type: Function,
|
|
141
|
+
default: () => {},
|
|
142
|
+
},
|
|
136
143
|
formItem: {
|
|
137
144
|
// 定义表单的数据
|
|
138
145
|
type: Array,
|
|
@@ -234,6 +241,7 @@ export default {
|
|
|
234
241
|
this.queryParams = {
|
|
235
242
|
...(this.noUrlParameters ? {} : this.$route?.query),
|
|
236
243
|
};
|
|
244
|
+
this.afterReset();
|
|
237
245
|
this.handleQuery();
|
|
238
246
|
},
|
|
239
247
|
currentInputComponent() {
|
|
@@ -243,10 +251,8 @@ export default {
|
|
|
243
251
|
};
|
|
244
252
|
</script>
|
|
245
253
|
|
|
246
|
-
<style
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
margin-bottom: 3px;
|
|
250
|
-
}
|
|
254
|
+
<style scoped>
|
|
255
|
+
.el-form-item {
|
|
256
|
+
margin-bottom: 2px !important;
|
|
251
257
|
}
|
|
252
258
|
</style>
|