perf(X-Pack): 定时报告页面校验

This commit is contained in:
fit2cloud-chenyw 2024-05-14 18:32:37 +08:00
parent e2433ec933
commit d1d9319d55
14 changed files with 244 additions and 4 deletions

View File

@ -0,0 +1,17 @@
package io.dataease.chart.dao.ext.mapper;
import io.dataease.api.chart.vo.ViewSelectorVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@Mapper
public interface ExtChartViewMapper {
@Select("""
select id, scene_id as pid, title, type from core_chart_view where scene_id = #{resourceId}
""")
List<ViewSelectorVO> queryViewOption(@Param("resourceId") Long resourceId);
}

View File

@ -4,9 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.dataease.api.chart.dto.*;
import io.dataease.api.chart.vo.ViewSelectorVO;
import io.dataease.api.dataset.union.model.SQLObj;
import io.dataease.chart.dao.auto.entity.CoreChartView;
import io.dataease.chart.dao.auto.mapper.CoreChartViewMapper;
import io.dataease.chart.dao.ext.mapper.ExtChartViewMapper;
import io.dataease.dataset.dao.auto.entity.CoreDatasetTableField;
import io.dataease.dataset.dao.auto.mapper.CoreDatasetTableFieldMapper;
import io.dataease.dataset.manage.PermissionManage;
@ -41,6 +43,9 @@ public class ChartViewManege {
@Resource
private PermissionManage permissionManage;
@Resource
private ExtChartViewMapper extChartViewMapper;
private ObjectMapper objectMapper = new ObjectMapper();
@Transactional
@ -273,4 +278,7 @@ public class ChartViewManege {
}
public List<ViewSelectorVO> viewOption(Long resourceId) {
return extChartViewMapper.queryViewOption(resourceId);
}
}

View File

@ -3,6 +3,7 @@ package io.dataease.chart.server;
import io.dataease.api.chart.ChartViewApi;
import io.dataease.api.chart.dto.ChartViewDTO;
import io.dataease.api.chart.dto.ChartViewFieldDTO;
import io.dataease.api.chart.vo.ViewSelectorVO;
import io.dataease.chart.manage.ChartViewManege;
import io.dataease.exception.DEException;
import io.dataease.result.ResultCode;
@ -52,5 +53,8 @@ public class ChartViewServer implements ChartViewApi {
return chartViewManege.getDetails(id);
}
@Override
public List<ViewSelectorVO> viewOption(Long resourceId) {
return chartViewManege.viewOption(resourceId);
}
}

View File

