@ddwl/ddwl-ui 1.0.14 → 1.0.15
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 +9 -0
- package/package.json +1 -1
- package/src/lib/slots/dict.vue +0 -3
- package/src/packages/form-item/index.vue +20 -34
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## [1.0.15](https://121.40.23.60:51888/frontend/ddwl-ui/compare/v1.0.14...v1.0.15) (2025-07-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* d-form-item新增自定义slot ([8fed8c1](https://121.40.23.60:51888/frontend/ddwl-ui/commits/8fed8c177a84af8eb9820b1f00eb2901d8cc624c))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
1
10
|
## [1.0.14](https://121.40.23.60:51888/frontend/ddwl-ui/compare/v1.0.13...v1.0.14) (2025-07-04)
|
|
2
11
|
|
|
3
12
|
|
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/no-v-for-template-key -->
|
|
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,16 @@
|
|
|
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
|
+
:key="s.slotName"
|
|
46
|
+
>
|
|
47
|
+
<form-item-render
|
|
48
|
+
:scope="config"
|
|
49
|
+
:render="s.render"
|
|
50
|
+
/>
|
|
51
|
+
</template>
|
|
74
52
|
<template v-if="config.component === 'el-checkbox-group'">
|
|
75
53
|
<el-checkbox
|
|
76
54
|
v-for="(checkbox, checkboxIndex) in config.options"
|
|
@@ -100,9 +78,11 @@
|
|
|
100
78
|
</template>
|
|
101
79
|
|
|
102
80
|
<script>
|
|
81
|
+
import FormItemRender from '../render'
|
|
82
|
+
|
|
103
83
|
export default {
|
|
104
84
|
name: 'DFormItem',
|
|
105
|
-
components: {},
|
|
85
|
+
components: { FormItemRender },
|
|
106
86
|
model: {
|
|
107
87
|
prop: 'modelValue',
|
|
108
88
|
event: 'change'
|
|
@@ -130,6 +110,12 @@ export default {
|
|
|
130
110
|
this.$emit('change', value)
|
|
131
111
|
}
|
|
132
112
|
},
|
|
113
|
+
slots () {
|
|
114
|
+
return Object.entries(this.config.slots || []).map(([key, value]) => ({
|
|
115
|
+
slotName: key,
|
|
116
|
+
render: value
|
|
117
|
+
}))
|
|
118
|
+
},
|
|
133
119
|
clearable () {
|
|
134
120
|
return (config) => {
|
|
135
121
|
// 优先取配置项clearable
|