feat: add product price range filter
This commit is contained in:
@@ -1,7 +1,29 @@
|
||||
<template>
|
||||
<div>
|
||||
<n-card :bordered="false" class="proCard">
|
||||
<BasicForm ref="searchRef" @register="register" @submit="reload" @keyup.enter="reload" />
|
||||
<BasicForm ref="searchRef" @register="register" @submit="reload" @keyup.enter="reload">
|
||||
<template #priceRangeSlot="{ model }">
|
||||
<n-space :wrap="false" align="center">
|
||||
<n-input-number
|
||||
v-model:value="model.priceMin"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
:show-button="false"
|
||||
clearable
|
||||
placeholder="最低价"
|
||||
/>
|
||||
<span>-</span>
|
||||
<n-input-number
|
||||
v-model:value="model.priceMax"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
:show-button="false"
|
||||
clearable
|
||||
placeholder="最高价"
|
||||
/>
|
||||
</n-space>
|
||||
</template>
|
||||
</BasicForm>
|
||||
<BasicTable
|
||||
ref="tableRef"
|
||||
openChecked
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { computed, h, ref } from 'vue';
|
||||
import { h, ref } from 'vue';
|
||||
import { NImage, NTag } from 'naive-ui';
|
||||
import { FormSchema } from '@/components/Form';
|
||||
import { useDictStore } from '@/store/modules/dict';
|
||||
@@ -13,14 +13,9 @@ export const schemas = ref<FormSchema[]>([
|
||||
componentProps: { clearable: true },
|
||||
},
|
||||
{
|
||||
field: 'categoryId',
|
||||
component: 'NSelect',
|
||||
label: '商品分类',
|
||||
componentProps: {
|
||||
options: computed(() => dict.getOptionUnRef('productCategoryOption')),
|
||||
clearable: true,
|
||||
placeholder: '请选择',
|
||||
},
|
||||
field: 'priceRange',
|
||||
label: '价格范围',
|
||||
slot: 'priceRangeSlot',
|
||||
},
|
||||
]);
|
||||
|
||||
@@ -62,4 +57,4 @@ export const columns = [
|
||||
},
|
||||
];
|
||||
|
||||
export const loadOptions = () => dict.loadOptions(['productCategoryOption', 'bizPublishStatus']);
|
||||
export const loadOptions = () => dict.loadOptions(['bizPublishStatus']);
|
||||
|
||||
Reference in New Issue
Block a user