diff --git a/src/resources/plugins/TsForm/TsFormCheckbox.vue b/src/resources/plugins/TsForm/TsFormCheckbox.vue index 674f592e3148232033b4bd22b1c68bb43a0197ca..f74a3d0832ba9c57bfa49bfe24673f1f3350ae61 100755 --- a/src/resources/plugins/TsForm/TsFormCheckbox.vue +++ b/src/resources/plugins/TsForm/TsFormCheckbox.vue @@ -170,16 +170,18 @@ export default { }, handleEchoFailedDefaultValue() { // 处理回显失败默认值,回显失败清空默认值 - let selectedList = []; - let valueList = this.currentValue instanceof Array ? this.currentValue : [this.currentValue]; - valueList.forEach((item, index) => { - if (item && !this.nodeList.find((n) => n[this.valueName] == item)) { - selectedList.push(item[this.valueName]); - this.currentValue.splice(index, 1); + if (this.isClearEchoFailedDefaultValue && !this.$utils.isEmpty(this.nodeList)) { + let selectedList = []; + let valueList = this.currentValue instanceof Array ? this.currentValue : [this.currentValue]; + valueList.forEach((item, index) => { + if (item && !this.nodeList.find((n) => n[this.valueName] == item)) { + selectedList.push(item[this.valueName]); + this.currentValue.splice(index, 1); + } + }); + if (!this.$utils.isEmpty(selectedList)) { + this.onChangeValue(); } - }); - if (!this.$utils.isEmpty(selectedList) && this.isClearEchoFailedDefaultValue) { - this.onChangeValue(); } }, onChangeValue(val, item) { @@ -235,9 +237,9 @@ export default { } else { _this.$emit('change-label', []); } + _this.handleEchoFailedDefaultValue(); }, 100); } - this.handleEchoFailedDefaultValue(); } }, computed: { diff --git a/src/resources/plugins/TsForm/TsFormRadio.vue b/src/resources/plugins/TsForm/TsFormRadio.vue index 4584d58c8c87223389dbe713e9981d95949ee256..da570a86071adc2c0b4ef1ec30639077e03ff678 100755 --- a/src/resources/plugins/TsForm/TsFormRadio.vue +++ b/src/resources/plugins/TsForm/TsFormRadio.vue @@ -175,15 +175,17 @@ export default { }, handleEchoFailedDefaultValue() { // 处理回显失败默认值,回显失败清空默认值 - let selectedList = []; - if (this.currentValue) { - let selectedItem = this.nodeList.find((item) => item[this.valueName] == this.currentValue); - if (!selectedItem) { - this.currentValue = null; + if (this.isClearEchoFailedDefaultValue && !this.$utils.isEmpty(this.nodeList)) { + let selectedList = []; + if (this.currentValue) { + let selectedItem = this.nodeList.find((item) => item[this.valueName] == this.currentValue); + if (!selectedItem) { + this.currentValue = null; + } + } + if (!this.$utils.isEmpty(selectedList)) { + this.onChangeValue(); } - } - if (!this.$utils.isEmpty(selectedList) && this.isClearEchoFailedDefaultValue) { - this.onChangeValue(); } }, onChangeValue() { diff --git a/src/resources/plugins/TsForm/TsFormSelect.vue b/src/resources/plugins/TsForm/TsFormSelect.vue index 5e6222abdad1de36f584e9c19ccf2c354009a3c1..c39c00d242eb1d1def631cd1ac6082016e4f5afe 100755 --- a/src/resources/plugins/TsForm/TsFormSelect.vue +++ b/src/resources/plugins/TsForm/TsFormSelect.vue @@ -919,20 +919,22 @@ export default { }, handleEchoFailedDefaultValue() { // 处理回显失败默认值,回显失败清空默认值 - let selectedList = []; - let valueList = this.multiple ? this.currentValue : this.currentValue instanceof Array ? this.currentValue : [this.currentValue]; - valueList.forEach((item, index) => { - if (item && !this.selectedList.find((n) => n[this.valueName] == item)) { - selectedList.push(item[this.valueName]); - if (this.currentValue instanceof Array) { - this.currentValue.splice(index, 1); - } else if (this.currentValue) { - this.currentValue = null; + if (this.isClearEchoFailedDefaultValue && !this.$utils.isEmpty(this.selectedList)) { + let selectedList = []; + let valueList = this.multiple ? this.currentValue : this.currentValue instanceof Array ? this.currentValue : [this.currentValue]; + valueList.forEach((item, index) => { + if (item && !this.selectedList.find((n) => n[this.valueName] == item)) { + selectedList.push(item[this.valueName]); + if (this.currentValue instanceof Array) { + this.currentValue.splice(index, 1); + } else if (this.currentValue) { + this.currentValue = null; + } } + }); + if (!this.$utils.isEmpty(selectedList)) { + this.onChangeValue(); } - }); - if (!this.$utils.isEmpty(selectedList) && this.isClearEchoFailedDefaultValue) { - this.onChangeValue(); } }, dynamicSearch(query, isFirst) { diff --git a/src/resources/plugins/TsSheet/form/component/formtableinputer/index.vue b/src/resources/plugins/TsSheet/form/component/formtableinputer/index.vue index ab02664e45f1a97e3a59ccc0f2b1f554ca5639ff..0b9cd2b452b59881051883f3c2d3e857492537fa 100644 --- a/src/resources/plugins/TsSheet/form/component/formtableinputer/index.vue +++ b/src/resources/plugins/TsSheet/form/component/formtableinputer/index.vue @@ -4,7 +4,7 @@