fix:解决冲突

This commit is contained in:
zyh
2023-03-15 16:11:44 +08:00
75 changed files with 415 additions and 1404 deletions

View File

@@ -12,7 +12,7 @@
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"
@row-dblclick="(row)=>{$emit('showBottomBox', 'panelTab', row)}"
@row-dblclick="(row)=>{$emit('showBottomBox', 'dashboardTab', row)}"
>
<el-table-column
:resizable="false"
@@ -156,7 +156,7 @@
<div slot="header" class="table-operation-title">{{$t('overall.option')}}</div>
<div slot-scope="scope" class="table-operation-items">
<button v-if="assetTab" class="table-operation-item" v-has="'model_edit'" @click="$emit('edit', scope.row)" :title="$t('overall.edit')"><i class="nz-icon nz-icon-edit"></i></button>
<button v-else class="table-operation-item" @click="$emit('showBottomBox', 'panelTab', scope.row)" :title="$t('overall.view')"><i class="nz-icon nz-icon-view1"></i></button>
<button v-else class="table-operation-item" @click="$emit('showBottomBox', 'dashboardTab', scope.row)" :title="$t('overall.view')"><i class="nz-icon nz-icon-view1"></i></button>
<el-dropdown size="medium" v-has="['asset_edit','asset_connect','asset_add','asset_delete', 'alertSilence_add']" trigger="click" @command="tableOperation">
<div class="table-operation-item table-operation-item--more" :title="$t('overall.moreOperations')">
<i class="nz-icon nz-icon-more3"></i>

View File

@@ -9,7 +9,7 @@
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"
@row-dblclick="(row)=>{showBottomBox('panel', row)}"
@row-dblclick="(row)=>{showBottomBox('dashboardTab', row)}"
>
<el-table-column
:resizable="false"
@@ -58,7 +58,7 @@
fixed="right">
<div slot="header" class="table-operation-title">{{$t('overall.option')}}</div>
<div slot-scope="scope" class="table-operation-items">
<button class="table-operation-item" @click="showBottomBox('panel', scope.row)" :title="$t('overall.view')"><i class="nz-icon nz-icon-view1"></i></button>
<button class="table-operation-item" @click="showBottomBox('dashboardTab', scope.row)" :title="$t('overall.view')"><i class="nz-icon nz-icon-view1"></i></button>
<el-dropdown size="medium" v-has="['chartTemplate_edit','chartTemplate_delete']" trigger="click" @command="tableOperation">
<div class="table-operation-item table-operation-item--more" :title="$t('overall.moreOperations')">
<i class="nz-icon nz-icon-more3"></i>

View File

@@ -9,7 +9,7 @@
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"
@row-dblclick="(row)=>{showBottomBox('panel', row)}"
@row-dblclick="(row)=>{showBottomBox('dashboardTab', row)}"
>
<el-table-column
:resizable="false"
@@ -58,7 +58,7 @@
fixed="right">
<div slot="header" class="table-operation-title">{{$t('overall.option')}}</div>
<div slot-scope="scope" class="table-operation-items">
<button class="table-operation-item" @click="showBottomBox('panel', scope.row)" :title="$t('overall.view')"><i class="nz-icon nz-icon-view1"></i></button>
<button class="table-operation-item" @click="showBottomBox('dashboardTab', scope.row)" :title="$t('overall.view')"><i class="nz-icon nz-icon-view1"></i></button>
<el-dropdown size="medium" v-has="['dashboard_temp_add','dashboard_temp_edit','dashboard_temp_delete']" trigger="click" @command="tableOperation">
<div class="table-operation-item table-operation-item--more" :title="$t('overall.moreOperations')">
<i class="nz-icon nz-icon-more3"></i>

View File

