fix:解决冲突

This commit is contained in:
zyh
2022-11-17 18:05:36 +08:00
75 changed files with 1114 additions and 4269 deletions

View File

@@ -576,6 +576,12 @@ textarea {
.el-icon-arrow-right:before { .el-icon-arrow-right:before {
content: "\e6ad"; content: "\e6ad";
} }
.el-icon-arrow-up{
font-family: nz-icon!important;
}
.el-icon-arrow-up:before{
content: "\e6af";
}
.el-icon-arrow-down{ .el-icon-arrow-down{
font-family: nz-icon!important; font-family: nz-icon!important;
} }

View File

@@ -97,14 +97,16 @@
} }
} }
.nz-btn-group { .nz-btn-group {
#endpoint-query-changetime,#recordRules-query-changetime:hover { #endpoint-query-changetime,
#recordRules-query-changetime:hover {
border: 1px solid $--asset-label-btn-border-color; border: 1px solid $--asset-label-btn-border-color;
} }
.nz-btn.nz-btn-size-normal.nz-btn-style-light.control-icon-unchecked:hover { .nz-btn.nz-btn-size-normal.nz-btn-style-light.control-icon-unchecked:hover {
border: 1px solid $--asset-label-btn-border-color; border: 1px solid $--asset-label-btn-border-color;
z-index: 2; z-index: 2;
} }
.nz-btn.nz-btn-size-normal.nz-btn-style-light.control-icon-unchecked,.nz-btn.nz-btn-size-normal.nz-btn-style-light.control-icon-checked { .nz-btn.nz-btn-size-normal.nz-btn-style-light.control-icon-unchecked,
.nz-btn.nz-btn-size-normal.nz-btn-style-light.control-icon-checked {
margin-right: -1px; margin-right: -1px;
} }
.project-calendar.nz-input-group-middle { .project-calendar.nz-input-group-middle {
@@ -277,6 +279,60 @@
height: calc(100% - 15px) !important; height: calc(100% - 15px) !important;
} }
} }
#assetProcessTable {
.el-popover__reference {
display: flex;
align-items: center;
}
.bar {
width: 3px;
height: 14px;
border-radius: 0;
margin-right: 0px;
line-height: 100%;
}
.process-name {
height: 100%;
margin-left: 6px;
line-height: 24px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
#container {
width: 120px;
min-width: 120px;
height: 18px;
margin-right: 20px;
}
.percentage {
flex-grow: 1;
word-wrap: break-word;
}
.el-progress-bar__outer {
border-radius: 2px;
background-color: #e6eaed;
}
.el-progress-bar__inner {
border-radius: 0;
}
.active-icon {
margin-left: 5px;
}
}
#assetNetworkTable{
.process-name{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
#assetVsysTable{
}
// comments // comments
#commentBottomTab { #commentBottomTab {
.sub-container .nz-table-list { .sub-container .nz-table-list {
@@ -297,26 +353,26 @@
border-color: transparent; border-color: transparent;
} }
} }
.comment-editor{ .comment-editor {
border: 1px solid $--border-color-light; border: 1px solid $--border-color-light;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.ql-toolbar.ql-snow{ .ql-toolbar.ql-snow {
border-top: unset !important; border-top: unset !important;
border-left: unset !important; border-left: unset !important;
border-right: unset !important; border-right: unset !important;
} }
.editor-core{ .editor-core {
height: 0 !important; height: 0 !important;
flex: 1; flex: 1;
} }
.ql-container.ql-snow { .ql-container.ql-snow {
border: unset !important border: unset !important;
} }
.text-too-long{ .text-too-long {
display: none; display: none;
} }
.ql-editor.ql-blank::before{ .ql-editor.ql-blank::before {
font-style: normal; font-style: normal;
color: $--color-text-placeholder; color: $--color-text-placeholder;
} }
@@ -368,3 +424,10 @@
} }
} }
} }
//endpoint 二级页面搜索
.endpoint-tab-new {
.top-tool-right .nz-btn.nz-btn-size-normal {
box-sizing: content-box;
}
}

View File

