fix(过滤组件): 下拉组件单选框选中后无法取消选中
This commit is contained in:
parent
791dca6ef1
commit
86e3f1ee9a
@ -55,6 +55,26 @@
|
||||
>{{ $t('commons.required') }}</el-checkbox>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-dialog
|
||||
:visible.sync="dialogVisible"
|
||||
append-to-body
|
||||
:before-close="sureRequired"
|
||||
>
|
||||
当前组件的展示风格为平铺,如果设为非必填,那么组件的展示风格将切换为下拉展示。
|
||||
<div style="text-align: end;margin-top: 16px;">
|
||||
<span slot="footer">
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="dialogVisible = false"
|
||||
>{{ $t('commons.cancel') }}</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
@click="sureRequired"
|
||||
>{{ $t('commons.confirm') }}</el-button>
|
||||
</span>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
@ -77,18 +97,22 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
targets: []
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
|
||||
created() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
sureRequired() {
|
||||
this.element.options.attrs.required = false
|
||||
this.dialogVisible = false
|
||||
},
|
||||
requiredChange(val) {
|
||||
if (val === false && (this.element.style.showMode && this.element.style.showMode === 'radio' && !this.element.options.attrs.multiple)) {
|
||||
this.dialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.element.options.attrs.required = true
|
||||
})
|
||||
return
|
||||
}
|
||||
this.$emit('required-change', val)
|
||||
},
|
||||
getTableName(tableId) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user