File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
src/ui/src/components/model-manage/field-group Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 201201 }
202202 },
203203 defaultValue (val , old ) {
204- // 检测选中值变化,需要修正is_default
204+ // 检测选中值变化,需要修正is_default,这里值的类型都是string
205205 if (val && ! isEqual (val, old)) {
206206 this .enumList .forEach ((item ) => {
207- item .is_default = val .includes (item .id )
207+ if (this .isDefaultCompMultiple && Array .isArray (val)) {
208+ item .is_default = val .includes (item .id )
209+ } else {
210+ item .is_default = val === item .id
211+ }
208212 })
209213 this .$emit (' input' , this .enumList )
210214 }
Original file line number Diff line number Diff line change 151151 :value =" defaultValue"
152152 :property =" field" >
153153 </cmdb-property-value >
154+ <!-- bool类型字段未设置与默认值false都将显示为false -->
154155 <span v-else
155- class =" property-value" >{{defaultValue || '--'}}</span >
156+ class =" property-value" >{{defaultValue ?? '--'}}</span >
156157 </div >
157158 </div >
158159 <template slot="footer" slot-scope="{ sticky }" v-if =" canEdit " >
You can’t perform that action at this time.
0 commit comments