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> <script>
import Dialog from '@/components/Dialog' import Dialog from '@/components/Dialog'
import { GenericCreateUpdateForm } from '@/layout/components' import { GenericCreateUpdateForm } from '@/layout/components'
import { platformFieldsMeta, setAutomations } from '../const' import { platformFieldsMeta } from '../const'
export default { export default {
components: { components: {
@@ -56,9 +56,19 @@ export default {
} }
}, },
created() { created() {
setAutomations(this) try {
this.setOptions()
} finally {
this.iVisible = true
}
}, },
methods: { 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() { submitSuccess() {
this.iVisible = false this.iVisible = false
} }