houzhongjian
2024-07-23 8501060c4f921d1e744c477e4dc08eb47b52693c
提交 | 用户 | 时间
850106 1 <template>
H 2   <el-dialog :visible.sync="visible" :title="$t('schedule.log')" :close-on-click-modal="false" :close-on-press-escape="false" width="75%">
3     <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
4       <el-form-item>
5         <el-input v-model="dataForm.jobId" :placeholder="$t('schedule.jobId')" clearable></el-input>
6       </el-form-item>
7       <el-form-item>
8         <el-button @click="getDataList()">{{ $t('query') }}</el-button>
9       </el-form-item>
10     </el-form>
11     <el-table
12       v-loading="dataListLoading"
13       :data="dataList"
14       border
15       @sort-change="dataListSortChangeHandle"
16       height="460"
17       style="width: 100%;">
18       <el-table-column prop="jobId" :label="$t('schedule.jobId')" header-align="center" align="center" width="80"></el-table-column>
19       <el-table-column prop="beanName" :label="$t('schedule.beanName')" header-align="center" align="center"></el-table-column>
20       <el-table-column prop="params" :label="$t('schedule.params')" header-align="center" align="center"></el-table-column>
21       <el-table-column prop="status" :label="$t('schedule.status')" header-align="center" align="center">
22         <template slot-scope="scope">
23           <el-tag v-if="scope.row.status === 1" size="small">{{ $t('schedule.statusLog1') }}</el-tag>
24           <el-tag v-else type="danger" size="small" @click.native="showErrorInfo(scope.row.id)" style="cursor: pointer;">{{ $t('schedule.statusLog0') }}</el-tag>
25         </template>
26       </el-table-column>
27       <el-table-column prop="times" :label="$t('schedule.times')" header-align="center" align="center"></el-table-column>
28       <el-table-column prop="createDate" :label="$t('schedule.createDate')" header-align="center" align="center" width="180"></el-table-column>
29     </el-table>
30     <el-pagination
31       :current-page="page"
32       :page-sizes="[10, 20, 50, 100]"
33       :page-size="limit"
34       :total="total"
35       layout="total, sizes, prev, pager, next, jumper"
36       @size-change="pageSizeChangeHandle"
37       @current-change="pageCurrentChangeHandle">
38     </el-pagination>
39   </el-dialog>
40 </template>
41
42 <script>
43 import mixinViewModule from '@/mixins/view-module'
44 export default {
45   mixins: [mixinViewModule],
46   data () {
47     return {
48       visible: false,
49       mixinViewModuleOptions: {
50         getDataListURL: '/iailab-ntt-system/sys/scheduleLog/page',
51         getDataListIsPage: true
52       },
53       dataForm: {
54         jobId: ''
55       }
56     }
57   },
58   methods: {
59     init () {
60       this.visible = true
61       this.getDataList()
62     },
63     // 失败信息
64     showErrorInfo (id) {
65       this.$http.get(`/iailab-ntt-data/sys/scheduleLog/${id}`).then(({ data: res }) => {
66         if (res.code !== 0) {
67           return this.$message.error(res.msg)
68         }
69         this.$alert(res.data.error)
70       }).catch(() => {})
71     }
72   }
73 }
74 </script>