fix: 修复加载组态mask

This commit is contained in:
huanghao1412 2024-02-27 10:19:04 +08:00
parent e58d62097d
commit 5aa28ad908
7 changed files with 40 additions and 13 deletions

View File

@ -25,7 +25,7 @@ import { useGetMessageByParent } from '@/utils/utils'
const {getMessageByParent} = useGetMessageByParent() const {getMessageByParent} = useGetMessageByParent()
console.log(window.location.origin) // console.log(window.location.origin)
const routerStore = useRouterStore() const routerStore = useRouterStore()
getMessageByParent('setCallByParent', (e) => { getMessageByParent('setCallByParent', (e) => {
if(e.data.type === 'setCallByParent' && e.data.page === 'customLargeScreen') { if(e.data.type === 'setCallByParent' && e.data.page === 'customLargeScreen') {

View File

@ -10,7 +10,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { computed, PropType, toRefs, onMounted, onUnmounted, ref, watch } from 'vue' import { computed, PropType, toRefs, onMounted, onUnmounted, ref, watch, defineEmits } from 'vue'
import { CreateComponentType } from '@/packages/index.d' import { CreateComponentType } from '@/packages/index.d'
import { useOriginStore } from '@/store/modules/originStore/originStore' import { useOriginStore } from '@/store/modules/originStore/originStore'
import { postMessageToParent } from '@/utils' import { postMessageToParent } from '@/utils'
@ -39,6 +39,9 @@ const iframe = ref()
const option = computed(() => { const option = computed(() => {
return props.chartConfig.option return props.chartConfig.option
}) })
const emit = defineEmits(['changeZIndex'])
const handleMsg = (event: any) => { const handleMsg = (event: any) => {
let origin = process.env.NODE_ENV === 'production' ? window.location.origin : 'http://192.168.0.42:9528' let origin = process.env.NODE_ENV === 'production' ? window.location.origin : 'http://192.168.0.42:9528'
if (event.origin === origin) { if (event.origin === origin) {
@ -73,6 +76,9 @@ const handleMsg = (event: any) => {
isThereATitleComponet: option.value.isThereATitleComponet isThereATitleComponet: option.value.isThereATitleComponet
}) })
} }
else if(obj.type === 'setZIndex') {
emit('changeZIndex', obj.zIndex)
}
} }
} }

View File

@ -12,11 +12,11 @@
<n-input v-model:value="optionData.datasetCustom" size="small"></n-input> <n-input v-model:value="optionData.datasetCustom" size="small"></n-input>
</setting-item> </setting-item>
</setting-item-box> </setting-item-box>
<setting-item-box name="混合模式" alone> <!-- <setting-item-box name="混合模式" alone>-->
<setting-item name="使用滤色选项可以去除黑色背景"> <!-- <setting-item name="使用滤色选项可以去除黑色背景">-->
<n-select v-model:value="chartStyles.blendMode" :options="BlendModeEnumList" size="small"></n-select> <!-- <n-select v-model:value="chartStyles.blendMode" :options="BlendModeEnumList" size="small"></n-select>-->
</setting-item> <!-- </setting-item>-->
</setting-item-box> <!-- </setting-item-box>-->
<setting-item-box name="控制"> <setting-item-box name="控制">
<setting-item> <setting-item>
<n-checkbox v-model:checked="optionData.loop" size="small">循环播放</n-checkbox> <n-checkbox v-model:checked="optionData.loop" size="small">循环播放</n-checkbox>

View File

@ -9,6 +9,6 @@ export const VideoConfig: ConfigType = {
category: ChatCategoryEnum.MORE, category: ChatCategoryEnum.MORE,
categoryName: ChatCategoryEnumName.MORE, categoryName: ChatCategoryEnumName.MORE,
package: PackagesCategoryEnum.INFORMATIONS, package: PackagesCategoryEnum.INFORMATIONS,
chartFrame: ChartFrameEnum.COMMON, chartFrame: ChartFrameEnum.STATIC,
image: 'video.png' image: 'video.png'
} }

View File

