diff --git a/src/api/perfManage/goldTarget.ts b/src/api/perfManage/goldTarget.ts index e72c223c..b07cf806 100644 --- a/src/api/perfManage/goldTarget.ts +++ b/src/api/perfManage/goldTarget.ts @@ -8,7 +8,6 @@ import { parseObjLineToHump } from '@/utils/parse-utils'; * @returns object */ export async function listgoldData(query: Record) { - //console.log(query); let totalSQL = 'select count(*) as total from gold_kpi where 1=1 '; let rowsSQL = 'SELECT gold_kpi.*,kpi_title.en_title FROM gold_kpi LEFT JOIN kpi_title on gold_kpi.kpi_id=kpi_title.kpi_id where 1=1 '; @@ -88,12 +87,11 @@ export async function listgoldData(query: Record) { * @returns object */ export async function goldData(query: Record) { - //console.log(query); // 发起请求 let insertKpiId: string[]=[]; let insertWhere: string[]=[]; query.goldArr.forEach((item: any)=> { - insertKpiId.push(`SUM(CASE WHEN kpi_id = '${item}' THEN value ELSE 0 END) AS ${item.split(".")[0]+'_'+item.split(".")[1]} `); + insertKpiId.push(`SUM(CASE WHEN kpi_id = '${item}' THEN value ELSE 0 END) AS \`${item}\``); insertWhere.push(`'${item}'`); }) const result = await request({ @@ -103,7 +101,7 @@ export async function goldData(query: Record) { rowsSQL:`SELECT CONCAT(DATE_FORMAT(start_time, '%Y-%m-%d %H:'), LPAD(FLOOR(MINUTE(start_time) / ${query.particle}) * ${query.particle}, 2, '0'), ':00') AS time_interval,`+ insertKpiId.join(",")+ " FROM gold_kpi"+ - ` WHERE ne_type='UPF' and kpi_id in (${insertWhere.join(",")}) and start_time BETWEEN '${query.beginTime}' AND '${query.endTime}'`+ + ` WHERE ne_type='${query.neType[0]}' and kpi_id in (${insertWhere.join(",")}) and start_time BETWEEN '${query.beginTime}' AND '${query.endTime}'`+ ` GROUP BY DATE_FORMAT(start_time, '%Y-%m-%d %H:'), FLOOR(MINUTE(start_time) / ${query.particle})`+ " ORDER BY start_time", }, diff --git a/src/components/ChartLine/index.vue b/src/components/ChartLine/index.vue index ac558ec9..91c0a14a 100644 --- a/src/components/ChartLine/index.vue +++ b/src/components/ChartLine/index.vue @@ -69,7 +69,7 @@ const props = defineProps({ const seriesStyle = [ { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ - { + { offset: 0, color: 'rgba(22, 119, 255, .5)', }, @@ -203,7 +203,7 @@ function initChart() { }, }, grid: props.option.grid || { left: '8%', right: '8%', bottom: '20%' }, - legend: { + legend: props.option.legend || { right: 10, itemWidth: 8, textStyle: { diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index 5a7673a9..1f88e184 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -630,6 +630,8 @@ export default { endTime:'End Time', particle: 'Particle Ssize', timeFrame: 'Time Range', + nullTip:'There are no statistical data within this time range', + kpiTitle:'KPI Statistics Chart', } }, traceManage: { diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index ad2dc2b4..d5c5f49b 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -630,6 +630,8 @@ export default { endTime:'结束时间', particle:'颗粒度', timeFrame:'时间范围', + nullTip:'此时间范围内没有统计数据', + kpiTitle:'KPI统计图表', } }, traceManage: { diff --git a/src/views/perfManage/goldTarget/index.vue b/src/views/perfManage/goldTarget/index.vue index 1e65dc2b..3425b195 100644 --- a/src/views/perfManage/goldTarget/index.vue +++ b/src/views/perfManage/goldTarget/index.vue @@ -1,11 +1,14 @@