From 0bc75c537d73e9bdf1027d8f649fb40d20846e94 Mon Sep 17 00:00:00 2001 From: liuqimichale <123456lq> Date: Tue, 7 Aug 2018 10:03:38 +0800 Subject: [PATCH] 防止重复提交 --- topages/workfill/workfill.css | 4 ++++ topages/workfill/workfill.html | 14 +++++++------- topages/workfill/workfill.js | 10 +++++++--- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/topages/workfill/workfill.css b/topages/workfill/workfill.css index f9a56b2..343533c 100644 --- a/topages/workfill/workfill.css +++ b/topages/workfill/workfill.css @@ -61,6 +61,10 @@ .workfill-list-btn{ padding: 3px 20px; border-radius: 15px; + border: 0; +} +.workfill-list-btn:focus{ + outline: none; } .workfill-list-wrap li:nth-of-type(1) .workfill-list-btn{ background-color: #fedee5; diff --git a/topages/workfill/workfill.html b/topages/workfill/workfill.html index 6107b07..c0c786c 100644 --- a/topages/workfill/workfill.html +++ b/topages/workfill/workfill.html @@ -13,7 +13,7 @@
  • 周一 - 提交 +
    @@ -31,7 +31,7 @@
  • 周二 - 提交 +
    @@ -48,7 +48,7 @@
  • 周三 - 提交 +
    @@ -65,7 +65,7 @@
  • 周四 - 提交 +
    @@ -82,7 +82,7 @@
  • 周五 - 提交 +
    @@ -99,7 +99,7 @@
  • 周六 - 提交 +
    @@ -116,7 +116,7 @@
  • 周日 - 提交 +
    diff --git a/topages/workfill/workfill.js b/topages/workfill/workfill.js index 06762ff..1c7b011 100644 --- a/topages/workfill/workfill.js +++ b/topages/workfill/workfill.js @@ -146,7 +146,7 @@ var fun = { $("#work-projectName"+row.weeksNum).selectpicker('val',row.projectId); $("#work-projectName"+row.weeksNum).selectpicker('refresh'); - $("#btn-commit"+row.weeksNum).text('编辑'); + $("#btn-commit"+row.weeksNum).html('编辑'); $("#btn-commit"+row.weeksNum).parent().parent().find(".workfill-list-container").attr("contenteditable","false"); $("#btn-commit"+row.weeksNum).parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').addClass('display-none'); var projectName=$("#btn-commit"+row.weeksNum).parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon .work-projectName').find("option:selected").text(); @@ -169,6 +169,7 @@ var fun = { $('.ITD-alertmodel-contentmsg').text(''); $('#ITD-tipsmodel').modal('hide'); },3000); + _this.removeAttr("disabled"); return false; }else{ var req= { @@ -188,12 +189,13 @@ var fun = { if(res.success == true){ var asraId = res.data; $("#weekday"+id).attr("data-id",asraId); - _this.text('编辑'); + _this.html('编辑'); _this.parent().parent().find(".workfill-list-container").attr("contenteditable","false"); _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').addClass('display-none'); var projectName=_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon .work-projectName').find("option:selected").text(); _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').removeClass('display-none'); _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').text(projectName); + _this.removeAttr("disabled"); }else{ $('.ITD-alertmodel-contentmsg').text('提交失败!'); @@ -202,6 +204,7 @@ var fun = { $('.ITD-alertmodel-contentmsg').text(''); $('#ITD-tipsmodel').modal('hide'); },3000); + _this.removeAttr("disabled"); return false; } } @@ -229,7 +232,7 @@ documentBindFunc.on('click','#time-opr-nextbtn',function () { documentBindFunc.on('click','.workfill-list-btn',function () { var _this=$(this); if(_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').hasClass('display-none')){ - _this.text('提交'); + _this.html('提交'); _this.parent().parent().find(".workfill-list-container").attr("contenteditable","true"); _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').toggleClass('display-none'); var projectName=_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon .work-projectName').find("option:selected").text(); @@ -237,6 +240,7 @@ documentBindFunc.on('click','.workfill-list-btn',function () { _this.parent().parent().find('.workfill-list-projectnamewrap .workfill-list-projectname').text(projectName); }else { + _this.attr("disabled","disabled"); var commitId = _this.attr("id"); var id = commitId.substring(10,11); fun.dailyReportCommit(id,_this); -- libgit2 0.21.4