From 8b40f521b99ba9e5af7bb38587e4a4a4a0599193 Mon Sep 17 00:00:00 2001 From: houzhongjian <houzhongyi@126.com> Date: 星期四, 02 一月 2025 09:41:42 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/api/model/sche/record/index.ts | 15 ++ src/views/model/sche/scheme/index.vue | 25 +++ src/views/model/pre/item/MmPredictItemChart.vue | 4 src/views/model/sche/scheme/record/index.vue | 153 +++++++++++++++++++++++++ src/api/model/sche/model/index.ts | 4 src/views/model/sche/model/ScheduleModelForm.vue | 103 ++++++++++++++++ .env.prod | 4 7 files changed, 296 insertions(+), 12 deletions(-) diff --git a/.env.prod b/.env.prod index a602754..3dfd239 100644 --- a/.env.prod +++ b/.env.prod @@ -4,7 +4,7 @@ VITE_DEV=false # 请求路径 -VITE_BASE_URL='http://10.50.37.62' +VITE_BASE_URL='http://10.88.4.131' # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务 VITE_UPLOAD_TYPE=server @@ -25,7 +25,7 @@ VITE_BASE_PATH=/plat # 数据采集服务所在服务器,映射截图图片用 -VITE_VIDEO_CAMERA_DOMAIN='10.50.37.62' +VITE_VIDEO_CAMERA_DOMAIN='10.88.4.131' # 输出路径 VITE_OUT_DIR=dist diff --git a/src/api/model/sche/model/index.ts b/src/api/model/sche/model/index.ts index d850247..0ac2b05 100644 --- a/src/api/model/sche/model/index.ts +++ b/src/api/model/sche/model/index.ts @@ -20,6 +20,7 @@ status: number, paramList: null, settingList: null + modelOut:null } export interface ModelParamVO { @@ -80,7 +81,8 @@ pointList.push( { id: item.id, - name: item.pointName + name: item.pointName, + itemNo : item.pointNo } ) }) diff --git a/src/api/model/sche/record/index.ts b/src/api/model/sche/record/index.ts new file mode 100644 index 0000000..f712041 --- /dev/null +++ b/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}) +} diff --git a/src/views/model/pre/item/MmPredictItemChart.vue b/src/views/model/pre/item/MmPredictItemChart.vue index 2670907..14afaed 100644 --- a/src/views/model/pre/item/MmPredictItemChart.vue +++ b/src/views/model/pre/item/MmPredictItemChart.vue @@ -79,6 +79,8 @@ dataForm.value.id = row.id; dataForm.value.itemName = row.itemname; if (row.id) { + myChart = echarts.init(chartDomPre.value); + myChart.clear() getDataList(); } } @@ -160,7 +162,6 @@ }) } - myChart = echarts.init(chartDomPre.value); const option = { title: { text: dataForm.value.itemName, @@ -208,7 +209,6 @@ ], series: seriesData, }; - myChart.clear() myChart.setOption(option); } catch (error) { console.error(error) diff --git a/src/views/model/sche/model/ScheduleModelForm.vue b/src/views/model/sche/model/ScheduleModelForm.vue index d9b6aa1..d09e47a 100644 --- a/src/views/model/sche/model/ScheduleModelForm.vue +++ b/src/views/model/sche/model/ScheduleModelForm.vue @@ -272,6 +272,83 @@ <!-- </template>--> <!-- </el-table-column>--> </el-table> + <el-divider content-position="left">模型下发配置</el-divider> + <el-row :gutter="20"> + <el-col :span="4"> + <el-button type="primary" size="small" @click="addRowOut()" >新增</el-button> + </el-col> + </el-row> + <el-table + :data="formData.modelOut" + border + style="width: 100%; margin-top: 5px;"> + <el-table-column prop="resultKey`" label="输出key" align="center" min-width="100"> + <template #default="scope"> + <el-input size="mini" v-model="scope.row.resultKey" style="width:100%;height:100%"/> + </template> + </el-table-column> + <el-table-column prop="resultType`" label="数据类型" align="center" min-width="100"> + <template #default="scope"> + <el-input size="mini" v-model="scope.row.resultType" style="width:100%;height:100%"/> + </template> + </el-table-column> + <el-table-column prop="resultPort" label="角标1" align="center" min-width="100"> + <template #default="scope"> + <el-input-number :min="0" clearable controls-position="right" size="mini" v-model="scope.row.resultPort" style="width:100%;height:100%"/> + </template> + </el-table-column> + <el-table-column prop="resultIndex" label="角标2" align="center" min-width="100"> + <template #default="scope"> + <el-input-number :min="0" clearable controls-position="right" size="mini" v-model="scope.row.resultIndex" style="width:100%;height:100%"/> + </template> + </el-table-column> + <el-table-column prop="isWrite" label="是否下发" align="center" min-width="100"> + <template #default="scope"> + <el-switch size="small" v-model="scope.row.isWrite" :active-value="1" + :inactive-value="0"/> + </template> + </el-table-column> + <el-table-column + prop="" + label="测点名称" + align="center" min-width="200"> + <template #default="scope"> + <el-select v-model="scope.row.pointNo" + filterable + placeholder="请选择"> + <el-option + v-for="(item, index) in modelparamListMap['DATAPOINT']" + :key="index" + :label="item.name" + :value="item.itemNo"/> + </el-select> + </template> + </el-table-column> + <el-table-column prop="disturbancePointNo’" label="无扰切换点位" align="center" min-width="200"> + <template #default="scope"> + <el-select v-model="scope.row.disturbancePointNo" + filterable + placeholder="请选择"> + <el-option + v-for="(item, index) in modelparamListMap['DATAPOINT']" + :key="index" + :label="item.name" + :value="item.itemNo"/> + </el-select> + </template> + </el-table-column> + <el-table-column label="操作" fixed="right" header-align="center" align="center" width="100"> + <template #default="scope"> + <el-button + @click="deleteModelOutRow(scope.$index)" + key="danger" + type="danger" + link + >删除 + </el-button> + </template> + </el-table-column> + </el-table> </el-form> <template #footer> <el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button> @@ -284,6 +361,7 @@ import * as ScheduleModelApi from '@/api/model/sche/model' import { CommonStatusEnum } from '@/utils/constants' import * as MpkApi from "@/api/model/mpk/mpk"; + import {generateUUID} from "@/utils"; defineOptions({ name: 'ScheduleModelForm' }) @@ -307,7 +385,8 @@ invocation: undefined, status: CommonStatusEnum.ENABLE, paramList: [], - settingList: [] + settingList: [], + modelOut: [] }) const formRules = reactive({ modelCode: [{ required: true, message: '模型编号不能为空', trigger: 'blur' }], @@ -413,7 +492,8 @@ invocation: undefined, status: CommonStatusEnum.ENABLE, paramList: [], - settingList: [] + settingList: [], + modelOut: [] } formRef.value?.resetFields() } @@ -490,4 +570,23 @@ function changeModelparamtype(row) { row.modelparamid = '' } + const addRowOut= function () { + if(formData.value.modelOut===undefined) { + formData.value.modelOut = [] + } + formData.value.modelOut.push({ + id: generateUUID(), + resultKey: undefined, + resultType: "double[][]", + port: 0, + index: 0, + isWrite: 1, + pointNo:undefined, + sort:undefined, + disturbancePointNo:undefined, + }) + } + const deleteModelOutRow = function (index) { + formData.value.modelOut.splice(index, 1) + } </script> diff --git a/src/views/model/sche/scheme/index.vue b/src/views/model/sche/scheme/index.vue index 6212a90..54f4b3f 100644 --- a/src/views/model/sche/scheme/index.vue +++ b/src/views/model/sche/scheme/index.vue @@ -52,7 +52,7 @@ <ContentWrap> <el-table v-loading="loading" :data="list"> <el-table-column label="方案编号" align="center" prop="code" min-width="100"/> - <el-table-column label="方案名称" align="center" prop="name" min-width="100"/> + <el-table-column label="方案名称" header-align="center" align="left" prop="name" min-width="100"/> <el-table-column label="触发方式" align="center" prop="triggerMethod" min-width="100"> <template #default="scope"> <dict-tag :type="DICT_TYPE.SCHE_TRIGGER_METHOD" :value="scope.row.triggerMethod" /> @@ -63,13 +63,13 @@ <el-table-column label="调整类型" align="center" prop="scheduleType" min-width="100"/> <el-table-column label=" 调整策略" align="center" prop="scheduleStrategy" min-width="100"/> <el-table-column label="调度时间" align="center" prop="scheduleTime" min-width="160" /> - <el-table-column label="备注" align="center" prop="remark" min-width="100" /> + <el-table-column label="备注" header-align="center" align="left" prop="remark" min-width="160" /> <el-table-column label="状态" align="center" prop="status" min-width="100"> <template #default="scope"> <dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" /> </template> </el-table-column> - <el-table-column label="操作" align="center" min-width="110" fixed="right"> + <el-table-column label="操作" align="center" min-width="100" fixed="right"> <template #default="scope"> <el-button link @@ -78,6 +78,14 @@ v-hasPermi="['sche:scheme:update']" > 编辑 + </el-button> + <el-button + link + type="primary" + @click="openRecordList(scope.row.id)" + v-hasPermi="['sche:record:query']" + > + 日志 </el-button> <el-button link @@ -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() 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