|
|
<!DOCTYPE html>
|
|
|
<html>
|
|
|
<head>
|
|
|
<meta charset="UTF-8" />
|
|
|
<title>Yoho!Buy运营平台</title>
|
|
|
<script src="/pfcms/js/include.js"></script>
|
|
|
<script src="/pfcms/js/ajaxfileupload.js"></script>
|
|
|
<style>
|
|
|
.btn-long {
|
|
|
width: 120px;
|
|
|
height: 37px;
|
|
|
line-height: 37px;
|
|
|
font-size: 15px;
|
|
|
color: white;
|
|
|
border-radius: 5px;
|
|
|
display: inline-block;
|
|
|
cursor: pointer;
|
|
|
text-align: center;
|
|
|
}
|
|
|
.btn-long:hover {
|
|
|
opacity: 0.9;
|
|
|
}
|
|
|
|
|
|
</style>
|
|
|
</head>
|
|
|
<body class="easyui-layout" >
|
|
|
<div region="north" style="height: 200px;">
|
|
|
<script>
|
|
|
document.write(addHead('运营管理', '标签分组管理'));
|
|
|
</script>
|
|
|
|
|
|
<div style="margin-left: 20px;margin-top: 10px">
|
|
|
|
|
|
<input class="easyui-textbox" id="groupNameSearch" style="width: 140px">
|
|
|
</input>
|
|
|
|
|
|
<a id="searchBtn" class="btn-info">查询</a>
|
|
|
<!--<a id="addActivityBtn" class="btn-success">新增</a>-->
|
|
|
<a id="allBtn" class="btn-info">全部</a>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style="margin-left: 20px;margin-top: 10px">
|
|
|
<a id="addBtn" class="btn-long" style="background-color: #5CB85C;">+新建标签分组</a>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div region="center" id="labelGroupList" style="margin-left: 20px">
|
|
|
<table id="labelGroupListTable"></table>
|
|
|
</div>
|
|
|
|
|
|
</body>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
$(function() {
|
|
|
//用于页面刷新后的数据行定位
|
|
|
var index ="";
|
|
|
$("#allBtn").linkbutton({
|
|
|
iconCls : "icon-search",
|
|
|
onClick : function() {
|
|
|
$("#labelGroupListTable").datagrid("load", {});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
$("#groupNameSearch").textbox({
|
|
|
required:false,
|
|
|
prompt: "请输入标签分组名称"
|
|
|
});
|
|
|
|
|
|
|
|
|
$("#searchBtn").linkbutton({
|
|
|
iconCls : "icon-search",
|
|
|
onClick : function() {
|
|
|
$("#labelGroupListTable").datagrid("load", {
|
|
|
groupName: $("#groupNameSearch").textbox("getValue")
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
$("#addBtn").click(function () {
|
|
|
getEditDialog(null);
|
|
|
});
|
|
|
|
|
|
|
|
|
// 检索按钮
|
|
|
$("#labelGroupListTable").myDatagrid({
|
|
|
fit: true,
|
|
|
fitColumns: true,
|
|
|
striped: true,
|
|
|
/*queryParams: {
|
|
|
rewardName: $("#rewardName1").textbox("getValue"),
|
|
|
status: $("#rewardstatus1").combobox("getValue"),
|
|
|
type: $("#rewardtype1").combobox("getValue")
|
|
|
},*/
|
|
|
url: contextPath + "/labelGroupManage/getLabelGroupList",
|
|
|
method: 'POST',
|
|
|
loadFilter: function (data) {
|
|
|
var tmp = defaultLoadFilter(data);
|
|
|
tmp.rows = tmp.list;
|
|
|
return tmp;
|
|
|
},
|
|
|
columns: [[
|
|
|
{
|
|
|
title: "ID",
|
|
|
field: "id",
|
|
|
width: 15,
|
|
|
align: "center"
|
|
|
},
|
|
|
|
|
|
{
|
|
|
title: "标签分组名称",
|
|
|
field: "groupName",
|
|
|
width: 30,
|
|
|
align: "left"
|
|
|
},
|
|
|
{
|
|
|
title: "所属标签数",
|
|
|
field: "labelAmount",
|
|
|
width: 20,
|
|
|
align: "labelAmount"
|
|
|
}, {
|
|
|
title: "状态",
|
|
|
field: "status",
|
|
|
width: 25,
|
|
|
align: "left",
|
|
|
formatter: function (value, rowData, rowIndex) {
|
|
|
if(value == '0'){
|
|
|
return "关闭";
|
|
|
}
|
|
|
if(value == '1'){
|
|
|
return "开启";
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
title: "操作",
|
|
|
field: "ddg",
|
|
|
width: 40,
|
|
|
align: "center",
|
|
|
formatter: function (value, rowData, rowIndex) {
|
|
|
var str = "<a role='edit' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #31b0d5' index='"+ rowIndex +"'>编辑</a>";
|
|
|
str += "<a role='close' style='margin-left:10px;background-color: #ffa951' dataId='"+ rowData.id +"' index='"+ rowIndex +"'>删除</a>";
|
|
|
return str;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
]],
|
|
|
cache: false,
|
|
|
pagination: true,
|
|
|
pageSize: 10,
|
|
|
pageList: [10],
|
|
|
idField: "id",
|
|
|
singleSelect: true,
|
|
|
onLoadSuccess: function (data) {
|
|
|
|
|
|
if(index != ""){
|
|
|
$(this).datagrid("scrollTo",index);
|
|
|
index = "";
|
|
|
}
|
|
|
$(this).datagrid("getPanel").find("a[role='close']").linkbutton({
|
|
|
iconCls: "icon-redo",
|
|
|
onClick: function () {
|
|
|
var close_id = $(this).attr("dataId");
|
|
|
index = $(this).attr("index");
|
|
|
$.messager.confirm("确认", "确认删除该分组吗?", function (flag) {
|
|
|
if(flag){
|
|
|
$.post(contextPath + "/labelGroupManage/deleteLabelGroup", {
|
|
|
id : close_id,
|
|
|
}, function(data) {
|
|
|
if (data.code == CODE_SUCCESS) {
|
|
|
$("#labelGroupListTable").datagrid("reload");
|
|
|
window.self.$.messager.show({
|
|
|
title : "提示",
|
|
|
msg : "删除成功!"
|
|
|
});
|
|
|
} else {
|
|
|
window.self.$.messager.alert("失败", data.message, "error");
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// 编辑
|
|
|
$(this).datagrid("getPanel").find("a[role='edit']").linkbutton({
|
|
|
iconCls : "icon-edit",
|
|
|
onClick : function() {
|
|
|
|
|
|
index = $(this).attr("index");
|
|
|
var row = $("#labelGroupListTable").datagrid('getData').rows[index];
|
|
|
getEditDialog(row);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
// 编辑分组
|
|
|
function getEditDialog(data){
|
|
|
var labelGroupList = $("<div id='labelGroupList'>").appendTo($(document.body));
|
|
|
var title = data == null ? "新建标签分组":"修改标签分组";
|
|
|
var textVar = data == null ? "保存":"保存";
|
|
|
var msgVar = data == null ? "确认新增分组吗?":"确认保存分组吗?";
|
|
|
|
|
|
window.self.paramObject.mkData = data;
|
|
|
$(labelGroupList).myDialog({
|
|
|
title: title,
|
|
|
width: "70%",
|
|
|
height: "80%",
|
|
|
resizable:false,
|
|
|
buttons:[{
|
|
|
id : "saveBtn",
|
|
|
text:textVar,
|
|
|
iconCls : "icon-save",
|
|
|
handler:function(){
|
|
|
|
|
|
|
|
|
$("#activityAddForm").form("submit", {
|
|
|
url: contextPath + "/labelGroupManage/addUpLabelGroup",
|
|
|
onSubmit: function (param) {
|
|
|
if(data != null){
|
|
|
param.id = data.id;
|
|
|
}
|
|
|
// param.status = $("input[name='statusRadio'][checked]").val();
|
|
|
if (!$("#activityAddForm").form("validate")) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
$.messager.progress({
|
|
|
title: "正在执行",
|
|
|
msg: "正在执行,请稍后..."
|
|
|
});
|
|
|
return true;
|
|
|
},
|
|
|
success: function (data) {
|
|
|
$.messager.progress("close");
|
|
|
data = JSON.parse(data);
|
|
|
if (data.code == 200) {
|
|
|
$(labelGroupList).dialog("close");
|
|
|
$("#labelGroupListTable").datagrid("reload");
|
|
|
$.messager.show({
|
|
|
title: "提示",
|
|
|
msg: title + "成功!",
|
|
|
height: 120
|
|
|
});
|
|
|
} else {
|
|
|
$.messager.alert("失败", data.message, "error");
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
text: "关闭",
|
|
|
iconCls: "icon-cancel",
|
|
|
handler: function () {
|
|
|
$.messager.confirm("确认", "确认关闭吗?", function (flag) {
|
|
|
if(flag){
|
|
|
$(labelGroupList).dialog("close");
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}],
|
|
|
modal: true,
|
|
|
href: contextPath + "/html/grass/labelGroupManage/labelGroupEdit.html",
|
|
|
});
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
|
</html> |
|
|
\ No newline at end of file |
...
|
...
|
|