Wzyyy98 3 лет назад
Родитель
Сommit
09ce8eda2f

+ 0 - 1
src/components/ProTableCard/CardItems/DataCollect/channel.tsx

@@ -28,7 +28,6 @@ export default (props: ChannelCardProps) => {
       status={props.state?.value}
       statusText={props.state?.text}
       showMask={false}
-      showStatus={false}
       statusNames={{
         running: StatusColorEnum.success,
         disabled: StatusColorEnum.processing,

+ 8 - 1
src/pages/device/Instance/Detail/MapChannel/Tree.tsx

@@ -48,7 +48,7 @@ const ChannelTree = (props: Props) => {
   };
 
   const save = async () => {
-    console.log(metaData);
+    // console.log(metaData);
     const params: any[] = [];
     // const metadataName = metaData.map((item: any) => item.name);
     list.forEach((item: any) => {
@@ -97,6 +97,10 @@ const ChannelTree = (props: Props) => {
     setList(filterRef.current);
   }, [filterRef.current]);
 
+  useEffect(() => {
+    console.log(checked);
+  }, [checked]);
+
   return (
     <Modal
       title="批量映射"
@@ -149,6 +153,9 @@ const ChannelTree = (props: Props) => {
               disabled={checked && checked.length === 0}
               onClick={() => {
                 const item = filterTree(data, checked);
+                if (item) {
+                  setChecked([]);
+                }
                 setData(item);
               }}
             >

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

@@ -43,7 +43,7 @@ const MapChannel = (props: Props) => {
     const res = await service.removeMap('device', data.id, [params]);
     if (res.status === 200) {
       onlyMessage('解绑成功');
-      setReload('remove');
+      setReload(params);
     }
   };
   const ActionButton = () => {

+ 2 - 1
src/pages/device/Instance/Detail/Parsing/index.tsx

@@ -325,7 +325,8 @@ const Parsing = (props: Props) => {
                 </div>
               </div>
               <Input.TextArea
-                autoSize={{ minRows: 5 }}
+                rows={5}
+                // autoSize={{ minRows: 5 ,maxRows:5}}
                 placeholder="// 二进制数据以0x开头的十六进制输入,字符串数据输入原始字符串"
                 style={{ marginTop: 10 }}
                 onChange={(e) => {

+ 2 - 2
src/pages/notice/Config/Detail/doc/Email.tsx

@@ -11,14 +11,14 @@ const Email = () => {
       <h2>1、 服务器地址</h2>
       <div>下拉可选择国内常用的邮箱服务配置,也支持手动输入其他地址。</div>
       <div>
-        系统POP协议。POP允许电子邮件客户端下载服务器上的邮件,但是您在电子邮件客户端的操作(如:移动邮件、标记已读等),这不会反馈到服务器上。
+        系统使用POP协议。POP允许电子邮件客户端下载服务器上的邮件,但是您在电子邮件客户端的操作(如:移动邮件、标记已读等),这不会反馈到服务器上。
       </div>
       <h2>2、发件人</h2>
       <div>用于发送邮件时“发件人“信息的显示</div>
       <h2>3、 用户名</h2>
       <div>用该账号进行发送邮件。</div>
       <h2>4、密码</h2>
-      <div>用账号身份认证,认证通过后可通过该账号进行发送邮件。</div>
+      <div>用账号身份认证,认证通过后可通过该账号进行发送邮件。</div>
     </div>
   );
 };

+ 1 - 1
src/pages/notice/Template/Detail/doc/DingTalkRebot.tsx

@@ -15,7 +15,7 @@ const DingTalkRebot = () => {
         通知模板结合通知配置为告警消息通知提供支撑。通知模板只能调用同一类型的通知配置服务。
       </div>
       <div>
-        使用钉钉群机器人消息通知时需在钉钉开放平台中创建好对应的机器人,再到钉钉客户端在对应的群绑定智能机器人。
+        使用钉钉群机器人消息通知时需在钉钉开放平台中创建好对应的机器人,再到钉钉客户端在对应的群绑定智能机器人。
       </div>
       <h1>2.模板配置说明</h1>
       <div>

+ 4 - 0
src/pages/rule-engine/Scene/Save/action/DeviceOutput/actions/TypeModel.tsx

@@ -179,6 +179,10 @@ export default observer((props: Props) => {
           <Input
             value={value}
             style={{ width: '100%', textAlign: 'left' }}
+            readOnly
+            onClick={() => {
+              setObjVisable(true);
+            }}
             addonAfter={
               <EditOutlined
                 onClick={() => {

+ 9 - 3
src/pages/rule-engine/Scene/Save/action/DeviceOutput/device/index.tsx

@@ -268,7 +268,13 @@ export default observer((props: Props) => {
       return nodes;
     }
     return nodes.filter((it) => {
-      if (it.children.find((item: any) => item.id.indexOf('deviceId' || 'device_id') > -1)) {
+      if (
+        it.children.find(
+          (item: any) =>
+            item.id.indexOf('deviceId' || 'device_id' || 'device_Id') > -1 &&
+            item.type === 'string',
+        )
+      ) {
         return true;
       }
       return false;
@@ -307,13 +313,13 @@ export default observer((props: Props) => {
         _list.push(...array);
       }
       //变量
-      if (builtInList.length !== 0 && !props.parallel) {
+      if (builtInList.length !== 0 && !props.parallel && props.name !== 0) {
         const array = TypeList.filter((item) => item.value === 'variable');
         _list.push(...array);
       }
       setList(_list);
     } else {
-      if (builtInList.length !== 0 && !props.parallel) {
+      if (builtInList.length !== 0 && !props.parallel && props.name !== 0) {
         const array = TypeList.filter((item) => item.value === 'variable');
         _list.push(...array);
       }

+ 1 - 1
src/pages/system/Apply/Api/index.tsx

@@ -4,7 +4,7 @@ import BasePage from './base';
 export default () => {
   return (
     <PageContainer>
-      <BasePage type={'empowerment'} showHome={true} />
+      <BasePage type={'empowerment'} showHome={true} showDebugger={true} />
     </PageContainer>
   );
 };

+ 130 - 5
src/pages/system/Apply/Save/index.tsx

@@ -31,6 +31,7 @@ import { useHistory, useLocation } from '@/hooks';
 import { getMenuPathByCode } from '@/utils/menu';
 import MenuPage from '../Menu';
 import _ from 'lodash';
+import { UploadImage } from '@/components';
 
 const Save = () => {
   const location = useLocation();
@@ -133,6 +134,7 @@ const Save = () => {
       TreeSelect,
       ArrayTable,
       AutoComplete,
+      UploadImage,
     },
   });
 
@@ -237,13 +239,35 @@ const Save = () => {
           });
         });
       });
-      onFieldReact('apiClient.authConfig.oauth2.clientId', (filed) => {
+      onFieldReact('apiClient.authConfig.oauth2.clientId', (field) => {
         if (id && accessRef.current?.includes('apiClient')) {
-          filed.componentProps = {
+          field.componentProps = {
             disabled: true,
           };
         }
       });
+      onFieldReact('apiServer.ipWhiteList', (field: any) => {
+        const value = (field as Field).value;
+        console.log(value);
+        const pattern =
+          /((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}/;
+        if (value) {
+          const str = value?.split(/[\n,]/g).filter((i: any) => i && i.trim());
+          console.log(str);
+          str.forEach((item: any) => {
+            const ip = pattern.test(item);
+            console.log(ip);
+            if (!ip) {
+              field.selfErrors = `[${item}]不是正确的IP地址`;
+              return;
+            } else {
+              field.selfErrors = '';
+            }
+          });
+        } else {
+          field.selfErrors = '';
+        }
+      });
     },
   });
 
@@ -461,6 +485,16 @@ const Save = () => {
       'x-component-props': {
         placeholder: '请输入appId',
       },
+      'x-validator': [
+        {
+          max: 64,
+          message: '最多可输入64个字符',
+        },
+        {
+          required: true,
+          message: '请输入appId',
+        },
+      ],
       'x-reactions': {
         dependencies: ['provider'],
         fulfill: {
@@ -484,6 +518,16 @@ const Save = () => {
       'x-component-props': {
         placeholder: '请输入appSecret',
       },
+      'x-validator': [
+        {
+          max: 64,
+          message: '最多可输入64个字符',
+        },
+        {
+          required: true,
+          message: '请输入appSecret',
+        },
+      ],
     },
     'sso.autoCreateUser': {
       type: 'string',
@@ -530,6 +574,16 @@ const Save = () => {
       'x-component-props': {
         placeholder: '请输入scope',
       },
+      'x-validator': [
+        {
+          max: 64,
+          message: '最多可输入64个字符',
+        },
+        {
+          required: true,
+          message: '请输入scope',
+        },
+      ],
     },
     'sso.configuration.oauth2.clientId': {
       type: 'string',
@@ -545,6 +599,16 @@ const Save = () => {
       'x-component-props': {
         placeholder: '请输入client_id',
       },
+      'x-validator': [
+        {
+          max: 64,
+          message: '最多可输入64个字符',
+        },
+        {
+          required: true,
+          message: '请输入client_id',
+        },
+      ],
     },
     'sso.configuration.oauth2.clientSecret': {
       type: 'string',
@@ -560,6 +624,16 @@ const Save = () => {
       'x-component-props': {
         placeholder: '请输入client_secret',
       },
+      'x-validator': [
+        {
+          max: 64,
+          message: '最多可输入64个字符',
+        },
+        {
+          required: true,
+          message: '请输入client_secret',
+        },
+      ],
     },
     'sso.configuration.oauth2.authorizationUrl': {
       type: 'string',
@@ -591,6 +665,17 @@ const Save = () => {
         placeholder: '请输入token地址',
       },
     },
+    'sso.configuration.oauth2.logoUrl': {
+      type: 'string',
+      title: 'logo',
+      'x-decorator': 'FormItem',
+      'x-decorator-props': {
+        gridSpan: 2,
+        layout: 'vertical',
+        labelAlign: 'left',
+      },
+      'x-component': 'UploadImage',
+    },
     'sso.configuration.oauth2.userInfoUrl': {
       type: 'string',
       title: '用户信息地址',
@@ -749,6 +834,16 @@ const Save = () => {
       'x-component-props': {
         placeholder: '请输入appId',
       },
+      'x-validator': [
+        {
+          max: 64,
+          message: '最多可输入64个字符',
+        },
+        {
+          required: true,
+          message: '请输入appId',
+        },
+      ],
     },
     'apiClient.authConfig.oauth2.clientSecret': {
       type: 'string',
@@ -764,6 +859,16 @@ const Save = () => {
       'x-component-props': {
         placeholder: '请输入appKey',
       },
+      'x-validator': [
+        {
+          max: 64,
+          message: '最多可输入64个字符',
+        },
+        {
+          required: true,
+          message: '请输入appKey',
+        },
+      ],
     },
   } as any;
   //第三方平台-客户端
@@ -1093,6 +1198,16 @@ const Save = () => {
                 'x-component-props': {
                   placeholder: '请输入secureKey',
                 },
+                'x-validator': [
+                  {
+                    max: 64,
+                    message: '最多可输入64个字符',
+                  },
+                  {
+                    required: true,
+                    message: '请输入secureKey',
+                  },
+                ],
               },
               'apiServer.redirectUri': {
                 type: 'string',
@@ -1533,7 +1648,7 @@ const Save = () => {
                       type: 'void',
                       // required: true,
                       'x-component': 'ArrayTable.Column',
-                      'x-component-props': { width: 100, title: 'key' },
+                      'x-component-props': { width: 100, title: 'KEY' },
                       properties: {
                         key: {
                           // required: true,
@@ -1545,7 +1660,7 @@ const Save = () => {
                     column2: {
                       type: 'void',
                       'x-component': 'ArrayTable.Column',
-                      'x-component-props': { width: 100, title: 'value' },
+                      'x-component-props': { width: 100, title: 'VALUE' },
                       properties: {
                         value: {
                           // required: true,
@@ -1574,7 +1689,7 @@ const Save = () => {
                   add: {
                     type: 'void',
                     'x-component': 'ArrayTable.Addition',
-                    title: '添加参数',
+                    title: '新增',
                   },
                 },
               },
@@ -1670,6 +1785,16 @@ const Save = () => {
                     'x-component-props': {
                       placeholder: '请输入默认密码',
                     },
+                    'x-validator': [
+                      {
+                        max: 64,
+                        message: '最多可输入64个字符',
+                      },
+                      {
+                        required: true,
+                        message: '请输入默认密码',
+                      },
+                    ],
                   },
                   'sso.roleIdList': {
                     title: '角色',

+ 1 - 0
src/pages/system/Apply/index.tsx

@@ -305,6 +305,7 @@ const Apply = () => {
               paddingLeft: 24,
               background: '#fff',
               fontSize: 14,
+              color: 'rgba(0, 0, 0, 0.55)',
             }}
           >
             <span style={{ marginRight: 8, fontSize: 16 }}>