Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
school-paper-admin-front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
school-paper
school-paper-admin-front
Commits
ad73f2de
Commit
ad73f2de
authored
Jul 24, 2023
by
裴梁博
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/v1/plb' into 'feature/v1/zmj'
Feature/v1/plb See merge request
!1
parents
837b90ca
d4a680a5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
19 deletions
+51
-19
src/components/Editor/index.vue
+12
-5
src/views/school-paper/questionBank/index.vue
+39
-14
No files found.
src/components/Editor/index.vue
View file @
ad73f2de
...
...
@@ -56,13 +56,19 @@ export default {
type
:
{
type
:
String
,
default
:
"url"
,
}
},
iconType
:
{
type
:
Array
,
default
:
()
=>
{
return
[
"link"
,
"image"
,
"video"
];
// 链接、图片、视频
},
},
},
data
()
{
return
{
uploadUrl
:
process
.
env
.
VUE_APP_BASE_API
+
"/system/oss/upload"
,
// 上传的图片服务器地址
headers
:
{
Authorization
:
"Bearer "
+
getToken
()
Authorization
:
"Bearer "
+
getToken
()
,
},
Quill
:
null
,
currentValue
:
""
,
...
...
@@ -82,7 +88,7 @@ export default {
[{
color
:
[]
},
{
background
:
[]
}],
// 字体颜色、字体背景颜色
[{
align
:
[]
}],
// 对齐方式
[
"clean"
],
// 清除文本格式
[
"link"
,
"image"
,
"video"
]
// 链接、图片、视频
this
.
iconType
,
// 链接、图片、视频
],
},
placeholder
:
"请输入内容"
,
...
...
@@ -126,7 +132,7 @@ export default {
const
editor
=
this
.
$refs
.
editor
;
this
.
Quill
=
new
Quill
(
editor
,
this
.
options
);
// 如果设置了上传地址则自定义图片上传事件
if
(
this
.
type
==
'url'
)
{
if
(
this
.
type
==
"url"
)
{
let
toolbar
=
this
.
Quill
.
getModule
(
"toolbar"
);
toolbar
.
addHandler
(
"image"
,
(
value
)
=>
{
this
.
uploadType
=
"image"
;
...
...
@@ -191,7 +197,8 @@ export default {
</
script
>
<
style
>
.editor
,
.ql-toolbar
{
.editor
,
.ql-toolbar
{
white-space
:
pre-wrap
!important
;
line-height
:
normal
!important
;
}
...
...
src/views/school-paper/questionBank/index.vue
View file @
ad73f2de
...
...
@@ -237,7 +237,7 @@
>
</div>
<div
class=
"app-container-list-item-footer"
>
<el-button
icon=
"el-icon-edit-outline"
>
编辑
</el-button>
<el-button
icon=
"el-icon-
edit-
delete"
>
删除
</el-button>
<el-button
icon=
"el-icon-delete"
>
删除
</el-button>
</div>
</div>
</div>
...
...
@@ -311,7 +311,14 @@
/>
<!-- 添加或修改题库主对话框 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"70%"
append-to-body
>
<
template
v-if=
"open"
>
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"70%"
append-to-body
destroy-on-close
>
<el-form
ref=
"form"
:model=
"form"
...
...
@@ -407,11 +414,19 @@
</el-col>
<el-col
:span=
"18"
>
<el-form-item
label=
"题目"
prop=
"topic"
>
<editor
v-model=
"form.topic"
:min-height=
"192"
/>
<editor
v-model=
"form.topic"
:min-height=
"192"
:iconType=
"['image']"
/>
</el-form-item>
<template
v-if=
"[1, '1', 3, '3'].includes(form.species)"
>
<el-form-item
label=
"答案"
prop=
"answer"
>
<editor
v-model=
"form.answer"
:min-height=
"192"
/>
<editor
v-model=
"form.answer"
:min-height=
"192"
:iconType=
"['image']"
/>
</el-form-item>
<el-form-item
label=
"答案图片"
prop=
"rightAnswersPic"
>
<imageUpload
:limit=
"9"
v-model=
"form.rightAnswersPic"
/>
...
...
@@ -443,7 +458,11 @@
v-else
@
click=
"clickCheckItemDel(index)"
></i>
<editor
v-model=
"item.html"
:min-height=
"192"
/>
<editor
v-model=
"item.html"
:min-height=
"192"
:iconType=
"['image']"
/>
</div>
</div>
</el-form-item>
...
...
@@ -472,13 +491,17 @@
</el-form-item>
<
template
v-if=
"form.explain"
>
<el-form-item
label=
"解答过程"
prop=
"resolveCourse"
>
<editor
v-model=
"form.resolveCourse"
:min-height=
"192"
/>
<editor
v-model=
"form.resolveCourse"
:min-height=
"192"
:iconType=
"['image']"
/>
</el-form-item>
<el-form-item
label=
"解答视频"
prop=
"resolveVideo"
>
<fileUpload
v-model=
"form.resolveVideo"
:limit=
"1"
:fileSize=
"10000
"
:fileSize=
"1024
"
:fileType=
"['mp4', 'mp3']"
/>
</el-form-item>
...
...
@@ -496,6 +519,7 @@
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
</template>
</div>
</template>
...
...
@@ -760,7 +784,7 @@ export default {
isKong
=
false
;
if
(
index
<
25
)
{
self
.
form
.
checkList
.
forEach
((
item
,
ik
)
=>
{
if
(
self
.
IsEmptyStr
(
self
.
getWangEditorText
(
item
.
html
+
''
)
+
""
))
{
if
(
self
.
IsEmptyStr
(
self
.
getWangEditorText
(
item
.
html
+
""
)
+
""
))
{
isKong
=
true
;
}
});
...
...
@@ -839,7 +863,7 @@ export default {
});
},
getWangEditorText
(
str
)
{
console
.
log
(
str
,
"========str"
)
console
.
log
(
str
,
"========str"
);
if
(
str
)
{
return
str
.
replace
(
/<
[^
<p>
]
+>/g
,
""
)
// 将所有
<
p
>
标签
replace
''
...
...
@@ -859,18 +883,19 @@ export default {
},
/** 提交按钮 */
submitForm
()
{
let
self
=
this
,
isKong
=
false
;
let
self
=
this
,
isKong
=
false
;
self
.
isEditor
(
"topic"
);
if
(
self
.
form
.
checkList
&&
self
.
form
.
checkList
.
length
)
{
if
(
self
.
form
.
checkList
&&
self
.
form
.
checkList
.
length
)
{
self
.
form
.
checkList
.
forEach
((
item
,
ik
)
=>
{
console
.
log
(
item
.
html
)
if
(
self
.
IsEmptyStr
(
self
.
getWangEditorText
(
item
.
html
+
''
)
+
""
))
{
console
.
log
(
item
.
html
)
;
if
(
self
.
IsEmptyStr
(
self
.
getWangEditorText
(
item
.
html
+
""
)
+
""
))
{
isKong
=
true
;
}
});
if
(
isKong
)
{
self
.
$message
.
warning
(
"请填写选项内容"
);
self
.
$refs
.
form
.
validateField
(
'checkList'
);
self
.
$refs
.
form
.
validateField
(
"checkList"
);
}
}
if
(
self
.
form
.
explain
)
{
...
...
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