@ -1 +1,3 @@
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M104.185 95.254c8.161 7.574 13.145 17.441 13.145 28.28 0 1.508-.098 2.998-.285 4.466h-10.784c.238-1.465.403-2.948.403-4.465 0-8.983-4.36-17.115-11.419-23.216C86 104.66 75.355 107.162 64 107.162c-11.344 0-21.98-2.495-31.22-6.83-7.064 6.099-11.444 14.218-11.444 23.203 0 1.517.165 3 .403 4.465H10.955a35.444 35.444 0 0 1-.285-4.465c0-10.838 4.974-20.713 13.127-28.291C9.294 85.42.003 70.417.003 53.58.003 23.99 28.656.001 64 .001s63.997 23.988 63.997 53.58c0 16.842-9.299 31.85-23.812 41.673zM64 36.867c-29.454 0-53.33-10.077-53.33 15.342 0 25.418 23.876 46.023 53.33 46.023 29.454 0 53.33-20.605 53.33-46.023 0-25.419-23.876-15.342-53.33-15.342zm24.888 25.644c-3.927 0-7.111-2.665-7.111-5.953 0-3.288 3.184-5.954 7.11-5.954 3.928 0 7.111 2.666 7.111 5.954s-3.183 5.953-7.11 5.953zm-3.556 16.372c0 4.11-9.55 7.442-21.332 7.442-11.781 0-21.332-3.332-21.332-7.442 0-1.06.656-2.064 1.8-2.976 3.295 2.626 10.79 4.465 19.532 4.465 8.743 0 16.237-1.84 19.531-4.465 1.145.912 1.801 1.916 1.801 2.976zm-46.22-16.372c-3.927 0-7.11-2.665-7.11-5.953 0-3.288 3.183-5.954 7.11-5.954 3.927 0 7.111 2.666 7.111 5.954s-3.184 5.953-7.11 5.953z"/></svg>
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M104.185 95.254c8.161 7.574 13.145 17.441 13.145 28.28 0 1.508-.098 2.998-.285 4.466h-10.784c.238-1.465.403-2.948.403-4.465 0-8.983-4.36-17.115-11.419-23.216C86 104.66 75.355 107.162 64 107.162c-11.344 0-21.98-2.495-31.22-6.83-7.064 6.099-11.444 14.218-11.444 23.203 0 1.517.165 3 .403 4.465H10.955a35.444 35.444 0 0 1-.285-4.465c0-10.838 4.974-20.713 13.127-28.291C9.294 85.42.003 70.417.003 53.58.003 23.99 28.656.001 64 .001s63.997 23.988 63.997 53.58c0 16.842-9.299 31.85-23.812 41.673zM64 36.867c-29.454 0-53.33-10.077-53.33 15.342 0 25.418 23.876 46.023 53.33 46.023 29.454 0 53.33-20.605 53.33-46.023 0-25.419-23.876-15.342-53.33-15.342zm24.888 25.644c-3.927 0-7.111-2.665-7.111-5.953 0-3.288 3.184-5.954 7.11-5.954 3.928 0 7.111 2.666 7.111 5.954s-3.183 5.953-7.11 5.953zm-3.556 16.372c0 4.11-9.55 7.442-21.332 7.442-11.781 0-21.332-3.332-21.332-7.442 0-1.06.656-2.064 1.8-2.976 3.295 2.626 10.79 4.465 19.532 4.465 8.743 0 16.237-1.84 19.531-4.465 1.145.912 1.801 1.916 1.801 2.976zm-46.22-16.372c-3.927 0-7.11-2.665-7.11-5.953 0-3.288 3.183-5.954 7.11-5.954 3.927 0 7.111 2.666 7.111 5.954s-3.184 5.953-7.11 5.953z"/></svg><svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4.25 6.58317H7.75C9.36083 6.58317 11.25 7.70816 11.25 9.73317V11.3082C11.25 11.5981 10.9888 11.8332 10.6667 11.8332H1.33333C1.01117 11.8332 0.75 11.5981 0.75 11.3082V9.73317C0.75 7.70986 2.63917 6.58317 4.25 6.58317ZM10.0833 10.6665V9.69428C10.0833 8.46841 8.84142 7.74984 7.75 7.74984H4.25C3.18248 7.74984 1.91667 8.43333 1.91667 9.69428V10.6665H10.0833ZM6 5.99984C4.38917 5.99984 3.08333 4.694 3.08333 3.08317C3.08333 1.47234 4.38917 0.166504 6 0.166504C7.61083 0.166504 8.91667 1.47234 8.91667 3.08317C8.91667 4.694 7.61083 5.99984 6 5.99984ZM6 4.83317C6.9665 4.83317 7.75 4.04967 7.75 3.08317C7.75 2.11667 6.9665 1.33317 6 1.33317C5.0335 1.33317 4.25 2.11667 4.25 3.08317C4.25 4.04967 5.0335 4.83317 6 4.83317Z" fill="white"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,3 @@
<svg width="12" height="12" viewBox="0 0 12 12" fill="" xmlns="http://www.w3.org/2000/svg">
<path d="M4.25 6.58317H7.75C9.36083 6.58317 11.25 7.70816 11.25 9.73317V11.3082C11.25 11.5981 10.9888 11.8332 10.6667 11.8332H1.33333C1.01117 11.8332 0.75 11.5981 0.75 11.3082V9.73317C0.75 7.70986 2.63917 6.58317 4.25 6.58317ZM10.0833 10.6665V9.69428C10.0833 8.46841 8.84142 7.74984 7.75 7.74984H4.25C3.18248 7.74984 1.91667 8.43333 1.91667 9.69428V10.6665H10.0833ZM6 5.99984C4.38917 5.99984 3.08333 4.694 3.08333 3.08317C3.08333 1.47234 4.38917 0.166504 6 0.166504C7.61083 0.166504 8.91667 1.47234 8.91667 3.08317C8.91667 4.694 7.61083 5.99984 6 5.99984ZM6 4.83317C6.9665 4.83317 7.75 4.04967 7.75 3.08317C7.75 2.11667 6.9665 1.33317 6 1.33317C5.0335 1.33317 4.25 2.11667 4.25 3.08317C4.25 4.04967 5.0335 4.83317 6 4.83317Z" fill=""/>
</svg>

