| | |
| | | { |
| | | name: '任务', |
| | | type: 'bar', |
| | | barWidth: 8, |
| | | barWidth: 6, |
| | | itemStyle: { |
| | | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ |
| | | { offset: 0, color: '#FF8902' }, |
| | |
| | | { |
| | | name: '事件', |
| | | type: 'bar', |
| | | barWidth: 8, |
| | | barWidth: 6, |
| | | itemStyle: { |
| | | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ |
| | | { offset: 0, color: '#4363FF' }, |
| | |
| | | |
| | | // 获取行业统计数据 |
| | | 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) |
| | |
| | | }) |
| | | } |
| | | |
| | | 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; |
| | |
| | | color: #363636; |
| | | line-height: 18px; |
| | | } |
| | | |
| | | .chart { |
| | | padding: 6px 0px; |
| | | width: 100%; |
| | | height: 166px; |
| | | |
| | | |
| | | } |
| | | } |
| | | </style> |