|
|
@@ -246,8 +246,13 @@
|
|
246
|
246
|
}
|
|
247
|
247
|
|
|
248
|
248
|
@keyframes spin {
|
|
249
|
|
- 0% { transform: rotate(0deg); }
|
|
250
|
|
- 100% { transform: rotate(360deg); }
|
|
|
249
|
+ 0% {
|
|
|
250
|
+ transform: rotate(0deg);
|
|
|
251
|
+ }
|
|
|
252
|
+
|
|
|
253
|
+ 100% {
|
|
|
254
|
+ transform: rotate(360deg);
|
|
|
255
|
+ }
|
|
251
|
256
|
}
|
|
252
|
257
|
|
|
253
|
258
|
.clear-btn {
|
|
|
@@ -336,13 +341,11 @@
|
|
336
|
341
|
</div>
|
|
337
|
342
|
<!-- 搜索结果列表 -->
|
|
338
|
343
|
<div class="search-results" style="flex: 1; overflow-y: auto; padding: 10px;">
|
|
339
|
|
- <div v-if="articles && articles.length > 0"
|
|
340
|
|
- v-for="(article, index) in articles"
|
|
341
|
|
- :key="index"
|
|
342
|
|
- @click="selectArticle(article)"
|
|
343
|
|
- style="padding: 10px; margin: 5px 0; background: white; border-radius: 4px; cursor: pointer; transition: background-color 0.2s;"
|
|
344
|
|
- :style="{ backgroundColor: selectedArticle === article ? '#e6f3ff' : 'white' }"
|
|
345
|
|
- class="search-result-item">
|
|
|
344
|
+ <div v-if="articles && articles.length > 0" v-for="(article, index) in articles" :key="index"
|
|
|
345
|
+ @click="selectArticle(article)"
|
|
|
346
|
+ style="padding: 10px; margin: 5px 0; background: white; border-radius: 4px; cursor: pointer; transition: background-color 0.2s;"
|
|
|
347
|
+ :style="{ backgroundColor: selectedArticle === article ? '#e6f3ff' : 'white' }"
|
|
|
348
|
+ class="search-result-item">
|
|
346
|
349
|
<div style="font-weight: bold;">文章ID: {{ article.ID }}</div>
|
|
347
|
350
|
<div style="font-size: 12px; color: #666; margin-top: 4px;">
|
|
348
|
351
|
创建时间: {{ article.CreateTime }}
|
|
|
@@ -354,11 +357,11 @@
|
|
354
|
357
|
单词表: {{ article.Words }}
|
|
355
|
358
|
</div>
|
|
356
|
359
|
<div style="font-size: 12px; color: #666;">
|
|
357
|
|
- 是否精选: {{ article.IsFine=="1"?"是":"" }}
|
|
|
360
|
+ 是否精选: {{ article.IsFine ? "是" : "否" }}
|
|
358
|
361
|
</div>
|
|
359
|
362
|
</div>
|
|
360
|
|
- <div v-else-if="articles && articles.length === 0"
|
|
361
|
|
- style="text-align: center; color: #999; padding: 20px;">
|
|
|
363
|
+ <div v-else-if="articles && articles.length === 0"
|
|
|
364
|
+ style="text-align: center; color: #999; padding: 20px;">
|
|
362
|
365
|
未找到相关文章
|
|
363
|
366
|
</div>
|
|
364
|
367
|
</div>
|
|
|
@@ -377,17 +380,24 @@
|
|
377
|
380
|
<span class="json-key">是否精选:</span>
|
|
378
|
381
|
<span class="json-number editable" @dblclick="editValue(selectedArticle, 'IsFine', 'IsFine')">
|
|
379
|
382
|
<template v-if="editingKey === 'IsFine'">
|
|
380
|
|
- <input type="number" class="json-editor-input" v-model.number="selectedArticle.IsFine"
|
|
381
|
|
- @blur="finishEdit" @keyup.enter="finishEdit" v-focus>
|
|
|
383
|
+ <label style="margin-right: 10px;">
|
|
|
384
|
+ <input type="radio" v-model.number="selectedArticle.IsFine" :value="1"
|
|
|
385
|
+ @change="finishEdit"> 是
|
|
|
386
|
+ </label>
|
|
|
387
|
+ <label>
|
|
|
388
|
+ <input type="radio" v-model.number="selectedArticle.IsFine" :value="0"
|
|
|
389
|
+ @change="finishEdit"> 否
|
|
|
390
|
+ </label>
|
|
382
|
391
|
</template>
|
|
383
|
392
|
<template v-else>
|
|
384
|
|
- {{ selectedArticle.IsFine }}
|
|
|
393
|
+ {{ selectedArticle.IsFine == 1 || selectedArticle.IsFine == "1" ? "是" : "否" }}
|
|
385
|
394
|
</template>
|
|
386
|
395
|
</span>
|
|
387
|
396
|
</div>
|
|
388
|
397
|
<div class="json-node">
|
|
389
|
398
|
<span class="json-key">文章英文标题:</span>
|
|
390
|
|
- <span class="json-string editable" @dblclick="editValue(selectedArticle, 'ArticleTitle', 'ArticleTitle')">
|
|
|
399
|
+ <span class="json-string editable"
|
|
|
400
|
+ @dblclick="editValue(selectedArticle, 'ArticleTitle', 'ArticleTitle')">
|
|
391
|
401
|
<template v-if="editingKey === 'ArticleTitle'">
|
|
392
|
402
|
<input type="text" class="json-editor-input" v-model="selectedArticle.ArticleTitle"
|
|
393
|
403
|
@blur="finishEdit" @keyup.enter="finishEdit" v-focus>
|
|
|
@@ -399,7 +409,8 @@
|
|
399
|
409
|
</div>
|
|
400
|
410
|
<div class="json-node">
|
|
401
|
411
|
<span class="json-key">文章中文标题:</span>
|
|
402
|
|
- <span class="json-string editable" @dblclick="editValue(selectedArticle, 'ArticleTitleCHN', 'ArticleTitleCHN')">
|
|
|
412
|
+ <span class="json-string editable"
|
|
|
413
|
+ @dblclick="editValue(selectedArticle, 'ArticleTitleCHN', 'ArticleTitleCHN')">
|
|
403
|
414
|
<template v-if="editingKey === 'ArticleTitleCHN'">
|
|
404
|
415
|
<input type="text" class="json-editor-input" v-model="selectedArticle.ArticleTitleCHN"
|
|
405
|
416
|
@blur="finishEdit" @keyup.enter="finishEdit" v-focus>
|
|
|
@@ -411,7 +422,8 @@
|
|
411
|
422
|
</div>
|
|
412
|
423
|
<div class="json-node">
|
|
413
|
424
|
<span class="json-key">文章图片名称:</span>
|
|
414
|
|
- <span class="json-string editable" @dblclick="editValue(selectedArticle, 'ArticleImage', 'ArticleImage')">
|
|
|
425
|
+ <span class="json-string editable"
|
|
|
426
|
+ @dblclick="editValue(selectedArticle, 'ArticleImage', 'ArticleImage')">
|
|
415
|
427
|
<template v-if="editingKey === 'ArticleImage'">
|
|
416
|
428
|
<input type="text" class="json-editor-input" v-model="selectedArticle.ArticleImage"
|
|
417
|
429
|
@blur="finishEdit" @keyup.enter="finishEdit" v-focus>
|
|
|
@@ -423,10 +435,12 @@
|
|
423
|
435
|
</div>
|
|
424
|
436
|
<div class="json-node">
|
|
425
|
437
|
<span class="json-key">创建时间:</span>
|
|
426
|
|
- <span class="json-string editable" @dblclick="editValue(selectedArticle, 'CreateTime', 'CreateTime')">
|
|
|
438
|
+ <span class="json-string editable"
|
|
|
439
|
+ @dblclick="editValue(selectedArticle, 'CreateTime', 'CreateTime')">
|
|
427
|
440
|
<template v-if="editingKey === 'CreateTime'">
|
|
428
|
|
- <input type="text" disabled="true" class="json-editor-input" v-model="selectedArticle.CreateTime"
|
|
429
|
|
- @blur="finishEdit" @keyup.enter="finishEdit" v-focus>
|
|
|
441
|
+ <input type="text" disabled="true" class="json-editor-input"
|
|
|
442
|
+ v-model="selectedArticle.CreateTime" @blur="finishEdit" @keyup.enter="finishEdit"
|
|
|
443
|
+ v-focus>
|
|
430
|
444
|
</template>
|
|
431
|
445
|
<template v-else>
|
|
432
|
446
|
"{{ selectedArticle.CreateTime }}"
|
|
|
@@ -435,23 +449,26 @@
|
|
435
|
449
|
</div>
|
|
436
|
450
|
<div class="json-node">
|
|
437
|
451
|
<span class="json-key">英语文章:</span>
|
|
438
|
|
- <span class="json-string editable" @dblclick="editValue(selectedArticle, 'ArticleStart', 'ArticleStart')">
|
|
|
452
|
+ <span class="json-string editable"
|
|
|
453
|
+ @dblclick="editValue(selectedArticle, 'ArticleStart', 'ArticleStart')">
|
|
439
|
454
|
<template v-if="editingKey === 'ArticleStart'">
|
|
440
|
|
- <input type="text" disabled="true" class="json-editor-input" v-model="selectedArticle.ArticleStart"
|
|
441
|
|
- @blur="finishEdit" @keyup.enter="finishEdit" v-focus>
|
|
|
455
|
+ <input type="text" disabled="true" class="json-editor-input"
|
|
|
456
|
+ v-model="selectedArticle.ArticleStart" @blur="finishEdit" @keyup.enter="finishEdit"
|
|
|
457
|
+ v-focus>
|
|
442
|
458
|
</template>
|
|
443
|
459
|
<template v-else>
|
|
444
|
460
|
"{{ selectedArticle.ArticleStart }}"
|
|
445
|
461
|
</template>
|
|
446
|
462
|
</span>
|
|
447
|
463
|
</div>
|
|
448
|
|
-
|
|
|
464
|
+
|
|
449
|
465
|
<div class="json-node">
|
|
450
|
466
|
<span class="json-key">用户ID:</span>
|
|
451
|
467
|
<span class="json-number editable" @dblclick="editValue(selectedArticle, 'UserID', 'UserID')">
|
|
452
|
468
|
<template v-if="editingKey === 'UserID'">
|
|
453
|
|
- <input type="number" disabled="true" class="json-editor-input" v-model.number="selectedArticle.UserID"
|
|
454
|
|
- @blur="finishEdit" @keyup.enter="finishEdit" v-focus>
|
|
|
469
|
+ <input type="number" disabled="true" class="json-editor-input"
|
|
|
470
|
+ v-model.number="selectedArticle.UserID" @blur="finishEdit" @keyup.enter="finishEdit"
|
|
|
471
|
+ v-focus>
|
|
455
|
472
|
</template>
|
|
456
|
473
|
<template v-else>
|
|
457
|
474
|
{{ selectedArticle.UserID }}
|
|
|
@@ -460,10 +477,12 @@
|
|
460
|
477
|
</div>
|
|
461
|
478
|
<div class="json-node">
|
|
462
|
479
|
<span class="json-key">生成秒数:</span>
|
|
463
|
|
- <span class="json-number editable" @dblclick="editValue(selectedArticle, 'GenerateTime', 'GenerateTime')">
|
|
|
480
|
+ <span class="json-number editable"
|
|
|
481
|
+ @dblclick="editValue(selectedArticle, 'GenerateTime', 'GenerateTime')">
|
|
464
|
482
|
<template v-if="editingKey === 'GenerateTime'">
|
|
465
|
|
- <input type="number" disabled="true" class="json-editor-input" v-model.number="selectedArticle.GenerateTime"
|
|
466
|
|
- @blur="finishEdit" @keyup.enter="finishEdit" v-focus>
|
|
|
483
|
+ <input type="number" disabled="true" class="json-editor-input"
|
|
|
484
|
+ v-model.number="selectedArticle.GenerateTime" @blur="finishEdit"
|
|
|
485
|
+ @keyup.enter="finishEdit" v-focus>
|
|
467
|
486
|
</template>
|
|
468
|
487
|
<template v-else>
|
|
469
|
488
|
{{ selectedArticle.GenerateTime }}
|
|
|
@@ -472,10 +491,12 @@
|
|
472
|
491
|
</div>
|
|
473
|
492
|
<div class="json-node">
|
|
474
|
493
|
<span class="json-key">使用AI模型:</span>
|
|
475
|
|
- <span class="json-string editable" @dblclick="editValue(selectedArticle, 'AIProvider', 'AIProvider')">
|
|
|
494
|
+ <span class="json-string editable"
|
|
|
495
|
+ @dblclick="editValue(selectedArticle, 'AIProvider', 'AIProvider')">
|
|
476
|
496
|
<template v-if="editingKey === 'AIProvider'">
|
|
477
|
|
- <input type="text" disabled="true" class="json-editor-input" v-model="selectedArticle.AIProvider"
|
|
478
|
|
- @blur="finishEdit" @keyup.enter="finishEdit" v-focus>
|
|
|
497
|
+ <input type="text" disabled="true" class="json-editor-input"
|
|
|
498
|
+ v-model="selectedArticle.AIProvider" @blur="finishEdit" @keyup.enter="finishEdit"
|
|
|
499
|
+ v-focus>
|
|
479
|
500
|
</template>
|
|
480
|
501
|
<template v-else>
|
|
481
|
502
|
"{{ selectedArticle.AIProvider }}"
|
|
|
@@ -486,8 +507,8 @@
|
|
486
|
507
|
<span class="json-key">提示语:</span>
|
|
487
|
508
|
<span class="json-string editable" @dblclick="editValue(selectedArticle, 'BuildStr', 'BuildStr')">
|
|
488
|
509
|
<template v-if="editingKey === 'BuildStr'">
|
|
489
|
|
- <input type="text" disabled="true" class="json-editor-input" v-model="selectedArticle.BuildStr"
|
|
490
|
|
- @blur="finishEdit" @keyup.enter="finishEdit" v-focus>
|
|
|
510
|
+ <input type="text" disabled="true" class="json-editor-input"
|
|
|
511
|
+ v-model="selectedArticle.BuildStr" @blur="finishEdit" @keyup.enter="finishEdit" v-focus>
|
|
491
|
512
|
</template>
|
|
492
|
513
|
<template v-else>
|
|
493
|
514
|
"{{ selectedArticle.BuildStr }}"
|
|
|
@@ -510,7 +531,7 @@
|
|
510
|
531
|
<span class="json-key">文章难度:</span>
|
|
511
|
532
|
<span class="json-string editable" @dblclick="editValue(selectedArticle, 'Level', 'Level')">
|
|
512
|
533
|
<template v-if="editingKey === 'Level'">
|
|
513
|
|
- <input type="text" disabled="true" class="json-editor-input" v-model="selectedArticle.Level"
|
|
|
534
|
+ <input type="text" disabled="true" class="json-editor-input" v-model="selectedArticle.Level"
|
|
514
|
535
|
@blur="finishEdit" @keyup.enter="finishEdit" v-focus>
|
|
515
|
536
|
</template>
|
|
516
|
537
|
<template v-else>
|
|
|
@@ -520,10 +541,12 @@
|
|
520
|
541
|
</div>
|
|
521
|
542
|
<div class="json-node">
|
|
522
|
543
|
<span class="json-key">文章类型:</span>
|
|
523
|
|
- <span class="json-string editable" @dblclick="editValue(selectedArticle, 'ArticleStyle', 'ArticleStyle')">
|
|
|
544
|
+ <span class="json-string editable"
|
|
|
545
|
+ @dblclick="editValue(selectedArticle, 'ArticleStyle', 'ArticleStyle')">
|
|
524
|
546
|
<template v-if="editingKey === 'ArticleStyle'">
|
|
525
|
|
- <input type="text" disabled="true" class="json-editor-input" v-model="selectedArticle.ArticleStyle"
|
|
526
|
|
- @blur="finishEdit" @keyup.enter="finishEdit" v-focus>
|
|
|
547
|
+ <input type="text" disabled="true" class="json-editor-input"
|
|
|
548
|
+ v-model="selectedArticle.ArticleStyle" @blur="finishEdit" @keyup.enter="finishEdit"
|
|
|
549
|
+ v-focus>
|
|
527
|
550
|
</template>
|
|
528
|
551
|
<template v-else>
|
|
529
|
552
|
"{{ selectedArticle.ArticleStyle }}"
|
|
|
@@ -534,18 +557,20 @@
|
|
534
|
557
|
<span class="json-key">用户阅读数:</span>
|
|
535
|
558
|
<span class="json-number editable" @dblclick="editValue(selectedArticle, 'ReadCount', 'ReadCount')">
|
|
536
|
559
|
<template v-if="editingKey === 'ReadCount'">
|
|
537
|
|
- <input type="number" disabled="true" class="json-editor-input" v-model.number="selectedArticle.ReadCount"
|
|
538
|
|
- @blur="finishEdit" @keyup.enter="finishEdit" v-focus>
|
|
|
560
|
+ <input type="number" disabled="true" class="json-editor-input"
|
|
|
561
|
+ v-model.number="selectedArticle.ReadCount" @blur="finishEdit" @keyup.enter="finishEdit"
|
|
|
562
|
+ v-focus>
|
|
539
|
563
|
</template>
|
|
540
|
564
|
<template v-else>
|
|
541
|
565
|
{{ selectedArticle.ReadCount }}
|
|
542
|
566
|
</template>
|
|
543
|
567
|
</span>
|
|
544
|
568
|
</div>
|
|
545
|
|
-
|
|
|
569
|
+
|
|
546
|
570
|
<div class="json-node">
|
|
547
|
571
|
<span class="json-key">JSON结果:</span>
|
|
548
|
|
- <span class="json-string editable" @dblclick="editValue(selectedArticle, 'JSONString', 'JSONString')">
|
|
|
572
|
+ <span class="json-string editable"
|
|
|
573
|
+ @dblclick="editValue(selectedArticle, 'JSONString', 'JSONString')">
|
|
549
|
574
|
<template v-if="editingKey === 'JSONString'">
|
|
550
|
575
|
<textarea class="json-editor-input" disabled="true" v-model="selectedArticle.JSONString"
|
|
551
|
576
|
@blur="finishEdit" @keyup.enter="finishEdit" v-focus></textarea>
|
|
|
@@ -559,8 +584,9 @@
|
|
559
|
584
|
<span class="json-key">是否删除:</span>
|
|
560
|
585
|
<span class="json-number editable" @dblclick="editValue(selectedArticle, 'Flag', 'Flag')">
|
|
561
|
586
|
<template v-if="editingKey === 'Flag'">
|
|
562
|
|
- <input type="number" disabled="true" class="json-editor-input" v-model.number="selectedArticle.Flag"
|
|
563
|
|
- @blur="finishEdit" @keyup.enter="finishEdit" v-focus>
|
|
|
587
|
+ <input type="number" disabled="true" class="json-editor-input"
|
|
|
588
|
+ v-model.number="selectedArticle.Flag" @blur="finishEdit" @keyup.enter="finishEdit"
|
|
|
589
|
+ v-focus>
|
|
564
|
590
|
</template>
|
|
565
|
591
|
<template v-else>
|
|
566
|
592
|
{{ selectedArticle.Flag }}
|
|
|
@@ -573,8 +599,10 @@
|
|
573
|
599
|
</div>
|
|
574
|
600
|
</div>
|
|
575
|
601
|
</div>
|
|
576
|
|
- </div>
|
|
|
602
|
+ <div class="toast" :class="{ show: showToastFlag, [toastType]: showToastFlag }">{{ toastMessage }}</div>
|
|
577
|
603
|
|
|
|
604
|
+ </div>
|
|
|
605
|
+
|
|
578
|
606
|
<script>
|
|
579
|
607
|
new Vue({
|
|
580
|
608
|
el: '#app',
|
|
|
@@ -584,7 +612,10 @@
|
|
584
|
612
|
selectedArticle: null,
|
|
585
|
613
|
isSearchLoading: false,
|
|
586
|
614
|
isDetailLoading: false,
|
|
587
|
|
- editingKey: null
|
|
|
615
|
+ editingKey: null,
|
|
|
616
|
+ toastMessage: '',
|
|
|
617
|
+ toastType: 'info',
|
|
|
618
|
+ showToastFlag: false
|
|
588
|
619
|
},
|
|
589
|
620
|
methods: {
|
|
590
|
621
|
searchArticles() {
|
|
|
@@ -631,15 +662,17 @@
|
|
631
|
662
|
saveArticle() {
|
|
632
|
663
|
if (!this.selectedArticle) return;
|
|
633
|
664
|
this.isDetailLoading = true;
|
|
634
|
|
- this.selectedArticle.Source="web";
|
|
|
665
|
+ this.selectedArticle.Source = "web";
|
|
635
|
666
|
$.ajax({
|
|
636
|
667
|
url: 'api/UpdateYJBDCArticle',
|
|
637
|
668
|
method: 'POST',
|
|
638
|
669
|
data: this.selectedArticle,
|
|
639
|
670
|
success: () => {
|
|
640
|
671
|
this.isDetailLoading = false;
|
|
641
|
|
- alert('保存成功');
|
|
|
672
|
+ this.showToast('保存成功', 'success');
|
|
|
673
|
+ // 重新加载文章列表和当前选中的文章
|
|
642
|
674
|
this.searchArticles();
|
|
|
675
|
+ this.selectArticle(this.selectedArticle);
|
|
643
|
676
|
},
|
|
644
|
677
|
error: () => {
|
|
645
|
678
|
this.isDetailLoading = false;
|
|
|
@@ -649,7 +682,17 @@
|
|
649
|
682
|
},
|
|
650
|
683
|
cancelEdit() {
|
|
651
|
684
|
this.selectedArticle = null;
|
|
652
|
|
- }
|
|
|
685
|
+ },
|
|
|
686
|
+ showToast(message, type = 'info') {
|
|
|
687
|
+ this.toastMessage = message;
|
|
|
688
|
+ this.toastType = type;
|
|
|
689
|
+ this.showToastFlag = true;
|
|
|
690
|
+
|
|
|
691
|
+ // 自动隐藏
|
|
|
692
|
+ setTimeout(() => {
|
|
|
693
|
+ this.showToastFlag = false;
|
|
|
694
|
+ }, 3000);
|
|
|
695
|
+ },
|
|
653
|
696
|
},
|
|
654
|
697
|
directives: {
|
|
655
|
698
|
focus: {
|