From 13909c99e368788a94a48753dc9f76e40a992cd6 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期一, 29 七月 2024 15:21:06 +0800
Subject: [PATCH] #
---
zy-asrs-admin/src/views/system/userLogin/index.vue | 103 +++++++++++++++++++++++++--------------------------
1 files changed, 50 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..885edfc 100644
--- a/zy-asrs-admin/src/views/system/userLogin/index.vue
+++ b/zy-asrs-admin/src/views/system/userLogin/index.vue
@@ -6,9 +6,11 @@
import { logout } from '@/config.js';
import EditView from './edit.vue'
import { formatMessage } from '@/utils/localeUtils.js';
+import useTableSearch from '@/utils/tableUtils.jsx';
const context = getCurrentInstance()?.appContext.config.globalProperties;
const router = useRouter();
+
const TABLE_KEY = 'table-userLogin';
let currentPage = 1;
let pageSize = 10;
@@ -18,72 +20,61 @@
let tableData = ref([]);
getPage();
+const {
+ getColumnSearchProps,
+} = useTableSearch();
+
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,
+ ...getColumnSearchProps('userId$'),
},
{
- title: '瀵嗛挜',
- name: 'token',
+ title: formatMessage('db.sys_user_login.token', '瀵嗛挜'),
dataIndex: 'token',
- key: 'token',
+ width: 140,
ellipsis: true,
+ ...getColumnSearchProps('token'),
},
{
- title: '鐧诲綍ip',
- name: 'ip',
+ title: formatMessage('db.sys_user_login.ip', '鐧诲綍ip'),
dataIndex: 'ip',
- key: 'ip',
+ width: 140,
+ ...getColumnSearchProps('ip'),
},
{
- 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,
+ ...getColumnSearchProps('type$'),
},
{
- title: '娣诲姞鏃堕棿',
- name: 'createTime$',
+ title: formatMessage('db.sys_user_login.create_time', '娣诲姞鏃堕棿'),
dataIndex: 'createTime$',
- key: 'createTime$',
+ width: 140,
+ ...getColumnSearchProps('createTime$'),
},
{
- title: '澶囨敞',
- name: 'memo',
+ title: formatMessage('db.sys_user_login.system', '鐧诲綍绯荤粺'),
+ dataIndex: 'system',
+ width: 140,
+ ...getColumnSearchProps('system'),
+ },
+ {
+ title: formatMessage('db.sys_user_login.memo', '澶囨敞'),
dataIndex: 'memo',
- key: 'memo',
+ width: 140,
+ ...getColumnSearchProps('memo'),
},
+
{
- title: '鎿嶄綔',
+ title: formatMessage('common.operation', '鎿嶄綔'),
name: 'oper',
dataIndex: 'oper',
key: 'oper',
+ width: 140,
},
];
@@ -136,15 +127,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 +205,4 @@
</div>
</template>
-<style></style>
\ No newline at end of file
+<style></style>
--
Gitblit v1.9.1