wzyyy 3 лет назад
Родитель
Сommit
4cec9bab4b

+ 1 - 1
src/components/ProTableCard/CardItems/aliyun.tsx

@@ -20,7 +20,7 @@ export default (props: AliyunCardProps) => {
       status={props?.state?.value}
       statusText={props?.state?.text}
       statusNames={{
-        enabled: StatusColorEnum.processing,
+        enabled: StatusColorEnum.success,
         disabled: StatusColorEnum.error,
       }}
       showMask={false}

+ 1 - 1
src/components/ProTableCard/CardItems/cascade.tsx

@@ -22,7 +22,7 @@ export default (props: CascadeCardProps) => {
       status={props.status.value}
       statusText={props.status.text}
       statusNames={{
-        enabled: StatusColorEnum.processing,
+        enabled: StatusColorEnum.success,
         disabled: StatusColorEnum.error,
       }}
     >

+ 9 - 8
src/components/ProTableCard/CardItems/duerOs.tsx

@@ -4,6 +4,7 @@ import '@/style/common.less';
 import '../index.less';
 import { Tooltip } from 'antd';
 import { DuerOSItem } from '@/pages/cloud/DuerOS/typings';
+import { StatusColorEnum } from '@/components/BadgeStatus';
 
 export interface DuerOSProps extends DuerOSItem {
   detail?: React.ReactNode;
@@ -17,14 +18,14 @@ export default (props: DuerOSProps) => {
   return (
     <TableCard
       actions={props.action}
-      // detail={props.detail}
-      showStatus={false}
-      // status={props.state?.value}
-      // statusText={props.state?.text}
-      // statusNames={{
-      //   enabled: StatusColorEnum.success,
-      //   disabled: StatusColorEnum.error,
-      // }}
+      detail={props.detail}
+      // showStatus={false}
+      status={props?.state?.value}
+      statusText={props?.state?.text}
+      statusNames={{
+        enabled: StatusColorEnum.success,
+        disabled: StatusColorEnum.error,
+      }}
       showMask={false}
     >
       <div className={'pro-table-card-item'}>

+ 4 - 0
src/global.less

@@ -126,4 +126,8 @@ ol {
 
 .ellipsis-70 {
   width: 70%;
+  overflow: hidden;
+  white-space: nowrap;
+  text-align: left;
+  text-overflow: ellipsis;
 }

+ 1 - 1
src/locales/zh-CN/pages.ts

@@ -257,7 +257,7 @@ export default {
   // 设备管理-设备
   'pages.device.instance': '设备',
   'pages.device.instance.registrationTime': '注册时间',
-  'pages.device.instance.status.notActive': '未启用',
+  'pages.device.instance.status.notActive': '用',
   'pages.device.instance.status.offLine': '离线',
   'pages.device.instance.status.onLine': '在线',
   'pages.device.instance.deleteTip': '已启用的设备无法删除',

+ 1 - 1
src/pages/Northbound/AliCloud/index.tsx

@@ -156,7 +156,7 @@ const AliCloud = () => {
       valueType: 'select',
       valueEnum: {
         disabled: {
-          text: '用',
+          text: '用',
           status: 'disabled',
         },
         enabled: {

+ 4 - 0
src/pages/cloud/DuerOS/typings.d.ts

@@ -36,6 +36,10 @@ type DuerOSItem = {
     text: string;
     value: string;
   };
+  state?: {
+    text: string;
+    value: string;
+  };
   actionMappings: ActionMapping[];
   propertyMappings: PropertyMapping[];
 } & BaseItem;

+ 1 - 1
src/pages/device/Instance/index.tsx

@@ -266,7 +266,7 @@ const Instance = () => {
         notActive: {
           text: intl.formatMessage({
             id: 'pages.device.instance.status.notActive',
-            defaultMessage: '未启用',
+            defaultMessage: '用',
           }),
           status: 'notActive',
         },

+ 3 - 3
src/pages/link/Protocol/index.tsx

@@ -261,10 +261,10 @@ const Protocol = () => {
                 type={'link'}
                 style={{ padding: 0 }}
                 tooltip={{
-                  title: record.state === 1 ? '撤销' : '发布',
+                  title: record.state === 1 ? '禁用' : '启用',
                 }}
                 popConfirm={{
-                  title: `确认${record.state === 1 ? '撤销' : '发布'}`,
+                  title: `确认${record.state === 1 ? '禁用' : '启用'}`,
                   onConfirm: () => {
                     if (record.state === 1) {
                       modifyState(record.id, 'un-deploy');
@@ -275,7 +275,7 @@ const Protocol = () => {
                 }}
               >
                 {record.state === 1 ? <StopOutlined /> : <PlayCircleOutlined />}
-                {record.state === 1 ? '撤销' : '发布'}
+                {record.state === 1 ? '禁用' : '启用'}
               </PermissionButton>,
               <PermissionButton
                 isPermission={permission.delete}

+ 2 - 4
src/pages/link/Protocol/save/index.tsx

@@ -138,7 +138,6 @@ const Save = (props: Props) => {
             'x-disabled': !!props.data?.id,
             'x-decorator-props': {
               gridSpan: 2,
-              tooltip: <div>jar:上传协议jar包,文件格式支持.jar或.zip</div>,
             },
             'x-component-props': {
               model: 'singular',
@@ -179,9 +178,6 @@ const Save = (props: Props) => {
                 'x-visible': false,
                 'x-decorator-props': {
                   gridSpan: 2,
-                  tooltip: (
-                    <div>local:填写本地协议编译目录绝对地址,如:d:/protocol/target/classes</div>
-                  ),
                 },
                 'x-validator': [
                   {
@@ -197,6 +193,8 @@ const Save = (props: Props) => {
                       componentType: '{{$deps[0]==="jar"?"FileUpload":"Input"}}',
                       componentProps:
                         '{{$deps[0]==="jar"?{type:"file", accept: ".jar, .zip"}:{placeholder: "请输入文件地址"}}}',
+                      decoratorProps:
+                        '{{$deps[0]!=="jar"?{gridSpan:"2",tooltip:"local:填写本地协议编译目录绝对地址,如:d:/protocol/target/classes"}:{gridSpan:"2",tooltip:"jar:上传协议jar包,文件格式支持.jar或.zip"}}}',
                     },
                   },
                 },

+ 2 - 2
src/pages/media/Cascade/index.tsx

@@ -169,11 +169,11 @@ const Cascade = () => {
       valueType: 'select',
       valueEnum: {
         disabled: {
-          text: '已停止',
+          text: '禁用',
           status: 'disabled',
         },
         enabled: {
-          text: '已启动',
+          text: '正常',
           status: 'enabled',
         },
       },

+ 17 - 0
src/pages/rule-engine/Alarm/Configuration/index.tsx

@@ -105,9 +105,26 @@ const Configuration = () => {
     {
       title: '状态',
       dataIndex: 'state',
+      valueType: 'select',
       renderText: (state) => (
         <Badge text={state?.text} status={state?.value === 'disabled' ? 'error' : 'success'} />
       ),
+      valueEnum: {
+        disabled: {
+          text: intl.formatMessage({
+            id: 'pages.device.product.status.disabled',
+            defaultMessage: '禁用',
+          }),
+          status: 'disabled',
+        },
+        enabled: {
+          text: intl.formatMessage({
+            id: 'pages.device.product.status.enabled',
+            defaultMessage: '正常',
+          }),
+          status: 'enabled',
+        },
+      },
     },
     {
       title: '说明',

+ 7 - 0
src/pages/rule-engine/Alarm/Log/TabComponent/index.less

@@ -69,5 +69,12 @@
 
   .card-state-content {
     transform: skewX(-45deg);
+    .stateText {
+      width: 70px;
+      overflow: hidden;
+      white-space: nowrap;
+      text-align: center;
+      text-overflow: ellipsis;
+    }
   }
 }

+ 12 - 2
src/pages/rule-engine/Alarm/Log/TabComponent/index.tsx

@@ -239,8 +239,18 @@ const TabComponent = observer((props: Props) => {
                         style={{ backgroundColor: colorMap.get(item.level) }}
                       >
                         <div className={'card-state-content'}>
-                          {AlarmLogModel.defaultLevel.find((i) => i.level === item.level)?.title ||
-                            item.level}
+                          <Tooltip
+                            placement="topLeft"
+                            title={
+                              AlarmLogModel.defaultLevel.find((i) => i.level === item.level)
+                                ?.title || item.level
+                            }
+                          >
+                            <div className={'stateText'}>
+                              {AlarmLogModel.defaultLevel.find((i) => i.level === item.level)
+                                ?.title || item.level}
+                            </div>
+                          </Tooltip>
                         </div>
                       </div>
                     </div>

+ 2 - 2
src/pages/system/Permission/index.tsx

@@ -1,11 +1,11 @@
 import { PageContainer } from '@ant-design/pro-layout';
 import React, { useRef, useState } from 'react';
 import {
-  CloseCircleOutlined,
   DeleteOutlined,
   EditOutlined,
   PlayCircleOutlined,
   PlusOutlined,
+  StopOutlined,
 } from '@ant-design/icons';
 import { Badge, Button, Dropdown, Menu, Popconfirm, Space, Tooltip, Upload } from 'antd';
 import type { ActionType, ProColumns } from '@jetlinks/pro-table';
@@ -217,7 +217,7 @@ const Permission: React.FC = observer(() => {
             }),
           }}
         >
-          {record.status ? <CloseCircleOutlined /> : <PlayCircleOutlined />}
+          {record.status ? <StopOutlined /> : <PlayCircleOutlined />}
         </PermissionButton>,
         <PermissionButton
           type={'link'}

+ 2 - 2
src/pages/system/User/index.tsx

@@ -5,12 +5,12 @@ import type { ActionType, ProColumns } from '@jetlinks/pro-table';
 import ProTable from '@jetlinks/pro-table';
 import { Badge, Popconfirm } from 'antd';
 import {
-  CloseCircleOutlined,
   DeleteOutlined,
   EditOutlined,
   PlayCircleOutlined,
   PlusOutlined,
   SafetyOutlined,
+  StopOutlined,
 } from '@ant-design/icons';
 import { useIntl } from '@@/plugin-locale/localeExports';
 import { useRef, useState } from 'react';
@@ -177,7 +177,7 @@ const User = observer(() => {
             }),
           }}
         >
-          {record.status ? <CloseCircleOutlined /> : <PlayCircleOutlined />}
+          {record.status ? <StopOutlined /> : <PlayCircleOutlined />}
         </PermissionButton>,
         <PermissionButton
           type="link"