From 6f7b02372e1387dd1bbc2e23aef3bc240eb7b24c Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 7 Apr 2022 11:04:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E6=A0=91?= =?UTF-8?q?=E8=A1=A8=E6=96=B0=E5=A2=9E(=E5=B1=95=E5=BC=80/=E6=8A=98?= =?UTF-8?q?=E5=8F=A0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/vm/vue/index-tree.vue.vm | 24 ++++++++++++++++++- .../resources/vm/vue/v3/index-tree.vue.vm | 22 ++++++++++++++++- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm index a95916f4..9d29acee 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm +++ b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm @@ -78,14 +78,24 @@ v-hasPermi="['${moduleName}:${businessName}:add']" >新增 + + 展开/折叠 + #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(); diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index-tree.vue.vm b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index-tree.vue.vm index d57bbdf0..11bbe52e 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index-tree.vue.vm +++ b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index-tree.vue.vm @@ -76,14 +76,23 @@ v-hasPermi="['${moduleName}:${businessName}:add']" >新增 + + 展开/折叠 + #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(); -- GitLab