| | |
| | | |
| | | // 获取行业统计数据 |
| | | 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> |