forked from github/dataease
Merge pull request #12092 from dataease/pr@dev-v2@feat_outer-params-check
feat(数据大屏、仪表板): 板外部参数必传校验、支持默认值 #11501
This commit is contained in:
commit
82f1794cd3
@ -14,7 +14,7 @@ public class MybatisPlusGenerator {
|
||||
* 第一 我嫌麻烦
|
||||
* 第二 后面配置会放到nacos读起来更麻烦了
|
||||
*/
|
||||
private static final String url = "jdbc:mysql://localhost:3306/dataease?autoReconnect=false&useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false";
|
||||
private static final String url = "jdbc:mysql://localhost:3306/dataease4?autoReconnect=false&useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false";
|
||||
private static final String username = "root";
|
||||
private static final String password = "123456";
|
||||
|
||||
@ -25,7 +25,7 @@ public class MybatisPlusGenerator {
|
||||
/**
|
||||
* 这是要生成代码的表名称
|
||||
*/
|
||||
private static final String TABLE_NAME = "visualization_outer_params_target_view_info";
|
||||
private static final String TABLE_NAME = "visualization_outer_params_info";
|
||||
|
||||
/**
|
||||
* 下面两个配置基本上不用动
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.dataease.visualization.dao.auto.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -9,7 +10,7 @@ import java.io.Serializable;
|
||||
* </p>
|
||||
*
|
||||
* @author fit2cloud
|
||||
* @since 2024-03-08
|
||||
* @since 2024-09-09
|
||||
*/
|
||||
@TableName("visualization_outer_params")
|
||||
public class VisualizationOuterParams implements Serializable {
|
||||
@ -19,6 +20,7 @@ public class VisualizationOuterParams implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId("params_id")
|
||||
private String paramsId;
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.dataease.visualization.dao.auto.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -9,7 +10,7 @@ import java.io.Serializable;
|
||||
* </p>
|
||||
*
|
||||
* @author fit2cloud
|
||||
* @since 2024-03-08
|
||||
* @since 2024-09-09
|
||||
*/
|
||||
@TableName("visualization_outer_params_info")
|
||||
public class VisualizationOuterParamsInfo implements Serializable {
|
||||
@ -19,6 +20,7 @@ public class VisualizationOuterParamsInfo implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId("params_info_id")
|
||||
private String paramsInfoId;
|
||||
|
||||
/**
|
||||
@ -46,6 +48,16 @@ public class VisualizationOuterParamsInfo implements Serializable {
|
||||
*/
|
||||
private String copyId;
|
||||
|
||||
/**
|
||||
* 是否必填
|
||||
*/
|
||||
private Boolean required;
|
||||
|
||||
/**
|
||||
* 默认值 JSON格式
|
||||
*/
|
||||
private String defaultValue;
|
||||
|
||||
public String getParamsInfoId() {
|
||||
return paramsInfoId;
|
||||
}
|
||||
@ -94,6 +106,22 @@ public class VisualizationOuterParamsInfo implements Serializable {
|
||||
this.copyId = copyId;
|
||||
}
|
||||
|
||||
public Boolean getRequired() {
|
||||
return required;
|
||||
}
|
||||
|
||||
public void setRequired(Boolean required) {
|
||||
this.required = required;
|
||||
}
|
||||
|
||||
public String getDefaultValue() {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public void setDefaultValue(String defaultValue) {
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "VisualizationOuterParamsInfo{" +
|
||||
@ -103,6 +131,8 @@ public class VisualizationOuterParamsInfo implements Serializable {
|
||||
", checked = " + checked +
|
||||
", copyFrom = " + copyFrom +
|
||||
", copyId = " + copyId +
|
||||
", required = " + required +
|
||||
", defaultValue = " + defaultValue +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
* </p>
|
||||
*
|
||||
* @author fit2cloud
|
||||
* @since 2024-03-08
|
||||
* @since 2024-09-09
|
||||
*/
|
||||
@Mapper
|
||||
public interface VisualizationOuterParamsInfoMapper extends BaseMapper<VisualizationOuterParamsInfo> {
|
||||
|
@ -10,7 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
* </p>
|
||||
*
|
||||
* @author fit2cloud
|
||||
* @since 2024-03-08
|
||||
* @since 2024-09-09
|
||||
*/
|
||||
@Mapper
|
||||
public interface VisualizationOuterParamsMapper extends BaseMapper<VisualizationOuterParams> {
|
||||
|
@ -16,6 +16,8 @@
|
||||
<result column="params_id" jdbcType="VARCHAR" property="paramsId" />
|
||||
<result column="param_name" jdbcType="VARCHAR" property="paramName" />
|
||||
<result column="checked" jdbcType="BIT" property="checked" />
|
||||
<result column="required" jdbcType="BIT" property="checked" />
|
||||
<result column="default_value" jdbcType="VARCHAR" property="copyFrom" />
|
||||
<result column="copy_from" jdbcType="VARCHAR" property="copyFrom" />
|
||||
<result column="copy_id" jdbcType="VARCHAR" property="copyId" />
|
||||
</resultMap>
|
||||
|
@ -4,14 +4,14 @@
|
||||
:append-to-body="true"
|
||||
title="外部参数设置"
|
||||
v-model="state.outerParamsSetVisible"
|
||||
width="70vw"
|
||||
width="80vw"
|
||||
top="10vh"
|
||||
trigger="click"
|
||||
>
|
||||
<el-row style="height: 550px">
|
||||
<el-row v-loading="state.loading">
|
||||
<el-row class="preview">
|
||||
<el-col :span="8" class="preview-left">
|
||||
<el-col :span="6" class="preview-left">
|
||||
<el-row class="tree-head">
|
||||
<span class="head-text">参数列表</span>
|
||||
<span class="head-filter">
|
||||
@ -68,7 +68,7 @@
|
||||
</el-tree>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="16" class="preview-show">
|
||||
<el-col :span="14" class="preview-show">
|
||||
<el-row v-if="state.curNodeId">
|
||||
<el-row class="new-params-title"> 选择参数关联组件 </el-row>
|
||||
<el-row class="new-params-filter" v-if="state.outerParamsInfo?.filterInfo?.length">
|
||||
@ -246,6 +246,11 @@
|
||||
<empty-background description="请配置参数" img-type="noneWhite" />
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="params-attach-setting">
|
||||
<el-row v-if="state.curNodeId">
|
||||
<el-row class="new-params-title"> 参数配置 </el-row>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row>
|
||||
<el-row class="root-class">
|
||||
@ -320,6 +325,8 @@ const state = reactive({
|
||||
defaultOuterParamsInfo: {
|
||||
paramName: '',
|
||||
checked: true,
|
||||
required: false,
|
||||
defaultValue: {},
|
||||
targetViewInfoList: []
|
||||
},
|
||||
defaultTargetViewInfo: {
|
||||
@ -972,4 +979,8 @@ defineExpose({
|
||||
.expand-custom-outer {
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.params-attach-setting {
|
||||
border-left: 1px solid #e6e6e6;
|
||||
}
|
||||
</style>
|
||||
|
@ -36,6 +36,18 @@ public class VisualizationOuterParamsInfoVO implements Serializable {
|
||||
*/
|
||||
private Boolean checked;
|
||||
|
||||
|
||||
/**
|
||||
* 是否必填
|
||||
*/
|
||||
private Boolean required;
|
||||
|
||||
/**
|
||||
* 默认值 JSON格式
|
||||
*/
|
||||
private String defaultValue;
|
||||
|
||||
|
||||
/**
|
||||
* 复制来源
|
||||
*/
|
||||
|
@ -46,6 +46,17 @@ public class VisualizationOuterParamsVO implements Serializable {
|
||||
*/
|
||||
private String copyId;
|
||||
|
||||
/**
|
||||
* 是否必填
|
||||
*/
|
||||
private Boolean required;
|
||||
|
||||
/**
|
||||
* 默认值 JSON格式
|
||||
*/
|
||||
private String defaultValue;
|
||||
|
||||
|
||||
public String getParamsId() {
|
||||
return paramsId;
|
||||
}
|
||||
@ -97,12 +108,14 @@ public class VisualizationOuterParamsVO implements Serializable {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "VisualizationOuterParams{" +
|
||||
"paramsId = " + paramsId +
|
||||
", visualizationId = " + visualizationId +
|
||||
", checked = " + checked +
|
||||
", remark = " + remark +
|
||||
", copyFrom = " + copyFrom +
|
||||
", copyId = " + copyId +
|
||||
"}";
|
||||
"paramsId = " + paramsId +
|
||||
", visualizationId = " + visualizationId +
|
||||
", checked = " + checked +
|
||||
", required = " + required +
|
||||
", defaultValue = " + defaultValue +
|
||||
", remark = " + remark +
|
||||
", copyFrom = " + copyFrom +
|
||||
", copyId = " + copyId +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user