提交 8464e7a7 authored 作者: junjie's avatar junjie

feat(视图): 视图编辑传参调整

上级 208878c0
......@@ -498,9 +498,6 @@ export default {
sceneClick(data, node) {
this.$store.dispatch('chart/setViewId', null)
this.$store.dispatch('chart/setViewId', data.id)
this.$store.dispatch('chart/setTableId', null)
this.$store.dispatch('chart/setTableId', data.tableId)
// this.$router.push('/chart/chart-edit')
this.$emit('switchComponent', { name: 'ChartEdit' })
},
......
<template>
<!--TODO 慢慢完善,写个DEMO-->
<el-row style="height: 100%;overflow-y: hidden;width: 100%;">
<span v-show="false">{{ tableId }}</span>
<span v-show="false">{{ sceneId }}</span>
<span v-show="false">{{ vId }}</span>
<el-row style="height: 40px;background-color: white" class="padding-lr">
<span style="line-height: 40px;">{{ view.name }}</span>
......@@ -284,15 +281,6 @@ export default {
}
},
computed: {
tableId() {
// console.log(this.$store.state.chart.tableId);
this.initTableData(this.$store.state.chart.tableId)
return this.$store.state.chart.tableId
},
sceneId() {
// console.log(this.$store.state.chart.sceneId);
return this.$store.state.chart.sceneId
},
vId() {
// console.log(this.$store.state.chart.viewId);
this.getData(this.$store.state.chart.viewId)
......@@ -330,9 +318,9 @@ export default {
save() {
const view = JSON.parse(JSON.stringify(this.view))
view.id = this.view.id
view.sceneId = this.sceneId
view.sceneId = this.view.sceneId
view.name = this.table.name
view.tableId = this.$store.state.chart.tableId
view.tableId = this.view.tableId
// view.xaxis.forEach(function(ele) {
// if (!ele.summary || ele.summary === '') {
// ele.summary = 'sum'
......@@ -372,6 +360,7 @@ export default {
getData(id) {
if (id) {
post('/chart/view/getData/' + id, null).then(response => {
this.initTableData(response.data.tableId)
this.view = JSON.parse(JSON.stringify(response.data))
this.view.xaxis = this.view.xaxis ? JSON.parse(this.view.xaxis) : []
this.view.yaxis = this.view.yaxis ? JSON.parse(this.view.yaxis) : []
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论