From a1df307ece594d8f2da568c2d13475000f31bd09 Mon Sep 17 00:00:00 2001 From: yaojn Date: Thu, 30 Oct 2025 15:12:04 +0800 Subject: [PATCH] =?UTF-8?q?-=20[=E4=BF=AE=E5=A4=8D]=E8=A1=A8=E6=A0=BCformt?= =?UTF-8?q?able=E7=BB=84=E4=BB=B6=E8=A1=A5=E5=85=85=E7=BC=BA=E5=A4=B1disab?= =?UTF-8?q?led=E5=B1=9E=E6=80=A7=20-=20[=E4=BF=AE=E5=A4=8D]=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E9=9D=9E=E8=A1=A8=E6=A0=BC=E5=A4=96=E7=9A=84=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E5=92=8C=E5=86=85=E5=B5=8C=E8=A1=A8=E6=A0=BC=E8=81=94?= =?UTF-8?q?=E5=8A=A8=E5=A4=B1=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98=20=20=20?= =?UTF-8?q?=20-=20[=E5=85=B3=E8=81=94]#[1542072920670208]=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E8=BE=93=E5=85=A5=E7=BB=84=E4=BB=B6=E5=86=85=E5=B5=8C?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E8=BE=93=E5=85=A5=E7=BB=84=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E8=81=94=E5=8A=A8=E8=A7=84=E5=88=99=E5=A4=B1=E6=95=88=E3=80=82?= =?UTF-8?q?=20http://192.168.0.96:8090/demo/rdm.html#/bug-detail/939050947?= =?UTF-8?q?543040/939050947543057/1542072920670208?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TsSheet/form/component/formtable.vue | 1 + .../formtableinputer/column-item.vue | 20 +++++---- .../form/component/formtableinputer/index.vue | 44 ++++++++++++++++--- 3 files changed, 50 insertions(+), 15 deletions(-) diff --git a/src/resources/plugins/TsSheet/form/component/formtable.vue b/src/resources/plugins/TsSheet/form/component/formtable.vue index 2b2aec5e..261ba86b 100644 --- a/src/resources/plugins/TsSheet/form/component/formtable.vue +++ b/src/resources/plugins/TsSheet/form/component/formtable.vue @@ -16,6 +16,7 @@ :formItemList="$utils.deepClone([...extraFormItemList, ...config.dataConfig, ...formItemList])" :showStatusIcon="false" :readonly="readonly" + :disabled="disabled" :isCustomValue="isCustomValue" :externalData="externalData" :formDataForWatch="{...filterUuid(initFormData),...formDataForWatch, ...row}" diff --git a/src/resources/plugins/TsSheet/form/component/formtableinputer/column-item.vue b/src/resources/plugins/TsSheet/form/component/formtableinputer/column-item.vue index c4808020..d18008a7 100644 --- a/src/resources/plugins/TsSheet/form/component/formtableinputer/column-item.vue +++ b/src/resources/plugins/TsSheet/form/component/formtableinputer/column-item.vue @@ -91,7 +91,7 @@ export default { }, mixins: [conditionMixin], inject: [ - 'formDataForWatch', + 'getFormDataForWatch', 'extraFormItemList', 'extendConfigList', 'formItemList', @@ -150,11 +150,13 @@ export default { currentItemMask: false, //当前组件是否不可见 currentItemReadonly: false, //当前组件是否只读 cunrrentRequire: false // - } + }, + formItem: {} }; }, beforeCreate() {}, created() { + this.formItem = this.extraFormItemList.find(d => d.uuid === this.extraUuid); this.initReactionFormItemUuid(); this.updateConfig(); this.initStatus(); @@ -470,10 +472,6 @@ export default { }, filter: {}, computed: { - formItem() { - const formItem = this.extraFormItemList.find(d => d.uuid === this.extraUuid); - return formItem; - }, componentStyle() { return { width: this.mode != 'defaultvalue' ? (this.formItem.config && this.formItem.config.width) || '100%' : '100%' }; }, @@ -565,20 +563,24 @@ export default { }, formItemUuid() { return this.formItem && this.formItem.uuid; + }, + formDataForWatch() { + return this.getFormDataForWatch(); } }, watch: { reactionData: { handler(val, oldVal) { if (val && (this.mode === 'read' || this.mode === 'readSubform')) { - if (!this.$utils.isSame(val, this.reactionFormItemUuidMap)) { + if (!this.$utils.isEmpty(this.reactionFormItemUuidMap) && !this.$utils.isSame(val, this.reactionFormItemUuidMap)) { this.executionReaction(val, this.reactionFormItemUuidMap); this.reactionFormItemUuidMap = this.$utils.deepClone(val); + this.isFirstLoad = false; } - this.isFirstLoad = false; } }, - immediate: true + immediate: true, + deep: true } } }; diff --git a/src/resources/plugins/TsSheet/form/component/formtableinputer/index.vue b/src/resources/plugins/TsSheet/form/component/formtableinputer/index.vue index 8a7b8155..d1a8de53 100644 --- a/src/resources/plugins/TsSheet/form/component/formtableinputer/index.vue +++ b/src/resources/plugins/TsSheet/form/component/formtableinputer/index.vue @@ -179,7 +179,7 @@ export default { }, provide() { return { - formDataForWatch: Object.freeze(this.$utils.deepClone(this.formDataForWatch)), + getFormDataForWatch: () => this.formDataForWatch, extraFormItemList: this.frozenExtraFormItemList, extendConfigList: this.frozenExtendConfigList, formItemList: this.frozenFormItemList, @@ -708,9 +708,11 @@ export default { return false; }, reactionDepsMap() { - const map = {}; + let map = {}; this.extraList.forEach(extra => { - const set = new Set(); + if (extra?.uuid) { + map[extra.uuid] = []; + } const reactionValue = extra.reaction || {}; for (const action in reactionValue) { const reaction = reactionValue[action]; @@ -719,17 +721,47 @@ export default { (reaction.conditionGroupList || []).forEach(group => { (group.conditionList || []).forEach(cond => { const uuid = (cond.formItemUuid || '').split('#')[0]; - if (uuid) set.add(uuid); + if (uuid) { + map[extra.uuid].push(uuid); + } }); }); } else { (reaction.ruleList || []).forEach(rule => { const uuid = (rule.formItemUuid || '').split('#')[0]; - if (uuid) set.add(uuid); + if (uuid) { + map[extra.uuid].push(uuid); + } }); } } - map[extra.uuid] = Array.from(set); + const {dataConfig = []} = extra.config || {}; + if (dataConfig.length > 0) { + dataConfig.forEach(d => { + const innerReactionValue = d.reaction || {}; + for (const action in innerReactionValue) { + const reactionRule = innerReactionValue[action]; + if (!reactionRule) continue; + if (action !== 'filter') { + (reactionRule.conditionGroupList || []).forEach(group => { + (group.conditionList || []).forEach(cond => { + const uuid = (cond.formItemUuid || '').split('#')[0]; + if (uuid) { + map[extra.uuid].push(uuid); + } + }); + }); + } else { + (reactionRule.ruleList || []).forEach(rule => { + const uuid = (rule.formItemUuid || '').split('#')[0]; + if (uuid) { + map[extra.uuid].push(uuid); + } + }); + } + } + }); + } }); return map; }, -- Gitee