From cf3c6082e48c67461d36596eff6d3da6e54bf84f Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期五, 05 七月 2024 11:25:35 +0800
Subject: [PATCH] #

---
 zy-asrs-admin/src/views/system/userLogin/index.vue |   91 +++++++++++++++++++--------------------------
 1 files changed, 38 insertions(+), 53 deletions(-)

diff --git a/zy-asrs-admin/src/views/system/userLogin/index.vue b/zy-asrs-admin/src/views/system/userLogin/index.vue
index e151820..e0af397 100644
--- a/zy-asrs-admin/src/views/system/userLogin/index.vue
+++ b/zy-asrs-admin/src/views/system/userLogin/index.vue
@@ -9,6 +9,7 @@
 const context = getCurrentInstance()?.appContext.config.globalProperties;
 
 const router = useRouter();
+
 const TABLE_KEY = 'table-userLogin';
 let currentPage = 1;
 let pageSize = 10;
@@ -20,70 +21,48 @@
 
 const columns = [
   {
-    title: 'ID',
-    name: 'id',
-    dataIndex: 'id',
-    key: 'id',
-  },
-  {
-    title: '鐢ㄦ埛',
-    name: 'userId$',
+    title: formatMessage('db.sys_user_login.user_id', '鐢ㄦ埛'),
     dataIndex: 'userId$',
-    key: 'userId$',
+    width: 140,
   },
   {
-    title: '瀵嗛挜',
-    name: 'token',
+    title: formatMessage('db.sys_user_login.token', '瀵嗛挜'),
     dataIndex: 'token',
-    key: 'token',
+    width: 140,
     ellipsis: true,
   },
   {
-    title: '鐧诲綍ip',
-    name: 'ip',
+    title: formatMessage('db.sys_user_login.ip', '鐧诲綍ip'),
     dataIndex: 'ip',
-    key: 'ip',
+    width: 140,
   },
   {
-    title: '绫诲瀷',
-    name: 'type',
-    dataIndex: 'type',
-    key: 'type',
-    customRender: (column) => {
-      let typeMap = {
-        0: {
-          text: formatMessage('login.success', '鐧诲綍鎴愬姛'),
-        },
-        1: {
-          text: formatMessage('login.fail', '鐧诲綍澶辫触'),
-        },
-        2: {
-          text: formatMessage('login.logout', '閫�鍑虹櫥褰�'),
-        },
-        3: {
-          text: formatMessage('login.retoken', '缁token'),
-        },
-      };
-      return typeMap[column.value].text;
-    }
+    title: formatMessage('db.sys_user_login.type', '绫诲瀷'),
+    dataIndex: 'type$',
+    width: 140,
   },
   {
-    title: '娣诲姞鏃堕棿',
-    name: 'createTime$',
+    title: formatMessage('db.sys_user_login.create_time', '娣诲姞鏃堕棿'),
     dataIndex: 'createTime$',
-    key: 'createTime$',
+    width: 140,
   },
   {
-    title: '澶囨敞',
-    name: 'memo',
+    title: formatMessage('db.sys_user_login.system', '鐧诲綍绯荤粺'),
+    dataIndex: 'system',
+    width: 140,
+  },
+  {
+    title: formatMessage('db.sys_user_login.memo', '澶囨敞'),
     dataIndex: 'memo',
-    key: 'memo',
+    width: 140,
   },
+
   {
-    title: '鎿嶄綔',
+    title: formatMessage('common.operation', '鎿嶄綔'),
     name: 'oper',
     dataIndex: 'oper',
     key: 'oper',
+    width: 140,
   },
 ];
 
@@ -136,15 +115,21 @@
     content: formatMessage('page.delete.confirm', '纭畾鍒犻櫎璇ラ」鍚楋紵'),
     maskClosable: true,
     onOk: async () => {
-      post('/api/userLogin/remove/' + rows.map((row) => row.id).join(','), {}).then(resp => {
-        let result = resp.data;
-        if (result.code === 200) {
-          message.success(result.msg);
-        } else {
-          message.error(result.msg);
-        }
-        getPage()
-      })
+      const hide = message.loading(formatMessage('common.loading', '璇锋眰涓�'));
+      try {
+        post('/api/userLogin/remove/' + rows.map((row) => row.id).join(','), {}).then(resp => {
+          let result = resp.data;
+          if (result.code === 200) {
+            message.success(result.msg);
+          } else {
+            message.error(result.msg);
+          }
+          getPage()
+          hide()
+        })
+      } catch (error) {
+        message.error(formatMessage('common.fail', '璇锋眰澶辫触'));
+      }
     },
   });
 }
@@ -208,4 +193,4 @@
   </div>
 </template>
 
-<style></style>
\ No newline at end of file
+<style></style>

--
Gitblit v1.9.1