Commit 84d1a5ba authored by 李鹏 's avatar 李鹏

日志管理接口联调

parent 53337b81
...@@ -949,18 +949,38 @@ export const menuData = { ...@@ -949,18 +949,38 @@ export const menuData = {
menuName: "用户行为审计", menuName: "用户行为审计",
dict_group_id: "64c156e0-bfff-4bfc-a63a-56effe130a25", dict_group_id: "64c156e0-bfff-4bfc-a63a-56effe130a25",
menuType: 1, menuType: 1,
path: "/system-admin/log/userAccount", path: "/system-admin/log/userBehavior",
parentPath: "/system-admin/log", parentPath: "/system-admin/log",
icon: "", icon: "",
menu_id: "185558e4-afc4-44b0-ba9e-12e11cad25ef", menu_id: "185558e4-afc4-44b0-ba9e-12e11cad25ef",
p_menu_id: "224f73fd-f095-40ff-b1dd-6d094cf59280", p_menu_id: "224f73fd-f095-40ff-b1dd-6d094cf59280",
source: "", source: "",
children: null, children: [
{
id: 778,
level: 5,
sort: 1,
menuName: "详情",
dict_group_id: "64c156e0-bfff-4bfc-a63a-56effe130a25",
menuType: 2,
path: "/system-admin/log/userBehavior/detail",
parentPath: "/system-admin/log/userBehavior",
icon: "",
menu_id: "a7f9bb86-f9b2-4bf6-a201-d7edb937f639",
p_menu_id: "185558e4-afc4-44b0-ba9e-12e11cad25ef",
source: "",
children: null,
system_type: "",
new_window: 0,
remark: "",
built_in: 0,
},
],
system_type: "", system_type: "",
new_window: 0, new_window: 0,
remark: "", remark: "",
built_in: 0, built_in: 0,
name: "system-admin-log-userAccount", name: "system-admin-log-userBehavior",
rowPath: ".3.4.1", rowPath: ".3.4.1",
}, },
{ {
...@@ -970,7 +990,7 @@ export const menuData = { ...@@ -970,7 +990,7 @@ export const menuData = {
menuName: "用户账户审计", menuName: "用户账户审计",
dict_group_id: "64c156e0-bfff-4bfc-a63a-56effe130a25", dict_group_id: "64c156e0-bfff-4bfc-a63a-56effe130a25",
menuType: 1, menuType: 1,
path: "/system-admin/log/userBehavior", path: "/system-admin/log/userAccount",
parentPath: "/system-admin/log", parentPath: "/system-admin/log",
icon: "", icon: "",
menu_id: "84f732d7-574b-4f66-9ef0-2aad4cdc353c", menu_id: "84f732d7-574b-4f66-9ef0-2aad4cdc353c",
...@@ -981,7 +1001,7 @@ export const menuData = { ...@@ -981,7 +1001,7 @@ export const menuData = {
new_window: 0, new_window: 0,
remark: "", remark: "",
built_in: 0, built_in: 0,
name: "system-admin-log-userBehavior", name: "system-admin-log-userAccount",
rowPath: ".3.4.2", rowPath: ".3.4.2",
}, },
], ],
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
style="width: 100%" style="width: 100%"
type="date" type="date"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
v-model="date" v-model="logTime"
placeholder="请选择日期" /> placeholder="请选择日期" />
<div class="type_station bg-scroll"> <div class="type_station bg-scroll">
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
@click="nodeClick(item)" @click="nodeClick(item)"
v-for="(item, index) in containerList" v-for="(item, index) in containerList"
:key="index" :key="index"
:title="item.name"> :title="item">
{{ item.name }} {{ item }}
</div> </div>
</div> </div>
</div> </div>
...@@ -28,10 +28,10 @@ ...@@ -28,10 +28,10 @@
<div class="form-filter"> <div class="form-filter">
<el-form :model="filterForm" inline> <el-form :model="filterForm" inline>
<el-form-item label="级别"> <el-form-item label="级别">
<el-select placeholder="全部" style="width: 160px" v-model="filterForm.level"> <el-select placeholder="全部" style="width: 160px" v-model="filterForm.logLevel">
<el-option label="info" value="info"> </el-option> <el-option label="INFO" value="INFO"> </el-option>
<el-option label="warning" value="warning"> </el-option> <el-option label="WARNING" value="WARNING"> </el-option>
<el-option label="error" value="error"> </el-option> <el-option label="ERROR" value="ERROR"> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="关键字"> <el-form-item label="关键字">
...@@ -63,37 +63,37 @@ import { ElMessage } from "element-plus"; ...@@ -63,37 +63,37 @@ import { ElMessage } from "element-plus";
import axios from "@/request/http.js"; import axios from "@/request/http.js";
import bgBreadcrumb from "@/components/bg-breadcrumb.vue"; import bgBreadcrumb from "@/components/bg-breadcrumb.vue";
const state = reactive({ const state = reactive({
date: "", logTime: "",
containerList: [], // 容器数据 containerList: [], // 容器数据
selectedNodeContainer: "", selectedNodeContainer: "",
filterForm: { filterForm: {
level: "", logLevel: "",
search: "", search: "",
}, },
logList: [], logList: [],
}); });
watch( watch(
() => state.date, () => state.logTime,
(val) => { (val) => {
state.selectedNodeContainer = ""; state.selectedNodeContainer = "";
getContainerList(); getContainerList();
} }
); );
const nodeClick = (item) => { const nodeClick = (item) => {
state.selectedNodeContainer = item.value; state.selectedNodeContainer = item;
reset(); reset();
}; };
// 获取容器列表 // 获取容器列表
const getContainerList = () => { const getContainerList = () => {
let params = { let params = {
date: state.date, logTime: state.logTime,
}; };
axios axios
.get("/apaas/system/v5/log/system/tree", { params }) .get("/v1/api/log/system/list", { params })
.then((res) => { .then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
state.containerList = res.data.data || []; state.containerList = res.data.data || [];
state.selectedNodeContainer = state.containerList.length ? state.containerList[0].value : ""; state.selectedNodeContainer = state.containerList.length ? state.containerList[0] : "";
state.selectedNodeContainer ? reset() : (state.logList = []); state.selectedNodeContainer ? reset() : (state.logList = []);
} else { } else {
ElMessage.error(res.data.data); ElMessage.error(res.data.data);
...@@ -106,11 +106,11 @@ const getContainerList = () => { ...@@ -106,11 +106,11 @@ const getContainerList = () => {
//查询 //查询
const search = () => { const search = () => {
let params = { let params = {
index: state.selectedNodeContainer, name: state.selectedNodeContainer,
...state.filterForm, ...state.filterForm,
}; };
axios axios
.get("/apaas/system/v5/log/system/log", { params }) .get("/v1/api/log/system/log", { params })
.then((res) => { .then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
state.logList = (res.data.data || []).map((item) => JSON.stringify(item)); state.logList = (res.data.data || []).map((item) => JSON.stringify(item));
...@@ -126,7 +126,7 @@ const search = () => { ...@@ -126,7 +126,7 @@ const search = () => {
//重置 //重置
const reset = () => { const reset = () => {
state.filterForm = { state.filterForm = {
level: "", logLevel: "",
search: "", search: "",
}; };
search(); search();
...@@ -135,7 +135,7 @@ onBeforeMount(() => { ...@@ -135,7 +135,7 @@ onBeforeMount(() => {
getContainerList(); getContainerList();
}); });
const { date, containerList, selectedNodeContainer, filterForm, logList } = toRefs(state); const { logTime, containerList, selectedNodeContainer, filterForm, logList } = toRefs(state);
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -2,16 +2,11 @@ ...@@ -2,16 +2,11 @@
<div class="page_container"> <div class="page_container">
<bg-breadcrumb></bg-breadcrumb> <bg-breadcrumb></bg-breadcrumb>
<div class="main_container"> <div class="main_container">
<bg-filter-group <bg-filter-group @search="changeSearch" v-model="filter.search" placeholder="请输入账号、手机号和所属组织">
@search="changeSearch"
v-model="filter.search"
placeholder="请输入账号、手机号和所属组织">
<template v-slot:left_action> <template v-slot:left_action>
<div class="apaas_button"> <div class="apaas_button">
<el-button type="primary" @click="exportFile"> <el-button type="primary" @click="exportFile">
<bg-icon <bg-icon style="font-size: 12px; color: #fff; margin-right: 8px" icon="#bg-ic-file-send"></bg-icon>
style="font-size: 12px; color: #fff; margin-right: 8px"
icon="#bg-ic-file-send"></bg-icon>
导出 导出
</el-button> </el-button>
<el-popconfirm <el-popconfirm
...@@ -36,17 +31,6 @@ ...@@ -36,17 +31,6 @@
<template v-slot:filter_group> <template v-slot:filter_group>
<div class="left-filter filter_list"> <div class="left-filter filter_list">
<div class="filter_item">
<span class="filter_title">用户类型</span>
<el-select v-model="filter.is_admin" placeholder="请选择" style="width: 300px">
<el-option
v-for="(item, index) in userTypeList"
:key="index"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
<div class="filter_item"> <div class="filter_item">
<span class="filter_title">上次访问时间</span> <span class="filter_title">上次访问时间</span>
<el-date-picker <el-date-picker
...@@ -61,22 +45,14 @@ ...@@ -61,22 +45,14 @@
<div class="filter_item"> <div class="filter_item">
<span class="filter_title">活跃度</span> <span class="filter_title">活跃度</span>
<el-select v-model="filter.active" placeholder="请选择" style="width: 300px"> <el-select v-model="filter.active" placeholder="请选择" style="width: 300px">
<el-option <el-option v-for="(item, index) in activeOptions" :key="index" :label="item.label" :value="item.value">
v-for="(item, index) in activeOptions"
:key="index"
:label="item.label"
:value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
<div class="filter_item"> <div class="filter_item">
<span class="filter_title">密码强度</span> <span class="filter_title">密码强度</span>
<el-select v-model="filter.pwd_level" placeholder="请选择" style="width: 300px"> <el-select v-model="filter.pwd_level" placeholder="请选择" style="width: 300px">
<el-option <el-option v-for="(item, index) in pwdLevelList" :key="index" :label="item.label" :value="item.value">
v-for="(item, index) in pwdLevelList"
:key="index"
:label="item.label"
:value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
...@@ -137,7 +113,7 @@ ...@@ -137,7 +113,7 @@
</bg-table> </bg-table>
<bg-pagination <bg-pagination
:page="filter.page" :page="filter.page"
:size="filter.limit" :size="filter.page_size"
:total="filter.total" :total="filter.total"
@change-page="changePage" @change-page="changePage"
@change-size="changeSize"> @change-size="changeSize">
...@@ -168,12 +144,11 @@ const accountTable = ref(null); ...@@ -168,12 +144,11 @@ const accountTable = ref(null);
const state = reactive({ const state = reactive({
filter: { filter: {
search: "", search: "",
is_admin: "",
time: [], time: [],
active: 0, active: 0,
pwd_level: "", pwd_level: "",
page: 1, page: 1,
limit: 10, page_size: 10,
total: 0, total: 0,
}, },
activeOptions: [ activeOptions: [
...@@ -200,11 +175,6 @@ const state = reactive({ ...@@ -200,11 +175,6 @@ const state = reactive({
prop: "contact_phone", prop: "contact_phone",
// minWidth: 360, // minWidth: 360,
}, },
{
label: "用户类型",
prop: "is_admin",
// width: 200,
},
{ {
label: "所属组织", label: "所属组织",
prop: "name", prop: "name",
...@@ -252,14 +222,13 @@ const exportFile = () => { ...@@ -252,14 +222,13 @@ const exportFile = () => {
params.end_at = params.time ? params.time[1] || "" : ""; params.end_at = params.time ? params.time[1] || "" : "";
delete params.time; delete params.time;
axios axios
.get(`/apaas/system/v5/log/userAccountAudit/list/export`, { .get(`/v1/api/log/userAccountAudit/list/export`, {
params, params,
responseType: "blob", responseType: "blob",
}) })
.then((res) => { .then((res) => {
if (res.status === 200) { if (res.status === 200) {
const type = const type = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8";
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8";
downloadBlob(res.data, type); downloadBlob(res.data, type);
} else { } else {
ElMessage.error(res.statusText); ElMessage.error(res.statusText);
...@@ -273,7 +242,7 @@ const forceModifyPwd = () => { ...@@ -273,7 +242,7 @@ const forceModifyPwd = () => {
const selectedRows = Object.values(selectedObj); const selectedRows = Object.values(selectedObj);
if (!selectedRows.length) return ElMessage.warning("请先选择修改项"); if (!selectedRows.length) return ElMessage.warning("请先选择修改项");
const ids = selectedRows.map((item) => item.id); const ids = selectedRows.map((item) => item.id);
axios.post("/apaas/system/v5/user/resetpwd", { ids }).then((res) => { axios.post("/v1/api/user/resetPwd", { ids }).then((res) => {
if (res.data.code === 200) { if (res.data.code === 200) {
ElMessage.success(res.data.msg); ElMessage.success(res.data.msg);
cleanSelected(); cleanSelected();
...@@ -301,7 +270,7 @@ const getTableRows = () => { ...@@ -301,7 +270,7 @@ const getTableRows = () => {
params.end_at = params.time ? params.time[1] || "" : ""; params.end_at = params.time ? params.time[1] || "" : "";
delete params.time; delete params.time;
axios axios
.get(`/apaas/system/v5/log/userAccountAudit/list`, { .get(`/v1/api/log/userAccountAudit/list`, {
params, params,
}) })
.then((res) => { .then((res) => {
...@@ -317,18 +286,17 @@ const filterAction = () => { ...@@ -317,18 +286,17 @@ const filterAction = () => {
changePage(1); changePage(1);
}; };
const changeSize = (size) => { const changeSize = (size) => {
state.filter.limit = size; state.filter.page_size = size;
changePage(1); changePage(1);
}; };
const filterClear = () => { const filterClear = () => {
state.filter = { state.filter = {
search: "", search: "",
is_admin: "",
time: [], time: [],
active: 0, active: 0,
pwd_level: "", pwd_level: "",
page: 1, page: 1,
limit: 10, page_size: 10,
total: 0, total: 0,
}; };
changePage(1); changePage(1);
......
...@@ -45,11 +45,6 @@ const instanceData = reactive({ ...@@ -45,11 +45,6 @@ const instanceData = reactive({
label: "手机号", label: "手机号",
value: "", value: "",
}, },
{
key: "user_type",
label: "用户类型",
value: "",
},
{ {
key: "org_name", key: "org_name",
label: "所属组织", label: "所属组织",
...@@ -121,7 +116,7 @@ onBeforeMount(() => { ...@@ -121,7 +116,7 @@ onBeforeMount(() => {
}); });
const getDetailInfo = () => { const getDetailInfo = () => {
axios axios
.get(`/apaas/system/v5/log/userBehavior/detail/${route.query.id}`) .get(`/v1/api/log/userBehavior/detail/${route.query.id}`)
.then((res) => { .then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
const result = res.data.data || {}; const result = res.data.data || {};
......
...@@ -2,16 +2,11 @@ ...@@ -2,16 +2,11 @@
<div class="page_container"> <div class="page_container">
<bg-breadcrumb></bg-breadcrumb> <bg-breadcrumb></bg-breadcrumb>
<div class="main_container"> <div class="main_container">
<bg-filter-group <bg-filter-group @search="changeSearch" v-model="filter.search" placeholder="请输入账号、手机号和所属组织">
@search="changeSearch"
v-model="filter.search"
placeholder="请输入账号、手机号和所属组织">
<template v-slot:left_action> <template v-slot:left_action>
<div class="apaas_button"> <div class="apaas_button">
<el-button type="primary" @click="exportFile"> <el-button type="primary" @click="exportFile">
<bg-icon <bg-icon style="font-size: 12px; color: #fff; margin-right: 8px" icon="#bg-ic-file-send"></bg-icon>
style="font-size: 12px; color: #fff; margin-right: 8px"
icon="#bg-ic-file-send"></bg-icon>
导出 导出
</el-button> </el-button>
<el-button @click="deleteBatch"> 批量删除 </el-button> <el-button @click="deleteBatch"> 批量删除 </el-button>
...@@ -25,17 +20,6 @@ ...@@ -25,17 +20,6 @@
<template v-slot:filter_group> <template v-slot:filter_group>
<div class="left-filter filter_list"> <div class="left-filter filter_list">
<div class="filter_item">
<span class="filter_title">用户类型</span>
<el-select v-model="filter.is_admin" placeholder="请选择" style="width: 300px">
<el-option
v-for="(item, index) in userTypeList"
:key="index"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
<div class="filter_item"> <div class="filter_item">
<span class="filter_title">操作时间</span> <span class="filter_title">操作时间</span>
<el-date-picker <el-date-picker
...@@ -61,11 +45,7 @@ ...@@ -61,11 +45,7 @@
<div class="filter_item"> <div class="filter_item">
<span class="filter_title">请求方式</span> <span class="filter_title">请求方式</span>
<el-select v-model="filter.req_method" placeholder="请选择" style="width: 300px"> <el-select v-model="filter.req_method" placeholder="请选择" style="width: 300px">
<el-option <el-option v-for="(item, index) in reqMethodList" :key="index" :label="item.label" :value="item.value">
v-for="(item, index) in reqMethodList"
:key="index"
:label="item.label"
:value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
...@@ -88,16 +68,7 @@ ...@@ -88,16 +68,7 @@
</template> </template>
</bg-filter-group> </bg-filter-group>
<div class="table_container"> <div class="table_container">
<bg-table <bg-table ref="userTable" :headers="headers" :rows="tableRows" :stripe="true" select @selectAc="selectChange">
ref="userTable"
:headers="headers"
:rows="tableRows"
:stripe="true"
select
@selectAc="selectChange">
<template v-slot:is_admin="{ row }">
<span>{{ userTypeConfig[row.is_admin] }}</span>
</template>
<template v-slot:operate_type="{ row }"> <template v-slot:operate_type="{ row }">
<span>{{ filterOperateType(row.operate_type) }}</span> <span>{{ filterOperateType(row.operate_type) }}</span>
</template> </template>
...@@ -118,7 +89,7 @@ ...@@ -118,7 +89,7 @@
</bg-table> </bg-table>
<bg-pagination <bg-pagination
:page="filter.page" :page="filter.page"
:size="filter.limit" :size="filter.page_size"
:total="filter.total" :total="filter.total"
@change-page="changePage" @change-page="changePage"
@change-size="changeSize"> @change-size="changeSize">
...@@ -163,13 +134,12 @@ const userTypeList = computed(() => { ...@@ -163,13 +134,12 @@ const userTypeList = computed(() => {
const state = reactive({ const state = reactive({
filter: { filter: {
search: "", search: "",
is_admin: "",
time: [], time: [],
operate_type: "", operate_type: "",
req_method: "", req_method: "",
operate_status: "", operate_status: "",
page: 1, page: 1,
limit: 10, page_size: 10,
total: 0, total: 0,
}, },
operateStatusList: [ operateStatusList: [
...@@ -184,11 +154,6 @@ const state = reactive({ ...@@ -184,11 +154,6 @@ const state = reactive({
prop: "system_account", prop: "system_account",
// minWidth: 280, // minWidth: 280,
}, },
{
label: "用户类型",
prop: "is_admin",
// minWidth: 360,
},
{ {
label: "系统模块", label: "系统模块",
prop: "system_module", prop: "system_module",
...@@ -259,8 +224,7 @@ const state = reactive({ ...@@ -259,8 +224,7 @@ const state = reactive({
deleteTips: "", deleteTips: "",
}); });
const { filter, operateStatusList, headers, selectedNum, tableRows, deleteDialog, deleteTips } = const { filter, operateStatusList, headers, selectedNum, tableRows, deleteDialog, deleteTips } = toRefs(state);
toRefs(state);
//导出 //导出
const exportFile = () => { const exportFile = () => {
let params = { ...state.filter }; let params = { ...state.filter };
...@@ -269,14 +233,13 @@ const exportFile = () => { ...@@ -269,14 +233,13 @@ const exportFile = () => {
delete params.time; delete params.time;
delete params.total; delete params.total;
axios axios
.get(`/apaas/system/v5/log/userBehavior/list/export`, { .get(`/v1/api/log/userBehavior/list/export`, {
params, params,
responseType: "blob", responseType: "blob",
}) })
.then((res) => { .then((res) => {
if (res.status === 200) { if (res.status === 200) {
const type = const type = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8";
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8";
downloadBlob(res.data, type); downloadBlob(res.data, type);
} else { } else {
ElMessage.error(res.statusText); ElMessage.error(res.statusText);
...@@ -316,7 +279,7 @@ const deleteCurrent = (row) => { ...@@ -316,7 +279,7 @@ const deleteCurrent = (row) => {
const confirmDelete = () => { const confirmDelete = () => {
const ids = state.selectedRows.map((item) => item.id); const ids = state.selectedRows.map((item) => item.id);
axios axios
.delete(`/apaas/system/v5/log/userBehavior/delete?ids=${ids.join(",")}`) .delete(`/v1/api/log/userBehavior/delete?ids=${ids.join(",")}`)
.then((res) => { .then((res) => {
if (res.data.code === 200) { if (res.data.code === 200) {
ElMessage.success(res.data.data); ElMessage.success(res.data.data);
...@@ -348,7 +311,7 @@ const getTableRows = () => { ...@@ -348,7 +311,7 @@ const getTableRows = () => {
params.end_at = params.time ? params.time[1] || "" : ""; params.end_at = params.time ? params.time[1] || "" : "";
delete params.time; delete params.time;
axios axios
.get(`/apaas/system/v5/log/userBehavior/list`, { .get(`/v1/api/log/userBehavior/list`, {
params, params,
}) })
.then((res) => { .then((res) => {
...@@ -364,19 +327,18 @@ const filterAction = () => { ...@@ -364,19 +327,18 @@ const filterAction = () => {
changePage(1); changePage(1);
}; };
const changeSize = (size) => { const changeSize = (size) => {
state.filter.limit = size; state.filter.page_size = size;
changePage(1); changePage(1);
}; };
const filterClear = () => { const filterClear = () => {
state.filter = { state.filter = {
search: "", search: "",
is_admin: "",
time: [], time: [],
operate_type: "", operate_type: "",
req_method: "", req_method: "",
operate_status: "", operate_status: "",
page: 1, page: 1,
limit: 10, page_size: 10,
total: 0, total: 0,
}; };
changePage(1); changePage(1);
...@@ -384,7 +346,7 @@ const filterClear = () => { ...@@ -384,7 +346,7 @@ const filterClear = () => {
const goDetail = (row) => { const goDetail = (row) => {
router.push({ router.push({
path: "/log/userBehavior/detail", path: "/system-admin/log/userBehavior/detail",
query: { query: {
id: row.id, id: row.id,
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment