Compare commits

...

4 Commits

Author SHA1 Message Date
陈晨成
58691ea35d
Pre Merge pull request !252 from 陈晨成/master-fetch-dev 2026-05-22 01:42:29 +00:00
奔跑的面条
ad6b5d731d !278 fix: 修复成百上千组件在拖拽时产升的性能问题
Merge pull request !278 from linjy/fix-perfGain
2026-05-22 09:42:24 +08:00
1351515658@qq.com
e42236ccee fix: 优化项目配置JSON序列化,去掉多余空格 2025-02-10 13:50:52 +08:00
1351515658@qq.com
4409da213f feat(预览): 按钮名称区分本地预览和项目预览,未发布的项目不支持预览 2025-02-10 11:32:49 +08:00
7 changed files with 24 additions and 15 deletions

View File

@ -286,8 +286,7 @@ export const JSONStringify = <T>(data: T) => {
return null return null
} }
return val return val
}, }
2
) )
} }

View File

@ -8,7 +8,6 @@
:hiddenPoint="true" :hiddenPoint="true"
:class="animationsClass(groupData.styles.animations)" :class="animationsClass(groupData.styles.animations)"
:style="{ :style="{
...useComponentStyle(groupData.attr, groupIndex),
...useSizeStyle(groupData.attr), ...useSizeStyle(groupData.attr),
...getFilterStyle(groupData.styles), ...getFilterStyle(groupData.styles),
...getTransformStyle(groupData.styles), ...getTransformStyle(groupData.styles),
@ -28,9 +27,6 @@
:index="groupIndex" :index="groupIndex"
:item="item" :item="item"
:hiddenPoint="true" :hiddenPoint="true"
:style="{
...useComponentStyle(item.attr, groupIndex)
}"
> >
<component <component
class="edit-content-chart" class="edit-content-chart"
@ -60,7 +56,7 @@ import { animationsClass, getFilterStyle, getTransformStyle, getBlendModeStyle,
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
import { useContextMenu, divider } from '@/views/chart/hooks/useContextMenu.hook' import { useContextMenu, divider } from '@/views/chart/hooks/useContextMenu.hook'
import { useMouseHandle } from '../../hooks/useDrag.hook' import { useMouseHandle } from '../../hooks/useDrag.hook'
import { useComponentStyle, useSizeStyle } from '../../hooks/useStyle.hook' import { useSizeStyle } from '../../hooks/useStyle.hook'
import { EditShapeBox } from '../../components/EditShapeBox' import { EditShapeBox } from '../../components/EditShapeBox'
const props = defineProps({ const props = defineProps({

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="go-shape-box" :class="{ lock, hide }"> <div class="go-shape-box" :class="{ lock, hide }" :style="positionStyle">
<slot></slot> <slot></slot>
<!-- 锚点 --> <!-- 锚点 -->
<template v-if="!hiddenPoint"> <template v-if="!hiddenPoint">
@ -38,6 +38,10 @@ const props = defineProps({
hiddenPoint: { hiddenPoint: {
type: Boolean, type: Boolean,
required: false required: false
},
index: {
type: Number,
default: 0
} }
}) })
@ -80,6 +84,17 @@ const lock = computed(() => {
const hide = computed(() => { const hide = computed(() => {
return props.item.status.hide return props.item.status.hide
}) })
//
const positionStyle = computed(() => {
const attr = props.item?.attr
if (!attr) return {}
return {
zIndex: props.index + 1,
left: `${attr.x}px`,
top: `${attr.y}px`
}
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -39,7 +39,6 @@
:data-id="item.id" :data-id="item.id"
:index="index" :index="index"
:style="{ :style="{
...useComponentStyle(item.attr, index),
...(getBlendModeStyle(item.styles) as any), ...(getBlendModeStyle(item.styles) as any),
}" }"
:item="item" :item="item"
@ -106,7 +105,7 @@ import { useLayout } from './hooks/useLayout.hook'
import { useAddKeyboard } from '../hooks/useKeyboard.hook' import { useAddKeyboard } from '../hooks/useKeyboard.hook'
import { useSync } from '../hooks/useSync.hook' import { useSync } from '../hooks/useSync.hook'
import { dragHandle, dragoverHandle, mousedownHandleUnStop, useMouseHandle } from './hooks/useDrag.hook' import { dragHandle, dragoverHandle, mousedownHandleUnStop, useMouseHandle } from './hooks/useDrag.hook'
import { useComponentStyle, useSizeStyle } from './hooks/useStyle.hook' import { useSizeStyle } from './hooks/useStyle.hook'
import { useInitVChartsTheme } from '@/hooks' import { useInitVChartsTheme } from '@/hooks'
import { ContentBox } from '../ContentBox/index' import { ContentBox } from '../ContentBox/index'

View File

@ -166,7 +166,7 @@ const btnList = [
}, },
{ {
key: 'preview', key: 'preview',
title: () => '预览', title: () => '本地预览',
type: () => 'default', type: () => 'default',
icon: renderIcon(BrowsersOutlineIcon), icon: renderIcon(BrowsersOutlineIcon),
event: previewHandle event: previewHandle

View File

@ -65,7 +65,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { computed, ref, watch } from 'vue' import { computed, ref, watch } from 'vue'
import Draggable from 'vuedraggable' import Draggable from 'vuedraggable'
import cloneDeep from 'lodash/cloneDeep'
import { ContentBox } from '../ContentBox/index' import { ContentBox } from '../ContentBox/index'
import { useChartLayoutStore } from '@/store/modules/chartLayoutStore/chartLayoutStore' import { useChartLayoutStore } from '@/store/modules/chartLayoutStore/chartLayoutStore'
import { ChartLayoutStoreEnum, LayerModeEnum } from '@/store/modules/chartLayoutStore/chartLayoutStore.d' import { ChartLayoutStoreEnum, LayerModeEnum } from '@/store/modules/chartLayoutStore/chartLayoutStore.d'
@ -96,7 +95,7 @@ const layerMode = ref<LayerModeEnum>(chartLayoutStore.getLayerType)
// //
const reverseList = computed(() => { const reverseList = computed(() => {
const list: Array<CreateComponentType | CreateComponentGroupType> = cloneDeep(chartEditStore.getComponentList) const list: Array<CreateComponentType | CreateComponentGroupType> = [...chartEditStore.getComponentList]
return list.reverse() return list.reverse()
}) })

View File

@ -122,7 +122,8 @@ const selectOptions = ref([
{ {
label: renderLang('global.r_preview'), label: renderLang('global.r_preview'),
key: 'preview', key: 'preview',
icon: renderIcon(BrowsersOutlineIcon) icon: renderIcon(BrowsersOutlineIcon),
show: props.cardData?.release
}, },
{ {
label: props.cardData?.release label: props.cardData?.release
@ -136,7 +137,7 @@ const selectOptions = ref([
key: 'delete', key: 'delete',
icon: renderIcon(TrashIcon) icon: renderIcon(TrashIcon)
} }
]) ].filter(item => item.show !== false))
const handleSelect = (key: string) => { const handleSelect = (key: string) => {
switch (key) { switch (key) {