提交 c7fe2466 authored 作者: 王鹏飞's avatar 王鹏飞

updates

上级 064ad13c
......@@ -190,23 +190,23 @@ export default {
let params = this.params
// 翻页参数设置
if (this.hasPagination) {
params.page = (this.page.currentPage - 1).toString()
params.page_size = this.page.size.toString()
params.page = this.page.currentPage
params.limit = this.page.size
}
// 接口请求之前
if (beforeRequest) {
params = beforeRequest(params, isReset)
}
// for (const key in params) {
// if (params[key] === '' || params[key] === undefined || params[key] === undefined) {
// delete params[key]
// }
// }
for (const key in params) {
if (params[key] === '' || params[key] === undefined || params[key] === undefined) {
delete params[key]
}
}
this.loading = true
httpRequest(params)
.then(res => {
const { data = [], page_info: pageInfo = {} } = res || {}
this.page.total = parseInt(pageInfo.total_number || '')
const { data = [], total = 0 } = res.data || {}
this.page.total = total
this.dataList = callback ? callback(data) : data
})
.catch(() => {
......
import httpRequest from '@/utils/axios'
/**
* 获取商品列表
* 获取案例列表
*/
export function getGoodsList(data) {
return httpRequest.post('/api/shop/commodity/spu/search', data).then({})
export function getCaseList(params) {
return httpRequest.get('/api/xtraining/admin/v1/cases', { params })
}
......@@ -15,7 +15,7 @@
<script>
// 接口
// import { getGoodsList } from '../api'
import { getCaseList } from '../api'
export default {
data() {
......@@ -25,30 +25,17 @@ export default {
// 列表配置
tableOptions() {
return {
// remote: {
// httpRequest: getGoodsList,
// params: { shop_id: this.shopId, spu_id: '', spu_name: '', group_id: '', price_min: '', price_max: '' },
// },
remote: {
httpRequest: getCaseList,
params: { name: '', tag: '' }
},
filters: [
{
type: 'input',
prop: 'spu_name',
placeholder: '商品名称'
},
{
type: 'select',
prop: 'group_id',
options: this.groupList,
labelKey: 'group_name',
valueKey: 'group_id',
placeholder: '商品分组'
},
{ prop: 'price_zone', slots: 'filter-price' }
{ type: 'input', prop: 'name', placeholder: '名称' },
{ type: 'input', prop: 'tag', placeholder: '唯一标识' }
],
columns: [
{ label: '日期', prop: 'date' },
{ label: '姓名', prop: 'name' },
{ label: '地址', prop: 'address' },
{ label: 'ID', prop: 'id' },
{ label: '名称', prop: 'name' },
{ label: '操作', slots: 'table-x', align: 'right', width: 220 }
],
data: [
......
import httpRequest from '@/utils/axios'
/**
* 获取商品列表
* 获取类型列表
*/
export function getGoodsList(data) {
return httpRequest.post('/api/shop/commodity/spu/search', data).then({})
export function getTypeList(params) {
return httpRequest.get('/api/xtraining/admin/v1/categories', { params })
}
......@@ -15,7 +15,7 @@
<script>
// 接口
// import { getGoodsList } from '../api'
import { getTypeList } from '../api'
export default {
data() {
......@@ -25,30 +25,17 @@ export default {
// 列表配置
tableOptions() {
return {
// remote: {
// httpRequest: getGoodsList,
// params: { shop_id: this.shopId, spu_id: '', spu_name: '', group_id: '', price_min: '', price_max: '' },
// },
remote: {
httpRequest: getTypeList,
params: { name: '', tag: '' }
},
filters: [
{
type: 'input',
prop: 'spu_name',
placeholder: '商品名称'
},
{
type: 'select',
prop: 'group_id',
options: this.groupList,
labelKey: 'group_name',
valueKey: 'group_id',
placeholder: '商品分组'
},
{ prop: 'price_zone', slots: 'filter-price' }
{ type: 'input', prop: 'name', placeholder: '名称' },
{ type: 'input', prop: 'tag', placeholder: '唯一标识' }
],
columns: [
{ label: '日期', prop: 'date' },
{ label: '姓名', prop: 'name' },
{ label: '地址', prop: 'address' },
{ label: 'ID', prop: 'id' },
{ label: '名称', prop: 'name' },
{ label: '操作', slots: 'table-x', align: 'right', width: 220 }
],
data: [
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论