Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hy04_pinci
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
hy04_pinci
Commits
a328c39d
Commit
a328c39d
authored
Jun 15, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
表上传
parent
07b64184
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
111 additions
and
112 deletions
+111
-112
form.component.html
form/src/app/form/form.component.html
+93
-88
form.component.ts
form/src/app/form/form.component.ts
+18
-24
No files found.
form/src/app/form/form.component.html
View file @
a328c39d
This diff is collapsed.
Click to expand it.
form/src/app/form/form.component.ts
View file @
a328c39d
...
...
@@ -9,23 +9,18 @@ import { MetaFormCreator } from './mataFormCreator';
})
export
class
FormComponent
extends
ComponentBase
implements
OnInit
,
OnChanges
,
OnDestroy
{
// 储存数据用
saveKey
=
"
hy
01_danci
"
;
saveKey
=
"
hy
_04
"
;
item
=
{
recordFla
g
:
false
,
onlineFl
g
:
false
,
title
:
""
,
questionText
:
""
,
questionTextAudio
:
""
,
questions
:
[{
questionAudio
:
""
,
duration
:
120
,
options
:
[]
}],
questions
:
[],
bgAudio
:
""
,
bgAudioName
:
""
,
audioName
:
""
};
isVisible
=
false
;
deleteTitle
=
"
是否删除题目
"
;
deleteCallback
=
function
()
{
};
...
...
@@ -44,31 +39,25 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
init
():
void
{
console
.
log
(
new
MetaFormCreator
().
create
());
/* console.log(new MetaFormCreator().create()); */
}
removeoption
(
i
,
j
)
{
this
.
openDelete
(
"
确定
删除
选项?
"
,
()
=>
{
this
.
item
.
questions
[
i
].
options
.
splice
(
j
,
1
);
this
.
openDelete
(
"
确定
减少
选项?
"
,
()
=>
{
this
.
item
.
questions
[
i
].
letterList
.
splice
(
j
,
1
);
this
.
save
();
})
}
copyOption
(
i
,
j
)
{
let
data
=
this
.
item
.
questions
[
i
].
options
[
j
];
this
.
item
.
questions
[
i
].
options
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
data
)));
let
data
=
this
.
item
.
questions
[
i
].
letterList
[
j
];
this
.
item
.
questions
[
i
].
letterList
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
data
)));
this
.
save
();
}
addoption
(
i
)
{
this
.
item
.
questions
[
i
].
options
.
push
({
type
:
""
,
image
:
""
,
audio
:
""
,
text
:
""
,
duration
:
''
,
content
:
''
,
right
:
false
});
this
.
item
.
questions
[
i
].
letterList
.
push
({
text
:
''
})
this
.
save
();
}
...
...
@@ -83,7 +72,12 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
this
.
item
.
questions
.
push
({
questionAudio
:
""
,
duration
:
120
,
options
:
[]
type
:
"
img
"
,
image
:
""
,
audio
:
""
,
text
:
""
,
right
:
false
,
letterList
:
[],
});
this
.
save
();
}
...
...
@@ -93,7 +87,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
this
.
item
.
bgAudioName
=
""
;
this
.
save
();
}
ngChange
(
i
,
j
)
{
ngChange
(
i
)
{
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