Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
property-management
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
property-management
Commits
00a8fab2
Commit
00a8fab2
authored
Apr 14, 2022
by
416409548@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ie下获取目标点击坐标异常优化
parent
ae27b7d3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
ant-design-vue-jeecg/src/views/pm/access-control-device/modules/PmAccessControlDeviceForm.vue
+10
-12
No files found.
ant-design-vue-jeecg/src/views/pm/access-control-device/modules/PmAccessControlDeviceForm.vue
View file @
00a8fab2
...
@@ -321,24 +321,22 @@ export default {
...
@@ -321,24 +321,22 @@ export default {
},
},
imgClick
(
e
)
{
imgClick
(
e
)
{
// 获取点击目标的x,y坐标
// 获取点击目标的x,y坐标
// let target = e.target;
let
event
=
e
||
window
.
event
;
var
event
=
e
||
window
.
event
;
let
target
=
event
.
target
||
event
.
srcElement
;
var
target
=
event
.
target
||
event
.
srcElement
;
console
.
log
(
target
.
pageX
);
let
fixX
=
this
.
$refs
.
imgBg
.
getBoundingClientRect
().
left
;
let
fixX
=
this
.
$refs
.
imgBg
.
getBoundingClientRect
().
left
;
let
fixY
=
this
.
$refs
.
imgBg
.
getBoundingClientRect
().
top
;
let
fixY
=
this
.
$refs
.
imgBg
.
getBoundingClientRect
().
top
;
// let fixX = target.x
;
let
scrollX
=
document
.
documentElement
.
scrollLeft
||
document
.
body
.
scrollLeft
;
// let fixY = target.y
;
let
scrollY
=
document
.
documentElement
.
scrollTop
||
document
.
body
.
scrollTop
;
console
.
log
(
fixX
,
fixY
)
;
let
eventx
=
e
.
pageX
-
scrollX
||
e
.
clientX
;
// console.log(e.x, e.y)
;
let
eventy
=
e
.
pageY
-
scrollY
||
e
.
clientY
;
let
offsetWidth
=
target
.
offsetWidth
;
let
offsetWidth
=
target
.
offsetWidth
;
let
offsetHeight
=
target
.
offsetHeight
;
let
offsetHeight
=
target
.
offsetHeight
;
let
offsetX
=
(
event
.
x
-
fixX
);
let
offsetX
=
(
eventx
-
fixX
);
let
offsetY
=
(
event
.
y
-
fixY
);
let
offsetY
=
(
eventy
-
fixY
);
this
.
doorIconStyle
.
top
=
offsetY
-
20
+
'px'
;
this
.
doorIconStyle
.
top
=
offsetY
-
20
+
'px'
;
this
.
doorIconStyle
.
left
=
offsetX
-
20
+
'px'
;
this
.
doorIconStyle
.
left
=
offsetX
-
20
+
'px'
;
let
x
=
((
event
.
x
-
fixX
)
/
offsetWidth
).
toFixed
(
4
);
let
x
=
((
eventx
-
fixX
)
/
offsetWidth
).
toFixed
(
4
);
let
y
=
((
event
.
y
-
fixY
)
/
offsetHeight
).
toFixed
(
4
);
let
y
=
((
eventy
-
fixY
)
/
offsetHeight
).
toFixed
(
4
);
this
.
model
.
coordinateTmp
=
x
+
","
+
y
;
this
.
model
.
coordinateTmp
=
x
+
","
+
y
;
this
.
$refs
.
form
.
validateField
(
'coordinateTmp'
);
this
.
$refs
.
form
.
validateField
(
'coordinateTmp'
);
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment