Merge pull request #4173 from jumpserver/pr@dev@fix_cloud_origin

fixed: cloud origin bug. TAPD: 1043263
This commit is contained in:
ZhaoJiSen
2024-07-03 11:18:19 +08:00
committed by GitHub
3 changed files with 11 additions and 8 deletions

View File

@@ -122,9 +122,6 @@ export default {
}
}
},
activated() {
this.$refs.accountTable.reloadTable()
},
methods: {
valid(status) {
if (status !== 200) {

View File

@@ -172,11 +172,12 @@ export default {
btn.loading = true
}
})
this.$refs.form.$refs.form.dataForm.submitForm('form', false)
if (this.origin === 'update') {
setTimeout(() => {
this.$emit('refresh')
this.$emit('submitSuccess')
this.$emit('update:visible', false)
}, 500)
}

View File

@@ -17,7 +17,7 @@
>
<el-row>
<el-col>
<el-checkbox v-model="checkAll" @change="handleCheckedAllChange">
<el-checkbox v-model="checkAll" :indeterminate="isIndeterminate" @change="handleCheckedAllChange">
{{ $t('All') }}
</el-checkbox>
</el-col>
@@ -75,7 +75,7 @@ export default {
allRegions: [],
checkAll: false,
regionVisible: false,
isIndeterminate: false
isIndeterminate: true
}
},
watch: {
@@ -126,10 +126,13 @@ export default {
handleCheckedAllChange(val) {
this.checkedRegion = val ? this.allRegions.map(region => region.id) : []
this.isIndeterminate = false
this.checkAll = !!val
this.$emit('input', [])
this.refreshContent()
},
handleCheckedRegionChange(value) {
const checkedCount = value.length
this.checkAll = checkedCount === this.allRegions.length
this.checkAll = checkedCount === 0 || checkedCount === this.allRegions.length
this.isIndeterminate = checkedCount > 0 && checkedCount < this.allRegions.length
const region = this.allRegions
@@ -145,7 +148,9 @@ export default {
updateCheckedStatus() {
const checkedCount = this.checkedRegion.length
this.checkAll = checkedCount === this.allRegions.length
this.isIndeterminate = checkedCount > 0 && checkedCount < this.allRegions.length
if (checkedCount === 0 || checkedCount === this.allRegions.length) {
this.handleCheckedAllChange(this.allRegions)
}
}
}
}