From a5025a9428f7bf41b665d773123dd94244518ee4 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Mon, 20 Oct 2025 09:23:53 +0800
Subject: [PATCH] Merge branch 'master' of http://139.196.74.78:10010/r/drone/drone-app
---
src/pages/login/index.vue | 4
src/subPackages/taskDetail/execution/index.vue | 12 +++
src/subPackages/workDetail/mapWork/index.vue | 17 +++++
src/subPackages/workDetail/index.vue | 18 ++++-
src/subPackages/workDetail/addWork/index.vue | 33 +++++++++-
src/static/images/tabbar/add-task.svg | 10 +++
src/subPackages/taskDetail/addTask/index.vue | 18 +++++
src/pages/work/index.vue | 17 +++++
src/pages/inspectionTask/index.vue | 11 +++
9 files changed, 121 insertions(+), 19 deletions(-)
diff --git a/src/pages/inspectionTask/index.vue b/src/pages/inspectionTask/index.vue
index fd5bad2..30211dc 100644
--- a/src/pages/inspectionTask/index.vue
+++ b/src/pages/inspectionTask/index.vue
@@ -1,11 +1,12 @@
<!-- 巡检任务 -->
<template>
- <WebViewPlus :src="`${viewUrl}`" @webMessage="onPostMessage"/>
+ <WebViewPlus v-if="isApp" :src="`${viewUrl}`" @webMessage="onPostMessage"/>
</template>
<script setup>
import { getWebViewUrl } from "@/utils/index.js";
import WebViewPlus from "@/components/WebViewPlus.vue";
+import {onHide, onShow} from "@dcloudio/uni-app";
const viewUrl = getWebViewUrl('/inspectionTask')
@@ -22,6 +23,14 @@
}
}
}
+const isApp = ref(false)
+onShow(() => {
+ isApp.value = true
+});
+
+onHide(() => {
+ isApp.value = false
+});
</script>
<style scoped lang="scss">
diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue
index 0d2e5e2..9f75363 100644
--- a/src/pages/login/index.vue
+++ b/src/pages/login/index.vue
@@ -29,8 +29,8 @@
import { HOME_PATH, LOGIN_PATH, removeQueryString } from "@/router";
const userStore = useUserStore();
const loginForm = ref({
- username: "shuishen",
- password: "Dashabi....",
+ username: "cpz3",
+ password: "cpz3@2025",
});
const inputStyle = computed(() => {
const style = {};
diff --git a/src/pages/work/index.vue b/src/pages/work/index.vue
index 2d5daaa..eec5893 100644
--- a/src/pages/work/index.vue
+++ b/src/pages/work/index.vue
@@ -1,6 +1,6 @@
<template>
<view class="flex flex-col eventTickets">
- <WebViewPlus ref="sWebViewRef" :src="`${viewUrl}`" />
+ <WebViewPlus v-if="isApp" ref="sWebViewRef" :src="`${viewUrl}`" @webMessage="onPostMessage"/>
</view>
@@ -11,7 +11,20 @@
import WebViewPlus from "@/components/WebViewPlus.vue";
const sWebViewRef = ref(null);
const viewUrl = getWebViewUrl('/work', {})
-
+function onPostMessage(data) {
+
+ uni.navigateTo({
+ url: `/subPackages/workDetail/index?eventNum=${data.eventNum}`
+ });
+}
+ const isApp = ref(false)
+ onShow(() => {
+ isApp.value = true
+ });
+
+ onHide(() => {
+ isApp.value = false
+ });
</script>
<style scoped lang="scss">
diff --git a/src/static/images/tabbar/add-task.svg b/src/static/images/tabbar/add-task.svg
new file mode 100644
index 0000000..94465b9
--- /dev/null
+++ b/src/static/images/tabbar/add-task.svg
@@ -0,0 +1,10 @@
+<svg width="56" height="56" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g id="Group 1321316217">
+<g id="图标">
+<circle id="bg" cx="28" cy="28" r="25.5" fill="#1D6FE9" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
+</g>
+<g id="Frame">
+<path id="Vector" d="M29.051 17.3062C29.1972 17.3062 29.3373 17.3642 29.4407 17.4675C29.544 17.5709 29.6021 17.711 29.6021 17.8572V26.6735H38.4184C38.5645 26.6735 38.7047 26.7316 38.808 26.8349C38.9114 26.9382 38.9694 27.0784 38.9694 27.2245V28.3266C38.9694 28.4727 38.9114 28.6129 38.808 28.7162C38.7047 28.8195 38.5645 28.8776 38.4184 28.8776H29.6021V37.6939C29.6021 37.84 29.544 37.9802 29.4407 38.0835C29.3373 38.1869 29.1972 38.2449 29.051 38.2449H27.949C27.8029 38.2449 27.6627 38.1869 27.5594 38.0835C27.456 37.9802 27.398 37.84 27.398 37.6939V28.8776H18.5817C18.4355 28.8776 18.2954 28.8195 18.192 28.7162C18.0887 28.6129 18.0306 28.4727 18.0306 28.3266V27.2245C18.0306 27.0784 18.0887 26.9382 18.192 26.8349C18.2954 26.7316 18.4355 26.6735 18.5817 26.6735H27.398V17.8572C27.398 17.711 27.456 17.5709 27.5594 17.4675C27.6627 17.3642 27.8029 17.3062 27.949 17.3062H29.051Z" fill="white" stroke="white" stroke-width="0.4"/>
+</g>
+</g>
+</svg>
diff --git a/src/subPackages/taskDetail/addTask/index.vue b/src/subPackages/taskDetail/addTask/index.vue
index 1adc183..5dfea79 100644
--- a/src/subPackages/taskDetail/addTask/index.vue
+++ b/src/subPackages/taskDetail/addTask/index.vue
@@ -1,14 +1,30 @@
<!-- 新建任务 -->
<template>
- <WebViewPlus :src="`${viewUrl}`"/>
+ <WebViewPlus v-if="isApp" :src="`${viewUrl}`" @webMessage="onPostMessage"/>
</template>
<script setup>
import WebViewPlus from "@/components/WebViewPlus.vue";
import {getWebViewUrl} from "@/utils/index.js";
+import {onHide, onShow} from "@dcloudio/uni-app";
const viewUrl = ref(getWebViewUrl('/addTask'))
+function onPostMessage(data) {
+ if (data.type === 'submitSuccess'){
+ uni.switchTab({
+ url: '/pages/inspectionTask/index'
+ });
+ }
+}
+const isApp = ref(false)
+onShow(() => {
+ isApp.value = true
+});
+
+onHide(() => {
+ isApp.value = false
+});
</script>
<style lang="scss" scoped></style>
diff --git a/src/subPackages/taskDetail/execution/index.vue b/src/subPackages/taskDetail/execution/index.vue
index 957529d..09234ef 100644
--- a/src/subPackages/taskDetail/execution/index.vue
+++ b/src/subPackages/taskDetail/execution/index.vue
@@ -1,10 +1,10 @@
<!-- 已执行 -->
<template>
- <WebViewPlus :src="`${viewUrl}`"/>
+ <WebViewPlus v-if="isApp" :src="`${viewUrl}`"/>
</template>
<script setup>
-import {onLoad} from "@dcloudio/uni-app";
+import {onHide, onLoad, onShow} from "@dcloudio/uni-app";
import WebViewPlus from "@/components/WebViewPlus.vue";
import {getWebViewUrl} from "@/utils/index.js";
@@ -19,6 +19,14 @@
// });
// }
// }
+const isApp = ref(false)
+onShow(() => {
+ isApp.value = true
+});
+
+onHide(() => {
+ isApp.value = false
+});
</script>
<style lang="scss" scoped></style>
diff --git a/src/subPackages/workDetail/addWork/index.vue b/src/subPackages/workDetail/addWork/index.vue
index b78d0eb..bc3eb33 100644
--- a/src/subPackages/workDetail/addWork/index.vue
+++ b/src/subPackages/workDetail/addWork/index.vue
@@ -1,8 +1,33 @@
-<!-- 新建工单 -->
<template>
- <view> 基础 </view>
+ <view >
+ <WebViewPlus @webMessage="onPostMessage" v-if="isApp" ref="sWebViewRef" :src="`${viewUrl}`" />
+
+ </view>
+
</template>
-<script setup></script>
+<script setup>
+import {getWebViewUrl} from "@/utils/index.js";
+import WebViewPlus from "@/components/WebViewPlus.vue";
+const sWebViewRef = ref(null);
+const viewUrl = getWebViewUrl('/addWork')
+function onPostMessage(data) {
+ if (data.type === 'submitSuccess'){
+ uni.switchTab({
+ url: '/pages/work/index'
+ });
+ }
+}
+const isApp = ref(false)
+onShow(() => {
+ isApp.value = true
+});
-<style lang="scss" scoped></style>
+onHide(() => {
+ isApp.value = false
+});
+</script>
+
+<style scoped lang="scss">
+
+</style>
\ No newline at end of file
diff --git a/src/subPackages/workDetail/index.vue b/src/subPackages/workDetail/index.vue
index dac2931..d9d4852 100644
--- a/src/subPackages/workDetail/index.vue
+++ b/src/subPackages/workDetail/index.vue
@@ -1,21 +1,21 @@
<!-- 工单详情 - 包含待审核、待处理、处理中、已完成 -->
<template>
<div class="workDetailContainer">
- <WebViewPlus ref="sWebViewRef" :src="`${viewUrl}`" @webMessage="onPostMessage"/>
+ <WebViewPlus v-if="isApp" ref="sWebViewRef" :src="`${viewUrl}`" @webMessage="onPostMessage"/>
</div>
</template>
<script setup>
+ import {getWebViewUrl} from "@/utils/index.js";
import { onLoad } from '@dcloudio/uni-app';
import { useUserStore } from '@/store/index.js'
const userStore = useUserStore()
const userInfo = userStore.userInfo
const sWebViewRef = ref(null);
- const viewUrl = ref(`http://192.168.1.157:5173/drone-app-web-view/#/webViewWrapper/workDetail?params=${JSON.stringify(userStore?.userInfo)}`);
+ const viewUrl = ref('')
onLoad( (options) => {
- const eventNum= options.eventNum;
-
- viewUrl.value =`http://192.168.1.157:5173/drone-app-web-view/#/webViewWrapper/workDetail?params=${JSON.stringify(userStore?.userInfo)}&eventNum=${eventNum}`
+ const eventNum= options.eventNum;
+ viewUrl.value = getWebViewUrl('/workDetail', {eventNum:eventNum})
});
function onPostMessage(data) {
@@ -26,6 +26,14 @@
});
}
}
+ const isApp = ref(false)
+ onShow(() => {
+ isApp.value = true
+ });
+
+ onHide(() => {
+ isApp.value = false
+ });
</script>
<style lang="scss" scoped>
diff --git a/src/subPackages/workDetail/mapWork/index.vue b/src/subPackages/workDetail/mapWork/index.vue
index e82a780..c39e52c 100644
--- a/src/subPackages/workDetail/mapWork/index.vue
+++ b/src/subPackages/workDetail/mapWork/index.vue
@@ -1,8 +1,21 @@
<!-- 地图展示 -->
<template>
- <view> 基础 </view>
+ <WebViewPlus ref="sWebViewRef" :src="`${viewUrl}`" @webMessage="onPostMessage"/>
</template>
-<script setup></script>
+<script setup>
+ import {getWebViewUrl} from "@/utils/index.js";
+ import { onLoad } from '@dcloudio/uni-app';
+
+ const sWebViewRef = ref(null);
+ const viewUrl = ref('')
+
+ onLoad( (options) => {
+
+ const currentItem = options.currentItem
+ viewUrl.value = getWebViewUrl('/mapWork', {currentItem:currentItem})
+
+ });
+</script>
<style lang="scss" scoped></style>
--
Gitblit v1.9.3