소스 검색

污染物信息查看功能

dumingliang 5 일 전
부모
커밋
eec103e204

+ 27 - 0
docs/init-dict-biz-type.sql

@@ -0,0 +1,27 @@
+-- =============================================
+-- 业务类型数据字典初始化脚本
+-- 字典类型编码: gx_biz_type
+-- =============================================
+
+-- 1. 插入字典类型
+INSERT INTO sys_dict_type (dict_name, dict_type, status, create_by, create_time, update_by, update_time, remark)
+VALUES ('业务类型', 'gx_biz_type', '0', 'admin', SYSDATE, 'admin', SYSDATE, '数据交换业务域的业务类型');
+
+-- 2. 插入字典数据
+INSERT INTO sys_dict_data (dict_type, dict_value, dict_label, dict_sort, status, create_by, create_time, update_by, update_time, remark)
+VALUES ('gx_biz_type', '水位', '水位', 1, '0', 'admin', SYSDATE, 'admin', SYSDATE, '水位相关业务');
+
+INSERT INTO sys_dict_data (dict_type, dict_value, dict_label, dict_sort, status, create_by, create_time, update_by, update_time, remark)
+VALUES ('gx_biz_type', '水质', '水质', 2, '0', 'admin', SYSDATE, 'admin', SYSDATE, '水质相关业务');
+
+INSERT INTO sys_dict_data (dict_type, dict_value, dict_label, dict_sort, status, create_by, create_time, update_by, update_time, remark)
+VALUES ('gx_biz_type', '调度', '调度', 3, '0', 'admin', SYSDATE, 'admin', SYSDATE, '调度相关业务');
+
+INSERT INTO sys_dict_data (dict_type, dict_value, dict_label, dict_sort, status, create_by, create_time, update_by, update_time, remark)
+VALUES ('gx_biz_type', '工程', '工程', 4, '0', 'admin', SYSDATE, 'admin', SYSDATE, '工程相关业务');
+
+-- =============================================
+-- 后续如需扩增业务类型,直接执行以下INSERT语句即可:
+-- =============================================
+-- INSERT INTO sys_dict_data (dict_type, dict_value, dict_label, dict_sort, status, create_by, create_time, update_by, update_time, remark)
+-- VALUES ('gx_biz_type', '新类型值', '新类型名称', 排序号, '0', 'admin', SYSDATE, 'admin', SYSDATE, '备注说明');

+ 25 - 0
docs/init-gx-st-wry.sql

@@ -0,0 +1,25 @@
+-- =============================================
+-- 行政区污水处理数据表格初始化脚本
+-- 表名: gx_st_wry
+-- =============================================
+
+CREATE TABLE gx_st_wry (
+    ID BIGINT PRIMARY KEY IDENTITY(1,1),
+    BIZ_CODE VARCHAR2(50) NOT NULL COMMENT '业务域编码',
+    STNM VARCHAR2(100) NOT NULL COMMENT '行政区名称',
+    YEAR INT NOT NULL COMMENT '年份',
+    COD DECIMAL(10,2) COMMENT 'COD指标值',
+    NH3 DECIMAL(10,2) COMMENT '氨氮指标值',
+    TN DECIMAL(10,2) COMMENT '总氮指标值',
+    TP DECIMAL(10,2) COMMENT '总磷指标值',
+    REMARK VARCHAR2(500) COMMENT '备注',
+    CREATE_BY VARCHAR2(64) COMMENT '创建人',
+    CREATE_TIME DATETIME DEFAULT SYSDATE COMMENT '创建时间',
+    UPDATE_BY VARCHAR2(64) COMMENT '更新人',
+    UPDATE_TIME DATETIME DEFAULT SYSDATE COMMENT '更新时间',
+    DEL_FLAG CHAR(1) DEFAULT '0' COMMENT '删除标志:0存在,1删除'
+);
+
+CREATE INDEX idx_gx_st_wry_biz_code ON gx_st_wry(BIZ_CODE);
+CREATE INDEX idx_gx_st_wry_stnm ON gx_st_wry(STNM);
+CREATE INDEX idx_gx_st_wry_year ON gx_st_wry(YEAR);

+ 38 - 0
gw-admin/src/main/java/com/goldenwater/web/controller/gx/GxStWryController.java

