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
5e998af5
Commit
5e998af5
authored
Mar 19, 2026
by
JinWei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新增复制按钮
parent
ce5d5dad
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
form.component.html
src/app/form/form.component.html
+4
-1
form.component.ts
src/app/form/form.component.ts
+10
-2
No files found.
src/app/form/form.component.html
View file @
5e998af5
...
...
@@ -47,8 +47,11 @@
<!-- 题目头部 -->
<div
style=
"display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #eee;"
>
<h3
style=
"margin: 0; color: #333;"
>
第 {{i+1}} 题
</h3>
<div
style=
"display: flex; gap: 8px;"
>
<button
nz-button
(
click
)="
copyQuestion
(
i
)"
>
复制题目
</button>
<button
nz-button
nzType=
"danger"
(
click
)="
deleteQuestion
(
i
)"
>
删除题目
</button>
</div>
</div>
<!-- 题目图片 -->
<div
style=
"margin-bottom: 15px; display: flex; align-items: flex-start; gap: 15px;"
>
...
...
src/app/form/form.component.ts
View file @
5e998af5
...
...
@@ -65,10 +65,12 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
if
(
!
this
.
item
.
questionArr
)
{
this
.
item
.
questionArr
=
[];
}
const
defaultOptions
=
[{},
{}];
this
.
syncOptionKeys
(
defaultOptions
);
this
.
item
.
questionArr
.
push
({
text
:
""
,
correctIndex
:
null
,
optionArr
:
[]
correctIndex
:
0
,
optionArr
:
defaultOptions
});
this
.
save
();
}
...
...
@@ -78,6 +80,12 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
this
.
save
();
}
copyQuestion
(
i
:
number
)
{
const
copy
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
item
.
questionArr
[
i
]));
this
.
item
.
questionArr
.
push
(
copy
);
this
.
save
();
}
onCorrectAnswerChange
(
question
:
any
,
index
:
number
)
{
question
.
correctIndex
=
index
;
this
.
save
();
...
...
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