Bläddra i källkod

多媒体采集上传完通知。

jiaxiaoqiang 9 månader sedan
förälder
incheckning
8c503a6c97
1 ändrade filer med 9 tillägg och 0 borttagningar
  1. 9 0
      src/views/pro-steps/components/duomeiticaiji.vue

+ 9 - 0
src/views/pro-steps/components/duomeiticaiji.vue

@@ -116,6 +116,7 @@ const select_ohos = () => {
     methodName: "selectFile",
     apiUrlPath: "/api/v1/process/media/add", //上传完成后调的接口 不包含baseurl
     method: "post",
+    messageKey: "refreshView",
   };
 
   if (window.openHarmonyBridge && window.openHarmonyBridge.selectFile) {
@@ -132,11 +133,19 @@ const camera_ohos = () => {
     apiUrlPath: "/api/v1/process/media/add", //上传完成后调的接口 不包含baseurl
     method: "post",
     methodName: "startCamera",
+    messageKey: "refreshView",
   };
   if (window.openHarmonyBridge && window.openHarmonyBridge.startCamera) {
     window.openHarmonyBridge.startCamera(JSON.stringify(p));
   }
 };
+
+window.addEventListener("message", (event) => {
+  const data = JSON.parse(event.data);
+  if (data.fullUrl && data.messageKey && data.messageKey === "refreshView") {
+    getListData();
+  }
+});
 </script>
 
 <style lang="scss" scoped>