From 34a6f2e1f12786d2da4e2db1edd92163e7e5be62 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: Wed, 01 Sep 2021 14:03:59 +0800
Subject: [PATCH] 查询列表设置数据字典样式回显
---
ruoyi-ui/src/views/system/menu/index.vue | 36 +++++++++++++-----------------------
1 files changed, 13 insertions(+), 23 deletions(-)
diff --git a/ruoyi-ui/src/views/system/menu/index.vue b/ruoyi-ui/src/views/system/menu/index.vue
index b0ea59a..8055969 100644
--- a/ruoyi-ui/src/views/system/menu/index.vue
+++ b/ruoyi-ui/src/views/system/menu/index.vue
@@ -55,7 +55,11 @@
<el-table-column prop="orderNum" label="排序" width="60"></el-table-column>
<el-table-column prop="perms" label="权限标识" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="component" label="组件路径" :show-overflow-tooltip="true"></el-table-column>
- <el-table-column prop="status" label="状态" :formatter="statusFormat" width="80"></el-table-column>
+ <el-table-column prop="status" label="状态" width="80">
+ <template slot-scope="scope">
+ <dict-tag :options="statusOptions" :value="scope.row.status"/>
+ </template>
+ </el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
@@ -63,16 +67,16 @@
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
- <el-button size="mini"
- type="text"
- icon="el-icon-edit"
+ <el-button size="mini"
+ type="text"
+ icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:menu:edit']"
>修改</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-plus"
+ <el-button
+ size="mini"
+ type="text"
+ icon="el-icon-plus"
@click="handleAdd(scope.row)"
v-hasPermi="['system:menu:add']"
>新增</el-button>
@@ -338,20 +342,6 @@
this.menuOptions.push(menu);
});
},
- // 显示状态字典翻译
- visibleFormat(row, column) {
- if (row.menuType == "F") {
- return "";
- }
- return this.selectDictLabel(this.visibleOptions, row.visible);
- },
- // 菜单状态字典翻译
- statusFormat(row, column) {
- if (row.menuType == "F") {
- return "";
- }
- return this.selectDictLabel(this.statusOptions, row.status);
- },
// 取消按钮
cancel() {
this.open = false;
@@ -439,4 +429,4 @@
}
}
};
-</script>
\ No newline at end of file
+</script>
--
Gitblit v1.9.3