Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
JJ36
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
JJ36
Commits
8de8c5be
Commit
8de8c5be
authored
Jul 30, 2024
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: debug
parent
5641de1e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
115 deletions
+44
-115
.DS_Store
.DS_Store
+0
-0
form.component.html
form/src/app/form/form.component.html
+27
-115
form.component.ts
form/src/app/form/form.component.ts
+17
-0
No files found.
.DS_Store
View file @
8de8c5be
No preview for this file type
form/src/app/form/form.component.html
View file @
8de8c5be
...
...
@@ -83,141 +83,54 @@
</div>
<!-- <div style="margin-top: 5px; display: flex; align-items: center; ">
<span style="">文本:</span>
<input type="text" nz-input [(ngModel)]="ques.text" (blur)="save()" style=" width: 200px;">
</div>
<div style="margin-top: 10px; display: flex; align-items: center;">
<span style="">音频:</span>
<app-audio-recorder [audioUrl]="ques.audio_url"
(audioUploaded)="onItemAudioUploadSuccess($event, ques, 'audio_url')">
</app-audio-recorder>
</div>
<div style="margin-top: 10px; display: flex; ">
<span style="">图片:</span>
<div style="width: 300px;">
<app-upload-image-with-preview [picUrl]="ques.pic_url"
(imageUploaded)="onItemImgUploadSuccess($event, ques, 'pic_url')">
</app-upload-image-with-preview>
</div>
<button *ngIf="ques.pic_url" style="float: right;" nz-button nzType="" (click)="onDeletaImg(ques, 'pic_url')">
x
</button>
</div>
<div style="margin-top: 10px; display: flex; ">
<span style="">视频:</span>
<div style="width: 300px;">
<app-upload-video [videoUrl]="ques.video_url"
(videoUploaded)="onVideoUploadSuccess($event, ques, 'video_url')">
</app-upload-video>
</div>
<button *ngIf="ques.video_url" style="float: right;" nz-button nzType="" (click)="onDeletaImg(ques, 'video_url')">
x
</button>
</div> -->
</div>
<!-- <div style="margin-top:10px; border: 1px #ccc solid; border-radius: 15px; padding: 15px; background-color: rgb(248, 255, 245);">
<h3>设置选项:</h3>
<div style="margin: 10px;">
<div style="display: flex; align-items: center; justify-content:flex-start;">
<span style="margin-right: 20px;">选项类型:</span>
<label style="" nz-checkbox [(ngModel)]="ques.optionTypeText" (ngModelChange)="checkboxChange($event, ques, 'optionTypeText')">文本</label>
<label style="" nz-checkbox [(ngModel)]="ques.optionTypeAudio" (ngModelChange)="checkboxChange($event, ques, 'optionTypeAudio')">音频</label>
<label style="" nz-checkbox [(ngModel)]="ques.optionTypePic" (ngModelChange)="checkboxChange($event, ques, 'optionTypePic')">图片</label>
</div>
</div>
</div>
<div *ngFor="let option of ques.optionArr; let j = index"
style="border: 1px #ccc solid; border-radius: 15px; width: 100%; padding: 30px; ">
<div style="display: flex; align-items: center; justify-content: space-between;">
<div style="display: flex; align-items: center;">
<h4>设置选项-{{j+1}}:</h4>
<div align="center" style="display: flex; align-items: center; justify-content: center;margin-top: -7px;">
<nz-radio-group [ngModel]="option.answer" (ngModelChange)="radioChange($event, option, 'answer')">
<div style="display: flex; flex-wrap: wrap; width: 100%;">
<label style="margin-left: 5px;" nz-radio [nzValue]="'isRight'">{{'正确'}}</label>
<label style="margin-left: 5px;" nz-radio [nzValue]="'isWrong'">{{'错误'}}</label>
</div>
</nz-radio-group>
</div>
</div>
<button style="float:right" nz-button nzType="danger" (click)="deleteOptionBtnClick(ques.optionArr, j)">
x
</button>
</div>
<div
style=
"padding: 30px;"
>
<button
nz-button
nzType=
"dashed"
(
click
)="
addOnePageBtnClick
()"
style=
"width: 200px; height: 100px;"
>
<i
nz-icon
nzType=
"plus-circle"
nzTheme=
"outline"
></i>
添加拖拽项
</button>
</div>
</div>
<div *ngIf="ques.optionTypeText" style="margin-top: 5px; display: flex; align-items: center; ">
<span style="">文本:</span>
<input type="text" nz-input [(ngModel)]="option.text" (blur)="save()" style=" width: 200px;">
</div>
<div *ngIf="ques.optionTypeAudio" style="margin-top: 10px; display: flex; align-items: center;">
<span style="">音频:</span>
<app-audio-recorder [audioUrl]="option.audio_url"
(audioUploaded)="onItemAudioUploadSuccess($event, option, 'audio_url')">
</app-audio-recorder>
</div>
<div *ngIf="ques.optionTypePic" style="margin-top: 10px; display: flex; ">
<span style="">图片:</span>
<div style="width: 300px;">
<app-upload-image-with-preview [picUrl]="option.pic_url"
(imageUploaded)="onItemImgUploadSuccess($event, option, 'pic_url')">
</app-upload-image-with-preview>
</div>
<button *ngIf="option.pic_url" style="float: right;" nz-button nzType="" (click)="onDeletaImg(option, 'pic_url')">
x
</button>
</div>
</div>
</div> --
>
<div
style=
"border: 2px #ccc solid; border-radius: 15px; width: 1000px; margin: 30px"
>
<div
*
ngFor=
"let wrongData of item.wrongArr; let i = index"
style=
"border: 1px #ccc solid; border-radius: 15px; width: 950px; padding: 30px; margin: 30px;"
>
<
!-- <div style="margin-top: 30px
">
<
button nz-button nzType="dashed" (click)="addOneOption(ques)" style="width: 150px; height: 50px;"
>
<i nz-icon nzType="plus-circle" nzTheme="outline"></i
>
添加选项
<
div
style=
"display: flex; align-items: center; justify-content: space-between;
"
>
<
h2>
干扰项-{{i+1}}:
</h2
>
<button
style=
"float: right; margin-right: 0px;"
nz-button
nzType=
"danger"
(
click
)="
deleteWrongBtnClick
(
i
)"
>
删除
</button>
</div> -->
</div>
<div
style=
"border: 1px #ccc solid; border-radius: 15px; padding: 15px; background-color: rgb(255, 250, 243);"
>
<div>
<div
style=
"margin-top: 5px; display: flex; align-items: center; "
>
<span
style=
""
>
文本:
</span>
<input
type=
"text"
nz-input
[(
ngModel
)]="
wrongData
.
text
"
(
blur
)="
save
()"
style=
" width: 300px;"
>
</div>
</div>
</div>
</div>
<div
style=
"padding: 30px;"
>
<button
nz-button
nzType=
"dashed"
(
click
)="
addOne
Page
BtnClick
()"
style=
"width: 200px; height: 100px;"
>
<button
nz-button
nzType=
"dashed"
(
click
)="
addOne
Wrong
BtnClick
()"
style=
"width: 200px; height: 100px;"
>
<i
nz-icon
nzType=
"plus-circle"
nzTheme=
"outline"
></i>
添加
拖拽
项
添加
干扰
项
</button>
</div>
...
...
@@ -227,5 +140,4 @@
</div>
\ No newline at end of file
form/src/app/form/form.component.ts
View file @
8de8c5be
...
...
@@ -800,6 +800,18 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
save
();
}
addOneWrongBtnClick
()
{
if
(
!
this
.
item
.
wrongArr
)
{
this
.
item
.
wrongArr
=
[];
}
this
.
item
.
wrongArr
.
push
(
{}
);
this
.
save
();
}
addOneOption
(
ques
)
{
if
(
!
ques
.
optionArr
)
{
ques
.
optionArr
=
[];
...
...
@@ -824,6 +836,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
save
();
}
deleteWrongBtnClick
(
i
)
{
this
.
item
.
wrongArr
.
splice
(
i
,
1
);
this
.
save
();
}
checkboxChange
(
e
,
it
,
key
)
{
console
.
log
(
'
e:
'
,
e
);
...
...
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