leisure-core 0.4.43 → 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 +53 -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,21 +75,38 @@
|
|
|
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>
|
|
88
105
|
</div>
|
|
89
106
|
</template>
|
|
90
107
|
<script>
|
|
108
|
+
import { Number } from "core-js";
|
|
109
|
+
|
|
91
110
|
export default {
|
|
92
111
|
name: "le-common-page",
|
|
93
112
|
props: {
|
|
@@ -95,10 +114,18 @@ export default {
|
|
|
95
114
|
type: Array,
|
|
96
115
|
default: () => [],
|
|
97
116
|
},
|
|
117
|
+
totalData: {
|
|
118
|
+
type: Number,
|
|
119
|
+
default: 1,
|
|
120
|
+
},
|
|
98
121
|
tableColumns: {
|
|
99
122
|
type: Array,
|
|
100
123
|
default: () => [],
|
|
101
124
|
},
|
|
125
|
+
formColumns: {
|
|
126
|
+
type: Array,
|
|
127
|
+
default: () => [],
|
|
128
|
+
},
|
|
102
129
|
queryParams: {
|
|
103
130
|
type: Object,
|
|
104
131
|
default: () => {},
|
|
@@ -123,10 +150,22 @@ export default {
|
|
|
123
150
|
type: String,
|
|
124
151
|
default: "80%",
|
|
125
152
|
},
|
|
153
|
+
popFormLabelWidth: {
|
|
154
|
+
type: String,
|
|
155
|
+
default: "100px",
|
|
156
|
+
},
|
|
157
|
+
popFormTitle: {
|
|
158
|
+
type: String,
|
|
159
|
+
default: "标题",
|
|
160
|
+
},
|
|
126
161
|
popLabelWidth: {
|
|
127
162
|
type: String,
|
|
128
163
|
default: "100px",
|
|
129
164
|
},
|
|
165
|
+
fieldOptions: {
|
|
166
|
+
type: Object,
|
|
167
|
+
default: () => {},
|
|
168
|
+
},
|
|
130
169
|
},
|
|
131
170
|
watch: {
|
|
132
171
|
searchParam: {
|
|
@@ -136,10 +175,16 @@ export default {
|
|
|
136
175
|
deep: true,
|
|
137
176
|
immediate: true,
|
|
138
177
|
},
|
|
178
|
+
totalData: {
|
|
179
|
+
handler(val) {
|
|
180
|
+
this.searchData.total = val;
|
|
181
|
+
},
|
|
182
|
+
},
|
|
139
183
|
},
|
|
140
184
|
data() {
|
|
141
185
|
return {
|
|
142
186
|
formPop: {},
|
|
187
|
+
|
|
143
188
|
searchData: {
|
|
144
189
|
pageNo: 1,
|
|
145
190
|
total: 1,
|
|
@@ -195,6 +240,10 @@ export default {
|
|
|
195
240
|
this.formPop = {};
|
|
196
241
|
this.showDialog = false;
|
|
197
242
|
},
|
|
243
|
+
getOptions(prop) {
|
|
244
|
+
let options = this.fieldOptions[`${prop}Options`] || [];
|
|
245
|
+
return options;
|
|
246
|
+
},
|
|
198
247
|
},
|
|
199
248
|
};
|
|
200
249
|
</script>
|