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 @@
-
+
{{ $t('term.pbc.exporttemplate') }} @@ -292,7 +292,7 @@ export default { let theadUuidList = []; this.tableData.theadList.forEach((item) => { if (item?.key && item?.title) { - if (item.key != 'number') { + if (item.key != 'number' && !this.handleExcludeTable(item.key)) { // 序号是否需要显示 theadList.push({ header: item.title, @@ -364,7 +364,7 @@ export default { let theadUuidList = []; // 获取所有表头的uuid列表 this.tableData.theadList.forEach((item) => { if (item?.key && item?.title) { - if (item.key != 'number') { + if (item.key != 'number' && !this.handleExcludeTable(item.key)) { columnsList.push({ header: item.title, key: item.key, @@ -399,12 +399,15 @@ export default { let selectedItem = this.extraList.find((extraItem) => extraItem.uuid == key); let {config = {}, handler = ''} = selectedItem || {}; let {dataSource = '', isMultiple = false} = config; - if (dataSource == 'matrix' && isMultiple) { + console.log('handler', handler); + if (handler == 'formtable') { + this.$set(item, [key], null); + } else if (dataSource == 'matrix' && (isMultiple || handler == 'formradio')) { // 矩阵数据源并且是多选,需要处理值去掉&=& this.$set(item, [key], this.handleSpecialValue(item[key])); } else if (dataSource == 'static' && (isMultiple || handler == 'formcheckbox')) { // 静态数据源并且是多选 - this.$set(item, [key], item[key].join(',')); + this.$set(item, [key], item[key]?.join(',')); } } } @@ -458,6 +461,14 @@ export default { const formatObj = foundItem ? { numFmt: '@' } : {}; return formatObj; }, + handleExcludeTable(uuid) { + // 处理排除表格输入组件 + let componentsList = ['formtable']; + const foundItem = this.extraList.find((item) => { + return item.uuid && item.uuid === uuid && componentsList.includes(item.handler); + }); + return foundItem; + }, convertToExcelColumn(number) { // 将数字转化成A-Z的值 let result = ''; @@ -548,7 +559,7 @@ export default { let {config = {}, handler = ''} = selectedItem || {}; if (value) { let {dataSource = '', isMultiple = false} = config || {}; - if (dataSource === 'matrix' && isMultiple) { + if (dataSource === 'matrix' && (isMultiple || handler == 'formradio')) { // 矩阵 resultValue = []; let valueList = []; diff --git a/src/resources/plugins/TsSheet/form/config/common/static-data-editor.vue b/src/resources/plugins/TsSheet/form/config/common/static-data-editor.vue index 9fb5fc0a9fa99581daae5beb2a1b2eb8891c024d..a5bb0b7d60d5f5706393d6b5710368addf61224e 100644 --- a/src/resources/plugins/TsSheet/form/config/common/static-data-editor.vue +++ b/src/resources/plugins/TsSheet/form/config/common/static-data-editor.vue @@ -19,7 +19,7 @@