From 829168329052247444b4f7bb2a0ee939988c777d Mon Sep 17 00:00:00 2001 From: augushong Date: Fri, 28 Apr 2023 10:47:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=96=87=E4=BB=B6=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E7=BB=91=E5=AE=9A=E5=90=8D=E7=A7=B0=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=87=AA=E5=8A=A8=E5=88=A0=E9=99=A4=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/view/mall/goods/edit.html | 6 ++-- public/static/plugs/easy-admin/easy-admin.js | 30 +++++++++++++------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/app/admin/view/mall/goods/edit.html b/app/admin/view/mall/goods/edit.html index 7e8f270..93fc2f5 100644 --- a/app/admin/view/mall/goods/edit.html +++ b/app/admin/view/mall/goods/edit.html @@ -78,7 +78,7 @@ -
+
@@ -89,8 +89,8 @@
diff --git a/public/static/plugs/easy-admin/easy-admin.js b/public/static/plugs/easy-admin/easy-admin.js index 8389c86..f6727d2 100644 --- a/public/static/plugs/easy-admin/easy-admin.js +++ b/public/static/plugs/easy-admin/easy-admin.js @@ -2114,7 +2114,7 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick if (extGroup.image.indexOf(ext) != -1) { // 是图片 - liHtml += '
  • ×
  • \n'; + liHtml += '
  • ×
  • \n'; } else { // 不是图片 @@ -2122,7 +2122,7 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick uploadIcon = admin.getExtGroupName(ext); - liHtml += '
  • ×
  • \n'; + liHtml += '
  • ×
  • \n'; } @@ -2144,19 +2144,29 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick $('body').on('click', '[data-upload-delete]', function () { var uploadName = $(this).attr('data-upload-delete'), deleteUrl = $(this).attr('data-upload-url'), + uploadFilenameField = $(this).attr('data-upload-filename-field'), sign = $(this).attr('data-upload-sign'); var confirm = admin.msg.confirm('确定删除?', function () { var elem = "input[name='" + uploadName + "']"; + var elemFilenameField = "input[name='" + uploadFilenameField + "']"; var currentUrl = $(elem).val(); - var url = ''; - if (currentUrl !== deleteUrl) { - url = currentUrl.search(deleteUrl) === 0 ? currentUrl.replace(deleteUrl + sign, '') : currentUrl.replace(sign + deleteUrl, ''); - $(elem).val(url); - $(elem).trigger("input"); - } else { - $(elem).val(url); - $('#bing-' + uploadName).remove(); + var currentFilename = $(elemFilenameField).val(); + + var currentUrlList = currentUrl.split(sign); + var deleteIndex = currentUrlList.indexOf(deleteUrl); + + currentUrlList.splice(deleteIndex, 1) + $(elem).val(currentUrlList.join(sign)); + $(elem).trigger("input"); + + if (currentFilename) { + + var currentFilenameList = currentFilename.split(sign); + currentFilenameList.splice(deleteIndex, 1) + + $(elemFilenameField).val(currentFilenameList.join(sign)); } + admin.msg.close(confirm); }); return false;