Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
JJ_EXAM
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
JJ_EXAM
Commits
d921dd6b
Commit
d921dd6b
authored
Apr 10, 2026
by
JinWei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 允许上传多个封面
parent
8dc46f24
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
6 deletions
+34
-6
form.component.html
src/app/form/form.component.html
+19
-6
form.component.ts
src/app/form/form.component.ts
+15
-0
No files found.
src/app/form/form.component.html
View file @
d921dd6b
...
@@ -33,16 +33,29 @@
...
@@ -33,16 +33,29 @@
</button>
</button>
</div>
</div>
<div
style=
"margin: 20px; display: flex; align-items: center;"
>
<div
style=
"margin: 20px; display: flex; align-items: flex-start;"
>
<h3
style=
"min-width: 150px; text-align:left"
>
封面图片:
</h3>
<h3
style=
"min-width: 150px; text-align:left; line-height: 32px;"
>
封面图片:
</h3>
<app-upload-image-with-preview
style=
"width: 80%; max-width: 640px;"
[
picUrl
]="
item
.
cover
"
<div
style=
"display: flex; flex-wrap: wrap; gap: 15px; flex: 1; max-width: 640px;"
>
(
imageUploaded
)="
onImageUploadSuccess
($
event
)"
>
<div
*
ngFor=
"let url of item.covers; let imgIndex = index"
style=
"width: 200px; position: relative;"
>
<app-upload-image-with-preview
[
picUrl
]="
url
"
[
disableUpload
]="
true
"
>
</app-upload-image-with-preview>
<button
nz-button
nzType=
"danger"
nzShape=
"circle"
nzSize=
"small"
style=
"position: absolute; top: -10px; right: -10px; z-index: 10;"
(
click
)="
onDeleteCoverMultiImg
(
item
,
imgIndex
)"
>
<i
nz-icon
nzType=
"close"
></i>
</button>
</div>
<div
style=
"width: 200px;"
>
<app-upload-image-with-preview
[
picUrl
]="
null
"
[
TIP
]="'点击上传封面'"
(
imageUploaded
)="
onCoverMultiImgUploadSuccess
($
event
,
item
)"
>
</app-upload-image-with-preview>
</app-upload-image-with-preview>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- 题目列表 -->
<!-- 题目列表 -->
<div
*
ngIf=
"item && item.questionArr !== undefined"
style=
"width: 1060px; margin: 30px;"
>
<div
*
ngIf=
"item && item.questionArr !== undefined"
style=
"width: 1060px; margin: 30px;"
>
...
@@ -88,7 +101,7 @@
...
@@ -88,7 +101,7 @@
</span>
</span>
</div>
</div>
<nz-radio-group
[
ngModel
]="
question
.
correctIndex
"
(
ngModelChange
)="
onCorrectAnswerChange
(
question
,
$
event
)"
>
<nz-radio-group
[
ngModel
]="
question
.
correctIndex
"
(
ngModelChange
)="
onCorrectAnswerChange
(
question
,
$
event
)"
style=
"width: 85%;"
>
<div
*
ngFor=
"let option of question.optionArr; let j = index"
<div
*
ngFor=
"let option of question.optionArr; let j = index"
style=
"border: 1px solid; border-radius: 10px; padding: 12px 15px; margin-bottom: 10px; display: flex; align-items: center; gap: 12px;"
style=
"border: 1px solid; border-radius: 10px; padding: 12px 15px; margin-bottom: 10px; display: flex; align-items: center; gap: 12px;"
[
style
.
border-color
]="
question
.
correctIndex =
==
j
?
'#
52c41a
'
:
'#
ddd
'"
[
style
.
border-color
]="
question
.
correctIndex =
==
j
?
'#
52c41a
'
:
'#
ddd
'"
...
...
src/app/form/form.component.ts
View file @
d921dd6b
...
@@ -131,6 +131,21 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
...
@@ -131,6 +131,21 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
this
.
save
();
this
.
save
();
}
}
onCoverMultiImgUploadSuccess
(
e
,
item
,
key
=
'
covers
'
)
{
if
(
!
item
[
key
])
{
item
[
key
]
=
[];
}
item
[
key
].
push
(
e
.
url
);
this
.
save
();
}
onDeleteCoverMultiImg
(
item
,
index
,
key
=
'
covers
'
)
{
if
(
item
[
key
]
&&
item
[
key
][
index
])
{
item
[
key
].
splice
(
index
,
1
);
this
.
save
();
}
}
save
()
{
save
()
{
(
<
any
>
window
).
courseware
.
setData
(
this
.
item
,
null
,
this
.
saveKey
);
(
<
any
>
window
).
courseware
.
setData
(
this
.
item
,
null
,
this
.
saveKey
);
this
.
refresh
();
this
.
refresh
();
...
...
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