fix: 修改图层顺序

This commit is contained in:
MTrun 2022-02-07 21:02:49 +08:00
parent 88b03a416c
commit 1b7bcd3e32

View File

@ -14,7 +14,7 @@
<!-- 图层内容 -->
<ListItem
v-for="item in chartEditStore.getComponentList"
v-for="item in reverseList"
:key="item.id"
:componentData="item"
@mousedown="mousedownHandle(item)"
@ -26,12 +26,13 @@
</template>
<script setup lang="ts">
import { computed } from 'vue'
import { ContentBox } from '../ContentBox/index'
import { useChartLayoutStore } from '@/store/modules/chartLayoutStore/chartLayoutStore'
import { ChartLayoutStoreEnum } from '@/store/modules/chartLayoutStore/chartLayoutStore.d'
import { useChartEditStoreStore } from '@/store/modules/chartEditStore/chartEditStore'
import { CreateComponentType } from '@/packages/index.d'
import cloneDeep from 'lodash/cloneDeep';
import {
ChartEditStoreEnum,
TargetChartType
@ -53,6 +54,12 @@ const { handleContextMenu } = useContextMenu({
hideOptionsList: [MenuEnum.CLEAR, MenuEnum.PARSE]
})
//
const reverseList = computed(()=>{
const list: CreateComponentType[] = cloneDeep(chartEditStore.getComponentList)
return list.reverse()
})
const backHandle = () => {
chartLayoutStore.setItem(ChartLayoutStoreEnum.LAYERS, false)
}