From ec10ac7a0b3a5f728d18e2f566340d019cc0ef65 Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Tue, 03 Feb 2026 13:37:23 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
applications/task-work-order/src/views/orderView/organizational/agenciesManagement/FormDiaLog.vue | 123 -------
applications/task-work-order/src/views/orderView/organizational/agenciesManagement/index.vue | 57 ---
applications/task-work-order/src/views/orderView/appConfiguration/inventory/FormDiaLog.vue | 147 +--------
applications/task-work-order/src/views/orderView/appConfiguration/inventory/index.vue | 70 ----
applications/task-work-order/src/views/orderView/orderManage/orderManage/FormDiaLog.vue | 3
applications/task-work-order/src/views/orderView/organizational/zoningManagement/FormDiaLog.vue | 123 -------
applications/task-work-order/src/components/RegionSelect/main.vue | 198 +++++++++++++
applications/task-work-order/env/.env.production | 25 -
applications/task-work-order/env/.env | 8
applications/task-work-order/env/.env.test | 23 -
applications/task-work-order/src/axiosXT.js | 5
applications/drone-command/src/views/detectionCountermeasure/detectionRange/DetectionRangeDialog.vue | 36 ++
applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/ViewDiaLog.vue | 28 +
applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/inspectionRequestApi.js | 9
applications/task-work-order/env/.env.development | 34 -
15 files changed, 322 insertions(+), 567 deletions(-)
diff --git a/applications/drone-command/src/views/detectionCountermeasure/detectionRange/DetectionRangeDialog.vue b/applications/drone-command/src/views/detectionCountermeasure/detectionRange/DetectionRangeDialog.vue
index 446ff64..9243617 100644
--- a/applications/drone-command/src/views/detectionCountermeasure/detectionRange/DetectionRangeDialog.vue
+++ b/applications/drone-command/src/views/detectionCountermeasure/detectionRange/DetectionRangeDialog.vue
@@ -17,6 +17,7 @@
:terrain="true"
:layer-mode="4"
:boundary="false"
+ :zoom-to-boundary="dialogMode === 'add'"
/>
</div>
@@ -167,7 +168,7 @@
const formRef = ref(null) // 表单实例
const formData = ref(initForm()) // 表单数据
const visible = defineModel() // 弹框显隐
-const dialogMode = ref('add') // 弹框模式
+const dialogMode = ref('') // 弹框模式
const submitting = ref(false) // 提交中
const deviceOptions = ref([])
const dialogReadonly = computed(() => dialogMode.value === 'view')
@@ -334,6 +335,34 @@
updateRangeCircle(longitude, latitude, formData.value.effectiveRangeKm)
}
+function flyToRange(longitude, latitude, range) {
+ if (!viewer || longitude == null || latitude == null) return
+ const rangeMeters = Number(range)
+ if (Number.isFinite(rangeMeters) && rangeMeters > 0) {
+ const center = Cesium.Cartesian3.fromDegrees(longitude, latitude)
+ const radius = Math.max(rangeMeters, 1000)
+ const sphere = new Cesium.BoundingSphere(center, radius)
+
+ console.log(viewer, longitude, latitude, radius)
+
+
+ viewer.camera.flyToBoundingSphere(sphere, {
+ duration: 0,
+ offset: new Cesium.HeadingPitchRange(viewer.camera.heading, Cesium.Math.toRadians(-90), radius * 1.8),
+ })
+ return
+ }
+ viewer.camera.flyTo({
+ destination: Cesium.Cartesian3.fromDegrees(longitude, latitude, 2000),
+ orientation: {
+ heading: viewer.camera.heading,
+ pitch: Cesium.Math.toRadians(-65),
+ roll: 0,
+ },
+ duration: 0,
+ })
+}
+
function parseDeployLocation(value) {
if (!value) return null
const [longitude, latitude] = value.split(',').map(item => Number(item.trim()))
@@ -427,6 +456,8 @@
await nextTick()
initMap()
if (dialogMode.value === 'add') {
+ mapRef.value?.zoomToAdminBoundary?.()
+
await loadDeviceOptions()
formData.value = initForm()
return
@@ -449,7 +480,8 @@
const parsed = parseDeployLocation(location)
if (parsed) {
setMapPoint(parsed.longitude, parsed.latitude)
- viewer.flyTo(redPointEntity, { duration: 0 })
+
+ flyToRange(parsed.longitude, parsed.latitude, formData.value.effectiveRangeKm)
}
}
}
diff --git a/applications/task-work-order/env/.env b/applications/task-work-order/env/.env
index 5894dcc..fb9ce69 100644
--- a/applications/task-work-order/env/.env
+++ b/applications/task-work-order/env/.env
@@ -1,8 +1,11 @@
#接口地址
VITE_APP_API=/api
-#接口地址-xt
+#开发环境代理接口地址-xt
VITE_APP_API_XT=/apiXT
+
+# xt部署到服务器后接口地址
+VITE_APP_URL_XT=http://218.202.104.82:8200
#页面基础路径
VITE_APP_BASE=/task-work-order
@@ -15,9 +18,6 @@
# 是否在打包时开启压缩,支持 gzip 和 brotli
VITE_BUILD_COMPRESS=gzip
-
-# xt接口地址
-VITE_APP_URL_XT=http://218.202.104.82:8200
# 预览地址 previewURL
VITE_APP_PREVIEW_URL=http://192.168.1.204:8012
diff --git a/applications/task-work-order/env/.env.development b/applications/task-work-order/env/.env.development
index 15492be..5b55661 100644
--- a/applications/task-work-order/env/.env.development
+++ b/applications/task-work-order/env/.env.development
@@ -1,40 +1,20 @@
-###
- # @Author : yuan
- # @Date : 2026-01-07 14:58:30
- # @LastEditors : yuan
- # @LastEditTime : 2026-01-28 09:21:21
- # @FilePath : \applications\task-work-order\env\.env.development
- # @Description :
- # Copyright 2026 OBKoro1, All Rights Reserved.
- # 2026-01-07 14:58:30
-###
-NODE_ENV = 'development'
+NODE_ENV='development'
#开发环境配置
-VITE_APP_ENV = 'development'
+VITE_APP_ENV='development'
#开发环境代理地址(推荐本地新建文件 .env.development.local 来进行覆盖)
-# VITE_APP_URL = https://wrj.shuixiongit.com/api
-VITE_APP_URL= http://192.168.1.227
-
-
+VITE_APP_URL=http://192.168.1.227
#新大屏地址
-VITE_APP_DASHBOARD_URL = 'https://wrj.shuixiongit.com/command-center-dashboard/'
-
-# 域名
-VITE_APP_AREA_NAME = https://wrj.shuixiongit.com
+VITE_APP_DASHBOARD_URL='https://wrj.shuixiongit.com/command-center-dashboard/'
# ws地址
-VITE_APP_WS_API_URL = wss://wrj.shuixiongit.com/drone-wss/api/v1/ws
+VITE_APP_WS_API_URL=wss://wrj.shuixiongit.com/drone-wss/api/v1/ws
# 航线文件地址
-VITE_APP_AIRLINE_URL = https://wrj.shuixiongit.com/minio/cloud-bucket
+VITE_APP_AIRLINE_URL=https://wrj.shuixiongit.com/minio/cloud-bucket
# 行政区划存放地址
-VITE_APP_REGION_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_region
-# 算法仓库图片地址
-VITE_APP_PICTURE_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket
+VITE_APP_REGION_URL=https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_region
-# 设备ip地址
-VITE_APP_DEVICE_IP = '139.196.74.78:1883'
diff --git a/applications/task-work-order/env/.env.production b/applications/task-work-order/env/.env.production
index 0e9c292..19eb420 100644
--- a/applications/task-work-order/env/.env.production
+++ b/applications/task-work-order/env/.env.production
@@ -1,32 +1,23 @@
-NODE_ENV = 'production'
+NODE_ENV='production'
#生产环境配置
-VITE_APP_ENV = 'production'
+VITE_APP_ENV='production'
# 服务地址
-VITE_APP_URL = https://aisky.org.cn/api
-
-# 域名
-VITE_APP_AREA_NAME = https://aisky.org.cn
+VITE_APP_URL=https://aisky.org.cn/api
#新大屏地址
-VITE_APP_DASHBOARD_URL = 'https://aisky.org.cn/command-center-dashboard/'
+VITE_APP_DASHBOARD_URL='https://aisky.org.cn/command-center-dashboard/'
# ws地址
-VITE_APP_WS_API_URL = wss://aisky.org.cn/drone-wss/api/v1/ws
+VITE_APP_WS_API_URL=wss://aisky.org.cn/drone-wss/api/v1/ws
# 航线文件地址
-VITE_APP_AIRLINE_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket
+VITE_APP_AIRLINE_URL=https://wrj.shuixiongit.com/aiskyminio/cloud-bucket
# 图片存放地址
-VITE_APP_TERRAIN_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_terrain/
-
-# 算法仓库图片地址
-VITE_APP_PICTURE_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket
+VITE_APP_TERRAIN_URL=https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_terrain/
# 行政区划存放地址
-VITE_APP_REGION_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_region
-
-# 设备ip地址
-VITE_APP_DEVICE_IP = '101.132.85.201:1883'
+VITE_APP_REGION_URL=https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_region
diff --git a/applications/task-work-order/env/.env.test b/applications/task-work-order/env/.env.test
index 4600bb8..40b3bf8 100644
--- a/applications/task-work-order/env/.env.test
+++ b/applications/task-work-order/env/.env.test
@@ -1,31 +1,24 @@
-NODE_ENV = 'test'
+NODE_ENV='test'
#开发环境配置
-VITE_APP_ENV = 'test'
+VITE_APP_ENV='test'
# 服务地址
-VITE_APP_URL = https://wrj.shuixiongit.com/api
+VITE_APP_URL=https://wrj.shuixiongit.com/api
#新大屏地址
-VITE_APP_DASHBOARD_URL = 'https://wrj.shuixiongit.com/command-center-dashboard/'
-
-# 域名
-VITE_APP_AREA_NAME = https://wrj.shuixiongit.com
+VITE_APP_DASHBOARD_URL='https://wrj.shuixiongit.com/command-center-dashboard/'
# ws地址
-VITE_APP_WS_API_URL = wss://wrj.shuixiongit.com/drone-wss/api/v1/ws
+VITE_APP_WS_API_URL=wss://wrj.shuixiongit.com/drone-wss/api/v1/ws
# 航线文件地址
-VITE_APP_AIRLINE_URL = https://wrj.shuixiongit.com/minio/cloud-bucket
+VITE_APP_AIRLINE_URL=https://wrj.shuixiongit.com/minio/cloud-bucket
# 图片存放地址
-VITE_APP_TERRAIN_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_terrain/
+VITE_APP_TERRAIN_URL=https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_terrain/
-# 算法仓库图片地址
-VITE_APP_PICTURE_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket
# 行政区划存放地址
-VITE_APP_REGION_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_region
+VITE_APP_REGION_URL=https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_region
-# 设备ip地址
-VITE_APP_DEVICE_IP = '139.196.74.78:1883'
diff --git a/applications/task-work-order/src/axiosXT.js b/applications/task-work-order/src/axiosXT.js
index 6929039..d7e7d39 100644
--- a/applications/task-work-order/src/axiosXT.js
+++ b/applications/task-work-order/src/axiosXT.js
@@ -3,11 +3,10 @@
import { serialize } from '@/utils/util'
import { ElMessage } from 'element-plus'
// 全局未授权错误提示状态,只提示一次
-const { VITE_APP_API_XT } = import.meta.env
-
+const { VITE_APP_API_XT,VITE_APP_ENV,VITE_APP_URL_XT } = import.meta.env
const serviceXT = axios.create({
timeout: 600000,
- baseURL: VITE_APP_API_XT,
+ baseURL: VITE_APP_ENV === 'development' ? VITE_APP_API_XT : VITE_APP_URL_XT,
//跨域请求,允许保存cookie
withCredentials: false,
})
diff --git a/applications/task-work-order/src/components/RegionSelect/main.vue b/applications/task-work-order/src/components/RegionSelect/main.vue
new file mode 100644
index 0000000..cede878
--- /dev/null
+++ b/applications/task-work-order/src/components/RegionSelect/main.vue
@@ -0,0 +1,198 @@
+<template>
+ <el-tree-select
+ class="gd-select"
+ popper-class="gd-tree-select-popper"
+ :model-value="modelValue"
+ @update:model-value="handleChange"
+ node-key="id"
+ :default-expanded-keys="expandedKeys"
+ :props="treeSelectProps"
+ :placeholder="placeholder"
+ :clearable="clearable"
+ :filterable="filterable"
+ :check-strictly="checkStrictly"
+ lazy
+ :load="loadRegionNode"
+ :render-after-expand="false"
+ />
+</template>
+
+<script setup>
+import { ref, watch, onMounted } from 'vue'
+import request from '@/axios'
+
+// 懒加载获取区域节点数据
+const regionLazyTreeApi = params => {
+ return request({
+ url: `/blade-system/region/lazy-tree`,
+ method: 'get',
+ params,
+ })
+}
+
+// 定义组件属性
+const props = defineProps({
+ modelValue: {
+ type: [String, Number],
+ default: ''
+ },
+ placeholder: {
+ type: String,
+ default: '请选择'
+ },
+ clearable: {
+ type: Boolean,
+ default: true
+ },
+ filterable: {
+ type: Boolean,
+ default: true
+ },
+ checkStrictly: {
+ type: Boolean,
+ default: true
+ }
+})
+
+// 定义组件事件
+const emit = defineEmits(['update:modelValue', 'change'])
+
+// 组件内部状态
+const expandedKeys = ref([]) // 展开的节点
+const regionNodeCache = ref(new Map()) // 缓存区域节点
+
+// 树形选择器配置
+const treeSelectProps = {
+ value: 'id',
+ label: 'name',
+ children: 'children',
+ // 判断叶子节点
+ isLeaf: (data, node) => {
+ return node.level >= 2
+ }
+}
+
+// 处理值变化
+function handleChange(value) {
+ emit('update:modelValue', value)
+ // 从缓存中获取区域名称
+ const node = regionNodeCache.value.get(value)
+ const areaName = node?.name || ''
+ // 同时返回区域代码和区域名称
+ emit('change', { code: value, name: areaName })
+}
+
+// 懒加载获取区域节点数据
+async function loadRegionNode(node, resolve) {
+ try {
+ // 限制只加载两级,当前节点 level >= 1 时不加载子节点
+ if (node.level >= 2) {
+ resolve([])
+ return
+ }
+
+ // 初始化加载时传递 code 参数,加载子节点时传递 parentCode 参数
+ const params = node.data?.id ? { parentCode: node.data.id } : { code: '360800000000' }
+ const parentCode = node.data?.id || '360800000000'
+ const res = await regionLazyTreeApi(params)
+ const nodes = res?.data?.data || []
+
+ // 处理返回的节点数据
+ const processedNodes = nodes.map(item => {
+ const nodeId = item.id || item.value
+ // 缓存节点及其父节点关系
+ regionNodeCache.value.set(nodeId, {
+ id: nodeId,
+ name: item.name || item.title || item.label,
+ parentId: parentCode,
+ hasChildren: item.hasChildren || false
+ })
+
+ return {
+ id: nodeId,
+ name: item.name || item.title || item.label,
+ hasChildren: item.hasChildren || false
+ }
+ })
+
+ resolve(processedNodes)
+ } catch (error) {
+ console.error('获取区域数据失败:', error)
+ resolve([])
+ }
+}
+
+// 加载区域节点路径
+async function loadRegionPath(regionCode) {
+ if (!regionCode) return
+
+ try {
+ const path = []
+ const queue = [{ code: '360800000000', currentPath: ['360800000000'] }]
+ let found = false
+
+ // 广度优先搜索,逐层加载节点直到找到目标节点
+ while (queue.length > 0 && !found) {
+ const { code, currentPath } = queue.shift()
+
+ // 获取当前节点的子节点
+ const res = await regionLazyTreeApi({ parentCode: code })
+ const nodes = res?.data?.data || []
+
+ for (const node of nodes) {
+ const nodeId = node.id || node.value
+
+ // 缓存节点及其父节点关系
+ regionNodeCache.value.set(nodeId, {
+ id: nodeId,
+ name: node.name || node.title || node.label,
+ parentId: code,
+ hasChildren: node.hasChildren || false
+ })
+
+ // 检查是否找到目标节点
+ if (nodeId === regionCode) {
+ path.push(...currentPath, nodeId)
+ found = true
+ break
+ }
+
+ // 如果有子节点,加入队列继续搜索
+ if (node.hasChildren) {
+ queue.push({
+ code: nodeId,
+ currentPath: [...currentPath, nodeId]
+ })
+ }
+ }
+ }
+
+ if (path.length > 0) {
+ expandedKeys.value = path
+ }
+ } catch (error) {
+ console.error('加载区域路径失败:', error)
+ }
+}
+
+// 监听modelValue变化,当值变化时加载路径
+watch(
+ () => props.modelValue,
+ async (newValue) => {
+ if (newValue) {
+ await loadRegionPath(String(newValue))
+ } else {
+ expandedKeys.value = []
+ }
+ },
+ { immediate: true }
+)
+
+// 暴露方法给父组件
+defineExpose({
+ loadRegionPath
+})
+</script>
+
+<style scoped lang="scss">
+</style>
\ No newline at end of file
diff --git a/applications/task-work-order/src/views/orderView/appConfiguration/inventory/FormDiaLog.vue b/applications/task-work-order/src/views/orderView/appConfiguration/inventory/FormDiaLog.vue
index 4d2fb0e..1c2355c 100644
--- a/applications/task-work-order/src/views/orderView/appConfiguration/inventory/FormDiaLog.vue
+++ b/applications/task-work-order/src/views/orderView/appConfiguration/inventory/FormDiaLog.vue
@@ -42,23 +42,12 @@
<el-row>
<el-col :span="12">
<el-form-item label="所属区划" prop="areaCode">
- <el-tree-select
- class="gd-select"
- popper-class="gd-tree-select-popper"
- v-model="formData.areaCode"
- node-key="id"
- :default-expanded-keys="expandedKeys"
- :props="treeSelectProps"
- placeholder="请选择"
- clearable
- filterable
- :check-strictly="true"
- lazy
- :load="loadRegionNode"
- :render-after-expand="false"
- @change="handleAreaChange"
- />
- </el-form-item>
+ <RegionSelect
+ v-model="formData.areaCode"
+ placeholder="请选择"
+ @change="handleAreaChange"
+ />
+ </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="实施清单名称" prop="implementName">
@@ -106,7 +95,8 @@
import { computed, ref, inject } from 'vue'
import { ElMessage } from 'element-plus'
import { fieldRules } from '@ztzf/utils'
-import { inventorySubmitApi, inventoryDetailApi, regionLazyTreeApi } from './inventoryApi'
+import { inventorySubmitApi, inventoryDetailApi } from './inventoryApi'
+import RegionSelect from '@/components/RegionSelect/main.vue'
// 初始化表单数据
const initForm = () => ({
@@ -135,20 +125,6 @@
const submitting = ref(false) // 提交中
const dialogReadonly = computed(() => dialogMode.value === 'view')
const titleEnum = ref({ edit: '编辑', view: '查看', add: '新增' })
-const expandedKeys = ref([]) // 树形选择器展开的节点
-const regionNodeCache = ref(new Map()) // 缓存区域节点及其父节点关系
-
-// 区域树形选择器配置
-const treeSelectProps = ref({
- value: 'id',
- label: 'name',
- children: 'children',
- // 判断叶子节点
- isLeaf: (data, node) => {
- // 如果是第二级节点,则认为是叶子节点
- return node.level >= 2
- },
-})
// 表单校验规则
const rules = {
@@ -188,10 +164,14 @@
formData.value.areaName = ''
return
}
- // 从缓存中获取区域名称
- const node = regionNodeCache.value.get(value)
- if (node) {
- formData.value.areaName = node.name || ''
+ // 处理RegionSelect组件传递的包含code和name的对象
+ if (typeof value === 'object' && value.code) {
+ formData.value.areaCode = value.code
+ formData.value.areaName = value.name || ''
+ } else {
+ // 兼容旧的字符串值格式
+ formData.value.areaCode = value
+ formData.value.areaName = ''
}
}
@@ -220,62 +200,6 @@
data.areaCode = String(data.areaCode)
}
formData.value = data
-
- // 如果是编辑模式,获取区域节点的路径以展开树形选择器
- if (dialogMode.value === 'edit' && data.areaCode) {
- await loadRegionPath(data.areaCode)
- }
-}
-
-// 加载区域节点路径
-async function loadRegionPath(areaCode) {
- try {
- const path = []
- const queue = [{ code: '360800000000', currentPath: ['360800000000'] }]
- let found = false
-
- // 广度优先搜索,逐层加载节点直到找到目标节点
- while (queue.length > 0 && !found) {
- const { code, currentPath } = queue.shift()
-
- // 获取当前节点的子节点
- const res = await regionLazyTreeApi({ parentCode: code })
- const nodes = res?.data?.data || []
-
- for (const node of nodes) {
- const nodeId = node.id || node.value
-
- // 缓存节点及其父节点关系
- regionNodeCache.value.set(nodeId, {
- id: nodeId,
- name: node.name || node.title || node.label,
- parentId: code,
- hasChildren: node.hasChildren || false,
- })
-
- // 检查是否找到目标节点
- if (nodeId === areaCode) {
- path.push(...currentPath, nodeId)
- found = true
- break
- }
-
- // 如果有子节点,加入队列继续搜索
- if (node.hasChildren) {
- queue.push({
- code: nodeId,
- currentPath: [...currentPath, nodeId],
- })
- }
- }
- }
-
- if (path.length > 0) {
- expandedKeys.value = path
- }
- } catch (error) {
- console.error('加载区域路径失败:', error)
- }
}
// 打开弹框
@@ -284,45 +208,6 @@
formData.value = dialogMode.value === 'add' ? initForm() : row
if (dialogMode.value !== 'add') {
await loadDetail()
- }
-}
-
-// 懒加载获取区域节点数据
-async function loadRegionNode(node, resolve) {
- try {
- // 限制只加载两级,当前节点 level >= 1 时不加载子节点
- if (node.level >= 2) {
- resolve([])
- return
- }
- // 初始化加载时传递 code 参数,加载子节点时传递 parentCode 参数
- const params = node.data?.id ? { parentCode: node.data.id } : { code: '360800000000' }
- const parentCode = node.data?.id || '360800000000'
- const res = await regionLazyTreeApi(params)
- const nodes = res?.data?.data || []
-
- // 处理返回的节点数据
- const processedNodes = nodes.map(item => {
- const nodeId = item.id || item.value
- // 缓存节点及其父节点关系
- regionNodeCache.value.set(nodeId, {
- id: nodeId,
- name: item.name || item.title || item.label,
- parentId: parentCode,
- hasChildren: item.hasChildren || false,
- })
-
- return {
- id: nodeId,
- name: item.name || item.title || item.label,
- hasChildren: item.hasChildren || false,
- }
- })
-
- resolve(processedNodes)
- } catch (error) {
- console.error('获取区域数据失败:', error)
- resolve([])
}
}
diff --git a/applications/task-work-order/src/views/orderView/appConfiguration/inventory/index.vue b/applications/task-work-order/src/views/orderView/appConfiguration/inventory/index.vue
index 0eafb91..5320452 100644
--- a/applications/task-work-order/src/views/orderView/appConfiguration/inventory/index.vue
+++ b/applications/task-work-order/src/views/orderView/appConfiguration/inventory/index.vue
@@ -2,22 +2,13 @@
<basic-container>
<el-form ref="queryParamsRef" :model="searchParams" class="gd-search-form">
<el-form-item label="所属区划" prop="areaCode">
- <el-tree-select
- class="gd-select gray"
- popper-class="gd-tree-select-popper"
- v-model="searchParams.areaCode"
- node-key="id"
- :props="treeSelectProps"
- placeholder="请选择"
- clearable
- filterable
- @change="handleSearch"
- :check-strictly="true"
- lazy
- :load="loadRegionNode"
- :render-after-expand="false"
- />
- </el-form-item>
+ <RegionSelect
+ class="gd-select gray"
+ v-model="searchParams.areaCode"
+ placeholder="请选择"
+ @change="handleSearch"
+ />
+ </el-form-item>
<el-form-item label="实施清单名称" prop="implementName">
<el-input
class="gd-input gray"
@@ -105,7 +96,8 @@
import { ElMessage, ElMessageBox } from 'element-plus'
import FormDiaLog from './FormDiaLog.vue'
import ConfigDiaLog from './ConfigDiaLog.vue'
-import { inventoryPageApi, inventoryRemoveApi, regionLazyTreeApi, deptTreeApi } from './inventoryApi'
+import { inventoryPageApi, inventoryRemoveApi, deptTreeApi } from './inventoryApi'
+import RegionSelect from '@/components/RegionSelect/main.vue'
// 初始化查询参数
const initSearchParams = () => ({
@@ -129,17 +121,6 @@
const dictObj = ref({}) // 字典对象
const deptTree = ref([]) // 部门树数据
-// 树形选择器配置
-const treeSelectProps = {
- value: 'id',
- label: 'name',
- children: 'children',
- // 添加isLeaf配置,告诉组件如何判断叶子节点
- isLeaf: (data, node) => {
- return data.leaf === true
- },
-}
-
// 部门树配置
const treeProps = {
value: 'id',
@@ -152,40 +133,7 @@
provide('deptTree', deptTree)
provide('treeProps', treeProps)
-// 懒加载获取区域节点数据
-async function loadRegionNode(node, resolve) {
- try {
- // 限制只加载两级,当前节点 level >= 1 时不加载子节点
- if (node.level >= 2) {
- resolve([])
- return
- }
- // 初始化加载时传递 code 参数,加载子节点时传递 parentCode 参数
- const params = node.data?.id ? { parentCode: node.data.id } : { code: '360800000000' }
- const res = await regionLazyTreeApi(params)
- const nodes = res?.data?.data || []
-
- // 处理返回的节点数据
- const processedNodes = nodes.map(item => {
- // 判断是否为叶子节点:如果是第二级(node.level === 1)则为叶子节点
- const isLeaf = node.level === 1
-
- return {
- id: item.id || item.value,
- name: item.name || item.title || item.label,
- hasChildren: item.hasChildren || false,
- // 关键:设置leaf属性,告知Tree组件该节点是否为叶子节点
- leaf: isLeaf,
- }
- })
-
- resolve(processedNodes)
- } catch (error) {
- console.error('获取区域数据失败:', error)
- resolve([])
- }
-}
// 获取部门树数据
async function getDeptTree() {
diff --git a/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/ViewDiaLog.vue b/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/ViewDiaLog.vue
index b8a62bb..d5e84a7 100644
--- a/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/ViewDiaLog.vue
+++ b/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/ViewDiaLog.vue
@@ -29,7 +29,6 @@
</el-timeline-item>
</el-timeline>
</div>
-
</div>
<div class="detail-right">
@@ -251,7 +250,12 @@
import { computed, ref, onMounted } from 'vue'
import { ElMessage } from 'element-plus'
import { fieldRules, flyVisual, getDictLabel } from '@ztzf/utils'
-import { gdPatrolTaskRepublish, gdFlyerPageApi, gdPatrolTaskAuditApi } from './inspectionRequestApi'
+import {
+ gdPatrolTaskRepublish,
+ gdFlyerPageApi,
+ gdPatrolTaskAuditApi,
+ gdPatrolTaskDetailApi,
+} from './inspectionRequestApi'
import { gdWorkOrderFlowListApi, gdWorkOrderFlowPatrolListApi, gdWorkOrderPageApi } from '../orderManage/orderManageApi'
import { gdManageDeviceListApi } from '../orderManage/gdManageDeviceApi'
import { pxToRem } from '@/utils/rem'
@@ -300,10 +304,10 @@
const getAirName = inject('getAirName')
const gdStatusObj = {
- '0': { reason: '拒绝原因', operationType: '2',title:'拒绝签收' },
+ '0': { reason: '拒绝原因', operationType: '2', title: '拒绝签收' },
'1': { reason: '拒绝原因' },
'2': { reason: '' },
- '3': { reason: '驳回原因', operationType: '5',title:'驳回' },
+ '3': { reason: '驳回原因', operationType: '5', title: '驳回' },
'4': { reason: '驳回原因' },
'5': { reason: '' },
'6': { reason: '拒绝原因' },
@@ -337,7 +341,7 @@
row: formData.value,
type: gdStatusObj[taskStatus.value].operationType,
formLabel: gdStatusObj[taskStatus.value].reason,
- title: gdStatusObj[taskStatus.value]?.title
+ title: gdStatusObj[taskStatus.value]?.title,
})
})
}
@@ -446,6 +450,7 @@
})
// 获取航线详情
function getAirDetails() {
+ console.log(formData.value)
queryAirById(formData.value.patrolRouteUrl).then(res => {
const list = res.data.data.airlineWaypoints
if (!list.length) return mapRef.value?.flyBoundary()
@@ -500,14 +505,11 @@
// 打开弹框
async function open({ mode = 'view', row } = {}) {
dialogMode.value = mode
- formData.value = { ...initForm(), ...row }
- ;['6', '7', '8'].includes(row.taskStatus) && getTaskResultList()
+ const res = await gdPatrolTaskDetailApi({ id: row.id })
+ formData.value = { ...initForm(), ...res.data.data }
+ ;['6', '7', '8'].includes(row.taskStatus) && await getTaskResultList()
loadList()
initMap()
-}
-
-const readyMap = () => {
- // mapRef.value?.flyBoundary()
getAirDetails()
}
@@ -565,11 +567,11 @@
margin-top: 2px;
}
-.processBox{
+.processBox {
display: flex;
flex-direction: column;
- .detail-left{
+ .detail-left {
height: 100%;
overflow: auto;
}
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 3d9a491..22a5b4a 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
@@ -9,6 +9,15 @@
})
}
+// 详情
+export const gdPatrolTaskDetailApi = params => {
+ return request({
+ url: `/drone-gd/workOrder/gdPatrolTask/detail`,
+ method: 'get',
+ params,
+ })
+}
+
// 新增
export const gdPatrolTaskSaveApi = data => {
return request({
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 75d00f4..2acc032 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
@@ -554,7 +554,8 @@
// 渲染
function renderingAllDevice(list) {
list.forEach(item => {
- const position = Cesium.Cartesian3.fromDegrees(item.longitude || 115.0, item.latitude || 27.11)
+ if (!item.longitude || !item.latitude) return
+ const position = Cesium.Cartesian3.fromDegrees(item.longitude, item.latitude)
viewer.entities.add({
position: position,
billboard: {
diff --git a/applications/task-work-order/src/views/orderView/organizational/agenciesManagement/FormDiaLog.vue b/applications/task-work-order/src/views/orderView/organizational/agenciesManagement/FormDiaLog.vue
index 8bd33d4..50b2c76 100644
--- a/applications/task-work-order/src/views/orderView/organizational/agenciesManagement/FormDiaLog.vue
+++ b/applications/task-work-order/src/views/orderView/organizational/agenciesManagement/FormDiaLog.vue
@@ -43,20 +43,10 @@
</el-col>
<el-col :span="12">
<el-form-item label="所属区划" prop="areaCode">
- <el-tree-select
+ <RegionSelect
class="gd-select"
- popper-class="gd-tree-select-popper"
v-model="formData.areaCode"
- node-key="id"
- :default-expanded-keys="expandedKeys"
- :props="treeSelectProps"
placeholder="请选择"
- clearable
- filterable
- :check-strictly="true"
- lazy
- :load="loadRegionNode"
- :render-after-expand="false"
/>
</el-form-item>
</el-col>
@@ -109,9 +99,9 @@
import { fieldRules } from '@ztzf/utils'
import {
agenciesSubmitApi,
- agenciesDetailApi,
- regionLazyTreeApi
+ agenciesDetailApi
} from './agenciesApi'
+import RegionSelect from '@/components/RegionSelect/main.vue'
// 初始化表单数据
const initForm = () => ({
@@ -133,18 +123,7 @@
const submitting = ref(false) // 提交中
const dialogReadonly = computed(() => dialogMode.value === 'view')
const titleEnum = ref({ edit: '编辑', view: '查看', add: '新增' })
-const expandedKeys = ref([]) // 树形选择器展开的节点
-const regionNodeCache = ref(new Map()) // 缓存区域节点及其父节点关系
-const treeSelectProps = ref({
- value: 'id',
- label: 'name',
- children: 'children',
- // 判断叶子节点
- isLeaf: (data, node) => {
- // 如果是第二级节点,则认为是叶子节点
- return node.level >= 2
- }
-})
+
const rules = {
deptName: fieldRules(true),
areaCode: fieldRules(true),
@@ -181,62 +160,6 @@
data.areaCode = String(data.areaCode)
}
formData.value = data
-
- // 如果是编辑模式,获取区域节点的路径以展开树形选择器
- if (dialogMode.value === 'edit' && data.areaCode) {
- await loadRegionPath(data.areaCode)
- }
-}
-
-// 加载区域节点路径
-async function loadRegionPath(areaCode) {
- try {
- const path = []
- const queue = [{ code: '360800000000', currentPath: ['360800000000'] }]
- let found = false
-
- // 广度优先搜索,逐层加载节点直到找到目标节点
- while (queue.length > 0 && !found) {
- const { code, currentPath } = queue.shift()
-
- // 获取当前节点的子节点
- const res = await regionLazyTreeApi({ parentCode: code })
- const nodes = res?.data?.data || []
-
- for (const node of nodes) {
- const nodeId = node.id || node.value
-
- // 缓存节点及其父节点关系
- regionNodeCache.value.set(nodeId, {
- id: nodeId,
- name: node.name || node.title || node.label,
- parentId: code,
- hasChildren: node.hasChildren || false
- })
-
- // 检查是否找到目标节点
- if (nodeId === areaCode) {
- path.push(...currentPath, nodeId)
- found = true
- break
- }
-
- // 如果有子节点,加入队列继续搜索
- if (node.hasChildren) {
- queue.push({
- code: nodeId,
- currentPath: [...currentPath, nodeId]
- })
- }
- }
- }
-
- if (path.length > 0) {
- expandedKeys.value = path
- }
- } catch (error) {
- console.error('加载区域路径失败:', error)
- }
}
// 打开弹框
@@ -245,44 +168,6 @@
formData.value = dialogMode.value === 'add' ? initForm() : row
if (dialogMode.value !== 'add') {
await loadDetail()
- }
-}
-// 懒加载获取区域节点数据
-async function loadRegionNode(node, resolve) {
- try {
- // 限制只加载两级,当前节点 level >= 1 时不加载子节点
- if (node.level >= 2) {
- resolve([])
- return
- }
- // 初始化加载时传递 code 参数,加载子节点时传递 parentCode 参数
- const params = node.data?.id ? { parentCode: node.data.id } : { code: '360800000000' }
- const parentCode = node.data?.id || '360800000000'
- const res = await regionLazyTreeApi(params)
- const nodes = res?.data?.data || []
-
- // 处理返回的节点数据
- const processedNodes = nodes.map(item => {
- const nodeId = item.id || item.value
- // 缓存节点及其父节点关系
- regionNodeCache.value.set(nodeId, {
- id: nodeId,
- name: item.name || item.title || item.label,
- parentId: parentCode,
- hasChildren: item.hasChildren || false
- })
-
- return {
- id: nodeId,
- name: item.name || item.title || item.label,
- hasChildren: item.hasChildren || false
- }
- })
-
- resolve(processedNodes)
- } catch (error) {
- console.error('获取区域数据失败:', error)
- resolve([])
}
}
diff --git a/applications/task-work-order/src/views/orderView/organizational/agenciesManagement/index.vue b/applications/task-work-order/src/views/orderView/organizational/agenciesManagement/index.vue
index 549eab1..8f966d8 100644
--- a/applications/task-work-order/src/views/orderView/organizational/agenciesManagement/index.vue
+++ b/applications/task-work-order/src/views/orderView/organizational/agenciesManagement/index.vue
@@ -22,20 +22,13 @@
</el-form-item>
<el-form-item label="所属区划" prop="areaCode">
- <el-tree-select
+ <RegionSelect
class="gd-select gray"
- popper-class="gd-tree-select-popper"
v-model="searchParams.areaCode"
- node-key="id"
- :props="treeSelectProps"
placeholder="请选择"
clearable
filterable
@change="handleSearch"
- :check-strictly="true"
- lazy
- :load="loadRegionNode"
- :render-after-expand="false"
/>
</el-form-item>
@@ -146,13 +139,13 @@
import { onMounted, ref, provide, nextTick } from 'vue'
import { ElMessage, ElMessageBox, ElUpload } from 'element-plus'
import FormDiaLog from './FormDiaLog.vue'
+import RegionSelect from '@/components/RegionSelect/main.vue'
import {
agenciesPageApi,
agenciesRemoveApi,
agenciesImportApi,
agenciesExportApi,
agenciesExportTemplateApi,
- regionLazyTreeApi,
agenciesSubmitApi
} from './agenciesApi'
import { getDictionaryByCode } from '@/api/system/dictbiz'
@@ -176,17 +169,6 @@
const regionOptions = ref([]) // 区域选项
const dictObj = ref({}) // 字典对象
const selectedFiles = ref([]) // 勾选的文件列表
-
-// 树形选择器配置
-const treeSelectProps = {
- value: 'id',
- label: 'name',
- children: 'children',
- // 添加isLeaf配置,告诉组件如何判断叶子节点
- isLeaf: (data, node) => {
- return data.leaf === true
- }
-}
// 导入机构相关
const isShowImportView = ref(false)
const importFileName = ref('')
@@ -214,41 +196,6 @@
getDictionaryByCode('institutionStatus').then(res => {
dictObj.value = res.data.data
})
-}
-
-// 懒加载获取区域节点数据
-async function loadRegionNode(node, resolve) {
- try {
- // 限制只加载两级,当前节点 level >= 1 时不加载子节点
- if (node.level >= 2) {
- resolve([])
- return
- }
-
- // 初始化加载时传递 code 参数,加载子节点时传递 parentCode 参数
- const params = node.data?.id ? { parentCode: node.data.id } : { code: '360800000000' }
- const res = await regionLazyTreeApi(params)
- const nodes = res?.data?.data || []
-
- // 处理返回的节点数据
- const processedNodes = nodes.map(item => {
- // 判断是否为叶子节点:如果是第二级(node.level === 1)则为叶子节点
- const isLeaf = node.level === 1
-
- return {
- id: item.id || item.value,
- name: item.name || item.title || item.label,
- hasChildren: item.hasChildren || false,
- // 关键:设置leaf属性,告知Tree组件该节点是否为叶子节点
- leaf: isLeaf
- }
- })
-
- resolve(processedNodes)
- } catch (error) {
- console.error('获取区域数据失败:', error)
- resolve([])
- }
}
// 获取列表
async function getList() {
diff --git a/applications/task-work-order/src/views/orderView/organizational/zoningManagement/FormDiaLog.vue b/applications/task-work-order/src/views/orderView/organizational/zoningManagement/FormDiaLog.vue
index a82015f..a31afd9 100644
--- a/applications/task-work-order/src/views/orderView/organizational/zoningManagement/FormDiaLog.vue
+++ b/applications/task-work-order/src/views/orderView/organizational/zoningManagement/FormDiaLog.vue
@@ -56,20 +56,10 @@
</el-col>
<el-col :span="12">
<el-form-item label="上级区划" prop="parentCode">
- <el-tree-select
+ <RegionSelect
class="gd-select"
- popper-class="gd-tree-select-popper"
v-model="formData.parentCode"
- node-key="id"
- :default-expanded-keys="expandedKeys"
- :props="treeSelectProps"
placeholder="请选择"
- clearable
- filterable
- :check-strictly="true"
- lazy
- :load="loadRegionNode"
- :render-after-expand="false"
/>
</el-form-item>
</el-col>
@@ -132,19 +122,10 @@
import { fieldRules } from '@ztzf/utils'
import {
zoningSubmitApi,
- zoningDetailApi,
- regionLazyTreeApi
+ zoningDetailApi
} from './zoningApi'
-const treeSelectProps = ref({
- value: 'id',
- label: 'name',
- children: 'children',
- // 判断叶子节点
- isLeaf: (data, node) => {
- // 如果是第二级节点,则认为是叶子节点
- return node.level >= 2
- }
-})
+import RegionSelect from '@/components/RegionSelect/main.vue'
+
// 初始化表单数据
const initForm = () => ({
code: '',
@@ -168,8 +149,6 @@
const submitting = ref(false) // 提交中
const dialogReadonly = computed(() => dialogMode.value === 'view')
const titleEnum = ref({ edit: '编辑', view: '查看', add: '新增' })
-const expandedKeys = ref([]) // 树形选择器展开的节点
-const regionNodeCache = ref(new Map()) // 缓存区域节点及其父节点关系
const rules = {
code: fieldRules(true),
@@ -212,62 +191,6 @@
data.parentCode = String(data.parentCode)
}
formData.value = data
-
- // 如果是编辑模式,获取区域节点的路径以展开树形选择器
- if (dialogMode.value === 'edit' && data.parentCode) {
- await loadRegionPath(data.parentCode)
- }
-}
-
-// 加载区域节点路径
-async function loadRegionPath(parentCode) {
- try {
- const path = []
- const queue = [{ code: '360800000000', currentPath: ['360800000000'] }]
- let found = false
-
- // 广度优先搜索,逐层加载节点直到找到目标节点
- while (queue.length > 0 && !found) {
- const { code, currentPath } = queue.shift()
-
- // 获取当前节点的子节点
- const res = await regionLazyTreeApi({ parentCode: code })
- const nodes = res?.data?.data || []
-
- for (const node of nodes) {
- const nodeId = node.id || node.value
-
- // 缓存节点及其父节点关系
- regionNodeCache.value.set(nodeId, {
- id: nodeId,
- name: node.name || node.title || node.label,
- parentId: code,
- hasChildren: node.hasChildren || false
- })
-
- // 检查是否找到目标节点
- if (nodeId === parentCode) {
- path.push(...currentPath, nodeId)
- found = true
- break
- }
-
- // 如果有子节点,加入队列继续搜索
- if (node.hasChildren) {
- queue.push({
- code: nodeId,
- currentPath: [...currentPath, nodeId]
- })
- }
- }
- }
-
- if (path.length > 0) {
- expandedKeys.value = path
- }
- } catch (error) {
- console.error('加载区域路径失败:', error)
- }
}
// 打开弹框
@@ -276,44 +199,6 @@
formData.value = dialogMode.value === 'add' ? initForm() : row
if (dialogMode.value !== 'add') {
await loadDetail()
- }
-}
-// 懒加载获取区域节点数据
-async function loadRegionNode(node, resolve) {
- try {
- // 限制只加载两级,当前节点 level >= 1 时不加载子节点
- if (node.level >= 2) {
- resolve([])
- return
- }
- // 初始化加载时传递 code 参数,加载子节点时传递 parentCode 参数
- const params = node.data?.id ? { parentCode: node.data.id } : { code: '360800000000' }
- const parentCode = node.data?.id || '360800000000'
- const res = await regionLazyTreeApi(params)
- const nodes = res?.data?.data || []
-
- // 处理返回的节点数据
- const processedNodes = nodes.map(item => {
- const nodeId = item.id || item.value
- // 缓存节点及其父节点关系
- regionNodeCache.value.set(nodeId, {
- id: nodeId,
- name: item.name || item.title || item.label,
- parentId: parentCode,
- hasChildren: item.hasChildren || false
- })
-
- return {
- id: nodeId,
- name: item.name || item.title || item.label,
- hasChildren: item.hasChildren || false
- }
- })
-
- resolve(processedNodes)
- } catch (error) {
- console.error('获取区域数据失败:', error)
- resolve([])
}
}
defineExpose({ open })
--
Gitblit v1.9.3