-
-
上侧弹层内容...
+
+
+
+
+
+
+
-
-
-
+ form.on('switch(user-enable)', function(obj) {
+ layer.tips(this.value + ' ' + this.name + ':' + obj.elem.checked, obj.othis);
+ });
+
+ window.add = function() {
+ drawer.open({
+ direction: "top",
+ dom: ".layer-top",
+ distance: "30%"
+ });
+ }
+
+ window.edit = function(obj) {
+ layer.msg("修改");
+ }
+
+ window.remove = function(obj) {
+ layer.confirm('确定要删除该用户', {
+ icon: 3,
+ title: '提示'
+ }, function(index) {
+ layer.close(index);
+ let loading = layer.load();
+ $.ajax({
+ url: MODULE_PATH + "remove/" + obj.data['userId'],
+ dataType: 'json',
+ type: 'delete',
+ success: function(result) {
+ layer.close(loading);
+ if (result.success) {
+ layer.msg(result.msg, {
+ icon: 1,
+ time: 1000
+ }, function() {
+ obj.del();
+ });
+ } else {
+ layer.msg(result.msg, {
+ icon: 2,
+ time: 1000
+ });
+ }
+ }
+ })
+ });
+ }
+
+ window.batchRemove = function(obj) {
+ let data = table.checkStatus(obj.config.id).data;
+ if (data.length === 0) {
+ layer.msg("未选中数据", {
+ icon: 3,
+ time: 1000
+ });
+ return false;
+ }
+ let ids = "";
+ for (let i = 0; i < data.length; i++) {
+ ids += data[i].userId + ",";
+ }
+ ids = ids.substr(0, ids.length - 1);
+ layer.confirm('确定要删除这些用户', {
+ icon: 3,
+ title: '提示'
+ }, function(index) {
+ layer.close(index);
+ let loading = layer.load();
+ $.ajax({
+ url: MODULE_PATH + "batchRemove/" + ids,
+ dataType: 'json',
+ type: 'delete',
+ success: function(result) {
+ layer.close(loading);
+ if (result.success) {
+ layer.msg(result.msg, {
+ icon: 1,
+ time: 1000
+ }, function() {
+ table.reload('user-table');
+ });
+ } else {
+ layer.msg(result.msg, {
+ icon: 2,
+ time: 1000
+ });
+ }
+ }
+ })
+ });
+ }
+
+ window.refresh = function(param) {
+ table.reload('user-table');
+ }
+ })
+
+