Explorar el Código

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

smallchill hace 5 años
padre
commit
7155e99857
Se han modificado 2 ficheros con 1 adiciones y 12 borrados
  1. 0 8
      src/api/system/param.js
  2. 1 4
      src/mixins/crud.js

+ 0 - 8
src/api/system/param.js

@@ -1,13 +1,5 @@
 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) => {
   return request({
     url: '/api/blade-system/param/list',

+ 1 - 4
src/mixins/crud.js

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