⬆️ Upgrading ORM Framework from Mybatis Plus 2.x to Mybatis Plus 3.x

This commit is contained in:
萌萌哒SAKURA酱 committed 2018-11-23 00:58:35 +08:00
1 parent abab6b1859
commit ff47da2767
128 files changed
+1579 -749

No files matched your search

@@ -1,20 +1,3 @@
<!--
- Copyright (c) 2018-2025, lengleng All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- Neither the name of the pig4cloud.com developer nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
- Author: lengleng (wangiegie@gmail.com)
-->
<template>
<div class="app-container pull-auto">
<basic-container>
@@ -23,8 +6,9 @@
:data="tableData"
:table-loading="tableLoading"
:option="tableOption"
@on-load="getList"
@current-change="currentChange"
@refresh-change="refreshChange"
@size-change="sizeChange"
@row-update="handleUpdate"
@row-save="handleSave"
@row-del="rowDel">
@@ -69,28 +53,40 @@
currentPage: 1, // 当前页数
pageSize: 20 // 每页显示多少条
},
listQuery: {
current: 1,
size: 20
},
tableLoading: false,
tableOption: tableOption
}
},
created() {
this.getList()
},
mounted: function() { },
computed: {
...mapGetters(['permissions'])
},
methods: {
getList(page, params) {
getList() {
this.tableLoading = true
fetchList(Object.assign({
page: page.currentPage,
limit: page.pageSize
}, params)).then(response => {
this.tableData = response.data.records
this.page.total = response.data.total
fetchList(this.listQuery).then(response => {
this.tableData = response.data.data.records
this.page.total = response.data.data.total
this.tableLoading = false
})
},
currentChange(val) {
this.page.current = val
this.listQuery.current = val
this.getList()
},
sizeChange(val) {
this.page.size = val
this.listQuery.size = val
this.getList()
},
/**
* @title 打开新增窗口
* @detail 调用crud的handleadd方法即可
@@ -107,7 +103,7 @@
},
rowDel: function(row, index) {
var _this = this
this.$confirm('是否确认删除ID为' + row.$pk.lowerAttrName, '提示', {
this.$confirm('是否确认删除ID为' + row.$pk.lowerAttrName + '的记录', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
@@ -136,11 +132,11 @@
handleUpdate: function(row, index, done) {
putObj(row).then(data => {
this.tableData.splice(index, 1, Object.assign({}, row))
this.$message({
showClose: true,
message: '修改成功',
type: 'success'
})
this.$message({
showClose: true,
message: '修改成功',
type: 'success'
})
done()
this.getList(this.page)
})
@@ -154,20 +150,20 @@
handleSave: function(row, done) {
addObj(row).then(data => {
this.tableData.push(Object.assign({}, row))
this.$message({
showClose: true,
message: '添加成功',
type: 'success'
})
done()
this.getList(this.page)
this.$message({
showClose: true,
message: '添加成功',
type: 'success'
})
done()
this.getList(this.page)
})
},
/**
* 刷新回调
*/
refreshChange() {
this.getList(this.page)
this.getList()
}
}
}