After

Width:  |  Height:  |  Size: 835 B

View File

@ -5,6 +5,7 @@ import { ref, onMounted, toRefs, getCurrentInstance, computed } from 'vue'
import findComponent from '@/utils/components'
import { downloadCanvas, imgUrlTrans } from '@/utils/imgUtils'
import ComponentEditBar from '@/components/visualization/ComponentEditBar.vue'
import ComponentSelector from '@/components/visualization/ComponentSelector.vue'
import { useEmitt } from '@/hooks/web/useEmitt'
const componentWrapperInnerRef = ref(null)
@ -72,6 +73,10 @@ const props = defineProps({
type: Number,
required: false,
default: 100
},
isSelector: {
type: Boolean,
default: false
}
})
const { config, showPosition, index, canvasStyleData, canvasViewInfo, dvInfo, searchCount, scale } =
@ -187,7 +192,7 @@ const deepScale = computed(() => scale.value / 100)
@mouseenter="onMouseEnter"
>
<component-edit-bar
v-if="!showPosition.includes('canvas') && dvInfo.type === 'dashboard'"
v-if="!showPosition.includes('canvas') && dvInfo.type === 'dashboard' && !props.isSelector"
class="wrapper-edit-bar"
ref="componentEditBarRef"
:class="{ 'wrapper-edit-bar-active': active }"
@ -197,6 +202,10 @@ const deepScale = computed(() => scale.value / 100)
:show-position="showPosition"
@userViewEnlargeOpen="opt => emits('userViewEnlargeOpen', opt)"
></component-edit-bar>
<component-selector
v-if="props.isSelector && config.component === 'UserView'"
:resource-id="config.id"
/>
<div class="wrapper-inner" ref="componentWrapperInnerRef" :style="componentBackgroundStyle">
<!--边框背景-->
<Icon

View File

