From 9fa4433e7ffe15c4232ae22fc5c908d418b28e64 Mon Sep 17 00:00:00 2001 From: my_ong <429426262@qq.com> Date: Tue, 10 Dec 2024 13:06:10 +0800 Subject: [PATCH] =?UTF-8?q?bug:=20select=E4=BA=8B=E4=BB=B6,TS=E8=AF=AD?= =?UTF-8?q?=E6=B3=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/stock/component/apply-form.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/views/stock/component/apply-form.vue b/src/views/stock/component/apply-form.vue index 3ffc896..85ffbd7 100644 --- a/src/views/stock/component/apply-form.vue +++ b/src/views/stock/component/apply-form.vue @@ -25,8 +25,8 @@ style="width: 40%" show-search :options="options" - @deselect="removeEvent" - @select="insertEvent" + @deselect="removeEvent($event)" + @select="insertEvent($event)" > @@ -81,6 +81,8 @@ import api from '@/api' import { useUserStore } from '@/stores/user' import dayjs, { Dayjs } from 'dayjs' + import { LabeledValue, DefaultOptionType } from 'ant-design-vue/es/select' + import { SelectHandler } from 'ant-design-vue/es/vc-select/Select' // 和外层界面的数据交互 const props = defineProps( @@ -151,7 +153,8 @@ // 选中时在末尾新增一行 // value: number, option: { label: string, value: number } - const insertEvent = (value: string | number) => { + type Insert = SelectHandler | undefined + const insertEvent = (value: Insert) => { // 根据value找到对应的物料信息 const m = materialList.value.find((item) => item.id === value) if (m) { @@ -174,7 +177,7 @@ } // 取消选中时,删除table中的行 - const removeEvent = (value: string | number) => { + const removeEvent = (value: Insert) => { const $table = tableRef.value // 根据value找到对应的行 if ($table) {