@ -15,7 +15,8 @@
...getComponentAttrStyle(item.attr, groupIndex), ...getComponentAttrStyle(item.attr, groupIndex),
...getStatusStyle(item.status), ...getStatusStyle(item.status),
...getPreviewConfigStyle(item.preview), ...getPreviewConfigStyle(item.preview),
...getBlendModeStyle(item.styles) as any ...getBlendModeStyle(item.styles) as any,
zIndex: zIndexMap[item.id] ? zIndexMap[item.id] : ''
}" }"
> >
<component <component
@ -30,13 +31,14 @@
...getTransformStyle(item.styles) ...getTransformStyle(item.styles)
}" }"
v-on="useLifeHandler(item)" v-on="useLifeHandler(item)"
@changeZIndex="z => changeZIndex(item.id, z)"
></component> ></component>
</div> </div>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { PropType } from 'vue' import {PropType, ref, Ref} from 'vue'
import { CreateComponentGroupType } from '@/packages/index.d' import { CreateComponentGroupType } from '@/packages/index.d'
import { animationsClass, getFilterStyle, getTransformStyle, getBlendModeStyle } from '@/utils' import { animationsClass, getFilterStyle, getTransformStyle, getBlendModeStyle } from '@/utils'
import { getSizeStyle, getComponentAttrStyle, getStatusStyle, getPreviewConfigStyle } from '../../utils' import { getSizeStyle, getComponentAttrStyle, getStatusStyle, getPreviewConfigStyle } from '../../utils'
@ -60,6 +62,15 @@ const props = defineProps({
required: true required: true
} }
}) })
const emit = defineEmits(['changeZIndex'])
// zindex
const zIndexMap: Ref<{ [k: string] : number | string | undefined }> = ref({})
const changeZIndex = (id: string, z: number | string | undefined) => {
zIndexMap.value[id] = z
emit('changeZIndex', z)
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -10,7 +10,8 @@
...getStatusStyle(item.status), ...getStatusStyle(item.status),
...getPreviewConfigStyle(item.preview), ...getPreviewConfigStyle(item.preview),
...getBlendModeStyle(item.styles) as any, ...getBlendModeStyle(item.styles) as any,
...getSizeStyle(item.attr) ...getSizeStyle(item.attr),
zIndex: zIndexMap[item.id] ? zIndexMap[item.id] : ''
}" }"
> >
<!-- 分组 --> <!-- 分组 -->
@ -20,6 +21,7 @@
:groupIndex="index" :groupIndex="index"
:themeSetting="themeSetting" :themeSetting="themeSetting"
:themeColor="themeColor" :themeColor="themeColor"
@changeZIndex="z => changeZIndex(item.id, z)"
></preview-render-group> ></preview-render-group>
<!-- 单组件 --> <!-- 单组件 -->
@ -35,13 +37,15 @@
...getFilterStyle(item.styles) ...getFilterStyle(item.styles)
}" }"
v-on="bindEvent(item)" v-on="bindEvent(item)"
@changeZIndex="z => changeZIndex(item.id, z)"
></component> ></component>
<!-- v-on="useLifeHandler(item)"--> <!-- v-on="useLifeHandler(item)"-->
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { PropType, computed, onMounted } from 'vue' import { PropType, computed, onMounted, ref } from 'vue'
import type { Ref } from 'vue'
import { useChartDataPondFetch } from '@/hooks' import { useChartDataPondFetch } from '@/hooks'
import { ChartEditStorageType } from '../../index.d' import { ChartEditStorageType } from '../../index.d'
import { PreviewRenderGroup } from '../PreviewRenderGroup/index' import { PreviewRenderGroup } from '../PreviewRenderGroup/index'
@ -76,6 +80,12 @@ const themeColor = computed(() => {
return colorCustomMergeData[chartEditStore.editCanvasConfig.chartThemeColor] return colorCustomMergeData[chartEditStore.editCanvasConfig.chartThemeColor]
}) })
// zindex
const zIndexMap: Ref<{ [k: string] : number | string | undefined }> = ref({})
const changeZIndex = (id: string, z: number | string | undefined) => {
zIndexMap.value[id] = z
}
// //
clearMittDataPondMap() clearMittDataPondMap()
onMounted(() => { onMounted(() => {

View File

@ -28,7 +28,7 @@ export const useComInstall = (localStorageInfo: ChartEditStorageType) => {
}) })
show.value = true show.value = true
} }
}, 200) }, 50)
return { return {
show show