Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
ww_picture-group
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
ww_picture-group
Commits
0f6d9f5a
Commit
0f6d9f5a
authored
Nov 04, 2020
by
liujiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: change refresh
parent
e671f16a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
form.component.ts
src/app/form/form.component.ts
+12
-3
play.component.ts
src/app/play/play.component.ts
+1
-1
No files found.
src/app/form/form.component.ts
View file @
0f6d9f5a
...
@@ -27,7 +27,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -27,7 +27,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
constructor
(
private
appRef
:
ApplicationRef
,
constructor
(
private
appRef
:
ApplicationRef
,
private
changeDetectorRef
:
ChangeDetectorRef
,
private
changeDetectorRef
:
ChangeDetectorRef
,
private
modalService
:
NzModalService
,
private
modalService
:
NzModalService
,
private
nzMessageService
:
NzMessageService
,)
{
private
nzMessageService
:
NzMessageService
,)
{
}
}
...
@@ -37,7 +37,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -37,7 +37,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
item
=
{
this
.
item
=
{
contentObj
:
{
contentObj
:
{
}
}
};
};
...
@@ -82,6 +82,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -82,6 +82,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
item
.
showPic
=
!
item
.
showPic
;
item
.
showPic
=
!
item
.
showPic
;
this
.
item
.
contentObj
.
groups
=
this
.
groups
;
this
.
item
.
contentObj
.
groups
=
this
.
groups
;
this
.
save
();
this
.
save
();
this
.
refresh
();
}
}
onDeleteCoursewareItem
(
groupIndex
,
index
)
{
onDeleteCoursewareItem
(
groupIndex
,
index
)
{
this
.
modalService
.
confirm
({
this
.
modalService
.
confirm
({
...
@@ -93,13 +94,16 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -93,13 +94,16 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
groups
[
groupIndex
].
options
.
splice
(
index
,
1
);
this
.
groups
[
groupIndex
].
options
.
splice
(
index
,
1
);
this
.
item
.
contentObj
.
groups
=
this
.
groups
;
this
.
item
.
contentObj
.
groups
=
this
.
groups
;
this
.
save
();
this
.
save
();
this
.
refresh
();
},
},
});
});
this
.
refresh
();
}
}
onHandleOptionItemImage
(
groupIndex
,
e
,
index
)
{
onHandleOptionItemImage
(
groupIndex
,
e
,
index
)
{
this
.
groups
[
groupIndex
].
options
[
index
].
pic_id
=
e
.
url
;
this
.
groups
[
groupIndex
].
options
[
index
].
pic_id
=
e
.
url
;
this
.
item
.
contentObj
.
groups
=
this
.
groups
;
this
.
item
.
contentObj
.
groups
=
this
.
groups
;
this
.
save
();
this
.
save
();
this
.
refresh
();
}
}
addNewOptionItem
(
groupIndex
)
{
addNewOptionItem
(
groupIndex
)
{
const
content
=
{
const
content
=
{
...
@@ -130,6 +134,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -130,6 +134,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
}
this
.
groups
[
groupIndex
].
options
.
push
(
content
);
this
.
groups
[
groupIndex
].
options
.
push
(
content
);
this
.
updateOptionItemText
();
this
.
updateOptionItemText
();
this
.
refresh
();
}
}
updateGroupText
(
evt
?:
{
target
:
{
value
:
''
}},
group
?:
{
name
:
''
})
{
updateGroupText
(
evt
?:
{
target
:
{
value
:
''
}},
group
?:
{
name
:
''
})
{
let
u
=
true
;
let
u
=
true
;
...
@@ -144,6 +149,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -144,6 +149,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
if
(
u
)
{
if
(
u
)
{
this
.
save
();
this
.
save
();
}
}
this
.
refresh
();
}
}
updateOptionItemText
(
evt
?:
{
target
:
{
value
:
''
}},
item
?:
{
text
:
''
})
{
updateOptionItemText
(
evt
?:
{
target
:
{
value
:
''
}},
item
?:
{
text
:
''
})
{
let
u
=
true
;
let
u
=
true
;
...
@@ -158,9 +164,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -158,9 +164,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
if
(
u
)
{
if
(
u
)
{
this
.
save
();
this
.
save
();
}
}
this
.
refresh
();
}
}
/**
/**
* 储存数据
* 储存数据
*/
*/
...
@@ -174,6 +181,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -174,6 +181,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
*/
*/
refresh
()
{
refresh
()
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
changeDetectorRef
.
markForCheck
();
this
.
changeDetectorRef
.
detectChanges
();
this
.
appRef
.
tick
();
this
.
appRef
.
tick
();
},
1
);
},
1
);
}
}
...
...
src/app/play/play.component.ts
View file @
0f6d9f5a
...
@@ -176,9 +176,9 @@ export class PlayComponent implements OnInit {
...
@@ -176,9 +176,9 @@ export class PlayComponent implements OnInit {
refresh
()
{
refresh
()
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
appRef
.
tick
();
this
.
changeDetectorRef
.
markForCheck
();
this
.
changeDetectorRef
.
markForCheck
();
this
.
changeDetectorRef
.
detectChanges
();
this
.
changeDetectorRef
.
detectChanges
();
this
.
appRef
.
tick
();
},
1
);
},
1
);
}
}
...
...
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