exec-log.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template id="exec-log">
  2. <el-dialog v-model="visible" :visible.sync="visible" width="800" @close="$emit('close')" title="执行日志" :close-on-click-modal="false">
  3. <div class="black-board">
  4. <pre v-if="output">{{ output == null ? "无日志数据" : output }}</pre>
  5. </div>
  6. </el-dialog>
  7. </template>
  8. <script>
  9. Vue.component('exec-log', {
  10. template: '#exec-log',
  11. props: {
  12. },
  13. data() {
  14. return {
  15. visible: false,
  16. output: '',
  17. }
  18. },
  19. methods: {
  20. async open(row) {
  21. console.log(row.output)
  22. this.output = row.output;
  23. this.visible = true;
  24. return this;
  25. }
  26. }
  27. });
  28. </script>
  29. <style scoped>
  30. .black-board {
  31. margin: 15px 0;
  32. max-height: 500px;
  33. white-space: normal;
  34. word-break: break-all;
  35. overflow-x: hidden;
  36. overflow-y: scroll;
  37. }
  38. pre {
  39. font-size: 12px;
  40. color: #ccc;
  41. padding: 20px;
  42. background: #333;
  43. font-family: consolas;
  44. line-height: 1.5;
  45. overflow: auto;
  46. border-radius: 4px;
  47. }
  48. </style>