| ... | ... | @@ -25,6 +25,7 @@ | 
| 25 | 25 | import { Button } from 'ant-design-vue'; | 
| 26 | 26 | import { getModelTsl } from '/@/api/device/modelOfMatter'; | 
| 27 | 27 | import { FunctionType } from './cpns/config'; | 
|  | 28 | +  import { isObject } from '/@/utils/is'; | 
| 28 | 29 |  | 
| 29 | 30 | defineEmits(['register']); | 
| 30 | 31 |  | 
| ... | ... | @@ -78,11 +79,17 @@ | 
| 78 | 79 | ]); | 
| 79 | 80 | }; | 
| 80 | 81 |  | 
|  | 82 | +  const isEmptyObject = (value: any) => isObject(value) && !Object.keys(value).length; | 
|  | 83 | + | 
| 81 | 84 | const handleExportAll = async () => { | 
| 82 | 85 | loading.value = true; | 
| 83 | 86 | try { | 
| 84 | 87 | const [events, properties, services] = await getAllModel(); | 
| 85 |  | -      const value = { properties, services, events }; | 
|  | 88 | +      const value = { | 
|  | 89 | +        properties: isEmptyObject(properties) ? [] : properties, | 
|  | 90 | +        services: isEmptyObject(services) ? [] : services, | 
|  | 91 | +        events: isEmptyObject(events) ? [] : events, | 
|  | 92 | +      }; | 
| 86 | 93 | exportJSONFile(value); | 
| 87 | 94 | } catch (error) { | 
| 88 | 95 | throw error; | 
... | ... |  |