|
@@ -1,6 +1,7 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div>
|
|
<div>
|
|
|
<PlusPage
|
|
<PlusPage
|
|
|
|
|
+ v-if="refreshTable"
|
|
|
ref="plusPageInstance"
|
|
ref="plusPageInstance"
|
|
|
:columns="tableConfig"
|
|
:columns="tableConfig"
|
|
|
:request="getList"
|
|
:request="getList"
|
|
@@ -14,7 +15,8 @@
|
|
|
actionBar: { buttons, type: 'link', width: 140 },
|
|
actionBar: { buttons, type: 'link', width: 140 },
|
|
|
adaptive: { offsetBottom: 50 },
|
|
adaptive: { offsetBottom: 50 },
|
|
|
treeProps: { children: 'children' },
|
|
treeProps: { children: 'children' },
|
|
|
- rowKey: 'deptId'
|
|
|
|
|
|
|
+ rowKey: 'deptId',
|
|
|
|
|
+ defaultExpandAll: defaultExpandAll
|
|
|
}"
|
|
}"
|
|
|
:pagination="false"
|
|
:pagination="false"
|
|
|
>
|
|
>
|
|
@@ -23,6 +25,9 @@
|
|
|
<el-button size="default" type="success" @click="handleCreate">
|
|
<el-button size="default" type="success" @click="handleCreate">
|
|
|
新增
|
|
新增
|
|
|
</el-button>
|
|
</el-button>
|
|
|
|
|
+ <el-button size="default" type="default" @click="toggleExpandAll">
|
|
|
|
|
+ 展开/折叠
|
|
|
|
|
+ </el-button>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</template>
|
|
</template>
|
|
|
</PlusPage>
|
|
</PlusPage>
|
|
@@ -47,7 +52,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-import { computed, defineOptions, reactive, ref, toRefs } from "vue";
|
|
|
|
|
|
|
+import { computed, defineOptions, nextTick, reactive, ref, toRefs } from "vue";
|
|
|
import type { FormRules } from "element-plus";
|
|
import type { FormRules } from "element-plus";
|
|
|
import { ElMessage } from "element-plus";
|
|
import { ElMessage } from "element-plus";
|
|
|
import {
|
|
import {
|
|
@@ -71,13 +76,8 @@ defineOptions({
|
|
|
name: "Dept"
|
|
name: "Dept"
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-interface TableRow {
|
|
|
|
|
- id: number;
|
|
|
|
|
- name: string;
|
|
|
|
|
- status: string;
|
|
|
|
|
- tag: string;
|
|
|
|
|
- time: Date;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+const refreshTable = ref(true);
|
|
|
|
|
+const defaultExpandAll = ref(false);
|
|
|
|
|
|
|
|
// 菜单列表
|
|
// 菜单列表
|
|
|
const deptList = ref([]);
|
|
const deptList = ref([]);
|
|
@@ -127,9 +127,17 @@ const handleBeforeSearch = (values: any) => {
|
|
|
return cloneDeep(values);
|
|
return cloneDeep(values);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const toggleExpandAll = () => {
|
|
|
|
|
+ refreshTable.value = false;
|
|
|
|
|
+ defaultExpandAll.value = !defaultExpandAll.value;
|
|
|
|
|
+ nextTick(() => {
|
|
|
|
|
+ refreshTable.value = true;
|
|
|
|
|
+ });
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const dialogTitle = computed(() => (state.isCreate ? "新增" : "编辑"));
|
|
const dialogTitle = computed(() => (state.isCreate ? "新增" : "编辑"));
|
|
|
|
|
|
|
|
-const { buttons } = useTable<TableRow[]>();
|
|
|
|
|
|
|
+const { buttons } = useTable();
|
|
|
|
|
|
|
|
// 表格数据
|
|
// 表格数据
|
|
|
const tableConfig: PlusColumn[] = [
|
|
const tableConfig: PlusColumn[] = [
|