xianniu-ui 0.3.5 → 0.3.7
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 +46 -29
- package/lib/xianniu-ui.umd.js +46 -29
- package/lib/xianniu-ui.umd.min.js +1 -1
- package/package.json +1 -1
- package/packages/search/main.vue +37 -21
package/package.json
CHANGED
package/packages/search/main.vue
CHANGED
|
@@ -3,16 +3,7 @@
|
|
|
3
3
|
<el-form ref="form" inline :model="form" :label-width="labelWidth">
|
|
4
4
|
<el-row :gutter="0" class="xn-search--row">
|
|
5
5
|
<template v-for="(item, idx) in formData">
|
|
6
|
-
<el-col
|
|
7
|
-
:xs="24"
|
|
8
|
-
:sm="12"
|
|
9
|
-
:md="8"
|
|
10
|
-
:lg="6"
|
|
11
|
-
:xl="6"
|
|
12
|
-
:offset="0"
|
|
13
|
-
:key="idx"
|
|
14
|
-
v-show="item.isShow || isColl"
|
|
15
|
-
>
|
|
6
|
+
<el-col v-bind="{ ...col }" :key="idx" v-show="item.isShow || isColl">
|
|
16
7
|
<el-form-item
|
|
17
8
|
v-if="item.type === 'city'"
|
|
18
9
|
:key="idx"
|
|
@@ -35,6 +26,7 @@
|
|
|
35
26
|
>
|
|
36
27
|
<el-input
|
|
37
28
|
style="width: 100%"
|
|
29
|
+
v-bind="item.options ? { ...item.options } : {}"
|
|
38
30
|
v-model="form.value[idx].modelVal"
|
|
39
31
|
:clearable="item.clearable || true"
|
|
40
32
|
:placeholder="item.placeholder || '请填写' + item.label"
|
|
@@ -48,11 +40,12 @@
|
|
|
48
40
|
class="xn-search--row_col"
|
|
49
41
|
>
|
|
50
42
|
<el-select
|
|
51
|
-
style="width:100%"
|
|
43
|
+
style="width: 100%"
|
|
52
44
|
v-model="form.value[idx].modelVal"
|
|
53
45
|
:placeholder="item.placeholder || '请选择' + item.label"
|
|
54
46
|
:clearable="item.clearable || true"
|
|
55
47
|
filterable
|
|
48
|
+
v-bind="item.options ? { ...item.options } : {}"
|
|
56
49
|
:remote="isRemote(item.remote)"
|
|
57
50
|
:reserve-keyword="isRemote(item.remote)"
|
|
58
51
|
:default-first-option="isRemote(item.remote)"
|
|
@@ -99,7 +92,7 @@
|
|
|
99
92
|
</el-form-item>
|
|
100
93
|
</el-col>
|
|
101
94
|
</template>
|
|
102
|
-
<el-col
|
|
95
|
+
<el-col v-bind="{ ...col }">
|
|
103
96
|
<el-form-item :style="{ 'padding-left': `${labelWidth}` }">
|
|
104
97
|
<el-button type="primary" icon="el-icon-search" @click="onSearch"
|
|
105
98
|
>查询</el-button
|
|
@@ -109,9 +102,12 @@
|
|
|
109
102
|
v-if="formData.length && formData.length > 4"
|
|
110
103
|
type="text"
|
|
111
104
|
@click="isColl = !isColl"
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
105
|
+
>
|
|
106
|
+
<template v-if="showColl">
|
|
107
|
+
<span>{{ isColl ? "收起" : "高级查询" }}</span
|
|
108
|
+
><i class="ml-5" :class="toggle"></i>
|
|
109
|
+
</template>
|
|
110
|
+
</el-button>
|
|
115
111
|
</el-form-item>
|
|
116
112
|
</el-col>
|
|
117
113
|
</el-row>
|
|
@@ -131,12 +127,32 @@ export default {
|
|
|
131
127
|
type: String,
|
|
132
128
|
default: "110px",
|
|
133
129
|
},
|
|
130
|
+
span: {
|
|
131
|
+
type: Number,
|
|
132
|
+
default: null,
|
|
133
|
+
},
|
|
134
|
+
showColl: {
|
|
135
|
+
type: Boolean,
|
|
136
|
+
default: true,
|
|
137
|
+
},
|
|
134
138
|
},
|
|
135
139
|
computed: {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
+
col() {
|
|
141
|
+
const { span } = this;
|
|
142
|
+
return {
|
|
143
|
+
span,
|
|
144
|
+
xs: span ? span : 24,
|
|
145
|
+
sm: span ? span : 12,
|
|
146
|
+
md: span ? span : 8,
|
|
147
|
+
lg: span ? span : 6,
|
|
148
|
+
xl: span ? span : 6,
|
|
149
|
+
offset: 0,
|
|
150
|
+
};
|
|
151
|
+
},
|
|
152
|
+
isRemote() {
|
|
153
|
+
return (val) => {
|
|
154
|
+
return val && typeof val === "function";
|
|
155
|
+
};
|
|
140
156
|
},
|
|
141
157
|
_formData() {
|
|
142
158
|
return this.formData;
|
|
@@ -189,7 +205,7 @@ export default {
|
|
|
189
205
|
created() {
|
|
190
206
|
for (let i = 0, formData = this.formData; i < formData.length; i++) {
|
|
191
207
|
const item = formData[i];
|
|
192
|
-
item.isShow = i > 3 ? false : true;
|
|
208
|
+
item.isShow = i > 3 && this.showColl ? false : true;
|
|
193
209
|
this.form.value.push({
|
|
194
210
|
key: item.prop,
|
|
195
211
|
modelVal: "",
|
|
@@ -247,7 +263,7 @@ export default {
|
|
|
247
263
|
const row =
|
|
248
264
|
this.formData && this.formData.find((item) => item.label === key);
|
|
249
265
|
this.$set(row, "data", data);
|
|
250
|
-
}
|
|
266
|
+
},
|
|
251
267
|
},
|
|
252
268
|
};
|
|
253
269
|
</script>
|