wzyyy 3 лет назад
Родитель
Сommit
00d06ddd1f
2 измененных файлов с 36 добавлено и 8 удалено
  1. 12 0
      src/global.less
  2. 24 8
      src/pages/rule-engine/Alarm/Configuration/index.tsx

+ 12 - 0
src/global.less

@@ -115,3 +115,15 @@ ol {
     background-color: @primary-1;
   }
 }
+
+.ellipsis {
+  width: 100%;
+  overflow: hidden;
+  white-space: nowrap;
+  text-align: left;
+  text-overflow: ellipsis;
+}
+
+.ellipsis-70 {
+  width: 70%;
+}

+ 24 - 8
src/pages/rule-engine/Alarm/Configuration/index.tsx

@@ -12,7 +12,7 @@ import {
 } from '@ant-design/icons';
 import { useIntl } from '@@/plugin-locale/localeExports';
 import { useEffect, useRef, useState } from 'react';
-import { Badge, message, Space } from 'antd';
+import { Badge, message, Space, Tooltip } from 'antd';
 import ProTableCard from '@/components/ProTableCard';
 import Save from './Save';
 import Service from '@/pages/rule-engine/Alarm/Configuration/service';
@@ -54,12 +54,19 @@ const Configuration = () => {
     {
       title: '告警级别',
       dataIndex: 'level',
-      ellipsis: true,
       render: (text: any) => (
-        <span>
-          {(Store.get('default-level') || []).find((item: any) => item?.level === text)?.title ||
-            text}
-        </span>
+        <Tooltip
+          placement="topLeft"
+          title={
+            (Store.get('default-level') || []).find((item: any) => item?.level === text)?.title ||
+            text
+          }
+        >
+          <div className="ellipsis">
+            {(Store.get('default-level') || []).find((item: any) => item?.level === text)?.title ||
+              text}
+          </div>
+        </Tooltip>
       ),
     },
     {
@@ -70,7 +77,7 @@ const Configuration = () => {
         <PermissionButton
           type={'link'}
           isPermission={!!getMenuPathByCode(MENUS_CODE['rule-engine/Scene'])}
-          style={{ padding: 0, height: 'auto', width: '100%' }}
+          style={{ padding: 0, height: 'auto' }}
           tooltip={{
             title: !!getMenuPathByCode(MENUS_CODE['rule-engine/Scene'])
               ? text
@@ -81,7 +88,16 @@ const Configuration = () => {
             history.push(`${url}?id=${record.sceneId}`);
           }}
         >
-          <span className="ellipsis">{text}</span>
+          <span
+            style={{
+              width: '200px',
+              overflow: 'hidden',
+              textAlign: 'left',
+              textOverflow: 'ellipsis',
+            }}
+          >
+            {text}
+          </span>
         </PermissionButton>
       ),
     },