mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
Merge branch 'dev' into master-fetch-dev
This commit is contained in:
@@ -15,10 +15,11 @@
|
||||
|
||||
<!-- 缩放比例 -->
|
||||
<n-select
|
||||
:disabled="lockScale"
|
||||
ref="selectInstRef"
|
||||
class="scale-btn"
|
||||
v-model:value="filterValue"
|
||||
size="mini"
|
||||
:disabled="lockScale"
|
||||
:options="filterOptions"
|
||||
@update:value="selectHandle"
|
||||
></n-select>
|
||||
@@ -54,6 +55,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { SelectInst } from 'naive-ui'
|
||||
import { reactive, ref, toRefs, watchEffect } from 'vue'
|
||||
import { icon } from '@/plugins'
|
||||
import { EditHistory } from '../EditHistory/index'
|
||||
@@ -62,15 +64,18 @@ import { EditDataSync } from '../EditDataSync/index'
|
||||
import { useDesignStore } from '@/store/modules/designStore/designStore'
|
||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||
import { EditCanvasTypeEnum } from '@/store/modules/chartEditStore/chartEditStore.d'
|
||||
import { useChartLayoutStore } from '@/store/modules/chartLayoutStore/chartLayoutStore'
|
||||
import { ChartLayoutStoreEnum } from '@/store/modules/chartLayoutStore/chartLayoutStore.d'
|
||||
|
||||
const { LockClosedOutlineIcon, LockOpenOutlineIcon } = icon.ionicons5
|
||||
|
||||
// 全局颜色
|
||||
const designStore = useDesignStore()
|
||||
const themeColor = ref(designStore.getAppTheme)
|
||||
|
||||
const chartLayoutStore = useChartLayoutStore()
|
||||
const chartEditStore = useChartEditStore()
|
||||
const { lockScale, scale } = toRefs(chartEditStore.getEditCanvas)
|
||||
const selectInstRef = ref<SelectInst | null>(null)
|
||||
|
||||
// 缩放选项
|
||||
let filterOptions = [
|
||||
@@ -101,7 +106,9 @@ const filterValue = ref('')
|
||||
|
||||
// 用户自选择
|
||||
const selectHandle = (v: number) => {
|
||||
selectInstRef.value?.blur()
|
||||
if (v === 0) {
|
||||
chartLayoutStore.setItemUnHandle(ChartLayoutStoreEnum.RE_POSITION_CANVAS, true)
|
||||
chartEditStore.computedScale()
|
||||
return
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, computed } from 'vue'
|
||||
import { onMounted, computed, provide } from 'vue'
|
||||
import { chartColors } from '@/settings/chartThemes/index'
|
||||
import { MenuEnum } from '@/enums/editPageEnum'
|
||||
import { CreateComponentType, CreateComponentGroupType } from '@/packages/index.d'
|
||||
@@ -91,7 +91,7 @@ import { animationsClass, getFilterStyle, getTransformStyle, getBlendModeStyle,
|
||||
import { useContextMenu } from '@/views/chart/hooks/useContextMenu.hook'
|
||||
import { MenuOptionsItemType } from '@/views/chart/hooks/useContextMenu.hook.d'
|
||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||
|
||||
import { SCALE_KEY } from '@/views/preview/hooks/useScale.hook'
|
||||
import { useLayout } from './hooks/useLayout.hook'
|
||||
import { useAddKeyboard } from '../hooks/useKeyboard.hook'
|
||||
import { useSync } from '../hooks/useSync.hook'
|
||||
@@ -110,6 +110,9 @@ const chartEditStore = useChartEditStore()
|
||||
const { handleContextMenu } = useContextMenu()
|
||||
const { dataSyncFetch, intervalDataSyncUpdate } = useSync()
|
||||
|
||||
// 编辑时注入scale变量,消除警告
|
||||
provide(SCALE_KEY, null);
|
||||
|
||||
// 布局处理
|
||||
useLayout()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user