1.移动端附件图片预览,移动端流程表单附件图片预览(不下载到本地),点击附件图片字段时拦截点击事件直接预览图片
const enable = true;
let isRun = false;
const runScript = () => {ecodeSDK.overwriteMobileClassFnQueueMapSet('Upload', {fn: (Com, newProps) => {if (newProps.datas && newProps.datas.length > 0) {return {com: Com,props: { ...newProps, onItemClick: (file,params,baseRoute) => showFormDoc(file, newProps,params,baseRoute), _noOverwrite: true }};}},});
};
const showFormDoc = (file, newProps,params,baseRoute) => {const fileViewUrl = WfForm.getGlobalStore().commonParam.fileViewUrl;const imagefileId = file.imagefileid;const url = fileViewUrl.replace("${fileid}",imagefileId);showHoverWindow(url,baseRoute,true);
}ecodeSDK.overwriteMobilePropsFnQueueMapSet('Upload', {fn: (newProps) => {if (!enable) return;if (!ecodeSDK.checkLPath('/spa/workflow/static4mobileform/index.html#/req')) return; // 判断是否为流程表单页面if (isRun) return;// if(newProps._noOverwrite) return ;if (window.WeaverMobile) {//if (newProps.datas && newProps.datas.length>0 ) {runScript(newProps)}}}
});
2.明细附件限制上传数量
let enable = true
ecodeSDK.overwritePropsFnQueueMapSet('WeaUpload',{fn:(newProps)=>{if(!enable) return ; //总开关if(!ecodeSDK.checkLPath('/spa/workflow/static4form/index.html#/main/workflow/req')) return;if(!WfForm) return;if(newProps.isDetail) {newProps.maxFilesNumber = 1;newProps.replaceWhenOver = false;}return newProps;}
});ecodeSDK.overwriteMobilePropsFnQueueMapSet('Upload',{fn:(newProps)=>{if(!enable) return ; //总开关if(!ecodeSDK.checkLPath('/spa/workflow/static4mobileform/index.html#/req')) return;if(!WfForm) return;if(newProps.uploadId.indexOf('_')!==-1) {newProps.maxFilesNumber = 1;}return newProps;}
});
3.移动端屏蔽附件下载按钮
ecodeSDK.overwriteMobilePropsFnQueueMapSet('FilePicker', {fn: (newProps, name) => {newProps.files.map(item => {item.showLoad = false;})return newProps;}
});