From c1c4fb2ca4a2ab1f560362b484e23ce19a8b073a Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期四, 21 十月 2021 18:10:45 +0800
Subject: [PATCH] update hutool 5.7.13 => 5.7.14 update qcloud.cos 5.6.55 => 5.6.58 update minio 8.3.0 => 8.3.1
---
ruoyi-ui/src/views/system/post/index.vue | 67 ++++++++++++---------------------
1 files changed, 24 insertions(+), 43 deletions(-)
diff --git a/ruoyi-ui/src/views/system/post/index.vue b/ruoyi-ui/src/views/system/post/index.vue
index 2b116e6..8f823f3 100644
--- a/ruoyi-ui/src/views/system/post/index.vue
+++ b/ruoyi-ui/src/views/system/post/index.vue
@@ -22,10 +22,10 @@
<el-form-item label="鐘舵��" prop="status">
<el-select v-model="queryParams.status" placeholder="宀椾綅鐘舵��" clearable size="small">
<el-option
- v-for="dict in statusOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
+ v-for="dict in dict.type.sys_normal_disable"
+ :key="dict.value"
+ :label="dict.label"
+ :value="dict.value"
/>
</el-select>
</el-form-item>
@@ -88,7 +88,11 @@
<el-table-column label="宀椾綅缂栫爜" align="center" prop="postCode" />
<el-table-column label="宀椾綅鍚嶇О" align="center" prop="postName" />
<el-table-column label="宀椾綅鎺掑簭" align="center" prop="postSort" />
- <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="dict.type.sys_normal_disable" :value="scope.row.status"/>
+ </template>
+ </el-table-column>
<el-table-column label="鍒涘缓鏃堕棿" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
@@ -137,10 +141,10 @@
<el-form-item label="宀椾綅鐘舵��" prop="status">
<el-radio-group v-model="form.status">
<el-radio
- v-for="dict in statusOptions"
- :key="dict.dictValue"
- :label="dict.dictValue"
- >{{dict.dictLabel}}</el-radio>
+ v-for="dict in dict.type.sys_normal_disable"
+ :key="dict.value"
+ :label="dict.value"
+ >{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="澶囨敞" prop="remark">
@@ -156,10 +160,11 @@
</template>
<script>
-import { listPost, getPost, delPost, addPost, updatePost, exportPost } from "@/api/system/post";
+import { listPost, getPost, delPost, addPost, updatePost } from "@/api/system/post";
export default {
name: "Post",
+ dicts: ['sys_normal_disable'],
data() {
return {
// 閬僵灞�
@@ -182,8 +187,6 @@
title: "",
// 鏄惁鏄剧ず寮瑰嚭灞�
open: false,
- // 鐘舵�佹暟鎹瓧鍏�
- statusOptions: [],
// 鏌ヨ鍙傛暟
queryParams: {
pageNum: 1,
@@ -210,9 +213,6 @@
},
created() {
this.getList();
- this.getDicts("sys_normal_disable").then(response => {
- this.statusOptions = response.data;
- });
},
methods: {
/** 鏌ヨ宀椾綅鍒楄〃 */
@@ -223,10 +223,6 @@
this.total = response.total;
this.loading = false;
});
- },
- // 宀椾綅鐘舵�佸瓧鍏哥炕璇�
- statusFormat(row, column) {
- return this.selectDictLabel(this.statusOptions, row.status);
},
// 鍙栨秷鎸夐挳
cancel() {
@@ -283,13 +279,13 @@
if (valid) {
if (this.form.postId != undefined) {
updatePost(this.form).then(response => {
- this.msgSuccess("淇敼鎴愬姛");
+ this.$modal.msgSuccess("淇敼鎴愬姛");
this.open = false;
this.getList();
});
} else {
addPost(this.form).then(response => {
- this.msgSuccess("鏂板鎴愬姛");
+ this.$modal.msgSuccess("鏂板鎴愬姛");
this.open = false;
this.getList();
});
@@ -300,31 +296,16 @@
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
handleDelete(row) {
const postIds = row.postId || this.ids;
- this.$confirm('鏄惁纭鍒犻櫎宀椾綅缂栧彿涓�"' + postIds + '"鐨勬暟鎹」?', "璀﹀憡", {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning"
- }).then(function() {
- return delPost(postIds);
- }).then(() => {
- this.getList();
- this.msgSuccess("鍒犻櫎鎴愬姛");
- })
+ this.$modal.confirm('鏄惁纭鍒犻櫎宀椾綅缂栧彿涓�"' + postIds + '"鐨勬暟鎹」锛�').then(function() {
+ return delPost(postIds);
+ }).then(() => {
+ this.getList();
+ this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ }).catch(() => {});
},
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
handleExport() {
- const queryParams = this.queryParams;
- this.$confirm('鏄惁纭瀵煎嚭鎵�鏈夊矖浣嶆暟鎹」?', "璀﹀憡", {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning"
- }).then(() => {
- this.exportLoading = true;
- return exportPost(queryParams);
- }).then(response => {
- this.download(response.msg);
- this.exportLoading = false;
- })
+ this.$download.excel('/system/post/export', this.queryParams);
}
}
};
--
Gitblit v1.9.3