From 3dbbc6a22360fa65c66609285f10bffc3a32334d Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期五, 22 十月 2021 16:23:08 +0800
Subject: [PATCH] AjaxResult重写put方法,以方便链式调用
---
ruoyi-ui/src/views/monitor/logininfor/index.vue | 67 ++++++++++++---------------------
1 files changed, 25 insertions(+), 42 deletions(-)
diff --git a/ruoyi-ui/src/views/monitor/logininfor/index.vue b/ruoyi-ui/src/views/monitor/logininfor/index.vue
index 14921e5..6341419 100644
--- a/ruoyi-ui/src/views/monitor/logininfor/index.vue
+++ b/ruoyi-ui/src/views/monitor/logininfor/index.vue
@@ -30,10 +30,10 @@
style="width: 240px"
>
<el-option
- v-for="dict in statusOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
+ v-for="dict in dict.type.sys_common_status"
+ :key="dict.value"
+ :label="dict.label"
+ :value="dict.value"
/>
</el-select>
</el-form-item>
@@ -101,7 +101,7 @@
<el-table-column label="鎿嶄綔绯荤粺" align="center" prop="os" />
<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_common_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="鎿嶄綔淇℃伅" align="center" prop="msg" />
@@ -127,6 +127,7 @@
export default {
name: "Logininfor",
+ dicts: ['sys_common_status'],
data() {
return {
// 閬僵灞�
@@ -143,8 +144,6 @@
total: 0,
// 琛ㄦ牸鏁版嵁
list: [],
- // 鐘舵�佹暟鎹瓧鍏�
- statusOptions: [],
// 鏃ユ湡鑼冨洿
dateRange: [],
// 榛樿鎺掑簭
@@ -153,7 +152,6 @@
queryParams: {
pageNum: 1,
pageSize: 10,
- reasonable: true,
ipaddr: undefined,
userName: undefined,
status: undefined
@@ -162,9 +160,6 @@
},
created() {
this.getList();
- this.getDicts("sys_common_status").then(response => {
- this.statusOptions = response.data;
- });
},
methods: {
/** 鏌ヨ鐧诲綍鏃ュ織鍒楄〃 */
@@ -203,44 +198,32 @@
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
handleDelete(row) {
const infoIds = row.infoId || this.ids;
- this.$confirm('鏄惁纭鍒犻櫎璁块棶缂栧彿涓�"' + infoIds + '"鐨勬暟鎹」?', "璀﹀憡", {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning"
- }).then(function() {
- return delLogininfor(infoIds);
- }).then(() => {
- this.getList();
- this.msgSuccess("鍒犻櫎鎴愬姛");
- }).catch(() => {});
+ this.$modal.confirm('鏄惁纭鍒犻櫎璁块棶缂栧彿涓�"' + infoIds + '"鐨勬暟鎹」锛�').then(function() {
+ return delLogininfor(infoIds);
+ }).then(() => {
+ this.getList();
+ this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ }).catch(() => {});
},
/** 娓呯┖鎸夐挳鎿嶄綔 */
handleClean() {
- this.$confirm('鏄惁纭娓呯┖鎵�鏈夌櫥褰曟棩蹇楁暟鎹」?', "璀﹀憡", {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning"
- }).then(function() {
- return cleanLogininfor();
- }).then(() => {
- this.getList();
- this.msgSuccess("娓呯┖鎴愬姛");
- }).catch(() => {});
+ this.$modal.confirm('鏄惁纭娓呯┖鎵�鏈夌櫥褰曟棩蹇楁暟鎹」锛�').then(function() {
+ return cleanLogininfor();
+ }).then(() => {
+ this.getList();
+ this.$modal.msgSuccess("娓呯┖鎴愬姛");
+ }).catch(() => {});
},
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
handleExport() {
const queryParams = this.queryParams;
- this.$confirm('鏄惁纭瀵煎嚭鎵�鏈夋搷浣滄棩蹇楁暟鎹」?', "璀﹀憡", {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning"
- }).then(() => {
- this.exportLoading = true;
- return exportLogininfor(queryParams);
- }).then(response => {
- this.download(response.msg);
- this.exportLoading = false;
- }).catch(() => {});
+ this.$modal.confirm('鏄惁纭瀵煎嚭鎵�鏈夋搷浣滄棩蹇楁暟鎹」锛�').then(() => {
+ this.exportLoading = true;
+ return exportLogininfor(queryParams);
+ }).then(response => {
+ this.$download.name(response.msg);
+ this.exportLoading = false;
+ }).catch(() => {});
}
}
};
--
Gitblit v1.9.3