| | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="工单名称" prop="name"> |
| | | <el-input v-model="formParams.name" placeholder="请输入工单名称" maxlength="100" show-word-limit :disabled="txtTitle === '审核工单' || txtTitle === '工单详情'"></el-input> |
| | | <el-input v-model="formParams.name" placeholder="请输入工单名称" maxlength="100" show-word-limit :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="关联航线" prop="file_id"> |
| | | <el-select v-model="formParams.file_id" placeholder="请选择航线" filterable @change="getFlyingNest" :disabled="txtTitle === '审核工单' || txtTitle === '工单详情'"> |
| | | <el-select v-model="formParams.file_id" placeholder="请选择航线" filterable @change="getFlyingNest" :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'"> |
| | | <el-option v-for="item in lineList" :key="item.wayline_id" :label="item.name" |
| | | :value="item.wayline_id" /> |
| | | </el-select> |
| | |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="安全返航真高" prop="rth_altitude" class="safe-height"> |
| | | <el-input-number v-model="formParams.rth_altitude" :min="50" :max="500" :disabled="txtTitle === '审核工单' || txtTitle === '工单详情'"></el-input-number> |
| | | <el-input-number v-model="formParams.rth_altitude" :min="50" :max="500" :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'"></el-input-number> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="关联机巢" prop="device_sns"> |
| | | <el-select v-model="formParams.device_sns" placeholder="请选择机巢" multiple :disabled="(txtTitle === '审核工单' || txtTitle === '工单详情')"> |
| | | <el-select v-model="formParams.device_sns" placeholder="请选择机巢" multiple :disabled="(txtTitle === '工单审核' || txtTitle === '工单详情')"> |
| | | <el-option v-for="item in drone_sns" :key="item.device_sn" :label="item.nickname" :value="item.device_sn" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="关联算法" prop="ai_types"> |
| | | <el-select v-model="formParams.ai_types" placeholder="请选择关联算法" multiple :disabled="txtTitle === '审核工单' || txtTitle === '工单详情'"> |
| | | <el-select v-model="formParams.ai_types" placeholder="请选择关联算法" multiple :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'"> |
| | | <el-option v-for="item in aiTypeList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12" v-if="txtTitle === '新建工单'"> |
| | | <el-form-item label="工单内容" prop="content"> |
| | | <el-input type="textarea" v-model="formParams.content" rows="4" placeholder="请输入工单内容" maxlength="255" show-word-limit :disabled="txtTitle === '审核工单' || txtTitle === '工单详情'"></el-input> |
| | | <el-input type="textarea" v-model="formParams.content" rows="4" placeholder="请输入工单内容" maxlength="255" show-word-limit :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | |
| | | |
| | | <el-col :span="7"> |
| | | <el-form-item label="周期频次" prop="date_range"> |
| | | <el-date-picker :disabled="txtTitle === '审核工单' || txtTitle === '工单详情'" |
| | | <el-date-picker :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'" |
| | | v-model="formParams.date_range" |
| | | type="daterange" |
| | | range-separator="至" |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="2"> |
| | | <el-select v-model="formParams.rep_fre_type" placeholder="请选择频次" :disabled="txtTitle === '审核工单' || txtTitle === '工单详情'"> |
| | | <el-select v-model="formParams.rep_fre_type" placeholder="请选择频次" :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'"> |
| | | <el-option v-for="item in weeks" :key="item" :label="item" :value="item" /> |
| | | </el-select> |
| | | </el-col> |
| | | <el-col :span="3"> |
| | | <el-time-picker :style="{ width: pxToRem(140) }" |
| | | v-model="formParams.deal_time" |
| | | :disabled="txtTitle === '审核工单' || txtTitle === '工单详情'" |
| | | :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'" |
| | | prop="deal_time" |
| | | value-format="HH:mm" |
| | | :picker-options="{ selectableRange: '00:00 - 23:59'}" /> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20" v-if="txtTitle === '审核工单' || txtTitle === '工单详情' || txtTitle === '工单编辑'"> |
| | | <el-row :gutter="20" v-if="txtTitle === '工单审核' || txtTitle === '工单详情' || txtTitle === '工单编辑'"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="工单内容" prop="content"> |
| | | <el-input type="textarea" v-model="formParams.content" rows="4" placeholder="请输入工单内容" maxlength="255" |
| | | show-word-limit :disabled="txtTitle === '审核工单' || txtTitle === '工单详情'"></el-input> |
| | | show-word-limit :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <template #footer v-if="txtTitle === '工单审核'"> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" |
| | | v-if="formParams.status == 1 && permission.order_log_review" |
| | | v-if="formParams.status == 1 && permission.orderLogpass" |
| | | @click="orderPass(formParams.id)">通过 |
| | | </el-button> |
| | | <el-button type="danger" |
| | |
| | | orderLogDetails, |
| | | orderLogPass, |
| | | orderLogReject, |
| | | orderLogRecall |
| | | orderLogRecall, getWaylineMaxTerrainHeight |
| | | } from '@/api/tickets/orderLog'; |
| | | import dayjs from 'dayjs' |
| | | import 'dayjs/locale/zh-cn' // 导入中文语言包 |
| | |
| | | const store = useStore() |
| | | const userInfo = computed(() => store.state.user.userInfo) |
| | | const permission = computed(() => store.state.user.permission); |
| | | |
| | | // safeHeight 计算属性 |
| | | const safeHeight = computed(() => { |
| | | const height = store.state.common.safeHeight |
| | | return Number(height) || 0 // 确保是数字类型 |
| | | }) |
| | | |
| | | // positionsArr 计算属性 |
| | | const positionsArr = computed(() => { |
| | | const arr = store.state.common.positionsArr |
| | | return arr || [] // 确保是数组类型 |
| | | }) |
| | | |
| | | const txtTitle = inject('txtTitle') |
| | | const rowObj = inject('rowObj') |
| | |
| | | ).padStart(2, '0')} 00:00:00` |
| | | } |
| | | |
| | | async function returnHeight() { |
| | | let checkedList = drone_sns.value.filter(item => formParams.value.device_sns.includes(item.device_sn)); |
| | | const maxItem = checkedList.reduce((max, item) => { |
| | | return item.drone_height > max.drone_height ? item : max; |
| | | }); |
| | | // 返航绝对高度 |
| | | let backHeight = formParams.value.rth_altitude // + maxItem.drone_height |
| | | console.log(backHeight,'backHeight') |
| | | // 安全起飞高度 |
| | | let positions = positionsArr.value |
| | | positions.unshift({latitude: maxItem.latitude, longitude: maxItem.longitude, height:maxItem.drone_height }) |
| | | positions.push({latitude: maxItem.latitude, longitude: maxItem.longitude, height:maxItem.drone_height}) |
| | | let resultHeight = 0 |
| | | await getWaylineMaxTerrainHeight(positions).then(res => { |
| | | resultHeight = safeHeight.value > (res.data.data + 30) ? safeHeight.value : (res.data.data + 30) |
| | | }) |
| | | let valueHeight = _.round(backHeight - resultHeight, 2) |
| | | return _.round(backHeight - resultHeight, 2) |
| | | } |
| | | |
| | | function submitForm(status) { |
| | | orderFormRef.value?.validate(async (valid, fields) => { |
| | | if (valid) { |
| | |
| | | if (selectedDate === dayjs().format('YYYY-MM-DD') && selectedTime < now) { |
| | | return ElMessage({message: '任务时间不能小于当前时间', type: 'warning'}) |
| | | } |
| | | } |
| | | let checkedList = drone_sns.value.filter(item => formParams.value.device_sns.includes(item.device_sn)); |
| | | const maxItem = checkedList.reduce((max, item) => { |
| | | return item.drone_height > max.drone_height ? item : max; |
| | | }); |
| | | // 返航绝对高度 |
| | | let backHeight = formParams.value.rth_altitude // + maxItem.drone_height |
| | | console.log(backHeight,'backHeight') |
| | | // 安全起飞高度 |
| | | let positions = positionsArr.value |
| | | positions.unshift({latitude: maxItem.latitude, longitude: maxItem.longitude, height:maxItem.drone_height }) |
| | | positions.push({latitude: maxItem.latitude, longitude: maxItem.longitude, height:maxItem.drone_height}) |
| | | let resultHeight = 0 |
| | | await getWaylineMaxTerrainHeight(positions).then(res => { |
| | | resultHeight = safeHeight.value > (res.data.data + 30) ? safeHeight.value : (res.data.data + 30) |
| | | }) |
| | | let valueHeight = _.round(backHeight - resultHeight, 2) |
| | | if (valueHeight < 0) { |
| | | await ElMessageBox.confirm(`当前返航高度存在安全隐患,建议调整为${resultHeight}米以上后进行发布`, '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | } |
| | | const submitData = { |
| | | ...formParams.value, |
| | |
| | | } |
| | | } |
| | | |
| | | const initMapPosition = async () => { |
| | | await nextTick() |
| | | |
| | | if (mapContainerRef.value?.initAddEntity) { |
| | | mapContainerRef.value.initAddEntity('initPosition') |
| | | } |
| | | } |
| | | |
| | | // 监听txtTitle |
| | | watch(isShowAddEditDetails, async (newVal, oldVal) => { |
| | | console.log('txtTitle 发生变化:', newVal, oldVal) |
| | | formParams.value = {} |
| | | formParams.value = {rth_altitude:120} |
| | | if (txtTitle.value === '工单审核' || txtTitle.value === '工单详情' || txtTitle.value === '工单编辑') { |
| | | const response = await orderLogDetails(rowObj.value.id) |
| | | const data = response.data.data |
| | |
| | | console.log(formParams.value, '898789') |
| | | drone_sns.value = data.device_list |
| | | initMapLine(data.device_map_infos) |
| | | } else { |
| | | initMapPosition() |
| | | } |
| | | }, { |
| | | immediate: true // 立即执行一次 |
| | |
| | | .step-description { |
| | | font-size: 14px; |
| | | color: #666; |
| | | line-height: 1.5; |
| | | line-height: 2.2; |
| | | } |
| | | } |
| | | } |