创建时翻译
This commit is contained in:
@@ -66,23 +66,43 @@
|
||||
let $ = layui.jquery;
|
||||
let popup = layui.popup;
|
||||
|
||||
form.on('submit(save)', function(data) {
|
||||
$.ajax({
|
||||
// form.on('submit(save)', function(data) {
|
||||
// console.log('submit');
|
||||
// $.ajax({
|
||||
// url: '/app/admin/location/insert',
|
||||
// data: JSON.stringify(data.field),
|
||||
// dataType: 'json',
|
||||
// contentType: 'application/json',
|
||||
// type: 'post',
|
||||
// success: function(result) {
|
||||
// console.log('操作成功',result);
|
||||
// if (result.code) {
|
||||
// popup.failure(result.msg);
|
||||
// } else {
|
||||
// popup.success("<?= $translations['operation_success'] ?? '操作成功' ?>", function() {
|
||||
// parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// return false;
|
||||
// });
|
||||
layui.form.on("submit(save)", function (data) {
|
||||
layui.$.ajax({
|
||||
url: '/app/admin/location/insert',
|
||||
data: JSON.stringify(data.field),
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
type: 'post',
|
||||
success: function(result) {
|
||||
if (result.code) {
|
||||
popup.failure(result.msg);
|
||||
} else {
|
||||
popup.success("<?= $translations['operation_success'] ?? '操作成功' ?>", function() {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
});
|
||||
type: "POST",
|
||||
dateType: "json",
|
||||
data: data.field,
|
||||
success: function (res) {
|
||||
if (res.code) {
|
||||
return layui.popup.failure(res.msg);
|
||||
}
|
||||
return layui.popup.success("操作成功", function () {
|
||||
parent.refreshTable();
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
return false;
|
||||
});
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user