xieyonghong 3 سال پیش
والد
کامیت
9b8f308505
22فایلهای تغییر یافته به همراه251 افزوده شده و 170 حذف شده
  1. 1 1
      src/components/FTermArrayCards/index.tsx
  2. 0 1
      src/components/FTermTypeSelect/index.tsx
  3. 7 4
      src/components/ProTableCard/CardItems/AlarmConfig.tsx
  4. 12 0
      src/pages/Northbound/AliCloud/Detail/index.tsx
  5. 1 0
      src/pages/account/Center/bind/index.less
  6. 1 0
      src/pages/device/Instance/Detail/MetadataLog/Property/AMap.tsx
  7. 10 1
      src/pages/device/Instance/Detail/MetadataLog/Property/Charts.tsx
  8. 2 3
      src/pages/device/Instance/Detail/MetadataLog/Property/index.tsx
  9. 3 3
      src/pages/device/Instance/Detail/Running/Property/EditProperty.tsx
  10. 10 10
      src/pages/device/Instance/Detail/Running/Property/FileComponent/index.less
  11. 8 8
      src/pages/device/Instance/Detail/Running/Property/FileComponent/index.tsx
  12. 9 8
      src/pages/device/Instance/Detail/Running/Property/PropertyCard.tsx
  13. 2 1
      src/pages/device/Instance/Detail/Running/Property/PropertyTable.tsx
  14. 111 87
      src/pages/device/Instance/Detail/Running/Property/index.tsx
  15. 17 18
      src/pages/device/Instance/service.ts
  16. 11 5
      src/pages/device/Product/Detail/Access/AccessConfig/index.tsx
  17. 8 0
      src/pages/device/components/Metadata/Base/Edit/index.tsx
  18. 11 1
      src/pages/link/Certificate/index.tsx
  19. 1 1
      src/pages/media/Device/Channel/Live/index.tsx
  20. 1 1
      src/pages/media/Device/Channel/Save.tsx
  21. 20 15
      src/pages/rule-engine/Alarm/Configuration/index.tsx
  22. 5 2
      src/pages/rule-engine/Scene/TriggerTerm/index.tsx

+ 1 - 1
src/components/FTermArrayCards/index.tsx

