let enable = true;
const allowedWorkflowIds = [148,56,143]; // 允许的流程ID列表
//判断条件
const checkConditions = () => {
// console.log("开始检查");
const {
hash
} = window.location;
if (!hash.startsWith('#/main/workflow/req')) return false; // 判断页面地址
if (!WfForm) return false; // 表单sdk加载完成
const baseInfo = WfForm.getBaseInfo();
const {
workflowid
} = baseInfo;
return allowedWorkflowIds.includes(workflowid); // 判断流程id是否在允许的列表中
};
ecodeSDK.overwritePropsFnQueueMapSet('WeaBrowser', {
fn: (newProps) => { //newProps 代表组件参数
if (!enable || !checkConditions()) return; // 开关打开、条件不满足
//筛选newProps.title:"多流程"
if (newProps.title == "多流程") {
const linkUrlWithMonitor = newProps.linkUrl.replace(/(requestid=)/, '&ismonitor=1&$1');
newProps.linkUrl = linkUrlWithMonitor;
console.log(newProps);
if (!newProps.replaceDatas || !newProps.replaceDatas.length || !newProps.replaceDatas[0].name) {
// 如果 replaceDatas 不存在、为空数组或第一个元素的 name 属性不存在或为空,则不执行后续操作
return;
}
newProps.replaceDatas[0].name = "点击查看流程";
}
},
});
[泛微ecode] 流程浏览按钮跳转监控流程(ismonitor) by https://oneszhang.com/archives/79.html