Authored by wangwei

资源位关闭内容编辑页,自动解除锁定

@@ -33,7 +33,6 @@ if(lock_type==1){ @@ -33,7 +33,6 @@ if(lock_type==1){
33 }, true); 33 }, true);
34 } 34 }
35 35
36 -  
37 /*配置模块*/ 36 /*配置模块*/
38 var edit = new common.edit2(".modal-body", { 37 var edit = new common.edit2(".modal-body", {
39 bucket: "yhb-img01" 38 bucket: "yhb-img01"
@@ -454,6 +453,16 @@ $(document).on("change", ".observe", function () { @@ -454,6 +453,16 @@ $(document).on("change", ".observe", function () {
454 }); 453 });
455 }); 454 });
456 455
  456 +window.onbeforeunload = function(){
  457 + if(lock_type==1){
  458 + common.util.__ajax({
  459 + url: "/resources/updateLock",
  460 + data: {id: param,
  461 + status:0}
  462 + }, function () {
  463 + });
  464 + }
  465 +}
457 /*删除*/ 466 /*删除*/
458 $(document).on("click", ".del", function () {//删除 467 $(document).on("click", ".del", function () {//删除
459 if(!checkLockStatus()){ 468 if(!checkLockStatus()){
@@ -1603,4 +1612,4 @@ function validateRollingOverContent(data) { @@ -1603,4 +1612,4 @@ function validateRollingOverContent(data) {
1603 } 1612 }
1604 1613
1605 return errArr; 1614 return errArr;
1606 -}  
  1615 +}
@@ -59,7 +59,7 @@ var g = new common.grid({ @@ -59,7 +59,7 @@ var g = new common.grid({
59 {display: "操作", name: "",render: function(item) { 59 {display: "操作", name: "",render: function(item) {
60 var arr = []; 60 var arr = [];
61 arr.push('<a target="_blank" class="btn btn-xs btn-info contentManage" data-index="' + item.__index + '" href="/resource/content/index/0/' + item.id + '">内容查看</a>'); 61 arr.push('<a target="_blank" class="btn btn-xs btn-info contentManage" data-index="' + item.__index + '" href="/resource/content/index/0/' + item.id + '">内容查看</a>');
62 - arr.push('<a target="_blank" class="btn btn-xs btn-primary add2" data-index="' + item.__index + '" href="/resource/content/index/1/' + item.id + '">内容编辑</a>'); 62 + arr.push('<a target="_blank" class="btn btn-xs btn-primary add" data-index="' + item.__index + '" href="/resource/content/index/1/' + item.id + '">内容编辑</a>');
63 arr.push('<a class="btn btn-xs btn-primary add2" data-index="' + item.__index + '">编辑</a>'); 63 arr.push('<a class="btn btn-xs btn-primary add2" data-index="' + item.__index + '">编辑</a>');
64 arr.push('<a class="btn btn-xs btn-danger delbtn" data-index="' + item.__index + '">删除</a>'); 64 arr.push('<a class="btn btn-xs btn-danger delbtn" data-index="' + item.__index + '">删除</a>');
65 if(item.lockPersonName !=''){ 65 if(item.lockPersonName !=''){