mirror of
https://github.com/jumpserver/lina.git
synced 2025-07-12 22:49:38 +00:00
fix: 修复平台详情-更新平台信息设置为false后不能点击问题
This commit is contained in:
parent
beced802f0
commit
eec62c12ff
@ -62,7 +62,7 @@ export default {
|
||||
}
|
||||
return obj
|
||||
},
|
||||
object: {}
|
||||
defaultOptions: {}
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
@ -90,7 +90,7 @@ export default {
|
||||
const type = this.$route.query.type
|
||||
const url = `/api/v1/assets/categories/constraints/?category=${category}&type=${type}`
|
||||
const constraints = await this.$axios.get(url)
|
||||
this.object = constraints
|
||||
this.defaultOptions = constraints
|
||||
|
||||
const fieldsCheck = ['protocols_enabled', 'domain_enabled', 'su_enabled']
|
||||
for (const field of fieldsCheck) {
|
||||
|
@ -36,15 +36,19 @@ export default {
|
||||
submitMethod: () => 'patch',
|
||||
fields: [['', ['automation']]],
|
||||
fieldsMeta: platformFieldsMeta(this),
|
||||
onSubmit: this.submit
|
||||
onSubmit: this.submit,
|
||||
defaultOptions: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['isSystemAdmin'])
|
||||
},
|
||||
mounted() {
|
||||
async mounted() {
|
||||
try {
|
||||
setAutomations(this)
|
||||
const { category, type } = this.object
|
||||
const url = `/api/v1/assets/categories/constraints/?category=${category.value}&type=${type.value}`
|
||||
this.defaultOptions = await this.$axios.get(url)
|
||||
await setAutomations(this)
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ export const platformFieldsMeta = (vm) => {
|
||||
}
|
||||
|
||||
export const setAutomations = (vm) => {
|
||||
const automation = vm.object.automation || {}
|
||||
const automation = vm.defaultOptions.automation || {}
|
||||
const autoFieldsMeta = vm.fieldsMeta.automation.fieldsMeta
|
||||
const autoFields = vm.fieldsMeta.automation.fields
|
||||
.filter(item => item.endsWith('_method'))
|
||||
|
Loading…
Reference in New Issue
Block a user