Rap 原分销系统代码Web
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

b9a22df83fe285bcfa97c0b5c5423d28991b625c.svn-base 3.8KB

5ヶ月前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <el-dialog :visible.sync="dialog" append-to-body title="执行日志" width="88%">
  3. <!-- 搜索 -->
  4. <div class="head-container">
  5. <el-input v-model="query.jobName" clearable size="small" placeholder="输入任务名称搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
  6. <date-range-picker v-model="query.createTime" class="date-item" />
  7. <el-select v-model="query.isSuccess" placeholder="日志状态" clearable size="small" class="filter-item" style="width: 110px" @change="toQuery">
  8. <el-option v-for="item in enabledTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
  9. </el-select>
  10. <el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
  11. <!-- 导出 -->
  12. <div style="display: inline-block;">
  13. <el-button
  14. :loading="downloadLoading"
  15. size="mini"
  16. class="filter-item"
  17. type="warning"
  18. icon="el-icon-download"
  19. @click="downloadMethod"
  20. >导出</el-button>
  21. </div>
  22. </div>
  23. <!--表格渲染-->
  24. <el-table v-loading="loading" :data="data" style="width: 100%;margin-top: -10px;">
  25. <el-table-column :show-overflow-tooltip="true" prop="jobName" label="任务名称" />
  26. <el-table-column :show-overflow-tooltip="true" prop="beanName" label="Bean名称" />
  27. <el-table-column :show-overflow-tooltip="true" prop="methodName" label="执行方法" />
  28. <el-table-column :show-overflow-tooltip="true" prop="params" width="120px" label="参数" />
  29. <el-table-column :show-overflow-tooltip="true" prop="cronExpression" label="cron表达式" />
  30. <el-table-column prop="createTime" label="异常详情" width="110px">
  31. <template slot-scope="scope">
  32. <el-button v-show="scope.row.exceptionDetail" size="mini" type="text" @click="info(scope.row.exceptionDetail)">查看详情</el-button>
  33. </template>
  34. </el-table-column>
  35. <el-table-column :show-overflow-tooltip="true" align="center" prop="time" width="100px" label="耗时(毫秒)" />
  36. <el-table-column align="center" prop="isSuccess" width="80px" label="状态">
  37. <template slot-scope="scope">
  38. <el-tag :type="scope.row.isSuccess ? 'success' : 'danger'">{{ scope.row.isSuccess ? '成功' : '失败' }}</el-tag>
  39. </template>
  40. </el-table-column>
  41. <el-table-column :show-overflow-tooltip="true" prop="createTime" label="创建日期" />
  42. </el-table>
  43. <el-dialog :visible.sync="errorDialog" append-to-body title="异常详情" width="85%">
  44. <pre>{{ errorInfo }}</pre>
  45. </el-dialog>
  46. <!--分页组件-->
  47. <el-pagination
  48. :total="total"
  49. :current-page="page + 1"
  50. :page-size="6"
  51. style="margin-top:8px;"
  52. layout="total, prev, pager, next"
  53. @size-change="sizeChange"
  54. @current-change="pageChange"
  55. />
  56. </el-dialog>
  57. </template>
  58. <script>
  59. import crud from '@/mixins/crud'
  60. import DateRangePicker from '@/components/DateRangePicker'
  61. export default {
  62. components: { DateRangePicker },
  63. mixins: [crud],
  64. data() {
  65. return {
  66. title: '任务日志',
  67. errorInfo: '', errorDialog: false,
  68. enabledTypeOptions: [
  69. { key: 'true', display_name: '成功' },
  70. { key: 'false', display_name: '失败' }
  71. ]
  72. }
  73. },
  74. methods: {
  75. doInit() {
  76. this.$nextTick(() => {
  77. this.init()
  78. })
  79. },
  80. // 获取数据前设置好接口地址
  81. beforeInit() {
  82. this.url = 'api/jobs/logs'
  83. this.size = 6
  84. return true
  85. },
  86. // 异常详情
  87. info(errorInfo) {
  88. this.errorInfo = errorInfo
  89. this.errorDialog = true
  90. }
  91. }
  92. }
  93. </script>
  94. <style scoped>
  95. .java.hljs{
  96. color: #444;
  97. background: #ffffff !important;
  98. }
  99. ::v-deep .el-dialog__body{
  100. padding: 0 20px 10px 20px !important;
  101. }
  102. </style>