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;