diff --git a/src/packages/components/Informations/Texts/TextCommon/config.vue b/src/packages/components/Informations/Texts/TextCommon/config.vue index c2a9e44e..4fa6912e 100644 --- a/src/packages/components/Informations/Texts/TextCommon/config.vue +++ b/src/packages/components/Informations/Texts/TextCommon/config.vue @@ -2,7 +2,7 @@ <collapse-item name="信息" :expanded="true"> <setting-item-box name="文字" :alone="true"> <setting-item> - <n-input v-model:value="optionData.dataset" size="small"></n-input> + <n-input v-model:value="optionData.dataset" type="textarea" size="small"></n-input> </setting-item> </setting-item-box> <setting-item-box name="链接" :alone="true"> @@ -30,11 +30,7 @@ <n-input-number v-model:value="optionData.fontSize" size="small" placeholder="字体大小"></n-input-number> </setting-item> <setting-item name="字体粗细"> - <n-select - v-model:value="optionData.fontWeight" - size="small" - :options="fontWeightOptions" - /> + <n-select v-model:value="optionData.fontWeight" size="small" :options="fontWeightOptions" /> </setting-item> <setting-item name="X轴内边距"> <n-input-number v-model:value="optionData.paddingX" size="small" placeholder="输入内边距"></n-input-number> @@ -87,9 +83,7 @@ <script setup lang="ts"> import { PropType } from 'vue' -import { option, WritingModeEnum, WritingModeObject, - FontWeightEnum, - FontWeightObject, } from './config' +import { option, WritingModeEnum, WritingModeObject, FontWeightEnum, FontWeightObject } from './config' import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting' const props = defineProps({ optionData: { @@ -117,13 +111,13 @@ const verticalOptions = [ const fontWeightOptions = [ { label: FontWeightEnum.NORMAL, - value: FontWeightObject[FontWeightEnum.NORMAL], + value: FontWeightObject[FontWeightEnum.NORMAL] }, { label: FontWeightEnum.BOLD, - value: FontWeightObject[FontWeightEnum.BOLD], - }, -]; + value: FontWeightObject[FontWeightEnum.BOLD] + } +] const handleLinkClick = () => { window.open(props.optionData.linkHead + props.optionData.link) } diff --git a/src/packages/components/Informations/Texts/TextCommon/index.vue b/src/packages/components/Informations/Texts/TextCommon/index.vue index c60a2fcb..9cd16502 100644 --- a/src/packages/components/Informations/Texts/TextCommon/index.vue +++ b/src/packages/components/Informations/Texts/TextCommon/index.vue @@ -1,8 +1,8 @@ <template> <div class="go-text-box"> <div class="content"> - <span style="cursor: pointer" v-if="link" @click="click">{{ option.dataset }}</span> - <span v-else>{{ option.dataset }}</span> + <span style="cursor: pointer; white-space: pre-wrap" v-if="link" @click="click"></span> + <span style="white-space: pre-wrap" v-else>{{ option.dataset }}</span> </div> </div> </template> @@ -82,7 +82,7 @@ const click = () => { border-width: v-bind('borderWidth + "px"'); border-radius: v-bind('borderRadius + "px"'); border-color: v-bind('borderColor'); - + background-color: v-bind('backgroundColor'); } } diff --git a/src/views/chart/ContentEdit/components/EditShapeBox/index.vue b/src/views/chart/ContentEdit/components/EditShapeBox/index.vue index b509b32b..babd1211 100644 --- a/src/views/chart/ContentEdit/components/EditShapeBox/index.vue +++ b/src/views/chart/ContentEdit/components/EditShapeBox/index.vue @@ -23,6 +23,8 @@ <script setup lang="ts"> import { computed, PropType } from 'vue' import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' +import { EditCanvasTypeEnum } from '@/store/modules/chartEditStore/chartEditStore.d' + import { useDesignStore } from '@/store/modules/designStore/designStore' import { CreateComponentType, CreateComponentGroupType } from '@/packages/index.d' import { useSizeStyle, usePointStyle } from '../../hooks/useStyle.hook' @@ -55,6 +57,9 @@ const themeColor = computed(() => { // 计算当前选中目标 const hover = computed(() => { + const isDrag = chartEditStore.getEditCanvas[EditCanvasTypeEnum.IS_DRAG] + if (isDrag) return false + if (props.item.status.lock) return false return props.item.id === chartEditStore.getTargetChart.hoverId }) diff --git a/src/views/chart/ContentEdit/hooks/useLayout.hook.ts b/src/views/chart/ContentEdit/hooks/useLayout.hook.ts index 1da17d5c..4fb3fb76 100644 --- a/src/views/chart/ContentEdit/hooks/useLayout.hook.ts +++ b/src/views/chart/ContentEdit/hooks/useLayout.hook.ts @@ -5,8 +5,9 @@ import { EditCanvasTypeEnum } from '@/store/modules/chartEditStore/chartEditStor const chartEditStore = useChartEditStore() // 布局处理 -export const useLayout = () => { - onMounted(() => { +export const useLayout = (fn: () => Promise<void>) => { + let removeScale: Function = () => { } + onMounted(async () => { // 设置 Dom 值(ref 不生效先用 document) chartEditStore.setEditCanvas( EditCanvasTypeEnum.EDIT_LAYOUT_DOM, @@ -17,13 +18,16 @@ export const useLayout = () => { document.getElementById('go-chart-edit-content') ) + // 获取数据 + await fn() // 监听初始化 - const removeScale = chartEditStore.listenerScale() + removeScale = chartEditStore.listenerScale() - onUnmounted(() => { - chartEditStore.setEditCanvas(EditCanvasTypeEnum.EDIT_LAYOUT_DOM, null) - chartEditStore.setEditCanvas(EditCanvasTypeEnum.EDIT_CONTENT_DOM, null) - removeScale() - }) + }) + + onUnmounted(() => { + chartEditStore.setEditCanvas(EditCanvasTypeEnum.EDIT_LAYOUT_DOM, null) + chartEditStore.setEditCanvas(EditCanvasTypeEnum.EDIT_CONTENT_DOM, null) + removeScale() }) } \ No newline at end of file diff --git a/src/views/chart/ContentEdit/index.vue b/src/views/chart/ContentEdit/index.vue index 34b7122a..f3820290 100644 --- a/src/views/chart/ContentEdit/index.vue +++ b/src/views/chart/ContentEdit/index.vue @@ -109,10 +109,10 @@ const chartEditStore = useChartEditStore() const { handleContextMenu } = useContextMenu() // 编辑时注入scale变量,消除警告 -provide(SCALE_KEY, null); +provide(SCALE_KEY, null) // 布局处理 -useLayout() +useLayout(async () => {}) // 点击事件 const { mouseenterHandle, mouseleaveHandle, mousedownHandle, mouseClickHandle } = useMouseHandle() diff --git a/src/views/chart/hooks/useSync.hook.ts b/src/views/chart/hooks/useSync.hook.ts index f72f9193..97221f19 100644 --- a/src/views/chart/hooks/useSync.hook.ts +++ b/src/views/chart/hooks/useSync.hook.ts @@ -185,6 +185,11 @@ export const useSync = () => { } else { await create(comItem as CreateComponentType) } + if (percentage === 100) { + // 清除历史记录 + chartHistoryStore.clearBackStack() + chartHistoryStore.clearForwardStack() + } } } else { // 非组件(顺便排除脏数据) diff --git a/src/views/project/items/components/ProjectItemsCard/index.vue b/src/views/project/items/components/ProjectItemsCard/index.vue index 63ec3c91..3044220b 100644 --- a/src/views/project/items/components/ProjectItemsCard/index.vue +++ b/src/views/project/items/components/ProjectItemsCard/index.vue @@ -131,20 +131,6 @@ const selectOptions = ref([ key: 'preview', icon: renderIcon(BrowsersOutlineIcon) }, - { - label: renderLang('global.r_copy'), - key: 'copy', - icon: renderIcon(CopyIcon) - }, - { - label: renderLang('global.r_rename'), - key: 'rename', - icon: renderIcon(PencilIcon) - }, - { - type: 'divider', - key: 'd1' - }, { label: props.cardData?.release ? renderLang('global.r_unpublish') @@ -152,15 +138,6 @@ const selectOptions = ref([ key: 'send', icon: renderIcon(SendIcon) }, - { - label: renderLang('global.r_download'), - key: 'download', - icon: renderIcon(DownloadIcon) - }, - { - type: 'divider', - key: 'd2' - }, { label: renderLang('global.r_delete'), key: 'delete',