市长热线演示版

entitylist.aspx 9.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="entitylist.aspx.cs" Inherits="HySoft.BaseCallCenter.Web.formmanage.entitylist" %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head id="Head1" runat="server">
  5. <title>实体管理</title>
  6. <link href="../scripts/ui/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  7. <script src="../scripts/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  8. <script src="../scripts/ui/json2.js" type="text/javascript"></script>
  9. <script src="../scripts/ui/js/core/base.js" type="text/javascript"></script>
  10. <script src="../scripts/ui/js/ligerui.min.js" type="text/javascript"></script>
  11. <link href="../scripts/ui/skins/Tab/css/tab.css" rel="stylesheet" type="text/css" />
  12. <link href="../scripts/ui/skins/Tab/css/grid.css" rel="stylesheet" type="text/css" />
  13. <script src="../scripts/ui/js/plugins/ligerGrid.js" type="text/javascript"></script>
  14. <script src="../scripts/ui/js/plugins/ligerLayout.js" type="text/javascript"></script>
  15. <link href="../scripts/ui/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
  16. <link href="../images/style.css" rel="stylesheet" type="text/css" />
  17. <script type="text/javascript">
  18. var gridlist;
  19. var fieldlist;
  20. var menu;
  21. var selectentityid = 0;
  22. var selectentityname = "";
  23. function itemclick(item, i) {
  24. switch (i) {
  25. case 0:
  26. AddAttribute();
  27. break;
  28. case 1:
  29. ModifyAttribute();
  30. break;
  31. case 2:
  32. DeleteAttribute();
  33. break;
  34. default:
  35. break;
  36. }
  37. }
  38. function AddAttribute() {
  39. $.ligerDialog.open({ url: 'attributeedit.aspx?action=add&entityid=' + selectentityid, title: '新增[<font color=red>' + selectentityname + '</font>]属性', height: 460, width: 600, isResize: true
  40. });
  41. }
  42. $(function () {
  43. $("#layout1").ligerLayout({
  44. leftWidth: 399,
  45. allowCenterBottomResize: false
  46. });
  47. menu = $.ligerMenu({ top: 100, left: 100, width: 120, items:
  48. [
  49. { text: '增加属性', click: itemclick, icon: 'add' },
  50. { text: '修改属性', click: itemclick, icon: 'modify' },
  51. { line: true },
  52. { text: '删除属性', click: itemclick, icon: 'delete' }
  53. ]
  54. });
  55. LoadList();
  56. LoadFieldList(0);
  57. });
  58. function getWhereStr() {
  59. var keyWords = "";
  60. if (document.getElementById("txtKeywords").value != "") {
  61. keyWords += document.getElementById("txtKeywords").value;
  62. }
  63. return keyWords;
  64. }
  65. function GetSql() {
  66. var sql = "";
  67. if (document.getElementById("txtKeywords").value != "") {
  68. sql += "&key=" + encodeURIComponent(document.getElementById("txtKeywords").value);
  69. }
  70. return sql;
  71. }
  72. function LoadList() {
  73. var sql = GetSql();
  74. gridlist = $("#diventitylist").ligerGrid({
  75. height: '95%',
  76. columns: [
  77. { display: 'ID', name: '_f_entityid', align: 'left', width: 1, hide: true },
  78. { display: '实体名称', name: '_f_name', width: 110 },
  79. { display: '实体表名', name: '_f_dbtablename', width: 100 },
  80. { display: '是否启用', name: '_f_isactivity', width: 80, render: function (rowdata, rowindex) {
  81. if (rowdata._f_isactivity == 1) { return '启用'; }
  82. else { return '禁用'; }
  83. }
  84. }
  85. ], url: '../formmanage/ajax/entitylist.ashx?action=getentitylist', pageSize: 10, rownumbers: true,
  86. onSelectRow: function (data, rowindex, rowobj) {
  87. selectentityid = data._f_entityid;
  88. selectentityname = data._f_name;
  89. LoadFieldList(data._f_entityid);
  90. },
  91. onDblClickRow: function (data, rowindex, rowobj) {
  92. }
  93. });
  94. gridlist.changePage('first');
  95. $("#pageloading").hide();
  96. }
  97. function LoadFieldList(entityid) {
  98. try {
  99. fieldlist = $("#divfieldlist").ligerGrid({
  100. height: '95%',
  101. columns: [
  102. { display: 'ID', name: '_f_attributeid', align: 'left', width: 1, hide: true },
  103. { display: '显示顺序', name: '_f_columnnumber', width: 60 },
  104. { display: '属性名称', name: '_f_name', width: 110 },
  105. { display: '数据字段', name: '_f_dbfieldlname', width: 100 },
  106. { display: '数据类型', name: '_f_dbtypename', width: 60 },
  107. { display: '长度', name: '_f_length', width: 60, render: function (rowdata, rowindex) {
  108. if (rowdata._f_length == 0) { return ''; }
  109. else { return rowdata._f_length; }
  110. }
  111. },
  112. { display: '主键', name: '_f_ispkattribute', width: 50, render: function (rowdata, rowindex) {
  113. if (rowdata._f_ispkattribute) { return '<font color=red>是</font>'; }
  114. else { return ''; }
  115. }
  116. },
  117. { display: '外键', name: '_f_iscustomfield', width: 50, render: function (rowdata, rowindex) {
  118. if (rowdata._f_iscustomfield) { return '<font color=red>是</font>'; }
  119. else { return ''; }
  120. }
  121. },
  122. { display: '显示', name: '_f_visibletoplatform', width: 50, render: function (rowdata, rowindex) {
  123. if (rowdata._f_visibletoplatform) { return '<font color=red>是</font>'; }
  124. else { return ''; }
  125. }
  126. },
  127. { display: '下拉', name: '_f_islookup', width: 50, render: function (rowdata, rowindex) {
  128. if (rowdata._f_islookup) { return '<font color=red>是</font>'; }
  129. else { return ''; }
  130. }
  131. }, { display: '下拉关联', name: '_f_lookupkey', width: 80 }
  132. ], onContextmenu: function (node, e) {
  133. try {
  134. actionRow = node;
  135. menu.show({ top: e.pageY, left: e.pageX });
  136. }
  137. catch (e) {
  138. alert(e.Message);
  139. }
  140. return false;
  141. }, url: '../formmanage/ajax/entitylist.ashx?action=getentityattributelistbyid&id=' + entityid, pageSize: 10, rownumbers: true,
  142. onSelectRow: function (data, rowindex, rowobj) {
  143. },
  144. onDblClickRow: function (data, rowindex, rowobj) {
  145. }
  146. });
  147. fieldlist.changePage('first');
  148. $("#pageloading").hide();
  149. }
  150. catch (e) {alert(e.Message);
  151. }
  152. }
  153. function Add() {
  154. $.ligerDialog.open({ url: 'entityedit.aspx?action=add', title: '新增实体', height: 380, width: 500, isResize: true
  155. });
  156. }
  157. document.onkeydown = function (event) {
  158. var e = event || window.event || arguments.callee.caller.arguments[0];
  159. if (e && e.keyCode == 13) {
  160. LoadList();
  161. }
  162. };
  163. </script>
  164. </head>
  165. <body style="overflow: hidden;">
  166. <form id="form1" runat="server">
  167. <div class="tools_box">
  168. <div class="tools_bar">
  169. <a class="tools_btn" href="#" onclick="Add();"><span><b class="add">添加</b></span>
  170. </a><a class="tools_btn" href="#" onclick="Modify();"><span><b class="modify">修改</b></span>
  171. </a><a class="tools_btn" href="#" onclick="Delete();"><span><b class="delete">禁用</b></span>
  172. </a><a class="tools_btn" href="#" onclick="DeleteUser('0');"><span><b class="delete">
  173. 启用</b></span> </a>
  174. <div class="search_box">
  175. 关键字:<asp:TextBox ID="txtKeywords" runat="server" CssClass="txtInput"></asp:TextBox>&nbsp;&nbsp;
  176. <input id="btnSearch" type="button" value="搜 索" class="btnSearch" onclick="LoadList();" />
  177. </div>
  178. </div>
  179. </div>
  180. <div id="layout1" style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px;
  181. padding-top: 0px; width: 100%;">
  182. <div style="height: 100%; overflow: hidden;" position="left" title="实体列表">
  183. <div id="diventitylist">
  184. </div>
  185. </div>
  186. <div position="center" title="属性列表">
  187. <div id="divfieldlist">
  188. </div>
  189. </div>
  190. </div>
  191. </form>
  192. </body>
  193. </html>