2023-12-05 13:23:01 +08:00
|
|
|
<template>
|
|
|
|
|
|
|
|
|
|
<div ref="kuwei" v-resize="resizeHandler">
|
2023-12-07 10:57:06 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="title" plain @click="open2">
|
|
|
|
|
{{layoutList.data.movieName}}
|
|
|
|
|
</div>
|
2023-12-05 13:23:01 +08:00
|
|
|
<div v-for="(item, index) in layoutList.data.seatList"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:style="{
|
|
|
|
|
position:'absolute',
|
|
|
|
|
background:'#e6e6e6',
|
|
|
|
|
height:propValue.base.boxHeight + 'px',
|
|
|
|
|
width: propValue.base.boxWidth + 'px',
|
2023-12-06 16:29:45 +08:00
|
|
|
left: (item.gRow) * propValue.base.boxHeightGap + 'px',
|
|
|
|
|
top: (item.gCol) * propValue.base.boxWidithGap + 'px',
|
2023-12-05 13:23:01 +08:00
|
|
|
}"
|
|
|
|
|
>
|
2023-12-07 10:57:06 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-popover
|
2023-12-05 13:23:01 +08:00
|
|
|
v-if="item.type==0"
|
2023-12-07 10:57:06 +08:00
|
|
|
placement="top-start"
|
|
|
|
|
:title="item.id"
|
|
|
|
|
trigger="hover"
|
|
|
|
|
:content="item.code"
|
|
|
|
|
>
|
|
|
|
|
<template #reference>
|
|
|
|
|
<el-image
|
|
|
|
|
class="seatImg0Class"
|
|
|
|
|
:seatId="item.id"
|
|
|
|
|
:seatIndex="index"
|
|
|
|
|
:src="img_kong"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-popover>
|
|
|
|
|
|
|
|
|
|
<el-popover
|
2023-12-05 13:23:01 +08:00
|
|
|
v-if="item.type==1"
|
2023-12-07 10:57:06 +08:00
|
|
|
placement="top-start"
|
|
|
|
|
:title="item.id"
|
|
|
|
|
trigger="hover"
|
|
|
|
|
:content="item.code"
|
|
|
|
|
>
|
|
|
|
|
<template #reference>
|
|
|
|
|
<el-image
|
|
|
|
|
class="seatImg1Class"
|
|
|
|
|
:seatId="item.id"
|
|
|
|
|
:seatIndex="index"
|
|
|
|
|
:src="img_130"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-popover>
|
|
|
|
|
|
|
|
|
|
<el-popover
|
2023-12-05 13:23:01 +08:00
|
|
|
v-if="item.type==2"
|
2023-12-07 10:57:06 +08:00
|
|
|
placement="top-start"
|
|
|
|
|
:title="item.id"
|
|
|
|
|
trigger="hover"
|
|
|
|
|
:content="item.code"
|
|
|
|
|
>
|
|
|
|
|
<template #reference>
|
|
|
|
|
<el-image
|
|
|
|
|
class="seatImg2Class"
|
|
|
|
|
:seatId="item.id"
|
|
|
|
|
:seatIndex="index"
|
|
|
|
|
:src="img_jinyong"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-popover>
|
|
|
|
|
|
|
|
|
|
<el-popover
|
2023-12-05 13:23:01 +08:00
|
|
|
v-if="item.type==3"
|
2023-12-07 10:57:06 +08:00
|
|
|
placement="top-start"
|
|
|
|
|
:title="item.id"
|
|
|
|
|
trigger="hover"
|
|
|
|
|
:content="item.code"
|
|
|
|
|
>
|
|
|
|
|
<template #reference>
|
|
|
|
|
<el-image
|
|
|
|
|
class="seatImg3Class"
|
|
|
|
|
:seatId="item.id"
|
|
|
|
|
:seatIndex="index"
|
|
|
|
|
:src="img_130"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-popover>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-05 13:23:01 +08:00
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { useData, useEventBus, useProp } from "open-data-v/base";
|
|
|
|
|
import { onMounted, reactive, ref } from "vue";
|
|
|
|
|
|
2023-12-07 10:57:06 +08:00
|
|
|
import img_130 from "@/assets/kuwei/130.png";
|
|
|
|
|
import img_jinyong from "@/assets/kuwei/132.png";
|
|
|
|
|
import img_kong from "@/assets/kuwei/133.png";
|
2023-12-05 13:23:01 +08:00
|
|
|
import type KuWeiComponent from './config'
|
|
|
|
|
import type { KuWeiType } from './type'
|
2023-12-07 10:57:06 +08:00
|
|
|
import { ElNotification } from 'element-plus'
|
2023-12-05 13:23:01 +08:00
|
|
|
const props = defineProps<{
|
|
|
|
|
component: KuWeiComponent
|
|
|
|
|
}>()
|
|
|
|
|
|
|
|
|
|
|
2023-12-07 10:57:06 +08:00
|
|
|
const getAssetsFile = (url: string) => {
|
|
|
|
|
return new URL(`@/assets/kuwei/${url}`, import.meta.url).href
|
|
|
|
|
}
|
2023-12-05 13:23:01 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
const { propValue } = useProp<KuWeiType>(props.component)
|
|
|
|
|
var layoutList = reactive({
|
|
|
|
|
data:{
|
|
|
|
|
mg_top: null,
|
|
|
|
|
mg_left: null,
|
|
|
|
|
movieName: null,
|
|
|
|
|
seatList: []
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const lineHeight = ref<string>('20px')
|
|
|
|
|
const resizeHandler = (entry: ResizeObserverEntry) => {
|
|
|
|
|
const { height } = entry.contentRect
|
|
|
|
|
lineHeight.value = `${height}px`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2023-12-07 10:57:06 +08:00
|
|
|
const open2 = () => {
|
|
|
|
|
console.log("123123132")
|
|
|
|
|
ElNotification({
|
|
|
|
|
title: 'Warning',
|
|
|
|
|
message: 'This is a warning message',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
})
|
|
|
|
|
}
|
2023-12-05 13:23:01 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
const dataHandler = (event) => {
|
|
|
|
|
if(!event.data){
|
|
|
|
|
event.data=event;
|
|
|
|
|
}
|
|
|
|
|
layoutList.data =event.data
|
|
|
|
|
// layoutList.height =event.data.height
|
|
|
|
|
// layoutList.mg_top =event.data.mg_top
|
|
|
|
|
// layoutList.mg_left =event.data.mg_left
|
|
|
|
|
// layoutList.positionDistin =event.data.positionDistin
|
|
|
|
|
// layoutList.movieName =event.data.movieName
|
|
|
|
|
// layoutList.seatList =event.data.seatList
|
|
|
|
|
// console.log(layoutList.seatList.length);
|
|
|
|
|
// layoutList.seatList=JSON.parse(JSON.stringify(event.data.seatList))
|
|
|
|
|
//
|
|
|
|
|
// layoutList=JSON.parse(JSON.stringify(layoutList))
|
|
|
|
|
}
|
|
|
|
|
onMounted(async () => {
|
2023-12-06 16:29:45 +08:00
|
|
|
/* try {
|
2023-12-05 13:23:01 +08:00
|
|
|
const queryParems = { tag: propValue.base.tag }
|
|
|
|
|
console.log("queryParems"+ propValue.base.tag)
|
|
|
|
|
console.log("url"+ propValue.base.url)
|
|
|
|
|
const res = await http.get({ url: propValue.base.url, params: queryParems })
|
|
|
|
|
console.log(res)
|
|
|
|
|
dataHandler(res)
|
|
|
|
|
} catch (error: any) {
|
|
|
|
|
console.log("异常-----")
|
|
|
|
|
console.log(error?.message)
|
2023-12-06 16:29:45 +08:00
|
|
|
}*/
|
2023-12-05 13:23:01 +08:00
|
|
|
})
|
|
|
|
|
const dataChange = (resp: any, _?: string) => {
|
|
|
|
|
|
|
|
|
|
if (!resp || !resp.afterData) {
|
|
|
|
|
console.log("数据失败-----")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (resp.status === 'SUCCESS') {
|
|
|
|
|
console.log(resp.afterData)
|
|
|
|
|
dataHandler(resp.afterData)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
useData(props.component, dataChange)
|
|
|
|
|
useEventBus('globalData', dataHandler)
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
span {
|
|
|
|
|
pointer-events: none;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
width: 100%;
|
|
|
|
|
text-align: center;
|
|
|
|
|
line-height: v-bind(lineHeight);
|
|
|
|
|
}
|
2023-12-06 16:29:45 +08:00
|
|
|
.seatImg0Class {
|
2023-12-06 16:47:25 +08:00
|
|
|
background: #E53240;
|
2023-12-06 16:29:45 +08:00
|
|
|
position: absolute;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
height: 100%;
|
|
|
|
|
border-radius:3px;
|
|
|
|
|
display:block;
|
|
|
|
|
}
|
|
|
|
|
.seatImg1Class {
|
2023-12-06 16:47:25 +08:00
|
|
|
background: #35B45E;
|
2023-12-06 16:29:45 +08:00
|
|
|
position: absolute;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
height: 100%;
|
|
|
|
|
border-radius:3px;
|
|
|
|
|
}
|
|
|
|
|
.seatImg2Class {
|
2023-12-06 16:47:25 +08:00
|
|
|
background-color:#E53240;
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
height: 100%;
|
|
|
|
|
border-radius:3px;
|
|
|
|
|
}
|
|
|
|
|
.seatImg3Class {
|
|
|
|
|
background:#F29961;
|
|
|
|
|
|
2023-12-06 16:29:45 +08:00
|
|
|
position: absolute;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
height: 100%;
|
|
|
|
|
border-radius:3px;
|
|
|
|
|
}
|
|
|
|
|
.title {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 35px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
line-height: 80px;
|
|
|
|
|
font-size: 78px;
|
|
|
|
|
color: #A8F4FF;
|
|
|
|
|
letter-spacing: 2px;
|
|
|
|
|
font-style:normal;
|
|
|
|
|
top:-180px;
|
|
|
|
|
position:absolute;
|
|
|
|
|
}
|
2023-12-05 13:23:01 +08:00
|
|
|
</style>
|