9 天以前 | 潘志宝 | |
9 天以前 | 潘志宝 | |
2024-12-23 | dengzedong |
src/api/model/sche/model/index.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/api/model/sche/record/index.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/model/sche/scheme/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/model/sche/scheme/record/RecordForm.vue | 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/model/sche/scheme/record/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/api/model/sche/model/index.ts
@@ -88,13 +88,13 @@ const predictItemList = ref([] as PredictItemApi.MmPredictItemVO) predictItemList.value = await PredictItemApi.getMmPredictItemList({ status: CommonEnabled.ENABLE, itemtypename: 'NormalItem' status: CommonEnabled.ENABLE }) const normalItemList = [] if (predictItemList.value) { const predictNormalItemList = predictItemList.value.filter(e => e.itemtypename === 'NormalItem' && e.outPuts && e.outPuts.length > 0); if (predictNormalItemList && predictNormalItemList.length > 0) { // 过滤掉本身 predictItemList.value.filter(e => e.id !== id).forEach(item => { predictNormalItemList.filter(e => e.id !== id).forEach(item => { normalItemList.push( { value: item.id, @@ -127,18 +127,14 @@ }) } predictItemList.value = await PredictItemApi.getMmPredictItemList({ status: CommonEnabled.ENABLE, itemtypename: 'MergeItem' }) const predictMergeItemList = predictItemList.value.filter(e => e.itemtypename === 'MergeItem' && e.outPuts && e.outPuts.length > 0); const mergeItemList = [] if (predictItemList.value) { if (predictMergeItemList && predictMergeItemList.length > 0) { // 过滤掉本身 predictItemList.value.filter(e => e.id !== id).forEach(item => { predictMergeItemList.filter(e => e.id !== id).forEach(item => { mergeItemList.push( { id: item.id, id: item.outPuts[0].id, name: item.itemname } ) src/api/model/sche/record/index.ts
对比新文件 @@ -0,0 +1,15 @@ import request from '@/config/axios' export interface StScheduleRecordPageReqVO extends PageParam { schemeId?: string } // 查询ScheduleRecord列表 export const getScheduleRecordPage = (params: StScheduleRecordPageReqVO) => { return request.get({ url: '/model/sche/record/page', params }) } // 查询ScheduleRecord详情 export const getScheduleRecord = (id: string) => { return request.get({ url: '/model/sche/record/get?id=' + id}) } src/views/model/sche/scheme/index.vue
@@ -81,6 +81,14 @@ </el-button> <el-button link type="primary" @click="openRecordList(scope.row.id)" v-hasPermi="['sche:record:query']" > 日志 </el-button> <el-button link type="danger" @click="handleDelete(scope.row.id)" v-hasPermi="['sche:scheme:delete']" @@ -102,13 +110,14 @@ <!-- 表单弹窗:添加/修改 --> <ScheduleSchemeForm ref="formRef" @success="getList" /> <!-- 表单弹窗:添加/修改 --> <RecordList ref="recordRef" /> </template> <script lang="ts" setup> import {DICT_TYPE, getIntDictOptions} from '@/utils/dict' import {dateFormatter} from '@/utils/formatTime' import download from '@/utils/download' import * as ScheduleSchemeApi from '@/api/model/sche/scheme' import ScheduleSchemeForm from './ScheduleSchemeForm.vue' import RecordList from './record/index.vue' defineOptions({name: 'ScheduleScheme'}) @@ -171,6 +180,12 @@ } } /** 调用日志查看 */ const recordRef = ref() const openRecordList = (id?: string) => { recordRef.value.open(id) } /** 初始化 **/ onMounted(async () => { await getList() src/views/model/sche/scheme/record/RecordForm.vue
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>