@ddwl/ddwl-ui 1.4.2 → 1.4.3
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 +97 -100
- package/dist/index.umd.js +102 -105
- package/dist/index.umd.min.js +4 -4
- package/package.json +1 -1
- package/src/packages/search-table/index.vue +5 -19
- package/src/packages/table/index.vue +5 -1
package/package.json
CHANGED
|
@@ -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,
|