|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="<?php echo $cfg_soft_lang;?>">
- <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
- <title>单页采集规则管理</title>
- <link rel="stylesheet" href="../static/web/css/bootstrap.min.css">
- <link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css">
- <link rel="stylesheet" href="../static/web/css/admin.css">
- <script src="../static/web/js/jquery.min.js"></script>
- <script src="../static/web/js/bootstrap.bundle.min.js"></script>
- <script src="js/main.js"></script>
- <script src="../static/web/js/webajax.js"></script>
- <style>#addNode{position:absolute;left:20px;top:20px;padding:6px;width:430px;z-index:2;background:#fff;border:1px solid #dee2e6;display:none}#editNode{position:absolute;left:20px;top:20px;width:430px;padding:6px;z-index:1;background:#fff;border:1px solid #dee2e6;display:none}</style>
- <script>
- function ShowAddNode() {
- $DE('addNode').style.display = 'block';
- }
- function CloseAddNode() {
- $DE('addNode').style.display = 'none';
- }
- function CloseEditNode() {
- $DE('editNode').style.display = 'none';
- $DE('addNode').style.display = 'none';
- }
- //编辑
- function EditNode(nid) {
- $DE('editNode').style.display = 'block';
- fetch('article_coonepage_rule.php?action=editload&id=' + nid).then(resp=>resp.text()).then((d)=>{
- $DE('editNodeBody').innerHTML = d;
- });
- }
- //获得选中文件的文件名
- function getCheckboxItem() {
- var allSel = "";
- if (document.form2.ids.value) return document.form2.ids.value;
- for (i = 0; i < document.form2.ids.length; i++) {
- if (document.form2.ids[i].checked) {
- allSel = (allSel == '' ? document.form2.ids[i].value : allSel + "," + document.form2.ids[i].value);
- }
- }
- return allSel;
- }
- function selAll() {
- for (i = 0; i < document.form2.ids.length; i++) {
- if (!document.form2.ids[i].checked) {
- document.form2.ids[i].checked = true;
- }
- }
- }
- function noSelAll() {
- for (i = 0; i < document.form2.ids.length; i++) {
- if (document.form2.ids[i].checked) {
- document.form2.ids[i].checked = false;
- }
- }
- }
- //删除节点
- function DelNode(selid) {
- if (selid == 0) selid = getCheckboxItem();
- if (selid != '') {
- if (window.confirm("您确定要删除这些条目吗")) location = "article_coonepage_rule.php?ids=" + selid + "&action=del";
- } else {
- ShowMsg("您没选择任何条目");
- }
- }
-
- </script>
- </head>
- <body>
- <table width="100%" cellpadding="2" align="center" cellspacing="1" class="table maintable my-3">
- <tr>
- <td colspan="6" bgcolor="#f5f5f5">
- <table width="98%" cellpadding="0" cellspacing="0" class="table table-borderless">
- <tr>
- <td width="30%">单页采集规则管理</td>
- <td width="70%" align="right"><a href="javascript:ShowAddNode();" class="btn btn-success btn-sm">增加新网址</a></td>
- </tr>
- </table>
- </td>
- </tr>
- <form name="form2">
- <tr bgcolor="#fbfce2" align="center">
- <td width="6%">id</td>
- <td width="6%">选择</td>
- <td width="20%">网址</td>
- <td width="12%">编码</td>
- <td width="20%">网站名称</td>
- <td>操作</td>
- </tr>
- {dede:datalist empty='<tr><td colspan="6"><center>暂无内容</center></td></tr>'}
- <tr align="center" onMouseOut="javascript:this.bgColor='#ffffff';">
- <td><?php echo $fields['id']?></td>
- <td><input type="checkbox" name="ids" id="ids" value="<?php echo $fields['id']?>"></td>
- <td align="left"><?php echo $fields['url'];?></td>
- <td><?php echo $fields['lang'];?></td>
- <td><?php echo $fields['title'];?></td>
- <td>
- <a href="javascript:EditNode(<?php echo $fields['id']?>)" class="btn btn-success btn-sm">编辑</a>
- <a href="javascript:DelNode(<?php echo $fields['id']?>)" class="btn btn-danger btn-sm">删除</a>
- </td>
- </tr>
- {/dede:datalist}
- <tr>
- <td colspan="6">
- <a href="javascript:selAll()" class="btn btn-success btn-sm">全选</a>
- <a href="javascript:noSelAll()" class="btn btn-success btn-sm">取消</a>
- <a href="javascript:DelNode(0)" class="btn btn-danger btn-sm">删除</a>
- </td>
- </tr>
- </form>
- <tr>
- <td colspan="6" bgcolor="#f5f5f5" align="center" class="py-2">{dede:pagelist listsize='6'/}</td>
- </tr>
- </table>
- <!--下面是隐藏的栏目增加修改表单-->
- <div id="editNode">
- <span id="editNodeBody">正在加载</span>
- </div>
- <div id="addNode">
- <form name="addform" action="article_coonepage_rule.php" method="post">
- <input type="hidden" name="action" value="add">
- <table width="430" cellspacing="0" cellpadding="0">
- <tr>
- <td width="90">网站名称:</td>
- <td width="270"><input type="text" name="title" id="title" class="biz-input-md" value="<?php echo $row['title'];?>"></td>
- </tr>
- <tr>
- <td>原内容编码:</td>
- <td colspan="2">
- <label><input type="radio" name="lang" value="utf-8" checked="checked"> UTF-8</label>
- <label><input type="radio" name="lang" value="gb2312"> GB2312/GBK</label>
- </td>
- </tr>
- <tr>
- <td>用作文档来源:</td>
- <td colspan="2">
- <label><input type="radio" name="issource" value="0"> 否</label>
- <label><input type="radio" name="issource" value="1" checked="checked"> 是</label>
- </td>
- </tr>
- <tr>
- <td>网站网址:</td>
- <td colspan="2"><input type="text" name="url" id="url" class="biz-input-md"></td>
- </tr>
- <tr>
- <td></td>
- <td colspan="2">使用不带http及任何附加目录的网址<br>
- 如:news.dedebiz.com</td>
- </tr>
- <tr>
- <td>采集规则:</td>
- <td colspan="2">仅针对文档内容,格式:前面HTML{@body}后面HMTL</td>
- </tr>
- <tr>
- <td></td>
- <td colspan="2"><textarea name="rule" class="biz-textarea-xl">{@body}</textarea></td>
- </tr>
- <tr>
- <td colspan="3" align="center" class="py-2">
- <button class="btn btn-success btn-sm" type="submit" name="Submit">保存</button>
- <button class="btn btn-success btn-sm" type="button" name="Submit2" onclick="javascript:CloseEditNode();">关闭</button>
- </td>
- </tr>
- </table>
- </form>
- </div>
- </body>
- </html>
|