Merge branch 'dev-v2' of github.com:dataease/dataease into dev-v2

This commit is contained in:
xuwei-fit2cloud 2024-03-11 17:10:32 +08:00
commit b0f296ab39
33 changed files with 1680 additions and 59 deletions

View File

@ -52,6 +52,7 @@ DataEase 是开源的数据可视化分析工具,帮助用户快速分析数
- [在线文档](https://dataease.io/docs/)
- [社区论坛](https://bbs.fit2cloud.com/c/de/6)
- [快速入门视频](https://www.bilibili.com/video/BV1Z84y1X7eF/)
- [嵌入式 BI 体验](https://embedded-bi.dataease.cn/)
## License

View File

@ -21,11 +21,11 @@ public class MybatisPlusGenerator {
/**
* 业务模块例如datasource,dataset,panel等
*/
private static final String busi = "template";
private static final String busi = "visualization";
/**
* 这是要生成代码的表名称
*/
private static final String TABLE_NAME = "visualization_template";
private static final String TABLE_NAME = "visualization_outer_params_target_view_info";
/**
* 下面两个配置基本上不用动

View File

@ -6,13 +6,13 @@ import io.dataease.api.dataset.union.model.SQLMeta;
import io.dataease.api.dataset.union.model.SQLObj;
import io.dataease.dto.dataset.DatasetTableFieldDTO;
import io.dataease.engine.constant.SQLConstants;
import io.dataease.engine.utils.DateUtils;
import io.dataease.engine.utils.Utils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @Author Junjun
@ -47,18 +47,15 @@ public class CustomWhere2Str {
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
// 此处获取标准格式的日期
whereName = String.format(SQLConstants.DE_STR_TO_DATE, originName, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : SQLConstants.DEFAULT_DATE_FORMAT);
whereName = String.format(SQLConstants.DATE_FORMAT, whereName, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : SQLConstants.DEFAULT_DATE_FORMAT);
}
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
String cast = String.format(SQLConstants.CAST, originName, SQLConstants.DEFAULT_INT_FORMAT);
// 此处获取标准格式的日期
whereName = String.format(SQLConstants.FROM_UNIXTIME, cast, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : SQLConstants.DEFAULT_DATE_FORMAT);
whereName = String.format(SQLConstants.DATE_FORMAT, whereName, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : SQLConstants.DEFAULT_DATE_FORMAT);
whereName = String.format(SQLConstants.FROM_UNIXTIME, cast, SQLConstants.DEFAULT_DATE_FORMAT);
}
if (field.getDeExtractType() == 1) {
// 此处获取标准格式的日期
String f = DateUtils.get_date_format(originName);
whereName = String.format(SQLConstants.DATE_FORMAT, originName, f);
whereName = originName;
}
} else if (field.getDeType() == 2 || field.getDeType() == 3) {
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
@ -88,14 +85,10 @@ public class CustomWhere2Str {
String whereTerm = Utils.transFilterTerm(filterItemDTO.getTerm());
String whereValue = "";
String whereNameReal;
// String whereNameReal;
if (field.getDeType() == 1) {
// 规定几种日期格式一一匹配匹配到就是该格式
String f = DateUtils.get_date_format(filterItemDTO.getValue());
String n = String.format(SQLConstants.DE_STR_TO_DATE, whereName, f);
whereNameReal = String.format(SQLConstants.UNIX_TIMESTAMP, n);
} else {
whereNameReal = whereName;
whereName = String.format(SQLConstants.UNIX_TIMESTAMP, whereName);
}
if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "null")) {
@ -111,13 +104,27 @@ public class CustomWhere2Str {
} else if (StringUtils.containsIgnoreCase(filterItemDTO.getTerm(), "like")) {
whereValue = "'%" + value + "%'";
} else {
// 如果是时间字段过滤当条件是等于和不等于的时候转换成between和not between
if (field.getDeType() == 1) {
value = Utils.allDateFormat2Long(value) + "";
if (StringUtils.containsIgnoreCase(whereTerm, "=")) {
whereTerm = " BETWEEN ";
// 把value类似过滤组件处理获得start time和end time
Map<String, Long> stringLongMap = Utils.parseDateTimeValue(value);
whereValue = String.format(SQLConstants.WHERE_VALUE_BETWEEN, stringLongMap.get("startTime"), stringLongMap.get("endTime"));
} else if (StringUtils.containsIgnoreCase(whereTerm, "<>")) {
whereTerm = " NOT BETWEEN ";
Map<String, Long> stringLongMap = Utils.parseDateTimeValue(value);
whereValue = String.format(SQLConstants.WHERE_VALUE_BETWEEN, stringLongMap.get("startTime"), stringLongMap.get("endTime"));
} else {
value = Utils.allDateFormat2Long(value) + "";
whereValue = String.format(SQLConstants.WHERE_VALUE_VALUE, value);
}
} else {
whereValue = String.format(SQLConstants.WHERE_VALUE_VALUE, value);
}
whereValue = String.format(SQLConstants.WHERE_VALUE_VALUE, value);
}
list.add(SQLObj.builder()
.whereField(whereNameReal)
.whereField(whereName)
.whereTermAndValue(whereTerm + whereValue)
.build());
}

View File

@ -5,7 +5,6 @@ import io.dataease.api.dataset.union.model.SQLMeta;
import io.dataease.api.dataset.union.model.SQLObj;
import io.dataease.dto.dataset.DatasetTableFieldDTO;
import io.dataease.engine.constant.SQLConstants;
import io.dataease.engine.utils.DateUtils;
import io.dataease.engine.utils.Utils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
@ -53,12 +52,6 @@ public class ExtWhere2Str {
}
if (field.getDeType() == 1) {
String date_format;
if (StringUtils.containsIgnoreCase(request.getOperator(), "between")) {
date_format = "yyyy-MM-dd HH:mm:ss";
} else {
date_format = DateUtils.get_date_format(value.get(0));
}
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
// 此处获取标准格式的日期
whereName = String.format(SQLConstants.DE_STR_TO_DATE, originName, StringUtils.isEmpty(field.getDateFormat()) ? SQLConstants.DEFAULT_DATE_FORMAT : field.getDateFormat());
@ -66,12 +59,12 @@ public class ExtWhere2Str {
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
String cast = String.format(SQLConstants.CAST, originName, SQLConstants.DEFAULT_INT_FORMAT);
// 此处获取标准格式的日期
whereName = String.format(SQLConstants.FROM_UNIXTIME, cast, date_format);
whereName = String.format(SQLConstants.FROM_UNIXTIME, cast, SQLConstants.DEFAULT_DATE_FORMAT);
whereName = String.format(SQLConstants.UNIX_TIMESTAMP, whereName);
}
if (field.getDeExtractType() == 1) {
// 此处获取标准格式的日期
whereName = String.format(SQLConstants.DE_STR_TO_DATE, originName, StringUtils.isEmpty(field.getDateFormat()) ? SQLConstants.DEFAULT_DATE_FORMAT : field.getDateFormat());
whereName = originName;
}
} else if (field.getDeType() == 2 || field.getDeType() == 3) {
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {

View File

@ -8,7 +8,6 @@ import io.dataease.api.permissions.dataset.dto.DatasetRowPermissionsTreeObj;
import io.dataease.dto.dataset.DatasetTableFieldDTO;
import io.dataease.engine.constant.ExtFieldConstant;
import io.dataease.engine.constant.SQLConstants;
import io.dataease.engine.utils.DateUtils;
import io.dataease.engine.utils.Utils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
@ -16,6 +15,7 @@ import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
@ -92,16 +92,13 @@ public class WhereTree2Str {
if (field.getDeType() == 1) {
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
whereName = String.format(SQLConstants.DE_STR_TO_DATE, originName, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : SQLConstants.DEFAULT_DATE_FORMAT);
whereName = String.format(SQLConstants.DATE_FORMAT, whereName, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : SQLConstants.DEFAULT_DATE_FORMAT);
}
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
String cast = String.format(SQLConstants.CAST, originName, SQLConstants.DEFAULT_INT_FORMAT);
whereName = String.format(SQLConstants.FROM_UNIXTIME, cast, SQLConstants.DEFAULT_DATE_FORMAT);
whereName = String.format(SQLConstants.DATE_FORMAT, whereName, SQLConstants.DEFAULT_DATE_FORMAT);
}
if (field.getDeExtractType() == 1) {
String f = DateUtils.get_date_format(originName);
whereName = String.format(SQLConstants.DATE_FORMAT, originName, f);
whereName = originName;
}
} else if (field.getDeType() == 2 || field.getDeType() == 3) {
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
@ -130,16 +127,7 @@ public class WhereTree2Str {
String whereValue = "";
if (field.getDeType() == 1) {
// 规定几种日期格式一一匹配匹配到就是该格式
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
String f = DateUtils.get_date_format(item.getValue());
whereName = String.format(SQLConstants.DE_STR_TO_DATE, whereName, f);
whereName = String.format(SQLConstants.UNIX_TIMESTAMP, whereName);
} else {
String f = DateUtils.get_date_format(item.getValue());
whereName = String.format(SQLConstants.DE_STR_TO_DATE, whereName, f);
whereName = String.format(SQLConstants.UNIX_TIMESTAMP, whereName);
}
whereName = String.format(SQLConstants.UNIX_TIMESTAMP, whereName);
}
if (StringUtils.equalsIgnoreCase(item.getTerm(), "null")) {
@ -155,10 +143,24 @@ public class WhereTree2Str {
} else if (StringUtils.containsIgnoreCase(item.getTerm(), "like")) {
whereValue = "'%" + value + "%'";
} else {
// 如果是时间字段过滤当条件是等于和不等于的时候转换成between和not between
if (field.getDeType() == 1) {
value = Utils.allDateFormat2Long(value) + "";
if (StringUtils.containsIgnoreCase(whereTerm, "=")) {
whereTerm = " BETWEEN ";
// 把value类似过滤组件处理获得start time和end time
Map<String, Long> stringLongMap = Utils.parseDateTimeValue(value);
whereValue = String.format(SQLConstants.WHERE_VALUE_BETWEEN, stringLongMap.get("startTime"), stringLongMap.get("endTime"));
} else if (StringUtils.containsIgnoreCase(whereTerm, "<>")) {
whereTerm = " NOT BETWEEN ";
Map<String, Long> stringLongMap = Utils.parseDateTimeValue(value);
whereValue = String.format(SQLConstants.WHERE_VALUE_BETWEEN, stringLongMap.get("startTime"), stringLongMap.get("endTime"));
} else {
value = Utils.allDateFormat2Long(value) + "";
whereValue = String.format(SQLConstants.WHERE_VALUE_VALUE, value);
}
} else {
whereValue = String.format(SQLConstants.WHERE_VALUE_VALUE, value);
}
whereValue = String.format(SQLConstants.WHERE_VALUE_VALUE, value);
}
SQLObj build = SQLObj.builder()
.whereField(whereName)

View File

@ -273,4 +273,97 @@ public class Utils {
}
return time;
}
public static Map<String, Long> parseDateTimeValue(String value) {
Map<String, Long> map = new LinkedHashMap<>();
long startTime = 0;
long endTime = 0;
String split = "-";
if (value != null && value.contains("/")) {
split = "/";
}
try {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy" + split + "MM" + split + "dd HH:mm:ss");
startTime = simpleDateFormat.parse(value).getTime();
endTime = startTime + 999;
map.put("startTime", startTime);
map.put("endTime", endTime);
return map;
} catch (Exception e) {
}
try {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy" + split + "MM" + split + "dd HH:mm");
startTime = simpleDateFormat.parse(value).getTime();
endTime = startTime + (60 * 1000 - 1);
map.put("startTime", startTime);
map.put("endTime", endTime);
return map;
} catch (Exception e) {
}
try {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy" + split + "MM" + split + "dd HH");
startTime = simpleDateFormat.parse(value).getTime();
endTime = startTime + (60 * 60 * 1000 - 1);
map.put("startTime", startTime);
map.put("endTime", endTime);
return map;
} catch (Exception e) {
}
try {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm:ss");
startTime = simpleDateFormat.parse(value).getTime();
endTime = startTime + 999;
map.put("startTime", startTime);
map.put("endTime", endTime);
return map;
} catch (Exception e) {
}
try {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy" + split + "MM" + split + "dd");
startTime = simpleDateFormat.parse(value).getTime();
endTime = startTime + (24 * 60 * 60 * 1000 - 1);
map.put("startTime", startTime);
map.put("endTime", endTime);
return map;
} catch (Exception e) {
}
try {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy" + split + "MM");
Date parse = simpleDateFormat.parse(value);
startTime = parse.getTime();
Calendar calendar = Calendar.getInstance();
calendar.setTime(parse);
calendar.add(Calendar.MONTH, 1);
endTime = calendar.getTime().getTime() - 1;
map.put("startTime", startTime);
map.put("endTime", endTime);
return map;
} catch (Exception e) {
}
try {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy");
Date parse = simpleDateFormat.parse(value);
startTime = parse.getTime();
Calendar calendar = Calendar.getInstance();
calendar.setTime(parse);
calendar.add(Calendar.YEAR, 1);
endTime = calendar.getTime().getTime() - 1;
map.put("startTime", startTime);
map.put("endTime", endTime);
return map;
} catch (Exception e) {
}
map.put("startTime", startTime);
map.put("endTime", endTime);
return map;
}
}

View File

@ -0,0 +1,108 @@
package io.dataease.visualization.dao.auto.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
/**
* <p>
* 外部参数关联关系表
* </p>
*
* @author fit2cloud
* @since 2024-03-08
*/
@TableName("visualization_outer_params")
public class VisualizationOuterParams implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String paramsId;
/**
* 可视化资源ID
*/
private String visualizationId;
/**
* 是否启用外部参数标识1-0-
*/
private Boolean checked;
/**
* 备注
*/
private String remark;
/**
* 复制来源
*/
private String copyFrom;
/**
* 复制来源ID
*/
private String copyId;
public String getParamsId() {
return paramsId;
}
public void setParamsId(String paramsId) {
this.paramsId = paramsId;
}
public String getVisualizationId() {
return visualizationId;
}
public void setVisualizationId(String visualizationId) {
this.visualizationId = visualizationId;
}
public Boolean getChecked() {
return checked;
}
public void setChecked(Boolean checked) {
this.checked = checked;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getCopyFrom() {
return copyFrom;
}
public void setCopyFrom(String copyFrom) {
this.copyFrom = copyFrom;
}
public String getCopyId() {
return copyId;
}
public void setCopyId(String copyId) {
this.copyId = copyId;
}
@Override
public String toString() {
return "VisualizationOuterParams{" +
"paramsId = " + paramsId +
", visualizationId = " + visualizationId +
", checked = " + checked +
", remark = " + remark +
", copyFrom = " + copyFrom +
", copyId = " + copyId +
"}";
}
}

View File

@ -0,0 +1,108 @@
package io.dataease.visualization.dao.auto.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
/**
* <p>
* 外部参数配置表
* </p>
*
* @author fit2cloud
* @since 2024-03-08
*/
@TableName("visualization_outer_params_info")
public class VisualizationOuterParamsInfo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String paramsInfoId;
/**
* visualization_outer_params 表的 ID
*/
private String paramsId;
/**
* 参数名
*/
private String paramName;
/**
* 是否启用
*/
private Boolean checked;
/**
* 复制来源
*/
private String copyFrom;
/**
* 复制来源ID
*/
private String copyId;
public String getParamsInfoId() {
return paramsInfoId;
}
public void setParamsInfoId(String paramsInfoId) {
this.paramsInfoId = paramsInfoId;
}
public String getParamsId() {
return paramsId;
}
public void setParamsId(String paramsId) {
this.paramsId = paramsId;
}
public String getParamName() {
return paramName;
}
public void setParamName(String paramName) {
this.paramName = paramName;
}
public Boolean getChecked() {
return checked;
}
public void setChecked(Boolean checked) {
this.checked = checked;
}
public String getCopyFrom() {
return copyFrom;
}
public void setCopyFrom(String copyFrom) {
this.copyFrom = copyFrom;
}
public String getCopyId() {
return copyId;
}
public void setCopyId(String copyId) {
this.copyId = copyId;
}
@Override
public String toString() {
return "VisualizationOuterParamsInfo{" +
"paramsInfoId = " + paramsInfoId +
", paramsId = " + paramsId +
", paramName = " + paramName +
", checked = " + checked +
", copyFrom = " + copyFrom +
", copyId = " + copyId +
"}";
}
}

View File

@ -0,0 +1,108 @@
package io.dataease.visualization.dao.auto.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
/**
* <p>
* 外部参数联动视图字段信息表
* </p>
*
* @author fit2cloud
* @since 2024-03-08
*/
@TableName("visualization_outer_params_target_view_info")
public class VisualizationOuterParamsTargetViewInfo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String targetId;
/**
* visualization_outer_params_info 表的 ID
*/
private String paramsInfoId;
/**
* 联动视图ID
*/
private String targetViewId;
/**
* 联动字段ID
*/
private String targetFieldId;
/**
* 复制来源
*/
private String copyFrom;
/**
* 复制来源ID
*/
private String copyId;
public String getTargetId() {
return targetId;
}
public void setTargetId(String targetId) {
this.targetId = targetId;
}
public String getParamsInfoId() {
return paramsInfoId;
}
public void setParamsInfoId(String paramsInfoId) {
this.paramsInfoId = paramsInfoId;
}
public String getTargetViewId() {
return targetViewId;
}
public void setTargetViewId(String targetViewId) {
this.targetViewId = targetViewId;
}
public String getTargetFieldId() {
return targetFieldId;
}
public void setTargetFieldId(String targetFieldId) {
this.targetFieldId = targetFieldId;
}
public String getCopyFrom() {
return copyFrom;
}
public void setCopyFrom(String copyFrom) {
this.copyFrom = copyFrom;
}
public String getCopyId() {
return copyId;
}
public void setCopyId(String copyId) {
this.copyId = copyId;
}
@Override
public String toString() {
return "VisualizationOuterParamsTargetViewInfo{" +
"targetId = " + targetId +
", paramsInfoId = " + paramsInfoId +
", targetViewId = " + targetViewId +
", targetFieldId = " + targetFieldId +
", copyFrom = " + copyFrom +
", copyId = " + copyId +
"}";
}
}

View File

@ -0,0 +1,18 @@
package io.dataease.visualization.dao.auto.mapper;
import io.dataease.visualization.dao.auto.entity.VisualizationOuterParamsInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* 外部参数配置表 Mapper 接口
* </p>
*
* @author fit2cloud
* @since 2024-03-08
*/
@Mapper
public interface VisualizationOuterParamsInfoMapper extends BaseMapper<VisualizationOuterParamsInfo> {
}

View File

@ -0,0 +1,18 @@
package io.dataease.visualization.dao.auto.mapper;
import io.dataease.visualization.dao.auto.entity.VisualizationOuterParams;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* 外部参数关联关系表 Mapper 接口
* </p>
*
* @author fit2cloud
* @since 2024-03-08
*/
@Mapper
public interface VisualizationOuterParamsMapper extends BaseMapper<VisualizationOuterParams> {
}

View File

@ -0,0 +1,18 @@
package io.dataease.visualization.dao.auto.mapper;
import io.dataease.visualization.dao.auto.entity.VisualizationOuterParamsTargetViewInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* 外部参数联动视图字段信息表 Mapper 接口
* </p>
*
* @author fit2cloud
* @since 2024-03-08
*/
@Mapper
public interface VisualizationOuterParamsTargetViewInfoMapper extends BaseMapper<VisualizationOuterParamsTargetViewInfo> {
}

View File

@ -73,3 +73,18 @@ export const storeStatusApi = (id: string): Promise<IResponse> => {
}
export const decompression = data => request.post({ url: '/dataVisualization/decompression', data })
export const detailList = dvId => {
return request.get({
url: '/dataVisualization/view/detailList/' + dvId,
method: 'get',
loading: false
})
}
export const getComponentInfo = dvId => {
return request.get({
url: '/panel/view/getComponentInfo/' + dvId,
loading: false
})
}

View File

@ -1,8 +1,8 @@
import request from '@/config/axios'
export function queryWithPanelId(panelId) {
export function queryWithDvId(dvId) {
return request.get({
url: '/outerParams/queryWithPanelId/' + panelId
url: '/outerParams/queryWithDvId/' + dvId
})
}
@ -14,9 +14,10 @@ export function updateOuterParamsSet(requestInfo) {
})
}
export function getOuterParamsInfo(panelId) {
export function getOuterParamsInfo(dvId) {
return request.get({
url: '/outerParams/getOuterParamsInfo/' + panelId,
loading: true
url: '/outerParams/getOuterParamsInfo/' + dvId,
method: 'get',
loading: false
})
}

View File

@ -0,0 +1,567 @@
<template>
<el-row style="height: 430px">
<el-row>
<span style="font-weight: 600; margin-right: 20px">{{
t('visualization.outer_param_set')
}}</span>
<el-checkbox v-model="state.outerParams?.checked">{{
t('visualization.enable_outer_param_set')
}}</el-checkbox>
</el-row>
<el-row v-loading="state.loading">
<el-row class="preview">
<el-col :span="8" style="height: 100%; overflow-y: hidden">
<el-row class="tree-head">
<span style="float: left; margin-left: 30px">{{ t('visualization.param_name') }}</span>
<span style="float: right; margin-right: 10px">{{
t('visualization.enable_param')
}}</span>
</el-row>
<el-row class="tree-content">
<el-tree
ref="outerParamsInfoTree"
:data="state.outerParamsInfoArray"
node-key="id"
highlight-current
:props="state.treeProp"
@node-click="nodeClick"
>
<template v-slot="{ node, data }">
<span class="custom-tree-node">
<span>
<span style="margin-left: 6px"
><el-input
v-model="data.paramName"
size="mini"
:placeholder="t('visualization.input_param_name')"
/></span>
</span>
<span @click.stop>
<div>
<span class="auth-span">
<el-checkbox
v-model="data.checked"
style="margin-right: 10px"
@change="sourceFieldCheckedChange(data)"
/>
<el-button
icon="el-icon-delete"
type="text"
size="small"
@click="removeOuterParamsInfo(node, data)"
/>
</span>
</div>
</span>
</span>
</template>
</el-tree>
</el-row>
<el-row class="tree-bottom">
<el-button
size="mini"
type="success"
icon="el-icon-plus"
round
@click="addOuterParamsInfo"
>{{ t('visualization.add_param') }}
</el-button>
</el-row>
</el-col>
<el-col :span="16" class="preview-show">
<el-row v-if="state.outerParamsInfo">
<el-row class="top_border">
<el-row style="margin-top: 10px">
<el-col :span="11">
<div class="ellip">{{ t('visualization.link_component') }}</div>
</el-col>
<el-col :span="11">
<div class="ellip">{{ t('visualization.link_component_field') }}</div>
</el-col>
</el-row>
<el-row style="height: 266px; overflow-y: auto">
<el-row
v-for="(targetViewInfo, index) in state.outerParamsInfo.targetViewInfoList"
:key="index"
>
<el-col :span="11">
<div class="select-filed">
<el-select
v-model="targetViewInfo.targetViewId"
filterable
style="width: 100%"
size="mini"
:placeholder="t('fu.search_bar.please_select')"
@change="viewInfoOnChange(targetViewInfo)"
>
<el-option
v-for="item in state.currentLinkPanelViewArray.filter(
curItem =>
!viewSelectedField.includes(curItem.id) ||
curItem.id === targetViewInfo.targetViewId
)"
:key="item.id"
:label="item.name"
:value="item.id"
>
<span v-if="item.isPlugin" style="float: left">
<svg-icon
:icon-class="
item.type !== 'buddle-map'
? '/api/pluginCommon/staticInfo/' + item.type + '/svg'
: item.type
"
style="width: 14px; height: 14px"
/>
</span>
<span v-else style="float: left">
<svg-icon :icon-class="item.type" style="width: 14px; height: 14px" />
</span>
<span style="float: left; font-size: 12px"> {{ item.name }}</span>
</el-option>
</el-select>
</div>
</el-col>
<el-col :span="11">
<div class="select-filed">
<el-select
v-model="targetViewInfo.targetFieldId"
filterable
:disabled="
state.viewIdFieldArrayMap[targetViewInfo.targetViewId] &&
state.viewIdFieldArrayMap[targetViewInfo.targetViewId].length === 1 &&
state.viewIdFieldArrayMap[targetViewInfo.targetViewId][0].id === 'empty'
"
style="width: 100%"
size="mini"
:placeholder="t('fu.search_bar.please_select')"
>
<el-option
v-for="viewField in state.viewIdFieldArrayMap[
targetViewInfo.targetViewId
]"
:key="viewField.id"
:label="viewField.name"
:value="viewField.id"
>
<span style="float: left">
<svg-icon
v-if="viewField.deType === 0"
icon-class="field_text"
class="field-icon-text"
/>
<svg-icon
v-if="viewField.deType === 1"
icon-class="field_time"
class="field-icon-time"
/>
<svg-icon
v-if="viewField.deType === 2 || viewField.deType === 3"
icon-class="field_value"
class="field-icon-value"
/>
<svg-icon
v-if="viewField.deType === 5"
icon-class="field_location"
class="field-icon-location"
/>
</span>
<span style="float: left; font-size: 12px">{{ viewField.name }}</span>
</el-option>
</el-select>
</div>
</el-col>
<el-col :span="2">
<div>
<el-button
icon="el-icon-delete"
type="text"
size="small"
style="float: left"
@click="deleteOuterParamsField(index)"
/>
</div>
</el-col>
</el-row>
</el-row>
<el-row class="bottom">
<el-button
size="mini"
type="success"
icon="el-icon-plus"
round
@click="addOuterParamsField"
>{{ t('visualization.add_param_link_field') }}
</el-button>
</el-row>
<!-- <el-button slot="reference">T</el-button>-->
<template v-slot:reference>
<i class="icon iconfont icon-edit slot-class" />
</template>
</el-row>
<el-row v-if="state.outerParamsInfo.linkType === 'outer'" style="height: 300px">
<el-input
v-model="state.outerParamsInfo.content"
:autosize="{ minRows: 14 }"
type="textarea"
:placeholder="t('visualization.input_jump_link')"
/>
</el-row>
</el-row>
<el-row
v-else
style="height: 100%; background-color: var(--MainContentBG)"
class="custom-position"
>
{{ t('visualization.select_param') }}
</el-row>
</el-col>
</el-row>
</el-row>
<el-row class="root-class">
<el-button size="mini" @click="cancel()">{{ t('commons.cancel') }} </el-button>
<el-button type="primary" size="mini" @click="save()">{{ t('commons.confirm') }} </el-button>
</el-row>
</el-row>
</template>
<script setup lang="ts">
import { ref, reactive, computed, nextTick } from 'vue'
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
import { storeToRefs } from 'pinia'
import { ElMessage } from 'element-plus-secondary'
import { useI18n } from '@/hooks/web/useI18n'
import { deepCopy } from '@/utils/utils'
import generateID from '@/utils/generateID'
import { queryWithDvId, updateOuterParamsSet } from '@/api/visualization/outerParams'
import { detailList } from '@/api/visualization/dataVisualization'
import checkArrayRepeat from '@/utils/check'
const dvMainStore = dvMainStoreWithOut()
const { dvInfo, componentData, canvasStyleData } = storeToRefs(dvMainStore)
const outerParamsInfoTree = ref(null)
const emits = defineEmits(['outerParamsSetVisibleChange'])
const { t } = useI18n()
const state = reactive({
loading: false,
treeProp: {
id: 'paramsInfoId',
label: 'paramName',
children: 'children'
},
outerParams: {},
outerParamsInfoArray: null,
mapOuterParamsInfoArray: {},
panelList: [],
outerParamsInfo: null,
currentFiledTreeNode: null,
defaultOuterParamsInfo: {
paramName: '',
checked: true,
targetViewInfoList: []
},
defaultTargetViewInfo: {
targetViewId: null,
targetFieldId: null
},
currentLinkPanelViewArray: [],
viewIdFieldArrayMap: {},
widgetSubjectsTrans: {
timeYearWidget: '年份过滤组件',
timeMonthWidget: '年月过滤组件',
timeDateWidget: '日期过滤组件',
timeDateRangeWidget: '日期范围过滤组件',
textSelectWidget: '文本下拉过滤组件',
textSelectGridWidget: '文本列表过滤组件',
textInputWidget: '文本搜索过滤组件',
textSelectTreeWidget: '下拉树过滤组件',
numberSelectWidget: '数字下拉过滤组件',
numberSelectGridWidget: '数字列表过滤组件',
numberRangeWidget: '数值区间过滤组件'
}
})
const viewSelectedField = computed(() =>
state.outerParamsInfo?.targetViewInfoList?.map(targetViewInfo => targetViewInfo.targetViewId)
)
const init = () => {
//
queryWithDvId(dvInfo.id).then(rsp => {
state.outerParams = rsp.data
state.outerParamsInfoArray = state.outerParams?.outerParamsInfoArray
if (state.outerParamsInfoArray.length > 0) {
state.outerParamsInfoArray.forEach(outerParamsInfo => {
state.mapOuterParamsInfoArray[outerParamsInfo.paramsInfoId] = outerParamsInfo
})
const firstNode = state.outerParamsInfoArray[0]
nextTick(() => {
outerParamsInfoTree.value.setCurrentKey(firstNode.paramsInfoId)
nodeClick(firstNode)
})
}
})
getPanelViewList(dvInfo.id)
}
const cancel = () => {
emits('outerParamsSetVisibleChange', false)
}
const save = () => {
if (checkArrayRepeat(state.outerParams.outerParamsInfoArray, 'paramName')) {
ElMessage.warning({
message: t('visualization.repeat_params'),
showClose: true
})
return
}
updateOuterParamsSet(state.outerParams).then(rsp => {
ElMessage({
message: t('commons.save_success'),
type: 'success',
showClose: true
})
cancel()
})
}
const nodeClick = data => {
state.outerParamsInfo = state.mapOuterParamsInfoArray[data.paramsInfoId]
}
//
const getPanelViewList = dvId => {
detailList(dvId).then(rsp => {
state.viewIdFieldArrayMap = {}
state.currentLinkPanelViewArray = rsp.data
if (state.currentLinkPanelViewArray) {
state.currentLinkPanelViewArray.forEach(view => {
state.viewIdFieldArrayMap[view.id] = view.tableFields
})
}
//
componentData.value.forEach(componentItem => {
if (componentItem.type === 'custom') {
state.currentLinkPanelViewArray.push({
id: componentItem.id,
type: 'filter',
name: componentItem.options.attrs.title
? componentItem.options.attrs.title
: state.widgetSubjectsTrans[componentItem.serviceName]
})
state.viewIdFieldArrayMap[componentItem.id] = [
{ id: 'empty', name: t('visualization.filter_no_select') }
]
}
})
})
}
const panelNodeClick = (data, node) => {
state.outerParamsInfo.targetViewInfoList = []
getPanelViewList(data.id)
}
const inputVal = value => {
if (!value) {
state.outerParamsInfo.targetViewInfoList = []
state.viewIdFieldArrayMap = {}
state.currentLinkPanelViewArray = []
}
}
const addOuterParamsField = () => {
state.outerParamsInfo.targetViewInfoList.push({
targetViewId: '',
targetFieldId: ''
})
}
const deleteOuterParamsField = index => {
state.outerParamsInfo.targetViewInfoList.splice(index, 1)
}
const normalizer = node => {
// children=null
if (node.children === null || node.children === 'null') {
delete node.children
}
}
const viewInfoOnChange = targetViewInfo => {
if (
state.viewIdFieldArrayMap[targetViewInfo.targetViewId] &&
state.viewIdFieldArrayMap[targetViewInfo.targetViewId].length === 1 &&
state.viewIdFieldArrayMap[targetViewInfo.targetViewId][0].id === 'empty'
) {
targetViewInfo.targetFieldId = 'empty'
} else {
targetViewInfo.targetFieldId = null
}
}
const sourceFieldCheckedChange = data => {
if (data.checked) {
state.outerParams?.checked = true
}
nextTick(() => {
outerParamsInfoTree.value.setCurrentKey(data.paramsInfoId)
nodeClick(data)
})
}
const addOuterParamsInfo = () => {
outerParamsInfoTree.value.checked = true
const outerParamsInfo = deepCopy(state.defaultOuterParamsInfo)
outerParamsInfo['paramsInfoId'] = generateID()
state.outerParamsInfoArray.push(outerParamsInfo)
state.mapOuterParamsInfoArray[outerParamsInfo.paramsInfoId] = outerParamsInfo
}
const removeOuterParamsInfo = (node, data) => {
const parent = node.parent
const children = parent.data.children || parent.data
const index = children.findIndex(d => d.paramsInfoId === data.paramsInfoId)
children.splice(index, 1)
if (data.paramsInfoId === state.outerParamsInfo.paramsInfoId) {
delete state.mapOuterParamsInfoArray[data.paramsInfoId]
state.outerParamsInfo = null
}
}
</script>
<style scoped lang="less">
.root-class {
margin: 15px 0px 5px;
text-align: center;
}
.preview {
margin-top: 5px;
border: 1px solid #e6e6e6;
height: 350px !important;
overflow: hidden;
background-size: 100% 100% !important;
}
.preview-show {
border-left: 1px solid #e6e6e6;
height: 350px;
background-size: 100% 100% !important;
}
.slot-class {
color: white;
}
.bottom {
margin-top: 15px;
text-align: center;
}
.ellip {
/*width: 100%;*/
margin-left: 10px;
margin-right: 10px;
overflow: hidden; /*超出部分隐藏*/
white-space: nowrap; /*不换行*/
text-overflow: ellipsis; /*超出部分文字以...显示*/
text-align: center;
background-color: #f7f8fa;
color: #3d4d66;
font-size: 12px;
line-height: 24px;
height: 24px;
border-radius: 3px;
}
.select-filed {
/*width: 100%;*/
margin-left: 10px;
margin-right: 10px;
overflow: hidden; /*超出部分隐藏*/
white-space: nowrap; /*不换行*/
text-overflow: ellipsis; /*超出部分文字以...显示*/
color: #3d4d66;
font-size: 12px;
line-height: 35px;
height: 35px;
border-radius: 3px;
}
v-deep(.el-popover) {
height: 200px;
overflow: auto;
}
.custom-position {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
flex-flow: row nowrap;
color: #9ea6b2;
}
.tree-style {
padding: 10px 15px;
height: 100%;
overflow-y: auto;
}
v-deep(.vue-treeselect__control) {
height: 28px;
}
v-deep(.vue-treeselect__single-value) {
color: #606266;
line-height: 28px !important;
}
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
}
.auth-span {
float: right;
width: 40px;
margin-right: 5px;
}
.tree-head {
height: 30px;
line-height: 30px;
border-bottom: 1px solid var(--TableBorderColor, #e6e6e6);
background-color: var(--SiderBG, #f7f8fa);
font-size: 12px;
color: var(--TableColor, #3d4d66);
}
.tree-content {
height: calc(100% - 70px);
overflow-y: auto;
}
.tree-bottom {
margin-top: 7px;
text-align: center;
}
v-deep(.vue-treeselect__placeholder {
line-height: 28px;
}
v-deep(.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content) {
background-color: #8dbbef !important;
}
.tree-content v-deep(.el-input__inner) {
background: transparent;
border: 0px !important;
}
</style>

View File

@ -4,6 +4,14 @@ import { ElMenu } from 'element-plus-secondary'
import { useRoute, useRouter } from 'vue-router'
import { isExternal } from '@/utils/validate'
import MenuItem from './MenuItem.vue'
import { useAppearanceStoreWithOut } from '@/store/modules/appearance'
const appearanceStore = useAppearanceStoreWithOut()
const tempColor = computed(() => {
return {
'--temp-color':
(appearanceStore.themeColor === 'custom' ? appearanceStore.customColor : '#3370FF') + '1A'
}
})
const isCollapse = ref(false)
const route = useRoute()
const { push } = useRouter()
@ -26,6 +34,7 @@ const menuSelect = (index: string, indexPath: string[]) => {
<template>
<el-menu
:style="tempColor"
@select="menuSelect"
:default-active="activeIndex"
class="el-menu-vertical"
@ -40,7 +49,37 @@ const menuSelect = (index: string, indexPath: string[]) => {
width: 100%;
min-height: 400px;
}
.ed-menu {
border: none;
.ed-menu-item:not(.is-active) {
&:hover {
background-color: #1f23291a !important;
}
}
.is-active:not(.ed-sub-menu) {
background-color: var(--temp-color);
}
:deep(.ed-sub-menu) {
margin: 0;
.ed-sub-menu__title {
&:hover {
background-color: #1f23291a;
}
}
.ed-menu-item:not(.is-active) {
&:hover {
background-color: #1f23291a !important;
}
}
}
:deep(.ed-sub-menu.is-active) {
.ed-sub-menu__title {
color: var(--ed-color-primary);
}
.is-active {
background-color: var(--temp-color);
}
}
}
</style>

View File

@ -118,7 +118,12 @@ export const copyStore = defineStore('copy', {
}
eventBus.emit('addDashboardItem-' + newComponent.canvasId, newComponent)
}
if (i === dataArray.length - 1) {
dvMainStore.setCurComponent({
component: newComponent,
index: componentData.value.length - 1
})
}
i++
}
}, moveTime)
@ -178,6 +183,7 @@ function deepCopyHelper(data, idMap) {
const newComponentId = generateID()
idMap[data.id] = newComponentId
result.id = newComponentId
result.inMobile = false
if (result.component === 'Group') {
result.propValue.forEach((component, i) => {
result.propValue[i] = deepCopyHelper(component, idMap)

View File

@ -0,0 +1,10 @@
export default function checkArrayRepeat(arrayData, key) {
for (let i = 0; i < arrayData.length; i++) {
for (let j = i + 1; j < arrayData.length; j++) {
if (arrayData[i][key] === arrayData[j][key]) {
return true
}
}
}
return false
}

View File

@ -218,7 +218,6 @@ export class Map extends L7PlotChartView<ChoroplethOptions, Choropleth> {
content.push(name)
}
if (label.showQuota) {
valueFormatter
areaMap[name] && content.push(valueFormatter(areaMap[name], label.quotaLabelFormatter))
}
item.properties['_DE_LABEL_'] = content.join('\n\n')
@ -229,7 +228,7 @@ export class Map extends L7PlotChartView<ChoroplethOptions, Choropleth> {
colors = colors.slice(0, validArea)
}
if (colors.length) {
options.color.value = colors
options.color['value'] = colors
}
return options
}
@ -244,7 +243,8 @@ export class Map extends L7PlotChartView<ChoroplethOptions, Choropleth> {
this.configLabel,
this.configStyle,
this.configTooltip,
this.configBasicStyle
this.configBasicStyle,
this.configLegend
)(chart, options, extra)
}
}

View File

@ -12,6 +12,15 @@ import { Tooltip } from '@antv/g2plot/esm'
import { add } from 'mathjs'
import isEmpty from 'lodash-es/isEmpty'
import _ from 'lodash'
import type { LegendOptions } from '@antv/l7plot/dist/esm/types/legend'
import { CategoryLegendListItem } from '@antv/l7plot-component/dist/lib/types/legend'
import createDom from '@antv/dom-util/esm/create-dom'
import {
CONTAINER_TPL,
ITEM_TPL,
LIST_CLASS
} from '@antv/l7plot-component/dist/esm/legend/category/constants'
import substitute from '@antv/util/esm/substitute'
export function getPadding(chart: Chart): number[] {
if (chart.drill) {
@ -772,3 +781,36 @@ export function getTooltipSeriesTotalMap(data: any[]): Record<string, number> {
})
return result
}
export function configL7Legend(): LegendOptions {
return {
customContent: (_: string, items: CategoryLegendListItem[]) => {
const showItems = items?.length > 30 ? items.slice(0, 30) : items
if (showItems?.length) {
const containerDom = createDom(CONTAINER_TPL) as HTMLElement
const listDom = containerDom.getElementsByClassName(LIST_CLASS)[0] as HTMLElement
showItems.forEach(item => {
let value = '-'
if (item.value !== '') {
if (Array.isArray(item.value)) {
item.value.forEach((v, i) => {
item.value[i] = Number.isNaN(v) || v === 'NaN' ? 'NaN' : parseFloat(v).toFixed(0)
})
value = item.value.join('-')
} else {
const tmp = item.value as string
value = Number.isNaN(tmp) || tmp === 'NaN' ? 'NaN' : parseFloat(tmp).toFixed(0)
}
}
const substituteObj = { ...item, value }
const domStr = substitute(ITEM_TPL, substituteObj)
const itemDom = createDom(domStr)
listDom.appendChild(itemDom)
})
return listDom
}
return ''
}
}
}

View File

@ -4,6 +4,7 @@ import { PlotOptions } from '@antv/l7plot/dist/esm/types/plot'
import { Plot as L7Plot } from '@antv/l7plot/dist/esm/core/plot'
import {
configL7Label,
configL7Legend,
configL7Style,
configL7Tooltip
} from '@/views/chart/components/js/panel/common/common_antv'
@ -13,6 +14,7 @@ import {
ChartLibraryType
} from '@/views/chart/components/js/panel/types'
import { defaultsDeep } from 'lodash-es'
import { ChoroplethOptions } from '@antv/l7plot/dist/esm/plots/choropleth'
export interface L7PlotDrawOptions<P> extends AntVDrawOptions<P> {
areaId?: string
@ -43,7 +45,11 @@ export abstract class L7PlotChartView<
defaultsDeep(options.tooltip, tooltip)
return options
}
protected configLegend(_: Chart, options: ChoroplethOptions) {
const legend = configL7Legend()
defaultsDeep(options.legend, legend)
return options
}
protected constructor(name: string, defaultData?: any[]) {
super(ChartLibraryType.L7_PLOT, name)
this.defaultData = defaultData

View File

@ -63,6 +63,10 @@ const loadCanvasDataAsync = async (dvId, dvType) => {
if (jumpParam) {
dvMainStore.addViewTrackFilter(jumpParam)
}
if (props.publicLinkStatus) {
// title
document.title = dvInfo.name
}
}
)
}

View File

@ -1,5 +1,5 @@
<script lang="ts" setup>
import { ref, reactive } from 'vue'
import { ref, reactive, computed } from 'vue'
import { ElMessage, ElLoading } from 'element-plus-secondary'
import { useI18n } from '@/hooks/web/useI18n'
import type {
@ -31,7 +31,38 @@ const treeProps = {
label: 'name',
disabled: 'readOnly'
}
const formatPid = computed(() => {
if (!state.form.pid) return ''
const pid = state.form.pid
return pid.replace(/(0+)$/g, '').replace(/\D/g, '')
})
const codeTips = ref(
'国家代码由三位数字组成省、市、区县、乡镇代码由两位数字组成非国家区域需要再后面补0'
)
const pidChange = () => {
state.form.code = null
}
const validateCode = (_: any, value: any, callback: any) => {
const isCountry = !formatPid.value
if (isCountry) {
const reg = /^[0-9]\d{2}$/
if (!reg.test(value) || value === '000') {
const msg = '请输入非0的三位数字'
callback(new Error(msg))
} else {
callback()
}
} else {
const fullValue = formatPid.value + value
const reg = /^[1-9](\d{8}|\d{10})$/
if (!reg.test(fullValue)) {
const msg = '请输入9或11位数字'
callback(new Error(msg))
} else {
callback()
}
}
}
const rule = reactive<FormRules>({
pid: [
{
@ -45,7 +76,8 @@ const rule = reactive<FormRules>({
required: true,
message: t('common.require'),
trigger: 'blur'
}
},
{ validator: validateCode, trigger: 'blur' }
],
name: [
{
@ -81,6 +113,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
await formEl.validate(valid => {
if (valid) {
const param = { ...state.form }
param['code'] = formatPid.value ? formatPid.value + param['code'] : param['code']
const formData = buildFormData(geoFile.value, param)
showLoading()
request
@ -179,11 +212,34 @@ defineExpose({
check-strictly
:render-after-expand="false"
:placeholder="t('common.please_select')"
@current-change="pidChange"
/>
</el-form-item>
<el-form-item label="区域代码" prop="code">
<el-input v-model="state.form.code" />
<template v-slot:label>
<span class="area-code-label">
<span>区域代码</span>
<el-tooltip effect="dark" :content="codeTips" placement="top">
<el-icon class="info-tips"><Icon name="dv-info"></Icon></el-icon>
</el-tooltip>
</span>
</template>
<el-input v-if="state.form.pid" v-model="state.form.code">
<template #prefix>
{{ formatPid }}
</template>
</el-input>
<el-tooltip
v-else
class="box-item"
effect="dark"
content="请先选择上级区域"
placement="top"
>
<el-input v-model="state.form.code" disabled />
</el-tooltip>
</el-form-item>
<el-form-item label="区域名称" prop="name">
@ -253,4 +309,11 @@ defineExpose({
width: calc(100% - 48px);
height: 30px;
}
.area-code-label {
display: inline-flex;
align-items: center;
i {
margin-left: 4px;
}
}
</style>

View File

@ -479,12 +479,12 @@ const saveTemplateEdit = templateEditForm => {
templateEditFormRef.value.validate(valid => {
if (valid) {
save({ ...templateEditForm }).then(response => {
state.currentTemplateLabel = templateEditForm.name
ElMessage({
message: '添加成功',
type: 'success',
showClose: true
})
state.currentTemplateId = null
getTree()
close()
})

@ -1 +1 @@
Subproject commit b5ec1c2a30ee6bc452627420232d539cd72f3a42
Subproject commit 62920fd79c962635398ee96c60f26bd7e902423f

View File

@ -0,0 +1,20 @@
package io.dataease.api.visualization;
import io.dataease.api.visualization.dto.VisualizationOuterParamsDTO;
import io.dataease.api.visualization.response.VisualizationOuterParamsBaseResponse;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("outerParams")
public interface VisualizationOuterParamsApi {
@GetMapping("/queryWithDvId/{dvId}")
VisualizationOuterParamsDTO queryWithVisualizationId(@PathVariable("dvId") String dvId);
@PostMapping("/updateOuterParamsSet")
void updateOuterParamsSet(@RequestBody VisualizationOuterParamsDTO OuterParamsDTO);
@GetMapping("/getOuterParamsInfo/{dvId}")
VisualizationOuterParamsBaseResponse getOuterParamsInfo(@PathVariable("dvId") String dvId);
}

View File

@ -0,0 +1,9 @@
package io.dataease.api.visualization.dto;
import io.dataease.api.visualization.vo.VisualizationOuterParamsVO;
public class VisualizationOuterParamsDTO extends VisualizationOuterParamsVO {
}

View File

@ -0,0 +1,8 @@
package io.dataease.api.visualization.dto;
import io.dataease.api.visualization.vo.VisualizationOuterParamsInfoVO;
public class VisualizationOuterParamsInfoDTO extends VisualizationOuterParamsInfoVO {
}

View File

@ -0,0 +1,9 @@
package io.dataease.api.visualization.dto;
import io.dataease.api.visualization.vo.VisualizationOuterParamsTargetViewInfoVO;
public class VisualizationOuterParamsTargetViewInfoDTO extends VisualizationOuterParamsTargetViewInfoVO {
}

View File

@ -0,0 +1,24 @@
package io.dataease.api.visualization.response;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* Author: wangjiahao
* Description:
*/
@Data
public class VisualizationOuterParamsBaseResponse {
// 获取仪表板外部参数映射信息
private Map<String, List<String>> outerParamsInfoMap;
public VisualizationOuterParamsBaseResponse(Map<String, List<String>> outerParamsInfoMap) {
this.outerParamsInfoMap = outerParamsInfoMap;
}
public VisualizationOuterParamsBaseResponse() {
}
}

View File

@ -0,0 +1,108 @@
package io.dataease.api.visualization.vo;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
/**
* <p>
* 外部参数配置表
* </p>
*
* @author fit2cloud
* @since 2024-03-08
*/
public class VisualizationOuterParamsInfoVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String paramsInfoId;
/**
* visualization_outer_params 表的 ID
*/
private String paramsId;
/**
* 参数名
*/
private String paramName;
/**
* 是否启用
*/
private Boolean checked;
/**
* 复制来源
*/
private String copyFrom;
/**
* 复制来源ID
*/
private String copyId;
public String getParamsInfoId() {
return paramsInfoId;
}
public void setParamsInfoId(String paramsInfoId) {
this.paramsInfoId = paramsInfoId;
}
public String getParamsId() {
return paramsId;
}
public void setParamsId(String paramsId) {
this.paramsId = paramsId;
}
public String getParamName() {
return paramName;
}
public void setParamName(String paramName) {
this.paramName = paramName;
}
public Boolean getChecked() {
return checked;
}
public void setChecked(Boolean checked) {
this.checked = checked;
}
public String getCopyFrom() {
return copyFrom;
}
public void setCopyFrom(String copyFrom) {
this.copyFrom = copyFrom;
}
public String getCopyId() {
return copyId;
}
public void setCopyId(String copyId) {
this.copyId = copyId;
}
@Override
public String toString() {
return "VisualizationOuterParamsInfo{" +
"paramsInfoId = " + paramsInfoId +
", paramsId = " + paramsId +
", paramName = " + paramName +
", checked = " + checked +
", copyFrom = " + copyFrom +
", copyId = " + copyId +
"}";
}
}

View File

@ -0,0 +1,108 @@
package io.dataease.api.visualization.vo;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
/**
* <p>
* 外部参数联动视图字段信息表
* </p>
*
* @author fit2cloud
* @since 2024-03-08
*/
public class VisualizationOuterParamsTargetViewInfoVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String targetId;
/**
* visualization_outer_params_info 表的 ID
*/
private String paramsInfoId;
/**
* 联动视图ID
*/
private String targetViewId;
/**
* 联动字段ID
*/
private String targetFieldId;
/**
* 复制来源
*/
private String copyFrom;
/**
* 复制来源ID
*/
private String copyId;
public String getTargetId() {
return targetId;
}
public void setTargetId(String targetId) {
this.targetId = targetId;
}
public String getParamsInfoId() {
return paramsInfoId;
}
public void setParamsInfoId(String paramsInfoId) {
this.paramsInfoId = paramsInfoId;
}
public String getTargetViewId() {
return targetViewId;
}
public void setTargetViewId(String targetViewId) {
this.targetViewId = targetViewId;
}
public String getTargetFieldId() {
return targetFieldId;
}
public void setTargetFieldId(String targetFieldId) {
this.targetFieldId = targetFieldId;
}
public String getCopyFrom() {
return copyFrom;
}
public void setCopyFrom(String copyFrom) {
this.copyFrom = copyFrom;
}
public String getCopyId() {
return copyId;
}
public void setCopyId(String copyId) {
this.copyId = copyId;
}
@Override
public String toString() {
return "VisualizationOuterParamsTargetViewInfo{" +
"targetId = " + targetId +
", paramsInfoId = " + paramsInfoId +
", targetViewId = " + targetViewId +
", targetFieldId = " + targetFieldId +
", copyFrom = " + copyFrom +
", copyId = " + copyId +
"}";
}
}

View File

@ -0,0 +1,108 @@
package io.dataease.api.visualization.vo;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
/**
* <p>
* 外部参数关联关系表
* </p>
*
* @author fit2cloud
* @since 2024-03-08
*/
public class VisualizationOuterParamsVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String paramsId;
/**
* 可视化资源ID
*/
private String visualizationId;
/**
* 是否启用外部参数标识1-0-
*/
private Boolean checked;
/**
* 备注
*/
private String remark;
/**
* 复制来源
*/
private String copyFrom;
/**
* 复制来源ID
*/
private String copyId;
public String getParamsId() {
return paramsId;
}
public void setParamsId(String paramsId) {
this.paramsId = paramsId;
}
public String getVisualizationId() {
return visualizationId;
}
public void setVisualizationId(String visualizationId) {
this.visualizationId = visualizationId;
}
public Boolean getChecked() {
return checked;
}
public void setChecked(Boolean checked) {
this.checked = checked;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getCopyFrom() {
return copyFrom;
}
public void setCopyFrom(String copyFrom) {
this.copyFrom = copyFrom;
}
public String getCopyId() {
return copyId;
}
public void setCopyId(String copyId) {
this.copyId = copyId;
}
@Override
public String toString() {
return "VisualizationOuterParams{" +
"paramsId = " + paramsId +
", visualizationId = " + visualizationId +
", checked = " + checked +
", remark = " + remark +
", copyFrom = " + copyFrom +
", copyId = " + copyId +
"}";
}
}