@@ -146,7 +146,7 @@
outline: none; outline: none;
border: 1px solid #ccc; border: 1px solid #ccc;
} }
button:hover { button:hover:not(.footer__btn) {
background: $--background-color-empty; background: $--background-color-empty;
} }
.nz-btn-style-normal { .nz-btn-style-normal {

View File

@@ -15,14 +15,14 @@
color: #fff; color: #fff;
} }
.calendar-dropdown-title { .calendar-dropdown-title {
line-height: 28px; line-height: 30px;
padding-left: 5px; padding-left: 5px;
margin-left: 0; margin-left: 0;
margin-top: -3px !important; margin-top: -5px !important;
text-align: left; text-align: left;
border-radius: 2px; border-radius: 2px;
min-width: 80px; min-width: 80px;
height: 28px; height: 30px;
border: solid 1px $--border-color-base; border: solid 1px $--border-color-base;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
@@ -65,7 +65,7 @@
box-sizing: content-box; box-sizing: content-box;
line-height: unset; line-height: unset;
height: 100%; height: 100%;
margin-left: -6px; margin-left: -1px;
margin-right: 10px; margin-right: 10px;
} }
.nz-icon-compare { .nz-icon-compare {

View File

@@ -116,6 +116,9 @@
height: 100%; height: 100%;
padding-right: 12px; padding-right: 12px;
overflow: auto; overflow: auto;
text-overflow: initial;
white-space: normal;
box-sizing: content-box;
} }
/*第一列宽25%*/ /*第一列宽25%*/
.mib-browser-detail-row>div:first-of-type { .mib-browser-detail-row>div:first-of-type {
@@ -129,6 +132,15 @@
border-left: 1px solid $--border-color-light; border-left: 1px solid $--border-color-light;
word-break: break-all; word-break: break-all;
color: $--color-text-secondary; color: $--color-text-secondary;
box-sizing: border-box;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
.document-copy-text{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
} }
.mib-browser-detail-row:not(:last-of-type) { .mib-browser-detail-row:not(:last-of-type) {
border-bottom: 1px solid $--border-color-light; border-bottom: 1px solid $--border-color-light;
@@ -139,7 +151,6 @@
} }
.mib-browser-detail-row>div { .mib-browser-detail-row>div {
padding-left: 5px; padding-left: 5px;
box-sizing: border-box;
} }
.mib-browser-detail-description { .mib-browser-detail-description {
padding: 0 14px 0 0; padding: 0 14px 0 0;

View File

@@ -3,7 +3,7 @@
position: relative; position: relative;
overflow: auto; overflow: auto;
margin: 0px; margin: 0px;
.el-form{ .el-form {
padding-left: 15px; padding-left: 15px;
} }
.el-tag.el-tag--info { .el-tag.el-tag--info {
@@ -36,34 +36,52 @@
.el-input.el-input--small { .el-input.el-input--small {
width: calc(100% - 49px); width: calc(100% - 49px);
} }
} }
} }
#system-basic{ #system-basic {
display: flex; display: flex;
align-items: center; align-items: center;
.el-form-item__content{ .el-form-item__content {
margin-left: 0px !important; margin-left: 0px !important;
} }
} }
} }
.system-config-form{ .system-config-form.basicForm {
.vue-tags-input {
max-width: unset !important;
}
.vue-tags-input.interface-name .ti-input{
padding: 0px !important;
}
.vue-tags-input .ti-input {
min-height: 32px;
padding: 0px 0px 0px 15px !important;
}
.vue-tags-input .ti-input .ti-new-tag-input-wrapper {
padding: 0;
margin: 0;
}
.vue-tags-input.interface-name .ti-input .ti-new-tag-input-wrapper {
padding-left: 7px;
}
}
.system-config-form {
width: 61.8% !important; width: 61.8% !important;
position: relative; position: relative;
} }
.linkBox{ .linkBox {
max-height: 800px; max-height: 800px;
width: 800px; width: 800px;
} }
.scrollBox{ .scrollBox {
position: relative; position: relative;
height: 600px; height: 600px;
margin-bottom: 20px; margin-bottom: 20px;
} }
.linkTitle{ .linkTitle {
display: flex; display: flex;
align-items:center; align-items: center;
border-bottom: 2px solid $--border-color-base; border-bottom: 2px solid $--border-color-base;
color: #6b778c; color: #6b778c;
font-size: 12px; font-size: 12px;
@@ -71,40 +89,40 @@
line-height: 24px; line-height: 24px;
font-weight: 600; font-weight: 600;
} }
.handle{ .handle {
cursor: move !important; cursor: move !important;
padding:0 5px; padding: 0 5px;
line-height: 34px; line-height: 34px;
} }
.linkBtn{ .linkBtn {
height: 28px; height: 28px;
line-height: 0; line-height: 0;
font-size: 12px; font-size: 12px;
} }
.linkTitleHandle{ .linkTitleHandle {
padding: 0 13px; padding: 0 13px;
} }
.linkAddBox{ .linkAddBox {
display: flex; display: flex;
padding: 10px 0; padding: 10px 0;
border-bottom: 1px solid $--border-color-base; border-bottom: 1px solid $--border-color-base;
font-size: 13px; font-size: 13px;
line-height: 34px; line-height: 34px;
} }
.linkContent{ .linkContent {
display: flex; display: flex;
padding: 10px 0; padding: 10px 0;
font-size: 13px; font-size: 13px;
line-height: 34px; line-height: 34px;
} }
.linkContent:not(:last-child){ .linkContent:not(:last-child) {
border-bottom: 1px solid $--border-color-base; border-bottom: 1px solid $--border-color-base;
} }
.linkFormContent{ .linkFormContent {
display: flex; display: flex;
line-height: 34px; line-height: 34px;
} }
.linkTitleName{ .linkTitleName {
width: 100px; width: 100px;
margin-right: 12px; margin-right: 12px;
overflow: hidden; overflow: hidden;
@@ -112,12 +130,12 @@
white-space: nowrap; white-space: nowrap;
height: 31px; height: 31px;
} }
.linkTitleUrl{ .linkTitleUrl {
width: 462px; width: 462px;
margin-right: 12px; margin-right: 12px;
height: 31px; height: 31px;
} }
.linkTitleUrlContent{ .linkTitleUrlContent {
display: inline-block; display: inline-block;
width: 460px; width: 460px;
overflow: hidden; overflow: hidden;
@@ -127,39 +145,39 @@
cursor: pointer; cursor: pointer;
outline: none; outline: none;
} }
.linkFormBtn .nz-icon-delete{ .linkFormBtn .nz-icon-delete {
cursor: pointer; cursor: pointer;
color: $--color-primary; color: $--color-primary;
margin-left: 10px; margin-left: 10px;
} }
.linkFormBtn .nz-icon-edit{ .linkFormBtn .nz-icon-edit {
font-size: 14px; font-size: 14px;
cursor: pointer; cursor: pointer;
} }
.nz-icon-create-square{ .nz-icon-create-square {
cursor: pointer; cursor: pointer;
color: $--color-text-primary; color: $--color-text-primary;
} }
.el-form-item--small .el-form-item__error{ .el-form-item--small .el-form-item__error {
padding-top: 0; padding-top: 0;
} }
.linkUrlTip{ .linkUrlTip {
width: 430px; width: 430px;
} }
.system-config-form.terminal .el-input-number--small{ .system-config-form.terminal .el-input-number--small {
width: 512px; width: 512px;
} }
.system-config-form.basicForm .el-input-number--small{ .system-config-form.basicForm .el-input-number--small {
width: 512px; width: 512px;
} }
.system-config-form .el-input input{ .system-config-form .el-input input {
text-align: left; text-align: left;
} }
.utc-item { .utc-item {
color: $--color-text-secondary; color: $--color-text-secondary;
font-size: 12px; font-size: 12px;
} }
.system-title{ .system-title {
font-size: 14px; font-size: 14px;
color: $--color-text-regular; color: $--color-text-regular;
letter-spacing: 0; letter-spacing: 0;
@@ -168,7 +186,7 @@
font-weight: 500; font-weight: 500;
margin-bottom: 30px; margin-bottom: 30px;
} }
.system-title-border{ .system-title-border {
border-top: 1px dashed $--border-color-light; border-top: 1px dashed $--border-color-light;
padding-top: 30px; padding-top: 30px;
width: 699px; width: 699px;
@@ -178,19 +196,25 @@
background-color: $--background-color-empty; background-color: $--background-color-empty;
padding: 10px; padding: 10px;
.el-form-item:last-of-type.monitorLastEle { .el-form-item:last-of-type.monitorLastEle {
.el-form-item__content{ .el-form-item__content {
margin-left: 180px !important; margin-left: 180px !important;
margin-bottom: 20px; margin-bottom: 20px;
} }
} }
.el-tabs__nav-scroll{ .el-form-item:last-of-type.monitorLastElement {
.el-form-item__content {
margin-left: 180px !important;
}
}
.el-tabs__nav-scroll {
background-color: $--background-color-empty; background-color: $--background-color-empty;
} }
.el-tabs__nav-scroll,.el-tabs__header,.el-tabs__nav-wrap{ .el-tabs__nav-scroll,
.el-tabs__header,
.el-tabs__nav-wrap {
border-bottom: 0; border-bottom: 0;
} }
.el-form-item:last-of-type { .el-form-item:last-of-type {
.el-form-item__content { .el-form-item__content {
margin-left: 0 !important; margin-left: 0 !important;
text-align: center; text-align: center;
@@ -200,13 +224,14 @@
} }
} }
.full-table { .full-table {
.el-tabs__content{ .el-tabs__content {
height: calc( 100% - 100px); height: calc(100% - 100px);
} }
.list-page .main-container{ .list-page .main-container {
padding: unset; padding: unset;
} }
.table-column-setting,.pagination-bottom{ .table-column-setting,
.pagination-bottom {
display: none; display: none;
} }
} }
@@ -218,17 +243,17 @@
outline: none; outline: none;
box-sizing: border-box; box-sizing: border-box;
} }
.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active { .el-tabs--border-card > .el-tabs__header .el-tabs__item.is-active {
color: $--color-primary; color: $--color-primary;
background: $--background-color-empty; background: $--background-color-empty;
border-bottom: none; border-bottom: none;
margin-left: .1px; margin-left: 0.1px;
} }
.el-tabs--border-card>.el-tabs__header .el-tabs__item:not(.is-disabled):hover { .el-tabs--border-card > .el-tabs__header .el-tabs__item:not(.is-disabled):hover {
color: $--color-primary; color: $--color-primary;
opacity: .8; opacity: 0.8;
} }
.el-tabs--border-card>.el-tabs__header .el-tabs__item { .el-tabs--border-card > .el-tabs__header .el-tabs__item {
height: 40px; height: 40px;
background: $--background-color-base; background: $--background-color-base;
border: 1px solid $--border-color-light; border: 1px solid $--border-color-light;
@@ -236,7 +261,7 @@
border-top-right-radius: 4px; border-top-right-radius: 4px;
margin-top: 0; margin-top: 0;
} }
.el-tabs--border-card>.el-tabs__header .el-tabs__item:not(:first-child) { .el-tabs--border-card > .el-tabs__header .el-tabs__item:not(:first-child) {
margin-left: 5px; margin-left: 5px;
} }
.el-input-group__prepend { .el-input-group__prepend {
@@ -249,7 +274,10 @@
border: 1px solid $--border-color-light; border: 1px solid $--border-color-light;
border-left: none; border-left: none;
} }
.el-input-number__decrease,.el-input-number__increase,.el-input-number__decrease.is-disabled,.el-input-number__increase.is-disabled { .el-input-number__decrease,
.el-input-number__increase,
.el-input-number__decrease.is-disabled,
.el-input-number__increase.is-disabled {
background-color: $--popover-background-color; background-color: $--popover-background-color;
} }
.el-input-number__decrease { .el-input-number__decrease {
@@ -273,21 +301,21 @@
border-color: $--color-primary; border-color: $--color-primary;
} }
} }
.system-config-form .el-form-item__content{ .system-config-form .el-form-item__content {
width: 512px; width: 512px;
} }
.system-config-form .el-input{ .system-config-form .el-input {
width: 512px; width: 512px;
text-align: left; text-align: left;
} }
.system-tabs { .system-tabs {
box-shadow: unset !important; box-shadow: unset !important;
border:unset; border: unset;
border-top: unset; border-top: unset;
height: 100%; height: 100%;
} }
.system-tabs.el-tabs--border-card{ .system-tabs.el-tabs--border-card {
box-shadow: unset !important; box-shadow: unset !important;
height: 100%; height: 100%;
width: 100%; width: 100%;
@@ -295,7 +323,7 @@
border-left: unset; border-left: unset;
background-color: $--background-color-empty; background-color: $--background-color-empty;
} }
.reset-form .el-checkbox-group{ .reset-form .el-checkbox-group {
margin-left: -28px !important; margin-left: -28px !important;
} }
.el-form-item__tip { .el-form-item__tip {
@@ -318,22 +346,32 @@
margin-bottom: 54px; margin-bottom: 54px;
} }
@keyframes warnBackground { @keyframes warnBackground {
0% {background-color: #FFFFFF;} 0% {
25% {background-color: #EF7458;} background-color: #ffffff;
50% {background-color: #FFFFFF;} }
75% {background-color: #EF7458;} 25% {
100% {background-color: #FFFFFF;} background-color: #ef7458;
}
50% {
background-color: #ffffff;
}
75% {
background-color: #ef7458;
}
100% {
background-color: #ffffff;
}
} }
.warn-pop { .warn-pop {
background-color: #FEF0F0; background-color: #fef0f0;
border-color: #FEF0F0; border-color: #fef0f0;
color:#F66C6C; color: #f66c6c;
} }
.warn-pop .popper__arrow:after{ .warn-pop .popper__arrow:after {
border-top-color: #FEF0F0 !important; border-top-color: #fef0f0 !important;
} }
.system .logo-upload-tip{ .system .logo-upload-tip {
color:#F66C6C; color: #f66c6c;
font-size: 12px; font-size: 12px;
line-height: 20px; line-height: 20px;
} }

View File

@@ -1,11 +1,14 @@
.notify-method-tab { .notify-method-tab {
.notify-table{ .notify-table {
height: calc(100% - 110px) height: calc(100% - 110px);
.pagination-bottom {
width: 0 !important;
}
} }
.notify-table .el-table{ .notify-table .el-table {
height: calc(100% - 10px) !important; height: calc(100% - 10px) !important;
} }
.notificationMessage{ .notificationMessage {
margin-left: 20px; margin-left: 20px;
display: flex; display: flex;
width: calc(100% - 39px); width: calc(100% - 39px);
@@ -22,7 +25,7 @@
.notificationMessage .nz-icon { .notificationMessage .nz-icon {
font-size: 20px; font-size: 20px;
} }
.notificationMessage .more{ .notificationMessage .more {
font-size: 14px; font-size: 14px;
cursor: pointer; cursor: pointer;
} }

View File

@@ -3,6 +3,16 @@
padding: 0px 0 10px 0px; padding: 0px 0 10px 0px;
background-color: $--background-color-base; background-color: $--background-color-base;
box-sizing: border-box; box-sizing: border-box;
.main-list::after{
content: '';
display: block;
position: absolute;
bottom: -10px;
left: 0;
right: 14px;
height: 10px;
background-color: $--background-color-empty;
}
pre { pre {
border: 1px solid $--border-color-base; border: 1px solid $--border-color-base;
border-left: 4px solid #e6522c; border-left: 4px solid #e6522c;

View File

@@ -16,6 +16,10 @@
border: 1px solid $--border-color-light; border: 1px solid $--border-color-light;
} }
} }
.not-fixed-height.no-resize.no-close{
height: 100%;
box-sizing: border-box;
}
.query-row { .query-row {
display: flex; display: flex;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -5,6 +5,48 @@
"css_prefix_text": "nz-icon-", "css_prefix_text": "nz-icon-",
"description": "", "description": "",
"glyphs": [ "glyphs": [
{
"icon_id": "586976",
"name": "map-sankey",
"font_class": "sankey",
"unicode": "e784",
"unicode_decimal": 59268
},
{
"icon_id": "6537184",
"name": "地图",
"font_class": "map",
"unicode": "e66c",
"unicode_decimal": 58988
},
{
"icon_id": "6807270",
"name": "Diagram-2",
"font_class": "diagram",
"unicode": "ec02",
"unicode_decimal": 60418
},
{
"icon_id": "11488020",
"name": "clock",
"font_class": "clock",
"unicode": "e762",
"unicode_decimal": 59234
},
{
"icon_id": "17692259",
"name": "走马灯",
"font_class": "projectTopology",
"unicode": "e765",
"unicode_decimal": 59237
},
{
"icon_id": "20559415",
"name": "165ranking",
"font_class": "rank",
"unicode": "e7ac",
"unicode_decimal": 59308
},
{ {
"icon_id": "32442422", "icon_id": "32442422",
"name": "New", "name": "New",

File diff suppressed because one or more lines are too long

View File

@@ -74,7 +74,7 @@
.el-icon { .el-icon {
display: block; display: block;
font-size: 12px; font-size: 12px !important;
font-weight: bold; font-weight: bold;
} }
} }

View File

@@ -1,326 +0,0 @@
<template>
<div style="width: 100%;height: 100%" v-my-loading="loading">
<hexagonBox
ref="hexagonBox"
:hexData="hexData"
:col="col"
:length="length"
:colorFrom="'level'"
:colorSet="colorSet"
:infoSet="infoSet"
:infoShow="infoShow"
:infoHide="infoHide"
:hexagonEdge="hexagonEdge"
:from="from"
:hexagonSvgID="hexagonSvgID"
:showTooltip="showTooltip"
@changeAsset="changeAsset"
@assetMove="assetMove"
@closeAsset="closeAsset"
/>
<alertLabel
v-if="showTooltip&&assetData.show"
v-my-loading="assetData.loading"
ref="alertLabel"
:id="assetData.id"
:that="assetData"
:type="fromType"
:LRTriangle="LRTriangle"
></alertLabel>
</div>
</template>
<script>
import hexagonBox from '@/components/common/honeycomb/hexagonFigureSvg'
import alertLabel from '@/components/common/alert/alertLabel2'
function textMouseDown (e) {
window.event ? window.event.cancelBubble = true : e.stopPropagation()
}
// eslint-disable-next-line no-unused-vars
function textMouseEnter (e) {
window.event ? window.event.cancelBubble = true : e.stopPropagation()
}
// eslint-disable-next-line no-unused-vars
function textMouseLeave (e) {
window.event ? window.event.cancelBubble = true : e.stopPropagation()
}
export default {
name: 'chartHexagon',
components: {
hexagonBox,
alertLabel
},
props: {
chartData: {},
chartInfo: {}
},
watch: {
chartData: {
immediate: true,
deep: true,
handler () {
setTimeout(() => {
this.initHexagon()
})
}
},
chartInfo: {
immediate: true,
deep: true,
handler () {
}
},
length: {
immediate: false,
deep: true,
handler () {
}
}
},
data () {
return {
hexData: [],
hexagonEdge: 90,
loading: false,
assetData: {
id: '',
loading: false,
show: false,
rate: 1,
position: {
top: 0,
left: 0,
mt: 0
}
},
boxWidth: '',
LRTriangle: true, // true 左三角 false 右
timer: null,
col: 8,
length: 48,
from: '',
hexagonSvgID: '',
showTooltip: false,
fromType: ''
}
},
methods: {
initHexagon () {
const param = this.chartInfo.param
if (param) {
this.col = param.col || 9
this.length = param.length || 48
this.from = param.from || 'module'
this.hexagonSvgID = 'hexagonSvg' + this.chartInfo.id
this.showTooltip = param.showTooltip || true
this.fromType = param.from || 'module'
}
setTimeout(() => {
this.hexData = this.chartData
}, 100)
},
colorSet (item) { // 设置方块颜色
const alert = item.alert[0]
if (alert.P1 > 0) {
return {
color: '#DA4D4D',
hoverColor: '#E87F7F'
}
} else if (alert.P2 > 0) {
return {
color: '#FFAB99',
hoverColor: '#FABEB2'
}
} else if (alert.P3 > 0) {
return {
color: '#FFCF92',
hoverColor: '#FFE0B8'
}
} else {
return { color: '#99D7C2', hoverColor: '#B2ECD9' }
}
},
infoSet (group, allHexagonRect, allHexagonText, data, item, fontSize, that) {
// 设置内部文本
// group 对应六边形所在的组。allHexagonRect吧所有文本框放入方便控制显示隐藏。data 六边形的相关数 data.center 中心点。that 子组件实例
const rgbColor = '0,0,0'
let str = ''
let textPaddingWidth = ''
let textPaddingHeight = ''
const rect0 = group.rect(that.hexagonEdge + 20, that.hexagonEdge / 3)
.attr({
x: data.center[0] - that.hexagonEdge / 2 - 10,
y: data.center[1] - that.hexagonEdge,
rx: 5,
ry: 5
}).fill({ color: `rgba(${rgbColor},0)` }).data({ color: rgbColor })
str = this.from === 'asset' ? item.name : item.name
str += ''
if (str.length >= 15) {
str = str.slice(0, 12) + '...'
}
const text0 = group.text(str).attr({ x: 0, y: 0, style: 'cursor:text' }).font({ size: fontSize }).fill({ opacity: 0, color: '#fff', weight: 600, cursor: 'text' })
textPaddingWidth = (that.hexagonEdge + 20) - (text0.bbox().width)
textPaddingHeight = (that.hexagonEdge / 3) - (text0.bbox().height)
text0.attr({
x: data.center[0] - that.hexagonEdge / 2 - 10 + textPaddingWidth / 2,
y: data.center[1] - that.hexagonEdge + textPaddingHeight / 2 - 4
}).hide()
allHexagonRect.push(rect0)
allHexagonText.push(text0)
text0.on('mousedown', textMouseDown)
const rect1 = group.rect(that.hexagonEdge + 20, that.hexagonEdge / 3)
.attr({
x: data.center[0] - that.hexagonEdge / 2 - 10,
y: data.center[1] - that.hexagonEdge / 2 - 7.5,
rx: 6,
ry: 6
}).fill({ color: `rgba(${rgbColor},0)` }).data({ color: rgbColor })
str = 'P1 : ' + item.alert[0].P1
if (str.length >= 15) {
str = str.slice(0, 12) + '...'
}
const text1 = group.text(str).attr({ x: 0, y: 0, style: 'cursor:default' }).font({ size: fontSize }).fill({ opacity: 0, color: '#fff', weight: 600, cursor: 'default' })
textPaddingWidth = (that.hexagonEdge + 20) - (text1.bbox().width)
textPaddingHeight = (that.hexagonEdge / 3) - (text1.bbox().height)
text1.attr({
x: data.center[0] - that.hexagonEdge / 2 - 10 + textPaddingWidth / 2,
y: data.center[1] - that.hexagonEdge / 2 - 7.5 + textPaddingHeight / 2 - 4
}).hide()
allHexagonRect.push(rect1)
allHexagonText.push(text1)
const rect2 = group.rect(that.hexagonEdge + 20, that.hexagonEdge / 3).attr({
x: data.center[0] - that.hexagonEdge / 2 - 10,
y: data.center[1] - that.hexagonEdge / 2 + that.hexagonEdge / 3 + 0.5,
rx: 6,
ry: 6
}).fill({ color: `rgba(${rgbColor},0)` }).data({ color: rgbColor })
str = 'P2 : ' + item.alert[0].P2
if (str.length >= 15) {
str = str.slice(0, 12) + '...'
}
const text2 = group.text(str).attr({ x: 0, y: 0, style: 'cursor:default' }).font({ size: fontSize }).fill({ opacity: 0, color: '#fff', weight: 600, cursor: 'default' })
textPaddingWidth = (that.hexagonEdge + 20) - (text2.bbox().width)
textPaddingHeight = (that.hexagonEdge / 3) - (text2.bbox().height)
text2.attr({
x: data.center[0] - that.hexagonEdge / 2 - 10 + textPaddingWidth / 2,
y: data.center[1] - that.hexagonEdge / 2 + that.hexagonEdge / 3 + 0.5 + textPaddingHeight / 2 - 4
}).hide()
allHexagonRect.push(rect2)
allHexagonText.push(text2)
const rect3 = group.rect(that.hexagonEdge + 20, that.hexagonEdge / 3)
.attr({
x: data.center[0] - that.hexagonEdge / 2 - 10,
y: data.center[1] - that.hexagonEdge / 2 + that.hexagonEdge / 3 * 2 + 5.5,
rx: 6,
ry: 6
}).fill({ color: `rgba(${rgbColor},0)` }).data({ color: rgbColor })
str = 'P3 : ' + item.alert[0].P3
if (str.length >= 15) {
str = str.slice(0, 12) + '...'
}
const text3 = group.text(str).attr({ x: 0, y: 0, style: 'cursor:default' }).font({ size: fontSize }).fill({ opacity: 0, color: '#fff', weight: 600, cursor: 'default' })
textPaddingWidth = (that.hexagonEdge + 20) - (text3.bbox().width)
textPaddingHeight = (that.hexagonEdge / 3) - (text3.bbox().height)
text3.attr({
x: data.center[0] - that.hexagonEdge / 2 - 10 + textPaddingWidth / 2,
y: data.center[1] - that.hexagonEdge / 2 + that.hexagonEdge / 3 * 2 + 5.5 + textPaddingHeight / 2 - 4
}).hide()
allHexagonRect.push(rect3)
allHexagonText.push(text3)
},
infoShow (allHexagonRect, allHexagonText) {
allHexagonRect.forEach(item => {
const rgbColor = item.data('color')
item.fill({ color: `rgba(${rgbColor},0.2)` })
})
allHexagonText.forEach(item => {
item.fill({ opacity: 1 }).show()
})
},
infoHide (allHexagonRect, allHexagonText) {
allHexagonRect.forEach(item => {
const rgbColor = item.data('color')
item.fill({ color: `rgba(${rgbColor},0)` })
})
allHexagonText.forEach(item => {
item.fill({ opacity: 0 }).hide()
})
},
changeAsset (data, e) {
if (this.timer) {
clearTimeout(this.timer)
}
this.assetData.id = data
const boxWidth = this.$refs.hexagonBox.$el.offsetWidth
this.boxWidth = boxWidth
// this.assetData.rate=window.screen.height/1297;
this.$nextTick(() => {
this.assetData.show = true
this.$nextTick(() => {
this.calcPosition(e)
})
})
},
assetMove (e) {
if (!this.assetData.show) { return }
this.calcPosition(e)
},
calcPosition (e) {
const boxWidth = this.boxWidth
const distance = this.fromType === 'asset' ? 300 : 50
const minus = (e.offsetY - distance) + this.$refs.alertLabel.$el.offsetHeight - window.innerHeight
// window.innerHeight
if (minus <= 0) {
this.assetData.position.top = e.offsetY - distance
this.assetData.position.mt = distance
} else if (minus > 0) {
this.assetData.position.top = window.innerHeight - this.$refs.alertLabel.$el.offsetHeight
this.assetData.position.mt = e.offsetY - (window.innerHeight - this.$refs.alertLabel.$el.offsetHeight)
}
if (boxWidth / 2 > e.pageX - 200) {
this.assetData.position.left = e.pageX + 35
this.assetData.position.right = 0
this.LRTriangle = true
} else {
this.assetData.position.right = window.innerWidth - (e.pageX - 35)
this.assetData.position.left = 0
this.LRTriangle = false
}
},
closeAsset () {
if (!this.timer) {
this.timer = setTimeout(() => {
this.assetData.show = false
this.timer = null
}, 100)
} else {
clearTimeout(this.timer)
this.timer = setTimeout(() => {
this.assetData.show = false
this.timer = null
}, 100)
}
},
endLoading () {
this.loading = false
},
startLoading () {
this.loading = true
},
resize () {
this.hexData = [...this.chartData]
}
}
}
</script>
<style scoped>
</style>

View File

@@ -42,7 +42,7 @@
</span> </span>
<div class="chart-header__title" v-if="!isGroup" :title="nameFormate()">{{nameFormate()}}</div> <div class="chart-header__title" v-if="!isGroup" :title="nameFormate()">{{nameFormate()}}</div>
<div class="chart-header__title groupTitle" v-else > <div class="chart-header__title groupTitle" v-else >
<span @click="groupShow"> <i class="nz-icon" :class="chartInfo.param.collapse ? 'nz-icon-arrow-right': 'nz-icon-arrow-down'"></i></span> <span @click="groupShow" style="cursor:pointer"> <i class="nz-icon" :class="chartInfo.param.collapse ? 'nz-icon-arrow-right': 'nz-icon-arrow-down'"></i></span>
{{nameFormate()}} {{nameFormate()}}
<span v-show="chartInfo.param.collapse" class="collapse-content">({{chartData ? chartData.length : 0}} charts)</span> <span v-show="chartInfo.param.collapse" class="collapse-content">({{chartData ? chartData.length : 0}} charts)</span>
</div> </div>

View File

@@ -67,15 +67,6 @@ export default {
this.quill.format('image', false) this.quill.format('image', false)
} }
}) })
this.quill.on('selection-change', function (range, oldRange, source) {
const tooltip = $self.$el.querySelector('.ql-tooltip')
if (tooltip) {
const left = tooltip.style.left
if (left && /\-\d+\.?\d+?px/.test(left)) {
tooltip.style.left = '10px'
}
}
})
this.quill.on('text-change', function (delta, oldDelta, source) { this.quill.on('text-change', function (delta, oldDelta, source) {
const length = $self.getHtml().length const length = $self.getHtml().length
if (length > 60000) { if (length > 60000) {

View File

@@ -4,7 +4,7 @@
<div class="top-tool-left"> <div class="top-tool-left">
<div class="sub-list-title" v-if="showTitle">{{bottomHeaderTitle}}<slot name="title"></slot></div> <div class="sub-list-title" v-if="showTitle">{{bottomHeaderTitle}}<slot name="title"></slot></div>
<div class="sub-list-tabs"> <div class="sub-list-tabs">
<div v-for="tab in tabs" :key="tab.prop" :class="{'sub-list-tab--active': tab.active || tab.prop == targetTab }" :title='tab.prop' class="sub-list-tab" @click="changeTab(tab.prop)">{{tab.name}}</div> <div v-for="tab in tabs" :key="tab.prop" :class="{'sub-list-tab--active': tab.active || tab.prop == targetTab }" :title='tab.name' class="sub-list-tab" @click="changeTab(tab.prop)">{{tab.name}}</div>
</div> </div>
</div> </div>
<div class="top-tool-right" v-if="!customTool"> <div class="top-tool-right" v-if="!customTool">

View File

@@ -15,7 +15,7 @@
> >
<template v-slot:title><span :title="obj.name">{{obj.name}}</span></template> <template v-slot:title><span :title="obj.name">{{obj.name}}</span></template>
<template v-slot> <template v-slot>
<alertRuleEvalLogTable <recordRuleEvalLogTable
ref="dataTable" ref="dataTable"
:orderByFa="'id'" :orderByFa="'id'"
v-my-loading="tools.loading" v-my-loading="tools.loading"
@@ -30,7 +30,7 @@
@edit="edit" @edit="edit"
@orderBy="tableDataSort" @orderBy="tableDataSort"
@reload="getTableData" @reload="getTableData"
@selectionChange="selectionChange"></alertRuleEvalLogTable> @selectionChange="selectionChange"></recordRuleEvalLogTable>
</template> </template>
<template v-slot:pagination> <template v-slot:pagination>
<Pagination ref="Pagination" :pageObj="pageObj" :tableId="tableId" @pageNo='pageNo' @pageSize='pageSize'></Pagination> <Pagination ref="Pagination" :pageObj="pageObj" :tableId="tableId" @pageNo='pageNo' @pageSize='pageSize'></Pagination>
@@ -42,7 +42,7 @@
import dataListMixin from '@/components/common/mixin/dataList' import dataListMixin from '@/components/common/mixin/dataList'
import subDataListMixin from '@/components/common/mixin/subDataList' import subDataListMixin from '@/components/common/mixin/subDataList'
import nzBottomDataList from '@/components/common/bottomBox/nzBottomDataList' import nzBottomDataList from '@/components/common/bottomBox/nzBottomDataList'
import alertRuleEvalLogTable from '@/components/common/table/alert/alertRuleEvalLogTable' import recordRuleEvalLogTable from '@/components/common/table/settings/recordRuleEvalLogTable'
import detailViewRightMixin from '@/components/common/mixin/detailViewRightMixin' import detailViewRightMixin from '@/components/common/mixin/detailViewRightMixin'
export default { export default {
@@ -50,7 +50,7 @@ export default {
mixins: [dataListMixin, subDataListMixin, detailViewRightMixin], mixins: [dataListMixin, subDataListMixin, detailViewRightMixin],
components: { components: {
nzBottomDataList, nzBottomDataList,
alertRuleEvalLogTable recordRuleEvalLogTable
}, },
props: { props: {
obj: Object, obj: Object,

View File

@@ -1,7 +1,7 @@
<template> <template>
<nz-bottom-data-list <nz-bottom-data-list
:showPagination="false"
:showTitle='showTitle' :showTitle='showTitle'
:tableId="tableId"
:obj='obj' :obj='obj'
:layout="[]" :layout="[]"
:tabs="tabs" :tabs="tabs"
@@ -51,10 +51,11 @@ export default {
calcTime () { calcTime () {
return function (time) { return function (time) {
if (this.obj.startTime) { if (this.obj.startTime) {
const startTime = new Date(this.obj.startTime).getTime() console.log(this.utcTimeToTimezoneStr(this.obj.startTime))
const startTime = this.momentStrToTimestamp(this.utcTimeToTimezoneStr(this.obj.startTime))
if (startTime) { if (startTime) {
const thisTime = startTime + time const thisTime = startTime + time
return this.dateFormat(thisTime) return this.momentTz(thisTime)
} }
} }
return '-' return '-'

View File

@@ -6,7 +6,6 @@
:tabs="tabs" :tabs="tabs"
:targetTab="targetTab" :targetTab="targetTab"
@changeTab="changeTab" @changeTab="changeTab"
:tableId="tableId"
:title="'Session ID'" :title="'Session ID'"
> >
<template v-slot:title><span :title="obj.uuid.substring(0, 8).toUpperCase()">{{obj.uuid.substring(0, 8).toUpperCase()}}</span></template> <template v-slot:title><span :title="obj.uuid.substring(0, 8).toUpperCase()">{{obj.uuid.substring(0, 8).toUpperCase()}}</span></template>

View File

@@ -2,7 +2,6 @@
<nz-bottom-data-list <nz-bottom-data-list
:showTitle='showTitle' :showTitle='showTitle'
:obj='obj' :obj='obj'
:tableId="tableId"
:layout="[]" :layout="[]"
:tabs="tabs" :tabs="tabs"
:targetTab="targetTab" :targetTab="targetTab"

View File

@@ -28,7 +28,7 @@
:terminaLogTab="true" :terminaLogTab="true"
@del="del" @del="del"
@edit="edit" @edit="edit"
@orderBy="tableDataSort" @tableDataSort="tableDataSort"
@reload="getTableData" @reload="getTableData"
@selectionChange="selectionChange"></assetVsysTable> @selectionChange="selectionChange"></assetVsysTable>
</template> </template>
@@ -65,7 +65,9 @@ export default {
searchLabelList: [] searchLabelList: []
}, },
searchLabel: {}, searchLabel: {},
tableData: [] tableData: [],
orderBy: { order: 'ascending', prop: 'id' }
} }
}, },
methods: { methods: {
@@ -75,7 +77,7 @@ export default {
this.$get(this.url, this.searchLabel).then(response => { this.$get(this.url, this.searchLabel).then(response => {
this.tools.loading = false this.tools.loading = false
if (response.code === 200) { if (response.code === 200) {
this.tableData = response.data.list this.tableData = this.filterShowData(response.data.list, this.orderBy)
if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) { if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) {
this.$nextTick(() => { this.$nextTick(() => {
this.scrollbarWrap = this.$refs.dataTable.$refs.dataTable.bodyWrapper this.scrollbarWrap = this.$refs.dataTable.$refs.dataTable.bodyWrapper
@@ -84,6 +86,22 @@ export default {
} }
} }
}) })
},
// 数据排序
tableDataSort (item) {
this.orderBy = item
this.filterShowData(this.tableData, item)
},
filterShowData (source, ord) {
let orderBy = null
orderBy = ord
if (orderBy.order === 'ascending') {
source = source.sort(this.$tableSet.asce(orderBy.prop))
}
if (orderBy.order === 'descending') {
source = source.sort(this.$tableSet.desc(orderBy.prop))
}
return source
} }
} }
} }

View File

@@ -6,7 +6,7 @@
</button> </button>
</div> </div>
<button v-if="this.type === 'btn'" class="table-operation-item delete-button" :id="id" @click="batchDelete" :title="$t('overall.delete')"><i class="nz-icon nz-icon-delete"></i></button> <button v-if="this.type === 'btn'" class="table-operation-item delete-button" :id="id" @click="batchDelete" :title="$t('overall.delete')"><i class="nz-icon nz-icon-delete"></i></button>
<div v-if="this.type === 'link'" :id="id" @click="batchDelete" :title="$t('overall.delete')"> <div v-if="this.type === 'link'" :id="id" @click="batchDelete">
<span><i class="nz-icon nz-icon-delete" ></i>{{title}}</span> <span><i class="nz-icon nz-icon-delete" ></i>{{title}}</span>
</div> </div>
<el-dialog <el-dialog

View File

@@ -1,939 +0,0 @@
<template>
<div ref="box" class="box-hexagon" v-clickoutside="{obj:{},func:hexagonSvgClearScale}" v-if="boxhexagonShow">
<div :id="hexagonSvgID">
</div>
<div class="mask" v-if="maskShow">
</div>
</div>
</template>
<script>
import { SVG } from '@svgdotjs/svg.js'
import '@svgdotjs/svg.panzoom.js'
import { getHexagon, setHexagon, delHexagon } from '../js/common'
function PolylineOver () {
this.stroke({ color: '#909090' })
}
function PolylineOut () {
this.stroke({ color: '#DADADA' })
}
function hexagonPoint (x, y, edge) { // 根据左上角坐标点生成六边的六个点的坐标 通过 svg画出
return new Promise(resolve => {
const MathSqrt3 = Math.sqrt(3)
const x1 = x
const y1 = y + edge / 2
const x2 = x + MathSqrt3 * edge / 2
const y2 = y
const x3 = x + MathSqrt3 * edge
const y3 = y + edge / 2
const x4 = x + MathSqrt3 * edge
const y4 = y + edge / 2 + edge
const x5 = x + MathSqrt3 * edge / 2
const y5 = y + edge * 2
const x6 = x
const y6 = y + edge / 2 + edge
const arr = [{ x: x1, y: y1 }, { x: x2, y: y2 }, { x: x3, y: y3 }, { x: x4, y: y4 }, { x: x5, y: y5 }, { x: x6, y: y6 }]
let svgStrPoint = ''
arr.forEach((item) => {
svgStrPoint += item.x + ',' + item.y + ' '
})
const center = [x + MathSqrt3 * edge / 2, y + edge]
resolve({
point: arr,
svgStrPoint,
center
})
})
}
// eslint-disable-next-line no-unused-vars
function midpoint (point1, point2) { // 计算中点
return {
x: (point1.x + point2.x) / 2,
y: (point1.y + point2.y) / 2
}
}
function borderMove (left, top, borderSize, type, svgPolyline) { // left,top, 坐标 borderSize 长度,type 外层边框线从哪走到那
const point = [null, null]
const MathSqrt3 = Math.sqrt(3)
const arr = svgPolyline.array()
switch (type) {
case 1: // 从左到右的斜上方运动
point[0] = left + MathSqrt3 * borderSize / 2
point[1] = top - borderSize / 2
break
case 2: // 从左到右的斜下方运动
point[0] = left + MathSqrt3 * borderSize / 2
point[1] = top + borderSize / 2
break
case 3: // 从上到下的正下方运动
point[0] = left
point[1] = top + borderSize
break
case 4: // 从右到左的斜下方运动
point[0] = left - MathSqrt3 * borderSize / 2
point[1] = top + borderSize / 2
break
case 5: // 从右到左的斜上方运动
point[0] = left - MathSqrt3 * borderSize / 2
point[1] = top - borderSize / 2
break
case 6: // 从右到左的斜上方运动
point[0] = left
point[1] = top - borderSize
break
}
arr.push(point)
svgPolyline.plot(arr)
return point
}
export default {
name: 'hexagonFigureSvg',
props: {
hexData: {}, // 数据
hexagonSvgID: { // 在同一个页面创建多个实例时 需要通过id区分
type: String,
required: true
},
col: {}, // 列数
colorFrom: { // 通过什么决定颜色
type: String,
default: ''
},
infoSet: { // 设置六边形内部内容 参数 group 对应六边形所在的组。allHexagonRect吧所有文本框放入方便控制显示隐藏。data 六边形的相关数 data.center 中心点。that 子组件实例
type: Function
},
colorSet: { // 设置方块对应颜色 参数 item 当前item的数据
type: Function,
default: () => {
return { color: '#99D7C2', hoverColor: '#B2ECD9' }
}
},
infoShow: { // 设置六边形内部内容 放大显示时的样式 参数 allHexagonRect
type: Function
},
infoHide: { // 设置六边形内部内容 缩小显示时的样式 参数 allHexagonRect
type: Function
},
hexagonEdgeProp: { // 边框长度
type: Number,
default: 90
},
magnifyRate: { // 放大倍率
type: Number,
default: 1
},
isClickRate: { // 是否支持点击放大
type: Boolean,
default: true
},
showTooltip: {
type: Boolean,
default: false
},
isPanning: { // 是否支持移动
type: Boolean,
default: true
},
isPinchZoom: { // 是否支持手指缩放
type: Boolean,
default: false
},
isWheelZoom: { // 是否支持手指缩放
type: Boolean,
default: false
},
zoomFactor: { // 鼠标滚轮放大倍数
type: Number,
default: 0.5
},
zoomMin: { // 最小倍数
type: Number,
default: 0.2
},
zoomMax: { // 最小倍数
type: Number,
default: 5
},
from: {
type: String,
default: 'asset'
}
},
watch: {
hexData: {
immediate: false,
deep: true,
handler (n) {
this.init()
}
},
col: { // 列数
immediate: false,
deep: true,
handler () {
this.init()
}
},
hexagonEdgeProp: {
immediate: false,
deep: true,
handler (n) {
}
}
},
data () {
return {
allHexagon: [],
allGroup: [],
// col:5,
row: 5,
boxPadLeft: 360,
boxPadTop: 180,
hexagonData: [],
textAll: [],
hexSize: '',
MathSqrt3: Math.sqrt(3),
hexagonTextPos: {
top: 0,
left: 0,
show: false,
data: null
},
boxhexagonShow: false,
pan: false, // 是否移动
defaultColor: { color: '#99D7C2', hoverColor: '#B2ECD9' },
viewBox: null,
isShowHover: true, // 是否显示hover块
timer: null, // 定时器用来处理单击双击的冲突
firstInit: true, // 优化刚加载时的多次点击造成放大缩小功能的不正常
defaultRate: 0.33, // 默认倍率 最小0.2
defaultBoxWidth: 2288,
hexagonEdge: JSON.stringify(this.hexagonEdgeProp),
fontSize: 14,
maskShow: true,
windowRate: 1,
scaleFlag: true
}
},
computed: {
interspace () {
return (this.hexagonEdge * this.MathSqrt3 / 5) * 0.5
}
},
created () {
},
mounted () {
// this.init()
window.addEventListener('visibilitychange', this.reload)
},
methods: {
init () { // 创建svg实例
this.boxhexagonShow = false
this.maskShow = true
this.hexagonEdge = this.hexagonEdgeProp
this.clearData().then(() => {
this.boxhexagonShow = true
setTimeout(() => {
this.hexagonData = JSON.parse(JSON.stringify(this.hexData))
const box = `#${this.hexagonSvgID}`
if (!document.getElementById(this.hexagonSvgID)) {
return
}
const hexagonSvg = SVG().addTo(box).size('100%', '100%')
.panZoom({
zoomMin: this.zoomMin,
zoomMax: this.zoomMax,
zoomFactor: this.zoomFactor,
pinchZoom: this.isPinchZoom,
wheelZoom: this.isWheelZoom,
panning: this.isPanning
})
.attr('id', 'SvgHex' + this.hexagonSvgID)
.attr('class', this.hexagonSvgID)
.attr('viewBox', `0 0 ${this.$refs.box.offsetWidth} ${this.$refs.box.offsetHeight}`) // svg实例
hexagonSvg.on('click', this.hexagonSvgClearScale)
hexagonSvg.on('panStart', this.hexagonSvgPanStart)
hexagonSvg.on('mousemove', this.hexagonMove)
hexagonSvg.on('panEnd', this.hexagonSvgPanEnd)
this.getLayout()
const Rate = (this.$refs.box.offsetWidth / this.defaultBoxWidth)
// Rate = (Rate > 0.2 ? Rate : 0.2)
this.windowRate = Rate
this.hexagonEdge = (this.hexagonEdge / this.defaultRate) * Rate
this.fontSize = 14
const fontSize = ((this.fontSize / this.defaultRate) * Rate)
this.fontSize = fontSize < 8 ? 8 : fontSize
setHexagon(this.hexagonSvgID, {
hexagonSvg: hexagonSvg,
svgPolyline: null,
allHexagonRect: [],
allHexagonText: [],
hover: null
})
this.getPadding().then(() => {
getHexagon(this.hexagonSvgID).svgPolyline = getHexagon(this.hexagonSvgID).hexagonSvg.polyline().fill('none').stroke({
color: '#DADADA',
width: 3,
linecap: 'round',
linejoin: 'round'
})
this.getDataPoint()
})// 获取到上方和左方的距离;
setTimeout(() => {
this.firstInit = false
}, 500)
})
}).catch((res) => {
// console.info(res)
})
},
getLayout () {
this.boxWidth = this.$refs.box.offsetWidth
this.boxHeight = this.$refs.box.offsetHeight
return new Promise(resolve => {
let radius = 0
let col = 0
let row = 0
for (let i = 1; i <= this.hexagonData.length; i++) {
const cols = Math.ceil(this.hexagonData.length / i)
const hexaRadiusY = Math.ceil((this.boxHeight * 2) / (3 * i + 1))
let hexaRadiusX = ''
if (i === 1) {
hexaRadiusX = Math.ceil(this.boxWidth / (Math.sqrt(3) * cols))
} else {
hexaRadiusX = Math.ceil(this.boxWidth / (Math.sqrt(3) * cols + Math.sqrt(3) / 2))
}
const rateMax = hexaRadiusX > hexaRadiusY ? hexaRadiusY : hexaRadiusX
if (rateMax > radius) {
radius = rateMax
col = cols
row = i
}
}
if (this.hexagonData.length) {
while (col * row >= this.hexagonData.length) { // 避免出现空白
row--
}
}
row++
if (col === 1 || row === 1) { // 行 或 列有一个为1时 需要调换位置 显示才会好看
const temp = col
col = row
row = temp
}
resolve({ col, row, radius: radius })
})
},
reload () {
if (!document.hidden) {
this.init()
}
},
getPadding () { // 确定到上方和下方的距离 保持居中
return new Promise(resolve => {
const hexagonWidth = this.MathSqrt3 * this.hexagonEdge + this.interspace
const hexagonHeight = this.hexagonEdge * 2 + this.interspace
let row = parseInt((this.hexagonData.length) / (this.col * 2 - 1)) * 2// 行数是总数除2倍列数-1的整数部分 加上根据余数的判断
const dolNum = (this.hexagonData.length) % (this.col * 2 - 1)
if (dolNum > 0 && dolNum <= this.col) { // 余数的判断
row += 1
} else if (dolNum > 0 && dolNum > this.col) {
row += 2
}
this.row = row
if (this.hexagonData.length - 1 <= this.col) {
// boxPadLeft:200, boxPadTop:75,
this.boxPadLeft = (this.$refs.box.offsetWidth - this.hexagonData.length * hexagonWidth) / 2
this.boxPadTop = (this.$refs.box.offsetHeight - hexagonHeight) / 2 // 只有一行是 到上方距离应该是两倍边长
} else {
this.boxPadLeft = (this.$refs.box.offsetWidth - this.col * hexagonWidth) / 2
this.boxPadTop = (this.$refs.box.offsetHeight - (hexagonHeight + (this.row - 1) * hexagonHeight * 3 / 4)) / 2 // 大于一行时 为一行的行高 + 3/2的行高
}
resolve()
})
},
getDataPoint () { // 确定所有坐标点的位置
const col = this.col// 确定列数
const row = this.row// 确定列数
const paddingTop = this.boxPadTop // 到上方的距离
const paddingLeft = this.boxPadLeft // 整体到左侧的距离
let arrIndex = 0
this.hexSize = this.MathSqrt3 * this.hexagonEdge / 2
for (let i = 0; i < row; i++) { // 确定 所有 坐标点
if (arrIndex > this.hexagonData.length - 1) {
break
}
for (let j = 0; j < col; j++) {
if (arrIndex > this.hexagonData.length - 1) {
break
}
if (i === 0) {
this.hexagonData[arrIndex].left = j * (this.hexSize * 2 + this.interspace) + paddingLeft
this.hexagonData[arrIndex].top = i * (this.hexSize * 2) + paddingTop
this.hexagonData[arrIndex].sub = i + '-' + j
} else if (i % 2 === 0) {
// if(i===2&&( j===1 || j==2)){
// this.hexagonData[arrIndex].left=j*(this.hexSize*2 + this.interspace)+ paddingLeft;
// this.hexagonData[arrIndex].top=i*(this.hexSize*2 + this.interspace/2 - this.hexSize*2*1/8)+ paddingTop;
// }else{
// continue;
// }
this.hexagonData[arrIndex].left = j * (this.hexSize * 2 + this.interspace) + paddingLeft
this.hexagonData[arrIndex].top = i * (this.hexSize * 2 + this.interspace / 2 * this.MathSqrt3 - this.hexSize * 2 / 8) + paddingTop
this.hexagonData[arrIndex].sub = i + '-' + j
} else {
if (j === col - 1) {
break
}
// if(i!==3){
// this.hexagonData[arrIndex].left=j*(this.hexSize*2 + this.interspace ) + this.hexSize*2/2 + this.interspace/2+ paddingLeft;
// this.hexagonData[arrIndex].top=i*(this.hexSize*2 + this.interspace/2 - this.hexSize*2*1/8) + paddingTop;
// } else if(i==3&&(j===1)){
// this.hexagonData[arrIndex].left=j*(this.hexSize*2 + this.interspace ) + this.hexSize*2/2 + this.interspace/2+ paddingLeft;
// this.hexagonData[arrIndex].top=i*(this.hexSize*2 + this.interspace/2 - this.hexSize*2*1/8) + paddingTop;
// }else{
// continue;
// }
this.hexagonData[arrIndex].left = j * (this.hexSize * 2 + this.interspace) + this.hexSize * 2 / 2 + this.interspace / 2 + paddingLeft
this.hexagonData[arrIndex].top = i * (this.hexSize * 2 + this.interspace / 2 * this.MathSqrt3 - this.hexSize * 2 / 8) + paddingTop
this.hexagonData[arrIndex].sub = i + '-' + j
}
arrIndex++
}
}
this.renderSomeHexagonAll()
},
renderSomeHexagonAll () { // 遍历所有数据 绘画六边形 之后画边框
const arr = []
this.hexagonData.forEach(item => {
this.renderHexagon(item)
arr.push(this.renderHexagon.bind(this, item))
})
Promise.all(arr).then(() => {
if (getHexagon(this.hexagonSvgID) && getHexagon(this.hexagonSvgID).hexagonSvg) {
this.borderHex()
getHexagon(this.hexagonSvgID).hexagonSvg.animate(300).zoom(this.defaultRate)
const hoverRect = getHexagon(this.hexagonSvgID).hexagonSvg.group().addClass('hoverRect')
hoverRect.rect()
hoverRect.text('a')
hoverRect.hide()
getHexagon(this.hexagonSvgID).hover = hoverRect
setTimeout(() => {
if (getHexagon(this.hexagonSvgID) && getHexagon(this.hexagonSvgID).hexagonSvg) {
this.viewBox = getHexagon(this.hexagonSvgID).hexagonSvg.attr('viewBox')
}
this.maskShow = false
}, 300)
}
})
},
renderHexagon (item) { // 绘画六边形
return new Promise(resolve => {
hexagonPoint(item.left, item.top, this.hexagonEdge).then(data => {
const color = this.colorSet ? this.colorSet(item) : this.defaultColor
const group = getHexagon(this.hexagonSvgID).hexagonSvg.group()
const polygon = group.polygon(data.svgStrPoint).fill(color.color)
polygon.data({
...data,
...item,
...color
})
group.on('mouseenter', this.hexagonOver.bind(this, group))
group.on('mouseleave', this.hexagonOut.bind(this, group))
group.on('click', this.changeScale.bind(this, polygon.data('center'), item, data, group))
this.allHexagon.push(polygon)
this.allGroup.push(group)
// 向六边形内 添加文本 本质是根据六边形的中心点确定各个文本位置
if (this.infoSet) {
this.infoSet(group, getHexagon(this.hexagonSvgID).allHexagonRect, getHexagon(this.hexagonSvgID).allHexagonText, data, item, this.fontSize, this)
}
resolve()
})
})
},
hexagonOver (that, e) { // 移入六边形
const color = that.first().data('hoverColor')
that.first().timeline().unschedule(that.first().animate())
that.timeline().unschedule(that.first().animate())
that.first().animate(100).stroke({ width: 3, color: '#909090' }).fill(color)
that.animate(100).transform({ scale: 1.1 })
that.parent().find('polyline').stroke({ color: '#909090' })
const hover = that.parent().find('.hoverRect')
if (this.isShowHover && hover && this.from && !this.showTooltip) { // 不显示气泡 显示基本信息
const center = that.first().data('center')
let str = this.from === 'asset' ? that.first().data('host') : that.first().data('module')
str += ''
hover.show()
hover.get(1).attr(
{
x: center[0] - (str.length * 20 + 30) / 2,
y: center[1] - this.hexagonEdge - 76
}
).fill({ color: '#fff', weight: 400 }).text(str).font({ size: 36 })
const textPaddingWidth = ((str.length * 20 + 30) - hover.get(1).bbox()[0].width) / 2
hover.get(1).attr(
{
x: center[0] - (str.length * 20 + 30) / 2 + textPaddingWidth,
y: center[1] - this.hexagonEdge - 76
}
)
hover.get(0).attr(
{
x: center[0] - (str.length * 20 + 30) / 2,
y: center[1] - this.hexagonEdge - 80
}
).fill({ color: 'rgba(0,0,0,0.3)' }).size((str.length * 20 + 30), 72).attr({ rx: '10', ry: '10' })
}
if (this.isShowHover && this.showTooltip) { // 显示气泡
this.$emit('changeAsset', that.first().data('id'), e)
}
},
hexagonMove (e) { // 六边形内移动
if (this.showTooltip) { // 显示气泡
this.$emit('assetMove', e)
}
// this.$emit('assetMove',e)
},
hexagonOut (that) { // 移出六边形
const color = that.first().data('color')
that.first().timeline().unschedule(that.first().animate())
that.timeline().unschedule(that.first().animate())
that.first().animate(100).stroke({ width: 0, color: '#909090' }).fill(color)
that.animate(100).transform({ scale: 1 })
that.parent().find('polyline').stroke({ color: '#DADADA' })
const hover = that.parent().find('.hoverRect')
if (hover && !this.showTooltip) { // 不显示气泡 显示基本信息
hover.hide()
}
if (this.showTooltip) { // 显示气泡
this.$emit('closeAsset')
}
},
changeScale (center, item1, data, group, e) {
window.event ? window.event.cancelBubble = true : e.stopPropagation()
if (this.scaleFlag) {
this.hexagonSvgScale(center, item1, data, group, e)
} else {
this.hexagonSvgClearScale(e)
}
},
hexagonSvgScale (center, item1, data, group, e) {
window.event ? window.event.cancelBubble = true : e.stopPropagation()
this.$emit('closeAsset')
if (this.timer) {
clearTimeout(this.timer)
this.timer = null
}
this.group = group
// this.group.on('dblclick',this.hexagonSvgClearScale);
if (!this.pan && this.isClickRate) {
getHexagon(this.hexagonSvgID).hexagonSvg.animate(300).zoom(this.magnifyRate, { x: center[0], y: center[1] })
if (this.infoShow) {
this.infoShow(getHexagon(this.hexagonSvgID).allHexagonRect, getHexagon(this.hexagonSvgID).allHexagonText)
}
this.isShowHover = false
this.scaleFlag = false
}
const hover = getHexagon(this.hexagonSvgID).hexagonSvg.find('.hoverRect')
if (hover) {
hover.hide()
}
},
hexagonSvgClearScale (e) {
// window.event? window.event.cancelBubble = true:e.stopPropagation();
if (this.firstInit) { return }
if (this.group) {
// this.group.off('dblclick',this.hexagonSvgClearScale);
this.group = null
}
if (!this.pan && this.isClickRate) {
getHexagon(this.hexagonSvgID).hexagonSvg.animate(300).zoom(this.defaultRate).attr('viewBox', this.viewBox)
this.scaleFlag = true
if (this.infoHide) {
this.infoHide(getHexagon(this.hexagonSvgID).allHexagonRect, getHexagon(this.hexagonSvgID).allHexagonText)
}
this.timer = setTimeout(() => {
this.isShowHover = true
}, 100)
window.getSelection().empty()// 取消选中文字
}
},
hexColorToRgb (color) {
const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/
// 把颜色值变成小写
if (reg.test(color)) {
// 如果只有三位的值,需变成六位,如:#fff => #ffffff
if (color.length === 4) {
let colorNew = '#'
for (let i = 1; i < 4; i += 1) {
colorNew += color.slice(i, i + 1).concat(color.slice(i, i + 1))
}
color = colorNew
}
// 处理六位的颜色值转为RGB
const colorChange = []
for (let i = 1; i < 7; i += 2) {
colorChange.push(parseInt('0x' + color.slice(i, i + 2)))
}
return colorChange.join(',')
} else {
return color
}
},
hexagonSvgPanStart (ev) { // 实例移动开始 解绑点击函数
ev.preventDefault()
setTimeout(() => { // 设置延时 解决移动后的缩放问题
this.pan = true
}, 100)
},
hexagonSvgPanEnd (ev) { // 实例移动结束 重新绑定点击函数
ev.preventDefault()
setTimeout(() => { // 设置延时 解决移动后的缩放问题
this.pan = false
}, 100)
// if(this.isShowHover&&getHexagon(this.hexagonSvgID).hexagonSvg){ // 记录移动位置 对双击事件有一定影响 暂时关闭 后续优化
// this.viewBox=getHexagon(this.hexagonSvgID).hexagonSvg.attr('viewBox');
// }
},
borderHex () { // 外层边框 数组点
const length = this.allHexagon.length
if (length == 0) { // 为0 调出
return
}
const k = { x: -this.interspace, y: -(this.interspace * 2) * this.MathSqrt3 / 6 }// 边框对起点的偏移量
const item = this.allHexagon[0].data('point')[0]
const endItemSub = this.allHexagon[length - 1].data('sub').split('-')
const borderCol = endItemSub[1]
const borderRow = endItemSub[0]
let borderPoint = [item.x + k.x, item.y + k.y]
let borderSize = this.hexagonEdge * 1.2
getHexagon(this.hexagonSvgID).svgPolyline.plot([borderPoint])
// 先从左到右划线 应该是 col的长度
let borderColTop = 0
if (borderRow == 0) {
borderColTop = borderCol
} else {
borderColTop = this.col - 1
}
for (let i = 0; i <= borderColTop * 2; i++) {
if (i === 1) {
borderSize = this.hexagonEdge * 1.1
}
if (i % 2 === 0) {
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 1, getHexagon(this.hexagonSvgID).svgPolyline)
} else {
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 2, getHexagon(this.hexagonSvgID).svgPolyline)
}
}
borderSize = this.hexagonEdge * 1.2
// 从上到下 应该是row的长度 分情况
let borderRowRight = 0// 右边循环次数
// 情况1 borderCol<=this.col && row==0时
if ((borderCol <= this.col - 1) && borderRow == 0) {
borderRowRight = 3
for (let i = 0; i < borderRowRight - 1; i++) {
if (i === 1) {
// borderPoint = borderMove(borderPoint[0],borderPoint[1],borderSize,2,,getHexagon(this.hexagonSvgID).svgPolylinetrue);
borderSize = this.hexagonEdge * 1.2
}
if (i === 2) {
// borderPoint = borderMove(borderPoint[0],borderPoint[1],borderSize,2,,getHexagon(this.hexagonSvgID).svgPolylinetrue);
borderSize = this.hexagonEdge * 1.1
}
if (i % 4 === 0) {
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 2, getHexagon(this.hexagonSvgID).svgPolyline)
} else if (i % 4 === 1) {
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 3, getHexagon(this.hexagonSvgID).svgPolyline)
} else if (i % 4 === 2) {
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 4, getHexagon(this.hexagonSvgID).svgPolyline)
} else if (i % 4 === 3) {
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 3, getHexagon(this.hexagonSvgID).svgPolyline)
}
}
}
// 情况2 border==this.col&& row>0时 且row 为奇数事
if (borderCol == this.col - 2 && borderRow > 0 && borderRow % 2 == 1) {
borderRowRight = 2 * (Number(borderRow) + 1)
for (let i = 0; i < borderRowRight; i++) {
if (i % 4 === 0) {
borderSize = this.hexagonEdge * 1.1
if (i == 0) {
borderSize = this.hexagonEdge * 1.2
}
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 2, getHexagon(this.hexagonSvgID).svgPolyline)
} else if (i % 4 === 1) {
borderSize = this.hexagonEdge * 1.2
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 3, getHexagon(this.hexagonSvgID).svgPolyline)
} else if (i % 4 === 2) {
borderSize = this.hexagonEdge * 1.1
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 4, getHexagon(this.hexagonSvgID).svgPolyline)
} else if (i % 4 === 3) {
borderSize = this.hexagonEdge * 1.03
if (i === borderRowRight - 1) {
borderSize = this.hexagonEdge * 1.1
}
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 3, getHexagon(this.hexagonSvgID).svgPolyline)
}
}
}
// 情况3 borderCol==this.col && row>0 且 row 为偶数事
if (borderCol == this.col - 1 && borderRow > 0 && borderRow % 2 == 0) {
borderRowRight = 2 * (Number(borderRow) + 1) + 1
for (let i = 0; i < borderRowRight - 1; i++) {
if (i % 4 === 0) {
borderSize = this.hexagonEdge * 1.1
if (i == 0) {
borderSize = this.hexagonEdge * 1.2
}
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 2, getHexagon(this.hexagonSvgID).svgPolyline)
} else if (i % 4 === 1) {
borderSize = this.hexagonEdge * 1.2
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 3, getHexagon(this.hexagonSvgID).svgPolyline)
} else if (i % 4 === 2) {
borderSize = this.hexagonEdge * 1.1
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 4, getHexagon(this.hexagonSvgID).svgPolyline)
} else if (i % 4 === 3) {
borderSize = this.hexagonEdge * 1.03
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 3, getHexagon(this.hexagonSvgID).svgPolyline)
}
}
}
// 情况4 border<this.col&& row>0时 且row 为奇数事
if (borderCol < this.col - 2 && borderRow > 0 && borderRow % 2 == 1) {
borderRowRight = 2 * (Number(borderRow - 1) + 1)
for (let i = 0; i < borderRowRight; i++) {
if (i % 4 === 0) {
borderSize = this.hexagonEdge * 1.1
if (i == 0) {
borderSize = this.hexagonEdge * 1.2
}
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 2, getHexagon(this.hexagonSvgID).svgPolyline)
} else if (i % 4 === 1) {
borderSize = this.hexagonEdge * 1.2
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 3, getHexagon(this.hexagonSvgID).svgPolyline)
} else if (i % 4 === 2) {
borderSize = this.hexagonEdge * 1.1
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 4, getHexagon(this.hexagonSvgID).svgPolyline)
} else if (i % 4 === 3) {
borderSize = this.hexagonEdge * 1.03
if (i === borderRowRight - 1) {
borderSize = this.hexagonEdge * 1.1
}
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 3, getHexagon(this.hexagonSvgID).svgPolyline)
}
}// 向下移动
borderSize = this.hexagonEdge * 1.2
for (let i = 0; i < (this.col - borderCol - 1) * 2 - 1; i++) { // 向左移动
if (i === 1) {
borderSize = this.hexagonEdge * 1.1
}
if (i == (this.col - borderCol - 1) * 2 - 2) {
borderSize = this.hexagonEdge
}
if (i % 2 === 0) {
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 4, getHexagon(this.hexagonSvgID).svgPolyline)
} else {
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 5, getHexagon(this.hexagonSvgID).svgPolyline)
}
}
borderSize = this.hexagonEdge * 1.1
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 3, getHexagon(this.hexagonSvgID).svgPolyline)
}
// 情况5 borderCol<this.col && row>0 且 row 为偶数事
if (borderCol < this.col - 1 && borderRow > 0 && borderRow % 2 == 0) {
borderRowRight = 2 * (Number(borderRow - 1) + 1) + 1
for (let i = 0; i < borderRowRight - 1; i++) {
if (i % 4 === 0) {
borderSize = this.hexagonEdge * 1.1
if (i == 0) {
borderSize = this.hexagonEdge * 1.2
}
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 2, getHexagon(this.hexagonSvgID).svgPolyline)
} else if (i % 4 === 1) {
borderSize = this.hexagonEdge * 1.2
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 3, getHexagon(this.hexagonSvgID).svgPolyline)
} else if (i % 4 === 2) {
borderSize = this.hexagonEdge * 1.1
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 4, getHexagon(this.hexagonSvgID).svgPolyline)
} else if (i % 4 === 3) {
borderSize = this.hexagonEdge * 1.03
if (i === borderRowRight - 2) {
borderSize = this.hexagonEdge * 1.15
}
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 3, getHexagon(this.hexagonSvgID).svgPolyline)
}
}
borderSize = this.hexagonEdge * 1.2
for (let i = 0; i < (this.col - borderCol - 1) * 2 - 1; i++) { // 向左移动
if (i == 1) {
borderSize = this.hexagonEdge * 1.1
}
if (i == (this.col - borderCol - 1) * 2 - 2) {
borderSize = this.hexagonEdge * 1
}
if (((Number(borderCol) + 2) == this.col) && (i == 0)) {
borderSize = this.hexagonEdge * 1.1
}
if (i % 2 === 0) {
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 4, getHexagon(this.hexagonSvgID).svgPolyline)
} else {
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 5, getHexagon(this.hexagonSvgID).svgPolyline)
}
}
borderSize = this.hexagonEdge * 1.1
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 3, getHexagon(this.hexagonSvgID).svgPolyline)
}
// 从右到左 就是结束时的列数
borderSize = this.hexagonEdge * 1.2
for (let i = 0; i <= borderCol * 2 + 1; i++) {
if (i === 1) {
// borderPoint = borderMove(borderPoint[0],borderPoint[1],borderSize,2,,getHexagon(this.hexagonSvgID).svgPolylinetrue);
borderSize = this.hexagonEdge * 1.1
}
if (i == borderCol * 2 + 1) {
borderSize = this.hexagonEdge * 1.2
}
if (i % 2 === 0) {
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 4, getHexagon(this.hexagonSvgID).svgPolyline)
} else {
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 5, getHexagon(this.hexagonSvgID).svgPolyline)
}
}
// 从下向上的移动
// 分兩種情況
borderSize = this.hexagonEdge * 1.2
if (borderRow % 2 == 1) {
for (let i = 0; i <= borderRow * 2; i++) {
if (i % 4 === 0) {
borderSize = this.hexagonEdge * 1.1
if (i !== 0) {
borderSize = this.hexagonEdge * 1.03
}
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 6, getHexagon(this.hexagonSvgID).svgPolyline)
} else if (i % 4 === 1) {
borderSize = this.hexagonEdge * 1.1
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 5, getHexagon(this.hexagonSvgID).svgPolyline)
} else if (i % 4 === 2) {
borderSize = this.hexagonEdge * 1.2
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 6, getHexagon(this.hexagonSvgID).svgPolyline)
} else if (i % 4 === 3) {
borderSize = this.hexagonEdge * 1.1
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 1, getHexagon(this.hexagonSvgID).svgPolyline)
}
}
}
if (borderRow % 2 == 0) {
for (let i = 0; i <= borderRow * 2; i++) {
if (i % 4 === 0) {
borderSize = this.hexagonEdge * 1.2
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 6, getHexagon(this.hexagonSvgID).svgPolyline)
} else if (i % 4 === 1) {
borderSize = this.hexagonEdge * 1.1
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 1, getHexagon(this.hexagonSvgID).svgPolyline)
} else if (i % 4 === 2) {
borderSize = this.hexagonEdge * 1.03
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 6, getHexagon(this.hexagonSvgID).svgPolyline)
} else if (i % 4 === 3) {
borderSize = this.hexagonEdge * 1.1
borderPoint = borderMove(borderPoint[0], borderPoint[1], borderSize, 5, getHexagon(this.hexagonSvgID).svgPolyline)
}
}
}
getHexagon(this.hexagonSvgID).svgPolyline.on('mouseover', PolylineOver)
getHexagon(this.hexagonSvgID).svgPolyline.on('mouseout', PolylineOut)
},
clearData () { // 清除数据 以及解绑事件 防止内存崩溃
if (getHexagon(this.hexagonSvgID) && getHexagon(this.hexagonSvgID).hexagonSvg) {
this.allHexagon.forEach((item) => {
item.off('mouseover', this.hexagonOver)
item.off('mouseout', this.hexagonOut)
item.off('click', this.changeScale)
// item.off('dblclick',this.hexagonSvgClearScale);
item.clear()
})
this.allHexagon = []
this.hexagonData = []
getHexagon(this.hexagonSvgID).hexagonSvg.off('click', this.hexagonSvgClearScale)
getHexagon(this.hexagonSvgID).hexagonSvg.off('mouseover', this.hexagonMove)
getHexagon(this.hexagonSvgID).hexagonSvg.off('panStart', this.hexagonSvgPanStart)
getHexagon(this.hexagonSvgID).hexagonSvg.off('panEnd', this.hexagonSvgPanEnd)
getHexagon(this.hexagonSvgID).hexagonSvg = null // Svg的实例
getHexagon(this.hexagonSvgID).svgPolyline = null// Svg hexagon的边框
delHexagon(this.hexagonSvgID)
}
const dom = document.getElementById(this.hexagonSvgID)
const child = document.getElementById('SvgHex' + this.hexagonSvgID)
if (dom && child) {
dom.removeChild(child)
}
return new Promise((resolve, reject) => {
resolve()
})
}
},
beforeDestroy () {
this.clearData()
if (getHexagon(this.hexagonSvgID)) {
getHexagon(this.hexagonSvgID).allHexagonRect = null// 文本框
getHexagon(this.hexagonSvgID).allHexagonText = null// 文本内容
}
window.removeEventListener('visibilitychange', this.reload)
}
}
</script>
<style scoped>
.box-hexagon, #hexagonSvg {
width: 100%;
height: 100%;
position: relative;
min-width: 200px;
min-height: 200px;
}
.hexagon-text {
position: absolute;
z-index: 1;
font-size: 10px;
}
.stop {
-webkit-animation-play-state: paused;
-moz-animation-play-state: paused;
animation-play-state: paused;
}
.mask{
position: absolute;
height: 100%;
width: 100%;
opacity: 0;
z-index: 20;
top:0;
left: 0;
}
</style>
<style>
#SvgHex {
transition: transform .25s linear;
transform-origin: 0 0;
}
#SvgHex.hexagonSvgBox {
transition: .25s linear;
}
</style>

