Browse Source

feat: merge

xieyonghong 3 years ago
parent
commit
4980dbafd1

+ 1 - 1
src/components/Metadata/ConfigParam/index.tsx

@@ -29,7 +29,7 @@ const ConfigParam = (props: Props) => {
             'x-decorator': 'FormItem',
             // 判断type 类型
             'x-component': 'Select',
-            enum: i.type.elements.map((e) => ({
+            enum: i.type.elements?.map((e) => ({
               label: e.text,
               value: e.value,
             })),

+ 0 - 1
src/pages/device/Instance/Detail/Diagnose/Message/index.tsx

@@ -302,7 +302,6 @@ const Message = observer(() => {
       FSelect,
       FDatePicker,
       NumberPicker,
-      DataTypeComponent,
     },
   });
 

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

@@ -1078,6 +1078,15 @@ const Edit = observer((props: Props) => {
           return;
       }
     };
+    if (params?.id) {
+      const result1 = await DB.getDB().table(`${type}`).where('id').equals(params.id).toArray();
+
+      if (result1.length > 0) {
+        message.error('标识已存在');
+        setLoading(false);
+        return;
+      }
+    }
 
     const _data = updateMetadata(type, [params], typeMap.get(props.type), updateDB);