Преглед на файлове

Merge branch 'test' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into test

chencc преди 1 година
родител
ревизия
ba62927cf6
променени са 4 файла, в които са добавени 170 реда и са изтрити 101 реда
  1. 1 1
      src/api/system/operationLog/api.js
  2. 30 6
      src/views/system/operationLog/components/search.vue
  3. 138 93
      src/views/system/operationLog/index.vue
  4. 1 1
      vue.config.js

+ 1 - 1
src/api/system/operationLog/api.js

@@ -7,7 +7,7 @@ import request from '@/utils/request';
  */
 
 export async function operateLogPageAPI(params) {
-  const res = await request.get('/sys/operatelog/page', {
+  const res = await request.get('/sys/operateProlog/page', {
     params
   });
   if (res.data.code == 0) {

+ 30 - 6
src/views/system/operationLog/components/search.vue

@@ -1,15 +1,33 @@
 <!-- 搜索表单 -->
 <template>
   <el-form
-    label-width="77px"
+    label-width="100px"
     class="ele-form-search"
     @keyup.enter.native="search"
     @submit.native.prevent
   >
     <el-row :gutter="15">
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="用户名称:">
-          <el-input clearable v-model.trim="where.userName" placeholder="请输入" />
+        <el-form-item label="操作描述:">
+          <el-input
+            clearable
+            v-model.trim="where.description"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="操作时间:" prop="createTime">
+          <el-date-picker
+            v-model="createTime"
+            type="datetimerange"
+            style="width: 100%"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            start-placeholder="开始时间"
+            end-placeholder="结束时间"
+          
+          >
+          </el-date-picker>
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
@@ -34,10 +52,12 @@
     data() {
       // 默认表单数据
       const defaultWhere = {
-        userName: '',
-        groupName: ''
+        description: '',
+        beginTime: '',
+        endTime: ''
       };
       return {
+        createTime: [],
         // 表单数据
         where: { ...defaultWhere }
       };
@@ -51,11 +71,15 @@
     methods: {
       /* 搜索 */
       search() {
-        console.log(this.where);
+        if(this.createTime.length){
+          this.where.beginTime=this.createTime?.[0]
+          this.where.endTime=this.createTime?.[1]
+        }  
         this.$emit('search', this.where);
       },
       /*  重置 */
       reset() {
+        this.createTime=[]
         this.where = { ...this.defaultWhere };
         this.search();
       }

+ 138 - 93
src/views/system/operationLog/index.vue

@@ -12,112 +12,157 @@
         :cache-key="cacheKeyUrl"
         :page-size="this.$store.state.tablePageSize"
       >
-
         <template v-slot:type="{ row }">
-          {{types[row.type]}}
+          {{ types[row.type] }}
         </template>
 
         <template v-slot:tableHeaderTitle="{ column }">
-          <span style="display: inline-block;text-align: center; width: 100%;">{{column.label}}</span>
+          <span
+            style="display: inline-block; text-align: center; width: 100%"
+            >{{ column.label }}</span
+          >
         </template>
       </ele-pro-table>
     </el-card>
-
   </div>
 </template>
 
 <script>
-import tabMixins from '@/mixins/tableColumnsMixin';
-import search from "./components/search.vue";
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  import search from './components/search.vue';
 
-import {deepClone} from "@/utils";
-import {operateLogPageAPI} from "@/api/system/operationLog/api";
+  import { deepClone } from '@/utils';
+  import { operateLogPageAPI } from '@/api/system/operationLog/api';
 
-export default {
-  name: 'index',
-  mixins: [tabMixins],
-components:{search},
-  data() {
-    return {
-      // 表格列配置
-      columns: [
-        {
-          columnKey: 'index',
-          label: '序号',
-          type: 'index',
-          width: 55,
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        {
-          prop: 'userName',
-          label: '用户名称',
-          align: 'center',
-          showOverflowTooltip: true,
-          width: 120
-        },
-        {
-          prop: ' type',
-          label: '日志类型',
-          align: 'center',
-          slot: 'type',
-          showOverflowTooltip: true,
-          width: 120
-        },
-        {
-          prop: 'dateTime',
-          label: '操作时间',
-          minWidth: 100,
-          slot: 'dateTime',
-          align: 'center',
-          headerSlot: 'tableHeaderTitle',
-        },
-        {
-          prop: 'ip',
-          label: 'IP地址',
-          minWidth: 100,
-          align: 'center',
-        },
-        {
-          prop: 'tag',
-          label: '操作菜单',
-          minWidth: 100,
-          align: 'center',
-        },
-        {
-          prop: 'description',
-          label: '操作描述',
-          minWidth: 100,
-          align: 'center',
+  export default {
+    name: 'index',
+    mixins: [tabMixins],
+    components: { search },
+    data() {
+      return {
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'userName',
+            label: '用户名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 100
+          },
+          {
+            prop: ' type',
+            label: '日志类型',
+            align: 'center',
+            slot: 'type',
+            showOverflowTooltip: true,
+            width: 150
+          },
+
+      
+          {
+            prop: 'ip',
+            label: 'IP地址',
+            width: 100,
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            prop: 'tag',
+            label: '操作菜单',
+            width: 100,
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            prop: 'operationType',
+            label: '操作类型',
+            width: 100,
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            prop: 'description',
+            label: '操作描述',
+            minWidth: 100,
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            prop: 'changeDetail',
+            label: '变更内容',
+            minWidth: 100,
+            showOverflowTooltip: true,
+            formatter(row) {
+              if (row.changeDetail) {
+                let data = JSON.parse(row.changeDetail);
+                return JSON.stringify(data.changeColumns)
+              }
+            }
+          },
+          {
+            prop: 'method',
+            label: '访问接口',
+            minWidth: 100,
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            prop: 'request',
+            label: '请求参数',
+            minWidth: 100,
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            prop: 'response',
+            label: '返回参数',
+            minWidth: 100,
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            prop: 'operationTime',
+            label: '接口响应时长(ms)',
+            width: 150,
+            align: 'center',
+          },
+          {
+            prop: 'createTime',
+            label: '操作时间',
+            width: 180,
+            slot: 'createTime',
+            align: 'center',
+            headerSlot: 'tableHeaderTitle'
+          },
+        ],
+        types: {
+          0: '常规日志',
+          1: '系统管理操作日志',
+          2: '系统安全操作日志',
+          3: '系统审计操作日志'
         },
-        {
-          prop: 'api',
-          label: '访问接口',
-          minWidth: 100,
-          align: 'center',
-        }
-      ],
-      types:{
-        0:'常规日志',
-        1:'系统管理操作日志',
-        2:'系统安全操作日志',
-        3:'系统审计操作日志',
-      },
-      cacheKeyUrl: '19f94758-operationLog',
-    };
-  },
-  created() {
-  },
-  methods: {
-    /* 表格数据源 */
-    datasource({page, limit, where, order}) {
-      return operateLogPageAPI({pageNum: page, size: limit, ...where});
-    },
-    /* 刷新表格 */
-    reload(where) {
-      this.$refs.table.reload({page: 1, where});
+        cacheKeyUrl: '19f94758-operationLog'
+      };
     },
-  }
-};
+    created() {},
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return operateLogPageAPI({ pageNum: page, size: limit, ...where });
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where });
+      }
+    }
+  };
 </script>

+ 1 - 1
vue.config.js

@@ -36,7 +36,7 @@ module.exports = {
     proxy: {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
-        target: 'http://192.168.1.125:18086',
+        target: 'http://192.168.1.25:18086',
         // target: 'http://192.168.1.158:18086',
         // target: 'http://192.168.1.176:18086',
         // target: 'http://192.168.1.251:18086',