View File

@@ -251,6 +251,30 @@ export const chart = {
value: 'stackArea', value: 'stackArea',
label: i18n.t('dashboard.panel.chartForm.typeVal.stackArea.label') label: i18n.t('dashboard.panel.chartForm.typeVal.stackArea.label')
}, },
{
value: 'area',
label: i18n.t('dashboard.panel.chartForm.typeVal.stackArea.label')
},
{
value: 'point',
label: i18n.t('dashboard.panel.chartForm.typeVal.point.label')
},
{
value: 'gauge',
label: i18n.t('dashboard.panel.chartForm.typeVal.gauge.label')
},
{
value: 'sankey',
label: i18n.t('dashboard.panel.chartForm.typeVal.sankey.label')
},
{
value: 'hexagon',
label: i18n.t('dashboard.panel.chartForm.typeVal.hexagonFigure.label')
},
{
value: 'stat',
label: i18n.t('dashboard.panel.chartForm.typeVal.singleStat.label')
},
{ {
value: 'bar', value: 'bar',
label: i18n.t('dashboard.panel.chartForm.typeVal.bar.label') label: i18n.t('dashboard.panel.chartForm.typeVal.bar.label')
@@ -283,6 +307,7 @@ export const chart = {
value: 'group', value: 'group',
label: i18n.t('dashboard.panel.chartForm.group') label: i18n.t('dashboard.panel.chartForm.group')
}, },
{ {
value: 'logs', value: 'logs',
label: i18n.t('overall.logs') label: i18n.t('overall.logs')
@@ -290,6 +315,42 @@ export const chart = {
{ {
value: 'diagram', value: 'diagram',
label: i18n.t('dashboard.panel.chartForm.typeVal.diagram.label') label: i18n.t('dashboard.panel.chartForm.typeVal.diagram.label')
},
{
value: 'treemap',
label: i18n.t('dashboard.panel.chartForm.typeVal.treemap.label')
},
{
value: 'pie',
label: i18n.t('dashboard.panel.chartForm.typeVal.pie.label')
},
{
value: 'bubble',
label: i18n.t('dashboard.panel.chartForm.typeVal.bubble.label')
},
{
value: 'rank',
label: i18n.t('dashboard.panel.chartForm.typeVal.rank.label')
},
{
value: 'log',
label: i18n.t('dashboard.panel.chartForm.typeVal.log.label')
},
{
value: 'table',
label: i18n.t('dashboard.panel.chartForm.typeVal.table.label')
},
{
value: 'map',
label: i18n.t('dashboard.panel.chartForm.typeVal.map.label')
},
{
value: 'topology',
label: i18n.t('dashboard.panel.chartForm.typeVal.topology.label')
},
{
value: 'clock',
label: i18n.t('dashboard.panel.chartForm.typeVal.clock.label')
} }
] ]
} }

