diff --git a/src/assets/css/chart.scss b/src/assets/css/chart.scss
index e0b64e3f..6ee893d6 100644
--- a/src/assets/css/chart.scss
+++ b/src/assets/css/chart.scss
@@ -1,13 +1,21 @@
-.nz-chart-tooltip > div > div:nth-of-type(1) > div:nth-of-type(2) > div > div:nth-of-type(1){
+.nz-chart-tooltip .cn-chart-tooltip-box{
display: flex;
- span {
- float: none;
- }
- > span:nth-of-type(2){
+ .cn-chart-tooltip-content{
flex: 1;
display: inline-block;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
+ font-size:14px;
+ color:#666;
+ font-weight:400;
+ margin-left:2px ;
+ }
+ .cn-chart-tooltip-value{
+ float:right;
+ margin-left:20px;
+ font-size:14px;
+ color:#666;
+ font-weight:900;
}
}
diff --git a/src/assets/css/common.scss b/src/assets/css/common.scss
index e60b3cef..dc43eb28 100644
--- a/src/assets/css/common.scss
+++ b/src/assets/css/common.scss
@@ -54,3 +54,9 @@ th *:first-letter,
.header__operations *:first-letter {
text-transform: capitalize;
}
+
+.outer-box {
+ padding: 10px;
+ height: 100%;
+ width: 100%;
+}
diff --git a/src/assets/css/tableCommon.scss b/src/assets/css/tableCommon.scss
index 901d3bd5..a9798238 100644
--- a/src/assets/css/tableCommon.scss
+++ b/src/assets/css/tableCommon.scss
@@ -44,7 +44,7 @@
height: 44px;
background-color: white;
border: 1px solid #E6EAED;
-
+
}
.top-tool-right {
@@ -134,7 +134,7 @@
color: #666666;
font-size: 14px;
text-align: center;
-
+
line-height: 40px;
&.sub-list-tab--active {
@@ -156,7 +156,7 @@
background-color: #e6eaed;
position: absolute;
z-index: 1;
-
+
user-select: none;
color: #5f6368;
cursor: ns-resize;
@@ -188,7 +188,7 @@
position: relative;
padding: 0 20px;
width: 100%;
-
+
flex: auto;
height: calc(100% - 58px);
@@ -356,7 +356,7 @@
left: 270px !important;
margin-top: -3px !important;
box-shadow: none;
-
+
border-radius: 0;
border-color: #c7c7c7;
@@ -391,3 +391,6 @@
.margin-r-20{
margin-right: 20px;
}
+.margin-l-10{
+ margin-left: 10px;
+}
diff --git a/src/components/charts/PieTable.vue b/src/components/charts/PieTable.vue
index 7a31de6e..9770c468 100644
--- a/src/components/charts/PieTable.vue
+++ b/src/components/charts/PieTable.vue
@@ -1,16 +1,21 @@
-
+
+ :prop="item.prop"
+ #default="{row}">
+
+ {{nameColumn === 'fqdnCategoryName' ? row['fqdnCategoryName'] : row['reputationLevel'] }}
+
+
+ {{shortFormatter(row[item.prop])}}
+
+
+ {{row[item.prop]}}
+
@@ -33,59 +48,163 @@
:key="index"
:min-width="item.width"
:label="item.label"
- :prop="item.prop">
+ :prop="item.prop"
+ #default="{row}">
+
+ {{nameColumn === 'fqdnCategoryName' ? row['categoryName'] : row['reputationLevel'] }}
+
+
+ {{shortFormatter(row[item.prop])}}
+
+
+ {{row[item.prop]}}
+
-
diff --git a/src/components/charts/StatisticsLegend.vue b/src/components/charts/StatisticsLegend.vue
index 9dbc41eb..c2bfd67a 100644
--- a/src/components/charts/StatisticsLegend.vue
+++ b/src/components/charts/StatisticsLegend.vue
@@ -97,7 +97,6 @@ export default {
immediate: true,
deep: true,
handler (n) {
- console.info(n)
}
}
},
@@ -198,4 +197,4 @@ color: deepskyblue;
white-space: nowrap;
text-overflow: ellipsis;
}
-
\ No newline at end of file
+
diff --git a/src/components/charts/chart-options.js b/src/components/charts/chart-options.js
index 555ed860..b098968d 100644
--- a/src/components/charts/chart-options.js
+++ b/src/components/charts/chart-options.js
@@ -4,6 +4,7 @@
* @description chart option和一些工具
*/
import { format } from 'echarts'
+import { shortFormatter } from './chartFormatter'
import _ from 'lodash'
export const chartColor = ['#5370C6', '#90CC74', '#FAC858', '#EE6666',
'#73BFDE', '#3BA172', '#FC8452', '#9960B4',
@@ -20,9 +21,7 @@ const line = {
width: '20px',
overflow: 'truncate'
},
- // formatter: () =>{
- // return '1'
- // }
+ formatter: axiosFormatter,
className: 'nz-chart-tooltip',
extraCssText: 'box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);max-width: 300px !important'
},
@@ -30,7 +29,11 @@ const line = {
type: 'time'
},
yAxis: {
- type: 'value'
+ type: 'value',
+ axisLabel: {
+ formatter: shortFormatter
+ }
+
},
animation: false,
grid: {
@@ -74,9 +77,7 @@ const lineWithStatistics = {
width: '20px',
overflow: 'truncate'
},
- // formatter: () =>{
- // return '1'
- // }
+ formatter: axiosFormatter,
className: 'nz-chart-tooltip',
extraCssText: 'box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);max-width: 300px !important'
},
@@ -85,7 +86,11 @@ const lineWithStatistics = {
},
animation: false,
yAxis: {
- type: 'value'
+ type: 'value',
+ axisLabel: {
+ formatter: shortFormatter
+ }
+
},
color: chartColor,
grid: {
@@ -117,9 +122,7 @@ const lineStack = {
width: '20px',
overflow: 'truncate'
},
- // formatter: () =>{
- // return '1'
- // }
+ formatter: axiosFormatter,
className: 'nz-chart-tooltip',
extraCssText: 'box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);max-width: 300px !important'
},
@@ -128,7 +131,11 @@ const lineStack = {
},
color: chartColor,
yAxis: {
- type: 'value'
+ type: 'value',
+ axisLabel: {
+ formatter: shortFormatter
+ }
+
},
grid: {
left: 55,
@@ -181,11 +188,12 @@ const pieWithTable = {
itemHeight: 10, // 设置高度
itemGap: 20,
selectedMode: false,
- formatter: tooLongFormatter
+ // formatter: tooLongFormatter
},
series: [
{
type: 'pie',
+ selectedMode: 'single',
radius: ['42%', '70%'],
center: ['30%', '50%'],
data: [],
@@ -293,6 +301,26 @@ export function getLayout (type) {
function tooLongFormatter (name) {
return format.truncateText(name, 110, '12')
}
-// function axiosFormatter(params) {
-//
-// }
+function axiosFormatter (params) {
+ let str = '
'
+ const sum = 0
+ params.forEach((item, i) => {
+ const tData = item.data[0]
+ if (i === 0) {
+ str += '
'
+ str += window.$dayJs.tz(tData).format('YYYY-MM-DD HH:mm:ss')
+ str += '
'
+ }
+ str += '
'
+ str += item.marker
+ str += `
+ ${item.seriesName}
+ `
+ str += `
+ ${shortFormatter(item.data[1])}
+ `
+ str += '
'
+ })
+ str += '
'
+ return str
+}
diff --git a/src/components/charts/chartFormatter.js b/src/components/charts/chartFormatter.js
new file mode 100644
index 00000000..65ed67a4
--- /dev/null
+++ b/src/components/charts/chartFormatter.js
@@ -0,0 +1,21 @@
+const shortList = [' ', 'K', 'Mil', 'Bil', 'Til', 'Quadrillion', 'Quintillion']
+function asciiCompute (num, ascii, units, dot = 2) {
+ if (!num && num !== 0 && num !== '0') {
+ return ''
+ }
+ num = Number(num)
+ let carry = 0
+ if (num > 1) {
+ const log = Math.log(num) / Math.log(ascii)
+ carry = parseInt(log)
+ num = num / Math.pow(ascii, carry)
+ }
+ if (Number.isInteger(num)) {
+ return num + ' ' + units[carry]
+ } else {
+ return num.toFixed(dot) + ' ' + units[carry]
+ }
+}
+export function shortFormatter (value, index, dot = 2) {
+ return asciiCompute(value, 1000, shortList, dot)
+}
diff --git a/src/components/charts/panel.scss b/src/components/charts/panel.scss
index 5ebab07a..5e1b04a7 100644
--- a/src/components/charts/panel.scss
+++ b/src/components/charts/panel.scss
@@ -252,6 +252,110 @@
flex: auto;
overflow-y: auto;
+ .el-table {
+ padding: 0 10px;
+
+ &:before {
+ height: 0;
+ }
+ thead {
+ color: #333;
+ }
+ th.is-leaf, td {
+ border-bottom: none;
+ }
+ th {
+ padding-bottom: 5px;
+ }
+ td {
+ padding: 4px 0;
+ color: #333;
+ }
+ }
+ }
+ }
+ &>.cn-chart__echarts {
+ .cn-chart__header {
+ border-bottom: 1px solid $--content-right-background-color;
+ .header__operations {
+ display: flex;
+ justify-content: end;
+ align-items: center;
+
+ .header__operation.header__operation--table {
+ display: flex;
+ align-items: center;
+ height: 22px;
+ margin-left: 10px;
+ color: $--color-primary;
+ border: 1px solid $--color-primary;
+ border-radius: $--border-radius-primary;
+
+ .option__button {
+ display: flex;
+ align-items: center;
+ height: 100%;
+ padding: 0 5px;
+ cursor: pointer;
+ background-color: white;
+ transition: all linear .2s;
+ }
+ .option__button:hover {
+ background-color: #EFF2F5;
+ }
+ .option__button.icon-group-item:first-of-type:not(:last-of-type) {
+ padding: 0 5px 0 0;
+ }
+ .option__button.icon-group-item:last-of-type:not(:first-of-type) {
+ padding: 0 0 0 5px;
+ }
+ .option__select {
+ .el-input__inner {
+ width: 120px;
+ padding-right: 20px;
+ border: none;
+ height: 100%;
+ line-height: 20px;
+ color: $--color-primary;
+ }
+ .el-input__prefix > div {
+ font-weight: normal;
+ line-height: 19px;
+ color: $--color-primary;
+ }
+ .el-input__suffix {
+ display: flex;
+ .el-input__suffix-inner {
+ line-height: 14px;
+ .el-select__caret {
+ line-height: 14px;
+ width: 16px;
+ color: $--color-primary;
+ }
+ }
+ }
+ }
+ .option__select.select-column {
+ .el-input__inner {
+ width: 120px;
+ padding-left: 8px;
+ }
+ }
+ .icon-group-divide {
+ height: 14px;
+ width: 1px;
+ background-color: $--color-primary;
+ }
+ i {
+ font-size: 12px;
+ }
+ }
+ }
+ }
+ .cn-chart__body {
+ flex: auto;
+ overflow-y: auto;
+
.el-table {
padding: 0 10px;
@@ -282,3 +386,12 @@
font-size: 12px;
}
}
+//.cn-chart-select{
+// display: flex;
+// align-items: center;
+// height: 22px;
+// margin-left: 10px;
+// color: #0091ff;
+// border: 1px solid #0091ff;
+// border-radius: 2px;
+//}
diff --git a/src/components/common/Pagination.vue b/src/components/common/Pagination.vue
index 14399080..c5600d04 100644
--- a/src/components/common/Pagination.vue
+++ b/src/components/common/Pagination.vue
@@ -231,7 +231,6 @@ export default {
immediate: true,
deep: true,
handler (n, o) {
- // console.log(n)
}
}
}
diff --git a/src/components/entities/LeftFilter.vue b/src/components/entities/LeftFilter.vue
new file mode 100644
index 00000000..50d9bcf5
--- /dev/null
+++ b/src/components/entities/LeftFilter.vue
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+ {{data[f.key]}}-{{data.count}}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/entities/entities.scss b/src/components/entities/entities.scss
new file mode 100644
index 00000000..adcb8d33
--- /dev/null
+++ b/src/components/entities/entities.scss
@@ -0,0 +1,10 @@
+.cn-entities {
+ display: grid;
+ grid-template-rows: 32px auto;
+ grid-template-columns: 250px auto;
+ grid-gap: 10px 20px;
+ padding: 20px;
+ height: 100%;
+ width: 100%;
+ background-color: #fff;
+}
\ No newline at end of file
diff --git a/src/utils/api.js b/src/utils/api.js
index 5fc4feb9..82be99c9 100644
--- a/src/utils/api.js
+++ b/src/utils/api.js
@@ -5,7 +5,6 @@
*/
import { get, post } from '@/utils/http'
import { sortByOrderNum } from '@/permission'
-import { storageKey, iso36112 } from '@/utils/constants'
export const api = {
// 系统相关
@@ -14,7 +13,10 @@ export const api = {
dict: '/sys/dict',
// 业务
panel: '/visual/panel',
- chart: '/visual/chart'
+ chart: '/visual/chart',
+ entityIpFilter: '/interface/entity/ip/filter',
+ entityDomainFilter: '/interface/entity/domain/filter',
+ entityAppFilter: '/interface/entity/app/filter'
}
/* panel */
export async function getPanelList (params) {
@@ -30,6 +32,18 @@ export async function getChartList (params) {
export async function getChart (id) {
return await getData(`${api.chart}/${id}`)
}
+/* ip类型entity过滤器数据 */
+export async function getEntityIpFilterList (params) {
+ return await getData(api.entityIpFilter, params, true)
+}
+/* domain类型entity过滤器数据 */
+export async function getEntityDomainFilterList (params) {
+ return await getData(api.entityDomainFilter, params, true)
+}
+/* app类型entity过滤器数据 */
+export async function getEntityAppFilterList (params) {
+ return await getData(api.entityAppFilter, params, true)
+}
/* 字典 */
export async function getDictList (params) {
return await getData(api.dict, params, true)
@@ -39,7 +53,7 @@ export async function getData (url, params = {}, isQueryList) {
const request = new Promise(resolve => {
get(url, params).then(response => {
if (response.code === 200) {
- resolve(isQueryList ? response.data.list : response.data)
+ resolve(isQueryList ? response.data.list || response.data.result : response.data || response.data.result)
}
})
})
diff --git a/src/utils/constants.js b/src/utils/constants.js
index 7dd27eb5..ac76dcd3 100644
--- a/src/utils/constants.js
+++ b/src/utils/constants.js
@@ -44,5 +44,12 @@ export const position = {
}
}
+export const entityType = {
+ ip: 'IP',
+ domain: 'Domain',
+ app: 'APP'
+}
+
export const chartTableDefaultPageSize = 10 // table类型图表默认每页数据量
export const chartTableTopOptions = [10, 100] // table类型图表的TOP-N选项
+export const chartPieTableTopOptions = [{ name: 'Sessions', value: 'sessions' }, { name: 'Packets', value: 'packets' }, { name: 'Bytes', value: 'bytes' }] // table类型图表的TOP-N选项
diff --git a/src/utils/tools.js b/src/utils/tools.js
index 12b7aa39..b1b5c6a6 100644
--- a/src/utils/tools.js
+++ b/src/utils/tools.js
@@ -433,7 +433,7 @@ export function getCapitalGeo (countryId) {
return data[countryId]
}
-export function JSONParse (data) {
+function JSONParse (data) {
const firstParse = JSON.parse(data)
if (typeof firstParse === 'string') {
return JSON.parse(firstParse)
diff --git a/src/views/charts/Chart.vue b/src/views/charts/Chart.vue
index a5fbd2f4..378a472d 100644
--- a/src/views/charts/Chart.vue
+++ b/src/views/charts/Chart.vue
@@ -44,21 +44,22 @@
>
{{chartInfo.i18n ? $t(chartInfo.i18n) : chartInfo.name}}
-
+
+
+
+
@@ -66,7 +67,7 @@
-
+
@@ -102,6 +103,7 @@
class="option__select select-topn"
placeholder=""
popper-class="option-popper"
+ @change="tabelLimtChange"
>
TOP {{item}}
TOP
@@ -114,6 +116,7 @@
class="option__select select-column"
:placeholder="$t('common.field')"
popper-class="option-popper"
+ @change="tabelLimtChange"
>
{{item}}
@@ -140,7 +143,6 @@
import * as echarts from 'echarts'
import * as am4Core from '@amcharts/amcharts4/core'
import * as am4Maps from '@amcharts/amcharts4/maps'
-import am4GeoDataWorldLow from '@amcharts/amcharts4-geodata/worldChinaLow'
import { shallowRef } from 'vue'
import {
@@ -166,9 +168,9 @@ import ChartMap from '@/components/charts/ChartMap'
import PieTable from '@/components/charts/PieTable'
import StatisticsLegend from '@/components/charts/StatisticsLegend'
import ChartTablePagination from '@/components/charts/ChartTablePagination'
-import { chartTableDefaultPageSize, chartTableTopOptions } from '@/utils/constants'
+import { chartTableDefaultPageSize, chartTableTopOptions, storageKey, chartPieTableTopOptions } from '@/utils/constants'
import { get } from '@/utils/http'
-import { replaceUrlPlaceholder, getCapitalGeo } from '@/utils/tools'
+import { replaceUrlPlaceholder, getCapitalGeo, getGeoData } from '@/utils/tools'
export default {
name: 'Chart',
@@ -195,7 +197,7 @@ export default {
table: {
pageSize: chartTableDefaultPageSize,
limit: chartTableTopOptions[0], // top-n
- orderBy: '',
+ orderBy: 'sessions',
tableColumns: [], // table字段
tableData: [], // table的所有数据
currentPageData: [] // table当前页的数据
@@ -206,11 +208,14 @@ export default {
icon: ''
},
activeTab: '',
- statisticsData: []
+ statisticsData: [],
+ orderPieTable: chartPieTableTopOptions[0].value,
+ selectPieChartName: ''
}
},
methods: {
initChart () {
+ const self = this
const chartParams = this.chartInfo.params ? JSON.parse(this.chartInfo.params) : null // 图表参数
if (this.isMap) {
this.myChart = this.initMap(`chart${this.chartInfo.id}`)
@@ -307,41 +312,7 @@ export default {
this.myChart = echarts.init(dom)
if (chartParams) {
if (this.isEchartsWithTable) {
- const queryParams = { startTime: parseInt(this.startTime / 1000), endTime: parseInt(this.endTime / 1000), limit: 10 } // 统计数据的查询参数
- const tableQueryParams = { startTime: parseInt(this.startTime / 1000), endTime: this.endTime, limit: 10 } // 统计数据的查询参数
- get(replaceUrlPlaceholder(chartParams.url, queryParams)).then(response => {
- if (response.code === 200) {
- const data = response.data.result
- this.chartOption.series[0].data = data.map(d => {
- return {
- data: d,
- name: d[chartParams.nameColumn],
- value: parseInt(d[chartParams.valueColumn])
- }
- })
- if (this.chartOption.series[0].data && this.chartOption.series[0].data.length > 10) { // pieWithTable 图例超过10个改为滚动显示
- this.chartOption.legend.type = 'scroll'
- }
- this.myChart.setOption(this.chartOption)
- this.$nextTick(() => {
- this.myChart.resize()
- })
- tableQueryParams[chartParams.nameColumn] = data[0][chartParams.nameColumn]
- get(replaceUrlPlaceholder(chartParams.urlTable, tableQueryParams)).then(response2 => {
- if (response2.code === 200) {
- this.pieTableData = response2.data.result
- }
- })
- }
- })
-
- this.myChart.on('click', function (echartParams) {
- get(replaceUrlPlaceholder(chartParams.urlTable, tableQueryParams)).then(response => {
- if (response.code === 200) {
- this.pieTableData = response.data.result
- }
- })
- })
+ this.chartWithPieTableInit(chartParams)
} else if (this.isEchartsWithStatistics) {
const queryParams = { startTime: parseInt(this.startTime / 1000), endTime: parseInt(this.endTime / 1000) }
get(replaceUrlPlaceholder(chartParams.url, queryParams)).then(response => {
@@ -387,21 +358,7 @@ export default {
}
} else if (this.isTable) {
if (chartParams) {
- const queryParams = { startTime: parseInt(this.startTime / 1000), endTime: parseInt(this.endTime / 1000), limit: 100, order: 'sessions' }
- get(replaceUrlPlaceholder(chartParams.url, queryParams)).then(response => {
- if (response.code === 200) {
- const tableColumns = new Set()
- response.data.result.forEach(d => {
- Object.keys(d).forEach(k => {
- tableColumns.add(k)
- })
- })
- this.table.tableColumns = tableColumns
- this.table.tableData = response.data.result
- this.table.orderBy = this.table.tableColumns[0]
- this.table.currentPageData = this.getTargetPageData(1, this.table.pageSize, this.table.tableData)
- }
- })
+ this.initChartTable(chartParams)
}
} else if (this.isSingleValue) {
if (chartParams) {
@@ -430,7 +387,7 @@ export default {
},
initMap (id) {
const chart = am4Core.create(id, am4Maps.MapChart)
- chart.geodata = am4GeoDataWorldLow
+ chart.geodata = getGeoData(storageKey.iso36112WorldLow)
chart.projection = new am4Maps.projections.Miller()
const polygonSeries = chart.series.push(new am4Maps.MapPolygonSeries())
polygonSeries.useGeodata = true
@@ -448,6 +405,84 @@ export default {
},
getTargetPageData (pageNum, pageSize, tableData) {
return this.$_.slice(tableData, (pageNum - 1) * pageSize, pageNum * pageSize)
+ },
+ orderPieTableChange () {
+ const chartParams = this.chartInfo.params ? JSON.parse(this.chartInfo.params) : null // 图表参数
+ this.myChart.off('click')
+ this.chartWithPieTableInit(chartParams)
+ },
+ chartWithPieTableInit (chartParams) {
+ const self = this
+ chartParams.valueColumn = this.orderPieTable
+ const queryParams = { startTime: parseInt(this.startTime / 1000), endTime: parseInt(this.endTime / 1000), limit: 10, order: this.orderPieTable } // 统计数据的查询参数
+ const tableQueryParams = { startTime: parseInt(this.startTime / 1000), endTime: this.endTime, limit: 10, order: this.orderPieTable } // 统计数据的查询参数
+ tableQueryParams[chartParams.nameColumn] = [] // 处理两个图表不一样的地方
+ get(replaceUrlPlaceholder(chartParams.url, queryParams)).then(response => {
+ if (response.code === 200) {
+ const data = response.data.result
+ this.chartOption.series[0].data = data.map(d => {
+ if (chartParams.nameColumn === 'fqdnCategoryName') {
+ tableQueryParams[chartParams.nameColumn].push(d[chartParams.nameColumn])
+ }
+ return {
+ data: d,
+ name: d[chartParams.nameColumn],
+ value: parseInt(d[chartParams.valueColumn])
+ }
+ })
+ if (tableQueryParams[chartParams.nameColumn].length) {
+ // tableQueryParams[chartParams.nameColumn] = JSON.stringify(tableQueryParams[chartParams.nameColumn])
+ }
+ if (this.chartOption.series[0].data && this.chartOption.series[0].data.length > 10) { // pieWithTable 图例超过10个改为滚动显示
+ this.chartOption.legend.type = 'scroll'
+ }
+ this.myChart.setOption(this.chartOption)
+ this.$nextTick(() => {
+ this.myChart.resize()
+ })
+ get(replaceUrlPlaceholder(chartParams.urlTable, tableQueryParams)).then(response2 => {
+ if (response2.code === 200) {
+ this.pieTableData = response2.data.result
+ }
+ })
+ }
+ })
+
+ this.myChart.on('click', function (echartParams) {
+ const childrenParams = { startTime: parseInt(self.startTime / 1000), endTime: parseInt(self.endTime / 1000), limit: 10 }
+ childrenParams[chartParams.nameColumn] = echartParams.name
+ if (self.selectPieChartName === echartParams.name) {
+ self.selectPieChartName = ''
+ childrenParams[chartParams.nameColumn] = tableQueryParams[chartParams.nameColumn]
+ } else {
+ self.selectPieChartName = echartParams.name
+ }
+ get(replaceUrlPlaceholder(chartParams.urlTable, childrenParams)).then(response2 => {
+ if (response2.code === 200) {
+ self.pieTableData = response2.data.result
+ }
+ })
+ })
+ },
+ tabelLimtChange () {
+ const chartParams = this.chartInfo.params ? JSON.parse(this.chartInfo.params) : null // 图表参数
+ this.initChartTable(chartParams)
+ },
+ initChartTable (chartParams) {
+ const queryParams = { startTime: parseInt(this.startTime / 1000), endTime: parseInt(this.endTime / 1000), limit: this.table.limit, order: this.table.orderBy }
+ get(replaceUrlPlaceholder(chartParams.url, queryParams)).then(response => {
+ if (response.code === 200) {
+ const tableColumns = new Set()
+ response.data.result.forEach(d => {
+ Object.keys(d).forEach(k => {
+ tableColumns.add(k)
+ })
+ })
+ this.table.tableColumns = Array.from(tableColumns)
+ this.table.tableData = response.data.result
+ this.table.currentPageData = this.getTargetPageData(1, this.table.pageSize, this.table.tableData)
+ }
+ })
}
},
computed: {
@@ -470,6 +505,7 @@ export default {
chartInfo,
layoutConstant,
chartTableTopOptions,
+ chartPieTableTopOptions,
chartOption: getOption(props.chart.type),
isEcharts: isEcharts(props.chart.type),
isEchartsWithTable: isEchartsWithTable(props.chart.type),
diff --git a/src/views/charts/Panel.vue b/src/views/charts/Panel.vue
index de997dc7..53132a0d 100644
--- a/src/views/charts/Panel.vue
+++ b/src/views/charts/Panel.vue
@@ -101,6 +101,7 @@ export default {
chart.i = chart.id
return chart
})
+ // this.chartList = [this.chartList[7], this.chartList[12]]
}
},
timeRefreshChange () {
diff --git a/src/views/entities/EntityExplorer.vue b/src/views/entities/EntityExplorer.vue
index 260376e7..bfd1a0f9 100644
--- a/src/views/entities/EntityExplorer.vue
+++ b/src/views/entities/EntityExplorer.vue
@@ -1,13 +1,130 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-