...
|
...
|
@@ -185,9 +185,14 @@ var Bll = { |
|
|
|
|
|
}
|
|
|
};
|
|
|
|
|
|
var statusArr = ["已过期", "进行中", "未发布"];
|
|
|
for(var i = 0; i < resources.length; i++) {
|
|
|
times[i] = Bll.getLocalTime(resources[i].resource.publishTime);
|
|
|
//status 0:已过期;1:进行中;2:未发布
|
|
|
var time = resources[i].resource.publishTime==0?"":Bll.getLocalTime(resources[i].resource.publishTime);
|
|
|
times[i] = {
|
|
|
time:time,
|
|
|
status:statusArr[resources[i].status]
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/*第一步,基础模板*/
|
...
|
...
|
@@ -269,7 +274,7 @@ $(document).on("click", ".del", function () {//删除 |
|
|
/*编辑*/
|
|
|
$(document).on("click", ".edit", function () {
|
|
|
var index = $(this).data("index");
|
|
|
var item = Bll.contentDatas[index];
|
|
|
var item = Bll.contentDatas[currIndex][index];
|
|
|
Bll.module = $.extend(true, {}, item);
|
|
|
Bll.toast(index, Bll.module);
|
|
|
});
|
...
|
...
|
@@ -391,19 +396,27 @@ $(document).on("click", "#copyTab", function() { |
|
|
url: "/resources/copyResContent",
|
|
|
data: {rId:resources[currIndex].resource.id}
|
|
|
}, function (res) {
|
|
|
window.location.href = window.location.href;
|
|
|
setTimeout(function() {
|
|
|
window.location.href = window.location.href;
|
|
|
}, 2000);
|
|
|
});
|
|
|
});
|
|
|
//保存时间
|
|
|
$(document).on("click", "#saveTime", function() {
|
|
|
if(!times[currIndex].time) {
|
|
|
common.util.__tip("该页面不能保存时间");
|
|
|
return;
|
|
|
}
|
|
|
common.util.__ajax({
|
|
|
url: "/resources/updateResPublishTime",
|
|
|
data: {
|
|
|
id:resources[currIndex].resource.id,
|
|
|
time:times[currIndex]
|
|
|
time:times[currIndex].time
|
|
|
}
|
|
|
}, function (res) {
|
|
|
window.location.href = window.location.href;
|
|
|
setTimeout(function() {
|
|
|
window.location.href = window.location.href;
|
|
|
}, 2000);
|
|
|
});
|
|
|
});
|
|
|
new common.edit2("#times-list").init();
|
...
|
...
|
@@ -411,26 +424,37 @@ new common.edit2("#times-list").init(); |
|
|
$(document).on("click", ".timesLi", function() {
|
|
|
if(!$(this).hasClass("active")) {
|
|
|
$(this).addClass("active").siblings().removeClass("active");
|
|
|
var index = $(this).data("index");
|
|
|
currIndex = index;
|
|
|
currIndex = $(this).data("index");
|
|
|
Bll.__render("#add-content", "template_content", {modules: Bll.contentDatas[currIndex]});
|
|
|
Bll.__render("#times-list", "times-template", {times: times, selected: index});
|
|
|
Bll.__render("#times-list", "times-template", {times: times, selected: currIndex});
|
|
|
new common.edit2("#times-list").init();
|
|
|
}
|
|
|
});
|
|
|
$(document).on("change", ".preTimes", function() {
|
|
|
times[$(this).data("index")] = $(this).val();
|
|
|
console.log(times);
|
|
|
times[$(this).data("index")].time = $(this).val();
|
|
|
});
|
|
|
//删除tab
|
|
|
$(document).on("click", "#delTab", function() {
|
|
|
common.util.__ajax({
|
|
|
url: "/resources/deleteResourceById",
|
|
|
data: {
|
|
|
id:resources[currIndex].resource.id
|
|
|
}
|
|
|
}, function (res) {
|
|
|
window.location.href = window.location.href;
|
|
|
if(times[currIndex].status == "进行中") {
|
|
|
common.util.__tip("进行中的页面不能删除");
|
|
|
return false;
|
|
|
}
|
|
|
if(!times[currIndex].time) {
|
|
|
common.util.__tip("该页面不能删除");
|
|
|
return false;
|
|
|
}
|
|
|
common.dialog.confirm("警告", "确定取消" + times[currIndex].time + "发布的页面吗?",function() {
|
|
|
common.util.__ajax({
|
|
|
url: "/resources/deleteResourceById",
|
|
|
data: {
|
|
|
id: resources[currIndex].resource.id
|
|
|
}
|
|
|
}, function (res) {
|
|
|
setTimeout(function() {
|
|
|
window.location.href = window.location.href;
|
|
|
}, 2000);
|
|
|
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
|
...
|
...
|
@@ -655,21 +679,4 @@ $(document).on("mouseover", "#add-content .dragItem", function () { |
|
|
});
|
|
|
$(document).on("mouseleave", "#add-content .dragItem", function () {
|
|
|
new common.drag("#add-content").destroy();
|
|
|
});
|
|
|
|
|
|
/*
|
|
|
$(document).on("mouseover","#sortable .dragItem",function(){
|
|
|
//console.log(Bll.module.contentData.data.list);
|
|
|
var drag = new common.drag("#sortable", Bll.module.contentData.data.list, function(data){
|
|
|
Bll.module.contentData.data.list = data;
|
|
|
console.log(Bll.module.contentData);
|
|
|
console.log(Bll.module);
|
|
|
Bll.renderDialog("paramsGroup-template");
|
|
|
//Bll.__render("#sortable","paramsGroup-template",{modules:Bll.module});
|
|
|
})
|
|
|
drag.Initialize();
|
|
|
});
|
|
|
$(document).on("mouseleave","#sortable .dragItem",function(){
|
|
|
new common.drag("#sortable").destroy();
|
|
|
});
|
|
|
*/ |
|
|
}); |
|
|
\ No newline at end of file |
...
|
...
|
|