Skip to content
Permalink
Browse files
优化参数位置的展示,修复下拉选择框第一次更改不生效问题 (#672)
  • Loading branch information
KeRan213539 committed Dec 24, 2020
1 parent 3268c49 commit f3028e624c3e0fe50c51bcb42ef577ec51a377ec
Showing 2 changed files with 24 additions and 10 deletions.
@@ -153,7 +153,7 @@
<div class="font-weight-normal">
<strong>{{ $t('apiDocsRes.apiForm.paramPathLabel') }}</strong>
</div>
<div style="wordBreak: break-word">{{item.get('paramType')}}#{{item.get('name')}}</div>
<div style="wordBreak: break-word">[{{item.get('paramIndex')}}]{{item.get('paramType')}}#{{item.get('name')}}</div>
</div>
</v-timeline-item>
<v-timeline-item
@@ -357,7 +357,6 @@ export default {
if (!this.$refs.form.validate()) {
return false
}
var tempMap = new Map()
this.formValues.forEach((value, key) => {
var elementIdSplited = key.split('@@')
@@ -413,7 +412,6 @@ export default {
}).then(response => {
this.responseData = response.data
})
// console.log(this.formValues)
}
},
mounted () {
@@ -139,6 +139,8 @@ export default {
},
data: () => {
return {
isSelectDefaultBuiled: false,
selectDefaultValue: ''
}
},
watch: {
@@ -160,25 +162,39 @@ export default {
},
buildSelectItem () {
var allowableValues = this.formItemInfo.get('allowableValues')
const dataSource = new Array()
const selectSource = []
var dsItemEmpty = {}
dsItemEmpty.label = ''
dsItemEmpty.value = ''
selectSource.push(dsItemEmpty)
for (var i = 0; i < allowableValues.length; i++) {
var valueItem = allowableValues[i]
var dsItem = {}
dsItem.label = valueItem
dsItem.value = valueItem
dataSource.push(dsItem)
selectSource.push(dsItem)
}
return dataSource
return selectSource
},
buildDefaultValue () {
var defaultValue = this.formItemInfo.get('defaultValue')
this.formValues.set(this.buildItemId(), defaultValue)
if (defaultValue) {
this.formValues.set(this.buildItemId(), defaultValue)
} else {
defaultValue = ''
}
return defaultValue
},
buildSelectDefaultValue () {
var allowableValues = this.formItemInfo.get('allowableValues')
this.formValues.set(this.buildItemId(), allowableValues[0])
return allowableValues[0]
if (!this.isSelectDefaultBuiled) {
this.isSelectDefaultBuiled = true
var defaultValue = this.formItemInfo.get('defaultValue')
if (defaultValue) {
this.selectDefaultValue = defaultValue
this.formValues.set(this.buildItemId(), defaultValue[0])
}
}
return this.selectDefaultValue
},
buildJsonDefaultValue () {
var defaultValue = JSON.parse(this.formItemInfo.get('subParamsJson'))

0 comments on commit f3028e6

Please sign in to comment.