|
|
@@ -49,6 +49,43 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="tool-group">
|
|
|
+ <el-popover
|
|
|
+ v-model:visible="layerPopoverVisible"
|
|
|
+ placement="bottom"
|
|
|
+ :width="320"
|
|
|
+ trigger="click"
|
|
|
+ :disabled="!headerPanelProps.layerEnabled">
|
|
|
+ <template #reference>
|
|
|
+ <tool-button label="层级" :disabled="!headerPanelProps.layerEnabled">
|
|
|
+ <Files />
|
|
|
+ </tool-button>
|
|
|
+ </template>
|
|
|
+ <div class="layer-control-panel">
|
|
|
+ <div class="layer-control-panel__heading">
|
|
|
+ <strong>调整层级</strong>
|
|
|
+ <span>控制选中组件在画布中的前后顺序</span>
|
|
|
+ </div>
|
|
|
+ <div class="layer-control-panel__actions">
|
|
|
+ <tool-button
|
|
|
+ label="置顶"
|
|
|
+ compact
|
|
|
+ :disabled="!headerPanelProps.canMoveLayerUp"
|
|
|
+ @click="changeLayer('top')">
|
|
|
+ <Top />
|
|
|
+ </tool-button>
|
|
|
+ <tool-button
|
|
|
+ label="置底"
|
|
|
+ compact
|
|
|
+ :disabled="!headerPanelProps.canMoveLayerDown"
|
|
|
+ @click="changeLayer('bottom')">
|
|
|
+ <Bottom />
|
|
|
+ </tool-button>
|
|
|
+ </div>
|
|
|
+ <div class="layer-control-panel__hint">
|
|
|
+ 快捷键:{{ systemShortcutKey }} + → 置顶,{{ systemShortcutKey }} + ← 置底
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-popover>
|
|
|
<el-popover
|
|
|
placement="bottom"
|
|
|
:width="460"
|
|
|
@@ -172,6 +209,8 @@
|
|
|
import deepOilLogo from '@/assets/imgs/logo.png'
|
|
|
import SvgAnalysis from '@/components/mt-edit/components/svg-analysis/index.vue'
|
|
|
import type { IRealTimeData } from '@/components/mt-edit/store/types'
|
|
|
+import { getSystemShortcutKeyName } from '@/components/mt-edit/utils'
|
|
|
+import { Bottom, Files, Top } from '@element-plus/icons-vue'
|
|
|
import { useDark, useFullscreen, useToggle } from '@vueuse/core'
|
|
|
import { ElButton, ElIcon, ElImage, ElPopover, ElTag } from 'element-plus'
|
|
|
import { defineComponent, h, ref } from 'vue'
|
|
|
@@ -184,6 +223,9 @@ type HeaderPanelProps = {
|
|
|
groupEnabled: boolean
|
|
|
unGroupEnabled: boolean
|
|
|
alignEnabled: boolean
|
|
|
+ layerEnabled: boolean
|
|
|
+ canMoveLayerUp: boolean
|
|
|
+ canMoveLayerDown: boolean
|
|
|
deleteEnabled: boolean
|
|
|
lockState: boolean
|
|
|
undoEnabled: boolean
|
|
|
@@ -250,6 +292,7 @@ const emits = defineEmits([
|
|
|
'onDeleteClick',
|
|
|
'onExportClick',
|
|
|
'onTreeClick',
|
|
|
+ 'changeLayer',
|
|
|
'alignSelected',
|
|
|
'update:lockState',
|
|
|
'onRedoClick',
|
|
|
@@ -265,12 +308,18 @@ const isDark = useDark({ selector: '#mt-edit' })
|
|
|
const { isFullscreen, toggle } = useFullscreen()
|
|
|
const toggleDark = useToggle(isDark)
|
|
|
const drawline_selected = ref(false)
|
|
|
+const layerPopoverVisible = ref(false)
|
|
|
+const systemShortcutKey = getSystemShortcutKeyName()
|
|
|
const is_npm_env = ref(import.meta.env.MODE === 'npm')
|
|
|
const onGroupClick = () => emits('onGroupClick')
|
|
|
const onUngroupClick = () => emits('onUngroupClick')
|
|
|
const onDeleteClick = () => emits('onDeleteClick')
|
|
|
const onExportClick = () => emits('onExportClick')
|
|
|
const onTreeClick = () => emits('onTreeClick')
|
|
|
+const changeLayer = (type: 'top' | 'bottom') => {
|
|
|
+ emits('changeLayer', type)
|
|
|
+ layerPopoverVisible.value = false
|
|
|
+}
|
|
|
const alignSelected = (
|
|
|
type:
|
|
|
| 'left'
|
|
|
@@ -498,6 +547,57 @@ const onDrawLineClick = () => {
|
|
|
width: 100%;
|
|
|
}
|
|
|
|
|
|
+.layer-control-panel__heading {
|
|
|
+ display: flex;
|
|
|
+ padding-bottom: 10px;
|
|
|
+ border-bottom: 1px solid #e8ecf2;
|
|
|
+ flex-direction: column;
|
|
|
+ gap: 3px;
|
|
|
+}
|
|
|
+
|
|
|
+.layer-control-panel__heading strong {
|
|
|
+ font-size: 13px;
|
|
|
+ line-height: 19px;
|
|
|
+ color: #273244;
|
|
|
+}
|
|
|
+
|
|
|
+.layer-control-panel__heading span,
|
|
|
+.layer-control-panel__hint {
|
|
|
+ font-size: 11px;
|
|
|
+ line-height: 17px;
|
|
|
+ color: #8a95a6;
|
|
|
+}
|
|
|
+
|
|
|
+.layer-control-panel__actions {
|
|
|
+ display: grid;
|
|
|
+ padding: 10px 0;
|
|
|
+ grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
|
+ gap: 7px;
|
|
|
+}
|
|
|
+
|
|
|
+.layer-control-panel__actions :deep(.tool-button-wrap),
|
|
|
+.layer-control-panel__actions :deep(.tool-button) {
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+
|
|
|
+.layer-control-panel__actions :deep(.tool-button) {
|
|
|
+ padding: 9px 10px;
|
|
|
+ background: #f7f9fc;
|
|
|
+ border: 1px solid #e5eaf1;
|
|
|
+ justify-content: flex-start;
|
|
|
+}
|
|
|
+
|
|
|
+.layer-control-panel__actions :deep(.tool-button:not(.is-disabled):hover) {
|
|
|
+ background: var(--el-color-primary-light-9);
|
|
|
+ border-color: var(--el-color-primary-light-7);
|
|
|
+}
|
|
|
+
|
|
|
+.layer-control-panel__hint {
|
|
|
+ padding-top: 8px;
|
|
|
+ text-align: center;
|
|
|
+ border-top: 1px solid #e8ecf2;
|
|
|
+}
|
|
|
+
|
|
|
.dark .editor-header {
|
|
|
color: #cbd5e1;
|
|
|
background: rgb(24 31 43 / 97%);
|
|
|
@@ -512,7 +612,8 @@ const onDrawLineClick = () => {
|
|
|
}
|
|
|
|
|
|
.dark .editor-brand__name,
|
|
|
-.dark .align-panel__title {
|
|
|
+.dark .align-panel__title,
|
|
|
+.dark .layer-control-panel__heading strong {
|
|
|
color: #f1f5f9;
|
|
|
}
|
|
|
|