增加访问记录

main
zsk 2 years ago
parent 597c16793c
commit 2216da1ff9

@ -27,4 +27,12 @@ export function infoApi () {
url: "/admin/index/info", url: "/admin/index/info",
method: "get", method: "get",
}); });
}
// 登录日志
export function getLoginLogApi (data) {
return request({
url: `/admin/user/login/log/${data.page}/${data.limit}`,
method: "get",
});
} }

@ -28,7 +28,7 @@
import { createFromIconfontCN } from "@ant-design/icons-vue"; import { createFromIconfontCN } from "@ant-design/icons-vue";
// import { menuApi } from "../api/menu"; // import { menuApi } from "../api/menu";
import { h, reactive, onMounted, ref, watch } from "vue"; import { h, reactive, onMounted, ref, watch } from "vue";
import { TagsOutlined, HomeOutlined, ShoppingOutlined,MessageOutlined,FileProtectOutlined, UserOutlined,UsergroupAddOutlined, ApartmentOutlined, TeamOutlined, ContainerOutlined, AccountBookOutlined, BarChartOutlined, MailOutlined, SettingOutlined, AuditOutlined, SketchOutlined, MenuUnfoldOutlined, MenuFoldOutlined, SolutionOutlined } from "@ant-design/icons-vue"; import { TagsOutlined, HomeOutlined, ShoppingOutlined,MessageOutlined,FileProtectOutlined, VideoCameraOutlined,UserOutlined,UsergroupAddOutlined, ApartmentOutlined, TeamOutlined, ContainerOutlined, AccountBookOutlined, BarChartOutlined, MailOutlined, SettingOutlined, AuditOutlined, SketchOutlined, MenuUnfoldOutlined, MenuFoldOutlined, SolutionOutlined } from "@ant-design/icons-vue";
import { useStore } from "../stores/counter.ts"; import { useStore } from "../stores/counter.ts";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
import { mockMenuList } from "../utils/mock.js"; import { mockMenuList } from "../utils/mock.js";
@ -122,6 +122,9 @@ onMounted(() => {
case "message": case "message":
items.push(getItem(item.title, item.id, item.component, () => h(MessageOutlined))); items.push(getItem(item.title, item.id, item.component, () => h(MessageOutlined)));
break; break;
case "record":
items.push(getItem(item.title, item.id, item.component, () => h(VideoCameraOutlined)));
break;
case "ServiceMarket": case "ServiceMarket":
items.push(getItem(item.title, item.id, item.component, () => h(SketchOutlined))); items.push(getItem(item.title, item.id, item.component, () => h(SketchOutlined)));
break; break;

@ -55,6 +55,13 @@ const router = createRouter({
title: '消息通知', title: '消息通知',
}, },
component: () => import("../views/message/index.vue") component: () => import("../views/message/index.vue")
},{
path: "/merchantManagement/record",
name: "record",
meta: {
title: '访问记录',
},
component: () => import("../views/homePage/record.vue")
} }
].concat(noticeData) ].concat(noticeData)
}, },

@ -109,6 +109,33 @@ export let mockMenuList = {
"importTag": 0, "importTag": 0,
"exportTag": 0, "exportTag": 0,
"childrenList": [] "childrenList": []
},
{
"id": 5,
"creator": "",
"updator": "",
"createTime": "",
"updateTime": "",
"deleted": 0,
"title": "访问记录",
"menuName": "record",
"parentName": "",
"path": "record",
"component": "/merchantManagement/record.vue",
"visible": 0,
"perms": "",
"icon": "icon-houtaishouye",
"remark": "",
"parentId": "",
"tagNames": "queryTag,addTag,updateTag,deleteTag",
"idx": 10,
"queryTag": 0,
"addTag": 0,
"deleteTag": 0,
"updateTag": 0,
"importTag": 0,
"exportTag": 0,
"childrenList": []
} }
], ],

@ -480,7 +480,7 @@ const columns = ref([
width: "240px", width: "240px",
ellipsis: true, ellipsis: true,
customRender: (record) => { customRender: (record) => {
return record.record.percent+"%"; return record.record.percent ? record.record.percent+"%" : '-';
}, },
}, },

