fix(#IXTRN): 删除操作日志丢失
#Comment comment #IXTRN link commit:8b8112a5e4b41bc70f485c5023bdf2394add0739 #Issue close https://gitee.com/LongbowEnterprise/dashboard/issues?id=IXTRN
This commit is contained in:
parent
ab8c31f251
commit
90559cb107
|
@ -8,10 +8,6 @@
|
|||
e.data.handler.call(that);
|
||||
});
|
||||
}
|
||||
$('body').on('click', '.sweet-alert button.confirm', function(e) {
|
||||
if($.logData.length > 0)
|
||||
that.log({ crud: '删除' });
|
||||
});
|
||||
};
|
||||
|
||||
logPlugin.settings = {
|
||||
|
@ -54,7 +50,7 @@
|
|||
this.log({ crud: '删除头像' });
|
||||
},
|
||||
'button[data-method="title"]': function () {
|
||||
this.log({ crud: '保存网站标题'});
|
||||
this.log({ crud: '保存网站标题' });
|
||||
},
|
||||
'button[data-method="footer"]': function () {
|
||||
this.log({ crud: '保存网站页脚' });
|
||||
|
@ -80,8 +76,16 @@
|
|||
}
|
||||
};
|
||||
|
||||
$.extend({ logPlugin: function (options) { return new logPlugin(options); } });
|
||||
$.extend({
|
||||
logPlugin: function (options) {
|
||||
if (!window.logPlugin) window.logPlugin = new logPlugin(options);
|
||||
return window.logPlugin;
|
||||
}
|
||||
});
|
||||
$.logData = [];
|
||||
$.logData.log = function () {
|
||||
$.logPlugin().log({ crud: '删除数据' });
|
||||
};
|
||||
})(jQuery);
|
||||
|
||||
$(function () {
|
||||
|
|
|
@ -208,7 +208,8 @@
|
|||
xhrFields: { withCredentials: true },
|
||||
crossDomain: true
|
||||
});
|
||||
if ($.isArray($.logData) && !$.isEmptyObject(options.data) && options.method !== 'delete') $.logData.push({ url: url, data: options.data });
|
||||
if ($.isArray($.logData) && !$.isEmptyObject(options.data)) $.logData.push({ url: url, data: options.method === 'delete' ? options.logData : options.data });
|
||||
if (options.method === 'delete') $.logData.log();
|
||||
$.ajax(ajaxSettings);
|
||||
},
|
||||
lgbSwal: function (options) {
|
||||
|
|
|
@ -168,23 +168,18 @@
|
|||
else {
|
||||
swal($.extend({}, swalDeleteOptions)).then((result) => {
|
||||
if (result.value) {
|
||||
$.logData.push({
|
||||
url: options.url,
|
||||
data: arrselections.map(function (element, index) {
|
||||
return formatData($.extend({}, element));
|
||||
})
|
||||
var logData = arrselections.map(function (element, index) {
|
||||
return formatData($.extend({}, element));
|
||||
});
|
||||
var idField = findIdField(options.bootstrapTable);
|
||||
var iDs = arrselections.map(function (element, index) { return element[idField]; });
|
||||
$.bc({
|
||||
url: options.url, data: iDs, method: 'delete', title: options.delTitle, logData: logData,
|
||||
callback: function (result) {
|
||||
if (result) $(options.bootstrapTable).bootstrapTable('refresh');
|
||||
handlerCallback.call(that, null, element, { oper: 'del', success: result });
|
||||
}
|
||||
});
|
||||
setTimeout(function () {
|
||||
var idField = findIdField(options.bootstrapTable);
|
||||
var iDs = arrselections.map(function (element, index) { return element[idField]; });
|
||||
$.bc({
|
||||
url: options.url, data: iDs, method: 'delete', title: options.delTitle,
|
||||
callback: function (result) {
|
||||
if (result) $(options.bootstrapTable).bootstrapTable('refresh');
|
||||
handlerCallback.call(that, null, element, { oper: 'del', success: result });
|
||||
}
|
||||
});
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -239,20 +234,17 @@
|
|||
}
|
||||
swal($.extend({}, swalDeleteOptions, { html: text })).then((result) => {
|
||||
if (result.value) {
|
||||
$.logData.push({ url: op.url, data: data });
|
||||
setTimeout(function () {
|
||||
var idField = findIdField(op.table);
|
||||
var iDs = data.map(function (element, index) {
|
||||
return element[idField];
|
||||
});
|
||||
$.bc({
|
||||
url: op.url, data: iDs, method: 'delete', title: '删除数据',
|
||||
callback: function (result) {
|
||||
if (result) $(op.table).bootstrapTable('refresh');
|
||||
handlerCallback.call(op.src, null, e, { oper: 'del', success: result });
|
||||
}
|
||||
});
|
||||
}, 100);
|
||||
var idField = findIdField(op.table);
|
||||
var iDs = data.map(function (element, index) {
|
||||
return element[idField];
|
||||
});
|
||||
$.bc({
|
||||
url: op.url, data: iDs, method: 'delete', title: '删除数据', logData: data,
|
||||
callback: function (result) {
|
||||
if (result) $(op.table).bootstrapTable('refresh');
|
||||
handlerCallback.call(op.src, null, e, { oper: 'del', success: result });
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue