From 53a840af4b97ee4a481967a70b15653f17b7b4b4 Mon Sep 17 00:00:00 2001 From: Bo_boom <774738009@qq.com> Date: Mon, 5 Dec 2022 17:38:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E6=A0=A1=E9=AA=8C=E8=AD=A6?= =?UTF-8?q?=E5=91=8A=E6=8F=90=E7=A4=BA=E6=B7=BB=E5=8A=A0=EF=BC=9B=20(#410)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 表单校验警告提示添加 Co-authored-by: wusongda --- server/src/main/resources/web/index.ftl | 34 +++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/server/src/main/resources/web/index.ftl b/server/src/main/resources/web/index.ftl index 1fcc90e9..3bfa6ca4 100644 --- a/server/src/main/resources/web/index.ftl +++ b/server/src/main/resources/web/index.ftl @@ -17,6 +17,11 @@ + @@ -75,6 +80,12 @@ + @@ -90,10 +101,16 @@

- +
@@ -203,7 +220,10 @@ $('#previewByUrl').on('click',function() { var _url = $("#_url").val(); if (!checkUrl(_url)) { - alert('请输入正确的url'); + $("#previewCheckAlert").addClass("show"); + window.setTimeout(function(){ + $("#previewCheckAlert").removeClass("show"); + },3000);//显示的时间 return false; } @@ -217,6 +237,14 @@ }); $("#btnSubmit").click(function () { + var _fileName = $("#fileName").text() + if(!_fileName){ + $("#postFileAlert").addClass("show"); + window.setTimeout(function(){ + $("#postFileAlert").removeClass("show"); + },3000);//显示的时间 + return; + } showLoadingDiv(); $("#fileUpload").ajaxSubmit({ success: function (data) { @@ -226,10 +254,12 @@ } else { $('#table').bootstrapTable('refresh', {}); } + $("#fileName").text(""); $(".loading_container").hide(); }, error: function () { alert('上传失败,请联系管理员'); + $("#fileName").text(""); $(".loading_container").hide(); }, url: 'fileUpload', /*设置post提交到的页面*/