@ddwl/ddwl-ui 1.4.8 → 1.4.10
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/dist/index.common.js +109 -105
- package/dist/index.umd.js +109 -105
- package/dist/index.umd.min.js +2 -2
- package/package.json +1 -1
- package/src/packages/search-form/index.vue +16 -11
- package/src/packages/table/index.vue +4 -7
package/package.json
CHANGED
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
<form-item v-model="form[item.prop]" :config="item" />
|
|
17
17
|
</div>
|
|
18
18
|
</el-col>
|
|
19
|
-
<el-col :span="hiddenIndex === list.length ||
|
|
19
|
+
<el-col :span="hiddenIndex === list.length || expand ? emptySpan : 0" style="height: 68px">
|
|
20
20
|
<span />
|
|
21
21
|
</el-col>
|
|
22
|
-
<el-col v-if="hasSlot &&
|
|
22
|
+
<el-col v-if="hasSlot && expand && !suffixSlot" :span="24 - submitSpan" class="mb16">
|
|
23
23
|
<slot />
|
|
24
24
|
</el-col>
|
|
25
25
|
<el-col v-if="config.length" :span="submitSpan">
|
|
26
26
|
<div
|
|
27
27
|
:style="{
|
|
28
|
-
'margin-top': hasSlot &&
|
|
28
|
+
'margin-top': hasSlot && expand && !suffixSlot ? '0px' : '24px'
|
|
29
29
|
}"
|
|
30
30
|
class="d-search-form-btn"
|
|
31
31
|
>
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
<el-button :disabled="searchLoading" @click="reset"> 重置 </el-button>
|
|
34
34
|
<el-button
|
|
35
35
|
v-if="list.length > hiddenIndex"
|
|
36
|
-
class="
|
|
37
|
-
:class="`el-icon-arrow-${
|
|
36
|
+
class="expand-btn"
|
|
37
|
+
:class="`el-icon-arrow-${expand ? 'up' : 'down'}`"
|
|
38
38
|
@click="changeStatus"
|
|
39
39
|
/>
|
|
40
40
|
</div>
|
|
41
41
|
</el-col>
|
|
42
|
-
<el-col v-if="hasSlot && (!
|
|
42
|
+
<el-col v-if="hasSlot && (!expand || suffixSlot)" :span="20" class="mb16">
|
|
43
43
|
<slot />
|
|
44
44
|
</el-col>
|
|
45
45
|
</el-row>
|
|
@@ -84,6 +84,10 @@ export default {
|
|
|
84
84
|
buttonSpan: {
|
|
85
85
|
default: 0,
|
|
86
86
|
type: Number
|
|
87
|
+
},
|
|
88
|
+
defaultExpand: {
|
|
89
|
+
default: false,
|
|
90
|
+
type: Boolean
|
|
87
91
|
}
|
|
88
92
|
},
|
|
89
93
|
data() {
|
|
@@ -92,7 +96,7 @@ export default {
|
|
|
92
96
|
list: [],
|
|
93
97
|
hiddenIndex: 0,
|
|
94
98
|
emptySpan: 0,
|
|
95
|
-
|
|
99
|
+
expand: false,
|
|
96
100
|
searchLoading: false,
|
|
97
101
|
// 判断是否有插槽节点,目前只在组件初始化完成时判断
|
|
98
102
|
hasSlot: false,
|
|
@@ -116,7 +120,7 @@ export default {
|
|
|
116
120
|
},
|
|
117
121
|
showCol() {
|
|
118
122
|
return (index) => {
|
|
119
|
-
return this.
|
|
123
|
+
return this.expand || index < this.hiddenIndex
|
|
120
124
|
}
|
|
121
125
|
}
|
|
122
126
|
},
|
|
@@ -140,6 +144,7 @@ export default {
|
|
|
140
144
|
}
|
|
141
145
|
},
|
|
142
146
|
created() {
|
|
147
|
+
this.expand = this.defaultExpand
|
|
143
148
|
this.initForm = cloneDeep(this.value)
|
|
144
149
|
this.$nextTick(() => {
|
|
145
150
|
this.hasSlot = !!(this.$slots.default && this.$slots.default.length)
|
|
@@ -180,8 +185,8 @@ export default {
|
|
|
180
185
|
* @description: 展开/收起
|
|
181
186
|
*/
|
|
182
187
|
changeStatus() {
|
|
183
|
-
this.
|
|
184
|
-
this.$emit('expand-change', this.
|
|
188
|
+
this.expand = !this.expand
|
|
189
|
+
this.$emit('expand-change', this.expand)
|
|
185
190
|
},
|
|
186
191
|
calcSpan() {
|
|
187
192
|
let hiddenIndex = 1
|
|
@@ -239,7 +244,7 @@ export default {
|
|
|
239
244
|
&-overflow {
|
|
240
245
|
margin-top: 24px;
|
|
241
246
|
}
|
|
242
|
-
.
|
|
247
|
+
.expand-btn {
|
|
243
248
|
padding: 4px 8px;
|
|
244
249
|
}
|
|
245
250
|
.d-search-item {
|
|
@@ -256,17 +256,14 @@ export default {
|
|
|
256
256
|
async getData(params) {
|
|
257
257
|
const defaultParams =
|
|
258
258
|
typeof this.requestConfig.params === 'function'
|
|
259
|
-
? this.requestConfig.params(this.form)
|
|
259
|
+
? this.requestConfig.params({ ...params, ...this.form })
|
|
260
260
|
: {
|
|
261
|
+
...params,
|
|
261
262
|
...this.form,
|
|
262
263
|
...this.requestConfig.params
|
|
263
264
|
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
...defaultParams
|
|
267
|
-
}
|
|
268
|
-
this.$emit('get-data', params)
|
|
269
|
-
const { data } = await this.requestConfig.api(params)
|
|
265
|
+
this.$emit('get-data', defaultParams)
|
|
266
|
+
const { data } = await this.requestConfig.api(defaultParams)
|
|
270
267
|
this.total = data.total
|
|
271
268
|
let listData = data.list || []
|
|
272
269
|
if (this.requestConfig.props) {
|