|
@@ -41,6 +41,12 @@ $project = function()
|
|
|
return $array;
|
|
|
};
|
|
|
|
|
|
+$cate = function()
|
|
|
+{
|
|
|
+ $info = Dever::load('spider/cate-state');
|
|
|
+ return $info;
|
|
|
+};
|
|
|
+
|
|
|
$info = Dever::load('manage/project.get');
|
|
|
|
|
|
$path = $info['spider']['path'];
|
|
@@ -50,14 +56,12 @@ if(isset($info['spider']['setup']))
|
|
|
$path = $info['spider']['setup'];
|
|
|
}
|
|
|
|
|
|
-$id = Dever::input('option_pid', -1);
|
|
|
-
|
|
|
return array
|
|
|
(
|
|
|
|
|
|
'name' => 'project',
|
|
|
|
|
|
- 'lang' => '项目管理',
|
|
|
+ 'lang' => '项目配置',
|
|
|
'status' => $status,
|
|
|
'path' => $path,
|
|
|
|
|
@@ -79,6 +83,19 @@ return array
|
|
|
|
|
|
'order' => 'desc',
|
|
|
),
|
|
|
+
|
|
|
+ 'cate_id' => array
|
|
|
+ (
|
|
|
+ 'type' => 'int-11',
|
|
|
+ 'name' => '采集源',
|
|
|
+ 'default' => '1',
|
|
|
+ 'desc' => '采集源',
|
|
|
+ 'match' => 'is_numeric',
|
|
|
+ 'update' => 'select',
|
|
|
+ 'search' => 'select',
|
|
|
+ 'option' => $cate,
|
|
|
+ 'list' => true,
|
|
|
+ ),
|
|
|
|
|
|
'name' => array
|
|
|
(
|
|
@@ -97,11 +114,11 @@ return array
|
|
|
(
|
|
|
'type' => 'int-11',
|
|
|
'name' => '上级项目',
|
|
|
- 'default' => $id,
|
|
|
+
|
|
|
'desc' => '请选择上级分类',
|
|
|
'match' => 'is_numeric',
|
|
|
- 'update' => 'select',
|
|
|
- 'search' => 'select',
|
|
|
+
|
|
|
+
|
|
|
'option' => $project,
|
|
|
),
|
|
|
|
|
@@ -112,7 +129,7 @@ return array
|
|
|
'default' => '',
|
|
|
'desc' => '采集网址',
|
|
|
'match' => 'is_string',
|
|
|
- 'update' => $id < 0 ? 'hidden': 'textarea',
|
|
|
+ 'update' => 'textarea',
|
|
|
|
|
|
|
|
|
),
|
|
@@ -126,7 +143,7 @@ return array
|
|
|
'match' => 'is_numeric',
|
|
|
'option' => $request_type,
|
|
|
'list' => true,
|
|
|
- 'update' => $id < 0 ? 'hidden': 'radio',
|
|
|
+ 'update' => 'radio',
|
|
|
|
|
|
),
|
|
|
|
|
@@ -139,7 +156,7 @@ return array
|
|
|
'match' => 'is_numeric',
|
|
|
'option' => $content_type,
|
|
|
'list' => true,
|
|
|
- 'update' => $id < 0 ? 'hidden': 'radio',
|
|
|
+ 'update' => 'radio',
|
|
|
|
|
|
),
|
|
|
|
|
@@ -150,7 +167,7 @@ return array
|
|
|
'default' => '',
|
|
|
'desc' => '采集规则',
|
|
|
'match' => 'option',
|
|
|
- 'update' => $id < 0 ? 'hidden': 'textarea',
|
|
|
+ 'update' => 'textarea',
|
|
|
|
|
|
|
|
|
),
|
|
@@ -162,7 +179,7 @@ return array
|
|
|
'default' => '0',
|
|
|
'desc' => '采集页数',
|
|
|
'match' => 'option',
|
|
|
- 'update' => $id < 0 ? 'hidden': 'text',
|
|
|
+ 'update' => 'text',
|
|
|
),
|
|
|
|
|
|
'status' => array
|
|
@@ -174,7 +191,8 @@ return array
|
|
|
'match' => 'is_numeric',
|
|
|
'option' => $status,
|
|
|
'list' => 'Dever::load("spider/lib/project.status", {id})',
|
|
|
- 'update' => $id < 0 ? 'hidden': 'radio',
|
|
|
+ 'modal' => '查看详情',
|
|
|
+ 'update' => 'radio',
|
|
|
|
|
|
),
|
|
|
|
|
@@ -203,7 +221,6 @@ return array
|
|
|
'default' => '0',
|
|
|
'desc' => '下次采集时间',
|
|
|
'match' => 'is_numeric',
|
|
|
-
|
|
|
'callback' => 'maketime',
|
|
|
),
|
|
|
|
|
@@ -214,17 +231,17 @@ return array
|
|
|
'default' => '0',
|
|
|
'desc' => '采集间隔秒数',
|
|
|
'match' => 'is_numeric',
|
|
|
- 'update' => $id < 0 ? 'hidden' : 'text',
|
|
|
+ 'update' => 'text',
|
|
|
),
|
|
|
|
|
|
'header' => array
|
|
|
(
|
|
|
- 'type' => 'varchar-8000',
|
|
|
+ 'type' => 'text-255',
|
|
|
'name' => 'Header参数-换行为多个参数,格式cookie: 11',
|
|
|
'default' => '',
|
|
|
'desc' => 'Header参数',
|
|
|
'match' => 'option',
|
|
|
- 'update' => $id < 0 ? 'hidden': 'textarea',
|
|
|
+ 'update' => 'textarea',
|
|
|
|
|
|
|
|
|
),
|
|
@@ -236,7 +253,7 @@ return array
|
|
|
'default' => '',
|
|
|
'desc' => '其他参数',
|
|
|
'match' => 'option',
|
|
|
- 'update' => $id < 0 ? 'hidden': 'textarea',
|
|
|
+ 'update' => 'textarea',
|
|
|
|
|
|
|
|
|
),
|
|
@@ -248,7 +265,7 @@ return array
|
|
|
'default' => '',
|
|
|
'desc' => '数据推送',
|
|
|
'match' => 'option',
|
|
|
- 'update' => $id < 0 ? 'hidden': 'textarea',
|
|
|
+ 'update' => 'textarea',
|
|
|
|
|
|
|
|
|
),
|
|
@@ -289,6 +306,17 @@ return array
|
|
|
),
|
|
|
),
|
|
|
|
|
|
+
|
|
|
+ 'alter' => array
|
|
|
+ (
|
|
|
+ 2 => array
|
|
|
+ (
|
|
|
+ array('update', 'header', 'header', 'text-255 header'),
|
|
|
+
|
|
|
+ ),
|
|
|
+ 'version' => 2,
|
|
|
+ ),
|
|
|
+
|
|
|
'manage' => array
|
|
|
(
|
|
|
|
|
@@ -304,24 +332,23 @@ return array
|
|
|
|
|
|
|
|
|
|
|
|
- 'list_type' => 'parent',
|
|
|
+
|
|
|
|
|
|
|
|
|
'list_button' => array
|
|
|
(
|
|
|
'update' => array('编辑', '"project&option_pid={project_id}"'),
|
|
|
- 'list_data' => array('查看采集数据', '"data&search_option_pid={id}&oper_save_jump=project&oper_parent=project"', '{project_id} > 0'),
|
|
|
+ 'list_data' => array('查看采集数据', '"data&search_option_pid={id}&oper_save_jump=project&oper_parent=project"'),
|
|
|
'delete' => '删除',
|
|
|
'br1' => array('<br /><br />'),
|
|
|
- 'add' => array('新增子项目', '"project&option_pid={id}&oper_parent=project&oper_save_jump=project"', '{project_id} == -1'),
|
|
|
|
|
|
- 'list_col' => array('设置采集字段', '"col&search_option_pid={id}&oper_parent=project"', '{project_id} > 0 && {status} <= 2'),
|
|
|
+ 'list_col' => array('设置采集字段', '"col&search_option_pid={id}&oper_parent=project"', '{status} <= 2'),
|
|
|
|
|
|
- 'list_col1' => array('设置自定义字段', '"set&search_option_pid={id}&oper_parent=project"', '{project_id} > 0 && {status} <= 2'),
|
|
|
+ 'list_col1' => array('设置自定义字段', '"set&search_option_pid={id}&oper_parent=project"', '{status} <= 2'),
|
|
|
|
|
|
'br2' => array('<br /><br />'),
|
|
|
- 'new' => array('测试采集', 'Dever::url("spider/lib/api.test?id={id}")', '{project_id} > 0'),
|
|
|
- 'oper1' => array('开始采集', 'Dever::url("spider/lib/api.add?id={id}")', '{project_id} > 0 && {status} <= 2'),
|
|
|
+ 'new' => array('测试采集', 'Dever::url("spider/lib/api.test?id={id}")'),
|
|
|
+ 'oper1' => array('开始采集', 'Dever::url("spider/lib/api.add?id={id}")', '{status} <= 2'),
|
|
|
),
|
|
|
),
|
|
|
|