From 4e8c6fb7c0adfb8b625f5c3e5cd4811188d58849 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期日, 29 八月 2021 15:57:01 +0800
Subject: [PATCH] 修复字典组件值为整形不显示问题
---
ruoyi-ui/src/views/system/dict/index.vue | 44 +++++++++++++++++++++++++++-----------------
1 files changed, 27 insertions(+), 17 deletions(-)
diff --git a/ruoyi-ui/src/views/system/dict/index.vue b/ruoyi-ui/src/views/system/dict/index.vue
index c1de85a..20cf5ce 100644
--- a/ruoyi-ui/src/views/system/dict/index.vue
+++ b/ruoyi-ui/src/views/system/dict/index.vue
@@ -50,7 +50,7 @@
></el-date-picker>
</el-form-item>
<el-form-item>
- <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button>
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button>
</el-form-item>
</el-form>
@@ -59,6 +59,7 @@
<el-col :span="1.5">
<el-button
type="primary"
+ plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
@@ -68,6 +69,7 @@
<el-col :span="1.5">
<el-button
type="success"
+ plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@@ -78,6 +80,7 @@
<el-col :span="1.5">
<el-button
type="danger"
+ plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@@ -88,8 +91,10 @@
<el-col :span="1.5">
<el-button
type="warning"
+ plain
icon="el-icon-download"
size="mini"
+ :loading="exportLoading"
@click="handleExport"
v-hasPermi="['system:dict:export']"
>瀵煎嚭</el-button>
@@ -97,11 +102,12 @@
<el-col :span="1.5">
<el-button
type="danger"
+ plain
icon="el-icon-refresh"
size="mini"
- @click="handleClearCache"
+ @click="handleRefreshCache"
v-hasPermi="['system:dict:remove']"
- >娓呯悊缂撳瓨</el-button>
+ >鍒锋柊缂撳瓨</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@@ -112,12 +118,16 @@
<el-table-column label="瀛楀吀鍚嶇О" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="瀛楀吀绫诲瀷" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope">
- <router-link :to="'/dict/type/data/' + scope.row.dictId" class="link-type">
+ <router-link :to="'/system/dict-data/index/' + scope.row.dictId" class="link-type">
<span>{{ scope.row.dictType }}</span>
</router-link>
</template>
</el-table-column>
- <el-table-column label="鐘舵��" align="center" prop="status" :formatter="statusFormat" />
+ <el-table-column label="鐘舵��" align="center" prop="status">
+ <template slot-scope="scope">
+ <dict-tag :options="statusOptions" :value="scope.row.status"/>
+ </template>
+ </el-table-column>
<el-table-column label="澶囨敞" align="center" prop="remark" :show-overflow-tooltip="true" />
<el-table-column label="鍒涘缓鏃堕棿" align="center" prop="createTime" width="180">
<template slot-scope="scope">
@@ -183,7 +193,7 @@
</template>
<script>
-import { listType, getType, delType, addType, updateType, exportType, clearCache } from "@/api/system/dict/type";
+import { listType, getType, delType, addType, updateType, exportType, refreshCache } from "@/api/system/dict/type";
export default {
name: "Dict",
@@ -191,6 +201,8 @@
return {
// 閬僵灞�
loading: true,
+ // 瀵煎嚭閬僵灞�
+ exportLoading: false,
// 閫変腑鏁扮粍
ids: [],
// 闈炲崟涓鐢�
@@ -248,10 +260,6 @@
this.loading = false;
}
);
- },
- // 瀛楀吀鐘舵�佸瓧鍏哥炕璇�
- statusFormat(row, column) {
- return this.selectDictLabel(this.statusOptions, row.status);
},
// 鍙栨秷鎸夐挳
cancel() {
@@ -334,7 +342,7 @@
}).then(() => {
this.getList();
this.msgSuccess("鍒犻櫎鎴愬姛");
- })
+ }).catch(() => {});
},
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
handleExport() {
@@ -343,16 +351,18 @@
confirmButtonText: "纭畾",
cancelButtonText: "鍙栨秷",
type: "warning"
- }).then(function() {
+ }).then(() => {
+ this.exportLoading = true;
return exportType(queryParams);
}).then(response => {
this.download(response.msg);
- })
+ this.exportLoading = false;
+ }).catch(() => {});
},
- /** 娓呯悊缂撳瓨鎸夐挳鎿嶄綔 */
- handleClearCache() {
- clearCache().then(response => {
- this.msgSuccess("娓呯悊鎴愬姛");
+ /** 鍒锋柊缂撳瓨鎸夐挳鎿嶄綔 */
+ handleRefreshCache() {
+ refreshCache().then(() => {
+ this.msgSuccess("鍒锋柊鎴愬姛");
});
}
}
--
Gitblit v1.9.3