Эх сурвалжийг харах

[0806] 2.系统中:设备管理-测点配置,需要用肖工已设计好的表。(之前已发至群里:config_point,位于doc/数据库脚本/gateway.sql)

taosj 3 сар өмнө
parent
commit
a1fc7e1030

+ 86 - 0
forecast-backend-server/src/main/java/com/ufo/project/config/controller/ConfigPointController.java

@@ -0,0 +1,86 @@
+package com.ufo.project.config.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ufo.base.framework.aspectj.lang.annotation.Log;
+import com.ufo.base.framework.aspectj.lang.enums.BusinessType;
+import com.ufo.project.config.domain.ConfigPoint;
+import com.ufo.project.config.service.IConfigPointService;
+import com.ufo.base.framework.web.controller.BaseController;
+import com.ufo.base.framework.web.domain.AjaxResult;
+import com.ufo.base.common.utils.poi.ExcelUtil;
+import com.ufo.base.framework.web.page.TableDataInfo;
+
+/**
+ * 测点Controller
+ *
+ * @author ufo
+ * @date 2026-08-04
+ */
+@RestController
+@RequestMapping("/config/point")
+public class ConfigPointController extends BaseController
+{
+    @Autowired
+    private IConfigPointService configPointService;
+
+    @PreAuthorize("@ss.hasPermi('config:stationPoint:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(ConfigPoint configPoint)
+    {
+        startPage();
+        List<ConfigPoint> list = configPointService.selectConfigPointList(configPoint);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('config:stationPoint:export')")
+    @Log(title = "测点", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, ConfigPoint configPoint)
+    {
+        List<ConfigPoint> list = configPointService.selectConfigPointList(configPoint);
+        ExcelUtil<ConfigPoint> util = new ExcelUtil<ConfigPoint>(ConfigPoint.class);
+        util.exportExcel(response, list, "测点数据");
+    }
+
+    @PreAuthorize("@ss.hasPermi('config:stationPoint:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(configPointService.selectConfigPointById(id));
+    }
+
+    @PreAuthorize("@ss.hasPermi('config:stationPoint:add')")
+    @Log(title = "测点", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ConfigPoint configPoint)
+    {
+        return toAjax(configPointService.insertConfigPoint(configPoint));
+    }
+
+    @PreAuthorize("@ss.hasPermi('config:stationPoint:edit')")
+    @Log(title = "测点", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody ConfigPoint configPoint)
+    {
+        return toAjax(configPointService.updateConfigPoint(configPoint));
+    }
+
+    @PreAuthorize("@ss.hasPermi('config:stationPoint:remove')")
+    @Log(title = "测点", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(configPointService.deleteConfigPointByIds(ids));
+    }
+}

+ 327 - 0
forecast-backend-server/src/main/java/com/ufo/project/config/domain/ConfigPoint.java

@@ -0,0 +1,327 @@
+package com.ufo.project.config.domain;
+
+import com.ufo.base.framework.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ufo.base.framework.aspectj.lang.annotation.Excel;
+import java.math.BigDecimal;
+
+/**
+ * 测点对象 config_point
+ *
+ * @author ufo
+ * @date 2026-08-04
+ */
+public class ConfigPoint extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    private Long id;
+
+    /** 名称 */
+    @Excel(name = "名称")
+    private String name;
+
+    /** 编码 */
+    @Excel(name = "编码")
+    private String code;
+
+    /** 地址 */
+    @Excel(name = "地址")
+    private Long addr;
+
+    /** 测点类型 */
+    @Excel(name = "测点类型")
+    private String category;
+
+    /** 设备号 */
+    @Excel(name = "设备号")
+    private Long configDeviceId;
+
+    /** 初始值 */
+    @Excel(name = "初始值")
+    private String initValue;
+
+    /** 是否取反 */
+    @Excel(name = "是否取反")
+    private String willInverse;
+
+    /** 计算方式 */
+    @Excel(name = "计算方式")
+    private String kbComposite;
+
+    /** K */
+    @Excel(name = "K")
+    private BigDecimal k;
+
+    /** B */
+    @Excel(name = "B")
+    private BigDecimal b;
+
+    /** 零漂 */
+    @Excel(name = "零漂")
+    private BigDecimal zeroFilter;
+
+    /** 越限检查 */
+    @Excel(name = "越限检查")
+    private String willCheckUd;
+
+    /** 上限1 */
+    @Excel(name = "上限1")
+    private BigDecimal up1;
+
+    /** 上限2 */
+    @Excel(name = "上限2")
+    private BigDecimal up2;
+
+    /** 下限1 */
+    @Excel(name = "下限1")
+    private BigDecimal down1;
+
+    /** 下限2 */
+    @Excel(name = "下限2")
+    private BigDecimal down2;
+
+    /** 滤波 */
+    @Excel(name = "滤波")
+    private Long hopFilter;
+
+    /** 呆值时间 */
+    @Excel(name = "呆值时间")
+    private Long lazyTm;
+
+    /** 报警模板id */
+    @Excel(name = "报警模板id")
+    private Long configAlarmTemplateId;
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+
+    public void setCode(String code)
+    {
+        this.code = code;
+    }
+
+    public String getCode()
+    {
+        return code;
+    }
+
+    public void setAddr(Long addr)
+    {
+        this.addr = addr;
+    }
+
+    public Long getAddr()
+    {
+        return addr;
+    }
+
+    public void setCategory(String category)
+    {
+        this.category = category;
+    }
+
+    public String getCategory()
+    {
+        return category;
+    }
+
+    public void setConfigDeviceId(Long configDeviceId)
+    {
+        this.configDeviceId = configDeviceId;
+    }
+
+    public Long getConfigDeviceId()
+    {
+        return configDeviceId;
+    }
+
+    public void setInitValue(String initValue)
+    {
+        this.initValue = initValue;
+    }
+
+    public String getInitValue()
+    {
+        return initValue;
+    }
+
+    public void setWillInverse(String willInverse)
+    {
+        this.willInverse = willInverse;
+    }
+
+    public String getWillInverse()
+    {
+        return willInverse;
+    }
+
+    public void setKbComposite(String kbComposite)
+    {
+        this.kbComposite = kbComposite;
+    }
+
+    public String getKbComposite()
+    {
+        return kbComposite;
+    }
+
+    public void setK(BigDecimal k)
+    {
+        this.k = k;
+    }
+
+    public BigDecimal getK()
+    {
+        return k;
+    }
+
+    public void setB(BigDecimal b)
+    {
+        this.b = b;
+    }
+
+    public BigDecimal getB()
+    {
+        return b;
+    }
+
+    public void setZeroFilter(BigDecimal zeroFilter)
+    {
+        this.zeroFilter = zeroFilter;
+    }
+
+    public BigDecimal getZeroFilter()
+    {
+        return zeroFilter;
+    }
+
+    public void setWillCheckUd(String willCheckUd)
+    {
+        this.willCheckUd = willCheckUd;
+    }
+
+    public String getWillCheckUd()
+    {
+        return willCheckUd;
+    }
+
+    public void setUp1(BigDecimal up1)
+    {
+        this.up1 = up1;
+    }
+
+    public BigDecimal getUp1()
+    {
+        return up1;
+    }
+
+    public void setUp2(BigDecimal up2)
+    {
+        this.up2 = up2;
+    }
+
+    public BigDecimal getUp2()
+    {
+        return up2;
+    }
+
+    public void setDown1(BigDecimal down1)
+    {
+        this.down1 = down1;
+    }
+
+    public BigDecimal getDown1()
+    {
+        return down1;
+    }
+
+    public void setDown2(BigDecimal down2)
+    {
+        this.down2 = down2;
+    }
+
+    public BigDecimal getDown2()
+    {
+        return down2;
+    }
+
+    public void setHopFilter(Long hopFilter)
+    {
+        this.hopFilter = hopFilter;
+    }
+
+    public Long getHopFilter()
+    {
+        return hopFilter;
+    }
+
+    public void setLazyTm(Long lazyTm)
+    {
+        this.lazyTm = lazyTm;
+    }
+
+    public Long getLazyTm()
+    {
+        return lazyTm;
+    }
+
+    public void setConfigAlarmTemplateId(Long configAlarmTemplateId)
+    {
+        this.configAlarmTemplateId = configAlarmTemplateId;
+    }
+
+    public Long getConfigAlarmTemplateId()
+    {
+        return configAlarmTemplateId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("name", getName())
+            .append("code", getCode())
+            .append("addr", getAddr())
+            .append("category", getCategory())
+            .append("configDeviceId", getConfigDeviceId())
+            .append("initValue", getInitValue())
+            .append("willInverse", getWillInverse())
+            .append("kbComposite", getKbComposite())
+            .append("k", getK())
+            .append("b", getB())
+            .append("zeroFilter", getZeroFilter())
+            .append("willCheckUd", getWillCheckUd())
+            .append("up1", getUp1())
+            .append("up2", getUp2())
+            .append("down1", getDown1())
+            .append("down2", getDown2())
+            .append("hopFilter", getHopFilter())
+            .append("lazyTm", getLazyTm())
+            .append("configAlarmTemplateId", getConfigAlarmTemplateId())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 25 - 0
forecast-backend-server/src/main/java/com/ufo/project/config/mapper/ConfigPointMapper.java

@@ -0,0 +1,25 @@
+package com.ufo.project.config.mapper;
+
+import java.util.List;
+import com.ufo.project.config.domain.ConfigPoint;
+
+/**
+ * 测点Mapper接口
+ *
+ * @author ufo
+ * @date 2026-08-04
+ */
+public interface ConfigPointMapper
+{
+    public ConfigPoint selectConfigPointById(Long id);
+
+    public List<ConfigPoint> selectConfigPointList(ConfigPoint configPoint);
+
+    public int insertConfigPoint(ConfigPoint configPoint);
+
+    public int updateConfigPoint(ConfigPoint configPoint);
+
+    public int deleteConfigPointById(Long id);
+
+    public int deleteConfigPointByIds(Long[] ids);
+}

+ 25 - 0
forecast-backend-server/src/main/java/com/ufo/project/config/service/IConfigPointService.java

@@ -0,0 +1,25 @@
+package com.ufo.project.config.service;
+
+import java.util.List;
+import com.ufo.project.config.domain.ConfigPoint;
+
+/**
+ * 测点Service接口
+ *
+ * @author ufo
+ * @date 2026-08-04
+ */
+public interface IConfigPointService
+{
+    public ConfigPoint selectConfigPointById(Long id);
+
+    public List<ConfigPoint> selectConfigPointList(ConfigPoint configPoint);
+
+    public int insertConfigPoint(ConfigPoint configPoint);
+
+    public int updateConfigPoint(ConfigPoint configPoint);
+
+    public int deleteConfigPointByIds(Long[] ids);
+
+    public int deleteConfigPointById(Long id);
+}

+ 60 - 0
forecast-backend-server/src/main/java/com/ufo/project/config/service/impl/ConfigPointServiceImpl.java

@@ -0,0 +1,60 @@
+package com.ufo.project.config.service.impl;
+
+import java.util.List;
+import com.ufo.base.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ufo.project.config.mapper.ConfigPointMapper;
+import com.ufo.project.config.domain.ConfigPoint;
+import com.ufo.project.config.service.IConfigPointService;
+
+/**
+ * 测点Service业务层处理
+ *
+ * @author ufo
+ * @date 2026-08-04
+ */
+@Service
+public class ConfigPointServiceImpl implements IConfigPointService
+{
+    @Autowired
+    private ConfigPointMapper configPointMapper;
+
+    @Override
+    public ConfigPoint selectConfigPointById(Long id)
+    {
+        return configPointMapper.selectConfigPointById(id);
+    }
+
+    @Override
+    public List<ConfigPoint> selectConfigPointList(ConfigPoint configPoint)
+    {
+        return configPointMapper.selectConfigPointList(configPoint);
+    }
+
+    @Override
+    public int insertConfigPoint(ConfigPoint configPoint)
+    {
+        configPoint.setCreateTime(DateUtils.getNowDate());
+        return configPointMapper.insertConfigPoint(configPoint);
+    }
+
+    @Override
+    public int updateConfigPoint(ConfigPoint configPoint)
+    {
+        configPoint.setUpdateTime(DateUtils.getNowDate());
+        return configPointMapper.updateConfigPoint(configPoint);
+    }
+
+    @Override
+    public int deleteConfigPointByIds(Long[] ids)
+    {
+        return configPointMapper.deleteConfigPointByIds(ids);
+    }
+
+    @Override
+    public int deleteConfigPointById(Long id)
+    {
+        return configPointMapper.deleteConfigPointById(id);
+    }
+}

+ 152 - 0
forecast-backend-server/src/main/resources/mybatis/config/ConfigPointMapper.xml

@@ -0,0 +1,152 @@
+<?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.ufo.project.config.mapper.ConfigPointMapper">
+
+    <resultMap type="ConfigPoint" id="ConfigPointResult">
+        <result property="id"    column="id"    />
+        <result property="name"    column="name"    />
+        <result property="code"    column="code"    />
+        <result property="addr"    column="addr"    />
+        <result property="category"    column="category"    />
+        <result property="configDeviceId"    column="config_device_id"    />
+        <result property="initValue"    column="init_value"    />
+        <result property="willInverse"    column="will_inverse"    />
+        <result property="kbComposite"    column="kb_composite"    />
+        <result property="k"    column="k"    />
+        <result property="b"    column="b"    />
+        <result property="zeroFilter"    column="zero_filter"    />
+        <result property="willCheckUd"    column="will_check_ud"    />
+        <result property="up1"    column="up1"    />
+        <result property="up2"    column="up2"    />
+        <result property="down1"    column="down1"    />
+        <result property="down2"    column="down2"    />
+        <result property="hopFilter"    column="hop_filter"    />
+        <result property="lazyTm"    column="lazy_tm"    />
+        <result property="configAlarmTemplateId"    column="config_alarm_template_id"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="updateBy"    column="update_by"    />
+    </resultMap>
+
+    <sql id="selectConfigPointVo">
+        select id, name, code, addr, category, config_device_id, init_value, will_inverse, kb_composite, k, b, zero_filter, will_check_ud, up1, up2, down1, down2, hop_filter, lazy_tm, config_alarm_template_id, create_time, update_time, create_by, update_by from config_point
+    </sql>
+
+    <select id="selectConfigPointList" parameterType="ConfigPoint" resultMap="ConfigPointResult">
+        <include refid="selectConfigPointVo"/>
+        <where>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="code != null  and code != ''"> and code = #{code}</if>
+            <if test="addr != null"> and addr = #{addr}</if>
+            <if test="category != null  and category != ''"> and category = #{category}</if>
+            <if test="configDeviceId != null"> and config_device_id = #{configDeviceId}</if>
+            <if test="kbComposite != null  and kbComposite != ''"> and kb_composite = #{kbComposite}</if>
+            <if test="willCheckUd != null  and willCheckUd != ''"> and will_check_ud = #{willCheckUd}</if>
+        </where>
+    </select>
+
+    <select id="selectConfigPointById" parameterType="Long" resultMap="ConfigPointResult">
+        <include refid="selectConfigPointVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertConfigPoint" parameterType="ConfigPoint">
+        insert into config_point
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="name != null and name != ''">name,</if>
+            <if test="code != null and code != ''">code,</if>
+            <if test="addr != null">addr,</if>
+            <if test="category != null and category != ''">category,</if>
+            <if test="configDeviceId != null">config_device_id,</if>
+            <if test="initValue != null and initValue != ''">init_value,</if>
+            <if test="willInverse != null and willInverse != ''">will_inverse,</if>
+            <if test="kbComposite != null and kbComposite != ''">kb_composite,</if>
+            <if test="k != null">k,</if>
+            <if test="b != null">b,</if>
+            <if test="zeroFilter != null">zero_filter,</if>
+            <if test="willCheckUd != null and willCheckUd != ''">will_check_ud,</if>
+            <if test="up1 != null">up1,</if>
+            <if test="up2 != null">up2,</if>
+            <if test="down1 != null">down1,</if>
+            <if test="down2 != null">down2,</if>
+            <if test="hopFilter != null">hop_filter,</if>
+            <if test="lazyTm != null">lazy_tm,</if>
+            <if test="configAlarmTemplateId != null">config_alarm_template_id,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="createBy != null and createBy != ''">create_by,</if>
+            <if test="updateBy != null and updateBy != ''">update_by,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="name != null and name != ''">#{name},</if>
+            <if test="code != null and code != ''">#{code},</if>
+            <if test="addr != null">#{addr},</if>
+            <if test="category != null and category != ''">#{category},</if>
+            <if test="configDeviceId != null">#{configDeviceId},</if>
+            <if test="initValue != null and initValue != ''">#{initValue},</if>
+            <if test="willInverse != null and willInverse != ''">#{willInverse},</if>
+            <if test="kbComposite != null and kbComposite != ''">#{kbComposite},</if>
+            <if test="k != null">#{k},</if>
+            <if test="b != null">#{b},</if>
+            <if test="zeroFilter != null">#{zeroFilter},</if>
+            <if test="willCheckUd != null and willCheckUd != ''">#{willCheckUd},</if>
+            <if test="up1 != null">#{up1},</if>
+            <if test="up2 != null">#{up2},</if>
+            <if test="down1 != null">#{down1},</if>
+            <if test="down2 != null">#{down2},</if>
+            <if test="hopFilter != null">#{hopFilter},</if>
+            <if test="lazyTm != null">#{lazyTm},</if>
+            <if test="configAlarmTemplateId != null">#{configAlarmTemplateId},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="createBy != null and createBy != ''">#{createBy},</if>
+            <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
+         </trim>
+    </insert>
+
+    <update id="updateConfigPoint" parameterType="ConfigPoint">
+        update config_point
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="name != null and name != ''">name = #{name},</if>
+            <if test="code != null and code != ''">code = #{code},</if>
+            <if test="addr != null">addr = #{addr},</if>
+            <if test="category != null and category != ''">category = #{category},</if>
+            <if test="configDeviceId != null">config_device_id = #{configDeviceId},</if>
+            <if test="initValue != null and initValue != ''">init_value = #{initValue},</if>
+            <if test="willInverse != null and willInverse != ''">will_inverse = #{willInverse},</if>
+            <if test="kbComposite != null and kbComposite != ''">kb_composite = #{kbComposite},</if>
+            <if test="k != null">k = #{k},</if>
+            <if test="b != null">b = #{b},</if>
+            <if test="zeroFilter != null">zero_filter = #{zeroFilter},</if>
+            <if test="willCheckUd != null and willCheckUd != ''">will_check_ud = #{willCheckUd},</if>
+            <if test="up1 != null">up1 = #{up1},</if>
+            <if test="up2 != null">up2 = #{up2},</if>
+            <if test="down1 != null">down1 = #{down1},</if>
+            <if test="down2 != null">down2 = #{down2},</if>
+            <if test="hopFilter != null">hop_filter = #{hopFilter},</if>
+            <if test="lazyTm != null">lazy_tm = #{lazyTm},</if>
+            <if test="configAlarmTemplateId != null">config_alarm_template_id = #{configAlarmTemplateId},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteConfigPointById" parameterType="Long">
+        delete from config_point where id = #{id}
+    </delete>
+
+    <delete id="deleteConfigPointByIds" parameterType="Long">
+        delete from config_point where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 21 - 0
forecast-backend-vue/src/api/config/point.js

@@ -0,0 +1,21 @@
+import request from '@/utils/request'
+
+export function listPoint(query) {
+  return request({ url: '/config/point/list', method: 'get', params: query })
+}
+
+export function getPoint(id) {
+  return request({ url: '/config/point/' + id, method: 'get' })
+}
+
+export function addPoint(data) {
+  return request({ url: '/config/point', method: 'post', data })
+}
+
+export function updatePoint(data) {
+  return request({ url: '/config/point', method: 'put', data })
+}
+
+export function delPoint(id) {
+  return request({ url: '/config/point/' + id, method: 'delete' })
+}

+ 14 - 10
forecast-backend-vue/src/views/ufo/config/station/StationConfigCrud.vue

@@ -2,7 +2,7 @@
   <div class="station-config-page">
     <a-card :bordered="false">
       <a-form :model="queryParams" layout="inline">
-        <a-form-item label="场站">
+        <a-form-item v-if="hasStation" label="场站">
           <a-select v-model:value="queryParams.stationId" allow-clear show-search class="query-select" :options="stationOptions" :filter-option="filterOption" />
         </a-form-item>
         <a-form-item v-for="item in searchFields" :key="item.name" :label="item.label">
@@ -21,7 +21,7 @@
     </a-card>
 
     <a-card :bordered="false" class="section">
-      <a-table :columns="columns" :data-source="rows" :loading="loading" :pagination="pagination" row-key="id" @change="handleTableChange">
+      <a-table :columns="columns" :data-source="rows" :loading="loading" :pagination="pagination" row-key="id" :scroll="tableScroll" @change="handleTableChange">
         <template #bodyCell="{ column, record }">
           <template v-if="column.key === 'operation'">
             <a-space>
@@ -38,7 +38,7 @@
     <a-modal v-model:open="formOpen" :title="form.id ? '编辑' + moduleConfig.title : '新增' + moduleConfig.title" width="860px" @ok="submitForm">
       <a-form ref="formRef" :model="form" :rules="rules" :label-col="{ span: 7 }" :wrapper-col="{ span: 15 }">
         <a-row :gutter="16">
-          <a-col :span="12">
+          <a-col v-if="hasStation" :span="12">
             <a-form-item label="所属场站" name="stationId">
               <a-select v-model:value="form.stationId" show-search :options="stationOptions" :filter-option="filterOption" @change="handleStationChange" />
             </a-form-item>
@@ -46,8 +46,8 @@
           <a-col v-for="item in moduleConfig.fields" :key="item[0]" :span="12">
             <a-form-item :label="item[1]" :name="item[0]">
               <a-select v-if="item[2] === 'select'" v-model:value="form[item[0]]" allow-clear :options="toOptions(item[4])" />
-              <a-select v-else-if="item[2] === 'device'" v-model:value="form.deviceId" allow-clear show-search :options="deviceOptions" :filter-option="filterOption" @change="handleDeviceChange" />
-              <a-input-number v-else-if="item[2] === 'number'" v-model:value="form[item[0]]" class="full-input" :min="0" />
+              <a-select v-else-if="item[2] === 'device'" v-model:value="form[deviceFieldName]" allow-clear show-search :options="deviceOptions" :filter-option="filterOption" @change="handleDeviceChange" />
+              <a-input-number v-else-if="item[2] === 'number'" v-model:value="form[item[0]]" class="full-input" />
               <a-date-picker v-else-if="item[2] === 'date'" v-model:value="form[item[0]]" value-format="YYYY-MM-DD" class="full-input" />
               <a-input v-else v-model:value="form[item[0]]" allow-clear />
             </a-form-item>
@@ -77,6 +77,8 @@ const queryParams = reactive({ pageNum: 1, pageSize: 10, stationId: undefined })
 const pagination = reactive({ current: 1, pageSize: 10, total: 0, showSizeChanger: true });
 const form = reactive({});
 
+const hasStation = computed(() => props.moduleConfig.hasStation !== false);
+const deviceFieldName = computed(() => props.moduleConfig.fields.find((item) => item[2] === 'device')?.[0]);
 const fieldMap = computed(() => new Map(props.moduleConfig.fields.map((item) => [item[0], item])));
 const searchFields = computed(() => props.moduleConfig.search.filter((name) => name !== 'stationId').map((name) => ({ name, label: fieldMap.value.get(name)?.[1] || name, type: fieldMap.value.get(name)?.[2], options: toOptions(fieldMap.value.get(name)?.[4]) })));
 const columns = computed(() => [
@@ -84,9 +86,10 @@ const columns = computed(() => [
   ...props.moduleConfig.columns.map((name) => ({ title: name === 'stationName' ? '场站' : fieldMap.value.get(name)?.[1] || name, dataIndex: name, width: 140, ellipsis: true })),
   { title: '操作', key: 'operation', width: 130, fixed: 'right' }
 ]);
+const tableScroll = computed(() => ({ x: columns.value.reduce((sum, col) => sum + (col.width || 140), 0) }));
 const rules = computed(() => ({
-  stationId: [{ required: true, message: '请选择所属场站', trigger: 'change' }],
-  ...Object.fromEntries(props.moduleConfig.fields.filter((item) => item[3]).map((item) => [item[0], [{ required: true, message: '请输入' + item[1], trigger: item[2] === 'select' ? 'change' : 'blur' }]]))
+  ...(hasStation.value ? { stationId: [{ required: true, message: '请选择所属场站', trigger: 'change' }] } : {}),
+  ...Object.fromEntries(props.moduleConfig.fields.filter((item) => item[3]).map((item) => [item[0], [{ required: true, message: '请输入' + item[1], trigger: item[2] === 'select' || item[2] === 'device' ? 'change' : 'blur' }]]))
 }));
 const deviceOptions = computed(() => allDevices.value
   .filter((item) => !form.stationId || String(item.stationId) === String(form.stationId))
@@ -97,12 +100,13 @@ const filterOption = (input, option) => String(option?.label || '').toLowerCase(
 const resetObject = (target, source = {}) => { Object.keys(target).forEach((key) => delete target[key]); Object.assign(target, source); };
 
 const loadStations = async () => {
+  if (!hasStation.value) return;
   const res = await listStation({ pageNum: 1, pageSize: 500 });
   const list = res?.rows || res?.data || [];
   stationOptions.value = list.map((item) => ({ label: item.stationName || item.name || item.id, value: item.id }));
 };
 const loadDevices = async () => {
-  if (props.moduleConfig.key !== 'point') return;
+  if (!deviceFieldName.value) return;
   const res = await listStationDevice({ pageNum: 1, pageSize: 500 });
   allDevices.value = res?.rows || res?.data || [];
 };
@@ -139,8 +143,8 @@ const openForm = async (record) => {
   formOpen.value = true;
 };
 const handleStationChange = () => {
-  if (props.moduleConfig.key === 'point') {
-    form.deviceId = undefined;
+  if (deviceFieldName.value) {
+    form[deviceFieldName.value] = undefined;
     form.deviceName = undefined;
   }
 };

+ 12 - 0
forecast-backend-vue/src/views/ufo/config/station/cpoint/index.vue

@@ -0,0 +1,12 @@
+<template>
+  <StationConfigCrud :module-config="moduleConfig" :api="api" />
+</template>
+
+<script setup name="ConfigPoint">
+import StationConfigCrud from '../StationConfigCrud.vue';
+import { stationConfigModules } from '../moduleConfig';
+import { listPoint, getPoint, addPoint, updatePoint, delPoint } from '@/api/config/point';
+
+const moduleConfig = stationConfigModules.find((item) => item.key === 'cpoint');
+const api = { list: listPoint, get: getPoint, add: addPoint, update: updatePoint, del: delPoint };
+</script>

+ 186 - 0
forecast-backend-vue/src/views/ufo/config/station/moduleConfig.js

@@ -449,5 +449,191 @@ export const stationConfigModules = [
       "pointName",
       "protocol"
     ]
+  },
+  {
+    "key": "cpoint",
+    "title": "测点表",
+    "api": "point",
+    "perm": "config:point",
+    "exportName": "测点表.xlsx",
+    "hasStation": false,
+    "fields": [
+      [
+        "configDeviceId",
+        "设备号",
+        "device",
+        true
+      ],
+      [
+        "name",
+        "名称",
+        "input",
+        true
+      ],
+      [
+        "code",
+        "编码",
+        "input"
+      ],
+      [
+        "addr",
+        "地址",
+        "number"
+      ],
+      [
+        "category",
+        "测点类型",
+        "select",
+        false,
+        [
+          [
+            "遥信",
+            "YX"
+          ],
+          [
+            "遥测",
+            "YC"
+          ],
+          [
+            "遥控",
+            "YM"
+          ],
+          [
+            "遥调",
+            "YT"
+          ]
+        ]
+      ],
+      [
+        "initValue",
+        "初始值",
+        "input"
+      ],
+      [
+        "willInverse",
+        "是否取反",
+        "select",
+        true,
+        [
+          [
+            "是",
+            "Y"
+          ],
+          [
+            "否",
+            "N"
+          ]
+        ]
+      ],
+      [
+        "kbComposite",
+        "计算方式",
+        "select",
+        true,
+        [
+          [
+            "不复合",
+            "0"
+          ],
+          [
+            "复合",
+            "1"
+          ]
+        ]
+      ],
+      [
+        "k",
+        "K",
+        "number"
+      ],
+      [
+        "b",
+        "B",
+        "number"
+      ],
+      [
+        "zeroFilter",
+        "零漂",
+        "number"
+      ],
+      [
+        "willCheckUd",
+        "越限检查",
+        "select",
+        false,
+        [
+          [
+            "是",
+            "Y"
+          ],
+          [
+            "否",
+            "N"
+          ]
+        ]
+      ],
+      [
+        "up1",
+        "上限1",
+        "number"
+      ],
+      [
+        "up2",
+        "上限2",
+        "number"
+      ],
+      [
+        "down1",
+        "下限1",
+        "number"
+      ],
+      [
+        "down2",
+        "下限2",
+        "number"
+      ],
+      [
+        "hopFilter",
+        "滤波",
+        "number"
+      ],
+      [
+        "lazyTm",
+        "呆值时间",
+        "number"
+      ],
+      [
+        "configAlarmTemplateId",
+        "报警模板id",
+        "number"
+      ]
+    ],
+    "columns": [
+      "name",
+      "code",
+      "addr",
+      "category",
+      "configDeviceId",
+      "initValue",
+      "willInverse",
+      "kbComposite",
+      "k",
+      "b",
+      "zeroFilter",
+      "willCheckUd",
+      "up1",
+      "up2",
+      "down1",
+      "down2",
+      "hopFilter",
+      "lazyTm",
+      "configAlarmTemplateId"
+    ],
+    "search": [
+      "name",
+      "code",
+      "category",
+      "willCheckUd"
+    ]
   }
 ];