@ -0,0 +1,157 @@
<template>
<!--我的职位-->
<div class="p-manage-myJob">
<div class="m-select g_flex_row_between">
<!-- <div class="g_flex_row_start">
<div class="g_w_320 g-search-btn g_mr_16">
<a-input-search v-model:value="tableData.keyword" placeholder="请输入姓名" @search="searchList" @change="handleChangeSearch" allowClear />
</div>
</div> -->
<div>
<!-- <a-button type="primary" @click="openAdd" :icon="h(PlusOutlined)">新增用户</a-button> -->
<!-- <a-button type="" class="g_border_d g_ml_16" @click="handleToForm('add', { id: 0 })" :icon="h(DownloadOutlined)">导出模版</a-button> -->
<!--
<a-dropdown :trigger="['click']">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="goShareList"></a-menu-item>
<a-menu-item key="2" @click="handleToForm('add',{id:0})"></a-menu-item>
</a-menu>
</template>
<a-button>
新增职位
<DownOutlined style="zoom:.8" />
</a-button>
</a-dropdown> -->
</div>
</div>
<div class="m-table g_mt_20 antd-table">
<a-table sticky :columns="columns" :scroll="{x:1000}" :data-source="tableData.records" size="middle" :pagination="false" :loading="tableData.loading" class="g_clear_scroll" style="max-width: calc(100% - 0px)">
<template #bodyCell="{ column, record }">
</template>
</a-table>
<div class="g_pb_16 g_pt_16 g_pageBottom" v-if="tableData.records.length > 0">
<a-pagination v-model:current="tableData.page" v-model:page-size="tableData.size" :total="tableData.total" :pageSize="tableData.size" :show-total="(total) => `${total}`" @change="handleModalPage" @showSizeChange="handleModalSize" :show-quick-jumper="tableData.total < tableData.size ? false : true" :showSizeChanger="tableData.total < tableData.size ? false : true" :hideOnSinglePage="false" />
</div>
</div>
</div>
</template>
<script setup>
import request from "../../utils/request"; //
import { ref, onMounted, getCurrentInstance, h, watch } from "vue";
import { PlusOutlined, EllipsisOutlined, UploadOutlined, DownOutlined } from "@ant-design/icons-vue";
import { Modal, message } from "ant-design-vue";
import { useRouter, useRoute } from "vue-router";
import {getLoginLogApi} from "../../api/login";
import { DownloadOutlined } from "@ant-design/icons-vue";
import idCardPanel from "../components/upload/image.vue";
/* #################### 初始化事件 #################### */
const router = useRouter(); //
const route = useRoute();
const commonJS = getCurrentInstance().appContext.app.config.globalProperties.G;
onMounted(() => {
getTable();
});
/* #################### 表格事件 #################### */
const tableData = ref({
keyword: "",
page: 1,
limit: 20,
total: 0,
count: 0,
loading: false,
records: [],
});
const getTable = () => {
console.log(tableData.value);
tableData.value.loading = true;
getLoginLogApi({ limit: tableData.value.limit, page: tableData.value.page}).then((res) => {
console.log(res);
tableData.value = { ...res.data, page: res.data.current, limit: res.data.size };
tableData.value.records.forEach((item, index) => {
item.rank = index + 1;
});
});
};
const columns = ref([
{
title: "序号",
key: "rank",
dataIndex: "rank",
width: "50px",
ellipsis: true,
},
{
title: "姓名",
key: "username",
width:"120px",
dataIndex: "username",
},
{
title: "电话",
key: "name",
width:"180px",
dataIndex: "name",
},
{
title: "登录时间",
key: "updateTime",
dataIndex: "updateTime",
ellipsis: true,
},
]);
/* #################### 分页器事件 #################### */
const handleModalPage = ($page, $size) => {
//
console.log($page);
console.log($size);
tableData.value.page = $page;
getTable();
};
const handleModalSize = ($page, $size) => {
// size
tableData.value.page = 1;
tableData.value.size = $size;
getTable();
};
</script>
<style lang="less">
.ant-table-cell:empty::before{
content: "-";
}
.p-manage-myJob {
position: relative;
min-height: calc(100vh - 213px);
width: 100%;
height: 100px;
.btn-active {
width: 40px;
height: 24px;
margin-left: 6.5px;
font-size: 12px;
color: #f6343e;
background-color: #fff3f3;
padding: 1px 3px;
zoom: 0.6;
margin-top: 8px;
text-align: center;
}
}
.ant-spin-blur .ant-empty {
opacity: 0;
}
</style>
Loading…
Cancel
Save