本文摘要
在泛微EC9的ecode开发中,可通过重写Table组件属性来定制待办列表的流程标题样式。文章以退回流程标红为例,利用ecodeSDK遍历待办数据,识别标题中的退回标记并替换为红色加粗的HTML,实现视觉提醒。该方法适用于需要突出显示特定状态流程的OA二次开发场景,注意路径判断以确保仅对待办列表生效。

退回标红示例代码:
ecodeSDK.overwritePropsFnQueueMapSet('Table', { fn: (newProps) => { if (!ecodeSDK.checkLPath('/wui/index.html#/main/workflow/listDoing')) return; console.log("路径识别正确!", newProps);
// 遍历 newProps.datas 进行处理 if (newProps.datas && newProps.datas.length) { for (let i = 0; i < newProps.datas.length; i++) { let requestnamespan = newProps.datas[i].requestnamespan;
// 判断 requestnamespan 是否包含 "[退回]" if (requestnamespan && requestnamespan.includes("[退回]")) { // 修改 requestnamespan 的 HTML 使其红色加粗 newProps.datas[i].requestnamespan = requestnamespan.replace( "[退回]", "<span style='color: red; font-weight: bold;'>[退回]</span>" ); } } } },});