| | |
| | | :type="index === processList.length - 1 ? 'success' : 'info'" |
| | | :color="activity.color" |
| | | :hollow="activity.hollow" |
| | | :timestamp="activity.flowDesc.split(' ')[1]" |
| | | :timestamp="activity.createTime" |
| | | > |
| | | <div class="item-content"> |
| | | <div>{{ activity.flowDesc.split(' ')[0] }}</div> |
| | | <div>{{ activity.operator }}</div> |
| | | <div class="flowName">{{ activity.flowName }}</div> |
| | | </div> |
| | | </el-timeline-item> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <div class="detail-title" :style="{ marginTop: pxToRem(20) }">已选设备</div> |
| | | <el-table class="setHeight" ref="deviceTableRef" :data="deviceList" row-key="id"> |
| | | <el-table class="setHeight gd-dialog-table" ref="deviceTableRef" :data="deviceList" row-key="id"> |
| | | <el-table-column prop="nickname" label="设备名称" /> |
| | | <el-table-column prop="deviceName" label="设备型号" /> |
| | | <el-table-column prop="devicePayload" label="设备负载" /> |
| | |
| | | <div class="detail-title" :style="{ marginTop: pxToRem(20) }">工单执行范围</div> |
| | | <CommonCesiumMap |
| | | ref="mapRef" |
| | | class="leftMap gd-cesium" |
| | | class="gd-cesium" |
| | | :active="visible" |
| | | :flat-mode="false" |
| | | :terrain="true" |
| | |
| | | |
| | | <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', '50'].includes(gdStatus)" color="#F2F3F5"> |
| | | {{ gdStatus === '50' ? '结算' : '申请取消' }} |
| | | </el-button> |
| | | <el-button color="#4C34FF" @click="requestModification" v-if="['20', '25'].includes(gdStatus)"> |
| | | 申请修改 |
| | | </el-button> |
| | | </template> |
| | | <el-button |
| | | v-if="['11'].includes(gdStatus) || suddenlyEdit || (!dialogReadonly && !formData.id)" |
| | | :loading="submitting" |
| | | :disabled="submitting" |
| | | color="#4C34FF" |
| | | @click="handleSubmit" |
| | | > |
| | | {{ gdStatus === '11' || !gdStatus ? '发布' : '提交修改' }} |
| | | </el-button> |
| | | <el-button v-if="['11', '21', '23', '24', '25', '31', '60'].includes(gdStatus)" @click="viewDescription"> |
| | | {{ gdStatusObj[gdStatus].reason }} |
| | | </el-button> |
| | | <el-button @click="addDescription" v-if="['20', '24', '25', '50'].includes(gdStatus)"> |
| | | {{ gdStatus === '50' ? '结算' : '申请取消' }} |
| | | </el-button> |
| | | <el-button @click="requestModification" v-if="['20', '25'].includes(gdStatus)">申请修改</el-button> |
| | | </template> |
| | | <template v-else> |
| | | <el-button v-if="['21', '23'].includes(gdStatus)" @click="viewDescription"> |
| | | <el-button v-if="['21', '23'].includes(gdStatus)" @click="viewDescription" color="#F2F3F5"> |
| | | {{ gdStatusObj[gdStatus].reason }} |
| | | </el-button> |
| | | <el-button v-if="gdStatus === '10'" @click="addDescription">拒绝接单</el-button> |
| | | <el-button v-if="gdStatus === '10'" @click="statusChange(1)">接单</el-button> |
| | | <el-button v-if="gdStatus === '22'" @click="statusChange(8)">不同意修改</el-button> |
| | | <el-button v-if="gdStatus === '22'" @click="statusChange(7)">同意修改</el-button> |
| | | <el-button v-if="gdStatus === '21'" @click="addDescription">不同意取消</el-button> |
| | | <el-button v-if="gdStatus === '21'" @click="statusChange(5)">同意取消</el-button> |
| | | <el-button v-if="gdStatus === '30'" @click="addDescription">协商修改</el-button> |
| | | <el-button v-if="gdStatus === '31'" @click="statusChange(10)">同意</el-button> |
| | | <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> |
| | | |
| | |
| | | const processList = ref([]) |
| | | let viewPlane |
| | | const hasPatrolTaskList = computed(() => ['30', '40', '50', '60'].includes(String(formData.value.workOrderStatus))) |
| | | import droneIcon from '@/assets/images/orderView/orderManage/drone.png' |
| | | |
| | | const gdStatusObj = { |
| | | '10': { reason: '拒绝原因', operationType: '2' }, |
| | | '11': { reason: '拒绝原因' }, |
| | | '20': { reason: '取消原因', operationType: '3' }, |
| | | '21': { reason: '原因', operationType: '6' }, |
| | | '22': { reason: '驳回原因' }, |
| | | '22': { reason: '驳回原因', operationType: '8' }, |
| | | '23': { reason: '取消原因' }, |
| | | '24': { reason: '驳回原因', operationType: '3' }, |
| | | '25': { reason: '驳回原因', operationType: '3' }, |
| | |
| | | }) |
| | | } |
| | | |
| | | function requestModification() { |
| | | // 申请修改按钮 |
| | | async function requestModification() { |
| | | suddenlyEdit.value = true |
| | | dialogMode.value = 'edit' |
| | | await getDeviceList() |
| | | nextTick(() => { |
| | | syncSelection() |
| | | viewPlane && viewer.entities.remove(viewPlane) |
| | |
| | | }) |
| | | } |
| | | |
| | | // 填写说明弹框回调 |
| | | function rejectSuccess() { |
| | | visible.value = false |
| | | emit('success') |
| | |
| | | const str = [...pointList.value, pointList.value[0]].map(item => `${item.longitude} ${item.latitude}`).join(',') |
| | | let geom = `POLYGON((${str}))` |
| | | const res = await gdManageDeviceListApi({ |
| | | deviceIds: formData.value.recommendDeviceIds, |
| | | devicePayload: dialogMode.value === 'add' ? formData.value.deviceLoadDemand : '', |
| | | geom: dialogMode.value === 'add' ? geom : '', |
| | | deviceIds: dialogMode.value === 'add' ? '' : formData.value.recommendDeviceIds, |
| | | devicePayload: formData.value?.deviceLoadDemand, |
| | | geom: geom, |
| | | }) |
| | | deviceList.value = res?.data?.data ?? [] |
| | | } catch (error) { |
| | |
| | | } |
| | | |
| | | // 设备需求变化 |
| | | function loadDemandChange() { |
| | | async function loadDemandChange() { |
| | | formData.value.recommendDeviceIds = '' |
| | | selectedDevices.value = [] |
| | | getDeviceList() |
| | | await getDeviceList() |
| | | syncSelection() |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | watch( |
| | | () => dateRange.value, |
| | | newVal => { |
| | | const range = dateRangeFormat(dateRange.value) |
| | | formData.value.executeStartTime = range[0] |
| | | formData.value.executeEndTime = range[1] |
| | | } |
| | | ) |
| | | |
| | | // 加载时间线list |
| | | function loadList() { |
| | | gdWorkOrderFlowListApi({ workOrderId: formData.value.id,type: '0' }).then(res => { |
| | | gdWorkOrderFlowListApi({ workOrderId: formData.value.id, type: '0' }).then(res => { |
| | | processList.value = res.data.data |
| | | }) |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | // 同步关联场景 |
| | | // 回显选中设备 |
| | | function syncSelection() { |
| | | if (!deviceTableRef.value) return |
| | | deviceTableRef.value.clearSelection() |
| | |
| | | }) |
| | | } |
| | | |
| | | function setMapDevice() { |
| | | gdManageDeviceListApi().then(res => { |
| | | renderingDevice(res?.data?.data || []) |
| | | }) |
| | | } |
| | | |
| | | import droneIcon from '@/assets/images/orderView/orderManage/drone.png' |
| | | |
| | | function renderingDevice(list) { |
| | | // 渲染红点 |
| | | // 渲染 |
| | | function renderingAllDevice(list) { |
| | | list.forEach(item => { |
| | | const position = Cesium.Cartesian3.fromDegrees(item.longitude || 115.0, item.latitude || 27.11) |
| | | viewer.entities.add({ |
| | | position: position, |
| | | billboard: { |
| | | image: droneIcon, |
| | | width: 40, |
| | | height: 40, |
| | | width: 30, |
| | | height: 30, |
| | | verticalOrigin: Cesium.VerticalOrigin.CENTER, |
| | | }, |
| | | label: { |
| | | text: item.nickname, |
| | | font: '12px/1.5 Microsoft YaHei', |
| | | style: Cesium.LabelStyle.FILL_AND_OUTLINE, |
| | | outlineWidth: 2, |
| | | outlineColor: Cesium.Color.WHITE, |
| | | horizontalOrigin: Cesium.HorizontalOrigin.CENTER, |
| | | verticalOrigin: Cesium.VerticalOrigin.BOTTOM, |
| | | pixelOffset: new Cesium.Cartesian2(0, -20), |
| | | }, |
| | | }) |
| | | }) |
| | |
| | | // 打开弹框 |
| | | async function open({ mode = 'add', row } = {}) { |
| | | dialogMode.value = mode |
| | | formData.value = dialogMode.value === 'add' ? initForm() : row |
| | | initMap() |
| | | const allDeviceRes = await gdManageDeviceListApi() |
| | | formData.value = dialogMode.value === 'add' ? initForm() : row |
| | | renderingAllDevice(allDeviceRes?.data?.data || []) |
| | | if (dialogMode.value === 'add') { |
| | | addPolygon() |
| | | } else { |
| | |
| | | hasPatrolTaskList.value && gdPatrolTaskPage() |
| | | dialogMode.value === 'edit' ? editPolygon() : viewPolygon() |
| | | } |
| | | // setMapDevice() |
| | | |
| | | await nextTick() |
| | | await getDeviceList() |
| | | syncSelection() |
| | | getDeviceList() |
| | | highlightSelectedDevices() |
| | | } |
| | | |
| | | // 初始化地图实例 |
| | |
| | | viewer = map?.viewer || null |
| | | } |
| | | |
| | | // 高亮选中的设备 |
| | | function highlightSelectedDevices() { |
| | | const selectedIds = (formData.value.recommendDeviceIds || '').split(',').filter(Boolean) |
| | | if (!viewer?.entities) return |
| | | viewer.entities.values.forEach(entity => { |
| | | if (entity.billboard?.image?._value === droneIcon && entity.label) { |
| | | const device = deviceList.value.find(d => d.nickname === entity.label.text._value) |
| | | if (device && selectedIds.includes(String(device.id))) { |
| | | entity.label.fillColor = Cesium.Color.YELLOW |
| | | } else { |
| | | entity.label.fillColor = Cesium.Color.WHITE |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | watch(() => formData.value.recommendDeviceIds, highlightSelectedDevices) |
| | | |
| | | watch( |
| | | () => dateRange.value, |
| | | newVal => { |
| | | const range = dateRangeFormat(dateRange.value) |
| | | formData.value.executeStartTime = range[0] |
| | | formData.value.executeEndTime = range[1] |
| | | } |
| | | ) |
| | | |
| | | // 地图加载完毕 |
| | | function mapReady() { |
| | | dialogMode.value === 'add' && mapRef.value.flyBoundary() |
| | | } |
| | |
| | | .content { |
| | | display: flex; |
| | | gap: 0 20px; |
| | | height: 680px; |
| | | |
| | | .leftBox { |
| | | width: 0; |
| | | flex: 1; |
| | | display: flex; |
| | | overflow: auto; |
| | | flex-direction: column; |
| | | |
| | | .gd-cesium { |
| | | width: 100%; |
| | | height: 423px; |
| | | min-height: 380px; |
| | | flex: 1; |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | .processBox { |
| | | padding: 24px 0; |
| | | width: 312px; |
| | | border: 1px solid #e4e4e4; |
| | | overflow: auto; |
| | | |
| | | .item-content { |
| | | position: relative; |
| | | .flowName { |