Ver código fonte

大屏数据填报

zhangshuling 1 ano atrás
pai
commit
357e07aaa8

+ 50 - 0
xzl-admin/src/main/java/com/xzl/web/controller/RptDataConfigController.java

@@ -0,0 +1,50 @@
+package com.xzl.web.controller;
+
+import com.xzl.common.core.controller.BaseController;
+import com.xzl.common.core.domain.AjaxResult;
+import com.xzl.common.core.page.TableDataInfo;
+import com.xzl.system.domain.RptDataConfig;
+import com.xzl.system.service.IRptDataConfigService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 【请填写功能名称】Controller
+ *
+ * @author xzl
+ * @date 2024-01-10
+ */
+@RestController
+@RequestMapping("/rpt/data-config")
+public class RptDataConfigController extends BaseController {
+  @Autowired
+  private IRptDataConfigService rptDataConfigService;
+
+  @PreAuthorize("@ss.hasPermi('rpt:data-config:list')")
+  @GetMapping("/page")
+  public TableDataInfo page(RptDataConfig rptDataConfig) {
+    startPage();
+    List<RptDataConfig> list = rptDataConfigService.selectDistinctRptDataConfigList(rptDataConfig);
+    return getDataTable(list);
+  }
+
+  @PreAuthorize("@ss.hasPermi('rpt:data-config:list')")
+  @GetMapping("/list")
+  public AjaxResult list(RptDataConfig rptDataConfig) {
+    return AjaxResult.success(rptDataConfigService.selectRptDataConfigList(rptDataConfig));
+  }
+
+  @PreAuthorize("@ss.hasPermi('rpt:data-config:save')")
+  @PostMapping("/save")
+  public AjaxResult save(@RequestBody List<RptDataConfig> rptDataConfigList) {
+    return AjaxResult.success(rptDataConfigService.saveList(rptDataConfigList));
+  }
+
+}

+ 204 - 0
xzl-system/src/main/java/com/xzl/system/domain/RptDataConfig.java

@@ -0,0 +1,204 @@
+package com.xzl.system.domain;
+
+import com.xzl.common.annotation.Excel;
+import com.xzl.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
+
+/**
+ * 【请填写功能名称】对象 rpt_data_config
+ *
+ * @author xzl
+ * @date 2024-01-10
+ */
+public class RptDataConfig extends BaseEntity {
+  private static final long serialVersionUID = 1L;
+
+  /**
+   * $column.columnComment
+   */
+  private Long id;
+
+  /**
+   * 报表ID
+   */
+  @Excel(name = "报表ID")
+  private String reportId;
+
+  /**
+   * $column.columnComment
+   */
+  @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+  private String reportName;
+
+  /**
+   * 报表数据块
+   */
+  @Excel(name = "报表数据块")
+  private String reportDataItem;
+
+  /**
+   * $column.columnComment
+   */
+  @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+  private String reportDataName;
+
+  /**
+   * $column.columnComment
+   */
+  @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+  private String reportDataField;
+
+  /**
+   * 报表数据内容
+   */
+  @Excel(name = "报表数据内容")
+  private String reportDataValue;
+
+  /**
+   * 0 手填, 1 函数填充
+   */
+  @Excel(name = "0 手填, 1 函数填充")
+  private String reportDataSource;
+
+  /**
+   * $column.columnComment
+   */
+  @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+  private Integer reportDataNum;
+
+  /**
+   * $column.columnComment
+   */
+  @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+  private Date createdDate;
+
+  /**
+   * $column.columnComment
+   */
+  @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+  private String lastModifiedBy;
+
+  /**
+   * $column.columnComment
+   */
+  @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+  private Date lastModifiedDate;
+
+  public void setId(Long id) {
+    this.id = id;
+  }
+
+  public Long getId() {
+    return id;
+  }
+
+  public void setReportId(String reportId) {
+    this.reportId = reportId;
+  }
+
+  public String getReportId() {
+    return reportId;
+  }
+
+  public void setReportName(String reportName) {
+    this.reportName = reportName;
+  }
+
+  public String getReportName() {
+    return reportName;
+  }
+
+  public void setReportDataItem(String reportDataItem) {
+    this.reportDataItem = reportDataItem;
+  }
+
+  public String getReportDataItem() {
+    return reportDataItem;
+  }
+
+  public void setReportDataName(String reportDataName) {
+    this.reportDataName = reportDataName;
+  }
+
+  public String getReportDataName() {
+    return reportDataName;
+  }
+
+  public void setReportDataField(String reportDataField) {
+    this.reportDataField = reportDataField;
+  }
+
+  public String getReportDataField() {
+    return reportDataField;
+  }
+
+  public void setReportDataValue(String reportDataValue) {
+    this.reportDataValue = reportDataValue;
+  }
+
+  public String getReportDataValue() {
+    return reportDataValue;
+  }
+
+  public void setReportDataSource(String reportDataSource) {
+    this.reportDataSource = reportDataSource;
+  }
+
+  public String getReportDataSource() {
+    return reportDataSource;
+  }
+
+  public void setReportDataNum(Integer reportDataNum) {
+    this.reportDataNum = reportDataNum;
+  }
+
+  public Integer getReportDataNum() {
+    return reportDataNum;
+  }
+
+  public void setCreatedDate(Date createdDate) {
+    this.createdDate = createdDate;
+  }
+
+  public Date getCreatedDate() {
+    return createdDate;
+  }
+
+  public void setLastModifiedBy(String lastModifiedBy) {
+    this.lastModifiedBy = lastModifiedBy;
+  }
+
+  public String getLastModifiedBy() {
+    return lastModifiedBy;
+  }
+
+  public void setLastModifiedDate(Date lastModifiedDate) {
+    this.lastModifiedDate = lastModifiedDate;
+  }
+
+  public Date getLastModifiedDate() {
+    return lastModifiedDate;
+  }
+
+  @Override
+  public String toString() {
+    return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+      .append("id", getId())
+      .append("reportId", getReportId())
+      .append("reportName", getReportName())
+      .append("reportDataItem", getReportDataItem())
+      .append("reportDataName", getReportDataName())
+      .append("reportDataField", getReportDataField())
+      .append("reportDataValue", getReportDataValue())
+      .append("reportDataSource", getReportDataSource())
+      .append("reportDataNum", getReportDataNum())
+      .append("createBy", getCreateBy())
+      .append("createdDate", getCreatedDate())
+      .append("lastModifiedBy", getLastModifiedBy())
+      .append("lastModifiedDate", getLastModifiedDate())
+      .toString();
+  }
+}