@@ -0,0 +1,38 @@
+package com.goldenwater.web.controller.gx;
+
+import java.util.List;
+
+import com.goldenwater.common.annotation.Anonymous;
+import com.goldenwater.common.core.controller.BaseController;
+import com.goldenwater.common.core.domain.AjaxResult;
+import com.goldenwater.gx.domain.GxStWry;
+import com.goldenwater.gx.service.IGxStWryService;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import jakarta.annotation.Resource;
+
+@RestController
+@RequestMapping("/gx/stWry")
+public class GxStWryController extends BaseController {
+
+    @Resource
+    private IGxStWryService gxStWryService;
+
+    @Anonymous
+    @GetMapping("/front/latest/{bizCode}")
+    public AjaxResult frontLatest(@PathVariable String bizCode) {
+        return success(gxStWryService.selectWryLatestByBizCode(bizCode));
+    }
+
+    @Anonymous
+    @GetMapping("/front/history")
+    public AjaxResult frontHistory(
+            @RequestParam(value = "bizCode") String bizCode,
+            @RequestParam(value = "stnm") String stnm) {
+        return success(gxStWryService.selectWryHistoryByBizCodeAndStnm(bizCode, stnm));
+    }
+}

+ 28 - 0
gw-gx/src/main/java/com/goldenwater/gx/domain/GxStWry.java

@@ -0,0 +1,28 @@
+package com.goldenwater.gx.domain;
+
+import java.io.Serializable;
+
+import com.goldenwater.common.core.domain.BaseEntity;
+import lombok.Data;
+
+@Data
+public class GxStWry extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    private String bizCode;
+
+    private String stnm;
+
+    private Integer year;
+
+    private Double cod;
+
+    private Double nh3;
+
+    private Double tn;
+
+    private Double tp;
+}

+ 11 - 0
gw-gx/src/main/java/com/goldenwater/gx/mapper/GxStWryMapper.java

@@ -0,0 +1,11 @@
+package com.goldenwater.gx.mapper;
+
+import java.util.List;
+import com.goldenwater.gx.domain.GxStWry;
+
+public interface GxStWryMapper {
+
+    List<GxStWry> selectWryLatestByBizCode(String bizCode);
+
+    List<GxStWry> selectWryHistoryByBizCodeAndStnm(String bizCode, String stnm);
+}

+ 11 - 0
gw-gx/src/main/java/com/goldenwater/gx/service/IGxStWryService.java

@@ -0,0 +1,11 @@
+package com.goldenwater.gx.service;
+
+import java.util.List;
+import com.goldenwater.gx.domain.GxStWry;
+
+public interface IGxStWryService {
+
+    List<GxStWry> selectWryLatestByBizCode(String bizCode);
+
+    List<GxStWry> selectWryHistoryByBizCodeAndStnm(String bizCode, String stnm);
+}

+ 26 - 0
gw-gx/src/main/java/com/goldenwater/gx/service/impl/GxStWryServiceImpl.java

@@ -0,0 +1,26 @@
+package com.goldenwater.gx.service.impl;
+
+import java.util.List;
+import org.springframework.stereotype.Service;
+
+import jakarta.annotation.Resource;
+import com.goldenwater.gx.domain.GxStWry;
+import com.goldenwater.gx.mapper.GxStWryMapper;
+import com.goldenwater.gx.service.IGxStWryService;
+
+@Service("gxStWryService")
+public class GxStWryServiceImpl implements IGxStWryService {
+
+    @Resource
+    private GxStWryMapper gxStWryMapper;
+
+    @Override
+    public List<GxStWry> selectWryLatestByBizCode(String bizCode) {
+        return gxStWryMapper.selectWryLatestByBizCode(bizCode);
+    }
+
+    @Override
+    public List<GxStWry> selectWryHistoryByBizCodeAndStnm(String bizCode, String stnm) {
+        return gxStWryMapper.selectWryHistoryByBizCodeAndStnm(bizCode, stnm);
+    }
+}

+ 2 - 2
gw-gx/src/main/resources/mapper/gx/GxExchangeStationMapper.xml

@@ -55,8 +55,8 @@
         <if test="stnm != null and stnm != ''">
             AND s.stnm like '%' || #{stnm} || '%'
         </if>
