dever 6 years ago
parent
commit
810ef6df61
3 changed files with 43 additions and 9 deletions
  1. 24 4
      assets/lib/layui/admin/lib/admin.js
  2. 18 4
      assets/lib/manage/main.js
  3. 1 1
      assets/lib/pnotify/pnotify.css

+ 24 - 4
assets/lib/layui/admin/lib/admin.js

@@ -6,7 +6,8 @@
  @License:LPPL
     
  */
- 
+config.history_link = '';
+config.history_text = '';
 layui.define('view', function(exports){
   var $ = layui.jquery
   ,laytpl = layui.laytpl
@@ -470,7 +471,25 @@ layui.define('view', function(exports){
     
     //返回上一页
     ,back: function(){
-      history.back();
+      //history.back();
+      history.go(-1);
+      return;
+      if (config.history_link) {
+        var btn = $(".layadmin-iframe").contents().find(".btn-danger");
+        if (btn.length) {
+          var link = btn.attr('href');
+          //$('.layadmin-iframe').attr('src', btn.attr('href'));
+        } else {
+          //$('.layadmin-iframe').attr('src', config.history_link);
+          var link = config.history_link;
+        }
+
+        var text = config.history_text;
+        var topLayui = parent === self ? layui : top.layui;
+        topLayui.index.openTabsPage(link, text);
+      } else {
+        history.go(-1);
+      }
     }
     
     //主题设置
@@ -776,10 +795,11 @@ layui.define('view', function(exports){
     
     admin.tabsPage.elem = othis;
     //admin.prevRouter[router.path[0]] = router.href; //记录上一次各菜单的路由信息
-
+    config.history_link = href;
+    config.history_text = text || othis.text();
     //执行跳转
     var topLayui = parent === self ? layui : top.layui;
-    topLayui.index.openTabsPage(href, text || othis.text());
+    topLayui.index.openTabsPage(href, config.history_text);
   });
   
   //点击事件

+ 18 - 4
assets/lib/manage/main.js

@@ -395,7 +395,7 @@ function loadEditorParam(e)
 		        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
 		        'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
 		        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
-		        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage' ,'media','table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
+		        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage','table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
 		        'anchor', 'link', 'unlink'
 		]
 		//media
@@ -658,7 +658,7 @@ function update(e, id, project, table, notice)
 			var t = eval('('+t+')');
 			if (t.status == 1) {
 				e.attr('data-old', value);
-				notify('操作已成功!您的操作已修改当前选项!');
+				notify('操作已成功!您的操作已修改当前选项!', e);
 				preview();
 			} else {
 				msg(t);
@@ -680,8 +680,17 @@ function update(e, id, project, table, notice)
 	}
 }
 
-function notify(msg)
+function notify(msg, e)
 {
+	if (!e) {
+		layer.msg(msg);
+		return;
+	}
+	layer.tips(msg, e, {
+	  tips: [1, '#3595CC']
+	});
+
+	/*
 	var notice = new PNotify({
 		title: '提示信息',
 		text: msg,
@@ -693,6 +702,7 @@ function notify(msg)
 	notice.get().click(function() {
 		notice.remove();
 	});
+	*/
 }
 
 //模板选择
@@ -1436,7 +1446,7 @@ function edit()
 						
 						$.post(url, {project:project,table:table,value:value,where_id:id,col:col}, function(t)
 						{
-							notify('修改成功');
+							notify('修改成功', self);
 
 							preview();
 							/*
@@ -2305,6 +2315,10 @@ var dever_update =
 		{
 			self.index[key] = 0;
 		}
+
+		if (isNaN(self.index[key])) {
+			self.index[key] = 0;
+		}
 		
 		if(self.index[key] <= 0)
 		{

+ 1 - 1
assets/lib/pnotify/pnotify.css

@@ -15,7 +15,7 @@ body > .ui-pnotify {
     /* Notices in the body context should be fixed to the viewport. */
     position: fixed;
     /* Ensures notices are above everything */
-    z-index: 100040;
+    z-index: 1000400000;
 }
 .ui-pnotify-modal-overlay {
     background-color: rgba(0, 0, 0, .4);