Merge pull request #8631 from dataease/pr@dev-v2@refactor_mobile

refactor(移动端): 增加开启移动端功能
This commit is contained in:
王嘉豪 2024-03-21 15:08:20 +08:00 committed by GitHub
commit 5565b55b9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 22 additions and 11 deletions

View File

@ -61,7 +61,7 @@ public class DataVisualizationInfo implements Serializable {
/**
* 移动端布局
*/
private String mobileLayout;
private Boolean mobileLayout;
/**
* 状态 0-未发布 1-已发布
@ -195,11 +195,11 @@ public class DataVisualizationInfo implements Serializable {
this.componentData = componentData;
}
public String getMobileLayout() {
public Boolean getMobileLayout() {
return mobileLayout;
}
public void setMobileLayout(String mobileLayout) {
public void setMobileLayout(Boolean mobileLayout) {
this.mobileLayout = mobileLayout;
}

View File

@ -14,7 +14,7 @@ import java.util.Set;
public interface CoreVisualiationExtMapper {
@Select("""
select id, name, pid, node_type from data_visualization_info
select id, name, pid, node_type, mobile_layout as extraFlag from data_visualization_info
${ew.customSqlSegment}
""")
List<VisualizationNodePO> queryNodes(@Param("ew") QueryWrapper<Object> queryWrapper);

View File

@ -34,3 +34,5 @@ CREATE TABLE `visualization_outer_params_target_view_info` (
PRIMARY KEY (`target_id`)
) COMMENT='外部参数联动视图字段信息表';
ALTER TABLE `data_visualization_info`
MODIFY COLUMN `mobile_layout` tinyint NULL DEFAULT 0 COMMENT '移动端布局0-关闭 1-开启';

View File

@ -34,3 +34,7 @@ CREATE TABLE `visualization_outer_params_target_view_info` (
PRIMARY KEY (`target_id`)
) COMMENT='外部参数联动视图字段信息表';
ALTER TABLE `data_visualization_info`
MODIFY COLUMN `mobile_layout` tinyint NULL DEFAULT 0 COMMENT '移动端布局0-关闭 1-开启';

View File

@ -61,7 +61,8 @@ export const dvMainStore = defineStore('dataVisualization', {
status: null,
selfWatermarkStatus: null,
watermarkInfo: {},
type: null
type: null,
mobileLayout: false
},
// 图表信息
canvasViewInfo: {},
@ -965,7 +966,8 @@ export const dvMainStore = defineStore('dataVisualization', {
status: null,
selfWatermarkStatus: null,
watermarkInfo: {},
type: null
type: null,
mobileLayout: false
}
},
setViewDataDetails(viewId, dataInfo) {
@ -1003,7 +1005,8 @@ export const dvMainStore = defineStore('dataVisualization', {
type: dvType,
status: 1,
selfWatermarkStatus: true,
watermarkInfo: watermarkInfo
watermarkInfo: watermarkInfo,
mobileLayout: false
}
const canvasStyleDataNew =
dvType === 'dashboard'
@ -1026,7 +1029,8 @@ export const dvMainStore = defineStore('dataVisualization', {
status: null,
selfWatermarkStatus: null,
watermarkInfo: {},
type: null
type: null,
mobileLayout: false
}
this.canvasStyleData = { ...deepCopy(DEFAULT_CANVAS_STYLE_DATA_DARK), backgroundColor: null }
}

View File

@ -104,7 +104,8 @@ export function initCanvasDataPrepare(dvId, busiFlag, callBack) {
updateName: canvasInfo.updateName,
createTime: canvasInfo.createTime,
updateTime: canvasInfo.updateTime,
watermarkInfo: watermarkInfo
watermarkInfo: watermarkInfo,
mobileLayout: canvasInfo.mobileLayout || false
}
const canvasDataResult = JSON.parse(canvasInfo.componentData)

View File

@ -201,7 +201,7 @@ const save = () => {
</div>
<div class="mobile-save">
<span class="open-mobile">开启移动端</span>
<el-switch size="small" v-model="openMobile" />
<el-switch size="small" v-model="dvInfo.mobileLayout" />
<span class="open-mobile-line"></span>
<el-tooltip effect="dark" content="切换至PC端布局" placement="bottom">
<el-icon @click="handleBack">

View File

@ -64,7 +64,7 @@ public class DataVisualizationVO implements Serializable {
/**
* 移动端布局
*/
private String mobileLayout;
private Boolean mobileLayout;
/**
* 状态 0-未发布 1-已发布