leisure-core 0.4.44 → 0.4.45
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/le-common-page/src/main.vue +42 -4
- package/package.json +1 -1
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
:key="column.prop"
|
|
25
25
|
:prop="column.prop"
|
|
26
26
|
:label="column.label"
|
|
27
|
+
:width="column.width"
|
|
28
|
+
:formatter="column.formatter"
|
|
27
29
|
>
|
|
28
30
|
</el-table-column>
|
|
29
31
|
<el-table-column fixed="right" label="操作" align="center">
|
|
@@ -62,7 +64,7 @@
|
|
|
62
64
|
</el-pagination>
|
|
63
65
|
</div>
|
|
64
66
|
<le-dialog-container
|
|
65
|
-
title="
|
|
67
|
+
:title="popFormTitle"
|
|
66
68
|
:width="popFormWidth"
|
|
67
69
|
:showDialog="showDialog"
|
|
68
70
|
@close="closeDialog"
|
|
@@ -73,15 +75,30 @@
|
|
|
73
75
|
:model="formPop"
|
|
74
76
|
:rules="rulePop"
|
|
75
77
|
ref="ruleForm"
|
|
76
|
-
label-width="
|
|
78
|
+
:label-width="popFormLabelWidth"
|
|
77
79
|
>
|
|
78
80
|
<el-form-item
|
|
79
|
-
v-for="(item, index) in
|
|
81
|
+
v-for="(item, index) in formColumns"
|
|
80
82
|
:key="index"
|
|
81
83
|
:label="item.label"
|
|
82
84
|
:prop="item.prop"
|
|
83
85
|
>
|
|
84
|
-
<el-input
|
|
86
|
+
<el-input
|
|
87
|
+
v-if="!item.type || item.type === 'input'"
|
|
88
|
+
v-model="formPop[item.prop]"
|
|
89
|
+
/>
|
|
90
|
+
<el-select
|
|
91
|
+
v-else-if="item.type === 'select'"
|
|
92
|
+
v-model="formPop[item.prop]"
|
|
93
|
+
placeholder="请选择"
|
|
94
|
+
>
|
|
95
|
+
<el-option
|
|
96
|
+
v-for="option in getOptions(item.prop)"
|
|
97
|
+
:key="option.value"
|
|
98
|
+
:label="option.label"
|
|
99
|
+
:value="option.value"
|
|
100
|
+
/>
|
|
101
|
+
</el-select>
|
|
85
102
|
</el-form-item>
|
|
86
103
|
</el-form>
|
|
87
104
|
</le-dialog-container>
|
|
@@ -105,6 +122,10 @@ export default {
|
|
|
105
122
|
type: Array,
|
|
106
123
|
default: () => [],
|
|
107
124
|
},
|
|
125
|
+
formColumns: {
|
|
126
|
+
type: Array,
|
|
127
|
+
default: () => [],
|
|
128
|
+
},
|
|
108
129
|
queryParams: {
|
|
109
130
|
type: Object,
|
|
110
131
|
default: () => {},
|
|
@@ -129,10 +150,22 @@ export default {
|
|
|
129
150
|
type: String,
|
|
130
151
|
default: "80%",
|
|
131
152
|
},
|
|
153
|
+
popFormLabelWidth: {
|
|
154
|
+
type: String,
|
|
155
|
+
default: "100px",
|
|
156
|
+
},
|
|
157
|
+
popFormTitle: {
|
|
158
|
+
type: String,
|
|
159
|
+
default: "标题",
|
|
160
|
+
},
|
|
132
161
|
popLabelWidth: {
|
|
133
162
|
type: String,
|
|
134
163
|
default: "100px",
|
|
135
164
|
},
|
|
165
|
+
fieldOptions: {
|
|
166
|
+
type: Object,
|
|
167
|
+
default: () => {},
|
|
168
|
+
},
|
|
136
169
|
},
|
|
137
170
|
watch: {
|
|
138
171
|
searchParam: {
|
|
@@ -151,6 +184,7 @@ export default {
|
|
|
151
184
|
data() {
|
|
152
185
|
return {
|
|
153
186
|
formPop: {},
|
|
187
|
+
|
|
154
188
|
searchData: {
|
|
155
189
|
pageNo: 1,
|
|
156
190
|
total: 1,
|
|
@@ -206,6 +240,10 @@ export default {
|
|
|
206
240
|
this.formPop = {};
|
|
207
241
|
this.showDialog = false;
|
|
208
242
|
},
|
|
243
|
+
getOptions(prop) {
|
|
244
|
+
let options = this.fieldOptions[`${prop}Options`] || [];
|
|
245
|
+
return options;
|
|
246
|
+
},
|
|
209
247
|
},
|
|
210
248
|
};
|
|
211
249
|
</script>
|