Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hy08_caici
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
hy08_caici
Commits
bc5295c6
Commit
bc5295c6
authored
Jun 26, 2023
by
LikG21
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
游戏配置更换
parent
b1dd2c8f
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
195 deletions
+93
-195
form.component.html
form/src/app/form/form.component.html
+74
-158
form.component.ts
form/src/app/form/form.component.ts
+19
-37
No files found.
form/src/app/form/form.component.html
View file @
bc5295c6
This diff is collapsed.
Click to expand it.
form/src/app/form/form.component.ts
View file @
bc5295c6
...
@@ -9,7 +9,7 @@ import { MetaFormCreator } from './mataFormCreator';
...
@@ -9,7 +9,7 @@ import { MetaFormCreator } from './mataFormCreator';
})
})
export
class
FormComponent
extends
ComponentBase
implements
OnInit
,
OnChanges
,
OnDestroy
{
export
class
FormComponent
extends
ComponentBase
implements
OnInit
,
OnChanges
,
OnDestroy
{
// 储存数据用
// 储存数据用
saveKey
=
"
hy_0
6
"
;
saveKey
=
"
hy_0
8
"
;
item
=
{
item
=
{
onlineFlg
:
false
,
onlineFlg
:
false
,
...
@@ -21,6 +21,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
...
@@ -21,6 +21,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
bgAudioName
:
""
,
bgAudioName
:
""
,
audioName
:
""
audioName
:
""
};
};
isVisible
=
false
;
isVisible
=
false
;
deleteTitle
=
"
是否删除题目
"
;
deleteTitle
=
"
是否删除题目
"
;
deleteCallback
=
function
()
{
};
deleteCallback
=
function
()
{
};
...
@@ -39,35 +40,29 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
...
@@ -39,35 +40,29 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
init
():
void
{
init
():
void
{
/* console.log(new MetaFormCreator().create()); */
console
.
log
(
new
MetaFormCreator
().
create
());
}
}
removeoption
(
i
,
j
)
{
removeoption
(
i
,
j
)
{
if
((
this
.
item
.
questions
[
i
].
optionsType
==
"
img
"
||
this
.
item
.
questions
[
i
].
optionsType
==
"
shortTxt
"
)
&&
this
.
item
.
questions
[
i
].
letterList
.
length
>
2
)
{
this
.
openDelete
(
"
确定删除选项?
"
,
()
=>
{
this
.
openDelete
(
"
确定减少选项?
"
,
()
=>
{
this
.
item
.
questions
[
i
].
options
.
splice
(
j
,
1
);
this
.
item
.
questions
[
i
].
letterList
.
splice
(
j
,
2
);
this
.
save
();
})
}
else
{
this
.
openDelete
(
"
确定减少选项?
"
,
()
=>
{
this
.
item
.
questions
[
i
].
letterList
.
splice
(
j
,
1
);
this
.
save
();
this
.
save
();
})
})
}
}
}
copyOption
(
i
,
j
)
{
copyOption
(
i
,
j
)
{
let
data
=
this
.
item
.
questions
[
i
].
letterList
[
j
];
let
data
=
this
.
item
.
questions
[
i
].
options
[
j
];
this
.
item
.
questions
[
i
].
letterList
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
data
)));
this
.
item
.
questions
[
i
].
options
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
data
)));
this
.
save
();
this
.
save
();
}
}
addoption
(
i
)
{
addoption
(
i
)
{
this
.
item
.
questions
[
i
].
letterList
.
push
({
this
.
item
.
questions
[
i
].
options
.
push
({
answer
:
''
,
type
:
""
,
image
:
""
,
image
:
""
,
shortText
:
""
,
audio
:
""
,
longText
:
""
,
text
:
""
,
})
right
:
false
});
this
.
save
();
this
.
save
();
}
}
...
@@ -80,32 +75,19 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
...
@@ -80,32 +75,19 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
addquestion
()
{
addquestion
()
{
this
.
item
.
questions
.
push
({
this
.
item
.
questions
.
push
({
optionsType
:
"
img
"
,
questionAudio
:
""
,
questionAudio
:
""
,
duration
:
120
,
duration
:
120
,
type
:
"
img
"
,
options
:
[]
image
:
""
,
index
:
''
,
audio
:
""
,
text
:
""
,
right
:
false
,
letterList
:
[],
});
});
this
.
save
();
this
.
save
();
}
}
deleteBgAudio
()
{
deleteBgAudio
()
{
this
.
item
.
bgAudio
=
""
;
this
.
item
.
bgAudio
=
""
;
this
.
item
.
bgAudioName
=
""
;
this
.
item
.
bgAudioName
=
""
;
this
.
save
();
this
.
save
();
}
}
button1
()
{
ngChange
(
i
,
j
)
{
console
.
log
(
this
.
item
,
'
456
'
)
}
ngChange
(
i
)
{
for
(
let
a
=
0
;
a
<
this
.
item
.
questions
[
i
].
letterList
.
length
;
a
++
)
{
this
.
item
.
questions
[
i
].
letterList
[
a
].
answer
=
false
}
this
.
item
.
questions
[
i
].
letterList
[
this
.
item
.
questions
[
i
].
index
].
answer
=
true
this
.
save
();
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