-        <if test="state != null and state != ''">
-            AND s.state = #{state}
+        <if test="delFlag != null and delFlag != ''">
+            AND s.del_flag = #{delFlag}
         </if>
         order by s.create_time desc
     </select>

+ 31 - 0
gw-gx/src/main/resources/mapper/gx/GxStWryMapper.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.goldenwater.gx.mapper.GxStWryMapper">
+
+    <resultMap type="com.goldenwater.gx.domain.GxStWry" id="GxStWryResult">
+        <result property="bizCode"      column="biz_code"      />
+        <result property="stnm"         column="stnm"          />
+        <result property="year"         column="year"          />
+        <result property="cod"          column="cod"           />
+        <result property="nh3"          column="nh3"           />
+        <result property="tn"           column="tn"            />
+        <result property="tp"           column="tp"            />
+    </resultMap>
+
+    <select id="selectWryLatestByBizCode" parameterType="String" resultMap="GxStWryResult">
+        SELECT * FROM (
+            SELECT t.*, ROW_NUMBER() OVER(PARTITION BY t.stnm ORDER BY t.year DESC) rn
+            FROM gx_st_wry t
+            WHERE t.biz_code = #{bizCode}
+        ) tmp
+        WHERE rn = 1
+        ORDER BY tmp.stcd asc
+    </select>
+
+    <select id="selectWryHistoryByBizCodeAndStnm" parameterType="map" resultMap="GxStWryResult">
+        SELECT * FROM gx_st_wry
+        WHERE biz_code = #{bizCode} AND stnm = #{stnm}
+        ORDER BY year DESC
+    </select>
+
+</mapper>

+ 277 - 98
gw-ui/src/views/front/DataCommon.vue

@@ -22,7 +22,7 @@
           </div>
         </div>
         <div class="search-right">
-          <el-input v-model="searchKeyword" placeholder="请输入站名" @keyup.enter="loadStationData" clearable style="width: 200px">
+          <el-input v-model="searchKeyword" placeholder="请输入站名/行政区名" @keyup.enter="loadData" clearable style="width: 200px">
             <template #prefix>
               <el-icon><Search /></el-icon>
             </template>
@@ -31,21 +31,31 @@
       </div>
       
       <div class="table-container">
-        <el-table :data="tableData" stripe border v-loading="loading">
-          <el-table-column prop="stcd" label="站码" width="100" />
-          <el-table-column prop="stnm" label="站名" width="150" />
-          <el-table-column prop="rvnm" label="河流名称" width="120" />
-          <el-table-column prop="lttd" label="纬度" width="100" />
-          <el-table-column prop="lgtd" label="经度" width="100" />
-          <el-table-column prop="latestDataTime" label="最新数据时间" width="170" />
-          <el-table-column prop="wt" label="水温(℃)" width="100" />
-          <el-table-column prop="ph" label="pH" width="80" />
-          <el-table-column prop="do" label="溶解氧(mg/L)" width="110" />
-          <el-table-column prop="nh3n" label="氨氮(mg/L)" width="100" />
-          <el-table-column prop="tp" label="总磷(mg/L)" width="100" />
-          <el-table-column prop="tn" label="总氮(mg/L)" width="100" />
-          <el-table-column prop="cod" label="COD(mg/L)" width="100" />
-          <el-table-column prop="bod" label="BOD(mg/L)" width="100" />
+        <el-table :data="tableData" stripe border v-loading="loading" @row-click="handleRowClick">
+          <template v-if="isWryType">
+            <el-table-column prop="stnm" label="行政区" width="250" />
+            <el-table-column prop="year" label="年份" width="80" />
+            <el-table-column prop="cod" label="化学需氧量排放总量(吨)" width="200" />
+            <el-table-column prop="nh3" label="氨氮排放总量(吨)" width="200" />
+            <el-table-column prop="tn" label="总氮排放总量(吨)" width="200" />
+            <el-table-column prop="tp" label="总磷排放总量(吨)" width="200" />
+          </template>
+          <template v-else>
+            <el-table-column prop="stcd" label="站码" width="100" />
+            <el-table-column prop="stnm" label="站名" width="150" />
+            <el-table-column prop="rvnm" label="河流名称" width="120" />
+            <el-table-column prop="lttd" label="纬度" width="100" />
+            <el-table-column prop="lgtd" label="经度" width="100" />
+            <el-table-column prop="latestDataTime" label="最新数据时间" width="170" />
+            <el-table-column prop="wt" label="水温(℃)" width="100" />
+            <el-table-column prop="ph" label="pH" width="80" />
+            <el-table-column prop="do" label="溶解氧(mg/L)" width="110" />
+            <el-table-column prop="nh3n" label="氨氮(mg/L)" width="100" />
+            <el-table-column prop="tp" label="总磷(mg/L)" width="100" />
+            <el-table-column prop="tn" label="总氮(mg/L)" width="100" />
+            <el-table-column prop="cod" label="COD(mg/L)" width="100" />
+            <el-table-column prop="bod" label="BOD(mg/L)" width="100" />
+          </template>
         </el-table>
         
         <div v-if="tableData.length === 0 && !loading" class="empty-state">
