Explorar o código

操作日志列表新增IP地址查询

RuoYi %!s(int64=2) %!d(string=hai) anos
pai
achega
e067c04464

+ 3 - 0
ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml

@@ -36,6 +36,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
36
 	<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">
36
 	<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">
37
 		<include refid="selectOperLogVo"/>
37
 		<include refid="selectOperLogVo"/>
38
 		<where>
38
 		<where>
39
+			<if test="operIp != null and operIp != ''">
40
+				AND oper_ip like concat('%', #{operIp}, '%')
41
+			</if>
39
 			<if test="title != null and title != ''">
42
 			<if test="title != null and title != ''">
40
 				AND title like concat('%', #{title}, '%')
43
 				AND title like concat('%', #{title}, '%')
41
 			</if>
44
 			</if>

+ 12 - 2
ruoyi-ui/src/views/system/operlog/index.vue

@@ -1,6 +1,15 @@
1
 <template>
1
 <template>
2
   <div class="app-container">
2
   <div class="app-container">
3
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
3
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
4
+      <el-form-item label="操作地址" prop="operIp">
5
+        <el-input
6
+          v-model="queryParams.operIp"
7
+          placeholder="请输入操作地址"
8
+          clearable
9
+          style="width: 240px;"
10
+          @keyup.enter.native="handleQuery"
11
+        />
12
+      </el-form-item>
4
       <el-form-item label="系统模块" prop="title">
13
       <el-form-item label="系统模块" prop="title">
5
         <el-input
14
         <el-input
6
           v-model="queryParams.title"
15
           v-model="queryParams.title"
@@ -105,7 +114,7 @@
105
     <el-table ref="tables" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
114
     <el-table ref="tables" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
106
       <el-table-column type="selection" width="50" align="center" />
115
       <el-table-column type="selection" width="50" align="center" />
107
       <el-table-column label="日志编号" align="center" prop="operId" />
116
       <el-table-column label="日志编号" align="center" prop="operId" />
108
-      <el-table-column label="系统模块" align="center" prop="title" />
117
+      <el-table-column label="系统模块" align="center" prop="title" :show-overflow-tooltip="true" />
109
       <el-table-column label="操作类型" align="center" prop="businessType">
118
       <el-table-column label="操作类型" align="center" prop="businessType">
110
         <template slot-scope="scope">
119
         <template slot-scope="scope">
111
           <dict-tag :options="dict.type.sys_oper_type" :value="scope.row.businessType"/>
120
           <dict-tag :options="dict.type.sys_oper_type" :value="scope.row.businessType"/>
@@ -113,7 +122,7 @@
113
       </el-table-column>
122
       </el-table-column>
114
       <el-table-column label="请求方式" align="center" prop="requestMethod" />
123
       <el-table-column label="请求方式" align="center" prop="requestMethod" />
115
       <el-table-column label="操作人员" align="center" prop="operName" width="110" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']"/>
124
       <el-table-column label="操作人员" align="center" prop="operName" width="110" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']"/>
116
-      <el-table-column label="主机" align="center" prop="operIp" width="130" :show-overflow-tooltip="true" />
125
+      <el-table-column label="操作地址" align="center" prop="operIp" width="130" :show-overflow-tooltip="true" />
117
       <el-table-column label="操作状态" align="center" prop="status">
126
       <el-table-column label="操作状态" align="center" prop="status">
118
         <template slot-scope="scope">
127
         <template slot-scope="scope">
119
           <dict-tag :options="dict.type.sys_common_status" :value="scope.row.status"/>
128
           <dict-tag :options="dict.type.sys_common_status" :value="scope.row.status"/>
@@ -229,6 +238,7 @@ export default {
229
       queryParams: {
238
       queryParams: {
230
         pageNum: 1,
239
         pageNum: 1,
231
         pageSize: 10,
240
         pageSize: 10,
241
+        operIp: undefined,
232
         title: undefined,
242
         title: undefined,
233
         operName: undefined,
243
         operName: undefined,
234
         businessType: undefined,
244
         businessType: undefined,