helpCategory.js
1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//帮助分类
var $ = require('jquery');
common = require('../common/common');
var g = new common.grid({
el: '#help_list',
columns: [
{display: "编号", name: "name"},
{display: "分类名称", name: "category"},
{display: "显示平台", name: "paltform"},
{display: "时间", name: "time"},
{
display: "操作", name: "", render: function (item) {
var arr = [];
arr.push('<a class="btn btn-info add2" data-index="' + item.__index + '">编辑</a>');
arr.push('<a class="btn btn-info delbtn" data-index="' + item.__index + '">删除</a>');
return arr.join('');
}
}
]
});
g.init("/operations111/helpcategory/index111");
var Bll = {
onClick:function(arg1, arg2, arg3) {
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");
}
});
});
e.init();
new common.dropDown({el: "#xxx"});
}
};
$('#add-category').on('click', function () {
var item={};
Bll.onClick("/operations111/helpcategory/index222",item,"添加分类");
});
$('#help_list').on('click', '.add2', function () {
var item=g.rows[$(this).data("index")];
Bll.onClick("/operations111/helpcategory/indexModify",item, "修改分类");
});
$('#help_list').on('click', '.delbtn', function() {
var e = new common.edit("baseform");
common.dialog.confirm("是否确认删除",
"",
function() {
e.submit("/operations111/helpcategory/indexDelete", function(option) {
option.success=function() {
alert("删除成功");
g.reload();
};
option.error=function() {
alert("删除失败");
};
})
});
e.init();
});