fix:修复notebook高度保存失效

This commit is contained in:
zyh
2023-09-21 17:48:09 +08:00
parent 99ee2224a4
commit 57b1a0cfad
3 changed files with 10 additions and 7 deletions

View File

@@ -44,12 +44,12 @@ export default {
},
methods: {
save () {
this.chartInfo.param.oldText = this.chartInfo.param.text
this.chartInfo.param.isEdit = false
this.chartInfo.param.oldText = this.chartInfo.param.text
},
cancel () {
this.chartInfo.param.text = this.chartInfo.param.oldText
this.chartInfo.param.isEdit = false
this.chartInfo.param.text = this.chartInfo.param.oldText
},
textChange (val) {
this.chartInfo.param.text = val

View File

@@ -93,7 +93,6 @@
</template>
<script>
import Vue from 'vue'
import axios from 'axios'
import bus from '../../../../libs/bus'
import subDataListMixin from '@/components/common/mixin/subDataList'
@@ -171,12 +170,17 @@ export default {
done () {
this.$refs.notebookList.copyDataList.forEach(item => {
if (item.type === 'text') {
Vue.delete(item.param, 'isEdit')
Vue.delete(item.param, 'oldText')
this.$set(item.param, 'isEdit', false)
}
})
let charts = this.$lodash.cloneDeep(this.$refs.notebookList.copyDataList)
charts = charts.filter(item => item.name !== 'groupTemp')
charts.forEach(item => {
if (item.type === 'text') {
delete item.param.isEdit
delete item.param.oldText
}
})
const params = {
name: this.notebookName,
charts
@@ -666,7 +670,6 @@ export default {
immediate: false,
deep: true,
handler (n) {
console.log(n)
if (n) {
this.disposeChart()
} else {

View File

@@ -175,7 +175,7 @@ export default {
this.firstInit = true
const cloneDataList = this.$lodash.cloneDeep(n)
const tempList = cloneDataList.map((item, index) => {
const height = item.height || ''
const height = item.h || item.height
return {
...item,
i: item.id,