Authored by 陶雨

4.6->分类管理增加非空验证,更改edit2对文件非空的提示语

... ... @@ -86,7 +86,9 @@ components.prototype={
$("input[type=file]", that.el).each(function() {
var value = $.trim($(this).attr("value"));
if ($(this).attr("required") && !value) {
err.push("<p>请上传文件</p>");
var prompt = $.trim($(this).attr("prompt"));
if(!prompt) err.push("<p>请上传文件</p>");
else err.push("<p>请上传"+ prompt +"</p>");
return false;
}
});
... ...
... ... @@ -81,6 +81,9 @@ $(document).on("click", "#addUrl", function () {
});
$(document).on("click", "#saveBtn", function () {
if(!edit.validate()) {
return false;
}
var isNew = $("#isNew").val();
var isHot = $("#isHot").val();
var separativeSign = $("#separativeSign").val();
... ...
... ... @@ -2,11 +2,11 @@
* Created by ty on 2016/5/26.
* 分类管理路由
*/
exports.domain = require('../config/common.js').domain;
//exports.domain = require('../config/common.js').domain;
//exports.domain = 'http://172.16.6.115:8080/platform';//王伟
//exports.domain = 'http://192.168.102.216:8180/platform'; //测试环境
//exports.domain = 'http://172.16.6.231:8080/platform';
//exports.domain = 'http://172.16.6.225:8080/platform';
exports.domain = 'http://172.16.6.225:8080/platform';
//exports.domain = 'http://192.168.102.216:8086/platform';
exports.res = [
... ...
... ... @@ -75,7 +75,7 @@
<div class="form-group">
<label class="col-sm-1 control-label">分类图标</label>
<div class="col-sm-9">
<input type="file" name="file" prompt="分类图标" value="[[sortIco]]" class="observe" data-field="sortIco">
<input type="file" name="file" prompt="分类图标" value="[[sortIco]]" class="observe" data-field="sortIco" required>
</div>
</div>
... ...