fix: 修复平台详情中更新协议,协议不能添加问题

This commit is contained in:
“huailei000”
2022-11-08 14:21:10 +08:00
committed by huailei
parent 73d03fecaf
commit dbf44cdfd8

View File

@@ -14,7 +14,7 @@
<script>
import Dialog from '@/components/Dialog'
import { GenericCreateUpdateForm } from '@/layout/components'
import { platformFieldsMeta, setAutomations } from '../const'
import { platformFieldsMeta } from '../const'
export default {
components: {
@@ -56,9 +56,19 @@ export default {
}
},
created() {
setAutomations(this)
try {
this.setOptions()
} finally {
this.iVisible = true
}
},
methods: {
async setOptions() {
const { category, type } = this.object
const url = `/api/v1/assets/categories/constraints/?category=${category.value}&type=${type.value}`
const res = await this.$axios.get(url)
this.fieldsMeta.protocols.el.choices = res['protocols'] || []
},
submitSuccess() {
this.iVisible = false
}