feat: 增加 锁定组件 hover 和 select 样式控制

This commit is contained in:
tnt group 2022-09-28 17:37:09 +08:00
parent abbf678e89
commit e49cf3dea2

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="go-shape-box"> <div class="go-shape-box" :class="{ lock: item.status.lock, hide: item.status.hide }">
<slot></slot> <slot></slot>
<!-- 锚点 --> <!-- 锚点 -->
<template v-if="!hiddenPoint"> <template v-if="!hiddenPoint">
@ -55,12 +55,14 @@ const themeColor = computed(() => {
// //
const hover = computed(() => { const hover = computed(() => {
if (props.item.status.lock) return false
return props.item.id === chartEditStore.getTargetChart.hoverId return props.item.id === chartEditStore.getTargetChart.hoverId
}) })
// //
const select = computed(() => { const select = computed(() => {
const id = props.item.id const id = props.item.id
if (props.item.status.lock) return false
return chartEditStore.getTargetChart.selectId.find((e: string) => e === id) return chartEditStore.getTargetChart.selectId.find((e: string) => e === id)
}) })
</script> </script>
@ -70,6 +72,14 @@ const select = computed(() => {
position: absolute; position: absolute;
cursor: move; cursor: move;
&.lock {
cursor: default !important;
}
&.hide {
display: none;
}
/* 锚点 */ /* 锚点 */
.shape-point { .shape-point {
z-index: 1; z-index: 1;