提交 fa10b943 编写于 作者: U unknown

附件上传增加校验脚本

上级 a506fa7a
......@@ -244,6 +244,10 @@
</td>
</tr>
</table>
<div style="height: 28px; font-weight: bold; line-height:28px; background-color: #EEE; padding: 0px 6px; border-top: 1px solid #999">上传时校验</div>
<div>可以通过this.target.uploadingFiles获取当前正在上传的附件。返回true表示通过,返回文本系统提示文本后中断上传。</div>
<div class="MWFScriptArea" name="uploadValidation" title="上传时校验脚本 (S)"></div>
</div>
<div title="{{$.lp.event}}" class="MWFTab" style="overflow: hidden">
......
......@@ -1379,6 +1379,17 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class(
return false;
}
}
this.uploadingFiles = files;
if (this.json.uploadValidation && this.json.uploadValidation.code) {
var flag = this.form.Macro.exec(this.json.uploadValidation.code, this);
if (!flag) flag = "附件校验未通过。";
if (flag.toString()!="true"){
this.form.notice(flag, "error");
return false;
}
}
this.fireEvent("beforeUpload", [files]);
return true;
}.bind(this), true, accept, size, function (o) { //错误的回调
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册