You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

161 lines
4.8 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div>
  3. <el-card class="elcard" style="border-radius: 15px">
  4. <div class="publiccss">安全日志</div>
  5. <el-table
  6. :data="tableData"
  7. style="width: 100%; margin-top: 20px"
  8. height="700"
  9. >
  10. <el-table-column prop="userName" label="用户名" width="80">
  11. </el-table-column>
  12. <el-table-column prop="httpStatusCode" label="状态" width="80">
  13. </el-table-column>
  14. <el-table-column prop="url" label="地址" width="180"> </el-table-column>
  15. <el-table-column prop="clientIpAddress" label="ip地址" width="200">
  16. </el-table-column>
  17. <el-table-column
  18. prop="clientId"
  19. label="客户端id"
  20. width=""
  21. ></el-table-column>
  22. <el-table-column
  23. prop="httpMethod"
  24. label="请求方法"
  25. width="180"
  26. ></el-table-column>
  27. <el-table-column prop="executionTime" label="时间" width="180">
  28. <template slot-scope="scope">
  29. {{ scope.row.executionTime | dateFormat }}
  30. </template>
  31. </el-table-column>
  32. <el-table-column prop="browserInfo" label="浏览器信息" width="500">
  33. </el-table-column>
  34. <el-table-column label="操作">
  35. <template slot-scope="scope">
  36. <el-button
  37. type=""
  38. @click="inquireabout(scope.row)"
  39. style="width: 100px"
  40. >查看</el-button
  41. >
  42. </template>
  43. </el-table-column>
  44. </el-table>
  45. <!-- 详情弹框 -->
  46. <el-dialog
  47. title="日志详情"
  48. :visible.sync="dialogVisible"
  49. width="80%"
  50. :close-on-click-modal="false"
  51. >
  52. <el-table :data="detailedinformationdata" style="width: 100%">
  53. <el-table-column prop="userName" label="用户名" width="80">
  54. </el-table-column>
  55. <el-table-column prop="httpStatusCode" label="状态" width="80">
  56. </el-table-column>
  57. <el-table-column prop="url" label="地址" width="180">
  58. </el-table-column>
  59. <el-table-column prop="clientIpAddress" label="ip地址" width="120">
  60. </el-table-column>
  61. <el-table-column
  62. prop="clientId"
  63. label="客户端id"
  64. width="100"
  65. ></el-table-column>
  66. <el-table-column
  67. prop="httpMethod"
  68. label="请求方法"
  69. width="180"
  70. ></el-table-column>
  71. <el-table-column prop="executionTime" label="时间" width="180">
  72. <template slot-scope="scope">
  73. {{ scope.row.executionTime | dateFormat }}
  74. </template>
  75. </el-table-column>
  76. <el-table-column prop="browserInfo" label="浏览器信息" width="">
  77. </el-table-column>
  78. </el-table>
  79. <span slot="footer" class="dialog-footer">
  80. <el-button @click="dialogVisible = false"> </el-button>
  81. <el-button
  82. type="primary"
  83. @click="queddialogVisible"
  84. class="bulletcommit"
  85. > </el-button
  86. >
  87. </span>
  88. </el-dialog>
  89. <el-pagination
  90. @size-change="handleSizeChange"
  91. @current-change="handleCurrentChange"
  92. :page-sizes="[10, 20, 30, 50]"
  93. :page-size="pages.maxResultCount"
  94. layout="total, sizes, prev, pager, next, jumper"
  95. :total="1000 - 1"
  96. >
  97. </el-pagination>
  98. </el-card>
  99. </div>
  100. </template>
  101. <script>
  102. import { dailyrecord, querylog } from "@/request/ruquset";
  103. export default {
  104. data() {
  105. return {
  106. tableData: [],
  107. pages: {
  108. skipCount: 0,
  109. maxResultCount: 20,
  110. // sorting
  111. },
  112. dialogVisible: false,
  113. detailedinformationdata: [],
  114. };
  115. },
  116. created() {
  117. this.cratlist();
  118. },
  119. methods: {
  120. cratlist() {
  121. dailyrecord(this.pages).then((res) => {
  122. this.tableData = res.data;
  123. console.log(res);
  124. });
  125. },
  126. //分页
  127. handleSizeChange(v) {
  128. this.pages.maxResultCount = v;
  129. this.cratlist();
  130. },
  131. handleCurrentChange(v) {
  132. this.pages.skipCount = v;
  133. (this.pages.currentPage - 1) * this.pages.MaxResultCount;
  134. this.cratlist();
  135. },
  136. //查询信息
  137. inquireabout(row) {
  138. this.dialogVisible = true;
  139. this.detailedinformationdata = [];
  140. console.log(row);
  141. querylog(row.id).then((res) => {
  142. if (row.id == res.data.id) {
  143. this.detailedinformationdata.push(res.data);
  144. }
  145. });
  146. },
  147. queddialogVisible() {
  148. // this.detailedinformationdata = [];
  149. this.dialogVisible = false;
  150. },
  151. },
  152. };
  153. </script>
  154. <style scoped>
  155. ::v-deep .el-table__header th {
  156. /* font-size: px; */
  157. background-color: rgb(245, 245, 245); /* 设置表头背景颜色 */
  158. color: rgb(113, 113, 113); /* 设置表头文字颜色 */
  159. }
  160. </style>