Files
yxe-admin/src/views/goods/index/components/search-advanced/progress-select.vue
T
南宁网宿科技 13bed2bafb Initial commit
2023-06-03 23:57:39 +08:00

51 lines
1.1 KiB
Vue

<!-- 选择下拉框 -->
<template>
<a-space>
<a-button type="dashed" @click="reset">全部</a-button>
<a-button
v-for="(item, index) in data"
:key="index"
type="dashed"
v-model:value.trim="where.progress"
@click="search(item.value)"
>{{ item.label }}</a-button
>
</a-space>
</template>
<script lang="ts" setup>
import { CustomerParam } from '@/api/oa/customer/model';
import useSearch from '@/utils/use-search';
import { getDictionaryOptions } from '@/utils/common';
const emit = defineEmits<{
(e: 'search', where?: CustomerParam): void;
}>();
// 字典数据
const data = getDictionaryOptions('customerFollowStatus');
// 表单数据
const { where, resetFields } = useSearch<CustomerParam>({
progress: '',
customerType: '',
customerSource: '',
betweenTime: '',
userId: ''
});
/* 搜索 */
const search = (val) => {
where.progress = val == 'all' ? null : val;
emit('search', where);
};
/* 重置 */
const reset = () => {
resetFields();
search('all');
};
</script>
<style lang="less"></style>