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: { methods: {
save () { save () {
this.chartInfo.param.oldText = this.chartInfo.param.text
this.chartInfo.param.isEdit = false this.chartInfo.param.isEdit = false
this.chartInfo.param.oldText = this.chartInfo.param.text
}, },
cancel () { cancel () {
this.chartInfo.param.text = this.chartInfo.param.oldText
this.chartInfo.param.isEdit = false this.chartInfo.param.isEdit = false
this.chartInfo.param.text = this.chartInfo.param.oldText
}, },
textChange (val) { textChange (val) {
this.chartInfo.param.text = val this.chartInfo.param.text = val

View File

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

View File

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