From fd92c9d9cc2314d10ee659f208abd04861fd3c52 Mon Sep 17 00:00:00 2001 From: shuzheng <469741414@qq.com> Date: Sun, 19 Feb 2017 10:21:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BB=84=E7=BB=87=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsp/manage/organization/create.jsp | 92 +++++++++++++ .../WEB-INF/jsp/manage/organization/index.jsp | 121 ++++++++++-------- .../jsp/manage/organization/update.jsp | 92 +++++++++++++ 3 files changed, 252 insertions(+), 53 deletions(-) create mode 100644 zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/organization/create.jsp create mode 100644 zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/organization/update.jsp diff --git a/zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/organization/create.jsp b/zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/organization/create.jsp new file mode 100644 index 00000000..be0108a4 --- /dev/null +++ b/zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/organization/create.jsp @@ -0,0 +1,92 @@ +<%@ page contentType="text/html; charset=utf-8"%> +<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> +<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%> +<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%> +<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %> + +
+
+
+ + +
+
+ + +
+
+ 保存 + 取消 +
+
+
+ \ No newline at end of file diff --git a/zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/organization/index.jsp b/zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/organization/index.jsp index f2e1aa33..ff239de5 100644 --- a/zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/organization/index.jsp +++ b/zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/organization/index.jsp @@ -29,19 +29,6 @@
- - @@ -82,15 +69,12 @@ $(function() { maintainSelected: true, toolbar: '#toolbar', columns: [ - {field: 'state', checkbox: true}, + {field: 'ck', checkbox: true}, {field: 'organizationId', title: '编号', sortable: true, align: 'center'}, {field: 'name', title: '组织名称'}, {field: 'description', title: '组织描述'}, {field: 'action', title: '操作', align: 'center', formatter: 'actionFormatter', events: 'actionEvents', clickToSelect: false} ] - }).on('all.bs.table', function (e, name, args) { - $('[data-toggle="tooltip"]').tooltip(); - $('[data-toggle="popover"]').popover(); }); }); // 格式化操作按钮 @@ -101,34 +85,22 @@ function actionFormatter(value, row, index) { ].join(''); } // 新增 +var createDialog; function createAction() { - $.confirm({ - type: 'dark', + createDialog = $.dialog({ animationSpeed: 300, title: '新增组织', - content: $('#createDialog').html(), - buttons: { - confirm: { - text: '确认', - btnClass: 'waves-effect waves-button', - action: function () { - $.alert('确认'); - } - }, - cancel: { - text: '取消', - btnClass: 'waves-effect waves-button' - } - } + content: 'url:${basePath}/manage/organization/create' }); } // 编辑 +var updateDialog; function updateAction() { var rows = $table.bootstrapTable('getSelections'); - if (rows.length == 0) { + if (rows.length != 1) { $.confirm({ title: false, - content: '请至少选择一条记录!', + content: '请选择一条记录!', autoClose: 'cancel|3000', backgroundDismiss: true, buttons: { @@ -139,28 +111,15 @@ function updateAction() { } }); } else { - $.confirm({ - type: 'blue', + updateDialog = $.dialog({ animationSpeed: 300, title: '编辑组织', - content: $('#createDialog').html(), - buttons: { - confirm: { - text: '确认', - btnClass: 'waves-effect waves-button', - action: function () { - $.alert('确认'); - } - }, - cancel: { - text: '取消', - btnClass: 'waves-effect waves-button' - } - } + content: 'url:${basePath}/manage/organization/update/' + rows[0].organizationId }); } } // 删除 +var deleteDialog; function deleteAction() { var rows = $table.bootstrapTable('getSelections'); if (rows.length == 0) { @@ -177,7 +136,7 @@ function deleteAction() { } }); } else { - $.confirm({ + deleteDialog = $.confirm({ type: 'red', animationSpeed: 300, title: false, @@ -191,7 +150,63 @@ function deleteAction() { for (var i in rows) { ids.push(rows[i].organizationId); } - $.alert('删除:id=' + ids.join("-")); + $.ajax({ + type: 'get', + url: '${basePath}/manage/organization/delete/' + ids.join("-"), + success: function(result) { + if (result.code != 1) { + if (result.data instanceof Array) { + $.each(result.data, function(index, value) { + $.confirm({ + theme: 'dark', + animation: 'rotateX', + closeAnimation: 'rotateX', + title: false, + content: value.errorMsg, + buttons: { + confirm: { + text: '确认', + btnClass: 'waves-effect waves-button waves-light' + } + } + }); + }); + } else { + $.confirm({ + theme: 'dark', + animation: 'rotateX', + closeAnimation: 'rotateX', + title: false, + content: result.data.errorMsg, + buttons: { + confirm: { + text: '确认', + btnClass: 'waves-effect waves-button waves-light' + } + } + }); + } + } else { + deleteDialog.close(); + $table.bootstrapTable('refresh'); + } + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + $.confirm({ + theme: 'dark', + animation: 'rotateX', + closeAnimation: 'rotateX', + title: false, + content: textStatus, + buttons: { + confirm: { + text: '确认', + btnClass: 'waves-effect waves-button waves-light' + } + } + }); + } + }); } }, cancel: { diff --git a/zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/organization/update.jsp b/zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/organization/update.jsp new file mode 100644 index 00000000..605126a9 --- /dev/null +++ b/zheng-upms/zheng-upms-server/src/main/webapp/WEB-INF/jsp/manage/organization/update.jsp @@ -0,0 +1,92 @@ +<%@ page contentType="text/html; charset=utf-8"%> +<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> +<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%> +<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%> +<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %> + +
+
+
+ + +
+
+ + +
+
+ 保存 + 取消 +
+
+
+ \ No newline at end of file