|
@@ -13,6 +13,8 @@ var currIndex = 0; |
|
@@ -13,6 +13,8 @@ var currIndex = 0; |
13
|
var lockStatus = 0;
|
13
|
var lockStatus = 0;
|
14
|
//资源id
|
14
|
//资源id
|
15
|
var param = location.href.substring(location.href.lastIndexOf("/") + 1);
|
15
|
var param = location.href.substring(location.href.lastIndexOf("/") + 1);
|
|
|
16
|
+//0:查看1:编辑
|
|
|
17
|
+var lock_type = location.href.substring(location.href.lastIndexOf("/")-1,location.href.lastIndexOf("/"));
|
16
|
common.util.__ajax({
|
18
|
common.util.__ajax({
|
17
|
url: "/resources/resContentIndex",
|
19
|
url: "/resources/resContentIndex",
|
18
|
data: {id: param},
|
20
|
data: {id: param},
|
|
@@ -21,13 +23,15 @@ common.util.__ajax({ |
|
@@ -21,13 +23,15 @@ common.util.__ajax({ |
21
|
resources = res.data;
|
23
|
resources = res.data;
|
22
|
console.log(resources);
|
24
|
console.log(resources);
|
23
|
}, true);
|
25
|
}, true);
|
24
|
-common.util.__ajax({
|
|
|
25
|
- url: "/resources/updateLock",
|
|
|
26
|
- data: {id: param,
|
26
|
+if(lock_type==1){
|
|
|
27
|
+ common.util.__ajax({
|
|
|
28
|
+ url: "/resources/updateLock",
|
|
|
29
|
+ data: {id: param,
|
27
|
status:1},
|
30
|
status:1},
|
28
|
- async: false
|
|
|
29
|
-}, function (res) {
|
|
|
30
|
-}, true);
|
31
|
+ async: false
|
|
|
32
|
+ }, function (res) {
|
|
|
33
|
+ }, true);
|
|
|
34
|
+}
|
31
|
|
35
|
|
32
|
/*配置模块*/
|
36
|
/*配置模块*/
|
33
|
var edit = new common.edit2(".modal-body", {
|
37
|
var edit = new common.edit2(".modal-body", {
|
|
@@ -449,6 +453,16 @@ $(document).on("change", ".observe", function () { |
|
@@ -449,6 +453,16 @@ $(document).on("change", ".observe", function () { |
449
|
});
|
453
|
});
|
450
|
});
|
454
|
});
|
451
|
|
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
|
+}
|
452
|
/*删除*/
|
466
|
/*删除*/
|
453
|
$(document).on("click", ".del", function () {//删除
|
467
|
$(document).on("click", ".del", function () {//删除
|
454
|
if(!checkLockStatus()){
|
468
|
if(!checkLockStatus()){
|
|
@@ -580,6 +594,10 @@ function dateStrToSeconds(date) { |
|
@@ -580,6 +594,10 @@ function dateStrToSeconds(date) { |
580
|
|
594
|
|
581
|
|
595
|
|
582
|
function checkLockStatus(){
|
596
|
function checkLockStatus(){
|
|
|
597
|
+ if(lock_type==0){
|
|
|
598
|
+ common.util.__tip("请点击内容编辑进行操作");
|
|
|
599
|
+ return false;
|
|
|
600
|
+ }
|
583
|
common.util.__ajax({
|
601
|
common.util.__ajax({
|
584
|
url: "/resources/checkLock",
|
602
|
url: "/resources/checkLock",
|
585
|
data: {id: param},
|
603
|
data: {id: param},
|
|
@@ -736,6 +754,9 @@ $(document).on("change", ".preTimes", function() { |
|
@@ -736,6 +754,9 @@ $(document).on("change", ".preTimes", function() { |
736
|
});
|
754
|
});
|
737
|
//删除tab
|
755
|
//删除tab
|
738
|
$(document).on("click", "#delTab", function() {
|
756
|
$(document).on("click", "#delTab", function() {
|
|
|
757
|
+ if(!checkLockStatus()){
|
|
|
758
|
+ return false;
|
|
|
759
|
+ }
|
739
|
if(times[currIndex].status == "进行中") {
|
760
|
if(times[currIndex].status == "进行中") {
|
740
|
common.util.__tip("进行中的页面不能删除");
|
761
|
common.util.__tip("进行中的页面不能删除");
|
741
|
return false;
|
762
|
return false;
|
|
@@ -1594,4 +1615,4 @@ function validateRollingOverContent(data) { |
|
@@ -1594,4 +1615,4 @@ function validateRollingOverContent(data) { |
1594
|
}
|
1615
|
}
|
1595
|
|
1616
|
|
1596
|
return errArr;
|
1617
|
return errArr;
|
1597
|
-} |
|
|
|
|
1618
|
+} |