在线编辑保存时增加询问
This commit is contained in:
parent
1f36630a34
commit
00c56759e5
@ -1 +1 @@
|
||||
3.9.43beta6
|
||||
3.9.43beta7
|
||||
@ -213,6 +213,11 @@ function f(){
|
||||
});
|
||||
//监听提交
|
||||
form.on('submit(saveBtn)', function (data) {
|
||||
layer.confirm('确认保存?', {
|
||||
title: "操作提示",
|
||||
icon: 0,
|
||||
btn: ['确定']
|
||||
} ,function(index){
|
||||
let txt = editor.getValue();
|
||||
// console.log(txt);
|
||||
let postData = {
|
||||
@ -232,6 +237,9 @@ function f(){
|
||||
layer.msg(ret.msg);
|
||||
}
|
||||
});
|
||||
|
||||
layer.close(index);
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
@ -123,25 +123,34 @@
|
||||
});
|
||||
//监听提交
|
||||
form.on('submit(saveBtn)', function (data) {
|
||||
layer.confirm('确认保存?', {
|
||||
title: "操作提示",
|
||||
icon: 0,
|
||||
btn: ['确定']
|
||||
} ,function(index){
|
||||
let txt = $('#script_code').val();
|
||||
// console.log(txt);
|
||||
let postData = {
|
||||
name:'{{name}}',
|
||||
code:txt,
|
||||
name: '{{name}}',
|
||||
code: txt,
|
||||
// code:txt.replaceAll("+","&").replaceAll("console.log","console.Log")
|
||||
}
|
||||
// console.log(postData);
|
||||
$.ajax({
|
||||
type:'post',
|
||||
url:api_save_url,
|
||||
data:postData,
|
||||
dataType:'json',
|
||||
async:false,
|
||||
success:function (ret) {
|
||||
type: 'post',
|
||||
url: api_save_url,
|
||||
data: postData,
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
success: function (ret) {
|
||||
console.log(ret);
|
||||
layer.msg(ret.msg);
|
||||
}
|
||||
});
|
||||
|
||||
layer.close(index);
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user