Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dg_book_voice
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
dg_book_voice
Commits
d588e12a
Commit
d588e12a
authored
Jan 13, 2024
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
表单修改
parent
b719705e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
40 deletions
+31
-40
form.component.html
form/src/app/form/form.component.html
+11
-3
form.component.ts
form/src/app/form/form.component.ts
+20
-37
No files found.
form/src/app/form/form.component.html
View file @
d588e12a
...
...
@@ -77,7 +77,7 @@
<div
style=
"display: flex;margin-top: 20px;"
>
<!-- 左右布局 开始 -->
<div
class=
"border-solid"
style=
"min-width: 1000px;"
>
<!-- 内容框体 开始 -->
<div
class=
"word-type-title"
>
单页
{{i+1}}
题目
{{i+1}}
</div>
<!-- <div class="option-audio">
...
...
@@ -107,8 +107,16 @@
</div> -->
<div
style=
"margin-top: 20px;width: 1200px;"
>
<app-custom-hot-zone
[
bgItem
]="
question
.
bgItem
"
[
hotZoneItemArr
]="
question
.
hotZoneItemArr
"
[
customTypeGroupArr
]="
customTypeGroupArr
"
(
save
)="
saveHotZone
(
question
,
$
event
)"
>
<div
style=
"font-size: 30px;"
>
左侧页
</div>
<app-custom-hot-zone
[
bgItem
]="
question
.
leftPage
.
bgItem
"
[
hotZoneItemArr
]="
question
.
leftPage
.
hotZoneItemArr
"
[
customTypeGroupArr
]="
customTypeGroupArr
"
(
save
)="
saveHotZone
(
question
.
leftPage
,
$
event
)"
>
</app-custom-hot-zone>
</div>
<div
style=
"margin-top: 20px;width: 1200px;"
>
<div
style=
"font-size: 30px;"
>
右侧页
</div>
<app-custom-hot-zone
[
bgItem
]="
question
.
rightPage
.
bgItem
"
[
hotZoneItemArr
]="
question
.
rightPage
.
hotZoneItemArr
"
[
customTypeGroupArr
]="
customTypeGroupArr
"
(
save
)="
saveHotZone
(
question
.
rightPage
,
$
event
)"
>
</app-custom-hot-zone>
</div>
...
...
form/src/app/form/form.component.ts
View file @
d588e12a
...
...
@@ -10,7 +10,7 @@ import { NzMessageService } from 'ng-zorro-antd';
})
export
class
FormComponent
extends
ComponentBase
implements
OnInit
,
OnChanges
,
OnDestroy
{
// 储存数据用
saveKey
=
"
dg
04_dyxx
"
;
saveKey
=
"
dg
_book_voice_1001
"
;
/*
整体配置部分解析
...
...
@@ -35,24 +35,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
]
item
=
{
imgAni
:
{
ske
:
{},
tex
:
{},
png
:
{}
},
tipSwitch
:
1
,
//提示功能开关
startAudio
:
""
,
audioName
:
""
,
title
:
"
听音选择
"
,
questions
:
[],
// bgItem: '',
// hotZoneItemArr: [],
// questionText: "",
};
constructor
(
public
nzMessageService
:
NzMessageService
,
public
appRef
:
ApplicationRef
,
public
changeDetectorRef
:
ChangeDetectorRef
)
{
...
...
@@ -81,19 +64,19 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
}
}
remove
o
ption
(
i
,
j
)
{
remove
O
ption
(
i
,
j
)
{
this
.
openDelete
(
"
确定删除选项?
"
,
()
=>
{
this
.
item
.
questions
[
i
].
options
.
splice
(
j
,
1
);
this
.
save
();
})
}
copy
o
ption
(
i
,
j
)
{
copy
O
ption
(
i
,
j
)
{
let
data
=
this
.
item
.
questions
[
i
].
options
[
j
];
this
.
item
.
questions
[
i
].
options
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
data
)));
this
.
save
();
}
add
o
ption
(
i
)
{
add
O
ption
(
i
)
{
this
.
item
.
questions
[
i
].
options
.
push
({
type
:
"
img
"
,
image
:
""
,
...
...
@@ -124,40 +107,40 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
}
addQuestion
()
{
this
.
item
.
questions
.
push
({
// options: [],
leftPage
:
{
bgItem
:
""
,
hotZoneItemArr
:
[],
text
:
""
,
audio
:
""
,
audioName
:
""
},
rightPage
:
{
bgItem
:
""
,
hotZoneItemArr
:
[],
},
options
:
[],
});
// while (this.item.questions[0].options.length < 3) {
// this.addoption(0);
// }
this
.
save
();
}
ngChange
(
i
,
j
)
{
this
.
save
();
}
saveHotZone
(
group
,
e
)
{
saveHotZone
(
question
,
e
)
{
console
.
log
(
'
e:
'
,
e
);
const
{
bgItem
,
hotZoneItemArr
}
=
e
;
group
.
bgItem
=
bgItem
;
group
.
hotZoneItemArr
=
hotZoneItemArr
;
question
.
bgItem
=
bgItem
;
question
.
hotZoneItemArr
=
hotZoneItemArr
;
this
.
nzMessageService
.
success
(
'
保存成功
'
);
this
.
save
();
}
onDragonBoneSave
(
e
,
item
)
{
console
.
log
(
e
);
this
.
save
();
}
dataSave
()
{
this
.
save
();
}
}
\ No newline at end of file
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