Skip to content

Commit

Permalink
Merge pull request #657 from veops/dev_ui_241217
Browse files Browse the repository at this point in the history
fix(ui): ci - number type attr default value display error
  • Loading branch information
LHRUN authored Dec 17, 2024
2 parents d1e40b4 + c3aab86 commit 41ce5db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
attr.name,
{
rules: [{ required: attr.is_required, message: $t('placeholder1') + `${attr.alias || attr.name}` }],
initialValue: attr.default && attr.default.default ? attr.default.default : null,
initialValue: attr.default && attr.default.default !== undefined && attr.default.default !== null ? attr.default.default : null,
},
]"
style="width: 100%"
Expand Down Expand Up @@ -148,6 +148,7 @@
</template>

<script>
import _ from 'lodash'
import moment from 'moment'
import JsonEditor from '../../../components/JsonEditor/jsonEditor.vue'
import CIReferenceAttr from '@/components/ciReferenceAttr/index.vue'
Expand Down Expand Up @@ -210,7 +211,7 @@ export default {
},

getChoiceDefault(attr) {
if (!attr?.default?.default) {
if (_.isNil(attr?.default?.default)) {
return attr.is_list ? [] : null
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ export default {
} else {
this.$nextTick(() => {
this.form.setFieldsValue({
default_value: _record.default && _record.default.default ? _record.default.default : null,
default_value: _record?.default?.default ?? null,
})
})
}
Expand Down

0 comments on commit 41ce5db

Please sign in to comment.