Authored by 马力

Merge branch 'hotfix_资源位增加查看功能'

... ... @@ -14,7 +14,7 @@ module.exports=function(app) {
});
/*资源内容管理页*/
app.get("/resource/content/index/:param","resource.resourceManage.ContentManage", "resourceManage_getUrlAction", function (response) {
app.get("/resource/content/index/:param/:param","resource.resourceManage.ContentManage", "resourceManage_getUrlAction", function (response) {
this.$extend = {
data:response.data,
moduleName: "资源管理",
... ...
... ... @@ -13,6 +13,8 @@ var currIndex = 0;
var lockStatus = 0;
//资源id
var param = location.href.substring(location.href.lastIndexOf("/") + 1);
//0:查看1:编辑
var lock_type = location.href.substring(location.href.lastIndexOf("/")-1,location.href.lastIndexOf("/"));
common.util.__ajax({
url: "/resources/resContentIndex",
data: {id: param},
... ... @@ -21,13 +23,15 @@ common.util.__ajax({
resources = res.data;
console.log(resources);
}, true);
common.util.__ajax({
url: "/resources/updateLock",
data: {id: param,
if(lock_type==1){
common.util.__ajax({
url: "/resources/updateLock",
data: {id: param,
status:1},
async: false
}, function (res) {
}, true);
async: false
}, function (res) {
}, true);
}
/*配置模块*/
var edit = new common.edit2(".modal-body", {
... ... @@ -449,6 +453,16 @@ $(document).on("change", ".observe", function () {
});
});
window.onbeforeunload = function(){
if(lock_type==1){
common.util.__ajax({
url: "/resources/updateLock",
data: {id: param,
status:0}
}, function () {
});
}
}
/*删除*/
$(document).on("click", ".del", function () {//删除
if(!checkLockStatus()){
... ... @@ -580,6 +594,10 @@ function dateStrToSeconds(date) {
function checkLockStatus(){
if(lock_type==0){
common.util.__tip("请点击内容编辑进行操作");
return false;
}
common.util.__ajax({
url: "/resources/checkLock",
data: {id: param},
... ... @@ -736,6 +754,9 @@ $(document).on("change", ".preTimes", function() {
});
//删除tab
$(document).on("click", "#delTab", function() {
if(!checkLockStatus()){
return false;
}
if(times[currIndex].status == "进行中") {
common.util.__tip("进行中的页面不能删除");
return false;
... ... @@ -1594,4 +1615,4 @@ function validateRollingOverContent(data) {
}
return errArr;
}
\ No newline at end of file
}
... ...
... ... @@ -58,7 +58,8 @@ var g = new common.grid({
}},
{display: "操作", name: "",render: function(item) {
var arr = [];
arr.push('<a target="_blank" class="btn btn-xs btn-info contentManage" data-index="' + item.__index + '" href="/resource/content/index/' + item.id + '">内容管理</a>');
arr.push('<a target="_blank" class="btn btn-xs btn-info contentManage" data-index="' + item.__index + '" href="/resource/content/index/0/' + item.id + '">内容查看</a>');
arr.push('<a target="_blank" class="btn btn-xs btn-primary add" data-index="' + item.__index + '" href="/resource/content/index/1/' + item.id + '">内容编辑</a>');
arr.push('<a class="btn btn-xs btn-primary add2" data-index="' + item.__index + '">编辑</a>');
arr.push('<a class="btn btn-xs btn-danger delbtn" data-index="' + item.__index + '">删除</a>');
if(item.lockPersonName !=''){
... ...