Explorar el Código

fix(metadata): fix 3803

Lind hace 3 años
padre
commit
ffe8dc7bdf
Se han modificado 1 ficheros con 16 adiciones y 1 borrados
  1. 16 1
      src/components/Metadata/JsonParam/index.tsx

+ 16 - 1
src/components/Metadata/JsonParam/index.tsx

@@ -9,7 +9,7 @@ import {
 } from '@formily/antd';
 import { createSchemaField } from '@formily/react';
 import type { ISchema } from '@formily/json-schema';
-import { DataTypeList } from '@/pages/device/data';
+import { DataTypeList, DateTypeList } from '@/pages/device/data';
 import { Store } from 'jetlinks-store';
 
 // 不算是自定义组件。只是抽离了JSONSchema
@@ -111,6 +111,21 @@ const JsonParam = (props: Props) => {
                         },
                       },
                     },
+                    format: {
+                      title: '时间格式',
+                      'x-decorator': 'FormItem',
+                      'x-component': 'Select',
+                      enum: DateTypeList,
+                      'x-visible': false,
+                      'x-reactions': {
+                        dependencies: ['..valueType.type'],
+                        fulfill: {
+                          state: {
+                            visible: "{{['date'].includes($deps[0])}}",
+                          },
+                        },
+                      },
+                    },
                     expands: {
                       type: 'object',
                       properties: {