vue-echarts使用

vue-echarts使用

  • 排名柱状图
    • 示例
    • 代码
  • 汇总
    • 示例
    • 代码
  • 平均时效
    • 示例
    • 代码
  • 全图

排名柱状图

示例

在这里插入图片描述

代码

// 排名趋势<!-- 排名数据趋势图 --><div class="rank"><div class="rank_title"><div class="rank_title_left"><span v-if="rankType === 1">{{ $lang('代理区排名') }}</span><span v-else>{{ $lang('中心排名') }}</span></div><div class="rank_title_right"><el-button size="small" type="info" :class="rankType === 1 ? 'btnBgc' : ''" @click="rankChange(1)">{{ $lang('代理区') }} </el-button><el-button size="small" type="info" :class="rankType !== 1 ? 'btnBgc' : ''" @click="rankChange(2)">{{ $lang('中心') }} </el-button></div></div><div class="rank_table"><el-table ref="table" :data="tableData" :border="false"><el-table-column prop="rank" type="index" :label="$lang('排名')" width="90" header-align="right" align="right"><template slot-scope="{ row }"><div v-if="row.rank < 4"><span class="btnBgc top">Top</span> <span>{{ row.rank }}</span></div><div v-else>{{ row.rank }}</div></template></el-table-column><el-table-column prop="netWorkName" :label="rankType === 1 ? $lang('代理区名称') : $lang('中心名称')" width="140" header-align="center" align="center"><template slot-scope="{ row }">{{ row.netWorkName }} </template></el-table-column><el-table-column :label="$lang('总主单号数量')" header-align="left" align="left"> </el-table-column></el-table><v-chart ref="RankChart" class="rank_chart" :options="rankOptions" :style="{ height: rankHeight,width: rankWidth}" v-if="rankNum" /></div>data({return {// --------------  1 排名数据趋势图表数据 ------------// 1 图表数据tableData: [], // table数据rankNum: [], // 图表数据// rank图表rankType: 1, // 排行类型 1-代理区 2-中心rankPage: {size: 10,current: 1,total: 0}, // 翻页信息}})<!-- 分页 --><div class="rank_pages b('pagination')"><el-pagination:page-size="rankPage.size":current-page="rankPage.current"layout="prev, pager, next":total="rankPage.total"@size-change="sizeChangeRank"@current-change="currentChangeRank"></el-pagination></div></div>// 排名数据趋势图rankOptions() {return {tooltip: {trigger: 'axis',axisPointer: {type: 'shadow'}},grid: {top: 5,left: 0,bottom: 0,backgroundColor: 'transparent'},xAxis: {show: false,splitNumber: 15,interval: 25},yAxis: {type: 'category',show: false},series: [{type: 'bar',data: this.rankNum,showBackground: true,backgroundStyle: {color: '#ccc'},label: {show: true,position: 'right'},itemStyle: {barBorderRadius: 30 // 设置圆角},barWidth: 12}],direction: 'horizontal'}},rankHeight() {this.$nextTick(() => {// 高度变化echars图表的高度也要发生变化this.$refs['RankChart'].resize()})return this.rankNum && this.rankNum.length > 0 ? 38 * this.rankNum.length + 'px' : '0px'}

汇总

示例

在这里插入图片描述

