feat: 巡检任务概况,事件概况,事件类型完成率接口对接
| | |
| | | }; |
| | | |
| | | // 巡检任务柱状图数据 |
| | | export const getJobNumBar = () => { |
| | | export const getJobNumBar = (data) => { |
| | | return request({ |
| | | url: '/drone-device-core/wayline/waylineJobInfo/jobNumBar', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }; |
| | | // 事件概况 |
| | | export const getJobEventTotal = () => { |
| | | return request({ |
| | | url: '/drone-device-core/jobEvent/total', |
| | | method: 'get', |
| | | }); |
| | | }; |
| | | export const getJobEventByStatus = (data) => { |
| | | return request({ |
| | | url: '/drone-device-core/jobEvent/eventByStatus', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }; |
| | | export const getJobEventBrokerLine = (data) => { |
| | | return request({ |
| | | url: '/drone-device-core/jobEvent/eventBrokerLine', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }; |
| | |
| | | <template> |
| | | <div class="common-date-time"> |
| | | <el-date-picker |
| | | v-model="newTime" |
| | | v-model="model" |
| | | type="daterange" |
| | | value-format="YYYY-MM-DD" |
| | | range-separator="-" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | > |
| | | </el-date-picker> |
| | | @change="change" |
| | | /> |
| | | <div class="time-card"> |
| | | <div |
| | | class="card-item" |
| | | :class="item == checked ? 'active' : ''" |
| | | v-for="item in timeList" |
| | | :class="item === checked ? 'active' : ''" |
| | | v-for="(item, index) in timeList" |
| | | @click="timeClick(item)" |
| | | > |
| | | {{ item }} |
| | | {{ timeListStr[index] }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | const newTime = ref([]); |
| | | let timeList = ['今日', '本周', '本月', '本年']; |
| | | import dayjs from 'dayjs'; |
| | | import { ref, defineEmits } from 'vue'; |
| | | |
| | | let checked = ref('今日'); |
| | | const emit = defineEmits(['change']); |
| | | |
| | | const model = defineModel(); |
| | | |
| | | let timeList = ['today', 'week', 'month', 'year']; |
| | | let timeListStr = ['今日', '本周', '本月', '本年']; |
| | | let checked = ref('today'); |
| | | |
| | | const getDateRange = unit => { |
| | | if (unit === 'today') { |
| | | return [dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')]; |
| | | } |
| | | return [dayjs().startOf(unit).format('YYYY-MM-DD'), dayjs().endOf(unit).format('YYYY-MM-DD')]; |
| | | }; |
| | | |
| | | const dateRanges = { |
| | | today: getDateRange('today'), |
| | | week: getDateRange('week'), |
| | | month: getDateRange('month'), |
| | | year: getDateRange('year'), |
| | | }; |
| | | |
| | | const change = value => { |
| | | emit('change', value); |
| | | }; |
| | | |
| | | let timeClick = item => { |
| | | checked.value = item; |
| | | model.value = dateRanges[item]; |
| | | emit('change', model.value); |
| | | }; |
| | | </script> |
| | | |
| | |
| | | <!-- 巡检任务详情 --> |
| | | <template> |
| | | <common-title |
| | | title="巡检任务情况" |
| | | :style="{ marginLeft: pxToRem(14) }" |
| | | @details="detailsFun" |
| | | > |
| | | <common-title title="巡检任务情况" :style="{ marginLeft: pxToRem(14) }" @details="detailsFun"> |
| | | </common-title> |
| | | <div class="inspection-rask-details"> |
| | | <div class="inspection-num"> |
| | | <div class="total"> |
| | | <div class="value">{{total}}</div> |
| | | <div class="value">{{ total }}</div> |
| | | <div class="name">总任务数</div> |
| | | </div> |
| | | <div class="status"> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <CommonDateTime :style="{ top: pxToRem(19) }"></CommonDateTime> |
| | | <CommonDateTime :style="{ top: pxToRem(19) }" v-model="newTime" @change="dateChange" /> |
| | | <div class="chart-container" ref="chartRef"></div> |
| | | </div> |
| | | </template> |
| | |
| | | import CommonTitle from '@/components/CommonTitle.vue'; |
| | | import CommonDateTime from '@/components/CommonDateTime.vue'; |
| | | import { getJobNumBar, getJobStatistics, getTotalJobNum } from '@/api/home'; |
| | | import dayjs from 'dayjs'; |
| | | |
| | | const currenDate = dayjs().format('YYYY-MM-DD'); |
| | | const newTime = ref([currenDate, currenDate]); |
| | | |
| | | const list = ref([ |
| | | { name: '计划执行', value: 89, color: '#FFFFFF',field:'planned_executions' }, |
| | | { name: '执行中', value: 100, color: '#FFA768',field:'running_num' }, |
| | | { name: '待执行', value: 66, color: '#FFE17E',field:'pending_executions' }, |
| | | { name: '已执行', value: 10, color: '#8EFFAC',field:'executed' }, |
| | | { name: '执行失败', value: 10, color: '#FF8E8E',field:'failed_executions' }, |
| | | { name: '计划执行', value: 89, color: '#FFFFFF', field: 'planned_executions' }, |
| | | { name: '执行中', value: 100, color: '#FFA768', field: 'running_num' }, |
| | | { name: '待执行', value: 66, color: '#FFE17E', field: 'pending_executions' }, |
| | | { name: '已执行', value: 10, color: '#8EFFAC', field: 'executed' }, |
| | | { name: '执行失败', value: 10, color: '#FF8E8E', field: 'failed_executions' }, |
| | | ]); |
| | | const option = { |
| | | grid: { |
| | |
| | | }, |
| | | }, |
| | | }, |
| | | series: [ |
| | | { |
| | | data: [ |
| | | 10, 15, 8, 20, 12, 18, 15, 22, 16, 19, 14, 17, 21, 13, 16, 18, 15, 20, 17, 22, 19, 16, 14, |
| | | 18, 21, 15, 17, 20, 16, 18, |
| | | ], |
| | | type: 'bar', |
| | | barWidth: '60%', |
| | | itemStyle: { |
| | | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ |
| | | { offset: 0, color: '#1EE7E7' }, |
| | | { offset: 1, color: 'rgba(0, 112, 255, 0.1)' }, |
| | | ]), |
| | | }, |
| | | series: { |
| | | data: [ |
| | | 10, 15, 8, 20, 12, 18, 15, 22, 16, 19, 14, 17, 21, 13, 16, 18, 15, 20, 17, 22, 19, 16, 14, 18, |
| | | 21, 15, 17, 20, 16, 18, |
| | | ], |
| | | type: 'bar', |
| | | barWidth: '60%', |
| | | itemStyle: { |
| | | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ |
| | | { offset: 0, color: '#1EE7E7' }, |
| | | { offset: 1, color: 'rgba(0, 112, 255, 0.1)' }, |
| | | ]), |
| | | }, |
| | | ], |
| | | }, |
| | | }; |
| | | |
| | | const detailsFun = () => { |
| | | console.log('details'); |
| | | }; |
| | | |
| | | const dateChange = value => { |
| | | newTime.value = value; |
| | | getData(); |
| | | }; |
| | | let chart = null; |
| | | const getData = () => { |
| | | const params = { |
| | | date_enum: 'TODAY', |
| | | // start_date: newTime.value[0], |
| | | // end_date: newTime.value[1] |
| | | }; |
| | | getJobStatistics(params).then(res => { |
| | | jobStatistics.value = res.data?.data || {}; |
| | | }); |
| | | getJobNumBar(params).then(res => { |
| | | option.xAxis.data = res.data?.data.map(item => item.name); |
| | | option.series.data = res.data?.data.map(item => item.value); |
| | | chart.setOption(option); |
| | | }); |
| | | }; |
| | | |
| | | const chartRef = ref(null); |
| | | const total = ref(0); |
| | | const jobStatistics = ref({ |
| | | "planned_executions": 0, |
| | | "executed": 0, |
| | | "running_num": 0, |
| | | "failed_executions": 0, |
| | | "pending_executions": 0 |
| | | }) |
| | | planned_executions: 0, |
| | | executed: 0, |
| | | running_num: 0, |
| | | failed_executions: 0, |
| | | pending_executions: 0, |
| | | }); |
| | | |
| | | onMounted(() => { |
| | | getTotalJobNum().then(res => { |
| | | total.value = res.data?.data || 0 |
| | | }) |
| | | getJobStatistics().then(res => { |
| | | jobStatistics.value = res.data?.data || {} |
| | | }) |
| | | getJobNumBar().then(res => { |
| | | console.log(res.data.data); |
| | | }) |
| | | const chart = echarts.init(chartRef.value); |
| | | chart.setOption(option); |
| | | chart = echarts.init(chartRef.value); |
| | | // 监听窗口大小变化 |
| | | window.addEventListener('resize', () => { |
| | | chart.resize(); |
| | | }); |
| | | getTotalJobNum().then(res => { |
| | | total.value = res.data?.data || 0; |
| | | }); |
| | | getData(); |
| | | }); |
| | | </script> |
| | | |
| | |
| | | width: 390px; |
| | | height: 414px; |
| | | background: linear-gradient( |
| | | 270deg, |
| | | rgba(31, 62, 122, 0) 0%, |
| | | rgba(31, 62, 122, 0.35) 21%, |
| | | #1f3e7a 100% |
| | | 270deg, |
| | | rgba(31, 62, 122, 0) 0%, |
| | | rgba(31, 62, 122, 0.35) 21%, |
| | | #1f3e7a 100% |
| | | ); |
| | | border-radius: 0px 0px 0px 0px; |
| | | opacity: 0.85; |
| | | |
| | | .inspection-num { |
| | | background: url('@/assets/images/home/homeLeft/inspection-num.png') no-repeat center / 100% 100%; |
| | | width: 360px; |
| | | height: 118px; |
| | | position: relative; |
| | | |
| | | .total { |
| | | position: absolute; |
| | | left: 34px; |
| | |
| | | text-align: center; |
| | | font-family: Source Han Sans CN, Source Han Sans CN; |
| | | line-height: 19px; |
| | | |
| | | .value { |
| | | font-family: YouSheBiaoTiHei, YouSheBiaoTiHei; |
| | | margin-left: 8px; |
| | | font-size: 26px; |
| | | } |
| | | } |
| | | |
| | | .status { |
| | | position: absolute; |
| | | top: 8px; |
| | |
| | | justify-content: flex-start; |
| | | line-height: 22px; |
| | | padding: 0 10px 10px 0; |
| | | |
| | | .name { |
| | | font-family: Source Han Sans CN, Source Han Sans CN; |
| | | font-weight: 400; |
| | | font-size: 14px; |
| | | color: #ffffff; |
| | | } |
| | | |
| | | .value { |
| | | font-family: YouSheBiaoTiHei, YouSheBiaoTiHei; |
| | | font-weight: 400; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | .chart-container { |
| | | width: 100%; |
| | | height: 200px; |
| | |
| | | <template> |
| | | <CommonTitle title="事件概况" /> |
| | | <div :style="{ marginLeft: pxToRem(14) }"> |
| | | <div class="eventOverview"> |
| | | <div class="overviewData"> |
| | | <div class="totalBox"> |
| | | <div class="totalNumber">{{ total }}</div> |
| | | <div class="totalLabel">总事件数</div> |
| | | </div> |
| | | <div class="contentBox"> |
| | | <div class="overviewItem" v-for="item in list" :key="item.name"> |
| | | <div class="itemName"><img :src="item.img" alt="" />{{ item.name }}</div> |
| | | <div class="itemValue" :style="{ color: item.color }">{{ item.value }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <CommonDateTime class="dateTime" v-model="newTime" @change="dateChange" /> |
| | | |
| | | <el-select class="homeRightSelect" v-model="value" placeholder="请选择" size="large"> |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | <div class="completion"> |
| | | <img class="completion-left-img" :src="completionLeft" alt="" /> |
| | | <div class="completion-text">事件类型完成率情况</div> |
| | | <div class="completion-separator"></div> |
| | | <img class="completion-left-img" :src="completionLeft" alt="" /> |
| | | </div> |
| | | |
| | | <div class="chart" ref="echartsRef"></div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | import CommonTitle from '@/components/CommonTitle.vue'; |
| | | import { pxToRem } from '@/utils/rem'; |
| | | import overviewImg1 from '@/assets/images/home/homeRight/overview1.png'; |
| | | import overviewImg2 from '@/assets/images/home/homeRight/overview2.png'; |
| | | import overviewImg3 from '@/assets/images/home/homeRight/overview3.png'; |
| | |
| | | import completionLeft from '@/assets/images/home/homeRight/completionLeft.png'; |
| | | import * as echarts from 'echarts'; |
| | | import CommonDateTime from '@/components/CommonDateTime.vue'; |
| | | import { |
| | | getJobEventBrokerLine, |
| | | getJobEventByStatus, |
| | | getJobEventTotal, |
| | | getJobNumBar, |
| | | getJobStatistics, |
| | | } from '@/api/home'; |
| | | import dayjs from 'dayjs'; |
| | | |
| | | const list = ref([ |
| | | { name: '待审核', value: 265, img: overviewImg1, color: '#FF8E8E' }, |
| | |
| | | { name: '已完结', value: 262, img: overviewImg6, color: '#8EFFAC' }, |
| | | ]); |
| | | const value = ref(''); |
| | | const echartsRef = ref(''); |
| | | const echartsRef = ref(null); |
| | | |
| | | const options = [ |
| | | { |
| | |
| | | label: 'Option1', |
| | | }, |
| | | ]; |
| | | const currenDate = dayjs().format('YYYY-MM-DD'); |
| | | const newTime = ref([currenDate, currenDate]); |
| | | const option = { |
| | | tooltip: { |
| | | trigger: 'axis', |
| | |
| | | fontWeight: 400, |
| | | fontSize: 10, |
| | | }, |
| | | data: ['暴露垃圾', '占道','暴露垃圾', '占道','暴露垃圾', '占道','暴露垃圾', '占道',], |
| | | data: ['暴露垃圾', '占道', '暴露垃圾', '占道', '暴露垃圾', '占道', '暴露垃圾', '占道'], |
| | | }, |
| | | ], |
| | | yAxis: [ |
| | |
| | | itemStyle: { |
| | | color: '#FF8E8E', // 设置颜色 |
| | | }, |
| | | data: [120, 132,120, 132,120, 132,120, 132,], |
| | | data: [120, 132, 120, 132, 120, 132, 120, 132], |
| | | }, |
| | | { |
| | | name: '已完成', |
| | |
| | | emphasis: { |
| | | focus: 'series', |
| | | }, |
| | | data: [120, 132,120, 132,120, 132,120, 132,], |
| | | data: [120, 132, 120, 132, 120, 132, 120, 132], |
| | | }, |
| | | { |
| | | name: '已完成1', |
| | |
| | | emphasis: { |
| | | focus: 'series', |
| | | }, |
| | | data: [120, 132,120, 132,120, 132,120, 132,], |
| | | data: [120, 132, 120, 132, 120, 132, 120, 132], |
| | | }, |
| | | { |
| | | name: '已完成2', |
| | |
| | | emphasis: { |
| | | focus: 'series', |
| | | }, |
| | | data: [120, 132,120, 132,120, 132,120, 132,], |
| | | data: [120, 132, 120, 132, 120, 132, 120, 132], |
| | | }, |
| | | { |
| | | name: '完成率', |
| | |
| | | }, |
| | | ], |
| | | }; |
| | | const total = ref(0); |
| | | |
| | | const getData = () => { |
| | | const params = { |
| | | date_enum: 'TODAY', |
| | | // start_date: newTime.value[0], |
| | | // end_date: newTime.value[1] |
| | | }; |
| | | getJobEventByStatus(params).then(res => { |
| | | const resList = res?.data?.data || []; |
| | | resList.forEach(item => { |
| | | list.value.forEach(item1 => { |
| | | if (item1.name === item.name) { |
| | | item1.value = item.num; |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | // todo 未对接 |
| | | getJobEventBrokerLine(params).then(res => {}); |
| | | }; |
| | | |
| | | const dateChange = value => { |
| | | console.log(value); |
| | | newTime.value = value; |
| | | getData(); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | const chart = echarts.init(echartsRef.value); |
| | |
| | | window.addEventListener('resize', () => { |
| | | chart.resize(); |
| | | }); |
| | | getJobEventTotal().then(res => { |
| | | total.value = res?.data?.data || 0; |
| | | }); |
| | | getData(); |
| | | }); |
| | | </script> |
| | | |
| | | <template> |
| | | <CommonTitle title="事件概况" /> |
| | | <div :style="{ marginLeft: pxToRem(14) }"> |
| | | <div class="eventOverview"> |
| | | <div class="overviewData"> |
| | | <div class="totalBox"> |
| | | <div class="totalNumber">8096</div> |
| | | <div class="totalLabel">总事件数</div> |
| | | </div> |
| | | <div class="contentBox"> |
| | | <div class="overviewItem" v-for="item in list" :key="item.name"> |
| | | <div class="itemName"><img :src="item.img" alt="" />{{ item.name }}</div> |
| | | <div class="itemValue" :style="{ color: item.color }">{{ item.value }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <CommonDateTime class="dateTime" /> |
| | | |
| | | <el-select class="homeRightSelect" v-model="value" placeholder="请选择" size="large"> |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | |
| | | <div class="completion"> |
| | | <img class="completion-left-img" :src="completionLeft" /> |
| | | <div class="completion-text">事件类型完成率情况</div> |
| | | <div class="completion-separator"></div> |
| | | <img class="completion-left-img" :src="completionLeft" /> |
| | | </div> |
| | | |
| | | <div class="chart" ref="echartsRef"></div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped lang="scss"> |
| | | .homeRightSelect { |
| | | width: 356px; |
| | | |
| | | :deep() { |
| | | .el-select__wrapper { |
| | | background: linear-gradient(90deg, #195bad 0%, rgba(25, 91, 173, 0) 100%); |
| | |
| | | flex-direction: column; |
| | | align-items: center; |
| | | |
| | | .dateTime{ |
| | | .dateTime { |
| | | width: 356px; |
| | | margin: 15px 0 8px 0; |
| | | } |
| | |
| | | padding-left: 11px; |
| | | |
| | | .totalBox { |
| | | width: 77px; |
| | | |
| | | .totalNumber { |
| | | font-family: YouSheBiaoTiHei, YouSheBiaoTiHei; |
| | | font-weight: 400; |
| | |
| | | <template></template> |
| | | |
| | | <script setup> |
| | | import { useStore } from 'vuex'; |
| | | |
| | |
| | | ); |
| | | </script> |
| | | |
| | | <template></template> |
| | | |
| | | <style scoped lang="scss"></style> |