Bladeren bron

🐛修改搜索大小写问题-pc

shaogen1995 2 jaren geleden
bovenliggende
commit
33d769a880

+ 7 - 2
web/src/views/Search/About.vue

@@ -1,5 +1,7 @@
 <template>
-  <div class="null" v-if="data.length === 0" tabindex="0">no information...</div>
+  <div class="null" v-if="data.length === 0" tabindex="0">
+    no information...
+  </div>
   <div class="SearchAbout" v-else>
     <div
       class="row"
@@ -51,7 +53,10 @@ export default {
       } else {
         let temp = [];
         temp = About.filter((v) => {
-          return v.h3.includes(txt) || v.p.includes(txt);
+          return (
+            v.h3.toLowerCase().includes(txt.toLowerCase()) ||
+            v.p.toLowerCase().includes(txt.toLowerCase())
+          );
         });
         //
         temp = temp.map((v) => {

+ 10 - 3
web/src/views/Search/All.vue

@@ -1,5 +1,7 @@
 <template>
-  <div class="null" v-if="data.length === 0" tabindex="0">no information...</div>
+  <div class="null" v-if="data.length === 0" tabindex="0">
+    no information...
+  </div>
   <div class="SearchAll" v-else>
     <div
       class="row"
@@ -12,7 +14,9 @@
       :aria-description="item.h3"
     >
       <div class="left" v-if="item.cover">
-        <img :src="item.cover" :alt="item.h3" 
+        <img
+          :src="item.cover"
+          :alt="item.h3"
           tabindex="0"
           aria-label="Image link"
           :aria-description="item.h3"
@@ -96,7 +100,10 @@ export default {
         temp = [...dataAll];
       } else {
         temp = dataAll.filter((v) => {
-          return v.h3.includes(txt) || v.p.includes(txt);
+          return (
+            v.h3.toLowerCase().includes(txt.toLowerCase()) ||
+            v.p.toLowerCase().includes(txt.toLowerCase())
+          );
         });
         //
         temp = temp.map((v) => {

+ 10 - 3
web/src/views/Search/Collections.vue

@@ -1,5 +1,7 @@
 <template>
-  <div class="null" v-if="data.length === 0" tabindex="0">no information...</div>
+  <div class="null" v-if="data.length === 0" tabindex="0">
+    no information...
+  </div>
   <div class="SearchCollections" v-else>
     <div
       class="row"
@@ -12,7 +14,9 @@
       :aria-description="item.h3"
     >
       <div class="left">
-        <img :src="item.cover" :alt="item.h3" 
+        <img
+          :src="item.cover"
+          :alt="item.h3"
           tabindex="0"
           aria-label="Image link"
           :aria-description="item.h3"
@@ -92,7 +96,10 @@ export default {
         temp = [...Collections];
       } else {
         temp = Collections.filter((v) => {
-          return v.h3.includes(txt) || v.p.includes(txt);
+          return (
+            v.h3.toLowerCase().includes(txt.toLowerCase()) ||
+            v.p.toLowerCase().includes(txt.toLowerCase())
+          );
         });
         //
         temp = temp.map((v) => {

+ 12 - 4
web/src/views/Search/Employment.vue

@@ -1,5 +1,7 @@
 <template>
-  <div class="null" v-if="data.length === 0" tabindex="0">no information...</div>
+  <div class="null" v-if="data.length === 0" tabindex="0">
+    no information...
+  </div>
   <div class="SearchEmployment" v-else>
     <div
       class="row"
@@ -12,7 +14,9 @@
       :aria-description="item.h3"
     >
       <div class="left" v-if="item.cover">
-        <img :src="item.cover" :alt="item.h3" 
+        <img
+          :src="item.cover"
+          :alt="item.h3"
           tabindex="0"
           aria-label="Image link"
           :aria-description="item.h3"
@@ -60,7 +64,10 @@ export default {
       } else {
         let temp = [];
         temp = Employment.filter((v) => {
-          return v.h3.includes(txt) || v.p.includes(txt);
+          return (
+            v.h3.toLowerCase().includes(txt.toLowerCase()) ||
+            v.p.toLowerCase().includes(txt.toLowerCase())
+          );
         });
         //
         temp = temp.map((v) => {
@@ -131,5 +138,6 @@ export default {
         line-height: 24px;
       }
     }
-  }}
+  }
+}
 </style>

+ 11 - 4
web/src/views/Search/Events.vue

@@ -1,5 +1,7 @@
 <template>
-  <div class="null" v-if="data.length === 0" tabindex="0">no information...</div>
+  <div class="null" v-if="data.length === 0" tabindex="0">
+    no information...
+  </div>
   <div class="SearchEvents" v-else>
     <div
       class="row"
@@ -12,13 +14,15 @@
       :aria-description="item.h3"
     >
       <div class="left" v-if="item.cover">
-        <img :src="item.cover" alt="item.h3"
+        <img
+          :src="item.cover"
+          alt="item.h3"
           tabindex="0"
           aria-label="Image link"
           :aria-description="item.h3"
         />
       </div>
-      <div class="right" :class="{rightAC:!item.p}">
+      <div class="right" :class="{ rightAC: !item.p }">
         <h3 v-html="item.h3" tabindex="0" aria-label="Link"></h3>
         <p v-html="item.p" tabindex="0" aria-label="Link"></p>
       </div>
@@ -60,7 +64,10 @@ export default {
       } else {
         let temp = [];
         temp = Events.filter((v) => {
-          return v.h3.includes(txt) || v.p.includes(txt);
+          return (
+            v.h3.toLowerCase().includes(txt.toLowerCase()) ||
+            v.p.toLowerCase().includes(txt.toLowerCase())
+          );
         });
         //
         temp = temp.map((v) => {

+ 10 - 3
web/src/views/Search/Exhibitions.vue

@@ -1,5 +1,7 @@
 <template>
-  <div class="null" v-if="data.length === 0" tabindex="0">no information...</div>
+  <div class="null" v-if="data.length === 0" tabindex="0">
+    no information...
+  </div>
   <div class="SearchExhibitions" v-else>
     <div
       class="row"
@@ -12,7 +14,9 @@
       :aria-description="item.h3"
     >
       <div class="left">
-        <img :src="item.cover" alt="item.h3"
+        <img
+          :src="item.cover"
+          alt="item.h3"
           tabindex="0"
           aria-label="Image link"
           :aria-description="item.h3"
@@ -80,7 +84,10 @@ export default {
         temp = [...Exhibitions];
       } else {
         temp = Exhibitions.filter((v) => {
-          return v.h3.includes(txt) || v.p.includes(txt);
+          return (
+            v.h3.toLowerCase().includes(txt.toLowerCase()) ||
+            v.p.toLowerCase().includes(txt.toLowerCase())
+          );
         });
         //
         temp = temp.map((v) => {

+ 11 - 4
web/src/views/Search/Join.vue

@@ -1,5 +1,7 @@
 <template>
-  <div class="null" v-if="data.length === 0" tabindex="0">no information...</div>
+  <div class="null" v-if="data.length === 0" tabindex="0">
+    no information...
+  </div>
   <div class="SearchJoin" v-else>
     <div
       class="row"
@@ -12,13 +14,15 @@
       :aria-description="item.h3"
     >
       <div class="left" v-if="item.cover">
-        <img :src="item.cover" alt="item.h3"
+        <img
+          :src="item.cover"
+          alt="item.h3"
           tabindex="0"
           aria-label="Image link"
           :aria-description="item.h3"
         />
       </div>
-      <div class="right" :class="{rightAC:!item.p}">
+      <div class="right" :class="{ rightAC: !item.p }">
         <h3 v-html="item.h3" tabindex="0" aria-label="Link"></h3>
         <p v-html="item.p" tabindex="0" aria-label="Link"></p>
       </div>
@@ -60,7 +64,10 @@ export default {
       } else {
         let temp = [];
         temp = Join.filter((v) => {
-          return v.h3.includes(txt) || v.p.includes(txt);
+          return (
+            v.h3.toLowerCase().includes(txt.toLowerCase()) ||
+            v.p.toLowerCase().includes(txt.toLowerCase())
+          );
         });
         //
         temp = temp.map((v) => {

+ 10 - 3
web/src/views/Search/Learn.vue

@@ -1,5 +1,7 @@
 <template>
-  <div class="null" v-if="data.length === 0" tabindex="0">no information...</div>
+  <div class="null" v-if="data.length === 0" tabindex="0">
+    no information...
+  </div>
   <div class="SearchLearn" v-else>
     <div
       class="row"
@@ -12,7 +14,9 @@
       :aria-description="item.h3"
     >
       <div class="left">
-        <img :src="item.cover" :alt="item.h3" 
+        <img
+          :src="item.cover"
+          :alt="item.h3"
           tabindex="0"
           aria-label="Image link"
           :aria-description="item.h3"
@@ -80,7 +84,10 @@ export default {
         temp = [...LearnEngage];
       } else {
         temp = LearnEngage.filter((v) => {
-          return v.h3.includes(txt) || v.p.includes(txt);
+          return (
+            v.h3.toLowerCase().includes(txt.toLowerCase()) ||
+            v.p.toLowerCase().includes(txt.toLowerCase())
+          );
         });
         //
         temp = temp.map((v) => {

+ 13 - 6
web/src/views/Search/Research.vue

@@ -1,5 +1,7 @@
 <template>
-  <div class="null" v-if="data.length === 0" tabindex="0">no information...</div>
+  <div class="null" v-if="data.length === 0" tabindex="0">
+    no information...
+  </div>
   <div class="SearchResearch" v-else>
     <div
       class="row"
@@ -12,13 +14,15 @@
       :aria-description="item.h3"
     >
       <div class="left" v-if="item.cover">
-        <img :src="item.cover" :alt="item.h3" 
+        <img
+          :src="item.cover"
+          :alt="item.h3"
           tabindex="0"
           aria-label="Image link"
           :aria-description="item.h3"
         />
       </div>
-      <div class="right" :class="{rightAC:!item.p}">
+      <div class="right" :class="{ rightAC: !item.p }">
         <h3 v-html="item.h3" tabindex="0" aria-label="Link"></h3>
         <p v-html="item.p" tabindex="0" aria-label="Link"></p>
       </div>
@@ -80,7 +84,10 @@ export default {
         temp = [...Publications];
       } else {
         temp = Publications.filter((v) => {
-            return v.h3.includes(txt) || v.p.includes(txt);
+          return (
+            v.h3.toLowerCase().includes(txt.toLowerCase()) ||
+            v.p.toLowerCase().includes(txt.toLowerCase())
+          );
         });
         //
         temp = temp.map((v) => {
@@ -159,10 +166,10 @@ export default {
         line-height: 24px;
       }
     }
-    .rightAC{
+    .rightAC {
       display: flex;
       align-items: center;
-      &>h3{
+      & > h3 {
         font-size: 24px;
         padding-left: 20px;
         padding-bottom: 40px;

+ 10 - 3
web/src/views/Search/Terms.vue

@@ -1,5 +1,7 @@
 <template>
-  <div class="null" v-if="data.length === 0" tabindex="0">no information...</div>
+  <div class="null" v-if="data.length === 0" tabindex="0">
+    no information...
+  </div>
   <div class="SearchTerms" v-else>
     <div
       class="row"
@@ -12,7 +14,9 @@
       :aria-description="item.h3"
     >
       <div class="left" v-if="item.cover">
-        <img :src="item.cover" :alt="item.h3" 
+        <img
+          :src="item.cover"
+          :alt="item.h3"
           tabindex="0"
           aria-label="Image link"
           :aria-description="item.h3"
@@ -60,7 +64,10 @@ export default {
       } else {
         let temp = [];
         temp = Terms.filter((v) => {
-          return v.h3.includes(txt) || v.p.includes(txt);
+          return (
+            v.h3.toLowerCase().includes(txt.toLowerCase()) ||
+            v.p.toLowerCase().includes(txt.toLowerCase())
+          );
         });
         //
         temp = temp.map((v) => {

+ 7 - 2
web/src/views/Search/Visit.vue

@@ -1,5 +1,7 @@
 <template>
-  <div class="null" v-if="data.length === 0" tabindex="0">no information...</div>
+  <div class="null" v-if="data.length === 0" tabindex="0">
+    no information...
+  </div>
   <div class="SearchVisit" v-else>
     <div
       class="row"
@@ -51,7 +53,10 @@ export default {
       } else {
         let temp = [];
         temp = Visit.filter((v) => {
-          return v.h3.includes(txt) || v.p.includes(txt);
+          return (
+            v.h3.toLowerCase().includes(txt.toLowerCase()) ||
+            v.p.toLowerCase().includes(txt.toLowerCase())
+          );
         });
         //
         temp = temp.map((v) => {