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.rhkb.cn/news/459377.html

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

相关文章

OpenCV视觉分析之目标跟踪(4)目标跟踪类TrackerDaSiamRPN的使用

操作系统&#xff1a;ubuntu22.04 OpenCV版本&#xff1a;OpenCV4.9 IDE:Visual Studio Code 编程语言&#xff1a;C11 算法描述 cv::TrackerDaSiamRPN 是 OpenCV 中用于目标跟踪的一个类&#xff0c;它实现了 DaSiam RPN&#xff08;Deformable Siamese Region Proposal Net…

量化交易打怪升级全攻略

上钟&#xff01; 继续分享量化干货~ 这次要唠的是Stat Arb的新作《Quant Roadmap》(中译名《量化交易路线图》)&#xff0c;为了方便&#xff0c;下文就称呼作者为“老S”&#xff0c;根据公开资料显示&#xff0c;他可是正儿八经的的量化研究员出身&#xff0c;在漂亮国头部对…

Docker 镜像下载问题及解决办法

Docker 镜像下载问题及解决办法 我在杂乱的、破旧的村庄寂寞地走过漫长的雨季&#xff0c;将我年少的眼光从晦暗的日子里打捞出来的是一棵棵开花的树&#xff0c;它们以一串串卓然不俗的花擦明了我的眼睛&#xff0c;也洗净了我的灵魂。 引言 在使用 Docker 时&#xff0c;用户…

Vue脚手架

Vue Cli脚手架使用 一、通过一个脚手架创建一个新项目 ​ 可以使用VScode的终端操作&#xff0c;但必须给一个管理员权限 1、创建&#xff08;两种方法&#xff09; vue create 项目名vue ui&#xff08;UI是user interface–图形化界面的创建方式&#xff0c;在图形化界面…

[含文档+PPT+源码等]精品基于PHP实现的培训机构信息管理系统的设计与实现

基于PHP实现的培训机构信息管理系统的设计与实现背景&#xff0c;可以从以下几个方面进行阐述&#xff1a; 一、社会发展与教育需求 随着经济的不断发展和人口数量的增加&#xff0c;教育培训行业迎来了前所未有的发展机遇。家长对子女教育的重视程度日益提高&#xff0c;课外…

智能防泄密:源代码保护的创新选择

在数字化时代&#xff0c;数据安全和源代码保护已成为企业关注的焦点。源代码不仅是企业的核心资产&#xff0c;更是企业创新能力和技术实力的体现。一旦源代码泄露&#xff0c;企业可能面临严重的商业损失和法律风险。因此&#xff0c;如何有效地保护源代码&#xff0c;防止泄…

卡方检验方法概述与类型——四格表和R*C表卡方检验案例

卡方检验是以卡方分布为基础&#xff0c;针对定类数据资料的常用假设检验方法。其理论思想是判断实际观测到的频数与有关总体的理论频数是否一致。 卡方统计量是实际频数与理论频数吻合程度的指标。卡方值越小&#xff0c;表明实际观察频数与理论频数越接近&#xff0c;反之卡…

H7-TOOL的LUA小程序教程第16期:脉冲测量,4路PWM,多路GPIO和波形打印(2024-10-25, 更新完毕)

LUA脚本的好处是用户可以根据自己注册的一批API&#xff08;当前TOOL已经提供了几百个函数供大家使用&#xff09;&#xff0c;实现各种小程序&#xff0c;不再限制Flash里面已经下载的程序&#xff0c;就跟手机安装APP差不多&#xff0c;所以在H7-TOOL里面被广泛使用&#xff…

JS轮播图实现自动轮播、悬浮停止轮播、点击切换,下方指示器与图片联动效果

代码&#xff1a; <!DOCTYPE html> <html lang"zh-CN"> <head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><title>Document</title><s…

【学术会议论文投稿】大数据治理:解锁数据价值,引领未来创新

第六届国际科技创新学术交流大会&#xff08;IAECST 2024&#xff09;_艾思科蓝_学术一站式服务平台 更多学术会议请看&#xff1a;https://ais.cn/u/nuyAF3 目录 引言 一、大数据治理的定义 二、大数据治理的重要性 三、大数据治理的核心组件 四、大数据治理的实践案例…

w外链如何跳转微信小程序

