优化crud驱动,list函数适配原版API

dev
smallchill 5 years ago
parent 0b9b7fe85b
commit 7155e99857
  1. 8
      src/api/system/param.js
  2. 5
      src/mixins/crud.js

@ -1,13 +1,5 @@
import request from '@/router/axios'; import request from '@/router/axios';
export const list = (data) => {
return request({
url: '/api/blade-system/param/list',
method: 'get',
params: data
})
}
export const getList = (current, size, params) => { export const getList = (current, size, params) => {
return request({ return request({
url: '/api/blade-system/param/list', url: '/api/blade-system/param/list',

@ -55,10 +55,7 @@ export default (app, option = {}) => {
getList() { getList() {
const callback = () => { const callback = () => {
this.loading = true; this.loading = true;
const pageParams = {}; this.api[option.list || 'getList'](this.page.currentPage, this.page.pageSize, this.params).then(res => {
pageParams[option.size || 'size'] = this.page.pageSize;
pageParams[option.current || 'current'] = this.page.currentPage;
this.api[option.list || 'list'](Object.assign(pageParams, this.params)).then(res => {
let data; let data;
if (option.res) { if (option.res) {
data = option.res(res.data); data = option.res(res.data);

Loading…
Cancel
Save