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 = '' let url = ''
this.terminal.height = document.body.clientHeight - 100 this.terminal.height = document.body.clientHeight - 100
this.terminal.width = document.body.clientWidth this.terminal.width = document.body.clientWidth
console.log(this.term.cols, this.term.cols)
if (this.terminal.type === 'asset') { 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 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') { } else if (this.terminal.type === 'custom') {

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="pop-custom" :class="{'pop-custom-top' : tableClass || operationTrue}" v-clickoutside="esc"> <div class="pop-custom" :class="{'pop-custom-top' : tableClass || operationTrue}" v-clickoutside="esc">
<div class="pop-title">{{$t('overall.selectColumns')}}</div> <div class="pop-title" @click.stop>{{$t('overall.selectColumns')}}</div>
<div class="pop-box custom-labels"> <div class="pop-box custom-labels" @click.stop>
<div style="height: 100%; overflow: auto;"> <div style="height: 100%; overflow: auto;">
<!--NotSet 为true不可设置--> <!--NotSet 为true不可设置-->
<div <div
@@ -19,7 +19,7 @@
</div> </div>
</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)"> <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> <span class="top-tool-btn-txt">{{$t('overall.clear')}}</span>
</button> </button>

View File

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

View File

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

View File

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

View File

@@ -102,7 +102,7 @@
@mouseleave="labelHover1(scope.row, item.prop, false, $event, true)"> @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' : ''}}] [{{scope.row.configs[0].enable ? 'Metrics':''}}{{scope.row.configs[0].enable&&scope.row.configs[1].enable?',':''}}{{scope.row.configs[1].enable ? 'logs' : ''}}]
</span> </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"> <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> <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> <pre class="copy-value-content__pre">{{JSON.stringify(clConfigs(scope.row),null,2)}}</pre>
@@ -344,7 +344,7 @@ export default {
if (slow) { if (slow) {
item[type].timeout = setTimeout(() => { item[type].timeout = setTimeout(() => {
this.$set(item[type], 'loading', loading) this.$set(item[type], 'loading', loading)
}, 200) }, 500)
} else { } else {
if (item[type].timeout) { if (item[type].timeout) {
clearTimeout(item[type].timeout) clearTimeout(item[type].timeout)
@@ -354,6 +354,13 @@ export default {
} }
// this.$set(this.tableData,index,item);// 调用父组件 // 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) { labelHoverConfigs (item, type, loading, e, slow) {
if (e) { if (e) {
const dom = e.currentTarget const dom = e.currentTarget
@@ -426,8 +433,11 @@ export default {
right: 8px; right: 8px;
top: 4px; top: 4px;
} }
.alert-label__border.alert-label{
width: auto !important;
}
.copy-value-content__pre { .copy-value-content__pre {
width: 500px; width: auto;
height: 200px; height: 200px;
margin-top: 20px; margin-top: 20px;
overflow-y: scroll; overflow-y: scroll;

View File

@@ -1,5 +1,5 @@
<template> <template>
<div class="explore list-page"> <div class="explore list-page" :class="'nz-explore-' + tabIndex">
<div class="main-list"> <div class="main-list">
<div class="main-container explore-split-box"> <div class="main-container explore-split-box">
<!-- 关闭按钮 --> <!-- 关闭按钮 -->
@@ -132,7 +132,7 @@
<!-- 自定义table列 --> <!-- 自定义table列 -->
<transition name="el-zoom-in-top"> <transition name="el-zoom-in-top">
<element-set <element-set
@click.stop @click.stop="()=>{}"
v-if="tools.showCustomTableTitle" v-if="tools.showCustomTableTitle"
:tableId="tableId" :tableId="tableId"
ref="customTableTitle" ref="customTableTitle"
@@ -3559,7 +3559,8 @@ export default {
}, },
methods: { methods: {
jumpClick (id) { 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) { selectMetricsLogs (val, icon, label) {
if (val) { if (val) {
@@ -4242,6 +4243,10 @@ export default {
return letter return letter
}, },
exportToHtml (name) { exportToHtml (name) {
if (this.showIntroduce) {
this.$message.error(this.$t('explore.queryExpression'))
return
}
const params = { const params = {
type: this.showMetrics ? 1 : 2, type: this.showMetrics ? 1 : 2,
start: this.momentStrToTimestamp(this.filterTime[0]) / 1000, start: this.momentStrToTimestamp(this.filterTime[0]) / 1000,
@@ -4327,6 +4332,7 @@ export default {
}) })
if (!temp) { if (!temp) {
this.showIntroduce = true 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;"> <div style="display: flex;justify-content: space-between;align-items: center;margin-bottom: 10px;">
<span>{{dataJson.type == 1 ? 'Metric expression' : 'Log expression'}}</span> <span>{{dataJson.type == 1 ? 'Metric expression' : 'Log expression'}}</span>
<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> </span>
</div> </div>
<div v-for="(item, index) in dataJson.data" :key = 'index' style="display: flex;margin-bottom: 10px"> <div v-for="(item, index) in dataJson.data" :key = 'index' style="display: flex;margin-bottom: 10px">
@@ -22,7 +22,7 @@
<template v-if="showMetrics"> <template v-if="showMetrics">
<el-collapse-item name="1" :title="$t('explore.graph')" class="el-collapse-item__height"> <el-collapse-item name="1" :title="$t('explore.graph')" class="el-collapse-item__height">
<div class="chart-room"> <div class="chart-room">
<chart ref="exploreChart" :unit="chartUnit" :timeRange="filterTime"></chart> <chart ref="exploreChart" :unit="chartUnitType" :timeRange="filterTime"></chart>
</div> </div>
</el-collapse-item> </el-collapse-item>
<el-collapse-item class="el-collapse-item__height" name="2" title="Table"> <el-collapse-item class="el-collapse-item__height" name="2" title="Table">
@@ -94,7 +94,7 @@
<template v-else> <template v-else>
<el-collapse-item v-if="showTab.indexOf('1') > -1" name="1" :title="$t('explore.graph')" class="el-collapse-item__height"> <el-collapse-item v-if="showTab.indexOf('1') > -1" name="1" :title="$t('explore.graph')" class="el-collapse-item__height">
<div class="chart-room"> <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> </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">
@@ -136,7 +136,7 @@ export default {
pageSize: 20, pageSize: 20,
total: 0 total: 0
}, },
chartUnit: 1, chartUnitType: 1,
filterTime: [], filterTime: [],
tools: { tools: {
loading: false, // 是否显示table加载动画 loading: false, // 是否显示table加载动画
@@ -162,7 +162,8 @@ export default {
} else { } else {
this.showMetrics = false 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() this.expressionChange()
}, },
methods: { methods: {
@@ -229,7 +230,7 @@ export default {
values: ['', val] 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))) this.$set(metrics, 'time', bus.timeFormate(bus.computeTimezone(result.values[0][0] * 1000)))
for (const key in metrics) { for (const key in metrics) {
@@ -557,7 +558,7 @@ export default {
} }
}, },
watch: { watch: {
chartUnit: { chartUnitType: {
handler (n, o) { handler (n, o) {
this.expressionChange() this.expressionChange()
} }

View File

@@ -7,7 +7,7 @@
<div class="chart-body" ref="chartBody" :id="chartId" ></div> <div class="chart-body" ref="chartBody" :id="chartId" ></div>
<div class="chart-no-data" v-show="noData">No Data</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"> <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}} <span class="legend-shape" :style="{background:(item.isGray?'#D3D3D3':getBgColor(index))}"></span>{{item.alias?item.alias:item.name}}
</div> </div>
@@ -222,7 +222,7 @@ export default {
height = 700 height = 700
width = 1200 width = 1200
} else { } else {
const legendHeight = document.querySelector('#legendArea').offsetHeight || 30 const legendHeight = document.querySelector('#legendArea' + this.chartId).offsetHeight || 30
height = this.$el.clientHeight - legendHeight height = this.$el.clientHeight - legendHeight
width = this.$el.clientWidth width = this.$el.clientWidth
} }

View File

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

View File

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