Просмотр исходного кода

🐛馆藏标题字数太多显示问题

shaogen1995 2 лет назад
Родитель
Сommit
11828a2296
3 измененных файлов с 11 добавлено и 4 удалено
  1. 2 2
      src/pages/Exhibit/index.tsx
  2. 8 1
      src/pages/Goods/index.tsx
  3. 1 1
      src/types/api/goods.d.ts

+ 2 - 2
src/pages/Exhibit/index.tsx

@@ -45,9 +45,9 @@ function Exhibit() {
         title: "展馆简介",
         render: (item: ExhibitTableType) =>
           item.description ? (
-            item.description.length >= 20 ? (
+            item.description.length >= 30 ? (
               <span style={{ cursor: "pointer" }} title={item.description}>
-                {item.description.substring(0, 20) + "..."}
+                {item.description.substring(0, 30) + "..."}
               </span>
             ) : (
               item.description

+ 8 - 1
src/pages/Goods/index.tsx

@@ -209,7 +209,14 @@ function Goods() {
       // },
       {
         title: "标题",
-        dataIndex: "name",
+        render: (item: GoodsTableSearch) =>
+          item.name!.length >= 20 ? (
+            <span style={{ cursor: "pointer" }} title={item.name}>
+              {item.name!.substring(0, 20) + "..."}
+            </span>
+          ) : (
+            item.name
+          ),
       },
       {
         title: "所属展馆",

+ 1 - 1
src/types/api/goods.d.ts

@@ -15,7 +15,7 @@ export type GoodsTableSearch = {
   id?: number;
   thumb?: string;
   type?: "model" | "img" | "audio" | "video";
-
+  name?:string
   searchKey: string;
   exhibitionId: string;
 };