|
|
@@ -0,0 +1,178 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<crud-template |
|
|
|
class="as-weight" |
|
|
|
:ref="(el) => (crudRef = el)" |
|
|
|
:home-data="field" |
|
|
|
@btnSearch="btnSearch" |
|
|
|
@refreshLeft="refreshLeft" |
|
|
|
:tableData="tableData" |
|
|
|
@CurrentChange="handleCurrentChange" |
|
|
|
@pageSizeChange=" |
|
|
|
(val) => { |
|
|
|
field.paging.currentPage = 1 |
|
|
|
field.paging.pageSize = val |
|
|
|
getList() |
|
|
|
} |
|
|
|
" |
|
|
|
> |
|
|
|
<template #search> |
|
|
|
<div class="date-label">执行时间:</div> |
|
|
|
<el-date-picker |
|
|
|
unlink-panels |
|
|
|
v-model="timeValue" |
|
|
|
type="datetimerange" |
|
|
|
range-separator="到" |
|
|
|
start-placeholder="起始执行日期" |
|
|
|
end-placeholder="结束执行日期" |
|
|
|
value-format="YYYY-MM-DD HH:mm:ss" |
|
|
|
format="YYYY-MM-DD HH:mm:ss" |
|
|
|
@change="dateChangeHandle" |
|
|
|
/> |
|
|
|
<div class="date-label">触发类型:</div> |
|
|
|
<el-select |
|
|
|
v-model="searchForm.bySystem" |
|
|
|
placeholder="请选择请求类型" |
|
|
|
style="width: 200px" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="(item, index) in typeOptions" |
|
|
|
:key="index" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
<div class="date-label">耗时大于:</div> |
|
|
|
<el-input |
|
|
|
v-model="searchForm.execTime" |
|
|
|
style="width: 150px" |
|
|
|
placeholder="" |
|
|
|
type="number" |
|
|
|
> |
|
|
|
<template #append>ms</template> |
|
|
|
</el-input> |
|
|
|
</template> |
|
|
|
</crud-template> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<!-- bdsq定时器日志 --> |
|
|
|
<script lang="ts" setup> |
|
|
|
// @ts-ignore crudFrom模板 |
|
|
|
import CrudTemplate from '@/crud/index.vue' |
|
|
|
import { ref, onMounted, computed, toRaw } from 'vue' |
|
|
|
import { ElMessage } from 'element-plus' |
|
|
|
// 请求函数 |
|
|
|
import BaseService from '@/utils/baseService' |
|
|
|
import { getDefaultTime } from '@/views/settlement/exportFn' |
|
|
|
//crud配置 |
|
|
|
import crudConfig from './crudConfig' |
|
|
|
import { useRoute } from 'vue-router' |
|
|
|
const route = useRoute() |
|
|
|
// 拿到配置 |
|
|
|
const { field, typeOptions } = crudConfig() |
|
|
|
const defaultTime: any = getDefaultTime('day', 1, 'YYYY-MM-DD HH:mm:ss') |
|
|
|
const timeValue = ref(defaultTime) // 筛选时间 |
|
|
|
function dateChangeHandle(val) { |
|
|
|
if (val) { |
|
|
|
searchForm.value.startTime = val[0] |
|
|
|
searchForm.value.endTime = val[1] |
|
|
|
} else { |
|
|
|
searchForm.value.startTime = '' |
|
|
|
searchForm.value.endTime = '' |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 获取数据,查询条件 |
|
|
|
const searchForm = ref({ |
|
|
|
startTime: defaultTime[0], //开始时间 |
|
|
|
endTime: defaultTime[1], //结束时间 |
|
|
|
execTime: 0, //耗时时间 |
|
|
|
bySystem: '', //不填为全部 true为系统触发 false为手工触发 |
|
|
|
}) |
|
|
|
//整个crud虚拟dom |
|
|
|
const crudRef = ref() |
|
|
|
|
|
|
|
const tableData = ref([]) |
|
|
|
// 搜索按钮 |
|
|
|
function btnSearch() { |
|
|
|
field.value.paging.currentPage = 1 |
|
|
|
getList() |
|
|
|
} |
|
|
|
// 搜索重置 |
|
|
|
function refreshLeft() { |
|
|
|
field.value.paging.currentPage = 1 |
|
|
|
searchForm.value = { |
|
|
|
startTime: defaultTime[0], //开始时间 |
|
|
|
endTime: defaultTime[1], //结束时间 |
|
|
|
execTime: 0, //耗时时间 |
|
|
|
bySystem: '', //不填为全部 true为系统触发 false为手工触发 |
|
|
|
} |
|
|
|
tableData.value = [] |
|
|
|
getList() |
|
|
|
} |
|
|
|
onMounted(() => { |
|
|
|
getList() |
|
|
|
}) |
|
|
|
|
|
|
|
// 处理请求参数 |
|
|
|
const handleParams = () => { |
|
|
|
let params: any = { |
|
|
|
pageNo: field.value.paging.currentPage, |
|
|
|
pageSize: field.value.paging.pageSize, |
|
|
|
} |
|
|
|
for (const key in searchForm.value) { |
|
|
|
let data = searchForm.value[key] |
|
|
|
if (data || data === 0 || data === false) { |
|
|
|
params[key] = data |
|
|
|
} |
|
|
|
} |
|
|
|
return params |
|
|
|
} |
|
|
|
// 获取数据 |
|
|
|
function getList() { |
|
|
|
const params = handleParams() |
|
|
|
crudRef.value.tableLoding = true //表格loading效果 |
|
|
|
BaseService.postN('/bdsq/system/schedulelog/manage', params).then( |
|
|
|
(res: any) => { |
|
|
|
crudRef.value.tableLoding = false |
|
|
|
if (res && res.statusCode === 0) { |
|
|
|
let bizContent = res.data |
|
|
|
console.log(bizContent, '请求日志返回') |
|
|
|
|
|
|
|
let data = bizContent.result || [] |
|
|
|
tableData.value = data |
|
|
|
field.value.paging.total = bizContent.totalCount |
|
|
|
} else { |
|
|
|
ElMessage.error(res.message) |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
// 取消 |
|
|
|
function cancel() { |
|
|
|
crudRef.value.reset() |
|
|
|
crudRef.value.dialogFormVisible = false |
|
|
|
} |
|
|
|
// 处理当前页数 |
|
|
|
function handleCurrentChange(val: number) { |
|
|
|
field.value.paging.currentPage = val |
|
|
|
getList() |
|
|
|
} |
|
|
|
// 生成数据 |
|
|
|
function handleCreate() { |
|
|
|
BaseService.post('09a4bc8e4e1f4ca49b25c9afbaa2c063', { |
|
|
|
...searchForm.value, |
|
|
|
}).then((res: any) => { |
|
|
|
if (res && res.statusCode === 0) { |
|
|
|
ElMessage.success('生成成功') |
|
|
|
getList() |
|
|
|
} else { |
|
|
|
ElMessage.error(res.message) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
/***********上传下载**************/ |
|
|
|
</script> |
|
|
|
<style scoped lang="less"></style> |