Procházet zdrojové kódy

feat(merge): merge sc

fix: 合并冲突
Lind před 3 roky
rodič
revize
7dde9bf51b

+ 51 - 9
src/pages/Northbound/AliCloud/Detail/index.tsx

@@ -134,6 +134,10 @@ const Detail = observer(() => {
             max: 64,
             message: '最多可输入64个字符',
           },
+          {
+            required: true,
+            message: '请输入名称',
+          },
         ],
       },
       accessConfig: {
@@ -155,6 +159,12 @@ const Detail = observer(() => {
               tooltip: '阿里云内部给每台机器设置的唯一编号',
             },
             'x-reactions': ['{{useAsyncDataSource(queryRegionsList)}}'],
+            'x-validator': [
+              {
+                required: true,
+                message: '请选择服务地址',
+              },
+            ],
           },
           accessKeyId: {
             type: 'string',
@@ -170,6 +180,10 @@ const Detail = observer(() => {
                 max: 64,
                 message: '最多可输入64个字符',
               },
+              {
+                required: true,
+                message: '请输入accessKey',
+              },
             ],
             'x-decorator-props': {
               tooltip: '用于程序通知方式调用云服务API的用户标识',
@@ -186,6 +200,10 @@ const Detail = observer(() => {
             },
             'x-validator': [
               {
+                required: true,
+                message: '请输入accessSecret',
+              },
+              {
                 max: 64,
                 message: '最多可输入64个字符',
               },
@@ -211,26 +229,36 @@ const Detail = observer(() => {
         'x-decorator-props': {
           tooltip: '物联网平台对应的阿里云产品',
         },
+        'x-validator': [
+          {
+            required: true,
+            message: '请选择网桥产品',
+          },
+        ],
       },
       mappings: {
         type: 'array',
         required: true,
         'x-component': 'ArrayCollapse',
-        title: '产品映射',
+        'x-decorator': 'FormItem',
         items: {
           type: 'object',
-          required: true,
           'x-component': 'ArrayCollapse.CollapsePanel',
           'x-component-props': {
             header: '产品映射',
           },
           properties: {
-            grid: {
+            index: {
+              type: 'void',
+              'x-component': 'ArrayCollapse.Index',
+            },
+            layout: {
               type: 'void',
-              'x-component': 'FormGrid',
-              'x-component-props': {
-                minColumns: [24],
-                maxColumns: [24],
+              'x-decorator': 'FormGrid',
+              'x-decorator-props': {
+                maxColumns: 2,
+                minColumns: 2,
+                columnGap: 24,
               },
               properties: {
                 type: 'object',
@@ -247,10 +275,17 @@ const Detail = observer(() => {
                       option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0,
                   },
                   'x-decorator-props': {
-                    gridSpan: 12,
+                    layout: 'vertical',
+                    labelAlign: 'left',
                     tooltip: '阿里云物联网平台产品标识',
                   },
                   'x-reactions': ['{{useAsyncDataSource(queryAliyunProductList)}}'],
+                  'x-validator': [
+                    {
+                      required: true,
+                      message: '请选择阿里云产品',
+                    },
+                  ],
                 },
                 productId: {
                   type: 'string',
@@ -259,7 +294,8 @@ const Detail = observer(() => {
                   'x-decorator': 'FormItem',
                   'x-component': 'Select',
                   'x-decorator-props': {
-                    gridSpan: 12,
+                    layout: 'vertical',
+                    labelAlign: 'left',
                   },
                   'x-component-props': {
                     placeholder: '请选择平台产品',
@@ -268,6 +304,12 @@ const Detail = observer(() => {
                       option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0,
                   },
                   'x-reactions': ['{{useAsyncDataSource(queryProductList)}}'],
+                  'x-validator': [
+                    {
+                      required: true,
+                      message: '请选择平台产品',
+                    },
+                  ],
                 },
               },
             },

+ 22 - 0
src/pages/account/NotificationSubscription/save/index.tsx

@@ -65,6 +65,10 @@ const Save = (props: Props) => {
             },
             'x-validator': [
               {
+                required: true,
+                message: '请输入名称',
+              },
+              {
                 max: 64,
                 message: '最多可输入64个字符',
               },
@@ -84,6 +88,12 @@ const Save = (props: Props) => {
               placeholder: '请选择类型',
             },
             'x-reactions': ['{{useAsyncDataSource(queryProvidersList)}}'],
+            'x-validator': [
+              {
+                required: true,
+                message: '请选择类型',
+              },
+            ],
           },
           'topicConfig.alarmConfigId': {
             title: '告警规则',
@@ -99,6 +109,12 @@ const Save = (props: Props) => {
               placeholder: '请选择告警规则',
             },
             'x-reactions': ['{{useAsyncDataSource(queryAlarmConfigList)}}'],
+            'x-validator': [
+              {
+                required: true,
+                message: '请选择告警规则',
+              },
+            ],
           },
           notice: {
             title: '通知方式',
@@ -127,6 +143,12 @@ const Save = (props: Props) => {
               labelAlign: 'left',
               layout: 'vertical',
             },
+            'x-validator': [
+              {
+                required: true,
+                message: '请选择通知方式',
+              },
+            ],
           },
         },
       },

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

@@ -1,5 +1,5 @@
 import LivePlayer from '@/components/Player';
-import { Image, Modal } from 'antd';
+import { Modal, Image } from 'antd';
 
 interface Props {
   close: () => void;

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

@@ -1,7 +1,7 @@
 import type { PropertyMetadata } from '@/pages/device/Product/typings';
 import styles from './index.less';
 import Detail from './Detail';
-import { useState } from 'react';
+import { useEffect, useState } from 'react';
 import { message, Tooltip } from 'antd';
 
 interface Props {
@@ -29,6 +29,11 @@ const FileComponent = (props: Props) => {
   const [type, setType] = useState<string>('other');
   const [visible, setVisible] = useState<boolean>(false);
   const isHttps = document.location.protocol === 'https:';
+  const [temp, setTemp] = useState<boolean>(false);
+
+  useEffect(() => {
+    setTemp(false);
+  }, [props.value]);
 
   const renderValue = () => {
     if (!value?.formatValue) {
@@ -46,7 +51,7 @@ const FileComponent = (props: Props) => {
           </div>
         );
       }
-      if (['.jpg', '.png'].some((item) => value?.formatValue.includes(item))) {
+      if (['.jpg', '.png', '.swf', '.tiff'].some((item) => value?.formatValue.includes(item))) {
         // 图片
         return (
           <div
@@ -54,6 +59,8 @@ const FileComponent = (props: Props) => {
             onClick={() => {
               if (isHttps && value?.formatValue.indexOf('http:') !== -1) {
                 message.error('域名为https时,不支持访问http地址');
+              } else if (temp) {
+                message.error('该图片无法访问');
               } else {
                 const flag =
                   ['.jpg', '.png'].find((item) => value?.formatValue.includes(item)) || '';
@@ -66,6 +73,7 @@ const FileComponent = (props: Props) => {
               src={value?.formatValue}
               onError={(e: any) => {
                 e.target.src = imgMap.get('error');
+                setTemp(true);
               }}
             />
           </div>

+ 1 - 0
src/pages/device/Instance/service.ts

@@ -279,6 +279,7 @@ class Service extends BaseService<DeviceInstance> {
       method: 'POST',
       data: {
         paging: false,
+        sorts: [{ name: 'name', order: 'asc' }],
       },
     });
   // 保存设备的物模型指标

+ 22 - 0
src/pages/link/Certificate/Detail/index.tsx

@@ -50,6 +50,12 @@ const Detail = observer(() => {
         default: 'common',
         'x-decorator': 'FormItem',
         'x-component': 'Standard',
+        'x-validator': [
+          {
+            required: true,
+            message: '请选择证书标准',
+          },
+        ],
       },
       name: {
         type: 'string',
@@ -62,6 +68,10 @@ const Detail = observer(() => {
         },
         'x-validator': [
           {
+            required: true,
+            message: '请输入证书名称',
+          },
+          {
             max: 64,
             message: '最多可输入64个字符',
           },
@@ -77,6 +87,12 @@ const Detail = observer(() => {
           placeholder:
             '证书私钥格式以"-----BEGIN (RSA|EC) PRIVATE KEY-----"开头,以"-----END(RSA|EC) PRIVATE KEY-----"结尾。',
         },
+        'x-validator': [
+          {
+            required: true,
+            message: '请上传证书文件',
+          },
+        ],
       },
       'configs.key': {
         title: '证书私钥',
@@ -88,6 +104,12 @@ const Detail = observer(() => {
           placeholder:
             '证书私钥格式以"-----BEGIN (RSA|EC) PRIVATE KEY-----"开头,以"-----END(RSA|EC) PRIVATE KEY-----"结尾。',
         },
+        'x-validator': [
+          {
+            required: true,
+            message: '请输入证书私钥',
+          },
+        ],
       },
       description: {
         title: '说明',

+ 2 - 0
src/pages/link/Certificate/index.tsx

@@ -24,6 +24,7 @@ const Certificate = () => {
     {
       dataIndex: 'type',
       title: '证书标准',
+      render: (text: any) => <span>{text?.text || '-'}</span>,
     },
     {
       dataIndex: 'name',
@@ -101,6 +102,7 @@ const Certificate = () => {
         params={param}
         columns={columns}
         search={false}
+        rowKey="id"
         headerTitle={
           <PermissionButton
             onClick={() => {

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

@@ -91,7 +91,7 @@ const TabComponent = observer((props: Props) => {
             type: 'and',
           },
         ],
-        sorts: [{ name: 'alarmDate', order: 'desc' }],
+        sorts: [{ name: 'alarmTime', order: 'desc' }],
       })
       .then((resp) => {
         if (resp.status === 200) {