diff --git a/o2web/source/x_component_process_Xform/Documenteditor.js b/o2web/source/x_component_process_Xform/Documenteditor.js index 620bfe4c0558f81725d50df793670406ec4c988a..75e79f561c6cb8236b443910ce59cb49c270ca2c 100644 --- a/o2web/source/x_component_process_Xform/Documenteditor.js +++ b/o2web/source/x_component_process_Xform/Documenteditor.js @@ -866,18 +866,41 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor = new Cla if (this.layout_subject){ if (!this.json.subjectValueData && this.json.subjectValueType=="data"){ this.layout_subject.set("contenteditable", control.subject); - this.layout_subject.addEvent("blur", function(){ - this.getData(); - }.bind(this)) + // this.layout_subject.addEvent("blur", function(){ + // this.getData(); + // }.bind(this)) + this.layout_subject.addEvent("blur", function(e){ + var subject = this.layout_subject.get("text"); + if (!subject){ + this.layout_subject.set("html", this.data.subject); + this.form.app.notice(MWF.xApplication.process.Xform.LP.subjectEmpty, "error", this.layout_subject, {"x": "center","y":"top"}, {"x": 0,"y":60}); + e.preventDefault(); + e.stopPropagation(); + }else{ + this.getData(); + } + }.bind(this)); } } if (this.layout_issuanceUnit){ if (!this.json.issuanceUnitValueData && this.json.issuanceUnitValueType=="data"){ this.layout_issuanceUnit.set("contenteditable", control.issuanceUnit); - this.layout_issuanceUnit.addEvent("blur", function(){ - this.getData(); - }.bind(this)) + // this.layout_issuanceUnit.addEvent("blur", function(){ + // this.getData(); + // }.bind(this)) + + this.layout_issuanceUnit.addEvent("blur", function(e){ + var issuanceUnit = this.layout_issuanceUnit.get("text"); + if (!issuanceUnit){ + this.layout_issuanceUnit.set("html", this.data.issuanceUnit); + this.form.app.notice(MWF.xApplication.process.Xform.LP.issuanceUnitEmpty, "error", this.layout_issuanceUnit, {"x": "center","y":"top"}, {"x": 0,"y":60}); + e.preventDefault(); + e.stopPropagation(); + }else{ + this.getData(); + } + }.bind(this)); } } diff --git a/o2web/source/x_component_process_Xform/lp/zh-cn.js b/o2web/source/x_component_process_Xform/lp/zh-cn.js index 147638c73b3d0a9dab42a7930f92afa3cc9b1f57..e4b8ea83dd60c8c8d0cfa84a05d341841c976ee3 100644 --- a/o2web/source/x_component_process_Xform/lp/zh-cn.js +++ b/o2web/source/x_component_process_Xform/lp/zh-cn.js @@ -233,6 +233,8 @@ MWF.xApplication.process.Xform.LP = { "original": "原始版本", "nodiff": "目前还没有历史修改信息" }, + "subjectEmpty": "标题不能为空", + "issuanceUnitEmpty": "发文单位不能为空", "fullWidth": "已启用半角空格自动转换为全角空格,如需输入半角空格,请使用:SHIFT+空格" };