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: { methods: {
valid(status) { valid(status) {
if (status !== 200) { if (status !== 200) {

View File

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

View File

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