Просмотр исходного кода

fix: 应用管理、场景联动

fix: 应用管理、场景联动
hear 3 лет назад
Родитель
Сommit
1c06d89ff9

+ 1 - 1
src/pages/device/components/Metadata/Base/index.tsx

@@ -179,7 +179,7 @@ const BaseMetadata = observer((props: Props) => {
         }}
         toolbar={{
           search: {
-            placeholder: '请输入标识',
+            placeholder: '请输入名称',
             allowClear: true,
             onSearch: handleSearch,
           },

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

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

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

@@ -271,10 +271,9 @@ export default observer((props: Props) => {
     return nodes.filter((it) => {
       if (
         it.children.find(
-          (item: any) =>
-            item.id.indexOf('deviceId' || 'device_id' || 'device_Id') > -1 &&
-            item.type === 'string',
-        )
+          (item: any) => item.id.indexOf('deviceId' || 'device_id' || 'device_Id') > -1,
+        ) &&
+        !it.children.find((item: any) => item.id.indexOf('bolaen') > -1)
       ) {
         return true;
       }
@@ -293,6 +292,7 @@ export default observer((props: Props) => {
       if (res.status === 200) {
         const _data = BuiltInParamsHandleTreeData(res.result);
         const array = filterTree(_data);
+        console.log('--------', array);
         setBuiltInList(array);
       }
     });

+ 12 - 13
src/pages/system/Apply/Save/index.tsx

@@ -248,22 +248,18 @@ const Save = () => {
       });
       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 = '';
-            }
-          });
+          // console.log(str);
+          const NoIP = str.find((item: any) => !pattern.test(item));
+          console.log(NoIP);
+          if (NoIP) {
+            field.selfErrors = `[${NoIP}]不是正确的IP地址`;
+          } else {
+            field.selfErrors = '';
+          }
         } else {
           field.selfErrors = '';
         }
@@ -675,6 +671,9 @@ const Save = () => {
         labelAlign: 'left',
       },
       'x-component': 'UploadImage',
+      'x-component-props': {
+        errorMessage: '请上传.jpg.png.jfif.pjp.pjpeg.jpeg格式的图片',
+      },
     },
     'sso.configuration.oauth2.userInfoUrl': {
       type: 'string',
@@ -1625,7 +1624,7 @@ const Save = () => {
                 default: [{}],
                 title: '参数',
                 'x-decorator': 'FormItem',
-                required: true,
+                // required: true,
                 'x-component': 'ArrayTable',
                 'x-reactions': {
                   dependencies: ['provider'],