@@ -101,7 +101,7 @@ export const FTermArrayCards: ComposedArrayCards = observer((props) => {
                     {
                       type: 'object',
                       properties: {
-                        termType: {
+                        type: {
                           'x-decorator': 'FormItem',
                           'x-component': 'Select',
                           'x-component-props': {

+ 0 - 1
src/components/FTermTypeSelect/index.tsx

@@ -21,7 +21,6 @@ const FTermTypeSelect = (props: Props) => {
         onChange={(value) => props.onChange(value)}
         value={props.value}
         style={{ width: '200px' }}
-        defaultValue={'and'}
         options={[
           { label: '并且', value: 'and' },
           { label: '或者', value: 'or' },

+ 7 - 4
src/components/ProTableCard/CardItems/AlarmConfig.tsx

@@ -41,19 +41,22 @@ export default (props: AlarmConfigProps) => {
           <div className={'card-item-content'}>
             <div>
               <label>关联场景联动</label>
-              <div>
+              <div className={'ellipsis'}>
                 <PermissionButton
                   type={'link'}
                   isPermission={!!getMenuPathByCode(MENUS_CODE['rule-engine/Scene'])}
                   style={{ padding: 0, height: 'auto' }}
+                  tooltip={{
+                    title: !!getMenuPathByCode(MENUS_CODE['rule-engine/Scene'])
+                      ? props?.sceneName
+                      : '没有权限,请联系管理员',
+                  }}
                   onClick={() => {
                     const url = getMenuPathByCode('rule-engine/Scene/Save');
                     history.push(`${url}?id=${props.sceneId}`);
                   }}
                 >
-                  <div className={'ellipsis'}>
-                    <Tooltip title={props?.sceneName || ''}>{props?.sceneName || ''}</Tooltip>
-                  </div>
+                  {props?.sceneName || ''}
                 </PermissionButton>
               </div>
             </div>

+ 12 - 0
src/pages/Northbound/AliCloud/Detail/index.tsx

@@ -196,6 +196,18 @@ const Detail = observer(() => {
               },
             ],
           },
+          instanceId: {
+            type: 'string',
+            title: '实例ID',
+            'x-decorator': 'FormItem',
+            'x-component': 'Input',
+            'x-component-props': {
+              placeholder: '请输入实例ID',
+            },
+            'x-decorator-props': {
+              tooltip: '阿里云物联网平台中的实例ID,没有则不填',
+            },
+          },
           accessKeyId: {
             type: 'string',
             title: 'accessKey',

+ 1 - 0
src/pages/account/Center/bind/index.less

@@ -52,6 +52,7 @@
       }
     }
   }
+
   .btn {
     display: flex;
     justify-content: center;

+ 1 - 0
src/pages/device/Instance/Detail/MetadataLog/Property/AMap.tsx

@@ -49,6 +49,7 @@ export default (props: Props) => {
             type="primary"
             onClick={() => {
               if (PathNavigatorRef.current) {
+                PathNavigatorRef.current.moveToPoint(0, 0);
                 PathNavigatorRef.current.stop();
               }
             }}

+ 10 - 1
src/pages/device/Instance/Detail/MetadataLog/Property/Charts.tsx

@@ -1,3 +1,4 @@
+import { Empty } from 'antd';
 import * as echarts from 'echarts';
 import _ from 'lodash';
 import { useEffect, useRef } from 'react';
@@ -58,7 +59,15 @@ const Charts = (props: Props) => {
     }
   }, [props.data]);
 
-  return <div id="charts" style={{ width: '100%', height: 500 }}></div>;
+  return (
+    <div>
+      {Array.isArray(props?.data) && props?.data.length > 2 ? (
+        <div id="charts" style={{ width: '100%', height: 500 }}></div>
+      ) : (
+        <Empty />
+      )}
+    </div>
+  );
 };
 
 export default Charts;

+ 2 - 3
src/pages/device/Instance/Detail/MetadataLog/Property/index.tsx

@@ -187,7 +187,6 @@ const PropertyLog = (props: Props) => {
         value: undefined,
         type: data?.name || '',
       });
-      console.log(dataList.length);
       setChartsList(dataList || []);
     }
   };
@@ -199,7 +198,7 @@ const PropertyLog = (props: Props) => {
     if (resp.status === 200) {
       const dataList: any[] = [
         {
-          year: start,
+          year: end,
           value: undefined,
           type: data?.name || '',
         },
@@ -213,7 +212,7 @@ const PropertyLog = (props: Props) => {
         });
       });
       dataList.push({
-        year: end,
+        year: start,
         value: undefined,
         type: data?.name || '',
       });

+ 3 - 3
src/pages/device/Instance/Detail/Running/Property/EditProperty.tsx

@@ -7,12 +7,12 @@ import { useParams } from 'umi';
 import type { PropertyMetadata } from '@/pages/device/Product/typings';
 
 interface Props {
-  visible: boolean;
   data: Partial<PropertyMetadata>;
   onCancel: () => void;
 }
+
 const EditProperty = (props: Props) => {
-  const { visible, data } = props;
+  const { data } = props;
   const params = useParams<{ id: string }>();
 
   const SchemaField = createSchemaField({
@@ -47,7 +47,7 @@ const EditProperty = (props: Props) => {
     <Modal
       maskClosable={false}
       title="编辑"
-      visible={visible}
+      visible
       onOk={async () => {
         const values: any = await form.submit();
         if (!!values) {

+ 10 - 10
src/pages/device/Instance/Detail/Running/Property/FileComponent/index.less

@@ -2,27 +2,27 @@
   display: flex;
   align-items: center;
   width: 100%;
-  max-height: 60px;
 
-  .other {
+  .cardValue {
+    display: flex;
+    align-items: center;
     width: 100%;
+    height: 60px;
     overflow: hidden;
     color: #323130;
     font-weight: 700;
     font-size: 24px;
     white-space: nowrap;
     text-overflow: ellipsis;
-  }
 
-  .img {
-    display: flex;
-    align-items: center;
-    justify-content: center;
-    width: 60px;
-    height: 100%;
+    img {
+      width: 60px;
+    }
+  }
 
+  .otherValue {
     img {
-      width: 100%;
+      width: 40px;
     }
   }
 }

+ 8 - 8
src/pages/device/Instance/Detail/Running/Property/FileComponent/index.tsx

@@ -33,14 +33,14 @@ const FileComponent = (props: Props) => {
 
   const renderValue = () => {
     if (value?.formatValue !== 0 && !value?.formatValue) {
-      return <div className={props.type === 'card' ? styles.other : {}}>--</div>;
+      return <div className={props.type === 'card' ? styles.cardValue : styles.otherValue}>--</div>;
     } else if (data?.valueType?.type === 'file') {
       if (
         data?.valueType?.fileType === 'base64' ||
         data?.valueType?.fileType === 'Binary(二进制)'
       ) {
         return (
-          <div className={props.type === 'card' ? styles.other : {}}>
+          <div className={props.type === 'card' ? styles.cardValue : styles.otherValue}>
             <Tooltip placement="topLeft" title={String(value?.formatValue)}>
               {String(value?.formatValue)}
             </Tooltip>
@@ -51,7 +51,7 @@ const FileComponent = (props: Props) => {
         // 图片
         return (
           <div
-            className={styles.img}
+            className={props.type === 'card' ? styles.cardValue : styles.otherValue}
             onClick={() => {
               if (isHttps && value?.formatValue.indexOf('http:') !== -1) {
                 message.error('域名为https时,不支持访问http地址');
@@ -80,7 +80,7 @@ const FileComponent = (props: Props) => {
       ) {
         return (
           <div
-            className={styles.img}
+            className={props.type === 'card' ? styles.cardValue : styles.otherValue}
             onClick={() => {
               if (isHttps && value?.formatValue.indexOf('http:') !== -1) {
                 message.error('域名为https时,不支持访问http地址');
@@ -107,20 +107,20 @@ const FileComponent = (props: Props) => {
             value?.formatValue.includes(item),
           ) || '';
         return (
-          <div className={styles.img}>
+          <div className={props.type === 'card' ? styles.cardValue : styles.otherValue}>
             <img src={imgMap.get(flag.slice(1))} />
           </div>
         );
       } else {
         return (
-          <div className={styles.img}>
+          <div className={props.type === 'card' ? styles.cardValue : styles.otherValue}>
             <img src={imgMap.get('other')} />
           </div>
         );
       }
     } else if (data?.valueType?.type === 'object' || data?.valueType?.type === 'geoPoint') {
       return (
-        <div className={props.type === 'card' ? styles.other : {}}>
+        <div className={props.type === 'card' ? styles.cardValue : styles.otherValue}>
           <Tooltip placement="topLeft" title={JSON.stringify(value?.formatValue)}>
             {JSON.stringify(value?.formatValue)}
           </Tooltip>
@@ -128,7 +128,7 @@ const FileComponent = (props: Props) => {
       );
     } else {
       return (
-        <div className={props.type === 'card' ? styles.other : {}}>
+        <div className={props.type === 'card' ? styles.cardValue : styles.otherValue}>
           <Tooltip placement="topLeft" title={String(value?.formatValue)}>
             {String(value?.formatValue)}
           </Tooltip>

+ 9 - 8
src/pages/device/Instance/Detail/Running/Property/PropertyCard.tsx

@@ -88,7 +88,7 @@ const Property = (props: Props) => {
   useEffect(() => {
     if (!dataValue?.timestamp) {
       setDataValue(value);
-    } else if (dataValue?.timestamp && dataValue?.timestamp < value?.timestamp) {
+    } else if (dataValue?.timestamp && dataValue?.timestamp <= value?.timestamp) {
       setDataValue(value);
     }
   }, [value]);
@@ -107,13 +107,14 @@ const Property = (props: Props) => {
           </div>
         </div>
       </Spin>
-      <EditProperty
-        visible={editVisible}
-        onCancel={() => {
-          setEditVisible(false);
-        }}
-        data={data}
-      />
+      {editVisible && (
+        <EditProperty
+          onCancel={() => {
+            setEditVisible(false);
+          }}
+          data={data}
+        />
+      )}
       {visible && <PropertyLog data={data} close={() => setVisible(false)} />}
       {indicatorVisible && (
         <Indicators

+ 2 - 1
src/pages/device/Instance/Detail/Running/Property/PropertyTable.tsx

@@ -7,6 +7,7 @@ interface Props {
   data: any;
   value: any;
 }
+
 const PropertyTable = (props: Props) => {
   const { type, data, value } = props;
   const [dataValue, setDataValue] = useState<any>(null);
@@ -14,7 +15,7 @@ const PropertyTable = (props: Props) => {
   useEffect(() => {
     if (!dataValue?.timestamp) {
       setDataValue(value);
-    } else if (dataValue?.timestamp && dataValue?.timestamp < value?.timestamp) {
+    } else if (dataValue?.timestamp && dataValue?.timestamp <= value?.timestamp) {
       setDataValue(value);
     }
   }, [value]);

+ 111 - 87
src/pages/device/Instance/Detail/Running/Property/index.tsx

@@ -1,4 +1,4 @@
-import { Col, Input, message, Pagination, Row, Space, Table } from 'antd';
+import { Col, Input, message, Pagination, Row, Space, Spin, Table } from 'antd';
 import CheckButton from '@/components/CheckButton';
 import { useCallback, useEffect, useRef, useState } from 'react';
 import type { PropertyMetadata } from '@/pages/device/Product/typings';
@@ -11,7 +11,7 @@ import EditProperty from './EditProperty';
 import { useParams } from 'umi';
 import PropertyLog from '../../MetadataLog/Property';
 import styles from './index.less';
-import { throttle } from 'lodash';
+import { groupBy, throttle, toArray } from 'lodash';
 import PropertyTable from './PropertyTable';
 
 interface Props {
@@ -43,6 +43,7 @@ const Property = (props: Props) => {
     pageSize: 8,
     currentPage: 0,
   });
+  const [loading, setLoading] = useState<boolean>(true);
 
   const [check, setCheck] = useState<boolean>(true);
 
@@ -162,11 +163,31 @@ const Property = (props: Props) => {
         },
       },
     ];
-
+    setLoading(true);
     service.propertyRealTime(param).subscribe({
       next: (resp) => {
-        propertyValue[resp.property] = resp.list[0];
-        setPropertyValue({ ...propertyValue });
+        if (resp.status === 200) {
+          const t1 = (resp?.result || []).map((item: any) => {
+            return {
+              timeString: item.data?.timeString,
+              timestamp: item.data?.timestamp,
+              ...item?.data?.value,
+            };
+          });
+          const obj: any = {};
+          toArray(groupBy(t1, 'property'))
+            .map((item) => {
+              return {
+                list: item.sort((a, b) => b.timestamp - a.timestamp),
+                property: item[0].property,
+              };
+            })
+            .forEach((i) => {
+              obj[i.property] = i.list[0];
+            });
+          setPropertyValue({ ...propertyValue, ...obj });
+        }
+        setLoading(false);
       },
     });
   };
@@ -187,92 +208,95 @@ const Property = (props: Props) => {
 
   return (
     <div>
-      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
-        <Space>
-          <Input.Search
-            allowClear
-            placeholder="请输入名称"
-            onSearch={(value: string) => {
-              if (!!value) {
-                const li = data.filter((item) => {
-                  return (
-                    item.name && item.name.toLowerCase().indexOf(value.toLocaleLowerCase()) !== -1
-                  );
-                });
-                setPropertyList(li);
-                setDataSource({
-                  total: li.length,
-                  data: (li || []).slice(0, 8),
-                  pageSize: 8,
-                  currentPage: 0,
-                });
-              } else {
-                setPropertyList(data);
-                setDataSource({
-                  total: data.length,
-                  data: (data || []).slice(0, 8),
-                  pageSize: 8,
-                  currentPage: 0,
-                });
-              }
+      <Spin spinning={loading}>
+        <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
+          <Space>
+            <Input.Search
+              allowClear
+              placeholder="请输入名称"
+              onSearch={(value: string) => {
+                if (!!value) {
+                  const li = data.filter((item) => {
+                    return (
+                      item.name && item.name.toLowerCase().indexOf(value.toLocaleLowerCase()) !== -1
+                    );
+                  });
+                  setPropertyList(li);
+                  setDataSource({
+                    total: li.length,
+                    data: (li || []).slice(0, 8),
+                    pageSize: 8,
+                    currentPage: 0,
+                  });
+                } else {
+                  setPropertyList(data);
+                  setDataSource({
+                    total: data.length,
+                    data: (data || []).slice(0, 8),
+                    pageSize: 8,
+                    currentPage: 0,
+                  });
+                }
+              }}
+              style={{ width: 317 }}
+            />
+          </Space>
+          <CheckButton
+            value={check}
+            change={(value: boolean) => {
+              setCheck(value);
             }}
-            style={{ width: 317 }}
           />
-        </Space>
-        <CheckButton
-          value={check}
-          change={(value: boolean) => {
-            setCheck(value);
+        </div>
+        <div style={{ marginTop: '20px' }}>
+          {check ? (
+            <Row gutter={[16, 16]}>
+              {dataSource.data.map((item: any) => (
+                <Col {...ColResponsiveProps} key={item.id}>
+                  <PropertyCard data={item} value={item?.id ? propertyValue[item?.id] : '--'} />
+                </Col>
+              ))}
+            </Row>
+          ) : (
+            <Table pagination={false} columns={columns} dataSource={dataSource.data} rowKey="id" />
+          )}
+          {dataSource.data.length > 0 && (
+            <div
+              style={{
+                marginTop: '20px',
+                width: '100%',
+                display: 'flex',
+                justifyContent: 'flex-end',
+              }}
+            >
+              <Pagination
+                className={styles.page}
+                defaultCurrent={1}
+                total={dataSource.total}
+                showSizeChanger
+                pageSize={dataSource.pageSize}
+                pageSizeOptions={[8, 16, 32, 48]}
+                onChange={(page: number, size: number) => {
+                  setDataSource({
+                    total: propertyList.length,
+                    data: (propertyList || []).slice((page - 1) * size, page * size),
+                    pageSize: size,
+                    currentPage: page - 1,
+                  });
+                }}
+              />
+            </div>
+          )}
+        </div>
+      </Spin>
+      {visible && (
+        <EditProperty
+          data={currentInfo}
+          onCancel={() => {
+            setVisible(false);
           }}
         />
-      </div>
-      <div style={{ marginTop: '20px' }}>
-        {check ? (
-          <Row gutter={[16, 16]}>
-            {dataSource.data.map((item: any) => (
-              <Col {...ColResponsiveProps} key={item.id}>
-                <PropertyCard data={item} value={item?.id ? propertyValue[item?.id] : '--'} />
-              </Col>
-            ))}
-          </Row>
-        ) : (
-          <Table pagination={false} columns={columns} dataSource={dataSource.data} rowKey="id" />
-        )}
-        {dataSource.data.length > 0 && (
-          <div
-            style={{
-              marginTop: '20px',
-              width: '100%',
-              display: 'flex',
-              justifyContent: 'flex-end',
-            }}
-          >
-            <Pagination
-              className={styles.page}
-              defaultCurrent={1}
-              total={dataSource.total}
-              showSizeChanger
-              pageSize={dataSource.pageSize}
-              pageSizeOptions={[8, 16, 32, 48]}
-              onChange={(page: number, size: number) => {
-                setDataSource({
-                  total: propertyList.length,
-                  data: (propertyList || []).slice((page - 1) * size, page * size),
-                  pageSize: size,
-                  currentPage: page - 1,
-                });
-              }}
-            />
-          </div>
-        )}
-      </div>
-      <EditProperty
-        data={currentInfo}
-        visible={visible}
-        onCancel={() => {
-          setVisible(false);
-        }}
-      />
+      )}
       {infoVisible && <PropertyLog data={currentInfo} close={() => setInfoVisible(false)} />}
     </div>
   );

+ 17 - 18
src/pages/device/Instance/service.ts

@@ -1,9 +1,9 @@
 import BaseService from '@/utils/BaseService';
 import { request } from 'umi';
-import type { DeviceInstance, PropertyData } from '@/pages/device/Instance/typings';
+import type { DeviceInstance } from '@/pages/device/Instance/typings';
 import SystemConst from '@/utils/const';
-import { defer, from, mergeMap, toArray } from 'rxjs';
-import { filter, groupBy, map } from 'rxjs/operators';
+import { defer, from } from 'rxjs';
+import { map } from 'rxjs/operators';
 
 class Service extends BaseService<DeviceInstance> {
   public detail = (id: string) => request(`${this.uri}/${id}/detail`, { method: 'GET' });
@@ -82,21 +82,20 @@ class Service extends BaseService<DeviceInstance> {
           data,
         }),
       ).pipe(
-        filter((resp) => resp.status === 200),
-        map((resp) => resp.result),
-        mergeMap((temp: PropertyData[]) => from(temp)),
-        map((item) => ({
-          timeString: item.data.timeString,
-          timestamp: item.data.timestamp,
-          ...item.data.value,
-        })),
-        groupBy((group$) => group$.property),
-        mergeMap((group) => group.pipe(toArray())),
-        map((arr) => ({
-          list: arr.sort((a, b) => a.timestamp - b.timestamp),
-          property: arr[0].property,
-        })),
-        // toArray()
+        // filter((resp) => resp.status === 200),
+        map((resp) => resp),
+        // mergeMap((temp: PropertyData[]) => from(temp)),
+        // map((item) => ({
+        //   timeString: item.data.timeString,
+        //   timestamp: item.data.timestamp,
+        //   ...item.data.value,
+        // })),
+        // groupBy((group$) => group$.property),
+        // mergeMap((group) => group.pipe(toArray())),
+        // map((arr) => ({
+        //   list: arr.sort((a, b) => a.timestamp - b.timestamp),
+        //   property: arr[0].property,
+        // }))
       ),
     );
 

+ 11 - 5
src/pages/device/Product/Detail/Access/AccessConfig/index.tsx

@@ -1,5 +1,5 @@
 import { useEffect, useState } from 'react';
-import { Button, Col, message, Modal, Pagination, Row } from 'antd';
+import { Col, message, Modal, Pagination, Row } from 'antd';
 import { service } from '@/pages/link/AccessConfig';
 import { productModel } from '@/pages/device/Product';
 import SearchComponent from '@/components/SearchComponent';
@@ -8,6 +8,8 @@ import styles from './index.less';
 import Service from '@/pages/device/Product/service';
 
 import AccessConfigCard from '@/components/ProTableCard/CardItems/AccessConfig';
+import { getMenuPathByCode } from '@/utils/menu';
+import PermissionButton from '@/components/PermissionButton';
 
 interface Props {
   close: () => void;
@@ -17,6 +19,7 @@ interface Props {
 const AccessConfig = (props: Props) => {
   const { close } = props;
   const service1 = new Service('device-product');
+  const { permission } = PermissionButton.usePermission('link/AccessConfig');
 
   const [dataSource, setDataSource] = useState<any>({
     data: [],
@@ -127,19 +130,22 @@ const AccessConfig = (props: Props) => {
           }}
         />
         <div style={{ display: 'flex', justifyContent: 'flex-end' }}>
-          <Button
-            type="primary"
+          <PermissionButton
+            isPermission={permission.add}
             onClick={() => {
-              const tab: any = window.open(`${origin}/#/link/AccessConfig/Detail`);
+              const url = getMenuPathByCode('link/AccessConfig/Detail');
+              const tab: any = window.open(`${origin}/#${url}`);
               tab!.onTabSaveSuccess = (value: any) => {
                 if (value.status === 200) {
                   handleSearch(param);
                 }
               };
             }}
+            key="button"
+            type="primary"
           >
             新增
-          </Button>
+          </PermissionButton>
         </div>
       </div>
       <Row gutter={[16, 16]}>

+ 8 - 0
src/pages/device/components/Metadata/Base/Edit/index.tsx

@@ -705,6 +705,14 @@ const Edit = observer((props: Props) => {
                   type: 'void',
                   'x-component': 'Editable.Popover',
                   title: '指标数据',
+                  'x-reactions': {
+                    dependencies: ['.edit.name'],
+                    fulfill: {
+                      state: {
+                        title: '{{$deps[0]}}',
+                      },
+                    },
+                  },
                   properties: {
                     id: {
                       // 标识

+ 11 - 1
src/pages/link/Certificate/index.tsx

@@ -2,7 +2,7 @@ import { PageContainer } from '@ant-design/pro-layout';
 import { useRef, useState } from 'react';
 import type { ActionType, ProColumns } from '@jetlinks/pro-table';
 import ProTable from '@jetlinks/pro-table';
-import { message } from 'antd';
+import { message, Tooltip } from 'antd';
 import { DeleteOutlined, EditOutlined, PlusOutlined } from '@ant-design/icons';
 import { useIntl } from '@@/plugin-locale/localeExports';
 import SearchComponent from '@/components/SearchComponent';
@@ -29,10 +29,20 @@ const Certificate = () => {
     {
       dataIndex: 'name',
       title: '证书名称',
+      width: '30%',
+      ellipsis: true,
     },
     {
       dataIndex: 'description',
       title: '说明',
+      width: '30%',
+      render: (text: any) => (
+        <div style={{ width: '100%' }} className="ellipsis">
+          <Tooltip placement="topLeft" title={text}>
+            {text}
+          </Tooltip>
+        </div>
+      ),
     },
     {
       title: intl.formatMessage({

+ 1 - 1
src/pages/media/Device/Channel/Live/index.tsx

@@ -1,6 +1,6 @@
 // 通道直播
 import { useCallback, useEffect, useState } from 'react';
-import { Radio, Modal } from 'antd';
+import { Modal, Radio } from 'antd';
 import LivePlayer from '@/components/Player';
 import MediaTool from '@/components/Player/mediaTool';
 import { service } from '../index';

+ 1 - 1
src/pages/media/Device/Channel/Save.tsx

@@ -1,7 +1,7 @@
 // Modal 弹窗,用于新增、修改数据
 import { createForm } from '@formily/core';
 import { createSchemaField } from '@formily/react';
-import { Form, FormItem, FormTab, Input, Select, FormGrid } from '@formily/antd';
+import { Form, FormGrid, FormItem, FormTab, Input, Select } from '@formily/antd';
 import { message, Modal } from 'antd';
 import { useIntl } from '@@/plugin-locale/localeExports';
 import type { ISchema } from '@formily/json-schema';

+ 20 - 15
src/pages/rule-engine/Alarm/Configuration/index.tsx

@@ -62,17 +62,23 @@ const Configuration = () => {
     {
       title: '关联场景联动',
       dataIndex: 'sceneName',
+      width: 160,
       render: (text: any, record: any) => (
         <PermissionButton
           type={'link'}
           isPermission={!!getMenuPathByCode(MENUS_CODE['rule-engine/Scene'])}
-          style={{ padding: 0, height: 'auto' }}
+          style={{ padding: 0, height: 'auto', width: '100%' }}
+          tooltip={{
+            title: !!getMenuPathByCode(MENUS_CODE['rule-engine/Scene'])
+              ? text
+              : '没有权限,请联系管理员',
+          }}
           onClick={() => {
             const url = getMenuPathByCode('rule-engine/Scene/Save');
             history.push(`${url}?id=${record.sceneId}`);
           }}
         >
-          {text}
+          <span className="ellipsis">{text}</span>
         </PermissionButton>
       ),
     },
@@ -86,6 +92,7 @@ const Configuration = () => {
     {
       title: '说明',
       dataIndex: 'description',
+      ellipsis: true,
     },
     {
       title: '操作',
@@ -143,12 +150,11 @@ const Configuration = () => {
           key="action"
           style={{ padding: 0 }}
           popConfirm={{
-            title: intl.formatMessage({
-              id: `pages.data.option.${
-                record.state?.value !== 'disabled' ? 'disabled' : 'disabled'
-              }.tips`,
-              defaultMessage: `确认${record.state?.value !== 'disabled' ? '禁用' : '启用'}?`,
-            }),
+            title: `${
+              record.state?.value !== 'disabled'
+                ? '禁用告警不会影响关联的场景状态,确定要禁用吗'
+                : '确认启用'
+            }?`,
             onConfirm: async () => {
               if (record.state?.value === 'disabled') {
                 await service._enable(record.id);
@@ -174,7 +180,7 @@ const Configuration = () => {
           }}
           type="link"
         >
-          {record.state?.value === 'disabled' ? <CloseCircleOutlined /> : <PlayCircleOutlined />}
+          {record.state?.value === 'disabled' ? <PlayCircleOutlined /> : <CloseCircleOutlined />}
         </PermissionButton>,
         <PermissionButton
           type="link"
@@ -274,12 +280,11 @@ const Configuration = () => {
                 isPermission={permission.action}
                 style={{ padding: 0 }}
                 popConfirm={{
-                  title: intl.formatMessage({
-                    id: `pages.data.option.${
-                      record.state?.value !== 'disabled' ? 'disabled' : 'enabled'
-                    }.tips`,
-                    defaultMessage: `确认${record.state?.value !== 'disabled' ? '禁用' : '启用'}?`,
-                  }),
+                  title: `${
+                    record.state?.value !== 'disabled'
+                      ? '禁用告警不会影响关联的场景状态,确定要禁用吗'
+                      : '确认启用'
+                  }?`,
                   onConfirm: async () => {
                     if (record.state?.value === 'disabled') {
                       await service._enable(record.id);

+ 5 - 2
src/pages/rule-engine/Scene/TriggerTerm/index.tsx

@@ -231,7 +231,9 @@ const TriggerTerm = (props: Props, ref: any) => {
   useImperativeHandle(ref, () => ({
     getTriggerForm: async () => {
       await form.validate();
+
       const data: any = await form.submit().then((_data: any) => {
+        if (!Array.isArray(_data.trigger)) return;
         _data.trigger?.map((item: { terms: any[] }) =>
           item.terms.map((j) => {
             if (j.value.value.length === 1) {
@@ -242,7 +244,7 @@ const TriggerTerm = (props: Props, ref: any) => {
         );
         return _data;
       });
-      return data;
+      return Array.isArray(data?.trigger) ? data : undefined;
     },
   }));
   const SchemaField = createSchemaField({
@@ -269,7 +271,7 @@ const TriggerTerm = (props: Props, ref: any) => {
         'x-component': 'FTermArrayCards',
         'x-decorator': 'FormItem',
         'x-value': {
-          termType: 'and',
+          type: 'and',
         },
         'x-component-props': {
           title: '分组',
@@ -293,6 +295,7 @@ const TriggerTerm = (props: Props, ref: any) => {
                     type: 'string',
                     // "x-decorator": 'FormItem',
                     'x-component': 'FTermTypeSelect',
+                    'x-value': 'and',
                   },
                   layout: {
                     type: 'void',