Function.js
上传用户:jiajie98
上传日期:2020-04-24
资源大小:1206k
文件大小:12k
源码类别:

网格计算

开发平台:

PHP

  1. //==========================================
  2. //系统开发:方卡在线
  3. //技术支持:http://www.fangka.net/
  4. //技 术 QQ:861118936
  5. //联系邮箱:admin@fangka.net
  6. //==========================================
  7. //==========================================
  8. //函数名:ShowBox
  9. //用途:操作框弹出
  10. //参数:
  11. //==========================================
  12. function ShowBox(DoUrl){
  13. document.getElementById('BoxContent').innerHTML="<div id='LoadBox'><a href='javascript:void(0);' title='点此关闭' onclick=$('select').show();$('#Boxs').hide()><img src='Images/Loading2.gif' /></a></div>";
  14. $("#Boxs").show();
  15. $.get(DoUrl,
  16. function(data){
  17. document.getElementById('BoxContent').innerHTML=data;
  18. PageReSize();
  19. $("#AlphaBox").height($(document).height());
  20. if($("#Fk_Article_Content").length>0){
  21. $('#Fk_Article_Content').xheditor(true,{upLinkUrl:"Upload.asp?Immediate=1",upLinkExt:"zip,rar,txt",upImgUrl:"Upload.asp?Immediate=1",upImgExt:"jpg,jpeg,gif,png",upFlashUrl:"Upload.asp?Immediate=1",upFlashExt:"swf",upMediaUrl:"Upload.asp?Immediate=1",upMediaExt:"avi"});
  22. }
  23. if($("#Fk_Module_Content").length>0){
  24. $('#Fk_Module_Content').xheditor(true,{upLinkUrl:"Upload.asp?Immediate=1",upLinkExt:"zip,rar,txt",upImgUrl:"Upload.asp?Immediate=1",upImgExt:"jpg,jpeg,gif,png",upFlashUrl:"Upload.asp?Immediate=1",upFlashExt:"swf",upMediaUrl:"Upload.asp?Immediate=1",upMediaExt:"avi"});
  25. }
  26. if($("#Fk_Product_Content").length>0){
  27. $('#Fk_Product_Content').xheditor(true,{upLinkUrl:"Upload.asp?Immediate=1",upLinkExt:"zip,rar,txt",upImgUrl:"Upload.asp?Immediate=1",upImgExt:"jpg,jpeg,gif,png",upFlashUrl:"Upload.asp?Immediate=1",upFlashExt:"swf",upMediaUrl:"Upload.asp?Immediate=1",upMediaExt:"avi"});
  28. }
  29. if($("#Fk_Down_Content").length>0){
  30. $('#Fk_Down_Content').xheditor(true,{upLinkUrl:"Upload.asp?Immediate=1",upLinkExt:"zip,rar,txt",upImgUrl:"Upload.asp?Immediate=1",upImgExt:"jpg,jpeg,gif,png",upFlashUrl:"Upload.asp?Immediate=1",upFlashExt:"swf",upMediaUrl:"Upload.asp?Immediate=1",upMediaExt:"avi"});
  31. }
  32. return true;
  33. }
  34. );
  35. $('select').hide();
  36. }
  37. //==========================================
  38. //函数名:
  39. //用途:按ESC关闭弹出窗口
  40. //参数:
  41. //==========================================
  42. document.onkeydown=function(){ 
  43. if(window.event.keyCode==27){ 
  44. $("#Boxs").hide();
  45. $('select').show();
  46. //==========================================
  47. //函数名:PageReSize
  48. //用途:页面初始化
  49. //参数:
  50. //==========================================
  51. function PageReSize(){
  52. var LeftWidth=189;
  53. var RightWidth=$("#Bodys").width()-189;
  54. var WindowsHeight=$(document).height()-90;
  55. var LeftHeight=$("#MainLeft").height();
  56. var RightHeight=$("#MainRight").height();
  57. if(RightWidth>812){
  58. $("#MainRight").width(RightWidth);
  59. $("#AllBox").width($("#Bodys").width());
  60. }else{
  61. $("#AllBox").width(1001);
  62. }
  63. if(LeftHeight<WindowsHeight||LeftHeight<RightHeight){
  64. if(RightHeight>WindowsHeight){
  65. $("#MainLeft").height(RightHeight);
  66. }else{
  67. $("#MainLeft").height(WindowsHeight);
  68. }
  69. }
  70. }
  71. //==========================================
  72. //函数名:SetRContent
  73. //用途:替换DIV内容
  74. //参数:DivId:要替换的DIV
  75. //     Urls:获取内容的链接
  76. //==========================================
  77. function SetRContent(DivId,Urls){
  78. document.getElementById(DivId).innerHTML="<a href='javascript:void(0);' title='点此关闭' onclick=$('select').show();$('#Boxs').hide()><img src='Images/Loading.gif' /></a>";
  79. $.get(Urls,
  80. function(data){
  81. document.getElementById(DivId).innerHTML=data;
  82. PageReSize();
  83. return true;
  84. }
  85. );
  86. PageReSize();
  87. }
  88. //==========================================
  89. //函数名:GetPinyin
  90. //用途:获取拼音
  91. //参数:InPutId:放置的Input
  92. //     Urls:获取内容的链接
  93. //==========================================
  94. function GetPinyin(InPutId,Urls){
  95. $.get(Urls,
  96. function(data){
  97. document.getElementById(InPutId).value=data;
  98. return true;
  99. }
  100. );
  101. }
  102. //==========================================
  103. //函数名:OpenMenu
  104. //用途:菜单开关
  105. //参数:MenuId:菜单ID
  106. //==========================================
  107. function OpenMenu(MenuId){
  108. if($("#"+MenuId).css("display")=="block"){
  109. $("#"+MenuId).css("display","none");
  110. }else{
  111. $("#"+MenuId).css("display","block");
  112. }
  113. }
  114. //==========================================
  115. //函数名:DelIt
  116. //用途:通用删除
  117. //参数:Cstr:提示语句
  118. //     Urls:执行URL
  119. //     F5Url:刷新URL
  120. //     F5Div:刷新DIV
  121. //==========================================
  122. function DelIt(Cstr,Urls,F5Div,F5Url){
  123. if(confirm(Cstr)){
  124. $.get(Urls,
  125. function(data){
  126. alert(data);
  127. var Arrstr1 = new Array();
  128. var Arrstr2 = new Array();
  129. Arrstr1 = F5Div.split("|");
  130. Arrstr2 = F5Url.split("|");
  131. for(var i=0;i<Arrstr1.length;i++){
  132. SetRContent(Arrstr1[i],Arrstr2[i]);
  133. }
  134. return true;
  135. }
  136. );
  137. }
  138. return;
  139. }
  140. //==========================================
  141. //函数名:Sends
  142. //用途:表单提交
  143. //参数:FormName:提交的FORM
  144. //     ToUrl:提交向的链接
  145. //     SuGo:成功后是否转向链接,1转向,0不转向
  146. //     GoUrl:转向链接
  147. //     SuAlert:成功后是否弹出框提示,1弹出,0不弹出
  148. //     SuF5:成功后是否刷新DIV,1刷新,0不刷新
  149. //     F5Url:刷新URL
  150. //     F5Div:刷新DIV
  151. //==========================================
  152. function Sends(FormName,ToUrl,SuGo,GoUrl,SuAlert,SuF5,F5Div,F5Url){
  153.     var options = { 
  154. url:  ToUrl,
  155.         beforeSubmit:function(formData, jqForm, options){
  156.           return true; 
  157. },
  158.         success:function(responseText, statusText){
  159.           if(statusText=="success"){
  160.             if(responseText.search("成功")>0){
  161. if(SuAlert==1){
  162. alert(responseText);
  163. }
  164. else{
  165. $("#Boxs").hide();
  166. var st=responseText.replace(/|||||/gi,"n");
  167. alert(st);
  168. }
  169. if(SuGo==1){
  170. location.href=GoUrl;
  171. }
  172. if(SuF5==1){
  173. var Arrstr1 = new Array();
  174. var Arrstr2 = new Array();
  175. Arrstr1 = F5Div.split("|");
  176. Arrstr2 = F5Url.split("|");
  177. for(var i=0;i<Arrstr1.length;i++){
  178. SetRContent(Arrstr1[i],Arrstr2[i]);
  179. }
  180. }
  181.             }
  182.             else{
  183. var st=responseText.replace(/|||||/gi,"n");
  184. alert(st);
  185.            }
  186.           }
  187.           else{
  188.             alert(statusText);
  189.           }
  190. }
  191.     }; 
  192.     $('#'+FormName+'').ajaxForm(options); 
  193. }
  194. //==========================================
  195. //函数名:Sends_Div
  196. //用途:表单提交更新DIV
  197. //参数:FormName:提交的FORM
  198. //     ToUrl:提交向的链接
  199. //     F5Div:刷新DIV
  200. //==========================================
  201. function Sends_Div(FormName,ToUrl,F5Div){
  202. document.getElementById(F5Div).innerHTML="<a href='javascript:void(0);' title='点此关闭' onclick=$('#Boxs').hide()><img src='Images/Loading.gif' /></a>";
  203.     var options = { 
  204. url:  ToUrl,
  205.         beforeSubmit:function(formData, jqForm, options){
  206.           return true; 
  207. },
  208.         success:function(responseText, statusText){
  209.           if(statusText=="success"){
  210.             document.getElementById(F5Div).innerHTML=responseText;
  211.           }
  212.           else{
  213.             alert(statusText);
  214.           }
  215. }
  216.     }; 
  217.     $('#'+FormName+'').ajaxForm(options); 
  218. }
  219. //==========================================
  220. //函数名:ChangeSelect
  221. //用途:修改Select内容
  222. //参数:Urls:执行URL
  223. //     SId:操作的Select
  224. //==========================================
  225. function ChangeSelect(Urls,SId){
  226. $.get(Urls,
  227. function(data){
  228. if(data!=""){
  229. BuildSel(data,document.getElementById(SId));
  230. }
  231. return true;
  232. }
  233. );
  234. }
  235. //==========================================
  236. //函数名:BuildSel
  237. //用途:执行修改Select内容
  238. //参数:Urls:执行URL
  239. //     SId:操作的Select
  240. //==========================================
  241. function BuildSel(Str,Sel){
  242. //先清空原来的数据.
  243. var Arrstr = new Array();
  244. Arrstr = Str.split(",,,,,");
  245. //开始构建新的Select.
  246. if(Str!=""){
  247. Sel.options.length=0;
  248. var arrst;
  249. for(var i=0;i<Arrstr.length;i++){
  250. if(Arrstr[i]!=""){
  251. Arrst=Arrstr[i].split("|||||");
  252. Sel.options[Sel.options.length]=new Option(Arrst[1],Arrst[0]);
  253. }
  254. }
  255. }
  256. }
  257. //==========================================
  258. //函数名:ModuleTypeChange
  259. //用途:模块类型选择内容变换
  260. //参数:ModuleTypeId:模板类型
  261. //==========================================
  262. function ModuleTypeChange(ModuleTypeId){
  263. if(ModuleTypeId==0){
  264. $("#Fk_Module_PageCounts").css("display","none");
  265. $("#Fk_Module_Keywords").css("display","block");
  266. $("#Fk_Module_Descriptions").css("display","block");
  267. $("#Fk_Module_Dirs").css("display","none");
  268. $("#Fk_Module_FileNames").css("display","block");
  269. $("#Fk_Module_Templates").css("display","block");
  270. $("#Fk_Module_LowTemplates").css("display","none");
  271. $("#Fk_Module_Urls").css("display","none");
  272. }
  273. if(ModuleTypeId==1){
  274. $("#Fk_Module_PageCounts").css("display","block");
  275. $("#Fk_Module_Keywords").css("display","block");
  276. $("#Fk_Module_Descriptions").css("display","block");
  277. $("#Fk_Module_Dirs").css("display","block");
  278. $("#Fk_Module_FileNames").css("display","none");
  279. $("#Fk_Module_Templates").css("display","block");
  280. $("#Fk_Module_LowTemplates").css("display","block");
  281. $("#Fk_Module_Urls").css("display","none");
  282. }
  283. if(ModuleTypeId==2){
  284. $("#Fk_Module_PageCounts").css("display","block");
  285. $("#Fk_Module_Keywords").css("display","block");
  286. $("#Fk_Module_Descriptions").css("display","block");
  287. $("#Fk_Module_Dirs").css("display","block");
  288. $("#Fk_Module_FileNames").css("display","none");
  289. $("#Fk_Module_Templates").css("display","block");
  290. $("#Fk_Module_LowTemplates").css("display","block");
  291. $("#Fk_Module_Urls").css("display","none");
  292. }
  293. if(ModuleTypeId==3){
  294. $("#Fk_Module_PageCounts").css("display","none");
  295. $("#Fk_Module_Keywords").css("display","block");
  296. $("#Fk_Module_Descriptions").css("display","block");
  297. $("#Fk_Module_Dirs").css("display","none");
  298. $("#Fk_Module_FileNames").css("display","block");
  299. $("#Fk_Module_Templates").css("display","block");
  300. $("#Fk_Module_LowTemplates").css("display","none");
  301. $("#Fk_Module_Urls").css("display","none");
  302. }
  303. if(ModuleTypeId==4){
  304. $("#Fk_Module_PageCounts").css("display","none");
  305. $("#Fk_Module_Keywords").css("display","block");
  306. $("#Fk_Module_Descriptions").css("display","block");
  307. $("#Fk_Module_Dirs").css("display","none");
  308. $("#Fk_Module_FileNames").css("display","block");
  309. $("#Fk_Module_Templates").css("display","block");
  310. $("#Fk_Module_LowTemplates").css("display","none");
  311. $("#Fk_Module_Urls").css("display","none");
  312. }
  313. if(ModuleTypeId==5){
  314. $("#Fk_Module_PageCounts").css("display","none");
  315. $("#Fk_Module_Keywords").css("display","none");
  316. $("#Fk_Module_Descriptions").css("display","none");
  317. $("#Fk_Module_Dirs").css("display","none");
  318. $("#Fk_Module_FileNames").css("display","none");
  319. $("#Fk_Module_Templates").css("display","none");
  320. $("#Fk_Module_LowTemplates").css("display","none");
  321. $("#Fk_Module_Urls").css("display","block");
  322. }
  323. if(ModuleTypeId==6){
  324. $("#Fk_Module_PageCounts").css("display","none");
  325. $("#Fk_Module_Keywords").css("display","none");
  326. $("#Fk_Module_Descriptions").css("display","none");
  327. $("#Fk_Module_Dirs").css("display","none");
  328. $("#Fk_Module_FileNames").css("display","none");
  329. $("#Fk_Module_Templates").css("display","block");
  330. $("#Fk_Module_LowTemplates").css("display","none");
  331. $("#Fk_Module_Urls").css("display","none");
  332. }
  333. if(ModuleTypeId==7){
  334. $("#Fk_Module_PageCounts").css("display","block");
  335. $("#Fk_Module_Keywords").css("display","block");
  336. $("#Fk_Module_Descriptions").css("display","block");
  337. $("#Fk_Module_Dirs").css("display","block");
  338. $("#Fk_Module_FileNames").css("display","none");
  339. $("#Fk_Module_Templates").css("display","block");
  340. $("#Fk_Module_LowTemplates").css("display","block");
  341. $("#Fk_Module_Urls").css("display","none");
  342. }
  343. }
  344. //==========================================
  345. //函数名:ColorPicker
  346. //用途:颜色选择
  347. //参数:ColorInput:要颜色的Input
  348. //==========================================
  349. function ColorPicker(ColorInput) { 
  350. var sColor=dlgHelper.ChooseColorDlg();
  351. if(sColor.toString(16)==0){
  352. ColorInput.value=""; 
  353. }else{
  354. ColorInput.value="#"+sColor.toString(16); 
  355. }