@ddwl/ddwl-ui 1.4.2 → 1.4.4
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 +150 -150
- package/dist/index.umd.js +190 -190
- package/dist/index.umd.min.js +4 -4
- package/package.json +1 -1
- package/src/packages/search-form/index.vue +6 -4
- package/src/packages/search-table/index.vue +5 -19
- package/src/packages/table/index.vue +5 -1
package/package.json
CHANGED
|
@@ -151,11 +151,12 @@ export default {
|
|
|
151
151
|
* @description: 查询
|
|
152
152
|
*/
|
|
153
153
|
async search() {
|
|
154
|
-
this
|
|
154
|
+
const params = cloneDeep(this.form)
|
|
155
|
+
this.$emit('search', params)
|
|
155
156
|
if (this.searchData) {
|
|
156
157
|
try {
|
|
157
158
|
this.searchLoading = true
|
|
158
|
-
await this.searchData({ pageNum: 1 },
|
|
159
|
+
await this.searchData({ pageNum: 1 }, params)
|
|
159
160
|
this.searchLoading = false
|
|
160
161
|
} catch (e) {
|
|
161
162
|
this.searchLoading = false
|
|
@@ -167,10 +168,11 @@ export default {
|
|
|
167
168
|
*/
|
|
168
169
|
async reset() {
|
|
169
170
|
this.form = cloneDeep(this.initForm)
|
|
170
|
-
this
|
|
171
|
+
const params = cloneDeep(this.form)
|
|
172
|
+
this.$emit('search', params)
|
|
171
173
|
if (this.searchData) {
|
|
172
174
|
this.resetLoading = true
|
|
173
|
-
await this.searchData({ pageNum: 1 },
|
|
175
|
+
await this.searchData({ pageNum: 1 }, params)
|
|
174
176
|
this.resetLoading = false
|
|
175
177
|
}
|
|
176
178
|
},
|
|
@@ -3,20 +3,21 @@
|
|
|
3
3
|
<div class="d-table-search-wrap">
|
|
4
4
|
<search-form
|
|
5
5
|
v-model="form"
|
|
6
|
+
v-bind="$attrs"
|
|
6
7
|
:config="config.searchConfig"
|
|
7
8
|
:search-data="searchData"
|
|
8
|
-
v-bind="$attrs"
|
|
9
9
|
v-on="$listeners"
|
|
10
10
|
>
|
|
11
11
|
<slot />
|
|
12
12
|
</search-form>
|
|
13
13
|
<d-table
|
|
14
14
|
v-if="config.columns.length"
|
|
15
|
+
v-bind="$attrs"
|
|
15
16
|
ref="dTable"
|
|
16
|
-
:request-config="requestConfig"
|
|
17
|
+
:request-config="config.requestConfig"
|
|
17
18
|
:columns="config.columns"
|
|
18
19
|
:data="data"
|
|
19
|
-
|
|
20
|
+
:form="form"
|
|
20
21
|
class="d-table-wrap"
|
|
21
22
|
v-on="$listeners"
|
|
22
23
|
/>
|
|
@@ -24,7 +25,6 @@
|
|
|
24
25
|
</template>
|
|
25
26
|
|
|
26
27
|
<script>
|
|
27
|
-
import { cloneDeep } from 'lodash'
|
|
28
28
|
import SearchForm from '../search-form/index.vue'
|
|
29
29
|
import DTable from '../table/index.vue'
|
|
30
30
|
|
|
@@ -50,21 +50,7 @@ export default {
|
|
|
50
50
|
form: {}
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
|
-
computed: {
|
|
54
|
-
requestConfig() {
|
|
55
|
-
const requestConfig = this.config.requestConfig
|
|
56
|
-
return {
|
|
57
|
-
...requestConfig,
|
|
58
|
-
params:
|
|
59
|
-
typeof requestConfig.params === 'function'
|
|
60
|
-
? requestConfig.params(cloneDeep(this.form)) // 处理自定义参数
|
|
61
|
-
: {
|
|
62
|
-
...this.form,
|
|
63
|
-
...requestConfig.params
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
},
|
|
53
|
+
computed: {},
|
|
68
54
|
created() {
|
|
69
55
|
this.createFormBind()
|
|
70
56
|
},
|
|
@@ -81,6 +81,10 @@ export default {
|
|
|
81
81
|
name: 'DTable',
|
|
82
82
|
components: { ...modules, ColumnRender },
|
|
83
83
|
props: {
|
|
84
|
+
form: {
|
|
85
|
+
type: Object,
|
|
86
|
+
default: () => ({})
|
|
87
|
+
},
|
|
84
88
|
data: {
|
|
85
89
|
type: Array,
|
|
86
90
|
default: () => []
|
|
@@ -250,7 +254,7 @@ export default {
|
|
|
250
254
|
async getData(params) {
|
|
251
255
|
const defaultParams =
|
|
252
256
|
typeof this.requestConfig.params === 'function'
|
|
253
|
-
? this.requestConfig.params()
|
|
257
|
+
? this.requestConfig.params(this.form)
|
|
254
258
|
: this.requestConfig.params
|
|
255
259
|
const { data } = await this.requestConfig.api({
|
|
256
260
|
...defaultParams,
|