chenyao
2025-10-14 379d64998edf01b19d396a8d364ef9d81f985268
src/subPackages/taskDetail/execution/index.vue
@@ -1,8 +1,35 @@
<!-- 已执行 -->
<template>
  <view> 基础 </view>
  <web-view ref="sWebViewRef" :src="`${viewUrl}`" @message="onPostMessage" @onPostMessage="onPostMessage" />
</template>
<script setup></script>
<script setup>
import {onLoad} from "@dcloudio/uni-app";
import {useUserStore} from "@/store/index.js";
const sWebViewRef = ref(null);
const userStore = useUserStore();
let viewUrl = ''
function onPostMessage(event) {
  if (event.detail.data[0].type === 'back') {
    // active.value = null
  }
}
// onLoad(() => {
//   window.addEventListener('message', function (e) {
//     if (e.data.data.type === 'back') {
//       // active.value = null
//     }
//   });
// })
onLoad((options) => {
  // console.log('options1111111', JSON.parse(decodeURIComponent(options)));
  const id=3333
  viewUrl = `http://192.168.1.178:5173/drone-app-web-view/#/webViewWrapper/execution?rowItem=${id}`;
});
</script>
<style lang="scss" scoped></style>