dongyukun
2025-05-27 53a86ab33c9b6ab0e2c75853d60eae31e60d4d8f
调度建议快照
已修改5个文件
104 ■■■■ 文件已修改
src/api/model/sche/suggest/suggestSnapshotRecord.ts 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/dict.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/model/sche/snapshotConf/det/configDetForm.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/model/sche/snapshotConf/det/index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/model/sche/suggest/suggestSnapshot.vue 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/model/sche/suggest/suggestSnapshotRecord.ts
@@ -1,16 +1,12 @@
// 建议快照记录
import request from "@/config/axios";
export interface ChartListReqVO extends PageParam {
  chooseDataList: []
}
// 列表
export const getList = (id) => {
  return request.get({ url: '/model/suggest/snapshot/record/list?operationId=' + id })
}
// 图表
export const getChartList = (params: ChartListReqVO) => {
  return request.get({ url: '/model/suggest/snapshot/record/chartList' , params})
export const getChartList = (data : selectedDataList) => {
  return request.post({ url: '/model/suggest/snapshot/record/getChartData' , data})
}
src/utils/dict.ts
@@ -168,6 +168,7 @@
  RESULT_TYPE = 'result_type',
  MATLAB_PLATFORM= 'matlab_platform',
  MATLAB_VERSION= 'matlab_version',
  SUGGEST_SNAPSHOT_DATA_TYPE= 'suggest_snapshot_data_type',
  // ========== DATA - 数据平台模块  ==========
  DATA_FIELD_TYPE = 'data_field_type',
  TAG_DATA_TYPE = 'tag_data_type',
src/views/model/sche/snapshotConf/det/configDetForm.vue
@@ -10,7 +10,14 @@
      <el-row :gutter="24">
        <el-col :span="12">
          <el-form-item label="数据类型" prop="dataType">
            <el-input v-model="formData.dataType" placeholder=""/>
            <el-select v-model="formData.dataType" placeholder="请选择">
              <el-option
                v-for="dict in getStrDictOptions(DICT_TYPE.SUGGEST_SNAPSHOT_DATA_TYPE)"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
@@ -84,9 +91,9 @@
<script lang="ts" setup>
  import * as ConfigDetApi from '@/api/model/sche/suggest/snapshotConfigDet'
import {deleteIcon} from "@/api/model/mpk/icon";
  import {DICT_TYPE, getIntDictOptions, getStrDictOptions} from '@/utils/dict'
defineOptions({ name: 'ConfigDetForm' })
const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗
@@ -122,7 +129,7 @@
    dialogTitle.value = t('action.' + type)
    formType.value = type
    resetForm()
    formData.confId = confId
    formData.value.confId = confId
    // 修改时,设置数据
    if (id) {
      formLoading.value = true
src/views/model/sche/snapshotConf/det/index.vue
@@ -60,7 +60,11 @@
        :data="list"
        row-key="id"
      >
        <el-table-column prop="dataType" label="数据类型"/>
        <el-table-column prop="dataType" align="center" label="数据类型">
          <template #default="scope">
            <dict-tag :type="DICT_TYPE.SUGGEST_SNAPSHOT_DATA_TYPE" :value="scope.row.dataType"/>
          </template>
        </el-table-column>
        <el-table-column prop="dataName" label="数据名称"/>
        <el-table-column prop="dataNo" label="数据编号"/>
        <el-table-column prop="leftLength" label="左侧长度(min)"/>
@@ -105,8 +109,8 @@
import {dateFormatter} from '@/utils/formatTime'
import * as configDetApi from '@/api/model/sche/suggest/snapshotConfigDet'
import ConfigDetForm from './configDetForm.vue'
import type {DrawerProps} from "element-plus";
  import {DICT_TYPE, getIntDictOptions, getStrDictOptions} from '@/utils/dict'
defineOptions({name: 'ConfigDet'})
src/views/model/sche/suggest/suggestSnapshot.vue
@@ -69,53 +69,44 @@
    loading.value = true
    try {
      const chartData = await suggestSnapshotApi.getChartList({
        chooseDataList: selectedData.value
      })
      const selectedDataList = selectedData.value.map(code =>
        dataList.value.find(d => d.dataNo === code)
      ).filter(Boolean) // 过滤无效项
      const chartData = await suggestSnapshotApi.getChartList(
        selectedDataList
      )
      // const chartData =[
      //   {
      //     "dataNo": "F0000101228",
      //     "categories": [
      //       "2024-02-01T00:00:00",
      //       "2024-02-01T02:00:00",
      //       "2024-02-01T04:00:00",
      //       "2024-02-01T06:00:00",
      //       "2024-02-01T08:00:00",
      //       "2024-02-01T10:00:00",
      //       "2024-02-01T12:00:00",
      //       "2024-02-01T14:00:00",
      //       "2024-02-01T16:00:00",
      //       "2024-02-01T18:00:00"
      //     ],
      //     "series": [
      //       {
      //         "name": "温度",
      //         "data": [22.1, 21.8, 21.5, 22.3, 24.5, 26.7, 28.2, 27.9, 25.6, 23.4]
      //       }
      //     "dataList": [
      //       ["2024-02-01 00:00:00", 220.1],
      //       ["2024-02-01 01:00:00", 219.8],
      //       ["2024-02-01 02:00:00", 220.2],
      //       ["2024-02-01 03:00:00", 219.9],
      //       ["2024-02-01 04:00:00", 220.5],
      //       ["2024-02-01 05:00:00", 221.0],
      //       ["2024-02-01 06:00:00", 220.8],
      //       ["2024-02-01 07:00:00", 220.6],
      //       ["2024-02-01 08:00:00", 220.3],
      //       ["2024-02-01 09:00:00", 220.0]
      //     ]
      //   },
      //   {
      //     "dataNo": "F0000100152",
      //     "categories": [
      //       "2024-02-01T00:00:00",
      //       "2024-02-01T02:00:00",
      //       "2024-02-01T04:00:00",
      //       "2024-02-01T06:00:00",
      //       "2024-02-01T08:00:00",
      //       "2024-02-01T10:00:00",
      //       "2024-02-01T12:00:00",
      //       "2024-02-01T14:00:00",
      //       "2024-02-01T16:00:00",
      //       "2024-02-01T18:00:00"
      //     ],
      //     "series": [
      //       {
      //         "name": "电压",
      //         "data": [220.1, 219.8, 220.2, 219.9, 220.5, 221.0, 220.8, 220.6, 220.3, 220.0]
      //       }
      //     "dataList": [
      //       ["2024-02-01 00:00:00", 220.1],
      //       ["2024-02-01 01:00:00", 219.8],
      //       ["2024-02-01 02:00:00", 220.2],
      //       ["2024-02-01 03:00:00", 219.9],
      //       ["2024-02-01 04:00:00", 220.5],
      //       ["2024-02-01 05:00:00", 221.0],
      //       ["2024-02-01 06:00:00", 220.8],
      //       ["2024-02-01 07:00:00", 220.6],
      //       ["2024-02-01 08:00:00", 220.3],
      //       ["2024-02-01 09:00:00", 220.0]
      //     ]
      //   }
      // ]
      // ];
      destroyCharts()
      // 生成图表配置数据
@@ -160,15 +151,12 @@
        },
        tooltip: { trigger: 'axis' },
        grid: { top: 30, left: '3%', right: '5%', bottom: 20 },
        xAxis: {
          type: 'category',
          data: chartInfo.data?.categories || []
        },
        xAxis: {type: 'category'},
        yAxis: { type: 'value' },
        dataZoom: [{ type: 'inside' }],
        series: [{
          type: 'line',
          data: chartInfo.data?.series?.[0]?.data || [],
          data: chartInfo.data?.dataList || [],
          lineStyle: { color: '#5B8FF9', width: 1 }
        }]
      }