From 03efc64ed206414fc945981fcb3f0e801f56a5ec Mon Sep 17 00:00:00 2001 From: Devil Date: Wed, 24 Mar 2021 18:36:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=95=86=E5=93=81=E8=A7=84?= =?UTF-8?q?=E6=A0=BC=E9=87=8D=E6=96=B0=E7=94=9F=E6=88=90=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=89=A9=E5=B1=95=E6=95=B0=E6=8D=AE=E9=87=8D=E5=A4=8D=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/admin/default/js/goods.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/public/static/admin/default/js/goods.js b/public/static/admin/default/js/goods.js index c6ddb74e1..707983b34 100755 --- a/public/static/admin/default/js/goods.js +++ b/public/static/admin/default/js/goods.js @@ -119,6 +119,13 @@ $(function() if($('.specifications-table th.table-title').length <= 0) { + // 防止用户操作删除了第一条数据、首行移除指定class + ($('.specifications-table tr.line-not-first').length >= $('.specifications-table tr').length) + { + $('.specifications-table').find('tbody tr:first').removeClass('line-not-first'); + } + + // 移除多余的规格行 $('.specifications-table tr.line-not-first').remove(); } }); @@ -661,6 +668,7 @@ $(function() for(var i=1; i