perf: 过滤器在编辑页面触发两次请求

This commit is contained in:
fit2cloud-chenyw 2023-11-28 16:01:00 +08:00
parent 92c6c26d4c
commit 50b03eef6a
8 changed files with 26 additions and 14 deletions

View File

@ -509,7 +509,7 @@ export default {
this.$store.commit('setComponentWithId', this.currentFilterCom)
this.$store.commit('recordSnapshot', 'sureFilter')
this.$store.commit('setCurComponent', { component: this.currentFilterCom, index: this.curComponentIndex })
bus.$emit('reset-default-value', this.currentFilterCom.id)
bus.$emit('reset-default-value', this.currentFilterCom)
this.closeFilter()
},
reFreshComponent(component) {

View File

@ -418,8 +418,10 @@ export default {
this.$refs.dateRef.hidePicker()
}
},
resetDefaultValue(id) {
if (this.inDraw && this.manualModify && this.element.id === id) {
resetDefaultValue(ele) {
const id = ele.id
const eleVal = ele.options.value.toString()
if (this.inDraw && this.manualModify && this.element.id === id && this.values.toString() !== eleVal && this.defaultValueStr === eleVal) {
if (!this.element.options.attrs.default.isDynamic) {
this.values = this.fillValueDerfault()
this.dateChange(this.values)

View File

@ -99,8 +99,10 @@ export default {
clearHandler() {
this.value = null
},
resetDefaultValue(id) {
if (this.inDraw && this.manualModify && this.element.id === id) {
resetDefaultValue(ele) {
const id = ele.id
const eleVal = ele.options.value.toString()
if (this.inDraw && this.manualModify && this.element.id === id && this.value.toString() !== eleVal && this.defaultValueStr === eleVal) {
this.value = this.fillValueDerfault()
this.search()
}

View File

@ -160,8 +160,10 @@ export default {
this.form.min = null
this.form.max = null
},
resetDefaultValue(id) {
if (this.inDraw && this.manualModify && this.element.id === id) {
resetDefaultValue(ele) {
const id = ele.id
const eleVal = ele.options.value.toString()
if (this.inDraw && this.manualModify && this.element.id === id && this.defaultValueStr === eleVal) {
if (!this.element.options.value) {
this.form.min = null
this.form.max = null

View File

@ -345,8 +345,10 @@ export default {
this.$refs.deSelect.$refs.visualSelect.blur()
}
},
resetDefaultValue(id) {
if (this.inDraw && this.manualModify && this.element.id === id) {
resetDefaultValue(ele) {
const id = ele.id
const eleVal = ele.options.value.toString()
if (this.inDraw && this.manualModify && this.element.id === id && this.value.toString() !== eleVal && this.defaultValueStr === eleVal) {
if (this.selectFirst) {
this.fillFirstValue()
this.firstChange(this.value)

View File

@ -282,8 +282,10 @@ export default {
this.checkAll = false
this.isIndeterminate = false
},
resetDefaultValue(id) {
if (this.inDraw && this.manualModify && this.element.id === id) {
resetDefaultValue(ele) {
const id = ele.id
const eleVal = ele.options.value.toString()
if (this.inDraw && this.manualModify && this.element.id === id && this.value.toString() !== eleVal && this.defaultValueStr === eleVal) {
this.value = this.fillValueDerfault()
this.changeValue(this.value)

View File

@ -234,8 +234,10 @@ export default {
this.value = this.element.options.attrs.multiple ? [] : null
this.$refs.deSelectTree && this.$refs.deSelectTree.resetSelectAll && this.$refs.deSelectTree.resetSelectAll()
},
resetDefaultValue(id) {
if (this.inDraw && this.manualModify && this.element.id === id) {
resetDefaultValue(ele) {
const id = ele.id
const eleVal = ele.options.value.toString()
if (this.inDraw && this.manualModify && this.element.id === id && this.value.toString() !== eleVal && this.defaultValueStr === eleVal) {
this.value = this.fillValueDerfault()
this.changeValue(this.value)
}

View File

@ -1269,7 +1269,7 @@ export default {
this.$store.commit('recordSnapshot', 'sureFilter')
this.$store.commit('setCurComponent', { component: this.currentFilterCom, index: this.curComponentIndex })
this.$store.commit('setComponentFromList', this.currentFilterCom)
bus.$emit('reset-default-value', this.currentFilterCom.id)
bus.$emit('reset-default-value', this.currentFilterCom)
this.closeFilter()
},
reFreshComponent(component) {