chengjie hai 6 meses
pai
achega
50427accf1
Modificáronse 1 ficheiros con 77 adicións e 18 borrados
  1. 77 18
      public/mg/mps_school.html

+ 77 - 18
public/mg/mps_school.html

@@ -15,12 +15,11 @@
15 15
         .main00 {
16 16
             width: 100%;
17 17
             height: 100vh;
18
-            /* 使用视口高度确保全屏 */
19 18
             min-height: 600px;
20
-            /* 设置最小高度 */
21 19
             background: white;
22 20
             display: flex;
23 21
             flex-direction: column;
22
+            overflow: hidden; /* 防止出现滚动条 */
24 23
         }
25 24
 
26 25
         .ListTop {
@@ -29,6 +28,7 @@
29 28
             background: white;
30 29
             border-bottom: 1px solid #EEEEEE;
31 30
             justify-content: flex-start;
31
+            flex-shrink: 0; /* 防止头部被压缩 */
32 32
         }
33 33
 
34 34
         .ListTop3 {
@@ -68,14 +68,12 @@
68 68
         .main0 {
69 69
             width: 100%;
70 70
             background: white;
71
-            align-items: flex-start;
72
-            height: calc(100vh - 60px);
73
-            /* 使用视口高度减去标题栏 */
74
-            min-height: 540px;
75
-            /* 600px - 60px */
71
+            flex: 1; /* 使用flex: 1代替固定高度 */
72
+            min-height: 0; /* 确保flex子项可以收缩 */
76 73
             overflow: hidden;
77
-            /* 防止内部滚动影响外部 */
78 74
             display: flex;
75
+            position: relative;
76
+            align-items: flex-start;
79 77
         }
80 78
 
81 79
         .school-list {
@@ -84,26 +82,29 @@
84 82
             background: #F9F9F9;
85 83
             display: flex;
86 84
             flex-direction: column;
87
-            align-items: flex-start;
88
-            height: calc(100vh - 120px);
89
-            /* 视口高度减去标题栏和搜索框 */
90
-            min-height: 480px;
91
-            /* 600px - 120px */
85
+            height: 100%;
92 86
             position: relative;
93 87
             flex-shrink: 0;
94
-            /* 防止flex压缩 */
95 88
         }
96 89
 
97 90
         .school-list-scrollable {
98 91
             flex: 1;
99 92
             overflow-y: auto;
100 93
             width: 100%;
94
+            min-height: 0; /* 确保flex子项可以收缩 */
95
+            display: flex;
96
+            flex-direction: column;
97
+        }
98
+
99
+        .search-box {
100
+            flex-shrink: 0; /* 防止搜索框被压缩 */
101 101
         }
102 102
 
103 103
         .school-detail {
104 104
             width: calc(100% - 400px);
105 105
             padding: 20px;
106 106
             overflow-y: auto;
107
+            margin-top: 50px;
107 108
         }
108 109
 
109 110
         .search-box {
@@ -111,12 +112,13 @@
111 112
             border-bottom: 1px solid #EEEEEE;
112 113
             background: white;
113 114
             width: 100%;
115
+            justify-content: center;
114 116
         }
115 117
 
116 118
         .search-input {
117 119
             width: 200px;
118 120
             height: 32px;
119
-            padding: 0 12px;
121
+            padding: 0 32px 0 12px;
120 122
             border: 1px solid #DDDDDD;
121 123
             border-radius: 4px;
122 124
             font-size: 14px;
@@ -432,6 +434,51 @@
432 434
         .toast.info {
433 435
             background: #2196F3;
434 436
         }
437
+        
438
+        /* 清空按钮样式 */
439
+        .clear-btn {
440
+            position: absolute;
441
+            right: 12px;
442
+            top: 50%;
443
+            transform: translateY(-50%);
444
+            width: 16px;
445
+            height: 16px;
446
+            background-color: #999;
447
+            border-radius: 50%;
448
+            display: flex;
449
+            align-items: center;
450
+            justify-content: center;
451
+            cursor: pointer;
452
+            transition: background-color 0.2s;
453
+        }
454
+        
455
+        .clear-btn:hover {
456
+            background-color: #666;
457
+        }
458
+        
459
+        .clear-x {
460
+            position: relative;
461
+            width: 8px;
462
+            height: 8px;
463
+        }
464
+        
465
+        .clear-x:before, .clear-x:after {
466
+            content: '';
467
+            position: absolute;
468
+            width: 8px;
469
+            height: 2px;
470
+            background-color: white;
471
+            top: 3px;
472
+            left: 0;
473
+        }
474
+        
475
+        .clear-x:before {
476
+            transform: rotate(45deg);
477
+        }
478
+        
479
+        .clear-x:after {
480
+            transform: rotate(-45deg);
481
+        }
435 482
     </style>
436 483
 </head>
437 484
 
@@ -446,8 +493,13 @@
446 493
             <!-- 左侧学校列表 -->
447 494
             <div class="school-list FlexColumn">
448 495
                 <div class="search-box FlexRow">
449
-                    <input type="text" class="search-input" v-model="searchText" @input="debounceSearch"
450
-                        @keyup.enter="searchSchools" placeholder="输入学校名称搜索...">
496
+                    <div style="position: relative;">
497
+                        <input type="text" class="search-input" v-model="searchText" @input="debounceSearch"
498
+                            @keyup.enter="searchSchools" placeholder="输入学校名称搜索...">
499
+                        <div class="clear-btn" v-show="searchText" @click="clearSearch">
500
+                            <span class="clear-x"></span>
501
+                        </div>
502
+                    </div>
451 503
                     <div class="btn33 btn31 btn FlexRow" @click="searchSchools">
452 504
                         <img title="搜索" alt="搜索"
453 505
                             src="https://kylx365-1253256735.file.myqcloud.com/web/universalpic_search_gray_30x30.png"
@@ -500,7 +552,9 @@
500 552
             </div>
501 553
 
502 554
             <!-- 右侧学校详情 -->
503
-            <div class="school-detail FlexColumn" v-if="!selectedSchool"></div>
555
+            <div class="school-detail FlexColumn" v-if="!selectedSchool">
556
+                <div style="font-size:36px;margin-top: 340px;">欢迎使用学校信息管理平台</div>
557
+            </div>
504 558
             <div class="school-detail FlexColumn" v-if="selectedSchool">
505 559
                 <form @submit.prevent="saveSchool">
506 560
                     <!-- 基本信息 -->
@@ -830,6 +884,11 @@
830 884
                     showToastFlag: false
831 885
                 },
832 886
                 methods: {
887
+                    // 清空搜索
888
+                    clearSearch() {
889
+                        this.searchText = '';
890
+                        this.loadDistricts();
891
+                    },
833 892
                     // 搜索学校
834 893
                     searchSchools() {
835 894
                         // 如果搜索框为空,恢复所有学校显示