index.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="10" class="mb8">
  4. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  5. </el-row>
  6. <el-table v-loading="loading" :data="list">
  7. <el-table-column type="selection" width="55" align="center" />
  8. <el-table-column :label="$t('文件名')" align="center" prop="fileName" />
  9. <el-table-column :label="$t('文件路径')" align="center" prop="fileUrl" />
  10. <el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width">
  11. <template slot-scope="scope">
  12. <el-button
  13. size="mini"
  14. type="text"
  15. icon="el-icon-download"
  16. @click="handleDownload(scope.row)"
  17. >{{ $t('下载') }}</el-button>
  18. </template>
  19. </el-table-column>
  20. </el-table>
  21. </div>
  22. </template>
  23. <script>
  24. import { list } from "@/api/monitor/log";
  25. export default {
  26. name: "Log",
  27. data() {
  28. return {
  29. // 遮罩层
  30. loading: true,
  31. // 选中数组
  32. ids: [],
  33. // 非多个禁用
  34. multiple: true,
  35. // 显示搜索条件
  36. showSearch: true,
  37. // 总条数
  38. total: 0,
  39. // 表格数据
  40. list: [],
  41. // 是否显示弹出层
  42. open: false,
  43. // 表单参数
  44. form: {},
  45. // 查询参数
  46. queryParams: {}
  47. };
  48. },
  49. created() {
  50. this.getList();
  51. },
  52. methods: {
  53. /** 下载操作日志 */
  54. handleDownload(row) {
  55. window.location.href = process.env.VUE_APP_BASE_API + "/monitor/log/download?fileName=" + encodeURI(row.fileName) + "&fileUrl=" + encodeURI(row.fileUrl);
  56. },
  57. /** 查询操作日志 */
  58. getList() {
  59. this.loading = true;
  60. list().then(response => {
  61. this.list = response.data;
  62. this.total = response.total;
  63. this.loading = false;
  64. }
  65. );
  66. },
  67. }
  68. };
  69. </script>