代码 修改

This commit is contained in:
2022-12-07 11:23:45 +08:00
parent 298df5d2df
commit f4199191b6
4 changed files with 33 additions and 8 deletions

View File

@@ -137,8 +137,12 @@
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55" />
<el-table-column label="菜单标题" prop="title" :min-width="flexWidth('title',crud.data,'菜单标题')" />
<el-table-column label="子系统" prop="system_type" :min-width="flexWidth('system_type',crud.data,'子系统')" />
<el-table-column label="菜单标题" prop="title" :min-width="100" />
<el-table-column label="子系统" prop="system_type" :min-width="flexWidth('system_type',crud.data,'子系统')" >
<template slot-scope="scope">
{{ dict.label.system_type[scope.row.system_type] }}
</template>
</el-table-column>
<el-table-column prop="icon" label="图标" align="center" :min-width="flexWidth('icon',crud.data,'图标')">
<template slot-scope="scope">
<svg-icon :icon-class="scope.row.icon ? scope.row.icon : ''" />
@@ -151,11 +155,25 @@
</el-table-column>
<el-table-column prop="permission" label="权限标识" :min-width="flexWidth('permission',crud.data,'权限标识')" />
<el-table-column prop="component" label="组件路径" min-width="120" />
<el-table-column prop="i_frame" label="外链" :formatter="crud.formatIsOrNot" :min-width="flexWidth('i_frame',crud.data,'外链')" />
<el-table-column prop="cache" label="缓存" :formatter="crud.formatIsOrNot" :min-width="flexWidth('cache',crud.data,'缓存')" />
<el-table-column prop="hidden" label="可见" :formatter="crud.formatIsOrNot" :min-width="flexWidth('hidden',crud.data,'可见')" />
<el-table-column prop="createTime" label="创建日期" :min-width="flexWidth('createTime',crud.data,'创建日期')" />
<el-table-column prop="i_frame" label="外链" :formatter="crud.formatIsOrNot" :min-width="flexWidth('i_frame',crud.data,'外链')" >
<template slot-scope="scope">
<span v-if="scope.row.i_frame">是</span>
<span v-else>否</span>
</template>
</el-table-column>
<el-table-column prop="cache" label="缓存" :formatter="crud.formatIsOrNot" :min-width="flexWidth('cache',crud.data,'缓存')" >
<template slot-scope="scope">
<span v-if="scope.row.cache">是</span>
<span v-else>否</span>
</template>
</el-table-column>
<el-table-column prop="hidden" label="可见" :formatter="crud.formatIsOrNot" :min-width="flexWidth('hidden',crud.data,'可见')" >
<template slot-scope="scope">
<span v-if="scope.row.hidden">否</span>
<span v-else>是</span>
</template>
</el-table-column>
<el-table-column prop="create_time" label="创建日期" :min-width="flexWidth('create_time',crud.data,'创建日期')" />
<el-table-column
v-permission="['admin','menu:edit','menu:del']"
label="操作"
@@ -213,6 +231,7 @@ export default {
return CRUD({ title: '菜单', idField: 'menu_id', url: 'api/menus', crudMethod: { ...crudMenu }})
},
mixins: [presenter(), header(), form(defaultForm), crud()],
dicts: ['system_type'],
data() {
return {
menus: [],
@@ -241,6 +260,7 @@ export default {
methods: {
// 新增与编辑前做的操作
[CRUD.HOOK.afterToCU](crud, form) {
console.log(this.dict)
this.menus = []
if (form.menu_id) { // 修改
if (!form.pid) { // 一级菜单一级的父级菜单的pid为0.