+ 63 - 0
xzl-system/src/main/java/com/xzl/system/mapper/RptDataConfigMapper.java

@@ -0,0 +1,63 @@
+package com.xzl.system.mapper;
+
+import java.util.List;
+import com.xzl.system.domain.RptDataConfig;
+
+/**
+ * 【请填写功能名称】Mapper接口
+ * 
+ * @author xzl
+ * @date 2024-01-10
+ */
+public interface RptDataConfigMapper 
+{
+    /**
+     * 查询【请填写功能名称】
+     * 
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    public RptDataConfig selectRptDataConfigById(Long id);
+
+    /**
+     * 查询【请填写功能名称】列表
+     * 
+     * @param rptDataConfig 【请填写功能名称】
+     * @return 【请填写功能名称】集合
+     */
+    public List<RptDataConfig> selectRptDataConfigList(RptDataConfig rptDataConfig);
+
+    /**
+     * 新增【请填写功能名称】
+     * 
+     * @param rptDataConfig 【请填写功能名称】
+     * @return 结果
+     */
+    public int insertRptDataConfig(RptDataConfig rptDataConfig);
+
+    /**
+     * 修改【请填写功能名称】
+     * 
+     * @param rptDataConfig 【请填写功能名称】
+     * @return 结果
+     */
+    public int updateRptDataConfig(RptDataConfig rptDataConfig);
+
+    /**
+     * 删除【请填写功能名称】
+     * 
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    public int deleteRptDataConfigById(Long id);
+
+    /**
+     * 批量删除【请填写功能名称】
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteRptDataConfigByIds(Long[] ids);
+
+    List<RptDataConfig> selectDistinctRptDataConfigList(RptDataConfig rptDataConfig);
+}

+ 65 - 0
xzl-system/src/main/java/com/xzl/system/service/IRptDataConfigService.java

@@ -0,0 +1,65 @@
+package com.xzl.system.service;
+
+import java.util.List;
+
+import com.xzl.system.domain.RptDataConfig;
+
+/**
+ * 【请填写功能名称】Service接口
+ *
+ * @author xzl
+ * @date 2024-01-10
+ */
+public interface IRptDataConfigService {
+  /**
+   * 查询【请填写功能名称】
+   *
+   * @param id 【请填写功能名称】主键
+   * @return 【请填写功能名称】
+   */
+  public RptDataConfig selectRptDataConfigById(Long id);
+
+  /**
+   * 查询【请填写功能名称】列表
+   *
+   * @param rptDataConfig 【请填写功能名称】
+   * @return 【请填写功能名称】集合
+   */
+  public List<RptDataConfig> selectRptDataConfigList(RptDataConfig rptDataConfig);
+
+  /**
+   * 新增【请填写功能名称】
+   *
+   * @param rptDataConfig 【请填写功能名称】
+   * @return 结果
+   */
+  public int insertRptDataConfig(RptDataConfig rptDataConfig);
+
+  /**
+   * 修改【请填写功能名称】
+   *
+   * @param rptDataConfig 【请填写功能名称】
+   * @return 结果
+   */
+  public int updateRptDataConfig(RptDataConfig rptDataConfig);
+
+  /**
+   * 批量删除【请填写功能名称】
+   *
+   * @param ids 需要删除的【请填写功能名称】主键集合
+   * @return 结果
+   */
+  public int deleteRptDataConfigByIds(Long[] ids);
+
+  /**
+   * 删除【请填写功能名称】信息
+   *
+   * @param id 【请填写功能名称】主键
+   * @return 结果
+   */
+  public int deleteRptDataConfigById(Long id);
+
+  List<RptDataConfig> saveList(List<RptDataConfig> rptDataConfigList);
+
+  List<RptDataConfig> selectDistinctRptDataConfigList(RptDataConfig rptDataConfig);
+}

+ 115 - 0
xzl-system/src/main/java/com/xzl/system/service/impl/RptDataConfigServiceImpl.java

@@ -0,0 +1,115 @@
+package com.xzl.system.service.impl;
+
+import java.util.List;
+
+import com.alibaba.fastjson2.JSON;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.xzl.system.mapper.RptDataConfigMapper;
+import com.xzl.system.domain.RptDataConfig;
+import com.xzl.system.service.IRptDataConfigService;
+
+/**
+ * 【请填写功能名称】Service业务层处理
+ *
+ * @author xzl
+ * @date 2024-01-10
+ */
+@Service
+public class RptDataConfigServiceImpl implements IRptDataConfigService {
+  private static final Logger log = LoggerFactory.getLogger(RptDataConfigServiceImpl.class);
+  @Autowired
+  private RptDataConfigMapper rptDataConfigMapper;
+
+  /**
+   * 查询【请填写功能名称】
+   *
+   * @param id 【请填写功能名称】主键
+   * @return 【请填写功能名称】
+   */
+  @Override
+  public RptDataConfig selectRptDataConfigById(Long id) {
+    return rptDataConfigMapper.selectRptDataConfigById(id);
+  }
+
+  /**
+   * 查询【请填写功能名称】列表
+   *
+   * @param rptDataConfig 【请填写功能名称】
+   * @return 【请填写功能名称】
+   */
+  @Override
+  public List<RptDataConfig> selectRptDataConfigList(RptDataConfig rptDataConfig) {
+    return rptDataConfigMapper.selectRptDataConfigList(rptDataConfig);
+  }
+
+  /**
+   * 新增【请填写功能名称】
+   *
+   * @param rptDataConfig 【请填写功能名称】
+   * @return 结果
+   */
+  @Override
+  public int insertRptDataConfig(RptDataConfig rptDataConfig) {
+    return rptDataConfigMapper.insertRptDataConfig(rptDataConfig);
+  }
+
+  /**
+   * 修改【请填写功能名称】
+   *
+   * @param rptDataConfig 【请填写功能名称】
+   * @return 结果
+   */
+  @Override
+  public int updateRptDataConfig(RptDataConfig rptDataConfig) {
+    return rptDataConfigMapper.updateRptDataConfig(rptDataConfig);
+  }
+
+  /**
+   * 批量删除【请填写功能名称】
+   *
+   * @param ids 需要删除的【请填写功能名称】主键
+   * @return 结果
+   */
+  @Override
+  public int deleteRptDataConfigByIds(Long[] ids) {
+    return rptDataConfigMapper.deleteRptDataConfigByIds(ids);
+  }
+
+  /**
+   * 删除【请填写功能名称】信息
+   *
+   * @param id 【请填写功能名称】主键
+   * @return 结果
+   */
+  @Override
+  public int deleteRptDataConfigById(Long id) {
+    return rptDataConfigMapper.deleteRptDataConfigById(id);
+  }
+
+  /**
+   * 保存各字段数据
+   *
+   * @param rptDataConfigList
+   * @return
+   */
+  @Override
+  public List<RptDataConfig> saveList(List<RptDataConfig> rptDataConfigList) {
+    if (rptDataConfigList != null) {
+      rptDataConfigList.forEach(o -> {
+        //TODO 测试代码
+        o.setReportName(o.getReportDataValue());
+        o.setReportDataValue(null);
+        rptDataConfigMapper.updateRptDataConfig(o);
+      });
+    }
+    return rptDataConfigList;
+  }
+
+  @Override
+  public List<RptDataConfig> selectDistinctRptDataConfigList(RptDataConfig rptDataConfig) {
+    return rptDataConfigMapper.selectDistinctRptDataConfigList(rptDataConfig);
+  }
+}

+ 115 - 0
xzl-system/src/main/resources/mapper/system/RptDataConfigMapper.xml

@@ -0,0 +1,115 @@
+<?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.xzl.system.mapper.RptDataConfigMapper">
+
+    <resultMap type="RptDataConfig" id="RptDataConfigResult">
+        <result property="id"    column="id"    />
+        <result property="reportId"    column="report_id"    />
+        <result property="reportName"    column="report_name"    />
+        <result property="reportDataItem"    column="report_data_item"    />
+        <result property="reportDataName"    column="report_data_name"    />
+        <result property="reportDataField"    column="report_data_field"    />
+        <result property="reportDataValue"    column="report_data_value"    />
+        <result property="reportDataSource"    column="report_data_source"    />
+        <result property="reportDataNum"    column="report_data_num"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createdDate"    column="created_date"    />
+        <result property="lastModifiedBy"    column="last_modified_by"    />
+        <result property="lastModifiedDate"    column="last_modified_date"    />
+    </resultMap>
+
+    <sql id="selectRptDataConfigVo">
+        select id, report_id, report_name, report_data_item, report_data_name, report_data_field, report_data_value, report_data_source, report_data_num, create_by, created_date, last_modified_by, last_modified_date from rpt_data_config
+    </sql>
+
+    <select id="selectRptDataConfigList" parameterType="RptDataConfig" resultMap="RptDataConfigResult">
+        <include refid="selectRptDataConfigVo"/>
+        <where>
+            <if test="reportId != null  and reportId != ''"> and report_id = #{reportId}</if>
+            <if test="reportName != null  and reportName != ''"> and report_name like concat('%', #{reportName}, '%')</if>
+            <if test="reportDataItem != null  and reportDataItem != ''"> and report_data_item = #{reportDataItem}</if>
+            <if test="reportDataName != null  and reportDataName != ''"> and report_data_name like concat('%', #{reportDataName}, '%')</if>
+            <if test="reportDataField != null  and reportDataField != ''"> and report_data_field = #{reportDataField}</if>
+            <if test="reportDataValue != null  and reportDataValue != ''"> and report_data_value = #{reportDataValue}</if>
+            <if test="reportDataSource == null  or reportDataSource == ''"> and report_data_source = '0'</if>
+            <if test="reportDataSource != null  and reportDataSource != ''"> and report_data_source = #{reportDataSource}</if>
+            <if test="reportDataNum != null "> and report_data_num = #{reportDataNum}</if>
+            <if test="createdDate != null "> and created_date = #{createdDate}</if>
+            <if test="lastModifiedBy != null  and lastModifiedBy != ''"> and last_modified_by = #{lastModifiedBy}</if>
+            <if test="lastModifiedDate != null "> and last_modified_date = #{lastModifiedDate}</if>
+        </where>
+    </select>
+
+    <select id="selectDistinctRptDataConfigList" parameterType="RptDataConfig" resultMap="RptDataConfigResult">
+        select distinct report_id, report_name from rpt_data_config order by report_data_num asc
+    </select>
+
+    <select id="selectRptDataConfigById" parameterType="Long" resultMap="RptDataConfigResult">
+        <include refid="selectRptDataConfigVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertRptDataConfig" parameterType="RptDataConfig" useGeneratedKeys="true" keyProperty="id">
+        insert into rpt_data_config
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="reportId != null">report_id,</if>
+            <if test="reportName != null">report_name,</if>
+            <if test="reportDataItem != null">report_data_item,</if>
+            <if test="reportDataName != null">report_data_name,</if>
+            <if test="reportDataField != null">report_data_field,</if>
+            <if test="reportDataValue != null">report_data_value,</if>
+            <if test="reportDataSource != null">report_data_source,</if>
+            <if test="reportDataNum != null">report_data_num,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createdDate != null">created_date,</if>
+            <if test="lastModifiedBy != null">last_modified_by,</if>
+            <if test="lastModifiedDate != null">last_modified_date,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="reportId != null">#{reportId},</if>
+            <if test="reportName != null">#{reportName},</if>
+            <if test="reportDataItem != null">#{reportDataItem},</if>
+            <if test="reportDataName != null">#{reportDataName},</if>
+            <if test="reportDataField != null">#{reportDataField},</if>
+            <if test="reportDataValue != null">#{reportDataValue},</if>
+            <if test="reportDataSource != null">#{reportDataSource},</if>
+            <if test="reportDataNum != null">#{reportDataNum},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createdDate != null">#{createdDate},</if>
+            <if test="lastModifiedBy != null">#{lastModifiedBy},</if>
+            <if test="lastModifiedDate != null">#{lastModifiedDate},</if>
+         </trim>
+    </insert>
+
+    <update id="updateRptDataConfig" parameterType="RptDataConfig">
+        update rpt_data_config
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="reportId != null">report_id = #{reportId},</if>
+            <if test="reportName != null">report_name = #{reportName},</if>
+            <if test="reportDataItem != null">report_data_item = #{reportDataItem},</if>
+            <if test="reportDataName != null">report_data_name = #{reportDataName},</if>
+            <if test="reportDataField != null">report_data_field = #{reportDataField},</if>
+            <if test="reportDataValue != null">report_data_value = #{reportDataValue},</if>
+            <if test="reportDataSource != null">report_data_source = #{reportDataSource},</if>
+            <if test="reportDataNum != null">report_data_num = #{reportDataNum},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createdDate != null">created_date = #{createdDate},</if>
+            <if test="lastModifiedBy != null">last_modified_by = #{lastModifiedBy},</if>
+            <if test="lastModifiedDate != null">last_modified_date = #{lastModifiedDate},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteRptDataConfigById" parameterType="Long">
+        delete from rpt_data_config where id = #{id}
+    </delete>
+
+    <delete id="deleteRptDataConfigByIds" parameterType="String">
+        delete from rpt_data_config where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 29 - 0
xzl-ui/src/api/system/rpt-config.js

@@ -0,0 +1,29 @@
+import request from '@/utils/request'
+
+// 查询【请填写功能名称】列表
+
+export function pageConfig(query) {
+  return request({
+    url: '/rpt/data-config/page',
+    method: 'get',
+    params: query
+  })
+}
+
+export function listConfig(query) {
+  return request({
+    url: '/rpt/data-config/list',
+    method: 'get',
+    params: query
+  })
+}
+
+
+export function saveConfig(data) {
+  return request({
+    url: '/rpt/data-config/save',
+    method: 'post',
+    data: data
+  })
+}
+

+ 15 - 1
xzl-ui/src/router/index.js

@@ -189,7 +189,21 @@ export const dynamicRoutes = [
         meta: { title: '数据库数据查看', activeMenu: '/dataGovernance' }
       },
     ]
-  }
+  },
+  {
+    path: '/http/rpt/data',
+    component: Layout,
+    hidden: true,
+    permissions: ['rpt:data-config:list'],
+    children: [
+      {
+        path: 'form/:rptId(\\S+)',
+        component: () => import('@/views/rpt/form'),
+        name: 'Data',
+        meta: { title: '报表数据填报', activeMenu: '/http/rpt' }
+      }
+    ]
+  },
 
 ]
 

