Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
SSIWB2504
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
SSIWB2504
Commits
df7ff131
Commit
df7ff131
authored
Aug 11, 2025
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改通用异常
parent
407525e5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
39 deletions
+38
-39
audio-recorder.component.ts
src/app/common/audio-recorder/audio-recorder.component.ts
+27
-20
play.component.ts
src/app/play/play.component.ts
+11
-19
No files found.
src/app/common/audio-recorder/audio-recorder.component.ts
View file @
df7ff131
import
{
Component
,
EventEmitter
,
Input
,
OnDestroy
,
OnInit
,
Output
,
NgZone
,
OnChanges
}
from
'
@angular/core
'
;
import
{
NzMessageService
,
NzNotificationService
,
UploadFile
}
from
'
ng-zorro-antd
'
;
import
{
HttpClient
,
HttpEvent
,
HttpEventType
,
HttpRequest
}
from
'
@angular/common/http
'
;
import
{
environment
}
from
'
../../../environments/environment
'
;
import
{
Component
,
EventEmitter
,
Input
,
OnDestroy
,
OnInit
,
Output
,
NgZone
,
OnChanges
}
from
'
@angular/core
'
;
import
{
NzMessageService
,
NzNotificationService
,
UploadFile
}
from
'
ng-zorro-antd
'
;
import
{
HttpClient
,
HttpEvent
,
HttpEventType
,
HttpRequest
}
from
'
@angular/common/http
'
;
import
{
environment
}
from
'
../../../environments/environment
'
;
declare
var
Recorder
;
...
...
@@ -53,7 +53,14 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy {
audioBlob
:
any
;
constructor
(
private
nzMessageService
:
NzMessageService
)
{
constructor
(
private
nzMessageService
:
NzMessageService
)
{
this
.
uploadUrl
=
(
<
any
>
window
).
courseware
.
uploadUrl
();
this
.
uploadData
=
(
<
any
>
window
).
courseware
.
uploadData
();
window
[
'
air
'
].
getUploadCallback
=
(
url
,
data
)
=>
{
this
.
uploadUrl
=
url
;
this
.
uploadData
=
data
;
};
}
...
...
@@ -196,9 +203,9 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy {
uploadSuccess
=
(
url
)
=>
{
this
.
nzMessageService
.
info
(
'
Upload Success
'
);
this
.
isUploading
=
false
;
if
(
typeof
url
==
"
string
"
)
{
if
(
typeof
url
==
"
string
"
)
{
this
.
audioUrl
=
url
}
else
{
}
else
{
this
.
audioUrl
=
url
.
url
}
}
...
...
src/app/play/play.component.ts
View file @
df7ff131
...
...
@@ -120,7 +120,7 @@ export class PlayComponent implements OnInit, OnDestroy {
g_clickY
;
// 点击坐标 Y
g_ctx
;
// canvas 实例
g_data
;
// 数据
g_formData
:
FormData
;
// 表单转换之后的数据
g_formData
:
any
;
// 表单转换之后的数据
g_teacherFlag
=
false
;
// 默认角色
g_currentUser
;
...
...
@@ -2516,24 +2516,12 @@ export class PlayComponent implements OnInit, OnDestroy {
// this.g_currentUser = window['air'].airClassInfo.user;
if
(
data
&&
typeof
data
==
"
object
"
)
{
this
.
g_data
=
data
;
this
.
g_formData
=
data
.
contentObj
;
this
.
g_formData
=
data
;
}
else
{
this
.
g_data
=
{};
this
.
g_formData
=
{};
}
if
(
!
this
.
g_data
.
contentObj
)
{
this
.
g_data
.
contentObj
=
{};
this
.
g_formData
=
{
score
:
0
,
title
:
''
,
doubleModal
:
false
,
questionText
:
''
,
questionType
:
''
,
questionTextAudio
:
''
,
bgAudio
:
''
,
questions
:
[]
};
}
this
.
initDefaultData
();
this
.
initAudio
();
...
...
@@ -2562,9 +2550,13 @@ export class PlayComponent implements OnInit, OnDestroy {
// 初始化默认数据
// ----------------------------------
initDefaultData
()
{
console
.
log
(
"
Init default form data
"
)
if
(
Object
.
keys
(
this
.
g_formData
).
length
===
0
)
{
this
.
g_formData
=
defaultFormData
;
console
.
log
(
"
this.g_formData
"
,
this
.
g_formData
)
}
else
{
this
.
g_formData
=
this
.
g_data
;
console
.
log
(
"
this.g_formData
"
,
this
.
g_formData
);
}
}
...
...
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