浏览代码

日志管理

zhangliang2 2 年之前
父节点
当前提交
fcf4348284

+ 10 - 1
src/api/systemManagement.js

@@ -41,6 +41,11 @@ const saveVehicleTemp = basePart + '/vehicleTemp/saveVehicleTemp' // 新增修
 const delVehicleTempById = basePart + '/vehicleTemp/delVehicleTempById' // 删除
 const upload = basePart + '/file/upload' // 上传
 
+// 车辆设置
+const getLoginLogPageList = basePart + '/log/getLoginLogPageList' // 登录列表
+const getOperationLogPageList = basePart + '/log/getOperationLogPageList' // 操作列表
+const getSystemLogPageList = basePart + '/log/getSystemLogPageList' // 系统列表
+
 
 export default {
     getUserPageList,
@@ -75,5 +80,9 @@ export default {
     getVehicleTempInfo,
     saveVehicleTemp,
     delVehicleTempById,
-    upload
+    upload,
+
+    getLoginLogPageList,
+    getOperationLogPageList,
+    getSystemLogPageList
 }

+ 22 - 4
src/router/systemManagement.js

@@ -151,12 +151,30 @@ export default [{
         component: () => import("@/views/systemManagement/reportTemplateDetail")
     },
     {
-        path: "/logManagement",
-        name: "logManagement",
+        path: "/loginLogManagement",
+        name: "loginLogManagement",
         meta: {
-            tabname: "日志管理",
+            tabname: "登录日志",
             menuKind: "systemManagement"
         },
-        component: () => import("@/views/systemManagement/logManagement")
+        component: () => import("@/views/systemManagement/loginLogManagement")
+    },
+    {
+        path: "/handleLogManagement",
+        name: "handleLogManagement",
+        meta: {
+            tabname: "操作日志",
+            menuKind: "systemManagement"
+        },
+        component: () => import("@/views/systemManagement/handleLogManagement")
+    },
+    {
+        path: "/systemLogManagement",
+        name: "systemLogManagement",
+        meta: {
+            tabname: "系统日志",
+            menuKind: "systemManagement"
+        },
+        component: () => import("@/views/systemManagement/systemLogManagement")
     }
 ]

+ 75 - 78
src/views/systemManagement/logManagement.vue → src/views/systemManagement/handleLogManagement.vue

@@ -4,7 +4,7 @@
             <template slot="searchItem1">
                 <span class="label">操作账户</span>
                 <el-input
-                    v-model="searchParams.a1"
+                    v-model="searchParams.username"
                     size="small"
                     clearable
                     placeholder="请输入"
@@ -13,31 +13,35 @@
                 </el-input>
             </template>
             <template slot="searchItem2">
-                <span class="label">操作内容</span>
-                <el-input
-                    v-model="searchParams.a2"
-                    size="small"
-                    clearable
-                    placeholder="请输入"
-                    maxlength="60"
-                >
-                </el-input>
+                <span class="label">所属模块</span>
+                <el-select v-model="searchParams.module" clearable size="small">
+                    <el-option
+                        v-for="item in moduleList"
+                        :label="item.caption"
+                        :value="item.code"
+                        :key="item.code"
+                    ></el-option>
+                </el-select>
             </template>
             <template slot="searchItem3">
-                <span class="label">日志类型</span>
-                <el-select v-model="searchParams.a3">
-                    <!--<el-option
-                        v-for="item in list"
+                <span class="label">操作类型</span>
+                <el-select
+                    v-model="searchParams.operationType"
+                    clearable
+                    size="small"
+                >
+                    <el-option
+                        v-for="item in operationTypeList"
                         :label="item.caption"
                         :value="item.code"
                         :key="item.code"
-                    ></el-option>-->
+                    ></el-option>
                 </el-select>
             </template>
             <template slot="searchItem4">
                 <span class="label">操作时间</span>
                 <el-date-picker
-                    v-model="searchDate"
+                    v-model="createDate"
                     type="daterange"
                     format="yyyy-MM-dd"
                     value-format="yyyy-MM-dd"
@@ -55,25 +59,14 @@
             </template>
         </search-layout>
 
-        <div class="myTabsBox myTabsBoxThreeTabs">
-            <!--<el-button
-                v-bind:class="{ addBtn: true}"
-                icon="el-icon-circle-plus-outline"
-                @click="addOne"
-                type="primary"
-                >新增</el-button
-            >-->
-        </div>
-
         <tableList
             ref="table"
-            style="margin: 0 30px"
+            style="margin: 30px"
             :columns="columns"
             :getDataWay="getDataWay"
             :pagination="pagination"
             index
         >
-        
         </tableList>
     </div>
 </template>
@@ -83,45 +76,43 @@ import searchLayout from "@/components/grid/searchLayout";
 import tableList from "@/components/grid/TableList";
 
 export default {
-    name: "logManagement",
+    name: "handleLogManagement", // 操作日志
     components: { searchLayout, tableList },
     data() {
         return {
             searchParams: {
                 //搜索参数
-                a1: "", // ID
-                a2: "", // 算法名称
-                a3: "", // 算法描述
-                a4: "", // 私有类型
-            },
-            searchDate:[],
-            getDataWay:{
-                //dataType: "url",
-                dataType: "data",
-                type: "post",
-                // firstRequest: false,
-                // data: this.$api.algorithmsLibrary.selectSharedAlgorithmList,
-                data:[{a1:'1',a2:'2',a3:'3',a4:'4',a5:'5',a6:'6'}],
-                param: {},
+                username: "", // 操作账户
+                module: "", // 所属模块
+                operationType: "", // 操作类型
+                createTimeBegin: "", // 上传时间起
+                createTimeEnd: "", // 上传时间止
             },
+            createDate: "",
+            moduleList: [],
+            operationTypeList: [],
             columns: [
                 //表格列
                 {
-                    label: "操作账户",
-                    prop: "a1",
+                    label: "账户名称",
+                    prop: "username",
                 },
                 {
-                    label: "操作类型",
-                    prop: "a2",
+                    label: "IP",
+                    prop: "ip",
+                },
+                {
+                    label: "所属模块",
+                    prop: "module",
                 },
                 {
                     label: "操作时间",
-                    prop: "a3",
+                    prop: "createTime",
                 },
                 {
-                    label: "操作内容",
-                    prop: "a4"
-                }
+                    label: "操作类型",
+                    prop: "operationType",
+                },
             ],
             pagination: {
                 //分页使用
@@ -131,16 +122,35 @@ export default {
                 pageSizes: [10, 30, 50, 100, 200],
                 layout: "sizes, total, prev, pager, next, jumper",
             },
+            getDataWay: {
+                //加载表格数据
+                dataType: "url",
+                type: "post",
+                // firstRequest: false,
+                data: this.$api.systemManagement.getOperationLogPageList,
+                param: {},
+            },
         };
     },
-    computed: {
-    
-    },
+
     methods: {
         doSearch() {
-            this.$nextTick(() => {
-                this.refreshList(this.searchParams);
-            });
+            if (this.createDate) {
+                this.searchParams.createTimeBegin = `${this.createDate[0]}`;
+                this.searchParams.createTimeEnd = `${this.createDate[1]}`;
+            } else {
+                this.searchParams.createTimeBegin = "";
+                this.searchParams.createTimeEnd = "";
+            }
+
+            let pageMap = {
+                username: this.searchParams.username,
+                module: this.searchParams.module,
+                operationType: this.searchParams.operationType,
+                createTimeBegin: this.searchParams.createTimeBegin,
+                createTimeEnd: this.searchParams.createTimeEnd,
+            };
+            this.refreshList(pageMap);
         },
         //刷新table
         refreshList(param) {
@@ -150,37 +160,24 @@ export default {
         },
         doReset() {
             this.searchParams = {
-                
+                username: "",
+                module: "",
+                operationType: "",
+                createTimeBegin: "",
+                createTimeEnd: "",
             };
+            this.createDate = "";
             this.doSearch();
         },
-        addOne() {
-            
-        },
-        editRow(row) {
-            
-        },
     },
     async mounted() {
         await this.$dicsListsInit({
-            validationStatusList: "validationStatus",
+            moduleList: "moduleType",
+            operationTypeList: "operationType",
         });
     },
 };
 </script>
 
 <style scoped lang="less">
-.tabsBox {
-    position: relative;
-    overflow: hidden;
-
-    .el-button {
-        position: absolute;
-        right: 40px;
-        top: 45px;
-    }
-}
-.myTabsBox{
-    min-height:29px;
-}
 </style>

+ 136 - 0
src/views/systemManagement/loginLogManagement.vue

@@ -0,0 +1,136 @@
+<template>
+    <div>
+        <search-layout :needBox="true">
+            <template slot="searchItem1">
+                <span class="label">操作账户</span>
+                <el-input
+                    v-model="searchParams.username"
+                    size="small"
+                    clearable
+                    placeholder="请输入"
+                    maxlength="60"
+                >
+                </el-input>
+            </template>
+            <template slot="searchItem2">
+                <span class="label">操作时间</span>
+                <el-date-picker
+                    v-model="createDate"
+                    type="daterange"
+                    format="yyyy-MM-dd"
+                    value-format="yyyy-MM-dd"
+                    range-separator="至"
+                    start-placeholder="开始日期"
+                    end-placeholder="结束日期"
+                >
+                </el-date-picker>
+            </template>
+            <template slot="searchBtn1">
+                <el-button type="primary" @click="doSearch">查询</el-button>
+            </template>
+            <template slot="searchBtn2">
+                <el-button type="primary" @click="doReset">重置</el-button>
+            </template>
+        </search-layout>
+
+        <tableList
+            ref="table"
+            style="margin: 30px"
+            :columns="columns"
+            :getDataWay="getDataWay"
+            :pagination="pagination"
+            index
+        >
+        </tableList>
+    </div>
+</template>
+
+<script>
+import searchLayout from "@/components/grid/searchLayout";
+import tableList from "@/components/grid/TableList";
+
+export default {
+    name: "loginLogManagement", // 登录日志
+    components: { searchLayout, tableList },
+    data() {
+        return {
+            searchParams: {
+                //搜索参数
+                username: "", // 操作账户
+                createTimeBegin: "", // 上传时间起
+                createTimeEnd: "", // 上传时间止
+            },
+            createDate: "",
+            columns: [
+                //表格列
+                {
+                    label: "账户名称",
+                    prop: "username",
+                },
+                {
+                    label: "IP",
+                    prop: "ip",
+                },
+                {
+                    label: "操作时间",
+                    prop: "createTime",
+                },
+            ],
+            pagination: {
+                //分页使用
+                currentPage: 1,
+                pageSize: 10,
+                position: "right",
+                pageSizes: [10, 30, 50, 100, 200],
+                layout: "sizes, total, prev, pager, next, jumper",
+            },
+            getDataWay: {
+                //加载表格数据
+                dataType: "url",
+                type: "post",
+                // firstRequest: false,
+                data: this.$api.systemManagement.getLoginLogPageList,
+                param: {},
+            },
+        };
+    },
+
+    methods: {
+        doSearch() {
+            if (this.createDate) {
+                this.searchParams.createTimeBegin = `${this.createDate[0]}`;
+                this.searchParams.createTimeEnd = `${this.createDate[1]}`;
+            } else {
+                this.searchParams.createTimeBegin = "";
+                this.searchParams.createTimeEnd = "";
+            }
+
+            let pageMap = {
+                username: this.searchParams.username,
+                createTimeBegin: this.searchParams.createTimeBegin,
+                createTimeEnd: this.searchParams.createTimeEnd,
+            };
+            this.refreshList(pageMap);
+        },
+        //刷新table
+        refreshList(param) {
+            param
+                ? this.$refs["table"].loadData(param)
+                : this.$refs["table"].loadData();
+        },
+        doReset() {
+            this.searchParams = {
+                username: "",
+                createTimeBegin: "",
+                createTimeEnd: "",
+            };
+            this.createDate = "";
+            this.doSearch();
+        },
+    },
+    mounted() {},
+};
+</script>
+
+<style scoped lang="less">
+</style>

+ 199 - 0
src/views/systemManagement/systemLogManagement.vue

@@ -0,0 +1,199 @@
+<template>
+    <div>
+        <search-layout :needBox="true">
+            <template slot="searchItem1">
+                <span class="label">操作账户</span>
+                <el-input
+                    v-model="searchParams.username"
+                    size="small"
+                    clearable
+                    placeholder="请输入"
+                    maxlength="60"
+                >
+                </el-input>
+            </template>
+            <template slot="searchItem2">
+                <span class="label">操作</span>
+                <el-cascader
+                    v-model="operation"
+                    :options="operationList"
+                    :props="props"
+                    clearable
+                    size="small"
+                ></el-cascader>
+            </template>
+            <template slot="searchItem3">
+                <span class="label">操作内容</span>
+                <el-input
+                    v-model="searchParams.content"
+                    size="small"
+                    clearable
+                    placeholder="请输入"
+                    maxlength="200"
+                >
+                </el-input>
+            </template>
+            <template slot="searchItem4">
+                <span class="label">操作时间</span>
+                <el-date-picker
+                    v-model="createDate"
+                    type="daterange"
+                    format="yyyy-MM-dd"
+                    value-format="yyyy-MM-dd"
+                    range-separator="至"
+                    start-placeholder="开始日期"
+                    end-placeholder="结束日期"
+                >
+                </el-date-picker>
+            </template>
+            <template slot="searchBtn1">
+                <el-button type="primary" @click="doSearch">查询</el-button>
+            </template>
+            <template slot="searchBtn2">
+                <el-button type="primary" @click="doReset">重置</el-button>
+            </template>
+        </search-layout>
+
+        <tableList
+            ref="table"
+            style="margin: 30px"
+            :columns="columns"
+            :getDataWay="getDataWay"
+            :pagination="pagination"
+            index
+        >
+        </tableList>
+    </div>
+</template>
+
+<script>
+import searchLayout from "@/components/grid/searchLayout";
+import tableList from "@/components/grid/TableList";
+
+export default {
+    name: "systemLogManagement", // 系统日志
+    components: { searchLayout, tableList },
+    data() {
+        return {
+            searchParams: {
+                //搜索参数
+                username: "", // 操作账户
+                module: "", // 所属模块
+                operationType: "", // 操作类型
+                content: "", // 操作内容
+                createTimeBegin: "", // 上传时间起
+                createTimeEnd: "", // 上传时间止
+            },
+            operation: [], // 操作
+            createDate: "",
+            operationList: [],
+            props: {
+                // multiple: true,
+                label: "dictName",
+                value: "dictCode",
+                checkStrictly: true,
+            },
+            columns: [
+                //表格列
+                {
+                    label: "账户名称",
+                    prop: "username",
+                },
+                {
+                    label: "账户类型",
+                    prop: "roleCode",
+                },
+                {
+                    label: "操作时间",
+                    prop: "createTime",
+                },
+                {
+                    label: "所属模块",
+                    prop: "module",
+                },
+                {
+                    label: "操作类型",
+                    prop: "operationType",
+                },
+                {
+                    label: "操作内容",
+                    prop: "content",
+                },
+            ],
+            pagination: {
+                //分页使用
+                currentPage: 1,
+                pageSize: 10,
+                position: "right",
+                pageSizes: [10, 30, 50, 100, 200],
+                layout: "sizes, total, prev, pager, next, jumper",
+            },
+            getDataWay: {
+                //加载表格数据
+                dataType: "url",
+                type: "post",
+                // firstRequest: false,
+                data: this.$api.systemManagement.getSystemLogPageList,
+                param: {},
+            },
+        };
+    },
+
+    methods: {
+        doSearch() {
+            console.log(this.operation);
+            if (this.createDate) {
+                this.searchParams.createTimeBegin = `${this.createDate[0]}`;
+                this.searchParams.createTimeEnd = `${this.createDate[1]}`;
+            } else {
+                this.searchParams.createTimeBegin = "";
+                this.searchParams.createTimeEnd = "";
+            }
+
+            if (this.operation.length === 1) {
+                this.searchParams.module = this.operation[0];
+            } else if (this.operation.length === 2) {
+                this.searchParams.module = this.operation[0];
+                this.searchParams.operationType = this.operation[1];
+            }
+
+            let pageMap = {
+                username: this.searchParams.username,
+                module: this.searchParams.module,
+                operationType: this.searchParams.operationType,
+                content: this.searchParams.content,
+                createTimeBegin: this.searchParams.createTimeBegin,
+                createTimeEnd: this.searchParams.createTimeEnd,
+            };
+            this.refreshList(pageMap);
+        },
+        //刷新table
+        refreshList(param) {
+            param
+                ? this.$refs["table"].loadData(param)
+                : this.$refs["table"].loadData();
+        },
+        doReset() {
+            this.searchParams = {
+                username: "",
+                module: "",
+                operationType: "",
+                content: "",
+                createTimeBegin: "",
+                createTimeEnd: "",
+            };
+            this.createDate = "";
+            this.operation = [];
+            this.doSearch();
+        },
+    },
+    async mounted() {
+        await this.$dicsTreesInit({
+            operationList: "sysLogType",
+        });
+    },
+};
+</script>
+
+<style scoped lang="less">
+</style>

+ 2 - 2
vue.config.js

@@ -88,8 +88,8 @@ module.exports = {
                 // target: 'http://10.10.83.145:6888/user-center',
                 // target: 'http://10.12.10.70/simulation',
                 // target: 'http://10.12.10.70:7001', // 登录
-                // target: 'http://10.12.10.73:7003',  // 王志强
-                target: 'http://10.12.10.70', // windowstest
+                target: 'http://10.12.10.73:7003',  // 王志强
+                // target: 'http://10.12.10.70', // windowstest
                 // target: 'http://10.12.10.87:8001',  // 赵艳
                 // target: 'http://10.12.10.72:8001',  // 王晓峰
                 // target: 'http://192.168.30.75',  // gq