forked from github/dataease
Merge pull request #4119 from dataease/pr@dev@feat_filter-options
feat(仪表板): 仪表板刷新时,过滤组件的备选项同时更新
This commit is contained in:
commit
f6b5be96c4
@ -44,6 +44,7 @@
|
||||
:in-screen="inScreen"
|
||||
:edit-mode="'preview'"
|
||||
:h="config.style.height"
|
||||
:search-count="searchCount"
|
||||
:canvas-id="canvasId"
|
||||
/>
|
||||
<component
|
||||
|
@ -96,10 +96,16 @@ export default {
|
||||
isRelation: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
searchCount: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
needRefreshComponents: ['de-select', 'de-select-grid', 'de-select-tree'],
|
||||
inputMaxSize: 46,
|
||||
inputLargeSize: 42,
|
||||
inputSmallSize: 38,
|
||||
@ -138,6 +144,7 @@ export default {
|
||||
return ['de-select', 'de-select-grid', 'de-date', 'de-input-search', 'de-number-range', 'de-select-tree'].includes(this.element.component)
|
||||
},
|
||||
...mapState([
|
||||
'curComponent',
|
||||
'previewCanvasScale'
|
||||
])
|
||||
},
|
||||
@ -148,6 +155,13 @@ export default {
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
},
|
||||
// 监听外部计时器变化
|
||||
searchCount: function(val1) {
|
||||
// 正在操作的组件不进行刷新
|
||||
if (val1 > 0 && this.needRefreshComponents.includes(this.element.component) && (!this.curComponent || this.curComponent.id !== this.element.id)) {
|
||||
this.$refs['deOutWidget'].refreshLoad()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -47,6 +47,7 @@ import { isSameVueObj, mergeCustomSortOption } from '@/utils'
|
||||
import { getLinkToken, getToken } from '@/utils/auth'
|
||||
import customInput from '@/components/widget/deWidget/customInput'
|
||||
import { textSelectWidget } from '@/components/widget/deWidget/serviceNameFn.js'
|
||||
|
||||
export default {
|
||||
components: { ElVisualSelect },
|
||||
mixins: [customInput],
|
||||
@ -255,6 +256,16 @@ export default {
|
||||
},
|
||||
initLoad() {
|
||||
this.value = this.fillValueDerfault()
|
||||
this.initOptions()
|
||||
if (this.element.options.value) {
|
||||
this.value = this.fillValueDerfault()
|
||||
this.changeValue(this.value)
|
||||
}
|
||||
},
|
||||
refreshLoad() {
|
||||
this.initOptions()
|
||||
},
|
||||
initOptions() {
|
||||
this.data = []
|
||||
if (this.element.options.attrs.fieldId) {
|
||||
let method = multFieldValues
|
||||
@ -273,10 +284,6 @@ export default {
|
||||
bus.$emit('valid-values-change', false)
|
||||
})
|
||||
}
|
||||
if (this.element.options.value) {
|
||||
this.value = this.fillValueDerfault()
|
||||
this.changeValue(this.value)
|
||||
}
|
||||
},
|
||||
visualChange(value) {
|
||||
this.value = value
|
||||
|
@ -286,6 +286,16 @@ export default {
|
||||
textSelectGridWidget: textSelectGridWidget,
|
||||
initLoad() {
|
||||
this.value = this.element.options.attrs.multiple ? [] : null
|
||||
this.initOptions()
|
||||
if (this.element.options.value) {
|
||||
this.value = this.fillValueDerfault()
|
||||
this.changeValue(this.value)
|
||||
}
|
||||
},
|
||||
refreshLoad() {
|
||||
this.initOptions()
|
||||
},
|
||||
initOptions() {
|
||||
if (this.element.options.attrs.fieldId) {
|
||||
let method = multFieldValues
|
||||
const token = this.$store.getters.token || getToken()
|
||||
@ -305,10 +315,6 @@ export default {
|
||||
}
|
||||
})
|
||||
}
|
||||
if (this.element.options.value) {
|
||||
this.value = this.fillValueDerfault()
|
||||
this.changeValue(this.value)
|
||||
}
|
||||
},
|
||||
changeValue(value) {
|
||||
if (!this.inDraw) {
|
||||
|
@ -265,6 +265,17 @@ export default {
|
||||
},
|
||||
initLoad() {
|
||||
this.value = this.fillValueDerfault()
|
||||
this.data = []
|
||||
this.initOptions()
|
||||
if (this.element.options.value) {
|
||||
this.value = this.fillValueDerfault()
|
||||
this.changeValue(this.value)
|
||||
}
|
||||
},
|
||||
refreshLoad() {
|
||||
this.initOptions()
|
||||
},
|
||||
initOptions() {
|
||||
this.data = []
|
||||
if (this.element.options.attrs.fieldId) {
|
||||
let method = mappingFieldValues
|
||||
@ -283,10 +294,6 @@ export default {
|
||||
})
|
||||
})
|
||||
}
|
||||
if (this.element.options.value) {
|
||||
this.value = this.fillValueDerfault()
|
||||
this.changeValue(this.value)
|
||||
}
|
||||
},
|
||||
changeValue(value) {
|
||||
if (!this.inDraw) {
|
||||
|
Loading…
Reference in New Issue
Block a user