Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
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
罗超
confucius
Commits
f7104785
Commit
f7104785
authored
Oct 20, 2021
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
a4975f7d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
127 additions
and
49 deletions
+127
-49
ChooseImg.vue
src/pages/teacher/components/ChooseImg.vue
+107
-19
alladdsc.vue
src/pages/teacher/components/alladdsc.vue
+1
-1
addimageText.vue
src/pages/teacher/contribution/addimageText.vue
+19
-29
No files found.
src/pages/teacher/components/ChooseImg.vue
View file @
f7104785
...
...
@@ -8,24 +8,61 @@
<el-button
@
click=
"GetPageList"
slot=
"append"
icon=
"el-icon-search"
></el-button>
</el-input>
</div>
<div
class=
"basefix app-attachment-list"
>
<!--
<div
class=
"app-attachment-item app-attachment-upload"
>
<el-upload
class=
"avatar-uploader"
action=
""
accept=
"image/jpeg,image/gif,image/png,image/bmp"
:show-file-list=
"false"
:http-request=
"UploadImage"
multiple
>
<div
class=
"app-upload"
flex=
"main:center cross:center"
style=
"width: 100px; height: 100px;"
>
<i
class=
"el-icon-upload"
></i>
<!-- type=1 图片 -->
<template
v-if=
"type==1"
>
<div
class=
"basefix app-attachment-list"
>
<!--
<div
class=
"app-attachment-item app-attachment-upload"
>
<el-upload
class=
"avatar-uploader"
action=
""
accept=
"image/jpeg,image/gif,image/png,image/bmp"
:show-file-list=
"false"
:http-request=
"UploadImage"
multiple
>
<div
class=
"app-upload"
flex=
"main:center cross:center"
style=
"width: 100px; height: 100px;"
>
<i
class=
"el-icon-upload"
></i>
</div>
</el-upload>
</div>
-->
<el-tooltip
v-for=
"(item,index) in dataList"
:key=
"index"
class=
"item"
effect=
"dark"
:content=
"item.MediaGroupName"
placement=
"top-start"
>
<div
@
click=
"PageSelect(item)"
:class=
"getChecked(item) ? 'selected' :''"
class=
"el-tooltip item app-attachment-item"
>
<img
:src=
"getIconLink(item.ImageUrl)"
class=
"app-attachment-img"
style=
"width: 100px; height: 100px;"
>
<div
class=
"app-attachment-name"
>
{{
item
.
MediaGroupName
}}
</div>
</div>
</el-upload>
</div>
-->
<el-tooltip
v-for=
"(item,index) in dataList"
:key=
"index"
class=
"item"
effect=
"dark"
:content=
"item.MediaGroupName"
placement=
"top-start"
>
<div
@
click=
"PageSelect(item)"
:class=
"getChecked(item) ? 'selected' :''"
class=
"el-tooltip item app-attachment-item"
>
<img
:src=
"getIconLink(item.ImageUrl)"
class=
"app-attachment-img"
style=
"width: 100px; height: 100px;"
>
<div
class=
"app-attachment-name"
>
{{
item
.
MediaGroupName
}}
</div>
</div>
</el-tooltip>
</div>
</el-tooltip>
</div>
</
template
>
<!-- type2 音频 -->
<
template
v-if=
"type==2"
>
<div
class=
"basefix app-attachment-list"
>
<el-tooltip
v-for=
"(x,y) in dataList"
:key=
"y"
class=
"item"
effect=
"dark"
:content=
"x.MediaGroupName"
placement=
"top-start"
>
<div
@
click=
"PageSelect(x)"
:class=
"getChecked(x) ? 'selected' :''"
class=
"el-tooltip item app-attachment-item"
>
<q-circular-progress
show-value
class=
"text-red q-ma-md"
:max=
'parseInt(x.Minutes)'
size=
"70px"
:thickness=
"0.2"
color=
"light-blue"
track-color=
"grey-3"
@
click
.
stop=
"playVoice(x.Path,y)"
>
<q-icon
name=
"volume_up"
class=
"q-mr-xs"
/>
<span
style=
"font-size: 11px;"
>
</span>
</q-circular-progress>
<div
class=
"app-attachment-name"
>
{{
x
.
MediaGroupName
}}
</div>
</div>
</el-tooltip>
</div>
</
template
>
<!-- type3 视频 -->
<
template
v-if=
"type==3"
>
<div
class=
"basefix app-attachment-list"
>
<el-tooltip
v-for=
"(x,y) in dataList"
:key=
"y"
class=
"item"
effect=
"dark"
:content=
"x.MediaGroupName"
placement=
"top-start"
>
<div
style=
"width:200px;height:150px;padding:10px;"
@
click=
"PageSelect(x)"
:class=
"getChecked(x) ? 'selected' :''"
class=
"el-tooltip item app-attachment-item"
>
<video
width=
"100%"
height=
"100%"
controls=
"controls"
v-if=
"x.Path"
>
<source
:src=
"x.Path"
type=
"video/mp4"
/>
</video>
<div
class=
"app-attachment-name"
>
{{
x
.
MediaGroupName
}}
</div>
</div>
</el-tooltip>
</div>
</
template
>
<div
style=
"padding:0 10px 10px 0"
>
<el-pagination
style=
"text-align:right"
background
:current-page=
"currentPage"
@
current-change=
"handleCurrentChange"
:page-size=
"msg.pageSize"
layout=
"prev, pager, next,jumper"
...
...
@@ -45,9 +82,16 @@
import
{
GetContributeMediumPage
}
from
'../../../api/system/wechat'
;
import
BenzAMRRecorder
from
'benz-amr-recorder'
export
default
{
name
:
'ChooseImg'
,
props
:
{
type
:
{
type
:
Number
,
default
:
null
},
},
data
()
{
return
{
czType
:
0
,
...
...
@@ -68,7 +112,8 @@
selectId
:
-
1
,
emitmsg
:
[],
PageCount
:
0
,
dataList
:[]
dataList
:[],
playRec
:
null
,
//播放对象
}
},
created
()
{},
...
...
@@ -76,9 +121,52 @@
},
mounted
()
{
if
(
this
.
type
){
this
.
msg
.
Type
=
this
.
type
;
}
this
.
GetPageList
();
},
methods
:
{
playVoice
(
_url
,
index
)
{
// TODO 这里暂时没处理 音频播放中暂停
let
vm
=
this
if
(
vm
.
voiceActive
&&
(
vm
.
voiceActive
!=
index
))
{
//如果再放一个点击另一个上一个清0
vm
.
dataList
[
vm
.
voiceActive
].
timevalue
=
0
}
if
(
vm
.
playRec
!==
null
)
{
vm
.
stopPlayVoice
(
index
)
}
vm
.
playRec
=
new
BenzAMRRecorder
()
//⚠️注意跨域问题
vm
.
playRec
.
initWithUrl
(
_url
).
then
(
function
()
{
vm
.
voiceActive
=
index
vm
.
playRec
.
play
()
let
timer
=
setInterval
(()
=>
{
vm
.
dataList
[
index
].
timevalue
+=
0.1
vm
.
$forceUpdate
();
},
100
);
vm
.
playRec
.
onEnded
(
function
()
{
vm
.
voiceActive
=
null
;
vm
.
dataList
[
index
].
timevalue
=
0
clearInterval
(
timer
);
//停止
setTimeout
(()
=>
{
vm
.
$forceUpdate
();
},
1000
);
})
}).
catch
((
e
)
=>
{
vm
.
$message
.
error
(
'播放录音失败'
)
})
},
//停止播放
stopPlayVoice
()
{
if
(
this
.
playRec
)
{
if
(
this
.
playRec
.
isPlaying
())
{
this
.
playRec
.
stop
()
}
}
},
closeDialog
(){
this
.
$emit
(
'closeDia'
);
},
...
...
@@ -98,7 +186,7 @@
var
result
=
{
selectId
:
this
.
emitmsg
[
0
].
selectId
,
url
:
this
.
emitmsg
[
0
].
url
,
Name
:
this
.
emitmsg
[
0
].
Media
Name
Name
:
this
.
emitmsg
[
0
].
Name
};
this
.
$emit
(
'SelectId'
,
result
)
}
...
...
src/pages/teacher/components/alladdsc.vue
View file @
f7104785
...
...
@@ -159,7 +159,7 @@
</div>
<!-- 选择文件 -->
<q-dialog
title=
"选择文件"
v-model=
"getImgChoice"
width=
"1200px"
>
<ChooseImg
@
SelectId=
"SelectId"
@
closeDia=
"getImgChoice=false"
></ChooseImg>
<ChooseImg
@
SelectId=
"SelectId"
:type=
"1"
@
closeDia=
"getImgChoice=false"
></ChooseImg>
</q-dialog>
</div>
</
template
>
...
...
src/pages/teacher/contribution/addimageText.vue
View file @
f7104785
...
...
@@ -86,13 +86,13 @@
本地上传
</el-upload>
</q-item>
<q-item
clickable
v-close-popup
@
click=
"get
ImgChoice=true
"
>
<q-item
clickable
v-close-popup
@
click=
"get
Choice(1)
"
>
从图片库选择
</q-item>
</q-list>
</q-btn-dropdown>
<q-btn
push
label=
"视频"
@
click=
"get
avideo
"
/>
<q-btn
push
label=
"音频"
@
click=
"get
audio
"
/>
<q-btn
push
label=
"视频"
@
click=
"get
Choice(3)
"
/>
<q-btn
push
label=
"音频"
@
click=
"get
Choice(2)
"
/>
<q-btn
push
label=
"超链接"
@
click=
"hyperlinks"
/>
<q-btn
push
label=
"小程序"
/>
</q-btn-group>
...
...
@@ -107,7 +107,7 @@
</div>
<!-- 选择文件 -->
<q-dialog
title=
"选择文件"
v-model=
"getImgChoice"
width=
"1200px"
>
<ChooseImg
@
SelectId=
"SelectId"
@
closeDia=
"getImgChoice=false"
></ChooseImg>
<ChooseImg
@
SelectId=
"SelectId"
:type=
"type"
@
closeDia=
"getImgChoice=false"
></ChooseImg>
</q-dialog>
</div>
</
template
>
...
...
@@ -136,7 +136,8 @@
zIndex
:
99
},
importFileUrl2
:
this
.
domainManager
().
UploadFileUrl2
,
getImgChoice
:
false
getImgChoice
:
false
,
type
:
-
1
}
},
...
...
@@ -144,15 +145,26 @@
},
methods
:
{
getChoice
(
type
){
this
.
getImgChoice
=
true
;
this
.
type
=
type
;
},
//选择图片
SelectId
(
obj
){
console
.
log
(
obj
,
'数据'
);
if
(
obj
){
let
data
=
[{
fileName
:
obj
.
Name
,
fileUrl
:
obj
.
url
}]
this
.
$refs
.
UE_cb
.
instertImage
(
data
)
if
(
this
.
type
==
1
){
this
.
$refs
.
UE_cb
.
instertImage
(
data
)
}
if
(
this
.
type
==
2
){
this
.
$refs
.
UE_cb
.
insertaudio
(
data
)
}
if
(
this
.
type
==
3
){
this
.
$refs
.
UE_cb
.
insertVideo
(
data
)
}
this
.
getImgChoice
=
false
;
}
},
...
...
@@ -167,28 +179,6 @@
this
.
$refs
.
UE_cb
.
instertImage
(
data
)
}
},
onItemClick
()
{
},
getavideo
(){
let
datas
=
{
"title"
:
"测试视频文件"
,
"description"
:
""
,
"down_url"
:
"http:
\
/
\
/203.205.136.113
\
/vweixinp.tc.qq.com
\
/1007_07ec2b9f113343d1985494ee31688230.f10.mp4?vkey=BFF307E7918FE7E2F5F05186CCF66BE375D1AF3ECD6BB02829646BFEFAD1386EDBDA72CAA1756CF47FD935F6944B9E745DC42BCE97E08B0FB8F0604F23258B28A2196CBF8AF10C356ADDB023820898B88B8219D607378B16&sha=0&save=1"
,
"newcat"
:
""
,
"newsubcat"
:
""
,
"tags"
:[],
"cover_url"
:
""
,
"vid"
:
"1007_07ec2b9f113343d1985494ee31688230"
}
let
url
=
datas
.
down_url
console
.
log
(
url
,
'url'
)
url
=
'https://vt-im-bucket.oss-cn-chengdu.aliyuncs.com/EduSystem/Test/Upload/wechatcatalogue/1628560736000_500.mp4'
let
data
=
[{
fileName
:
datas
.
title
,
fileUrl
:
url
}]
this
.
$refs
.
UE_cb
.
insertVideo
(
data
)
},
getaudio
(){
let
url
=
"http://192.168.20.214:8130/EduSystem/Test/Upload/wechatcatalogue/202110180631201650000000015.mp3"
//音频
let
data
=
[{
fileName
:
'测试哈'
,
fileUrl
:
url
}]
this
.
$refs
.
UE_cb
.
insertaudio
(
data
)
},
hyperlinks
(){
//
<
a
target
=
"_blank"
href
=
"http://mp.weixin.qq.com/s?__biz=MzU3OTUwMjg4OQ==&mid=2247489291&idx=1&sn=3c31ecd91398b9ba04baf03451add5bd&chksm=fd64414dca13c85b2e42aa6e8ec071538dccf54edd7d6580fd7f9cfeef67823ce3f6f33e9dd3#rd"
data
-
itemshowtype
=
"0"
tab
=
"innerlink"
>
散步看日本「会津若松」
<
/a
>
let
data
=
[{
...
...
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