| | |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="关联航线" prop="file_id"> |
| | | <el-select |
| | | v-model="form.file_id" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <!-- <el-col :span="6">--> |
| | | <!-- <el-form-item label="安全返航真高" prop="rth_altitude">--> |
| | | <!-- <el-input-number--> |
| | | <!-- v-model="form.rth_altitude"--> |
| | | <!-- :min="30"--> |
| | | <!-- :max="300"--> |
| | | <!-- ></el-input-number>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <el-col :span="6"> |
| | | <el-form-item label="安全返航真高" prop="rth_altitude"> |
| | | <el-input-number |
| | | v-model="form.rth_altitude" |
| | | :min="50" |
| | | :max="300" |
| | | ></el-input-number> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | |
| | | } from '@/api/tickets/orderLog'; |
| | | import { getTicketInfo } from '@/api/tickets/ticket'; |
| | | import { getDictionaryByCode } from '@/api/system/dictbiz'; |
| | | import { getWaylineFileListByArea } from '@/api/resource/wayline'; |
| | | import { getWaylineFileListByArea, newGetWorkspacesPage } from '@/api/resource/wayline'; |
| | | import { export_json_to_excel } from '@/utils/exportExcel'; |
| | | import { getFlyingNestBy } from '@/api/device/device'; |
| | | import { mapGetters } from 'vuex'; |
| | |
| | | import weekday from 'dayjs/plugin/weekday'; |
| | | import elTooltipCopy from '@/components/ElTooltipCopy.vue'; |
| | | import { CircleClose, Promotion, Select } from '@element-plus/icons-vue'; |
| | | |
| | | import { useStore } from 'vuex'; |
| | | import _ from 'lodash' |
| | | // const store = useStore() |
| | | dayjs.extend(weekday); |
| | | dayjs.locale('zh-cn'); |
| | | |
| | | // const lastHeight = computed(() => store.state.common.lastHeight) |
| | | |
| | | export default { |
| | | components: { elTooltipCopy }, |
| | |
| | | data() { |
| | | return { |
| | | activeTab: 'all', |
| | | |
| | | getlastHeight: 0, |
| | | tabs: [ |
| | | { label: '全部工单', name: 'all', value: null, count: 0 }, |
| | | { label: '待审核', name: 'WAIT_AUDIT', value: 1, count: 0 }, |
| | |
| | | indexLabel: '序号', |
| | | indexFixed: true, |
| | | |
| | | align: 'center', |
| | | align: 'left', |
| | | border: true, |
| | | stripe: false, |
| | | searchShow: true, |
| | |
| | | return CircleClose |
| | | }, |
| | | ...mapGetters(['userInfo', 'permission']), |
| | | lastHeight() { |
| | | const height = this.$store.state.common.lastHeight; |
| | | return Number(height) || 0; // 确保是数字类型 |
| | | }, |
| | | filteredTabs() { |
| | | // rejection_and_draft 权限控制“已驳回”和“草稿”tab |
| | | // console.log(this.permission, '权限信息') |
| | |
| | | return this.$message.warning('任务时间不能小于当前时间'); |
| | | } |
| | | } |
| | | const maxItem = this.device_sns.reduce((max, item) => { |
| | | return item.drone_height > max.drone_height ? item : max; |
| | | }); |
| | | console.log(maxItem, '高度') |
| | | let result = _.round((maxItem.drone_height + this.form.rth_altitude), 2) |
| | | |
| | | if (this.lastHeight > result) { |
| | | this.$confirm(`安全返航真高${result}米低于航线返航点高度${this.lastHeight}米,为确保返航路径安全,建议您进行调整后再发布`, '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(async () => { |
| | | const submitData = { |
| | | ...this.form, |
| | | status: status, |
| | | ai_types: this.form.ai_types?.length ? this.form.ai_types : [], |
| | | }; |
| | | // 判断该值this.form.date_range[0] 周几 和rep_fre_type 是不是相等 |
| | | // if (this.form.deal_time) { |
| | | // const weekday = dayjs(this.form.date_range[0]).format('dddd'); |
| | | // console.log('444', weekday) |
| | | // // form.rep_fre_type |
| | | // const now = new Date() |
| | | // const today = now.toDateString() |
| | | // const selectedDate = new Date(this.form.date_range[0]).toDateString() |
| | | |
| | | // if (today === selectedDate) { |
| | | // const [hours, minutes] = this.form.deal_time.split(':') |
| | | // const selectedTime = new Date() |
| | | // selectedTime.setHours(parseInt(hours), parseInt(minutes)) |
| | | |
| | | // if (selectedTime < now) { |
| | | // return this.$message.warning('任务时间不能小于当前时间') |
| | | |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | await saveUpdateOrderLog(submitData); |
| | | let id = this.form.id; |
| | | if (id) { |
| | |
| | | this.dialogVisible = false; |
| | | this.detailVisible = false; |
| | | (this.device_sns = []), (this.wayLineList = []), this.fetchTableData(); |
| | | }).catch(() => { |
| | | |
| | | }); |
| | | } else { |
| | | const submitData = { |
| | | ...this.form, |
| | | status: status, |
| | | ai_types: this.form.ai_types?.length ? this.form.ai_types : [], |
| | | }; |
| | | await saveUpdateOrderLog(submitData); |
| | | let id = this.form.id; |
| | | if (id) { |
| | | this.$message.success('工单发布成功'); |
| | | } else { |
| | | this.$message.success('工单创建成功'); |
| | | } |
| | | this.dialogVisible = false; |
| | | this.detailVisible = false; |
| | | (this.device_sns = []), (this.wayLineList = []), this.fetchTableData(); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | |
| | | |
| | | handleAdd() { |
| | | this.form = {}; |
| | | this.form.rth_altitude = 120; |
| | | this.dialogVisible = true; |
| | | |
| | | this.$nextTick(() => { |
| | |
| | | }, |
| | | //获取航线列表 |
| | | async asyncgetWaylineFileListByArea(name) { |
| | | var wayLineListResponse = await getWaylineFileListByArea(this.userInfo.detail.areaCode); |
| | | this.wayLineList = wayLineListResponse.data.data; |
| | | const formData = { |
| | | name: '', |
| | | waylineType: undefined, |
| | | current: 1, |
| | | size: 99999999, |
| | | descs: 'update_time', |
| | | } |
| | | var wayLineListResponse = await newGetWorkspacesPage(formData); |
| | | this.wayLineList = wayLineListResponse.data.data.records |
| | | |
| | | this.initMapLine(); |
| | | }, |
| | |
| | | |
| | | this.initMapLine({}, async polygon => { |
| | | const currentLine = that.wayLineList.find(item => item.wayline_id === waylineId); |
| | | |
| | | console.log(currentLine.wayline_type, '5555') |
| | | //按照航线来 |
| | | const params = { |
| | | type: [2, 4, 5].includes(currentLine.wayline_type) ? 2 : 0, |
| | | type: ['2', '4', '5'].includes(currentLine.wayline_type) ? 2 : 0, |
| | | wayline_id: waylineId, |
| | | polygon, |
| | | }; |
| | |
| | | }); |
| | | }, |
| | | }, |
| | | |
| | | watch: { |
| | | // lastHeight(newVal, oldVal) { |
| | | // console.log('lastHeight', newVal, oldVal); |
| | | // this.getlastHeight = newVal; |
| | | // }, |
| | | tableData: { |
| | | handler() { |
| | | // this.updateTabCounts() |