diff --git a/src/views/plugin/workflow/process/components/detail.vue b/src/views/plugin/workflow/process/components/detail.vue index 8a8e4aa..35cb5b9 100644 --- a/src/views/plugin/workflow/process/components/detail.vue +++ b/src/views/plugin/workflow/process/components/detail.vue @@ -180,24 +180,11 @@ export default { }) }, handleResolveOption(option, taskForm, status) { - const { column, group } = option + let { column, group } = option let vars = [] - if (status != 'todo') { // 已办,删除字段默认值 - option.detail = true - if (column && column.length > 0) { // 处理column - column.forEach(col => this.handleResolveEvent(col)) - } - - if (group && group.length > 0) { // 处理group - group.forEach(gro => { - if (gro.column && gro.column.length > 0) { - gro.column.forEach(col => this.handleResolveEvent(col)) - } - }) - } - } else { + if (taskForm) { const columnFilter = this.filterAvueColumn(column, taskForm) - const columnArr = columnFilter.column + column = columnFilter.column vars = columnFilter.vars || [] const groupArr = [] @@ -209,21 +196,39 @@ export default { if (gro.column.length > 0) groupArr.push(gro) }) } - option.column = columnArr - option.group = groupArr + group = groupArr } + + if (status != 'todo') { // 已办,删除字段默认值 + option.detail = true + if (column && column.length > 0) { // 处理column + column.forEach(col => this.handleResolveEvent(col, taskForm)) + } + + if (group && group.length > 0) { // 处理group + group.forEach(gro => { + if (gro.column && gro.column.length > 0) { + gro.column.forEach(col => this.handleResolveEvent(col, taskForm)) + } + }) + } + } + option.column = column + option.group = group return { option, vars } }, - handleResolveEvent(col) { + handleResolveEvent(col, taskForm) { const _this = this delete col.value - let event = ['change', 'blur', 'click', 'focus'] - event.forEach(e => { - if (col[e]) col[e] = eval((col[e] + '').replace(/this/g, '_this')) - }) - if (col.event) Object.keys(col.event).forEach(key => col.event[key] = eval((col.event[key] + '').replace(/this/g, '_this'))) + if (!taskForm) { + let event = ['change', 'blur', 'click', 'focus'] + event.forEach(e => { + if (col[e]) col[e] = eval((col[e] + '').replace(/this/g, '_this')) + }) + if (col.event) Object.keys(col.event).forEach(key => col.event[key] = eval((col.event[key] + '').replace(/this/g, '_this'))) - if (col.type == 'dynamic') col.children.column.forEach(cc => _this.handleResolveEvent(cc)) + } + if (col.type == 'dynamic') col.children.column.forEach(cc => _this.handleResolveEvent(cc, taskForm)) }, // 审核 handleExamine(pass) { diff --git a/src/views/plugin/workflow/process/external/Leave/detail.vue b/src/views/plugin/workflow/process/external/Leave/detail.vue index cde90e2..8ff4c09 100644 --- a/src/views/plugin/workflow/process/external/Leave/detail.vue +++ b/src/views/plugin/workflow/process/external/Leave/detail.vue @@ -229,7 +229,25 @@ export default { let { taskForm } = form const option = this.option option.menuBtn = false - const { column, group } = option + let { column, group } = option + if (taskForm) { + const columnFilter = this.filterAvueColumn(column, taskForm, true) + column = columnFilter.column + let vars = columnFilter.vars || [] + + const groupArr = [] + if (group && group.length > 0) { // 处理group + group.forEach(gro => { + const groupFilter = this.filterAvueColumn(gro.column, taskForm, true) + gro.column = groupFilter.column + vars = vars.concat(groupFilter.vars) + if (gro.column.length > 0) groupArr.push(gro) + }) + } + group = groupArr + this.vars = vars + } + if (status != 'todo') { // 已办,删除字段默认值 option.detail = true if (column && column.length > 0) { // 处理column @@ -253,24 +271,10 @@ export default { } }) } - } else { - const columnFilter = this.filterAvueColumn(column, taskForm, true) - const columnArr = columnFilter.column - let vars = columnFilter.vars || [] - - const groupArr = [] - if (group && group.length > 0) { // 处理group - group.forEach(gro => { - const groupFilter = this.filterAvueColumn(gro.column, taskForm, true) - gro.column = groupFilter.column - vars = vars.concat(groupFilter.vars) - if (gro.column.length > 0) groupArr.push(gro) - }) - } - option.column = columnArr - option.group = groupArr - this.vars = vars } + option.column = column + option.group = group + for (let key in variables) { if (!variables[key]) delete variables[key] }