View File

@@ -392,15 +392,9 @@ export default {
element.click() element.click()
}, },
copyValue () { copyValue () {
const domUrl = document.createElement('input') this.$copyText(this.fileContent).then(() => {
domUrl.value = this.fileContent this.$message.success({ message: this.$t('overall.copySuccess') })
domUrl.id = 'creatDom' })
document.body.appendChild(domUrl)
domUrl.select() // 选择对象
document.execCommand('Copy') // 执行浏览器复制命令
const creatDom = document.getElementById('creatDom')
creatDom.parentNode.removeChild(creatDom)
this.$message.success(this.$t('overall.copySuccess'))
}, },
initEvent () { initEvent () {
bus.$on('profile-dialog', () => { bus.$on('profile-dialog', () => {

View File

@@ -1321,6 +1321,9 @@ export default {
} else if (this.$refs.dataDetail) { } else if (this.$refs.dataDetail) {
tableTitle = this.$refs.dataDetail.tableTitle tableTitle = this.$refs.dataDetail.tableTitle
} }
if (!tableTitle || !this.tableId) {
return
}
let localStorageTableTitle = localStorage.getItem('nz-tableTitle-' + localStorage.getItem('nz-username') + '-' + this.tableId) let localStorageTableTitle = localStorage.getItem('nz-tableTitle-' + localStorage.getItem('nz-username') + '-' + this.tableId)
localStorageTableTitle = localStorageTableTitle ? JSON.parse(localStorageTableTitle) : tableTitle localStorageTableTitle = localStorageTableTitle ? JSON.parse(localStorageTableTitle) : tableTitle
if (tableTitle) { if (tableTitle) {

View File

@@ -1,5 +1,4 @@
import bus from '@/libs/bus' import bus from '@/libs/bus'
import { Loading } from 'element-ui'
export default { export default {
data () { data () {
return { return {

View File

@@ -70,6 +70,7 @@ export default {
clientState: this.$refs[detailType].bottomBox.object.clientState || '', clientState: this.$refs[detailType].bottomBox.object.clientState || '',
protocol: this.$refs[detailType].bottomBox.object.protocol || '', protocol: this.$refs[detailType].bottomBox.object.protocol || '',
uuid: this.$refs[detailType].bottomBox.object.uuid || '', uuid: this.$refs[detailType].bottomBox.object.uuid || '',
startTime: this.$refs[detailType].bottomBox.object.startTime || '',
model: { model: {
tsgAppliance: this.$refs[detailType].bottomBox.object.model ? this.$refs[detailType].bottomBox.object.model.tsgAppliance : '' tsgAppliance: this.$refs[detailType].bottomBox.object.model ? this.$refs[detailType].bottomBox.object.model.tsgAppliance : ''
} }
@@ -84,6 +85,7 @@ export default {
clientState: this.$refs[detailType].detailViewRightObj.clientState || '', clientState: this.$refs[detailType].detailViewRightObj.clientState || '',
protocol: this.$refs[detailType].detailViewRightObj.protocol || '', protocol: this.$refs[detailType].detailViewRightObj.protocol || '',
uuid: this.$refs[detailType].detailViewRightObj.uuid || '', uuid: this.$refs[detailType].detailViewRightObj.uuid || '',
startTime: this.$refs[detailType].detailViewRightObj.startTime || '',
model: { model: {
tsgAppliance: this.$refs[detailType].detailViewRightObj.model ? this.$refs[detailType].detailViewRightObj.model.tsgAppliance : '' tsgAppliance: this.$refs[detailType].detailViewRightObj.model ? this.$refs[detailType].detailViewRightObj.model.tsgAppliance : ''
} }
@@ -102,6 +104,7 @@ export default {
clientState: this.bottomBox.object.clientState || '', clientState: this.bottomBox.object.clientState || '',
protocol: this.bottomBox.object.protocol || '', protocol: this.bottomBox.object.protocol || '',
uuid: this.bottomBox.object.uuid || '', uuid: this.bottomBox.object.uuid || '',
startTime: this.bottomBox.object.startTime || '',
model: { model: {
tsgAppliance: this.bottomBox.object.model ? this.bottomBox.object.model.tsgAppliance : '' tsgAppliance: this.bottomBox.object.model ? this.bottomBox.object.model.tsgAppliance : ''
} }
@@ -117,6 +120,7 @@ export default {
clientState: this.detailViewRightObj.clientState || '', clientState: this.detailViewRightObj.clientState || '',
protocol: this.detailViewRightObj.protocol || '', protocol: this.detailViewRightObj.protocol || '',
uuid: this.detailViewRightObj.uuid || '', uuid: this.detailViewRightObj.uuid || '',
startTime: this.detailViewRightObj.startTime || '',
model: { model: {
tsgAppliance: this.detailViewRightObj.model ? this.detailViewRightObj.model.tsgAppliance : '' tsgAppliance: this.detailViewRightObj.model ? this.detailViewRightObj.model.tsgAppliance : ''
} }

View File

@@ -119,12 +119,18 @@ export default {
terminal_timeout: 30, terminal_timeout: 30,
terminal_telnet_user_tip: 'ogin:', terminal_telnet_user_tip: 'ogin:',
terminal_telnet_pin_tip: 'assword:', terminal_telnet_pin_tip: 'assword:',
terminal_record_local_retention: 365 terminal_record_local_retention: 365,
terminal_storage_type: '',
terminal_storage_s3_endpoint: '',
terminal_storage_s3_bucket: '',
terminal_storage_s3_access_key: '',
terminal_storage_s3_secret_access_key: ''
}, },
terminalCopy: null, terminalCopy: null,
terminalRules: { terminalRules: {
terminal_timeout: [{ validator: positiveInteger, trigger: 'blur' }], terminal_timeout: [{ validator: positiveInteger, trigger: 'blur' }],
terminal_record_local_retention: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }, { validator: positiveInteger, trigger: 'blur' }] terminal_record_local_retention: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }, { validator: positiveInteger, trigger: 'blur' }],
terminal_storage_type: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]
}, },
ldap: { ldap: {
ldap_address: '', ldap_address: '',

View File

@@ -33,7 +33,7 @@
<div class="choose-box-content" :title="item.checked.map(value=> labelValue[item.name].find(labelObj=>labelObj.value === value).label).join(' + ')"> <div class="choose-box-content" :title="item.checked.map(value=> labelValue[item.name].find(labelObj=>labelObj.value === value).label).join(' + ')">
{{item.checked.map(value=> labelValue[item.name].find(labelObj=>labelObj.value === value).label).join(' + ')}} {{item.checked.map(value=> labelValue[item.name].find(labelObj=>labelObj.value === value).label).join(' + ')}}
</div> </div>
<i class="nz-icon nz-icon-arrow-down6"/> <i class="nz-icon nz-icon-arrow-down6" style="cursor:pointer"/>
</div> </div>
</div> </div>
</el-popover> </el-popover>

View File

@@ -133,7 +133,7 @@
:use-chart-unit="false" :use-chart-unit="false"
class="pickTime margin-r-10"> class="pickTime margin-r-10">
</pick-time> </pick-time>
<button v-has="'project_edit'" class="top-tool-btn margin-r-10" type="button" @click="editTopology" :title="$t('overall.edit')"> <button v-has="'project_edit'" class="top-tool-btn margin-r-10" type="button" @click="editTopology(false)" :title="$t('overall.edit')">
<i class="nz-icon nz-icon-edit"></i> <i class="nz-icon nz-icon-edit"></i>
</button> </button>
<button class="top-tool-btn" type="button" @click="changeScreen" :title="topoScreen? $t('dashboard.screen.exit') : $t('dashboard.screen')"> <button class="top-tool-btn" type="button" @click="changeScreen" :title="topoScreen? $t('dashboard.screen.exit') : $t('dashboard.screen')">
@@ -661,6 +661,8 @@ export default {
methods: { methods: {
init () { init () {
// canvasOptions.on = this.onMessage // canvasOptions.on = this.onMessage
clearTimeout(this.timer3)
this.timer3 = null
this.reload() this.reload()
}, },
@@ -1982,7 +1984,7 @@ export default {
} }
}, },
editTopology (val) { editTopology (isPreview) {
this.editTopologyFlag = true this.editTopologyFlag = true
this.showNoData = false this.showNoData = false
this.topoScreenState = JSON.parse(JSON.stringify(this.topoScreen)) this.topoScreenState = JSON.parse(JSON.stringify(this.topoScreen))
@@ -2027,6 +2029,13 @@ export default {
item.animatePlay = false item.animatePlay = false
item.fontColor = item.data.fontColor || '#222222' item.fontColor = item.data.fontColor || '#222222'
} }
if (isPreview) {
const scale = getTopology(this.topologyIndex).store.data.scale
item.x = item.x / scale
item.y = item.y / scale
item.width = item.width / scale
item.height = item.height / scale
}
getTopology(this.topologyIndex)._setValue(item) getTopology(this.topologyIndex)._setValue(item)
}) })
getTopology(this.topologyIndex).render(true) getTopology(this.topologyIndex).render(true)
@@ -2212,7 +2221,7 @@ export default {
}, },
previewExit () { // 继续编辑 previewExit () { // 继续编辑
this.isPreview = false this.isPreview = false
this.editTopology() this.editTopology(true)
}, },
// 联动 project // 联动 project
@@ -2407,7 +2416,6 @@ export default {
window.removeEventListener('click', this.contextmenuNone) window.removeEventListener('click', this.contextmenuNone)
}, },
destroyed () { destroyed () {
} }
} }
</script> </script>

View File

@@ -104,7 +104,15 @@ export default {
if (data.type === 0 || data.type === 1) { if (data.type === 0 || data.type === 1) {
data.lineWidth = data.data.lineWidth data.lineWidth = data.data.lineWidth
} }
getTopology(this.topologyIndex).setValue(data) const obj = this.$loadsh.cloneDeep(data)
delete obj.x
delete obj.y
delete obj.center
delete obj.ex
delete obj.ey
delete obj.width
delete obj.height
getTopology(this.topologyIndex).setValue(obj)
}, },
pensActive (pens) { pensActive (pens) {
this.props = { this.props = {

View File

@@ -21,7 +21,7 @@
</el-form-item> </el-form-item>
<!-- type --> <!-- type -->
<el-form-item :label='$t("overall.type")' prop="typeId"> <el-form-item :label='$t("overall.type")' prop="typeId">
<el-select value-key="id" allow-create class="right-box__select" popper-class="right-box-select-top prevent-clickoutside" :filterable="true" v-model="editModel.typeId" placeholder="" size="small" id="module-box-input-project"> <el-select :disabled='editModel.id !== ""' value-key="id" allow-create class="right-box__select" popper-class="right-box-select-top prevent-clickoutside" :filterable="true" v-model="editModel.typeId" placeholder="" size="small" id="module-box-input-project">
<el-option v-for="(item, index) in typeDataList" :key="index" :label="item.name" :value="item.id"></el-option> <el-option v-for="(item, index) in typeDataList" :key="index" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -73,6 +73,7 @@
import selectWalk from '../../popBox/selectWalk' import selectWalk from '../../popBox/selectWalk'
import editRigthBox from '../../mixin/editRigthBox' import editRigthBox from '../../mixin/editRigthBox'
import { sysObjectIdInput } from '@/components/common/js/validate' import { sysObjectIdInput } from '@/components/common/js/validate'
import bus from '@/libs/bus'
export default { export default {
name: 'modelBox', name: 'modelBox',
@@ -184,6 +185,7 @@ export default {
if (typeof this.editModel.brandId === 'string') { // 判断是否是新增的 if (typeof this.editModel.brandId === 'string') { // 判断是否是新增的
this.$post(this.brandUrl, { name: this.editModel.brandId }).then(res => { this.$post(this.brandUrl, { name: this.editModel.brandId }).then(res => {
if (res.code === 200) { // 新增成功 if (res.code === 200) { // 新增成功
bus.$emit('refreshBrand')
this.getBrandList().then(res2 => { // 新增成功后重新调用getBrandList刷新brandList this.getBrandList().then(res2 => { // 新增成功后重新调用getBrandList刷新brandList
const newBrand = this.brandList.find(b => b.name === this.editModel.brandId) // 取出刚新增的brand对象 const newBrand = this.brandList.find(b => b.name === this.editModel.brandId) // 取出刚新增的brand对象
if (newBrand) { if (newBrand) {
@@ -225,7 +227,7 @@ export default {
}, },
/* 获取chart列表数据 */ /* 获取chart列表数据 */
ChartTemplateList () { ChartTemplateList () {
this.$get('visual/panel/chart', { pageSize: -1, varType: 1, panelId: 0, groupId: 0 }).then(res => { this.$get('visual/panel/chart', { pageSize: -1, varType: 1, panelId: 0, groupId: 0, returnChildren: 0 }).then(res => {
this.chartlList = res.data.list this.chartlList = res.data.list
}) })
}, },

View File

@@ -218,27 +218,37 @@
</template> </template>
<!-- TELNET --> <!-- TELNET -->
<template v-if="editAsset.type && editAsset.type.authProtocol === assetConstants.authProtocolData.telnet"> <template v-if="editAsset.type && editAsset.type.authProtocol === assetConstants.authProtocolData.telnet">
<div class="form__sub-title">TELNET</div> <div class="form__sub-title">TELNET
<el-form-item :label="$t('profile.username')" prop="authUsername"> <div>
<el-input maxlength="64" show-word-limit v-model="editAsset.authUsername" size="small"/> <el-switch v-model="editAsset.showTelnet" :active-value="true" :inactive-value="false" size="small"></el-switch>
</el-form-item> </div>
<el-form-item :label="$t('login.pin')" prop="authPin"> </div>
<el-input maxlength="256" show-word-limit v-model="editAsset.authPin" size="small" type="password"/> <div v-if="editAsset.showTelnet">
</el-form-item> <el-form-item :label="$t('profile.username')" prop="authUsername">
<el-form-item :label="$t('asset.usernamePrompt')" prop="authUserTip"> <el-input maxlength="64" show-word-limit v-model="editAsset.authUsername" size="small"/>
<el-input maxlength="64" show-word-limit v-model="editAsset.authUserTip" size="small"/> </el-form-item>
</el-form-item> <el-form-item :label="$t('login.pin')" prop="authPin">
<el-form-item :label="$t('asset.pinPrompt')" prop="authPinTip"> <el-input maxlength="256" show-word-limit v-model="editAsset.authPin" size="small" type="password"/>
<el-input maxlength="64" show-word-limit v-model="editAsset.authPinTip" size="small" type="password"/> </el-form-item>
</el-form-item> <el-form-item :label="$t('asset.usernamePrompt')" prop="authUserTip">
<el-form-item :label="$t('asset.port')" prop="authProtocolPort"> <el-input maxlength="64" show-word-limit v-model="editAsset.authUserTip" size="small"/>
<el-input v-model="editAsset.authProtocolPort" size="small"/> </el-form-item>
</el-form-item> <el-form-item :label="$t('asset.pinPrompt')" prop="authPinTip">
<el-input maxlength="64" show-word-limit v-model="editAsset.authPinTip" size="small" type="password"/>
</el-form-item>
<el-form-item :label="$t('asset.port')" prop="authProtocolPort">
<el-input v-model="editAsset.authProtocolPort" size="small"/>
</el-form-item>
</div>
</template> </template>
<!-- SNMP --> <!-- SNMP -->
<template v-if="editAsset.type && editAsset.type.snmpEnable === 1"> <template v-if="editAsset.type && editAsset.type.snmpEnable === 1">
<div class="form__sub-title">SNMP</div> <div class="form__sub-title">SNMP
<el-form-item :label="$t('asset.snmpCredential')" prop="snmpCredentialId"> <div>
<el-switch v-model="editAsset.showSnmp" :active-value="true" :inactive-value="false" size="small"></el-switch>
</div>
</div>
<el-form-item :label="$t('asset.snmpCredential')" prop="snmpCredentialId" v-if="editAsset.showSnmp">
<el-select v-model="editAsset.snmpCredentialId" class="right-box__select" :placeholder="$t('el.select.placeholder')" popper-class="right-box-select-top prevent-clickoutside" size="small" value-key="id"> <el-select v-model="editAsset.snmpCredentialId" class="right-box__select" :placeholder="$t('el.select.placeholder')" popper-class="right-box-select-top prevent-clickoutside" size="small" value-key="id">
<el-option v-for="snmp in options.snmpCredentialOptions" :key="snmp.id" :label="snmp.name" :value="snmp.id"></el-option> <el-option v-for="snmp in options.snmpCredentialOptions" :key="snmp.id" :label="snmp.name" :value="snmp.id"></el-option>
</el-select> </el-select>
@@ -450,6 +460,16 @@ export default {
} else { } else {
editAsset.showSSH = false editAsset.showSSH = false
} }
if (!editAsset.authType && this.editAsset.authUsername) {
editAsset.showTelnet = true
} else if (!editAsset.authType && !this.editAsset.authUsername) {
editAsset.showTelnet = false
}
if (editAsset.type.snmpEnable === 1 && editAsset.snmpCredentialId) {
editAsset.showSnmp = true
} else {
editAsset.showSnmp = false
}
this.editAsset = editAsset this.editAsset = editAsset
this.editAsset.brandAndModel = [this.editAsset.brand.id, this.editAsset.model.id] this.editAsset.brandAndModel = [this.editAsset.brand.id, this.editAsset.model.id]
this.editAsset.stateId = n.state ? n.state.id : 2 this.editAsset.stateId = n.state ? n.state.id : 2
@@ -677,6 +697,7 @@ export default {
this.editAsset.snmpCredentialId = '' this.editAsset.snmpCredentialId = ''
this.editAsset.authProtocolPort = '' this.editAsset.authProtocolPort = ''
this.editAsset.pid = '' this.editAsset.pid = ''
this.$refs.form.clearValidate()
this.getModelData() this.getModelData()
}, },
addLabel ([groupId, metaId]) { addLabel ([groupId, metaId]) {
@@ -733,12 +754,28 @@ export default {
if (params.purchaseDate) { if (params.purchaseDate) {
params.purchaseDate = bus.timeFormate(new Date(params.purchaseDate), 'YYYY-MM-DD') params.purchaseDate = bus.timeFormate(new Date(params.purchaseDate), 'YYYY-MM-DD')
} }
if (!params.showSSH) { // 判断是 ssh 还是 telnet
if (params.type.authProtocol === assetConstants.authProtocolData.telnet && !params.showTelnet) { // telnet
params.authType = '' params.authType = ''
params.authUsername = '' params.authUsername = ''
params.authPriKey = '' params.authPriKey = ''
params.authPin = '' params.authPin = ''
} }
if (params.type.authProtocol === assetConstants.authProtocolData.ssh && !params.showSSH) { // ssh
params.authType = ''
params.authUsername = ''
params.authPriKey = ''
params.authPin = ''
}
if (!params.showSSH && !params.showTelnet) {
params.authType = ''
params.authUsername = ''
params.authPriKey = ''
params.authPin = ''
}
if (!params.showSnmp) {
params.snmpCredentialId = ''
}
if (params.type.vm !== 1) { if (params.type.vm !== 1) {
params.parent = {} params.parent = {}
params.pid = '-1' params.pid = '-1'

View File

@@ -164,12 +164,6 @@ export default {
fromEndpoint: { fromEndpoint: {
type: Boolean, type: Boolean,
default: false default: false
},
variables: {
type: Array,
default: () => {
return []
}
} }
}, },
mixins: [rz, editRigthBox], mixins: [rz, editRigthBox],
@@ -183,6 +177,9 @@ export default {
computed: { computed: {
chartLastPosition () { chartLastPosition () {
return this.$store.getters.getChartLastPosition return this.$store.getters.getChartLastPosition
},
variables () {
return this.$store.state.panel.variablesArr
} }
}, },
data () { data () {

View File

@@ -27,17 +27,35 @@
</el-form-item> </el-form-item>
<!--chartTemp list--> <!--chartTemp list-->
<el-form-item :label="$t('overall.chartTemplate')" prop="pid"> <el-form-item :label="$t('overall.chartTemplate')" prop="pid">
<el-select id="chart-box-group" <!-- <el-select id="chart-box-group"-->
v-model="editChartTemp.pid" <!-- v-model="v"-->
class="right-box__select" clearable <!-- filterable-->
placeholder="" <!-- class="right-box__select" clearable-->
popper-class="prevent-clickoutside right-box-select-top" <!-- placeholder=""-->
size="small" <!-- popper-class="prevent-clickoutside right-box-select-top"-->
value-key="chartType" > <!-- size="small"-->
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in chartTempArr"> <!-- value-key="chartType" >-->
<span class="panel-dropdown-label-txt" >{{item.name}}</span> <!-- <el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in chartTempArr">-->
</el-option> <!-- <span class="panel-dropdown-label-txt" >{{item.name}}</span>-->
</el-select> <!-- </el-option>-->
<!-- </el-select>-->
<v-selectpage
:data="chartTempArr"
:tb-columns="ChartSearchShowFields"
:params="{
varType: 2, panelId: 0,
returnChildren:0,groupId:0,
}"
:multiple="false"
:language="language"
title="ChartSearch"
key-field="id"
show-field="name"
:width="626"
v-model="editChartTemp.pid"
class="form-control"
:result-format="resultFormat"
></v-selectpage>
</el-form-item> </el-form-item>
<!-- 选择资产穿梭框 --> <!-- 选择资产穿梭框 -->
@@ -106,6 +124,30 @@ export default {
{ name: 'Endpoint', id: 2 } { name: 'Endpoint', id: 2 }
], ],
chartTempArr: [], chartTempArr: [],
ChartSearchShowFields: [ // ChartSearch 下拉搜索表头
{ title: 'ID', data: 'id' },
{
title: this.$t('overall.name'),
data: function (row) {
if (row.name.length > 15) {
return row.name.substring(0, 12) + '...'
}
return row.name
},
key: 'name'
},
{ title: this.$t('overall.type'), data: 'type', key: 'type' },
{
title: this.$t('overall.remark'),
data: function (row) {
if (row.remark && row.remark.length > 15) {
return row.remark.substring(0, 12) + '...'
}
return row.remark
},
key: 'remark'
}
],
tableData: [], tableData: [],
transfer: { transfer: {
tableData: [], tableData: [],
@@ -196,7 +238,8 @@ export default {
return false return false
} }
return true return true
} },
language () { return this.$store.getters.getLanguage }
}, },
methods: { methods: {
pageNoChange (val) { pageNoChange (val) {
@@ -236,9 +279,11 @@ export default {
this.editChartTemp.varIds = this.$refs.transfer.selectedData.map(item => item.id) this.editChartTemp.varIds = this.$refs.transfer.selectedData.map(item => item.id)
} }
this.$refs.userForm.validate((valid) => { this.$refs.userForm.validate((valid) => {
const params = this.$loadsh.cloneDeep(this.editChartTemp)
params.pid = Number(params.pid)
if (valid) { if (valid) {
if (this.editChartTemp.id) { if (params.id) {
this.$put(this.url, this.editChartTemp).then(res => { this.$put(this.url, params).then(res => {
this.prevent_opt.save = false this.prevent_opt.save = false
if (res.code === 200) { if (res.code === 200) {
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') }) this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })
@@ -249,7 +294,7 @@ export default {
} }
}) })
} else { } else {
this.$post(this.url, this.editChartTemp).then(res => { this.$post(this.url, params).then(res => {
this.prevent_opt.save = false this.prevent_opt.save = false
if (res.code === 200) { if (res.code === 200) {
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') }) this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })
@@ -290,6 +335,14 @@ export default {
} }
}) })
}, },
resultFormat (resp) {
if (resp && resp.data) {
const assetData = {}
assetData.list = resp.data.list
assetData.totalRow = resp.data.total
return assetData
}
},
getTableData () { getTableData () {
if (this.editChartTemp.varType === 1) { if (this.editChartTemp.varType === 1) {
this.getAssetData() this.getAssetData()

View File

@@ -90,8 +90,8 @@ export default {
{ validator: noSpecialChar, trigger: 'blur' } { validator: noSpecialChar, trigger: 'blur' }
], ],
lnglat: [ lnglat: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }, { required: true, message: this.$t('validate.required'), trigger: 'change' },
{ validator: latlng, trigger: 'blur' } { validator: latlng, trigger: 'change' }
] ]
}, },
areaData: [], areaData: [],

View File

@@ -1439,15 +1439,9 @@ export default {
}, },
copyValue () { copyValue () {
const domUrl = document.createElement('input') this.$copyText(this.configsCopyValue).then(() => {
domUrl.value = this.configsCopyValue this.$message.success({ message: this.$t('overall.copySuccess') })
domUrl.id = 'creatDom' })
document.body.appendChild(domUrl)
domUrl.select() // 选择对象
document.execCommand('Copy') // 执行浏览器复制命令
const creatDom = document.getElementById('creatDom')
creatDom.parentNode.removeChild(creatDom)
this.$message.success(this.$t('overall.copySuccess'))
}, },
syntaxHighlight (json) { syntaxHighlight (json) {
if (typeof json != 'string') { if (typeof json != 'string') {

View File

@@ -1423,15 +1423,9 @@ export default {
}, },
copyValue () { copyValue () {
const domUrl = document.createElement('input') this.$copyText(this.configsCopyValue).then(() => {
domUrl.value = this.configsCopyValue this.$message.success({ message: this.$t('overall.copySuccess') })
domUrl.id = 'creatDom' })
document.body.appendChild(domUrl)
domUrl.select() // 选择对象
document.execCommand('Copy') // 执行浏览器复制命令
const creatDom = document.getElementById('creatDom')
creatDom.parentNode.removeChild(creatDom)
this.$message.success(this.$t('overall.copySuccess'))
}, },
copyLogsValue (index) { copyLogsValue (index) {
const domUrl = document.createElement('input') const domUrl = document.createElement('input')

View File

@@ -306,9 +306,15 @@
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
<el-form-item :label="$t('dashboard.panel.receivers')" class="item-receivers" prop="param.report.receivers"> <el-form-item :label="$t('dashboard.panel.receivers')" class="item-receivers" prop="param.report.receivers">
<el-select v-model="editPanel.param.report.receivers" clearable multiple placeholder="" popper-class="right-box-select-top prevent-clickoutside" size="small" value-key="chartType"> <el-select
<el-option v-for="item in userData" :key="item.id" :label="item.name" :value="item.id"> class="right-box__select"
<span class="panel-dropdown-label-txt" >{{item.name}}</span> v-model="editPanel.param.report.receivers" clearable multiple placeholder="" popper-class="right-box-select-top prevent-clickoutside" size="small" value-key="chartType">
<el-option
style="width: 620px"
v-for="item in userData" :key="item.id"
:label="item.name" :value="item.id">
<span class="user-name" :title="item.name">{{item.name}}</span>
<span class="user-username" :title="item.username">@{{item.username}}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -438,7 +444,7 @@ export default {
queryVariableList: [ queryVariableList: [
{ name: 'label_names()', description: this.$t('dashboard.panel.label_names()') }, { name: 'label_names()', description: this.$t('dashboard.panel.label_names()') },
{ name: 'label_values(label)', description: this.$t('dashboard.panel.label_values(label)') }, { name: 'label_values(label)', description: this.$t('dashboard.panel.label_values(label)') },
{ name: 'label_values(metric, label)', description: this.$t('dashboard.label_values(metric, label)') }, { name: 'label_values(metric, label)', description: this.$t('dashboard.panel.label_values(metric, label)') },
{ name: 'metrics(metric)', description: this.$t('dashboard.panel.metrics(metric)') }, { name: 'metrics(metric)', description: this.$t('dashboard.panel.metrics(metric)') },
{ name: 'query_result(query)', description: this.$t('dashboard.panel.query_result(query)') } { name: 'query_result(query)', description: this.$t('dashboard.panel.query_result(query)') }
] ]

View File

@@ -11,12 +11,12 @@
@selection-change="selectionChange" @selection-change="selectionChange"
@row-dblclick="(row)=>{queryMessage(row)}" @row-dblclick="(row)=>{queryMessage(row)}"
> >
<el-table-column <!-- <el-table-column
:resizable="false" :resizable="false"
align="center" align="center"
type="selection" type="selection"
width="55"> width="55">
</el-table-column> </el-table-column> -->
<el-table-column <el-table-column
v-for="(item, index) in customTableTitle" v-for="(item, index) in customTableTitle"
v-if="item.show" v-if="item.show"
@@ -86,25 +86,26 @@ export default {
return { return {
tableTitle: [ tableTitle: [
{ {
label: this.$t('overall.state'),
prop: 'state',
show: true,
minWidth: 100
}, {
label: this.$t('alert.alertRuleMessage'),
prop: 'msg',
show: true,
minWidth: 100
}, {
label: this.$t('overall.startTime'), label: this.$t('overall.startTime'),
prop: 'stts', prop: 'stts',
show: true, show: true,
minWidth: 300 minWidth: 120
}, { }, {
label: this.$t('config.terminallog.duration'), label: this.$t('config.terminallog.duration'),
prop: 'duration', prop: 'duration',
show: true, show: true,
minWidth: 120 minWidth: 120
},
{
label: this.$t('overall.state'),
prop: 'state',
show: true,
minWidth: 120
}, {
label: this.$t('alert.alertRuleMessage'),
prop: 'msg',
show: true,
minWidth: 120
} }
] ]
} }

View File

@@ -146,10 +146,3 @@ export default {
} }
} }
</script> </script>
<style scoped>
.process-name{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>

View File

@@ -179,46 +179,3 @@ export default {
} }
} }
</script> </script>
<style scoped>
.el-popover__reference{
display: flex;
align-items: center;
}
.bar {
width: 3px;
height: 14px;
border-radius: 0;
margin-right: 0px;
line-height: 100%;
}
.process-name{
height: 100%;
margin-left: 6px;
line-height: 24px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
#container {
width: 120px;
min-width: 120px;
height: 18px;
margin-right: 20px;
}
.percentage{
flex-grow: 1;
word-wrap: break-word;
}
>>>.el-progress-bar__outer{
border-radius: 2px;
background-color: #e6eaed;
}
>>>.el-progress-bar__inner{
border-radius: 0;
}
/deep/ .active-icon {
margin-left: 5px;
}
</style>
<style>
</style>

View File

@@ -22,6 +22,7 @@
:resizable="true" :resizable="true"
:sort-orders="['ascending', 'descending']" :sort-orders="['ascending', 'descending']"
:sortable="item.sortable" :sortable="item.sortable"
:width="`${item.width}`"
:show-overflow-tooltip="item.prop === 'description'" :show-overflow-tooltip="item.prop === 'description'"
class="data-column" class="data-column"
> >
@@ -59,7 +60,7 @@
</template> </template>
<template v-else-if="item.prop === 'vsysResult'"> <template v-else-if="item.prop === 'vsysResult'">
<div :title="scope.row[item.prop] && scope.row[item.prop].msg ? scope.row[item.prop].msg : '-'"> <div :title="scope.row[item.prop] && scope.row[item.prop].msg ? scope.row[item.prop].msg : '-'">
<copy :copyData='scope.row[item.prop] && scope.row[item.prop].msg ? scope.row[item.prop].msg : ""' :showInfo='scope.row[item.prop]'> <copy :copyData='scope.row[item.prop] && scope.row[item.prop].msg ? scope.row[item.prop].msg : ""' :showInfo='scope.row[item.prop] && scope.row[item.prop].msg'>
<template slot="copy-text"> <template slot="copy-text">
{{scope.row[item.prop] && scope.row[item.prop].msg ? scope.row[item.prop].msg : '-'}} {{scope.row[item.prop] && scope.row[item.prop].msg ? scope.row[item.prop].msg : '-'}}
</template> </template>
@@ -103,13 +104,15 @@ export default {
label: this.$t('asset.vsysId'), label: this.$t('asset.vsysId'),
prop: 'vsysId', prop: 'vsysId',
show: true, show: true,
minWidth: 120 minWidth: 120,
sortable: 'custom'
}, },
{ {
label: this.$t('overall.state'), label: this.$t('overall.state'),
prop: 'state', prop: 'state',
show: true, show: true,
minWidth: 120 minWidth: 120,
sortable: 'custom'
}, { }, {
label: this.$t('project.module.configs'), label: this.$t('project.module.configs'),
prop: 'vsysInfo', prop: 'vsysInfo',
@@ -124,7 +127,8 @@ export default {
label: this.$t('overall.time'), label: this.$t('overall.time'),
prop: 'uts', prop: 'uts',
show: true, show: true,
minWidth: 120 minWidth: 120,
sortable: 'custom'
} }
] ]
} }
@@ -152,14 +156,19 @@ export default {
} }
// this.$set(this.tableData,index,item);// 调用父组件 // this.$set(this.tableData,index,item);// 调用父组件
}, },
copyValue (txt) { copyValue (item) {
const str = `{ const str = {
"deviceTag": "${txt.deviceTag || ''}", deviceTag: item.deviceTag || '',
"params": "${txt.params || ''}" params: item.params || ''
}` }
this.$copyText(str).then(() => { this.$copyText(JSON.stringify(str)).then(() => {
this.$message.success({ message: this.$t('overall.copySuccess') }) this.$message.success({ message: this.$t('overall.copySuccess') })
}) })
},
// 数据排序
tableDataSort (item) {
const orderBy = { order: item.order, prop: item.prop }
this.$emit('tableDataSort', orderBy)
} }
} }
} }

View File

@@ -50,26 +50,30 @@
</button> </button>
</div> </div>
<div slot-scope="scope" v-else class="table-operation-items"> <div slot-scope="scope" class="table-operation-items" v-else>
<button class="table-operation-button" @click="Restore(scope.row)" v-if="scope.row" :title="$t('backup.RestoreNow')"> <button class="table-operation-item" :title="$t('overall.download')" v-has="'backup_download'" @click="downloadBackup(scope.row)"><i class="nz-icon nz-icon-download"></i></button>
<i class="nz-icon-shujubeifenhuifu nz-icon"></i> <el-dropdown size="medium" v-has="['backup_restore','backup_del']" trigger="click" @command="tableOperation">
</button> <div class="table-operation-item table-operation-item--more" :title="$t('overall.moreOperations')">
<div v-if="scope.row" @click="tableOperation(scope.row)"> <i class="nz-icon nz-icon-more3"></i>
<delete-button
ref="deleteButton"
:forceDeleteShow="false"
id="backup-delete"
:from="'backup'"
:type="'btn'"
:api="'/sys/backup'"
:single="true"
:delete-objs="singleDelete"
@before="delFlag=true"
></delete-button>
</div> </div>
<!-- <button class="table-operation-edit" @click="del(scope.row)" v-if="scope.row" :title="$t('overall.delete')"> <el-dropdown-menu slot="dropdown" class="right-box-select-top right-public-box-dropdown-top">
<i class="nz-icon nz-icon-delete" style="font-size='12px'"></i> <el-dropdown-item v-has="'backup_restore'" :command="['restore', scope.row]" disabled><i class="nz-icon-shujubeifenhuifu nz-icon"></i><span>{{$t('backup.RestoreNow')}}</span></el-dropdown-item>
</button> --> <el-dropdown-item v-has="'backup_del'" :command="['delete', scope.row]">
<delete-button
ref="deleteButton"
:forceDeleteShow="false"
id="backup-delete"
:from="'backup'"
:type="'link'"
:title="$t('overall.delete')"
:api="'/sys/backup'"
:single="true"
:delete-objs="singleDelete"
@before="delFlag=true"
></delete-button>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div> </div>
</el-table-column> </el-table-column>
<template slot="empty"> <template slot="empty">
@@ -87,7 +91,7 @@
<script> <script>
import { post, put } from '@/http' import { post, put } from '@/http'
import lodash from 'lodash' import axios from 'axios'
import bus from '@/libs/bus' import bus from '@/libs/bus'
import deleteButton from '@/components/common/deleteButton' import deleteButton from '@/components/common/deleteButton'
@@ -157,15 +161,6 @@ export default {
}, 400) }, 400)
} }
}, },
// del (row) {
// this.$delete('/sys/backup?filename=' + row.fileName).then(res => {
// if (res.code == 200) {
// this.$emit('getTableData', 'recent')
// } else {
// this.$message.error(res.msg)
// }
// })
// },
changeDate (item) { changeDate (item) {
const time = this.utcTimeToTimezoneStr(item) const time = this.utcTimeToTimezoneStr(item)
const time1 = this.timeFormate(time) const time1 = this.timeFormate(time)
@@ -187,17 +182,53 @@ export default {
edit () { edit () {
this.$emit('edit', this.tableData[0]) this.$emit('edit', this.tableData[0])
}, },
tableOperation (row) { tableOperation ([command, row]) {
this.$set(row, 'name', row.fileName) switch (command) {
if (this.singleDelete.length === 0) { case 'delete': {
this.singleDelete.push(row) this.$set(row, 'name', row.fileName)
} else { if (this.singleDelete.length === 0) {
this.singleDelete = [] this.singleDelete.push(row)
this.singleDelete.push(row) } else {
this.singleDelete = []
this.singleDelete.push(row)
}
break
}
case 'restore': {
this.Restore(row)
break
}
default:
break
} }
},
downloadBackup (backup) {
this.$emit('loading', true)
axios.get('/sys/backup/download?filename=' + backup.fileName, { responseType: 'blob' }).then(data => {
let fileName = new Date().getTime() + '.txt'
const disposition = data.headers['content-disposition']
if (disposition) {
fileName = disposition.split(';')[1].split('filename=')[1]
}
// 由于ie不支持download属性故需要做兼容判断
if (navigator.appVersion.toString().indexOf('.NET') > 0) {
// ie独有的msSaveBlob属性data.data为Blob文件流
window.navigator.msSaveBlob(data.data, fileName)
} else {
// 以下流程即为文章开始的下载流程
const url = window.URL.createObjectURL(data.data)
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.download = fileName
document.body.appendChild(link)
link.click()
window.URL.revokeObjectURL(link.href)
}
this.$emit('loading', false)
})
} }
}, },
watch: { watch: {
} }
} }

View File

@@ -114,6 +114,7 @@ export default {
data () { data () {
return { return {
chartTypeList: chartConstant.type, chartTypeList: chartConstant.type,
qsArr: [],
tableTitle: [ tableTitle: [
{ {
label: 'ID', label: 'ID',
@@ -185,17 +186,56 @@ export default {
case 'logs': case 'logs':
str += 'nz-icon-logs' str += 'nz-icon-logs'
break break
case 'log':
str += 'nz-icon-logs'
break
case 'bubble': case 'bubble':
str += 'nz-icon-bubble' str += 'nz-icon-bubble'
break break
case 'area':
str += 'nz-icon-stack-area'
break
case 'point':
str += 'nz-icon-bubble'
break
case 'stat':
str += 'nz-icon-single-value'
break
case 'hexagon':
str += 'nz-icon-duobianxing'
break
case 'gauge':
str += 'nz-icon-menu-dashboard'
break
case 'treemap':
str += 'nz-icon-Firewall'
break
case 'sankey':
str += 'nz-icon-sankey'
break
case 'rank':
str += 'nz-icon-rank'
break
case 'diagram':
str += 'nz-icon-diagram'
break
case 'map':
str += 'nz-icon-map'
break
case 'clock':
str += 'nz-icon-clock'
break
case 'topology':
str += 'nz-icon-projectTopology'
break
default : default :
str += 'nz-icon-table1' // str += 'nz-icon-table1'
break break
} }
return str return str
}, },
findTypeLabel (row) { findTypeLabel (row) {
const typeItem = this.chartTypeList.find(title => title.value === row.type) const typeItem = this.chartTypeList.find(title => title.value == row.type)
return typeItem ? this.$t(typeItem.label) : '-' return typeItem ? this.$t(typeItem.label) : '-'
} }
} }

View File

@@ -312,15 +312,18 @@ export default {
methods: { methods: {
copyValue (item) { copyValue (item) {
const str = item const str = item
const domUrl = document.createElement('input') // const domUrl = document.createElement('input')
domUrl.value = JSON.stringify(str) // domUrl.value = JSON.stringify(str)
domUrl.id = 'creatDom' // domUrl.id = 'creatDom'
document.body.appendChild(domUrl) // document.body.appendChild(domUrl)
domUrl.select() // 选择对象 // domUrl.select() // 选择对象
document.execCommand('Copy') // 执行浏览器复制命令 // document.execCommand('Copy') // 执行浏览器复制命令
const creatDom = document.getElementById('creatDom') // const creatDom = document.getElementById('creatDom')
creatDom.parentNode.removeChild(creatDom) // creatDom.parentNode.removeChild(creatDom)
this.$message.success(this.$t('overall.copySuccess')) // this.$message.success(this.$t('overall.copySuccess'))
this.$copyText(JSON.stringify(str)).then(() => {
this.$message.success({ message: this.$t('overall.copySuccess') })
})
}, },
suspendedStr (status) { // 10进制转为2进制 分别给对应的状态 suspendedStr (status) { // 10进制转为2进制 分别给对应的状态
if (!status || status === 1 || status == 0) { return '' } if (!status || status === 1 || status == 0) { return '' }

View File

@@ -0,0 +1,187 @@
<template>
<el-table
id="recordRuleEvalLogTable"
ref="dataTable"
:data="tableData"
:height="height"
tooltip-effect="light"
border
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"
@row-dblclick="(row)=>{queryMessage(row)}"
>
<!-- <el-table-column
:resizable="false"
align="center"
type="selection"
width="55">
</el-table-column> -->
<el-table-column
v-for="(item, index) in customTableTitle"
v-if="item.show"
:key="`col-${index}`"
:fixed="item.fixed"
:label="item.label"
:min-width="`${item.minWidth}`"
:prop="item.prop"
:resizable="true"
:sort-orders="['ascending', 'descending']"
:sortable="item.sortable"
:width="`${item.width}`"
:show-overflow-tooltip="item.prop === 'description'"
class="data-column"
>
<template slot="header">
<span class="data-column__span">{{item.label}}</span>
<div class="col-resize-area"></div>
</template>
<template slot-scope="scope" :column="item">
<template v-if="item.prop === 'state'">
<div>
<div :class="{'active-icon green-bg':scope.row.state == 200,'active-icon red-bg':scope.row.state != 200}" style="position: relative">
</div>
<span>{{scope.row.state == 200?'Ok':'Error'}}</span>
</div>
</template>
<template v-else-if="item.prop === 'duration'">
<el-tooltip :disabled="!scope.row.etts" effect="light" placement="right">
<div slot="content">
{{$t('overall.endTime')}}<br/>
{{utcTimeToTimezoneStr(scope.row.etts)}}
</div>
<span>{{getDuration(scope.row)}}</span>
</el-tooltip>
</template>
<template v-else-if="item.prop === 'stts'">
{{utcTimeToTimezoneStr(scope.row[item.prop])}}
</template>
<span v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</span>
<template v-else>-</template>
</template>
</el-table-column>
<template slot="empty">
<div v-if="!loading" class="table-no-data">
<svg class="icon" aria-hidden="true">
<use xlink:href="#nz-icon-no-data-list"></use>
</svg>
<div class="table-no-data__title">No results found</div>
</div>
<div v-else>&nbsp;</div>
</template>
</el-table>
</template>
<script>
import table from '@/components/common/mixin/table'
import { calcDurationByStringTimeMs } from '@/components/common/js/tools'
export default {
name: 'recordRuleEvalLogTable',
mixins: [table],
props: {
loading: Boolean,
nowTime: {}
},
data () {
return {
tableTitle: [
{
label: this.$t('overall.startTime'),
prop: 'stts',
show: true,
minWidth: 120
}, {
label: this.$t('config.terminallog.duration'),
prop: 'duration',
show: true,
minWidth: 120
}, {
label: this.$t('overall.state'),
prop: 'state',
show: true,
minWidth: 120
}, {
label: this.$t('alert.alertRuleMessage'),
prop: 'msg',
show: true,
minWidth: 120
}
]
}
},
computed: {
},
methods: {
getDuration (record) {
if (record.etts) {
return calcDurationByStringTimeMs(record.stts, record.etts)
}
return calcDurationByStringTimeMs(record.stts, this.utcTimeToTimezoneStr(this.nowTime))
}
}
}
</script>
<style scoped>
.colorEF7458{
color: #EF7458;
}
.color23BF9A{
color: #23BF9A;
}
/deep/ .active-icon {
margin-left: 5px;
}
</style>
<style>
.severity .P1{
background: #F5846A;
border-radius: 2px;
font-size: 12px;
color: #FFFFFF;
padding: 2px 6px;
}
.severity .P2{
background: #F7A54A;
border-radius: 2px;
font-size: 12px;
color: #FFFFFF;
padding: 2px 6px;
}
.severity .P3{
background: #F1C13D;
border-radius: 2px;
font-size: 12px;
color: #FFFFFF;
padding: 2px 6px;
}
.schedEnableTitle{
padding: 20px 15px;
margin-right: 0;
left: 1995px !important;
background: #FFFFFF;
border: 1px solid rgba(119,131,145,0.60);
box-shadow: 0 6px 16px 0 rgba(0,0,0,0.08);
border-radius: 3px;
}
.schedEnableTitle .nz-icon-a-rilizhou, .schedEnableTitle .nz-icon-dingshishijian{
font-size: 14px;
color: #666666;
margin-right: 12px;
}
.schedEnableTitle .week-item{
width: 32px;
height: 22px;
line-height: 22px;
opacity: 0.9;
background: #F6F6FA;
border-radius: 2px;
display: inline-block;
font-size: 12px;
color: #666666;
letter-spacing: 0;
font-weight: 400;
padding-left: 3px;
margin-right: 12px;
margin-bottom: 6px;
}
</style>

View File

@@ -26,7 +26,7 @@
</el-tooltip> </el-tooltip>
<!-- <div class="time-no-data">{{ showTime.text }}</div> --> <!-- <div class="time-no-data">{{ showTime.text }}</div> -->
</div> </div>
<div class="calendar-popover-text"> <div class="calendar-popover-text" style="cursor:pointer">
<i class="el-icon-arrow-down"></i> <i class="el-icon-arrow-down"></i>
</div> </div>
</div> </div>

View File

@@ -1,5 +1,5 @@
<template> <template>
<div class="system backup"> <div class="system backup" v-my-loading.dark="loading">
<div class="system-config-form system-config-backup"> <div class="system-config-form system-config-backup">
<div class="system-title">{{ $t("backup.configurations") }}</div> <div class="system-title">{{ $t("backup.configurations") }}</div>
<nz-data-list <nz-data-list
@@ -39,6 +39,7 @@
key="backups2" key="backups2"
:table-data2="tableData2" :table-data2="tableData2"
@getTableData="getTableData" @getTableData="getTableData"
@loading="load"
> >
</backups-table> </backups-table>
</template> </template>
@@ -95,7 +96,8 @@ export default {
// } // }
], ],
rightBoxshow: false, rightBoxshow: false,
isRefresh: '' isRefresh: '',
loading: false
} }
}, },
provide () { provide () {
@@ -184,6 +186,9 @@ export default {
} }
this.rightBoxshow = true this.rightBoxshow = true
}, },
load (flag) {
this.loading = flag
},
closeRightBox (refresh) { closeRightBox (refresh) {
if (refresh) { if (refresh) {
this.getTableData('backup') this.getTableData('backup')
@@ -192,7 +197,6 @@ export default {
} }
}, },
watch: {},
beforeDestroy () { beforeDestroy () {
bus.$off('backupNow', this.getTableData) bus.$off('backupNow', this.getTableData)
} }

View File

@@ -97,6 +97,7 @@ export default {
data () { data () {
return { return {
url: 'ipam/subnet', url: 'ipam/subnet',
detailType: 'list',
blankObject: { // 空白对象 blankObject: { // 空白对象
id: '', id: '',
name: '', name: '',

View File

@@ -581,12 +581,3 @@ export default {
} }
} }
</script> </script>
<style scoped>
.document-copy-text{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
</style>

View File

@@ -79,6 +79,7 @@
</div> </div>
</template> </template>
<script> <script>
import bus from '@/libs/bus'
import deleteButton from '@/components/common/deleteButton' import deleteButton from '@/components/common/deleteButton'
import modelBox from '@/components/common/rightBox/administration/modelBox' import modelBox from '@/components/common/rightBox/administration/modelBox'
import nzDataList from '@/components/common/table/nzDataList' import nzDataList from '@/components/common/table/nzDataList'
@@ -129,6 +130,11 @@ export default {
} }
} }
}, },
mounted () {
bus.$on('refreshBrand', () => {
this.$refs.dataList.$refs.searchInput.getBrandData()
})
},
methods: { methods: {
chartBySync (row) { chartBySync (row) {
this.$store.dispatch('dispatchHomeLoading', true) this.$store.dispatch('dispatchHomeLoading', true)
@@ -143,6 +149,11 @@ export default {
}) })
} }
}, },
beforeDestroy () {
bus.$off('refreshBrand', () => {
this.$refs.dataList.$refs.searchInput.getBrandData()
})
},
created () { created () {
}, },

View File

@@ -31,6 +31,7 @@
<vue-tags-input <vue-tags-input
v-model="tag" v-model="tag"
:maxlength="32" :maxlength="32"
:class="monitor.interface_name.length !== 0 ? 'interface-name' : ''"
:placeholder="$t('overall.add.interface_name')" :placeholder="$t('overall.add.interface_name')"
:tags="monitor.interface_name" :tags="monitor.interface_name"
@tags-changed="newTags=> monitor.interface_name = newTags" @tags-changed="newTags=> monitor.interface_name = newTags"
@@ -63,7 +64,7 @@
<el-input v-model="monitor.metrics_storage_s3_access_key" id="monitor-metrics_storage_s3_access_key"> <el-input v-model="monitor.metrics_storage_s3_access_key" id="monitor-metrics_storage_s3_access_key">
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('config.terminallog.key')" prop="metrics_storage_s3_secret_access_key" :rules=" [ { required: monitor.metrics_storage_type == 2, message: this.$t('validate.required'), trigger: 'blur' }]" class="monitorLastEle"> <el-form-item :label="$t('config.terminallog.key')" prop="metrics_storage_s3_secret_access_key" :rules=" [ { required: monitor.metrics_storage_type == 2, message: this.$t('validate.required'), trigger: 'blur' }]" class="monitorLastElement">
<el-input v-model="monitor.metrics_storage_s3_secret_access_key" id="monitor-metrics_storage_s3_secret_access_key" type="password"> <el-input v-model="monitor.metrics_storage_s3_secret_access_key" id="monitor-metrics_storage_s3_secret_access_key" type="password">
</el-input> </el-input>
</el-form-item> </el-form-item>
@@ -99,7 +100,7 @@
<el-input v-model="monitor.logs_storage_s3_access_key" id="monitor-logs_storage_s3_access_key"> <el-input v-model="monitor.logs_storage_s3_access_key" id="monitor-logs_storage_s3_access_key">
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('config.terminallog.key')" prop="logs_storage_s3_secret_access_key" :rules=" [ { required: monitor.logs_storage_type == 2, message: this.$t('validate.required'), trigger: 'blur' }]" class="monitorLastEle"> <el-form-item :label="$t('config.terminallog.key')" prop="logs_storage_s3_secret_access_key" :rules=" [ { required: monitor.logs_storage_type == 2, message: this.$t('validate.required'), trigger: 'blur' }]" class="monitorLastElement">
<el-input v-model="monitor.logs_storage_s3_secret_access_key" id="monitor-logs_storage_s3_secret_access_key" type="password"> <el-input v-model="monitor.logs_storage_s3_secret_access_key" id="monitor-logs_storage_s3_secret_access_key" type="password">
</el-input> </el-input>
</el-form-item> </el-form-item>
@@ -185,7 +186,4 @@ export default {
} }
</script> </script>
<style scoped> <style scoped>
.vue-tags-input{
max-width: unset;
}
</style> </style>

View File

@@ -384,15 +384,9 @@ export default {
element.click() element.click()
}, },
copyValue () { copyValue () {
const domUrl = document.createElement('input') this.$copyText(this.fileContent).then(() => {
domUrl.value = this.fileContent this.$message.success({ message: this.$t('overall.copySuccess') })
domUrl.id = 'creatDom' })
document.body.appendChild(domUrl)
domUrl.select() // 选择对象
document.execCommand('Copy') // 执行浏览器复制命令
const creatDom = document.getElementById('creatDom')
creatDom.parentNode.removeChild(creatDom)
this.$message.success(this.$t('overall.copySuccess'))
}, },
fileClosed () { fileClosed () {
this.personalCenter() this.personalCenter()

View File

@@ -118,6 +118,7 @@ export default {
return { return {
url: 'record/rule', url: 'record/rule',
tableId: 'recordRuleTable', tableId: 'recordRuleTable',
detailType: 'list',
searchMsg: { // 给搜索框子组件传递的信息 searchMsg: { // 给搜索框子组件传递的信息
searchLabelList: [ searchLabelList: [
{ {

View File

@@ -263,6 +263,22 @@ export default {
}) })
} }
}, },
copy (u, copyParams) {
const copyName = this.$loadsh.get(copyParams, 'copyName', '-copy')
this.object = { ...u, name: u.name + copyName, id: '' }
if (this.object.name.length > 64) {
const length = this.object.name.length - 64
this.object.name = u.name.substring(0, u.name.length - length) + '-copy'
}
if (this.object.type !== 'group') {
this.object.elements = this.object.elements.map(item => {
item.id = ''
return item
})
}
this.rightBox.show = true
},
chartBySync (row) { chartBySync (row) {
this.$store.dispatch('dispatchHomeLoading', true) this.$store.dispatch('dispatchHomeLoading', true)
this.$post('visual/panel/chart/syncTmpl', { pid: row.id }).then(res => { this.$post('visual/panel/chart/syncTmpl', { pid: row.id }).then(res => {

View File

@@ -19,7 +19,33 @@
<template slot="append"><span >{{$t('config.system.basic.day')}}</span></template> <template slot="append"><span >{{$t('config.system.basic.day')}}</span></template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item :label="$t('config.system.monitor.metrics_storage_type')" prop="terminal_storage_type">
<el-select v-model="terminal.terminal_storage_type" popper-class="right-box-select-top right-public-box-dropdown-top">
<el-option :label="$t('config.system.monitor.local')" value="1"></el-option>
<el-option :label="$t('config.system.monitor.s3')" value="2"></el-option>
</el-select>
</el-form-item>
<transition name="el-zoom-in-top">
<div v-show="terminal.terminal_storage_type == 2">
<el-form-item :label="$t('asset.endpoint')" prop="terminal_storage_s3_endpoint" :rules=" [ { required: terminal.terminal_storage_type == 2, message: this.$t('validate.required'), trigger: 'blur' }]">
<el-input v-model="terminal.terminal_storage_s3_endpoint" id="terminal-terminal_storage_s3_endpoint">
</el-input>
</el-form-item>
<el-form-item :label="$t('config.system.monitor.metrics_storage_s3_bucket')" prop="terminal_storage_s3_bucket" :rules=" [ { required: terminal.terminal_storage_type == 2, message: this.$t('validate.required'), trigger: 'blur' }]">
<el-input v-model="terminal.terminal_storage_s3_bucket" id="terminal-terminal_storage_s3_bucket">
</el-input>
</el-form-item>
<el-form-item :label="$t('config.system.monitor.metrics_storage_s3_access_key')" prop="terminal_storage_s3_access_key" :rules=" [ { required: terminal.terminal_storage_type == 2, message: this.$t('validate.required'), trigger: 'blur' }]">
<el-input v-model="terminal.terminal_storage_s3_access_key" id="terminal-terminal_storage_s3_access_key">
</el-input>
</el-form-item>
<el-form-item :label="$t('config.terminallog.key')" prop="terminal_storage_s3_secret_access_key" :rules=" [ { required: terminal.terminal_storage_type == 2, message: this.$t('validate.required'), trigger: 'blur' }]" class="monitorLastElement">
<el-input v-model="terminal.terminal_storage_s3_secret_access_key" id="terminal-terminal_storage_s3_secret_access_key" type="password">
</el-input>
</el-form-item>
</div>
</transition>
<el-form-item>
<button v-has="'system_terminal_edit'" :class="{'nz-btn-disabled':prevent_opt.save}" :disabled="prevent_opt.save" class="nz-btn nz-btn-size-normal nz-btn-style-normal" type="button" @click="saveSetInfo('terminal','terminalForm')">{{$t('overall.save')}}</button> <button v-has="'system_terminal_edit'" :class="{'nz-btn-disabled':prevent_opt.save}" :disabled="prevent_opt.save" class="nz-btn nz-btn-size-normal nz-btn-style-normal" type="button" @click="saveSetInfo('terminal','terminalForm')">{{$t('overall.save')}}</button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@@ -42,12 +68,18 @@ export default {
terminal_timeout: 30, terminal_timeout: 30,
terminal_telnet_user_tip: 'ogin:', terminal_telnet_user_tip: 'ogin:',
terminal_telnet_pin_tip: 'assword:', terminal_telnet_pin_tip: 'assword:',
terminal_record_local_retention: 365 terminal_record_local_retention: 365,
terminal_storage_type: '',
terminal_storage_s3_endpoint: '',
terminal_storage_s3_bucket: '',
terminal_storage_s3_access_key: '',
terminal_storage_s3_secret_access_key: ''
}, },
terminalCopy: null, terminalCopy: null,
terminalRules: { terminalRules: {
terminal_timeout: [{ validator: positiveInteger, trigger: 'blur' }], terminal_timeout: [{ validator: positiveInteger, trigger: 'blur' }],
terminal_record_local_retention: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }, { validator: positiveInteger, trigger: 'blur' }] terminal_record_local_retention: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }, { validator: positiveInteger, trigger: 'blur' }],
terminal_storage_type: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]
} }
} }
}, },

View File

@@ -4253,6 +4253,7 @@ export default {
} }
if (!this.showMetrics) { if (!this.showMetrics) {
params.limit = this.$refs.logDetail ? this.$refs.logDetail.getLimit() : 100 params.limit = this.$refs.logDetail ? this.$refs.logDetail.getLimit() : 100
params.direction = this.$refs.logDetail ? this.$refs.logDetail.getDescending() : 'backward'
} }
this.$store.dispatch('dispatchHomeLoading', true) this.$store.dispatch('dispatchHomeLoading', true)
this.$get('/visual/explore/snapshot', params, 'blob').then(res => { this.$get('/visual/explore/snapshot', params, 'blob').then(res => {
@@ -4287,7 +4288,6 @@ export default {
document.body.removeChild(link) // 下载完成移除元素 document.body.removeChild(link) // 下载完成移除元素
window.URL.revokeObjectURL(href) // 释放blob对象 window.URL.revokeObjectURL(href) // 释放blob对象
} }
this.$refs.topTool.closeDialog()
}, () => { }, () => {
this.$message.error('123') this.$message.error('123')
}) })

View File

@@ -28,12 +28,13 @@
<el-collapse-item class="el-collapse-item__height" name="2" title="Table"> <el-collapse-item class="el-collapse-item__height" name="2" title="Table">
<div slot="title" class="explore-table-title"> <div slot="title" class="explore-table-title">
{{$t('dashboard.panel.chartForm.typeVal.table.label')}} {{$t('dashboard.panel.chartForm.typeVal.table.label')}}
<!-- <i--> <i
<!-- class="nz-icon-gear nz-icon"--> class="nz-icon-gear nz-icon"
<!-- style="position: absolute;right: 10px;top: 8px"--> style="position: absolute;right: 10px;top: 8px"
<!-- @click.stop="tools.showCustomTableTitle = true"--> @click.stop="tools.showCustomTableTitle = true"
<!-- :title="$t('overall.selectColumns')"--> :title="$t('overall.selectColumns')"
<!-- ></i>--> >
</i>
<!-- 自定义table列 --> <!-- 自定义table列 -->
<transition name="el-zoom-in-top"> <transition name="el-zoom-in-top">
<element-set <element-set
@@ -51,13 +52,14 @@
</div> </div>
<!-- 自定义table列 --> <!-- 自定义table列 -->
<div class="nz-table-list explore-table"> <div class="nz-table-list explore-table">
<el-table ref="exploreTable" <el-table
v-my-loading="tools.loading" ref="exploreTable"
class="metric-table" v-my-loading="tools.loading"
:data="tableData" class="metric-table"
border :data="tableData"
:header-cell-class-name="({ column }) => column.property === 'gear' ? 'explore-table-gear' : ''" border
tooltip-effect="light"> :header-cell-class-name="({ column }) => column.property === 'gear' ? 'explore-table-gear' : ''"
tooltip-effect="light">
<el-table-column <el-table-column
v-for="(item, index) in tools.customTableTitle" v-for="(item, index) in tools.customTableTitle"
v-if="item.show" v-if="item.show"
@@ -85,8 +87,7 @@
</template> </template>
</el-table> </el-table>
</div> </div>
<pagination ref="Pagination" :page-obj="pageObj" @pageNo='pageNo' <pagination ref="Pagination" :page-obj="pageObj" @pageNo='pageNo' @pageSize='pageSize'></pagination>
@pageSize='pageSize'></pagination>
</el-collapse-item> </el-collapse-item>
</template> </template>
<!--log--> <!--log-->
@@ -97,7 +98,7 @@
</div> </div>
</el-collapse-item> </el-collapse-item>
<el-collapse-item v-if="showTab.indexOf('2') > -1" name="2" title="Logs"> <el-collapse-item v-if="showTab.indexOf('2') > -1" name="2" title="Logs">
<log-tab ref="logDetail" :timeRange="filterTime" :log-data="logData" :explore-log-table="logTabNoData" :explore-item="true" :tab-index="tabIndex" @limitChange="queryLogData" v-my-loading="chartLoading"></log-tab> <log-tab ref="logDetail" :timeRange="filterTime" :log-data="logData" :explore-log-table="logTabNoData" :explore-item="true" :tab-index="0" v-my-loading="chartLoading"></log-tab>
</el-collapse-item> </el-collapse-item>
</template> </template>
</el-collapse> </el-collapse>

View File

@@ -14,6 +14,7 @@
<span class="operation-label">{{$t('dashboard.explore.descending')}}</span> <span class="operation-label">{{$t('dashboard.explore.descending')}}</span>
<el-switch <el-switch
v-model="operations.descending" v-model="operations.descending"
:disabled="Boolean(dataJson)"
> >
</el-switch> </el-switch>
</div> </div>
@@ -26,7 +27,7 @@
</div> </div>
<div class="log-operation"> <div class="log-operation">
<span class="operation-label">{{$t('overall.limit')}}:</span> <span class="operation-label">{{$t('overall.limit')}}:</span>
<el-select v-model="limit" size="small" style="width: 100px;" popper-class="right-box-select-top right-public-box-dropdown-top"> <el-select v-model="limit" :disabled="Boolean(dataJson)" size="small" style="width: 100px;" popper-class="right-box-select-top right-public-box-dropdown-top">
<el-option v-for="option in limitOptions" :key="option" :value="option"></el-option> <el-option v-for="option in limitOptions" :key="option" :value="option"></el-option>
</el-select> </el-select>
</div> </div>
@@ -34,7 +35,7 @@
<span class="operation-label">Result:</span> <span class="operation-label">Result:</span>
<span class="operation-length">{{tableData.length}}</span> <span class="operation-length">{{tableData.length}}</span>
</div> </div>
<div class="log-operation log-operation--right" v-if=" dataJson && dataJson.type"> <div class="log-operation log-operation--right" v-if="!dataJson">
<button class="top-tool-btn" style="cursor: pointer;z-index: 2;" type="button" @click="exportLog" :title="$t('overall.download')"><i class="nz-icon nz-icon-download"></i></button> <button class="top-tool-btn" style="cursor: pointer;z-index: 2;" type="button" @click="exportLog" :title="$t('overall.download')"><i class="nz-icon nz-icon-download"></i></button>
</div> </div>
</div> </div>
@@ -181,7 +182,14 @@ export default {
timeFormatData: [], timeFormatData: [],
tableChartData: [], tableChartData: [],
myChart: null, myChart: null,
noData: false noData: false,
filterData: []
}
},
created () {
if (this.dataJson) {
this.limit = this.dataJson.limit || 100
this.operations.descending = this.dataJson.direction === 'backward'
} }
}, },
methods: { methods: {
@@ -190,6 +198,9 @@ export default {
levels: [0, 1, 2, 3, 4, 5, 6], levels: [0, 1, 2, 3, 4, 5, 6],
descending: true descending: true
} }
if (this.dataJson) {
this.operations.descending = this.dataJson.direction === 'backward'
}
}, },
exportLog () { exportLog () {
this.$emit('exportLog', { limit: this.limit, ...this.operations }) this.$emit('exportLog', { limit: this.limit, ...this.operations })
@@ -228,6 +239,20 @@ export default {
}, },
loadChart () { loadChart () {
const vm = this const vm = this
const selectObj = {}
const sele = []
this.filterData.forEach(item => {
if (sele.indexOf(item.level) == -1) {
sele.push(item.level)
}
})
this.tableChartData.forEach(item => {
if (sele.indexOf(item.name) !== -1) {
selectObj[item.name] = true
} else {
selectObj[item.name] = false
}
})
const dom = document.getElementById(`logChart${this.tabIndex}`) const dom = document.getElementById(`logChart${this.tabIndex}`)
if (!dom) { if (!dom) {
return return
@@ -255,9 +280,10 @@ export default {
}, },
grid: { grid: {
top: 20, top: 20,
left: 30, left: 20,
right: 10, right: 10,
bottom: 80 bottom: 80,
containLabel: true
}, },
legend: { legend: {
bottom: 20, bottom: 20,
@@ -270,6 +296,7 @@ export default {
padding: [0, 0, 0, 6], padding: [0, 0, 0, 6],
color: this.theme == 'light' ? '#666666' : '#BEBEBE' color: this.theme == 'light' ? '#666666' : '#BEBEBE'
}, },
selected: selectObj,
inactiveColor: this.theme == 'light' ? '#BEBEBE' : '#666666' // 字体颜色 inactiveColor: this.theme == 'light' ? '#BEBEBE' : '#666666' // 字体颜色
}, },
series, series,
@@ -395,6 +422,7 @@ export default {
}) })
return hit return hit
}) })
this.filterData = filterLevelData
// 复制一份升序的数据用于后面处理 // 复制一份升序的数据用于后面处理
const copyData = [...data] const copyData = [...data]
// 升降序 // 升降序
@@ -468,6 +496,9 @@ export default {
getLimit () { getLimit () {
return this.limit return this.limit
}, },
getDescending () {
return this.operations.descending ? 'backward' : 'forward'
},
resizeChart () { resizeChart () {
setTimeout(() => { setTimeout(() => {
this.myChart.resize() this.myChart.resize()
@@ -571,9 +602,6 @@ export default {
this.tableData = tableData this.tableData = tableData
this.tableChartData = tableChartData this.tableChartData = tableChartData
} }
},
limit (n) {
this.$emit('limitChange', n)
} }
}, },
destroyed () { destroyed () {

View File

@@ -127,7 +127,6 @@
:from="fromRoute.panel" :from="fromRoute.panel"
:panel-data="panelData" :panel-data="panelData"
:show-panel="showPanel" :show-panel="showPanel"
:variables="variables"
@close="closeChartBox" @close="closeChartBox"
@reload="panelReload" @reload="panelReload"
@reloadOnlyPanel="panelReloadOnlyPanel" @reloadOnlyPanel="panelReloadOnlyPanel"

View File

@@ -165,6 +165,7 @@ export default {
}, },
data () { data () {
return { return {
tableId: 'ping',
// 防止用户重复点击 // 防止用户重复点击
flag: true, flag: true,
loading: false, loading: false,

View File

@@ -158,6 +158,7 @@ export default {
}, },
data () { data () {
return { return {
tableId: 'trace',
// 防止用户重复点击 // 防止用户重复点击
flag: true, flag: true,
loading: false, loading: false,

File diff suppressed because one or more lines are too long

View File

@@ -2,7 +2,7 @@
// import 'element-ui/lib/theme-chalk/index.css' // import 'element-ui/lib/theme-chalk/index.css'
// import 'xterm/dist/xterm.css' // import 'xterm/dist/xterm.css'
import '@/assets/css/main.scss' import '@/assets/css/main.scss'
// import '@/assets/css/font/iconfont.js' import '@/assets/css/font/iconfont.js'
import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import i18n from '@/components/common/i18n' import i18n from '@/components/common/i18n'
@@ -21,12 +21,14 @@ import { clickoutside, bottomBoxWindow, stringTimeParseToUnix, unixTimeParseToSt
import * as tools from '@/components/common/js/tools.js' import * as tools from '@/components/common/js/tools.js'
import * as constants from '@/components/common/js/constants.js' import * as constants from '@/components/common/js/constants.js'
import elementSet from '@/components/common/elementSet' // 自定义表头组件
import chartList from '@/components/chart/chartList.vue' // 全局引入 chartList 组件 防止 chart-group爆粗 import chartList from '@/components/chart/chartList.vue' // 全局引入 chartList 组件 防止 chart-group爆粗
import pickTime from '@/components/common/pickTime' import pickTime from '@/components/common/pickTime'
import nzDataList from '@/components/common/table/nzDataList' import nzDataList from '@/components/common/table/nzDataList'
import mainMixin from '@/components/common/mixin/mainMixinFun' import mainMixin from '@/components/common/mixin/mainMixinFun'
import Pagination from '@/components/common/pagination' import Pagination from '@/components/common/pagination'
Vue.component('element-set', elementSet) // 公用设置表头
Vue.component('pick-time', pickTime) Vue.component('pick-time', pickTime)
Vue.component('nzDataList', nzDataList) Vue.component('nzDataList', nzDataList)
Vue.component('chartList', chartList) Vue.component('chartList', chartList)

File diff suppressed because one or more lines are too long

View File

@@ -31,10 +31,10 @@ export default new Router({
path: '/explore', path: '/explore',
component: resolve => require(['@/components/page/dashboard/explore/explore'], resolve) component: resolve => require(['@/components/page/dashboard/explore/explore'], resolve)
}, },
{ // {
path: '/overview', // path: '/overview',
component: resolve => require(['@/components/page/dashboard/overview/overview'], resolve) // component: resolve => require(['@/components/page/dashboard/overview/overview'], resolve)
}, // },
{ {
path: '/project', path: '/project',
component: resolve => require(['@/components/page/monitor/project/index'], resolve) component: resolve => require(['@/components/page/monitor/project/index'], resolve)