NEX-717 fix:bug修改

This commit is contained in:
zhangyu
2021-06-02 16:55:17 +08:00
parent 38d62fbe43
commit 9ee8b0f7ba
7 changed files with 37 additions and 6 deletions

View File

@@ -103,7 +103,7 @@
</el-radio-group>
</template>
<template v-else-if="label.type.toUpperCase() === assetConstants.labelTypeData.CHECKBOX">
<el-checkbox-group v-model="label.value[0]">
<el-checkbox-group v-model="label.value">
<el-checkbox v-for="item in JSON.parse(label.param).items" :key="item.name" :label="item.name" :value="item.name"></el-checkbox>
</el-checkbox-group>
</template>
@@ -481,9 +481,27 @@ export default {
},
blankLabelValue (label) {
if (label.type.toUpperCase() === this.assetConstants.labelTypeData.CHECKBOX) {
return []
const arr = []
if (label.param && JSON.parse(label.param).items) {
JSON.parse(label.param).items.forEach(item => {
if (item.check) {
arr.push(item.name)
}
})
}
return arr
} else if (label.type.toUpperCase() === this.assetConstants.labelTypeData.MULTITEXT || label.type.toUpperCase() === assetConstants.labelTypeData.TEXT || label.type.toUpperCase() === assetConstants.labelTypeData.TEXTAREA) {
return ['']
} else if (label.type.toUpperCase() === this.assetConstants.labelTypeData.RADIO || label.type.toUpperCase() === assetConstants.labelTypeData.SELECT) {
const arr = ['']
if (label.param && JSON.parse(label.param).items) {
JSON.parse(label.param).items.forEach(item => {
if (item.check) {
arr[0] = item.name
}
})
}
return arr
} else {
return ['']
}