xianniu-ui 0.3.22 → 0.3.23
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/lib/xianniu-ui.common.js +91 -46
- package/lib/xianniu-ui.umd.js +91 -46
- package/lib/xianniu-ui.umd.min.js +3 -3
- package/package.json +1 -1
- package/packages/search/main.vue +30 -13
package/package.json
CHANGED
package/packages/search/main.vue
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div class="xn-search">
|
|
3
3
|
<el-form ref="form" inline :model="form" :label-width="labelWidth">
|
|
4
4
|
<el-row :gutter="0" class="xn-search--row">
|
|
5
|
-
<template v-for="(item, idx) in
|
|
5
|
+
<template v-for="(item, idx) in form.value">
|
|
6
6
|
<el-col v-bind="{ ...col }" :key="idx" v-show="item.isShow || isColl">
|
|
7
7
|
<el-form-item
|
|
8
8
|
v-if="item.type === 'city'"
|
|
@@ -12,8 +12,9 @@
|
|
|
12
12
|
class="xn-search--row_col"
|
|
13
13
|
>
|
|
14
14
|
<xn-city
|
|
15
|
+
:key="item.prop"
|
|
15
16
|
:data-level="(item.options && item.options.dataLevel) || 2"
|
|
16
|
-
v-model="
|
|
17
|
+
v-model="item.modelVal"
|
|
17
18
|
@on-city="handleChangeCity"
|
|
18
19
|
/>
|
|
19
20
|
</el-form-item>
|
|
@@ -25,9 +26,10 @@
|
|
|
25
26
|
class="xn-search--row_col"
|
|
26
27
|
>
|
|
27
28
|
<el-input
|
|
29
|
+
:key="item.prop"
|
|
28
30
|
style="width: 100%"
|
|
29
31
|
v-bind="item.options ? { ...item.options } : {}"
|
|
30
|
-
v-model="
|
|
32
|
+
v-model="item.modelVal"
|
|
31
33
|
:clearable="item.clearable || true"
|
|
32
34
|
:placeholder="item.placeholder || '请填写' + item.label"
|
|
33
35
|
/>
|
|
@@ -40,8 +42,9 @@
|
|
|
40
42
|
class="xn-search--row_col"
|
|
41
43
|
>
|
|
42
44
|
<el-select
|
|
45
|
+
:key="item.prop"
|
|
43
46
|
style="width: 100%"
|
|
44
|
-
v-model="
|
|
47
|
+
v-model="item.modelVal"
|
|
45
48
|
:placeholder="item.placeholder || '请选择' + item.label"
|
|
46
49
|
:clearable="item.clearable || true"
|
|
47
50
|
filterable
|
|
@@ -71,7 +74,8 @@
|
|
|
71
74
|
class="xn-search--row_col"
|
|
72
75
|
>
|
|
73
76
|
<xn-date
|
|
74
|
-
|
|
77
|
+
:key="item.prop"
|
|
78
|
+
v-model="item.modelVal"
|
|
75
79
|
:mode="item.mode || 'range'"
|
|
76
80
|
:type="item.type || 'daterange'"
|
|
77
81
|
:is-shortcut="showShortcut(item)"
|
|
@@ -203,16 +207,29 @@ export default {
|
|
|
203
207
|
};
|
|
204
208
|
},
|
|
205
209
|
created() {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
}
|
|
213
|
-
|
|
210
|
+
// this.init();
|
|
211
|
+
},
|
|
212
|
+
watch: {
|
|
213
|
+
formData: {
|
|
214
|
+
handler(n) {
|
|
215
|
+
n&&n.length&&this.init();
|
|
216
|
+
},
|
|
217
|
+
immediate:true
|
|
218
|
+
},
|
|
214
219
|
},
|
|
215
220
|
methods: {
|
|
221
|
+
init() {
|
|
222
|
+
this.form.value = []
|
|
223
|
+
for (let i = 0, formData = this.formData; i < formData.length; i++) {
|
|
224
|
+
const item = formData[i];
|
|
225
|
+
item.isShow = i > 3 && this.showColl ? false : true;
|
|
226
|
+
this.form.value.push({
|
|
227
|
+
...item,
|
|
228
|
+
key: item.prop,
|
|
229
|
+
modelVal: "",
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
},
|
|
216
233
|
onSearch() {
|
|
217
234
|
const formValue = {};
|
|
218
235
|
if (this.formData) {
|