This commit is contained in:
parent
cc0167b120
commit
eb76595bb9
@ -2,8 +2,16 @@ import {mande} from "mande";
|
||||
|
||||
const product = mande('/api/v1/products')
|
||||
|
||||
const queryRemoveZero = (query)=>{
|
||||
let q = {}
|
||||
Object.keys(query).forEach(key => {
|
||||
query[key] === 'undefined' || query[key] === null || query[key] === '' || (q[key] = query[key])
|
||||
})
|
||||
return q
|
||||
}
|
||||
export const ListProducts = (query) => {
|
||||
return product.get({query:query})
|
||||
const q = queryRemoveZero(query)
|
||||
return product.get({query:q})
|
||||
}
|
||||
|
||||
export const UpdateProduct=(p)=>{
|
||||
|
@ -132,8 +132,11 @@ const query = reactive({
|
||||
size:6,
|
||||
rate_sort: null,
|
||||
disc_sort: null,
|
||||
orderable: null,
|
||||
keyword: '',
|
||||
})
|
||||
|
||||
|
||||
const loading = ref(false)
|
||||
|
||||
const data = ref({
|
||||
@ -212,6 +215,18 @@ const columns = computed(()=>[
|
||||
title: '可购买',
|
||||
dataIndex: 'orderable',
|
||||
key: 'orderable',
|
||||
filteredValue: query.orderable,
|
||||
filterMultiple:false,
|
||||
filters:[
|
||||
{
|
||||
text: '可购买',
|
||||
value: 'true',
|
||||
},
|
||||
{
|
||||
text: '不可购买',
|
||||
value: 'false',
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '抓取时间',
|
||||
@ -277,6 +292,9 @@ const tableChange = (pagination, filters, sorter, { action, currentDataSource })
|
||||
}else if (sorter.columnKey === 'discPercent'){
|
||||
query.disc_sort = sorter.order
|
||||
}
|
||||
|
||||
query.orderable = filters.orderable
|
||||
|
||||
list()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user