@ddwl/ddwl-ui 1.0.14 → 1.0.16
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/CHANGELOG.md +18 -0
- package/package.json +1 -1
- package/src/lib/slots/dict.vue +0 -3
- package/src/packages/form-item/index.vue +19 -34
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## [1.0.16](https://121.40.23.60:51888/frontend/ddwl-ui/compare/v1.0.15...v1.0.16) (2025-07-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* d-form-item slot去除key ([e2db721](https://121.40.23.60:51888/frontend/ddwl-ui/commits/e2db7211fbee878aa85bb9b916fb33b8a0f24d9b))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## [1.0.15](https://121.40.23.60:51888/frontend/ddwl-ui/compare/v1.0.14...v1.0.15) (2025-07-04)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* d-form-item新增自定义slot ([8fed8c1](https://121.40.23.60:51888/frontend/ddwl-ui/commits/8fed8c177a84af8eb9820b1f00eb2901d8cc624c))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
1
19
|
## [1.0.14](https://121.40.23.60:51888/frontend/ddwl-ui/compare/v1.0.13...v1.0.14) (2025-07-04)
|
|
2
20
|
|
|
3
21
|
|
package/package.json
CHANGED
package/src/lib/slots/dict.vue
CHANGED
|
@@ -29,13 +29,10 @@ export default {
|
|
|
29
29
|
},
|
|
30
30
|
computed: {
|
|
31
31
|
dictText () {
|
|
32
|
-
console.log(this.$DDWL, this.row[this.prop], this.row, this.prop, this)
|
|
33
32
|
if (Array.isArray(this.row[this.prop])) {
|
|
34
33
|
const result = this.$DDWL.enum.getLabels(this.code, this.row[this.prop])
|
|
35
|
-
console.log(result)
|
|
36
34
|
return result?.length ? result.join(',') : ''
|
|
37
35
|
} else {
|
|
38
|
-
console.log(this.$DDWL.enum.getLabel(this.code, this.row[this.prop]))
|
|
39
36
|
return this.$DDWL.enum.getLabel(this.code, this.row[this.prop])
|
|
40
37
|
}
|
|
41
38
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- eslint-disable vue/valid-v-for -->
|
|
1
2
|
<template>
|
|
2
3
|
<div class="search-item">
|
|
3
4
|
<div>
|
|
@@ -22,39 +23,6 @@
|
|
|
22
23
|
{{ radio.label }}
|
|
23
24
|
</el-radio>
|
|
24
25
|
</el-radio-group>
|
|
25
|
-
<el-cascader
|
|
26
|
-
v-if="config.component === 'el-cascader'"
|
|
27
|
-
:ref="config.prop"
|
|
28
|
-
v-model="value"
|
|
29
|
-
:style="{
|
|
30
|
-
width: config.width
|
|
31
|
-
}"
|
|
32
|
-
:clearable="clearable(config)"
|
|
33
|
-
:disabled="!!config.disabled"
|
|
34
|
-
:placeholder="config.placeholder || placeholder(config)"
|
|
35
|
-
v-bind="config.props"
|
|
36
|
-
v-on="config.listeners"
|
|
37
|
-
@change="change"
|
|
38
|
-
>
|
|
39
|
-
<!-- 当级联选择项需要弹pop弹窗时 -->
|
|
40
|
-
<template
|
|
41
|
-
v-if="config.hasPopover"
|
|
42
|
-
slot-scope="{ data }"
|
|
43
|
-
>
|
|
44
|
-
<el-popover
|
|
45
|
-
v-if="config.popConfig.isShow(data)"
|
|
46
|
-
:placement="config.popConfig.placement || 'right'"
|
|
47
|
-
trigger="hover"
|
|
48
|
-
>
|
|
49
|
-
<component
|
|
50
|
-
:is="config.popConfig.component"
|
|
51
|
-
:data="data"
|
|
52
|
-
/>
|
|
53
|
-
<span slot="reference"> {{ data[config.props.props.label] }}</span>
|
|
54
|
-
</el-popover>
|
|
55
|
-
<span v-else> {{ data[config.props.props.label] }}</span>
|
|
56
|
-
</template>
|
|
57
|
-
</el-cascader>
|
|
58
26
|
<component
|
|
59
27
|
:is="config.component"
|
|
60
28
|
v-else
|
|
@@ -71,6 +39,15 @@
|
|
|
71
39
|
v-on="config.listeners"
|
|
72
40
|
@change="change"
|
|
73
41
|
>
|
|
42
|
+
<template
|
|
43
|
+
v-for="s in slots"
|
|
44
|
+
:slot="s.slotName"
|
|
45
|
+
>
|
|
46
|
+
<form-item-render
|
|
47
|
+
:scope="config"
|
|
48
|
+
:render="s.render"
|
|
49
|
+
/>
|
|
50
|
+
</template>
|
|
74
51
|
<template v-if="config.component === 'el-checkbox-group'">
|
|
75
52
|
<el-checkbox
|
|
76
53
|
v-for="(checkbox, checkboxIndex) in config.options"
|
|
@@ -100,9 +77,11 @@
|
|
|
100
77
|
</template>
|
|
101
78
|
|
|
102
79
|
<script>
|
|
80
|
+
import FormItemRender from '../render'
|
|
81
|
+
|
|
103
82
|
export default {
|
|
104
83
|
name: 'DFormItem',
|
|
105
|
-
components: {},
|
|
84
|
+
components: { FormItemRender },
|
|
106
85
|
model: {
|
|
107
86
|
prop: 'modelValue',
|
|
108
87
|
event: 'change'
|
|
@@ -130,6 +109,12 @@ export default {
|
|
|
130
109
|
this.$emit('change', value)
|
|
131
110
|
}
|
|
132
111
|
},
|
|
112
|
+
slots () {
|
|
113
|
+
return Object.entries(this.config.slots || []).map(([key, value]) => ({
|
|
114
|
+
slotName: key,
|
|
115
|
+
render: value
|
|
116
|
+
}))
|
|
117
|
+
},
|
|
133
118
|
clearable () {
|
|
134
119
|
return (config) => {
|
|
135
120
|
// 优先取配置项clearable
|