From 230bc667109c42a39b312019f9f0e9dbe336e16f Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Thu, 22 Jan 2026 11:02:39 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
applications/task-work-order/src/views/orderView/orderDataManage/dataObjection/FormDiaLog.vue | 38 +++-
/dev/null | 294 ------------------------------------
applications/task-work-order/vite.config.mjs | 2
applications/task-work-order/src/views/orderView/orderManage/orderManage/index.vue | 26 ++
applications/task-work-order/src/views/orderView/orderDataManage/appInnovation/index.vue | 2
applications/drone-command/vite.config.mjs | 2
applications/mobile-web-view/vite.config.mjs | 2
applications/task-work-order/src/views/orderView/orderDataManage/supplyAdd/ApplyViewDialog.vue | 8
applications/task-work-order/src/views/orderView/orderDataManage/appInnovation/FormDiaLog.vue | 3
applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/inspectionRequestApi.js | 2
applications/task-work-order/src/views/orderView/orderManage/orderManage/FormDiaLog.vue | 50 +++++-
applications/task-work-order/src/views/orderView/orderDataManage/dataObjection/dataObjectionApi.js | 9 +
12 files changed, 112 insertions(+), 326 deletions(-)
diff --git a/applications/drone-command/vite.config.mjs b/applications/drone-command/vite.config.mjs
index cc99c15..6919fc7 100644
--- a/applications/drone-command/vite.config.mjs
+++ b/applications/drone-command/vite.config.mjs
@@ -38,7 +38,7 @@
__INTLIFY_PROD_DEVTOOLS__: false,
},
server: {
- port: 5174,
+ port: 5177,
// host: '192.168.1.178',
proxy: {
'/api': {
diff --git a/applications/mobile-web-view/vite.config.mjs b/applications/mobile-web-view/vite.config.mjs
index e706f61..8a2bf9a 100644
--- a/applications/mobile-web-view/vite.config.mjs
+++ b/applications/mobile-web-view/vite.config.mjs
@@ -67,7 +67,7 @@
// key: fs.readFileSync('./127.0.0.1+3-key.pem'), // 私钥路径
// cert: fs.readFileSync('./127.0.0.1+3.pem'), // 证书路径
// },
- port: 5175,
+ port: 5179,
proxy: {
'/aisky-webodm-vol': {
target: 'https://wrj.shuixiongit.com/aisky-webodm-vol',
diff --git a/applications/task-work-order/src/views/orderView/orderDataManage/appInnovation/FormDiaLog.vue b/applications/task-work-order/src/views/orderView/orderDataManage/appInnovation/FormDiaLog.vue
index 6dd96d2..1417098 100644
--- a/applications/task-work-order/src/views/orderView/orderDataManage/appInnovation/FormDiaLog.vue
+++ b/applications/task-work-order/src/views/orderView/orderDataManage/appInnovation/FormDiaLog.vue
@@ -131,9 +131,6 @@
innovationStatus: '',
})
-// 从父组件注入字典数据
-const appInnovationStatusOptions = inject('appInnovationStatusOptions')
-
const emit = defineEmits(['success'])
const formRef = ref(null) // 表单实例
const formData = ref(initForm()) // 表单数据
diff --git a/applications/task-work-order/src/views/orderView/orderDataManage/appInnovation/index.vue b/applications/task-work-order/src/views/orderView/orderDataManage/appInnovation/index.vue
index 345ef80..4ed5abb 100644
--- a/applications/task-work-order/src/views/orderView/orderDataManage/appInnovation/index.vue
+++ b/applications/task-work-order/src/views/orderView/orderDataManage/appInnovation/index.vue
@@ -54,7 +54,7 @@
<el-table-column label="操作" class-name="operation-btns">
<template v-slot="{ row }">
<el-link @click="openForm('view', row)">查看</el-link>
- <el-link @click="openForm('edit', row)">编辑</el-link>
+<!-- <el-link @click="openForm('edit', row)">编辑</el-link>-->
<el-link @click="handleDelete(row)">删除</el-link>
</template>
</el-table-column>
diff --git a/applications/task-work-order/src/views/orderView/orderDataManage/dataObjection/FormDiaLog.vue b/applications/task-work-order/src/views/orderView/orderDataManage/dataObjection/FormDiaLog.vue
index 0a47538..33b53a1 100644
--- a/applications/task-work-order/src/views/orderView/orderDataManage/dataObjection/FormDiaLog.vue
+++ b/applications/task-work-order/src/views/orderView/orderDataManage/dataObjection/FormDiaLog.vue
@@ -39,7 +39,7 @@
</el-col>
<el-col :span="12">
<div class="label">相关附件</div>
- <div class="val">{{ formData.attachName || '暂无附件' }}</div>
+ <div class="val">{{ formData.attachNames || '暂无附件' }}</div>
</el-col>
<el-col :span="12" v-if="detailObjectionStatus === '2'">
<div class="label">其他异议详情</div>
@@ -203,8 +203,19 @@
>
反馈
</el-button>
+ <el-button
+ class="save-btn"
+ color="#4C34FF"
+
+ :loading="submitting"
+ :disabled="submitting"
+ @click="handleDownloadAttach"
+
+ >
+ 下载附件
+ </el-button>
</template>
- <template v-if="detailDemandStatus === '2'">
+ <template v-if="detailObjectionStatus === '2'">
<el-button color="#F2F3F5" :loading="submitting" :disabled="submitting" @click="visible = false">关闭</el-button>
</template>
</template>
@@ -218,6 +229,7 @@
import {
gdDataObjectionDetailApi,
gdDataObjectionSubmitApi,
+ getAttachDetailApi,
} from '@/views/orderView/orderDataManage/dataObjection/dataObjectionApi'
import { putFileAttachApi } from '@/views/orderView/orderDataManage/supplyAdd/supplyAddApi'
import { pxToRem } from '@/utils/rem'
@@ -265,6 +277,7 @@
const titleEnum = ref({ edit: '编辑', view: '查看', add: '数据异议申请' })
const fileList = ref([]) // 上传文件列表
const uploadedFiles = ref([]) // 已上传文件列表
+const attachmentDetailsList = ref([])
// 表单校验规则
const rules = {
@@ -305,9 +318,6 @@
if (file.response && file.response.attachId) {
uploadedFiles.value = uploadedFiles.value.filter(item => item.attachId !== file.response.attachId)
}
- // 更新formData中的附件信息
- formData.value.attachId = uploadedFiles.value.map(f => f.attachId).join(',')
- formData.value.attachName = uploadedFiles.value.map(f => f.originalName).join(',')
}
// 上传前验证
@@ -336,9 +346,6 @@
link: fileData.link,
attachId: fileData.attachId,
})
- // 更新formData中的附件信息
- formData.value.attachId = uploadedFiles.value.map(f => f.attachId).join(',')
- formData.value.attachName = uploadedFiles.value.map(f => f.originalName).join(',')
ElMessage.success('文件上传成功!')
}
}
@@ -419,6 +426,20 @@
const res = await gdDataObjectionDetailApi({ id: formData.value.id })
formData.value = res?.data?.data ?? {}
}
+// 获取附件详情
+async function getAttachDetail() {
+ if (!formData.value.id) return
+ const res = await getAttachDetailApi({ id: formData.value.id })
+ console.log('附件详情',res.data.data)
+ attachmentDetailsList.value=res.data.data
+}
+// 处理附件下载
+async function handleDownloadAttach() {
+console.log('附件');
+
+
+}
+
// 打开弹框
async function open({ mode = 'add', row } = {}) {
@@ -432,6 +453,7 @@
feedbackFormData.value = initFeedbackForm()
if (dialogMode.value !== 'add') {
await loadDetail()
+ await getAttachDetail()
}
}
diff --git a/applications/task-work-order/src/views/orderView/orderDataManage/dataObjection/dataObjectionApi.js b/applications/task-work-order/src/views/orderView/orderDataManage/dataObjection/dataObjectionApi.js
index f99ab16..fc07017 100644
--- a/applications/task-work-order/src/views/orderView/orderDataManage/dataObjection/dataObjectionApi.js
+++ b/applications/task-work-order/src/views/orderView/orderDataManage/dataObjection/dataObjectionApi.js
@@ -36,3 +36,12 @@
})
}
+// 获取附件详情
+export const getAttachDetailApi = params => {
+ return request({
+ url: `/blade-resource/attach/detail`,
+ method: 'get',
+ params,
+ })
+}
+
diff --git a/applications/task-work-order/src/views/orderView/orderDataManage/supplyAdd/ApplyViewDialog.vue b/applications/task-work-order/src/views/orderView/orderDataManage/supplyAdd/ApplyViewDialog.vue
index b1bb4c2..09f2938 100644
--- a/applications/task-work-order/src/views/orderView/orderDataManage/supplyAdd/ApplyViewDialog.vue
+++ b/applications/task-work-order/src/views/orderView/orderDataManage/supplyAdd/ApplyViewDialog.vue
@@ -68,7 +68,7 @@
</el-row>
</div>
<!-- 申请中-->
- <div v-if="detailDemandStatus === '1'">
+ <div v-if="detailDemandStatus === '1' && !requesterProvider">
<div class="detail-title">数据上传</div>
<div class="upload-container">
<el-upload
@@ -106,7 +106,7 @@
</div>
</div>
<template #footer>
- <template v-if="detailDemandStatus === '1'">
+ <template v-if="detailDemandStatus === '1' && !requesterProvider">
<el-button class="save-btn" color="#4C34FF" @click="rejectTheApplication">拒绝申请</el-button>
<el-button color="#F2F3F5" @click="approvedByTheReview">审核通过</el-button>
</template>
@@ -140,7 +140,9 @@
import { ElMessage } from 'element-plus'
import reasonForRejectionDialog from '@/views/orderView/orderDataManage/supplyAdd/reasonForRejectionDialog.vue'
import AuditRecord from '@/views/orderView/orderDataManage/supplyAdd/auditRecord.vue' // 导入新组件
-
+import { useStore } from 'vuex'
+const store = useStore()
+const requesterProvider = computed(() => store.state.user.userInfo?.role_id === '2014158512610869250')
const emit = defineEmits(['success'])
const dictObj = inject('dictObj')
const deptTree = inject('deptTree')
diff --git a/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/inspectionRequestApi.js b/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/inspectionRequestApi.js
index 0123165..3d9a491 100644
--- a/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/inspectionRequestApi.js
+++ b/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/inspectionRequestApi.js
@@ -1,6 +1,6 @@
import request from '@/axios'
-// 分页查询
+// 分页查询巡查page
export const gdPatrolTaskPageApi = params => {
return request({
url: `/drone-gd/workOrder/gdPatrolTask/page`,
diff --git a/applications/task-work-order/src/views/orderView/orderManage/orderManage/FormDiaLog.vue b/applications/task-work-order/src/views/orderView/orderManage/orderManage/FormDiaLog.vue
index f054c12..47e50c3 100644
--- a/applications/task-work-order/src/views/orderView/orderManage/orderManage/FormDiaLog.vue
+++ b/applications/task-work-order/src/views/orderView/orderManage/orderManage/FormDiaLog.vue
@@ -48,6 +48,31 @@
<el-table-column prop="deviceName" label="设备型号" />
<el-table-column prop="devicePayload" label="设备负载" />
</el-table>
+ <template v-if="hasPatrolTaskList">
+ <div class="detail-title" :style="{ marginTop: pxToRem(20) }">巡查任务名称</div>
+ <el-table class="setHeight" :data="patrolTaskList" row-key="id">
+ <el-table-column prop="patrolTaskName" show-overflow-tooltip label="巡查任务名称" />
+ <el-table-column prop="patrolTaskType" show-overflow-tooltip label="巡查任务类型">
+ <template v-slot="{ row }">
+ {{ getDictLabel(row.patrolTaskType, dictObj.patrolTaskType) }}
+ </template>
+ </el-table-column>
+ <el-table-column prop="taskStatus" show-overflow-tooltip label="任务状态">
+ <template v-slot="{ row }">
+ {{ getDictLabel(row.taskStatus, dictObj.taskStatus) }}
+ </template>
+ </el-table-column>
+ <el-table-column prop="executeTime" show-overflow-tooltip label="任务执行时间" />
+ <el-table-column prop="feishou" show-overflow-tooltip label="选择飞手" />
+ <el-table-column prop="deviceId" show-overflow-tooltip label="选择设备" />
+ <el-table-column label="操作" class-name="operation-btns">
+ <template v-slot="{ row }">
+ <el-link type="primary" @click="">查看</el-link>
+ </template>
+ </el-table-column>
+ </el-table>
+ </template>
+
</div>
<el-form
class="gd-dialog-form"
@@ -217,6 +242,7 @@
import dayjs from 'dayjs'
import RefuseOrderDialog from '@/views/orderView/orderManage/orderManage/RefuseOrderDialog.vue'
import CommonCesiumMap from '@/components/map-container/common-cesium-map.vue'
+import { gdPatrolTaskPageApi } from '@/views/orderView/orderManage/inspectionRequest/inspectionRequestApi'
// 初始化表单数据
const initForm = () => ({
@@ -234,6 +260,7 @@
const rejectVisible = ref(false)
const dictObj = inject('dictObj')
const dateRange = ref([])
+const patrolTaskList = ref([])
const emit = defineEmits(['success'])
const formRef = ref(null) // 表单实例
const formData = ref(initForm()) // 表单数据
@@ -425,22 +452,27 @@
})
}
+const hasPatrolTaskList = computed(() => ['30','40','50','60'].includes(String(formData.value.workOrderStatus)))
+
+function gdPatrolTaskPage() {
+ gdPatrolTaskPageApi({ current: 1, size: 1000, workOrderId: formData.value.id }).then(res => {
+ patrolTaskList.value = res.data.data.records || []
+ })
+}
+
// 打开弹框
async function open({ mode = 'add', row } = {}) {
dialogMode.value = mode
formData.value = dialogMode.value === 'add' ? initForm() : row
initMap()
- if (dialogMode.value !== 'add') {
- await loadDetail()
- }
- await getDeviceList()
if (dialogMode.value === 'add') {
addPolygon()
- } else if (dialogMode.value === 'edit') {
- editPolygon()
} else {
- viewPolygon()
+ await loadDetail()
+ hasPatrolTaskList.value && gdPatrolTaskPage()
+ dialogMode.value === 'edit' ? editPolygon() : viewPolygon()
}
+ await getDeviceList()
await nextTick()
syncSelection()
}
@@ -486,7 +518,7 @@
}
.setHeight {
- max-height: 300px;
- min-height: 200px;
+ //max-height: 300px;
+ //min-height: 200px;
}
</style>
diff --git a/applications/task-work-order/src/views/orderView/orderManage/orderManage/index.vue b/applications/task-work-order/src/views/orderView/orderManage/orderManage/index.vue
index 66eb64c..1198ba4 100644
--- a/applications/task-work-order/src/views/orderView/orderManage/orderManage/index.vue
+++ b/applications/task-work-order/src/views/orderView/orderManage/orderManage/index.vue
@@ -1,5 +1,9 @@
<template>
<basic-container>
+ <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
+ <el-tab-pane label="全部 " name="all"></el-tab-pane>
+ <el-tab-pane label="我的任务工单" name="my"></el-tab-pane>
+ </el-tabs>
<el-form ref="queryParamsRef" :model="searchParams" class="gd-search-form">
<el-form-item label="工单名称" prop="workOrderName">
<el-input
@@ -68,7 +72,7 @@
</el-form>
<div class="gd-table-toolbar">
- <el-button color="#F2F3F5" @click="requester = !requester">我是{{ requester ? '需求方' : '服务方' }}</el-button>
+<!-- <el-button color="#F2F3F5" @click="requester = !requester">我是{{ requester ? '需求方' : '服务方' }}</el-button>-->
<el-button color="#F2F3F5" @click="previewVisible = true">预览</el-button>
<el-button :icon="Plus" color="#4C34FF" type="primary" @click="openForm('add')">新增</el-button>
@@ -144,6 +148,11 @@
import PreviewFiles from '@/components/PreviewFiles/PreviewFiles.vue'
import testDock from '@/assets/docx/testDocx.docx'
import testPdf from '@/assets/pdf/testPdf.pdf'
+import { useStore } from 'vuex'
+
+const store = useStore()
+const requester = computed(() => store.state.user.userInfo?.role_id === '2014158512610869250')
+const activeName = ref('all')
// 初始化查询参数
const initSearchParams = () => ({
@@ -155,7 +164,7 @@
current: 1, // 当前页
size: 10, // 每页大小
})
-const requester = ref(true)
+// const requester = ref(true)
const searchParams = ref(initSearchParams()) // 查询参数
const dateRange = ref([]) // 执行时间范围
const total = ref(0) // 总条数
@@ -180,7 +189,12 @@
const range = dateRangeFormat(dateRange.value)
loading.value = true
try {
- const res = await gdWorkOrderPageApi({ ...searchParams.value, startTime: range[0], endTime: range[1] })
+ const res = await gdWorkOrderPageApi({
+ ...searchParams.value,
+ startTime: range[0],
+ endTime: range[1],
+ createUser: activeName.value === 'user' ? store.state.user.userInfo.user_id : '',
+ })
list.value = res?.data?.data?.records ?? []
total.value = res?.data?.data?.total ?? 0
} finally {
@@ -200,6 +214,10 @@
dateRange.value = []
searchParams.value.current = 1
getList()
+}
+
+function handleClick(tab,event) {
+ handleSearch()
}
// 新增/编辑/查看 弹框
@@ -246,7 +264,7 @@
// 获取字典
function getDictList() {
- getDictionaryByCode('deviceLoadDemand,workOrderType,workOrderStatus').then(res => {
+ getDictionaryByCode('deviceLoadDemand,workOrderType,workOrderStatus,patrolTaskType,taskStatus').then(res => {
dictObj.value = res.data.data
})
}
diff --git a/applications/task-work-order/src/views/orderView/orderManage/orderManage/test.vue b/applications/task-work-order/src/views/orderView/orderManage/orderManage/test.vue
deleted file mode 100644
index 73d5851..0000000
--- a/applications/task-work-order/src/views/orderView/orderManage/orderManage/test.vue
+++ /dev/null
@@ -1,294 +0,0 @@
-<template>
- <el-dialog v-model="visible" :title="titleEnum[dialogMode]" :close-on-click-modal="false" width="80%">
- <div class="bodyBox">
- <div class="leftMap ztzf-cesium" id="mapContainer"></div>
- <div class="rightInfo">
- <div v-if="readonly">
- <div>防区名称: {{ formData.zoneName }}</div>
- <div>防区面积: {{ formatZoneArea(formData.zoneArea) }}</div>
- <el-table :data="sceneList" row-key="id">
- <el-table-column prop="sceneName" label="场景名称" />
- <el-table-column prop="sceneType" label="场景类型">
- <template v-slot="{ row }">
- {{ getDictLabel(row.sceneType, dictObj.sceneType) }}
- </template>
- </el-table-column>
- </el-table>
- </div>
- <el-form v-else ref="formRef" :model="formData" :rules="rules" :disabled="readonly" label-width="100px">
- <el-row>
- <el-col :span="24">
- <el-form-item label="防区名称" prop="zoneName">
- <el-input v-model="formData.zoneName" maxlength="50" placeholder="请输入" clearable />
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item label="防区面积" prop="zoneArea">{{ formatZoneArea(formData.zoneArea) }}</el-form-item>
- </el-col>
- <el-col :span="24">
- <div>
- <div>
- 关联场景
- <el-input v-model="searchName" placeholder="请输入" clearable></el-input>
- </div>
- <el-form-item label="关联场景" prop="defenseSceneIds" label-width="0">
- <el-table
- ref="sceneTableRef"
- :data="sceneList.filter(item => item.sceneName.includes(searchName))"
- row-key="id"
- @selection-change="handleSceneSelectionChange"
- >
- <el-table-column type="selection" width="55" :reserve-selection="true" />
- <el-table-column prop="sceneName" label="场景名称" />
- <el-table-column prop="sceneType" label="场景类型">
- <template v-slot="{ row }">
- {{ getDictLabel(row.sceneType, dictObj.sceneType) }}
- </template>
- </el-table-column>
- </el-table>
- </el-form-item>
- </div>
- </el-col>
- </el-row>
- </el-form>
- </div>
- </div>
- <template #footer>
- <el-button @click="handleCancel">{{ readonly ? '关闭' : '取消' }}</el-button>
- <el-button v-if="!readonly" type="primary" :loading="submitting" :disabled="submitting" @click="handleSubmit">
- 确定
- </el-button>
- </template>
- </el-dialog>
-</template>
-
-<script setup>
-import { computed, inject, nextTick, ref } from 'vue'
-import { ElMessage } from 'element-plus'
-import { fwDefenseZoneDetailApi, fwDefenseZoneSubmitApi } from './defenseZoneApi'
-import { fwDefenseSceneListApi } from '@/views/areaManage/sceneConfig/sceneConfigApi'
-import { fieldRules, geomAnalysis, getDictLabel } from '@ztzf/utils'
-import { PublicCesium } from '@/utils/cesium/publicCesium'
-import { DrawPolygon } from '@/utils/cesium/DrawPolygon'
-import { cartesian3Convert } from '@/utils/cesium/mapUtil'
-import * as turf from '@turf/turf'
-import * as Cesium from 'cesium'
-
-// 初始化表单
-const initForm = () => ({
- defenseSceneIds: '', // 关联场景ID
- geom: '', // 经纬度面
- zoneArea: null, // 防区面积
- zoneName: '', // 防区名称
-})
-
-const emit = defineEmits(['success'])
-const formRef = ref(null) // 表单实例
-const formData = ref(initForm()) // 表单数据
-const visible = defineModel() // 弹框显隐
-const dialogMode = ref('add') // 弹框模式
-const submitting = ref(false) // 提交中
-const readonly = computed(() => dialogMode.value === 'view')
-const titleEnum = ref({ edit: '编辑', view: '查看', add: '新增' })
-const sceneTableRef = ref(null)
-const searchName = ref('')
-const sceneList = ref([]) // 关联场景列表
-const selectedSceneRows = ref([]) // 选中场景
-const dictObj = inject('dictObj')
-let viewer
-let drawPolygonExample
-let pointList = []
-
-const rules = {
- zoneName: fieldRules(true, 50),
- defenseSceneIds: fieldRules(true),
- zoneArea: fieldRules(true),
-}
-
-// 关闭弹框
-function handleCancel() {
- visible.value = false
-}
-
-// 提交新增/编辑
-async function handleSubmit() {
- const isValid = await formRef.value?.validate().catch(() => false)
- if (!isValid) return
- if (!pointList.length) {
- ElMessage.warning('请绘制防区范围')
- return
- }
- submitting.value = true
- try {
- const ids = selectedSceneRows.value.map(item => item.id)
- formData.value.defenseSceneIds = ids.join(',')
- const str = [...pointList, pointList[0]].map(item => `${item.longitude} ${item.latitude}`).join(',')
- formData.value.geom = `POLYGON((${str}))`
- await fwDefenseZoneSubmitApi(formData.value)
- ElMessage.success(dialogMode.value === 'add' ? '新增成功' : '更新成功')
- visible.value = false
- emit('success')
- } finally {
- submitting.value = false
- }
-}
-
-// 加载详情
-async function loadDetail() {
- if (!formData.value.id) return
- const res = await fwDefenseZoneDetailApi({ id: formData.value.id })
- formData.value = res?.data?.data ?? initForm()
-}
-
-// 获取场景列表
-async function getSceneList() {
- const res = await fwDefenseSceneListApi({ filterSelected: 1, zoneId: formData.value.id })
- sceneList.value = res?.data?.data ?? []
- if (readonly.value) {
- const ids = getSceneIdList()
- sceneList.value = sceneList.value.filter(item => ids.includes(item.id))
- }
-}
-
-// 获取场景ID列表
-function getSceneIdList() {
- if (!formData.value.defenseSceneIds) return []
- return formData.value.defenseSceneIds.split(',')
-}
-
-// 关联场景变更
-function handleSceneSelectionChange(rows) {
- selectedSceneRows.value = rows
- formData.value.defenseSceneIds = rows.map(item => item.id).join(',')
-}
-
-// 同步关联场景
-function syncSceneSelection() {
- if (!sceneTableRef.value) return
- sceneTableRef.value.clearSelection()
- const ids = getSceneIdList()
- const rows = []
- sceneList.value.forEach(row => {
- if (ids.includes(row.id)) {
- sceneTableRef.value.toggleRowSelection(row, true)
- rows.push(row)
- }
- })
- selectedSceneRows.value = rows
-}
-
-// 格式化防区面积
-function formatZoneArea(value) {
- if (value == null || value === '') return ''
- return `${value}k㎡`
-}
-
-// 初始化地图实例
-function initMap() {
- const publicCesiumInstance = new PublicCesium({
- dom: 'mapContainer',
- flatMode: false,
- terrain: true,
- layerMode: 4,
- boundary: false,
- })
- viewer = publicCesiumInstance.getViewer()
-}
-
-// 绘制完成回调
-const drawFinished = async data => {
- pointList = _.cloneDeep(data).map(item => {
- const val = cartesian3Convert(item, viewer)
- return { ...val, lng: val.longitude, lat: val.latitude }
- })
- if (!pointList.length) return
- const polygon = turf.polygon([
- [...pointList.map(item => [item.longitude, item.latitude]), [pointList[0].longitude, pointList[0].latitude]],
- ])
- const areaSqm = turf.area(polygon) // 平方米
- formData.value.zoneArea = _.round(areaSqm / 1_000_000, 2) // 平方千米
-}
-
-// 新增模式绘制
-function addPolygon() {
- drawPolygonExample = new DrawPolygon(viewer)
- drawPolygonExample.initHandler(viewer)
- drawPolygonExample.subscribe('getPolygonPositions', drawFinished)
-}
-
-// 编辑面
-function editPolygon() {
- if (!formData.value?.geom) return
- pointList = geomAnalysis(formData.value.geom)
- drawPolygonExample?.destroy()
- drawPolygonExample = new DrawPolygon(viewer)
- let noClosedList = _.cloneDeep(pointList)
- noClosedList.pop()
- drawPolygonExample.initPolygon(
- viewer,
- noClosedList.map(item => ({ lng: item.longitude, lat: item.latitude }))
- )
- drawPolygonExample.subscribe('getPolygonPositions', drawFinished)
-}
-
-// 查看面
-function viewPolygon() {
- if (!formData.value?.geom) return
- pointList = geomAnalysis(formData.value.geom)
- const result = pointList.map(item => [item.longitude, item.latitude]).flat()
- const mian = viewer.entities?.add({
- customType: 'control_group',
- position: Cesium.Cartesian3.fromDegrees(result[0], result[1]),
- polyline: {
- positions: Cesium.Cartesian3.fromDegreesArray(result),
- clampToGround: true,
- width: 3,
- material: Cesium.Color.RED,
- },
- })
- viewer.flyTo(mian)
-}
-
-// 打开弹框
-async function open({ mode, row } = {}) {
- dialogMode.value = mode || 'add'
- formData.value = dialogMode.value === 'add' ? initForm() : row
- selectedSceneRows.value = []
- pointList = []
- await nextTick()
- initMap()
- if (dialogMode.value !== 'add') {
- await loadDetail()
- }
- await getSceneList()
- if (dialogMode.value === 'add') {
- addPolygon()
- } else if (dialogMode.value === 'edit') {
- editPolygon()
- } else {
- viewPolygon()
- }
- await nextTick()
- syncSceneSelection()
-}
-
-defineExpose({
- open,
-})
-</script>
-
-<style scoped lang="scss">
-.bodyBox {
- display: flex;
- height: 600px;
- .leftMap {
- width: 70%;
- height: 100%;
- }
- .rightInfo {
- width: 30%;
- height: 100%;
- overflow: auto;
- }
-}
-</style>
diff --git a/applications/task-work-order/vite.config.mjs b/applications/task-work-order/vite.config.mjs
index b314de5..f29b570 100644
--- a/applications/task-work-order/vite.config.mjs
+++ b/applications/task-work-order/vite.config.mjs
@@ -38,7 +38,7 @@
__INTLIFY_PROD_DEVTOOLS__: false,
},
server: {
- port: 5174,
+ port: 5178,
// host: '192.168.1.178',
proxy: {
'/api': {
--
Gitblit v1.9.3