Merge pull request #10722 from dataease/pr@dev-v2@refactor_tab

refactor(仪表板): Tab页显示优化
This commit is contained in:
王嘉豪 2024-07-02 17:59:50 +08:00 committed by GitHub
commit 2a57a4a862
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 12 deletions

View File

@ -403,7 +403,8 @@ public class DataVisualizationServer implements DataVisualizationApi {
request.setPid(result.getPid()); request.setPid(result.getPid());
} }
if (DataVisualizationConstants.RESOURCE_OPT_TYPE.MOVE.equals(request.getOpt()) if (DataVisualizationConstants.RESOURCE_OPT_TYPE.MOVE.equals(request.getOpt())
|| DataVisualizationConstants.RESOURCE_OPT_TYPE.RENAME.equals(request.getOpt())) { || DataVisualizationConstants.RESOURCE_OPT_TYPE.RENAME.equals(request.getOpt())
|| DataVisualizationConstants.RESOURCE_OPT_TYPE.EDIT.equals(request.getOpt())) {
wrapper.ne("id", request.getId()); wrapper.ne("id", request.getId());
} }
} }

View File

@ -3,6 +3,7 @@
v-if="state.tabShow" v-if="state.tabShow"
style="width: 100%; height: 100%" style="width: 100%; height: 100%"
:class="headClass" :class="headClass"
class="custom-tabs-head"
ref="tabComponentRef" ref="tabComponentRef"
> >
<de-custom-tab <de-custom-tab
@ -160,7 +161,8 @@ const props = defineProps({
default: 1 default: 1
} }
}) })
const { element, isEdit, showPosition, canvasStyleData, canvasViewInfo, dvInfo } = toRefs(props) const { element, isEdit, showPosition, canvasStyleData, canvasViewInfo, dvInfo, scale } =
toRefs(props)
const state = reactive({ const state = reactive({
activeTabName: '', activeTabName: '',
@ -316,11 +318,11 @@ const headClass = computed(() => {
const titleStyle = itemName => { const titleStyle = itemName => {
if (editableTabsValue.value === itemName) { if (editableTabsValue.value === itemName) {
return { return {
fontSize: (element.value.style.activeFontSize || 18) + 'px' fontSize: (element.value.style.activeFontSize || 18) * scale.value + 'px'
} }
} else { } else {
return { return {
fontSize: (element.value.style.fontSize || 16) + 'px' fontSize: (element.value.style.fontSize || 16) * scale.value + 'px'
} }
} }
} }

View File

@ -95,10 +95,10 @@ function matrixAdaptor(componentItem) {
componentItem.y = 1 + (componentItem.y - 1) * 2 componentItem.y = 1 + (componentItem.y - 1) * 2
componentItem.sizeX = componentItem.sizeX * 2 componentItem.sizeX = componentItem.sizeX * 2
componentItem.sizeY = componentItem.sizeY * 2 componentItem.sizeY = componentItem.sizeY * 2
componentItem.mx = 1 + (componentItem.mx - 1) * 2 componentItem['mx'] = 1 + (componentItem.mx - 1) * 2
componentItem.my = 1 + (componentItem.my - 1) * 2 componentItem['my'] = 1 + (componentItem.my - 1) * 2
componentItem.mSizeX = componentItem.mSizeX * 2 componentItem['mSizeX'] = componentItem.mSizeX * 2
componentItem.mSizeY = componentItem.mSizeY * 2 componentItem['mSizeY'] = componentItem.mSizeY * 2
if (componentItem.component === 'Group') { if (componentItem.component === 'Group') {
componentItem.propValue.forEach(groupItem => { componentItem.propValue.forEach(groupItem => {
matrixAdaptor(groupItem) matrixAdaptor(groupItem)
@ -498,10 +498,7 @@ export async function decompressionPre(params, callBack) {
(!deTemplateDataTemp.version || deTemplateDataTemp.version === 2) && (!deTemplateDataTemp.version || deTemplateDataTemp.version === 2) &&
deTemplateDataTemp.type === 'dashboard' deTemplateDataTemp.type === 'dashboard'
) { ) {
componentItem.x = 1 + (componentItem.x - 1) * 2 matrixAdaptor(componentItem)
componentItem.y = 1 + (componentItem.y - 1) * 2
componentItem.sizeX = componentItem.sizeX * 2
componentItem.sizeY = componentItem.sizeY * 2
} }
}) })
const sourceCanvasStyle = JSON.parse(deTemplateDataTemp['canvasStyleData']) const sourceCanvasStyle = JSON.parse(deTemplateDataTemp['canvasStyleData'])