mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-13 05:59:01 +08:00
✨ 添加新特性。完善後台綁定的代碼
This commit is contained in:
1 parent
36b2ce817e
commit
9dfd44766c
18 files changed
+497
-141
No files matched your search
@@ -46,8 +46,7 @@ public class ${className}Controller {
|
||||
@GetMapping("/{${pk.lowerAttrName}}")
|
||||
public R info(@PathVariable("${pk.lowerAttrName}") ${pk.attrType} ${pk.lowerAttrName}){
|
||||
${className} ${classname} = ${classname}Service.selectById(${pk.lowerAttrName});
|
||||
|
||||
return new R<>(${classname});
|
||||
return new R<>(${classname});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -55,11 +54,10 @@ public class ${className}Controller {
|
||||
* @param ${classname}
|
||||
* @return R
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@PostMapping
|
||||
public R save(@RequestBody ${className} ${classname}){
|
||||
${classname}Service.insert(${classname});
|
||||
|
||||
return new R<>(Boolean.TRUE);
|
||||
return new R<>(Boolean.TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,10 +65,9 @@ public class ${className}Controller {
|
||||
* @param ${classname}
|
||||
* @return R
|
||||
*/
|
||||
@PutMapping("/update")
|
||||
@PutMapping
|
||||
public R update(@RequestBody ${className} ${classname}){
|
||||
${classname}Service.updateById(${classname});
|
||||
|
||||
return new R<>(Boolean.TRUE);
|
||||
}
|
||||
|
||||
@@ -79,10 +76,9 @@ public class ${className}Controller {
|
||||
* @param ${pk.lowerAttrName}s
|
||||
* @return R
|
||||
*/
|
||||
@DeleteMapping("/delete")
|
||||
@DeleteMapping
|
||||
public R delete(@RequestBody ${pk.attrType}[] ${pk.lowerAttrName}s){
|
||||
${classname}Service.deleteBatchIds(Arrays.asList(${pk.lowerAttrName}s));
|
||||
|
||||
return new R<>(Boolean.TRUE);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,16 +16,16 @@
|
||||
*/
|
||||
|
||||
export const tableOption = {
|
||||
"border": true,
|
||||
"index": true,
|
||||
"stripe": true,
|
||||
"menuAlign": "center",
|
||||
"align": "center",
|
||||
"editBtn": false,
|
||||
"delBtn": false,
|
||||
"addBtn": false,
|
||||
"dic": [],
|
||||
"column": [
|
||||
'border': true,
|
||||
'index': true,
|
||||
'stripe': true,
|
||||
'menuAlign': "center",
|
||||
'align': "center",
|
||||
'editBtn': false,
|
||||
'delBtn': false,
|
||||
'addBtn': false,
|
||||
'dic': [],
|
||||
'column': [
|
||||
#foreach ($column in $columns)
|
||||
{
|
||||
label: '$column.comments',
|
||||
|
||||
@@ -70,6 +70,10 @@
|
||||
currentPage: 1, // 当前页数
|
||||
pageSize: 20 // 每页显示多少条
|
||||
},
|
||||
listQuery: {
|
||||
page: 1,
|
||||
limit: 20
|
||||
},
|
||||
tableLoading: false,
|
||||
tableOption: tableOption
|
||||
}
|
||||
@@ -84,21 +88,20 @@
|
||||
methods: {
|
||||
getList() {
|
||||
this.tableLoading = true
|
||||
fetchList({
|
||||
page: this.page.currentPage,
|
||||
limit: this.page.pageSize
|
||||
}).then(response => {
|
||||
fetchList(this.listQuery).then(response => {
|
||||
this.tableData = response.data.records
|
||||
this.page.total = response.data.total
|
||||
this.tableLoading = false
|
||||
this.page.total = response.data.total
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
currentChange(val) {
|
||||
this.page.currentPage = val
|
||||
this.listQuery.page = val
|
||||
this.getList()
|
||||
},
|
||||
sizeChange(val) {
|
||||
this.page.pageSize = val
|
||||
this.listQuery.limit = val
|
||||
this.getList()
|
||||
},
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user