fix:解决冲突

This commit is contained in:
zyh
2023-03-15 15:41:15 +08:00
13 changed files with 47 additions and 30 deletions

View File

@@ -122,7 +122,6 @@ export default {
let url = ''
this.terminal.height = document.body.clientHeight - 100
this.terminal.width = document.body.clientWidth
console.log(this.term.cols, this.term.cols)
if (this.terminal.type === 'asset') {
url = baseUrl + '/terminal.ws?width=' + this.terminal.width + '&height=' + this.terminal.height + '&cols=' + this.term.cols + '&rows=' + this.term.rows + '&token=' + token + '&assetId=' + this.terminal.assetId + '&accountId=' + this.terminal.accountId + '&uuid=' + this.terminal.uuid
} else if (this.terminal.type === 'custom') {

View File

@@ -585,7 +585,6 @@ export default {
return '-'
},
resetState (type) {
console.log(type)
if (type == 'sizeOrderType') {
this.dateOrderType = 0
this.nameOrderType = 0

View File

@@ -660,6 +660,7 @@ export default {
initPens (data) {
// 获取对应的值 给节点 连线添加对应动画
this.lineName = data.lineName ? data.lineName : this.lineName
getTopology(this.topologyIndex).setOptions({ drawingLineName: this.lineName })
this.chartGetData = []
const axiosArr = []
const promiseArr = []
@@ -1635,9 +1636,8 @@ export default {
// this.topologyData.data[key]=this.colorRGBtoHex(val);
// getTopology(this.index).data[key]=val;
// getTopology(this.index).render();
const dataOption = getTopology(this.topologyIndex).data()
dataOption[key] = this.lineName
getTopology(this.topologyIndex).render()
getTopology(this.topologyIndex).store.data.lineName = val
getTopology(this.topologyIndex).setOptions({ drawingLineName: val })
},
notModuleIDArrChange (id) {
this.notModuleIDArr = this.notModuleIDArr.filter(item => item.id !== id)

View File

@@ -1,7 +1,7 @@
<template>
<div class="pop-custom" :class="{'pop-custom-top' : tableClass || operationTrue}" v-clickoutside="esc">
<div class="pop-title">{{$t('overall.selectColumns')}}</div>
<div class="pop-box custom-labels">
<div class="pop-title" @click.stop>{{$t('overall.selectColumns')}}</div>
<div class="pop-box custom-labels" @click.stop>
<div style="height: 100%; overflow: auto;">
<!--NotSet 为true不可设置-->
<div
@@ -19,7 +19,7 @@
</div>
</div>
<div class="custom-bottom-btns">
<div class="custom-bottom-btns" @click.stop>
<button v-if="isCancel" :id="tableId+'-element-set-none'" class="nz-btn nz-btn-size-small nz-btn-style-light is-cancel" type="button" @click.stop="batchHandler(false)">
<span class="top-tool-btn-txt">{{$t('overall.clear')}}</span>
</button>

View File

@@ -676,6 +676,7 @@ export default {
initPens (data) {
// 获取对应的值 给节点 连线添加对应动画
this.lineName = data.lineName ? data.lineName : this.lineName
getTopology(this.topologyIndex).setOptions({ drawingLineName: this.lineName })
this.chartGetData = []
const axiosArr = []
const promiseArr = []
@@ -2058,6 +2059,7 @@ export default {
// this.topologyData.data[key]=this.colorRGBtoHex(val);
// getTopology(this.index).data[key]=val;
// getTopology(this.index).render();
getTopology(this.topologyIndex).store.data.lineName = val
getTopology(this.topologyIndex).setOptions({ drawingLineName: val })
},
notModuleIDArrChange (id) {

View File

@@ -171,7 +171,7 @@ export default {
},
topoScale (num) {
this.moduleId = ''
getTopology(this.topologyIndex).centerView()
// getTopology(this.topologyIndex).centerView()
this.showNodeTools('')
this.popDataShowUpdate('', false)
if (!this.editTopologyFlag) {

View File

@@ -373,7 +373,6 @@ export default {
}
},
changeSearchStr () {
console.log(this.searchStr, 'changeSearchStr')
const arr = this.searchStr.split(':')
if (arr.length > 1) {
this.setValueList(arr[1])
@@ -475,21 +474,17 @@ export default {
const findItem = this.selectArr.find(item => item.key === this.editTagObj.key)
if (findItem) {
this.selectArr.splice(this.editTagIndex, 1)
console.log(findItem, this.editDialogObj.value)
findItem.value = findItem.value.concat(this.editDialogObj.value)
findItem.value = findItem.value.filter(function (item, index) {
return findItem.value.indexOf(item) === index // 因为indexOf 只能查找到第一个
})
console.log(findItem.value)
} else {
this.selectArr[this.editTagIndex] = this.$loadsh.cloneDeep(this.editTagObj)
}
},
querySearch (queryString, cb) {
const restaurants = this.oldSearchList.map(item => { return { value: item.name } })
console.log(restaurants)
const results = queryString ? restaurants.filter(name => name.value.indexOf(queryString) !== -1) : restaurants
console.log(results)
cb(results)
},
handleSelect () {

View File

@@ -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>
@@ -344,7 +344,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)
@@ -354,6 +354,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
@@ -426,8 +433,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

@@ -1,5 +1,5 @@
<template>
<div class="explore list-page">
<div class="explore list-page" :class="'nz-explore-' + tabIndex">
<div class="main-list">
<div class="main-container explore-split-box">
<!-- 关闭按钮 -->
@@ -132,7 +132,7 @@
<!-- 自定义table列 -->
<transition name="el-zoom-in-top">
<element-set
@click.stop
@click.stop="()=>{}"
v-if="tools.showCustomTableTitle"
:tableId="tableId"
ref="customTableTitle"
@@ -3559,7 +3559,8 @@ export default {
},
methods: {
jumpClick (id) {
document.querySelector(id).scrollIntoView(true)
const dom = document.getElementsByClassName('nz-explore-' + this.tabIndex)[0]
dom.querySelector(id).scrollIntoView(true)
},
selectMetricsLogs (val, icon, label) {
if (val) {
@@ -4242,6 +4243,10 @@ export default {
return letter
},
exportToHtml (name) {
if (this.showIntroduce) {
this.$message.error(this.$t('explore.queryExpression'))
return
}
const params = {
type: this.showMetrics ? 1 : 2,
start: this.momentStrToTimestamp(this.filterTime[0]) / 1000,
@@ -4327,6 +4332,7 @@ export default {
})
if (!temp) {
this.showIntroduce = true
this.saveDisabled = true
}
}
}

View File

@@ -3,7 +3,7 @@
<div style="display: flex;justify-content: space-between;align-items: center;margin-bottom: 10px;">
<span>{{dataJson.type == 1 ? 'Metric expression' : 'Log expression'}}</span>
<span>
<chart-unit v-model="chartUnit" class="margin-r-10"></chart-unit>
<chart-unit v-if="showMetrics" v-model="chartUnitType" ref="chartUnit" class="margin-r-10"></chart-unit>
</span>
</div>
<div v-for="(item, index) in dataJson.data" :key = 'index' style="display: flex;margin-bottom: 10px">
@@ -22,7 +22,7 @@
<template v-if="showMetrics">
<el-collapse-item name="1" :title="$t('explore.graph')" class="el-collapse-item__height">
<div class="chart-room">
<chart ref="exploreChart" :unit="chartUnit" :timeRange="filterTime"></chart>
<chart ref="exploreChart" :unit="chartUnitType" :timeRange="filterTime"></chart>
</div>
</el-collapse-item>
<el-collapse-item class="el-collapse-item__height" name="2" title="Table">
@@ -94,7 +94,7 @@
<template v-else>
<el-collapse-item v-if="showTab.indexOf('1') > -1" name="1" :title="$t('explore.graph')" class="el-collapse-item__height">
<div class="chart-room">
<chart ref="logChart" :unit="chartUnit" v-my-loading="chartLoading" :timeRange="filterTime"></chart>
<chart ref="logChart" :unit="chartUnitType" v-my-loading="chartLoading" :timeRange="filterTime"></chart>
</div>
</el-collapse-item>
<el-collapse-item v-if="showTab.indexOf('2') > -1" name="2" title="Logs">
@@ -136,7 +136,7 @@ export default {
pageSize: 20,
total: 0
},
chartUnit: 1,
chartUnitType: 1,
filterTime: [],
tools: {
loading: false, // 是否显示table加载动画
@@ -162,7 +162,8 @@ export default {
} else {
this.showMetrics = false
}
this.chartUnit = this.dataJson.unit || 1
this.chartUnitType = this.dataJson.unit || 1
this.$refs.chartUnit.unit = this.dataJson.unit || 1
this.expressionChange()
},
methods: {
@@ -229,7 +230,7 @@ export default {
values: ['', val]
}
}
this.$set(metrics, 'value#' + index, chartDataFormat.getUnit(this.chartUnit || 2).compute(result.values[0][1], null, 2))
this.$set(metrics, 'value#' + index, chartDataFormat.getUnit(this.chartUnitType || 2).compute(result.values[0][1], null, 2))
this.$set(metrics, 'time', bus.timeFormate(bus.computeTimezone(result.values[0][0] * 1000)))
for (const key in metrics) {
@@ -557,7 +558,7 @@ export default {
}
},
watch: {
chartUnit: {
chartUnitType: {
handler (n, o) {
this.expressionChange()
}

View File

@@ -7,7 +7,7 @@
<div class="chart-body" ref="chartBody" :id="chartId" ></div>
<div class="chart-no-data" v-show="noData">No Data</div>
<div class="legend-container legend-container-screen" id="legendArea" ref="legendArea" v-show="legend.length>0">
<div class="legend-container legend-container-screen" :id="'legendArea' + chartId" ref="legendArea" v-show="legend.length>0">
<div v-for="(item, index) in legend" :title="item.alias?item.alias:item.name" @click="clickLegend(item.name,index)" class="legend-item" :class="{'ft-gr':item.isGray}" :key="'legend_' + item.name+'_'+index">
<span class="legend-shape" :style="{background:(item.isGray?'#D3D3D3':getBgColor(index))}"></span>{{item.alias?item.alias:item.name}}
</div>
@@ -222,7 +222,7 @@ export default {
height = 700
width = 1200
} else {
const legendHeight = document.querySelector('#legendArea').offsetHeight || 30
const legendHeight = document.querySelector('#legendArea' + this.chartId).offsetHeight || 30
height = this.$el.clientHeight - legendHeight
width = this.$el.clientWidth
}

View File

@@ -49,6 +49,12 @@
#entranceHtml .el-icon-check::before{
content: '\e689';
}
#entranceHtml .el-table__expand-icon {
height: 48px;
}
#entranceHtml .el-table__expand-icon .el-icon-arrow-right{
margin-top: -12px;
}
</style>
</head>

View File

@@ -34,7 +34,6 @@ const terminalFile = {
state.externalTerminal = false
}
if (data.isLogout) {
console.log(state, self)
get('logout').then(() => {
self.commit('logoutSuccess')
document.location.href = '/'