@@ -54,13 +64,31 @@
         </div>
       </div>
     </div>
+
+    <el-dialog :title="historyDialogTitle" v-model="historyDialogVisible" width="900px" append-to-body>
+      <div class="history-dialog-content">
+        <div class="history-table">
+          <el-table :data="historyTableData" stripe border>
+            <el-table-column prop="year" label="年份" width="100" />
+            <el-table-column prop="cod" label="化学需氧量排放总量(吨)" width="200" />
+            <el-table-column prop="nh3" label="氨氮排放总量(吨)" width="200" />
+            <el-table-column prop="tn" label="总氮排放总量(吨)" width="200" />
+            <el-table-column prop="tp" label="总磷排放总量(吨)" width="200" />
+          </el-table>
+        </div>
+        <div class="history-chart">
+          <div ref="chartRef" class="chart-container"></div>
+        </div>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script setup>
-import { ref, onMounted } from 'vue'
+import { ref, onMounted, computed, nextTick, watch } from 'vue'
 import { Search, DataAnalysis } from '@element-plus/icons-vue'
 import request from '@/utils/request'
+import * as echarts from 'echarts'
 
 const selectedUnit = ref('TBA')
 const selectedBiz = ref('TBA_SW_1H2H')
@@ -69,9 +97,20 @@ const loading = ref(false)
 
 const unitList = ref([])
 const bizList = ref([])
-const stationList = ref([])
 const tableData = ref([])
 
+const historyDialogVisible = ref(false)
+const historyDialogTitle = ref('')
+const historyTableData = ref([])
+const chartRef = ref(null)
+let chartInstance = null
+
+const WRY_TYPES = ['JS_ST_WRY', 'ZJ_ST_WRY', 'SH_ST_WRY']
+
+const isWryType = computed(() => {
+  return WRY_TYPES.includes(selectedBiz.value)
+})
+
 onMounted(() => {
   loadUnits()
 })