@@ -11,7 +11,7 @@
@cell-mouse-enter="cellMouseEnter"
@sort-change="tableDataSort"
@selection-change="selectionChange"
@row-dblclick="(row)=>{$emit('showBottomBox', 'panelTab', row)}"
@row-dblclick="(row)=>{$emit('showBottomBox', 'dashboardTab', row)}"
>
<el-table-column
:resizable="false"
@@ -102,7 +102,7 @@
@mouseleave="labelHover1(scope.row, item.prop, false, $event, true)">
[{{scope.row.configs[0].enable ? 'Metrics':''}}{{scope.row.configs[0].enable&&scope.row.configs[1].enable?',':''}}{{scope.row.configs[1].enable ? 'logs' : ''}}]
</span>
<nz-tooltip :that="scope.row[item.prop]" class="data-column__" v-if="scope.row[item.prop] && scope.row[item.prop].loading" :type="item.prop">
<nz-tooltip :that="scope.row[item.prop]" class="data-column__" v-if="scope.row[item.prop] && scope.row[item.prop].loading" :type="item.prop" @tipHover="tipHover($event,scope.row, item.prop,)" >
<div name="default">
<span class="copy-value-content" :title="$t('overall.duplicate')"> <i class="nz-icon nz-icon-override" @click="copyValue(clConfigs(scope.row))"></i></span>
<pre class="copy-value-content__pre">{{JSON.stringify(clConfigs(scope.row),null,2)}}</pre>
@@ -169,7 +169,7 @@
<div slot="header" class="table-operation-title">{{$t('overall.option')}}</div>
<div slot-scope="scope" class="table-operation-items">
<button v-if="endpointTab" class="table-operation-item" v-has="'monitor_endpoint_edit'" @click="$emit('edit', scope.row)" :title="$t('overall.edit')"><i class="nz-icon nz-icon-edit"></i></button>
<button v-else class="table-operation-item" @click="$emit('showBottomBox', 'panelTab', scope.row)" :title="$t('overall.view')"><i class="nz-icon nz-icon-view1"></i></button>
<button v-else class="table-operation-item" @click="$emit('showBottomBox', 'dashboardTab', scope.row)" :title="$t('overall.view')"><i class="nz-icon nz-icon-view1"></i></button>
<el-dropdown size="medium" v-has="['monitor_endpoint_edit','monitor_endpoint_delete','alertSilence_add']" trigger="click" @command="tableOperation">
<div class="table-operation-item table-operation-item--more" :title="$t('overall.moreOperations')">
<i class="nz-icon nz-icon-more3"></i>
@@ -343,7 +343,7 @@ export default {
if (slow) {
item[type].timeout = setTimeout(() => {
this.$set(item[type], 'loading', loading)
}, 200)
}, 500)
} else {
if (item[type].timeout) {
clearTimeout(item[type].timeout)
@@ -353,6 +353,13 @@ export default {
}
// this.$set(this.tableData,index,item);// 调用父组件
},
tipHover (tipLoading, item, type) {
if (item[type].timeout) {
clearTimeout(item[type].timeout)
item[type].timeout = null
}
this.$set(item[type], 'loading', tipLoading)
},
labelHoverConfigs (item, type, loading, e, slow) {
if (e) {
const dom = e.currentTarget
@@ -425,8 +432,11 @@ export default {
right: 8px;
top: 4px;
}
.alert-label__border.alert-label{
width: auto !important;
}
.copy-value-content__pre {
width: 500px;
width: auto;
height: 200px;
margin-top: 20px;
overflow-y: scroll;

View File

@@ -64,8 +64,8 @@
</template>
</copy>
</template>
<template v-else-if="item.prop === 'panel'">
{{scope.row.panel ? scope.row.panel.name : '-'}}
<template v-else-if="item.prop === 'dashboard'">
{{scope.row.dashboard ? scope.row.dashboard.name : '-'}}
</template>
<span v-else-if="item.prop === 'createTime'">{{utcTimeToTimezoneStr(scope.row[item.prop])}}</span>
<template v-else-if="item.prop === 'assetNum'">
@@ -156,7 +156,7 @@ export default {
show: true
}, {
label: this.$t('model.dashboardtemplate'),
prop: 'panel',
prop: 'dashboard',
minWidth: 200,
show: false
}, {

View File

@@ -76,8 +76,8 @@
/>
</span>
</template>
<template v-else-if="item.prop === 'panel'">
{{scope.row.panel ? scope.row.panel.name : '-'}}
<template v-else-if="item.prop === 'dashboard'">
{{scope.row.dashboard ? scope.row.dashboard.name : '-'}}
</template>
<span v-else-if="item.prop === 'id'" :id="'globalSearch' + scope.row.id">{{scope.row[item.prop]}}</span>
<span v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</span>
@@ -167,7 +167,7 @@ export default {
sortable: 'custom'
}, {
label: this.$t('model.dashboardtemplate'),
prop: 'panel',
prop: 'dashboard',
minWidth: 150,
show: false
}, {

View File

@@ -71,9 +71,6 @@
@showFullscreen="showFullscreen"
></panel-chart>
</el-dialog>
<transition name="right-box">
<chart-box :chart="chart" :panel-data="panelData" :show-panel="{id: -1, name: '', type: 'endpointQuery'}" @close="rightBox.show = false" @on-create-success="createSuccess" @reload="getPanelData" @reloadOnlyPanel="getPanelData" box-class="save-chart-box" from="project_endpoint_query" ref="addChartModal" v-if="rightBox.show" style="z-index: 2900" :fromEndpoint="true"></chart-box>
</transition>
<transition name="right-box">
<chart-right-box
v-if="chartRightBoxShow"
@@ -81,7 +78,7 @@
ref="addChartModal"
:chart="chart"
:showPanel="{}"
:from="fromRoute.panel"
:from="fromRoute.dashboard"
:panel-data="panelData"
@close="closeChartBox"
@on-create-success="createSuccess"
@@ -93,7 +90,6 @@
<script>
import chartRightBox from '@/components/common/rightBox/chart/chartRightBox'
import bus from '../../../../libs/bus'
import chart from '@/components/page/dashboard/overview/chart'
import { sameLabels, fromRoute } from '@/components/common/js/constants'
import metaData from '@/components/common/metaData'
import panelChart from '@/components/chart/panelChart'
@@ -102,7 +98,6 @@ import lineData from '@/components/chart/defaultLineData'
export default {
name: 'endpointQueryTab',
components: {
chart,
metaData,
panelChart,
chartRightBox
@@ -168,7 +163,13 @@ export default {
pageNo: 1,
total: 0
},
metaDataList: []
metaDataList: [],
letter: [
'A', 'B', 'C', 'D', 'E', 'F', 'G',
'H', 'I', 'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S', 'T',
'U', 'V', 'W', 'X', 'Y', 'Z'
]
}
},
methods: {
@@ -215,7 +216,7 @@ export default {
},
getPanelData () { // 获取panel数据
return new Promise((resolve, reject) => {
this.$get('visual/panel?pageNo=1&pageSize=-1').then(response => {
this.$get('visual/dashboard?pageNo=1&pageSize=-1').then(response => {
if (response.code === 200) {
this.panelData = response.data.list
resolve()
@@ -362,6 +363,9 @@ export default {
element.expression = endpoint.element
chartInfo.elements.push(element)
}
chartInfo.elements.forEach((item, index) => {
item.name = this.transformNumToLetter(index)
})
this.showFullscreen(true, chartInfo)
})
},
@@ -379,7 +383,7 @@ export default {
})
},
createSuccess (panel) {
this.$confirm(this.$t('dashboard.metric.goPanelTip'), this.$t('tip.saveSuccess'), {
this.$confirm(this.$t('dashboard.metric.goDashboardTip'), this.$t('tip.saveSuccess'), {
confirmButtonText: this.$t('tip.yes'),
cancelButtonText: this.$t('tip.no'),
type: 'success'
@@ -388,7 +392,7 @@ export default {
this.$store.state.showPanel.id = panel.id
this.$store.state.showPanel.name = panel.name
this.$router.push({
path: '/panel',
path: '/dashboard',
query: {
t: +new Date()
}
@@ -429,6 +433,16 @@ export default {
/* if (refresh) {
this.getData(this.filter)
} */
},
transformNumToLetter (num) { // 相当于26进制 获取idaddExpression
const self = this
let letter = ''
const loopNum = parseInt(num / 26)
if (loopNum > 0) {
letter += this.transformNumToLetter(loopNum - 1)
}
letter += self.letter[num % 26]
return letter
}
},
computed: {

View File

@@ -78,7 +78,7 @@
ref="addChartModal"
:chart="chart"
:showPanel="{}"
:from="fromRoute.panel"
:from="fromRoute.dashboard"
:panel-data="panelData"
@close="closeChartBox"
@on-create-success="createSuccess"
@@ -210,7 +210,7 @@ export default {
},
getPanelData () { // 获取panel数据
return new Promise((resolve, reject) => {
this.$get('visual/panel?pageNo=1&pageSize=-1').then(response => {
this.$get('visual/dashboard?pageNo=1&pageSize=-1').then(response => {
if (response.code === 200) {
this.panelData = response.data.list
resolve()
@@ -374,7 +374,7 @@ export default {
})
},
createSuccess (panel) {
this.$confirm(this.$t('dashboard.metric.goPanelTip'), this.$t('tip.saveSuccess'), {
this.$confirm(this.$t('dashboard.metric.goDashboardTip'), this.$t('tip.saveSuccess'), {
confirmButtonText: this.$t('tip.yes'),
cancelButtonText: this.$t('tip.no'),
type: 'success'
@@ -383,7 +383,7 @@ export default {
this.$store.state.showPanel.id = panel.id
this.$store.state.showPanel.name = panel.name
this.$router.push({
path: '/panel',
path: '/dashboard',
query: {
t: +new Date()
}