diff --git a/src/hooks/web/useWorkFlowForm.ts b/src/hooks/web/useWorkFlowForm.ts index 0b9ff27..6437739 100644 --- a/src/hooks/web/useWorkFlowForm.ts +++ b/src/hooks/web/useWorkFlowForm.ts @@ -497,3 +497,37 @@ export function changeSchemaDisabled(schemas) { }); return schemas; } +// 辅助设置表单可以编辑 +export function changeSchemaEnable(schemas) { + const layoutComponents = ['tab', 'grid', 'card']; + schemas?.map((info) => { + if (layoutComponents.includes(info.type!)) { + info.children?.map((childInfo) => { + childInfo.list.map((com) => { + if (layoutComponents.includes(com.type)) { + changeSchemaDisabled(childInfo.list); + } else { + com.dynamicDisabled = false; + } + }); + }); + } else if (info.type == 'table-layout') { + info.children?.map((childInfo) => { + childInfo.list.map((com) => { + com.children.map((el) => { + if (layoutComponents.includes(el.type) || el.type == 'table-layout') { + changeSchemaDisabled(com.children); + } else { + el.dynamicDisabled = false; + } + }); + }); + }); + } else if (info.type == 'one-for-one') { + changeSchemaDisabled(info.componentProps.childSchemas); + } else { + info.dynamicDisabled = false; + } + }); + return schemas; +} \ No newline at end of file diff --git a/src/utils/helper/generatorHelper.ts b/src/utils/helper/generatorHelper.ts index 81b3abd..3eb822d 100644 --- a/src/utils/helper/generatorHelper.ts +++ b/src/utils/helper/generatorHelper.ts @@ -1533,7 +1533,19 @@ ${hasTemplatePrint ? ' reactive ' : ''} actionsList = actionsList.concat(editAndDelBtn); } } - return actionsList; + return filterAction(actionsList, record); + } + function filterAction(list, record) { + const result = list.filter((item)=> { + let conditions = item.tooltip !== '查看流转记录' + if (record.workflowData.enabled) { + conditions = conditions && item.tooltip !== '查看' + } else { + conditions = conditions && (item.tooltip === '查看' || item.tooltip === '删除') + } + return conditions + }) + return result } ` : ` diff --git a/src/views/secondDev/formCreatePage.vue b/src/views/secondDev/formCreatePage.vue index 900abdd..76db627 100644 --- a/src/views/secondDev/formCreatePage.vue +++ b/src/views/secondDev/formCreatePage.vue @@ -8,12 +8,18 @@ 关闭 - + + + + + {{ item.name }} + + @@ -23,13 +29,34 @@