Showing
2 changed files
with
7 additions
and
1 deletions
| ... | ... | @@ -7,9 +7,12 @@ import type { ModalProps } from '@/components/Modal' |
| 7 | 7 | import { BasicModal, useModalInner } from '@/components/Modal' |
| 8 | 8 | import { DataSourceTypeEnum } from '@/enums/datasource' |
| 9 | 9 | import type { NodeDataActJsonType, NodeDataEventJsonType } from '@/api/node/model' |
| 10 | +import { useContentDataStoreWithOut } from '@/store/modules/contentData' | |
| 10 | 11 | |
| 11 | 12 | defineEmits(['register']) |
| 12 | 13 | |
| 14 | +const contentDataStore = useContentDataStoreWithOut() | |
| 15 | + | |
| 13 | 16 | const { getNodeData, getNodeAllData, saveNodeAllData } = usePublicFormContext() |
| 14 | 17 | |
| 15 | 18 | const contentComponent = shallowRef() |
| ... | ... | @@ -39,6 +42,9 @@ const handleDoSaveActData = async () => { |
| 39 | 42 | const { event } = unref(componentProps)! |
| 40 | 43 | const { actJson } = toRaw(unref(getNodeData)) || {} |
| 41 | 44 | const value = unref(componentInstance)?.getFieldsValue() |
| 45 | + | |
| 46 | + if (contentDataStore.getIsTemplate) value.deviceId = null | |
| 47 | + | |
| 42 | 48 | await saveNodeAllData({ ...toRaw(unref(getNodeData)), actJson: { ...(actJson || {} as NodeDataActJsonType), [event]: value } }) |
| 43 | 49 | } |
| 44 | 50 | ... | ... |