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