Skip to content

Commit

Permalink
优化:上线单名称/工单名称超过50个字符时增加提示。
Browse files Browse the repository at this point in the history
  • Loading branch information
kang.peng committed Nov 30, 2023
1 parent a564fe3 commit 58c10ea
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions sql/templates/sqlsubmit.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<div class="form-group">
<input id="workflow_name" type="text" autocomplete="off" name="workflow_name"
class="form-control"
data-name="上线单名称" data-placeholder="请输入上线单名称"
data-name="上线单名称" data-placeholder="请输入上线单名称!"
placeholder="请输入上线单名称,如:XX项目会员功能建表"
required>
</div>
Expand Down Expand Up @@ -333,6 +333,7 @@ <h4 class="modal-title text-danger">提交信息确认</h4>
element.find('[required]').each(
function () {
var fieldElement = $(this);
var fieldId = $(this).attr('id');
//如果为null则设置为''
var value = fieldElement.val() || '';
if (value) {
Expand All @@ -343,6 +344,11 @@ <h4 class="modal-title text-danger">提交信息确认</h4>
result = false;
return result;
}
if(fieldId == "workflow_name" && value.length>=50){
alert("上线单名称/工单名称不能超过50个字符!");
result = false;
return result;
}
}
);
return result;
Expand Down Expand Up @@ -564,10 +570,6 @@ <h4 class="modal-title text-danger">提交信息确认</h4>
obj[item.name] = item.value;
return obj;
}, {})
if (formData.workflow_name.length>=50){
alert("上线单名称/工单名称不能超过50个字符!")
return
}
$.ajax({
type: "post",
url: "/api/v1/workflow/",
Expand Down

0 comments on commit 58c10ea

Please sign in to comment.