dialog.info.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <div class="edu-training-edit">
  3. <DialogCom :title="this.title" :visible.sync="isShow" append-to-body>
  4. <div class="page-body">
  5. <div class="extend_mod" style="max-height: 500px;">
  6. <el-table :data="logList" border style="width: 100%;max-height: 500px;overflow-y: auto;">
  7. <el-table-column
  8. prop="fileName"
  9. label="文件名称"
  10. align="center"
  11. ></el-table-column>
  12. <el-table-column
  13. prop="fileType"
  14. label="文件类型"
  15. align="center"
  16. >
  17. <template slot-scope="scope">
  18. {{ scope.row.fileType == 1 ? '文件' : '目录' }}
  19. </template>
  20. </el-table-column>
  21. <el-table-column
  22. prop="fileSize"
  23. label="文件大小"
  24. align="center"
  25. >
  26. </el-table-column>
  27. <el-table-column
  28. label="操作"
  29. align="center"
  30. width="200"
  31. class-name="small-padding fixed-width"
  32. >
  33. <template slot-scope="scope">
  34. <el-button
  35. size="mini"
  36. type="text"
  37. icon="el-icon-edit-outline"
  38. @click="transferLog(scope.row)"
  39. >获取日志
  40. </el-button>
  41. <el-button
  42. size="mini"
  43. type="text"
  44. icon="el-icon-edit-outline"
  45. @click="transferLog(scope.row)"
  46. >重新获取
  47. </el-button>
  48. <el-button
  49. size="mini"
  50. type="text"
  51. icon="el-icon-delete"
  52. @click="handleDelete(scope.row)"
  53. >下载
  54. </el-button>
  55. </template>
  56. </el-table-column>
  57. </el-table>
  58. </div>
  59. </div>
  60. <div slot="footer" class="dialog-footer">
  61. <el-button @click="onHide">关闭</el-button>
  62. </div>
  63. </DialogCom>
  64. </div>
  65. </template>
  66. <script>
  67. import {mapMutations, mapState} from "vuex";
  68. import {getLogList} from "@/api/system/logManagement";
  69. import {getLabel} from "@/views/commonOption";
  70. export default {
  71. components: {},
  72. dicts: [],
  73. data() {
  74. const params = this.$route.params;
  75. return {
  76. id: params ? params.id : null,
  77. isShow: false,
  78. formData: this.reset(),
  79. title: '',
  80. logList: [],
  81. serverId: null,
  82. serviceId: null,
  83. };
  84. },
  85. props: {},
  86. watch: {},
  87. computed: {
  88. ...mapState(["loginUser"]),
  89. },
  90. methods: {
  91. ...mapMutations([]),
  92. getLabel,
  93. reset(other = {}) {
  94. return {
  95. fileName: null,
  96. fileSize: null,
  97. fileType: null,
  98. ...other,
  99. };
  100. },
  101. async refresh(serverId, serviceId) {
  102. if (!serverId || !serviceId) {
  103. this.reset(serverId);
  104. } else {
  105. getLogList(serverId, serviceId).then((response) => {
  106. this.logList = response.data;
  107. this.loading = false;
  108. });
  109. }
  110. },
  111. async show(server, service, other = {}) {
  112. this.serverId = server.id;
  113. this.serviceId = service.id;
  114. this.title = service.checkName + "日志详情页";
  115. await this.refresh(server.id, service.id);
  116. this.isShow = true;
  117. },
  118. transferLog(row) {
  119. },
  120. // 事件
  121. onHide() {
  122. this.isShow = false;
  123. },
  124. },
  125. mounted() {
  126. },
  127. };
  128. </script>
  129. <style lang="scss" scoped>
  130. .text-content {
  131. margin: 0;
  132. max-height: 500px;
  133. overflow: auto;
  134. }
  135. </style>