forked from github/dataease
fix(定时报告): 表单中视图数据无法回显
This commit is contained in:
parent
90c83419cf
commit
67e08c27b5
@ -112,28 +112,11 @@ export default {
|
|||||||
value(val, old) {
|
value(val, old) {
|
||||||
this.innerValues = val
|
this.innerValues = val
|
||||||
},
|
},
|
||||||
innerValues(val, old) {
|
|
||||||
if (val !== old) {
|
|
||||||
this.$emit('input', val)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
panelId(val, old) {
|
panelId(val, old) {
|
||||||
if (val !== old) {
|
if (val !== old) {
|
||||||
this.innerValues = []
|
this.innerValues = []
|
||||||
this.loadView()
|
this.loadView()
|
||||||
}
|
}
|
||||||
},
|
|
||||||
selectedViews: {
|
|
||||||
handler(val) {
|
|
||||||
if (!val || !JSON.stringify(val)) {
|
|
||||||
this.innerValues = []
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const viewIds = JSON.parse(JSON.stringify(val))
|
|
||||||
|
|
||||||
this.innerValues = JSON.parse(JSON.stringify(viewIds))
|
|
||||||
},
|
|
||||||
deep: true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -147,7 +130,6 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadView() {
|
loadView() {
|
||||||
this._selectClearFun()
|
|
||||||
this.innerValues = this.value
|
this.innerValues = this.value
|
||||||
this.viewLoaded = false
|
this.viewLoaded = false
|
||||||
this.panelId && findOne(this.panelId).then(response => {
|
this.panelId && findOne(this.panelId).then(response => {
|
||||||
@ -198,10 +180,15 @@ export default {
|
|||||||
this.$store.dispatch('task/delView', { 'panelId': this.panelId, 'viewId': item })
|
this.$store.dispatch('task/delView', { 'panelId': this.panelId, 'viewId': item })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
const viewIds = JSON.parse(JSON.stringify(this.$store.getters.panelViews[this.panelId]))
|
||||||
|
this.$emit('input', viewIds)
|
||||||
},
|
},
|
||||||
_selectClearFun() {
|
_selectClearFun() {
|
||||||
this.$store.dispatch('task/delPanelViews', this.panelId)
|
this.$store.dispatch('task/delPanelViews', this.panelId)
|
||||||
|
const viewIds = JSON.parse(JSON.stringify(this.$store.getters.panelViews[this.panelId]))
|
||||||
|
this.$emit('input', viewIds)
|
||||||
},
|
},
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
if (this.value && this.value.length) {
|
if (this.value && this.value.length) {
|
||||||
const viewIds = JSON.parse(JSON.stringify(this.value))
|
const viewIds = JSON.parse(JSON.stringify(this.value))
|
||||||
@ -219,6 +206,7 @@ export default {
|
|||||||
},
|
},
|
||||||
sureDialog() {
|
sureDialog() {
|
||||||
this.innerValues = JSON.parse(JSON.stringify(this.$store.getters.panelViews[this.panelId]))
|
this.innerValues = JSON.parse(JSON.stringify(this.$store.getters.panelViews[this.panelId]))
|
||||||
|
this.$emit('input', this.innerValues)
|
||||||
this.closeDialog()
|
this.closeDialog()
|
||||||
},
|
},
|
||||||
cancelDialog() {
|
cancelDialog() {
|
||||||
|
Loading…
Reference in New Issue
Block a user