Skip to content

Commit 71a63d1

Browse files
committed
表单强化
1 parent 4580767 commit 71a63d1

File tree

12 files changed

+6532
-5833
lines changed

12 files changed

+6532
-5833
lines changed

public/0.js

Lines changed: 3000 additions & 3000 deletions
Large diffs are not rendered by default.

public/app.js

Lines changed: 1312 additions & 1330 deletions
Large diffs are not rendered by default.

public/vendor.js

Lines changed: 1715 additions & 1376 deletions
Large diffs are not rendered by default.

resources/js/components/form/Form.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<template>
22
<div class="form-page">
3+
<component
4+
v-if="attrs.top"
5+
:is="attrs.top.componentName"
6+
:attrs="attrs.top"
7+
/>
38
<component
49
:is="attrs.attrs.isDialog ? 'div' : 'el-card'"
510
shadow="never"
@@ -74,6 +79,7 @@
7479
<ItemDiaplsy
7580
v-model="formData[item.prop]"
7681
:form_item="item"
82+
:form_items="attrs.formItems"
7783
:form_data="formData"
7884
/>
7985
</template>
@@ -128,6 +134,11 @@
128134
</div>
129135
</el-form>
130136
</component>
137+
<component
138+
v-if="attrs.bottom"
139+
:is="attrs.bottom.componentName"
140+
:attrs="attrs.bottom"
141+
/>
131142
</div>
132143
</template>
133144
<script>
Lines changed: 58 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,35 @@
11
<template>
2-
<div v-if="attrs">
2+
<div>
33
<component
4-
:value="value"
5-
:is="attrs.componentName"
6-
:attrs="attrs"
7-
:form_data="form_data"
8-
:form_items="form_items"
9-
@change="onChange"
4+
v-if="form_item.componentTopComponent"
5+
:is="form_item.componentTopComponent.componentName"
6+
:attrs="form_item.componentTopComponent"
7+
/>
8+
<div class="flex align-center input-view">
9+
<component
10+
v-if="form_item.componentLeftComponent"
11+
:is="form_item.componentLeftComponent.componentName"
12+
:attrs="form_item.componentLeftComponent"
13+
/>
14+
<component
15+
v-if="attrs"
16+
:value="value"
17+
:is="attrs.componentName"
18+
:attrs="attrs"
19+
:form_data="form_data"
20+
:form_items="form_items"
21+
@change="onChange"
22+
/>
23+
<component
24+
v-if="form_item.componentRightComponent"
25+
:is="form_item.componentRightComponent.componentName"
26+
:attrs="form_item.componentRightComponent"
27+
/>
28+
</div>
29+
<component
30+
v-if="form_item.componentBottomComponent"
31+
:is="form_item.componentBottomComponent.componentName"
32+
:attrs="form_item.componentBottomComponent"
1033
/>
1134
</div>
1235
</template>
@@ -17,30 +40,52 @@ export default {
1740
mixins: [BaseComponent],
1841
props: {
1942
value: {
20-
default: null,
43+
default: null
2144
},
2245
form_items: Array,
2346
//fromItem数据
2447
form_item: Object,
2548
//当前表单数据
26-
form_data: Object,
49+
form_data: Object
2750
},
2851
data() {
2952
return {};
3053
},
3154
model: {
3255
prop: "value",
33-
event: "change",
56+
event: "change"
3457
},
3558
computed: {
3659
attrs() {
3760
return this.form_item.component;
38-
},
61+
}
3962
},
4063
methods: {
4164
onChange(value) {
4265
this.$emit("change", value);
43-
},
44-
},
66+
}
67+
}
4568
};
4669
</script>
70+
<style lang="scss" scoped>
71+
.el-form-item__content{
72+
.input-view {
73+
min-height: 40px;
74+
}
75+
}
76+
.el-form-item--medium {
77+
.input-view {
78+
min-height: 36px;
79+
}
80+
}
81+
.el-form-item--small {
82+
.input-view {
83+
min-height: 32px;
84+
}
85+
}
86+
.el-form-item--mini {
87+
.input-view {
88+
min-height: 28px;
89+
}
90+
}
91+
</style>

0 commit comments

Comments
 (0)