|
@@ -23,6 +23,20 @@ class Database
|
|
*/
|
|
*/
|
|
private $table;
|
|
private $table;
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * param
|
|
|
|
+ *
|
|
|
|
+ * @var array
|
|
|
|
+ */
|
|
|
|
+ private $param = array();
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * parent
|
|
|
|
+ *
|
|
|
|
+ * @var array
|
|
|
|
+ */
|
|
|
|
+ private $parent = array();
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* menu
|
|
* menu
|
|
*
|
|
*
|
|
@@ -162,7 +176,7 @@ class Database
|
|
public function url($key = false, $id = 0, $table = false, $suffix = '', $project = '', $param = array())
|
|
public function url($key = false, $id = 0, $table = false, $suffix = '', $project = '', $param = array())
|
|
{
|
|
{
|
|
$table = $table ? $table : $this->table;
|
|
$table = $table ? $table : $this->table;
|
|
-
|
|
|
|
|
|
+ $project = $project ? $project : $this->project;
|
|
|
|
|
|
if (strpos($table, 'http://') !== false || strpos($table, 'javascript') !== false) {
|
|
if (strpos($table, 'http://') !== false || strpos($table, 'javascript') !== false) {
|
|
return $table;
|
|
return $table;
|
|
@@ -174,7 +188,7 @@ class Database
|
|
|
|
|
|
$config = array
|
|
$config = array
|
|
(
|
|
(
|
|
- 'project' => 'project/database?project=' . $this->project,
|
|
|
|
|
|
+ 'project' => 'project/database?project=' . $project,
|
|
'list' => 'project/database/list?{param}',
|
|
'list' => 'project/database/list?{param}',
|
|
'search' => 'project/database/list?{param}',
|
|
'search' => 'project/database/list?{param}',
|
|
'add' => 'project/database/update?{param}',
|
|
'add' => 'project/database/update?{param}',
|
|
@@ -188,7 +202,7 @@ class Database
|
|
'stat' => 'project/database/stat?{param}',
|
|
'stat' => 'project/database/stat?{param}',
|
|
'excel' => 'database.list_excel?{param}',
|
|
'excel' => 'database.list_excel?{param}',
|
|
'stat_excel' => 'database.stat_excel?{param}',
|
|
'stat_excel' => 'database.stat_excel?{param}',
|
|
- 'reset' => 'project/database/list?project=' . $this->project . '&table=' . $table . '&menu=' . $this->menu . '&menu_id=' . $this->menu_id,
|
|
|
|
|
|
+ 'reset' => 'project/database/list?project=' . $project . '&table=' . $table . '&menu=' . $this->menu . '&menu_id=' . $this->menu_id,
|
|
'diy' => 'list?{param}',
|
|
'diy' => 'list?{param}',
|
|
);
|
|
);
|
|
$state = $this->getState();
|
|
$state = $this->getState();
|
|
@@ -221,80 +235,126 @@ class Database
|
|
*/
|
|
*/
|
|
private function getUrlParam($key, $table, $suffix, $state, $project = '', $input = array())
|
|
private function getUrlParam($key, $table, $suffix, $state, $project = '', $input = array())
|
|
{
|
|
{
|
|
- $index = md5($key . '_' . $project . '_' . $table . '_' . $suffix . '_' . http_build_query($input));
|
|
|
|
- if (isset($this->param[$index])) {
|
|
|
|
- //return $this->param[$index];
|
|
|
|
- }
|
|
|
|
- $param = '';
|
|
|
|
- $array = array('project', 'search', 'add', 'list', 'update', 'edit');
|
|
|
|
- //if (in_array($key, $array) && !strstr($table, 'oper_')) {
|
|
|
|
- if (!strstr($table, 'oper_')) {
|
|
|
|
- $where = Dever::preInput('search_', $input);
|
|
|
|
- if ($where) {
|
|
|
|
- if (isset($where['where_id'])) {
|
|
|
|
- //unset($where['where_id']);
|
|
|
|
- }
|
|
|
|
|
|
+ if (!$this->param) {
|
|
|
|
+ if ($where = Dever::preInput('search_', $input)) {
|
|
unset($where['search_option_state']);
|
|
unset($where['search_option_state']);
|
|
- $param .= '&' . http_build_query($where);
|
|
|
|
|
|
+ $this->param += $where;
|
|
}
|
|
}
|
|
|
|
|
|
- $oper = Dever::preInput('send_', $input);
|
|
|
|
- if ($oper) {
|
|
|
|
- $param .= '&' . http_build_query($oper);
|
|
|
|
|
|
+ /*
|
|
|
|
+ if ($where = Dever::preInput('oper_', $input)) {
|
|
|
|
+ $this->param += $where;
|
|
}
|
|
}
|
|
|
|
+ */
|
|
|
|
|
|
- if ($key != 'listData') {
|
|
|
|
- $oper = Dever::preInput('oper_', $input);
|
|
|
|
- if ($oper) {
|
|
|
|
- $param .= '&' . http_build_query($oper);
|
|
|
|
- }
|
|
|
|
|
|
+ /*
|
|
|
|
+ if ($where = Dever::preInput('send_', $input)) {
|
|
|
|
+ $this->param += $where;
|
|
|
|
+ }*/
|
|
|
|
+
|
|
|
|
+ if ($search_limit = Dever::input('search_limit')) {
|
|
|
|
+ $this->param['search_limit'] = $search_limit;
|
|
}
|
|
}
|
|
|
|
|
|
- $top = Dever::preInput('top_', $input);
|
|
|
|
- if ($top) {
|
|
|
|
- $param .= '&' . http_build_query($top);
|
|
|
|
|
|
+ if ($page_type = Dever::input('page_type')) {
|
|
|
|
+ $this->param['page_type'] = $page_type;
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
|
|
- if ($key == 'search' && $search_limit = Dever::input('search_limit')) {
|
|
|
|
- $param .= '&search_limit=' . $search_limit;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (strpos($suffix, 'search_option_state') !== false) {
|
|
|
|
- $state = '';
|
|
|
|
- } else {
|
|
|
|
- $state = '&search_option_state=' . $state;
|
|
|
|
- }
|
|
|
|
- $page_type = Dever::input('page_type');
|
|
|
|
- if ($page_type) {
|
|
|
|
- $param .= '&page_type=' . $page_type . '';
|
|
|
|
- }
|
|
|
|
- /*
|
|
|
|
- $where_id = Dever::input('where_id');
|
|
|
|
- if ($where_id) {
|
|
|
|
- $param .= '&where_id=' . $where_id . '';
|
|
|
|
- }
|
|
|
|
- */
|
|
|
|
- $menu_id = Dever::input('menu_id');
|
|
|
|
- if ($menu_id && !strstr($param, 'menu_id')) {
|
|
|
|
- $param .= '&menu_id=' . $menu_id . '';
|
|
|
|
|
|
+ if ($state) {
|
|
|
|
+ $this->param['search_option_state'] = $state;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $this->param['menu'] = $this->menu;
|
|
|
|
+ $this->param['menu_id'] = $this->menu_id;
|
|
|
|
+
|
|
|
|
+ $this->parent();
|
|
}
|
|
}
|
|
- if (!$project) {
|
|
|
|
- if ($key == 'add' || $key == 'update' || $key == 'delete' || $key == 'recovery') {
|
|
|
|
- $project = $this->project;
|
|
|
|
|
|
+
|
|
|
|
+ $param = $this->param;
|
|
|
|
+
|
|
|
|
+ if ($this->parent) {
|
|
|
|
+ if ($key == 'listParent') {
|
|
|
|
+ $parent = $this->parent['parent'];
|
|
|
|
+ if ($this->parent['project']) {
|
|
|
|
+ $project = $this->parent['project'];
|
|
|
|
+ }
|
|
|
|
+ $table = $this->parent['table'];
|
|
} else {
|
|
} else {
|
|
- $project = Dever::input('oper_project', $this->project);
|
|
|
|
|
|
+ $parent = $this->parent['link'];
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (strstr($parent, '=')) {
|
|
|
|
+ parse_str($parent, $array);
|
|
|
|
+ $param = array_merge($this->param, $array);
|
|
|
|
+ } else {
|
|
|
|
+ $param['parent'] = $parent;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $param['project'] = $project;
|
|
|
|
+ $param['table'] = $table;
|
|
|
|
+ if (strstr($table, '&')) {
|
|
|
|
+ $temp = explode('&', $table, 2);
|
|
|
|
+ $param['table'] = $temp[0];
|
|
|
|
+ parse_str($temp[1], $array);
|
|
|
|
+ $param = array_merge($param, $array);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if ($suffix) {
|
|
|
|
+ parse_str($suffix, $array);
|
|
|
|
+ $param = array_merge($param, $array);
|
|
}
|
|
}
|
|
|
|
|
|
- $param = 'project=' . $project . $param . '&table=' . $table . '&menu=' . $this->menu . '&menu_id=' . $this->menu_id . $state . $suffix;
|
|
|
|
|
|
+ return urldecode(http_build_query($param));
|
|
|
|
+ }
|
|
|
|
|
|
- //echo $key . "\r\n";
|
|
|
|
- //echo $param ."\r\n";
|
|
|
|
|
|
|
|
- $this->param[$index] = $param;
|
|
|
|
|
|
+ private function parent()
|
|
|
|
+ {
|
|
|
|
+ $this->parent = array();
|
|
|
|
+ $parent = Dever::input('parent');
|
|
|
|
+ if ($parent) {
|
|
|
|
+ $this->parent['project'] = '';
|
|
|
|
+ $this->parent['link'] = $parent;
|
|
|
|
|
|
- return $param;
|
|
|
|
|
|
+ $parent = explode('.', $parent);
|
|
|
|
+ $cur = array_pop($parent);
|
|
|
|
+ if ($cur && strstr($cur, '/')) {
|
|
|
|
+ $temp = explode('/', $cur);
|
|
|
|
+ $cur = $temp[1];
|
|
|
|
+ $this->parent['project'] = $temp[0];
|
|
|
|
+ }
|
|
|
|
+ $this->parent['parent'] = implode('.', $parent);
|
|
|
|
+ $this->parent['table'] = $cur;
|
|
|
|
+ } else {
|
|
|
|
+ # 此处为了兼容旧版本的一些设置 这里后续废弃
|
|
|
|
+ $parent = Dever::input('oper_table', Dever::input('oper_parent'));
|
|
|
|
+ if ($parent) {
|
|
|
|
+ $link = '';
|
|
|
|
+ $this->parent['link'] = 'oper_table=' . $parent;
|
|
|
|
+ $this->parent['table'] = $parent;
|
|
|
|
+ $this->parent['project'] = Dever::input('oper_project');
|
|
|
|
+ $top = Dever::preInput('top_');
|
|
|
|
+ if ($top) {
|
|
|
|
+ $top_query = http_build_query($top);
|
|
|
|
+ $this->parent['link'] .= '&' . $top_query;
|
|
|
|
+ if (strstr($top_query, '.')) {
|
|
|
|
+ foreach ($top as $k => $v) {
|
|
|
|
+ $temp = explode('.', $v);
|
|
|
|
+ $k = str_replace('top_', '', $k);
|
|
|
|
+ $link .= '&oper_' . $k . '=' . $temp[0];
|
|
|
|
+ if (isset($temp[1])) {
|
|
|
|
+ $link .= '&top_' . $k . '=' . $temp[1];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ $link .= '&' . str_replace('top_', 'oper_', $top_query);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $this->parent['parent'] = $link;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -443,9 +503,14 @@ class Database
|
|
'struct' => isset($config['manage']['struct']) ? $config['manage']['struct'] : '',
|
|
'struct' => isset($config['manage']['struct']) ? $config['manage']['struct'] : '',
|
|
'stat_desc' => '主动统计',
|
|
'stat_desc' => '主动统计',
|
|
'search_param' => '',
|
|
'search_param' => '',
|
|
|
|
+ 'parent' => '',
|
|
);
|
|
);
|
|
|
|
|
|
- $this->parent();
|
|
|
|
|
|
+ if ($this->parent) {
|
|
|
|
+ $this->info['parent'] = $this->url(Dever::input('parent_link', 'listParent'));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $this->info['submit'] = $this->info['parent'] ? $this->info['parent'] : $this->info['list'];
|
|
|
|
|
|
# 保存页面
|
|
# 保存页面
|
|
$this->info['save'] = Dever::input('oper_save_table', Dever::input('oper_save_jump'));
|
|
$this->info['save'] = Dever::input('oper_save_table', Dever::input('oper_save_jump'));
|
|
@@ -476,70 +541,6 @@ class Database
|
|
return $this->info;
|
|
return $this->info;
|
|
}
|
|
}
|
|
|
|
|
|
- private function parent()
|
|
|
|
- {
|
|
|
|
- # 返回上一页
|
|
|
|
- $this->info['parent'] = '';
|
|
|
|
- $this->info['parent_project'] = '';
|
|
|
|
- $parent = Dever::input('parent');
|
|
|
|
- if ($parent) {
|
|
|
|
- $parent = explode('.', $parent);
|
|
|
|
- $cur = array_pop($parent);
|
|
|
|
- if (strstr($cur, '/')) {
|
|
|
|
- $temp = explode('/', $cur);
|
|
|
|
- $cur = $temp[1];
|
|
|
|
- $this->info['parent_project'] = $temp[0];
|
|
|
|
- }
|
|
|
|
- $parent = implode('.', $parent);
|
|
|
|
- $search = Dever::preInput('search_');
|
|
|
|
- $oper_parent = $cur . '&parent=' . $parent;
|
|
|
|
- if ($search) {
|
|
|
|
- $oper_parent .= '&' . http_build_query($search);
|
|
|
|
- }
|
|
|
|
- $send = Dever::preInput('send_');
|
|
|
|
- if ($send) {
|
|
|
|
- $oper_parent .= '&' . http_build_query($send);
|
|
|
|
- }
|
|
|
|
- $this->info['parent'] = $this->url(Dever::input('oper_index', 'listData'), 0, $oper_parent, '', $this->info['parent_project']);
|
|
|
|
- } else {
|
|
|
|
- # 此处为了兼容旧版本的一些设置 这里后续废弃
|
|
|
|
- $oper_parent = Dever::input('oper_table', Dever::input('oper_parent'));
|
|
|
|
- if ($oper_parent) {
|
|
|
|
- $oper = Dever::preInput('oper_');
|
|
|
|
- if ($oper) {
|
|
|
|
- $oper_parent .= '&' . str_replace('oper_', '', http_build_query($oper));
|
|
|
|
- }
|
|
|
|
- $search = Dever::preInput('search_');
|
|
|
|
- if ($search) {
|
|
|
|
- $oper_parent .= '&' . http_build_query($search);
|
|
|
|
- }
|
|
|
|
- $send = Dever::preInput('send_');
|
|
|
|
- if ($send) {
|
|
|
|
- $oper_parent .= '&' . http_build_query($send);
|
|
|
|
- }
|
|
|
|
- $top = Dever::preInput('top_');
|
|
|
|
- if ($top) {
|
|
|
|
- $top_query = http_build_query($top);
|
|
|
|
- if (strstr($top_query, '.')) {
|
|
|
|
- foreach ($top as $k => $v) {
|
|
|
|
- $temp = explode('.', $v);
|
|
|
|
- $k = str_replace('top_', '', $k);
|
|
|
|
- $oper_parent .= '&oper_' . $k . '=' . $temp[0];
|
|
|
|
- if (isset($temp[1])) {
|
|
|
|
- $oper_parent .= '&top_' . $k . '=' . $temp[1];
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- $oper_parent .= '&' . str_replace('top_', 'oper_', $top_query);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- $this->info['parent_project'] = Dever::input('oper_project');
|
|
|
|
-
|
|
|
|
- $this->info['parent'] = $this->url(Dever::input('oper_index', 'listData'), 0, $oper_parent, '', $this->info['parent_project']);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 获取表名
|
|
* 获取表名
|
|
*
|
|
*
|
|
@@ -964,10 +965,13 @@ class Database
|
|
width: 100%;
|
|
width: 100%;
|
|
}';
|
|
}';
|
|
} else {
|
|
} else {
|
|
- $css = '.layui-input,.xm-select-parent
|
|
|
|
|
|
+ $css = '.layui-input,.xm-select-parent,.layui-form-select
|
|
{
|
|
{
|
|
width: 50%;
|
|
width: 50%;
|
|
}
|
|
}
|
|
|
|
+ .layui-form-select .layui-input {
|
|
|
|
+ width:100%;
|
|
|
|
+ }
|
|
@media screen and (max-width: 1024px) {
|
|
@media screen and (max-width: 1024px) {
|
|
.layui-input,.xm-select-parent
|
|
.layui-input,.xm-select-parent
|
|
{
|
|
{
|
|
@@ -1224,6 +1228,11 @@ class Database
|
|
|
|
|
|
$result = '';
|
|
$result = '';
|
|
|
|
|
|
|
|
+ $suffix = '';
|
|
|
|
+ if (isset($config['manage']['link'])) {
|
|
|
|
+ $suffix = $config['manage']['link'];
|
|
|
|
+ }
|
|
|
|
+
|
|
# 增加返回上一页按钮
|
|
# 增加返回上一页按钮
|
|
$info = $this->info();
|
|
$info = $this->info();
|
|
if ($info['parent']) {
|
|
if ($info['parent']) {
|
|
@@ -1255,7 +1264,7 @@ class Database
|
|
$insert_state = Dever::load('manage/auth.oper', 4);
|
|
$insert_state = Dever::load('manage/auth.oper', 4);
|
|
if ($insert_state) {
|
|
if ($insert_state) {
|
|
if ($add_show) {
|
|
if ($add_show) {
|
|
- $button[$add_name] = $info['add'];
|
|
|
|
|
|
+ $button[$add_name] = $info['add'] . '&' . $suffix;
|
|
}
|
|
}
|
|
} elseif (isset($config['manage']['button']['新增'])) {
|
|
} elseif (isset($config['manage']['button']['新增'])) {
|
|
unset($config['manage']['button']['新增']);
|
|
unset($config['manage']['button']['新增']);
|
|
@@ -1268,7 +1277,7 @@ class Database
|
|
if (is_string($config['manage']['stat'])) {
|
|
if (is_string($config['manage']['stat'])) {
|
|
$name = $config['manage']['stat'];
|
|
$name = $config['manage']['stat'];
|
|
}
|
|
}
|
|
- $button[$name] = $this->url('stat');
|
|
|
|
|
|
+ $button[$name] = $this->url('stat', false, false, $suffix);
|
|
}
|
|
}
|
|
|
|
|
|
if (isset($config['manage']['button']) && $config['manage']['button']) {
|
|
if (isset($config['manage']['button']) && $config['manage']['button']) {
|
|
@@ -1301,15 +1310,15 @@ class Database
|
|
# 增加回收站
|
|
# 增加回收站
|
|
if (Dever::load('manage/auth.oper', 5) != false && isset($config['struct']['state']) && (!isset($config['manage']['delete']) || (isset($config['manage']['delete']) && $config['manage']['delete'] && isset($config['manage']['_list']['value']['delete'])))) {
|
|
if (Dever::load('manage/auth.oper', 5) != false && isset($config['struct']['state']) && (!isset($config['manage']['delete']) || (isset($config['manage']['delete']) && $config['manage']['delete'] && isset($config['manage']['_list']['value']['delete'])))) {
|
|
if ($config['state'] == 2) {
|
|
if ($config['state'] == 2) {
|
|
- $button['返回数据列表'] = $this->url('list', 0, false, '&search_option_state=1', $this->project);
|
|
|
|
|
|
+ $button['返回数据列表'] = $this->url('list', 0, false, 'search_option_state=1', $this->project);
|
|
} else {
|
|
} else {
|
|
- $button['回收站'] = $this->url('list', 0, false, '&search_option_state=2', $this->project);
|
|
|
|
|
|
+ $button['回收站'] = $this->url('list', 0, false, 'search_option_state=2', $this->project);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
# 列表页按钮
|
|
# 列表页按钮
|
|
if ($button) {
|
|
if ($button) {
|
|
- $result .= $this->list_button_show($button);
|
|
|
|
|
|
+ $result .= $this->list_button_show($button, $suffix);
|
|
}
|
|
}
|
|
/*
|
|
/*
|
|
if (Dever::load('manage/auth.oper', 6) != false && isset($config['manage']['button'])) {
|
|
if (Dever::load('manage/auth.oper', 6) != false && isset($config['manage']['button'])) {
|
|
@@ -1354,7 +1363,7 @@ class Database
|
|
}
|
|
}
|
|
|
|
|
|
if ($close_name) {
|
|
if ($close_name) {
|
|
- $result .= '<a href="' . ($info['parent'] ? $info['parent'] : $info['list']) . '" class="btn btn-danger layui-btn layuiadmin-btn-list layui-btn-danger" onclicks="msg({status:1,msg:\'yes\'})">'.$close_name.'</a>';
|
|
|
|
|
|
+ $result .= '<a href="' . $info['submit'] . '" class="btn btn-danger layui-btn layuiadmin-btn-list layui-btn-danger" onclicks="msg({status:1,msg:\'yes\'})">'.$close_name.'</a>';
|
|
}
|
|
}
|
|
|
|
|
|
if (isset($config['manage']['update_button']) && $config['manage']['update_button']) {
|
|
if (isset($config['manage']['update_button']) && $config['manage']['update_button']) {
|
|
@@ -1375,7 +1384,7 @@ class Database
|
|
return $result;
|
|
return $result;
|
|
}
|
|
}
|
|
|
|
|
|
- private function list_button_show($button)
|
|
|
|
|
|
+ private function list_button_show($button, $suffix = '')
|
|
{
|
|
{
|
|
$result = '';
|
|
$result = '';
|
|
$refer = Dever::input('refer');
|
|
$refer = Dever::input('refer');
|
|
@@ -1398,9 +1407,9 @@ class Database
|
|
if (is_array($v)) {
|
|
if (is_array($v)) {
|
|
if ($v[0] == 'location') {
|
|
if ($v[0] == 'location') {
|
|
if ($v[1] == 'add') {
|
|
if ($v[1] == 'add') {
|
|
- $url = $this->url('add');
|
|
|
|
|
|
+ $url = $this->url('add', false, false, $suffix);
|
|
} elseif ($v[1] == 'list') {
|
|
} elseif ($v[1] == 'list') {
|
|
- $url = $this->url('list');
|
|
|
|
|
|
+ $url = $this->url('list', false, false, $suffix);
|
|
} else {
|
|
} else {
|
|
$url = Dever::url($v[1]);
|
|
$url = Dever::url($v[1]);
|
|
}
|
|
}
|
|
@@ -1428,7 +1437,7 @@ class Database
|
|
$v[2] = 1;
|
|
$v[2] = 1;
|
|
}
|
|
}
|
|
//$url .= '&manage_log=update.' . $this->project . '.' . $this->table . '&manage_oper=' . $k;
|
|
//$url .= '&manage_log=update.' . $this->project . '.' . $this->table . '&manage_oper=' . $k;
|
|
- $result .= ' <a class="btn btn-default layui-btn layuiadmin-btn-list layui-btn-danger" href="javascript:;" onclick="$(\'#form1\').attr(\'action\', \'' . $this->url('list') . '\');list_mul($(this), 1, \''.$url.'\')">' . $k . '</a>';
|
|
|
|
|
|
+ $result .= ' <a class="btn btn-default layui-btn layuiadmin-btn-list layui-btn-danger" href="javascript:;" onclick="$(\'#form1\').attr(\'action\', \'' . $this->url('list', false, false, $suffix) . '\');list_mul($(this), 1, \''.$url.'\')">' . $k . '</a>';
|
|
} elseif ($v[0] == 'show') {
|
|
} elseif ($v[0] == 'show') {
|
|
$url = Dever::url($v[1]);
|
|
$url = Dever::url($v[1]);
|
|
$submit = '';
|
|
$submit = '';
|
|
@@ -1439,19 +1448,19 @@ class Database
|
|
$result .= ' <a class="btn btn-default layui-btn layuiadmin-btn-list" onclick="loadPage(\''.$url.'\', \''.$k.'\',\''.$submit.'\')">' . $k . '</a>';
|
|
$result .= ' <a class="btn btn-default layui-btn layuiadmin-btn-list" onclick="loadPage(\''.$url.'\', \''.$k.'\',\''.$submit.'\')">' . $k . '</a>';
|
|
} elseif ($v[0] == 'fast') {
|
|
} elseif ($v[0] == 'fast') {
|
|
if (isset($v[2]) && $v[2]) {
|
|
if (isset($v[2]) && $v[2]) {
|
|
- $url = $this->url('add', $v[1], $v[2]);
|
|
|
|
|
|
+ $url = $this->url('add', $v[1], $v[2], $suffix);
|
|
} elseif (isset($v[1]) && $v[1]) {
|
|
} elseif (isset($v[1]) && $v[1]) {
|
|
- $url = Dever::url($v[1]);
|
|
|
|
|
|
+ $url = Dever::url($v[1], false, false, $suffix);
|
|
} else {
|
|
} else {
|
|
- $url = $this->url('add');
|
|
|
|
|
|
+ $url = $this->url('add', false, false, $suffix);
|
|
}
|
|
}
|
|
$result .= ' <a class="btn btn-default layui-btn layuiadmin-btn-list" href="javascript:;" onclick="fastEdit($(this),\''.$url.'\',\''.$k.'\', \'\')">' . $k . '</a>';
|
|
$result .= ' <a class="btn btn-default layui-btn layuiadmin-btn-list" href="javascript:;" onclick="fastEdit($(this),\''.$url.'\',\''.$k.'\', \'\')">' . $k . '</a>';
|
|
} elseif ($v[0] == 'fasts') {
|
|
} elseif ($v[0] == 'fasts') {
|
|
- $result .= ' <a class="btn btn-default layui-btn layuiadmin-btn-list" href="javascript:;" onclick="fastEdit($(this),\''.$this->url('add').'\',\''.$k.'\', \'\', 1)">' . $k . '</a>';
|
|
|
|
|
|
+ $result .= ' <a class="btn btn-default layui-btn layuiadmin-btn-list" href="javascript:;" onclick="fastEdit($(this),\''.$this->url('add', false, false, $suffix).'\',\''.$k.'\', \'\', 1)">' . $k . '</a>';
|
|
} elseif ($v[0] == 'onclick') {
|
|
} elseif ($v[0] == 'onclick') {
|
|
$result .= ' <a href="javascript:;" class="btn btn-warning layui-btn layuiadmin-btn-list layui-btn-warm" onclick="' . $v[1] . '">' . $k . '</a>';
|
|
$result .= ' <a href="javascript:;" class="btn btn-warning layui-btn layuiadmin-btn-list layui-btn-warm" onclick="' . $v[1] . '">' . $k . '</a>';
|
|
} else {
|
|
} else {
|
|
- $result .= ' <a class="btn btn-default layui-btn layuiadmin-btn-list" href="' . $this->url($v[0], false, $v[1]) . '">' . $k . '</a>';
|
|
|
|
|
|
+ $result .= ' <a class="btn btn-default layui-btn layuiadmin-btn-list" href="' . $this->url($v[0], false, $v[1], $suffix) . '">' . $k . '</a>';
|
|
}
|
|
}
|
|
|
|
|
|
} elseif (strpos($v, 'modal|') !== false) {
|
|
} elseif (strpos($v, 'modal|') !== false) {
|
|
@@ -1536,7 +1545,7 @@ class Database
|
|
$class = 'layui-btn-primary';
|
|
$class = 'layui-btn-primary';
|
|
}
|
|
}
|
|
|
|
|
|
- $url = $this->url('list', 0, false, '&search_button=' . $value);
|
|
|
|
|
|
+ $url = $this->url('list', 0, false, 'search_button=' . $value);
|
|
$btn .= '<a class="btn btn-primary layui-btn layuiadmin-btn-list '.$class.'" href="'.$url.'" type="button" style="height: 38px;margin-left:0px;margin-top:-2px;">'.$v1.'</a> ';
|
|
$btn .= '<a class="btn btn-primary layui-btn layuiadmin-btn-list '.$class.'" href="'.$url.'" type="button" style="height: 38px;margin-left:0px;margin-top:-2px;">'.$v1.'</a> ';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1899,7 +1908,7 @@ class Database
|
|
} else {
|
|
} else {
|
|
$btn = 'default';
|
|
$btn = 'default';
|
|
}
|
|
}
|
|
- $url = $this->url('list', 0, false, '&search_limit=' . $k);
|
|
|
|
|
|
+ $url = $this->url('list', 0, false, 'search_limit=' . $k);
|
|
$limit .= '<a href="'.$url.'" style="width:60px;font-weight:bold;" class="btn btn-'.$btn.' layui-btn layui-btn-radius layui-btn-primary">'.$v.'</a> ';
|
|
$limit .= '<a href="'.$url.'" style="width:60px;font-weight:bold;" class="btn btn-'.$btn.' layui-btn layui-btn-radius layui-btn-primary">'.$v.'</a> ';
|
|
}
|
|
}
|
|
|
|
|
|
@@ -3001,6 +3010,11 @@ class Database
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ $suffix = '';
|
|
|
|
+ if (isset($config['manage']['link'])) {
|
|
|
|
+ $suffix = $config['manage']['link'];
|
|
|
|
+ }
|
|
|
|
+
|
|
foreach ($config['manage']['_list']['value'] as $kj => $vj) {
|
|
foreach ($config['manage']['_list']['value'] as $kj => $vj) {
|
|
$pj = false;
|
|
$pj = false;
|
|
|
|
|
|
@@ -3041,24 +3055,24 @@ class Database
|
|
$vj[3] = '';
|
|
$vj[3] = '';
|
|
}
|
|
}
|
|
|
|
|
|
- $result .= '<a href="javascript:;" onclick="fastEdit($(this), \'' . $this->url('list', $data['id'], $pj) . '\', \''.$vj[0].'\', \''.$vj[3].'\', 1, 1)"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 '.$class.'">' . $vj[0] . '</button></a> ';
|
|
|
|
|
|
+ $result .= '<a href="javascript:;" onclick="fastEdit($(this), \'' . $this->url('list', $data['id'], $pj, $suffix) . '\', \''.$vj[0].'\', \''.$vj[3].'\', 1, 1)"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 '.$class.'">' . $vj[0] . '</button></a> ';
|
|
} elseif (strpos($kj, 'fast_add') !== false) {
|
|
} elseif (strpos($kj, 'fast_add') !== false) {
|
|
if (!isset($vj[3])) {
|
|
if (!isset($vj[3])) {
|
|
$vj[3] = '';
|
|
$vj[3] = '';
|
|
}
|
|
}
|
|
|
|
|
|
- $result .= '<a href="javascript:;" onclick="fastEdit($(this), \'' . $this->url('update', false, $pj) . '\', \''.$vj[0].'\', \''.$vj[3].'\', 1)"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 '.$class.'">' . $vj[0] . '</button></a> ';
|
|
|
|
|
|
+ $result .= '<a href="javascript:;" onclick="fastEdit($(this), \'' . $this->url('update', false, $pj, $suffix) . '\', \''.$vj[0].'\', \''.$vj[3].'\', 1)"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 '.$class.'">' . $vj[0] . '</button></a> ';
|
|
} elseif (strpos($kj, 'fast') !== false) {
|
|
} elseif (strpos($kj, 'fast') !== false) {
|
|
if (!isset($vj[3])) {
|
|
if (!isset($vj[3])) {
|
|
$vj[3] = '';
|
|
$vj[3] = '';
|
|
}
|
|
}
|
|
|
|
|
|
- $result .= '<a href="javascript:;" onclick="fastEdit($(this), \'' . $this->url('update', $data['id'], $pj) . '\', \''.$vj[0].'\', \''.$vj[3].'\', 1)"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 '.$class.'">' . $vj[0] . '</button></a> ';
|
|
|
|
|
|
+ $result .= '<a href="javascript:;" onclick="fastEdit($(this), \'' . $this->url('update', $data['id'], $pj, $suffix) . '\', \''.$vj[0].'\', \''.$vj[3].'\', 1)"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 '.$class.'">' . $vj[0] . '</button></a> ';
|
|
} elseif (strpos($kj, 'edits') !== false) {
|
|
} elseif (strpos($kj, 'edits') !== false) {
|
|
if (!isset($vj[1])) {
|
|
if (!isset($vj[1])) {
|
|
$vj[1] = '';
|
|
$vj[1] = '';
|
|
}
|
|
}
|
|
- $result .= '<a href="javascript:;" onclick="fastEdit($(this), \'' . $this->url($kj, $data['id']) . '\', \''.$vj[0].'\', \''.$vj[1].'\', 1)"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 '.$class.'">' . $vj[0] . '</button></a> ';
|
|
|
|
|
|
+ $result .= '<a href="javascript:;" onclick="fastEdit($(this), \'' . $this->url($kj, $data['id'], false, $suffix) . '\', \''.$vj[0].'\', \''.$vj[1].'\', 1)"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 '.$class.'">' . $vj[0] . '</button></a> ';
|
|
} elseif (strpos($kj, 'copy') !== false) {
|
|
} elseif (strpos($kj, 'copy') !== false) {
|
|
$vj[1] = $this->value($vj[1], $data);
|
|
$vj[1] = $this->value($vj[1], $data);
|
|
$vj[1] = Dever::load($vj[1]);
|
|
$vj[1] = Dever::load($vj[1]);
|
|
@@ -3070,7 +3084,7 @@ class Database
|
|
if (strstr($vj[1], 'http')) {
|
|
if (strstr($vj[1], 'http')) {
|
|
$url = $vj[1] . '&id=' . $data['id'];
|
|
$url = $vj[1] . '&id=' . $data['id'];
|
|
} else {
|
|
} else {
|
|
- $url = $this->url($kj, $data['id']);
|
|
|
|
|
|
+ $url = $this->url($kj, $data['id'], false, $suffix);
|
|
}
|
|
}
|
|
$result .= '<a href="javascript:;" onclick="fastEdit($(this), \'' . $url . '\', \''.$vj[0].'\', \''.$vj[1].'\')"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 '.$class.'">' . $vj[0] . '</button></a> ';
|
|
$result .= '<a href="javascript:;" onclick="fastEdit($(this), \'' . $url . '\', \''.$vj[0].'\', \''.$vj[1].'\')"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 '.$class.'">' . $vj[0] . '</button></a> ';
|
|
} elseif (strpos($kj, 'location') !== false) {
|
|
} elseif (strpos($kj, 'location') !== false) {
|
|
@@ -3080,7 +3094,7 @@ class Database
|
|
if (strstr($vj[1], 'http')) {
|
|
if (strstr($vj[1], 'http')) {
|
|
$url = $vj[1] . '&id=' . $data['id'];
|
|
$url = $vj[1] . '&id=' . $data['id'];
|
|
} else {
|
|
} else {
|
|
- $url = $this->url($kj, $data['id']);
|
|
|
|
|
|
+ $url = $this->url($kj, $data['id'], false, $suffix);
|
|
}
|
|
}
|
|
$result .= '<a href="'.$url.'"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 '.$class.'">' . $vj[0] . '</button></a> ';
|
|
$result .= '<a href="'.$url.'"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 '.$class.'">' . $vj[0] . '</button></a> ';
|
|
} elseif (strpos($kj, 'oper') !== false) {
|
|
} elseif (strpos($kj, 'oper') !== false) {
|
|
@@ -3106,15 +3120,16 @@ class Database
|
|
} elseif($vj[2]) {
|
|
} elseif($vj[2]) {
|
|
$url = Dever::url($this->value($vj[1], $data), $vj[2]);
|
|
$url = Dever::url($this->value($vj[1], $data), $vj[2]);
|
|
} else {
|
|
} else {
|
|
- $url = $this->url($kj, $data['id']);
|
|
|
|
|
|
+ $url = $this->url($kj, $data['id'], false, $suffix);
|
|
}
|
|
}
|
|
|
|
|
|
$result .= '<a href="' . $url . '" target="_blank" class="oper_' . $kj . '"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 '.$class.'">' . $h . $vjn . '</button></a> ';
|
|
$result .= '<a href="' . $url . '" target="_blank" class="oper_' . $kj . '"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 '.$class.'">' . $h . $vjn . '</button></a> ';
|
|
} elseif (isset($vj[1]) && strpos($vj[1], 'modal|') !== false) {
|
|
} elseif (isset($vj[1]) && strpos($vj[1], 'modal|') !== false) {
|
|
$t = explode('|', $vj[1]);
|
|
$t = explode('|', $vj[1]);
|
|
$result .= '<a href="#dever_modal" data-toggle="modal" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 '.$class.'" onclick=' . $t[1] . ' msg-send="' . $this->value($t[2], $data) . '">' . $vj[0] . '</a> ';
|
|
$result .= '<a href="#dever_modal" data-toggle="modal" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 '.$class.'" onclick=' . $t[1] . ' msg-send="' . $this->value($t[2], $data) . '">' . $vj[0] . '</a> ';
|
|
- } elseif (isset($vj[1])) {
|
|
|
|
- $result .= '<a href="' . $this->url($kj, $data['id'], $pj) . '" class="oper_' . $kj . '"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 '.$class.'">' . $h . $vjn . '</button></a> ';
|
|
|
|
|
|
+ } elseif (isset($vj[1]) || $kj == 'delete') {
|
|
|
|
+
|
|
|
|
+ $result .= '<a href="' . $this->url($kj, $data['id'], $pj, $suffix) . '" class="oper_' . $kj . '"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 '.$class.'">' . $h . $vjn . '</button></a> ';
|
|
} elseif ($vj) {
|
|
} elseif ($vj) {
|
|
$result .= '<span style="margin-left:5px;margin-right:10px;">' . $vj[0] . '</span>';
|
|
$result .= '<span style="margin-left:5px;margin-right:10px;">' . $vj[0] . '</span>';
|
|
}
|
|
}
|
|
@@ -3960,7 +3975,9 @@ class Database
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if ($table_key == '-1') {
|
|
if ($table_key == '-1') {
|
|
- $table_body .= '<td><a href="javascript:;" onclick="var self = $(this);var index = layer.confirm(\'确定进行此项操作吗?\', function(i, l){self.parent().parent().remove();layer.close(index);});" class="layui-btn layui-btn-xs">删除</a></td>';
|
|
|
|
|
|
+ $del_table = $param['api'];
|
|
|
|
+ $del_id = Dever::encode($bv['id']);
|
|
|
|
+ $table_body .= '<td><a href="javascript:;" onclick="var self = $(this);var index = layer.confirm(\'确定进行此项操作吗?\', function(i, l){var p = self.parent().parent();var url=config.host+\'api.del\';$.post(url, {table:\''.$del_table.'\', id:\''.$del_id.'\'});p.remove();layer.close(index);});" class="layui-btn layui-btn-xs">删除</a></td>';
|
|
}
|
|
}
|
|
$table_body .= '</tr>';
|
|
$table_body .= '</tr>';
|
|
}
|
|
}
|