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

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

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