From 557607b06a1d264ec34e2837f5812c5ec81fefbc Mon Sep 17 00:00:00 2001 From: Hai Liang Wang Date: Wed, 17 Oct 2018 17:05:00 +0800 Subject: [PATCH] =?UTF-8?q?#90=20=E5=A2=9E=E5=8A=A0=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/templates/apps/chatbot/edit.html | 13 ++++++++++--- .../resources/templates/apps/chatbot/index.html | 17 ++++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) 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 0fac1877..12a52047 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 @@ -116,7 +116,7 @@ if (data.rc == 0) { cb(null, data.data); } else { - cb(data.error); + cb(data.data); } }) .fail(function (jqXHR, textStatus) { @@ -129,10 +129,17 @@ var form = layui.form(); form.on('submit(save)', function (data) { var field = data.field; - var submitFinish = function (err, bot) { if (err) { - console.error(err); + layer.confirm(err.data||err.error, { + btn: ['关闭'], + icon: 2, + title: '提示' + }, function (popup, layero) { + layer.close(popup) + }, function (popup) { + // 取消方法 + }); } else { layer.open({ title: '提示' 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 8b67d65b..dcbbe354 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 @@ -68,7 +68,7 @@ if (data.rc == 0) { resolve(data.data); } else { - reject(data.error); + reject(data); } }) .fail(function (jqXHR, textStatus) { @@ -107,7 +107,18 @@ var isEnabled = $(''); isEnabled.change(function () { - change(r.id, $(this).find('input').prop('checked')); + change(r.id, $(this).find('input').prop('checked')) + .then(null, function(err){ + layer.confirm(err.data||err.error, { + btn: ['关闭'], + icon: 2, + title: '提示' + }, function (index, layero) { + layer.close(index) + }, function (index) { + // 取消方法 + }); + }); }) var rows = [ @@ -146,7 +157,7 @@ } function init() { - query(1, 10); + query(1, 50); } layui.use(['form'], function () {