|
@@ -228,6 +228,11 @@ export class ReadingExerciseComponent implements OnInit {
|
|
|
await this.load();
|
|
await this.load();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @HostListener('document:keydown.escape')
|
|
|
|
|
+ closeDialog(): void {
|
|
|
|
|
+ this.dialog.set(null);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
async handleDialog(): Promise<void> {
|
|
async handleDialog(): Promise<void> {
|
|
|
const current = this.dialog();
|
|
const current = this.dialog();
|
|
|
this.dialog.set(null);
|
|
this.dialog.set(null);
|
|
@@ -255,7 +260,7 @@ export class ReadingExerciseComponent implements OnInit {
|
|
|
await this.refreshHistoryCount();
|
|
await this.refreshHistoryCount();
|
|
|
let article = await this.withTimeout(
|
|
let article = await this.withTimeout(
|
|
|
this.params.sid&&!this.params.renew?this.cloud.get<ReadingArticle>('SurveyItem',this.params.sid):this.reading.createArticle(this.params, (value) => this.updateArticleProgress(value)),
|
|
this.params.sid&&!this.params.renew?this.cloud.get<ReadingArticle>('SurveyItem',this.params.sid):this.reading.createArticle(this.params, (value) => this.updateArticleProgress(value)),
|
|
|
- 120000, '短文生成',
|
|
|
|
|
|
|
+ 150000, '短文生成',
|
|
|
);
|
|
);
|
|
|
this.article.set(article);
|
|
this.article.set(article);
|
|
|
const attachArticleToRoute = !this.params.sid || this.params.renew;
|
|
const attachArticleToRoute = !this.params.sid || this.params.renew;
|
|
@@ -274,7 +279,7 @@ export class ReadingExerciseComponent implements OnInit {
|
|
|
const missing = this.params.wordList.filter((word) => !article.content.toLowerCase().includes(word.toLowerCase()));
|
|
const missing = this.params.wordList.filter((word) => !article.content.toLowerCase().includes(word.toLowerCase()));
|
|
|
article = await this.withTimeout(
|
|
article = await this.withTimeout(
|
|
|
this.reading.supplyMissingWords(article, missing, (value) => this.updateArticleProgress(value)),
|
|
this.reading.supplyMissingWords(article, missing, (value) => this.updateArticleProgress(value)),
|
|
|
- 120000, '词汇补全',
|
|
|
|
|
|
|
+ 150000, '词汇补全',
|
|
|
);
|
|
);
|
|
|
this.article.set(article);
|
|
this.article.set(article);
|
|
|
}
|
|
}
|
|
@@ -296,7 +301,7 @@ export class ReadingExerciseComponent implements OnInit {
|
|
|
await this.returnToOrigin();
|
|
await this.returnToOrigin();
|
|
|
} else {
|
|
} else {
|
|
|
this.error.set(message);
|
|
this.error.set(message);
|
|
|
- const canRetry = this.retryCount < this.maxRetry;
|
|
|
|
|
|
|
+ const canRetry = this.retryCount < this.maxRetry && !message.includes('联系管理员');
|
|
|
this.dialog.set({
|
|
this.dialog.set({
|
|
|
title: '遇到问题',
|
|
title: '遇到问题',
|
|
|
message: `${message}${canRetry ? `(剩余重试次数:${this.maxRetry - this.retryCount})` : ''}`,
|
|
message: `${message}${canRetry ? `(剩余重试次数:${this.maxRetry - this.retryCount})` : ''}`,
|
|
@@ -351,6 +356,7 @@ export class ReadingExerciseComponent implements OnInit {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
async returnToOrigin(): Promise<void> {
|
|
async returnToOrigin(): Promise<void> {
|
|
|
|
|
+ this.closeDialog();
|
|
|
await this.router.navigateByUrl(normalizeReadingReturnUrl(this.params.returnUrl), { replaceUrl: true });
|
|
await this.router.navigateByUrl(normalizeReadingReturnUrl(this.params.returnUrl), { replaceUrl: true });
|
|
|
}
|
|
}
|
|
|
|
|
|