@@ -88,7 +127,6 @@ function loadUnits() {
 
 function handleUnitChange(val) {
   selectedBiz.value = ''
-  stationList.value = []
   tableData.value = []
   loadBizList(val)
 }
@@ -102,13 +140,23 @@ function loadBizList(unitCode) {
     const bizData = res.data || []
     
     Promise.all(bizData.map(biz => {
-      return request({
-        url: '/gx/station/front/listByBizCode/' + biz.bizCode,
-        method: 'get'
-      }).then(stationRes => {
-        const stations = stationRes.data || []
-        return { ...biz, stationCount: stations.length }
-      })
+      if (WRY_TYPES.includes(biz.bizCode)) {
+        return request({
+          url: '/gx/stWry/front/latest/' + biz.bizCode,
+          method: 'get'
+        }).then(wryRes => {
+          const data = wryRes.data || []
+          return { ...biz, stationCount: data.length }
+        })
+      } else {
+        return request({
+          url: '/gx/station/front/listByBizCode/' + biz.bizCode,
+          method: 'get'
+        }).then(stationRes => {
+          const stations = stationRes.data || []
+          return { ...biz, stationCount: stations.length }
+        })
+      }
     })).then(results => {
       bizList.value = results
       
@@ -127,70 +175,195 @@ function loadBizList(unitCode) {
 
 function handleBizClick(bizCode) {
   selectedBiz.value = bizCode
-  loadStationData()
+  loadData()
 }
 
-function loadStationData() {
+function loadData() {
   loading.value = true
   
-  request({
-    url: '/gx/station/front/listByBizCode/' + selectedBiz.value,
-    method: 'get'
-  }).then(res => {
-    stationList.value = res.data || []
-    
-    let filteredStations = stationList.value
-    if (searchKeyword.value) {
-      const keyword = searchKeyword.value.toLowerCase()
-      filteredStations = filteredStations.filter(s => 
-        s.stnm.toLowerCase().includes(keyword) || 
-        s.stcd.toLowerCase().includes(keyword)
-      )
-    }
-    
-    Promise.all(filteredStations.map(station => {
-      return request({
-        url: '/gx/quality/front/list',
-        method: 'get',
-        params: { stcd: station.stcd, pageSize: 1 }
-      }).then(qualityRes => {
-        const qualityData = qualityRes.data || []
-        const latestQuality = qualityData.length > 0 ? qualityData[0] : {}
-        return {
+  if (isWryType.value) {
+    request({
+      url: '/gx/stWry/front/latest/' + selectedBiz.value,
+      method: 'get'
+    }).then(res => {
+      let data = res.data || []
+      
+      if (searchKeyword.value) {
+        const keyword = searchKeyword.value.toLowerCase()
+        data = data.filter(item => 
+          item.stnm.toLowerCase().includes(keyword)
+        )
+      }
+      
+      tableData.value = data
+      loading.value = false
+    }).catch(() => {
+      tableData.value = []
+      loading.value = false
+    })
+  } else {
+    request({
+      url: '/gx/station/front/listByBizCode/' + selectedBiz.value,
+      method: 'get'
+    }).then(res => {
+      const stationList = res.data || []
+      
+      let filteredStations = stationList
+      if (searchKeyword.value) {
+        const keyword = searchKeyword.value.toLowerCase()
+        filteredStations = filteredStations.filter(s => 
+          s.stnm.toLowerCase().includes(keyword) || 
+          s.stcd.toLowerCase().includes(keyword)
+        )
+      }
+      
+      Promise.all(filteredStations.map(station => {
+        return request({
+          url: '/gx/quality/front/list',
+          method: 'get',
+          params: { stcd: station.stcd, pageSize: 1 }
+        }).then(qualityRes => {
+          const qualityData = qualityRes.data || []
+          const latestQuality = qualityData.length > 0 ? qualityData[0] : {}
+          return {
+            ...station,
+            latestDataTime: latestQuality.uploadTime || '-',
+            wt: latestQuality.wt || '-',
+            ph: latestQuality.ph || '-',
+            do: latestQuality.do || '-',
+            nh3n: latestQuality.nh3n || '-',
+            tp: latestQuality.tp || '-',
+            tn: latestQuality.tn || '-',
+            cod: latestQuality.cod || '-',
+            bod: latestQuality.bod || '-'
+          }
+        })
+      })).then(results => {
+        tableData.value = results
+        loading.value = false
+      }).catch(() => {
+        tableData.value = filteredStations.map(station => ({
           ...station,
-          latestDataTime: latestQuality.uploadTime || '-',
-          wt: latestQuality.wt || '-',
-          ph: latestQuality.ph || '-',
-          do: latestQuality.do || '-',
-          nh3n: latestQuality.nh3n || '-',
-          tp: latestQuality.tp || '-',
-          tn: latestQuality.tn || '-',
-          cod: latestQuality.cod || '-',
-          bod: latestQuality.bod || '-'
-        }
+          latestDataTime: '-',
+          wt: '-',
+          ph: '-',
+          do: '-',
+          nh3n: '-',
+          tp: '-',
+          tn: '-',
+          cod: '-',
+          bod: '-'
+        }))
+        loading.value = false
       })
-    })).then(results => {
-      tableData.value = results
-      loading.value = false
     }).catch(() => {
-      tableData.value = filteredStations.map(station => ({
-        ...station,
-        latestDataTime: '-',
-        wt: '-',
-        ph: '-',
-        do: '-',
-        nh3n: '-',
-        tp: '-',
-        tn: '-',
-        cod: '-',
-        bod: '-'
-      }))
       loading.value = false
     })
-  }).catch(() => {
-    loading.value = false
+  }
+}
+
+function handleRowClick(row) {
+  if (isWryType.value) {
+    historyDialogTitle.value = `${row.stnm} 历史数据`
+    loadHistoryData(row.stnm)
+    historyDialogVisible.value = true
+  }
+}
+
+function loadHistoryData(stnm) {
+  request({
+    url: '/gx/stWry/front/history',
+    method: 'get',
+    params: { bizCode: selectedBiz.value, stnm: stnm }
+  }).then(res => {
+    historyTableData.value = res.data || []
+    nextTick(() => {
+      renderChart()
+    })
   })
 }
+
+function renderChart() {
+  if (!chartRef.value) return
+  
+  if (chartInstance) {
+    chartInstance.dispose()
+  }
+  
+  chartInstance = echarts.init(chartRef.value)
+  
+  const sortedData = [...historyTableData.value].sort((a, b) => a.year - b.year)
+  const years = sortedData.map(item => item.year + '年')
+  const codData = sortedData.map(item => item.cod || 0)
+  const nh3Data = sortedData.map(item => item.nh3 || 0)
+  const tnData = sortedData.map(item => item.tn || 0)
+  const tpData = sortedData.map(item => item.tp || 0)
+  
+  const option = {
+    tooltip: {
+      trigger: 'axis',
+      axisPointer: {
+        type: 'shadow'
+      }
+    },
+    legend: {
+      data: ['COD', '氨氮', '总氮', '总磷'],
+      bottom: 10
+    },
+    grid: {
+      left: '3%',
+      right: '4%',
+      bottom: '15%',
+      top: '10%',
+      containLabel: true
+    },
+    xAxis: {
+      type: 'category',
+      data: years,
+      axisLabel: {
+        rotate: 45
+      }
+    },
+    yAxis: {
+      type: 'value'
+    },
+    series: [
+      {
+        name: 'COD',
+        type: 'bar',
+        data: codData,
+        itemStyle: { color: '#1c97e7' }
+      },
+      {
+        name: '氨氮',
+        type: 'bar',
+        data: nh3Data,
+        itemStyle: { color: '#ffcc4d' }
+      },
+      {
+        name: '总氮',
+        type: 'bar',
+        data: tnData,
+        itemStyle: { color: '#93d347' }
+      },
+      {
+        name: '总磷',
+        type: 'bar',
+        data: tpData,
+        itemStyle: { color: '#ff8562' }
+      }
+    ]
+  }
+  
+  chartInstance.setOption(option)
+}
+
+watch(historyDialogVisible, (val) => {
+  if (!val && chartInstance) {
+    chartInstance.dispose()
+    chartInstance = null
+  }
+})
 </script>
 
 <style scoped>
@@ -200,25 +373,6 @@ function loadStationData() {
   flex-direction: column;
 }
 
-.page-header {
-  padding: 20px;
-  background: #fff;
-  border-radius: 12px;
-  margin-bottom: 20px;
-}
-
-.page-header h1 {
-  font-size: 24px;
-  font-weight: bold;
-  margin: 0 0 10px 0;
-}
-
-.page-header p {
-  font-size: 14px;
-  color: #666;
-  margin: 0;
-}
-
 .page-content {
   flex: 1;
   background: #fff;
@@ -308,6 +462,11 @@ function loadStationData() {
   width: 100%;
 }
 
+.table-container :deep(.el-table tr:hover) {
+  cursor: pointer;
+  background-color: #f5f7fa;
+}
+
 .empty-state {
   display: flex;
   flex-direction: column;
@@ -327,4 +486,24 @@ function loadStationData() {
   font-size: 16px;
   margin: 0;
 }
+
+.history-dialog-content {
+  display: flex;
+  gap: 20px;
+  height: 500px;
+}
+
+.history-table {
+  flex: 1;
+  overflow-y: auto;
+}
+
+.history-chart {
+  flex: 1;
+}
+
+.chart-container {
+  width: 100%;
+  height: 100%;
+}
 </style>

+ 11 - 8
gw-ui/src/views/gx/biz/index.vue

@@ -9,10 +9,7 @@
       </el-form-item>
       <el-form-item label="业务类型" prop="bizType">
         <el-select v-model="queryParams.bizType" placeholder="请选择" clearable style="width: 150px">
-          <el-option label="水位" value="水位" />
-          <el-option label="水质" value="水质" />
-          <el-option label="调度" value="调度" />
-          <el-option label="工程" value="工程" />
+          <el-option v-for="item in bizTypeOptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue" />
         </el-select>
       </el-form-item>
       <el-form-item label="提供单位" prop="bizUnit">
@@ -90,10 +87,7 @@
         </el-form-item>
         <el-form-item label="业务类型" prop="bizType">
           <el-select v-model="form.bizType" placeholder="请选择">
-            <el-option label="水位" value="水位" />
-            <el-option label="水质" value="水质" />
-            <el-option label="调度" value="调度" />
-            <el-option label="工程" value="工程" />
+            <el-option v-for="item in bizTypeOptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue" />
           </el-select>
         </el-form-item>
         <el-form-item label="提供单位" prop="bizUnit">
@@ -145,11 +139,13 @@
 <script setup name="GxBiz">
 import { listBiz, getBiz, addBiz, updateBiz, delBiz } from "@/api/gx/biz";
 import { listUnit } from "@/api/gx/unit";
+import { getDicts } from "@/api/system/dict/data";
 
 const { proxy } = getCurrentInstance();
 
 const bizList = ref([]);
 const unitList = ref([]);
+const bizTypeOptions = ref([]);
 const loading = ref(true);
 const showSearch = ref(true);
 const ids = ref([]);
@@ -297,6 +293,13 @@ function getUnitList() {
   });
 }
 
+function getBizTypeList() {
+  getDicts("gx_biz_type").then((response) => {
+    bizTypeOptions.value = response.data;
+  });
+}
+
 getList();
 getUnitList();
+getBizTypeList();
 </script>

+ 11 - 11
gw-ui/src/views/gx/station/index.vue

@@ -17,9 +17,9 @@
       <el-form-item label="站名" prop="stnm">
         <el-input v-model="queryParams.stnm" placeholder="请输入站名" clearable style="width: 160px" @keyup.enter="handleQuery" />
       </el-form-item>
-      <el-form-item label="状态" prop="state">
-        <el-select v-model="queryParams.state" placeholder="全部" clearable style="width: 100px">
-          <el-option label="正常" value="0" />
+      <el-form-item label="状态" prop="delFlag">
+        <el-select v-model="queryParams.delFlag" placeholder="全部" clearable style="width: 100px">
+          <el-option label="使用" value="0" />
           <el-option label="停用" value="1" />
         </el-select>
       </el-form-item>
@@ -56,10 +56,10 @@
       <el-table-column label="经度" prop="lgtd" width="100" align="center" />
       <el-table-column label="纬度" prop="lttd" width="100" align="center" />
       <el-table-column label="站址" prop="stlc" :show-overflow-tooltip="true" />
-      <el-table-column label="状态" prop="state" width="80" align="center">
+      <el-table-column label="状态" prop="delFlag" width="80" align="center">
         <template #default="scope">
-          <el-tag :type="scope.row.state === '0' ? 'success' : 'danger'" size="small">
-            {{ scope.row.state === '0' ? '正常' : '停用' }}
+          <el-tag :type="scope.row.delFlag === '0' ? 'success' : 'danger'" size="small">
+            {{ scope.row.delFlag === '0' ? '使用' : '停用' }}
           </el-tag>
         </template>
       </el-table-column>
@@ -142,9 +142,9 @@
         </el-row>
         <el-row :gutter="20">
           <el-col :span="12">
-            <el-form-item label="状态" prop="state">
-              <el-radio-group v-model="form.state">
-                <el-radio value="0">正常</el-radio>
+            <el-form-item label="状态" prop="delFlag">
+              <el-radio-group v-model="form.delFlag">
+                <el-radio value="0">使用</el-radio>
                 <el-radio value="1">停用</el-radio>
               </el-radio-group>
             </el-form-item>
@@ -197,7 +197,7 @@ const data = reactive({
     bizCode: undefined,
     stcd: undefined,
     stnm: undefined,
-    state: undefined,
+    delFlag: undefined,
   },
   rules: {
     bizCode: [{ required: true, message: "业务域不能为空", trigger: "change" }],
@@ -279,7 +279,7 @@ function reset() {
     rvnm: undefined,
     hnnm: undefined,
     bsnm: undefined,
-    state: "0",
+    delFlag: "0",
     flag1h3h: undefined,
     note: undefined,
   };