main.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. window.onload = function () {
  2. Backs_Name();
  3. U.UF.DL.asynLoadJs({ type: "text/javascript", src: "/js/Controls/PC/U.MD.UI.Calendar.js" });
  4. U.UF.DL.asynLoadCss({ "href": "/css/Controls/PC/U.MD.UI.Calendar.css", type: "text/css", rel: "stylesheet" });
  5. U.selectEl(".backs_scoretwo")[0].click()
  6. }
  7. //查找项目名称
  8. Backs_Name = function () {
  9. // var div = $$("div", { "className": "backs_right"} , U.selectEl(".backs")[0]);
  10. var r = U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Reply_SelectTypeName"]));
  11. for (var i = 0; i < r.value.length; i++) {
  12. var two = $$("div", { "className": "backs_scoretwo", "innerHTML": r.value[i].ProjectName, "id": r.value[i].ProjectID }, U.selectEl(".backs_left")[0]);
  13. var update = $$("img", { "onerror": U.MD.C.imgError, "className": "update", "src": "../img/reply/update.png" }, U.selectEl(".backs_scoretwo")[i]);
  14. var dustbin = $$("img", { "onerror": U.MD.C.imgError, "className": "dustbin", "src": "../img/reply/dustbin.png" }, U.selectEl(".backs_scoretwo")[i]);
  15. U.selectEl(".update")[i].onclick = function () {
  16. Backs_UpdateType();
  17. }
  18. U.selectEl(".dustbin")[i].onclick = function () {
  19. Backs_DeleteType();
  20. }
  21. U.selectEl(".backs_left>div")[i].onclick = function () {
  22. Backs(this.id, 0);
  23. for (var i = 0; i < r.value.length; i++) {
  24. U.selectEl(".backs_left>div")[i].className = 'backs_scoretwo';
  25. U.selectEl(".backs_left>div")[i].style.backgroundColor = '';
  26. }
  27. this.className = 'backs_score';
  28. this.style.backgroundColor = '#013F67';
  29. }
  30. }
  31. var two = $$("div", { "className": "backs_scoretwo", "innerHTML": "+ 添加项目", "onclick": "Backs_InsertType()", "style": { "margin-top": "120px"} }, U.selectEl(".backs_left")[0]);
  32. U.selectEl(".backs_scoretwo")[0].className = 'backs_scoretwo backs_score';
  33. }
  34. //创建导航栏组件
  35. Creat_Navigation = function () {
  36. var ul = $$("ul", { "className": "backs_ul dhl" }, U.selectEl(".backs_right")[0]);
  37. var li = $$("li", { "className": "backs_li xh", "innerHTML": "序号" }, ul);
  38. var li = $$("li", { "className": "backs_li yh", "innerHTML": "用户" }, ul);
  39. var li = $$("li", { "className": "backs_content con", "innerHTML": "评论内容" }, ul);
  40. var li = $$("li", { "className": "backs_li ly", "innerHTML": "来源" }, ul);
  41. var li = $$("li", { "className": "backs_li sj", "innerHTML": "时间" }, ul);
  42. var li = $$("li", { "className": "backs_content", "innerHTML": "操作" }, ul);
  43. }
  44. //创建数据列表组件
  45. Todo = function (i, data) {
  46. var ul = $$("ul", { "className": "backs_ul" }, U.selectEl(".backs_right")[0]);
  47. var li = $$("li", { "className": "backs_li xh", "innerHTML": i + 1 }, ul);
  48. var li = $$("li", { "className": "backs_li yh", "innerHTML": data[i].UserName }, ul);
  49. var li = $$("li", { "className": "backs_content con", "innerHTML": data[i].ReplyContent }, ul);
  50. var li = $$("li", { "className": "backs_li ly", "innerHTML": "云盘" }, ul);
  51. var li = $$("li", { "className": "backs_li sj", "innerHTML": data[i].ReplyAddTime }, ul);
  52. var a = $$("li", { "className": "backs_content" }, ul);
  53. var b = $$("div", { "className": "backs_pass", "innerHTML": "查看" }, a);
  54. // var c = $$("div", { "className": "backs_span", "innerHTML": "|" }, a);
  55. var ReplyExamine = $$("div", { "className": "backs_pass", "id": data[i].ReplyID, "innerHTML": "通过", "onclick": "ReplyExamine(this)" }, a);
  56. if (data[i].ReplyExamine == 0) {
  57. ReplyExamine.style.backgroundColor = "#217EC4!important";
  58. ReplyExamine.style.color = "#fff";
  59. ReplyExamine.innerHTML = "通过";
  60. } else {
  61. ReplyExamine.style.backgroundColor = "#cccccc";
  62. ReplyExamine.style.color = "rgba(0, 93, 152, 1)";
  63. ReplyExamine.innerHTML = "未通过";
  64. }
  65. // var c = $$("div", { "className": "backs_span", "innerHTML": "|" }, a);
  66. var b = $$("div", { "className": "backs_pass", "innerHTML": "删除" }, a);
  67. }
  68. //动态创建数据
  69. Backs = function (Tid, isfetch) {
  70. U.selectEl(".backs_right")[0].innerHTML = '';
  71. if (isfetch == 0) {
  72. Creat_Navigation();
  73. }
  74. var STRE = U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Reply_SelectTypeReplyEnable", Tid])).value[0];
  75. /*var TypeID = U.selectEl(".backs_score")[0].id;*/
  76. if (STRE.ProjectReplyEnable == "0") {
  77. U.selectEl(".ellipse")[0].style.backgroundColor = "#D7D7D7";
  78. U.selectEl(".circle")[0].style.left = "5px";
  79. } else {
  80. U.selectEl(".ellipse")[0].style.backgroundColor = "rgba(0, 93, 152, 1)";
  81. U.selectEl(".circle")[0].style.left = "27px";
  82. }
  83. // var div = $$("div", { "className": "backs_right"} , U.selectEl(".backs")[0]); U.selectEl(".backs_score")[0].id
  84. var b = U.selectEl(".backs_selet")[0].value
  85. U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Reply_SelectAllType", Tid, "aa29cab0-691d-4235-8d30-7afada8a3672", "1", ""]), function (r) {
  86. var data = r.value;
  87. if (data.length == 0) {
  88. var ul = $$("div", { "innerHTML": "暂无数据!" }, U.selectEl(".backs_right")[0]);
  89. ul.style.cssText = 'text-align: center;font-size: 31px;'
  90. retrun;
  91. }
  92. for (var i = 0; i < r.value.length; i++) {
  93. Todo(i,data);
  94. }
  95. });
  96. }
  97. //添加弹窗
  98. Backs_InsertType = function () {
  99. new U.UF.UI.form("添加项目", $$("div", { "id": "DetailInfo_box", "style": { "padding": "20px"} }), { "class": "box", "style": { "width": "300px", "height": "200px", "position": "aboulute", "top": "10%", "left": "45%"} });
  100. $$("div", { "id": "Reply2", "innerHTML": "项目名:", "style": { "float": "left", "line-height": "38px"} }, U.selectEl("#DetailInfo_box")[0]); //创建内容盒子
  101. $$("div", { "id": "backs_p", "contenteditable": "true" }, U.selectEl("#DetailInfo_box")[0]); //创建内容盒子
  102. $$("div", { "class": "backs_ok", "innerHTML": "确定", "onclick": "Backs_InsertTypeID()" }, U.selectEl("#DetailInfo_box")[0]); //创建内容盒子
  103. $$("div", { "class": "backs_ok", "innerHTML": "取消", "onclick":"Backs_none()" }, U.selectEl("#DetailInfo_box")[0]); //创建内容盒子
  104. }
  105. //修改弹窗
  106. Backs_UpdateType = function () {
  107. new U.UF.UI.form("修改项目", $$("div", { "id": "DetailInfo_box", "style": { "padding": "20px"} }), { "class": "box", "style": { "width": "300px", "height": "200px", "position": "aboulute", "top": "10%", "left": "45%"} });
  108. $$("div", { "id": "Reply2", "innerHTML": "项目名:", "style": { "float": "left", "line-height": "38px"} }, U.selectEl("#DetailInfo_box")[0]); //创建内容盒子
  109. $$("div", { "id": "backs_p", "contenteditable": "true" }, U.selectEl("#DetailInfo_box")[0]); //创建内容盒子
  110. $$("div", { "class": "backs_ok", "innerHTML": "确定" ,"onclick":"Backs_UpdateTypeID()" }, U.selectEl("#DetailInfo_box")[0]); //创建内容盒子
  111. $$("div", { "class": "backs_ok", "innerHTML": "取消", "onclick":"Backs_none()" }, U.selectEl("#DetailInfo_box")[0]); //创建内容盒子
  112. }
  113. //删除项目
  114. Backs_DeleteType = function () {
  115. new U.UF.UI.form("修改项目", $$("div", { "id": "DetailInfo_box", "style": { "padding": "20px"} }), { "class": "box", "style": { "width": "300px", "height": "200px", "position": "aboulute", "top": "10%", "left": "45%"} });
  116. $$("div", { "id": "Reply2", "innerHTML": "确定要删除该项目吗", "style": { "margin-left":"38px", "line-height": "38px"} }, U.selectEl("#DetailInfo_box")[0]); //创建内容盒子
  117. $$("div", { "class": "backs_ok", "innerHTML": "确定" ,"onclick":"Backs_DeleteTypeID()" }, U.selectEl("#DetailInfo_box")[0]); //创建内容盒子
  118. $$("div", { "class": "backs_ok", "innerHTML": "取消", "onclick":"Backs_none()" }, U.selectEl("#DetailInfo_box")[0]); //创建内容盒子
  119. }
  120. //删除项目数据
  121. Backs_DeleteTypeID = function () {
  122. U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Delete_Type", U.selectEl(".backs_score")[0].id]), function (r) {
  123. });
  124. U.selectEl(".box")[0].remove();
  125. }
  126. //修改项目数据
  127. Backs_UpdateTypeID = function () {
  128. U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Update_TName", U.selectEl("#backs_p")[0].innerText, U.selectEl(".backs_score")[0].id]), function (r) {
  129. r.value == '1' ? U.Alert('修改项目成功') : U.Alert('修改项目失败')
  130. });
  131. U.selectEl(".backs_score")[0].innerHTML = U.selectEl("#backs_p")[0].innerHTML;
  132. U.selectEl(".box")[0].remove();
  133. }
  134. //插入项目数据
  135. Backs_InsertTypeID = function () {
  136. U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Insert_Type", Guid.newGuid(), U.selectEl("#backs_p")[0].innerText, 0]), function (r) {
  137. r.value == '1' ? U.Alert('添加项目成功') : U.Alert('添加项目失败')
  138. });
  139. U.selectEl(".box")[0].remove();
  140. }
  141. Backs_none = function (){
  142. // U.selectEl(".box")[0].style.display = 'none';
  143. U.selectEl(".box")[0].remove();
  144. }
  145. //搜索框查询
  146. Backs_Select = function () {
  147. var b = U.selectEl(".backs_selet")[0].value
  148. U.selectEl(".backs_right")[0].innerHTML = '';
  149. Creat_Navigation();
  150. U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Reply_SelectLike", '%' + b + '%']), function (r) {
  151. var data = r.value
  152. if (data.length == 0) {
  153. var ul = $$("div", { "innerHTML": "暂无数据!" }, U.selectEl(".backs_right")[0]);
  154. ul.style.cssText = 'text-align: center;font-size: 31px;'
  155. retrun;
  156. }
  157. for (var i = 0; i < r.value.length; i++) {
  158. Todo(i, data);
  159. }
  160. });
  161. }
  162. //查询两周时间段
  163. Backs_SelectSeven = function (num) {
  164. var b = U.selectEl(".backs_selet")[0].value
  165. U.selectEl(".backs_right")[0].innerHTML = '';
  166. Creat_Navigation();
  167. // var b = $$("div", { "className": "backs_pass","innerHTML":"查看" }, a);
  168. U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Select_Seven", num]), function (r) {
  169. var data = r.value
  170. if (data.length == 0) {
  171. var ul = $$("div", { "innerHTML": "暂无数据!" }, U.selectEl(".backs_right")[0]);
  172. ul.style.cssText='text-align: center;font-size: 31px;'
  173. retrun;
  174. }
  175. for (var i = 0; i < r.value.length; i++) {
  176. Todo(i, data);
  177. }
  178. });
  179. }
  180. $(".backs_input")[0].onclick = function () {
  181. U.MD.UI.Calendar(this);
  182. }
  183. $(".backs_input")[1].onclick = function () {
  184. U.MD.UI.Calendar(this);
  185. }
  186. $("#backs_input")[0].onclick = function () {
  187. var b = U.selectEl(".backs_selet")[0].value
  188. U.selectEl(".backs_right")[0].innerHTML = '';
  189. Creat_Navigation();
  190. // var b = $$("div", { "className": "backs_pass","innerHTML":"查看" }, a);
  191. U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Select_Rpdata", U.selectEl(".backs_input")[0].value, U.selectEl(".backs_input")[1].value]), function (r) {
  192. var data = r.value
  193. for (var i = 0; i < r.value.length; i++) {
  194. Todo(i, data);
  195. }
  196. });
  197. }
  198. ReplyExamine = function (el) {
  199. if(el.innerHTML == "通过"){
  200. U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Reply_ReplyExamine", 1 , el.id]), function (r) {
  201. el.style.backgroundColor = "#cccccc";
  202. el.style.color = "rgba(0, 93, 152, 1)";
  203. el.innerHTML = "未通过";
  204. });
  205. }else{
  206. U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Reply_ReplyExamine", 0 , el.id]), function (r) {
  207. el.style.backgroundColor = "#217EC4";
  208. el.style.color = "#fff";
  209. el.innerHTML = "通过";
  210. });
  211. }
  212. }
  213. TypeReplyEnable = function (r) {
  214. var TypeID = U.selectEl(".backs_score")[0].id;
  215. var STRE = U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Reply_SelectTypeReplyEnable", TypeID])).value[0];
  216. if (STRE.TypeReplyEnable == 0) {
  217. U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Reply_TypeReplyEnable", 1, TypeID]), function (r) {
  218. U.selectEl(".ellipse")[0].style.backgroundColor = "rgba(0, 93, 152, 1)";
  219. U.selectEl(".circle")[0].style.left = "27px";
  220. });
  221. } else {
  222. U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Reply_TypeReplyEnable", 0, TypeID]), function (r) {
  223. U.selectEl(".ellipse")[0].style.backgroundColor = "#D7D7D7";
  224. U.selectEl(".circle")[0].style.left = "5px";
  225. });
  226. }
  227. }