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
a15e2609
Commit
a15e2609
authored
Apr 02, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
72f0d618
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
37 deletions
+26
-37
UeEditor.vue
src/components/editor/UeEditor.vue
+26
-37
No files found.
src/components/editor/UeEditor.vue
View file @
a15e2609
...
...
@@ -64,6 +64,7 @@
uploadType
:
"1"
,
//1-上传图片,2-上传附件,3-上传音频
//默认图片域名
defaultImgDomain
:
"http://imgfile.oytour.com/static/"
,
ViewDomain
:
"http://192.168.1.36:8140"
,
};
},
watch
:
{
...
...
@@ -104,7 +105,6 @@
},
//选择文件弹窗
attachmentSelected
(
fileArray
)
{
console
.
log
(
"this.uploadType"
,
this
.
uploadType
)
if
(
fileArray
&&
fileArray
.
length
)
{
let
html
=
''
;
//图片
...
...
@@ -114,18 +114,16 @@
})
}
//附件
else
if
(
this
.
uploadType
==
2
)
{
fileArray
.
forEach
(
item
=>
{
html
+=
this
.
getIconContent
(
item
);
})
}
//音频
else
if
(
this
.
uploadType
==
3
)
{
else
{
fileArray
.
forEach
(
item
=>
{
var
obj
=
this
.
getIcon
(
item
.
fileName
);
html
+=
this
.
getIconContent
(
item
);
if
(
obj
.
fileType
==
4
)
{
html
+=
this
.
audioIframeStr
(
item
);
}
else
if
(
obj
.
fileType
==
1
||
obj
.
fileType
==
2
||
obj
.
fileType
==
3
)
{
html
+=
this
.
fileIframeList
(
item
,
obj
.
fileType
);
}
})
}
if
(
html
&&
html
!=
''
)
{
this
.
ue
.
execCommand
(
'inserthtml'
,
html
);
...
...
@@ -143,7 +141,8 @@
getIcon
(
fileName
)
{
var
obj
=
{
iconUrl
:
""
,
dataType
:
""
dataType
:
""
,
fileType
:
0
,
//1视频,2-pdf,3-word、ppt、xls,4-mp3
}
if
(
!
fileName
)
{
obj
.
iconUrl
=
this
.
defaultImgDomain
+
"file.png"
;
...
...
@@ -155,63 +154,53 @@
obj
.
dataType
=
type
;
if
(
type
===
'video'
||
type
===
'svideo'
)
{
obj
.
iconUrl
=
this
.
defaultImgDomain
+
"video.png"
;
obj
.
fileType
=
1
;
}
else
if
(
type
===
'txt'
||
type
===
'text'
)
{
obj
.
iconUrl
=
this
.
defaultImgDomain
+
"txt.png"
;
}
else
if
(
type
===
'xls'
||
type
===
'xlsx'
)
{
obj
.
iconUrl
=
this
.
defaultImgDomain
+
"excel.png"
;
obj
.
fileType
=
3
;
}
else
if
(
type
===
'doc'
||
type
===
'docx'
)
{
obj
.
iconUrl
=
this
.
defaultImgDomain
+
"word.png"
;
obj
.
fileType
=
3
;
}
else
if
(
type
===
'zip'
||
type
===
'rar'
||
type
===
'gz'
)
{
obj
.
iconUrl
=
this
.
defaultImgDomain
+
"zip.png"
;
}
else
if
(
type
===
'mp3'
)
{
obj
.
iconUrl
=
this
.
defaultImgDomain
+
"sound.png"
;
obj
.
fileType
=
4
;
}
else
if
(
type
===
'pdf'
)
{
obj
.
iconUrl
=
this
.
defaultImgDomain
+
"pdf.png"
;
obj
.
fileType
=
2
;
}
else
if
(
type
===
'ppt'
||
type
===
'pptx'
)
{
obj
.
iconUrl
=
this
.
defaultImgDomain
+
"ppt.png"
;
obj
.
fileType
=
3
;
}
else
if
(
type
===
'avi'
||
type
===
'rmvb'
||
type
===
'3gp'
||
type
===
'mpg'
||
type
===
'mpeg'
||
type
===
'mov'
||
type
===
'wmv'
||
type
===
'asf'
||
type
===
'mkv'
||
type
===
'mp4'
||
type
===
'vob'
||
type
===
'f4v'
||
type
===
'flv'
)
{
obj
.
iconUrl
=
this
.
defaultImgDomain
+
"movie.png"
;
obj
.
fileType
=
1
;
}
else
{
obj
.
iconUrl
=
this
.
defaultImgDomain
+
"unknown.png"
;
}
return
obj
;
},
//音频[MP3]
audioIframeStr
(
data
)
{
var
fileUrl
=
encodeURIComponent
(
data
.
fileUrl
);
return
'<p><iframe height="62px" width="auto" frameborder="0" allowtransparency="true" '
+
' style="background-color:transparent;border-radius: 3px;overflow: hidden;z-index: 0;" scrolling="no" '
+
' src="
http://192.168.1.36:8140/index.html?fileName='
+
data
.
fileName
+
'&url='
+
fileUrl
+
' src="
'
+
this
.
ViewDomain
+
'/index.html?fileName='
+
data
.
fileName
+
'&url='
+
fileUrl
+
'" class="ans-insertaudio-module" module="_insertaudio">'
+
' </iframe></p>'
;
},
//
其他方法
getTypeList
(
data
)
{
//
视频、PDF、WORD、PPT、EXCEL
fileIframeList
(
data
,
fileType
)
{
//视频1 音频 2 ppt/word 3
if
(
this
.
uploadType
==
3
){
var
fileUrl
=
encodeURIComponent
(
data
.
fileUrl
);
return
'<p><iframe height="62px" width="auto" frameborder="0" allowtransparency="true" '
+
' style="background-color:transparent;border-radius: 3px;overflow: hidden;z-index: 0;" scrolling="no" '
+
' src="http://192.168.1.36:8140/read.html?fileName='
+
data
.
fileName
+
'&url='
+
fileUrl
+
'&fileType='
+
2
+
'" class="ans-insertaudio-module" module="_insertaudio">'
+
' </iframe></p>'
;
}
if
(
this
.
uploadType
==
2
){
'<p class="attachNew" ><em style="font-style:normal; display:block;min-height:2px;"></em>'
+
'<span data="'
+
objId
+
'" type="'
+
dataType
+
'" name="'
+
fileName
+
'" contenteditable="false" style="margin-top:10px;background:#F7F8FA;padding:14px 16px;max-width:572px;zoom:1;overflow:hidden;cursor:pointer;display:block;position: relative;" >'
+
'<img src="http://mooc2-ans.chaoxing.com/images/questionbank/icon/'
+
iconName
+
'" style=" width:42px; height:42px; overflow:hidden; margin-right:14px; display:block; border-radius:4px;float:left;">'
+
'<span style=" display:block;min-height:42px; display:table-cell; vertical-align:middle;display:-webkit-box; -webkit-box-pack:center; -webkit-box-orient:vertical; display:-moz-box; -moz-box-pack:center; -moz-box-orient:vertical;">
\
n'
+
'
\
t
\
t<span style=" -webkit-box-flex:1; width:510px
\\
0; display:block; display:-webkit-box; -webkit-box-pack:center; -webkit-box-orient:vertical; display:-moz-box; -moz-box-pack:center; -moz-box-orient:vertical;">
\
n'
+
'
\
t
\
t
\
t<span style=" padding-right:72px; padding-right:0
\\
9; font-size:14px; color:#181E33; line-height:20px; display:block; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">'
+
fileName
+
'</span>
\
n'
+
'
\
t
\
t
\
t<span style=" display:block; padding-right:72px; padding-right:0
\\
9; line-height:18px; margin-top:4px; font-size:12px; color:#A8A8B3; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">'
+
size
+
'</span>
\
n'
+
'
\
t
\
t</span>
\
n'
+
'
\
t</span>
\
n'
+
'</span></p>'
;
}
' src="'
+
this
.
ViewDomain
+
'/read.html?fileName='
+
data
.
fileName
+
'&url='
+
fileUrl
+
'&fileType='
+
fileType
+
'" class="ans-insertaudio-module" module="_insertaudio">'
+
' </iframe></p>'
;
},
loadUe
()
{
const
_this
=
this
;
...
...
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