| | |
| | | |
| | | // 单个机巢信息 |
| | | const singleUavHome = computed(() => store.state.home.singleUavHome) |
| | | const osdVisible = computed(() => store.state.home.osdVisible); |
| | | |
| | | const isMore = ref(true) |
| | | // 控制加载状态 |
| | |
| | | } |
| | | }) |
| | | |
| | | // 监听如果当前任务飞行完毕,当前任务即消失 |
| | | watch(() => store.state.home.deviceState, async (newValue) => { |
| | | const deviceInfo = newValue?.deviceInfo[osdVisible.value.sn]; |
| | | if (!deviceInfo) return |
| | | // 重新刷新数据 |
| | | if (deviceInfo?.mode_code === 14) { |
| | | getJobList() |
| | | } |
| | | }); |
| | | |
| | | const { init: initTaskWayline, removeEntitys } = useTaskWayline() |
| | | |
| | | onMounted(async () => { |
| | |
| | | const isTakeOff = ref(false) |
| | | // 监听ws消息 |
| | | watch(() => store.state.home.deviceState, async (newValue) => { |
| | | console.log(osdVisible.value.sn,'333333') |
| | | const deviceInfo = newValue?.deviceInfo[osdVisible.value.sn] |
| | | if (!deviceInfo) return |
| | | |
| | | const currentIsTakeOff = ![14, 0].includes(deviceInfo?.mode_code) |
| | | console.log(isTakeOff.value, currentIsTakeOff,'8888') |
| | | // 如果还是之前的状态,不切换 |
| | | if (isTakeOff.value === currentIsTakeOff) return |
| | | isTakeOff.value = currentIsTakeOff |
| | |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | value-format="YYYY-MM-DD" |
| | | @change="handleSearch" |
| | | @change="handleDateChange" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | |
| | | </template> |
| | | <script setup> |
| | | import { pxToRem } from '@/utils/rem' |
| | | import { ElMessage } from 'element-plus' |
| | | import { deptsByAreaCode, getDockInfo } from '@/api/home/common'; |
| | | import TaskAlgorithmBusiness from './components/TaskAlgorithmBusiness.vue'; |
| | | import dayjs from 'dayjs'; |
| | |
| | | |
| | | let timeClick = (item,index) => { |
| | | checked.value = item; |
| | | // model.value = dateRanges[item]; |
| | | // dateRange.value = dateRanges[item]; |
| | | dateRange.value = []; |
| | | // emit('change', dateRanges[item],timeListEnum[index]); |
| | | searchForm.date_enum = timeListEnum[index]; |
| | | handleSearch(); |
| | |
| | | // 搜索 |
| | | const handleSearch = () => { |
| | | if (!dateRange.value) { dateRange.value = []; } |
| | | if (dateRange.value && dateRange.value.length) { |
| | | // 有值时 清除 日 本周 本月 本年状态 |
| | | checked.value = ''; |
| | | } |
| | | // 提交至store |
| | | let params = { |
| | | ...searchForm, |
| | |
| | | store.commit('setTaskSearchParams', params); |
| | | emit('search', params); |
| | | }; |
| | | const handleDateChange = (val) => { |
| | | if (val && val.length === 2) { |
| | | const start = dayjs(val[0]) |
| | | const end = dayjs(val[1]) |
| | | const diff = end.diff(start, 'day') |
| | | |
| | | if (diff > 30) { |
| | | ElMessage.warning('日期范围不能超过30天') |
| | | dateRange.value = [] |
| | | return |
| | | } |
| | | } |
| | | handleSearch() |
| | | }; |
| | | // 重置 |
| | | const handleReset = () => { |
| | | dateRange.value = []; |
| | |
| | | |
| | | const option = { |
| | | tooltip: { |
| | | trigger: 'axis', |
| | | axisPointer: { |
| | | type: 'shadow' |
| | | }, |
| | | formatter: '{b}: {c} 件' |
| | | }, |
| | | trigger: 'axis', |
| | | axisPointer: { |
| | | type: 'shadow', |
| | | }, |
| | | }, |
| | | legend: { |
| | | data: ['任务', '事件'], |
| | | top: '2%', |
| | |
| | | containLabel: true |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | axisLine: { |
| | | lineStyle: { |
| | | color: '#fff' |
| | | } |
| | | }, |
| | | axisLabel: { |
| | | color: '#fff', |
| | | interval: 0, |
| | | rotate: 30 |
| | | } |
| | | }, |
| | | type: 'category', |
| | | // data: ['1月', '2月', '3月', '4月', '5月', '6月'], |
| | | axisLine: { |
| | | lineStyle: { |
| | | color: '#fff', |
| | | }, |
| | | }, |
| | | axisLabel: { |
| | | color: '#fff', |
| | | }, |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | name: '单位:件', |
| | |
| | | series: [ |
| | | { |
| | | name: '任务', |
| | | type: 'bar', |
| | | barWidth: '6px', |
| | | type: 'bar', |
| | | barWidth: '20%', |
| | | itemStyle: { |
| | | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ |
| | | { offset: 0, color: '#1EE7C5' }, |
| | |
| | | { |
| | | name: '事件', |
| | | type: 'bar', |
| | | barWidth: '6px', |
| | | barWidth: '20%', |
| | | itemStyle: { |
| | | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ |
| | | { offset: 0, color: '#69BCFF' }, |
| | |
| | | bottom: '2%', |
| | | containLabel: true |
| | | }, |
| | | // xAxis: { |
| | | // type: 'category', |
| | | // axisLine: { |
| | | // lineStyle: { |
| | | // color: '#fff' |
| | | // } |
| | | // }, |
| | | // axisLabel: { |
| | | // color: '#fff', |
| | | // interval: 0, |
| | | // rotate: 30 |
| | | // } |
| | | // }, |
| | | xAxis: { |
| | | type: 'category', |
| | | axisLine: { |
| | | lineStyle: { |
| | | color: '#fff' |
| | | } |
| | | }, |
| | | axisLabel: { |
| | | color: '#fff', |
| | | interval: 0, |
| | | rotate: 30 |
| | | } |
| | | }, |
| | | type: 'category', |
| | | data: ['1'], |
| | | axisLine: { |
| | | show: false, // 隐藏轴线 |
| | | }, |
| | | axisTick: { |
| | | show: true, |
| | | length: 2, |
| | | lineStyle: { |
| | | color: '#ffffff', |
| | | }, |
| | | }, |
| | | axisLabel: { |
| | | color: '#ffffff', |
| | | margin: 8, |
| | | }, |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | name: '单位:件', |
| | |
| | | } |
| | | img { width: 160px; height: 110px;} |
| | | .num { |
| | | width: 50px; |
| | | width: 100px; |
| | | position: absolute; |
| | | font-size: 32px; |
| | | top: 90px; |
| | | left: 48px; |
| | | left: 24px; |
| | | } |
| | | } |
| | | .other-total { |