Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ai-yunshou-vue
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AI云守
ai-yunshou-vue
Commits
657abc7f
Commit
657abc7f
authored
Aug 14, 2024
by
wp song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
点位管理
parent
f98e1f1c
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
654 additions
and
371 deletions
+654
-371
src/assets/movie.mp4
src/assets/movie.mp4
+0
-0
src/views/videoControl/pointControl/components/drawPoint.vue
src/views/videoControl/pointControl/components/drawPoint.vue
+331
-151
src/views/videoControl/pointControl/hooks/index.js
src/views/videoControl/pointControl/hooks/index.js
+69
-38
src/views/videoControl/pointControl/index.scss
src/views/videoControl/pointControl/index.scss
+20
-6
src/views/videoControl/pointControl/index.vue
src/views/videoControl/pointControl/index.vue
+215
-176
src/views/videoControl/pointControl/utils/index.js
src/views/videoControl/pointControl/utils/index.js
+19
-0
No files found.
src/assets/movie.mp4
0 → 100644
View file @
657abc7f
File added
src/views/videoControl/pointControl/components/drawPoint.vue
View file @
657abc7f
This diff is collapsed.
Click to expand it.
src/views/videoControl/pointControl/hooks/index.js
View file @
657abc7f
import
{
onMounted
,
ref
,
watch
}
from
"
vue
"
;
import
{
onMounted
,
ref
,
watch
}
from
"
vue
"
;
import
request
from
"
@/utils/request
"
;
import
request
from
"
@/utils/request
"
;
import
{
ElMessageBox
}
from
"
element-plus
"
;
import
{
ElMessageBox
}
from
"
element-plus
"
;
function
useIndex
(
apis
)
{
function
useIndex
(
apis
,
callback
)
{
const
visible
=
ref
(
false
);
const
visible
=
ref
(
false
);
const
search
=
ref
({});
const
form
=
ref
({
const
form
=
ref
({
regionName
:
''
regionName
:
""
,
});
});
const
list
=
ref
([]);
const
list
=
ref
([]);
const
page
=
ref
({
pageNum
:
1
,
pageSize
:
10
,
total
:
0
,
});
watch
(
watch
(
()
=>
visible
,
()
=>
visible
.
value
,
(
newVal
)
=>
{
(
newVal
)
=>
{
if
(
newVal
==
false
)
{
if
(
newVal
==
false
)
{
form
.
value
=
{};
form
.
value
=
{};
}
}
}
}
);
);
function
toView
()
{}
watch
([()
=>
page
.
value
.
pageNum
,
()
=>
page
.
value
.
pageSize
],
(
val
)
=>
{
getList
();
});
function
toEdit
(
data
)
{
function
toEdit
(
data
)
{
getDetail
(
data
.
id
);
getDetail
(
data
.
id
);
visible
.
value
=
true
;
visible
.
value
=
true
;
...
@@ -25,24 +33,31 @@ function useIndex(apis) {
...
@@ -25,24 +33,31 @@ function useIndex(apis) {
function
toAdd
()
{
function
toAdd
()
{
visible
.
value
=
true
;
visible
.
value
=
true
;
}
}
function
toDel
(
data
)
{
function
toDel
(
data
,
immclose
=
true
)
{
//弹框确认
//弹框确认
ElMessageBox
.
confirm
(
"
是否删除该区域?
"
).
then
(()
=>
{
return
new
Promise
((
resolve
)
=>
{
request
({
ElMessageBox
.
confirm
(
"
是否删除?
"
).
then
(()
=>
{
url
:
apis
.
delete
+
data
.
id
,
request
({
method
:
"
delete
"
,
url
:
apis
.
delete
+
data
.
id
,
}).
then
((
res
)
=>
{
method
:
"
delete
"
,
visible
.
value
=
false
;
}).
then
((
res
)
=>
{
getList
();
if
(
immclose
)
{
visible
.
value
=
false
;
getList
();
}
resolve
();
});
});
});
});
});
}
}
function
getList
()
{
function
getList
(
params
)
{
request
({
request
({
url
:
apis
.
list
,
url
:
apis
.
list
,
method
:
"
get
"
,
method
:
"
get
"
,
params
:
{
...
params
,
...
page
.
value
,
...
search
.
value
},
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
list
.
value
=
res
.
data
;
list
.
value
=
res
.
data
||
res
.
rows
;
page
.
value
.
total
=
res
.
total
;
});
});
}
}
function
getDetail
(
id
)
{
function
getDetail
(
id
)
{
...
@@ -50,50 +65,66 @@ function useIndex(apis) {
...
@@ -50,50 +65,66 @@ function useIndex(apis) {
url
:
apis
.
detail
+
id
,
url
:
apis
.
detail
+
id
,
method
:
"
get
"
,
method
:
"
get
"
,
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
callback
&&
callback
(
res
);
form
.
value
=
res
.
data
;
form
.
value
=
res
.
data
;
return
res
;
});
});
}
}
function
toSubmit
()
{
function
toSubmit
(
immclose
=
true
)
{
if
(
form
.
value
.
id
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
request
({
if
(
form
.
value
.
id
)
{
url
:
apis
.
edit
,
request
({
method
:
"
put
"
,
url
:
apis
.
edit
,
data
:
form
.
value
,
method
:
"
put
"
,
}).
then
((
res
)
=>
{
data
:
form
.
value
,
visible
.
value
=
false
;
}).
then
((
res
)
=>
{
getList
();
if
(
immclose
)
{
});
visible
.
value
=
false
;
}
else
{
getList
();
request
({
}
url
:
apis
.
add
,
resolve
();
method
:
"
post
"
,
});
data
:
form
.
value
,
}
else
{
}).
then
((
res
)
=>
{
request
({
visible
.
value
=
false
;
url
:
apis
.
add
,
getList
();
method
:
"
post
"
,
});
data
:
form
.
value
,
}
}).
then
((
res
)
=>
{
if
(
immclose
)
{
visible
.
value
=
false
;
getList
();
}
resolve
();
});
}
});
}
}
function
toClose
()
{
function
toClose
()
{
visible
.
value
=
false
;
visible
.
value
=
false
;
}
}
function
toOpen
()
{
visible
.
value
=
false
;
}
onMounted
(()
=>
{
onMounted
(()
=>
{
getList
();
if
(
apis
.
list
)
{
getList
();
}
});
});
return
{
return
{
visible
,
visible
,
form
,
form
,
list
,
list
,
toView
,
page
,
toEdit
,
toEdit
,
toAdd
,
toAdd
,
toDel
,
toDel
,
getDetail
,
getDetail
,
toClose
,
toClose
,
toSubmit
,
toSubmit
,
getList
,
toOpen
,
};
};
}
}
...
...
src/views/videoControl/pointControl/index.scss
View file @
657abc7f
.areaNodes
{
.areaNodes
{
display
:
flex
;
display
:
flex
;
justify-content
:
space-between
;
justify-content
:
space-between
;
align-items
:
center
;
align-items
:
center
;
width
:
100%
;
width
:
100%
;
}
}
\ No newline at end of file
.pagination-right
{
display
:
flex
;
justify-content
:
flex-end
;
width
:
100%
;
margin-top
:
20px
;
}
.el-tree
{
:deep
(
.is-current
)
{
&
>
.el-tree-node__content
{
background-color
:
var
(
--
el-color-primary-light-9
);
}
}
}
src/views/videoControl/pointControl/index.vue
View file @
657abc7f
This diff is collapsed.
Click to expand it.
src/views/videoControl/pointControl/utils/index.js
0 → 100644
View file @
657abc7f
// 随机生成十个颜色
export
const
colors
=
()
=>
{
const
r
=
Math
.
floor
(
Math
.
random
()
*
256
);
const
g
=
Math
.
floor
(
Math
.
random
()
*
256
);
const
b
=
Math
.
floor
(
Math
.
random
()
*
256
);
const
a
=
0.8
;
return
`rgba(
${
r
}
,
${
g
}
,
${
b
}
,
${
a
}
)`
;
};
export
function
drawImage
(
video
){
const
img
=
video
;
const
canvas
=
document
.
getElementById
(
'
canvas
'
);
const
ctx
=
canvas
.
getContext
(
'
2d
'
);
canvas
.
width
=
img
.
offsetWidth
;
canvas
.
height
=
img
.
offsetHeight
;
ctx
.
drawImage
(
img
,
0
,
0
,
canvas
.
width
,
canvas
.
height
);
// 绘制图片
return
canvas
.
toDataURL
(
"
image/jpg
"
)
}
\ No newline at end of file
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