CN-90 fix: 色阶增加单位

This commit is contained in:
chenjinsong
2021-08-26 17:14:51 +08:00
parent 51db57d3a5
commit fa7a3b4a96
10 changed files with 205 additions and 144 deletions

View File

@@ -1,7 +1,9 @@
/* eslint-disable @typescript-eslint/no-var-requires */ /* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path') const path = require('path')
const webpack = require('webpack') const webpack = require('webpack')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin') const CompressionWebpackPlugin = require('compression-webpack-plugin')
const productionGzipExtensions = ['js', 'css']
// const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const { VueLoaderPlugin } = require('vue-loader') const { VueLoaderPlugin } = require('vue-loader')
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin // const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
@@ -66,6 +68,14 @@ const config = {
const plugins = [ const plugins = [
new VueLoaderPlugin(), new VueLoaderPlugin(),
new CompressionWebpackPlugin({
filename: '[path].gz[query]',
algorithm: 'gzip',
test: /\.(js|css|json|txt|html|ico|svg)(\?.*)?$/i, // 匹配文件名
threshold: 10240, // 对10K以上的数据进行压缩
minRatio: 0.8,
deleteOriginalAssets: false // 是否删除源文件
})/*,
new UglifyJsPlugin({ new UglifyJsPlugin({
uglifyOptions: { uglifyOptions: {
compress: { compress: {
@@ -76,7 +86,7 @@ const plugins = [
exclude: /manifest.+js/, exclude: /manifest.+js/,
sourceMap: config.build.productionSourceMap, sourceMap: config.build.productionSourceMap,
parallel: true parallel: true
}) })*/
// new BundleAnalyzerPlugin(), // new BundleAnalyzerPlugin(),
] ]

View File

@@ -52,6 +52,7 @@
"@vue/compiler-sfc": "^3.0.0", "@vue/compiler-sfc": "^3.0.0",
"@vue/component-compiler-utils": "^3.2.0", "@vue/component-compiler-utils": "^3.2.0",
"babel-eslint": "^10.1.0", "babel-eslint": "^10.1.0",
"compression-webpack-plugin": "^8.0.1",
"eslint": "^7.22.0", "eslint": "^7.22.0",
"eslint-config-standard": "^16.0.2", "eslint-config-standard": "^16.0.2",
"eslint-plugin-import": "^2.22.1", "eslint-plugin-import": "^2.22.1",

View File

@@ -40,7 +40,6 @@
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { post } from '@/utils/http' import { post } from '@/utils/http'
import { ElMessage } from 'element-plus'
export default { export default {
name: 'Login', name: 'Login',
@@ -64,18 +63,19 @@ export default {
// } // }
post('sys/login', { username: this.username, pin: this.pin }).then( post('sys/login', { username: this.username, pin: this.pin }).then(
res => { res => {
if (res.code === 200 && res.msg == 'success') { if (res.code === 200) {
this.loading = true
this.blockOperation.query = true
this.loginSuccess(res) this.loginSuccess(res)
localStorage.setItem('cn-username', this.username) localStorage.setItem('cn-username', this.username)
} else if (res.code === 518005) {
this.$message.error(this.$t('tip.incorrectUsernameOrPassword'))
} else { } else {
this.loading = false this.$message.error(this.$t('tip.unknownError'))
this.blockOperation.query = false
ElMessage.error('密码错误')
} }
} }
) ).finally(() => {
this.loading = false
this.blockOperation.query = false
})
} }
} }
} }

View File

@@ -23,7 +23,7 @@ export default {
name: 'ChartError', name: 'ChartError',
props: { props: {
isError: Boolean, isError: Boolean,
errorInfo:String errorInfo: String
} }
} }
</script> </script>

View File

@@ -28,7 +28,7 @@ export default {
data () { data () {
return { return {
errorContent: '出错了。。。', errorContent: '出错了。。。',
isError: true, isError: true
} }
} }
} }

View File

