优化网站导航模块
This commit is contained in:
@@ -1,19 +1,23 @@
|
||||
<!-- 搜索表单 -->
|
||||
<template>
|
||||
<a-space :size="10" style="flex-wrap: wrap">
|
||||
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
<span>添加</span>
|
||||
</a-button>
|
||||
<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 { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import type { GradeParam } from '@/api/user/grade/model';
|
||||
import { watch } from 'vue';
|
||||
import useSearch from '@/utils/use-search';
|
||||
import { GoodsParam } from '@/api/shop/goods/model';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@@ -24,15 +28,21 @@
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: GradeParam): void;
|
||||
(e: 'search', where?: GoodsParam): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'remove'): void;
|
||||
(e: 'batchMove'): void;
|
||||
}>();
|
||||
|
||||
// 新增
|
||||
const add = () => {
|
||||
emit('add');
|
||||
// 表单数据
|
||||
const { where } = useSearch<GoodsParam>({
|
||||
goodsId: undefined,
|
||||
goodsName: undefined,
|
||||
keywords: undefined
|
||||
});
|
||||
|
||||
const handleSearch = () => {
|
||||
emit('search', where);
|
||||
};
|
||||
|
||||
watch(
|
||||
|
||||
Reference in New Issue
Block a user