src/views/monitor/log/error.vue
@@ -1,6 +1,9 @@
<template>
  <basic-container>
    <avue-crud :option="option"
  <basic-container
    :class="[$store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '']"
  >
    <avue-crud
      :option="option"
               :table-loading="loading"
               :data="data"
               ref="crud"
@@ -13,7 +16,8 @@
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
      @on-load="onLoad"
    >
    </avue-crud>
  </basic-container>
</template>
@@ -32,10 +36,11 @@
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0
        total: 0,
        ...this.$store.state.control.changePageSize,
        },
        option: {
          height: 'auto',
        height: "auto",
          calcHeight: 30,
          tip: false,
          searchShow: true,
@@ -47,49 +52,49 @@
          addBtn: false,
          delBtn: false,
          menuWidth: 120,
          dialogType: 'drawer',
        dialogType: "drawer",
          column: [
            {
              label: "服务id",
              prop: "serviceId",
              search: true,
              width:'120'
            width: "120",
            },
            {
              label: "服务host",
              prop: "serverHost",
              search: true,
              width:'150'
            width: "150",
            },
            {
              label: "服务ip",
              prop: "serverIp",
              width:'160'
            width: "160",
            },
            {
              label: "软件环境",
              prop: "env",
              width:'80'
            width: "80",
            },
            {
              label: "请求方法",
              prop: "method",
              width:'80'
            width: "80",
            },
            {
              label: "请求接口",
              prop: "requestUri"
            prop: "requestUri",
            },
            {
              label: "日志时间",
              prop: "createTime",
              width:'180'
            width: "180",
            },
            {
              label: "用户代理",
              prop: "userAgent",
              span: 24,
              hide: true
            hide: true,
            },
            {
              label: "请求数据",
@@ -97,7 +102,7 @@
              type: "textarea",
              span: 24,
              minRows: 2,
              hide: true
            hide: true,
            },
            {
              label: "日志数据",
@@ -105,20 +110,20 @@
              type: "textarea",
              span: 24,
              minRows: 16,
              hide: true
            }
          ]
            hide: true,
        },
        data: []
        ],
      },
      data: [],
      };
    },
    computed: {
      ...mapGetters(["permission"]),
      permissionList() {
        return {
          viewBtn: this.vaildData(this.permission.log_error_view, false)
        viewBtn: this.vaildData(this.permission.log_error_view, false),
        };
      }
    },
    },
    methods: {
      searchReset() {
@@ -133,7 +138,7 @@
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getErrorLogs(this.form.id).then(res => {
        getErrorLogs(this.form.id).then((res) => {
            this.form = res.data.data;
          });
        }
@@ -150,14 +155,18 @@
      },
      onLoad(page, params = {}) {
        this.loading = true;
        getErrorList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
      getErrorList(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query)
      ).then((res) => {
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;
          this.loading = false;
        });
      }
    }
    },
  },
  };
</script>