要创建外链跳转微信小程序&#xff0c;主要有以下几种方法&#xff1a; 使用第三方工具生成跳转链接&#xff1a; 注册并登录第三方外链平台&#xff1a;例如 “W外链” 等工具。前往该平台的官方网站&#xff0c;使用手机号、邮箱等方式进行注册并登录账号。选择创建小程序外…

记一次靶场的文件上传

刚开始一个上传的页面&#xff0c;尝试了txt,png,ppt,php,这些常见的后缀文件发现都能上传成功&#xff0c;并且页面一点回显都没有&#xff0c;自己都不知道是被过滤了什么类型的文件&#xff0c; 后面不经意间打开了自己的证件照&#xff0c;是jpg格式的&#xff0c;于是尝试…

EPLAN中绘制PLC盒子时如何切换不同品牌PLC的IO地址?

EPLAN中绘制PLC盒子时如何切换不同品牌PLC的IO地址? 如下图所示,我这里需要绘制一个三菱的PLC盒子,但是我在插入PLC数字输入点时,该点位的地址却显示是西门子PLC的地址I0.0,那么如何将其修改为三菱PLC的地址呢? 如下图所示,找到选项-----设置, 如下图所示,找到项目---…

【银河麒麟高级服务器操作系统·实例分享】裸金属服务器开机失败分析及处理建议

了解更多银河麒麟操作系统全新产品&#xff0c;请点击访问 麒麟软件产品专区&#xff1a;https://product.kylinos.cn 开发者专区&#xff1a;https://developer.kylinos.cn 文档中心&#xff1a;https://documentkylinos.cn 现象描述 裸金属物理服务器开机卡在EFI stub页面…

2024年【焊工(中级)】最新解析及焊工(中级)考试总结

题库来源&#xff1a;安全生产模拟考试一点通公众号小程序 焊工&#xff08;中级&#xff09;最新解析参考答案及焊工&#xff08;中级&#xff09;考试试题解析是安全生产模拟考试一点通题库老师及焊工&#xff08;中级&#xff09;操作证已考过的学员汇总&#xff0c;相对有…

汽车IVI中控OS Linux driver开发实操(二十六):i.MX图形库

概述: 下表列出了整个GPU系列,在i.MX 6板上,只有6Quad和6QuadPlus支持OpenCL。表中还显示了OpenCL的关键性能指标GFLOPS的理论数量。一些基准测试,如Clpeak,可用于验证它。 i.MX G2D API G2D应用程序编程接口(API)设计为易于理解和使用2DBit blit(BLT)功能。它允许用…

【算法】Kruskal最小生成树算法

目录 一、最小生成树 二、Kruskal算法求最小生成树 三、代码 一、最小生成树 什么是最小生成树&#xff1f; 对于一个n个节点的带权图&#xff0c;从中选出n-1条边&#xff08;保持每个节点的联通&#xff09;构成一棵树&#xff08;不能带环&#xff09;&#xff0c;使得…

apisix的原理及作用,跟spring cloud gateway有什么区别?

apache APISIX 是一个高性能、可扩展的开源 API 网关&#xff0c;它主要用于处理 API 请求、流量管理、安全控制和服务治理。APISIX 可以将复杂的服务架构中的不同服务通过统一的网关来进行管理和监控&#xff0c;为微服务架构提供了便捷的流量入口管理方式。 APISIX 的原理 …

大模型系列——AlphaZero/强化学习/MCTS

AlphaGo Zero无需任何人类历史棋谱&#xff0c;仅使用深度强化学习&#xff0c;从零开始训练三天的成就已远远超过了人类数千年积累的围棋知识。 1、围棋知识 &#xff08;1&#xff09;如何简单理解围棋知识 &#xff08;2&#xff09;数子法分胜负&#xff1a;https://zhu…

2024年【金属非金属矿山(地下矿山)安全管理人员】考试报名及金属非金属矿山(地下矿山)安全管理人员复审考试

题库来源&#xff1a;安全生产模拟考试一点通公众号小程序 金属非金属矿山&#xff08;地下矿山&#xff09;安全管理人员考试报名是安全生产模拟考试一点通生成的&#xff0c;金属非金属矿山&#xff08;地下矿山&#xff09;安全管理人员证模拟考试题库是根据金属非金属矿山…