From 02344a13fee73fc665df2bd1df7da0d1bf22f9bd Mon Sep 17 00:00:00 2001 From: accacc Date: Mon, 17 Jan 2022 22:59:39 +0800 Subject: [PATCH 1/4] optimize --- app/Http/Controllers/MindController.php | 8 ++ resources/views/minds/outlineviewv2.blade.php | 87 +++++++++++++++++++ routes/web.php | 1 + 3 files changed, 96 insertions(+) create mode 100644 resources/views/minds/outlineviewv2.blade.php diff --git a/app/Http/Controllers/MindController.php b/app/Http/Controllers/MindController.php index ac0c31df..05ab1668 100644 --- a/app/Http/Controllers/MindController.php +++ b/app/Http/Controllers/MindController.php @@ -149,6 +149,14 @@ class MindController extends Controller { ] ), 'minds.outlineview' ); } + public function outlineViewv2(Request $request, Mind $mind) { + $this->authorize ( 'destroy', $mind ); + + return $this->jsonAndViewAutoResponse ( $request, ResponseDataUtil::genSimpleSucc ( [ + 'mind' => $mind + ] ), 'minds.outlineviewv2' ); + } + /** * 通过获取节点思维导图信息 * diff --git a/resources/views/minds/outlineviewv2.blade.php b/resources/views/minds/outlineviewv2.blade.php new file mode 100644 index 00000000..6a13427f --- /dev/null +++ b/resources/views/minds/outlineviewv2.blade.php @@ -0,0 +1,87 @@ +@extends('layouts.app') + +@section('content') + + + + + + +
+ +
+ @include('common.success') +
+
+ 想法-{{$mind->name}} + + +
+ +
+
+
    +
+
+
+
+ +
+
+ +@endsection diff --git a/routes/web.php b/routes/web.php index 4485339c..ae43e266 100644 --- a/routes/web.php +++ b/routes/web.php @@ -40,6 +40,7 @@ Route::group ( [ Route::get ( '/mind/{mind}', 'MindController@view' ); Route::get ( '/mindajaxget/{mind}', 'MindController@ajaxget' ); Route::get ( '/mindoutlineview/{mind}', 'MindController@outlineView' ); + Route::get ( '/mindoutlineviewv2/{mind}', 'MindController@outlineViewv2' ); Route::get ( '/mindajaxoutlineget/{mind}', 'MindController@ajaxoutlineget' ); Route::post ( '/mind/{mind}', 'MindController@update' ); -- Gitee From 944d4b2ec022a7d9211d288a6002019e9caeda4a Mon Sep 17 00:00:00 2001 From: accacc Date: Mon, 17 Jan 2022 11:03:10 -0500 Subject: [PATCH 2/4] optimize --- app/Services/DailySummaryService.php | 11 ++++++-- resources/views/articles/index.blade.php | 2 +- .../views/dailysummarys/create.blade.php | 9 ++++--- resources/views/minds/index.blade.php | 2 +- resources/views/minds/outlineviewv2.blade.php | 25 ++++++++++--------- resources/views/minds/view.blade.php | 4 +-- resources/views/pomos/index.blade.php | 5 +++- resources/views/tasks/index.blade.php | 9 +++++-- 8 files changed, 42 insertions(+), 25 deletions(-) diff --git a/app/Services/DailySummaryService.php b/app/Services/DailySummaryService.php index 575ed629..2e727d3d 100644 --- a/app/Services/DailySummaryService.php +++ b/app/Services/DailySummaryService.php @@ -91,10 +91,17 @@ class DailySummaryService { $minds = $this->mindRepository->getListForSummary ( Auth::id (), $startTime, $endTime ); $notes = $this->noteRepository->getListForSummary ( Auth::id (), $startTime, $endTime ); - $infos = array (); + $thingTypeInfos = array(1=>'事情', 2=>'任务', 3=>'番茄'); + $infos = array ( + 'thing'=>array('name'=>'事情', 'list'=>array()), + 'article'=>array('name'=>'文章', 'list'=>array()), + 'mind'=>array('name'=>'导图', 'list'=>array()), + 'note'=>array('name'=>'笔记', 'list'=>array()), + ); foreach ( $things as $thing ) { + $type = isset($thingTypeInfos[$thing->type]) ? '['.$thingTypeInfos[$thing->type].']':''; $infos ['thing'] ['list'] [] = array ( - 'content' => $thing->name, + 'content' => $type . $thing->name, 'url' => '' ); } diff --git a/resources/views/articles/index.blade.php b/resources/views/articles/index.blade.php index dd7649e9..cb61f5ea 100644 --- a/resources/views/articles/index.blade.php +++ b/resources/views/articles/index.blade.php @@ -433,7 +433,7 @@ if(processNavFlag == false) { @else
- 好像没有更多了,阅读一下其他的文章或者开始新的订阅吧~ + 好像没有更多了,阅读一下其他的文章或者开始新的订阅吧~
@endif diff --git a/resources/views/dailysummarys/create.blade.php b/resources/views/dailysummarys/create.blade.php index a3a4e34b..e018f0fd 100644 --- a/resources/views/dailysummarys/create.blade.php +++ b/resources/views/dailysummarys/create.blade.php @@ -24,15 +24,16 @@ function getInfos($summary_date) { } else { $('#tips').html(""); $.each( result_arr.result.infos, function( subject, tipInfo ){ - var li = '
  • ' + $mind.name ; + $htmlData = ''; + if($level != 0) { + $htmlData = '
  • ' + $mind.topic + '' ; $content = ''; if(null != $mind.content && '' != $mind.content) { - $content = '
    ' + + '
    '; + $content = '
    ' + $mind.content.replace(/\r\n/g, "
    ") + '
    '; } $htmlData += '
  • '; - $htmlData += $conent; - - if(Object.getOwnPropertyNames($mind.children).length > 0) { + $htmlData += $content; + } + if(null != $mind.children && Object.getOwnPropertyNames($mind.children).length > 0) { $htmlData += '