From 291bf570b2106cb99b0e689af7d6ccaacc9e5c1c Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期三, 25 十二月 2024 18:10:42 +0800 Subject: [PATCH] Merge branch 'master' of http://dlindusit.com:53929/r/iailab-plat-ui-vue3 --- src/views/model/sche/scheme/record/index.vue | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 153 insertions(+), 0 deletions(-) diff --git a/src/views/model/sche/scheme/record/index.vue b/src/views/model/sche/scheme/record/index.vue new file mode 100644 index 0000000..4d74cda --- /dev/null +++ b/src/views/model/sche/scheme/record/index.vue @@ -0,0 +1,153 @@ +<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> -- Gitblit v1.9.3