81 lines
2.5 KiB
Vue
Raw Normal View History

2022-07-18 19:06:37 +08:00
<template>
<ContentWrap>
<!-- 列表 -->
2023-01-03 11:21:27 +08:00
<XTable @register="registerTable">
2022-11-22 17:07:30 +08:00
<template #toolbar_buttons>
<XButton
type="warning"
preIcon="ep:download"
:title="t('action.export')"
v-hasPermi="['infra:job:export']"
2023-01-04 16:33:51 +08:00
@click="exportList('定时任务详情.xls')"
2022-11-22 17:07:30 +08:00
/>
</template>
<template #beginTime_default="{ row }">
2022-07-18 19:06:37 +08:00
<span>{{
dayjs(row.beginTime).format('YYYY-MM-DD HH:mm:ss') +
' ~ ' +
dayjs(row.endTime).format('YYYY-MM-DD HH:mm:ss')
}}</span>
</template>
2022-11-22 17:07:30 +08:00
<template #duration_default="{ row }">
2022-07-18 19:06:37 +08:00
<span>{{ row.duration + ' 毫秒' }}</span>
</template>
2022-11-22 17:07:30 +08:00
<template #actionbtns_default="{ row }">
<XTextButton
preIcon="ep:view"
:title="t('action.detail')"
v-hasPermi="['infra:job:query']"
@click="handleDetail(row)"
/>
2022-07-18 19:06:37 +08:00
</template>
2023-01-03 11:21:27 +08:00
</XTable>
2022-07-18 19:06:37 +08:00
</ContentWrap>
2022-11-15 12:25:19 +08:00
<XModal v-model="dialogVisible" :title="dialogTitle">
2022-07-18 19:06:37 +08:00
<!-- 对话框(详情) -->
2022-12-06 23:46:13 +08:00
<Descriptions :schema="allSchemas.detailSchema" :data="detailData">
2022-07-18 19:06:37 +08:00
<template #retryInterval="{ row }">
<span>{{ row.retryInterval + '毫秒' }} </span>
</template>
<template #monitorTimeout="{ row }">
<span>{{ row.monitorTimeout > 0 ? row.monitorTimeout + ' 毫秒' : '未开启' }}</span>
</template>
</Descriptions>
<!-- 操作按钮 -->
<template #footer>
2022-11-29 20:41:02 +08:00
<XButton :title="t('dialog.close')" @click="dialogVisible = false" />
2022-07-18 19:06:37 +08:00
</template>
2022-11-15 12:25:19 +08:00
</XModal>
2022-07-18 19:06:37 +08:00
</template>
2022-11-23 22:26:25 +08:00
<script setup lang="ts" name="JobLog">
2022-11-22 17:07:30 +08:00
import { ref } from 'vue'
import dayjs from 'dayjs'
import { useI18n } from '@/hooks/web/useI18n'
2023-01-03 11:21:27 +08:00
import { useXTable } from '@/hooks/web/useXTable'
2022-11-22 17:07:30 +08:00
import * as JobLogApi from '@/api/infra/jobLog'
import { allSchemas } from './jobLog.data'
const { t } = useI18n() // 国际化
// 列表相关的变量
2023-01-03 11:21:27 +08:00
const [registerTable, { exportList }] = useXTable({
2022-11-22 17:07:30 +08:00
allSchemas: allSchemas,
getListApi: JobLogApi.getJobLogPageApi,
exportListApi: JobLogApi.exportJobLogApi
})
// ========== CRUD 相关 ==========
const dialogVisible = ref(false) // 是否显示弹出层
const dialogTitle = ref('') // 弹出层标题
// ========== 详情相关 ==========
2022-12-06 23:46:13 +08:00
const detailData = ref() // 详情 Ref
2022-11-22 17:07:30 +08:00
// 详情操作
2022-11-22 17:12:45 +08:00
const handleDetail = async (row: JobLogApi.JobLogVO) => {
2022-11-22 17:07:30 +08:00
// 设置数据
const res = JobLogApi.getJobLogApi(row.id)
2022-12-06 23:46:13 +08:00
detailData.value = res
2022-11-22 17:07:30 +08:00
dialogTitle.value = t('action.detail')
dialogVisible.value = true
}
</script>