<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HelpCate.aspx.cs" Inherits="CY.WebForm.Pages.InfoManage.HelpCate" %>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
<head id="Head1" runat="server">
|
<title>帮助中心管理</title>
|
<uc:CMSHead ID="CMSHead1" runat="server" />
|
<!-- 树start-->
|
<script type="text/javascript" src="../../libs/js/tree/ztree/ztree.js"></script>
|
<link href="../../libs/js/tree/ztree/ztree.css" rel="stylesheet" type="text/css" />
|
<script type="text/javascript">
|
var setting1 = {
|
view: {
|
// addHoverDom: addHoverDom,
|
removeHoverDom: removeHoverDom,
|
selectedMulti: false
|
},
|
edit: {
|
enable: true,
|
renameTitle: "修改",
|
removeTitle: "删除",
|
showRemoveBtn: showRemoveBtn,
|
showRenameBtn: showRenameBtn
|
},
|
callback: {
|
//不允许拖拽
|
beforeDrag: beforeDrag1,
|
//修改前确认
|
beforeEditName: beforeEditName1,
|
//删除前确认
|
beforeRemove: beforeRemove1,
|
//单击展开节点
|
onClick: onNodeClick1
|
}
|
};
|
|
//删除按钮
|
function showRemoveBtn(treeId, treeNode) {
|
return !treeNode.isParent;
|
}
|
//编辑按钮
|
function showRenameBtn(treeId, treeNode) {
|
return true;
|
}
|
|
var zNodes1 = [
|
<%=treeHtml %>
|
];
|
|
function initComplete() {
|
$.fn.zTree.init($("#tree-1"), setting1, zNodes1);
|
};
|
|
function beforeDrag1(treeId, treeNodes) {
|
return false;
|
};
|
|
//确认是否进入编辑状态
|
function beforeEditName1(treeId, treeNode) {
|
var KeyId = treeNode.id;
|
var treeName_o = treeNode.Name
|
if(KeyId == "233" || treeName_o =="帮助中心分类")
|
{
|
alertMsg("顶级菜单不可编辑");
|
}else{
|
$.ajax({
|
url: "/Pages/common/CommonAjax.aspx",
|
type: "POST",
|
dataType: "html",
|
data: { info_datetype: "newsinfo", KeyId: KeyId },
|
global: false,
|
cache: false,
|
success: function (data) {
|
var jnone = [];
|
eval("jnone=" + data);
|
$("#hideKeyId").val(jnone.Keyid);
|
$("#selParentId").val(jnone.ParentId);
|
$("#txtTitle").val(jnone.Title);
|
$("#selIsHomeShow").val(jnone.IsHomeShow+'');
|
|
$("#selIsOtherPage").val(jnone.IsOtherPage+'');
|
$("#txtHerf").val(jnone.Herf);
|
if(jnone.Icon !="")
|
{
|
$("#imgIcon").attr("src",jnone.Icon);
|
$("#imgIcon").show();
|
}
|
$("#txtOrderNum").val(jnone.OrderNum);
|
$("#selStatus").val(jnone.Status);
|
}
|
});
|
}
|
return false;
|
};
|
|
//确认是否删除+删除处理
|
function beforeRemove1(treeId, treeNode) {
|
var zTree = $.fn.zTree.getZTreeObj("tree-1");
|
//选中该节点
|
zTree.selectNode(treeNode);
|
top.Dialog.confirm("删除此分类将会删除此分类下面的全部帮助中心,确认删除 <b>" + treeNode.name + "</b> 吗?", function () {
|
|
//此处进行ajax后台数据处理
|
$.ajax({
|
url: "/Pages/InfoManage/NewsCate.aspx",
|
type: "POST",
|
dataType: "html",
|
data: { deleteid:treeNode.id},
|
global: false,
|
cache: false,
|
success: function (data) {
|
if(data == "1"){
|
zTree.removeNode(treeNode);
|
alertMsg("删除成功");
|
}else{
|
alertMsg("删除失败");
|
}
|
}
|
});
|
});
|
return false;
|
};
|
|
//单击展开节点
|
function onNodeClick1(event, treeId, treeNode){
|
var zTree = $.fn.zTree.getZTreeObj("tree-1");
|
zTree.expandNode(treeNode);
|
};
|
|
|
function removeHoverDom(treeId, treeNode) {
|
$("#addBtn_" + treeNode.id).unbind().remove();
|
};
|
|
function ClearKeyId() {
|
$("#hideKeyId").val("");
|
}
|
</script>
|
<!-- 树end -->
|
</head>
|
<body>
|
<form id="form1" runat="server" class="form">
|
<div id="scrollContent">
|
<div class="box1">
|
<div style=" float:left; width:320px; border: 1px solid #CCCCCC;height:100%; padding:10px;">
|
<ul id="tree-1" class="ztree">
|
</ul>
|
</div>
|
<div style=" float:left; border: 1px solid #CCCCCC; margin-left:20px; height:100%;padding:10px;">
|
<table>
|
<tr>
|
<td class="ali03 w100px">当前编号:</td><td><input type="text" runat="server" id="hideKeyId" class="w40px" readonly="readonly" /> 新增请点击 <span id="spanClearKeyId" class="red CP" style="text-decoration:underline;" onclick="ClearKeyId();">清空编号</span></td>
|
</tr>
|
<tr>
|
<td class="ali03 w100px">父级菜单:</td><td><select id="selParentId" runat="server" keepDefaultStyle="true" ><option value="0">顶级菜单</option></select></td>
|
</tr>
|
<tr>
|
<td class="ali03">分类名称:</td><td><input type="text" id="txtTitle" runat="server" class="w143px req" /></td>
|
</tr>
|
<tr>
|
<td class="ali03">是否首页展示:</td><td><select id="selIsHomeShow" runat="server" keepDefaultStyle="true" ><option value="true">是</option><option value="false">否</option></select></td>
|
</tr>
|
<%--<tr>
|
<td class="ali03">是否外部链接:</td><td><select id="selIsOtherPage" runat="server" keepDefaultStyle="true" ><option value="false">否</option><option value="true">是</option></select></td>
|
</tr>
|
<tr>
|
<td class="ali03">链接地址:</td><td><input type="text" id="txtHerf" runat="server" class="w143px" /></td>
|
</tr>--%>
|
<tr>
|
<td class="ali03 valign01">分类图标:</td>
|
<td>
|
<input type="file" id="fileIcon" name="fileIcon" runat="server" keepDefaultStyle="true" /><br />
|
<img src="" width="20" height="20" style="display:none;" id="imgIcon" />
|
</td>
|
</tr>
|
<tr>
|
<td class="ali03">分类排序:</td><td><input type="text" id="txtOrderNum" runat="server" class="req int" value="1" /></td>
|
</tr>
|
<tr>
|
<td class="ali03">状态:</td><td><select id="selStatus" runat="server" keepDefaultStyle="true" ><option value="True">启用</option><option value="False">禁止</option></select></td>
|
</tr>
|
<tr>
|
<td class="ali03"></td><td><asp:Button ID="btn_Submit" Text="提交" runat="server" OnClick="btn_Submit_Config" /></td>
|
</tr>
|
</table>
|
</div>
|
<div class="CB"></div>
|
</div>
|
</div>
|
</form>
|
<script type="text/javascript">
|
$(function () {
|
$("#selParentId option").each(function (ii, vv) {
|
$(this).html($(this).html().replace(/[.]/g, " "));
|
});
|
});
|
</script>
|
</body>
|
</html>
|