diff --git a/contact-center/app/src/main/resources/templates/apps/chatbot/edit.html b/contact-center/app/src/main/resources/templates/apps/chatbot/edit.html index 6d57dcdb..22a9a8d5 100644 --- a/contact-center/app/src/main/resources/templates/apps/chatbot/edit.html +++ b/contact-center/app/src/main/resources/templates/apps/chatbot/edit.html @@ -9,11 +9,6 @@ width: 400px; } -
-
-

机器人列表

-
-
@@ -129,7 +124,9 @@ title: '提示' , content: '保存成功' }); - location.href = '/apps/chatbot/index.html'; + parent.init(); + var index = parent.layer.getFrameIndex(window.name); + parent.layer.close(index); } } diff --git a/contact-center/app/src/main/resources/templates/apps/chatbot/index.html b/contact-center/app/src/main/resources/templates/apps/chatbot/index.html index 34d17d5d..c36e9904 100644 --- a/contact-center/app/src/main/resources/templates/apps/chatbot/index.html +++ b/contact-center/app/src/main/resources/templates/apps/chatbot/index.html @@ -67,7 +67,15 @@ function query(p, ps) { request('chatbot?p=' + (p || 1) + '&ps=' + (ps || 10), { ops: 'fetch' }).then(function (rows) { var tds = $.map(rows, function (r) { - var edit = $('编辑'); + var edit = $('编辑'); + edit.click(function () { + layer.open({ + title: '编辑机器人', + type: 2, + area: ['800px', '450px'], + content: 'edit.html?id=' + r.id + }) + }); var remove = $('删除').click(function () { var lindex = layer.confirm('请确认是否删除?', { @@ -75,7 +83,7 @@ }, function () { console.log('ok', r.id) window.remove(r.id); - window.init(); + layer.close(lindex); }, function () { console.log('cancel', r.id) @@ -105,7 +113,9 @@ } function remove(id) { - return request('chatbot', { ops: 'delete', id: id }) + return request('chatbot', { ops: 'delete', id: id }).then(function () { + window.init(); + }) } function change(id, isEnabled) { @@ -113,7 +123,12 @@ } function showCreate() { - location.href = '/apps/chatbot/edit.html'; + layer.open({ + title: '新建机器人', + type: 2, + area: ['800px', '450px'], + content: 'edit.html' + }) } function init() {