general-basic-form 1.0.9 → 1.0.13
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 +22 -4
- package/package.json +5 -8
- package/src/GeneralBasicForm.vue +6 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# GeneralBasicForm
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
一个兼容 Vue2 和 Vue3 的表单组件 <br/>
|
|
4
4
|
示例:
|
|
5
5
|
|
|
6
6
|
<GeneralBasicForm
|
|
@@ -20,8 +20,21 @@
|
|
|
20
20
|
|
|
21
21
|
showSearch: true, // 显示搜索条件
|
|
22
22
|
getList(); //请求数据的函数
|
|
23
|
-
formItem: [
|
|
24
|
-
{ label: "款式名称",
|
|
23
|
+
formItem: [
|
|
24
|
+
{ label: "款式名称",
|
|
25
|
+
prop: "bsName",
|
|
26
|
+
type: "input",
|
|
27
|
+
placeholder: "请输入图片名称/分类名称/图片标签",
|
|
28
|
+
rules: [
|
|
29
|
+
{
|
|
30
|
+
message: "请输入信息"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
pattern: /^\w+[\,\,\-\w' '#]+$/,
|
|
34
|
+
message: "请输入正确的Invoice单号"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
maxlength: "3000"},
|
|
25
38
|
{
|
|
26
39
|
label: "二次工艺",
|
|
27
40
|
prop: "spName",
|
|
@@ -32,7 +45,11 @@
|
|
|
32
45
|
{ value: "2", desc: "绣花" },
|
|
33
46
|
],
|
|
34
47
|
},
|
|
35
|
-
{
|
|
48
|
+
{
|
|
49
|
+
label: "创建时间",
|
|
50
|
+
prop: "create_time",
|
|
51
|
+
type: "date-picker",
|
|
52
|
+
"value-format": "yyyyMMdd"
|
|
36
53
|
},
|
|
37
54
|
{
|
|
38
55
|
label: "分类",
|
|
@@ -104,6 +121,7 @@
|
|
|
104
121
|
],
|
|
105
122
|
//分别支持input输入框,select单选框,date-picker日期选择器,cascader层级选择器 四种组件
|
|
106
123
|
//date-picker可以传入'start-placeholder'和'end-placeholder',其他组件支持placeholder传入
|
|
124
|
+
//rules为表单校验规则,每个组件都可以传入
|
|
107
125
|
|
|
108
126
|
安装:npm i general-basic-form<br/>
|
|
109
127
|
install: npm i general-basic-form
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "general-basic-form",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -11,7 +11,10 @@
|
|
|
11
11
|
"keywords": [
|
|
12
12
|
"general-basic-form",
|
|
13
13
|
"form",
|
|
14
|
+
"vue",
|
|
15
|
+
"vue2",
|
|
14
16
|
"vue3",
|
|
17
|
+
"element-plus",
|
|
15
18
|
"element-plus"
|
|
16
19
|
],
|
|
17
20
|
"author": "chendeli419287484@qq.com",
|
|
@@ -25,11 +28,5 @@
|
|
|
25
28
|
"eslint": "^7.32.0",
|
|
26
29
|
"eslint-plugin-vue": "^7.14.0"
|
|
27
30
|
},
|
|
28
|
-
"dependencies": {
|
|
29
|
-
"babel-eslint": "^10.1.0",
|
|
30
|
-
"element-plus": "^1.0.2-beta.70",
|
|
31
|
-
"eslint": "^7.32.0",
|
|
32
|
-
"vue": "^3.2.2",
|
|
33
|
-
"vue-router": "^4.0.5"
|
|
34
|
-
}
|
|
31
|
+
"dependencies": {}
|
|
35
32
|
}
|
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-
|
|
4
|
+
* @LastEditTime: 2021-10-13 16:35:02
|
|
5
5
|
* @LastEditors: 陈德立*******419287484@qq.com
|
|
6
6
|
* @Github: https://github.com/Alan1034
|
|
7
7
|
* @Description:
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
:label="item.label"
|
|
26
26
|
:prop="item.prop"
|
|
27
27
|
:key="item.prop"
|
|
28
|
+
:rules="item.rules"
|
|
28
29
|
>
|
|
29
30
|
<el-input
|
|
30
31
|
v-if="item.type === 'input'"
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
:size="size"
|
|
34
35
|
v-bind="inputSetting"
|
|
35
36
|
:placeholder="item.placeholder || inputSetting.placeholder"
|
|
37
|
+
:maxlength="item.maxlength"
|
|
36
38
|
></el-input>
|
|
37
39
|
<el-select
|
|
38
40
|
filterable
|
|
@@ -69,6 +71,7 @@
|
|
|
69
71
|
:end-placeholder="
|
|
70
72
|
item['end-placeholder'] || datePackerSetting['end-placeholder']
|
|
71
73
|
"
|
|
74
|
+
:value-format="item['value-format']"
|
|
72
75
|
></el-date-picker>
|
|
73
76
|
</el-form-item>
|
|
74
77
|
<el-form-item>
|
|
@@ -166,10 +169,10 @@ export default {
|
|
|
166
169
|
});
|
|
167
170
|
},
|
|
168
171
|
/** 重置按钮操作 */
|
|
169
|
-
resetQuery() {
|
|
172
|
+
async resetQuery() {
|
|
170
173
|
this.$refs.queryFormRef.resetFields();
|
|
171
174
|
const params = { page: 1 };
|
|
172
|
-
this.$router.push({
|
|
175
|
+
await this.$router.push({
|
|
173
176
|
query: { ...params },
|
|
174
177
|
});
|
|
175
178
|
this.handleQuery();
|