forked from github/dataease
refactor(仪表板、数据大屏): 跳转弹窗支持设置弹窗大小
This commit is contained in:
parent
eaa7a0e2a6
commit
f3a756cc2b
@ -25,7 +25,7 @@ public class MybatisPlusGenerator {
|
||||
/**
|
||||
* 这是要生成代码的表名称
|
||||
*/
|
||||
private static final String TABLE_NAME = "visualization_outer_params_info";
|
||||
private static final String TABLE_NAME = "visualization_link_jump_info";
|
||||
|
||||
/**
|
||||
* 下面两个配置基本上不用动
|
||||
|
@ -5,17 +5,20 @@ import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* 跳转配置表
|
||||
* </p>
|
||||
*
|
||||
* @author fit2cloud
|
||||
* @since 2023-09-22
|
||||
* @since 2024-09-19
|
||||
*/
|
||||
@TableName("visualization_link_jump_info")
|
||||
public class VisualizationLinkJumpInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
@ -33,6 +36,11 @@ public class VisualizationLinkJumpInfo implements Serializable {
|
||||
*/
|
||||
private String jumpType;
|
||||
|
||||
/**
|
||||
* 窗口大小large middle small
|
||||
*/
|
||||
private String windowSize;
|
||||
|
||||
/**
|
||||
* 关联仪表板ID
|
||||
*/
|
||||
@ -58,8 +66,14 @@ public class VisualizationLinkJumpInfo implements Serializable {
|
||||
*/
|
||||
private Boolean attachParams;
|
||||
|
||||
/**
|
||||
* 复制来源
|
||||
*/
|
||||
private Long copyFrom;
|
||||
|
||||
/**
|
||||
* 复制来源ID
|
||||
*/
|
||||
private Long copyId;
|
||||
|
||||
public Long getId() {
|
||||
@ -94,6 +108,14 @@ public class VisualizationLinkJumpInfo implements Serializable {
|
||||
this.jumpType = jumpType;
|
||||
}
|
||||
|
||||
public String getWindowSize() {
|
||||
return windowSize;
|
||||
}
|
||||
|
||||
public void setWindowSize(String windowSize) {
|
||||
this.windowSize = windowSize;
|
||||
}
|
||||
|
||||
public Long getTargetDvId() {
|
||||
return targetDvId;
|
||||
}
|
||||
@ -157,6 +179,7 @@ public class VisualizationLinkJumpInfo implements Serializable {
|
||||
", linkJumpId = " + linkJumpId +
|
||||
", linkType = " + linkType +
|
||||
", jumpType = " + jumpType +
|
||||
", windowSize = " + windowSize +
|
||||
", targetDvId = " + targetDvId +
|
||||
", sourceFieldId = " + sourceFieldId +
|
||||
", content = " + content +
|
||||
|
@ -6,11 +6,11 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* 跳转配置表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author fit2cloud
|
||||
* @since 2023-09-22
|
||||
* @since 2024-09-19
|
||||
*/
|
||||
@Mapper
|
||||
public interface VisualizationLinkJumpInfoMapper extends BaseMapper<VisualizationLinkJumpInfo> {
|
||||
|
@ -3,3 +3,6 @@ ALTER TABLE `visualization_outer_params_info`
|
||||
ADD COLUMN `default_value` varchar(255) DEFAULT NULL COMMENT '默认值 JSON格式',
|
||||
ADD COLUMN `enabled_default` tinyint(1) NULL DEFAULT 0 COMMENT '是否启用默认值';
|
||||
update visualization_outer_params_info set required =0;
|
||||
|
||||
ALTER TABLE `visualization_link_jump_info`
|
||||
ADD COLUMN `window_size` varchar(255) NULL DEFAULT 'middle' COMMENT '窗口大小large middle small';
|
||||
|
@ -8,3 +8,6 @@ set required =0;
|
||||
ALTER TABLE `xpack_report_info`
|
||||
ADD COLUMN `show_watermark` tinyint(1) NOT NULL DEFAULT 0 COMMENT '显示水印' AFTER `rid`;
|
||||
|
||||
ALTER TABLE `visualization_link_jump_info`
|
||||
ADD COLUMN `window_size` varchar(255) NULL DEFAULT 'middle' COMMENT '窗口大小large middle small';
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
<result column="link_jump_id" jdbcType="BIGINT" property="linkJumpId"/>
|
||||
<result column="link_type" jdbcType="VARCHAR" property="linkType"/>
|
||||
<result column="jump_type" jdbcType="VARCHAR" property="jumpType"/>
|
||||
<result column="window_size" jdbcType="VARCHAR" property="windowSize"/>
|
||||
<result column="target_dv_id" jdbcType="BIGINT" property="targetDvId"/>
|
||||
<result column="source_field_id" jdbcType="BIGINT" property="sourceFieldId"/>
|
||||
<result column="content" jdbcType="VARCHAR" property="content"/>
|
||||
@ -78,6 +79,7 @@
|
||||
visualization_link_jump_info.link_jump_id,
|
||||
visualization_link_jump_info.link_type,
|
||||
visualization_link_jump_info.jump_type,
|
||||
visualization_link_jump_info.window_size,
|
||||
visualization_link_jump_info.target_dv_id,
|
||||
visualization_link_jump_info.content,
|
||||
xpack_share.uuid AS publicJumpId,
|
||||
@ -304,6 +306,7 @@
|
||||
link_jump_id,
|
||||
link_type,
|
||||
jump_type,
|
||||
window_size,
|
||||
target_dv_id,
|
||||
source_field_id,
|
||||
content,
|
||||
@ -315,6 +318,7 @@
|
||||
plj_copy.t_id,
|
||||
link_type,
|
||||
jump_type,
|
||||
window_size,
|
||||
target_dv_id,
|
||||
source_field_id,
|
||||
content,
|
||||
|
@ -120,6 +120,20 @@
|
||||
<el-radio label="newPop">{{ t('visualization.pop_window') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
class="radio-group-box"
|
||||
v-if="state.linkJumpInfo?.jumpType === 'newPop'"
|
||||
>
|
||||
<template #label>
|
||||
<span class="title">窗口大小</span>
|
||||
</template>
|
||||
<el-radio-group class="larger-radio" v-model="state.linkJumpInfo.windowSize">
|
||||
<el-radio label="large">大</el-radio>
|
||||
<el-radio label="middle">中</el-radio>
|
||||
<el-radio label="small">小</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-header>
|
||||
|
||||
<el-main class="settings-main">
|
||||
@ -1022,7 +1036,7 @@ span {
|
||||
height: 100%;
|
||||
|
||||
.settings-header {
|
||||
height: 92px;
|
||||
height: auto;
|
||||
border-bottom: 1px solid #e6e6e6;
|
||||
|
||||
.radio-group-box {
|
||||
@ -1047,6 +1061,7 @@ span {
|
||||
|
||||
.settings-main {
|
||||
padding: 16px;
|
||||
overflow: hidden;
|
||||
.empty {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
@ -379,14 +379,29 @@ const divEmbedded = type => {
|
||||
useEmitt().emitter.emit('changeCurrentComponent', type)
|
||||
}
|
||||
|
||||
const windowsJump = (url, jumpType) => {
|
||||
const windowsJump = (url, jumpType, size = 'middle') => {
|
||||
try {
|
||||
let newWindow
|
||||
if ('newPop' === jumpType) {
|
||||
let sizeX, sizeY
|
||||
if (size === 'large') {
|
||||
sizeX = 0.95
|
||||
sizeY = 0.9
|
||||
} else if (size === 'middle') {
|
||||
sizeX = 0.8
|
||||
sizeY = 0.75
|
||||
} else {
|
||||
sizeX = 0.6
|
||||
sizeY = 0.5
|
||||
}
|
||||
const height = screen.height * sizeY
|
||||
const width = screen.width * sizeX
|
||||
const left = screen.width * ((1 - sizeX) / 2)
|
||||
const top = screen.height * ((1 - sizeY) / 2)
|
||||
window.open(
|
||||
url,
|
||||
'_blank',
|
||||
'width=800,height=600,left=200,top=100,toolbar=no,scrollbars=yes,resizable=yes,location=no'
|
||||
`width=${width},height=${height},left=${left},top=${top},toolbar=no,scrollbars=yes,resizable=yes,location=no`
|
||||
)
|
||||
} else {
|
||||
newWindow = window.open(url, jumpType)
|
||||
@ -441,7 +456,7 @@ const jumpClick = param => {
|
||||
}?jumpInfoParam=${encodeURIComponent(Base64.encode(JSON.stringify(param)))}`
|
||||
const currentUrl = window.location.href
|
||||
localStorage.setItem('beforeJumpUrl', currentUrl)
|
||||
windowsJump(url, jumpInfo.jumpType)
|
||||
windowsJump(url, jumpInfo.jumpType, jumpInfo.windowSize)
|
||||
} else {
|
||||
ElMessage.warning(t('visualization.public_link_tips'))
|
||||
}
|
||||
@ -464,7 +479,7 @@ const jumpClick = param => {
|
||||
router.push(parseUrl(url))
|
||||
return
|
||||
}
|
||||
windowsJump(url, jumpInfo.jumpType)
|
||||
windowsJump(url, jumpInfo.jumpType, jumpInfo.windowSize)
|
||||
}
|
||||
} else {
|
||||
ElMessage.warning('未指定跳转仪表板')
|
||||
@ -483,7 +498,7 @@ const jumpClick = param => {
|
||||
return
|
||||
}
|
||||
|
||||
windowsJump(url, jumpInfo.jumpType)
|
||||
windowsJump(url, jumpInfo.jumpType, jumpInfo.windowSize)
|
||||
}
|
||||
} else {
|
||||
}
|
||||
|
@ -29,6 +29,12 @@ public class VisualizationLinkJumpInfoVO {
|
||||
*/
|
||||
private String jumpType;
|
||||
|
||||
/**
|
||||
* 窗口大小large middle small
|
||||
*/
|
||||
private String windowSize;
|
||||
|
||||
|
||||
/**
|
||||
* 关联仪表板ID
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user