|
@@ -183,11 +183,11 @@ export const save = async (
|
|
|
MessagePlugin.warning($t('画布为空,无法保存!'));
|
|
|
return;
|
|
|
}
|
|
|
- if (!(user && user.id)) {
|
|
|
- MessagePlugin.warning(noLoginTip);
|
|
|
- localforage.setItem(localStorageName, JSON.stringify(data));
|
|
|
- return;
|
|
|
- }
|
|
|
+ // if (!(user && user.id)) {
|
|
|
+ // MessagePlugin.warning(noLoginTip);
|
|
|
+ // localforage.setItem(localStorageName, JSON.stringify(data));
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
// 保存为组件
|
|
|
if (
|
|
|
vType === 'v.component' &&
|
|
@@ -460,16 +460,20 @@ export const save = async (
|
|
|
}
|
|
|
|
|
|
notice && MessagePlugin.success($t('保存成功!'));
|
|
|
-
|
|
|
- const msg: IframeMsg = {
|
|
|
- msgType: getVisual2DMsgType(Visual2DMsgType.SendDeviceIds),
|
|
|
- deviceIds: data.pens
|
|
|
+
|
|
|
+ // 保存为方案时才记录当前画面所绑定设备的 id
|
|
|
+ if (vType === '') {
|
|
|
+ const deviceIds = data.pens
|
|
|
.filter((item) => (item as HvacDevicePen).hvacDeviceInfo?.id)
|
|
|
.map((item) => (item as HvacDevicePen).hvacDeviceInfo.id)
|
|
|
- .join(","),
|
|
|
- };
|
|
|
+
|
|
|
+ const msg: IframeMsg = {
|
|
|
+ msgType: getVisual2DMsgType(Visual2DMsgType.SendDeviceIds),
|
|
|
+ deviceIds: [...new Set(deviceIds)].join(","),
|
|
|
+ };
|
|
|
|
|
|
- window.parent.postMessage(msg, "*");
|
|
|
+ window.parent.postMessage(msg, "*");
|
|
|
+ }
|
|
|
|
|
|
meta2d.emit('business-save', vType);
|
|
|
dot.value = false;
|