Merge remote-tracking branch 'origin/master'
12 files modified
1 files added
| | |
| | | <script setup> |
| | | import * as Cesium from 'cesium' |
| | | import CommonCesiumMap from '@/components/map-container/common-cesium-map.vue' |
| | | import { geomAnalysis } from '@ztzf/utils' |
| | | import { fwDefenseZonePageApi } from '@/views/areaManage/defenseZone/defenseZoneApi' |
| | | import { fwAreaDividePageApi } from '@/views/areaManage/partition/partitionApi' |
| | | import { buildEllipsePositions } from '@/utils/cesium/shapeTools' |
| | | import { AREA_TYPE_STYLE_MAP, BUFFER_LEVEL_STYLES, DEFAULT_AREA_STYLE } from '@ztzf/constants' |
| | | import { fwAreaDivideListApi } from '@/views/areaManage/partition/partitionApi' |
| | | import { fwDefenseSceneListApi } from '@/views/areaManage/sceneConfig/sceneConfigApi' |
| | | import { cockpitAggregationApi } from '@/api/dataCockpit' |
| | | import layerControlIcon from '@/assets/images/dataCockpit/layerControl.png' |
| | |
| | | createRadialGradientMaterial, |
| | | getTexturedVertexFormat, |
| | | } from './device-map-materials' |
| | | import { getPointPositionsHeight } from '@/utils/cesium/mapUtil' |
| | | import dzIcon from '@/assets/images/dataCockpit/map/dz-map-layer.png' |
| | | import yxIcon from '@/assets/images/dataCockpit/map/yx-map-layer.png' |
| | | |
| | | const CLUSTER_HEIGHT = 100000 |
| | | const DETAIL_HEIGHT = 10000 |
| | | const POLYGON_HEIGHT_M = 0.2 |
| | | |
| | | const props = defineProps({ |
| | | onlineDevices: { |
| | |
| | | }) |
| | | const emit = defineEmits(['droneSignal', 'droneCounter', 'droneFavorite']) |
| | | |
| | | const DEFAULT_ZONE_PAGE_SIZE = 999 |
| | | |
| | | const mapRef = ref(null) |
| | | let viewer = null |
| | |
| | | let deviceBillboardCollection = null |
| | | let deviceRingOutlinePrimitives = [] |
| | | let deviceRingFillPrimitives = [] |
| | | let defenseZonePrimitive = null |
| | | let defenseZoneOutlinePrimitive = null |
| | | let partitionPrimitive = null |
| | | let partitionOutlinePrimitive = null |
| | | let partitionFillPrimitives = [] |
| | | let partitionOutlinePrimitives = [] |
| | | let aggregationSource = null |
| | | let commandPostBillboardCollection = null |
| | | let droneTrackBillboardCollection = null |
| | |
| | | if (!viewer) return |
| | | ensureCockpitPrimitiveLayer() |
| | | cockpitPrimitiveLayer.removeAll(false) |
| | | if (defenseZonePrimitive) cockpitPrimitiveLayer.add(defenseZonePrimitive) |
| | | if (defenseZoneOutlinePrimitive) cockpitPrimitiveLayer.add(defenseZoneOutlinePrimitive) |
| | | if (partitionPrimitive) cockpitPrimitiveLayer.add(partitionPrimitive) |
| | | if (partitionOutlinePrimitive) cockpitPrimitiveLayer.add(partitionOutlinePrimitive) |
| | | if (partitionFillPrimitives.length) { |
| | | partitionFillPrimitives.forEach(primitive => cockpitPrimitiveLayer.add(primitive)) |
| | | } |
| | | if (partitionOutlinePrimitives.length) { |
| | | partitionOutlinePrimitives.forEach(primitive => cockpitPrimitiveLayer.add(primitive)) |
| | | } |
| | | if (deviceRingFillPrimitives.length) { |
| | | deviceRingFillPrimitives.forEach(primitive => cockpitPrimitiveLayer.add(primitive)) |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | const clearDefenseZoneEntities = () => { |
| | | if (!viewer) return |
| | | if (defenseZonePrimitive) { |
| | | removeCockpitPrimitive(defenseZonePrimitive) |
| | | defenseZonePrimitive = null |
| | | } |
| | | if (defenseZoneOutlinePrimitive) { |
| | | removeCockpitPrimitive(defenseZoneOutlinePrimitive) |
| | | defenseZoneOutlinePrimitive = null |
| | | } |
| | | } |
| | | |
| | | const clearPartitionEntities = () => { |
| | | if (!viewer) return |
| | | if (partitionPrimitive) { |
| | | removeCockpitPrimitive(partitionPrimitive) |
| | | partitionPrimitive = null |
| | | if (partitionFillPrimitives.length) { |
| | | partitionFillPrimitives.forEach(primitive => removeCockpitPrimitive(primitive)) |
| | | partitionFillPrimitives = [] |
| | | } |
| | | if (partitionOutlinePrimitive) { |
| | | removeCockpitPrimitive(partitionOutlinePrimitive) |
| | | partitionOutlinePrimitive = null |
| | | if (partitionOutlinePrimitives.length) { |
| | | partitionOutlinePrimitives.forEach(primitive => removeCockpitPrimitive(primitive)) |
| | | partitionOutlinePrimitives = [] |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | const setDetailVisibility = visible => { |
| | | detailVisible.value = visible |
| | | if (defenseZonePrimitive) defenseZonePrimitive.show = visible |
| | | if (defenseZoneOutlinePrimitive) defenseZoneOutlinePrimitive.show = visible |
| | | if (partitionPrimitive) partitionPrimitive.show = visible |
| | | if (partitionOutlinePrimitive) partitionOutlinePrimitive.show = visible |
| | | if (partitionFillPrimitives.length) { |
| | | partitionFillPrimitives.forEach(primitive => { |
| | | primitive.show = visible |
| | | }) |
| | | } |
| | | if (partitionOutlinePrimitives.length) { |
| | | partitionOutlinePrimitives.forEach(primitive => { |
| | | primitive.show = visible |
| | | }) |
| | | } |
| | | if (commandPostBillboardCollection) commandPostBillboardCollection.show = visible |
| | | if (deviceBillboardCollection) deviceBillboardCollection.show = visible |
| | | if (deviceRingFillPrimitives.length) { |
| | |
| | | reorderCockpitPrimitives() |
| | | } |
| | | |
| | | const getDefenseZonePositions = geom => { |
| | | const points = geomAnalysis(geom) |
| | | if (points.length < 3) return [] |
| | | const first = points[0] |
| | | const last = points[points.length - 1] |
| | | const list = |
| | | first && last && first.longitude === last.longitude && first.latitude === last.latitude |
| | | ? points.slice(0, -1) |
| | | : points |
| | | return list.map(item => Cesium.Cartesian3.fromDegrees(item.longitude, item.latitude)) |
| | | const elevatePositions = async (positions, height = POLYGON_HEIGHT_M) => { |
| | | if (!Array.isArray(positions) || !positions.length) return [] |
| | | if (!viewer) return positions |
| | | const points = positions |
| | | .map(pos => { |
| | | const carto = Cesium.Cartographic.fromCartesian(pos) |
| | | if (!carto) return null |
| | | return { |
| | | lng: Cesium.Math.toDegrees(carto.longitude), |
| | | lat: Cesium.Math.toDegrees(carto.latitude), |
| | | } |
| | | }) |
| | | .filter(Boolean) |
| | | if (!points.length) return positions |
| | | const heights = await getPointPositionsHeight(points, viewer) |
| | | return heights.map(item => Cesium.Cartesian3.fromDegrees(item.longitude, item.latitude, (item.ASL ?? 0) + height)) |
| | | } |
| | | |
| | | const buildZonePrimitives = (zones, lineColor, fillColor1, fillColor2) => { |
| | | if (!viewer) return { primitive: null, outlinePrimitive: null } |
| | | const polygonInstances = [] |
| | | const lineInstances = [] |
| | | const texturedVertexFormat = getTexturedVertexFormat() |
| | | ; (zones || []).forEach((zone, index) => { |
| | | if (!zone?.geom) return |
| | | const positions = getDefenseZonePositions(zone.geom) |
| | | if (!positions.length) return |
| | | const polygon = new Cesium.PolygonGeometry({ |
| | | polygonHierarchy: new Cesium.PolygonHierarchy(positions), |
| | | vertexFormat: texturedVertexFormat, |
| | | const getAreaTypeStyle = areaType => { |
| | | return AREA_TYPE_STYLE_MAP?.[String(areaType)] || DEFAULT_AREA_STYLE |
| | | } |
| | | |
| | | const buildPartitionPrimitives = async shapes => { |
| | | if (!viewer) return { primitives: [], outlinePrimitives: [] } |
| | | const vertexFormat = getTexturedVertexFormat() |
| | | const groups = new Map() |
| | | const tasks = [] |
| | | ; (shapes || []).forEach(shape => { |
| | | if (!shape?.positions || shape.positions.length < 3) return |
| | | const outlineColor = shape.outlineColor |
| | | const fillColor = shape.fillColor |
| | | const key = `${outlineColor.toCssColorString()}|${fillColor.toCssColorString()}` |
| | | if (!groups.has(key)) { |
| | | groups.set(key, { outlineColor, fillColor, polygonInstances: [], lineInstances: [] }) |
| | | } |
| | | const group = groups.get(key) |
| | | const positions = shape.positions |
| | | tasks.push( |
| | | elevatePositions(positions).then(elevatedPositions => { |
| | | if (!elevatedPositions.length) return |
| | | const polygon = new Cesium.PolygonGeometry({ |
| | | polygonHierarchy: new Cesium.PolygonHierarchy(elevatedPositions), |
| | | perPositionHeight: true, |
| | | vertexFormat, |
| | | }) |
| | | group.polygonInstances.push( |
| | | new Cesium.GeometryInstance({ |
| | | geometry: polygon, |
| | | }) |
| | | ) |
| | | const linePositions = |
| | | elevatedPositions.length > 1 |
| | | ? [...elevatedPositions, elevatedPositions[0]] |
| | | : elevatedPositions |
| | | group.lineInstances.push( |
| | | new Cesium.GeometryInstance({ |
| | | geometry: new Cesium.PolylineGeometry({ |
| | | positions: linePositions, |
| | | width: 2, |
| | | }), |
| | | attributes: { |
| | | color: Cesium.ColorGeometryInstanceAttribute.fromColor(outlineColor), |
| | | }, |
| | | }) |
| | | ) |
| | | }) |
| | | ) |
| | | }) |
| | | |
| | | if (tasks.length) await Promise.all(tasks) |
| | | |
| | | const primitives = [] |
| | | const outlinePrimitives = [] |
| | | groups.forEach(group => { |
| | | if (group.polygonInstances.length) { |
| | | const material = createRadialGradientMaterial(group.outlineColor, group.fillColor, { |
| | | gamma: 1.7, |
| | | innerCutoff: 0, |
| | | }) |
| | | polygonInstances.push( |
| | | new Cesium.GeometryInstance({ |
| | | geometry: polygon, |
| | | }) |
| | | ) |
| | | const linePositions = positions.length > 1 ? [...positions, positions[0]] : positions |
| | | lineInstances.push( |
| | | new Cesium.GeometryInstance({ |
| | | geometry: new Cesium.GroundPolylineGeometry({ |
| | | positions: linePositions, |
| | | width: 2, |
| | | }), |
| | | attributes: { |
| | | color: Cesium.ColorGeometryInstanceAttribute.fromColor( |
| | | Cesium.Color.fromCssColorString(lineColor) |
| | | ), |
| | | }, |
| | | }) |
| | | ) |
| | | }) |
| | | let primitive = null |
| | | if (polygonInstances.length) { |
| | | const baseColor1 = Cesium.Color.fromCssColorString(fillColor1) |
| | | const baseColor2 = Cesium.Color.fromCssColorString(fillColor2) |
| | | const material = createRadialGradientMaterial(baseColor1.withAlpha(0.64), baseColor2.withAlpha(0.64)) |
| | | primitive = new Cesium.GroundPrimitive({ |
| | | geometryInstances: polygonInstances, |
| | | appearance: new Cesium.MaterialAppearance({ |
| | | material, |
| | | translucent: true, |
| | | }), |
| | | }) |
| | | addCockpitPrimitive(primitive) |
| | | } |
| | | let outlinePrimitive = null |
| | | if (lineInstances.length) { |
| | | outlinePrimitive = new Cesium.GroundPolylinePrimitive({ |
| | | geometryInstances: lineInstances, |
| | | appearance: new Cesium.PolylineColorAppearance(), |
| | | }) |
| | | addCockpitPrimitive(outlinePrimitive) |
| | | } |
| | | return { primitive, outlinePrimitive } |
| | | const primitive = new Cesium.Primitive({ |
| | | geometryInstances: group.polygonInstances, |
| | | appearance: new Cesium.MaterialAppearance({ |
| | | material, |
| | | translucent: true, |
| | | }), |
| | | }) |
| | | addCockpitPrimitive(primitive) |
| | | primitives.push(primitive) |
| | | } |
| | | if (group.lineInstances.length) { |
| | | const outlinePrimitive = new Cesium.Primitive({ |
| | | geometryInstances: group.lineInstances, |
| | | appearance: new Cesium.PolylineColorAppearance(), |
| | | }) |
| | | addCockpitPrimitive(outlinePrimitive) |
| | | outlinePrimitives.push(outlinePrimitive) |
| | | } |
| | | }) |
| | | |
| | | return { primitives, outlinePrimitives } |
| | | } |
| | | |
| | | const renderDefenseZones = zones => { |
| | | if (!viewer) return |
| | | clearDefenseZoneEntities() |
| | | const result = buildZonePrimitives(zones, '#72F3FF', '#72F3FF', '#0A7C88') |
| | | defenseZonePrimitive = result.primitive |
| | | defenseZoneOutlinePrimitive = result.outlinePrimitive |
| | | if (defenseZonePrimitive) defenseZonePrimitive.show = detailVisible.value |
| | | if (defenseZoneOutlinePrimitive) defenseZoneOutlinePrimitive.show = detailVisible.value |
| | | reorderCockpitPrimitives() |
| | | const parseGeomJson = geomJson => { |
| | | if (!geomJson) return null |
| | | if (typeof geomJson === 'object') return geomJson |
| | | if (typeof geomJson !== 'string') return null |
| | | const trimmed = geomJson.trim() |
| | | if (!trimmed) return null |
| | | try { |
| | | return JSON.parse(trimmed) |
| | | } catch (error) {} |
| | | return null |
| | | } |
| | | |
| | | const renderPartitions = zones => { |
| | | const normalizeShapePoint = point => { |
| | | if (!point) return null |
| | | const lng = point?.lng ?? point?.longitude |
| | | const lat = point?.lat ?? point?.latitude |
| | | const height = Number.isFinite(Number(point?.height)) ? Number(point.height) : 0 |
| | | if (!Number.isFinite(Number(lng)) || !Number.isFinite(Number(lat))) return null |
| | | return { lng: Number(lng), lat: Number(lat), height } |
| | | } |
| | | |
| | | const buildShapePositions = (points = []) => { |
| | | const normalized = points.map(normalizeShapePoint).filter(Boolean) |
| | | return normalized.map(point => Cesium.Cartesian3.fromDegrees(point.lng, point.lat, point.height)) |
| | | } |
| | | |
| | | const getShapeDisplayPoints = shape => { |
| | | if (Array.isArray(shape?.displayPoints) && shape.displayPoints.length) { |
| | | return shape.displayPoints |
| | | } |
| | | return shape?.points || [] |
| | | } |
| | | |
| | | const resolvePartitionShapes = areas => { |
| | | const shapes = [] |
| | | ; (areas || []).forEach(area => { |
| | | const extList = Array.isArray(area?.fwAreaDivideExtList) ? area.fwAreaDivideExtList : [] |
| | | extList.forEach((item, index) => { |
| | | const isShapePayload = item?.drawType || item?.points |
| | | const parsed = isShapePayload ? item : parseGeomJson(item?.geomJson) |
| | | if (!parsed) return |
| | | const shape = { |
| | | id: parsed?.id || `shape_${Date.now()}_${index}_${Math.random().toString(16).slice(2, 6)}`, |
| | | drawType: parsed?.drawType ?? 'polygon', |
| | | areaType: parsed?.areaType ?? item?.areaTypeKey ?? item?.areaType ?? '', |
| | | points: Array.isArray(parsed?.points) ? parsed.points : [], |
| | | displayPoints: Array.isArray(parsed?.displayPoints) ? parsed.displayPoints : null, |
| | | meta: parsed?.meta ?? null, |
| | | } |
| | | if (shape.drawType === 'buffer' && shape.meta?.bufferRadii?.length && shape.meta?.center) { |
| | | const center = shape.meta.center |
| | | const centerCartesian = Cesium.Cartesian3.fromDegrees( |
| | | center.lng, |
| | | center.lat, |
| | | center.height || 0 |
| | | ) |
| | | const radii = shape.meta.bufferRadii |
| | | .map(radius => Number(radius)) |
| | | .filter(radius => Number.isFinite(radius) && radius > 0) |
| | | radii.forEach((radius, levelIndex) => { |
| | | const positions = buildEllipsePositions(centerCartesian, radius, radius) |
| | | const style = BUFFER_LEVEL_STYLES[levelIndex] || BUFFER_LEVEL_STYLES[BUFFER_LEVEL_STYLES.length - 1] |
| | | if (positions.length >= 3) { |
| | | shapes.push({ |
| | | positions, |
| | | fillColor: style.fill, |
| | | outlineColor: style.outline, |
| | | }) |
| | | } |
| | | }) |
| | | return |
| | | } |
| | | const positions = buildShapePositions(getShapeDisplayPoints(shape)) |
| | | if (positions.length >= 3) { |
| | | const style = getAreaTypeStyle(shape.areaType) |
| | | shapes.push({ |
| | | positions, |
| | | fillColor: style.fill, |
| | | outlineColor: style.outline, |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | return shapes |
| | | } |
| | | |
| | | const renderPartitions = async zones => { |
| | | if (!viewer) return |
| | | clearPartitionEntities() |
| | | const result = buildZonePrimitives(zones, '#FFD772', '#FFD772', '#A86B00') |
| | | partitionPrimitive = result.primitive |
| | | partitionOutlinePrimitive = result.outlinePrimitive |
| | | if (partitionPrimitive) partitionPrimitive.show = detailVisible.value |
| | | if (partitionOutlinePrimitive) partitionOutlinePrimitive.show = detailVisible.value |
| | | reorderCockpitPrimitives() |
| | | } |
| | | |
| | | const loadDefenseZones = async () => { |
| | | if (!viewer) return |
| | | try { |
| | | const res = await fwDefenseZonePageApi({ current: 1, size: DEFAULT_ZONE_PAGE_SIZE }) |
| | | renderDefenseZones(res?.data?.data?.records ?? []) |
| | | } catch (error) { |
| | | renderDefenseZones([]) |
| | | const shapes = resolvePartitionShapes(zones) |
| | | const result = await buildPartitionPrimitives(shapes) |
| | | partitionFillPrimitives = result.primitives |
| | | partitionOutlinePrimitives = result.outlinePrimitives |
| | | if (partitionFillPrimitives.length) { |
| | | partitionFillPrimitives.forEach(primitive => { |
| | | primitive.show = detailVisible.value |
| | | }) |
| | | } |
| | | if (partitionOutlinePrimitives.length) { |
| | | partitionOutlinePrimitives.forEach(primitive => { |
| | | primitive.show = detailVisible.value |
| | | }) |
| | | } |
| | | reorderCockpitPrimitives() |
| | | } |
| | | |
| | | const loadPartitions = async () => { |
| | | if (!viewer) return |
| | | try { |
| | | const res = await fwAreaDividePageApi({ current: 1, size: DEFAULT_ZONE_PAGE_SIZE }) |
| | | renderPartitions(res?.data?.data?.records ?? []) |
| | | const res = await fwAreaDivideListApi() |
| | | await renderPartitions(res?.data?.data ?? []) |
| | | } catch (error) { |
| | | renderPartitions([]) |
| | | await renderPartitions([]) |
| | | } |
| | | } |
| | | |
| | |
| | | const stage = getStageByHeight(height) |
| | | updateStageDisplay(stage) |
| | | renderDeviceEntities(props.onlineDevices) |
| | | loadDefenseZones() |
| | | loadPartitions() |
| | | loadAggregation() |
| | | loadCommandPosts() |
| | |
| | | onBeforeUnmount(() => { |
| | | document.removeEventListener('click', handleClickOutside) |
| | | clearDeviceEntities() |
| | | clearDefenseZoneEntities() |
| | | clearPartitionEntities() |
| | | clearAggregationEntities() |
| | | clearCommandPostEntities() |
| | |
| | | import { fieldRules, geomAnalysis, getDictLabel } from '@ztzf/utils' |
| | | import CommonCesiumMap from '@/components/map-container/common-cesium-map.vue' |
| | | import { DrawManager, EditManager, buildEllipsePositions } from '@/utils/cesium/shapeTools' |
| | | import { cartesian3Convert } from '@/utils/cesium/mapUtil' |
| | | import { cartesian3Convert, getPointPositionsHeight } from '@/utils/cesium/mapUtil' |
| | | import * as Cesium from 'cesium' |
| | | import { AREA_TYPE_STYLE_MAP, BUFFER_LEVEL_STYLES, DEFAULT_AREA_STYLE } from '@ztzf/constants' |
| | | import { fwPoliceStationListApi } from '@/views/areaManage/precinctInfo/precinctInfoApi' |
| | | import { fwDeviceListApi } from '@/views/basicManage/deviceStock/fwDevice' |
| | | import polygonIcon from '@/assets/images/areaMap/polygon.png' |
| | |
| | | const bufferAreaTypeValue = '1,2,3' |
| | | const showTypePanel = ref(false) |
| | | const suppressTypePanelOnce = ref(false) |
| | | const areaTypeStyleMap = { |
| | | '1': { |
| | | fill: Cesium.Color.fromBytes(25, 178, 230, 128), |
| | | outline: Cesium.Color.fromBytes(0, 251, 255, 255), |
| | | }, |
| | | '2': { |
| | | fill: Cesium.Color.fromBytes(255, 235, 59, 128), |
| | | outline: Cesium.Color.fromBytes(255, 235, 59, 255), |
| | | }, |
| | | '3': { |
| | | fill: Cesium.Color.fromBytes(247, 20, 20, 128), |
| | | outline: Cesium.Color.fromBytes(255, 0, 0, 255), |
| | | }, |
| | | } |
| | | let viewer |
| | | let drawManager |
| | | let editManager |
| | |
| | | return { lng, lat } |
| | | } |
| | | |
| | | function createDeviceRangePrimitive (device) { |
| | | async function resolveDeviceTerrainHeight (position) { |
| | | if (!viewer) return 0 |
| | | try { |
| | | const results = await getPointPositionsHeight([{ lng: position.lng, lat: position.lat }], viewer) |
| | | const height = Number(results?.[0]?.ASL) |
| | | return Number.isFinite(height) ? height : 0 |
| | | } catch (error) { |
| | | return 0 |
| | | } |
| | | } |
| | | |
| | | async function createDeviceRangePrimitive (device) { |
| | | if (!viewer) return null |
| | | if (!device) return null |
| | | const position = getDeviceLngLat(device) |
| | | if (!position) return null |
| | | const rangeMeters = normalizeDeviceRange(device.effectiveRangeKm) |
| | | const center = Cesium.Cartesian3.fromDegrees(position.lng, position.lat, 0) |
| | | const centerHeight = await resolveDeviceTerrainHeight(position) |
| | | const center = Cesium.Cartesian3.fromDegrees(position.lng, position.lat, centerHeight) |
| | | const radii = new Cesium.Cartesian3(rangeMeters, rangeMeters, rangeMeters) |
| | | const geometry = new Cesium.EllipsoidGeometry({ |
| | | radii, |
| | |
| | | }) |
| | | } |
| | | |
| | | function renderDeviceRangeSingle (device) { |
| | | async function renderDeviceRangeSingle (device) { |
| | | if (!viewer) return |
| | | clearDeviceRangePrimitives() |
| | | const primitive = createDeviceRangePrimitive(device) |
| | | const primitive = await createDeviceRangePrimitive(device) |
| | | if (!primitive) return |
| | | deviceRangePrimitiveMap.set(String(device?.id ?? Date.now()), primitive) |
| | | viewer.scene.primitives.add(primitive) |
| | | } |
| | | |
| | | function renderDeviceRanges (rows) { |
| | | async function renderDeviceRanges (rows) { |
| | | if (!viewer) return |
| | | const selectedRows = Array.isArray(rows) ? rows : [] |
| | | const nextIds = new Set(selectedRows.map(row => String(row?.id))) |
| | |
| | | deviceRangePrimitiveMap.delete(id) |
| | | } |
| | | } |
| | | selectedRows.forEach(row => { |
| | | const pendingRows = selectedRows.filter(row => { |
| | | const id = String(row?.id) |
| | | if (!id || deviceRangePrimitiveMap.has(id)) return |
| | | const primitive = createDeviceRangePrimitive(row) |
| | | return id && !deviceRangePrimitiveMap.has(id) |
| | | }) |
| | | if (!pendingRows.length) return |
| | | const primitives = await Promise.all( |
| | | pendingRows.map(async row => { |
| | | const primitive = await createDeviceRangePrimitive(row) |
| | | return { row, primitive } |
| | | }) |
| | | ) |
| | | primitives.forEach(({ row, primitive }) => { |
| | | if (!primitive) return |
| | | const id = String(row?.id) |
| | | deviceRangePrimitiveMap.set(id, primitive) |
| | | viewer.scene.primitives.add(primitive) |
| | | }) |
| | | } |
| | | |
| | | async function flyToDevice (device) { |
| | | if (!viewer) return |
| | | const position = getDeviceLngLat(device) |
| | | if (!position) return |
| | | const height = await resolveDeviceTerrainHeight(position) |
| | | const destination = Cesium.Cartesian3.fromDegrees(position.lng, position.lat, height + device.effectiveRangeKm * 3) |
| | | viewer.camera.flyTo({ |
| | | destination, |
| | | orientation: { |
| | | heading: viewer.camera.heading, |
| | | pitch: Cesium.Math.toRadians(-90), |
| | | roll: 0, |
| | | }, |
| | | duration: 0.6, |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | function getAreaTypeStyle (areaType) { |
| | | return areaTypeStyleMap?.[String(areaType)] || { |
| | | fill: Cesium.Color.fromBytes(45, 140, 240, 99), |
| | | outline: Cesium.Color.fromBytes(45, 140, 240, 255), |
| | | } |
| | | return AREA_TYPE_STYLE_MAP?.[String(areaType)] || DEFAULT_AREA_STYLE |
| | | } |
| | | |
| | | function renderShapeList () { |
| | |
| | | const [radius1, radius2, radius3] = shape.meta.bufferRadii |
| | | const radii = [radius1, radius2, radius3].filter(item => Number.isFinite(item) && item > 0) |
| | | if (radii.length) { |
| | | const styles = [ |
| | | { |
| | | fill: Cesium.Color.fromBytes(247, 20, 20, 128), |
| | | outline: Cesium.Color.fromBytes(255, 0, 0, 255), |
| | | }, |
| | | { |
| | | fill: Cesium.Color.fromBytes(255, 235, 59, 128), |
| | | outline: Cesium.Color.fromBytes(255, 235, 59, 255), |
| | | }, |
| | | { |
| | | fill: Cesium.Color.fromBytes(25, 178, 230, 128), |
| | | outline: Cesium.Color.fromBytes(0, 251, 255, 255), |
| | | }, |
| | | ] |
| | | radii.forEach((radius, index) => { |
| | | const style = styles[index] || styles[styles.length - 1] |
| | | const style = BUFFER_LEVEL_STYLES[index] || BUFFER_LEVEL_STYLES[BUFFER_LEVEL_STYLES.length - 1] |
| | | dataSource.entities.add({ |
| | | name: 'shape-display', |
| | | customData: { shapeId: shape.id, drawType: shape.drawType, level: index + 1 }, |
| | |
| | | const ids = rows.map(item => item.id) |
| | | formData.value.deviceIds = ids.join(',') |
| | | renderDeviceRanges(rows) |
| | | const target = rows[rows.length - 1] |
| | | if (target) { |
| | | void flyToDevice(target) |
| | | } |
| | | } |
| | | |
| | | function handleDeviceRowClick (row) { |
| | | if (readonly.value) { |
| | | renderDeviceRangeSingle(row) |
| | | void flyToDevice(row) |
| | | return |
| | | } |
| | | renderDeviceRanges(selectedDeviceRows.value) |
| | | void flyToDevice(row) |
| | | } |
| | | |
| | | // 同步选择状态 |
| | |
| | | import { buildEllipsePositions } from '@/utils/cesium/shapeTools' |
| | | import { saveOperationLog } from '@ztzf/apis' |
| | | import { useRoute } from 'vue-router' |
| | | import { AREA_TYPE_STYLE_MAP, BUFFER_LEVEL_STYLES, DEFAULT_AREA_STYLE } from '@ztzf/constants' |
| | | |
| | | const initForm = () => ({ |
| | | sceneName: '', // 场景配置名称 |
| | |
| | | const route = useRoute() |
| | | let viewer |
| | | let areaDisplaySource |
| | | const areaTypeStyleMap = { |
| | | '1': { |
| | | fill: Cesium.Color.fromBytes(25, 178, 230, 128), |
| | | outline: Cesium.Color.fromBytes(0, 251, 255, 255), |
| | | }, |
| | | '2': { |
| | | fill: Cesium.Color.fromBytes(255, 235, 59, 128), |
| | | outline: Cesium.Color.fromBytes(255, 235, 59, 255), |
| | | }, |
| | | '3': { |
| | | fill: Cesium.Color.fromBytes(247, 20, 20, 128), |
| | | outline: Cesium.Color.fromBytes(255, 0, 0, 255), |
| | | }, |
| | | } |
| | | |
| | | const rules = { |
| | | sceneName: fieldRules(true, 50), |
| | |
| | | } |
| | | |
| | | function getAreaTypeStyle(areaType) { |
| | | return areaTypeStyleMap?.[String(areaType)] || { |
| | | fill: Cesium.Color.fromBytes(45, 140, 240, 99), |
| | | outline: Cesium.Color.fromBytes(45, 140, 240, 255), |
| | | } |
| | | return AREA_TYPE_STYLE_MAP?.[String(areaType)] || DEFAULT_AREA_STYLE |
| | | } |
| | | |
| | | function parseGeomJson(geomJson) { |
| | |
| | | const radii = shape.meta.bufferRadii |
| | | .map(radius => Number(radius)) |
| | | .filter(radius => Number.isFinite(radius) && radius > 0) |
| | | const styles = [ |
| | | { |
| | | fill: Cesium.Color.fromBytes(247, 20, 20, 128), |
| | | outline: Cesium.Color.fromBytes(255, 0, 0, 255), |
| | | }, |
| | | { |
| | | fill: Cesium.Color.fromBytes(255, 235, 59, 128), |
| | | outline: Cesium.Color.fromBytes(255, 235, 59, 255), |
| | | }, |
| | | { |
| | | fill: Cesium.Color.fromBytes(25, 178, 230, 128), |
| | | outline: Cesium.Color.fromBytes(0, 251, 255, 255), |
| | | }, |
| | | ] |
| | | radii.forEach((radius, index) => { |
| | | const style = styles[index] || styles[styles.length - 1] |
| | | const style = BUFFER_LEVEL_STYLES[index] || BUFFER_LEVEL_STYLES[BUFFER_LEVEL_STYLES.length - 1] |
| | | dataSource.entities.add({ |
| | | name: 'scene-area-display', |
| | | customData: { drawType: shape.drawType, level: index + 1 }, |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="defenseLeader" show-overflow-tooltip label="防控负责人" /> |
| | | <el-table-column prop="leaderPhone" show-overflow-tooltip label="防控负责人电话" /> |
| | | <el-table-column show-overflow-tooltip label="有效时间"> |
| | | <el-table-column show-overflow-tooltip label="有效时间" width="300"> |
| | | <template v-slot="{ row }"> |
| | | {{ formatEffectiveDate(row) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="defenseSceneId" show-overflow-tooltip label="关联场景配置ID" /> |
| | | <el-table-column prop="defenseSceneName" show-overflow-tooltip label="关联场景配置" /> |
| | | <el-table-column label="操作" class-name="operation-btns"> |
| | | <template v-slot="{ row }"> |
| | | <el-link @click="openForm('view', row)">查看</el-link> |
| | |
| | | <div class="legend-bar"> |
| | | <div class="legend-title" data-text="图例">图例</div> |
| | | <div class="legend-item"> |
| | | <span class="legend-color defense"></span> |
| | | <span class="legend-text" data-text="防区">防区</span> |
| | | </div> |
| | | <div class="legend-item"> |
| | | <span class="legend-color partition"></span> |
| | | <span class="legend-text" data-text="区域">区域</span> |
| | | </div> |
| | |
| | | border-radius: 0; |
| | | } |
| | | |
| | | .legend-color.defense { |
| | | background: radial-gradient(50% 50% at 50% 50%, rgba(114, 243, 255, 0.45) 0%, rgba(10, 124, 136, 0.55) 100%); |
| | | border: 1px solid rgba(114, 243, 255, 0.85); |
| | | } |
| | | |
| | | .legend-color.partition { |
| | | background: radial-gradient(50% 50% at 50% 50%, rgba(255, 215, 114, 0.5) 0%, rgba(168, 107, 0, 0.6) 100%); |
| | |
| | | <el-dialog |
| | | class="gd-dialog" |
| | | v-model="visible" |
| | | title="编辑" |
| | | :title="titleEnum[dialogMode]" |
| | | @closed="visible = false" |
| | | destroy-on-close |
| | | :close-on-click-modal="false" |
| | |
| | | </div> |
| | | |
| | | <template #footer> |
| | | <template v-if="requester"> |
| | | <el-button v-if="['1', '4'].includes(taskStatus)" @click="viewDescription" color="#F2F3F5"> |
| | | {{ gdStatusObj[taskStatus].reason }} |
| | | </el-button> |
| | | <el-button @click="statusChange(3)" v-if="taskStatus === '3'" color="#4C34FF">撤回任务</el-button> |
| | | <el-button v-if="['1', '4', '7'].includes(taskStatus)" @click="viewDescription" color="#F2F3F5"> |
| | | {{ gdStatusObj[taskStatus].reason }} |
| | | </el-button> |
| | | <el-button @click="statusChange(3)" v-if="taskStatus === '3' && permission.flyOrder_revoke" color="#4C34FF"> |
| | | 撤回任务 |
| | | </el-button> |
| | | |
| | | <template v-if="permission.flyOrder_controlAcceptance"> |
| | | <el-button @click="refusalToAccept" v-if="taskStatus === '6'" color="#F2F3F5">拒绝验收</el-button> |
| | | <el-button @click="statusChange(6)" v-if="taskStatus === '6'" color="#4C34FF">验收通过</el-button> |
| | | <el-button |
| | | v-if="!dialogReadonly || ['1', '4'].includes(taskStatus)" |
| | | :loading="submitting" |
| | | :disabled="submitting" |
| | | color="#4C34FF" |
| | | @click="handleSubmit" |
| | | > |
| | | 提交 |
| | | </el-button> |
| | | </template> |
| | | <template v-else> |
| | | <el-button v-if="['7'].includes(taskStatus)" @click="viewDescription" color="#F2F3F5"> |
| | | {{ gdStatusObj[taskStatus].reason }} |
| | | </el-button> |
| | | <el-button |
| | | v-if="!dialogReadonly || (['1', '4'].includes(taskStatus) && permission.flyOrder_add)" |
| | | :loading="submitting" |
| | | :disabled="submitting" |
| | | color="#4C34FF" |
| | | @click="handleSubmit" |
| | | > |
| | | 提交 |
| | | </el-button> |
| | | <template v-if="permission.flyOrder_controlSignFor"> |
| | | <el-button v-if="taskStatus === '0'" @click="addDescription" color="#F2F3F5">拒绝签收</el-button> |
| | | <el-button v-if="taskStatus === '0'" @click="statusChange(1)" color="#4C34FF">签收</el-button> |
| | | </template> |
| | | <template v-if="permission.flyOrder_controlReview"> |
| | | <el-button v-if="taskStatus === '3'" @click="addDescription" color="#F2F3F5">驳回</el-button> |
| | | <el-button v-if="taskStatus === '3'" @click="statusChange(4)" color="#4C34FF">同意</el-button> |
| | | </template> |
| | | </template> |
| | | |
| | | <RefuseOrderDialog1 |
| | | ref="refuseOrderDialogRef" |
| | | v-if="rejectVisible" |
| | |
| | | import { pxToRem } from '@/utils/rem' |
| | | import CommonCesiumMap from '@/components/map-container/common-cesium-map.vue' |
| | | import { gdTaskResultListApi } from '@/views/orderView/orderManage/clueEvents/achievementApi' |
| | | import RefuseOrderDialog from '@/views/orderView/orderManage/orderManage/RefuseOrderDialog.vue' |
| | | import RefuseOrderDialog1 from '@/views/orderView/orderManage/inspectionRequest/RefuseOrderDialog1.vue' |
| | | import { Check } from '@element-plus/icons-vue' |
| | | import { queryAirById } from '@/api/zkxt' |
| | | import * as Cesium from 'cesium' |
| | | import { useStore } from 'vuex' |
| | | |
| | | // 初始化表单数据 |
| | | const initForm = () => ({ |
| | |
| | | taskDesc: '', |
| | | workOrderId: null, |
| | | }) |
| | | const store = useStore() |
| | | const permission = computed(() => store.state.user.permission) |
| | | |
| | | const rejectVisible = ref(false) |
| | | const mapRef = ref(null) |
| | | const dictObj = inject('dictObj') |
| | | const requester = inject('requester') |
| | | const emit = defineEmits(['success', 'refusalAccept']) |
| | | const formRef = ref(null) |
| | | const formData = ref(initForm()) |
| | |
| | | |
| | | // 获取飞手列表 |
| | | async function getFlyerList() { |
| | | const res = await gdFlyerPageApi({ size: 999,current: 1 }) |
| | | const res = await gdFlyerPageApi({ size: 999, current: 1 }) |
| | | flyerList.value = res?.data?.data?.records ?? [] |
| | | } |
| | | |
| | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | |
| | | /* 时间线样式 */ |
| | | :deep(.gd-timeline) { |
| | | padding-left: 90px; |
| | | padding-left: 90px; |
| | | } |
| | | |
| | | :deep(.el-timeline-item) { |
| | | padding-bottom: 20px; |
| | | .item-content { |
| | | position: relative; |
| | | .flowName { |
| | | width: 80px; |
| | | position: absolute; |
| | | left: -120px; |
| | | top: 0px; |
| | | } |
| | | } |
| | | padding-bottom: 20px; |
| | | .item-content { |
| | | position: relative; |
| | | .flowName { |
| | | width: 80px; |
| | | position: absolute; |
| | | left: -120px; |
| | | top: 0px; |
| | | } |
| | | } |
| | | } |
| | | .imgBox { |
| | | display: flex; |
| | |
| | | } |
| | | } |
| | | :deep(.el-timeline-item__timestamp) { |
| | | font-size: 12px; |
| | | color: #999; |
| | | margin-top: 2px; |
| | | font-size: 12px; |
| | | color: #999; |
| | | margin-top: 2px; |
| | | } |
| | | </style> |
| | |
| | | </el-form> |
| | | |
| | | <div class="gd-table-toolbar"> |
| | | <el-button v-if="requester" :icon="Plus" color="#4C34FF" type="primary" @click="openForm('add')">新增</el-button> |
| | | <el-button v-if="permission.flyOrder_add" :icon="Plus" color="#4C34FF" type="primary" @click="openForm('add')">新增</el-button> |
| | | </div> |
| | | |
| | | <div class="gd-table-container" v-loading="loading"> |
| | |
| | | import { airlineListApi } from '@/api/zkxt' |
| | | |
| | | const store = useStore() |
| | | const requester = computed(() => store.state.user.userInfo?.role_id === '2014158512610869250') |
| | | const permission = computed(() => store.state.user.permission) |
| | | |
| | | // 初始化查询参数 |
| | | const initSearchParams = () => ({ |
| | | patrolTaskName: '', // 任务名称 |
| | |
| | | }) |
| | | const activeName = ref('all') |
| | | provide('dictObj', dictObj) |
| | | provide('requester', requester) |
| | | |
| | | // 获取列表 |
| | | async function getList() { |
| | |
| | | function viewDiaLogView(row) { |
| | | viewDiaLogVisible.value = true |
| | | nextTick(() => { |
| | | let mode = ['1', '4'].includes(row.taskStatus) && requester.value ? 'edit' : 'view' |
| | | let mode = ['1', '4'].includes(row.taskStatus) && permission.value.flyOrder_add ? 'edit' : 'view' |
| | | viewDiaLogRef.value?.open({ mode, row }) |
| | | }) |
| | | } |
| | |
| | | </div> |
| | | |
| | | <template #footer> |
| | | <template v-if="requester"> |
| | | <template v-if="!suddenlyEdit"> |
| | | <el-button |
| | | v-if="['11', '21', '23', '24', '25', '31', '60'].includes(gdStatus)" |
| | | @click="viewDescription" |
| | | color="#F2F3F5" |
| | | > |
| | | {{ gdStatusObj[gdStatus].reason }} |
| | | </el-button> |
| | | <el-button @click="addDescription" v-if="['20', '24', '25'].includes(gdStatus)" color="#F2F3F5"> |
| | | 申请取消 |
| | | </el-button> |
| | | <el-button color="#4C34FF" @click="requestModification" v-if="['20', '25'].includes(gdStatus)"> |
| | | 申请修改 |
| | | </el-button> |
| | | </template> |
| | | <el-button |
| | | v-if="['11', '21', '23','31', '60'].includes(gdStatus)" |
| | | @click="viewDescription" |
| | | color="#F2F3F5" |
| | | > |
| | | {{ gdStatusObj[gdStatus].reason }} |
| | | </el-button> |
| | | |
| | | <template v-if="!suddenlyEdit"> |
| | | <el-button |
| | | v-if="['11'].includes(gdStatus) || suddenlyEdit || (!dialogReadonly && !formData.id)" |
| | | :loading="submitting" |
| | | :disabled="submitting" |
| | | color="#4C34FF" |
| | | @click="handleSubmit" |
| | | @click="addDescription" |
| | | v-if="['20'].includes(gdStatus) && permission.order_applyCancel" |
| | | color="#F2F3F5" |
| | | > |
| | | {{ gdStatus === '11' || !gdStatus ? '发布' : '提交修改' }} |
| | | 申请取消 |
| | | </el-button> |
| | | <el-button |
| | | color="#4C34FF" |
| | | @click="requestModification" |
| | | v-if="['20'].includes(gdStatus) && permission.order_applyNegotiation" |
| | | > |
| | | 申请修改 |
| | | </el-button> |
| | | </template> |
| | | <template v-else> |
| | | <el-button v-if="['21', '23'].includes(gdStatus)" @click="viewDescription" color="#F2F3F5"> |
| | | {{ gdStatusObj[gdStatus].reason }} |
| | | </el-button> |
| | | <el-button v-if="gdStatus === '50'" @click="addDescription" color="#F2F3F5">结算</el-button> |
| | | <el-button |
| | | v-if="(['11'].includes(gdStatus) || suddenlyEdit || !formData.id) && permission.order_release" |
| | | :loading="submitting" |
| | | :disabled="submitting" |
| | | color="#4C34FF" |
| | | @click="handleSubmit" |
| | | > |
| | | {{ gdStatus === '11' || !gdStatus ? '发布' : '提交修改' }} |
| | | </el-button> |
| | | <el-button v-if="gdStatus === '50' && permission.order_settlement" @click="addDescription" color="#F2F3F5"> |
| | | 结算 |
| | | </el-button> |
| | | <template v-if="permission.order_controlOrder"> |
| | | <el-button v-if="gdStatus === '10'" @click="addDescription" color="#F2F3F5">拒绝接单</el-button> |
| | | <el-button v-if="gdStatus === '10'" @click="statusChange(1)" color="#4C34FF">接单</el-button> |
| | | <el-button v-if="gdStatus === '22'" @click="addDescription" color="#F2F3F5">不同意修改</el-button> |
| | | <el-button v-if="gdStatus === '22'" @click="statusChange(7)" color="#4C34FF">同意修改</el-button> |
| | | <el-button v-if="gdStatus === '21'" @click="addDescription" color="#F2F3F5">不同意取消</el-button> |
| | | <el-button v-if="gdStatus === '21'" @click="statusChange(5)" color="#4C34FF">同意取消</el-button> |
| | | <el-button v-if="gdStatus === '30'" @click="addDescription" color="#4C34FF">协商修改</el-button> |
| | | <el-button v-if="gdStatus === '31'" @click="statusChange(10)" color="#4C34FF">同意</el-button> |
| | | </template> |
| | | <template v-if="permission.order_controlEdit"> |
| | | <el-button v-if="gdStatus === '22'" @click="statusChange(8)" color="#F2F3F5">驳回</el-button> |
| | | <el-button v-if="gdStatus === '22'" @click="statusChange(7)" color="#4C34FF">同意</el-button> |
| | | </template> |
| | | <template v-if="permission.order_controlCancel"> |
| | | <el-button v-if="gdStatus === '21'" @click="statusChange(6)" color="#F2F3F5">驳回</el-button> |
| | | <el-button v-if="gdStatus === '21'" @click="statusChange(5)" color="#4C34FF">同意</el-button> |
| | | </template> |
| | | <el-button v-if="gdStatus === '30' && permission.order_applyNegotiation" @click="addDescription" color="#4C34FF"> |
| | | 协商修改 |
| | | </el-button> |
| | | <el-button |
| | | v-if="gdStatus === '31' && permission.order_controlNegotiation" |
| | | @click="statusChange(10)" |
| | | color="#4C34FF" |
| | | > |
| | | 同意 |
| | | </el-button> |
| | | </template> |
| | | |
| | | <RefuseOrderDialog |
| | |
| | | import { Check } from '@element-plus/icons-vue' |
| | | import droneIcon from '@/assets/images/orderView/orderManage/drone.png' |
| | | import droneActiveIcon from '@/assets/images/orderView/orderManage/droneActive.png' |
| | | import { useStore } from 'vuex' |
| | | const store = useStore() |
| | | const permission = computed(() => store.state.user.permission) |
| | | |
| | | // 初始化表单数据 |
| | | const initForm = () => ({ |
| | |
| | | const hasPatrolTaskList = computed(() => ['30', '40', '50', '60'].includes(String(formData.value.workOrderStatus))) |
| | | |
| | | const gdStatusObj = { |
| | | '10': { reason: '拒绝原因', operationType: '2' }, |
| | | '11': { reason: '拒绝原因' }, |
| | | '10': { reason: '驳回原因', operationType: '2' }, |
| | | '11': { reason: '驳回原因' }, |
| | | '20': { reason: '取消原因', operationType: '3' }, |
| | | '21': { reason: '原因', operationType: '6' }, |
| | | '22': { reason: '驳回原因', operationType: '8' }, |
| | | '23': { reason: '取消原因' }, |
| | | '24': { reason: '驳回原因', operationType: '3' }, |
| | | '25': { reason: '驳回原因', operationType: '3' }, |
| | | '30': { reason: '修改原因', operationType: '9' }, |
| | | '31': { reason: '修改原因' }, |
| | | '30': { reason: '协商修改原因', operationType: '9' }, |
| | | '31': { reason: '协商修改原因' }, |
| | | '40': { reason: '' }, |
| | | '50': { reason: '情况说明', operationType: '11' }, |
| | | '60': { reason: '情况说明' }, |
| | | } |
| | | |
| | | // 工单状态:0草稿、10发布中_接单中、11发布中_拒绝接单、20响应中_待拆分、21响应中_申请取消、22响应中_申请修改、23响应中_已取消、 |
| | | // 24响应中_拒绝取消、25响应中_拒绝修改 30执行中_待全部完成、31执行中_协商修改、40完成待验_待全部验收、50验收通过_待结算、60结算完成_已结算 |
| | | // 30执行中_待全部完成、31执行中_协商修改、40完成待验_待全部验收、50验收通过_待结算、60结算完成_已结算 |
| | | const gdStatus = computed(() => formData.value?.workOrderStatus) |
| | | |
| | | const rules = { |
| | |
| | | const image = entity.billboard?.image?._value |
| | | if ((image === droneIcon || image === droneActiveIcon) && entity.label) { |
| | | const device = deviceList.value.find(d => d.nickname === entity.label.text._value) |
| | | entity.billboard.image = device && selectedIds.includes(String(device.id)) |
| | | ? droneActiveIcon |
| | | : droneIcon |
| | | entity.billboard.image = device && selectedIds.includes(String(device.id)) ? droneActiveIcon : droneIcon |
| | | } |
| | | }) |
| | | } |
| | |
| | | <el-dialog |
| | | class="gd-dialog" |
| | | v-model="visible" |
| | | title="编辑" |
| | | :title="titleEnum[dialogMode]" |
| | | @closed="visible = false" |
| | | destroy-on-close |
| | | :close-on-click-modal="false" |
| | |
| | | </el-form> |
| | | |
| | | <div class="gd-table-toolbar"> |
| | | <!-- <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')" v-if="requester">新增</el-button> |
| | | <el-button :icon="Delete" color="#4C34FF" :disabled="!selectedIds.length" @click="handleDelete()" v-if="requester">删除</el-button> |
| | | <el-button |
| | | v-if="permission.order_release" |
| | | :icon="Plus" |
| | | color="#4C34FF" |
| | | type="primary" |
| | | @click="openForm('add')" |
| | | > |
| | | 新增 |
| | | </el-button> |
| | | <!-- <el-button |
| | | :icon="Delete" |
| | | color="#4C34FF" |
| | | :disabled="!selectedIds.length" |
| | | @click="handleDelete()" |
| | | v-if="permission.order_delete" |
| | | > |
| | | 删除 |
| | | </el-button>--> |
| | | </div> |
| | | |
| | | <div class="gd-table-container" v-loading="loading"> |
| | | <div class="gd-table-content gd-table-content-bg"> |
| | | <el-table class="gd-table" :data="list" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="46" v-if="requester"/> |
| | | <el-table-column type="selection" width="46" v-if="permission.order_delete" /> |
| | | <el-table-column type="index" width="64" label="序号" /> |
| | | <el-table-column prop="workOrderName" show-overflow-tooltip label="工单名称" /> |
| | | <el-table-column prop="workOrderCode" show-overflow-tooltip label="工单编号" /> |
| | |
| | | <el-table-column prop="createTime" show-overflow-tooltip label="工单创建时间" /> |
| | | <el-table-column label="操作" class-name="operation-btns"> |
| | | <template v-slot="{ row }"> |
| | | <el-link type="primary" @click="openFormChange(row)">查看</el-link> |
| | | <el-link type="primary" @click="openFormChange(row)">查看</el-link> |
| | | <!--<el-link type="primary" @click="openForm('edit', row)">编辑</el-link>--> |
| | | <el-link type="primary" @click="handleDelete(row)" v-if="requester">删除</el-link> |
| | | <!-- <el-link type="primary" @click="handleDelete(row)" v-if="permission.order_delete">删除</el-link>--> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <PreviewFiles v-model="previewVisible" :src="testDock" type="docx"/> |
| | | <PreviewFiles v-model="previewVisible" :src="testDock" type="docx" /> |
| | | <FormDiaLog ref="dialogRef" @success="getList" v-if="dialogVisible" v-model="dialogVisible" /> |
| | | </basic-container> |
| | | </template> |
| | |
| | | import { useStore } from 'vuex' |
| | | |
| | | const store = useStore() |
| | | const requester = computed(() => store.state.user.userInfo?.role_id === '2014158512610869250') |
| | | const activeName = ref('all') |
| | | |
| | | const permission = computed(() => store.state.user.permission) |
| | | console.log(permission.value, 'permission') |
| | | |
| | | // 初始化查询参数 |
| | | const initSearchParams = () => ({ |
| | |
| | | current: 1, // 当前页 |
| | | size: 10, // 每页大小 |
| | | }) |
| | | // const requester = ref(true) |
| | | const searchParams = ref(initSearchParams()) // 查询参数 |
| | | const dateRange = ref([]) // 执行时间范围 |
| | | const total = ref(0) // 总条数 |
| | |
| | | workOrderStatus: [], // 工单状态 |
| | | }) |
| | | provide('dictObj', dictObj) |
| | | provide('requester', requester) |
| | | |
| | | |
| | | // 获取列表 |
| | | async function getList() { |
| | |
| | | }) |
| | | } |
| | | // 工单状态:0草稿、10发布中_接单中、11发布中_拒绝接单、20响应中_待拆分、 |
| | | // 21响应中_申请取消、22响应中_申请修改、23响应中_已取消、24响应中_拒绝取消、 |
| | | // 25响应中_拒绝修改 30执行中_待全部完成、31执行中_协商修改、40完成待验_待全部验收、 |
| | | // 21响应中_申请取消、22响应中_申请修改、23响应中_已取消、 |
| | | // 30执行中_待全部完成、31执行中_协商修改、40完成待验_待全部验收、 |
| | | // 50验收通过_待结算、60结算完成_已结算 |
| | | function openFormChange(row) { |
| | | dialogVisible.value = true |
| | | nextTick(() => { |
| | | const mode = ['11'].includes(row.workOrderStatus) && requester.value ? 'edit' : 'view' |
| | | const mode = ['11'].includes(row.workOrderStatus) && permission.value.order_release ? 'edit' : 'view' |
| | | dialogRef.value?.open({ mode, row }) |
| | | }) |
| | | } |
| New file |
| | |
| | | import * as Cesium from 'cesium' |
| | | |
| | | export const AREA_TYPE_STYLE_MAP = { |
| | | '1': { |
| | | fill: Cesium.Color.fromBytes(25, 178, 230, 128), |
| | | outline: Cesium.Color.fromBytes(0, 251, 255, 255), |
| | | }, |
| | | '2': { |
| | | fill: Cesium.Color.fromBytes(255, 235, 59, 128), |
| | | outline: Cesium.Color.fromBytes(255, 235, 59, 255), |
| | | }, |
| | | '3': { |
| | | fill: Cesium.Color.fromBytes(247, 20, 20, 128), |
| | | outline: Cesium.Color.fromBytes(255, 0, 0, 255), |
| | | }, |
| | | } |
| | | |
| | | export const DEFAULT_AREA_STYLE = { |
| | | fill: Cesium.Color.fromBytes(45, 140, 240, 99), |
| | | outline: Cesium.Color.fromBytes(45, 140, 240, 255), |
| | | } |
| | | |
| | | export const BUFFER_LEVEL_STYLES = [ |
| | | { |
| | | fill: Cesium.Color.fromBytes(247, 20, 20, 128), |
| | | outline: Cesium.Color.fromBytes(255, 0, 0, 255), |
| | | }, |
| | | { |
| | | fill: Cesium.Color.fromBytes(255, 235, 59, 128), |
| | | outline: Cesium.Color.fromBytes(255, 235, 59, 255), |
| | | }, |
| | | { |
| | | fill: Cesium.Color.fromBytes(25, 178, 230, 128), |
| | | outline: Cesium.Color.fromBytes(0, 251, 255, 255), |
| | | }, |
| | | ] |
| | |
| | | export * from './publicEnums'; |
| | | export * from './workEnums'; |
| | | export * from './fwDevice'; |
| | | export * from './areaStyles'; |