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
af175863
Commit
af175863
authored
Jan 22, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
9fe07281
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
17 deletions
+59
-17
UeEditor.vue
src/components/editor/UeEditor.vue
+57
-15
question-upload.vue
src/components/question/question-upload.vue
+2
-2
No files found.
src/components/editor/UeEditor.vue
View file @
af175863
...
@@ -89,32 +89,74 @@
...
@@ -89,32 +89,74 @@
this
.
attachmentDialogVisible
=
false
;
this
.
attachmentDialogVisible
=
false
;
},
},
//选择文件弹窗
//选择文件弹窗
attachmentSelected
(
e
)
{
attachmentSelected
(
fileArray
)
{
if
(
e
.
length
)
{
console
.
log
(
"fileArray"
,
fileArray
);
if
(
fileArray
&&
fileArray
.
length
)
{
let
html
=
''
;
let
html
=
''
;
//图片
if
(
this
.
uploadType
==
1
)
{
if
(
this
.
uploadType
==
1
)
{
for
(
let
i
in
e
)
{
for
(
let
i
in
e
)
{
html
+=
'<img src="'
+
e
[
i
].
fileUrl
+
'" style="max-width: 100%;">'
;
html
+=
'<img src="'
+
e
[
i
].
fileUrl
+
'" style="max-width: 100%;">'
;
}
}
}
}
if
(
this
.
uploadType
==
2
)
{
//附件
if
(
this
.
uploadType
==
2
||
this
.
uploadType
==
3
)
{
for
(
let
i
in
e
)
{
for
(
let
i
in
e
)
{
var
type
=
e
[
i
].
fileName
.
split
(
'.'
)[
1
];
var
type
=
e
[
i
].
fileName
.
split
(
'.'
)[
1
];
if
(
type
==
'xlsx'
||
type
==
'xls'
){
var
imgUrl
=
""
;
html
+=
var
dataName
=
""
;
`<p><span contenteditable="false" style="display:-webkit-box;margin-top:10px;background: #F7F8FA;padding: 14px 16px;max-width: 572px;overflow: hidden;cursor:pointer;-webkit-box-align: center;text-align:left;cursor:pointer;" name="
${
e
[
i
].
fileName
}
" data="xls">`
+
if
(
type
==
'xlsx'
||
type
==
'xls'
)
{
`<img src="http://mooc2-ans.chaoxing.com/images/questionbank/icon/excel.png" style="width:42px; height:42px; overflow:hidden; margin-right:14px;border-radius:4px;"><span style="font-size:14px; color:#181E33; line-height:20px; display:block; overflow:hidden; text-overflow:ellipsis;">
${
e
[
i
].
fileName
}
</span></span></p>`
imgUrl
=
"http://imgfile.oytour.com/static/excel.png"
;
dataName
=
"xls"
;
}
}
if
(
type
==
'txt'
){
if
(
type
==
'txt'
)
{
html
+=
imgUrl
=
"http://imgfile.oytour.com/static/txt.png"
;
`<p><span contenteditable="false" style="display:-webkit-box;margin-top:10px;background: #F7F8FA;padding: 14px 16px;max-width: 572px;overflow: hidden;cursor:pointer;-webkit-box-align: center;text-align:left;cursor:pointer;" name="
${
e
[
i
].
fileName
}
" data="xls">`
+
dataName
=
"txt"
;
`<img src="http://mooc2-ans.chaoxing.com/images/questionbank/icon/txt.png" style="width:42px; height:42px; overflow:hidden; margin-right:14px;border-radius:4px;"><span style="font-size:14px; color:#181E33; line-height:20px; display:block; overflow:hidden; text-overflow:ellipsis;">
${
e
[
i
].
fileName
}
</span></span></p>`
}
}
if
(
type
==
'ppt'
||
type
==
'pptx'
){
if
(
type
==
'ppt'
||
type
==
'pptx'
)
{
html
+=
imgUrl
=
"http://imgfile.oytour.com/static/ppt.png"
;
`<p><span contenteditable="false" style="display:-webkit-box;margin-top:10px;background: #F7F8FA;padding: 14px 16px;max-width: 572px;overflow: hidden;cursor:pointer;-webkit-box-align: center;text-align:left;cursor:pointer;" name="
${
e
[
i
].
fileName
}
" data="xls">`
+
dataName
=
"ppt"
;
`<img src="http://mooc2-ans.chaoxing.com/images/questionbank/icon/ppt.png" style="width:42px; height:42px; overflow:hidden; margin-right:14px;border-radius:4px;"><span style="font-size:14px; color:#181E33; line-height:20px; display:block; overflow:hidden; text-overflow:ellipsis;">
${
e
[
i
].
fileName
}
</span></span></p>`
}
}
if
(
type
==
'doc'
||
type
==
'docx'
)
{
imgUrl
=
"http://imgfile.oytour.com/static/word.png"
;
dataName
=
"doc"
;
}
if
(
type
==
'mp3'
)
{
imgUrl
=
"http://imgfile.oytour.com/static/video.png"
;
dataName
=
"mp3"
;
}
html
+=
`<p><span contenteditable="false" style="display:-webkit-box;margin-top:10px;background: #F7F8FA;padding: 14px 16px;max-width: 572px;overflow: hidden;cursor:pointer;-webkit-box-align: center;text-align:left;cursor:pointer;" name="
${
e
[
i
].
dataName
}
" data="
${
e
[
i
].
fileName
}
">`
+
`<img src="
${
imgUrl
}
" style="width:42px; height:42px; overflow:hidden; margin-right:14px;border-radius:4px;"><span style="font-size:14px; color:#181E33; line-height:20px; display:block; overflow:hidden; text-overflow:ellipsis;">
${
e
[
i
].
fileName
}
</span></span></p>`
}
}
if
(
this
.
uploadType
==
3
)
{
for
(
let
i
in
e
)
{
var
type
=
e
[
i
].
fileName
.
split
(
'.'
)[
1
];
var
imgUrl
=
""
;
var
dataName
=
""
;
if
(
type
==
'xlsx'
||
type
==
'xls'
)
{
imgUrl
=
"http://imgfile.oytour.com/static/excel.png"
;
dataName
=
"xls"
;
}
if
(
type
==
'txt'
)
{
imgUrl
=
"http://imgfile.oytour.com/static/txt.png"
;
dataName
=
"txt"
;
}
if
(
type
==
'ppt'
||
type
==
'pptx'
)
{
imgUrl
=
"http://imgfile.oytour.com/static/ppt.png"
;
dataName
=
"ppt"
;
}
if
(
type
==
'doc'
||
type
==
'docx'
)
{
imgUrl
=
"http://imgfile.oytour.com/static/word.png"
;
dataName
=
"doc"
;
}
html
+=
`<p><span contenteditable="false" style="display:-webkit-box;margin-top:10px;background: #F7F8FA;padding: 14px 16px;max-width: 572px;overflow: hidden;cursor:pointer;-webkit-box-align: center;text-align:left;cursor:pointer;" name="
${
e
[
i
].
dataName
}
" data="
${
e
[
i
].
fileName
}
">`
+
`<img src="
${
imgUrl
}
" style="width:42px; height:42px; overflow:hidden; margin-right:14px;border-radius:4px;"><span style="font-size:14px; color:#181E33; line-height:20px; display:block; overflow:hidden; text-overflow:ellipsis;">
${
e
[
i
].
fileName
}
</span></span></p>`
}
}
}
}
this
.
ue
.
execCommand
(
'inserthtml'
,
html
);
this
.
ue
.
execCommand
(
'inserthtml'
,
html
);
...
...
src/components/question/question-upload.vue
View file @
af175863
...
@@ -52,12 +52,12 @@
...
@@ -52,12 +52,12 @@
<template>
<template>
<span>
第
{{
subIndex
+
1
}}
小题
{{
subItem
.
SubTitle
}}
</span><br
/>
<span>
第
{{
subIndex
+
1
}}
小题
{{
subItem
.
SubTitle
}}
</span><br
/>
</
template
>
</
template
>
<
template
v-if=
"
subItem.QuestionKey=='single'||subItem.QuestionKey=='multiple
'"
<
template
v-if=
"
subItem.QuestionKey=='single'||subItem.QuestionKey=='multiple'|| subItem.QuestionKey=='single-number
'"
v-for=
"childItem in subItem.SubAnwser"
>
v-for=
"childItem in subItem.SubAnwser"
>
<span>
{{
childItem
.
Name
}}
.
{{
childItem
.
Content
}}
</span><br
/>
<span>
{{
childItem
.
Name
}}
.
{{
childItem
.
Content
}}
</span><br
/>
</
template
>
</
template
>
</span>
</span>
<
template
v-if=
"subItem.QuestionKey=='single'||subItem.QuestionKey=='multiple'"
>
<
template
v-if=
"subItem.QuestionKey=='single'||subItem.QuestionKey=='multiple'
|| subItem.QuestionKey=='single-number'
"
>
<template
v-for=
"childItem in subItem.SubAnwser"
>
<template
v-for=
"childItem in subItem.SubAnwser"
>
<span
v-if=
"childItem.IsAnswer"
>
答案:
{{
childItem
.
Name
}}
</span>
<span
v-if=
"childItem.IsAnswer"
>
答案:
{{
childItem
.
Name
}}
</span>
<br
v-if=
"childItem.IsAnswer"
/>
<br
v-if=
"childItem.IsAnswer"
/>
...
...
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