给日志页面增加按租户查询的功能

This commit is contained in:
季圣华
2023-12-14 22:57:02 +08:00
parent 899c75ef1c
commit f55b1875d8

View File

@@ -49,12 +49,17 @@
<a-input placeholder="请输入操作IP" v-model="queryParam.clientIp"></a-input> <a-input placeholder="请输入操作IP" v-model="queryParam.clientIp"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24" v-if="isManage">
<a-form-item label="操作状态" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item label="租户账号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select v-model="queryParam.status" placeholder="请选择操作状态"> <a-input placeholder="请输入租户账号" v-model="queryParam.tenantLoginName"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24" v-if="isManage">
<a-form-item label="租户类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select v-model="queryParam.tenantType" placeholder="请选择租户类型">
<a-select-option value="">请选择</a-select-option> <a-select-option value="">请选择</a-select-option>
<a-select-option value="0">成功</a-select-option> <a-select-option value="0">试用租户</a-select-option>
<a-select-option value="1">失败</a-select-option> <a-select-option value="1">付费租户</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -88,6 +93,7 @@
<script> <script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JEllipsis from '@/components/jeecg/JEllipsis' import JEllipsis from '@/components/jeecg/JEllipsis'
import {getAction } from '@/api/manage'
export default { export default {
name: "LogList", name: "LogList",
@@ -104,9 +110,11 @@
createTimeRange:[], createTimeRange:[],
userInfo: '', userInfo: '',
clientIp:'', clientIp:'',
status:'' tenantLoginName:'',
tenantType:''
}, },
tabKey: "1", tabKey: "1",
isManage: false,
// 表头 // 表头
columns: [ columns: [
{ {
@@ -120,21 +128,11 @@
} }
}, },
{title: '操作模块', dataIndex: 'operation', width: 120, align: "left"}, {title: '操作模块', dataIndex: 'operation', width: 120, align: "left"},
{title: '操作详情', dataIndex: 'content', scopedSlots: { customRender: 'content' }, width: 350, align:"left" }, {title: '操作详情', dataIndex: 'content', scopedSlots: { customRender: 'content' }, width: 360, align:"left" },
{title: '操作员账号', dataIndex: 'loginName', width: 80, align: "left"}, {title: '操作员账号', dataIndex: 'loginName', width: 80, align: "left"},
{title: '操作员姓名', dataIndex: 'userName', width: 80, align: "left"}, {title: '操作员姓名', dataIndex: 'userName', width: 80, align: "left"},
{ {title: '操作IP', dataIndex: 'clientIp', width: 100, align: "left"},
title: '操作状态', dataIndex: 'status',width:80, align:"left", {title: '操作时间', dataIndex: 'createTimeStr', width: 110, align: "left"}
customRender:function (text) {
if(text){
return "失败";
}else {
return "成功";
}
}
},
{title: '操作IP', dataIndex: 'clientIp', width: 110, align: "left"},
{title: '操作时间', dataIndex: 'createTimeStr', width: 120, align: "left"}
], ],
operateColumn: operateColumn:
{ {
@@ -154,23 +152,10 @@
} }
} }
}, },
methods: { created() {
// 日志类型 this.initUserInfo()
callback(key){
// 动态添加操作类型列
if (key == 2) {
this.tabKey = '2';
this.columns.splice(7, 0, this.operateColumn);
}else if(this.columns.length == 9)
{
this.tabKey = '1';
this.columns.splice(7,1);
}
let that=this;
that.queryParam.logType=key;
that.loadData();
}, },
methods: {
onDateChange: function (value, dateString) { onDateChange: function (value, dateString) {
console.log(dateString[0],dateString[1]); console.log(dateString[0],dateString[1]);
this.queryParam.beginTime=dateString[0]; this.queryParam.beginTime=dateString[0];
@@ -179,6 +164,18 @@
onDateOk(value) { onDateOk(value) {
console.log(value); console.log(value);
}, },
initUserInfo() {
getAction('/user/getUserSession').then((res)=>{
if(res.code === 200){
let user = res.data.user
if(user.tenantId === 0) {
this.isManage = true
}
}else{
this.$message.warning(res.data)
}
})
}
} }
} }
</script> </script>