fix:修改 asset 导入导出 以及 chartTemp 预览的问题
This commit is contained in:
@@ -202,8 +202,8 @@ import chartAlertList from './chart-alert-list'
|
|||||||
import textChart from './text-chart'
|
import textChart from './text-chart'
|
||||||
import chartPie from './chart-pie'
|
import chartPie from './chart-pie'
|
||||||
import chartBarStatis from './chart-bar-statistics'
|
import chartBarStatis from './chart-bar-statistics'
|
||||||
import chartTempData from '@/components/charts/chartTempData'
|
|
||||||
import { fromRoute } from '@/components/common/js/constants'
|
import { fromRoute } from '@/components/common/js/constants'
|
||||||
|
import chartTempData from '@/components/charts/chartTempData'
|
||||||
// import visNetwork from './visNetwork'
|
// import visNetwork from './visNetwork'
|
||||||
export default {
|
export default {
|
||||||
name: 'chartList',
|
name: 'chartList',
|
||||||
@@ -678,7 +678,7 @@ export default {
|
|||||||
// return this.$get('/prom/api/v1/query_range?query=' + query + "&start=" + this.$stringTimeParseToUnix(endTime) + "&end=" + this.$stringTimeParseToUnix(endTime) + '&step=' + step);
|
// return this.$get('/prom/api/v1/query_range?query=' + query + "&start=" + this.$stringTimeParseToUnix(endTime) + "&end=" + this.$stringTimeParseToUnix(endTime) + '&step=' + step);
|
||||||
// }
|
// }
|
||||||
if (this.from === fromRoute.chartTemp) {
|
if (this.from === fromRoute.chartTemp) {
|
||||||
return chartTempData
|
return new Promise(resolve => resolve(chartTempData))
|
||||||
}
|
}
|
||||||
return this.$get('/prom/api/v1/query_range?query=' + query + '&start=' + this.$stringTimeParseToUnix(startTime) + '&end=' + this.$stringTimeParseToUnix(endTime) + '&step=' + step)
|
return this.$get('/prom/api/v1/query_range?query=' + query + '&start=' + this.$stringTimeParseToUnix(startTime) + '&end=' + this.$stringTimeParseToUnix(endTime) + '&step=' + step)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -662,6 +662,9 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (param.from == fromRoute.chartTemp) { // 模板列表
|
if (param.from == fromRoute.chartTemp) { // 模板列表
|
||||||
|
this.panelDataList[0].children.forEach((item1, i) => {
|
||||||
|
item1.chartIndex = i
|
||||||
|
})
|
||||||
this.dataList = this.panelDataList
|
this.dataList = this.panelDataList
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.dataList.forEach((item, index) => {
|
this.dataList.forEach((item, index) => {
|
||||||
|
|||||||
@@ -313,8 +313,12 @@ export default {
|
|||||||
padding-top: 15px;
|
padding-top: 15px;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
padding-bottom: 50px;
|
padding-bottom: 50px;
|
||||||
|
height: calc(100% - 50px);
|
||||||
|
}
|
||||||
|
.chart-temp{
|
||||||
|
height: calc(100% - 20px);
|
||||||
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.resize-modal {
|
.resize-modal {
|
||||||
width: calc(100% - 240px);
|
width: calc(100% - 240px);
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
></element-set>
|
></element-set>
|
||||||
</transition>
|
</transition>
|
||||||
<div class="sub-container">
|
<div class="sub-container">
|
||||||
<div :class="targetTab === 'panel' ? 'bottom-panel' : 'nz-table2'">
|
<div :class="[targetTab === 'panel' ? 'bottom-panel' : 'nz-table2',from === fromRoute.chartTemp ? 'chart-temp': '']">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
<div class="pagination-bottom" v-if="showPagination">
|
<div class="pagination-bottom" v-if="showPagination">
|
||||||
@@ -45,6 +45,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { fromRoute } from '@/components/common/js/constants'
|
||||||
export default {
|
export default {
|
||||||
name: 'nzBottomDataList',
|
name: 'nzBottomDataList',
|
||||||
props: {
|
props: {
|
||||||
@@ -92,6 +93,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
fromRoute: fromRoute,
|
||||||
tools: {
|
tools: {
|
||||||
toTopBtnTop: this.$tableHeight.toTopBtnTop, // to-top按钮的top属性
|
toTopBtnTop: this.$tableHeight.toTopBtnTop, // to-top按钮的top属性
|
||||||
tableHover: false, // 控制滚动条和top按钮同时出现
|
tableHover: false, // 控制滚动条和top按钮同时出现
|
||||||
|
|||||||
@@ -36,13 +36,15 @@
|
|||||||
</button>
|
</button>
|
||||||
<top-tool-more-options
|
<top-tool-more-options
|
||||||
id="asset-list"
|
id="asset-list"
|
||||||
:params="searchLabel"
|
:params="filter"
|
||||||
:permissions="{import: 'panel_chart_add', export: 'panel_view'}"
|
:permissions="{import: 'panel_chart_add', export: 'panel_view'}"
|
||||||
class="top-tool-export margin-r-10"
|
class="top-tool-export margin-r-10"
|
||||||
export-file-name="asset-charts"
|
export-file-name="asset-charts"
|
||||||
export-url="visual/panel/export"
|
export-url="visual/panel/export"
|
||||||
import-url="visual/panel/import"
|
import-url="visual/panel/import"
|
||||||
@afterImport="getTableData"
|
@afterImport="getTableData"
|
||||||
|
:showCur="false"
|
||||||
|
:link="obj"
|
||||||
:showLock="from === fromRoute.asset"
|
:showLock="from === fromRoute.asset"
|
||||||
@panelLockChange="panelLockChange"
|
@panelLockChange="panelLockChange"
|
||||||
>
|
>
|
||||||
@@ -279,6 +281,11 @@ export default {
|
|||||||
if (this.from == this.$CONSTANTS.fromRoute.chartTemp) {
|
if (this.from == this.$CONSTANTS.fromRoute.chartTemp) {
|
||||||
if (this.obj.type === 'group') {
|
if (this.obj.type === 'group') {
|
||||||
this.$get('/visual/panel/chart', { ids: this.obj.id, groupId: 0 }).then(res => {
|
this.$get('/visual/panel/chart', { ids: this.obj.id, groupId: 0 }).then(res => {
|
||||||
|
res.data.list.forEach(item => {
|
||||||
|
if (!item.children) {
|
||||||
|
item.children = []
|
||||||
|
}
|
||||||
|
})
|
||||||
this.panelDataList = res.data.list
|
this.panelDataList = res.data.list
|
||||||
if (this.panelDataList.length > 0) {
|
if (this.panelDataList.length > 0) {
|
||||||
this.showPanel.id = this.filter.panelId = 0
|
this.showPanel.id = this.filter.panelId = 0
|
||||||
@@ -454,6 +461,9 @@ export default {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (n && n.id) {
|
if (n && n.id) {
|
||||||
this.getTableData(n.id)
|
this.getTableData(n.id)
|
||||||
|
if ( this.from === fromRoute.asset) {
|
||||||
|
this.searchLabel.assetIds = n.id
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, 500)
|
}, 500)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user