代码

        <!-- 汇总数据趋势图 --><div class="collect"><div class="collect_btn"><el-button size="small" type="info" :class="charType === 1 ? 'btnBgc' : ''" @click="collectChange(1)"> {{ $lang('总包号数量') }}</el-button><el-button size="small" type="info" :class="charType === 3 ? 'btnBgc' : ''" @click="collectChange(3)">{{ $lang('总主单重量') }}</el-button><el-button size="small" type="info" :class="charType === 2 ? 'btnBgc' : ''" @click="collectChange(2)">{{ $lang('总交运重量') }}</el-button></div><v-chart ref="CollectChart" class="collect_chart"  :options="collectOptions" /></div>data(){return {// --------------  2 汇总数据趋势图表数据 ------------collectColumnars: [], // 柱状图数据collectBrokenLines: [], // 折线图数据xAxisDataCollect: [], // x轴数据 = 日期collectMax: null, // 最大值collectMin: null, // 最小值lineMinValue: null, // 折线最小lineMaxValue: null, // 折线最大charType: 1, // 重量类型 1-总包号数量 2-总机场交运重量 3-总主单发运collectData: ['', this.$lang('总包号数量'), this.$lang('总交运重量'), this.$lang('总主单重量')],}}// 汇总数据趋势图collectOptions() {const $this = thisreturn {tooltip: {trigger: 'axis',axisPointer: {type: 'shadow'},// formatter: `{b0} <br> {a0}: {c0}.toLocaleString() <br> {a1}: {c1}%`formatter: function (params) {let value1 = ''let value2 = ''let axisValue = ''params.map((item) => {if (item.componentSubType === 'bar') {axisValue = item.axisValuevalue1 = item.value.toLocaleString()}if (item.componentSubType === 'line') {value2 = item.value}})return axisValue + '<br>' + $this.collectData[$this.charType] + ' : ' + value1 + '<br>' + $this.$lang('环比') + ' : ' + value2 + '%'}},legend: {data: [$this.collectData[$this.charType], this.$lang('环比')]},xAxis: [{type: 'category',data: this.xAxisDataCollect}],yAxis: [{type: 'value',min: 0,max: this.collectMax},{type: 'value',min: this.lineMinValue,max: this.lineMaxValue,axisLabel: {formatter: '{value} %'}}],series: [{name: $this.collectData[$this.charType],type: 'bar',data: this.collectColumnars,label: {show: true,position: 'top',fontSize: 15}},{name: $this.$lang('环比'),type: 'line',yAxisIndex: 1,data: this.collectBrokenLines}]}},

平均时效

示例

在这里插入图片描述

代码

      <!-- 平均时效趋势图 --><div class="average_aging" v-if="isShowAverageAgingChart"><div class="average_aging_title">{{$lang('平均时效(分钟)')}}</div><v-chart ref="AverageAgingChart" class="average_aging_chart" :options="averageAgingOption" /></div>data(){return {// --------------  3 平均时效趋势图表数据 ------------averageAgingColumnars: [], // 柱状图数据averageAgingBrokenLines: [], // 柱状图数据xAxisDataAverageAging: [], // x轴数据 = 日期agingMax: null, // 最大值agingMin: null, // 最小值agingLineMin: null, // 折线最大值agingLineMax: null // 折线最小值}}// 平均时效趋势图averageAgingOption() {const $this = thisreturn {tooltip: {trigger: 'axis',axisPointer: {type: 'shadow'},// formatter: `{b0} <br> {a0}: {c0}(分钟) <br> {a1}: {c1}%`formatter: function (params) {let value1 = ''let value2 = ''let axisValue = ''params.map((item) => {if (item.componentSubType === 'bar') {axisValue = item.axisValuevalue1 = item.value.toLocaleString()}if (item.componentSubType === 'line') {value2 = item.value}})return axisValue + '<br>' + $this.$lang('平均时效') + ' : ' + value1 + $this.$lang('(分钟)') + ' <br>' + $this.$lang('环比') + ' : ' + value2 + '%'}},legend: {data: [this.$lang('平均时效'), this.$lang('环比')]},xAxis: [{type: 'category',data: this.xAxisDataAverageAging}],yAxis: [{type: 'value',min: this.agingMin,max: this.agingMax},{type: 'value',min: this.agingLineMin,max: this.agingLineMax,axisLabel: {formatter: '{value} %'}}],series: [{name: $this.$lang('平均时效'),type: 'bar',data: this.averageAgingColumnars,label: {show: true,position: 'top',fontSize: 15}},{name: $this.$lang('环比'),type: 'line',yAxisIndex: 1,data: this.averageAgingBrokenLines}]}},

全图

在这里插入图片描述

<template><div class="flight-transit-timeAbnormal-all"><avue-crudref="params":data="tableList":option="listOpt":page="page":table-loading="loading"@size-change="sizeChange"@current-change="currentChange"@search-reset="resetList"@search-change="searchChange":summary-method="summaryMethod"@cell-click="cellClick":cell-class-name="cellClassName"><template slot="menuLeft"><el-button size="small" type="info" @click="handleExportExcel()" v-if="hasPower('OUTEXCELALL')"><i class="icon-iconfont iconfont icondaochu1"></i><span>{{ $lang('导出') }}</span></el-button><el-button size="small" v-if="hasPower('EXPORTLOGALL')" type="info" @click="exportLogDisplay = true"><i class="iconfont icon-iconfont icondaochurizhi1"></i><span>{{ $lang('导出日志') }}</span></el-button><!-- 列表模式 + 图表模式 --><el-button size="small" type="info" @click="listModel" v-if="listAndChartShow"><i class="iconfont icon-iconfont iconanniu-shujushuaxin"></i><span>{{ $lang('列表模式') }}</span></el-button><el-button size="small" type="info" @click="chartModel" v-else><i class="iconfont icon-iconfont iconanniu-shujushuaxin"></i><span>{{ $lang('图表模式') }}</span></el-button></template><template slot="timeSearch"><div style="width: 416px"><el-row><el-radio-group v-model="searchForm.queryTimeType"><el-radio :label="1">{{ $lang('实际起飞时间') }}</el-radio><el-radio :label="2">{{ $lang('实际起飞时间(WIB)') }}</el-radio></el-radio-group></el-row><el-date-pickerv-model="searchForm.operateDate"type="daterange"range-separator="—"format="yyyy-MM-dd"value-format="yyyy-MM-dd":clearable="false":start-placeholder="$lang('开始时间')":end-placeholder="$lang('结束时间')"></el-date-picker></div></template><!-- 始发代理区 登录账号非总部禁用始发代理区--><template slot="startRegionCodeNameSearch"><BaseNetWorkNewstyle="width: 250px":query="{ current: 1, size: 100, typeIds: organLevelObj.NT_AGENT_AREA }":dicUrl="'/transportation/tmsSysNetwork/permissionControlQueryNet'":multiple="true":disabled="user.institutionalLevelId !== 22":propObj="searchForm"v-on:update:propObj="searchForm = $event":code="networkKeyValues[0].code":name="networkKeyValues[0].name"/></template><!-- 始发转运中心 登录账号是中心禁用始发转运中心--><template slot="startNetworkNameSearch"><BaseNetWorkNewstyle="width: 250px":query="{ current: 1, size: 100, typeIds: organLevelObj.NT_CENTER }":dicUrl="'/transportation/tmsSysNetwork/permissionControlQueryNet'":multiple="true":disabled="user.institutionalLevelId === 335":propObj="searchForm"v-on:update:propObj="searchForm = $event":code="networkKeyValues[1].code":name="networkKeyValues[1].name"/></template><!-- 异常类型 --><template slot="exFlagsSearch"><el-select v-model="searchForm.exFlags" :placeholder="$lang('请选择')" :multiple="true" style="width:250px" collapse-tags clearable><el-option v-for="temp in DICT.exceptionRegistrationType" :label="temp.label" :value="temp.value" :key="temp.value"></el-option></el-select></template><template slot="searchExtend"><div class="ibank-total-right"><div class="ibank-total-con" v-if="!chartModelShow"><span>{{$lang('汇总项')}}</span><el-checkbox v-model="searchForm.regionCount">{{$lang('始发代理区')}}</el-checkbox><el-checkbox v-model="searchForm.networkCount">{{$lang('始发中心')}}</el-checkbox><el-checkbox v-model="searchForm.exCount">{{$lang('异常类型')}}</el-checkbox></div></div></template></avue-crud><!-- 导出日志 --><DownloadCenter :dialogVisible.sync="exportLogDisplay" :moduleType="313"></DownloadCenter><!-- 图表模式 --><div class="chartBox" v-if="chartModelShow"><!-- 汇总数据展示 --><div class="collect_data"><div class="collect_data_item"><div class="collect_data_text">{{ $lang('平均时效(分钟)') }}</div><div class="collect_data_num">{{ isShowAverageAgingChart ? total.averageTimeLimit : '-' }}</div></div><div class="collect_data_item"><div class="collect_data_text">{{ $lang('总包号') }}</div><div class="collect_data_num">{{ total.pkgNumber }}</div></div><div class="collect_data_item"><div class="collect_data_text">{{ $lang('总主单重量') }}</div><div class="collect_data_num">{{ total.sentWeightNumber }}</div></div><div class="collect_data_item"><div class="collect_data_text">{{ $lang('总交运重量') }}</div><div class="collect_data_num">{{ total.airportSentWeightNumber }}</div></div></div><!-- 排名和汇总数据趋势图 --><div class="middle"><!-- 排名数据趋势图 --><div class="rank"><div class="rank_title"><div class="rank_title_left"><span v-if="rankType === 1">{{ $lang('代理区排名') }}</span><span v-else>{{ $lang('中心排名') }}</span></div><div class="rank_title_right"><el-button size="small" type="info" :class="rankType === 1 ? 'btnBgc' : ''" @click="rankChange(1)">{{ $lang('代理区') }} </el-button><el-button size="small" type="info" :class="rankType !== 1 ? 'btnBgc' : ''" @click="rankChange(2)">{{ $lang('中心') }} </el-button></div></div><div class="rank_table"><el-table ref="table" :data="tableData" :border="false"><el-table-column prop="rank" type="index" :label="$lang('排名')" width="90" header-align="right" align="right"><template slot-scope="{ row }"><div v-if="row.rank < 4"><span class="btnBgc top">Top</span> <span>{{ row.rank }}</span></div><div v-else>{{ row.rank }}</div></template></el-table-column><el-table-column prop="netWorkName" :label="rankType === 1 ? $lang('代理区名称') : $lang('中心名称')" width="140" header-align="center" align="center"><template slot-scope="{ row }">{{ row.netWorkName }} </template></el-table-column><el-table-column :label="$lang('总主单号数量')" header-align="left" align="left"> </el-table-column></el-table><v-chart ref="RankChart" class="rank_chart" :options="rankOptions" :style="{ height: rankHeight,width: rankWidth}" v-if="rankNum" /></div><!-- 分页 --><div class="rank_pages b('pagination')"><el-pagination:page-size="rankPage.size":current-page="rankPage.current"layout="prev, pager, next":total="rankPage.total"@size-change="sizeChangeRank"@current-change="currentChangeRank"></el-pagination></div></div><!-- 汇总数据趋势图 --><div class="collect"><div class="collect_btn"><el-button size="small" type="info" :class="charType === 1 ? 'btnBgc' : ''" @click="collectChange(1)"> {{ $lang('总包号数量') }}</el-button><el-button size="small" type="info" :class="charType === 3 ? 'btnBgc' : ''" @click="collectChange(3)">{{ $lang('总主单重量') }}</el-button><el-button size="small" type="info" :class="charType === 2 ? 'btnBgc' : ''" @click="collectChange(2)">{{ $lang('总交运重量') }}</el-button></div><v-chart ref="CollectChart" class="collect_chart"  :options="collectOptions" /></div></div><!-- 平均时效趋势图 --><div class="average_aging" v-if="isShowAverageAgingChart"><div class="average_aging_title">{{$lang('平均时效(分钟)')}}</div><v-chart ref="AverageAgingChart" class="average_aging_chart" :options="averageAgingOption" /></div></div></div>
</template><script>
import mixin from '@mixins/mixin'
import { FlightTransitTimeAbnormalAll } from './pool.js'
import { RESPONSE_CODE } from '@public/http/config'
import { DICT } from '@/common/utils/dict'
import { TIMEOUT_TIMES } from '@public/utils/const'
import ExportMixin from '@/common/mixin/exportMixin'
import VChart from '@components/base/echarts/index' // 图表
import 'echarts'
import { commonFun } from '@public/utils/common'
import { mapGetters } from 'vuex'
import getNetworkInfo from '@/common/mixin/getNetworkInfo'
const START = ' 00:00:00'
const END = ' 23:59:59'
import debounce from 'lodash/debounce'export default {name: 'FlightTransitTimeAbnormalAll',mixins: [mixin, ExportMixin, getNetworkInfo],components: { VChart },props: {},data() {return {DICT,COM_HTTP: FlightTransitTimeAbnormalAll,tableList: [], // 列表数据page: {sizes: [10, 20, 30, 40, 50, 100, 150, 200]}, // 翻页重写// 查询条件searchForm: {queryCyclical: 1, // 时间维度 按日期/按周期queryTimeType: 1, // 时间类型operateDate: [commonFun.getBeforeDate(6), commonFun.getBeforeDate(0)],startTime: '',endTime: '',exceptionTag: '', // 异常标识exFlags: [], // 异常类型timeType: null, // 时效类型regionCount: true, // 是否展示始发代理区networkCount: true, // 是否展示始发中心exCount: true, // 是否展示异常类型startRegionCode: [],startRegionCodeName: [],startNetworkCode: [],startNetworkName: []},// 分页的显示隐藏paginationShow: true,// 图表的显示隐藏chartModelShow: false,// 按钮的显示隐藏listAndChartShow: false,// 汇总数据total: {},networkKeyValues: [// 网点编码与名称字段对应值{ name: 'startRegionCodeName', code: 'startRegionCode' },{ name: 'startNetworkName', code: 'startNetworkCode' }],queryCyclicalType: 1, // 周期和日期isShowFirst: false,// *************************************** 图表模式 *************************************** //// --------------  1 排名数据趋势图表数据 ------------// 1 图表数据tableData: [], // table数据rankNum: [], // 图表数据// rank图表rankType: 1, // 排行类型 1-代理区 2-中心rankPage: {size: 10,current: 1,total: 0}, // 翻页信息// --------------  2 汇总数据趋势图表数据 ------------collectColumnars: [], // 柱状图数据collectBrokenLines: [], // 折线图数据xAxisDataCollect: [], // x轴数据 = 日期collectMax: null, // 最大值collectMin: null, // 最小值lineMinValue: null, // 折线最小lineMaxValue: null, // 折线最大charType: 1, // 重量类型 1-总包号数量 2-总机场交运重量 3-总主单发运collectData: ['', this.$lang('总包号数量'), this.$lang('总交运重量'), this.$lang('总主单重量')],// --------------  3 平均时效趋势图表数据 ------------averageAgingColumnars: [], // 柱状图数据averageAgingBrokenLines: [], // 柱状图数据xAxisDataAverageAging: [], // x轴数据 = 日期agingMax: null, // 最大值agingMin: null, // 最小值agingLineMin: null, // 折线最大值agingLineMax: null // 折线最小值}},computed: {// 用户信息...mapGetters({ token: 'token', lang: 'lang', user: 'user' }),listOpt() {const $this = thisreturn {menu: false,header: true,showSummary: true,fixHeight: 50,pagination: this.paginationShow,column: [// 查询{prop: 'queryCyclical',label: '时间维度',search: true,hide: true,type: 'select',dicData: DICT.airTimeDimension,editable: false,searchClearable: false,searchDefault: 1,hasAll: false,change(val) {$this.$refs.params.searchForm.queryCyclical = val.value}},{prop: 'dayTime',label: '日期',hide: $this.searchForm.queryCyclical === 2},{prop: 'dayTimeWeek',label: '日期',hide: $this.searchForm.queryCyclical === 1},{prop: 'time',label: '',search: true,hide: true,searchslot: true,editable: false},{label: '始发代理区',prop: 'startRegionCodeName',hide: !$this.searchForm.regionCount,search: true,remote: true,searchslot: true},{label: '始发转运中心',prop: 'startNetworkName',search: true,hide: !$this.searchForm.networkCount,searchslot: true},{prop: 'exceptionTag',label: '异常标识',search: true,hide: true,type: 'select',dicData: DICT.exceptionTagList,change(val) {if (val.value) {$this.searchForm.exceptionTag = val.value} else {$this.searchForm.exceptionTag = ''}$this.$refs.params.searchForm.exFlags = []$this.searchForm.exFlags = []}},{prop: 'exFlags',label: '异常类型',search: $this.searchForm.exceptionTag === 'Y',searchslot: true,hide: true},{prop: 'exFlags',label: '异常类型',hide: !$this.searchForm.exCount,type: 'select',dicData: DICT.exceptionRegistrationType,formatter: (row, value, label, column) => {if (row.exFlags) {return row.exFlags.map((item) => {return $this._dictFilter(item, DICT.exceptionRegistrationType)}).join(',')}}},{prop: 'timeType',label: '时效类型',search: true,hide: true,type: 'select',dicData: DICT.airTimeTypeList,change(val) {$this.searchForm.timeType = val.value$this.$refs.params.searchForm.timeType = val.value}},{label: '总主单号数量',prop: 'mainShipmentNumber'},{label: '总包号数量',prop: 'pkgNumber'},{label: '总主单发运重量',prop: 'sentWeightNumber'},{label: '总机场交运重量',prop: 'airportSentWeightNumber'},{label: '平均时效(分钟)',prop: 'averageTimeLimit',hide: !$this.searchForm.timeType}]}},// 排名数据趋势图rankOptions() {return {tooltip: {trigger: 'axis',axisPointer: {type: 'shadow'}},grid: {top: 5,left: 0,bottom: 0,backgroundColor: 'transparent'},xAxis: {show: false,splitNumber: 15,interval: 25},yAxis: {type: 'category',show: false},series: [{type: 'bar',data: this.rankNum,showBackground: true,backgroundStyle: {color: '#ccc'},label: {show: true,position: 'right'},itemStyle: {barBorderRadius: 30 // 设置圆角},barWidth: 12}],direction: 'horizontal'}},// 汇总数据趋势图collectOptions() {const $this = thisreturn {tooltip: {trigger: 'axis',axisPointer: {type: 'shadow'},// formatter: `{b0} <br> {a0}: {c0}.toLocaleString() <br> {a1}: {c1}%`formatter: function (params) {let value1 = ''let value2 = ''let axisValue = ''params.map((item) => {if (item.componentSubType === 'bar') {axisValue = item.axisValuevalue1 = item.value.toLocaleString()}if (item.componentSubType === 'line') {value2 = item.value}})return axisValue + '<br>' + $this.collectData[$this.charType] + ' : ' + value1 + '<br>' + $this.$lang('环比') + ' : ' + value2 + '%'}},legend: {data: [$this.collectData[$this.charType], this.$lang('环比')]},xAxis: [{type: 'category',data: this.xAxisDataCollect}],yAxis: [{type: 'value',min: 0,max: this.collectMax},{type: 'value',min: this.lineMinValue,max: this.lineMaxValue,axisLabel: {formatter: '{value} %'}}],series: [{name: $this.collectData[$this.charType],type: 'bar',data: this.collectColumnars,label: {show: true,position: 'top',fontSize: 15}},{name: $this.$lang('环比'),type: 'line',yAxisIndex: 1,data: this.collectBrokenLines}]}},// 平均时效趋势图averageAgingOption() {const $this = thisreturn {tooltip: {trigger: 'axis',axisPointer: {type: 'shadow'},// formatter: `{b0} <br> {a0}: {c0}(分钟) <br> {a1}: {c1}%`formatter: function (params) {let value1 = ''let value2 = ''let axisValue = ''params.map((item) => {if (item.componentSubType === 'bar') {axisValue = item.axisValuevalue1 = item.value.toLocaleString()}if (item.componentSubType === 'line') {value2 = item.value}})return axisValue + '<br>' + $this.$lang('平均时效') + ' : ' + value1 + $this.$lang('(分钟)') + ' <br>' + $this.$lang('环比') + ' : ' + value2 + '%'}},legend: {data: [this.$lang('平均时效'), this.$lang('环比')]},xAxis: [{type: 'category',data: this.xAxisDataAverageAging}],yAxis: [{type: 'value',min: this.agingMin,max: this.agingMax},{type: 'value',min: this.agingLineMin,max: this.agingLineMax,axisLabel: {formatter: '{value} %'}}],series: [{name: $this.$lang('平均时效'),type: 'bar',data: this.averageAgingColumnars,label: {show: true,position: 'top',fontSize: 15}},{name: $this.$lang('环比'),type: 'line',yAxisIndex: 1,data: this.averageAgingBrokenLines}]}},// 平均时效趋势图是否展示isShowAverageAgingChart() {return !!this.searchForm.timeType},rankHeight() {this.$nextTick(() => {// 高度变化echars图表的高度也要发生变化this.$refs['RankChart'].resize()})return this.rankNum && this.rankNum.length > 0 ? 38 * this.rankNum.length + 'px' : '0px'}},created() {},mounted() {this.init()window.addEventListener('resize', debounce(this.resizeChart, 100));},methods: {/** ******************************* 列表按钮请求 ***************************************** */async init() {console.log('init', this.user)let obj = {}// 账号信息 22=总部 334=代理区 335=中心 336=网点 institutionalLevelIdconst { networkCode, networkName, institutionalLevelId } = this.user// 总部无默认值,支持编辑代理区以及中心if (institutionalLevelId === 22) {obj = { startNetworkCode: [], startNetworkName: [], startRegionCode: [], startRegionCodeName: [] }} else {// 登录级别为代理区 默认代理区的值禁止编辑代理区if (institutionalLevelId === 334) {obj = { startNetworkCode: [], startNetworkName: [], startRegionCode: [networkCode], startRegionCodeName: [networkName] }} else {// 登录级别为中心/网点 默认代理区和中心的值禁止编辑代理区和中心 networkCodeconst { agentNetwork, centNetwork } = await this._getAgentInfoByNetworkCode(networkCode)if (agentNetwork || centNetwork) {obj = { startNetworkCode: centNetwork ? [centNetwork.code] : [], startNetworkName: centNetwork ? [centNetwork.name] : [],startRegionCode: agentNetwork ? [agentNetwork.code] : [], startRegionCodeName: agentNetwork ? [agentNetwork.name] : [] }}}}Object.assign(this.searchForm, obj)this.searchFun()},// 新增参数setSearchParams(params) {const obj = {}const { queryTimeType, operateDate, regionCount, networkCount, exCount, exFlags, exceptionTag } = this.searchFormconst { queryCyclical } = this.$refs.params.searchFormconst startTime = operateDate[0] + STARTconst endTime = operateDate[1] + ENDObject.assign(this.$refs.params.searchForm, { queryTimeType, startTime, endTime, operateDate, regionCount, networkCount, exCount, exFlags, exceptionTag, queryCyclical })const nParams = {}this.networkKeyValues.forEach((item) => {const { name, code } = itemconst valCode = this.searchForm[code]const valName = this.searchForm[name]nParams[code] = valCode || ''nParams[name] = valName || ''obj[code] = undefinedif (valCode || (Array.isArray(valCode) && valCode.length > 0)) {obj[code] = valCode}})Object.assign(obj, { queryTimeType, startTime, endTime, operateDate, regionCount, networkCount, exCount, exFlags, exceptionTag, ...nParams })return obj},// 清空resetList() {const searchForm = {queryCyclical: 1, // 时间维度 按日期/按周期queryTimeType: 1, // 时间类型operateDate: [commonFun.getBeforeDate(6), commonFun.getBeforeDate(0)],startTime: '',endTime: '',exceptionTag: '', // 异常标识exFlags: [], // 异常类型timeType: null, // 时效类型regionCount: true, // 是否展示始发代理区networkCount: true, // 是否展示始发中心exCount: true, // 是否展示异常类型startRegionCode: [],startRegionCodeName: [],startNetworkCode: [],startNetworkName: []}Object.assign(this.searchForm, searchForm)this.init()},// 查询方法async searchFun(params, current) {console.log('searchFun')this.loading = trueif (typeof this.searchFunBefore === 'function') {const state = this.searchFunBefore()if (!state) {this.loading = falsereturn}}// avue-crud的ref名称是paramsif (!params && this.$refs.hasOwnProperty('params')) {params = this.rangHandle(this.$refs.params.searchForm)}// 传入参数有currentif (current) {this.page.current = current}const param = JSON.parse(JSON.stringify(this.searchFunParamsHandle(params)))if (param === false) {this.loading = falsereturn}// 添加超时清除loading状态的定时器const timeState = setTimeout(() => {if (this.loading) this.loading = false}, TIMEOUT_TIMES)setTimeout(() => {this.getSummaryData(param) // 合计请求}, 30)setTimeout(() => {this.getRankData(param) // 排行图表请求}, 30)setTimeout(() => {this.getCollectData(param) // 汇总数据趋势图请求}, 30)setTimeout(() => {param.timeType && this.getAverageAging(param) // 平均时效趋势图请求}, 30)try {console.log('util/mixin.searchFun::params', param)const res = await this.COM_HTTP.reqList(param)// 清除超时定时器clearTimeout(timeState)this.loading = falsethis.pageLoading = falseif (res.code === RESPONSE_CODE.SUCCESS) {if (this.usePagination) {this.tableList = res.data.records ? (this.formatList ? this.formatList(res.data) : res.data.records) : []this.page.total = res.data.total || 0this.page.current = res.data.current || 1} else {this.tableList = this.formatList ? this.formatList(res.data) : res.data || []}this.searchAfterFun()} else {this.$message.error(res.msg)this.tableList = []}} catch (error) {console.error('searchFun::error', error)// 清除超时定时器clearTimeout(timeState)this.loading = falsethis.pageLoading = false}},searchAfterFun() {console.log('searchAfterFun', this.$refs.params.searchForm.queryCyclical)this.searchForm.queryCyclical = this.$refs.params.searchForm.queryCyclical},// 合计summaryMethod({ columns, data }) {const sums = []const arr = ['startRegionCodeName', 'startNetworkName', 'exFlags', 'dayTime', 'dayTimeWeek']columns.forEach((column, index) => {// 1 合计if (index === 0) {sums[index] = this.$lang('合计')return}// 3 有值if (arr.includes(column.property)) {sums[index] = '--'} else {sums[index] = this.total && this.total[column['property']]}})return sums},cellClassName({ row, column, rowIndex, columnIndex }) {if (column.property === 'mainShipmentNumber') {return 'cell-blue-gao view-link'}},cellClick(row, column, cell, event) {if (column.property === 'mainShipmentNumber') {const { queryTimeType, queryCyclical } = this.$refs.params.searchFormconst { startNetworkCode: startNetworkCodeSearch, startNetworkName: startNetworkNameSearch, startRegionCode: startRegionCodeSearch, startRegionCodeName: startRegionCodeNameSearch, exFlags: exFlagsSearch, exceptionTag: exceptionTagSearch } = this.searchFormconst { startNetworkCode, startNetworkName, startRegionCode, startRegionCodeName, exFlags, dayTime, dayTimeWeek } = rowconst operateDate = queryCyclical === 1 ? [dayTime, dayTime] : [dayTimeWeek.slice(0, 10), dayTimeWeek.slice(-10)]const params = { queryTimeType, operateDate }if (startRegionCode && startRegionCodeName) {Object.assign(params, { startRegionCode: [startRegionCode], startRegionCodeName: [startRegionCodeName] })} else {Object.assign(params, { startRegionCode: startRegionCodeSearch || [], startRegionCodeName: startRegionCodeNameSearch || [] })}if (startNetworkCode && startNetworkName) {Object.assign(params, { startNetworkCode: [startNetworkCode], startNetworkName: [startNetworkName] })} else {Object.assign(params, { startNetworkCode: startNetworkCodeSearch || [], startNetworkName: startNetworkNameSearch || [] })}//  如果汇总勾选了异常类型,点击数据异常类型有值'Y';无值'N'if (this.searchForm.exCount) {Object.assign(params, { exceptionTag: (exFlags ? 'Y' : 'N'), exFlags: exFlags || exFlagsSearch || [] })} else {Object.assign(params, { exceptionTag: exceptionTagSearch || '', exFlags: exFlags || exFlagsSearch || [] })}this.$emit('toMainBillAll', params)}},// 1 列表模式listModel() {document.querySelector('.flight-transit-timeAbnormal-all .el-table').style.display = 'block'this.paginationShow = truethis.chartModelShow = falsethis.listAndChartShow = falsethis.searchForm.regionCount = truethis.searchForm.networkCount = truethis.searchForm.exCount = true},// 2 图表模式chartModel() {document.querySelector('.flight-transit-timeAbnormal-all .el-table').style.display = 'none'this.paginationShow = falsethis.chartModelShow = truethis.listAndChartShow = trueconsole.log(this.collectData[this.charType])},_dictFilter(v, dict) {return (dict.find((item) => item.value + '' === v + '') || {}).label},/** ******************************* 图标请求 ***************************************** */// 3  图表数据// 3.1  图表以及列表汇总数据async getSummaryData(params) {console.log('getSummaryData', params)try {const { code, data, msg } = await this.COM_HTTP.reqSummary(params)if (code === RESPONSE_CODE.SUCCESS) {if (data) {Object.entries(data).forEach(([key, value]) => {data[key] = value ? Number(value).toLocaleString() : value})this.total = data || {}} else {this.total = {}}} else {this.$message.error(this.$lang(msg))}} catch (e) {console.log(e)}},// 3.2  排名数据趋势数据async getRankData(params) {console.log('getRankData11111', this.$refs.params.searchForm)try {const param = params? { ...params, ...this.rankPage, ...{ rankType: this.rankType }}: { ...this.$refs.params.searchForm, ...this.rankPage, ...{ rankType: this.rankType }}delete param.regionCountdelete param.networkCountdelete param.exCountconsole.log('getRankData222', param)const { code, data, msg } = await this.COM_HTTP.reqRankChart(param)if (code === RESPONSE_CODE.SUCCESS) {this.rankNum = []this.tableData = data.records || []this.rankPage.total = data.total || 0this.rankPage.current = data.current || 1this.tableData &&this.tableData.length > 0 &&this.tableData.map((item) => {this.rankNum.unshift(item.mainShipmentNumber)})console.log(this.rankNum)} else {this.$message.error(this.$lang(msg))}} catch (e) {console.log(e)}},resizeChart() {this.$refs['RankChart'].resize()},// 3.3  汇总趋势数据async getCollectData(params) {try {const param = params ? { ...params, ...{ charType: this.charType }} : { ...this.$refs.params.searchForm, ...{ charType: this.charType }}delete param.regionCountdelete param.networkCountdelete param.exCountconst { code, data, msg } = await this.COM_HTTP.reqCollectChart(param)if (code === RESPONSE_CODE.SUCCESS) {this.xAxisDataCollect = []this.collectColumnars = []this.collectBrokenLines = []if (data) {// 柱状图data.columnars &&data.columnars.forEach((v) => {this.collectColumnars.push(v.countNumber)this.xAxisDataCollect.push(v.dayTime)})// 折线图data.brokenLines &&data.brokenLines.forEach((v) => {this.collectBrokenLines.push(v.ratio)})this.collectMax = data.maxValuethis.collectMin = data.minValuethis.lineMinValue = data.lineMinValuethis.lineMaxValue = data.lineMaxValue}} else {this.$message.error(this.$lang(msg))}} catch (e) {console.log(e)}},// 3.4  平均时效趋势数据async getAverageAging(params) {try {const param = { ...params }delete param.regionCountdelete param.networkCountdelete param.exCountconst { code, data, msg } = await this.COM_HTTP.reqTimeChart(param)if (code === RESPONSE_CODE.SUCCESS) {this.xAxisDataAverageAging = []this.averageAgingColumnars = []this.averageAgingBrokenLines = []if (data) {// 柱状图data.columnars &&data.columnars.forEach((v) => {this.averageAgingColumnars.push(v.countNumber)this.xAxisDataAverageAging.push(v.dayTime)})// 折线图data.brokenLines &&data.brokenLines.forEach((v) => {this.averageAgingBrokenLines.push(v.ratio)})this.agingMax = data.maxValuethis.agingMin = data.minValuethis.agingLineMin = data.lineMinValuethis.agingLineMax = data.lineMaxValue}} else {this.$message.error(this.$lang(msg))}} catch (e) {console.log(e)}},// 页码修改sizeChangeRank(val) {this.rankPage.current = 1this.rankPage.size = valthis.getRankData()},// 跳转到当前页currentChangeRank(val) {this.rankPage.current = valthis.getRankData()},// 排行类型 1-代理区 2-中心rankChange(val) {this.rankType = valthis.getRankData()},// 汇总数据趋势图 重量类型 1-总包号数量 2-总机场交运重量 3-总主单发运collectChange(val) {this.charType = valthis.getCollectData()}},beforeDestroy() {window.removeEventListener('resize', this.resizeChart);}
}
</script><style lang="scss">
.flight-transit-timeAbnormal-all {width: 100%;height: 100%;padding-left: 0px;padding-top: 0px;// 图标模式.chartBox {width: 99%;// height: 500px;margin: 0 auto;// margin-top: 20px;padding-top: 20px;// 汇总.collect_data {display: flex;align-items: center;justify-items: center;font-weight: 600;color: #e60012;width: 100%;border: 1px solid #ccc;height: 160px;.collect_data_item {flex: 1;height: 160px;line-height: 70px;text-align: center;border-right: 1px solid #ccc;// padding-left: 60px;&:nth-last-child(1) {border-right: none;}.collect_data_text {font-size: 20px;}.collect_data_num {font-size: 45px;}}}// 中间2个图标.middle {width: 100%;// height: 400px;margin-top: 20px;display: flex;// 排名.rank {width: 35%;border: 1px solid #ccc;position: relative;.rank_title {display: flex;justify-content: space-between;align-items: center;border-bottom: 1px solid #ccc;padding: 10px;.rank_title_right {.el-button {margin-left: 0 !important;}}}.rank_table {width: 100%;max-height: 420px;position: relative;.el-table__header {th {background-color: #fff;}}td,th.is-leaf {border-bottom: none !important;}.rank_chart {width: 40%;min-width: 150px;position: absolute;top: 33px;left: 240px;}}.rank_pages {height: 30px;display: flex;justify-content: center;margin-top: 10px;position: absolute;bottom: 10px;left: 38%;}}.collect {width: 65%;height: 525px;margin-left: 15px;border: 1px solid #ccc;.collect_btn {display: flex;justify-content: flex-end;align-items: center;border-bottom: 1px solid #ccc;padding: 10px;.el-button {margin-left: 0 !important;}}.collect_chart {width: 100%;margin: 0 auto;margin-top: 30px;}}}.average_aging {border: 1px solid #ccc;margin-top: 20px;.average_aging_title {border-bottom: 1px solid #ccc;padding: 10px;}.average_aging_chart {width: 90%;height: 500px;margin: 0 auto;margin-top: 30px;}}}.cell-pointer {cursor: pointer;}.avue-crud__search{.el-form-item:first-of-type{width: 110px!important;// height: 10px !important;}}
}
.cell-blue-gao {cursor: pointer;.cell span {@include text-color('brand');}
}
.btnBgc {background-color: #e60012 !important;color: #fff !important;
}
.el-pager li.active {color: #e60012 !important;
}
.el-pager li:hover {color: #e60012 !important;
}
.top {border-radius: 24px;padding: 1px 4px;margin-right: 3px;display: inline-block;width: 26px;font-size: 11px;text-align: center;
}
.ibank-total-right{margin-bottom: 8px;line-height: 32px;
}
</style>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/883745.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【04】RabbitMQ的集群机制

1、RabbitMQ的性能监控 关于RabbitMQ的性能监控&#xff0c;在管理控制台中提供了非常丰富的展示。例如&#xff1a;首页这个整体监控页面&#xff0c;就展示了非常多详细的信息&#xff1a; 还包括消息的生产消费频率、关键组件的使用情况等等非常多的消息。都可以在这个管理…

Segugio:一款针对恶意软件的进程执行跟踪与安全分析工具

关于Segugio Segugio是一款功能强大的恶意软件安全分析工具&#xff0c;该工具允许我们轻松分析恶意软件执行的关键步骤&#xff0c;并对其进行跟踪分析和安全审计。 Segugio允许执行和跟踪恶意软件感染过程中的关键步骤&#xff0c;其中包括从点击第一阶段到提取恶意软件的最…

YOLO-FaceV2:A Scale and Occlusion Aware Face Detector

摘要 近年来&#xff0c;基于深度学习的人脸检测算法取得了巨大进展。这些算法一般可以分为两类&#xff0c;即像Faster R-CNN这样的两阶段检测器和像YOLO这样的一阶段检测器。由于一阶段检测器在精度和速度之间取得了更好的平衡&#xff0c;因此已被广泛应用于多种场景。在本…

贪心算法与盛雨水问题

啥是盛雨水问题&#xff1f;给个图就熟悉了 欸&#xff1f; 这其中的关键在于&#xff1a; 1. 容量2D化就是长 * 宽 2. 木桶效应&#xff1a;宽取决于短板。 那我们来分析&#xff0c;怎么样能达到最佳的结果呢&#xff1f;穷举一下所有可能性不就好了&#xff1f;每两个板子…

OAK相机的RGB-D彩色相机去畸变做对齐

▌低畸变标准镜头的OAK相机RGB-D对齐的方法 OAK相机内置的RGB-D管道会自动将深度图和RGB图对齐。其思想是将深度图像中的每个像素与彩色图像中对应的相应像素对齐。产生的RGB-D图像可以用于OAK内置的图像识别模型将识别到的2D物体自动映射到三维空间中去&#xff0c;或者产生的…

Information Theoretical Estimators (ITE) Toolbox的使用(MATLAB)

Information Theoretical Estimators (ITE) Toolbox是什么 官方文档&#xff1a; ITE is can estimate several entropy, mutual information, divergence, association measures, cross quantities and kernels on distributions. Thanks to its highly modular design, ITE …

STM32G474硬件CRC16和软件CRC16校验

1、硬件CRC校验和软件CRC校验的多项式&#xff0c;以及初始值 #define CRC_Hardware_POLYNOMIAL_16B 0x8005 //硬件CRC多项式为0x8005 //CRC16x^16 x^15 x^2 1&#xff0c;因为bit151,bit21,bit01&#xff0c;所以正向校验的多项式的值为0x8005 //CRC校验分为正向校验和反…

UWA Gears:Frame Capture模式 - 着色器查看器

UWA Gears 是UWA最新发布的无SDK性能分析工具。针对移动平台&#xff0c;提供了实时监测和截帧分析功能&#xff0c;帮助您精准定位性能热点&#xff0c;提升应用的整体表现。 在上周的文章中&#xff0c;我们详细介绍了网格查看器的功能&#xff0c;介绍如何通过网格数据优化…

微服务电商平台课程三:基础环境搭建

后端基础环境 工具版本号功能说明下载JDK1.8java编译运行的基本环境Java Downloads | Oracledocker27.0.3容器化部署Windows | Docker Docsgit2.46.2代码版本管理&#xff0c;多人协作代码开发Git for Windowsmaven3.9.9服务的依赖管理Maven – Download Apache MavenMySQL5.7…

第十四章 章节练习echarts饼图渲染

目录 一、引言 二、完整代码 三、总结 一、引言 通过前面几个章节的学习&#xff0c;再结合日常项目中经常会使用到的echarts图&#xff0c;来完整以下功能需求&#xff0c;增强对知识点的巩固&#xff1a; 1. 基本渲染 2. 添加功能 3. 删除功能 4. 饼图渲染 运行效果图…

厨艺爱好者的在线互动平台:Spring Boot实现

摘 要 使用旧方法对厨艺交流信息进行系统化管理已经不再让人们信赖了&#xff0c;把现在的网络信息技术运用在厨艺交流信息的管理上面可以解决许多信息管理上面的难题&#xff0c;比如处理数据时间很长&#xff0c;数据存在错误不能及时纠正等问题。 这次开发的厨艺交流平台功能…

WUP-MY-POS-PRINTER 旻佑热敏打印机票据打印uniapp插件使用说明

插件地址&#xff1a;WUP-MY-POS-PRINTER 旻佑热敏打印机票据打印安卓库 简介 本插件主要用于旻佑热敏打印机打印票据&#xff0c;不支持标签打印。适用于旻佑的各型支持票据打印的热敏打印机。本插件开发时使用的打印机型号为MY-805嵌入式面板打印机&#xff0c;其他型号请先…

2006-2023年各地级市债务余额数据

2006-2023年各地级市债务余额数据 1、时间&#xff1a;2006-2023年 2、来源&#xff1a;整理自wind 3、指标&#xff1a;地区、地方政府债-债券数量(只)、地方政府债-债券余额(亿)、地方政府债-债券余额占比(%)、城投债-债券数量(只)、城投债-债券余额(亿)、城投债-债券余额…

CentOS7安装Docker-2024

CentOS7安装Docker-2024 安装 更新yum仓库&#xff1a; yum -y update安装yum-utils并配置阿里云的docker仓库和相关插件&#xff1a; sudo yum install -y yum-utilsyum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repoyum i…

121.WEB渗透测试-信息收集-ARL(12)

免责声明&#xff1a;内容仅供学习参考&#xff0c;请合法利用知识&#xff0c;禁止进行违法犯罪活动&#xff01; 内容参考于&#xff1a; 易锦网校会员专享课 上一个内容&#xff1a;120.WEB渗透测试-信息收集-ARL&#xff08;11&#xff09; 点击管理控制台 连接成功&…

Java | Leetcode Java题解之第513题找树左下角的值

题目&#xff1a; 题解&#xff1a; class Solution {public int findBottomLeftValue(TreeNode root) {int ret 0;Queue<TreeNode> queue new ArrayDeque<TreeNode>();queue.offer(root);while (!queue.isEmpty()) {TreeNode p queue.poll();if (p.right ! nu…

w005基于Springboot学生心理咨询评估系统

&#x1f64a;作者简介&#xff1a;拥有多年开发工作经验&#xff0c;分享技术代码帮助学生学习&#xff0c;独立完成自己的项目或者毕业设计。 代码可以私聊博主获取。&#x1f339;赠送计算机毕业设计600个选题excel文件&#xff0c;帮助大学选题。赠送开题报告模板&#xff…

SpringCloud接入nacos配置中心

这里写自定义目录标题 版本选择项目搭建pom.xml本地的 application.ymlchenfu-miniapp-dev.yml 中的配置项接收配置的实体类 版本选择 spring-cloud-Alibaba版本依赖关系 本文章&#xff0c;采用的 springboot 版本是 2.6.13&#xff0c;spring-cloud-alibaba 版本是 2021.0.5…

(二十二)、k8s 中的关键概念

文章目录 1、总体概览2、第一层&#xff1a;物理机、集群、Node、Pod 之间的关系2、第二层&#xff1a;命名空间 Namespace3、定义4、控制平面&#xff08;Control Plane&#xff09;5、特别的概念 Service6、Deployment 经过 之前几篇文章对 k8s 的实践&#xff0c;结合实践&…

AI模型库 : 下一个大型供应链攻击目标

像 Hugging Face 这样的AI模型平台&#xff0c;很容易受到攻击者多年来通过 npm、PyPI 和其他开源存储库成功执行的同类攻击的影响 Hugging Face 等AI模型存储库为攻击者提供了与 npm 和 PyPI 等开源公共存储库相同的将恶意代码植入开发环境的机会。 在今年 4 月即将举行的 Bl…