Explorar o código

动态表单新增字段

xuezizhuo hai 1 ano
pai
achega
f486480b0f

+ 24 - 0
ruoyi-system/src/main/java/com/ruoyi/system/entity/DragTable.java

@@ -64,6 +64,12 @@ public class DragTable extends BaseEntity
     /** 是否显示列表复选框(0:显示;1;不显示) */
     private String isSelection;
 
+    /** 回显数据(前端修改回显数据使用) */
+    private String echoData;
+
+    /** 菜单编号 */
+    private Long menuId;
+
     public void settId(Long tId) 
     {
         this.tId = tId;
@@ -180,6 +186,22 @@ public class DragTable extends BaseEntity
         this.isSelection = isSelection;
     }
 
+    public String getEchoData() {
+        return echoData;
+    }
+
+    public void setEchoData(String echoData) {
+        this.echoData = echoData;
+    }
+
+    public Long getMenuId() {
+        return menuId;
+    }
+
+    public void setMenuId(Long menuId) {
+        this.menuId = menuId;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -200,6 +222,8 @@ public class DragTable extends BaseEntity
             .append("updateBy", getUpdateBy())
             .append("updateTime", getUpdateTime())
             .append("isSelection", getIsSelection())
+            .append("echoData",getEchoData())
+            .append("menuId",getMenuId())
             .toString();
     }
 }

+ 25 - 2
ruoyi-system/src/main/java/com/ruoyi/system/entity/vo/DragTableVo.java

@@ -52,6 +52,11 @@ public class DragTableVo
     /** 导出字段名以及列名JSON */
     private Object tableExportField;
 
+    /** 回显数据(前端修改回显数据使用) */
+    private String echoData;
+
+    /** 菜单编号 */
+    private Long menuId;
 
     public Long gettId() {
         return tId;
@@ -149,6 +154,22 @@ public class DragTableVo
         this.tableExportField = tableExportField;
     }
 
+    public String getEchoData() {
+        return echoData;
+    }
+
+    public void setEchoData(String echoData) {
+        this.echoData = echoData;
+    }
+
+    public Long getMenuId() {
+        return menuId;
+    }
+
+    public void setMenuId(Long menuId) {
+        this.menuId = menuId;
+    }
+
     @Override
     public String toString() {
         return "DragTableVo{" +
@@ -158,12 +179,14 @@ public class DragTableVo
                 ", tableKey='" + tableKey + '\'' +
                 ", sqlKey='" + sqlKey + '\'' +
                 ", dtTableName='" + dtTableName + '\'' +
-                ", dtColumnName='" + dtColumnName + '\'' +
+                ", dtColumnName=" + dtColumnName +
                 ", timeFormat='" + timeFormat + '\'' +
                 ", isSelection='" + isSelection + '\'' +
                 ", searchFieldList=" + searchFieldList +
                 ", tableSql='" + tableSql + '\'' +
-                ", tableExportField='" + tableExportField + '\'' +
+                ", tableExportField=" + tableExportField +
+                ", echoData='" + echoData + '\'' +
+                ", menuId=" + menuId +
                 '}';
     }
 }

+ 11 - 1
ruoyi-system/src/main/resources/mapper/dragmapper/DragTableMapper.xml

@@ -22,6 +22,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateBy"    column="update_by"    />
         <result property="updateTime"    column="update_time"    />
         <result property="isSelection"   column="is_selection"/>
+        <result property="echoData"      column="echo_data"/>
+        <result property="menuId" column="menu_id"/>
     </resultMap>
 
     <resultMap type="com.ruoyi.system.entity.vo.DragTableVo" id="DragTableVoResult">
@@ -36,10 +38,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="isSelection"   column="is_selection"/>
         <result property="tableSql" column="table_sql"/>
         <result property="tableExportField" column="table_export_field"/>
+        <result property="echoData"      column="echo_data"/>
+        <result property="menuId" column="menu_id"/>
     </resultMap>
 
     <sql id="selectDragTableVo">
-        select t_id, dt_name, dt_nickname, table_key, sql_key, dt_table_name,time_format, dt_notes, dt_column_name, spare, spare1, del_flag, create_by, create_time, update_by, update_time, is_selection from drag_table
+        select t_id, dt_name, dt_nickname, table_key, sql_key, dt_table_name,time_format, dt_notes, dt_column_name, spare, spare1, del_flag, create_by, create_time, update_by, update_time, is_selection,echo_data,menu_id from drag_table
     </sql>
 
     <select id="selectDragTableList" parameterType="com.ruoyi.system.entity.DragTable" resultMap="DragTableResult">
@@ -78,6 +82,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="delFlag != null">del_flag,</if>
             <if test="createBy != null">create_by,</if>
             <if test="isSelection != null">is_selection,</if>
+            <if test="echoData != null">echo_data,</if>
+            <if test="menuId != null">menu_id,</if>
             create_time
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -94,6 +100,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="delFlag != null">#{delFlag},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="isSelection != null">#{isSelection},</if>
+            <if test="echoData != null">#{echoData},</if>
+            <if test="menuId != null">#{menuId},</if>
             now()
          </trim>
     </insert>
@@ -117,6 +125,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="isSelection != null">is_selection = #{isSelection},</if>
+            <if test="echoData != null">echo_data = #{echoData},</if>
+            <if test="menuId != null">menu_id = #{menuId},</if>
         </trim>
         where t_id = #{tId}
     </update>