feat: add detail
parent
5424d0b443
commit
3e04dde0e2
|
@ -0,0 +1,25 @@
|
||||||
|
<template>
|
||||||
|
<BasicModal v-bind="$attrs" @register="registerModal" title="查看详情">
|
||||||
|
<Description @register="registerDesc" />
|
||||||
|
</BasicModal>
|
||||||
|
</template>
|
||||||
|
<script lang="ts" setup name="InfraJobLogModal">
|
||||||
|
import { Description, useDescription } from '@/components/Description'
|
||||||
|
import { BasicModal, useModalInner } from '@/components/Modal'
|
||||||
|
import { descSchema } from './jobLog.data'
|
||||||
|
import { getJobLog } from '@/api/infra/jobLog'
|
||||||
|
import { ref } from 'vue'
|
||||||
|
|
||||||
|
const datas = ref()
|
||||||
|
|
||||||
|
const [registerDesc] = useDescription({
|
||||||
|
schema: descSchema,
|
||||||
|
data: datas
|
||||||
|
})
|
||||||
|
|
||||||
|
const [registerModal, { setModalProps }] = useModalInner(async (data) => {
|
||||||
|
setModalProps({ confirmLoading: false })
|
||||||
|
const res = await getJobLog(data.record.id)
|
||||||
|
datas.value = res
|
||||||
|
})
|
||||||
|
</script>
|
|
@ -12,12 +12,15 @@
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
|
<JobLogModal @register="registerModal" @success="reload()" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup name="InfraJobLog">
|
<script lang="ts" setup name="InfraJobLog">
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import { useI18n } from '@/hooks/web/useI18n'
|
import { useI18n } from '@/hooks/web/useI18n'
|
||||||
import { useMessage } from '@/hooks/web/useMessage'
|
import { useMessage } from '@/hooks/web/useMessage'
|
||||||
|
import { useModal } from '@/components/Modal'
|
||||||
|
import JobLogModal from './JobLogModal.vue'
|
||||||
import { IconEnum } from '@/enums/appEnum'
|
import { IconEnum } from '@/enums/appEnum'
|
||||||
import { BasicTable, useTable, TableAction } from '@/components/Table'
|
import { BasicTable, useTable, TableAction } from '@/components/Table'
|
||||||
import { JobLogExportReqVO, exportJobLog, getJobLogPage } from '@/api/infra/jobLog'
|
import { JobLogExportReqVO, exportJobLog, getJobLogPage } from '@/api/infra/jobLog'
|
||||||
|
@ -26,8 +29,9 @@ import { columns, searchFormSchema } from './jobLog.data'
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const { query } = useRoute()
|
const { query } = useRoute()
|
||||||
const { createConfirm, createMessage } = useMessage()
|
const { createConfirm, createMessage } = useMessage()
|
||||||
|
const [registerModal, { openModal }] = useModal()
|
||||||
|
|
||||||
const [registerTable, { getForm }] = useTable({
|
const [registerTable, { getForm, reload }] = useTable({
|
||||||
title: '定时任务日志列表',
|
title: '定时任务日志列表',
|
||||||
api: getJobLogPage,
|
api: getJobLogPage,
|
||||||
searchInfo: { id: query.id as unknown as number },
|
searchInfo: { id: query.id as unknown as number },
|
||||||
|
@ -44,8 +48,8 @@ const [registerTable, { getForm }] = useTable({
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
function handleDetail() {
|
function handleDetail(record: Recordable) {
|
||||||
console.info('detail')
|
openModal(true, { record })
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleExport() {
|
async function handleExport() {
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { DescItem } from '@/components/Description'
|
||||||
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
|
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
|
||||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
|
|
||||||
|
@ -89,58 +90,53 @@ export const searchFormSchema: FormSchema[] = [
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
export const formSchema: FormSchema[] = [
|
export const descSchema: DescItem[] = [
|
||||||
{
|
{
|
||||||
label: '任务编号',
|
label: '日志编号',
|
||||||
field: 'id',
|
field: 'id'
|
||||||
show: false,
|
|
||||||
component: 'Input'
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '任务名称',
|
label: '任务编号',
|
||||||
field: 'name',
|
field: 'jobId'
|
||||||
required: true,
|
|
||||||
component: 'Input'
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '处理器的名字',
|
label: '处理器的名字',
|
||||||
field: 'handlerName',
|
field: 'handlerName'
|
||||||
required: true,
|
|
||||||
dynamicDisabled: ({ values }) => !!values.id,
|
|
||||||
component: 'Input'
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '处理器的参数',
|
label: '处理器的参数',
|
||||||
field: 'handlerParam',
|
field: 'handlerParam'
|
||||||
component: 'Input'
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'CRON 表达式',
|
label: '第几次执行',
|
||||||
field: 'cronExpression',
|
field: 'executeIndex'
|
||||||
required: true,
|
|
||||||
component: 'Input'
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '重试次数',
|
label: '执行时间',
|
||||||
field: 'retryCount',
|
field: 'beginTime',
|
||||||
required: true,
|
render: (data) => {
|
||||||
helpMessage: '设置为 0 时,不进行重试',
|
return useRender.renderDate(data.beginTime) + ' ~ ' + useRender.renderDate(data.endTime)
|
||||||
defaultValue: 0,
|
}
|
||||||
component: 'InputNumber'
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '重试间隔',
|
label: '执行时长',
|
||||||
field: 'retryInterval',
|
field: 'duration',
|
||||||
required: true,
|
render: (curVal) => {
|
||||||
helpMessage: '单位:毫秒。设置为 0 时,无需间隔',
|
return useRender.renderText(curVal, ' 毫秒')
|
||||||
defaultValue: 0,
|
}
|
||||||
component: 'InputNumber',
|
|
||||||
suffix: '毫秒'
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '监控超时时间',
|
label: '任务状态',
|
||||||
field: 'monitorTimeout',
|
field: 'status',
|
||||||
component: 'Input',
|
render: (curVal) => {
|
||||||
suffix: '毫秒'
|
return useRender.renderDict(curVal, DICT_TYPE.INFRA_JOB_LOG_STATUS)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '执行结果',
|
||||||
|
field: 'duration',
|
||||||
|
render: (curVal) => {
|
||||||
|
return useRender.renderText(curVal, ' result')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue