Browse Source

fix: #793 数据翻页没有传递pageSize 参数绑定有问题

冷冷 5 năm trước cách đây
mục cha
commit
ea6312b0fc

+ 1 - 0
src/const/crud/admin/dict.js

@@ -28,6 +28,7 @@ export const tableOption = {
     label: '类型',
     prop: 'type',
     'search': true,
+    editDisabled: true,
     rules: [{
       required: true,
       message: '请输入字典类型',

+ 108 - 106
src/views/activiti/index.vue

@@ -27,6 +27,8 @@
         @on-load="getList"
         @search-change="searchChange"
         @refresh-change="refreshChange"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @row-save="handleSave"
         @row-del="rowDel">
         <template
@@ -55,125 +57,125 @@
 </template>
 
 <script>
-import { addObj, delObj, deploy, fetchList } from '@/api/activiti/activiti'
-import { tableOption } from '@/const/crud/activiti/activiti'
-import { mapGetters } from 'vuex'
+  import {addObj, delObj, deploy, fetchList} from '@/api/activiti/activiti'
+  import {tableOption} from '@/const/crud/activiti/activiti'
+  import {mapGetters} from 'vuex'
 
-export default {
-  name: 'Activiti',
-  data() {
-    return {
-      searchForm: {},
-      tableData: [],
-      page: {
-        total: 0, // 总页数
-        currentPage: 1, // 当前页数
-        pageSize: 20 // 每页显示多少条
-      },
-      tableLoading: false,
-      tableOption: tableOption
-    }
-  },
-  created() {
-  },
-  mounted: function() {
-  },
-  computed: {
-    ...mapGetters(['permissions'])
-  },
-  methods: {
-    getList(page, params) {
-      this.tableLoading = true
-      fetchList(Object.assign({
-        descs: 'create_time',
-        current: page.currentPage,
-        size: page.pageSize
-      }, params, this.searchForm)).then(response => {
-        this.tableData = response.data.data.records
-        this.page.total = response.data.data.total
-        this.tableLoading = false
-      })
+  export default {
+    name: 'Activiti',
+    data() {
+      return {
+        searchForm: {},
+        tableData: [],
+        page: {
+          total: 0, // 总页数
+          currentPage: 1, // 当前页数
+          pageSize: 20 // 每页显示多少条
+        },
+        tableLoading: false,
+        tableOption: tableOption
+      }
     },
-    handleView(row) {
-      const name = `模型id为${row.id}的${row.name}流程图`,
-        src = `/activti/detail/${row.id}`
-      this.$router.push({
-        path: src,
-        query: {
-          name: name
-        }
-      })
+    created() {
     },
-    handleDel(row, index) {
-      this.$refs.crud.rowDel(row, index)
+    mounted: function () {
     },
-    handleDeploy: function(row) {
-      var _this = this
-      this.$confirm('是否确认部署ID为"' + row.id + '"的模型?', '警告', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(function() {
-        return deploy(row.id)
-      }).then(() => {
-        this.getList(this.page)
-        _this.$message({
-          showClose: true,
-          message: '部署成功',
-          type: 'success'
-        })
-      }).catch(function() {
-      })
+    computed: {
+      ...mapGetters(['permissions'])
     },
-    rowDel: function(row) {
-      var _this = this
-      this.$confirm('是否确认删除ID为"' + row.id + '"的模型?', '警告', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(function() {
-        return delObj(row.id)
-      }).then(() => {
-        this.getList(this.page)
-        _this.$message({
-          showClose: true,
-          message: '删除成功',
-          type: 'success'
+    methods: {
+      getList(page, params) {
+        this.tableLoading = true
+        fetchList(Object.assign({
+          descs: 'create_time',
+          current: page.currentPage,
+          size: page.pageSize
+        }, params, this.searchForm)).then(response => {
+          this.tableData = response.data.data.records
+          this.page.total = response.data.data.total
+          this.tableLoading = false
         })
-      }).catch(function() {
-      })
-    },
-    /**
+      },
+      handleView(row) {
+        const name = `模型id为${row.id}的${row.name}流程图`,
+          src = `/activti/detail/${row.id}`
+        this.$router.push({
+          path: src,
+          query: {
+            name: name
+          }
+        })
+      },
+      handleDel(row, index) {
+        this.$refs.crud.rowDel(row, index)
+      },
+      handleDeploy: function (row) {
+        var _this = this
+        this.$confirm('是否确认部署ID为"' + row.id + '"的模型?', '警告', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(function () {
+          return deploy(row.id)
+        }).then(() => {
+          this.getList(this.page)
+          _this.$message({
+            showClose: true,
+            message: '部署成功',
+            type: 'success'
+          })
+        }).catch(function () {
+        })
+      },
+      rowDel: function (row) {
+        var _this = this
+        this.$confirm('是否确认删除ID为"' + row.id + '"的模型?', '警告', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(function () {
+          return delObj(row.id)
+        }).then(() => {
+          this.getList(this.page)
+          _this.$message({
+            showClose: true,
+            message: '删除成功',
+            type: 'success'
+          })
+        }).catch(function () {
+        })
+      },
+      /**
        * @title 数据添加
        * @param row 为当前的数据
        * @param done 为表单关闭函数
        *
        **/
-    handleSave: function(row, done) {
-      addObj(row).then(() => {
-        this.tableData.push(Object.assign({}, row))
-        this.$message({
-          showClose: true,
-          message: '添加成功',
-          type: 'success'
+      handleSave: function (row, done) {
+        addObj(row).then(() => {
+          this.tableData.push(Object.assign({}, row))
+          this.$message({
+            showClose: true,
+            message: '添加成功',
+            type: 'success'
+          })
+          done()
+          this.getList(this.page)
         })
-        done()
+      },
+      searchChange(form) {
+        this.searchForm = form
+        this.getList(this.page, form)
+      },
+      sizeChange(pageSize) {
+        this.page.pageSize = pageSize
+      },
+      currentChange(current) {
+        this.page.currentPage = current
+      },
+      refreshChange() {
         this.getList(this.page)
-      })
-    },
-    /**
-       * 搜索回调
-       */
-    searchChange(form) {
-      this.searchForm = form
-      this.getList(this.page, form)
-    },
-    /**
-       * 刷新回调
-       */
-    refreshChange() {
-      this.getList(this.page)
+      }
     }
   }
-}
 </script>

+ 12 - 53
src/views/activiti/leave.vue

@@ -27,6 +27,8 @@
         @on-load="getList"
         @search-change="searchChange"
         @refresh-change="refreshChange"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @row-update="handleUpdate"
         @row-save="handleSave"
         @row-del="rowDel">
@@ -106,11 +108,6 @@ export default {
         this.tableLoading = false
       })
     },
-    /**
-       * @title 打开新增窗口
-       * @detail 调用crud的handleadd方法即可
-       *
-       **/
     handleAdd: function() {
       this.$refs.crud.rowAdd()
     },
@@ -121,7 +118,6 @@ export default {
       this.$refs.crud.rowDel(row, index)
     },
     rowDel: function(row, index) {
-      var _this = this
       this.$confirm('是否确认删除ID为' + row.leaveId, '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
@@ -129,16 +125,10 @@ export default {
       }).then(function() {
         return delObj(row.leaveId)
       }).then(() => {
-        _this.tableData.splice(index, 1)
-        _this.$message({
-          showClose: true,
-          message: '删除成功',
-          type: 'success'
-        })
+        this.$message.success('删除成功')
       })
     },
     handleSubmit: function(row, index) {
-      var _this = this
       this.$confirm('是否确认提交ID为' + row.leaveId, '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
@@ -146,62 +136,34 @@ export default {
       }).then(function() {
         return submit(row.leaveId)
       }).then(() => {
-        _this.tableData.splice(index, 1)
-        _this.$message({
-          showClose: true,
-          message: '提交成功',
-          type: 'success'
-        })
+        this.$message.success('提交成功')
         this.getList(this.page)
       })
     },
-    /**
-       * @title 数据更新
-       * @param row 为当前的数据
-       * @param index 为当前更新数据的行数
-       * @param done 为表单关闭函数
-       *
-       **/
     handleUpdate: function(row, index, done) {
       putObj(row).then(() => {
-        this.tableData.splice(index, 1, Object.assign({}, row))
-        this.$message({
-          showClose: true,
-          message: '修改成功',
-          type: 'success'
-        })
+        this.$message.success('修改成功')
         done()
         this.getList(this.page)
       })
     },
-    /**
-       * @title 数据添加
-       * @param row 为当前的数据
-       * @param done 为表单关闭函数
-       *
-       **/
     handleSave: function(row, done) {
       addObj(row).then(() => {
-        this.tableData.push(Object.assign({}, row))
-        this.$message({
-          showClose: true,
-          message: '添加成功',
-          type: 'success'
-        })
+        this.$message.success('添加成功')
         done()
         this.getList(this.page)
       })
     },
-    /**
-       * 搜索回调
-       */
     searchChange(form) {
       this.searchForm = form
       this.getList(this.page, form)
     },
-    /**
-       * 刷新回调
-       */
+    sizeChange(pageSize){
+      this.page.pageSize = pageSize
+    },
+    currentChange(current){
+      this.page.currentPage = current
+    },
     refreshChange() {
       this.getList(this.page)
     }
@@ -209,6 +171,3 @@ export default {
 }
 </script>
 
-<style lang="scss" scoped>
-</style>
-

+ 106 - 108
src/views/activiti/process.vue

@@ -27,14 +27,12 @@
         @on-load="getList"
         @search-change="searchChange"
         @refresh-change="refreshChange"
-        @row-del="rowDel"
-      >
+        @row-del="rowDel">
         <template slot-scope="scope" slot="menuBtn">
           <el-dropdown-item
             v-if="permissions.act_process_manage"
             divided
-            @click.native="handlePic(scope.row,scope.index)"
-          >流程图
+            @click.native="handlePic(scope.row,scope.index)">流程图
           </el-dropdown-item>
           <el-dropdown-item
             v-if="permissions.act_process_manage && scope.row.suspend"
@@ -66,125 +64,125 @@
 </template>
 
 <script>
-import { delObj, fetchList, status } from '@/api/activiti/process'
-import { tableOption } from '@/const/crud/activiti/process'
-import { mapGetters } from 'vuex'
+  import {delObj, fetchList, status} from '@/api/activiti/process'
+  import {tableOption} from '@/const/crud/activiti/process'
+  import {mapGetters} from 'vuex'
 
-export default {
-  name: 'Process',
-  data() {
-    return {
-      searchForm: {},
-      showPicDialog: false,
-      actPicUrl: '',
-      tableData: [],
-      page: {
-        total: 0, // 总页数
-        currentPage: 1, // 当前页数
-        pageSize: 20 // 每页显示多少条
-      },
-      tableLoading: false,
-      tableOption: tableOption
-    }
-  },
-  created() {
-  },
-  mounted: function() {
-  },
-  computed: {
-    ...mapGetters(['permissions'])
-  },
-  methods: {
-    getList(page, params) {
-      this.tableLoading = true
-      fetchList(
-        Object.assign(
-          {
-            descs: 'create_time',
-            current: page.currentPage,
-            size: page.pageSize
-          },
-          params,
-          this.searchForm
-        )
-      ).then(response => {
-        this.tableData = response.data.data.records
-        this.page.total = response.data.data.total
-        this.tableLoading = false
-      })
+  export default {
+    name: 'Process',
+    data() {
+      return {
+        searchForm: {},
+        showPicDialog: false,
+        actPicUrl: '',
+        tableData: [],
+        page: {
+          total: 0, // 总页数
+          currentPage: 1, // 当前页数
+          pageSize: 20 // 每页显示多少条
+        },
+        tableLoading: false,
+        tableOption: tableOption
+      }
+    },
+    created() {
     },
-    handlePic(row) {
-      this.actPicUrl =
+    mounted: function () {
+    },
+    computed: {
+      ...mapGetters(['permissions'])
+    },
+    methods: {
+      getList(page, params) {
+        this.tableLoading = true
+        fetchList(
+          Object.assign(
+            {
+              descs: 'create_time',
+              current: page.currentPage,
+              size: page.pageSize
+            },
+            params,
+            this.searchForm
+          )
+        ).then(response => {
+          this.tableData = response.data.data.records
+          this.page.total = response.data.data.total
+          this.tableLoading = false
+        })
+      },
+      handlePic(row) {
+        this.actPicUrl =
           `/act/process/resource/` +
           row.deploymentId +
           '/' +
           row.processonDefinitionId +
           '/image'
-      this.showPicDialog = true
-    },
-    handleStatus(row, type) {
-      var _this = this
-      this.$confirm(
-        '是否确认操作ID为"' + row.processonDefinitionId + '"的流程?',
-        '警告',
-        {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }
-      ).then(function() {
-        return status(row.processonDefinitionId, type)
-      }).then(() => {
-        this.getList(this.page)
-        _this.$message({
-          showClose: true,
-          message: '操作成功',
-          type: 'success'
+        this.showPicDialog = true
+      },
+      handleStatus(row, type) {
+        var _this = this
+        this.$confirm(
+          '是否确认操作ID为"' + row.processonDefinitionId + '"的流程?',
+          '警告',
+          {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }
+        ).then(function () {
+          return status(row.processonDefinitionId, type)
+        }).then(() => {
+          this.getList(this.page)
+          _this.$message({
+            showClose: true,
+            message: '操作成功',
+            type: 'success'
+          })
+          this.getList(this.page)
         })
-        this.getList(this.page)
-      })
-    },
-    handleDel(row, index) {
-      this.$refs.crud.rowDel(row, index)
-    },
-    rowDel: function(row) {
-      var _this = this
-      this.$confirm(
-        '是否确认删除ID为"' + row.deploymentId + '"的模型?',
-        '警告',
-        {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }
-      ).then(function() {
-        return delObj(row.deploymentId)
-      }).then(() => {
-        this.getList(this.page)
-        _this.$message({
-          showClose: true,
-          message: '删除成功',
-          type: 'success'
+      },
+      handleDel(row, index) {
+        this.$refs.crud.rowDel(row, index)
+      },
+      rowDel: function (row) {
+        var _this = this
+        this.$confirm(
+          '是否确认删除ID为"' + row.deploymentId + '"的模型?',
+          '警告',
+          {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }
+        ).then(function () {
+          return delObj(row.deploymentId)
+        }).then(() => {
+          this.getList(this.page)
+          _this.$message({
+            showClose: true,
+            message: '删除成功',
+            type: 'success'
+          })
+          this.getList(this.page)
+        }).catch(function () {
         })
-        this.getList(this.page)
-      }).catch(function() {
-      })
-    },
-    /**
+      },
+      /**
        * 搜索回调
        */
-    searchChange(form) {
-      this.searchForm = form
-      this.getList(this.page, form)
-    },
-    /**
+      searchChange(form) {
+        this.searchForm = form
+        this.getList(this.page, form)
+      },
+      /**
        * 刷新回调
        */
-    refreshChange() {
-      this.getList(this.page)
+      refreshChange() {
+        this.getList(this.page)
+      }
     }
   }
-}
 </script>
 
 <style lang="scss" scoped>

+ 82 - 77
src/views/activiti/task.vue

@@ -25,6 +25,8 @@
         :table-loading="tableLoading"
         :option="tableOption"
         @on-load="getList"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @refresh-change="refreshChange">
         <template
           slot-scope="scope"
@@ -76,91 +78,94 @@
 </template>
 
 <script>
-import { doTask, fetchComment, fetchDetail, fetchList } from '@/api/activiti/task'
-import { formOption, tableOption, taskOption } from '@/const/crud/activiti/task'
-import { mapGetters } from 'vuex'
+  import {doTask, fetchComment, fetchDetail, fetchList} from '@/api/activiti/task'
+  import {formOption, tableOption, taskOption} from '@/const/crud/activiti/task'
+  import {mapGetters} from 'vuex'
 
-export default {
-  name: 'Task',
-  data() {
-    return {
-      actPicUrl: '',
-      obj: {},
-      flagList: {},
-      showTask: false,
-      showComment: false,
-      showPicDialog: false,
-      tableData: [],
-      taskTableData: [],
-      page: {
-        total: 0, // 总页数
-        currentPage: 1, // 当前页数
-        pageSize: 20 // 每页显示多少条
-      },
-      tableLoading: false,
-      tableOption: tableOption,
-      formOption: formOption,
-      taskOption: taskOption
-    }
-  },
-  created() {
-  },
-  mounted: function() {
-  },
-  computed: {
-    ...mapGetters(['permissions'])
-  },
-  methods: {
-    getList(page, params) {
-      this.tableLoading = true
-      fetchList(Object.assign({
-        current: page.currentPage,
-        size: page.pageSize
-      }, params)).then(response => {
-        this.tableData = response.data.data.records
-        this.page.total = response.data.data.total
-        this.tableLoading = false
-      })
+  export default {
+    name: 'Task',
+    data() {
+      return {
+        actPicUrl: '',
+        obj: {},
+        flagList: {},
+        showTask: false,
+        showComment: false,
+        showPicDialog: false,
+        tableData: [],
+        taskTableData: [],
+        page: {
+          total: 0, // 总页数
+          currentPage: 1, // 当前页数
+          pageSize: 20 // 每页显示多少条
+        },
+        tableLoading: false,
+        tableOption: tableOption,
+        formOption: formOption,
+        taskOption: taskOption
+      }
     },
-    audit: function(row) {
-      fetchDetail(row.taskId).then(response => {
-        this.obj = response.data.data
-        // 根据连线判断下次的流程
-        this.flagList = this.obj.flagList
-        this.showTask = true
-      })
-      this.obj = row
+    created() {
     },
-    comment: function(row) {
-      fetchComment(row.taskId).then(response => {
-        this.taskTableData = response.data.data
-      })
-      this.showComment = true
+    mounted: function () {
     },
-    handleTask: function(row, result) {
-      this.obj.taskFlag = result
-      doTask(this.obj).then(() => {
-        this.$message({
-          showClose: true,
-          message: '提交成功',
-          type: 'success'
+    computed: {
+      ...mapGetters(['permissions'])
+    },
+    methods: {
+      getList(page, params) {
+        this.tableLoading = true
+        fetchList(Object.assign({
+          current: page.currentPage,
+          size: page.pageSize
+        }, params)).then(response => {
+          this.tableData = response.data.data.records
+          this.page.total = response.data.data.total
+          this.tableLoading = false
+        })
+      },
+      audit: function (row) {
+        fetchDetail(row.taskId).then(response => {
+          this.obj = response.data.data
+          // 根据连线判断下次的流程
+          this.flagList = this.obj.flagList
+          this.showTask = true
+        })
+        this.obj = row
+      },
+      comment: function (row) {
+        fetchComment(row.taskId).then(response => {
+          this.taskTableData = response.data.data
         })
-        this.showTask = false
+        this.showComment = true
+      },
+      handleTask: function (row, result) {
+        this.obj.taskFlag = result
+        doTask(this.obj).then(() => {
+          this.$message({
+            showClose: true,
+            message: '提交成功',
+            type: 'success'
+          })
+          this.showTask = false
+          this.getList(this.page)
+        })
+      },
+      viewPic: function (row) {
+        this.actPicUrl = `/act/task/view/` + row.taskId
+        this.showPicDialog = true
+      },
+      sizeChange(pageSize) {
+        this.page.pageSize = pageSize
+      },
+      currentChange(current) {
+        this.page.currentPage = current
+      },
+      refreshChange() {
         this.getList(this.page)
-      })
-    },
-    viewPic: function(row) {
-      this.actPicUrl = `/act/task/view/` + row.taskId
-      this.showPicDialog = true
-    },
-    /**
-       * 刷新回调
-       */
-    refreshChange() {
-      this.getList(this.page)
+      }
     }
   }
-}
 </script>
 
 <style lang="scss" scoped>

+ 92 - 89
src/views/admin/client/index.vue

@@ -27,6 +27,8 @@
         :permission="permissionList"
         @on-load="getList"
         @refresh-change="refreshChange"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @row-update="handleUpdate"
         @row-save="handleSave"
         @row-del="handleDelete"/>
@@ -35,98 +37,99 @@
 </template>
 
 <script>
-    import {addObj, delObj, fetchList, putObj} from '@/api/admin/client'
-    import {tableOption} from '@/const/crud/admin/client'
-    import {mapGetters} from 'vuex'
+  import {addObj, delObj, fetchList, putObj} from '@/api/admin/client'
+  import {tableOption} from '@/const/crud/admin/client'
+  import {mapGetters} from 'vuex'
 
-    export default {
-        name: 'Client',
-        data() {
-            return {
-                tableData: [],
-                page: {
-                    total: 0, // 总页数
-                    currentPage: 1, // 当前页数
-                    pageSize: 20 // 每页显示多少条
-                },
-                tableLoading: false,
-                tableOption: tableOption
-            }
+  export default {
+    name: 'Client',
+    data() {
+      return {
+        tableData: [],
+        page: {
+          total: 0, // 总页数
+          currentPage: 1, // 当前页数
+          pageSize: 20 // 每页显示多少条
         },
-        created() {
-        },
-        mounted: function () {
-        },
-        computed: {
-            ...mapGetters(['permissions']),
-            permissionList() {
-                return {
-                    addBtn: this.vaildData(this.permissions.sys_client_add, false),
-                    delBtn: this.vaildData(this.permissions.sys_client_del, false),
-                    editBtn: this.vaildData(this.permissions.sys_client_edit, false)
-                }
-            }
-        },
-        methods: {
-            getList(page, params) {
-                this.tableLoading = true
-                fetchList(Object.assign({
-                    current: page.currentPage,
-                    size: page.pageSize
-                }, params)).then(response => {
-                    this.tableData = response.data.data.records
-                    this.page.total = response.data.data.total
-                    this.tableLoading = false
-                })
-            },
-            handleDelete: function (row, index) {
-                var _this = this
-                this.$confirm('是否确认删除ID为' + row.clientId, '提示', {
-                    confirmButtonText: '确定',
-                    cancelButtonText: '取消',
-                    type: 'warning'
-                }).then(function () {
-                    return delObj(row.clientId)
-                }).then(() => {
-                    _this.$message.success('删除成功')
-                    this.refreshChange()
-                }).catch(function () {
-                })
-            },
-            handleUpdate: function (row, index, done) {
-                if (row.accessTokenValidity === undefined) {
-                    row.accessTokenValidity = 60 * 60 * 12
-                }
-                if (row.refreshTokenValidity === undefined) {
-                    row.refreshTokenValidity = 60 * 60 * 24 * 30
-                }
+        tableLoading: false,
+        tableOption: tableOption
+      }
+    },
+    created() {
+    },
+    mounted: function () {
+    },
+    computed: {
+      ...mapGetters(['permissions']),
+      permissionList() {
+        return {
+          addBtn: this.vaildData(this.permissions.sys_client_add, false),
+          delBtn: this.vaildData(this.permissions.sys_client_del, false),
+          editBtn: this.vaildData(this.permissions.sys_client_edit, false)
+        }
+      }
+    },
+    methods: {
+      getList(page, params) {
+        this.tableLoading = true
+        fetchList(Object.assign({
+          current: page.currentPage,
+          size: page.pageSize
+        }, params)).then(response => {
+          this.tableData = response.data.data.records
+          this.page.total = response.data.data.total
+          this.tableLoading = false
+        })
+      },
+      handleDelete: function (row, index) {
+        var _this = this
+        this.$confirm('是否确认删除ID为' + row.clientId, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(function () {
+          return delObj(row.clientId)
+        }).then(() => {
+          _this.$message.success('删除成功')
+          this.refreshChange()
+        })
+      },
+      handleUpdate: function (row, index, done) {
+        if (row.accessTokenValidity === undefined) {
+          row.accessTokenValidity = 60 * 60 * 12
+        }
+        if (row.refreshTokenValidity === undefined) {
+          row.refreshTokenValidity = 60 * 60 * 24 * 30
+        }
 
-                putObj(row).then(() => {
-                    this.$message.success('修改成功');
-                    this.refreshChange()
-                    done()
-                })
-            },
-            handleSave: function (row, done) {
-                if (row.accessTokenValidity === undefined) {
-                    row.accessTokenValidity = 60 * 60 * 12
-                }
-                if (row.refreshTokenValidity === undefined) {
-                    row.refreshTokenValidity = 60 * 60 * 24 * 30
-                }
-                addObj(row).then(() => {
-                    this.$message.success('添加成功');
-                    this.refreshChange()
-                    done()
-                })
-            },
-            refreshChange() {
-                this.getList(this.page)
-            }
+        putObj(row).then(() => {
+          this.$message.success('修改成功');
+          this.refreshChange()
+          done()
+        })
+      },
+      handleSave: function (row, done) {
+        if (row.accessTokenValidity === undefined) {
+          row.accessTokenValidity = 60 * 60 * 12
+        }
+        if (row.refreshTokenValidity === undefined) {
+          row.refreshTokenValidity = 60 * 60 * 24 * 30
         }
+        addObj(row).then(() => {
+          this.$message.success('添加成功');
+          this.refreshChange()
+          done()
+        })
+      },
+      sizeChange(pageSize) {
+        this.page.pageSize = pageSize
+      },
+      currentChange(current) {
+        this.page.currentPage = current
+      },
+      refreshChange() {
+        this.getList(this.page)
+      }
     }
+  }
 </script>
-
-<style lang="scss" scoped>
-</style>
-

+ 131 - 147
src/views/admin/dict/index.vue

@@ -29,6 +29,8 @@
         @row-update="handleUpdate"
         @row-save="handleSave"
         @search-change="searchChange"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @row-del="rowDel">
         <template
           slot-scope="scope"
@@ -65,168 +67,150 @@
 </template>
 
 <script>
-import { addItemObj, addObj, delItemObj, delObj, fetchItemList, fetchList, putItemObj, putObj } from '@/api/admin/dict'
-import { tableDictItemOption, tableOption } from '@/const/crud/admin/dict'
-import { mapGetters } from 'vuex'
+  import {addItemObj, addObj, delItemObj, delObj, fetchItemList, fetchList, putItemObj, putObj} from '@/api/admin/dict'
+  import {tableDictItemOption, tableOption} from '@/const/crud/admin/dict'
+  import {mapGetters} from 'vuex'
 
-export default {
-  name: 'Dict',
-  data() {
-    return {
-      searchForm: {},
-      form: {
-        type: undefined,
-        dictId: undefined
-      },
-      dictType: undefined,
-      dictId: undefined,
-      dialogFormVisible: false,
-      tableData: [],
-      tableDictItemData: [],
-      page: {
-        total: 0, // 总页数
-        currentPage: 1, // 当前页数
-        pageSize: 20 // 每页显示多少条
-      },
-      tableLoading: false,
-      tableOption: tableOption,
-      tableDictItemOption: tableDictItemOption
-    }
-  },
-  created() {
-  },
-  mounted: function() {
-  },
-  computed: {
-    ...mapGetters(['permissions']),
-    permissionList() {
+  export default {
+    name: 'Dict',
+    data() {
       return {
-        addBtn: this.vaildData(this.permissions.sys_dict_add, false),
-        delBtn: this.vaildData(this.permissions.sys_dict_del, false),
-        editBtn: this.vaildData(this.permissions.sys_dict_edit, false)
+        searchForm: {},
+        form: {
+          type: undefined,
+          dictId: undefined
+        },
+        dictType: undefined,
+        dictId: undefined,
+        dialogFormVisible: false,
+        tableData: [],
+        tableDictItemData: [],
+        page: {
+          total: 0, // 总页数
+          currentPage: 1, // 当前页数
+          pageSize: 20 // 每页显示多少条
+        },
+        tableLoading: false,
+        tableOption: tableOption,
+        tableDictItemOption: tableDictItemOption
       }
-    }
-  },
-  methods: {
-    getList(page, params) {
-      this.tableLoading = true
-      fetchList(Object.assign({
-        current: page.currentPage,
-        size: page.pageSize
-      }, params, this.searchForm)).then(response => {
-        this.tableData = response.data.data.records
-        this.page.total = response.data.data.total
-        this.tableLoading = false
-      })
     },
-
-    getDictItemList(dictId, type) {
-      this.dictType = type
-      this.dictId = dictId
-      this.dialogFormVisible = true
-      this.tableLoading = true
-      fetchItemList(Object.assign({
-        current: this.page.currentPage,
-        size: this.page.pageSize
-      }, { dictId: dictId })).then(response => {
-        this.tableDictItemData = response.data.data.records
-        this.tableLoading = false
-      })
+    created() {
     },
-    handleBeforeOpen(done) {
-      this.form.type = this.dictType
-      this.form.dictId = this.dictId
-      done()
+    mounted: function () {
     },
-    rowDel: function(row) {
-      var _this = this
-      this.$confirm('是否确认删除数据类型为"' + row.type + '"的数据项?', '警告', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(function() {
-        return delObj(row)
-      }).then(() => {
-        this.getList(this.page)
-        _this.$message({
-          showClose: true,
-          message: '删除成功',
-          type: 'success'
-        })
-      }).catch(function() {
-      })
+    computed: {
+      ...mapGetters(['permissions']),
+      permissionList() {
+        return {
+          addBtn: this.vaildData(this.permissions.sys_dict_add, false),
+          delBtn: this.vaildData(this.permissions.sys_dict_del, false),
+          editBtn: this.vaildData(this.permissions.sys_dict_edit, false)
+        }
+      }
     },
-    handleUpdate: function(row, index, done) {
-      putObj(row).then(() => {
-        this.$message({
-          showClose: true,
-          message: '修改成功',
-          type: 'success'
+    methods: {
+      getList(page, params) {
+        this.tableLoading = true
+        fetchList(Object.assign({
+          current: page.currentPage,
+          size: page.pageSize
+        }, params, this.searchForm)).then(response => {
+          this.tableData = response.data.data.records
+          this.page.total = response.data.data.total
+          this.tableLoading = false
         })
-        this.getList(this.page)
-        done()
-      })
-    },
-    handleSave: function(row, done) {
-      addObj(row).then(() => {
-        this.$message({
-          showClose: true,
-          message: '添加成功',
-          type: 'success'
+      },
+
+      getDictItemList(dictId, type) {
+        this.dictType = type
+        this.dictId = dictId
+        this.dialogFormVisible = true
+        this.tableLoading = true
+        fetchItemList(Object.assign({
+          current: this.page.currentPage,
+          size: this.page.pageSize
+        }, {dictId: dictId})).then(response => {
+          this.tableDictItemData = response.data.data.records
+          this.tableLoading = false
         })
-        this.getList(this.page)
+      },
+      handleBeforeOpen(done) {
+        this.form.type = this.dictType
+        this.form.dictId = this.dictId
         done()
-      })
-    },
-    handleItemSave: function(row, done) {
-      addItemObj(row).then(() => {
-        this.$message({
-          showClose: true,
-          message: '添加成功',
-          type: 'success'
+      },
+      rowDel: function (row) {
+        var _this = this
+        this.$confirm('是否确认删除数据类型为"' + row.type + '"的数据项?', '警告', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(function () {
+          return delObj(row)
+        }).then(() => {
+          this.getList(this.page)
+          _this.$message.success('删除成功')
+        }).catch(function () {
         })
-        this.getDictItemList(row.dictId, row.type)
-        done()
-      })
-    },
-    handleItemUpdate: function(row, index, done) {
-      putItemObj(row).then(() => {
-        this.$message({
-          showClose: true,
-          message: '修改成功',
-          type: 'success'
+      },
+      handleUpdate: function (row, index, done) {
+        putObj(row).then(() => {
+          this.$message.success('修改成功')
+          this.getList(this.page)
+          done()
         })
-        this.getDictItemList(row.dictId, row.type)
-        done()
-      })
-    },
-    searchChange(form) {
-      this.searchForm = form
-      this.getList(this.page, form)
-    },
-    handleItem: function(row) {
-      this.getDictItemList(row.id, row.type)
-    },
-    rowItemDel: function(row) {
-      var _this = this
-      this.$confirm('是否确认删除数据为"' + row.label + '"的数据项?', '警告', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(function() {
-        return delItemObj(row.id)
-      }).then(() => {
-        this.getDictItemList(row.dictId, row.type)
-        _this.$message({
-          showClose: true,
-          message: '删除成功',
-          type: 'success'
+      },
+      handleSave: function (row, done) {
+        addObj(row).then(() => {
+          this.$message.success('添加成功')
+          this.getList(this.page)
+          done()
+        })
+      },
+      handleItemSave: function (row, done) {
+        addItemObj(row).then(() => {
+          this.$message.success('添加成功')
+          this.getDictItemList(row.dictId, row.type)
+          done()
+        })
+      },
+      handleItemUpdate: function (row, index, done) {
+        putItemObj(row).then(() => {
+          this.$message.success('修改成功')
+          this.getDictItemList(row.dictId, row.type)
+          done()
+        })
+      },
+      searchChange(form) {
+        this.searchForm = form
+        this.getList(this.page, form)
+      },
+      sizeChange(pageSize) {
+        this.page.pageSize = pageSize
+      },
+      currentChange(current) {
+        this.page.currentPage = current
+      },
+      handleItem: function (row) {
+        this.getDictItemList(row.id, row.type)
+      },
+      rowItemDel: function (row) {
+        var _this = this
+        this.$confirm('是否确认删除数据为"' + row.label + '"的数据项?', '警告', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(function () {
+          return delItemObj(row.id)
+        }).then(() => {
+          this.getDictItemList(row.dictId, row.type)
+          _this.$message.success('删除成功')
+        }).catch(function () {
         })
-      }).catch(function() {
-      })
+      }
     }
   }
-}
 </script>
 
 <style lang="scss" scoped>

+ 8 - 3
src/views/admin/file/index.vue

@@ -28,6 +28,8 @@
         @on-load="getList"
         @search-change="searchChange"
         @refresh-change="refreshChange"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @row-del="rowDel">
         <template
           slot="menu"
@@ -116,6 +118,12 @@ export default {
       this.searchForm = this.form
       this.getList(this.page)
     },
+    sizeChange(pageSize){
+      this.page.pageSize = pageSize
+    },
+    currentChange(current){
+      this.page.currentPage = current
+    },
     download: function(row, index) {
       handleDown(row.fileName, row.bucketName)
     },
@@ -128,6 +136,3 @@ export default {
 }
 </script>
 
-<style lang="scss" scoped>
-</style>
-

+ 9 - 11
src/views/admin/log/index.vue

@@ -28,6 +28,8 @@
         @on-load="getList"
         @search-change="searchChange"
         @refresh-change="refreshChange"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @row-del="handleDel"/>
     </basic-container>
   </div>
@@ -79,7 +81,6 @@ export default {
       })
     },
     handleDel: function(row) {
-      var _this = this
       this.$confirm('是否确认删除ID为"' + row.id + '"的日志?', '警告', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
@@ -88,25 +89,22 @@ export default {
         return delObj(row.id)
       }).then(() => {
         this.getList(this.page)
-        _this.$message({
-          showClose: true,
-          message: '删除成功',
-          type: 'success'
-        })
-      }).catch(function() {
+        this.$message.success('删除成功')
       })
     },
     searchChange(form) {
       this.searchForm = form
       this.getList(this.page, form)
     },
+    sizeChange(pageSize){
+      this.page.pageSize = pageSize
+    },
+    currentChange(current){
+      this.page.currentPage = current
+    },
     refreshChange() {
       this.getList(this.page)
     }
   }
 }
 </script>
-
-<style lang="scss" scoped>
-</style>
-

+ 86 - 102
src/views/admin/param/index.vue

@@ -27,6 +27,8 @@
         @on-load="getList"
         @search-change="searchChange"
         @refresh-change="refreshChange"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @row-update="handleUpdate"
         @row-save="handleSave"
         @row-del="rowDel"/>
@@ -35,127 +37,109 @@
 </template>
 
 <script>
-import { addObj, delObj, fetchList, putObj } from '@/api/admin/sys-public-param'
-import { tableOption } from '@/const/crud/admin/sys-public-param'
-import { mapGetters } from 'vuex'
+  import {addObj, delObj, fetchList, putObj} from '@/api/admin/sys-public-param'
+  import {tableOption} from '@/const/crud/admin/sys-public-param'
+  import {mapGetters} from 'vuex'
 
-export default {
-  name: 'Syspublicparam',
-  data() {
-    return {
-      searchForm: {},
-      tableData: [],
-      page: {
-        total: 0, // 总页数
-        currentPage: 1, // 当前页数
-        pageSize: 20 // 每页显示多少条
-      },
-      tableLoading: false,
-      tableOption: tableOption
-    }
-  },
-  created() {
-  },
-  mounted: function() {
-  },
-  computed: {
-    ...mapGetters(['permissions']),
-    permissionList() {
+  export default {
+    name: 'Syspublicparam',
+    data() {
       return {
-        addBtn: this.vaildData(this.permissions.admin_syspublicparam_add, false),
-        delBtn: this.vaildData(this.permissions.admin_syspublicparam_del, false),
-        editBtn: this.vaildData(this.permissions.admin_syspublicparam_edit, false)
+        searchForm: {},
+        tableData: [],
+        page: {
+          total: 0, // 总页数
+          currentPage: 1, // 当前页数
+          pageSize: 20 // 每页显示多少条
+        },
+        tableLoading: false,
+        tableOption: tableOption
       }
-    }
-  },
-  methods: {
-    getList(page, params) {
-      this.tableLoading = true
-      fetchList(Object.assign({
-        descs: 'create_time',
-        current: page.currentPage,
-        size: page.pageSize
-      }, params, this.searchForm)).then(response => {
-        this.tableData = response.data.data.records
-        this.page.total = response.data.data.total
-        this.tableLoading = false
-      })
     },
-    rowDel: function(row, index) {
-      var _this = this
-      this.$confirm('是否确认删除ID为' + row.publicId, '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(function() {
-        return delObj(row.publicId)
-      }).then(data => {
-        this.getList(this.page)
-        _this.$message({
-          showClose: true,
-          message: '删除成功',
-          type: 'success'
-        })
-        this.getList(this.page)
-      })
+    created() {
     },
-    /**
+    mounted: function () {
+    },
+    computed: {
+      ...mapGetters(['permissions']),
+      permissionList() {
+        return {
+          addBtn: this.vaildData(this.permissions.admin_syspublicparam_add, false),
+          delBtn: this.vaildData(this.permissions.admin_syspublicparam_del, false),
+          editBtn: this.vaildData(this.permissions.admin_syspublicparam_edit, false)
+        }
+      }
+    },
+    methods: {
+      getList(page, params) {
+        this.tableLoading = true
+        fetchList(Object.assign({
+          descs: 'create_time',
+          current: page.currentPage,
+          size: page.pageSize
+        }, params, this.searchForm)).then(response => {
+          this.tableData = response.data.data.records
+          this.page.total = response.data.data.total
+          this.tableLoading = false
+        })
+      },
+      rowDel: function (row, index) {
+        this.$confirm('是否确认删除ID为' + row.publicId, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(function () {
+          return delObj(row.publicId)
+        }).then(data => {
+          this.getList(this.page)
+          this.$message.success('删除成功')
+          this.getList(this.page)
+        })
+      },
+      /**
        * @title 数据更新
        * @param row 为当前的数据
        * @param index 为当前更新数据的行数
        * @param done 为表单关闭函数
        *
        **/
-    handleUpdate: function(row, index, done, loading) {
-      putObj(row).then(data => {
-        this.tableData.splice(index, 1, Object.assign({}, row))
-        this.$message({
-          showClose: true,
-          message: '修改成功',
-          type: 'success'
+      handleUpdate: function (row, index, done, loading) {
+        putObj(row).then(data => {
+          this.$message.success('修改成功')
+          done()
+          this.getList(this.page)
+        }).catch(() => {
+          loading()
         })
-        done()
-        this.getList(this.page)
-      }).catch(() => {
-        loading()
-      })
-    },
-    /**
+      },
+      /**
        * @title 数据添加
        * @param row 为当前的数据
        * @param done 为表单关闭函数
        *
        **/
-    handleSave: function(row, done, loading) {
-      addObj(row).then(data => {
-        this.tableData.push(Object.assign({}, row))
-        this.$message({
-          showClose: true,
-          message: '添加成功',
-          type: 'success'
+      handleSave: function (row, done, loading) {
+        addObj(row).then(data => {
+          this.$message.success('添加成功')
+          done()
+          this.getList(this.page)
+        }).catch(() => {
+          loading()
         })
-        done()
+      },
+      searchChange(form) {
+        this.searchForm = form
+        this.getList(this.page, form)
+      },
+      refreshChange() {
         this.getList(this.page)
-      }).catch(() => {
-        loading()
-      })
-    },
-    /**
-       * 搜索回调
-       */
-    searchChange(form) {
-      this.searchForm = form
-      this.getList(this.page, form)
-    },
-    /**
-       * 刷新回调
-       */
-    refreshChange() {
-      this.getList(this.page)
+      },
+      sizeChange(pageSize) {
+        this.page.pageSize = pageSize
+      },
+      currentChange(current) {
+        this.page.currentPage = current
+      }
     }
   }
-}
 </script>
-
-<style lang="scss" scoped>
-</style>

+ 10 - 2
src/views/admin/role/index.vue

@@ -28,7 +28,9 @@
         :before-open="handleOpenBefore"
         @on-load="getList"
         @search-change="handleFilter"
-        @refresh-change="handleRefreshChange"
+        @refresh-change="refreshChange"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @row-update="update"
         @row-save="create">
 
@@ -180,13 +182,19 @@ export default {
         this.listLoading = false
       })
     },
-    handleRefreshChange() {
+    refreshChange() {
       this.getList(this.page)
     },
     handleFilter(form) {
       this.searchForm = form
       this.getList(this.page, form)
     },
+    sizeChange(pageSize){
+      this.page.pageSize = pageSize
+    },
+    currentChange(current){
+      this.page.currentPage = current
+    },
     handleCreate() {
       this.$refs.crud.rowAdd()
     },

+ 81 - 82
src/views/admin/social/index.vue

@@ -28,6 +28,8 @@
         @on-load="getList"
         @refresh-change="refreshChange"
         @search-change="searchChange"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @row-update="handleUpdate"
         @row-save="handleSave"
         @row-del="rowDel"/>
@@ -36,97 +38,94 @@
 </template>
 
 <script>
-import { addObj, delObj, fetchList, putObj } from '@/api/admin/sys-social-details'
-import { tableOption } from '@/const/crud/admin/sys-social-details'
-import { mapGetters } from 'vuex'
+  import {addObj, delObj, fetchList, putObj} from '@/api/admin/sys-social-details'
+  import {tableOption} from '@/const/crud/admin/sys-social-details'
+  import {mapGetters} from 'vuex'
 
-export default {
-  name: 'SysSocialDetails',
-  data() {
-    return {
-      searchForm: {},
-      tableData: [],
-      page: {
-        total: 0, // 总页数
-        currentPage: 1, // 当前页数
-        pageSize: 20 // 每页显示多少条
-      },
-      tableLoading: false,
-      tableOption: tableOption
-    }
-  },
-  created() {
-  },
-  mounted: function() {
-  },
-  computed: {
-    ...mapGetters(['permissions']),
-    permissionList() {
+  export default {
+    name: 'SysSocialDetails',
+    data() {
       return {
-        addBtn: this.vaildData(this.permissions.sys_social_details_add, false),
-        delBtn: this.vaildData(this.permissions.sys_social_details_del, false),
-        editBtn: this.vaildData(this.permissions.sys_social_details_edit, false)
+        searchForm: {},
+        tableData: [],
+        page: {
+          total: 0, // 总页数
+          currentPage: 1, // 当前页数
+          pageSize: 20 // 每页显示多少条
+        },
+        tableLoading: false,
+        tableOption: tableOption
       }
-    }
-  },
-  methods: {
-    getList(page, params) {
-      this.tableLoading = true
-      fetchList(Object.assign({
-        current: page.currentPage,
-        size: page.pageSize
-      }, params, this.searchForm)).then(response => {
-        this.tableData = response.data.data.records
-        this.page.total = response.data.data.total
-        this.tableLoading = false
-      })
     },
-    rowDel: function(row, index) {
-      var _this = this
-      this.$confirm('是否确认删除ID为' + row.id, '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(function() {
-        return delObj(row.id)
-      }).then(() => {
-        _this.tableData.splice(index, 1)
-        _this.$message({
-          showClose: true,
-          message: '删除成功',
-          type: 'success'
-        })
-        this.refreshChange()
-      }).catch(function() {
-      })
+    created() {
+    },
+    mounted: function () {
     },
-    handleUpdate: function(row, index, done) {
-      putObj(row).then(() => {
-        this.tableData.splice(index, 1, Object.assign({}, row))
-        this.$message.success('修改成功')
-        this.refreshChange()
-        done()
-      })
+    computed: {
+      ...mapGetters(['permissions']),
+      permissionList() {
+        return {
+          addBtn: this.vaildData(this.permissions.sys_social_details_add, false),
+          delBtn: this.vaildData(this.permissions.sys_social_details_del, false),
+          editBtn: this.vaildData(this.permissions.sys_social_details_edit, false)
+        }
+      }
     },
-    handleSave: function(row, done) {
+    methods: {
+      getList(page, params) {
+        this.tableLoading = true
+        fetchList(Object.assign({
+          current: page.currentPage,
+          size: page.pageSize
+        }, params, this.searchForm)).then(response => {
+          this.tableData = response.data.data.records
+          this.page.total = response.data.data.total
+          this.tableLoading = false
+        })
+      },
+      rowDel: function (row, index) {
+        var _this = this
+        this.$confirm('是否确认删除ID为' + row.id, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(function () {
+          return delObj(row.id)
+        }).then(() => {
+          _this.$message.success('删除成功')
+          this.refreshChange()
+        }).catch(function () {
+        })
+      },
+      handleUpdate: function (row, index, done) {
+        putObj(row).then(() => {
+          this.$message.success('修改成功')
+          this.refreshChange()
+          done()
+        })
+      },
+      handleSave: function (row, done) {
         addObj(row).then(() => {
-            this.tableData.push(Object.assign({}, row))
-            this.$message.success('添加成功')
-            this.refreshChange()
-            done()
+          this.tableData.push(Object.assign({}, row))
+          this.$message.success('添加成功')
+          this.refreshChange()
+          done()
         })
-    },
-    refreshChange() {
-      this.getList(this.page)
-    },
-    searchChange(form) {
-      this.searchForm = form
-      this.getList(this.page, form)
+      },
+      refreshChange() {
+        this.getList(this.page)
+      },
+      searchChange(form) {
+        this.searchForm = form
+        this.getList(this.page, form)
+      },
+      sizeChange(pageSize) {
+        this.page.pageSize = pageSize
+      },
+      currentChange(current) {
+        this.page.currentPage = current
+      }
     }
   }
-}
 </script>
 
-<style lang="scss" scoped>
-</style>
-

+ 13 - 42
src/views/admin/tenant/index.vue

@@ -27,6 +27,8 @@
         @on-load="getList"
         @search-change="searchChange"
         @refresh-change="refreshChange"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @row-update="handleUpdate"
         @row-save="handleSave"
         @row-del="rowDel"/>
@@ -43,8 +45,8 @@ export default {
   name: 'Tenant',
   data() {
     return {
+      tableData:[],
       searchForm: {},
-      tableData: [],
       page: {
         total: 0, // 总页数
         currentPage: 1, // 当前页数
@@ -87,72 +89,41 @@ export default {
       }).then(function() {
         return delObj(row.id)
       }).then(data => {
-        _this.tableData.splice(index, 1)
-        _this.$message({
-          showClose: true,
-          message: '删除成功',
-          type: 'success'
-        })
+        _this.$message.success('删除成功')
         this.getList(this.page)
       })
     },
-    /**
-       * @title 数据更新
-       * @param row 为当前的数据
-       * @param index 为当前更新数据的行数
-       * @param done 为表单关闭函数
-       *
-       **/
     handleUpdate: function(row, index, done, loading) {
       putObj(row).then(data => {
-        this.tableData.splice(index, 1, Object.assign({}, row))
-        this.$message({
-          showClose: true,
-          message: '修改成功',
-          type: 'success'
-        })
+        this.$message.success('修改成功')
         done()
         this.getList(this.page)
       }).catch(() => {
         loading()
       })
     },
-    /**
-       * @title 数据添加
-       * @param row 为当前的数据
-       * @param done 为表单关闭函数
-       *
-       **/
     handleSave: function(row, done, loading) {
       addObj(row).then(data => {
-        this.tableData.push(Object.assign({}, row))
-        this.$message({
-          showClose: true,
-          message: '添加成功',
-          type: 'success'
-        })
+        this.$message.success('添加成功')
         done()
         this.getList(this.page)
       }).catch(() => {
         loading()
       })
     },
-    /**
-       * 搜索回调
-       */
     searchChange(form) {
       this.searchForm = form
       this.getList(this.page, form)
     },
-    /**
-       * 刷新回调
-       */
     refreshChange() {
       this.getList(this.page)
-    }
+    },
+    sizeChange(pageSize){
+      this.page.pageSize = pageSize
+    },
+    currentChange(current){
+      this.page.currentPage = current
+    },
   }
 }
 </script>
-
-<style lang="scss" scoped>
-</style>

+ 11 - 16
src/views/admin/token/index.vue

@@ -27,6 +27,8 @@
         :permission="permissionList"
         @on-load="getList"
         @refresh-change="refreshChange"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @row-del="handleDel"/>
     </basic-container>
   </div>
@@ -41,7 +43,7 @@ export default {
   name: 'Token',
   data() {
     return {
-      tableData: [],
+      tableData:[],
       page: {
         total: 0, // 总页数
         currentPage: 1, // 当前页数
@@ -84,25 +86,18 @@ export default {
       }).then(function() {
         return delObj(row.access_token)
       }).then(() => {
-        _this.tableData.splice(index, 1)
-        _this.$message({
-          showClose: true,
-          message: '强制下线成功',
-          type: 'success'
-        })
-      }).catch(function() {
+        _this.$message.success('强制下线成功')
       })
     },
-    /**
-       * 刷新回调
-       */
     refreshChange() {
       this.getList(this.page)
-    }
+    },
+    sizeChange(pageSize){
+      this.page.pageSize = pageSize
+    },
+    currentChange(current){
+      this.page.currentPage = current
+    },
   }
 }
 </script>
-
-<style lang="scss" scoped>
-</style>
-

+ 169 - 182
src/views/admin/user/index.vue

@@ -24,7 +24,6 @@
           :sm="24"
           :md="5"
           class="user__tree">
-
           <avue-tree
             :option="treeOption"
             :data="treeData"
@@ -45,7 +44,9 @@
             :data="list"
             @on-load="getList"
             @search-change="handleFilter"
-            @refresh-change="handleRefreshChange"
+            @refresh-change="refreshChange"
+            @size-change="sizeChange"
+            @current-change="currentChange"
             @row-update="update"
             @row-save="create">
             <template slot="menuLeft">
@@ -130,193 +131,179 @@
 </template>
 
 <script>
-    import {addObj, delObj, fetchList, putObj} from '@/api/admin/user'
-    import {deptRoleList} from '@/api/admin/role'
-    import {fetchTree} from '@/api/admin/dept'
-    import {tableOption} from '@/const/crud/admin/user'
-    import {mapGetters} from 'vuex'
+  import {addObj, delObj, fetchList, putObj} from '@/api/admin/user'
+  import {deptRoleList} from '@/api/admin/role'
+  import {fetchTree} from '@/api/admin/dept'
+  import {tableOption} from '@/const/crud/admin/user'
+  import {mapGetters} from 'vuex'
 
-    export default {
-        name: 'SysUser',
-        data() {
-            return {
-                searchForm: {},
-                treeOption: {
-                    nodeKey: 'id',
-                    addBtn: false,
-                    menu: false,
-                    props: {
-                        label: 'name',
-                        value: 'id'
-                    }
-                },
-                treeData: [],
-                option: tableOption,
-                treeDeptData: [],
-                checkedKeys: [],
-                roleProps: {
-                    label: 'roleName',
-                    value: 'roleId'
-                },
-                defaultProps: {
-                    label: 'name',
-                    value: 'id'
-                },
-                page: {
-                    total: 0, // 总页数
-                    currentPage: 1, // 当前页数
-                    pageSize: 20, // 每页显示多少条,
-                    isAsc: false// 是否倒序
-                },
-                list: [],
-                listLoading: true,
-                role: [],
-                form: {},
-                rolesOptions: []
-            }
+  export default {
+    name: 'SysUser',
+    data() {
+      return {
+        searchForm: {},
+        treeOption: {
+          nodeKey: 'id',
+          addBtn: false,
+          menu: false,
+          props: {
+            label: 'name',
+            value: 'id'
+          }
         },
-        computed: {
-            ...mapGetters(['permissions'])
+        treeData: [],
+        option: tableOption,
+        treeDeptData: [],
+        checkedKeys: [],
+        roleProps: {
+          label: 'roleName',
+          value: 'roleId'
         },
-        watch: {
-            role() {
-                this.form.role = this.role
-            }
+        defaultProps: {
+          label: 'name',
+          value: 'id'
         },
-        created() {
-            this.sys_user_add = this.permissions['sys_user_add']
-            this.sys_user_edit = this.permissions['sys_user_edit']
-            this.sys_user_del = this.permissions['sys_user_del']
-            this.init()
+        page: {
+          total: 0, // 总页数
+          currentPage: 1, // 当前页数
+          pageSize: 20, // 每页显示多少条,
+          isAsc: false// 是否倒序
         },
-        methods: {
-            init() {
-                fetchTree().then(response => {
-                    this.treeData = response.data.data
-                })
-            },
-            nodeClick(data) {
-                this.page.page = 1
-                this.getList(this.page, {deptId: data.id})
-            },
-            getList(page, params) {
-                this.listLoading = true
-                fetchList(Object.assign({
-                    current: page.currentPage,
-                    size: page.pageSize
-                }, params, this.searchForm)).then(response => {
-                    this.list = response.data.data.records
-                    this.page.total = response.data.data.total
-                    this.listLoading = false
-                })
-            },
-            getNodeData() {
-                deptRoleList().then(response => {
-                    this.rolesOptions = response.data.data
-                })
-            },
-            handleDept() {
-                fetchTree().then(response => {
-                    this.treeDeptData = response.data.data
-                })
-            },
-            handleFilter(param) {
-                this.searchForm = param
-                this.getList(this.page, param)
-            },
-            handleRefreshChange() {
-                this.getList(this.page)
-            },
-            handleCreate() {
-                this.$refs.crud.rowAdd()
-            },
-            handleOpenBefore(show, type) {
-                window.boxType = type
-                this.handleDept()
-                if (['edit', 'views'].includes(type)) {
-                    this.role = []
-                    for (var i = 0; i < this.form.roleList.length; i++) {
-                        this.role[i] = this.form.roleList[i].roleId
-                    }
-                    deptRoleList().then(response => {
-                        this.rolesOptions = response.data.data
-                    })
-                } else if (type === 'add') {
-                    this.role = []
-                }
-                show()
-            },
-            handleUpdate(row, index) {
-                console.log(row)
-                this.$refs.crud.rowEdit(row, index)
-                this.form.password = undefined
-            },
-            create(row, done, loading) {
-                if (this.form.phone.indexOf('*') > 0) {
-                    this.form.phone = undefined
-                }
-                addObj(this.form).then(() => {
-                    this.getList(this.page)
-                    done()
-                    this.$notify({
-                        title: '成功',
-                        message: '创建成功',
-                        type: 'success',
-                        duration: 2000
-                    })
-                }).catch(() => {
-                    loading()
-                })
-            },
-            update(row, index, done, loading) {
-                if (this.form.phone && this.form.phone.indexOf('*') > 0) {
-                    this.form.phone = undefined
-                }
-                putObj(this.form).then(() => {
-                    this.getList(this.page)
-                    done()
-                    this.$notify({
-                        title: '成功',
-                        message: '修改成功',
-                        type: 'success',
-                        duration: 2000
-                    })
-                }).catch(() => {
-                    loading()
-                })
-            },
-            deletes(row, index) {
-                this.$confirm(
-                    '此操作将永久删除该用户(用户名:' + row.username + '), 是否继续?',
-                    '提示',
-                    {
-                        confirmButtonText: '确定',
-                        cancelButtonText: '取消',
-                        type: 'warning'
-                    }
-                ).then(() => {
-                    delObj(row.userId)
-                        .then(() => {
-                            this.list.splice(index, 1)
-                            this.$notify({
-                                title: '成功',
-                                message: '删除成功',
-                                type: 'success',
-                                duration: 2000
-                            })
-                        })
-                        .cache(() => {
-                            this.$notify({
-                                title: '失败',
-                                message: '删除失败',
-                                type: 'error',
-                                duration: 2000
-                            })
-                        })
-                })
-            }
+        list: [],
+        listLoading: true,
+        role: [],
+        form: {},
+        rolesOptions: []
+      }
+    },
+    computed: {
+      ...mapGetters(['permissions'])
+    },
+    watch: {
+      role() {
+        this.form.role = this.role
+      }
+    },
+    created() {
+      this.sys_user_add = this.permissions['sys_user_add']
+      this.sys_user_edit = this.permissions['sys_user_edit']
+      this.sys_user_del = this.permissions['sys_user_del']
+      this.init()
+    },
+    methods: {
+      init() {
+        fetchTree().then(response => {
+          this.treeData = response.data.data
+        })
+      },
+      nodeClick(data) {
+        this.page.page = 1
+        this.getList(this.page, {deptId: data.id})
+      },
+      getList(page, params) {
+        this.listLoading = true
+        fetchList(Object.assign({
+          current: page.currentPage,
+          size: page.pageSize
+        }, params, this.searchForm)).then(response => {
+          this.list = response.data.data.records
+          this.page.total = response.data.data.total
+          this.listLoading = false
+        })
+      },
+      getNodeData() {
+        deptRoleList().then(response => {
+          this.rolesOptions = response.data.data
+        })
+      },
+      handleDept() {
+        fetchTree().then(response => {
+          this.treeDeptData = response.data.data
+        })
+      },
+      handleFilter(param) {
+        this.searchForm = param
+        this.getList(this.page, param)
+      },
+      sizeChange(pageSize) {
+        this.page.pageSize = pageSize
+      },
+      currentChange(current) {
+        this.page.currentPage = current
+      },
+      refreshChange() {
+        this.getList(this.page)
+      },
+      handleCreate() {
+        this.$refs.crud.rowAdd()
+      },
+      handleOpenBefore(show, type) {
+        window.boxType = type
+        this.handleDept()
+        if (['edit', 'views'].includes(type)) {
+          this.role = []
+          for (var i = 0; i < this.form.roleList.length; i++) {
+            this.role[i] = this.form.roleList[i].roleId
+          }
+          deptRoleList().then(response => {
+            this.rolesOptions = response.data.data
+          })
+        } else if (type === 'add') {
+          this.role = []
+        }
+        show()
+      },
+      handleUpdate(row, index) {
+        console.log(row)
+        this.$refs.crud.rowEdit(row, index)
+        this.form.password = undefined
+      },
+      create(row, done, loading) {
+        if (this.form.phone.indexOf('*') > 0) {
+          this.form.phone = undefined
         }
+        addObj(this.form).then(() => {
+          this.getList(this.page)
+          done()
+          this.$notify.success('创建成功')
+        }).catch(() => {
+          loading()
+        })
+      },
+      update(row, index, done, loading) {
+        if (this.form.phone && this.form.phone.indexOf('*') > 0) {
+          this.form.phone = undefined
+        }
+        putObj(this.form).then(() => {
+          this.getList(this.page)
+          done()
+          this.$notify.success('修改成功')
+        }).catch(() => {
+          loading()
+        })
+      },
+      deletes(row, index) {
+        this.$confirm(
+          '此操作将永久删除该用户(用户名:' + row.username + '), 是否继续?',
+          '提示',
+          {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }
+        ).then(() => {
+          delObj(row.userId)
+            .then(() => {
+              this.list.splice(index, 1)
+              this.$notify.success('删除成功')
+            })
+            .cache(() => {
+              this.$notify.error('删除失败')
+            })
+        })
+      }
     }
+  }
 </script>
 <style lang="scss">
   .user {

+ 9 - 11
src/views/daemon/execution-log/index.vue

@@ -27,6 +27,8 @@
         :permission="permissionList"
         @on-load="getList"
         @refresh-change="refreshChange"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @row-del="handleDel"/>
     </basic-container>
   </div>
@@ -78,7 +80,6 @@ export default {
       })
     },
     handleDel: function(row, index) {
-      var _this = this
       this.$confirm('是否确认删除ID为' + row.id, '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
@@ -86,19 +87,16 @@ export default {
       }).then(function() {
         return delObj(row.id)
       }).then(() => {
-        _this.tableData.splice(index, 1)
-        _this.$message({
-          showClose: true,
-          message: '删除成功',
-          type: 'success'
-        })
+        this.$message.success('删除成功')
         this.getList(this.page)
-      }).catch(function() {
       })
     },
-    /**
-       * 刷新回调
-       */
+    sizeChange(pageSize){
+      this.page.pageSize = pageSize
+    },
+    currentChange(current){
+      this.page.currentPage = current
+    },
     refreshChange() {
       this.getList(this.page)
     }

+ 8 - 10
src/views/daemon/job-log/index.vue

@@ -9,6 +9,8 @@
         :option="tableOption"
         @on-load="getList"
         @refresh-change="refreshChange"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @search-change="handleFilter"
         @search-reset="handleSearchReset">
         <template slot-scope="scope" slot="jobLogStatus">
@@ -89,15 +91,15 @@ export default {
       this.queryParams = params
       this.getList(this.page)
     },
-    /**
-       * 刷新回调
-       */
     refreshChange() {
       this.getList(this.page)
     },
-    /**
-       * 获取字典显示名称并缓存
-       */
+    sizeChange(pageSize){
+      this.page.pageSize = pageSize
+    },
+    currentChange(current){
+      this.page.currentPage = current
+    },
     getDicNameCache(type) {
       remote(type).then(response => {
         const code = response.data.code
@@ -107,15 +109,11 @@ export default {
         }
       })
     },
-    /**
-       * 获取字典显示名称并缓存
-       */
     getDicNameJobExecuteStatus(value) {
       let re = ''
       this.JobExecuteStatusDicCache.forEach(obj => {
         if (obj.value === value) {
           re = obj.label
-          return
         }
       })
       return re

+ 8 - 0
src/views/daemon/job-manage/index.vue

@@ -12,6 +12,8 @@
         @row-save="save"
         @row-update="update"
         @refresh-change="refreshChange"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @search-change="handleFilter"
         @search-reset="handleSearchReset">
         <template slot-scope="scope" slot="jobStatus">
@@ -315,6 +317,12 @@
       refreshChange() {
         this.getList(this.page)
       },
+      sizeChange(pageSize){
+        this.page.pageSize = pageSize
+      },
+      currentChange(current){
+        this.page.currentPage = current
+      },
       shutdownJobs() {
         this.$confirm(
           '即将暂停全部运行中定时任务, 是否继续?',

+ 61 - 56
src/views/daemon/job-manage/job-log.vue

@@ -9,6 +9,8 @@
           :option="tableLogOption"
           :table-loading="tableLogLoading"
           @on-load="getJobLogList"
+          @size-change="sizeChange"
+          @current-change="currentChange"
           @refresh-change="getJobLogList">
         </avue-crud>
       </el-dialog>
@@ -18,63 +20,66 @@
 </template>
 
 <script>
-    import {fetchLogList,} from '@/api/daemon/sys-job'
-    import {tableLogOption} from '@/const/crud/daemon/sys-job'
-    import {mapGetters} from 'vuex'
+  import {fetchLogList,} from '@/api/daemon/sys-job'
+  import {tableLogOption} from '@/const/crud/daemon/sys-job'
+  import {mapGetters} from 'vuex'
 
-    export default {
-        name: 'jobLog',
-        data() {
-            return {
-                tableLogData: [],
-                dialogFormVisible: false,
-                jobId: '',
-                pageLog: {
-                    total: 0, // 总页数
-                    currentPage: 1, // 当前页数
-                    pageSize: 10 // 每页显示多少条,
-                },
-                tableLogLoading: false,
-                tableLogOption: tableLogOption,
-            }
+  export default {
+    name: 'jobLog',
+    data() {
+      return {
+        tableLogData: [],
+        dialogFormVisible: false,
+        jobId: '',
+        pageLog: {
+          total: 0, // 总页数
+          currentPage: 1, // 当前页数
+          pageSize: 10 // 每页显示多少条,
         },
-        computed: {
-            ...mapGetters(['permissions'])
-        },
-        mounted: function () {
-        },
-        methods: {
-            init () {
-                this.dialogFormVisible = true
-                this.getJobLogList(this.pageLog)
-            },
-            /**
-             * 获取定时任务执行日志
-             */
-            getJobLog(row) {
-                this.dialogFormVisible = true
-                this.tableLogLoading = true
-                this.jobId = row.jobId
-                this.getJobLogList(this.pageLog)
-            },
-            getJobLogList(page) {
-                fetchLogList(Object.assign({
-                    descs: 'create_time',
-                    current: page.currentPage,
-                    size: page.pageSize
-                }, { jobId: this.jobId })).then(response => {
-                    this.tableLogData = response.data.data.records
-                    this.pageLog.total = response.data.data.total
-                    this.pageLog.pageSize = response.data.data.pageSize
-                    this.tableLogLoading = false
-                })
-            },
-            closeJobLogDialog() {
-                this.jobId = ''
-                this.pageLog.total = 0
-                this.pageLog.currentPage = 1
-                this.pageLog.pageSize = 10
-            },
-        }
+        tableLogLoading: false,
+        tableLogOption: tableLogOption,
+      }
+    },
+    computed: {
+      ...mapGetters(['permissions'])
+    },
+    mounted: function () {
+    },
+    methods: {
+      init() {
+        this.dialogFormVisible = true
+        this.getJobLogList(this.pageLog)
+      },
+      getJobLog(row) {
+        this.dialogFormVisible = true
+        this.tableLogLoading = true
+        this.jobId = row.jobId
+        this.getJobLogList(this.pageLog)
+      },
+      getJobLogList(page) {
+        fetchLogList(Object.assign({
+          descs: 'create_time',
+          current: page.currentPage,
+          size: page.pageSize
+        }, {jobId: this.jobId})).then(response => {
+          this.tableLogData = response.data.data.records
+          this.pageLog.total = response.data.data.total
+          this.pageLog.pageSize = response.data.data.pageSize
+          this.tableLogLoading = false
+        })
+      },
+      sizeChange(pageSize) {
+        this.page.pageSize = pageSize
+      },
+      currentChange(current) {
+        this.page.currentPage = current
+      },
+      closeJobLogDialog() {
+        this.jobId = ''
+        this.pageLog.total = 0
+        this.pageLog.currentPage = 1
+        this.pageLog.pageSize = 10
+      },
     }
+  }
 </script>

+ 78 - 109
src/views/daemon/status-trace-log/index.vue

@@ -26,6 +26,8 @@
         :option="tableOption"
         @on-load="getList"
         @refresh-change="refreshChange"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @search-change="searchChange"
         @row-update="handleUpdate"
         @row-save="handleSave"
@@ -46,123 +48,90 @@
 </template>
 
 <script>
-import { addObj, delObj, fetchList, putObj } from '@/api/daemon/status-trace-log'
-import { tableOption } from '@/const/crud/daemon/status-trace-log'
-import { mapGetters } from 'vuex'
+  import {addObj, delObj, fetchList, putObj} from '@/api/daemon/status-trace-log'
+  import {tableOption} from '@/const/crud/daemon/status-trace-log'
+  import {mapGetters} from 'vuex'
 
-export default {
-  name: 'StatusTraceLog',
-  data() {
-    return {
-      searchForm: {},
-      tableData: [],
-      page: {
-        total: 0, // 总页数
-        currentPage: 1, // 当前页数
-        pageSize: 20 // 每页显示多少条
-      },
-      tableLoading: false,
-      tableOption: tableOption
-    }
-  },
-  created() {
-  },
-  mounted: function() {
-  },
-  computed: {
-    ...mapGetters(['permissions'])
-  },
-  methods: {
-    getList(page, params) {
-      this.tableLoading = true
-      fetchList(Object.assign({
-        current: page.currentPage,
-        size: page.pageSize
-      }, params, this.searchForm)).then(response => {
-        this.tableData = response.data.data.records
-        this.page.total = response.data.data.total
-        this.tableLoading = false
-      })
-    },
-    /**
-       * @title 打开新增窗口
-       * @detail 调用crud的handleadd方法即可
-       *
-       **/
-    handleAdd: function() {
-      this.$refs.crud.rowAdd()
+  export default {
+    name: 'StatusTraceLog',
+    data() {
+      return {
+        searchForm: {},
+        tableData: [],
+        page: {
+          total: 0, // 总页数
+          currentPage: 1, // 当前页数
+          pageSize: 20 // 每页显示多少条
+        },
+        tableLoading: false,
+        tableOption: tableOption
+      }
     },
-    handleEdit(row, index) {
-      this.$refs.crud.rowEdit(row, index)
+    computed: {
+      ...mapGetters(['permissions'])
     },
-    handleDel(row, index) {
-      this.$refs.crud.rowDel(row, index)
-    },
-    rowDel: function(row, index) {
-      var _this = this
-      this.$confirm('是否确认删除ID为' + row.id, '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(function() {
-        return delObj(row.clientId)
-      }).then(() => {
-        _this.tableData.splice(index, 1)
-        _this.$message({
-          showClose: true,
-          message: '删除成功',
-          type: 'success'
+    methods: {
+      getList(page, params) {
+        this.tableLoading = true
+        fetchList(Object.assign({
+          current: page.currentPage,
+          size: page.pageSize
+        }, params, this.searchForm)).then(response => {
+          this.tableData = response.data.data.records
+          this.page.total = response.data.data.total
+          this.tableLoading = false
         })
-      }).catch(function() {
-      })
-    },
-    /**
-       * @title 数据更新
-       * @param row 为当前的数据
-       * @param index 为当前更新数据的行数
-       * @param done 为表单关闭函数
-       *
-       **/
-    handleUpdate: function(row, index, done) {
-      putObj(row).then(() => {
-        this.tableData.splice(index, 1, Object.assign({}, row))
-        this.$message({
-          showClose: true,
-          message: '修改成功',
-          type: 'success'
+      },
+      handleAdd: function () {
+        this.$refs.crud.rowAdd()
+      },
+      handleEdit(row, index) {
+        this.$refs.crud.rowEdit(row, index)
+      },
+      handleDel(row, index) {
+        this.$refs.crud.rowDel(row, index)
+      },
+      rowDel: function (row, index) {
+        this.$confirm('是否确认删除ID为' + row.id, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(function () {
+          return delObj(row.clientId)
+        }).then(() => {
+          this.$message.success('删除成功')
+          this.refreshChange()
         })
-        done()
-      })
-    },
-    /**
-       * @title 数据添加
-       * @param row 为当前的数据
-       * @param done 为表单关闭函数
-       *
-       **/
-    handleSave: function(row, done) {
-      addObj(row).then(() => {
-        this.tableData.push(Object.assign({}, row))
-        this.$message({
-          showClose: true,
-          message: '添加成功',
-          type: 'success'
+      },
+      handleUpdate: function (row, index, done) {
+        putObj(row).then(() => {
+          this.$message.success('修改成功')
+          this.refreshChange()
+          done()
         })
-        done()
-      })
-    },
-    searchChange(form) {
-      this.searchForm = form
-      this.getList(this.page, form)
-    },
-    /**
-       * 刷新回调
-       */
-    refreshChange() {
-      this.getList(this.page)
+      },
+      handleSave: function (row, done) {
+        addObj(row).then(() => {
+          this.$message.success('添加成功')
+          this.refreshChange()
+          done()
+        })
+      },
+      searchChange(form) {
+        this.searchForm = form
+        this.getList(this.page, form)
+      },
+      sizeChange(pageSize) {
+        this.page.pageSize = pageSize
+      },
+      currentChange(current) {
+        this.page.currentPage = current
+      },
+      refreshChange() {
+        this.getList(this.page)
+      }
     }
   }
-}
 </script>
 
 <style lang="scss" scoped>

+ 8 - 0
src/views/gen/datasource.vue

@@ -28,6 +28,8 @@
         @row-update="handleUpdate"
         @row-save="handleSave"
         @row-del="rowDel"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @refresh-change="refreshDsChange"
         @on-load="getDsList"/>
     </basic-container>
@@ -99,6 +101,12 @@
           this.dsPage.total = response.data.data.total
         })
       },
+      sizeChange(pageSize) {
+        this.page.pageSize = pageSize
+      },
+      currentChange(current) {
+        this.page.currentPage = current
+      },
       refreshDsChange() {
         this.getDsList(this.dsPage)
       }

+ 11 - 16
src/views/gen/form.vue

@@ -26,6 +26,8 @@
                  @on-load="getList"
                  @search-change="searchChange"
                  @refresh-change="refreshChange"
+                 @size-change="sizeChange"
+                 @current-change="currentChange"
                  @row-update="handleUpdate"
                  @row-save="handleSave"
                  @row-del="rowDel">
@@ -88,22 +90,13 @@
         }).then(function () {
           return delObj(row.id)
         }).then(data => {
-          _this.tableData.splice(index, 1)
-          _this.$message({
-            showClose: true,
-            message: '删除成功',
-            type: 'success'
-          })
+          this.$message.success('删除成功')
           this.getList(this.page)
         })
       },
       handleUpdate: function (row, index, done, loading) {
         putObj(row).then(data => {
-          this.$message({
-            showClose: true,
-            message: '修改成功',
-            type: 'success'
-          })
+          this.$message.success('修改成功')
           done()
           this.getList(this.page)
         }).catch(() => {
@@ -112,11 +105,7 @@
       },
       handleSave: function (row, done, loading) {
         addObj(row).then(data => {
-          this.$message({
-            showClose: true,
-            message: '添加成功',
-            type: 'success'
-          })
+          this.$message.success('添加成功')
           done()
           this.getList(this.page)
         }).catch(() => {
@@ -127,6 +116,12 @@
         this.searchForm = form
         this.getList(this.page, form)
       },
+      sizeChange(pageSize){
+        this.page.pageSize = pageSize
+      },
+      currentChange(current){
+        this.page.currentPage = current
+      },
       refreshChange() {
         this.getList(this.page)
       }

+ 8 - 0
src/views/gen/index.vue

@@ -49,6 +49,8 @@
         :table-loading="tableLoading"
         :option="tableOption"
         @on-load="getList"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @refresh-change="refreshChange">
         <template
           slot-scope="scope"
@@ -145,6 +147,12 @@
         this.formData.tableName = row.tableName
         this.box = true
       },
+      sizeChange(pageSize){
+        this.page.pageSize = pageSize
+      },
+      currentChange(current){
+        this.page.currentPage = current
+      },
       refreshChange() {
         this.getList(this.page)
       },

+ 8 - 1
src/views/mp/wxaccount/index.vue

@@ -25,6 +25,8 @@
         :table-loading="tableLoading"
         :option="tableOption"
         @on-load="getList"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @refresh-change="refreshChange"
         @row-update="handleUpdate"
         @row-save="handleSave"
@@ -146,7 +148,12 @@ export default {
         this.getList(this.page)
       })
     },
-
+    sizeChange(pageSize){
+      this.page.pageSize = pageSize
+    },
+    currentChange(current){
+      this.page.currentPage = current
+    },
     refreshChange() {
       this.getList(this.page)
     },

+ 8 - 3
src/views/mp/wxaccountfans/index.vue

@@ -49,6 +49,8 @@
         :table-loading="tableLoading"
         :option="tableOption"
         @on-load="getList"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @refresh-change="refreshChange"
         @row-update="handleUpdate"
         @row-save="handleSave"
@@ -165,9 +167,12 @@ export default {
         this.getList(this.page)
       })
     },
-    /**
-       * 刷新回调
-       */
+    sizeChange(pageSize){
+      this.page.pageSize = pageSize
+    },
+    currentChange(current){
+      this.page.currentPage = current
+    },
     refreshChange() {
       this.getList(this.page)
     },

+ 8 - 6
src/views/mp/wxfansmsg/index.vue

@@ -27,6 +27,8 @@
         @on-load="getList"
         @refresh-change="refreshChange"
         @search-change="searchChange"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @row-save="handleSave"
         @row-del="rowDel">
         <template
@@ -174,15 +176,15 @@ export default {
         this.getResList(this.pageRes, { fansMsgId: this.msgId })
       })
     },
-    /**
-       * 刷新回调
-       */
+    sizeChange(pageSize){
+      this.page.pageSize = pageSize
+    },
+    currentChange(current){
+      this.page.currentPage = current
+    },
     refreshChange() {
       this.getList(this.page)
     },
-    /**
-       * 搜索回调
-       */
     searchChange(form) {
       this.searchForm = form
       this.getList(this.page, form)

+ 8 - 6
src/views/pay/goods/index.vue

@@ -27,6 +27,8 @@
         @on-load="getList"
         @search-change="searchChange"
         @refresh-change="refreshChange"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @row-update="handleUpdate"
         @row-save="handleSave"
         @row-del="rowDel"/>
@@ -125,16 +127,16 @@ export default {
         loading()
       })
     },
-    /**
-       * 搜索回调
-       */
     searchChange(form) {
       this.searchForm = form
       this.getList(this.page, form)
     },
-    /**
-       * 刷新回调
-       */
+    sizeChange(pageSize){
+      this.page.pageSize = pageSize
+    },
+    currentChange(current){
+      this.page.currentPage = current
+    },
     refreshChange() {
       this.getList(this.page)
     }

+ 97 - 101
src/views/pay/notify/index.vue

@@ -27,6 +27,8 @@
         @on-load="getList"
         @search-change="searchChange"
         @refresh-change="refreshChange"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @row-update="handleUpdate"
         @row-save="handleSave"
         @row-del="rowDel"/>
@@ -35,115 +37,109 @@
 </template>
 
 <script>
-import {
-  fetchList,
-  addObj,
-  putObj,
-  delObj
-} from '@/api/pay/paynotifyrecord'
-import {
-  tableOption
-} from '@/const/crud/pay/paynotifyrecord'
-import {
-  mapGetters
-} from 'vuex'
+  import {addObj, delObj, fetchList, putObj} from '@/api/pay/paynotifyrecord'
+  import {tableOption} from '@/const/crud/pay/paynotifyrecord'
+  import {mapGetters} from 'vuex'
 
-export default {
-  name: 'Paynotifyrecord',
-  data() {
-    return {
-      searchForm: {},
-      tableData: [],
-      page: {
-        total: 0, // 总页数
-        currentPage: 1, // 当前页数
-        pageSize: 20 // 每页显示多少条
-      },
-      tableLoading: false,
-      tableOption: tableOption
-    }
-  },
-  computed: {
-    ...mapGetters(['permissions']),
-    permissionList() {
+  export default {
+    name: 'Paynotifyrecord',
+    data() {
       return {
-        addBtn: this.vaildData(this.permissions.generator_paynotifyrecord_add, false),
-        delBtn: this.vaildData(this.permissions.generator_paynotifyrecord_del, false),
-        editBtn: this.vaildData(this.permissions.generator_paynotifyrecord_edit, false)
+        searchForm: {},
+        tableData: [],
+        page: {
+          total: 0, // 总页数
+          currentPage: 1, // 当前页数
+          pageSize: 20 // 每页显示多少条
+        },
+        tableLoading: false,
+        tableOption: tableOption
       }
-    }
-  },
-  methods: {
-    getList(page, params) {
-      this.tableLoading = true
-      fetchList(Object.assign({
-        descs: 'create_time',
-        current: page.currentPage,
-        size: page.pageSize
-      }, params, this.searchForm)).then(response => {
-        this.tableData = response.data.data.records
-        this.page.total = response.data.data.total
-        this.tableLoading = false
-      }).catch(() => {
-        this.tableLoading = false
-      })
     },
-    rowDel: function(row, index) {
-      var _this = this
-      this.$confirm('是否确认删除ID为' + row.id, '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(function() {
-        return delObj(row.id)
-      }).then(data => {
-        _this.tableData.splice(index, 1)
-        _this.$message({
-          showClose: true,
-          message: '删除成功',
-          type: 'success'
-        })
-        this.getList(this.page)
-      })
+    computed: {
+      ...mapGetters(['permissions']),
+      permissionList() {
+        return {
+          addBtn: this.vaildData(this.permissions.generator_paynotifyrecord_add, false),
+          delBtn: this.vaildData(this.permissions.generator_paynotifyrecord_del, false),
+          editBtn: this.vaildData(this.permissions.generator_paynotifyrecord_edit, false)
+        }
+      }
     },
-    handleUpdate: function(row, index, done, loading) {
-      putObj(row).then(data => {
-        this.tableData.splice(index, 1, Object.assign({}, row))
-        this.$message({
-          showClose: true,
-          message: '修改成功',
-          type: 'success'
+    methods: {
+      getList(page, params) {
+        this.tableLoading = true
+        fetchList(Object.assign({
+          descs: 'create_time',
+          current: page.currentPage,
+          size: page.pageSize
+        }, params, this.searchForm)).then(response => {
+          this.tableData = response.data.data.records
+          this.page.total = response.data.data.total
+          this.tableLoading = false
+        }).catch(() => {
+          this.tableLoading = false
         })
-        done()
-        this.getList(this.page)
-      }).catch(() => {
-        loading()
-      })
-    },
-    handleSave: function(row, done, loading) {
-      addObj(row).then(data => {
-        this.tableData.push(Object.assign({}, row))
-        this.$message({
-          showClose: true,
-          message: '添加成功',
-          type: 'success'
+      },
+      rowDel: function (row, index) {
+        var _this = this
+        this.$confirm('是否确认删除ID为' + row.id, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(function () {
+          return delObj(row.id)
+        }).then(data => {
+          _this.tableData.splice(index, 1)
+          _this.$message({
+            showClose: true,
+            message: '删除成功',
+            type: 'success'
+          })
+          this.getList(this.page)
+        })
+      },
+      handleUpdate: function (row, index, done, loading) {
+        putObj(row).then(data => {
+          this.tableData.splice(index, 1, Object.assign({}, row))
+          this.$message({
+            showClose: true,
+            message: '修改成功',
+            type: 'success'
+          })
+          done()
+          this.getList(this.page)
+        }).catch(() => {
+          loading()
         })
-        done()
+      },
+      handleSave: function (row, done, loading) {
+        addObj(row).then(data => {
+          this.tableData.push(Object.assign({}, row))
+          this.$message({
+            showClose: true,
+            message: '添加成功',
+            type: 'success'
+          })
+          done()
+          this.getList(this.page)
+        }).catch(() => {
+          loading()
+        })
+      },
+      searchChange(form) {
+        this.searchForm = form
+        this.getList(this.page, form)
+      },
+      sizeChange(pageSize) {
+        this.page.pageSize = pageSize
+      },
+      currentChange(current) {
+        this.page.currentPage = current
+      },
+      refreshChange() {
         this.getList(this.page)
-      }).catch(() => {
-        loading()
-      })
-    },
-    searchChange(form) {
-      this.searchForm = form
-      this.getList(this.page, form)
-    },
-    refreshChange() {
-      this.getList(this.page)
+      }
     }
   }
-}
 </script>
-
-<style lang="scss" scoped>
-</style>

+ 8 - 3
src/views/pay/orders/index.vue

@@ -27,6 +27,8 @@
         @on-load="getList"
         @search-change="searchChange"
         @refresh-change="refreshChange"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @row-update="handleUpdate"
         @row-save="handleSave"
         @row-del="rowDel"/>
@@ -138,12 +140,15 @@ export default {
       this.searchForm = form
       this.getList(this.page, form)
     },
+    sizeChange(pageSize){
+      this.page.pageSize = pageSize
+    },
+    currentChange(current){
+      this.page.currentPage = current
+    },
     refreshChange() {
       this.getList(this.page)
     }
   }
 }
 </script>
-
-<style lang="scss" scoped>
-</style>

+ 8 - 0
src/views/pay/paychannel/index.vue

@@ -27,6 +27,8 @@
         @on-load="getList"
         @search-change="searchChange"
         @refresh-change="refreshChange"
+        @size-change="sizeChange"
+        @current-change="currentChange"
         @row-update="handleUpdate"
         @row-save="handleSave"
         @row-del="rowDel"/>
@@ -138,6 +140,12 @@ export default {
       this.searchForm = form
       this.getList(this.page, form)
     },
+    sizeChange(pageSize){
+      this.page.pageSize = pageSize
+    },
+    currentChange(current){
+      this.page.currentPage = current
+    },
     refreshChange() {
       this.getList(this.page)
     }