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

updates

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