diff --git a/src/assets/css/components/components/charts/panel.scss b/src/assets/css/components/components/charts/panel.scss deleted file mode 100644 index 77c31ec6..00000000 --- a/src/assets/css/components/components/charts/panel.scss +++ /dev/null @@ -1,974 +0,0 @@ -.entity-detail-tool { - display: flex; - justify-content: space-between; - align-items: center; - margin: 10px 20px 10px 0; - padding: 0 20px; - height: 60px; - background-color: #FFFFFF; - box-shadow: 0 1px 2px 0 rgba(0,0,0,0.06); - border-radius: 2px; - - .cn-icon-arrow-left-circle { - color: $--color-primary; - font-size: 20px; - } -} - -.chart-error-popper{ - word-wrap:break-word; - word-break:break-word; - border: 1px solid #e02f44; - min-width: 180px !important; - max-width: 280px !important; -} - -.chart-header-position{ - position: relative; -} - -.chart-error-popper.el-popper.is-light { - background: #e02f44; - border: 1px solid #e02f44; -} -.chart-error-popper.el-popover.el-popper { - color:white; -} - -.chart-error-popper.el-popper.is-light[data-popper-placement^='top'] .el-popper__arrow::before { - border-color: #e02f44; - background: #e02f44; - bottom:0px; -} - -.chart-error-popper.el-popper.is-light[data-popper-placement^='bottom'] .el-popper__arrow::before { - border-color: #e02f44; - background: #e02f44; -} - -.chart-info-corner { - color: #767980; - cursor: pointer; - position: absolute; - display: none; - left: 0; - width: 28px; - height: 28px; - z-index: 2; - top: 0; -} -.chart-info-corner--error { - display: block; - color: #fff; -} -.chart-info-corner--error .chart-info-corner-inner { - border-left: 28px solid #e02f44; - border-right: none; - border-bottom: 28px solid rgba(0,0,0,0); -} -.chart-info-corner-inner { - width: 0; - height: 0; - position: absolute; - left: 0; - bottom: 0; -} -.chart-info-corner .fa { - position: absolute; - top: 2px; - left: 6px; - font-size: 65%; - z-index: 3; - font-style: normal; -} -.cn-chart-icon-warning:before { - content: "!"; - font-weight:normal; -} - -.cn-chart:not(.cn-chart__group):not(.cn-chart__block) { - &>.cn-chart__body { - height: 100%; - width: 100%; - } -} -.cn-panel, .cn-panel>.cn-chart__tabs>.el-tabs__content>.el-tab-pane, .cn-chart__group .cn-chart__body, .cn-chart__block .cn-chart__body { - display: grid; - grid-template-columns: repeat(30, 1fr); - grid-auto-flow: row; - grid-gap: 10px; - overflow: auto; - padding-right: 20px; - position: relative; - - .panel__time { - position: absolute; - right: 20px; - top: 10px; - z-index: 1; - display: flex; - - &>div { - margin-left: 10px; - } - } - - &>.cn-chart { - position: relative; - background-color: #FFFFFF; - border: 1px solid #E7EAED; - box-shadow: 0 2px 4px 0 rgba(51,51,51,0.02); - border-radius: 2px; - height: calc(100% - 47px); - width: 100%; - - .chart-drawing { - height: 100%; - width: 100%; - } - } - &>.cn-chart__whois>.cn-chart__body { - overflow: auto; - } - &>.cn-chart__echarts, &>.cn-chart__table, &>.cn-chart__map, &>.cn-chart__group, &>.cn-chart__block, &>.cn-chart__whois, &>.cn-chart__dns-record, &>.cn-chart__app-basic { - display: flex; - flex-direction: column; - .cn-chart__header { - display: flex; - justify-content: space-between; - align-items: center; - flex-shrink: 0; - padding: 10px 20px 10px 18px; - height: 47px; - - .cn-chart__title { - font-size: 16px; - color: #333333; - font-weight: bold; - } - .header__operations { - color: #999; - } - } - .cn-chart__body { - flex: auto; - display: flex; - .el-descriptions { - padding-top: 30px; - } - &>.el-descriptions { - flex: 0 0 350px; - padding: 30px 36px; - } - .chart-location { - display: flex; - flex: 1; - flex-direction: column; - padding: 0 20px 20px 0; - } - .el-descriptions__content { - color: #3976CB; - } - } - } - &>.cn-chart__block { - &>.cn-chart__header { - height: 60px; - border-bottom: none !important; - } - &>.cn-chart__body { - display: grid !important; - grid-template-columns: repeat(30, 1fr); - grid-auto-flow: row; - grid-gap: 10px; - padding: 0 20px; - &>.cn-chart { - border: 1px solid #E7EAED; - } - /* detail页面block下的五连图的标题样式改变 */ - .cn-chart__group .cn-chart__echarts { - .cn-chart__header { - border-bottom: none !important; - - .header__title { - font-size: 14px !important; - color: #3976CB !important; - } - } - } - } - } - .cn-chart__group { - .cn-chart__header { - border-bottom: 1px solid $--content-right-background-color; - } - &>.cn-chart__body { - display: grid !important; - grid-gap: 10px; - padding: 0 20px; - .cn-chart { - border: none; - box-shadow: none; - } - } - } - &>.cn-chart__title { - display: flex; - align-items: center; - font-size: 20px; - padding-left: 10px; - color: #333; - background-color: transparent; - box-shadow: none; - border: none; - } - &>.cn-chart__tabs { - padding: 10px 25px 10px 15px; - - .el-tabs__nav-wrap::after { - height: 1px; - } - &>.el-tabs__header { - margin-bottom: 10px; - } - &>.el-tabs__content { - height: calc(100% - 40px); - } - } - &>.cn-chart__table { - .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: 80px; - 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: 86px; - 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; - - &: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--echarts { - 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: 86px; - padding-left: 8px; - } - } - .icon-group-divide { - height: 14px; - width: 1px; - background-color: $--color-primary; - } - i { - font-size: 12px; - } - } - } - } - .cn-chart__body { - overflow: hidden 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__body.pie-with-table { - flex-basis: 40%; - } - .cn-chart__footer.pie-with-table { - flex-basis: 60%; - padding: 10px 30px 30px; - } - } - .pie-table { - font-size: 14px; - color: #333333; - font-weight: 500; - - .el-table__header-wrapper { - .cell { - color: #333; - } - } - .el-table__expanded-cell[class*=cell] { - padding: 0; - } - - .expand-table .el-table__body .el-table__row:last-of-type td { - border: none; - } - .expand-table { - font-weight: 400; - color: #606266; - - .el-table__body-wrapper { - height: auto !important; - } - } - } - .chart__legend { - width: calc(100% - 40px); - border: 1px solid #E7EAED; - color: #5f6368; - margin: auto; - margin-bottom: 15px; - - .chart__table-top { - width: 100%; - height: 30px; - border-bottom: #E7EAED 1px solid; - display: flex; - - div { - font-size: 13px; - line-height: 28px; - color: $--color-primary; - } - } - .chart__table-below { - height: 240px; - width: 100%; - font-size: 13px; - } - .table-below-box { - width: 100%; - display: flex; - align-items: center; - line-height: 24px; - } - .table-below-box:hover { - background-color: #f9f9f9; - border: 0; - color: #383838; - } - .table__below-color { - width: 27px; - height: 7px; - flex-shrink: 0; - padding-left: 10px; - - div { - height: 100%; - width: 100%; - border-radius: 24%; - } - } - .table__below-title { - padding: 0 6px; - flex-shrink: 1; - flex-grow: 1; - overflow: hidden; - min-width: 200px; - text-overflow: ellipsis; - white-space: nowrap; - } - .table__below-statistics { - width: 80px; - flex-shrink: 0; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } - .table-below-box:not(.chart__table-top) { - cursor: pointer; - } - .table-below-box.table-below-box--inactivated { - color: #ccc; - .table__below-color div { - background-color: #ccc !important; - } - } - } -} -@media only screen and (min-width : 10px) { - .cn-panel, .cn-panel>.cn-chart__tabs>.el-tabs__content>.el-tab-pane, - .cn-chart__body { - grid-auto-rows: 25px; - } -} -@media only screen and (min-width : 1224px) { - .cn-panel, - .cn-panel>.cn-chart__tabs>.el-tabs__content>.el-tab-pane, - .cn-chart__body { - grid-auto-rows: 30px; - } -} -@media only screen and (min-width : 1824px) { - .cn-panel, - .cn-panel>.cn-chart__tabs>.el-tabs__content>.el-tab-pane, - .cn-chart__body { - grid-auto-rows: 40px; - } -} -@media only screen and (min-width : 2424px) { - .cn-panel, - .cn-panel>.cn-chart__tabs>.el-tabs__content>.el-tab-pane, - .cn-chart__body { - grid-auto-rows: 55px; - } -} -.cn-panel>.cn-chart__tabs>.el-tabs__content>.el-tab-pane>.cn-chart { - border: none; - box-shadow: none; - .cn-chart__header { - border-bottom: none; - } -} - -.cn-entity-detail { - height: 100%; - width: 100%; - overflow: hidden; - .entity-detail__header { - display: flex; - justify-content: space-between; - height: 70px; - padding-right: 20px; - background-color: #F7F9FB; - - .detail-header__title { - display: flex; - align-items: center; - padding-left: 20px; - font-size: 20px; - - .title__icon-circle { - display: flex; - justify-content: center; - align-items: center; - height: 38px; - width: 38px; - border-radius: 50%; - background-color: #B8C1D1; - - i { - color: white; - font-size: 20px; - } - } - .title__name { - text-overflow: ellipsis; - max-width: 400px; - overflow: hidden; - white-space: nowrap; - padding-left: 10px; - color: #333; - } - } - .detail-header__operation { - display: flex; - align-items: flex-end; - - .panel__time { - display: flex; - padding: 0 30px 10px 0; - } - - & > .el-tabs > .el-tabs__header { // header背景色 - margin: 0 0 -1px 0; - - & > .el-tabs__nav-wrap > .el-tabs__nav-scroll > .el-tabs__nav { - & > .el-tabs__item { - height: 35px; - line-height: 35px; - } - & > .el-tabs__item.is-active { // 激活的tab上边框和背景色 - background-color: white; - border-top: 2px solid #0091ff; - } - & > .el-tabs__active-bar { - display: none; - } - & > div:last-of-type { - padding-right: 20px; - } - & > div:nth-of-type(2) { - padding-left: 20px; - } - } - } - & > .el-tabs > .el-tabs__header > .el-tabs__nav-wrap::after { // 去掉tabs下方边框 - height: 0 !important; - } - &>.el-tabs { // 底部对齐 - display: flex; - align-items: flex-end; - } - } - } - .entity-detail__body { - height: 100%; - width: 100%; - overflow: auto; - /*&>div { - display: grid; - grid-template-columns: repeat(30, 1fr); - grid-auto-flow: row; - grid-gap: 10px; - height: 100%; - } - - .cn-panel { - padding: 20px; - grid-gap: 10px; - - &>.cn-chart>.cn-chart__header { - border-bottom: 1px solid $--content-right-background-color; - .header__title>span { - color: #1890FF; - font-weight: bold; - font-size: 16px; - } - } - &>.cn-chart>.cn-chart__body { - .cn-chart__header { - border-bottom: 1px solid $--content-right-background-color; - .header__title { - color: #666; - font-size: 16px; - } - } - } - }*/ - } -} -.el-overlay { - overflow: hidden !important; -} -.entity-detail__dialog { - height: 90vh; - overflow: hidden; - .el-dialog__header { - display: none; - } - .el-dialog__body { - height: 100%; - padding: 0; - } -} -.option-popper { - .el-select-dropdown__item { - height: 24px; - line-height: 24px; - font-size: 12px; - } -} -.header__operation-btn { - margin-left: 12px; - cursor: pointer; - color: #999; -} -.ip-detail-as { - color: #999; - font-size: 12px; - padding-left: 10px; -} -//.cn-chart-select{ -// display: flex; -// align-items: center; -// height: 22px; -// margin-left: 10px; -// color: #0091ff; -// border: 1px solid #0091ff; -// border-radius: 2px; -//} -.cn-chart__single-value.cn-chart__single-value--detail-overview.cn-chart__single-value--icon-left { - .single-value__icon { - width: 38px; - height: 38px; - - i { - font-size: 15px; - } - } - .single-value__content { - .content__data { - font-size: 14px; - } - .content__title { - font-size: 12px; - } - } -} -.cn-chart__single-value.cn-chart__single-value--icon-left { - display: flex; - align-items: center; - - .single-value-icon__box { - display: flex; - align-items: center; - justify-content: center; - flex: 0 0 40%; - } - - .single-value__icon { - display: flex; - justify-content: center; - width: 72px; - height: 72px; - background-color: $--chart-single-value-icon-background-color; - border-radius: 50%; - - i { - display: flex; - align-items: center; - font-size: 28px; - color: $--color-primary; - } - } - - .single-value__content { - display: flex; - flex-direction: column; - max-width: 60%; - padding-right: 10px; - - .content__data { - padding-bottom: 7%; - font-size: 24px; - color: #333333; - font-weight: bold; - } - .content__title { - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - font-size: 16px; - color: #666666; - } - &.single-value__content--with-chart { - .content__title { - border-bottom: 1px solid $--content-right-background-color; - } - } - .single-value__unit { - font-weight: normal; - padding-left: 10px; - color: #666; - font-size: 20px; - } - } -} -.cn-chart__single-value.cn-chart__single-value--icon-right { - display: flex; - flex-direction: row-reverse; - justify-content: space-around; - align-items: center; - - .single-value__icon { - background-color: $--chart-single-value-icon-background-color; - border-radius: 50%; - position: relative; - margin-right: 7.5%; - margin-bottom: 6%; - width: 56px; - height: 56px; - - i { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%,-50%); - font-size: 24px; - color: $--color-primary; - } - } - - .single-value__content { - display: flex; - height: 100%; - flex-direction: column; - - .content__title { - display: flex; - align-items: center; - height: 50%; - font-size: 16px; - color: #666666; - } - .content__data { - display: flex; - padding-top: 5%; - height: 50%; - flex: auto; - font-size: 24px; - color: #333333; - font-weight: bold; - } - } -} -.cn-chart__single-value.cn-chart__single-value--icon-right--color { - display: flex; - flex-direction: row-reverse; - justify-content: space-around; - align-items: center; - - .single-value__content { - display: flex; - height: 100%; - width: 100%; - flex-direction: row-reverse; - justify-content: space-between; - align-items: center; - - .single-value-icon__box { - padding-right: 30px; - .single-value__icon { - border-radius: 50%; - position: relative; - margin-right: 7.5%; - margin-top: 30%; - - .cn-icon-svg { - width: 50px; - height: 50px; - vertical-align: middle; - fill: currentColor; - overflow: hidden; - } - - i { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%,-50%); - font-size: 24px; - } - } - } - - .single-value__data{ - display: flex; - height: 100%; - flex-direction: column; - padding-left: 20px; - - .content__title { - display: flex; - align-items: end; - height: 50%; - font-size: 16px; - color: #666666; - padding-bottom: 5px; - } - .content__data { - display: flex; - padding-top: 5%; - height: 50%; - flex: auto; - font-size: 24px; - color: #333333; - font-weight: bold; - } - } - - } -} -.cn-chart__single-value.cn-chart__single-value--chart { - display: flex; - padding: 13px 20px; - - .single-value__content { - display: flex; - height: 100%; - width: 100%; - flex-direction: column; - - .content__title { - display: flex; - align-items: center; - height: 30%; - font-size: 16px; - color: #666666; - } - .content__data { - display: flex; - align-items: center; - height: 25%; - font-size: 24px; - color: #333333; - font-weight: bold; - } - .content__chart { - flex: auto - } - } -} - -.chart-table-pagination.el-pagination { - padding: 12px 0 9px 0; - text-align: center; - - .el-pagination__jump { - margin-left: 10px; - } -} diff --git a/src/components/charts/ChartMap.vue b/src/components/charts/ChartMap.vue deleted file mode 100644 index 573f993b..00000000 --- a/src/components/charts/ChartMap.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - diff --git a/src/components/charts/ChartSingleValue.vue b/src/components/charts/ChartSingleValue.vue deleted file mode 100644 index 5721bd84..00000000 --- a/src/components/charts/ChartSingleValue.vue +++ /dev/null @@ -1,95 +0,0 @@ - - - diff --git a/src/components/charts/ChartTable.vue b/src/components/charts/ChartTable.vue deleted file mode 100644 index 523e692b..00000000 --- a/src/components/charts/ChartTable.vue +++ /dev/null @@ -1,72 +0,0 @@ - - - diff --git a/src/components/charts/ChartTableActiveIp.vue b/src/components/charts/ChartTableActiveIp.vue deleted file mode 100644 index bde28488..00000000 --- a/src/components/charts/ChartTableActiveIp.vue +++ /dev/null @@ -1,112 +0,0 @@ - - - - - diff --git a/src/components/charts/ChartTablePagination.vue b/src/components/charts/ChartTablePagination.vue deleted file mode 100644 index 521d861c..00000000 --- a/src/components/charts/ChartTablePagination.vue +++ /dev/null @@ -1,55 +0,0 @@ - - - diff --git a/src/components/charts/ChartTitle.vue b/src/components/charts/ChartTitle.vue deleted file mode 100644 index f790cfc5..00000000 --- a/src/components/charts/ChartTitle.vue +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/src/components/charts/EchartsFrame.vue b/src/components/charts/EchartsFrame.vue deleted file mode 100644 index bc2acb6c..00000000 --- a/src/components/charts/EchartsFrame.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - diff --git a/src/components/charts/PieTable.vue b/src/components/charts/PieTable.vue deleted file mode 100644 index 2615da28..00000000 --- a/src/components/charts/PieTable.vue +++ /dev/null @@ -1,258 +0,0 @@ - - - diff --git a/src/components/charts/chart-options.js b/src/components/charts/chart-options.js deleted file mode 100644 index 460c4e6d..00000000 --- a/src/components/charts/chart-options.js +++ /dev/null @@ -1,828 +0,0 @@ -/** - * @author 陈劲松 - * @date 2021/6/16 - * @description chart option和一些工具 -*/ -import { format } from 'echarts' -import { unitTypes } from '@/utils/constants' -import unitConvert from '@/utils/unit-convert' -import _ from 'lodash' -export const chartColor = ['#5370C6', '#90CC74', '#FAC858', '#EE6666', - '#73BFDE', '#3BA172', '#FC8452', '#9960B4', - '#E97CCC', '#FEA69E', '#0F8AB2', '#57CBAC', - '#5888BC', '#63B6AC', '#EDC6B2', '#D5746B'] -export const chartBarColor = ['#0F8AB2', '#57CBAC'] -export function getChartColor (index) { - return chartColor[index % chartColor.length] -} -export function getCharBartColor (index) { - return chartBarColor[index % chartBarColor.length] -} -const line = { - tooltip: { - appendToBody: true, - trigger: 'axis', - textStyle: { - width: '20px', - overflow: 'truncate' - }, - formatter: axiosFormatter, - show: true, - className: 'nz-chart-tooltip', - extraCssText: 'box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);max-width: 300px !important' - }, - xAxis: { - type: 'time' - }, - yAxis: { - type: 'value', - axisLabel: { - formatter: function (value, index, a, b) { - return unitConvert(value, unitTypes.number).join(' ') - } - }, - minInterval: 1 - }, - animation: false, - grid: { - left: 55, - bottom: 30, - top: 100, - right: 25 - }, - color: chartColor, - legend: { - tooltip: { - show: true, - formatter: '{a}' - }, - show: true, - right: 23, - top: 8, - padding: 2, - orient: 'horizontal', - icon: 'circle', - itemGap: 10, - itemWidth: 10, - textStyle: { - padding: [0, 0, 0, 2], - fontSize: 14 - }, - formatter: tooLongFormatter - }, - axisLabel: { - fontSize: 14 - }, - series: [ - { - name: '', - type: 'line', - smooth: false, - symbol: 'none', - data: [] - } - ] -} -const lineWithStatistics = { - tooltip: { - appendToBody: true, - trigger: 'axis', - textStyle: { - width: '20px', - overflow: 'truncate' - }, - formatter: axiosFormatter, - className: 'nz-chart-tooltip', - extraCssText: 'box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);max-width: 300px !important' - }, - xAxis: { - type: 'time' - }, - animation: false, - yAxis: { - type: 'value', - axisLabel: { - formatter: function (value, index) { - return unitConvert(value, unitTypes.number).join(' ') - } - }, - minInterval: 1 - }, - color: chartColor, - grid: { - left: 55, - bottom: 30, - top: 20, - right: 20 - }, - legend: { - show: false - }, - axisLabel: { - fontSize: 14 - }, - series: [ - { - name: '', - type: 'line', - smooth: false, - symbol: 'none', - data: [] - } - ] -} -const lineStack = { - tooltip: { - appendToBody: true, - trigger: 'axis', - textStyle: { - width: '20px', - overflow: 'truncate' - }, - formatter: axiosFormatter, - className: 'nz-chart-tooltip', - extraCssText: 'box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);max-width: 300px !important' - }, - xAxis: { - type: 'time' - }, - color: chartColor, - yAxis: { - type: 'value', - axisLabel: { - formatter: function (value, index) { - return unitConvert(value, unitTypes.number).join(' ') - } - }, - minInterval: 1 - }, - grid: { - left: 55, - bottom: 45, - top: 10, - right: 180 - }, - legend: { - show: true, - right: 30, - top: 'middle', - orient: 'vertical', - icon: 'circle', - itemGap: 20, - itemWidth: 10, - formatter: tooLongFormatter, - textStyle: { - padding: [0, 0, 0, 5], - fontSize: 14 - } - }, - axisLabel: { - fontSize: 14 - }, - series: [ - { - name: '', - type: 'line', - stack: 'value', - areaStyle: {}, - symbol: 'none', - data: [] - } - ] -} -const pieWithTable = { - tooltip: { - appendToBody: true - }, - color: chartColor, - animation: false, - legend: { - orient: 'vertical', - type: 'plain', - left: '60%', - top: 'middle', - icon: 'circle', - itemWidth: 10, // 设置宽度 - itemHeight: 10, // 设置高度 - itemGap: 20, - formatter: tooLongFormatter, - tooltip: { - show: true - } - }, - series: [ - { - type: 'pie', - selectedMode: 'single', - radius: ['42%', '65%'], - center: ['30%', '50%'], - data: [], - label: { - formatter: '{d}%' - }, - tooltip: { - formatter: function (param, index, callback) { - return `${param.name}: ${unitConvert(param.value, param.data.unitType).join(' ')}` - } - }, - emphasis: { - itemStyle: { - shadowBlur: 10, - shadowOffsetX: 0, - shadowColor: 'rgba(0, 0, 0, 0.5)' - } - } - } - ] -} -const ipHostedDomain = { - color: chartColor, - animation: false, - tooltip: { - show: true - }, - legend: { - orient: 'vertical', - type: 'plain', - right: '8%', - top: 'middle', - icon: 'circle', - itemWidth: 10, // 设置宽度 - itemHeight: 10, // 设置高度 - itemGap: 20, - tooltip: { - show: true - } - }, - series: [ - { - type: 'pie', - selectedMode: 'single', - radius: ['42%', '65%'], - center: ['36%', '50%'], - data: [], - label: { - formatter: '{d}%' - }, - tooltip: { - formatter: function (param, index, callback) { - return `${param.name}: ${unitConvert(param.value, param.data.unitType).join(' ')}` - } - }, - emphasis: { - itemStyle: { - shadowBlur: 10, - shadowOffsetX: 0, - shadowColor: 'rgba(0, 0, 0, 0.5)' - } - } - } - ] -} -const singleValueLine = { - tooltip: { - show: true, - enterable: true, - showContent: true, - appendToBody: true, - trigger: 'axis', - textStyle: { - width: '20px', - overflow: 'truncate' - } - }, - xAxis: { - type: 'time', - show: false - }, - yAxis: { - type: 'value', - show: false - }, - animation: false, - grid: { - left: 0, - bottom: 2, - top: 5, - right: 0 - }, - color: chartColor, - legend: { - show: false - }, - series: [ - { - type: 'line', - legendHoverLink: false, - itemStyle: { - normal: { - color: '#81C9FF', - lineStyle: { - width: 2 - } - } - }, - data: [], - showSymbol: false, - areaStyle: { color: '#C9EAFF' } - } - ] -} -export const entityListLineOption = { - tooltip: { - appendToBody: true, - trigger: 'axis', - textStyle: { - width: '20px', - overflow: 'truncate' - }, - formatter: axiosFormatter, - show: true, - className: 'nz-chart-tooltip', - extraCssText: 'box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);max-width: 300px !important' - }, - xAxis: { - type: 'time', - show: false - }, - yAxis: { - type: 'value', - show: false - }, - animation: false, - grid: { - left: 0, - bottom: 2, - top: 5, - right: 0 - }, - color: chartColor, - legend: { - show: false - }, - series: [ - { - type: 'line', - legendHoverLink: false, - itemStyle: { - normal: { - lineStyle: { - width: 2 - } - } - }, - data: [], - showSymbol: false - } - ] -} -const relationShip = { - grid: { - left: 0, - bottom: 50, - top: 80, - right: 0 - }, - series: [ - { - type: 'graph', - layout: 'force', - symbolSize: 40, - roam: true, - force: { - repulsion: 350 - }, - draggable: true, - label: { show: true }, - edgeSymbol: ['none', 'arrow'], - edgeSymbolSize: 7, - data: [], - links: [] - } - ] -} -const sankey = { - tooltip: { - trigger: 'item', - triggerOn: 'mousemove' - }, - series: [ - { - type: 'sankey', - data: [], - links: [], - right: '5%', - top: 50, - bottom: 100, - levels: [ - { - depth: 0, - itemStyle: { - color: '#47D49C' - }, - lineStyle: { - color: '#999' - } - }, { - depth: 1, - itemStyle: { - color: '#A69BF5' - }, - lineStyle: { - color: '#999' - } - }, { - depth: 2, - itemStyle: { - color: '#73A0FA' - }, - lineStyle: { - color: '#999' - } - } - ] - } - ] -} -const ipOpenPortBar = { - xAxis: { - type: 'category', - axisTick: { show: false }, - axisLine: { show: false } - }, - grid: { - top: 30, - left: 60, - right: 50, - bottom: 50 - }, - yAxis: { - type: 'value', - show: false - }, - series: [{ - barWidth: 38, - data: [], - type: 'bar', - label: { show: true, position: 'top' }, - barCategoryGap: '10%' - }] -} -const categoryBar = { - tooltip: { - appendToBody: true, - trigger: 'axis', - textStyle: { - width: '20px', - overflow: 'truncate' - }, - formatter: categoryVerticalFormatter, - show: true, - className: 'nz-chart-tooltip', - extraCssText: 'box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);max-width: 300px !important' - }, - xAxis: { - type: 'category', - axisTick: { show: false }, - axisLine: { show: false } - }, - grid: { - top: 20, - left: 10, - right: 25, - bottom: 20, - containLabel: true - }, - yAxis: { - type: 'value', - axisTick: { show: false }, - axisLine: { show: false } - }, - color: chartColor, - series: [{ - barWidth: 15, - data: [], - type: 'bar', - label: { show: false }, - barCategoryGap: '10%', - itemStyle: { - color: function (params) { - return getCharBartColor([params.dataIndex]) - } - } - }] -} - -const timeBar = { - tooltip: { - appendToBody: true, - trigger: 'axis', - textStyle: { - width: '20px', - overflow: 'truncate' - }, - formatter: timeVerticalFormatter, - show: true, - className: 'nz-chart-tooltip', - extraCssText: 'box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);max-width: 300px !important' - }, - xAxis: { - type: 'time', - axisTick: { show: false }, - axisLine: { show: false }, - axisLabel: { - interval: 0, - // rotate: -40, //设置日期显示样式(倾斜度) - formatter: function (value) { // 在这里写你需要的时间格式 - const t_date = new Date(value) - return [t_date.getMonth() + 1, t_date.getDate()].join('/') + ' ' + [t_date.getHours(), t_date.getMinutes()].join(':') - } - } - }, - grid: { - top: 20, - left: 25, - right: 25, - bottom: 20, - containLabel: true - }, - yAxis: { - type: 'value', - axisTick: { show: false }, - axisLine: { show: false }, - axisLabel: { - formatter: function (value, index, a, b) { - return unitConvert(value, unitTypes.number).join(' ') - } - }, - minInterval: 1 - }, - color: chartColor, - series: [{ - barWidth: 15, - data: [], - type: 'bar', - label: { show: false }, - barCategoryGap: '10%', - itemStyle: { - color: function (params) { - return getCharBartColor([params.dataIndex]) - } - } - }] -} -const typeOptionMappings = [ - { value: 11, option: line }, // 常规折线图 - { value: 12, option: lineWithStatistics }, // 带统计表格的折线图 - { value: 13, option: lineStack }, // 折线堆叠图 - { value: 22, option: ipOpenPortBar }, // ip详情--开放端口的柱状图 - { value: 23, option: timeBar }, // 矿机所属单位 - { value: 24, option: categoryBar }, // 挖矿事件统计 - { value: 31, option: pieWithTable }, // 常规折线图 - { value: 33, option: ipHostedDomain }, // ip详情--托管域名 - { value: 34, option: ipHostedDomain }, // app详情--相关域名 - { value: 42, option: relationShip }, // 关系图 - { value: 43, option: sankey }, // 桑基图 - { value: 52, option: singleValueLine } -] -const typeCategory = { - MAP: 'map', - TABLE: 'table', - ECHARTS: 'echarts', - TITLE: 'title', - SINGLE: 'singleValue', - TABS: 'tabs' -} -export function getTypeCategory (type) { - if (isMap(type)) { - return typeCategory.MAP - } else if (isEcharts(type)) { - return typeCategory.ECHARTS - } else if (isTable(type)) { - return typeCategory.TABLE - } else if (isSingleValue(type)) { - return typeCategory.SINGLE - } else if (isTitle(type)) { - return typeCategory.TITLE - } else if (isTabs(type)) { - return typeCategory.TABS - } -} -/* 柱状图:挖矿事件统计(time类型柱状图) */ -export function isEchartsTimeBar (type) { - return type == 23 -} -/* 柱状图:矿机所属单位(category类型柱状图) */ -export function isEchartsCategoryBar (type) { - return type == 24 -} -/* 饼图柱状图等 */ -export function isEcharts (type) { - return type >= 11 && type <= 50 -} -/* 地图 */ -export function isMap (type) { - return type >= 1 && type <= 10 -} -/* 连线地图 */ -export function isMapLine (type) { - return type === 1 -} -/* 色块地图 */ -export function isMapBlock (type) { - return type === 2 -} -/* 带统计的折线图 */ -export function isEchartsWithStatistics (type) { - return type === 12 -} -/* 关系图 */ -export function isRelationShip (type) { - return type === 42 -} -/* 桑基图 */ -export function isSankey (type) { - return type === 43 -} -/* 单值 */ -export function isSingleValue (type) { - return type >= 51 && type <= 60 -} -/* 带折线图的单值 */ -export function isSingleValueWithEcharts (type) { - return type === 52 -} -/* 带折线图的单值 */ -export function isSingleValueWithEchartsTemp (type) { - return type === 55 -} -/* 带Table的饼图 */ -export function isEchartsWithTable (type) { - return type === 31 -} -/* table */ -export function isTable (type) { - return type >= 61 && type <= 70 -} -/* table */ -export function isActiveIpTable (type) { - return type == 63 -} -/* title */ -export function isTitle (type) { - return type === 93 -} -/* tabs */ -export function isTabs (type) { - return type === 91 -} -/* IP实体基本信息 */ -export function isIpBasicInfo (type) { - return type === 4 -} -/* IP实体开放端口 */ -export function isIpOpenPort (type) { - return type === 22 -} -/* IP实体托管域名 */ -export function isIpHostedDomain (type) { - return type === 33 -} -/* APP实体相关域名 */ -export function isAppRelatedDomain (type) { - return type === 34 -} -/* APP实体基本信息 */ -export function isAppBasicInfo (type) { - return type === 82 -} -/* DOMAIN实体Whois */ -export function isDomainWhois (type) { - return type === 83 -} -/* DOMAIN实体DNS记录 */ -export function isDomainDnsRecord (type) { - return type === 84 -} -/* 近期挖矿事件 */ -export function isCryptocurrencyEventList (type) { - return type === 85 -} -/* 组 */ -export function isGroup (type) { - return type === 94 -} -/* 实体详情块 */ -export function isBlock (type) { - return type === 95 -} -export function getOption (type) { - const mapping = typeOptionMappings.find(m => m.value === type) - return mapping && mapping.option ? _.cloneDeep(mapping.option) : null -} -export const layoutConstant = { - HEADER: 'header', - FOOTER: 'footer' -} -export function getLayout (type) { - const layout = [] - if (!isSingleValue(type) && !isTitle(type)) { - layout.push(layoutConstant.HEADER) - } - if (type === 12 || type === 31) { - layout.push(layoutConstant.FOOTER) - } - return layout -} - -function tooLongFormatter (name) { - return format.truncateText(name, 110, '12') -} -function axiosFormatter (params) { - let str = '
' - 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 += ` - ${unitConvert(item.data[1], item.data[2]).join(' ')} - ` - str += '
' - }) - str += '
' - return str -} - -export function timeVerticalFormatter (params) { - let str = '
' - 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 += ` - ${unitConvert(item.data[1], item.data[2]).join(' ')} - ` - str += '
' - }) - str += '
' - return str -} - -export function timeHorizontalFormatter (params) { - let str = '
' - params.forEach((item, i) => { - const tData = item.data[1] - 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 += ` - ${unitConvert(item.data[0], item.data[2]).join(' ')} - ` - str += '
' - }) - str += '
' - return str -} -export function categoryHorizontalFormatter (params) { - let str = '
' - params.forEach((item, i) => { - str += '
' - str += item.data[1] + ': ' + item.data[0] - str += '
' - }) - str += '
' - return str -} -export function categoryVerticalFormatter (params) { - let str = '
' - params.forEach((item, i) => { - str += '
' - str += item.data[0] + ': ' + item.data[1] - str += '
' - }) - str += '
' - return str -} diff --git a/src/components/entities/EntityList.vue b/src/components/entities/EntityList.vue index 35bea4cb..1fa3c9bc 100644 --- a/src/components/entities/EntityList.vue +++ b/src/components/entities/EntityList.vue @@ -126,8 +126,8 @@ import { get } from '@/utils/http' import { api } from '@/utils/api' import * as echarts from 'echarts' -import { getChartColor, entityListLineOption } from '@/components/charts/chart-options' -import { legendMapping } from '@/components/charts/chart-table-title' +import { getChartColor, entityListLineOption } from '@/views/charts/charts/chart-options' +import { legendMapping } from '@/views/charts/charts/chart-table-title' import unitConvert from '@/utils/unit-convert' import { unitTypes } from '@/utils/constants' diff --git a/src/router/index.js b/src/router/index.js index 30bc4aba..580d0ec9 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -10,6 +10,10 @@ const routes = [ path: '/entityDetail', component: () => import('@/views/entityExplorer/EntityDetail') }, + { + path: '/detections', + component: () => import('@/views/detections/Index') + }, { path: '/', component: () => import('@/components/layout/Home'), diff --git a/src/views/charts/Chart.vue b/src/views/charts/Chart.vue index 48bdd627..5ce07b18 100644 --- a/src/views/charts/Chart.vue +++ b/src/views/charts/Chart.vue @@ -1,630 +1,231 @@ diff --git a/src/views/charts/Chart2.vue b/src/views/charts/Chart2.vue deleted file mode 100644 index 5ce07b18..00000000 --- a/src/views/charts/Chart2.vue +++ /dev/null @@ -1,358 +0,0 @@ - - - diff --git a/src/components/charts/ChartError.vue b/src/views/charts/ChartError.vue similarity index 100% rename from src/components/charts/ChartError.vue rename to src/views/charts/ChartError.vue diff --git a/src/views/charts/ChartHeader.vue b/src/views/charts/ChartHeader.vue index 47322a48..1ae0d764 100644 --- a/src/views/charts/ChartHeader.vue +++ b/src/views/charts/ChartHeader.vue @@ -115,7 +115,7 @@ + + diff --git a/src/views/entities/EntityExplorer.vue b/src/views/entities/EntityExplorer.vue deleted file mode 100644 index 2d2ee1d6..00000000 --- a/src/views/entities/EntityExplorer.vue +++ /dev/null @@ -1,487 +0,0 @@ - - - diff --git a/src/views/entityExplorer/entityList/detailOverview/App.vue b/src/views/entityExplorer/entityList/detailOverview/App.vue index fc6c91cd..bd743668 100644 --- a/src/views/entityExplorer/entityList/detailOverview/App.vue +++ b/src/views/entityExplorer/entityList/detailOverview/App.vue @@ -133,14 +133,14 @@
- + >
@@ -149,7 +149,7 @@ import { api } from '@/utils/api' import entityDetailMixin from './entityDetailMixin' import { unitTypes } from '@/utils/constants' import unitConvert from '@/utils/unit-convert' -import Chart2 from '@/views/charts/Chart2' +import Chart from '@/views/charts/Chart' import _ from 'lodash' import ChartSingleValue from '@/views/charts/charts/ChartSingleValue' import { get } from '@/utils/http' @@ -158,7 +158,7 @@ export default { name: 'App', mixins: [entityDetailMixin], components: { - Chart2, + Chart, ChartSingleValue }, data () { diff --git a/src/views/entityExplorer/entityList/detailOverview/Domain.vue b/src/views/entityExplorer/entityList/detailOverview/Domain.vue index 4af40f47..ca055306 100644 --- a/src/views/entityExplorer/entityList/detailOverview/Domain.vue +++ b/src/views/entityExplorer/entityList/detailOverview/Domain.vue @@ -127,7 +127,7 @@
{{$t('entities.recentSecurity')}}
{{entityData.securityNum || '-'}}
-
+
{{security.startTime}}
{{security.securitySeverity}}
@@ -141,14 +141,14 @@
- + >
@@ -158,14 +158,14 @@ import { api } from '@/utils/api' import entityDetailMixin from './entityDetailMixin' import { unitTypes } from '@/utils/constants' import unitConvert from '@/utils/unit-convert' -import Chart2 from '@/views/charts/Chart2' +import Chart from '@/views/charts/Chart' import _ from 'lodash' import { get } from '@/utils/http' export default { name: 'Domain', components: { ChartSingleValue, - Chart2 + Chart }, mixins: [entityDetailMixin], data () { diff --git a/src/views/entityExplorer/entityList/detailOverview/Ip.vue b/src/views/entityExplorer/entityList/detailOverview/Ip.vue index 29ee1a8f..425c3b54 100644 --- a/src/views/entityExplorer/entityList/detailOverview/Ip.vue +++ b/src/views/entityExplorer/entityList/detailOverview/Ip.vue @@ -125,14 +125,14 @@
- + >
@@ -142,7 +142,7 @@ import ChartSingleValue from '@/views/charts/charts/ChartSingleValue' import { api } from '@/utils/api' import { unitTypes } from '@/utils/constants' import unitConvert from '@/utils/unit-convert' -import Chart2 from '@/views/charts/Chart2' +import Chart from '@/views/charts/Chart' import _ from 'lodash' import { get } from '@/utils/http' @@ -150,7 +150,7 @@ export default { name: 'Ip', mixins: [entityDetailMixin], components: { - Chart2, + Chart, ChartSingleValue }, data () { diff --git a/src/views/entityExplorer/entityList/detailOverview/entityDetailMixin.js b/src/views/entityExplorer/entityList/detailOverview/entityDetailMixin.js index 64b53a07..2eda0558 100644 --- a/src/views/entityExplorer/entityList/detailOverview/entityDetailMixin.js +++ b/src/views/entityExplorer/entityList/detailOverview/entityDetailMixin.js @@ -1,7 +1,7 @@ import _ from 'lodash' import { get } from '@/utils/http' import * as echarts from 'echarts' -import { entityListLineOption } from '@/components/charts/chart-options' +import { entityListLineOption } from '@/views/charts/charts/chart-options' import { unitTypes } from '@/utils/constants' import unitConvert from '@/utils/unit-convert' diff --git a/src/views/entityExplorer/entityList/entityListMixin.js b/src/views/entityExplorer/entityList/entityListMixin.js index 9da3a6ca..ee2bedfd 100644 --- a/src/views/entityExplorer/entityList/entityListMixin.js +++ b/src/views/entityExplorer/entityList/entityListMixin.js @@ -2,8 +2,8 @@ import _ from 'lodash' import { get } from '@/utils/http' import { api } from '@/utils/api' import * as echarts from 'echarts' -import { entityListLineOption } from '@/components/charts/chart-options' -import {riskLevelMapping, unitTypes} from '@/utils/constants' +import { entityListLineOption } from '@/views/charts/charts/chart-options' +import { riskLevelMapping, unitTypes } from '@/utils/constants' export default { props: {