-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdiff_output.txt
More file actions
2244 lines (2199 loc) · 84.1 KB
/
diff_output.txt
File metadata and controls
2244 lines (2199 loc) · 84.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff --git a/package-lock.json b/package-lock.json
index ea893fd..3e32ef9 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -12,7 +12,8 @@
"bcryptjs": "^3.0.3",
"pkg": "^5.8.1",
"vue": "^3.5.22",
- "xlsx": "^0.18.5"
+ "xlsx": "^0.18.5",
+ "xlsx-js-style": "^1.2.0"
},
"bin": {
"seat-chart-editor-v2": "server.cjs"
@@ -27,7 +28,7 @@
"vite-plugin-vue-devtools": "^8.0.3"
},
"engines": {
- "node": "^20.19.0 || >=22.12.0"
+ "node": ">=20.0.0"
}
},
"node_modules/@babel/code-frame": {
@@ -4448,6 +4449,15 @@
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
"license": "MIT"
},
+ "node_modules/exit-on-epipe": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmmirror.com/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz",
+ "integrity": "sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw==",
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=0.8"
+ }
+ },
"node_modules/expand-template": {
"version": "2.0.3",
"resolved": "https://registry.npmmirror.com/expand-template/-/expand-template-2.0.3.tgz",
@@ -4563,6 +4573,12 @@
}
}
},
+ "node_modules/fflate": {
+ "version": "0.3.11",
+ "resolved": "https://registry.npmmirror.com/fflate/-/fflate-0.3.11.tgz",
+ "integrity": "sha512-Rr5QlUeGN1mbOHlaqcSYMKVpPbgLy0AWT/W0EHxA6NGI12yO1jpoui2zBBvU2G824ltM6Ut8BFgfHSBGfkmS0A==",
+ "license": "MIT"
+ },
"node_modules/filelist": {
"version": "1.0.6",
"resolved": "https://registry.npmmirror.com/filelist/-/filelist-1.0.6.tgz",
@@ -6737,6 +6753,18 @@
"node": ">=10"
}
},
+ "node_modules/printj": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmmirror.com/printj/-/printj-1.1.2.tgz",
+ "integrity": "sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ==",
+ "license": "Apache-2.0",
+ "bin": {
+ "printj": "bin/printj.njs"
+ },
+ "engines": {
+ "node": ">=0.8"
+ }
+ },
"node_modules/proc-log": {
"version": "5.0.0",
"resolved": "https://registry.npmmirror.com/proc-log/-/proc-log-5.0.0.tgz",
@@ -8321,6 +8349,74 @@
"node": ">=0.8"
}
},
+ "node_modules/xlsx-js-style": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmmirror.com/xlsx-js-style/-/xlsx-js-style-1.2.0.tgz",
+ "integrity": "sha512-DDT4FXFSWfT4DXMSok/m3TvmP1gvO3dn0Eu/c+eXHW5Kzmp7IczNkxg/iEPnImbG9X0Vb8QhROda5eatSR/97Q==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "adler-32": "~1.2.0",
+ "cfb": "^1.1.4",
+ "codepage": "~1.14.0",
+ "commander": "~2.17.1",
+ "crc-32": "~1.2.0",
+ "exit-on-epipe": "~1.0.1",
+ "fflate": "^0.3.8",
+ "ssf": "~0.11.2",
+ "wmf": "~1.0.1",
+ "word": "~0.3.0"
+ },
+ "bin": {
+ "xlsx": "bin/xlsx.njs"
+ },
+ "engines": {
+ "node": ">=0.8"
+ }
+ },
+ "node_modules/xlsx-js-style/node_modules/adler-32": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmmirror.com/adler-32/-/adler-32-1.2.0.tgz",
+ "integrity": "sha512-/vUqU/UY4MVeFsg+SsK6c+/05RZXIHZMGJA+PX5JyWI0ZRcBpupnRuPLU/NXXoFwMYCPCoxIfElM2eS+DUXCqQ==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "exit-on-epipe": "~1.0.1",
+ "printj": "~1.1.0"
+ },
+ "bin": {
+ "adler32": "bin/adler32.njs"
+ },
+ "engines": {
+ "node": ">=0.8"
+ }
+ },
+ "node_modules/xlsx-js-style/node_modules/codepage": {
+ "version": "1.14.0",
+ "resolved": "https://registry.npmmirror.com/codepage/-/codepage-1.14.0.tgz",
+ "integrity": "sha512-iz3zJLhlrg37/gYRWgEPkaFTtzmnEv1h+r7NgZum2lFElYQPi0/5bnmuDfODHxfp0INEfnRqyfyeIJDbb7ahRw==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "commander": "~2.14.1",
+ "exit-on-epipe": "~1.0.1"
+ },
+ "bin": {
+ "codepage": "bin/codepage.njs"
+ },
+ "engines": {
+ "node": ">=0.8"
+ }
+ },
+ "node_modules/xlsx-js-style/node_modules/codepage/node_modules/commander": {
+ "version": "2.14.1",
+ "resolved": "https://registry.npmmirror.com/commander/-/commander-2.14.1.tgz",
+ "integrity": "sha512-+YR16o3rK53SmWHU3rEM3tPAh2rwb1yPcQX5irVn7mb0gXbwuCCrnkbV5+PBfETdfg1vui07nM6PCG1zndcjQw==",
+ "license": "MIT"
+ },
+ "node_modules/xlsx-js-style/node_modules/commander": {
+ "version": "2.17.1",
+ "resolved": "https://registry.npmmirror.com/commander/-/commander-2.17.1.tgz",
+ "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==",
+ "license": "MIT"
+ },
"node_modules/xmlbuilder": {
"version": "15.1.1",
"resolved": "https://registry.npmmirror.com/xmlbuilder/-/xmlbuilder-15.1.1.tgz",
diff --git a/package.json b/package.json
index 8bfb108..5ad690f 100644
--- a/package.json
+++ b/package.json
@@ -22,7 +22,8 @@
"bcryptjs": "^3.0.3",
"pkg": "^5.8.1",
"vue": "^3.5.22",
- "xlsx": "^0.18.5"
+ "xlsx": "^0.18.5",
+ "xlsx-js-style": "^1.2.0"
},
"devDependencies": {
"@tauri-apps/cli": "^2.10.1",
@@ -54,4 +55,4 @@
"dist/**/*"
]
}
-}
\ No newline at end of file
+}
diff --git a/src/components/layout/ExportPreview.vue b/src/components/layout/ExportPreview.vue
index 4c9528e..947f4bc 100644
--- a/src/components/layout/ExportPreview.vue
+++ b/src/components/layout/ExportPreview.vue
@@ -1,148 +1,193 @@
<template>
<Teleport to="body">
- <div v-if="visible" class="export-dialog-overlay" @mousedown.self="overlayMouseDownSelf = true" @mouseup.self="handleOverlayMouseUp">
+ <div v-if="visible" class="export-overlay"
+ @mousedown.self="overlayMouseDownSelf = true"
+ @mouseup.self="handleOverlayMouseUp">
<div class="export-dialog">
+
+ <!-- ── 标题栏 ── -->
<div class="dialog-header">
<h3>导出设置</h3>
<button class="close-btn" @click="$emit('close')">✕</button>
</div>
+ <!-- ── Tab 栏 ── -->
+ <div class="tab-bar">
+ <button :class="['tab-btn', { active: activeTab === 'image' }]" @click="activeTab = 'image'">
+ 图片导出
+ </button>
+ <button :class="['tab-btn', { active: activeTab === 'excel' }]" @click="activeTab = 'excel'">
+ Excel 导出
+ </button>
+ </div>
+
+ <!-- ── 主体 ── -->
<div class="dialog-body">
- <!-- 左侧:设置面板 -->
+
+ <!-- 设置面板 -->
<div class="settings-panel">
- <div class="settings-section">
- <h4>基础设置</h4>
- <div class="setting-row">
- <label>标题:</label>
- <input v-model="exportSettings.title" type="text" placeholder="班级座位表" />
- </div>
- <label class="check-item">
- <input type="checkbox" v-model="exportSettings.showTitle" />
- <span>显示标题</span>
- </label>
- <label class="check-item">
- <input type="checkbox" v-model="exportSettings.showRowNumbers" />
- <span>显示行号</span>
- </label>
- <label class="check-item">
- <input type="checkbox" v-model="exportSettings.showGroupLabels" />
- <span>显示组号</span>
- </label>
- <label class="check-item">
- <input type="checkbox" v-model="exportSettings.showPodium" />
- <span>显示讲台</span>
- </label>
- <div class="mode-row">
- <span class="mode-label">模式:</span>
- <label class="radio-item"><input type="radio" value="color" v-model="exportSettings.colorMode" /><span>彩色</span></label>
- <label class="radio-item"><input type="radio" value="bw" v-model="exportSettings.colorMode" /><span>灰度</span></label>
- <label class="radio-item"><input type="radio" value="pureBw" v-model="exportSettings.colorMode" /><span>黑白</span></label>
- </div>
- </div>
-
- <div class="settings-section">
- <h4>间距</h4>
- <div class="spacing-grid">
- <div class="num-input">
- <label>列间距</label>
- <input type="number" v-model.number="exportSettings.colGap" min="0" max="100" />
- </div>
- <div class="num-input">
- <label>行间距</label>
- <input type="number" v-model.number="exportSettings.rowGap" min="0" max="100" />
- </div>
- <div class="num-input">
- <label>组间距</label>
- <input type="number" v-model.number="exportSettings.groupGap" min="0" max="200" />
+
+ <!-- ======== 图片设置 ======== -->
+ <template v-if="activeTab === 'image'">
+ <div class="settings-section">
+ <h4>基础设置</h4>
+ <div class="setting-row">
+ <label>标题:</label>
+ <input v-model="exportSettings.title" type="text" placeholder="班级座位表" />
</div>
- <div class="num-input">
- <label>边距</label>
- <input type="number" v-model.number="exportSettings.padding" min="0" max="100" />
+ <label class="check-item"><input type="checkbox" v-model="exportSettings.showTitle" /><span>显示标题</span></label>
+ <label class="check-item"><input type="checkbox" v-model="exportSettings.showRowNumbers" /><span>显示行号</span></label>
+ <label class="check-item"><input type="checkbox" v-model="exportSettings.showGroupLabels" /><span>显示组号</span></label>
+ <label class="check-item"><input type="checkbox" v-model="exportSettings.showPodium" /><span>显示讲台</span></label>
+ <label class="check-item"><input type="checkbox" v-model="exportSettings.reverseOrder" /><span>翻转行序(讲台置顶)</span></label>
+ <div class="mode-row">
+ <span class="mode-label">模式:</span>
+ <label class="radio-item"><input type="radio" value="color" v-model="exportSettings.colorMode" /><span>彩色</span></label>
+ <label class="radio-item"><input type="radio" value="bw" v-model="exportSettings.colorMode" /><span>灰度</span></label>
+ <label class="radio-item"><input type="radio" value="pureBw" v-model="exportSettings.colorMode" /><span>黑白</span></label>
</div>
</div>
- </div>
-
- <div class="settings-section">
- <h4>标签</h4>
- <label class="check-item">
- <input type="checkbox" v-model="exportSettings.enableTagLabels" />
- <span>启用标签</span>
- </label>
- <div v-if="exportSettings.enableTagLabels && tags.length > 0" class="tag-list">
- <div v-for="tag in tags" :key="tag.id" class="tag-row">
- <label class="check-item" v-if="tagSettingsLocal[tag.id]">
- <input type="checkbox" v-model="tagSettingsLocal[tag.id].enabled" @change="syncTagSettings" />
- <span class="tag-dot" :style="{ backgroundColor: tag.color }"></span>
- <span>{{ tag.name }}</span>
- </label>
- <input v-if="tagSettingsLocal[tag.id] && tagSettingsLocal[tag.id].enabled"
- type="text" v-model="tagSettingsLocal[tag.id].displayText"
- @input="syncTagSettings" class="tag-input"
- placeholder="显示文本" maxlength="4" />
+
+ <div class="settings-section">
+ <h4>间距</h4>
+ <div class="spacing-grid">
+ <div class="num-input"><label>列间距</label><input type="number" v-model.number="exportSettings.colGap" min="0" max="100" /></div>
+ <div class="num-input"><label>行间距</label><input type="number" v-model.number="exportSettings.rowGap" min="0" max="100" /></div>
+ <div class="num-input"><label>组间距</label><input type="number" v-model.number="exportSettings.groupGap" min="0" max="200" /></div>
+ <div class="num-input"><label>边距</label><input type="number" v-model.number="exportSettings.padding" min="0" max="100" /></div>
</div>
</div>
- </div>
-
- <div class="settings-section">
- <h4>字号</h4>
- <div class="spacing-grid">
- <div class="num-input">
- <label>姓名</label>
- <input type="number" v-model.number="exportSettings.fontSizeName" min="8" max="60" />
- </div>
- <div class="num-input">
- <label>学号</label>
- <input type="number" v-model.number="exportSettings.fontSizeStudentId" min="8" max="60" />
+
+ <div class="settings-section">
+ <h4>标签</h4>
+ <label class="check-item"><input type="checkbox" v-model="exportSettings.enableTagLabels" /><span>启用标签</span></label>
+ <div v-if="exportSettings.enableTagLabels && tags.length > 0" class="tag-list">
+ <div v-for="tag in tags" :key="tag.id" class="tag-row">
+ <label class="check-item" v-if="tagSettingsLocal[tag.id]">
+ <input type="checkbox" v-model="tagSettingsLocal[tag.id].enabled" @change="syncTagSettings" />
+ <span class="tag-dot" :style="{ backgroundColor: tag.color }"></span>
+ <span>{{ tag.name }}</span>
+ </label>
+ <input v-if="tagSettingsLocal[tag.id] && tagSettingsLocal[tag.id].enabled"
+ type="text" v-model="tagSettingsLocal[tag.id].displayText"
+ @input="syncTagSettings" class="tag-input"
+ placeholder="显示文本" maxlength="4" />
+ </div>
</div>
- <div class="num-input">
- <label>标题</label>
- <input type="number" v-model.number="exportSettings.fontSizeTitle" min="8" max="80" />
+ </div>
+
+ <div class="settings-section">
+ <h4>字号</h4>
+ <div class="spacing-grid">
+ <div class="num-input"><label>姓名</label><input type="number" v-model.number="exportSettings.fontSizeName" min="8" max="60" /></div>
+ <div class="num-input"><label>学号</label><input type="number" v-model.number="exportSettings.fontSizeStudentId" min="8" max="60" /></div>
+ <div class="num-input"><label>标题</label><input type="number" v-model.number="exportSettings.fontSizeTitle" min="8" max="80" /></div>
+ <div class="num-input"><label>行号</label><input type="number" v-model.number="exportSettings.fontSizeRowNumber" min="8" max="40" /></div>
+ <div class="num-input"><label>组号</label><input type="number" v-model.number="exportSettings.fontSizeGroupLabel" min="8" max="40" /></div>
+ <div class="num-input"><label>讲台</label><input type="number" v-model.number="exportSettings.fontSizePodium" min="8" max="40" /></div>
+ <div class="num-input"><label>标签</label><input type="number" v-model.number="exportSettings.fontSizeTag" min="8" max="30" /></div>
</div>
- <div class="num-input">
- <label>行号</label>
- <input type="number" v-model.number="exportSettings.fontSizeRowNumber" min="8" max="40" />
+ </div>
+
+ <div class="settings-section">
+ <h4>位置微调</h4>
+ <div class="spacing-grid">
+ <div class="num-input"><label>姓名 Y 偏移</label><input type="number" v-model.number="exportSettings.offsetYName" min="-100" max="100" /></div>
+ <div class="num-input"><label>学号 Y 偏移</label><input type="number" v-model.number="exportSettings.offsetYStudentId" min="-100" max="100" /></div>
</div>
- <div class="num-input">
- <label>组号</label>
- <input type="number" v-model.number="exportSettings.fontSizeGroupLabel" min="8" max="40" />
+ </div>
+ </template>
+
+ <!-- ======== Excel 设置 ======== -->
+ <template v-else>
+ <div class="settings-section">
+ <h4>内容</h4>
+ <div class="setting-row">
+ <label>标题文字:</label>
+ <input v-model="exportSettings.title" type="text" placeholder="班级座位表" />
</div>
- <div class="num-input">
- <label>讲台</label>
- <input type="number" v-model.number="exportSettings.fontSizePodium" min="8" max="40" />
+ <label class="check-item"><input type="checkbox" v-model="exportSettings.excelShowTitle" /><span>显示标题行</span></label>
+ <label class="check-item"><input type="checkbox" v-model="exportSettings.excelShowGroupLabels" /><span>显示组号行</span></label>
+ <label class="check-item"><input type="checkbox" v-model="exportSettings.excelShowRowNumbers" /><span>显示行号列</span></label>
+ <label class="check-item"><input type="checkbox" v-model="exportSettings.excelShowStudentId" /><span>格子内显示学号</span></label>
+ <label class="check-item"><input type="checkbox" v-model="exportSettings.excelShowPodium" /><span>显示讲台行</span></label>
+ <label class="check-item"><input type="checkbox" v-model="exportSettings.excelReverseOrder" /><span>翻转行序(讲台置顶)</span></label>
+ </div>
+
+ <div class="settings-section">
+ <h4>外观</h4>
+ <div class="mode-row">
+ <span class="mode-label">配色:</span>
+ <label class="radio-item"><input type="radio" value="color" v-model="exportSettings.excelColorMode" /><span>彩色</span></label>
+ <label class="radio-item"><input type="radio" value="bw" v-model="exportSettings.excelColorMode" /><span>单色</span></label>
</div>
- <div class="num-input">
- <label>标签</label>
- <input type="number" v-model.number="exportSettings.fontSizeTag" min="8" max="30" />
+ <div class="spacing-grid" style="margin-top:8px">
+ <div class="num-input"><label>姓名字号(pt)</label><input type="number" v-model.number="exportSettings.excelNameFontSize" min="8" max="24" /></div>
+ <div class="num-input"><label>学号字号(pt)</label><input type="number" v-model.number="exportSettings.excelIdFontSize" min="6" max="18" /></div>
+ <div class="num-input"><label>列宽(字符)</label><input type="number" v-model.number="exportSettings.excelCellWidth" min="6" max="30" /></div>
+ <div class="num-input"><label>行高(点)</label><input type="number" v-model.number="exportSettings.excelSeatRowHeight" min="20" max="100" /></div>
</div>
</div>
- </div>
-
- <div class="settings-section">
- <h4>位置微调</h4>
- <div class="spacing-grid">
- <div class="num-input">
- <label>姓名 Y 偏移</label>
- <input type="number" v-model.number="exportSettings.offsetYName" min="-100" max="100" />
- </div>
- <div class="num-input">
- <label>学号 Y 偏移</label>
- <input type="number" v-model.number="exportSettings.offsetYStudentId" min="-100" max="100" />
+
+ <div class="settings-section">
+ <h4>标签统计表</h4>
+ <label class="check-item">
+ <input type="checkbox" v-model="exportSettings.excelShowTagTable" />
+ <span>导出标签统计</span>
+ </label>
+ <div v-if="exportSettings.excelShowTagTable" class="tag-table-options">
+ <div class="mode-row" style="margin-top:6px">
+ <span class="mode-label">位置:</span>
+ <label class="radio-item"><input type="radio" :value="false" v-model="exportSettings.excelTagTableNewSheet" /><span>座位下方</span></label>
+ <label class="radio-item"><input type="radio" :value="true" v-model="exportSettings.excelTagTableNewSheet" /><span>新工作表</span></label>
+ </div>
+ <div v-if="tags.length === 0" class="tag-empty-hint">暂无标签数据</div>
+ <div v-else class="tag-preview-list">
+ <div v-for="tag in tags" :key="tag.id" class="tag-preview-item">
+ <span class="tag-dot" :style="{ backgroundColor: tag.color }"></span>
+ <span>{{ tag.name }}</span>
+ <span class="tag-count">{{ getTagStudentCount(tag.id) }}人</span>
+ </div>
+ </div>
</div>
</div>
- </div>
+ </template>
</div>
- <!-- 右侧:实时预览 -->
+ <!-- 预览面板 -->
<div class="preview-panel">
- <div v-if="isGenerating" class="preview-loading">正在生成预览...</div>
- <img v-else-if="previewUrl" :src="previewUrl" alt="预览" class="preview-img" />
- <div v-else class="preview-empty">调整设置后自动生成预览</div>
+ <!-- 图片预览 -->
+ <template v-if="activeTab === 'image'">
+ <div v-if="isGenerating" class="preview-loading">正在生成预览...</div>
+ <img v-else-if="previewUrl" :src="previewUrl" alt="预览" class="preview-img" />
+ <div v-else class="preview-empty">调整设置后自动生成预览</div>
+ </template>
+
+ <!-- Excel 预览 -->
+ <template v-else>
+ <div class="excel-preview-wrap">
+ <div class="excel-preview-hint">预览(与实际 Excel 文件布局一致)</div>
+ <div class="excel-preview-scroll" ref="excelScrollRef">
+ <div class="excel-preview-scale-wrapper" :style="{ zoom: Math.min(1, excelScale) }">
+ <div v-html="excelPreviewHtml" class="excel-preview-content" ref="excelContentRef"></div>
+ </div>
+ </div>
+ </div>
+ </template>
</div>
</div>
+ <!-- ── 底部按钮 ── -->
<div class="dialog-footer">
<button class="btn secondary" @click="$emit('close')">关闭</button>
- <button class="btn primary" :disabled="isGenerating" @click="handleDownload">下载图片</button>
+ <template v-if="activeTab === 'image'">
+ <button class="btn primary" :disabled="isGenerating" @click="handleDownload">下载图片</button>
+ </template>
+ <template v-else>
+ <button class="btn excel" :disabled="isExcelDownloading" @click="handleExcelDownload">
+ {{ isExcelDownloading ? '生成中...' : '下载 Excel' }}
+ </button>
+ </template>
</div>
</div>
</div>
@@ -150,57 +195,286 @@
</template>
<script setup>
-import { ref, watch, onMounted, onBeforeUnmount } from 'vue'
+import { ref, computed, watch, onMounted, onBeforeUnmount, nextTick } from 'vue'
import { useExportSettings } from '@/composables/useExportSettings'
import { useImageExport } from '@/composables/useImageExport'
import { useTagData } from '@/composables/useTagData'
+import { useExcelData } from '@/composables/useExcelData'
+import { useSeatChart } from '@/composables/useSeatChart'
+import { useStudentData } from '@/composables/useStudentData'
-const props = defineProps({
- visible: { type: Boolean, default: false }
-})
-
+const props = defineProps({ visible: { type: Boolean, default: false } })
const emit = defineEmits(['close', 'exported'])
const { exportSettings, initializeTagSettings, updateTagSetting } = useExportSettings()
const { exportToImage } = useImageExport()
const { tags } = useTagData()
+const { exportSeatChartToExcel } = useExcelData()
+const { organizedSeats, seatConfig } = useSeatChart()
+const { students } = useStudentData()
+const activeTab = ref('image')
const previewUrl = ref('')
const isGenerating = ref(false)
+const isExcelDownloading = ref(false)
const tagSettingsLocal = ref({})
let debounceTimer = null
-// 防止鼠标从弹窗内拖出后意外关闭:需要 mousedown 和 mouseup 都在 overlay 自身上才关闭
+const excelScrollRef = ref(null)
+const excelContentRef = ref(null)
+const excelScale = ref(1)
+let excelResizeObserver = null
+
+const updateExcelScale = () => {
+ if (!excelScrollRef.value || !excelContentRef.value || activeTab.value !== 'excel') return
+ const contentEl = excelContentRef.value.firstElementChild
+ if (!contentEl) return
+ const scrollWidth = excelScrollRef.value.clientWidth
+ const contentWidth = contentEl.offsetWidth
+ if (contentWidth > 0 && contentWidth > scrollWidth - 30) {
+ excelScale.value = (scrollWidth - 30) / contentWidth
+ } else {
+ excelScale.value = 1
+ }
+}
+
+// overlay 点击关闭保护(防止从弹窗内拖出后关闭)
const overlayMouseDownSelf = ref(false)
const handleOverlayMouseUp = () => {
- if (overlayMouseDownSelf.value) {
- emit('close')
- }
+ if (overlayMouseDownSelf.value) emit('close')
overlayMouseDownSelf.value = false
}
-// 初始化标签本地副本
+// ── 标签人数统计 ──
+const getTagStudentCount = (tagId) => {
+ return students.value.filter(s => s.tags && s.tags.includes(tagId)).length
+}
+
+// ── HTML 转义(防止学生名字中含有 < > & 等字符破坏预览)
+const esc = (str) => String(str ?? '').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')
+
+// ── Excel 预览(computed,仿真 Excel 界面,实时响应设置变化)──
+const excelPreviewHtml = computed(() => {
+ if (activeTab.value !== 'excel') return ''
+
+ const es = exportSettings.value
+ const { groupCount, columnsPerGroup, seatsPerColumn } = seatConfig.value
+ const isBw = es.excelColorMode === 'bw'
+ const isReversed = es.excelReverseOrder
+
+ const clr = {
+ header: isBw ? '#444' : '#23587B',
+ headerTxt: '#fff',
+ rowNumBg: isBw ? '#e8e8e8' : '#D6E8F4',
+ rowNumTxt: isBw ? '#333' : '#23587B',
+ podiumBg: isBw ? '#d0d0d0' : '#D6E8F4',
+ podiumTxt: isBw ? '#333' : '#23587B',
+ emptyBg: isBw ? '#d8d8d8' : '#F0F0F0',
+ emptyTxt: '#999',
+ vacantBg: '#FAFAFA',
+ titleBg: isBw ? '#e8e8e8' : '#D6E8F4',
+ }
+
+ const fs = es.excelNameFontSize || 12
+ const idFs = es.excelIdFontSize || 10
+ const cw = Math.max(50, (es.excelCellWidth || 10) * 7) // px
+ const rh = Math.max(24, (es.excelSeatRowHeight || 40) * 0.85) // px (scaled for preview)
+
+ // Helper: Excel column letter (0-indexed)
+ const colLetter = (n) => n < 26
+ ? String.fromCharCode(65 + n)
+ : String.fromCharCode(64 + Math.floor(n / 26)) + String.fromCharCode(65 + n % 26)
+
+ const studentMap = new Map(students.value.map(s => [s.id, s]))
+
+ // ── Inline style shorthands ──
+ const S = {
+ // 纯净简约外壳
+ shell: `font-family:Calibri,'Microsoft YaHei',sans-serif;display:inline-block;border:1px solid #d0d0d0;box-shadow:0 4px 12px rgba(0,0,0,.08);background:#fff;`,
+ grid: `overflow:auto;background:#e6e6e6;`,
+ // 行和列的原生标号头风格
+ corner: `background:#f0f0f0;border-right:1px solid #d0d0d0;border-bottom:1px solid #d0d0d0;width:30px;min-width:30px;`,
+ colHead: `background:#f0f0f0;border-right:1px solid #d0d0d0;border-bottom:1px solid #d0d0d0;text-align:center;font-size:11.5px;font-weight:normal;color:#444;padding:2px;line-height:18px;`,
+ rowHead: `background:#f0f0f0;border-right:1px solid #d0d0d0;border-bottom:1px solid #d0d0d0;text-align:center;font-size:11.5px;color:#444;padding:2px;min-width:30px;line-height:18px;white-space:nowrap;`,
+ // Data cell styles (unstyled raw Excel look)
+ titleCell:`background:#fff;color:#000;text-align:center;font-weight:bold;font-size:${fs + 2}px;padding:4px;border:1px solid #d0d0d0;vertical-align:middle;`,
+ grpHead: `background:#fff;color:#000;text-align:center;font-weight:bold;font-size:${fs}px;padding:4px 6px;border:1px solid #d0d0d0;vertical-align:middle;`,
+ rowNum: `background:#fff;color:#000;text-align:center;font-weight:bold;font-size:${fs - 1}px;padding:3px 5px;border:1px solid #d0d0d0;white-space:nowrap;vertical-align:middle;`,
+ seat: `background:#fff;color:#000;text-align:center;font-size:${fs}px;padding:3px 5px;border:1px solid #d0d0d0;vertical-align:middle;min-width:${cw}px;`,
+ empty: `background:#fff;color:#999;text-align:center;font-size:${fs - 1}px;padding:3px 5px;border:1px solid #d0d0d0;vertical-align:middle;`,
+ vacant: `background:#fff;color:#000;text-align:center;font-size:${fs}px;padding:3px 5px;border:1px dashed #d0d0d0;vertical-align:middle;min-width:${cw}px;`,
+ gap: `width:12px;background:#fff;border-top:1px solid #d0d0d0;border-bottom:1px solid #d0d0d0;`,
+ podium: `background:#fff;color:#000;text-align:center;font-weight:bold;font-size:${fs}px;padding:5px;border:1px solid #d0d0d0;vertical-align:middle;`,
+ tagHead: `background:#fff;color:#000;text-align:center;font-weight:bold;font-size:${fs}px;padding:4px 6px;border:1px solid #d0d0d0;`,
+ tagCell: `background:#fff;color:#000;font-size:${fs}px;padding:3px 6px;border:1px solid #d0d0d0;vertical-align:middle;`,
+ }
+
+ // ── Compute data column count (for Excel column letters) ──
+ const dataCols = (es.excelShowRowNumbers ? 1 : 0)
+ + groupCount * columnsPerGroup
+ + (groupCount - 1)
+
+ // Build rows in order for column header assignment
+ let colLetters = []
+ for (let i = 0; i < dataCols; i++) colLetters.push(colLetter(i))
+
+ const titleText = esc(es.title || '班级座位表')
+
+ // ── Start building HTML ──
+ let html = `<div style="${S.shell}">`
+
+ // Grid
+ html += `<div style="${S.grid}"><table style="border-collapse:collapse;font-family:inherit;color:#000;margin:0;">`
+
+ // ── Column header row (corner + A B C ...) ──
+ html += `<thead><tr style="height:18px;">`
+ html += `<th style="${S.corner}"></th>`
+ for (let i = 0; i < dataCols; i++) {
+ html += `<th style="${S.colHead}min-width:${i === 0 && es.excelShowRowNumbers ? 52 : cw}px;">${colLetters[i]}</th>`
+ }
+ html += `</tr></thead>`
+
+ html += `<tbody>`
+ let xlRow = 1 // Excel row counter shown in row headers
+
+ // ── 1. Title row ──
+ if (es.excelShowTitle) {
+ html += `<tr style="height:28px;">`
+ html += `<td style="${S.rowHead}">${xlRow++}</td>`
+ html += `<td colspan="${dataCols}" style="${S.titleCell}">${titleText}</td>`
+ html += `</tr>`
+ }
+
+ // ── 2. Podium at top (if reversed) ──
+ if (es.excelShowPodium && isReversed) {
+ html += `<tr style="height:22px;">`
+ html += `<td style="${S.rowHead}">${xlRow++}</td>`
+ html += `<td colspan="${dataCols}" style="${S.podium}">讲台</td>`
+ html += `</tr>`
+ }
+
+ // ── 3. Group label row ──
+ if (es.excelShowGroupLabels) {
+ html += `<tr style="height:22px;">`
+ html += `<td style="${S.rowHead}">${xlRow++}</td>`
+ if (es.excelShowRowNumbers) {
+ // 在 Excel 文件中它是个普通空占位格,没有独立样式
+ html += `<td style="border:1px solid #d0d0d0;background:#fff;min-width:52px;"></td>`
+ }
+ for (let g = 0; g < groupCount; g++) {
+ html += `<th colspan="${columnsPerGroup}" style="${S.grpHead}min-width:${cw * columnsPerGroup}px;">第 ${g + 1} 组</th>`
+ if (g < groupCount - 1) html += `<td style="${S.gap}"></td>`
+ }
+ html += `</tr>`
+ }
+
+ // ── 4. Seat rows ──
+ const rowRange = Array.from({ length: seatsPerColumn }, (_, i) => i)
+ const rows = isReversed ? [...rowRange].reverse() : rowRange
+
+ for (const r of rows) {
+ const displayRow = seatsPerColumn - r
+ const rowHt = rh
+ html += `<tr style="height:${rowHt}px;">`
+ html += `<td style="${S.rowHead}">${xlRow++}</td>`
+ if (es.excelShowRowNumbers) {
+ html += `<td style="${S.rowNum}">第${displayRow}排</td>`
+ }
+ for (let g = 0; g < groupCount; g++) {
+ for (let c = 0; c < columnsPerGroup; c++) {
+ const seat = organizedSeats.value[g]?.[c]?.[r]
+ if (!seat) {
+ html += `<td style="${S.vacant}"></td>`
+ } else if (seat.isEmpty) {
+ html += `<td style="${S.empty}">空置</td>`
+ } else if (seat.studentId) {
+ const stu = studentMap.get(seat.studentId)
+ if (stu) {
+ let content = `<div style="font-weight:bold;color:#000;font-size:${fs}px;line-height:1.3;">${esc(stu.name)}</div>`
+ if (es.excelShowStudentId && stu.studentNumber) {
+ content += `<div style="color:#888;font-size:${idFs}px;line-height:1.2;">${esc(stu.studentNumber)}</div>`
+ }
+ html += `<td style="${S.seat}">${content}</td>`
+ } else {
+ html += `<td style="${S.vacant}"></td>`
+ }
+ } else {
+ html += `<td style="${S.vacant}"></td>`
+ }
+ }
+ if (g < groupCount - 1) html += `<td style="${S.gap}"></td>`
+ }
+ html += `</tr>`
+ }
+
+ // ── 5. Podium at bottom (normal order) ──
+ if (es.excelShowPodium && !isReversed) {
+ html += `<tr style="height:22px;">`
+ html += `<td style="${S.rowHead}">${xlRow++}</td>`
+ html += `<td colspan="${dataCols}" style="${S.podium}">讲台</td>`
+ html += `</tr>`
+ }
+
+ // ── 6. Tag table (inline, if not on new sheet) ──
+ if (es.excelShowTagTable && tags.value.length > 0 && !es.excelTagTableNewSheet) {
+ const hasData = tags.value.some(t => getTagStudentCount(t.id) > 0)
+ if (hasData) {
+ // 2 gap rows
+ for (let i = 0; i < 2; i++) {
+ html += `<tr style="height:16px;"><td style="${S.rowHead}">${xlRow++}</td>`
+ for (let c = 0; c < dataCols; c++) {
+ html += `<td style="border:1px solid #d0d0d0;background:#fff;"></td>`
+ }
+ html += `</tr>`
+ }
+ // Tag table title
+ html += `<tr style="height:22px;"><td style="${S.rowHead}">${xlRow++}</td>`
+ html += `<td colspan="3" style="${S.tagHead}">标签统计</td>`
+ html += `<td colspan="${Math.max(1, dataCols - 3)}" style="border:1px solid #d0d0d0;background:#fff;"></td></tr>`
+ // Tag table header
+ html += `<tr style="height:22px;"><td style="${S.rowHead}">${xlRow++}</td>`
+ html += `<td style="${S.tagHead}min-width:80px;">标签</td>`
+ html += `<td style="${S.tagHead}min-width:50px;">人数</td>`
+ html += `<td style="${S.tagHead}min-width:180px;">学生名单</td>`
+ html += `<td colspan="${Math.max(1, dataCols - 3)}" style="border:1px solid #d0d0d0;background:#fff;"></td></tr>`
+ for (const tag of tags.value) {
+ const tagStus = students.value.filter(s => s.tags && s.tags.includes(tag.id))
+ if (tagStus.length === 0) continue
+ const dot = `<span style="display:inline-block;width:8px;height:8px;border-radius:50%;background:${tag.color};margin-right:4px;vertical-align:middle;"></span>`
+ html += `<tr style="height:${rh * 0.7}px;"><td style="${S.rowHead}">${xlRow++}</td>`
+ html += `<td style="${S.tagCell}text-align:center;">${dot}${esc(tag.name)}</td>`
+ html += `<td style="${S.tagCell}text-align:center;font-weight:bold;">${tagStus.length}人</td>`
+ html += `<td style="${S.tagCell}">${tagStus.map(s => esc(s.name)).join('、')}</td>`
+ html += `<td colspan="${Math.max(1, dataCols - 3)}" style="border:1px solid #d0d0d0;background:#fff;"></td></tr>`
+ }
+ }
+ }
+
+ html += `</tbody></table></div></div>`
+ return html
+})
+
+
+// ── 标签本地副本 ──
const initTagLocal = () => {
const s = {}
tags.value.forEach(tag => {
s[tag.id] = {
- enabled: exportSettings.value.tagSettings[tag.id]?.enabled ?? true,
+ enabled: exportSettings.value.tagSettings[tag.id]?.enabled ?? true,
displayText: exportSettings.value.tagSettings[tag.id]?.displayText ?? tag.name.substring(0, 2)
}
})
tagSettingsLocal.value = s
}
-// 同步标签设置到 store,并触发预览刷新
const syncTagSettings = () => {
Object.keys(tagSettingsLocal.value).forEach(tagId => {
updateTagSetting(parseInt(tagId), tagSettingsLocal.value[tagId])
})
- // 手动触发预览更新(deep watch 不一定能捕获对 tagSettings 的就地修改)
generatePreview()
}
-// 生成预览(防抖)
+// ── 图片预览(防抖)──
const generatePreview = () => {
if (debounceTimer) clearTimeout(debounceTimer)
debounceTimer = setTimeout(async () => {
@@ -215,19 +489,14 @@ const generatePreview = () => {
}, 300)
}
-// 下载
+// ── 下载图片 ──
const handleDownload = async () => {
let url = previewUrl.value
if (!url) {
isGenerating.value = true
- try {
- url = await exportToImage()
- previewUrl.value = url
- } catch {
- return
- } finally {
- isGenerating.value = false
- }
+ try { url = await exportToImage(); previewUrl.value = url }
+ catch { return }
+ finally { isGenerating.value = false }
}
const link = document.createElement('a')
link.href = url
@@ -239,7 +508,41 @@ const handleDownload = async () => {
emit('exported', url)
}
-// 监听所有设置变化 → 实时预览
+// ── 下载 Excel ──
+const handleExcelDownload = async () => {
+ isExcelDownloading.value = true
+ try {
+ const es = exportSettings.value
+ exportSeatChartToExcel(
+ organizedSeats.value,
+ students.value,
+ tags.value,
+ seatConfig.value,
+ {
+ showStudentId: es.excelShowStudentId,
+ showRowNumbers: es.excelShowRowNumbers,
+ showGroupLabels: es.excelShowGroupLabels,
+ showTitle: es.excelShowTitle,
+ showPodium: es.excelShowPodium,
+ reverseOrder: es.excelReverseOrder,
+ colorMode: es.excelColorMode,
+ nameFontSize: es.excelNameFontSize,
+ idFontSize: es.excelIdFontSize,
+ cellWidth: es.excelCellWidth,
+ seatRowHeight: es.excelSeatRowHeight,
+ showTagTable: es.excelShowTagTable,
+ tagTableNewSheet: es.excelTagTableNewSheet,
+ title: es.title || '班级座位表'
+ }
+ )
+ } catch (e) {
+ console.error('Excel 导出失败', e)
+ } finally {
+ isExcelDownloading.value = false
+ }
+}
+
+// ── 监听图片设置变化 → 触发图片预览 ──
watch(
() => [
exportSettings.value.title,
@@ -247,6 +550,7 @@ watch(
exportSettings.value.showRowNumbers,
exportSettings.value.showGroupLabels,
exportSettings.value.showPodium,
+ exportSettings.value.reverseOrder,
exportSettings.value.colorMode,
exportSettings.value.enableTagLabels,
exportSettings.value.colGap,
@@ -264,22 +568,29 @@ watch(
exportSettings.value.offsetYName,
exportSettings.value.offsetYStudentId,
],
- () => {
- if (props.visible) generatePreview()
- },
+ () => { if (props.visible && activeTab.value === 'image') generatePreview() },
{ deep: true }
)
-// 弹窗打开时初始化
+// ── 切换到 Tab 时触发预览或缩放 ──
+watch(activeTab, (v) => {
+ if (v === 'image' && props.visible) generatePreview()
+ if (v === 'excel' && props.visible) nextTick(updateExcelScale)
+})
+
+watch(() => excelPreviewHtml.value, () => {
+ if (activeTab.value === 'excel' && props.visible) nextTick(updateExcelScale)
+})
+
+// ── 弹窗打开时初始化 ──
watch(() => props.visible, (v) => {
if (v) {
initializeTagSettings(tags.value)
initTagLocal()
- generatePreview()
+ if (activeTab.value === 'image') generatePreview()
}
})
-// tags 变化
watch(tags, () => {
initializeTagSettings(tags.value)
initTagLocal()
@@ -288,15 +599,21 @@ watch(tags, () => {
onMounted(() => {
initializeTagSettings(tags.value)
initTagLocal()
+ if (excelScrollRef.value) {
+ excelResizeObserver = new ResizeObserver(() => updateExcelScale())
+ excelResizeObserver.observe(excelScrollRef.value)
+ }
})
onBeforeUnmount(() => {
if (debounceTimer) clearTimeout(debounceTimer)
+ if (excelResizeObserver) excelResizeObserver.disconnect()
})
</script>
<style scoped>
-.export-dialog-overlay {
+/* ── 遮罩 ── */
+.export-overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.55);
@@ -307,12 +624,9 @@ onBeforeUnmount(() => {
backdrop-filter: blur(3px);
animation: fadeIn 0.15s ease;
}
+@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
-@keyframes fadeIn {
- from { opacity: 0; }
- to { opacity: 1; }
-}
-
+/* ── 对话框 ── */
.export-dialog {
background: white;
border-radius: 16px;
@@ -324,12 +638,9 @@ onBeforeUnmount(() => {
max-height: 90vh;
animation: slideUp 0.2s ease;
}
+@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
-@keyframes slideUp {
- from { transform: translateY(16px); opacity: 0; }
- to { transform: translateY(0); opacity: 1; }
-}
-
+/* ── 标题栏 ── */
.dialog-header {
display: flex;
justify-content: space-between;
@@ -338,34 +649,40 @@ onBeforeUnmount(() => {
border-bottom: 1px solid #e8eef2;
flex-shrink: 0;
}
-
-.dialog-header h3 {
- margin: 0;
- font-size: 17px;
- font-weight: 600;
- color: #23587b;
+.dialog-header h3 { margin: 0; font-size: 17px; font-weight: 600; color: #23587b; }
+.close-btn {
+ width: 30px; height: 30px; border: none; background: #f0f0f0;
+ border-radius: 8px; cursor: pointer; font-size: 15px; color: #666;
+ display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
+.close-btn:hover { background: #e0e0e0; color: #333; }
-.close-btn {
- width: 30px;
- height: 30px;
+/* ── Tab 栏 ── */
+.tab-bar {
+ display: flex;
+ gap: 2px;
+ padding: 10px 20px 0;
+ border-bottom: 1px solid #e8eef2;
+ flex-shrink: 0;
+ background: #fafbfc;
+}
+.tab-btn {
+ padding: 8px 20px;
border: none;
- background: #f0f0f0;
- border-radius: 8px;
+ background: transparent;
+ border-radius: 8px 8px 0 0;
+ font-size: 13px;
+ font-weight: 500;
+ color: #888;
cursor: pointer;
- font-size: 15px;
- color: #666;
- display: flex;
- align-items: center;
- justify-content: center;
transition: all 0.15s;
+ border-bottom: 2px solid transparent;
+ margin-bottom: -1px;
}
+.tab-btn:hover { color: #23587b; background: #edf3f8; }
+.tab-btn.active { color: #23587b; font-weight: 700; border-bottom: 2px solid #23587b; background: white; }
-.close-btn:hover {
- background: #e0e0e0;
- color: #333;
-}