<template>
|
<el-drawer
|
v-model="drawer"
|
size="50%"
|
title="调度日志"
|
:direction="direction"
|
:before-close="handleClose"
|
>
|
<!-- 搜索 -->
|
<ContentWrap>
|
<el-form
|
class="-mb-15px"
|
:model="queryParams"
|
ref="queryFormRef"
|
:inline="true"
|
label-width="68px"
|
>
|
<el-form-item>
|
<el-date-picker
|
v-model="queryParams.startTime"
|
format="YYYY-MM-DD HH:mm:00"
|
value-format="YYYY-MM-DD HH:mm:00"
|
type="datetime"
|
placeholder="选择日期时间"
|
/>
|
</el-form-item>
|
<el-form-item>
|
<el-date-picker
|
v-model="queryParams.endTime"
|
format="YYYY-MM-DD HH:mm:00"
|
value-format="YYYY-MM-DD HH:mm:00"
|
type="datetime"
|
placeholder="选择日期时间"
|
/>
|
</el-form-item>
|
<el-form-item>
|
<el-button @click="handleQuery">
|
<Icon icon="ep:search" class="mr-5px" />
|
搜索
|
</el-button>
|
<el-button @click="resetQuery">
|
<Icon icon="ep:refresh" class="mr-5px" />
|
重置
|
</el-button>
|
</el-form-item>
|
</el-form>
|
</ContentWrap>
|
<!-- 列表 -->
|
<ContentWrap>
|
<el-table v-loading="loading" :data="list">
|
<el-table-column
|
prop="scheduleTime"
|
label="调度时间"
|
header-align="center"
|
align="left"
|
min-width="150"
|
/>
|
<el-table-column
|
prop="resultCode"
|
label="结果状态"
|
header-align="center"
|
align="center"
|
/>
|
<el-table-column
|
prop="resultData"
|
label="结果数据"
|
header-align="center"
|
align="center"
|
min-width="400"
|
/>
|
</el-table>
|
<!-- 分页 -->
|
<Pagination
|
:total="total"
|
v-model:page="queryParams.pageNo"
|
v-model:limit="queryParams.pageSize"
|
@pagination="getList"
|
/>
|
</ContentWrap>
|
</el-drawer>
|
</template>
|
<script lang="ts" setup>
|
import type { DrawerProps } from 'element-plus'
|
import * as ScheduleRecordApi from "@/api/model/sche/record";
|
import {reactive, ref} from "vue";
|
|
defineOptions({name: 'RecordList'})
|
|
const message = useMessage() // 消息弹窗
|
const {t} = useI18n() // 国际化
|
|
const drawer = ref(false)
|
const direction = ref<DrawerProps['direction']>('rtl')
|
const loading = ref(true) // 列表的加载中
|
const total = ref(0) // 列表的总页数
|
const list = ref([]) // 列表的数据
|
const queryParams = reactive({
|
pageNo: 1,
|
pageSize: 10,
|
schemeId: undefined,
|
startTime: undefined,
|
endTime: undefined,
|
})
|
const queryFormRef = ref() // 搜索的表单
|
const exportLoading = ref(false) // 导出的加载中
|
|
/** 查询列表 */
|
const getList = async () => {
|
loading.value = true
|
try {
|
const page = await ScheduleRecordApi.getScheduleRecordPage(queryParams)
|
list.value = page.list
|
total.value = page.total
|
} finally {
|
loading.value = false
|
}
|
}
|
|
/** 搜索按钮操作 */
|
const handleQuery = () => {
|
queryParams.pageNo = 1
|
getList()
|
}
|
|
/** 重置按钮操作 */
|
const resetQuery = () => {
|
queryFormRef.value.resetFields()
|
handleQuery()
|
}
|
|
/** 打开弹窗 */
|
const open = async (id?: string) => {
|
resetForm()
|
drawer.value = true
|
queryParams.schemeId = id
|
if (id) {
|
getList()
|
}
|
}
|
defineExpose({open}) // 提供 open 方法,用于打开弹窗
|
|
/** 重置表单 */
|
const resetForm = () => {
|
queryParams.pageNo = 1
|
queryParams.pageSize = 10
|
queryParams.schemeId = ''
|
queryParams.startTime = undefined
|
queryParams.endTime = undefined
|
}
|
const handleClose = (done: () => void) => {
|
drawer.value = false
|
}
|
</script>
|