Browse Source

优化树表代码生成模板

tags/v3.0.0
Ricky 4 years ago
parent
commit
3ef167e416
  1. 24
      ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm

24
ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm

@ -108,9 +108,13 @@ @@ -108,9 +108,13 @@
#elseif($column.list && "" != $column.dictType)
<el-table-column label="${comment}" align="center" prop="${javaField}" :formatter="${javaField}Format" />
#elseif($column.list && "" != $javaField)
#if(${foreach.index} == 1)
<el-table-column label="${comment}" prop="${javaField}" />
#else
<el-table-column label="${comment}" align="center" prop="${javaField}" />
#end
#end
#end
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -123,6 +127,13 @@ @@ -123,6 +127,13 @@
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAdd(scope.row)"
v-hasPermi="['${moduleName}:${businessName}:add']"
>新增</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['${moduleName}:${businessName}:remove']"
@ -394,7 +405,7 @@ export default { @@ -394,7 +405,7 @@ export default {
children: node.children
};
},
/** 查询部门下拉树结构 */
/** 查询${functionName}下拉树结构 */
getTreeselect() {
list${BusinessName}().then(response => {
this.${businessName}Options = [];
@ -456,16 +467,21 @@ export default { @@ -456,16 +467,21 @@ export default {
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
handleAdd(row) {
this.reset();
this.getTreeselect();
this.getTreeselect();
if (row != null && row.${treeCode}) {
this.form.${treeParentCode} = row.${treeCode};
} else {
this.form.${treeParentCode} = 0;
}
this.open = true;
this.title = "添加${functionName}";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.getTreeselect();
this.getTreeselect();
if (row != null) {
this.form.${treeParentCode} = row.${treeCode};
}

Loading…
Cancel
Save