|
@@ -6,6 +6,7 @@ class Web
|
|
{
|
|
{
|
|
protected $web;
|
|
protected $web;
|
|
protected $path;
|
|
protected $path;
|
|
|
|
+ protected $domain;
|
|
protected $param = array();
|
|
protected $param = array();
|
|
|
|
|
|
# 执行某个业务接口
|
|
# 执行某个业务接口
|
|
@@ -18,6 +19,7 @@ class Web
|
|
if (isset($param['host'])) {
|
|
if (isset($param['host'])) {
|
|
$this->web['host'] = $param['host'];
|
|
$this->web['host'] = $param['host'];
|
|
}
|
|
}
|
|
|
|
+ $this->domain = $this->web['host'];
|
|
$this->path = Dever::db('web_path', 'collect')->find(array('web_id' => $this->web['id'], 'id' => $web_path_id));
|
|
$this->path = Dever::db('web_path', 'collect')->find(array('web_id' => $this->web['id'], 'id' => $web_path_id));
|
|
if (!$this->path) {
|
|
if (!$this->path) {
|
|
return false;
|
|
return false;
|
|
@@ -157,31 +159,31 @@ class Web
|
|
$where['web_path_id'] = $web_path_id;
|
|
$where['web_path_id'] = $web_path_id;
|
|
$info = Dever::db('web_data', 'collect')->select($where, $set);
|
|
$info = Dever::db('web_data', 'collect')->select($where, $set);
|
|
$data['head'] = $data['body'] = array();
|
|
$data['head'] = $data['body'] = array();
|
|
- $col = Dever::db('web_path_col', 'collect')->select(array('web_path_id' => $web_path_id));
|
|
|
|
|
|
+ $col = Dever::db('web_path_col', 'collect')->select(array('web_path_id' => $web_path_id, 'status' => 1));
|
|
if (!$col || !$info) {
|
|
if (!$col || !$info) {
|
|
return $data;
|
|
return $data;
|
|
}
|
|
}
|
|
- print_r($col);die;
|
|
|
|
|
|
+ $config = array();
|
|
foreach ($col as $k => $v) {
|
|
foreach ($col as $k => $v) {
|
|
-
|
|
|
|
|
|
+ $config['field'][$v['key']] = array('name' => $v['key'], 'type' => 'show');
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ $page = Dever::load('common', 'manage')->page('collect/web_data', $config);
|
|
|
|
+ $data['field'] = $page->setting('field', $data['head']);
|
|
foreach ($info as $k => $v) {
|
|
foreach ($info as $k => $v) {
|
|
- $content = Dever::json_decode($v['content']);
|
|
|
|
|
|
+ $body = array();
|
|
|
|
+ $content = Dever::json_decode($v['value']);
|
|
foreach ($content as $key => $value) {
|
|
foreach ($content as $key => $value) {
|
|
- $content[$key] = $page->getValue($key, $value, $content);
|
|
|
|
- }
|
|
|
|
- $content['id'] = $v['id'];
|
|
|
|
- $data['body'][] = $content;
|
|
|
|
- }
|
|
|
|
- if ($data['head']) {
|
|
|
|
- $head = array();
|
|
|
|
- foreach ($data['head'] as $k => $v) {
|
|
|
|
- if ($v['type'] == 'show') {
|
|
|
|
- $head[] = $v;
|
|
|
|
|
|
+ if (isset($config['field'][$key])) {
|
|
|
|
+ $body[$key] = $page->getValue($key, $value, $content);
|
|
|
|
+ $button = $page->button('data_button', $v);
|
|
|
|
+ if ($button) {
|
|
|
|
+ $body['button'] = $button;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- $data['head'] = $head;
|
|
|
|
|
|
+ $body['id'] = $v['id'];
|
|
|
|
+ $data['body'][] = $body;
|
|
}
|
|
}
|
|
return $data;
|
|
return $data;
|
|
}
|
|
}
|
|
@@ -303,4 +305,58 @@ class Web
|
|
|
|
|
|
Dever::excelExport($body, $header, $file);
|
|
Dever::excelExport($body, $header, $file);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public function view($page)
|
|
|
|
+ {
|
|
|
|
+ # 这里获取基本信息
|
|
|
|
+ //print_r($page->info);die;
|
|
|
|
+ $info[] = array
|
|
|
|
+ (
|
|
|
|
+ # 类型,desc描述 table表格,表格有head和body即可
|
|
|
|
+ 'type' => 'desc',
|
|
|
|
+ 'name' => '详细信息',
|
|
|
|
+ # 每行展示数量
|
|
|
|
+ 'column' => 1,
|
|
|
|
+ # 是否有边框
|
|
|
|
+ 'border' => true,
|
|
|
|
+ # 排列方向:horizontal横向 vertical纵向
|
|
|
|
+ 'direction' => 'horizontal',
|
|
|
|
+
|
|
|
|
+ 'content' => array
|
|
|
|
+ (
|
|
|
|
+ array
|
|
|
|
+ (
|
|
|
|
+ 'name' => '标题',
|
|
|
|
+ # 类型,text普通文本,tag标签,link链接,image图片 progress进度条 stat统计 timeline时间线 table表格
|
|
|
|
+ 'type' => 'text',
|
|
|
|
+ 'content' => '<a style="color:red">内容</a>',
|
|
|
|
+ # 样式primary success warning danger info exception
|
|
|
|
+ 'style' => 'primary',
|
|
|
|
+ ),
|
|
|
|
+ array
|
|
|
|
+ (
|
|
|
|
+ 'name' => '标题',
|
|
|
|
+ 'type' => 'tag',
|
|
|
|
+ 'content' => '内容',
|
|
|
|
+ 'style' => 'warning',
|
|
|
|
+ ),
|
|
|
|
+ array
|
|
|
|
+ (
|
|
|
|
+ 'name' => '标题',
|
|
|
|
+ 'type' => 'link',
|
|
|
|
+ 'content' => '内容',
|
|
|
|
+ ),
|
|
|
|
+ array
|
|
|
|
+ (
|
|
|
|
+ 'name' => '图片',
|
|
|
|
+ 'type' => 'image',
|
|
|
|
+ 'content' => 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
|
|
|
|
+ # 'fill', 'contain', 'cover', 'none', 'scale-down'
|
|
|
|
+ 'fit' => 'fill',
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ return array('info' => $info);
|
|
|
|
+ }
|
|
}
|
|
}
|