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