'
+ 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 3f72a5a3..d592682c 100644
--- a/src/components/charts/panel.scss
+++ b/src/components/charts/panel.scss
@@ -257,6 +257,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;
@@ -287,3 +391,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/utils/constants.js b/src/utils/constants.js
index 7dd27eb5..28558f64 100644
--- a/src/utils/constants.js
+++ b/src/utils/constants.js
@@ -46,3 +46,4 @@ export const position = {
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/views/charts/Chart.vue b/src/views/charts/Chart.vue
index c190f113..2aa7bd47 100644
--- a/src/views/charts/Chart.vue
+++ b/src/views/charts/Chart.vue
@@ -44,21 +44,22 @@
>