| | |
| | | loading.value = true |
| | | const type = 1 |
| | | const res = await addOrderRecordApi(type, ticketId) |
| | | |
| | | |
| | | } else if (checked.value === '智飞工单') { |
| | | loading.value = true |
| | | const type = 2 |
| | |
| | | const res = await getOrderOrEventApi(type, userInfo.value.detail.areaCode) |
| | | todos.value = res.data.data || [] |
| | | loading.value = false |
| | | // console.log('事件工单', todos.value); |
| | | } else if (checked.value === '智飞工单') { |
| | | loading.value = true |
| | | const type = 2 |
| | | const res = await getOrderOrEventApi(type, userInfo.value.detail.areaCode) |
| | | todos.value = res.data.data || [] |
| | | loading.value = false |
| | | // console.log('智飞工单', todos.value); |
| | | } |
| | | } |
| | | |
| | |
| | | </template> |
| | | <template v-else-if="test[item]?.name == '机巢保险'"> |
| | | <div |
| | | v-for="statusKey in [1, 0]" |
| | | v-for="statusKey in [1, 0,2]" |
| | | :key="statusKey" |
| | | class="status-item" |
| | | :class="getStatusStyle(test[item]?.name, statusKey)" |
| | |
| | | <span class="count"> |
| | | {{ newtitleData[item].status_map[statusKey] }} |
| | | {{ test[item]?.name === '无人机' ? '架' : '个' }} |
| | | </span> |
| | | </div> |
| | | </template> |
| | | <template v-else-if="test[item]?.name == '无人机流量'"> |
| | | <div |
| | | v-for="statusKey in [ 0,2,1]" |
| | | :key="statusKey" |
| | | class="status-item" |
| | | :class="getStatusStyle(test[item]?.name, statusKey)" |
| | | :style="{ color: getStatusColor(test[item]?.name, statusKey) }" |
| | | > |
| | | <span |
| | | class="indicator" |
| | | :style="{ |
| | | backgroundColor: getStatusBackground(test[item]?.name, statusKey), |
| | | color: getStatusColor(test[item]?.name, statusKey), |
| | | }" |
| | | ></span> |
| | | <span class="label">{{ getStatusLabel(test[item]?.name, statusKey) }}</span> |
| | | <span class="count"> |
| | | {{ newtitleData[item].status_map[statusKey] }} |
| | | {{ test[item]?.name === '无人机流量' ? '架' : '个' }} |
| | | </span> |
| | | </div> |
| | | </template> |
| | |
| | | const insureStatus = { |
| | | 0: '临近到期', |
| | | 1: '正常期限', |
| | | 2:'保险过期' |
| | | }; |
| | | const moveListStatus = { |
| | | '-1': '离线中', |
| | |
| | | const statusStyles = { |
| | | 机巢保险: { |
| | | 0: { class: 'expired', color: '#FFA600', background: '#FFA600' }, |
| | | 1: { class: 'normal', color: 'rgba(27, 148, 255, 1)', background: 'rgba(27, 148, 255, 1)' }, |
| | | 1: { class: 'normal', color: 'rgba(0, 180, 69, 1)', background: 'rgba(0, 180, 69, 1)' }, |
| | | 2: { class: 'flying',color: 'rgba(255, 36, 36, 1)', background: 'rgba(255, 36, 36, 1)' }, |
| | | }, |
| | | |
| | | 无人机流量: { |
| | | 0: { class: 'offline', color: 'rgba(0, 180, 69, 1)', background: 'rgba(0, 180, 69, 1)' }, |
| | | 1: { class: 'flying', color: 'rgba(186, 186, 186, 1)', background: 'rgba(186, 186, 186, 1)' }, |
| | | 2: { class: 'flying', color: 'rgba(255, 36, 36, 1)', background: 'rgba(255, 36, 36, 1)' }, |
| | | 1: { class: 'flying', color: 'rgba(255, 36, 36, 1)', background: 'rgba(255, 36, 36, 1)' }, |
| | | 2: { class: 'flying', color: '#FFA600', background: '#FFA600' }, |
| | | }, |
| | | 监控设备: { |
| | | 0: { class: 'offline', color: 'rgba(186, 186, 186, 1)', background: 'rgba(186, 186, 186, 1)' }, |
| | |
| | | const getBarChartData = value => { |
| | | gettaskOutcomApi(value).then(res => { |
| | | const list = res?.data?.data || []; |
| | | console.log('list',list); |
| | | |
| | | // 清空现有的eventTypeList值 |
| | | |
| | | eventTypeList.value.forEach(item => { |
| | | item.value = 0; |
| | | }); |
| | | |
| | | // 创建一个类型映射以便快速查找 |
| | | |
| | | const typeMap = new Map(); |
| | | eventTypeList.value.forEach(item => { |
| | | typeMap.set(item.type, item); |
| | | }); |
| | | |
| | | // 处理图表数据 - 确保每个月份都有所有类型的数据 |
| | | |
| | | echartsOption.xAxis.data = list.map(item => item.name); |
| | | |
| | | // 清空系列数据 |
| | | |
| | | Object.keys(seriesObj).forEach(key => { |
| | | seriesObj[key].data = []; |
| | | }); |
| | |
| | | // 遍历所有月份 |
| | | list.forEach(month => { |
| | | totalNum.value = month.total |
| | | |
| | | |
| | | // 创建一个临时映射存储当月的数据 |
| | | |
| | | const monthData = new Map(); |
| | | month.data.forEach(item => { |
| | | monthData.set(item.name, item.value); |
| | | }); |
| | | |
| | | // 为每个类型添加数据(如果有则用实际值,没有则为0) |
| | | eventTypeList.value.forEach(typeItem => { |
| | | const value = monthData.get(typeItem.type) || 0; |
| | | |
| | | // 添加到图表系列 |
| | | |
| | | if (seriesObj[typeItem.name]) { |
| | | seriesObj[typeItem.name].data.push(value); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | // 更新eventTypeList的值(取最后一个月份的数据) |
| | | |
| | | if (list.length > 0) { |
| | | const lastMonth = list[list.length - 1]; |
| | | const lastMonthData = new Map(); |