tree宽度修改

This commit is contained in:
仲么了
2024-01-29 15:42:45 +08:00
parent 9351307908
commit cea1f4863f
4 changed files with 26 additions and 19 deletions

View File

@@ -1,23 +1,22 @@
<template>
<div class="default-main" style="display: flex" :style="{ height: height }">
<div style="width: calc(100% - 280px)">
<div style="flex: 1; overflow: hidden">
<div class="custom-table-header">
<div style="flex: 1; font-weight: 700">角色列表</div>
<el-button :icon="Plus" type="primary" @click="addRole" class="ml10">新增</el-button>
</div>
<Table ref="tableRef" @currentChange="currentChange" />
</div>
<div style="height: 100%; flex: 1">
<Tree
v-if="menuListId"
ref="treeRef"
show-checkbox
:data="menuTree"
:checkStrictly="checkStrictly"
@check-change="checkChange"
></Tree>
<el-empty style="width: 100%; padding-top: 300px; box-sizing: border-box" description="请选择角色" v-else />
</div>
<Tree
v-if="menuListId"
ref="treeRef"
show-checkbox
width="350px"
:data="menuTree"
:checkStrictly="checkStrictly"
@check-change="checkChange"
></Tree>
<el-empty style="width: 350px; padding-top: 300px; box-sizing: border-box" description="请选择角色" v-else />
<PopupForm ref="popupRef"></PopupForm>
</div>
</template>
@@ -61,11 +60,11 @@ const tableStore = new TableStore({
render: 'tag',
custom: {
0: 'danger',
1: 'success',
1: 'success'
},
replaceValue: {
0: '注销',
1: '正常',
1: '正常'
}
},
{
@@ -150,7 +149,7 @@ const checkChange = (data: any) => {
timeout.value = setTimeout(() => {
updateRoleMenu({
id: menuListId.value,
idList: treeRef.value.treeRef.getCheckedNodes(false, true).map(node => node.id)
idList: treeRef.value.treeRef.getCheckedNodes(false, true).map((node: any) => node.id)
})
}, 1000)
}