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

fix: 设备接入网关回显问题

100011797 3 лет назад
Родитель
Сommit
4cb8074f0c

+ 1 - 1
src/pages/link/AccessConfig/Detail/Cloud/index.tsx

@@ -81,7 +81,7 @@ const Cloud = (props: Props) => {
             provider={props.provider}
             data={props.data}
             config={{
-              config,
+              ...config,
               protocol: protocolCurrent,
             }}
             prev={prev}

+ 2 - 1
src/pages/link/Type/Detail/index.tsx

@@ -598,7 +598,8 @@ const Save = observer(() => {
           dependencies: ['type'],
           fulfill: {
             state: {
-              title: '{{$deps[0] === "TCP_SERVER" ? "开启TLS" : "开启DTLS"}}',
+              title:
+                '{{!["TCP_SERVER", "UDP", "COAP_SERVER"].includes($deps[0]) ? "开启TLS" : "开启DTLS"}}',
             },
           },
         },

+ 1 - 1
src/pages/rule-engine/Alarm/Configuration/Save/Base/index.tsx

@@ -117,8 +117,8 @@ export default () => {
   });
 
   const handleSave = async () => {
-    setLoading(true);
     const data: any = await form.submit();
+    setLoading(true);
     const resp: any = await service.update({ ...data });
     setLoading(false);
     if (resp.status === 200) {

+ 18 - 1
src/pages/system/Relationship/Save/index.tsx

@@ -1,6 +1,11 @@
 import { useIntl } from 'umi';
 import type { Field } from '@formily/core';
-import { createForm, onFieldInputValueChange, onFieldValueChange } from '@formily/core';
+import {
+  createForm,
+  onFieldInputValueChange,
+  onFieldValueChange,
+  registerValidateRules,
+} from '@formily/core';
 import { createSchemaField } from '@formily/react';
 import React from 'react';
 import * as ICONS from '@ant-design/icons';
@@ -114,6 +119,14 @@ const Save = (props: Props) => {
     },
   });
 
+  registerValidateRules({
+    validateId(value) {
+      if (!value) return '';
+      const reg = new RegExp('^[0-9a-zA-Z_\\\\-]+$');
+      return reg.exec(value) ? '' : '标识只能由数字、字母、下划线、中划线组成';
+    },
+  });
+
   const schema: ISchema = {
     type: 'object',
     properties: {
@@ -170,6 +183,10 @@ const Save = (props: Props) => {
                 required: true,
                 message: '请输入标识',
               },
+              {
+                validateId: true,
+                message: '标识只能由数字、26个英文字母或者下划线组成',
+              },
             ],
             name: 'relation',
             required: true,

+ 11 - 1
src/pages/system/Relationship/index.tsx

@@ -45,9 +45,19 @@ const Relationship = () => {
       },
     },
     {
-      dataIndex: 'targetTypeName',
+      dataIndex: 'targetType',
       title: '被关联方',
       ellipsis: true,
+      valueType: 'select',
+      render: (_, row) => {
+        return row.targetTypeName;
+      },
+      valueEnum: {
+        user: {
+          text: '用户',
+          status: 'user',
+        },
+      },
     },
     {
       dataIndex: 'description',