Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
workbiu-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gxx
workbiu-admin
Commits
d3a8f3e3
Commit
d3a8f3e3
authored
Dec 12, 2017
by
mengyixi
Browse files
Options
Browse Files
Download
Plain Diff
countspace
parents
b238bf23
b1716724
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
139 additions
and
37 deletions
+139
-37
FileController.php
app/Http/Controllers/FileController.php
+5
-3
FileService.php
app/Services/FileService.php
+10
-7
composer.lock
composer.lock
+21
-21
groupinformation.blade.php
resources/views/admin/group/groupinformation.blade.php
+99
-6
web.php
routes/web.php
+4
-0
No files found.
app/Http/Controllers/FileController.php
View file @
d3a8f3e3
...
@@ -35,8 +35,9 @@ class FileController extends Controller
...
@@ -35,8 +35,9 @@ class FileController extends Controller
{
{
$group_id
=
$request
->
group_id
;
$group_id
=
$request
->
group_id
;
$result
=
$this
->
mFile
->
groupSpace
(
$group_id
);
$result
=
$this
->
mFile
->
groupSpace
(
$group_id
);
$mbyte
=
$result
/
1048576
;
$mbyte
=
ceil
(
$result
/
1048576
)
;
$finalspace
=
array
(
"usespace"
=>
$mbyte
);
$space
=
10
-
$mbyte
;
$finalspace
=
array
(
"space"
=>
$space
,
"usespace"
=>
$mbyte
);
$finalspace
=
json_encode
(
$finalspace
);
$finalspace
=
json_encode
(
$finalspace
);
return
$finalspace
;
return
$finalspace
;
}
}
...
@@ -46,7 +47,8 @@ class FileController extends Controller
...
@@ -46,7 +47,8 @@ class FileController extends Controller
$group_id
=
$request
->
group_id
;
$group_id
=
$request
->
group_id
;
$result
=
$this
->
mFile
->
groupSpace
(
$group_id
);
$result
=
$this
->
mFile
->
groupSpace
(
$group_id
);
$mbyte
=
$result
/
1048576
;
$mbyte
=
$result
/
1048576
;
$finalspace
=
array
(
"usespace"
=>
$mbyte
);
$space
=
10
-
$mbyte
;
$finalspace
=
array
(
"space"
=>
$space
,
"usespace"
=>
$mbyte
);
$finalspace
=
json_encode
(
$finalspace
);
$finalspace
=
json_encode
(
$finalspace
);
return
$finalspace
;
return
$finalspace
;
}
}
...
...
app/Services/FileService.php
View file @
d3a8f3e3
...
@@ -12,7 +12,7 @@ namespace App\Services;
...
@@ -12,7 +12,7 @@ namespace App\Services;
use
App\Models\File
;
use
App\Models\File
;
use
App\Contracts\FileServiceContract
;
use
App\Contracts\FileServiceContract
;
use
App\Util\OssClient
;
use
App\Util\OssEngine
;
use
App\Util\OssEngine
;
class
FileService
implements
FileServiceContract
class
FileService
implements
FileServiceContract
...
@@ -25,7 +25,7 @@ class FileService implements FileServiceContract
...
@@ -25,7 +25,7 @@ class FileService implements FileServiceContract
public
function
getAll
(
$group_id
)
public
function
getAll
(
$group_id
)
{
{
$files
=
File
::
where
(
'group_id'
,
$group_id
)
->
get
(
);
$files
=
File
::
where
(
'group_id'
,
$group_id
)
->
paginate
(
8
);
if
(
$files
->
isEmpty
()){
if
(
$files
->
isEmpty
()){
return
null
;
return
null
;
}
}
...
@@ -40,8 +40,8 @@ class FileService implements FileServiceContract
...
@@ -40,8 +40,8 @@ class FileService implements FileServiceContract
public
function
delete
(
$file_id
)
public
function
delete
(
$file_id
)
{
{
$file
=
File
::
where
([
"id"
=>
file_id
])
->
get
();
//
$file =File::where(["id"=>file_id])->get();
$result
=
$file
->
delete
();
//
$result = $file->delete();
// $pointer = $file->pointer;
// $pointer = $file->pointer;
// $count =File::where(["pointer"=>$pointer])->count();
// $count =File::where(["pointer"=>$pointer])->count();
// if($result && $count == 0){
// if($result && $count == 0){
...
@@ -57,12 +57,15 @@ class FileService implements FileServiceContract
...
@@ -57,12 +57,15 @@ class FileService implements FileServiceContract
// return Message::makeError('文件不存在');
// return Message::makeError('文件不存在');
// }
// }
// }
// }
return
$result
;
//
return $result;
}
}
public
function
groupSpace
(
$group_id
)
public
function
groupSpace
(
$group_id
)
{
{
$files
=
File
::
where
([
"group"
=>
$group_id
])
->
get
();
$files
=
File
::
where
([
"group_id"
=>
$group_id
])
->
get
();
if
(
$files
->
isEmpty
()){
return
null
;
}
$space
=
0
;
$space
=
0
;
foreach
(
$files
as
$file
)
foreach
(
$files
as
$file
)
{
{
...
@@ -74,7 +77,7 @@ class FileService implements FileServiceContract
...
@@ -74,7 +77,7 @@ class FileService implements FileServiceContract
public
function
ossSpace
(
$group_id
)
public
function
ossSpace
(
$group_id
)
{
{
$files
=
File
::
where
([
"group"
=>
$group_id
])
->
get
()
->
unique
(
"pointer"
);
$files
=
File
::
where
([
"group
_id
"
=>
$group_id
])
->
get
()
->
unique
(
"pointer"
);
$space
=
0
;
$space
=
0
;
foreach
(
$files
as
$file
)
foreach
(
$files
as
$file
)
{
{
...
...
composer.lock
View file @
d3a8f3e3
...
@@ -1860,30 +1860,30 @@
...
@@ -1860,30 +1860,30 @@
},
},
{
{
"name": "symfony/event-dispatcher",
"name": "symfony/event-dispatcher",
"version": "v
3.4
.1",
"version": "v
4.0
.1",
"source": {
"source": {
"type": "git",
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "
ca20b8f9ef149f40ff656d52965f240d85f7a8e4
"
"reference": "
6223fb2b68e7059e8d5843c0103999a84e7275cf
"
},
},
"dist": {
"dist": {
"type": "zip",
"type": "zip",
"url": "https://files.phpcomposer.com/files/symfony/event-dispatcher/
ca20b8f9ef149f40ff656d52965f240d85f7a8e4
.zip",
"url": "https://files.phpcomposer.com/files/symfony/event-dispatcher/
6223fb2b68e7059e8d5843c0103999a84e7275cf
.zip",
"reference": "
ca20b8f9ef149f40ff656d52965f240d85f7a8e4
",
"reference": "
6223fb2b68e7059e8d5843c0103999a84e7275cf
",
"shasum": ""
"shasum": ""
},
},
"require": {
"require": {
"php": "^
5.5.9|>=7.0.8
"
"php": "^
7.1.3
"
},
},
"conflict": {
"conflict": {
"symfony/dependency-injection": "<3.
3
"
"symfony/dependency-injection": "<3.
4
"
},
},
"require-dev": {
"require-dev": {
"psr/log": "~1.0",
"psr/log": "~1.0",
"symfony/config": "~
2.8|~3.0
|~4.0",
"symfony/config": "~
3.4
|~4.0",
"symfony/dependency-injection": "~3.
3
|~4.0",
"symfony/dependency-injection": "~3.
4
|~4.0",
"symfony/expression-language": "~
2.8|~3.0
|~4.0",
"symfony/expression-language": "~
3.4
|~4.0",
"symfony/stopwatch": "~
2.8|~3.0
|~4.0"
"symfony/stopwatch": "~
3.4
|~4.0"
},
},
"suggest": {
"suggest": {
"symfony/dependency-injection": "",
"symfony/dependency-injection": "",
...
@@ -1892,7 +1892,7 @@
...
@@ -1892,7 +1892,7 @@
"type": "library",
"type": "library",
"extra": {
"extra": {
"branch-alias": {
"branch-alias": {
"dev-master": "
3.4
-dev"
"dev-master": "
4.0
-dev"
}
}
},
},
"autoload": {
"autoload": {
...
@@ -1919,7 +1919,7 @@
...
@@ -1919,7 +1919,7 @@
],
],
"description": "Symfony EventDispatcher Component",
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"homepage": "https://symfony.com",
"time": "2017-11-09T1
4:14:31
+00:00"
"time": "2017-11-09T1
7:30:28
+00:00"
},
},
{
{
"name": "symfony/finder",
"name": "symfony/finder",
...
@@ -2713,32 +2713,32 @@
...
@@ -2713,32 +2713,32 @@
"packages-dev": [
"packages-dev": [
{
{
"name": "doctrine/instantiator",
"name": "doctrine/instantiator",
"version": "1.
0.5
",
"version": "1.
1.0
",
"source": {
"source": {
"type": "git",
"type": "git",
"url": "https://github.com/doctrine/instantiator.git",
"url": "https://github.com/doctrine/instantiator.git",
"reference": "
8e884e78f9f0eb1329e445619e04456e64d8051d
"
"reference": "
185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda
"
},
},
"dist": {
"dist": {
"type": "zip",
"type": "zip",
"url": "https://files.phpcomposer.com/files/doctrine/instantiator/
8e884e78f9f0eb1329e445619e04456e64d8051d
.zip",
"url": "https://files.phpcomposer.com/files/doctrine/instantiator/
185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda
.zip",
"reference": "
8e884e78f9f0eb1329e445619e04456e64d8051d
",
"reference": "
185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda
",
"shasum": ""
"shasum": ""
},
},
"require": {
"require": {
"php": "
>=5.3,<8.0-DEV
"
"php": "
^7.1
"
},
},
"require-dev": {
"require-dev": {
"athletic/athletic": "~0.1.8",
"athletic/athletic": "~0.1.8",
"ext-pdo": "*",
"ext-pdo": "*",
"ext-phar": "*",
"ext-phar": "*",
"phpunit/phpunit": "
~4.0
",
"phpunit/phpunit": "
^6.2.3
",
"squizlabs/php_codesniffer": "
~2.0
"
"squizlabs/php_codesniffer": "
^3.0.2
"
},
},
"type": "library",
"type": "library",
"extra": {
"extra": {
"branch-alias": {
"branch-alias": {
"dev-master": "1.
0
.x-dev"
"dev-master": "1.
2
.x-dev"
}
}
},
},
"autoload": {
"autoload": {
...
@@ -2763,7 +2763,7 @@
...
@@ -2763,7 +2763,7 @@
"constructor",
"constructor",
"instantiate"
"instantiate"
],
],
"time": "201
5-06-14T21:17:01
+00:00"
"time": "201
7-07-22T11:58:36
+00:00"
},
},
{
{
"name": "filp/whoops",
"name": "filp/whoops",
...
...
resources/views/admin/group/groupinformation.blade.php
View file @
d3a8f3e3
...
@@ -57,7 +57,7 @@
...
@@ -57,7 +57,7 @@
<
ul
class
=
"nav nav-tabs"
>
<
ul
class
=
"nav nav-tabs"
>
<
li
class
=
"active"
><
a
href
=
"#activity"
data
-
toggle
=
"tab"
>
团队成员
</
a
></
li
>
<
li
class
=
"active"
><
a
href
=
"#activity"
data
-
toggle
=
"tab"
>
团队成员
</
a
></
li
>
<
li
><
a
href
=
"#timeline"
data
-
toggle
=
"tab"
>
团队文件
</
a
></
li
>
<
li
><
a
href
=
"#timeline"
data
-
toggle
=
"tab"
>
团队文件
</
a
></
li
>
<
li
><
a
href
=
"#settings"
data
-
toggle
=
"tab"
>
Settings
</
a
></
li
>
<
li
><
a
href
=
"#settings"
data
-
toggle
=
"tab"
>
云存储空间
</
a
></
li
>
<
li
><
a
href
=
"{{route('group.invitePage',['group_id' =>
$groups->id
])}}"
>
邀请新成员
</
a
></
li
>
<
li
><
a
href
=
"{{route('group.invitePage',['group_id' =>
$groups->id
])}}"
>
邀请新成员
</
a
></
li
>
</
ul
>
</
ul
>
<
div
class
=
"tab-content"
style
=
"height: 740px"
>
<
div
class
=
"tab-content"
style
=
"height: 740px"
>
...
@@ -95,7 +95,7 @@
...
@@ -95,7 +95,7 @@
<
th
>
文件夹
</
th
>
<
th
>
文件夹
</
th
>
<
th
>
所属项目
</
th
>
<
th
>
所属项目
</
th
>
<
th
>
创建者
</
th
>
<
th
>
创建者
</
th
>
<
th
>
操作
</
th
>
{{
--<
th
>
操作
</
th
>--
}}
</
tr
>
</
tr
>
</
thead
>
</
thead
>
@
if
(
$files
==
null
)
@
if
(
$files
==
null
)
...
@@ -116,22 +116,24 @@
...
@@ -116,22 +116,24 @@
<
td
>
{{
$file
->
folder_id
}}
</
td
>
<
td
>
{{
$file
->
folder_id
}}
</
td
>
<
td
>
{{
$file
->
fileInProject
->
name
}}
</
td
>
<
td
>
{{
$file
->
fileInProject
->
name
}}
</
td
>
<
td
>
{{
$file
->
fileCreator
->
user_name
}}
</
td
>
<
td
>
{{
$file
->
fileCreator
->
user_name
}}
</
td
>
<
td
><
a
href
=
"{{route('file.get',['id' =>
$file->id
])}}"
class
=
"btn btn-info"
>
查看详情
</
a
>
<
td
>
<
a
href
=
"
{
{$file->id}
}
"
class
=
"btn bg-orange"
>
删除
</
a
>
{{
--<
a
href
=
"{{route('file.get',['id' =>
$file->id
])}}"
class
=
"btn btn-info"
>
查看详情
</
a
>--
}}
{{
--<
a
href
=
"{{route('file.delete',['id' =>
$file->id
])}}"
class
=
"btn bg-orange"
>
删除
</
a
>--
}}
</
td
>
</
td
>
</
tr
>
</
tr
>
</
tbody
>
</
tbody
>
@
endforeach
@
endforeach
@
endif
@
endif
</
table
>
</
table
>
{{
$files
->
links
()
}}
</
div
>
</
div
>
<!--
/.
tab
-
pane
-->
<!--
/.
tab
-
pane
-->
<
div
class
=
"tab-pane"
id
=
"settings"
>
<
div
class
=
"tab-pane"
id
=
"settings"
>
<
h3
>
wowowo
我这里什么都没有
</
h3
>
<
div
id
=
"main"
style
=
"width: 600px;height:400px;"
></
div
>
<
input
type
=
"text"
value
=
""
>
</
div
>
</
div
>
<!--
/.
tab
-
pane
-->
<!--
/.
tab
-
pane
-->
...
@@ -145,6 +147,97 @@
...
@@ -145,6 +147,97 @@
<!--
/.
row
-->
<!--
/.
row
-->
</
section
>
</
section
>
<
script
src
=
"
{
{url('js/echarts.js')}
}
"
></
script
>
<
script
src
=
"
{
{url('js/jquery-3.2.1.min.js')}
}
"
>
</
script
>
<!--
引入
echarts
.
js
-->
<
script
>
// 基于准备好的dom,初始化echarts实例
var
myChart
=
echarts
.
init
(
document
.
getElementById
(
'main'
));
// ------------------ ajax ---------------//
groupSpance
();
function
groupSpance
(){
$
.
ajax
({
type
:
'get'
,
url
:
'{{route('
file
.
groupSpace
')}}'
,
success
:
function
(
data
){
console
.
log
(
data
);
if
(
data
==
''
){
alert
(
111
);
}
else
{
console
.
log
(
option
[
'series'
]);
}
},
error
:
function
(
data
){
console
.
log
(
'错误'
);
}
});
}
option
=
{
title
:
{
text
:
'当前团队空间使用情况'
,
subtext
:
'这是真的'
,
x
:
'center'
},
tooltip
:
{
trigger
:
'item'
,
formatter
:
"
{
a
}
<br/>
{
b
}
:
{
c
}
(
{
d
}
%)"
},
legend
:
{
orient
:
'vertical'
,
left
:
'left'
,
data
:
[
'全部空间'
,
'已经使用'
]
},
series
:
[
{
name
:
'访问来源'
,
type
:
'pie'
,
radius
:
'55%'
,
center
:
[
'50%'
,
'60%'
],
data
:
[
{
value
:
335
,
name
:
'全部空间'
},
{
value
:
310
,
name
:
'已经使用'
}
],
itemStyle
:
{
emphasis
:
{
shadowBlur
:
10
,
shadowOffsetX
:
0
,
shadowColor
:
'rgba(0, 0, 0, 0.5)'
}
}
}
]
};
myChart
.
setOption
(
option
);
</
script
>
...
...
routes/web.php
View file @
d3a8f3e3
...
@@ -116,7 +116,11 @@ Route::get('/',function (){return view('login');})->name('admin.login');
...
@@ -116,7 +116,11 @@ Route::get('/',function (){return view('login');})->name('admin.login');
Route
::
get
(
'get_all'
,
'FileController@getAll'
)
->
name
(
'file.getAll'
);
Route
::
get
(
'get_all'
,
'FileController@getAll'
)
->
name
(
'file.getAll'
);
Route
::
delete
(
'delete_file'
,
'FileController@delete'
)
->
name
(
'file.delete'
);
Route
::
delete
(
'delete_file'
,
'FileController@delete'
)
->
name
(
'file.delete'
);
Route
::
get
(
'group_space'
,
'FileController@groupSpace'
)
->
name
(
'file.groupSpace'
);
Route
::
get
(
'group_space'
,
'FileController@groupSpace'
)
->
name
(
'file.groupSpace'
);
<<<<<<<
HEAD
Route
::
get
(
'oss_space'
,
'FileController@ossSpace'
)
->
name
(
'file.ossSpace'
);
Route
::
get
(
'oss_space'
,
'FileController@ossSpace'
)
->
name
(
'file.ossSpace'
);
=======
Route
::
get
(
'oss_space'
,
'FileController@ossSpace'
)
->
name
(
'file.ossspace'
);
>>>>>>>
b17167244102ea0cfb09e3d1f3cb459cddf1c995
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment