diff --git a/.gitignore b/.gitignore
index 16c1474..5e8b11f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,4 @@
/runtime/*
/public/storage/*
/public/backup/*
+/public/static/home/dev
diff --git a/app/admin/common.php b/app/admin/common.php
index 9aff6b4..de46a8e 100644
--- a/app/admin/common.php
+++ b/app/admin/common.php
@@ -64,32 +64,6 @@ function format_bytes($size, $delimiter = '')
return round($size, 2) . $delimiter . $units[$i];
}
-function list_to_tree($list, $pk = 'id', $pid = 'pid', $child = 'list', $root = 0)
-{
- // 创建Tree
- $tree = array();
- if (is_array($list)) {
- // 创建基于主键的数组引用
- $refer = array();
- foreach ($list as $key => $data) {
- $refer[$data[$pk]] = &$list[$key];
- }
- foreach ($list as $key => $data) {
- // 判断是否存在parent
- $parentId = $data[$pid];
- if ($root == $parentId) {
- $tree[$data[$pk]] = &$list[$key];
- } else {
- if (isset($refer[$parentId])) {
- $parent = &$refer[$parentId];
- $parent[$child][$data[$pk]] = &$list[$key];
- }
- }
- }
- }
- return $tree;
-}
-
function create_tree_list($pid, $arr, $group, &$tree = [])
{
foreach ($arr as $key => $vo) {
diff --git a/app/common.php b/app/common.php
index 9f2b52e..b96b70b 100644
--- a/app/common.php
+++ b/app/common.php
@@ -172,6 +172,32 @@ function table_assign($code = 0, $msg = '请求成功', $data = [], $httpCode =
throw new \think\exception\HttpResponseException($response);
}
+//菜单转为父子菜单
+function list_to_tree($list, $pk = 'id', $pid = 'pid', $child = 'list', $root = 0)
+{
+ // 创建Tree
+ $tree = array();
+ if (is_array($list)) {
+ // 创建基于主键的数组引用
+ $refer = array();
+ foreach ($list as $key => $data) {
+ $refer[$data[$pk]] = &$list[$key];
+ }
+ foreach ($list as $key => $data) {
+ // 判断是否存在parent
+ $parentId = $data[$pid];
+ if ($root == $parentId) {
+ $tree[$data[$pk]] = &$list[$key];
+ } else {
+ if (isset($refer[$parentId])) {
+ $parent = &$refer[$parentId];
+ $parent[$child][$data[$pk]] = &$list[$key];
+ }
+ }
+ }
+ }
+ return $tree;
+}
/**
* 时间戳格式化
* @param int $time
diff --git a/app/home/BaseController.php b/app/home/BaseController.php
index 95742ed..e3435d7 100644
--- a/app/home/BaseController.php
+++ b/app/home/BaseController.php
@@ -67,11 +67,9 @@ abstract class BaseController
'mobile_status' => 0,
'version' => get_config('webconfig.version'),
];
- $login_class = "nav-login";
- $login_top = '登录注册';
+ $login_top = '';
$info = $this->checkLogin();
if ($info) {
- $login_class = 'nav-login nav-logined';
$login_top = '' . $info['username'] . '';
$params['isLogin'] = 1;
$params['uid'] = $info['id'];
@@ -82,7 +80,6 @@ abstract class BaseController
View::assign('COMMON_NAV', $COMMON_NAV);
View::assign('webconfig', get_config('webconfig'));
View::assign('params', $params);
- View::assign('login_class', $login_class);
View::assign('login_top', $login_top);
}
// 检测用户登录状态
diff --git a/app/home/common.php b/app/home/common.php
index 08f3c1a..11cbe9e 100644
--- a/app/home/common.php
+++ b/app/home/common.php
@@ -15,8 +15,9 @@ function get_navs($name)
if (empty($nav_id)) {
return '';
}
- $list = \think\facade\Db::name('NavInfo')->where(['nav_id' => $nav_id, 'status' => 1])->order('sort asc')->select();
- \think\facade\Cache::tag('homeNav')->set('homeNav' . $name, $list);
+ $list = \think\facade\Db::name('NavInfo')->where(['nav_id' => $nav_id, 'status' => 1])->order('sort asc')->select()->toArray();
+ $nav = list_to_tree($list);
+ \think\facade\Cache::tag('homeNav')->set('homeNav' . $name, $nav);
}
$navs = get_cache('homeNav' . $name);
return $navs;
diff --git a/app/home/view/common/header.html b/app/home/view/common/header.html
index 7e60ff5..97281cb 100644
--- a/app/home/view/common/header.html
+++ b/app/home/view/common/header.html
@@ -1,14 +1,49 @@
-
在线管理团队的工作、项目和任务,覆盖从需求提出到研发完成上线的研发管理全生命周期
+日程 / 日报 / 项目 / 任务
+需求 / 设计 / 研发 / 测试
+进度 / 成本 / 绩效 / 质量
+文档 / 经验 / 规范 / 分享
+需求分析
+产品策划
+UI设计
+项目研发
+测试运维
+成功上线
+改进项目管理模式 提升团队的研发效率,低成本、全流程、快速定制,属于您团队的研发协同工具
+支持多产品路线,把控进度,协调团队资源
+项目操作记录全覆盖跟踪,项目进度一目了然
+时间跟踪机制,多状态流转,任务成果可见可控
+日报周报,工时登记,团队工作精细化管理
+编写测试用例库,BUG记录、跟踪和管理
+技术文档、开发经验、规则规范、支持多人分享
+