Files
guofu-admin/src/views/shop/cashier/components/search.vue
2024-08-23 22:28:24 +08:00

53 lines
1.1 KiB
Vue

<!-- 搜索表单 -->
<template>
<a-space :size="10" class="flex-wrap mb-5">
<a-input-search
allow-clear
size="large"
style="width: 400px"
placeholder="商品名称"
v-model:value="where.goodsName"
@pressEnter="handleSearch"
@search="handleSearch"
/>
<a-button @click="handleSearch" size="large">搜索</a-button>
</a-space>
</template>
<script lang="ts" setup>
import { watch } from 'vue';
import useSearch from '@/utils/use-search';
import { GoodsParam } from '@/api/shop/goods/model';
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const emit = defineEmits<{
(e: 'search', where?: GoodsParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 表单数据
const { where } = useSearch<GoodsParam>({
goodsId: undefined,
goodsName: undefined,
keywords: undefined
});
const handleSearch = () => {
emit('search', where);
};
watch(
() => props.selection,
() => {}
);
</script>