Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
L
laravelzh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
冯超鹏
laravelzh
Commits
6be05993
Commit
6be05993
authored
May 07, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://111.61.77.35:15/fengchaopeng/laravelzh
parents
59792c15
922fd930
Pipeline
#36
failed with stages
Changes
14
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
435 additions
and
31 deletions
+435
-31
DevicesController.php
app/Http/Controllers/DevicesController.php
+25
-1
UserController.php
app/Http/Controllers/UserController.php
+26
-24
device.js
resources/js/api/device.js
+27
-0
users.js
resources/js/api/users.js
+28
-0
devicestutus.svg
resources/js/icons/svg/devicestutus.svg
+1
-0
feizhilou.svg
resources/js/icons/svg/feizhilou.svg
+1
-0
userstutus.svg
resources/js/icons/svg/userstutus.svg
+1
-0
device.js
resources/js/router/modules/device.js
+6
-0
users.js
resources/js/router/modules/users.js
+6
-0
devicedtutus.vue
resources/js/views/device/devicedtutus.vue
+87
-0
index.vue
resources/js/views/device/index.vue
+53
-2
index.vue
resources/js/views/user/index.vue
+46
-3
userStatus.vue
resources/js/views/user/userStatus.vue
+119
-0
api.php
routes/api.php
+9
-1
No files found.
app/Http/Controllers/DevicesController.php
View file @
6be05993
...
...
@@ -233,7 +233,6 @@ class DevicesController extends Controller
}
//批量上传设备
public
function
batchdevice
(){
}
//获取设备详情信息
public
function
deviceDataInfo
(
$id
){
...
...
@@ -275,6 +274,31 @@ class DevicesController extends Controller
->
select
(
'r.*'
,
's.status_name'
)
->
get
()
->
toArray
();
}
//返回设备废纸篓数量
public
function
deviceBasket
(){
return
$this
->
jsonSuccessData
(
DB
::
table
(
'device'
)
->
where
(
'delete'
,
'='
,
'1'
)
->
count
());
}
//返回设备废纸篓和禁用设备
public
function
deviceBasketList
(){
$paper
=
DB
::
table
(
'device'
)
->
where
(
'delete'
,
'='
,
'1'
)
->
get
()
->
toArray
();
return
$this
->
jsonSuccessData
(
$paper
);
}
public
function
deviceDelete
(
Request
$request
){
$id
=
$request
->
input
(
'id'
);
$type
=
$request
->
input
(
'type'
);
if
(
$type
==
1
){
//丢弃废纸篓
return
$this
->
jsonSuccessData
(
DB
::
table
(
'device'
)
->
where
(
'id'
,
'='
,
$id
)
->
update
([
'delete'
=>
1
,
'devicestatus'
=>
6
]));
}
else
{
return
$this
->
jsonSuccessData
(
DB
::
table
(
'device'
)
->
where
(
'id'
,
'='
,
$id
)
->
update
([
'devicestatus'
=>
6
]));
}
}
public
function
UpPaperBasket
(
$id
){
return
$this
->
jsonSuccessData
(
DB
::
table
(
'device'
)
->
where
(
'id'
,
'='
,
$id
)
->
update
([
'delete'
=>
2
,
'devicestatus'
=>
1
]));
}
/**
* @param bool $isNew
* @return array
...
...
app/Http/Controllers/UserController.php
View file @
6be05993
...
...
@@ -480,31 +480,15 @@ class UserController extends Controller
}
//查看所有逻辑删除用户 和禁用用户
public
function
deupuser
(
Request
$request
)
public
function
UpPaperBasket
(
$id
)
{
$pagenNum
=
$request
->
input
(
'page'
)
-
1
;
//页数
$limit
=
$request
->
input
(
'limit'
);
if
(
is_null
(
$pagenNum
))
{
return
$this
->
jsonErrorData
(
105
,
'page不能为空'
);
}
if
(
is_null
(
$limit
))
{
return
$this
->
jsonErrorData
(
105
,
'limt不能为空'
);
}
$users
=
DB
::
table
(
'BackgroundUser as b'
)
->
where
(
'b.state'
,
'!='
,
'2'
)
->
leftjoin
(
'areachina as p'
,
'b.provinceid'
,
'='
,
'p.areaid'
)
->
leftjoin
(
'areachina as c'
,
'b.cityid'
,
'='
,
'c.areaid'
)
->
leftjoin
(
'areachina as a'
,
'b.areaid'
,
'='
,
'a.areaid'
)
->
orderBy
(
'b.id'
,
'desc'
)
->
select
(
'b.username'
,
'b.state'
,
'b.nickname'
,
'b.email'
,
'b.state'
,
'a.area_name as area'
,
'c.area_name as city'
,
'p.area_name as province'
)
->
offset
(
$pagenNum
)
->
limit
(
$limit
)
->
get
()
->
toArray
();
if
(
$users
)
{
return
$this
->
jsonSuccessData
(
$users
);
}
else
{
return
$this
->
jsonErrorData
(
105
,
'获取失败'
);
}
return
$this
->
jsonSuccessData
(
DB
::
table
(
'BackgroundUser'
)
->
where
(
'id'
,
'='
,
$id
)
->
update
([
'state'
=>
'2'
]));
}
//禁用用户
public
function
UpuserForbidden
(
$id
)
{
return
$this
->
jsonSuccessData
(
DB
::
table
(
'BackgroundUser'
)
->
where
(
'id'
,
'='
,
$id
)
->
update
([
'state'
=>
'3'
]));
}
/*
...
...
@@ -515,4 +499,22 @@ class UserController extends Controller
return
$this
->
jsonSuccessData
(
DB
::
table
(
'contactsuser'
)
->
where
([[
'contactsid'
,
'='
,
Auth
::
id
()],
[
'isadmin'
,
'='
,
is_null
(
$this
->
isadmin
())
?
'2'
:
'1'
],[
'isstatus'
,
'='
,
'1'
]])
->
get
());
}
/*
* 返回废纸篓数量
* */
public
function
paperBasket
()
{
return
$this
->
jsonSuccessData
(
DB
::
table
(
'BackgroundUser'
)
->
where
(
'state'
,
'='
,
'1'
)
->
count
());
}
/*
* 返回废纸篓 和状态
* */
public
function
paperBasketList
()
{
$paper
=
DB
::
table
(
'BackgroundUser'
)
->
where
(
'state'
,
'='
,
'1'
)
->
get
()
->
toArray
();
$stutus
=
DB
::
table
(
'BackgroundUser'
)
->
where
(
'state'
,
'='
,
'3'
)
->
get
()
->
toArray
();
return
$this
->
jsonSuccessData
([
'paper'
=>
$paper
,
'stutus'
=>
$stutus
]);
}
}
\ No newline at end of file
resources/js/api/device.js
View file @
6be05993
...
...
@@ -29,3 +29,30 @@ export function deviceDataSearch(data) {
});
}
export
function
deviceBasket
()
{
return
request
({
url
:
'/devices/deviceBasket'
,
method
:
'get'
,
});
}
export
function
deviceDelete
(
id
,
type
)
{
return
request
({
url
:
'/devices/deviceDelete?id='
+
id
+
'&type='
+
type
,
method
:
'get'
,
});
}
export
function
deviceBasketList
()
{
return
request
({
url
:
'/devices/deviceBasketList'
,
method
:
'get'
,
});
}
export
function
UpPaperBasket
(
id
)
{
return
request
({
url
:
'/devices/UpPaperBasket/'
+
id
,
method
:
'get'
,
});
}
resources/js/api/users.js
View file @
6be05993
...
...
@@ -37,3 +37,31 @@ export function postUpUser(data) {
data
,
});
}
export
function
paperBasket
()
{
return
request
({
url
:
'/user/paperBasket'
,
method
:
'get'
,
});
}
export
function
UpPaperBasket
(
id
)
{
return
request
({
url
:
'/user/UpPaperBasket/'
+
id
,
method
:
'get'
,
});
}
export
function
UpuserForbidden
(
id
)
{
return
request
({
url
:
'/user/UpuserForbidden/'
+
id
,
method
:
'get'
,
});
}
export
function
paperBasketList
()
{
return
request
({
url
:
'/user/paperBasketList'
,
method
:
'get'
,
});
}
resources/js/icons/svg/devicestutus.svg
0 → 100644
View file @
6be05993
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
t=
"1588736146111"
class=
"icon"
viewBox=
"0 0 1024 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"6102"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
width=
"200"
height=
"200"
><defs><style
type=
"text/css"
></style></defs><path
d=
"M773.906442 33.343399h-523.812884c-119.66415 0-216.750159 97.086009-216.750159 216.750159v523.812884c0 119.7364 97.086009 216.750159 216.750159 216.750159h523.812884c119.7364 0 216.750159-97.013759 216.750159-216.750159v-523.812884c0-119.66415-97.013759-216.750159-216.750159-216.750159z m24.203768 344.950653l-308.688352 308.688351c-11.148183 11.148183-29.564722 11.148183-41.204205 0l-222.678275-150.428223c-11.148183-11.148183-11.148183-29.564722 0-41.207817 11.148183-11.148183 29.633359-11.148183 41.204205 0l202.357948 130.039258 288.295774-288.368024c11.148183-11.148183 29.564722-11.148183 41.204205 0 11.148183 11.148183 11.148183 29.636972-0.4913 41.276455z"
p-id=
"6103"
></path></svg>
\ No newline at end of file
resources/js/icons/svg/feizhilou.svg
0 → 100644
View file @
6be05993
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
t=
"1588661664805"
class=
"icon"
viewBox=
"0 0 1024 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"1151"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
width=
"200"
height=
"200"
><defs><style
type=
"text/css"
></style></defs><path
d=
"M724.9 952.2h-423c-22.1 0-40.4-17.1-41.9-39.2l-36.3-539.6c-1.6-24.3 17.6-44.8 41.9-44.8h495.6c24.3 0 43.5 20.6 41.9 44.8L766.8 913c-1.5 22.1-19.8 39.2-41.9 39.2zM844.5 249.9h-657c-0.6 0-1-0.4-1-1V134c0-0.6 0.4-1 1-1h657c0.6 0 1 0.4 1 1v114.8c0 0.6-0.4 1.1-1 1.1z"
p-id=
"1152"
></path><path
d=
"M690.9 189.5H339.8c-0.6 0-1-0.4-1-1V57.9c0-0.6 0.4-1 1-1h351.1c0.6 0 1 0.4 1 1v130.6c0 0.5-0.4 1-1 1z"
p-id=
"1153"
></path></svg>
\ No newline at end of file
resources/js/icons/svg/userstutus.svg
0 → 100644
View file @
6be05993
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
t=
"1588663812608"
class=
"icon"
viewBox=
"0 0 1024 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"4334"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
width=
"200"
height=
"200"
><defs><style
type=
"text/css"
></style></defs><path
d=
"M210.84463 162.334118a337.016471 337.016471 0 0 1 240.941177-102.098824 342.136471 342.136471 0 0 1 301.17647 184.922353l-101.195294-24.395294a30.208 30.208 0 1 0-14.155294 58.729412l147.576471 35.538823a60.235294 60.235294 0 0 0 13.854117 1.807059 60.235294 60.235294 0 0 0 57.524706-45.778823l35.538824-147.576471a30.208 30.208 0 0 0-58.729412-14.155294l-25.6 110.531765A402.070588 402.070588 0 0 0 451.785807 0a396.950588 396.950588 0 0 0-284.009412 120.470588A30.117647 30.117647 0 1 0 210.84463 162.334118z"
fill=
""
p-id=
"4335"
></path><path
d=
"M882.46816 636.385882a150.588235 150.588235 0 1 0-199.077647 0 240.941176 240.941176 0 0 0-34.635294 19.275294 399.962353 399.962353 0 0 0-122.277647-65.054117 195.764706 195.764706 0 1 0-240.941177 0A421.647059 421.647059 0 0 0 0.021101 993.882353a30.117647 30.117647 0 0 0 60.235294 0 354.484706 354.484706 0 0 1 346.352941-361.411765 354.484706 354.484706 0 0 1 346.352941 361.411765 30.117647 30.117647 0 0 0 60.235295 0 428.272941 428.272941 0 0 0-117.157647-295.755294A180.705882 180.705882 0 0 1 963.785807 855.341176a30.117647 30.117647 0 0 0 60.235294 0 240.941176 240.941176 0 0 0-141.552941-218.955294zM271.079925 436.404706a135.529412 135.529412 0 1 1 135.529411 135.830588A135.529412 135.529412 0 0 1 271.079925 436.404706z m421.647058 87.642353a90.352941 90.352941 0 1 1 90.352942 90.352941 90.352941 90.352941 0 0 1-90.352942-90.352941z"
fill=
""
p-id=
"4336"
></path></svg>
\ No newline at end of file
resources/js/router/modules/device.js
View file @
6be05993
...
...
@@ -24,6 +24,12 @@ const deviceRoutes = {
name
:
'Categories'
,
meta
:
{
title
:
'设备分类'
,
icon
:
'tree-table'
,
permissions
:
[
'manage categories'
]
},
},
{
path
:
'DeviceStutus'
,
component
:
()
=>
import
(
'@/views/device/devicedtutus'
),
name
:
'DeviceStutus'
,
meta
:
{
title
:
'设备状态列表'
,
icon
:
'devicestutus'
,
permissions
:
[
'manage user'
]
},
},
],
};
export
default
deviceRoutes
;
resources/js/router/modules/users.js
View file @
6be05993
...
...
@@ -30,6 +30,12 @@ const usersRoutes = {
name
:
'Installer'
,
meta
:
{
title
:
'装维人员'
,
icon
:
'role'
},
},
{
path
:
'userStatus'
,
component
:
()
=>
import
(
'@/views/user/userStatus'
),
name
:
'userStatus'
,
meta
:
{
title
:
'用户状态'
,
icon
:
'userstutus'
,
permissions
:
[
'manage user'
]
},
},
],
};
export
default
usersRoutes
;
resources/js/views/device/devicedtutus.vue
0 → 100644
View file @
6be05993
<
template
>
<div
class=
"app-container"
>
<el-tabs
:tab-position=
"tabPosition"
style=
"height:100%;"
>
<el-tab-pane
label=
"废纸篓"
>
<el-table
:data=
"paperData"
style=
"width: 100%"
>
<el-table-column
prop=
"username"
label=
"设备编号"
width=
"180"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
devicenum
}}
</span>
</
template
>
</el-table-column>
<el-table-column
prop=
"nickname"
label=
"设备名称"
width=
"180"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
username
}}
</span>
</
template
>
</el-table-column>
<el-table-column
prop=
"email"
label=
"设备备注"
width=
"180"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
deviceremark
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"创建时间"
width=
"170"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
deviceaddtime
|
parseTime
(
'{y
}
-{m
}
-{d
}
{h
}
:{i
}
'
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
prop
=
"state"
label
=
"状态"
>
<
template
slot
-
scope
=
"scope"
>
<
el
-
switch
:
v
-
model
=
"scope.row.delete == 2"
active
-
color
=
"#13ce66"
inactive
-
color
=
"#ff4949"
@
change
=
"UpPaperBasket(scope.row.id)"
><
/el-switch
>
<
span
>
废纸篓用户
<
/span
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
<
/el-tab-pane
>
<
/el-tabs
>
<
/div
>
<
/template
>
<
script
>
import
{
deviceBasketList
,
UpPaperBasket
}
from
'@/api/device'
;
export
default
{
data
()
{
return
{
tabPosition
:
'top'
,
paperData
:
[],
// 废纸篓
value1
:
false
,
value2
:
false
,
}
;
}
,
created
()
{
this
.
deviceBasketList
();
}
,
methods
:
{
deviceBasketList
()
{
deviceBasketList
()
.
then
(
response
=>
{
this
.
paperData
=
response
.
data
;
}
)
.
catch
(
err
=>
{
console
.
log
(
err
);
}
);
}
,
UpPaperBasket
(
id
)
{
this
.
$confirm
(
'是否将设备恢复'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
}
).
then
(()
=>
{
UpPaperBasket
(
id
)
.
then
(
response
=>
{
this
.
deviceBasketList
();
}
)
.
catch
(
err
=>
{
console
.
log
(
err
);
}
);
}
).
catch
(()
=>
{
this
.
$message
({
type
:
'info'
,
message
:
'已取消'
,
}
);
}
);
}
,
}
,
}
;
<
/script
>
<
style
>
<
/style
>
resources/js/views/device/index.vue
View file @
6be05993
...
...
@@ -2,7 +2,7 @@
<div
class=
"app-container"
>
<div
class=
"filter-container"
>
<el-form
ref=
"query"
:model=
"deviceSearch"
style=
"display: inline-block;"
>
<el-input
v-model=
"deviceSearch.deviceName"
placeholder=
"
用户名称
"
style=
"width: 200px;"
class=
"filter-item"
name=
"userskk"
/>
<el-input
v-model=
"deviceSearch.deviceName"
placeholder=
"
设备编号
"
style=
"width: 200px;"
class=
"filter-item"
name=
"userskk"
/>
<el-button
v-waves
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleSubmit"
>
{{
$t
(
'table.search'
)
}}
</el-button>
...
...
@@ -10,6 +10,11 @@
<el-button
v-if=
"device != '' "
v-waves
:loading=
"downloadLoading"
class=
"filter-item"
type=
"primary"
icon=
"el-icon-download"
@
click=
"handleDownload"
>
{{
$t
(
'table.export'
)
}}
</el-button>
<el-badge
v-if=
"paper > 0"
:value=
"paper"
class=
"item"
style=
"margin-bottom: 8px;"
>
<el-button
size=
"small"
>
<svg-icon
class-name=
"custom-class"
icon-class=
"feizhilou"
/>
废纸篓
</el-button>
</el-badge>
</div>
<el-tabs
v-model=
"activeName"
stretch
@
tab-click=
"handleClick"
>
<el-tab-pane
v-for=
"item in list"
:key=
"item.tid"
:label=
"item.tname"
:tid=
"item.tid"
:name=
"item.tid==1 ? 'second' : list.tid"
></el-tab-pane>
...
...
@@ -77,6 +82,18 @@
<
span
:
style
=
"{color:( scope.row.devicestatus==1 ? '#67C23A' : '#F56C6C' )
}
"
>
{{
scope
.
row
.
devicestatus
==
1
?
'正常'
:
'设备错误'
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
align
=
"center"
label
=
"操作"
width
=
"170"
>
<
template
slot
-
scope
=
"scope"
>
<
el
-
popover
width
=
"160"
trigger
=
"click"
placement
=
"top"
>
<
p
>
此操作
,
分丢弃废纸篓
,
和禁用用户
<
/p
>
<
div
style
=
"text-align: right; margin: 0"
>
<
el
-
button
v
-
if
=
"scope.row.delete==2"
size
=
"mini"
type
=
"text"
@
click
=
"deviceDelete(scope.row.id, 1)"
>
丢弃废纸篓
<
/el-button
>
<
el
-
button
type
=
"text"
size
=
"mini"
@
click
=
"deviceDelete(scope.row.id, 2)"
>
禁用设备
<
/el-button
>
<
/div
>
<
el
-
button
slot
=
"reference"
size
=
"mini"
type
=
"danger"
:
disabled
=
"scope.row.delete == 1 ? true : (scope.row.devicestatus > 1 ? true : false) "
>
操作
<
/el-button
>
<
/el-popover
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
<
pagination
v
-
show
=
"total>0"
:
total
=
"total"
:
page
.
sync
=
"page"
:
limit
.
sync
=
"limit"
@
pagination
=
"getList"
/>
...
...
@@ -109,7 +126,7 @@
<
/template
>
<
script
>
import
{
deviceTypeList
,
deviceList
,
deviceDataInfo
,
deviceDataSearch
}
from
'@/api/device'
;
import
{
deviceTypeList
,
deviceList
,
deviceDataInfo
,
deviceDataSearch
,
deviceBasket
,
deviceDelete
}
from
'@/api/device'
;
import
Pagination
from
'@/components/Pagination'
;
// 分页
import
waves
from
'@/directive/waves'
;
// 水波纹效果
import
clip
from
'@/utils/clipboard'
;
...
...
@@ -139,11 +156,13 @@ export default {
limit
:
10
,
type
:
''
,
total
:
0
,
paper
:
undefined
,
}
;
}
,
created
()
{
this
.
getList
();
// 设备状态
this
.
devicelist
();
this
.
deviceBasket
();
}
,
methods
:
{
...
...
@@ -246,6 +265,38 @@ export default {
console
.
log
(
err
);
}
);
}
,
// 获取废纸篓数量
deviceBasket
()
{
deviceBasket
()
.
then
(
response
=>
{
this
.
paper
=
response
.
data
;
}
)
.
catch
(
err
=>
{
console
.
log
(
err
);
}
);
}
,
deviceDelete
(
id
,
type
)
{
this
.
$confirm
(
'是否将用户丢弃'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
}
).
then
(()
=>
{
deviceDelete
(
id
,
type
)
.
then
(
response
=>
{
this
.
getList
();
this
.
devicelist
();
this
.
deviceBasket
();
}
)
.
catch
(
err
=>
{
console
.
log
(
err
);
}
);
}
).
catch
(()
=>
{
this
.
$message
({
type
:
'info'
,
message
:
'已取消'
,
}
);
}
);
}
,
}
,
}
;
<
/script
>
...
...
resources/js/views/user/index.vue
View file @
6be05993
...
...
@@ -13,6 +13,11 @@
<el-button
v-if=
"userList != '' "
v-waves
:loading=
"downloadLoading"
class=
"filter-item"
type=
"primary"
icon=
"el-icon-download"
@
click=
"handleDownload"
>
{{
$t
(
'table.export'
)
}}
</el-button>
<el-badge
v-if=
"paper > 0"
:value=
"paper"
class=
"item"
style=
"margin-bottom: 8px;"
>
<el-button
size=
"small"
>
<svg-icon
class-name=
"custom-class"
icon-class=
"feizhilou"
/>
废纸篓
</el-button>
</el-badge>
</div>
<el-table
:key=
"tableKey"
v-loading=
"loading"
:data=
"userList"
border
fit
highlight-current-rows
>
<el-table-column
align=
"center"
label=
"id"
width=
"80"
>
...
...
@@ -50,7 +55,7 @@
<span>
{{
scope
.
row
.
add_time
|
parseTime
(
'{y
}
-{m
}
-{d
}
{h
}
:{i
}
'
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
align
=
"center"
label
=
"状态"
width
=
"
17
0"
>
<
el
-
table
-
column
align
=
"center"
label
=
"状态"
width
=
"
40
0"
>
<
template
slot
-
scope
=
"scope"
>
<
span
:
style
=
"{color:( scope.row.state==1 ? '#F56C6C' : ( scope.row.state==3 ? '#909399' : '#67C23A' ) )
}
"
>
{{
scope
.
row
.
state
==
1
?
'用户已被丢弃废纸篓'
:
(
scope
.
row
.
state
==
3
?
'禁用'
:
'正常'
)
}}
<
/span
>
<
/template
>
...
...
@@ -61,11 +66,12 @@
<
el
-
popover
width
=
"160"
trigger
=
"click"
placement
=
"top"
>
<
p
>
此删除
,
分丢弃废纸篓
,
和删除
<
/p
>
<
div
style
=
"text-align: right; margin: 0"
>
<
el
-
button
size
=
"mini"
type
=
"text"
@
click
=
"userDelete(scope.row.id, 1)"
>
丢弃废纸篓
<
/el-button
>
<
el
-
button
v
-
if
=
"scope.row.state>1"
size
=
"mini"
type
=
"text"
@
click
=
"userDelete(scope.row.id, 1)"
>
丢弃废纸篓
<
/el-button
>
<
el
-
button
type
=
"text"
size
=
"mini"
@
click
=
"userDelete(scope.row.id, 2)"
>
删除
<
/el-button
>
<
/div
>
<
el
-
button
slot
=
"reference"
size
=
"mini"
type
=
"danger"
>
删除
<
/el-button
>
<
/el-popover
>
<
el
-
switch
v
-
if
=
"scope.row.state==2"
:
v
-
model
=
"false"
inactive
-
color
=
"#ff4949"
@
change
=
"UpuserForbidden(scope.row.id)"
><
/el-switch
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
...
...
@@ -96,7 +102,7 @@
<
/div
>
<
/template
>
<
script
>
import
{
userList
,
userSeek
,
userDelete
,
userDataInfo
,
postUpUser
}
from
'@/api/users'
;
import
{
userList
,
userSeek
,
userDelete
,
userDataInfo
,
postUpUser
,
paperBasket
,
UpuserForbidden
}
from
'@/api/users'
;
import
Pagination
from
'@/components/Pagination'
;
// 分页
import
waves
from
'@/directive/waves'
;
// 水波纹效果
import
clip
from
'@/utils/clipboard'
;
...
...
@@ -128,10 +134,12 @@ export default {
company
:
undefined
,
userid
:
undefined
,
}
,
paper
:
undefined
,
}
;
}
,
created
()
{
this
.
getUserList
();
// 用户列表
this
.
paperBasket
();
}
,
methods
:
{
getUserList
()
{
...
...
@@ -215,6 +223,7 @@ export default {
}
);
}
else
{
this
.
getUserList
();
this
.
paperBasket
();
}
}
)
.
catch
(
err
=>
{
...
...
@@ -245,6 +254,7 @@ export default {
if
(
response
.
code
===
200
)
{
this
.
dialogPvVisible
=
false
;
this
.
getUserList
();
this
.
paperBasket
();
}
}
}
)
...
...
@@ -276,6 +286,39 @@ export default {
console
.
log
(
err
);
}
);
}
,
// 获取废纸篓数量
paperBasket
()
{
paperBasket
()
.
then
(
response
=>
{
if
(
response
.
code
===
200
)
{
this
.
paper
=
response
.
data
;
}
}
)
.
catch
(
err
=>
{
console
.
log
(
err
);
}
);
}
,
UpuserForbidden
(
id
)
{
this
.
$confirm
(
'是否将用户禁用'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
}
).
then
(()
=>
{
UpuserForbidden
(
id
)
.
then
(
response
=>
{
this
.
getUserList
();
this
.
paperBasket
();
}
)
.
catch
(
err
=>
{
console
.
log
(
err
);
}
);
}
).
catch
(()
=>
{
this
.
$message
({
type
:
'info'
,
message
:
'已取消'
,
}
);
}
);
}
,
}
,
}
;
<
/script
>
...
...
resources/js/views/user/userStatus.vue
0 → 100644
View file @
6be05993
<
template
>
<div
class=
"app-container"
>
<el-tabs
:tab-position=
"tabPosition"
style=
"height:100%;"
>
<el-tab-pane
label=
"用户状态"
>
<el-table
:data=
"tableData"
style=
"width: 100%"
>
<el-table-column
prop=
"username"
label=
"账号名称"
width=
"180"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
username
}}
</span>
</
template
>
</el-table-column>
<el-table-column
prop=
"nickname"
label=
"用户名称"
width=
"180"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
nickname
}}
</span>
</
template
>
</el-table-column>
<el-table-column
prop=
"email"
label=
"用户邮箱"
width=
"180"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
email
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"创建时间"
width=
"170"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
add_time
|
parseTime
(
'{y
}
-{m
}
-{d
}
{h
}
:{i
}
'
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
prop
=
"state"
label
=
"状态"
>
<
template
slot
-
scope
=
"scope"
>
<
el
-
switch
:
v
-
model
=
"scope.row.state == 3"
active
-
color
=
"#13ce66"
inactive
-
color
=
"#ff4949"
@
change
=
"UpPaperBasket(scope.row.id)"
><
/el-switch
>
<
span
>
禁用用户
<
/span
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
<
/el-tab-pane
>
<
el
-
tab
-
pane
label
=
"废纸篓"
>
<
el
-
table
:
data
=
"paperData"
style
=
"width: 100%"
>
<
el
-
table
-
column
prop
=
"username"
label
=
"账号名称"
width
=
"180"
>
<
template
slot
-
scope
=
"scope"
>
<
span
>
{{
scope
.
row
.
username
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
prop
=
"nickname"
label
=
"用户名称"
width
=
"180"
>
<
template
slot
-
scope
=
"scope"
>
<
span
>
{{
scope
.
row
.
nickname
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
prop
=
"email"
label
=
"用户邮箱"
width
=
"180"
>
<
template
slot
-
scope
=
"scope"
>
<
span
>
{{
scope
.
row
.
email
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
align
=
"center"
label
=
"创建时间"
width
=
"170"
>
<
template
slot
-
scope
=
"scope"
>
<
span
>
{{
scope
.
row
.
add_time
|
parseTime
(
'{y
}
-{m
}
-{d
}
{h
}
:{i
}
'
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
prop
=
"state"
label
=
"状态"
>
<
template
slot
-
scope
=
"scope"
>
<
el
-
switch
:
v
-
model
=
"scope.row.state == 1"
active
-
color
=
"#13ce66"
inactive
-
color
=
"#ff4949"
@
change
=
"UpPaperBasket(scope.row.id)"
><
/el-switch
>
<
span
>
废纸篓用户
<
/span
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
<
/el-tab-pane
>
<
/el-tabs
>
<
/div
>
<
/template
>
<
script
>
import
{
paperBasketList
,
UpPaperBasket
}
from
'@/api/users'
;
export
default
{
data
()
{
return
{
tabPosition
:
'top'
,
tableData
:
[],
// 用户状态
paperData
:
[],
// 废纸篓
value1
:
false
,
value2
:
false
,
}
;
}
,
created
()
{
this
.
paperBasketList
();
}
,
methods
:
{
paperBasketList
()
{
paperBasketList
()
.
then
(
response
=>
{
this
.
tableData
=
response
.
data
.
stutus
;
this
.
paperData
=
response
.
data
.
paper
;
}
)
.
catch
(
err
=>
{
console
.
log
(
err
);
}
);
}
,
UpPaperBasket
(
id
)
{
this
.
$confirm
(
'是否将用户恢复'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
}
).
then
(()
=>
{
UpPaperBasket
(
id
)
.
then
(
response
=>
{
this
.
paperBasketList
();
}
)
.
catch
(
err
=>
{
console
.
log
(
err
);
}
);
}
).
catch
(()
=>
{
this
.
$message
({
type
:
'info'
,
message
:
'已取消'
,
}
);
}
);
}
,
}
,
}
;
<
/script
>
<
style
>
<
/style
>
routes/api.php
View file @
6be05993
...
...
@@ -38,7 +38,11 @@ Route::group(['middleware' => 'auth:api'], function () {
Route
::
match
([
'get'
,
'post'
],
'user/areachina'
,
'UserController@areachina'
)
->
middleware
(
'permission:'
.
\App\Laravue\Acl
::
PERMISSION_PERMISSION_MANAGE
);
//获取地址列表
Route
::
post
(
'user/addcontactsuser'
,
'UserController@addcontactsuser'
)
->
middleware
(
'permission:'
.
\App\Laravue\Acl
::
PERMISSION_PERMISSION_MANAGE
);
//添加联系人
Route
::
get
(
'user/contactslist'
,
'UserController@contactslist'
);
//返回当前登入的联系人列表
Route
::
get
(
'user/deupuser'
,
'UserController@deupuser'
);
//返回当前登入的联系人列表
Route
::
get
(
'user/UpPaperBasket/{id}'
,
'UserController@UpPaperBasket'
);
//更新废纸篓和禁用用户
Route
::
get
(
'user/UpuserForbidden/{id}'
,
'UserController@UpuserForbidden'
);
//禁用此用户
Route
::
get
(
'user/paperBasket'
,
'UserController@paperBasket'
);
//返回废纸篓数量
Route
::
get
(
'user/paperBasketList'
,
'UserController@paperBasketList'
);
//返回废纸篓和用户状态
});
//上传图片路由
...
...
@@ -63,6 +67,10 @@ Route::group(['middleware'=>'auth:api'],function (){
Route
::
match
([
'get'
,
'post'
],
'devices/updatedevice'
,
'DevicesController@updatedevice'
)
->
middleware
(
'permission:'
.
\App\Laravue\Acl
::
PERMISSION_PERMISSION_MANAGE
);
//更新设备
Route
::
get
(
'devices/equipment'
,
'DevicesController@equipment'
);
//获取设备监测列表
Route
::
get
(
'devices/police'
,
'DevicesController@police'
);
//获取设备当前报警列表
Route
::
get
(
'devices/deviceBasket'
,
'DevicesController@deviceBasket'
);
//获取设备废纸篓数量
Route
::
get
(
'devices/deviceDelete'
,
'DevicesController@deviceDelete'
);
//禁用设备和丢弃废纸篓
Route
::
get
(
'devices/UpPaperBasket/{id}'
,
'DevicesController@UpPaperBasket'
);
//更新废纸篓和禁用用户
Route
::
get
(
'devices/deviceBasketList'
,
'DevicesController@deviceBasketList'
);
//返回禁用设备和废纸篓设备
});
...
...
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