From 682342b09084c9bbd4f66918e7af7120a831ca8b Mon Sep 17 00:00:00 2001 From: dengbf Date: Fri, 11 Jul 2025 18:59:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?-[=E5=85=B3=E8=81=94]=20#[1462965310554112]?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E7=BB=84=E4=BB=B6=E8=81=94=E5=8A=A8=E8=A7=84?= =?UTF-8?q?=E5=88=99=E4=BC=98=E5=8C=96=20http://192.168.0.96:8090/demo/rdm?= =?UTF-8?q?.html#/story-detail/939050947543040/939050947543042/14629653105?= =?UTF-8?q?54112?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/resources/plugins/TsSheet/TsSheet.vue | 32 +- src/resources/plugins/TsSheet/form-item.vue | 317 ++++++++++++------ .../form/component/formtableinputer/index.vue | 103 +----- .../plugins/TsSheet/form/reaction/filter.js | 3 + .../processdetail/workorder/CenterDetail.vue | 41 +-- .../pages/process/task/task-dispatch.vue | 7 +- 6 files changed, 269 insertions(+), 234 deletions(-) diff --git a/src/resources/plugins/TsSheet/TsSheet.vue b/src/resources/plugins/TsSheet/TsSheet.vue index 4068f567..462826c3 100644 --- a/src/resources/plugins/TsSheet/TsSheet.vue +++ b/src/resources/plugins/TsSheet/TsSheet.vue @@ -1167,9 +1167,9 @@ export default { //根据联动配置初始化watch initReactionWatch() { this.needWatch = false; - if (this.config.reaction) { - for (let key in this.config.reaction) { - if (this.config.reaction[key].some(d => !this.$utils.isEmpty(d)) > 0) { + if (this.reaction) { + for (let key in this.reaction) { + if (this.reaction[key].some(d => !this.$utils.isEmpty(d)) > 0) { this.needWatch = true; break; } @@ -1182,9 +1182,8 @@ export default { this.$nextTick(() => { const newVal = newValue && JSON.parse(newValue); const oldVal = oldValue && JSON.parse(oldValue); - - for (let key in this.config.reaction) { - this.config.reaction[key].forEach(reaction => { + for (let key in this.reaction) { + this.reaction[key].forEach(reaction => { if (this.mode !== 'edit' && reaction.rows && reaction.rows.length > 0) { const reactionResult = this.executeReaction(reaction, newVal, oldVal); if (key === 'hiderow') { @@ -1780,9 +1779,9 @@ export default { }, //行是否有联动设置 hasReaction(index) { - if (this.config.reaction) { - for (let key in this.config.reaction) { - const reactionList = this.config.reaction[key]; + if (this.reaction) { + for (let key in this.reaction) { + const reactionList = this.reaction[key]; if (reactionList && reactionList.length > 0) { for (let i = 0; i < reactionList.length; i++) { const reaction = reactionList[i]; @@ -1796,9 +1795,9 @@ export default { return false; }, isHideRow(index) { - if (this.config.reaction && this.config.reaction.hiderow) { - for (let i = 0; i < this.config.reaction.hiderow.length; i++) { - const hiderow = this.config.reaction.hiderow[i]; + if (this.reaction && this.reaction.hiderow) { + for (let i = 0; i < this.reaction.hiderow.length; i++) { + const hiderow = this.reaction.hiderow[i]; if (hiderow.rows && hiderow.rows.length > 0 && hiderow.rows.includes(index)) { return true; } @@ -2104,9 +2103,9 @@ export default { conditionData() { return uuid => { const conditionData = {}; - if (this.config.reaction) { - for (let key in this.config.reaction) { - const reactionList = this.config.reaction[key]; + if (this.reaction) { + for (let key in this.reaction) { + const reactionList = this.reaction[key]; if (reactionList && reactionList.length > 0) { reactionList.forEach(reaction => { if (reaction && !this.$utils.isEmpty(reaction) && reaction.conditionGroupList) { @@ -2400,6 +2399,9 @@ export default { let {componentTopLeftTip = ''} = config; return componentTopLeftTip; }; + }, + reaction() { + return this.config && this.config.reaction; } }, watch: { diff --git a/src/resources/plugins/TsSheet/form-item.vue b/src/resources/plugins/TsSheet/form-item.vue index f76674e0..2bb8a885 100644 --- a/src/resources/plugins/TsSheet/form-item.vue +++ b/src/resources/plugins/TsSheet/form-item.vue @@ -1,6 +1,5 @@