From 44dd9c4eb8a2489c63a5eb53fd4254bbb3510e95 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Thu, 18 Jun 2026 09:14:57 +0800
Subject: [PATCH] Merge branch 'feature/v9.0/9.0.4'
---
src/subPackages/taskDetail/execution/index.vue | 49 +++++++++++++++++++++++++++++--------------------
1 files changed, 29 insertions(+), 20 deletions(-)
diff --git a/src/subPackages/taskDetail/execution/index.vue b/src/subPackages/taskDetail/execution/index.vue
index 034aa96..201e281 100644
--- a/src/subPackages/taskDetail/execution/index.vue
+++ b/src/subPackages/taskDetail/execution/index.vue
@@ -1,34 +1,43 @@
<!-- 已执行 -->
<template>
- <web-view ref="sWebViewRef" :src="`${viewUrl}`" @message="onPostMessage" @onPostMessage="onPostMessage" />
+ <WebViewPlus v-if="isApp" :src="`${viewUrl}`" @webMessage="onPostMessage"/>
</template>
<script setup>
-import {onLoad} from "@dcloudio/uni-app";
-import {useUserStore} from "@/store/index.js";
+import {onHide, onLoad, onShow} from "@dcloudio/uni-app";
+import WebViewPlus from "@/components/WebViewPlus.vue";
+import {getWebViewUrl} from "@/utils/index.js";
-const sWebViewRef = ref(null);
-const userStore = useUserStore();
-let viewUrl = ''
+const wayLineJobInfoId = ref(null)
+const viewUrl = ref('')
-function onPostMessage(event) {
- if (event.detail.data[0].type === 'back') {
- // active.value = null
+function onPostMessage(data) {
+ if (data.type === 'back') {
+ uni.switchTab({
+ url: '/pages/inspectionTask/index'
+ });
+ } else if (data.type === 'control') {
+ uni.redirectTo({
+ url: `/pages/inspectionTask/execution/index?wayLineJobInfoId=${wayLineJobInfoId.value}`
+ });
+ } else if(data.type === 'workid') {
+ uni.navigateTo({
+ url: `/subPackages/workDetail/index?eventNum=${data.eventNum}&wLJobInfoId=${data.wLJobInfoId}¤t=${data.current}`
+ });
}
}
-// 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}`;
+ wayLineJobInfoId.value = options.wayLineJobInfoId
+ viewUrl.value = getWebViewUrl('/execution', {wayLineJobInfoId: wayLineJobInfoId.value, waylineJobId: options.waylineJobId, batch_no: options.batch_no})
+})
+const isApp = ref(false)
+onShow(() => {
+ isApp.value = true
+});
+
+onHide(() => {
+
});
</script>
--
Gitblit v1.9.3