+ 127 - 0
xzl-ui/src/views/rpt/form.vue

@@ -0,0 +1,127 @@
+<template>
+  <div class="app-container" style="width:50%">
+    <el-form ref="form" label-width="120px">
+      <el-collapse v-for="(o,i) in form" v-model="activeNames" accordion>
+        <el-collapse-item :title="o.name" :name="''+i">
+          <template v-for="(f,j) in o.field">
+            <el-form-item :label="f.name">
+              <el-input v-model="f.value" :placeholder="'请输入' + f.name"/>
+            </el-form-item>
+          </template>
+        </el-collapse-item>
+      </el-collapse>
+    </el-form>
+    <div slot="footer" style="text-align: right;padding:6px;">
+      <el-button type="primary" @click="submitForm">确 定</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+  import {listConfig, saveConfig} from "@/api/system/rpt-config";
+
+  export default {
+    name: "RptDataConfigForm",
+    data() {
+      return {
+        rptId: '',
+        activeNames: ['0'],
+        form: [/*
+          {
+            name: '数据块1',
+            field: [
+              {
+                id: '1000',
+                name: 'f11',
+                value: ''
+              },
+              {
+                id: '1001',
+                name: 'f12',
+                value: ''
+              }
+            ]
+          },
+          {
+            name: '数据块2',
+            field: [
+              {
+                id: '2000',
+                name: 'f21',
+                value: ''
+              },
+              {
+                id: '2001',
+                name: 'f22',
+                value: 'dfgdfg'
+              },
+              {
+                id: '2001',
+                name: 'f23',
+                value: ''
+              }
+            ]
+          }*/
+        ]
+      }
+    },
+    created() {
+      const rptId = this.$route.params && this.$route.params.rptId;
+      this.rptId = rptId;
+      this.getFormData();
+    },
+    methods: {
+      getFormData() {
+        const t = this
+        listConfig({reportId: t.rptId}).then(rs => {
+          // 将数据转成 form 需要的结构
+          const items = rs.data;
+          if (items && items.length > 0) {
+            t.form = [];
+            // 添加第一层数据(数据块)
+            items.forEach(o => {
+              let exists = false
+              t.form.forEach(f => {
+                if (o.reportDataItem == f.name) {
+                  exists = true
+                }
+              })
+
+              if (!exists) {
+                t.form.push({
+                  name: o.reportDataItem,
+                  field: []
+                })
+              }
+            })
+
+            // 添加第二层数据(属性)
+            t.form.forEach(f => {
+              items.forEach(o => {
+                if (o.reportDataItem == f.name) {
+                  f.field.push({name: o.reportDataField, value: o.reportDataValue, id: o.id})
+                }
+              })
+            })
+          }
+        })
+      },
+      submitForm() {
+        const data = []
+        // 把form里面的数据拉平
+        this.form.forEach(o => {
+          o.field.forEach(f => {
+            data.push({id: f.id, reportDataValue: f.value ? f.value : ''})
+          })
+        })
+        saveConfig(data).then(rs => {
+          this.$modal.msgSuccess("保存成功");
+        })
+      }
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 106 - 0
xzl-ui/src/views/rpt/index.vue

@@ -0,0 +1,106 @@
+<template>
+  <div class="app-container">
+    <el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange">
+      <el-table-column label="报表ID" align="center" prop="reportId">
+        <template slot-scope="scope">
+          <router-link :to="'./rpt/data/form/' + scope.row.reportId" class="link-type">
+            <span>{{ scope.row.reportId }}</span>
+          </router-link>
+        </template>
+      </el-table-column>
+      <el-table-column label="报表名称" align="center" prop="reportName"/>
+    </el-table>
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+  import {pageConfig} from "@/api/system/rpt-config";
+
+  export default {
+    name: "RptDataConfig",
+    data() {
+      return {
+        // 遮罩层
+        loading: true,
+        // 选中数组
+        ids: [],
+        // 非单个禁用
+        single: true,
+        // 非多个禁用
+        multiple: true,
+        // 显示搜索条件
+        showSearch: true,
+        // 总条数
+        total: 0,
+        // 【请填写功能名称】表格数据
+        configList: [],
+        // 弹出层标题
+        title: "",
+        // 是否显示弹出层
+        open: false,
+        // 查询参数
+        queryParams: {
+          pageNum: 1,
+          pageSize: 10,
+          reportId: null,
+          reportName: null,
+          reportDataItem: null,
+          reportDataName: null,
+          reportDataField: null,
+          reportDataValue: null,
+          reportDataSource: null,
+          reportDataNum: null,
+          createdDate: null,
+          lastModifiedBy: null,
+          lastModifiedDate: null
+        },
+        // 表单参数
+        form: {},
+        // 表单校验
+        rules: {}
+      };
+    },
+    created() {
+      this.getList();
+    },
+    methods: {
+      /** 查询【请填写功能名称】列表 */
+      getList() {
+        this.loading = true;
+        pageConfig(this.queryParams).then(response => {
+          this.configList = response.rows;
+          this.total = response.total;
+          this.loading = false;
+        });
+      },
+
+      /** 搜索按钮操作 */
+      handleQuery() {
+        this.queryParams.pageNum = 1;
+        this.getList();
+      },
+      /** 重置按钮操作 */
+      resetQuery() {
+        this.resetForm("queryForm");
+        this.handleQuery();
+      },
+      // 多选框选中数据
+      handleSelectionChange(selection) {
+        this.ids = selection.map(item => item.id)
+        this.single = selection.length !== 1
+        this.multiple = !selection.length
+      }
+    }
+  };
+</script>
+
+<style scoped>
+
+</style>