Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fireballoon
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
fireballoon
Commits
410914b8
Commit
410914b8
authored
Jun 07, 2022
by
yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug调整
parent
95406706
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
20 deletions
+42
-20
ComponentBase.ts
form/src/app/form/ComponentBase.ts
+39
-17
form.component.html
form/src/app/form/form.component.html
+3
-3
No files found.
form/src/app/form/ComponentBase.ts
View file @
410914b8
...
...
@@ -34,23 +34,45 @@ export class ComponentBase {
* 储存图片数据
* @param e
*/
onAssetUploadSuccess
(
e
:
any
,
...
key
:
Array
<
string
>
)
{
let
item
=
this
.
item
;
for
(
let
i
=
0
;
i
<
key
.
length
;
i
++
)
{
if
(
i
+
1
==
key
.
length
)
{
if
(
key
[
i
]
==
"
audio
"
)
{
let
sp
=
e
.
url
.
split
(
"
.mp3
"
);
let
u
=
sp
[
0
]
+
"
_l.mp3
"
;
item
[
key
[
i
]]
=
u
;
item
[
"
audioName
"
]
=
e
.
name
||
""
;
}
else
{
item
[
key
[
i
]]
=
e
.
url
;
}
this
.
save
();
return
;
}
item
=
item
[
key
[
i
]];
}
// onAssetUploadSuccess(e: any, ...key: Array<string>) {
// let item = this.item;
// for (let i = 0; i < key.length; i++) {
// if (i + 1 == key.length) {
// if (key[i] == "audio") {
// let sp = e.url.split(".mp3");
// let u = sp[0] + "_l.mp3";
// item[key[i]] = u;
// item["audioName"] = e.name || "";
// } else {
// item[key[i]] = e.url;
// }
// this.save();
// return;
// }
// item = item[key[i]];
// }
// }
/**
* 储存图片数据
* @param e
*/
onImageUploadSuccess
(
e
,
key
,
it
=
this
.
item
)
{
it
[
key
]
=
e
.
url
;
this
.
save
();
}
/**
* 储存音频数据
* @param e
*/
onAudioUploadSuccess
(
e
,
key
,
it
=
this
.
item
)
{
let
url
=
e
.
url
;
let
sp
=
url
.
split
(
"
.mp3
"
);
let
u
=
sp
[
0
]
+
"
_l.mp3
"
;
it
[
key
]
=
u
;
it
[
"
audioName
"
]
=
e
.
name
||
""
;
this
.
save
();
}
save
()
{
...
...
form/src/app/form/form.component.html
View file @
410914b8
...
...
@@ -84,7 +84,7 @@
<div
style=
"display:flex ;"
>
<div>
<app-audio-recorder
[
audioUrl
]="
item
.
questionTextAudio
"
(
audioUploaded
)="
onA
sset
UploadSuccess
($
event
,
'
questionTextAudio
')"
></app-audio-recorder>
(
audioUploaded
)="
onA
udio
UploadSuccess
($
event
,
'
questionTextAudio
')"
></app-audio-recorder>
</div>
<div
style=
"margin: 5px"
>
<span>
{{ item.audioName}}
</span>
...
...
@@ -131,7 +131,7 @@
</div>
<div
style=
"width: 300px;"
>
<app-upload-image-with-preview
[
picUrl
]="
option
.
image
"
(
imageUploaded
)="
on
AssetUploadSuccess
($
event
,
'
questions
',
i
,
'
options
',
j
,
'
image
'
)"
>
(
imageUploaded
)="
on
ImageUploadSuccess
($
event
,
'
image
',
option
)"
>
</app-upload-image-with-preview>
</div>
</div>
...
...
@@ -144,7 +144,7 @@
<div
style=
"display: flex"
>
<div>
<app-audio-recorder
[
audioUrl
]="
option
.
audio
"
(
audioUploaded
)="
onA
ssetUploadSuccess
($
event
,
'
questions
',
i
,
'
options
',
j
,
'
audio
'
)"
>
(
audioUploaded
)="
onA
udioUploadSuccess
($
event
,
'
audio
',
option
)"
>
</app-audio-recorder>
</div>
<div
style=
"margin: 5px"
>
...
...
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