无人机管理后台前端(已迁走)
罗广辉
2025-10-11 02409bfbe15f22fc3b5dccadabfd860a660a49d9
src/views/job/components/TaskTop/TaskEvent.vue
@@ -81,7 +81,7 @@
      {
         name: '任务',
         type: 'bar',
         barWidth: 8,
         barWidth: 6,
         itemStyle: {
            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
               { offset: 0, color: '#FF8902' },
@@ -92,7 +92,7 @@
      {
         name: '事件',
         type: 'bar',
         barWidth: 8,
         barWidth: 6,
         itemStyle: {
            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
               { offset: 0, color: '#4363FF' },
@@ -105,7 +105,12 @@
// 获取行业统计数据
const getJobEventBar = value => {
   jobEventBar(value).then(res => {
  const params = {
    ...value,
    status_list:value.status,
    status:undefined
  }
   jobEventBar(params).then(res => {
      if (res.data.code !== 0) return
      option.xAxis.data = res.data.data.map(item => item.name)
      option.series[0].data = res.data?.data.map(item => item.data[0].value)
@@ -114,29 +119,24 @@
   })
}
const changeKey = inject('changeKey')
// 添加监听
watch(
   () => store.state.task.taskSearchParams,
   newVal => {
      if (newVal) {
         getJobEventBar(newVal)
      }
   },
   { deep: true }
  () => [store.state.task.taskSearchParams, changeKey.value],
  () => getJobEventBar(store.state.task.taskSearchParams),
  { deep: true }
)
onMounted(() => {
   getJobEventBar({ date_enum: 'TODAY' })
})
</script>
<style lang="scss" scoped>
.task-event {
width: 529px;
   width: 0;
   flex: 1;
   height: 100%;
   margin-left: 9px;
   margin-left: 10px;
   background: #FFFFFF;
   border-radius: 8px 8px 8px 8px;
   .title {
      padding: 10px 0 10px 16px;
      width: 144px;
@@ -147,11 +147,12 @@
      color: #363636;
      line-height: 18px;
   }
   .chart {
      padding: 6px 0px;
      width: 100%;
      height: 166px;
   }
}
</style>