From 7dc33c9247dfd585195016513ced1a3e98e96df2 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子Li <15040126243@163.com>
Date: 星期一, 27 六月 2022 11:03:27 +0800
Subject: [PATCH] update springboot 2.6.8 => 2.6.9 update easyexcel 3.1.0 => 3.1.1 update hutool 5.8.2 => 5.8.3 update redisson 3.17.2 => 3.17.4 update aws-java-sdk-s3 1.12.215 => 1.12.248 update tencentcloud-sdk-java 3.1.500 => 3.1.537
---
ruoyi-ui/src/views/system/post/index.vue | 71 ++++++++++++-----------------------
1 files changed, 24 insertions(+), 47 deletions(-)
diff --git a/ruoyi-ui/src/views/system/post/index.vue b/ruoyi-ui/src/views/system/post/index.vue
index 2784756..444bf63 100644
--- a/ruoyi-ui/src/views/system/post/index.vue
+++ b/ruoyi-ui/src/views/system/post/index.vue
@@ -1,12 +1,11 @@
<template>
<div class="app-container">
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="宀椾綅缂栫爜" prop="postCode">
<el-input
v-model="queryParams.postCode"
placeholder="璇疯緭鍏ュ矖浣嶇紪鐮�"
clearable
- size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
@@ -15,17 +14,16 @@
v-model="queryParams.postName"
placeholder="璇疯緭鍏ュ矖浣嶅悕绉�"
clearable
- size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="鐘舵��" prop="status">
- <el-select v-model="queryParams.status" placeholder="宀椾綅鐘舵��" clearable size="small">
+ <el-select v-model="queryParams.status" placeholder="宀椾綅鐘舵��" clearable>
<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>
@@ -74,7 +72,6 @@
plain
icon="el-icon-download"
size="mini"
- :loading="exportLoading"
@click="handleExport"
v-hasPermi="['system:post:export']"
>瀵煎嚭</el-button>
@@ -90,7 +87,7 @@
<el-table-column label="宀椾綅鎺掑簭" align="center" prop="postSort" />
<el-table-column label="鐘舵��" align="center" prop="status">
<template slot-scope="scope">
- <dict-tag :options="statusOptions" :value="scope.row.status"/>
+ <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">
@@ -141,10 +138,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">
@@ -160,16 +157,15 @@
</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 {
// 閬僵灞�
loading: true,
- // 瀵煎嚭閬僵灞�
- exportLoading: false,
// 閫変腑鏁扮粍
ids: [],
// 闈炲崟涓鐢�
@@ -186,13 +182,10 @@
title: "",
// 鏄惁鏄剧ず寮瑰嚭灞�
open: false,
- // 鐘舵�佹暟鎹瓧鍏�
- statusOptions: [],
// 鏌ヨ鍙傛暟
queryParams: {
pageNum: 1,
pageSize: 10,
- reasonable: true,
postCode: undefined,
postName: undefined,
status: undefined
@@ -215,9 +208,6 @@
},
created() {
this.getList();
- this.getDicts("sys_normal_disable").then(response => {
- this.statusOptions = response.data;
- });
},
methods: {
/** 鏌ヨ宀椾綅鍒楄〃 */
@@ -284,13 +274,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();
});
@@ -301,31 +291,18 @@
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
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("鍒犻櫎鎴愬姛");
- }).catch(() => {});
+ 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;
- }).catch(() => {});
+ this.download('system/post/export', {
+ ...this.queryParams
+ }, `post_${new Date().getTime()}.xlsx`)
}
}
};
--
Gitblit v1.9.3