Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ElectricitySheep
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄媛媛
ElectricitySheep
Commits
d7179cb5
Commit
d7179cb5
authored
Sep 01, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
e091f54c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
38 deletions
+11
-38
materialMan.vue
src/components/CommodityMan/materialMan.vue
+6
-34
index.js
src/plug/index.js
+5
-4
No files found.
src/components/CommodityMan/materialMan.vue
View file @
d7179cb5
...
...
@@ -118,7 +118,7 @@
<div
@
click=
"PageSelect(item,index)"
:class=
"item.Selected ? 'selected' :''"
class=
"el-tooltip item material-item "
>
<img
:src=
"getIconLink(item.
Path)+'?x-oss-process=video/snapshot,t_9,f_jpg,w_299,h_0,m_fast'
"
<img
:src=
"getIconLink(item.
Image)
"
class=
"material-img"
style=
"width: 140px; height: 140px;"
>
<div
class=
"material-video-info"
><i
class=
"el-icon-video-play"
></i>
...
...
@@ -180,10 +180,7 @@
<el-button
size=
"small"
type=
"primary"
@
click=
"pagesubmitForm('addpageMsg')"
>
确 定
</el-button>
</span>
</el-dialog>
<video
width=
"320"
height=
"240"
controls
id=
"upvideo"
style=
"display:none"
>
</video>
<img
:src=
"testImg"
style=
"width:120px;height:60px;border:1px solid red;"
/>
<canvas
id=
'mycanvas'
></canvas>
</div>
</template>
<
script
>
...
...
@@ -249,7 +246,7 @@
checkList
:
[],
checkAllList
:
[],
checkAll
:
false
,
testImg
:
""
imgSrc
:
""
}
},
created
()
{
...
...
@@ -257,33 +254,10 @@
this
.
GetPageList
();
},
mounted
()
{
this
.
findvideocover
(
"http://192.168.2.214:8130/Upload/Video/20200901114120428.mp4"
)
},
methods
:
{
//获取视频封面
findvideocover
(
videoUrl
)
{
let
_this
=
this
;
this
.
$nextTick
(()
=>
{
let
video
=
document
.
getElementById
(
"upvideo"
);
let
source
=
document
.
createElement
(
"source"
);
source
.
src
=
videoUrl
;
source
.
type
=
"video/mp4"
;
video
.
appendChild
(
source
);
video
.
addEventListener
(
"loadeddata"
,
function
()
{
var
canvas
=
document
.
createElement
(
"canvas"
);
canvas
.
width
=
"320"
;
canvas
.
height
=
"320"
;
canvas
.
getContext
(
"2d"
)
.
drawImage
(
video
,
0
,
0
,
canvas
.
width
,
canvas
.
width
);
console
.
log
(
"video"
,
video
);
var
img
=
document
.
createElement
(
"img"
);
let
imgsrc
=
canvas
.
toDataURL
(
"image/png"
);
_this
.
testImg
=
imgsrc
});
});
},
Time
(
value
)
{
var
theTime
=
parseInt
(
value
);
// 秒
var
middle
=
0
;
// 分
...
...
@@ -500,9 +474,7 @@
var
that
=
this
;
this
.
UploadSelfFile
(
this
.
FileType
().
Video
,
file
.
file
,
res
=>
{
if
(
res
.
resultCode
==
1
)
{
if
(
that
.
addpageMsg
.
Type
==
2
)
{
that
.
addpageMsg
.
Image
=
res
.
FileUrl
;
}
that
.
addpageMsg
.
Image
=
res
.
VideoCoverImg
;
that
.
addpageMsg
.
Path
=
res
.
FileUrl
;
that
.
addpageMsg
.
Name
=
res
.
FileName
;
that
.
addPageList
();
...
...
src/plug/index.js
View file @
d7179cb5
...
...
@@ -58,7 +58,7 @@ export default {
let
javaUrl
=
'http://192.168.2.65:8018'
;
domainUrl
=
"http://192.168.0.116:8200"
;
domainUrl
=
"https://localhost:5001"
;
//
domainUrl = "https://localhost:5001";
let
vtUploadUrl
=
"http://192.168.2.214:8120"
;
let
vtViewUrl
=
"http://192.168.2.214:8130"
;
...
...
@@ -87,7 +87,7 @@ export default {
//文件上传自己服务器
VTUploadUrl
:
vtUploadUrl
,
//文件预览自己服务器
VTViewUrl
:
vt
Upload
Url
VTViewUrl
:
vt
View
Url
};
return
obj
;
},
...
...
@@ -150,7 +150,7 @@ export default {
var
that
=
this
;
var
newPath
=
'/Upload/'
+
path
+
"/"
;
var
formData
=
new
FormData
();
var
uploadUrl
=
that
.
domainManager
().
VTUploadUrl
+
"/Upload?filePath="
+
newPath
;
var
uploadUrl
=
that
.
domainManager
().
VTUploadUrl
+
"/Upload?filePath="
+
newPath
+
"&isCreateCover=1"
;
formData
.
append
(
"myfile"
,
file
);
that
.
$http
.
post
(
uploadUrl
,
formData
,
{})
.
then
(
res
=>
{
...
...
@@ -158,7 +158,8 @@ export default {
var
uploadResult
=
{
resultCode
:
1
,
FileName
:
file
.
name
,
FileUrl
:
that
.
domainManager
().
VTViewUrl
+
res
.
data
.
FilePath
FileUrl
:
that
.
domainManager
().
VTViewUrl
+
res
.
data
.
FilePath
,
VideoCoverImg
:
that
.
domainManager
().
VTViewUrl
+
res
.
data
.
VideoCoverImg
}
if
(
callback
)
{
callback
(
uploadResult
);
...
...
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