@@ -38,44 +38,43 @@
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item> <el-dropdown-item>
<div id="header-to-changepin" @click="showPinDialog">Change pin</div> <div id="header-to-changepin" @click="showPinDialog">{{$t('overall.changePin')}}</div>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item> <el-dropdown-item>
<div id="header-to-logout" @click="logout">Sign out</div> <div id="header-to-logout" @click="logout">{{$t('overall.logout')}}</div>
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
</div> </div>
<!-- <change-password :cur-user="username" :show-dialog="showChangePin" @click="showPinDialog" @dialogClosed="dialogClosed"></change-password>--> <!-- <change-password :cur-user="username" :show-dialog="showChangePin" @click="showPinDialog" @dialogClosed="dialogClosed"></change-password>-->
<el-dialog title="提示" <el-dialog v-model="showChangePin"
v-model="showChangePin"
width="30%" width="30%"
:before-close="handleClose"> :before-close="handleClose">
<el-form :rules="changePassFormRules" :model="changePassForm" ref="changePassForm"> <el-form :rules="changePassFormRules" :model="changePassForm" ref="changePassForm">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="旧密码" prop="oldPass"> <el-form-item :label="$t('overall.currentPassword')" prop="oldPwd">
<el-input v-model="changePassForm.oldPass" type="password"></el-input> <el-input v-model="changePassForm.oldPwd" type="password"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="新密码" prop="newPass"> <el-form-item :label="$t('overall.newPassword')" prop="newPwd">
<el-input v-model="changePassForm.newPass" type="password"></el-input> <el-input v-model="changePassForm.newPwd" type="password"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="确认新密码" prop="newPass2"> <el-form-item :label="$t('overall.confirmNewPassword')" prop="newPwd2">
<el-input v-model="changePassForm.newPass2" type="password"></el-input> <el-input v-model="changePassForm.newPwd2" type="password"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="showChangePin = false"> </el-button> <el-button @click="showChangePin = false">{{$t('overall.cancel')}}</el-button>
<el-button type="primary" @click="submit">确认更改密码</el-button> <el-button type="primary" @click="submit">{{$t('overall.update')}}</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
</div> </div>
@@ -85,15 +84,12 @@
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import { get, put } from '@/utils/http' import { get, put } from '@/utils/http'
import { entityType, storageKey } from '@/utils/constants' import { entityType, storageKey } from '@/utils/constants'
import { ElMessage } from 'element-plus'
export default { export default {
name: 'Header', name: 'Header',
data () { data () {
const passwordYN = (rule, value, callback) => { const passwordComparison = (rule, value, callback) => {
if (value === '') { if (value !== this.changePassForm.newPwd) {
callback(new Error('请再次输入密码')) callback(new Error(this.$t('validate.passwordConsistent')))
} else if (value !== this.changePassForm.newPass) {
callback(new Error('两次输入密码不一致!'))
} else { } else {
callback() callback()
} }
@@ -141,14 +137,14 @@ export default {
], ],
from: '', // entity类型 from: '', // entity类型
changePassForm: { changePassForm: {
oldPass: '', oldPwd: '',
newPass: '', newPwd: '',
newPass2: '' newPwd2: ''
}, },
changePassFormRules: { changePassFormRules: {
oldPass: [{ required: true, message: '请输入旧密码', trigger: 'blur' }], oldPwd: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
newPass: [{ required: true, message: '请输入新密码', trigger: 'blur' }], newPwd: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
newPass2: [{ required: true, message: '请输入新密码', trigger: 'blur' }, { validator: passwordYN, trigger: 'blur' }] newPwd2: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }, { validator: passwordComparison, trigger: 'blur' }]
} }
} }
}, },
@@ -231,15 +227,12 @@ export default {
submit () { submit () {
this.$refs.changePassForm.validate((valid) => { this.$refs.changePassForm.validate((valid) => {
if (valid) { if (valid) {
put('sys/user/pin', { oldPin: this.changePassForm.oldPass, newPin: this.changePassForm.newPass }).then(res => { put('sys/user/pin', { oldPin: this.changePassForm.oldPwd, newPin: this.changePassForm.newPwd }).then(res => {
if (res.code === 200) { if (res.code === 200) {
ElMessage.success({ this.$message.success('Success')
message: '密码修改成功',
type: 'success'
})
this.showChangePin = false this.showChangePin = false
} else if (res.msg == 'user oldpwd error') { } else if (res.code === 518005) {
ElMessage.error('密码错误') this.$message.error('密码错误')
} }
}) })
} else { } else {

View File

@@ -82,7 +82,7 @@ export default {
}, },
data () { data () {
return { return {
keyWord:"", keyWord: '',
fromRoute: fromRoute, fromRoute: fromRoute,
tools: { tools: {
showCustomTableTitle: false // 自定义列弹框是否显示 showCustomTableTitle: false // 自定义列弹框是否显示

View File

@@ -70,7 +70,7 @@ export default {
this.searchLabel = { ...this.searchLabel, ...this.pageObj } this.searchLabel = { ...this.searchLabel, ...this.pageObj }
this.tools.loading = true this.tools.loading = true
// console.log(typeof this.searchLabel) // console.log(typeof this.searchLabel)
console.log(delete this.searchLabel.total) console.log(delete this.searchLabel.total)
get(this.url, this.searchLabel).then(response => { get(this.url, this.searchLabel).then(response => {
this.tools.loading = false this.tools.loading = false
if (response.code === 200) { if (response.code === 200) {

View File

@@ -392,12 +392,16 @@ export function replaceUrlPlaceholder (url, params) {
_.forIn(params, (value, key) => { _.forIn(params, (value, key) => {
url = url.replace('{{' + key + '}}', value) url = url.replace('{{' + key + '}}', value)
}) })
return doubleQuotationToSingle(url) return url
} }
// 双引号替换为单引号 // 双引号替换为单引号
export function doubleQuotationToSingle (content) { export function doubleQuotationToSingle (content) {
return content.replace(/\"/g, "'") return content.replace(/\"/g, "'")
} }
// 双引号加斜杠转义
export function doubleQuotationEscape (content) {
return content.replace(/\"/g, '\\\"')
}
// 下划线转换驼峰 // 下划线转换驼峰
export function lineToHump (name) { export function lineToHump (name) {
return name.replace(/\_(\w)/g, function (all, letter) { return name.replace(/\_(\w)/g, function (all, letter) {
@@ -458,5 +462,3 @@ function JSONParse (data) {
return firstParse return firstParse
} }
} }

View File

@@ -1,9 +1,9 @@
<template> <template>
<!-- 标题 --> <!-- 标题 -->
<div <div
v-if="isTitle" v-if="isTitle"
class="cn-chart cn-chart__title" class="cn-chart cn-chart__title"
:style="computePosition">{{chartInfo.i18n ? $t(chartInfo.i18n) : chartInfo.name}}</div> :style="computePosition">{{chartInfo.i18n ? $t(chartInfo.i18n) : chartInfo.name}}</div>
<!-- Tabs --> <!-- Tabs -->
<el-tabs <el-tabs
class="cn-chart cn-chart__tabs" class="cn-chart cn-chart__tabs"
@@ -14,10 +14,10 @@
:ref="`chart-${chart.id}`" :ref="`chart-${chart.id}`"
> >
<el-tab-pane <el-tab-pane
v-for="tab in chartInfo.children" v-for="tab in chartInfo.children"
:label="tab.i18n ? $t(tab.i18n) : tab.name" :name="`${tab.id}`" :label="tab.i18n ? $t(tab.i18n) : tab.name" :name="`${tab.id}`"
:key="tab.id" :key="tab.id"
:ref="`chart-${chart.id}`" :ref="`chart-${chart.id}`"
> >
<template v-for="chart in tab.children"> <template v-for="chart in tab.children">
<chart v-if="activeTab == tab.id" :key="chart.id" :chart="chart" :time-filter="timeFilter" :ref="`chart-${chart.id}`" :entity="entity"></chart> <chart v-if="activeTab == tab.id" :key="chart.id" :chart="chart" :time-filter="timeFilter" :ref="`chart-${chart.id}`" :entity="entity"></chart>
@@ -31,11 +31,11 @@
:loading="loading" :loading="loading"
> >
<template #chartErrorInfo> <template #chartErrorInfo>
<chart-error <chart-error
:isError="isError" :isError="isError"
:errorInfo="errorInfo" :errorInfo="errorInfo"
> >
</chart-error> </chart-error>
</template> </template>
<template #title>{{chartInfo.i18n ? $t(chartInfo.i18n) : chartInfo.name}}</template> <template #title>{{chartInfo.i18n ? $t(chartInfo.i18n) : chartInfo.name}}</template>
<template #operations> <template #operations>
@@ -48,20 +48,20 @@
</chart-map> </chart-map>
<!-- echarts类的图如饼图柱状图折线图等 --> <!-- echarts类的图如饼图柱状图折线图等 -->
<echarts-frame <echarts-frame
v-else-if="isEcharts" v-else-if="isEcharts"
:layout="layout" :layout="layout"
:style="computePosition" :style="computePosition"
:chartInfo="chartInfo" :chartInfo="chartInfo"
:loading="loading" :loading="loading"
:no-data="noData" :no-data="noData"
> >
<template #chartErrorInfo> <template #chartErrorInfo>
<chart-error <chart-error
:isError="isError" :isError="isError"
:errorInfo="errorInfo" :errorInfo="errorInfo"
> >
</chart-error> </chart-error>
</template> </template>
<template #title v-if="layout.indexOf(layoutConstant.HEADER) > -1"> <template #title v-if="layout.indexOf(layoutConstant.HEADER) > -1">
{{chartInfo.i18n ? $t(chartInfo.i18n) : chartInfo.name}} {{chartInfo.i18n ? $t(chartInfo.i18n) : chartInfo.name}}
</template> </template>
@@ -95,19 +95,19 @@
</echarts-frame> </echarts-frame>
<!-- 单值图 --> <!-- 单值图 -->
<single-value <single-value
v-else-if="isSingleValue" v-else-if="isSingleValue"
:type="chartInfo.type" :type="chartInfo.type"
:style="computePosition" :style="computePosition"
:icon="singleValue.icon" :icon="singleValue.icon"
v-loading="loading" v-loading="loading"
> >
<template #chartErrorInfo> <template #chartErrorInfo>
<chart-error <chart-error
:isError="isError" :isError="isError"
:errorInfo="errorInfo" :errorInfo="errorInfo"
> >
</chart-error> </chart-error>
</template> </template>
<template #title><span :title="chartInfo.i18n ? $t(chartInfo.i18n) : chartInfo.name">{{chartInfo.i18n ? $t(chartInfo.i18n) : chartInfo.name}}</span></template> <template #title><span :title="chartInfo.i18n ? $t(chartInfo.i18n) : chartInfo.name">{{chartInfo.i18n ? $t(chartInfo.i18n) : chartInfo.name}}</span></template>
<template #data> <template #data>
<span>{{handleSingleValue[0] ? handleSingleValue[0] : '-'}}</span> <span>{{handleSingleValue[0] ? handleSingleValue[0] : '-'}}</span>
@@ -119,20 +119,20 @@
</single-value> </single-value>
<!-- 表格 --> <!-- 表格 -->
<chart-table <chart-table
v-else-if="isTable" v-else-if="isTable"
:table-columns="table.tableColumns" :table-columns="table.tableColumns"
:table-data="table.currentPageData" :table-data="table.currentPageData"
:style="computePosition" :style="computePosition"
:loading="loading" :loading="loading"
:no-data="noData" :no-data="noData"
> >
<template #chartErrorInfo> <template #chartErrorInfo>
<chart-error <chart-error
:isError="isError" :isError="isError"
:errorInfo="errorInfo" :errorInfo="errorInfo"
> >
</chart-error> </chart-error>
</template> </template>
<template #title>{{chartInfo.i18n ? $t(chartInfo.i18n) : chartInfo.name}}</template> <template #title>{{chartInfo.i18n ? $t(chartInfo.i18n) : chartInfo.name}}</template>
<template #operations> <template #operations>
<!-- <div class="header__operation header__operation&#45;&#45;table"> <!-- <div class="header__operation header__operation&#45;&#45;table">
@@ -266,8 +266,8 @@ export default {
loading: true, loading: true,
noData: false, // 查询结果为空 noData: false, // 查询结果为空
throttle: null, // 节流器 throttle: null, // 节流器
isError:false,//接口响应是否报错 isError: false, // 接口响应是否报错
errorInfo:"",//接口具体错误信息 errorInfo: ''// 接口具体错误信息
} }
}, },
@@ -308,10 +308,10 @@ export default {
get(replaceUrlPlaceholder(chartParams.url, queryParams)).then(response => { get(replaceUrlPlaceholder(chartParams.url, queryParams)).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.singleValue.value = response.data.result this.singleValue.value = response.data.result
}else { } else {
this.isError = true; this.isError = true
this.noData = true this.noData = true
this.errorInfo = response.msg||response.message||'Unknown'; this.errorInfo = response.msg || response.message || 'Unknown'
} }
if (this.isSingleValueWithEcharts) { // 带曲线的单值图 if (this.isSingleValueWithEcharts) { // 带曲线的单值图
const dom = document.getElementById(`chart${this.chartInfo.id}`) const dom = document.getElementById(`chart${this.chartInfo.id}`)
@@ -331,10 +331,10 @@ export default {
} }
} }
}) })
}else { } else {
this.isError = true; this.isError = true
this.noData = true this.noData = true
this.errorInfo = response.msg||response.message||'Unknown'; this.errorInfo = response.msg || response.message || 'Unknown'
} }
this.myChart.setOption(this.chartOption) this.myChart.setOption(this.chartOption)
this.$nextTick(() => { this.$nextTick(() => {
@@ -372,21 +372,55 @@ export default {
getTitle (r) { getTitle (r) {
let title = '' let title = ''
if (r.establishLatency || r.httpResponseLatency || r.sslConLatency) { if (r.establishLatency || r.httpResponseLatency || r.sslConLatency) {
title = `: ${unitConvert(r.establishLatency || r.httpResponseLatency || r.sslConLatency, unitTypes.time).join(' ')}` title += `: ${unitConvert(r.establishLatency || r.httpResponseLatency || r.sslConLatency, unitTypes.time).join(' ')}`
} }
if (r.sequenceGapLossPercent || r.pktRetransPercent) { if (r.sequenceGapLossPercent || r.pktRetransPercent) {
const d = unitConvert(r.sequenceGapLossPercent || r.pktRetransPercent, unitTypes.number) const d = unitConvert(r.sequenceGapLossPercent || r.pktRetransPercent, unitTypes.number)
title = d[0] === '0.00' ? ': 0' : `: ${d.join(' ')} %` title += d[0] === '0.00' ? ': 0' : `: ${d.join(' ')} %`
} }
if (r.sessions) { if (r.sessions) {
title = `\nSessions: ${unitConvert(r.sessions, unitTypes.number).join(' ')}` title += `\nSessions: ${unitConvert(r.sessions, unitTypes.number).join(' ')}`
}
if (r.packets) {
title += `\nPackets: ${unitConvert(r.packets, unitTypes.number).join(' ')}`
} }
if (r.bytes) { if (r.bytes) {
title = `\nBytes: ${unitConvert(r.bytes, unitTypes.byte).join(' ')}` title += `\nBytes: ${unitConvert(r.bytes, unitTypes.byte).join(' ')}`
} }
title = title || ': 0' title = title || ': 0'
return title return title
}, },
getTitle2 (item, valueColumn) {
let title = ''
switch (valueColumn) {
case 'sessions': {
title = `\nSessions: ${unitConvert(item.value, unitTypes.number).join(' ')}`
break
}
case 'packets': {
title = `\nPackets: ${unitConvert(item.value, unitTypes.number).join(' ')}`
break
}
case 'bytes': {
title = `\nBytes: ${unitConvert(item.value, unitTypes.byte).join(' ')}`
break
}
case 'establishLatency':
case 'httpResponseLatency':
case 'sslConLatency': {
const result = unitConvert(item.value, unitTypes.time)
title = `: ${result[0] === 0 ? 0 : result.join(' ')}`
break
}
case 'sequenceGapLossPercent':
case 'pktRetransPercent': {
title = `: ${unitConvert(item.value, unitTypes.number).join(' ')}`
break
}
default: break
}
return title
},
changeTab (tab) { changeTab (tab) {
this.activeTab = tab.paneName this.activeTab = tab.paneName
}, },
@@ -482,12 +516,22 @@ export default {
}) })
imageSeries.data = pointData imageSeries.data = pointData
} else if (this.isMapBlock) { } else if (this.isMapBlock) {
const seriesData = data.map(r => { const sumData = []
const value = r.establishLatency || r.httpResponseLatency || r.sslConLatency || r.sequenceGapLossPercent || r.pktRetransPercent || r.sessions data.forEach(r => {
const hit = sumData.find(s => s.id === r.serverId)
if (hit) {
hit.value += Number(r.establishLatency || r.httpResponseLatency || r.sslConLatency || r.sequenceGapLossPercent || r.pktRetransPercent || r.sessions) || 0
} else {
sumData.push({
id: r.serverId,
value: Number(r.establishLatency || r.httpResponseLatency || r.sslConLatency || r.sequenceGapLossPercent || r.pktRetransPercent || r.sessions) || 0
})
}
})
const seriesData = sumData.map(r => {
return { return {
id: r.serverId, ...r,
title: this.getTitle(r), title: this.getTitle2(r, chartParams.valueColumn)
value: value || 0
} }
}) })
polygonSeries.data = [...seriesData] polygonSeries.data = [...seriesData]
@@ -513,15 +557,26 @@ export default {
heatLegend.marginLeft = 15 heatLegend.marginLeft = 15
heatLegend.valign = 'bottom' heatLegend.valign = 'bottom'
const minRange = heatLegend.valueAxis.axisRanges.create()
minRange.value = heatLegend.minValue
minRange.label.text = minRange.value === 0 ? 0 : unitConvert(heatLegend.minValue, chartParams.unitType).join(' ')
const maxRange = heatLegend.valueAxis.axisRanges.create()
maxRange.value = heatLegend.maxValue
maxRange.label.text = maxRange.value === 0 ? 0 : unitConvert(heatLegend.maxValue, chartParams.unitType).join(' ')
heatLegend.valueAxis.renderer.labels.template.adapter.add('text', function (labelText) {
return ''
})
const polygonTemplate = polygonSeries.mapPolygons.template const polygonTemplate = polygonSeries.mapPolygons.template
polygonTemplate.tooltipText = '{name}{title}' polygonTemplate.tooltipText = '{name}{title}'
polygonTemplate.nonScalingStroke = true polygonTemplate.nonScalingStroke = true
polygonTemplate.strokeWidth = 0.5 polygonTemplate.strokeWidth = 0.5
} }
}else { } else {
this.isError = true; this.isError = true
this.noData = true this.noData = true
this.errorInfo = response.msg||response.message||'Unknown'; this.errorInfo = response.msg || response.message || 'Unknown'
} }
}).finally(() => { }).finally(() => {
setTimeout(() => { this.loading = false }, 250) setTimeout(() => { this.loading = false }, 250)
@@ -628,10 +683,10 @@ export default {
} }
this.chartOption.grid.left = 75 this.chartOption.grid.left = 75
} }
}else { } else {
this.isError = true; this.isError = true
this.noData = true this.noData = true
this.errorInfo = response.msg||response.message||'Unknown'; this.errorInfo = response.msg || response.message || 'Unknown'
} }
this.myChart.setOption(this.chartOption) this.myChart.setOption(this.chartOption)
this.$nextTick(() => { this.$nextTick(() => {
@@ -746,10 +801,10 @@ export default {
} }
} }
}) })
}else { } else {
this.isError = true; this.isError = true
this.noData = true; this.noData = true
this.errorInfo = response.msg||response.message||'Unknown'; this.errorInfo = response.msg || response.message || 'Unknown'
} }
this.myChart.setOption(this.chartOption) this.myChart.setOption(this.chartOption)
this.$nextTick(() => { this.$nextTick(() => {
@@ -805,17 +860,17 @@ export default {
get(replaceUrlPlaceholder(chartParams.urlTable, tableQueryParams)).then(response2 => { get(replaceUrlPlaceholder(chartParams.urlTable, tableQueryParams)).then(response2 => {
if (response2.code === 200) { if (response2.code === 200) {
this.pieTableData = response2.data.result this.pieTableData = response2.data.result
}else { } else {
this.isError = true; this.isError = true
this.noData = true this.noData = true
this.errorInfo = response.msg||response.message||'Unknown'; this.errorInfo = response.msg || response.message || 'Unknown'
} }
}) })
} }
}else { } else {
this.isError = true; this.isError = true
this.noData = true this.noData = true
this.errorInfo = response.msg||response.message||'Unknown'; this.errorInfo = response.msg || response.message || 'Unknown'
} }
}).finally(() => { }).finally(() => {
setTimeout(() => { this.loading = false }, 250) setTimeout(() => { this.loading = false }, 250)
@@ -884,10 +939,10 @@ export default {
this.table.tableData = response.data.result this.table.tableData = response.data.result
this.table.tableColumns = this.getTableTitle(response.data.result) this.table.tableColumns = this.getTableTitle(response.data.result)
this.table.currentPageData = this.getTargetPageData(1, this.table.pageSize, this.table.tableData) this.table.currentPageData = this.getTargetPageData(1, this.table.pageSize, this.table.tableData)
}else { } else {
this.isError = true; this.isError = true
this.noData = true this.noData = true
this.errorInfo = response.msg||response.message||'Unknown'; this.errorInfo = response.msg || response.message || 'Unknown'
} }
}).finally(() => { }).finally(() => {
setTimeout(() => { this.loading = false }, 250) setTimeout(() => { this.loading = false }, 250)