Files
gxtyzx-admin/src/views/cms/mpMenu_bak/menu/components/search.vue
T

62 lines
1.4 KiB
Vue

<!-- 搜索表单 -->
<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>
<span class="ele-text-placeholder" style="margin-left: 20px"
>菜单类型</span
>
<a-radio-group v-model:value="where.type" @change="handleSearch">
<a-radio-button :value="1">订单图标</a-radio-button>
<a-radio-button :value="0">功能图标</a-radio-button>
</a-radio-group>
</a-space>
</a-space>
</template>
<script lang="ts" setup>
import { PlusOutlined } from '@ant-design/icons-vue';
import { watch } from 'vue';
import useSearch from '@/utils/use-search';
import { MpMenu, MpMenuParam } from '@/api/cms/mp-menu/model';
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const emit = defineEmits<{
(e: 'search', where?: MpMenuParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 表单数据
const { where } = useSearch<MpMenu>({
type: 0
});
const handleSearch = () => {
emit('search', where);
};
// 新增
const add = () => {
emit('add');
};
watch(
() => props.selection,
() => {}
);
</script>