diff --git a/project/xumu/components/AiEartagPicker.vue b/project/xumu/components/AiEartagPicker.vue index 0b86ec76..faf2e86f 100644 --- a/project/xumu/components/AiEartagPicker.vue +++ b/project/xumu/components/AiEartagPicker.vue @@ -18,8 +18,17 @@ export default { selected: [] } }, + computed: { + api: v => { + let url = v.action + if (v.penId) { + url += `?penId=${v.penId}` + } + return url + } + }, watch: { - action: { + api: { immediate: true, handler() { this.getEartag() @@ -28,11 +37,7 @@ export default { }, methods: { getEartag() { - let url = this.action - if (this.penId) { - url += `?penId=${this.penId}` - } - !/undefined/.test(url) && this.instance.post(url).then(res => { + !/undefined/.test(this.api) && this.instance.post(this.api).then(res => { if (res?.data) { this.list = res.data }