forked from github/dataease
Merge pull request #8198 from dataease/pr@dev-v2@fix_markline2
fix(数据大屏): 修复对标线未显示问题
This commit is contained in:
commit
bcade9567f
@ -26,7 +26,7 @@ const hideLine = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const showLine = (isDownward, isRightward) => {
|
const showLine = (isDownward, isRightward) => {
|
||||||
const lines = currentInstance.ctx.$refs
|
const linesRef = currentInstance.ctx.$refs
|
||||||
const components = componentData.value
|
const components = componentData.value
|
||||||
const curComponentStyle = getComponentRotatedStyle(curComponent.value.style)
|
const curComponentStyle = getComponentRotatedStyle(curComponent.value.style)
|
||||||
const curComponentHalfWidth = curComponentStyle.width / 2
|
const curComponentHalfWidth = curComponentStyle.width / 2
|
||||||
@ -44,14 +44,14 @@ const showLine = (isDownward, isRightward) => {
|
|||||||
top: [
|
top: [
|
||||||
{
|
{
|
||||||
isNearly: isNearly(curComponentStyle.top, top),
|
isNearly: isNearly(curComponentStyle.top, top),
|
||||||
lineNode: lines.xt[0], // xt
|
lineNode: linesRef.xt[0], // xt
|
||||||
line: 'xt',
|
line: 'xt',
|
||||||
dragShift: top,
|
dragShift: top,
|
||||||
lineShift: top
|
lineShift: top
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
isNearly: isNearly(curComponentStyle.bottom, top),
|
isNearly: isNearly(curComponentStyle.bottom, top),
|
||||||
lineNode: lines.xt[0], // xt
|
lineNode: linesRef.xt[0], // xt
|
||||||
line: 'xt',
|
line: 'xt',
|
||||||
dragShift: top - curComponentStyle.height,
|
dragShift: top - curComponentStyle.height,
|
||||||
lineShift: top
|
lineShift: top
|
||||||
@ -62,21 +62,21 @@ const showLine = (isDownward, isRightward) => {
|
|||||||
curComponentStyle.top + curComponentHalfHeight,
|
curComponentStyle.top + curComponentHalfHeight,
|
||||||
top + componentHalfHeight
|
top + componentHalfHeight
|
||||||
),
|
),
|
||||||
lineNode: lines.xc[0], // xc
|
lineNode: linesRef.xc[0], // xc
|
||||||
line: 'xc',
|
line: 'xc',
|
||||||
dragShift: top + componentHalfHeight - curComponentHalfHeight,
|
dragShift: top + componentHalfHeight - curComponentHalfHeight,
|
||||||
lineShift: top + componentHalfHeight
|
lineShift: top + componentHalfHeight
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
isNearly: isNearly(curComponentStyle.top, bottom),
|
isNearly: isNearly(curComponentStyle.top, bottom),
|
||||||
lineNode: lines.xb[0], // xb
|
lineNode: linesRef.xb[0], // xb
|
||||||
line: 'xb',
|
line: 'xb',
|
||||||
dragShift: bottom,
|
dragShift: bottom,
|
||||||
lineShift: bottom
|
lineShift: bottom
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
isNearly: isNearly(curComponentStyle.bottom, bottom),
|
isNearly: isNearly(curComponentStyle.bottom, bottom),
|
||||||
lineNode: lines.xb[0], // xb
|
lineNode: linesRef.xb[0], // xb
|
||||||
line: 'xb',
|
line: 'xb',
|
||||||
dragShift: bottom - curComponentStyle.height,
|
dragShift: bottom - curComponentStyle.height,
|
||||||
lineShift: bottom
|
lineShift: bottom
|
||||||
@ -85,14 +85,14 @@ const showLine = (isDownward, isRightward) => {
|
|||||||
left: [
|
left: [
|
||||||
{
|
{
|
||||||
isNearly: isNearly(curComponentStyle.left, left),
|
isNearly: isNearly(curComponentStyle.left, left),
|
||||||
lineNode: lines.yl[0], // yl
|
lineNode: linesRef.yl[0], // yl
|
||||||
line: 'yl',
|
line: 'yl',
|
||||||
dragShift: left,
|
dragShift: left,
|
||||||
lineShift: left
|
lineShift: left
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
isNearly: isNearly(curComponentStyle.right, left),
|
isNearly: isNearly(curComponentStyle.right, left),
|
||||||
lineNode: lines.yl[0], // yl
|
lineNode: linesRef.yl[0], // yl
|
||||||
line: 'yl',
|
line: 'yl',
|
||||||
dragShift: left - curComponentStyle.width,
|
dragShift: left - curComponentStyle.width,
|
||||||
lineShift: left
|
lineShift: left
|
||||||
@ -103,21 +103,21 @@ const showLine = (isDownward, isRightward) => {
|
|||||||
curComponentStyle.left + curComponentHalfWidth,
|
curComponentStyle.left + curComponentHalfWidth,
|
||||||
left + componentHalfWidth
|
left + componentHalfWidth
|
||||||
),
|
),
|
||||||
lineNode: lines.yc[0], // yc
|
lineNode: linesRef.yc[0], // yc
|
||||||
line: 'yc',
|
line: 'yc',
|
||||||
dragShift: left + componentHalfWidth - curComponentHalfWidth,
|
dragShift: left + componentHalfWidth - curComponentHalfWidth,
|
||||||
lineShift: left + componentHalfWidth
|
lineShift: left + componentHalfWidth
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
isNearly: isNearly(curComponentStyle.left, right),
|
isNearly: isNearly(curComponentStyle.left, right),
|
||||||
lineNode: lines.yr[0], // yr
|
lineNode: linesRef.yr[0], // yr
|
||||||
line: 'yr',
|
line: 'yr',
|
||||||
dragShift: right,
|
dragShift: right,
|
||||||
lineShift: right
|
lineShift: right
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
isNearly: isNearly(curComponentStyle.right, right),
|
isNearly: isNearly(curComponentStyle.right, right),
|
||||||
lineNode: lines.yr[0], // yr
|
lineNode: linesRef.yr[0], // yr
|
||||||
line: 'yr',
|
line: 'yr',
|
||||||
dragShift: right - curComponentStyle.width,
|
dragShift: right - curComponentStyle.width,
|
||||||
lineShift: right
|
lineShift: right
|
||||||
|
Loading…
Reference in New Issue
Block a user