国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

188 lines
6.1KB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="<?php echo $cfg_soft_lang; ?>">
  5. <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  6. <title>单页采集规则管理</title>
  7. <link rel="stylesheet" href="../static/web/css/bootstrap.min.css">
  8. <link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css">
  9. <link rel="stylesheet" href="../static/web/css/admin.css">
  10. <script src="../static/web/js/jquery.min.js"></script>
  11. <script src="../static/web/js/bootstrap.bundle.min.js"></script>
  12. <script src="js/main.js"></script>
  13. <script src="../static/web/js/webajax.js"></script>
  14. <script>
  15. function ShowAddNode() {
  16. $DE('addNode').style.display = 'block';
  17. }
  18. function CloseAddNode() {
  19. $DE('addNode').style.display = 'none';
  20. }
  21. function CloseEditNode() {
  22. $DE('editNode').style.display = 'none';
  23. $DE('addNode').style.display = 'none';
  24. }
  25. //编辑
  26. function EditNode(nid) {
  27. $DE('editNode').style.display = 'block';
  28. fetch('article_coonepage_rule.php?action=editload&id=' + nid).then(resp=>resp.text()).then((d)=>{
  29. $DE('editNodeBody').innerHTML = d;
  30. });
  31. }
  32. //获得选中文件的文件名
  33. function getCheckboxItem() {
  34. var allSel = "";
  35. if (document.form2.ids.value) return document.form2.ids.value;
  36. for (i = 0; i < document.form2.ids.length; i++) {
  37. if (document.form2.ids[i].checked) {
  38. allSel = (allSel == '' ? document.form2.ids[i].value : allSel + "," + document.form2.ids[i].value);
  39. }
  40. }
  41. return allSel;
  42. }
  43. function selAll() {
  44. for (i = 0; i < document.form2.ids.length; i++) {
  45. if (!document.form2.ids[i].checked) {
  46. document.form2.ids[i].checked = true;
  47. }
  48. }
  49. }
  50. function noSelAll() {
  51. for (i = 0; i < document.form2.ids.length; i++) {
  52. if (document.form2.ids[i].checked) {
  53. document.form2.ids[i].checked = false;
  54. }
  55. }
  56. }
  57. //删除节点
  58. function DelNode(selid) {
  59. if (selid == 0) selid = getCheckboxItem();
  60. if (selid != '') {
  61. if (window.confirm("您确定要删除这些条目吗")) location = "article_coonepage_rule.php?ids=" + selid + "&action=del";
  62. } else {
  63. ShowMsg("您没选择任何条目");
  64. }
  65. }
  66. </script>
  67. <style>
  68. #addNode {
  69. position: absolute;
  70. left: 20px;
  71. top: 20px;
  72. padding: 6px;
  73. width: 430px;
  74. z-index: 2;
  75. background: #fff;
  76. border: 1px solid #dee2e6;
  77. display: none
  78. }
  79. #editNode {
  80. position: absolute;
  81. left: 20px;
  82. top: 20px;
  83. width: 430px;
  84. padding: 6px;
  85. z-index: 1;
  86. background: #fff;
  87. border: 1px solid #dee2e6;
  88. display: none
  89. }
  90. </style>
  91. </head>
  92. <body>
  93. <table width="100%" cellpadding="2" align="center" cellspacing="1" class="table maintable mt-3 mb-3">
  94. <tr bgcolor="#f8f8f8">
  95. <td colspan="6">
  96. <span class="float-left py-2">单页采集规则管理</span>
  97. <span class="float-right mr-2"><a href="javascript:ShowAddNode();" class="btn btn-success btn-sm">增加新网址</a></span>
  98. </td>
  99. </tr>
  100. <form name="form2">
  101. <tr bgcolor="#FBFCE2" align="center">
  102. <td width="8%">ID</td>
  103. <td width="8%">选择</td>
  104. <td width="20%">网址</td>
  105. <td width="12%">编码</td>
  106. <td width="20%">网站名称</td>
  107. <td width="12%">操作</td>
  108. </tr>
  109. {dede:datalist empty='<tr><td colspan="6"><center>暂无内容</center></td></tr>'}
  110. <tr align="center" onMouseOut="javascript:this.bgColor='#ffffff';">
  111. <td><?php echo $fields['id']?></td>
  112. <td><input type="checkbox" name="ids" id="ids" value="<?php echo $fields['id']?>"></td>
  113. <td align="left"><?php echo $fields['url']; ?></td>
  114. <td><?php echo $fields['lang']; ?></td>
  115. <td><?php echo $fields['title']; ?></td>
  116. <td>
  117. <a href="javascript:EditNode(<?php echo $fields['id']?>)" class="btn btn-success btn-sm">编辑</a>
  118. <a href="javascript:DelNode(<?php echo $fields['id']?>)" class="btn btn-success btn-sm">删除</a>
  119. </td>
  120. </tr>
  121. {/dede:datalist}
  122. <tr>
  123. <td colspan="6">
  124. <a href="javascript:selAll()" class="btn btn-success btn-sm">全选</a>
  125. <a href="javascript:noSelAll()" class="btn btn-success btn-sm">取消</a>
  126. <a href="javascript:DelNode(0)" class="btn btn-success btn-sm">删除</a>
  127. </td>
  128. </tr>
  129. </form>
  130. <tr align="right" bgcolor="#f8f8f8">
  131. <td height="36" colspan="6" align="center">{dede:pagelist listsize='6'/}</td>
  132. </tr>
  133. </table>
  134. <!--下面是隐藏的栏目增加修改表单-->
  135. <div id="editNode">
  136. <span id="editNodeBody">正在加载</span>
  137. </div>
  138. <div id="addNode">
  139. <form name="addform" action="article_coonepage_rule.php" method="post">
  140. <input type="hidden" name="action" value="add">
  141. <table width="430" cellspacing="0" cellpadding="0">
  142. <tr>
  143. <td width="90">网站名称:</td>
  144. <td width="270"><input type="text" name="title" id="title" style="width:260px" value="<?php echo $row['title']; ?>"></td>
  145. </tr>
  146. <tr>
  147. <td>原内容编码:</td>
  148. <td colspan="2">
  149. <label><input type="radio" name="lang" value="utf-8" checked="checked"> UTF-8</label>
  150. <label><input type="radio" name="lang" value="gb2312"> GB2312/GBK</label>
  151. </td>
  152. </tr>
  153. <tr>
  154. <td>用作文章来源:</td>
  155. <td colspan="2">
  156. <label><input type="radio" name="issource" value="0"> 否</label>
  157. <label><input type="radio" name="issource" value="1" checked="checked"> 是</label>
  158. </td>
  159. </tr>
  160. <tr>
  161. <td>网站网址:</td>
  162. <td colspan="2"><input type="text" name="url" id="url" style="width:260px"></td>
  163. </tr>
  164. <tr>
  165. <td></td>
  166. <td colspan="2">使用不带http及任何附加目录的网址<br>
  167. 如:news.dedebiz.com</td>
  168. </tr>
  169. <tr>
  170. <td>采集规则:</td>
  171. <td colspan="2">仅针对文章内容,格式:前面HTML{@body}后面HMTL</td>
  172. </tr>
  173. <tr>
  174. <td height="90"></td>
  175. <td colspan="2"><textarea name="rule" style="width:300px;height:80px">{@body}</textarea></td>
  176. </tr>
  177. <tr>
  178. <td colspan="3" align="center" class="py-2">
  179. <button class="btn btn-success btn-sm" type="submit" name="Submit">保存</button>
  180. <button class="btn btn-success btn-sm" type="button" name="Submit2" onclick="javascript:CloseEditNode();">关闭</button>
  181. </td>
  182. </tr>
  183. </table>
  184. </form>
  185. </div>
  186. </body>
  187. </html>