diff --git a/project/xumu/components/AiEartagPicker.vue b/project/xumu/components/AiEartagPicker.vue index db3701d9..f1705d22 100644 --- a/project/xumu/components/AiEartagPicker.vue +++ b/project/xumu/components/AiEartagPicker.vue @@ -16,7 +16,8 @@ export default { return { list: [], dialog: false, - selected: [] + selected: [], + origin: [] } }, computed: { @@ -41,6 +42,7 @@ export default { !/undefined/.test(this.api) && this.instance.post(this.api).then(res => { if (res?.data) { const key = this.valueKey + this.origin = res.data ?? [] this.list = res.data?.map(v => { if (typeof v == 'string') { return {key: v, label: v} @@ -54,7 +56,7 @@ export default { handleConfirm() { this.dialog = false this.$emit("input", this.selected) - this.$emit("select", this.list.filter(v => this.selected.includes(v.id))) + this.$emit("select", this.origin.filter(v => this.selected.includes(v?.[this.valueKey] ?? v))) } } }