Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hy01_danci
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
hy01_danci
Commits
7233d4c1
Commit
7233d4c1
authored
Jun 13, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改form内容
parent
cfdfe0b5
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
166 additions
and
171 deletions
+166
-171
.DS_Store
.DS_Store
+0
-0
app.module.ts
form/src/app/app.module.ts
+15
-15
ComponentBase.ts
form/src/app/form/ComponentBase.ts
+3
-2
form.component.html
form/src/app/form/form.component.html
+120
-97
form.component.ts
form/src/app/form/form.component.ts
+28
-57
No files found.
.DS_Store
View file @
7233d4c1
No preview for this file type
form/src/app/app.module.ts
View file @
7233d4c1
import
{
BrowserModule
}
from
'
@angular/platform-browser
'
;
import
{
NgModule
,
ErrorHandler
}
from
'
@angular/core
'
;
import
{
MyErrorHandler
}
from
'
./MyError
'
;
import
{
MyErrorHandler
}
from
'
./MyError
'
;
import
{
AppComponent
}
from
'
./app.component
'
;
import
{
NgZorroAntdModule
,
NZ_I18N
,
zh_CN
}
from
'
ng-zorro-antd
'
;
...
...
@@ -10,17 +10,17 @@ import { HttpClientModule } from '@angular/common/http';
import
{
BrowserAnimationsModule
}
from
'
@angular/platform-browser/animations
'
;
import
{
registerLocaleData
}
from
'
@angular/common
'
;
import
zh
from
'
@angular/common/locales/zh
'
;
import
{
FormComponent
}
from
'
./form/form.component
'
;
import
{
PlayComponent
}
from
'
./play/play.component
'
;
import
{
LessonTitleConfigComponent
}
from
'
./common/lesson-title-config/lesson-title-config.component
'
;
import
{
BackgroundImagePipe
}
from
'
./pipes/background-image.pipe
'
;
import
{
UploadImageWithPreviewComponent
}
from
'
./common/upload-image-with-preview/upload-image-with-preview.component
'
;
import
{
PlayerContentWrapperComponent
}
from
'
./common/player-content-wrapper/player-content-wrapper.component
'
;
import
{
CustomHotZoneComponent
}
from
'
./common/custom-hot-zone/custom-hot-zone.component
'
;
import
{
UploadVideoComponent
}
from
'
./common/upload-video/upload-video.component
'
;
import
{
TimePipe
}
from
'
./pipes/time.pipe
'
;
import
{
ResourcePipe
}
from
'
./pipes/resource.pipe
'
;
import
{
AudioRecorderComponent
}
from
'
./common/audio-recorder/audio-recorder.component
'
;
import
{
FormComponent
}
from
'
./form/form.component
'
;
import
{
PlayComponent
}
from
'
./play/play.component
'
;
import
{
LessonTitleConfigComponent
}
from
'
./common/lesson-title-config/lesson-title-config.component
'
;
import
{
BackgroundImagePipe
}
from
'
./pipes/background-image.pipe
'
;
import
{
UploadImageWithPreviewComponent
}
from
'
./common/upload-image-with-preview/upload-image-with-preview.component
'
;
import
{
PlayerContentWrapperComponent
}
from
'
./common/player-content-wrapper/player-content-wrapper.component
'
;
import
{
CustomHotZoneComponent
}
from
'
./common/custom-hot-zone/custom-hot-zone.component
'
;
import
{
UploadVideoComponent
}
from
'
./common/upload-video/upload-video.component
'
;
import
{
TimePipe
}
from
'
./pipes/time.pipe
'
;
import
{
ResourcePipe
}
from
'
./pipes/resource.pipe
'
;
import
{
AudioRecorderComponent
}
from
'
./common/audio-recorder/audio-recorder.component
'
;
import
{
FontAwesomeModule
,
FaIconLibrary
}
from
'
@fortawesome/angular-fontawesome
'
;
import
{
fas
}
from
'
@fortawesome/free-solid-svg-icons
'
;
import
{
far
}
from
'
@fortawesome/free-regular-svg-icons
'
;
...
...
@@ -54,15 +54,15 @@ registerLocaleData(zh);
FontAwesomeModule
],
providers
:
[
{
provide
:
ErrorHandler
,
useClass
:
MyErrorHandler
},
{
provide
:
ErrorHandler
,
useClass
:
MyErrorHandler
},
{
provide
:
NZ_I18N
,
useValue
:
zh_CN
}
],
bootstrap
:
[
AppComponent
]
})
export
class
AppModule
{
constructor
(
library
:
FaIconLibrary
)
{
let
fs
:
any
=
fas
;
let
fr
:
any
=
far
;
let
fs
:
any
=
fas
;
let
fr
:
any
=
far
;
library
.
addIconPacks
(
fs
,
fr
);
}
}
form/src/app/form/ComponentBase.ts
View file @
7233d4c1
...
...
@@ -42,13 +42,14 @@ export class ComponentBase {
// let sp = e.url.split(".mp3");
// let u = sp[0] + "_l.mp3";
// item[key[i]] = u;
// console.log("audioName: " + e.name);
// item["audioName"] = e.name || "";
// } else {
// item[key[i]] = e.url;
// }
// this.save();
// return;
// }
// this.save();
// item = item[key[i]];
// }
// }
...
...
form/src/app/form/form.component.html
View file @
7233d4c1
This diff is collapsed.
Click to expand it.
form/src/app/form/form.component.ts
View file @
7233d4c1
...
...
@@ -2,9 +2,6 @@ import { Component, OnDestroy, OnChanges, OnInit, ApplicationRef, ChangeDetector
import
{
ComponentBase
}
from
'
./ComponentBase
'
;
import
{
MetaFormCreator
}
from
'
./mataFormCreator
'
;
let
replaceAll
=
function
(
str
,
s1
,
s2
)
{
return
str
.
replace
(
new
RegExp
(
s1
,
"
gm
"
),
s2
);
}
@
Component
({
selector
:
'
app-form
'
,
templateUrl
:
'
./form.component.html
'
,
...
...
@@ -12,19 +9,21 @@ let replaceAll = function (str, s1, s2) {
})
export
class
FormComponent
extends
ComponentBase
implements
OnInit
,
OnChanges
,
OnDestroy
{
// 储存数据用
saveKey
=
"
ngt06_ball
"
;
saveKey
=
"
hy01_danci
"
;
item
=
{
imgAni
:
{
ske
:
{},
tex
:
{},
png
:
{}
},
startAudio
:
""
,
audioName
:
""
,
title
:
"
判断对错
"
,
questions
:
[],
recordFlag
:
false
,
title
:
""
,
questionText
:
""
,
questionTextAudio
:
""
,
questions
:
[{
questionAudio
:
""
,
duration
:
120
,
options
:
[]
}],
bgAudio
:
""
,
bgAudioName
:
""
,
audioName
:
""
};
isVisible
=
false
;
...
...
@@ -42,6 +41,8 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
this
.
deleteCallback
&&
this
.
deleteCallback
();
this
.
handleCancel
();
}
init
():
void
{
console
.
log
(
new
MetaFormCreator
().
create
());
}
...
...
@@ -52,7 +53,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
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
();
...
...
@@ -60,69 +61,39 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
addoption
(
i
)
{
this
.
item
.
questions
[
i
].
options
.
push
({
type
:
"
txt
"
,
type
:
""
,
image
:
""
,
audio
:
""
,
text
:
""
,
time
:
""
,
duration
:
''
,
content
:
''
,
right
:
false
});
this
.
save
();
}
removequestion
(
i
dx
)
{
removequestion
(
i
)
{
this
.
openDelete
(
"
确定删除题目?
"
,
()
=>
{
this
.
item
.
questions
.
splice
(
i
dx
,
1
);
this
.
item
.
questions
.
splice
(
i
,
1
);
this
.
save
();
})
}
addquestion
()
{
this
.
item
.
questions
.
push
({
options
:
[],
type
:
"
txt
"
,
audioUrl
:
""
,
audioName
:
""
,
text
:
""
,
questionAudio
:
""
,
duration
:
120
,
options
:
[]
});
this
.
save
();
}
ngChange
(
i
,
j
)
{
this
.
save
();
}
changeMain
(
question
)
{
//输出的数据可以识别到\n的换行符
let
arr
=
question
.
contentMain
.
split
(
"
"
);
let
oldArr
=
question
.
contentArr
.
concat
();
let
contetArr
=
arr
.
map
(
ar
=>
{
let
obj
=
{
text
:
`
${
ar
}
`
,
//replaceAll(`${ar}`, "\n", "<br/>"),
block
:
false
,
check
:
1
,
}
for
(
let
i
=
0
;
i
<
oldArr
.
length
;
i
++
)
{
if
(
obj
.
text
==
oldArr
[
i
].
text
)
{
obj
.
block
=
oldArr
[
i
].
block
;
obj
.
check
=
oldArr
[
i
].
check
;
oldArr
.
splice
(
i
,
1
);
break
;
}
}
return
obj
;
})
question
.
contentArr
=
contetArr
;
console
.
log
(
contetArr
)
this
.
save
();
}
onBlock
(
item
,
vis
)
{
item
.
block
=
vis
;
deleteBgAudio
()
{
this
.
item
.
bgAudio
=
""
;
this
.
item
.
bgAudioName
=
""
;
this
.
save
();
}
onDragonBoneSave
(
e
,
item
)
{
console
.
log
(
e
);
ngChange
(
i
,
j
)
{
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