@ -58,6 +58,10 @@ const props = defineProps({
type: Number,
required: false,
default: 1
},
isSelector: {
type: Boolean,
default: false
}
})
@ -276,6 +280,7 @@ defineExpose({
:show-position="showPosition"
:search-count="searchCount"
:scale="mobileInPc ? 100 : scaleWidth"
:is-selector="props.isSelector"
@userViewEnlargeOpen="userViewEnlargeOpen($event, item)"
/>
<user-view-enlarge ref="userViewEnlargeRef"></user-view-enlarge>

View File

@ -0,0 +1,43 @@
<template>
<div class="bar-main">
<el-checkbox v-model="checked" @change="checkChange" />
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted } from 'vue'
import { useViewSelectorStoreWithOut } from '@/store/modules/data-visualization/viewSelector'
const viewSelectorStore = useViewSelectorStoreWithOut()
const checked = ref(false)
const props = defineProps({
resourceId: {
type: String,
required: false
}
})
onMounted(() => {
checked.value = viewSelectorStore.getViewIdList.includes(props.resourceId)
})
const checkChange = val => {
if (val) {
viewSelectorStore.add(props.resourceId)
} else {
viewSelectorStore.remove(props.resourceId)
}
}
</script>
<style lang="less" scoped>
.bar-main {
position: absolute;
float: right;
right: 10px;
z-index: 10;
border-radius: 2px;
cursor: pointer !important;
font-size: 16px !important;
}
</style>

View File

@ -0,0 +1,57 @@
import { defineStore } from 'pinia'
import { store } from '@/store/index'
interface ViewSelectorState {
enable: boolean
viewIdList: string[]
}
export const viewSelectorStore = defineStore('viewSelectorStore', {
state: (): ViewSelectorState => {
return {
enable: false,
viewIdList: []
}
},
getters: {
getEnable(): boolean {
return this.enable
},
getViewIdList(): string[] {
return this.viewIdList
}
},
actions: {
setEnable(enable: boolean) {
this.enable = enable
},
remove(id?: string) {
let len = this.viewIdList.length
if (!len) {
return
}
if (!id) {
this.viewIdList = []
return
}
while (len--) {
if (this.viewIdList[len] === id) {
this.viewIdList.splice(len, 1)
}
}
},
add(id: string) {
if (!this.viewIdList.includes(id)) {
this.viewIdList.push(id)
}
},
clear() {
this.enable = false
this.viewIdList = []
}
}
})
export const useViewSelectorStoreWithOut = () => {
return viewSelectorStore(store)
}

View File

@ -25,6 +25,10 @@ const props = defineProps({
type: Boolean,
required: false,
default: false
},
isSelector: {
type: Boolean,
default: false
}
})
@ -119,6 +123,7 @@ defineExpose({
:canvas-view-info="state.canvasViewInfoPreview"
:dv-info="state.dvInfo"
:cur-gap="state.curPreviewGap"
:is-selector="props.isSelector"
></de-preview>
</div>
<XpackComponent

View File

@ -3,6 +3,7 @@ package io.dataease.api.chart;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.dataease.api.chart.dto.ChartViewDTO;
import io.dataease.api.chart.dto.ChartViewFieldDTO;
import io.dataease.api.chart.vo.ViewSelectorVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
@ -38,4 +39,8 @@ public interface ChartViewApi {
@Operation(summary = "查询图表详情")
@PostMapping("getDetail/{id}")
ChartViewDTO getDetail(@PathVariable Long id);
@Operation(summary = "查询仪表板下视图项")
@GetMapping("/viewOption/{resourceId}")
List<ViewSelectorVO> viewOption(@PathVariable("resourceId") Long resourceId);
}

View File

@ -0,0 +1,24 @@
package io.dataease.api.chart.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
@Data
public class ViewSelectorVO implements Serializable {
@Serial
private static final long serialVersionUID = -7163837502596313691L;
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
private String title;
private String type;
@JsonSerialize(using = ToStringSerializer.class)
private Long pid;
}

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.dataease.api.report.dto.*;
import io.dataease.api.report.vo.ReportGridVO;
import io.dataease.api.report.vo.ReportInfoVO;
import io.dataease.api.report.vo.ReportInstanceVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@ -57,7 +58,7 @@ public interface ReportApi {
@Operation(summary = "查询详情")
@GetMapping("/info/{taskId}")
ReportEditor info(@PathVariable("taskId") Long taskId);
ReportInfoVO info(@PathVariable("taskId") Long taskId);
@Operation(summary = "查询日志列表")
@Parameters({

View File

@ -0,0 +1,57 @@
package io.dataease.api.report.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;
@Data
public class ReportInfoVO implements Serializable {
@Serial
private static final long serialVersionUID = 2287397931951305464L;
@JsonSerialize(using = ToStringSerializer.class)
private Long taskId;
private String name;
private String title;
private String content;
private Integer rtid;
@JsonSerialize(using = ToStringSerializer.class)
private Long rid;
private Integer format;
private List<String> viewIdList;
private Integer viewDataRange;
private String pixel;
private List<Integer> reciFlagList;
private List<String> uidList;
private List<String> ridList;
private List<String> emailList;
private List<String> larkGroupList;
private Integer extWaitTime;
private Integer rateType;
private String rateVal;
private Long startTime;
private Long endTime;
}