mirror of
https://gitlab.52pay.top/go/easygoadmin.git
synced 2025-09-27 18:54:14 +08:00
修复多图片组件出错问题
This commit is contained in:
@@ -60,7 +60,7 @@ layui.extend({
|
|||||||
" </div>\n" +
|
" </div>\n" +
|
||||||
" </div>\n" +
|
" </div>\n" +
|
||||||
" <div class=\"layui-col-xs3\">\n" +
|
" <div class=\"layui-col-xs3\">\n" +
|
||||||
" <button class=\"layui-btn layui-btn-fluid\" cropper-event=\"confirmSave\" type=\"button\"> 保存修改</button>\n" +
|
" <button class=\"layui-btn layui-btn-fluid\" cropper-event=\"confirmSave\" b-name=\"" + name + "\" type=\"button\"> 保存修改</button>\n" +
|
||||||
" </div>\n" +
|
" </div>\n" +
|
||||||
" </div>\n" +
|
" </div>\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
@@ -91,8 +91,12 @@ layui.extend({
|
|||||||
});
|
});
|
||||||
$(".layui-btn").on('click', function () {
|
$(".layui-btn").on('click', function () {
|
||||||
var event = $(this).attr("cropper-event");
|
var event = $(this).attr("cropper-event");
|
||||||
|
var bName = $(this).attr("b-name")
|
||||||
//监听确认保存图像
|
//监听确认保存图像
|
||||||
if (event === 'confirmSave') {
|
if (event === 'confirmSave') {
|
||||||
|
if (bName !== name) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
image.cropper("getCroppedCanvas", {
|
image.cropper("getCroppedCanvas", {
|
||||||
width: saveW,
|
width: saveW,
|
||||||
height: saveH
|
height: saveH
|
||||||
@@ -109,7 +113,7 @@ layui.extend({
|
|||||||
processData: false,
|
processData: false,
|
||||||
contentType: false,
|
contentType: false,
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
if (result.code == 0) {
|
if (result.code === 0) {
|
||||||
//关闭提示层
|
//关闭提示层
|
||||||
layer.close(index);
|
layer.close(index);
|
||||||
layer.msg(result.msg, {icon: 1});
|
layer.msg(result.msg, {icon: 1});
|
||||||
|
Reference in New Issue
Block a user