Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
finance-manage
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
finance-oa
finance-manage
Commits
d9108881
Commit
d9108881
authored
Apr 07, 2022
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码生成树表新增(展开/折叠)
parent
db2dfee6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
2 deletions
+44
-2
ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm
ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm
+23
-1
ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm
...-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm
+21
-1
No files found.
ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm
View file @
d9108881
...
...
@@ -78,14 +78,24 @@
v-hasPermi="['${moduleName}:${businessName}:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-sort"
size="mini"
@click="toggleExpandAll"
>展开/折叠</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table
v-if="refreshTable"
v-loading="loading"
:data="${businessName}List"
row-key="${treeCode}"
default-expand-all
:default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
#foreach($column in $columns)
...
...
@@ -293,6 +303,10 @@ export default {
title: "",
// 是否显示弹出层
open: false,
// 是否展开,默认全部展开
isExpandAll: true,
// 重新渲染表格状态
refreshTable: true,
#foreach ($column in $columns)
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
...
...
@@ -423,6 +437,14 @@ export default {
this.open = true;
this.title = "添加${functionName}";
},
/** 展开/折叠操作 */
toggleExpandAll() {
this.refreshTable = false;
this.isExpandAll = !this.isExpandAll;
this.$nextTick(() => {
this.refreshTable = true;
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
...
...
ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm
View file @
d9108881
...
...
@@ -76,14 +76,23 @@
v-hasPermi=
"['${moduleName}:${businessName}:add']"
>
新增
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"info"
plain
icon=
"Sort"
@
click=
"toggleExpandAll"
>
展开/折叠
</el-button>
</el-col>
<right-toolbar
v-model:showSearch=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<el-table
v-if=
"refreshTable"
v-loading=
"loading"
:data=
"${businessName}List"
row-key=
"${treeCode}"
default-expand-all
:default-expand-all=
"isExpandAll"
:tree-props=
"{children: 'children', hasChildren: 'hasChildren'}"
>
#foreach($column in $columns)
...
...
@@ -283,6 +292,8 @@ const open = ref(false);
const
loading
=
ref
(
true
);
const
showSearch
=
ref
(
true
);
const
title
=
ref
(
""
);
const
isExpandAll
=
ref
(
true
);
const
refreshTable
=
ref
(
true
);
#
foreach
(
$column
in
$columns
)
#
if
(
$column
.
htmlType
==
"
datetime
"
&&
$column
.
queryType
==
"
BETWEEN
"
)
#
set
(
$AttrName
=
$column
.
javaField
.
substring
(
0
,
1
).
toUpperCase
()
+
$
{
column
.
javaField
.
substring
(
1
)})
...
...
@@ -405,6 +416,15 @@ async function handleAdd(row) {
title
.
value
=
"
添加${functionName}
"
;
}
/** 展开/折叠操作 */
function
toggleExpandAll
()
{
refreshTable
.
value
=
false
;
isExpandAll
.
value
=
!
isExpandAll
.
value
;
nextTick
(()
=>
{
refreshTable
.
value
=
true
;
});
}
/** 修改按钮操作 */
async
function
handleUpdate
(
row
)
{
reset
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment