Commit 7b9625bfb6f0b0820116cb85ae37d6ca63cc00d6
1 parent
8ab0c5ad
fix: device assign custom happend error
Showing
1 changed file
with
4 additions
and
0 deletions
@@ -62,6 +62,7 @@ | @@ -62,6 +62,7 @@ | ||
62 | const current = ref(0); | 62 | const current = ref(0); |
63 | const isUpdate = ref<Boolean>(false); | 63 | const isUpdate = ref<Boolean>(false); |
64 | const deviceInfo = ref({}); | 64 | const deviceInfo = ref({}); |
65 | + let currentDeviceData = {} as Recordable; | ||
65 | const getTitle = computed(() => (!unref(isUpdate) ? '新增设备' : '编辑设备')); | 66 | const getTitle = computed(() => (!unref(isUpdate) ? '新增设备' : '编辑设备')); |
66 | // 所有参数 | 67 | // 所有参数 |
67 | let stepState = ref(); | 68 | let stepState = ref(); |
@@ -71,6 +72,7 @@ | @@ -71,6 +72,7 @@ | ||
71 | isUpdate.value = data?.isUpdate; | 72 | isUpdate.value = data?.isUpdate; |
72 | if (unref(isUpdate)) { | 73 | if (unref(isUpdate)) { |
73 | const { record } = data; | 74 | const { record } = data; |
75 | + currentDeviceData = record; | ||
74 | unref(DeviceStep1Ref)?.parentSetFieldsValue({ | 76 | unref(DeviceStep1Ref)?.parentSetFieldsValue({ |
75 | ...record, | 77 | ...record, |
76 | profile: record.deviceProfile.name, | 78 | profile: record.deviceProfile.name, |
@@ -138,8 +140,10 @@ | @@ -138,8 +140,10 @@ | ||
138 | confirmLoading: true, | 140 | confirmLoading: true, |
139 | }); | 141 | }); |
140 | if (unref(isUpdate)) { | 142 | if (unref(isUpdate)) { |
143 | + console.log(currentDeviceData); | ||
141 | const editData = { | 144 | const editData = { |
142 | ...unref(stepState), | 145 | ...unref(stepState), |
146 | + customerId: currentDeviceData.customerId, | ||
143 | deviceInfo: { | 147 | deviceInfo: { |
144 | avatar: DeviceStep1Ref.value?.devicePic, | 148 | avatar: DeviceStep1Ref.value?.devicePic, |
145 | ...DeviceStep1Ref.value?.positionState, | 149 | ...DeviceStep1Ref.value?.positionState, |