码迷,mamicode.com
首页 > Web开发 > 详细

xmlTree标签树形菜单应用实例:B2C网站部门管理

时间:2015-04-06 08:48:53      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:xmltree标签   树形菜单   部门管理   电子商务   web开发   

轻开B2C电子商务网站的部门(组织机构)管理是一个典型的树形菜单应用实例,效果如图

技术分享

下边介绍一下简单的实现流程

1、存储部门信息的xml文件(轻开B2C电子商务网站base目录下的base/dept.xml文件

<?xml version="1.0" encoding="GBK"?>
<D act="base/xml/DShow.html" color="red" weName="小时代">
<D act="base/xml/DShow.html" color="orange" weName="客户群"></D>
<D color="purple" weName="市场部"></D>
<D color="blue" weName="服务部"></D>
<D color="green" weName="财务科"></D>
<D color="black" weName="项目工程部"></D>
<D color="gray" weName="开发部"></D>
</D>
2、管理的主框架网页(轻开B2C电子商务网站base目录下的base/index.html文件),60行,作用是导航到树形菜单
<TD class="m_out" onmouseup='this.className="m_over"' onmousedown='this.className="m_down"' onmouseover='this.className="m_over"' onmouseout='this.className="m_out"' noWrap><NOBR><IMG src="@{sys:path}images/LiuCheng.gif" border=0 align=absMiddle style="MARGIN-LEFT:3px; MARGIN-RIGHT:5px"><a class=M_Menu href="javascript:void(0)" onClick="lframe.location.href='@{sys:face}base/xml/tree.html?file=base/dept.xml&id=d&url=base/xml/deptShow.html';data.location.href='@{sys:face}base/xml/deptShow.html?file=base/dept.xml&HtokID=d0';openMe('Menu2')" id=Menu2>机构管理</a></NOBR></TD
3、树形菜单页(轻开B2C电子商务网站base/xml目录下的base/xml/dept/tree.html文件
<html>
<head>
<title>XML树</title>
<chtml file="base/tree/act.htm"/><!-- 引入树操作文件 -->
<style>div{padding-left:0px;padding-top:0px;cursor:normal;font-size:12px}</style>
<LINK href="@{sys:path}base/css/main.css" type="TEXT/CSS" rel="STYLESHEET">
</head>
<body onload="onStart();">
<table border=0 style="overflow:scroll" cellspacing=0 cellpadding=0>
<tr><td height=8></td></tr>
<tr><td>
<chtml>
<if x="@{pPage:file}" else=1>
	<xmlTree>resAdmin.xml</xmlTree>
	<xmlTree id="@{pPage:id}" act="@{pPage:act}" url="@{pPage:url}" imgPath="base/tree">@{pPage:file}</xmlTree>
</if>
</chtml>
</td></tr></table>
</body>
</html>
4、部门信息展示页(轻开B2C电子商务网站base/xml目录下的base/xml/dept/deptShow.html文件
<!--用户列表-->
<table width="99%" cellpadding="0" cellspacing="0" border="1" bordercolor="#b4b4b4" align=center>
	<tr height=24><th>用户名</th><th>姓名</th><th>职务</th><th>手机</th></tr>
<chtml>
<!-- 每页的长度 -->
<Bag id=pPage><we name=length>20</we></Bag>
<!-- 取总数等 -->
<esql module=base id=count>Select count(base_user.WE_ID) as all_ID,max(base_user.WE_ID) as max_id,min(base_user.WE_ID) as min_id from base_user,user_dept Where DEPT='@{pPage:HtokID}' and user_id=base_user.WE_ID</esql>
<!-- 总页数和最后一页的条数 -->
<bag id=pPage><we name=pages>@{int:@{count:all_id}/@{pPage:length}}</we><we name=odd>@{int:@{count:all_id}%@{pPage:length}}</we></bag>
<if x="@{pPage:odd}" else=1>
	<bag id=pPage x=0><we name=odd>@{pPage:length}</we></bag>
	<bag id=pPage><we name=pages>@{int:@{pPage:pages}+1}</we></bag>
</if>
<!-- 开始页 -->
<if x="@{pPage:start}"><Bag id=pPage><we name=start>@{int:@{count:all_ID}-@{pPage:odd}}</we></Bag></if>
<!-- 去掉符合条件,但不用显示的记录数 -->
<esql module=base id=count1>Select count(base_user.WE_ID) as num from base_user,user_dept where base_user.we_id<'@{int:@{count:min_id}+@{pPage:start}}' and base_user.we_id>='@{count:min_id}' and DEPT='@{pPage:HtokID}' and user_id=base_user.WE_ID</esql>
<!-- 如果最后一页不足,就取实际条数 -->
<if x="@{int:@{pPage:start}/@{pPage:length}+1}">
	<bag id=pPage x="@{pPage:pages}"><we name=length>@{pPage:odd}</we></bag>
</if>
</chtml>
<chtml>
<!-- 查询数据和显示列表 -->
<esql module=base id=list>
select base_user.we_id,USERNAME,mobile,acl,cnname 
	from base_user,(
		select temp_id,acl from (
			select base_user.we_id as temp_id,acl from base_user,user_dept 
			where base_user.we_id>='@{int:@{count:min_id}+@{pPage:start}}' 
				and base_user.we_id<='@{count:max_id}' 
				and DEPT='@{pPage:HtokID}' 
				and user_id=base_user.WE_ID 
			order by temp_id 
			limit @{int:@{pPage:start}+@{pPage:length}-@{count1:num}}
		) as t_id 
		order by temp_id desc 
		limit @{pPage:length}
	) as t_we
where temp_id=base_user.we_id
</esql>
<!-- 每页的长度 -->
<Bag id=pPage><we name=length>20</we><we name=show_url>@{sys:face}base/xml/userShow.html?HtokID=@{pPage:HtokID}&WE_ID=</we></Bag>
<for objects=list start="@{list:getLength}" end="0">
	<we>@{base/acl.xml:htokid=@{list:ACL}}</we>
	<tr height="22" class=bg0>
		<td><a href="@{pPage:show_url}@{list:WE_ID}">@{list:USERNAME}</a></td>
		<td><a href="@{pPage:show_url}@{list:WE_ID}">@{list:CNNAME}</a></td>
		<td><a href="@{pPage:show_url}@{list:WE_ID}">@{base/acl.xml:weName}</a></td>
		<td><a href="@{pPage:show_url}@{list:WE_ID}">@{list:MOBILE}</a></td>
	</tr>
</for>
</chtml>
</table>
大家先打开体验一下,回头抽空进行深入介绍,加油技术分享
轻松互联网开发平台(Easy Do IT)资源下载

平台及最新开发手册免费下载:http://download.csdn.net/detail/tx18/8464425

开发实例:轻开B2C电子商务网站,免费下载:http://download.csdn.net/detail/tx18/8318585

轻开平台会不定期升级为大家提供更多强大而Easy的功能,请留意下载最新的版本


xmlTree标签树形菜单应用实例:B2C网站部门管理

标签:xmltree标签   树形菜单   部门管理   电子商务   web开发   

原文地址:http://blog.csdn.net/tx18/article/details/44899391

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!