...
|
...
|
@@ -5,10 +5,19 @@ var $ = require('jquery'); |
|
|
var g = new common.grid({
|
|
|
el: '#help_list',
|
|
|
columns: [
|
|
|
{display: "编号", name: "name"},
|
|
|
{display: "分类名称", name: "category"},
|
|
|
{display: "显示平台", name: "paltform"},
|
|
|
{display: "时间", name: "time"},
|
|
|
{display: "编号", name: "id"},
|
|
|
{display: "分类名称", name: "categoryName"},
|
|
|
{display: "显示平台", name: "platform", render: function(item) {
|
|
|
if(item.platform != null && item.platform.trim() != "") {
|
|
|
var platform = item.platform;
|
|
|
var temp = platform.replace("iphone", "IOS手机").replace("ipad", "IOS Pad")
|
|
|
.replace("android", "安卓手机").replace("androidpad", "安卓Pad")
|
|
|
.replace("h5", "手机网站").replace("web", "网站")
|
|
|
.replace("platform", "平台").replace(/\|/g, " ");
|
|
|
return temp;
|
|
|
}
|
|
|
}},
|
|
|
{display: "时间", name: "createTime"},
|
|
|
{
|
|
|
display: "操作", name: "", render: function (item) {
|
|
|
|
...
|
...
|
@@ -21,58 +30,79 @@ var $ = require('jquery'); |
|
|
]
|
|
|
});
|
|
|
|
|
|
g.init("/operations111/helpcategory/index111");
|
|
|
g.init("/operations/helpcategory/getAllHelpCategory");
|
|
|
|
|
|
var Bll = {
|
|
|
onClick:function(arg1, arg2, arg3) {
|
|
|
var e = new common.edit("#baseform");
|
|
|
var Bll = {
|
|
|
getLocalTime:function(nS) {
|
|
|
var date = new Date(parseInt(nS) * 1000);
|
|
|
var mm = date.getMonth() + 1;
|
|
|
var dd = date.getDate();
|
|
|
return date.getFullYear() + "-" + (mm < 10 ? "0" + mm : mm) + "-" + (dd < 10 ? "0" + dd : dd);
|
|
|
},
|
|
|
onClick:function(url, item, hint) {
|
|
|
var e = new common.edit("#baseform");
|
|
|
|
|
|
console.log(arg2);
|
|
|
common.dialog.confirm(arg3,
|
|
|
common.util.__template($("#template").html(), arg2),
|
|
|
function() {
|
|
|
e.submit(arg1,function(option){
|
|
|
// option.data.category=option.data.category_name_value+"--uoho";
|
|
|
// console.log(option.data);
|
|
|
option.success=function(){
|
|
|
alert("suc");
|
|
|
g.reload();
|
|
|
};
|
|
|
option.error=function(){
|
|
|
alert("fail");
|
|
|
}
|
|
|
console.log(item);
|
|
|
common.dialog.confirm(hint,
|
|
|
common.util.__template($("#template").html(), item),
|
|
|
function() {
|
|
|
e.submit(url,function(option){
|
|
|
// option.data.category=option.data.category_name_value+"--uoho";
|
|
|
// console.log(option.data);
|
|
|
// option.debug=true;
|
|
|
option.success=function(){
|
|
|
g.reload();
|
|
|
};
|
|
|
option.error=function(){
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
e.init();
|
|
|
new common.dropDown({el: "#xxx"});
|
|
|
e.init();
|
|
|
// console.log(item.parentId);
|
|
|
new common.dropDown({el: "#parentId", "ajax": "firstCategory"});
|
|
|
if(hint == "修改分类") {
|
|
|
common.util.__ajax({
|
|
|
url:'/operations/helpcategory/getCategoryListByPid',
|
|
|
data:{id:item.parentId}
|
|
|
},function(res) {
|
|
|
for(var i = 0; i < res.data.length; i++) {
|
|
|
if(item.parentId == res.data[i].id) {
|
|
|
$("#select2-parentId-container").html(res.data[i].text);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
};
|
|
|
|
|
|
|
|
|
$('#add-category').on('click', function () {
|
|
|
var item={};
|
|
|
Bll.onClick("/operations111/helpcategory/index222",item,"添加分类");
|
|
|
Bll.onClick("/operations/helpcategory/addCategory",item,"添加分类");
|
|
|
});
|
|
|
|
|
|
$('#help_list').on('click', '.add2', function () {
|
|
|
$(document).on('click', '.add2', function () {
|
|
|
var item=g.rows[$(this).data("index")];
|
|
|
Bll.onClick("/operations111/helpcategory/indexModify",item, "修改分类");
|
|
|
Bll.onClick("/operations/helpcategory/updateHelpCategory",item, "修改分类");
|
|
|
});
|
|
|
$('#help_list').on('click', '.delbtn', function() {
|
|
|
var e = new common.edit("baseform");
|
|
|
common.dialog.confirm("是否确认删除",
|
|
|
"",
|
|
|
$(document).on('click', '.delbtn', function() {
|
|
|
var item=g.rows[$(this).data("index")];
|
|
|
common.dialog.confirm("警告",
|
|
|
"确认删除?",
|
|
|
function() {
|
|
|
e.submit("/operations111/helpcategory/indexDelete", function(option) {
|
|
|
option.success=function() {
|
|
|
alert("删除成功");
|
|
|
common.util.__ajax({
|
|
|
url:'/operations/helpcategory/deleteHelpCategory',
|
|
|
data:{
|
|
|
id: item.id,
|
|
|
parentId: item.parentId
|
|
|
}
|
|
|
},function() {
|
|
|
g.reload();
|
|
|
};
|
|
|
option.error=function() {
|
|
|
alert("删除失败");
|
|
|
};
|
|
|
})
|
|
|
});
|
|
|
});
|
|
|
e.init();
|
|
|
});
|
|
|
|
|
|
|
...
|
...
|
|