This commit is contained in:
chenyang
2022-07-02 08:52:08 +08:00
parent 0a244b34cc
commit 43e1402c74
6 changed files with 132 additions and 52 deletions
+19 -11
View File
@@ -8,6 +8,7 @@
<link rel="stylesheet" href="/static/layui-v2.6.8/layui/css/layui.css" media="all">
<script src="/static/layui-v2.6.8/layui/layui.js"></script>
<script src="/static/js/jquery-1.11.3.min.js"></script>
<script src="https://cdn.staticfile.org/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
<script>
let layer //弹层
, laypage //分页
@@ -241,17 +242,24 @@
}
// post start
const post_data = {'mind_name': mind_name, 'data_format': 'node_tree', 'snapshot_data': view.json2string(snapshot_data)}
$.post('create', post_data, function (resp) {
layer.closeAll()
view.fetch_data()
layer.msg('创建成功')
// 新页面打开
setTimeout(function () {
const id = resp.data
window.open('detail?id=' + id)
}, 500)
})
$.ajax({
type: "post",
url: "create",
headers: {"X-CSRFToken": $.cookie("csrftoken")},
data: post_data,
dataType: "json",
success: function (resp) {
layer.closeAll()
view.fetch_data()
layer.msg('创建成功')
// 新页面打开
setTimeout(function () {
const id = resp.data
window.open('detail?id=' + id)
}, 500)
},
async: false
});
// post end
} else {
layer.msg('请输入导图名称')