fix: 部门新增不显示问题

This commit is contained in:
lbw 2023-03-08 15:08:24 +08:00
parent ade034e96d
commit 18c0941817
2 changed files with 105 additions and 115 deletions

View File

@ -124,7 +124,7 @@ const getDeptData = async () => {
depttree().then((res) => {
parentData.value = [];
const dept = {
id: '-1',
id: '0',
name: '根部门',
children: [] as any[],
};

View File

@ -4,15 +4,13 @@
<div class="mb15">
<el-form :inline="true" :model="state.queryForm" @keyup.enter="getDataList" ref="queryRef">
<el-form-item :label="$t('sysmenu.name')" prop="menuName">
<el-input :placeholder="$t('sysmenu.inputNameTip')" clearable style="max-width: 180px"
v-model="state.queryForm.menuName"/>
<el-input :placeholder="$t('sysmenu.inputNameTip')" clearable style="max-width: 180px" v-model="state.queryForm.menuName" />
</el-form-item>
<el-form-item>
<el-button @click="getDataList" class="ml10" icon="search" type="primary">
{{ $t('common.queryBtn') }}
</el-button>
<el-button @click="onOpenAddMenu" class="ml10" icon="folder-add" type="primary"
v-auth="'sys_menu_add'">
<el-button @click="onOpenAddMenu" class="ml10" icon="folder-add" type="primary" v-auth="'sys_menu_add'">
{{ $t('common.addBtn') }}
</el-button>
</el-form-item>
@ -21,15 +19,13 @@
<el-table
:data="state.dataList"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
border
max-height="450"
row-key="path"
style="width: 100%"
v-loading="state.loading"
>
<el-table-column :label="$t('sysmenu.name')" fixed prop="name" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('sysmenu.sortOrder')" prop="sortOrder"
show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('sysmenu.sortOrder')" prop="sortOrder" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('sysmenu.icon')" prop="icon" show-overflow-tooltip>
<template #default="scope">
<SvgIcon :name="scope.row.icon" />
@ -49,23 +45,17 @@
<el-tag type="success" v-if="scope.row.keepAlive === '1'">开启</el-tag>
</template>
</el-table-column>
<el-table-column :label="$t('sysmenu.permission')" :show-overflow-tooltip="true"
prop="permission"></el-table-column>
<el-table-column :label="$t('sysmenu.permission')" :show-overflow-tooltip="true" prop="permission"></el-table-column>
<el-table-column :label="$t('common.action')" show-overflow-tooltip width="200">
<template #default="scope">
<el-button @click="onOpenAddMenu('add', scope.row)" text type="primary" v-auth="'sys_menu_add'">
{{ $t('common.addBtn') }}
</el-button>
<el-button @click="onOpenEditMenu('edit', scope.row)" text type="primary"
v-auth="'sys_menu_edit'">{{ $t('common.editBtn') }}
</el-button>
<el-button @click="onOpenEditMenu('edit', scope.row)" text type="primary" v-auth="'sys_menu_edit'">{{ $t('common.editBtn') }} </el-button>
<el-tooltip :content="$t('sysmenu.deleteDisabledTip')"
:disabled="!deleteMenuDisabled(scope.row)" placement="top">
<el-tooltip :content="$t('sysmenu.deleteDisabledTip')" :disabled="!deleteMenuDisabled(scope.row)" placement="top">
<span style="margin-left: 12px">
<el-button :disabled="deleteMenuDisabled(scope.row)" @click="onTabelRowDel(scope.row)"
text
type="primary" v-auth="'sys_menu_del'">
<el-button :disabled="deleteMenuDisabled(scope.row)" @click="onTabelRowDel(scope.row)" text type="primary" v-auth="'sys_menu_del'">
{{ $t('common.delBtn') }}
</el-button>
</span>