1
0

4 Commits 250f959e2e ... 43b1b7dc36

Autor SHA1 Nachricht Datum
  wangcong 43b1b7dc36 chore(config): 更新环境变量配置 vor 1 Woche
  wangcong c17485a650 chore(views): 暂时注释掉部分代码中的未登录校验 vor 1 Woche
  wangcong 134410651f chore(config): 注释掉 vite 代理配置 vor 1 Woche
  wangcong edf94fcd9b perf(views): 优化暖通图元绑定设备的逻辑 vor 1 Woche

+ 9 - 3
.env.development

@@ -1,3 +1,9 @@
-VITE_BASE_API=http://192.168.1.137:9900
-VITE_IMG_API=http://192.168.1.136:9000
-VITE_TEMP_TOKEN=
+# HKF
+# VITE_BASE_API=http://192.168.1.137:9900
+# VITE_IMG_API=http://192.168.1.70:9000
+# VITE_TEMP_TOKEN=ibjsk8jxqqeAkawSI0Z6LoOaqIDqS2w7vg_M2Sdzifa36F3x7Bv8TF8pyx04JKqwNV66Z3tVzpdaNrbNegS4vi6-845h4LdMhAb5H3hpBxmQiil3droqG0_8fNwqCeTJ
+
+# TEST
+VITE_BASE_API=http://39.105.175.99/hvac
+VITE_IMG_API=http://39.105.175.99:9000
+VITE_TEMP_TOKEN=_r-qWGpWSX-gis4EuK5Q9l9QIQum1RA3NeXROq3HJrdnNEd92W1d9UJ11pKbNSld8vNQFX5jauX6jbhT4JKmHI_qxdPVs4cdP0fvQoVN7K65O7L0-RynkTVDAeRvxbNQ

+ 1 - 1
.env.production

@@ -1,3 +1,3 @@
 VITE_BASE_API=http://39.105.175.99/hvac
 VITE_IMG_API=http://39.105.175.99:9000
-VITE_TEMP_TOKEN=
+VITE_TEMP_TOKEN=_r-qWGpWSX-gis4EuK5Q9l9QIQum1RA3NeXROq3HJrdnNEd92W1d9UJ11pKbNSld8vNQFX5jauX6jbhT4JKmHI_qxdPVs4cdP0fvQoVN7K65O7L0-RynkTVDAeRvxbNQ

+ 16 - 12
src/services/common.ts

@@ -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;

+ 4 - 4
src/views/components/FileProps.vue

@@ -378,10 +378,10 @@ const selectedSreen = (item: any) => {
 };
 
 const beforeUpload = (file: any) => {
-  if (!(user && user.id)) {
-    MessagePlugin.warning($t('请先登录!'));
-    return false;
-  }
+  // if (!(user && user.id)) {
+  //   MessagePlugin.warning($t('请先登录!'));
+  //   return false;
+  // }
   return true;
 };
 

+ 4 - 4
src/views/components/Graphics.vue

@@ -2271,10 +2271,10 @@ const onSelectFiles = (item: any) => {
 };
 
 const beforeUpload = (file: any) => {
-  if (!(user && user.id)) {
-    MessagePlugin.warning('请先登录!');
-    return false;
-  }
+  // if (!(user && user.id)) {
+  //   MessagePlugin.warning('请先登录!');
+  //   return false;
+  // }
   return true;
 };
 

+ 4 - 4
src/views/components/PenProps.vue

@@ -1666,10 +1666,10 @@ const beforeUpload = (file: any) => {
   //   MessagePlugin.warning($t('上传的图片不能大于5M'));
   //   return false;
   // }
-  if (!(user && user.id)) {
-    MessagePlugin.warning($t('请先登录!'));
-    return false;
-  }
+  // if (!(user && user.id)) {
+  //   MessagePlugin.warning($t('请先登录!'));
+  //   return false;
+  // }
   return true;
 };
 

+ 6 - 5
vite.config.ts

@@ -51,12 +51,13 @@ export default defineConfig({
       // '/image': 'https://v.le5le.com/',
       // '/file': 'https://v.le5le.com/',
       // '/api': 'http://192.168.110.141:7000/',
-      '/api': 'https://v.le5le.com/',
-      '/v/material': 'https://v.le5le.com/',
-      '/png': 'https://v.le5le.com/',
-      '/svg': 'https://v.le5le.com/',
+      // '/api': 'http://192.168.1.137:9900/api-dashboard',
+      // '/api': 'https://v.le5le.com/',
+      // '/v/material': 'https://v.le5le.com/',
+      // '/png': 'https://v.le5le.com/',
+      // '/svg': 'https://v.le5le.com/',
       // '/view': 'https://v.le5le.com/',
-      '/api/tools':'https://v.le5le.com/'
+      // '/api/tools':'https://v.le5le.com/'
     },
   },
 });