Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_web
Overview
Overview
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
pseer
gxpt_web
Commits
1bcbfa2a
Commit
1bcbfa2a
authored
Aug 29, 2024
by
YG8429
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备人工修改密码
parent
f74cd1d4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
3 deletions
+78
-3
device.js
src/api/system/device.js
+9
-0
roomDevice.vue
src/views/system/room/roomDevice.vue
+69
-3
No files found.
src/api/system/device.js
View file @
1bcbfa2a
...
...
@@ -35,6 +35,15 @@ export function updateDevice(data) {
})
}
// 修改设备密码
export
function
updateDevicePassword
(
data
)
{
return
request
({
url
:
'/system/device/updateDevicePassword'
,
method
:
'post'
,
data
:
data
})
}
// 删除设备信息
export
function
delDevice
(
id
)
{
return
request
({
...
...
src/views/system/room/roomDevice.vue
View file @
1bcbfa2a
...
...
@@ -87,6 +87,14 @@
v-hasPermi=
"['system:device:edit']"
>
关门
</el-button>
<el-button
v-if=
"scope.row.devType=='CCEE'"
size=
"mini"
type=
"text"
icon=
"el-icon-switch"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['system:device:edit']"
>
修改密码
</el-button>
<el-button
v-if=
"scope.row.devType=='0001'"
size=
"mini"
type=
"text"
...
...
@@ -114,17 +122,38 @@
:limit
.
sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
</div>
<selectDevice
ref=
"select"
:roomId=
"roomId"
@
ok=
"handleQuery"
/>
</div>
<!-- 修改密码对话框-->
<el-dialog
:title=
"passwordTitle"
:visible
.
sync=
"passwordOpen"
:append-to-body=
"true"
width=
"80%px"
append-to-bod
>
<el-form
ref=
"passwordForm"
:model=
"passwordForm"
label-width=
"120px"
>
<el-form-item
label=
"设备名称"
prop=
"devName"
>
<el-input
v-model=
"passwordForm.devName"
:disabled=
"true"
placeholder=
"请输入设备名称"
/>
</el-form-item>
<el-form-item
label=
"设备ID"
prop=
"devId"
>
<el-input
v-model=
"passwordForm.devId"
:disabled=
"true"
placeholder=
"请输入设备ID"
/>
</el-form-item>
<el-form-item
label=
"设备原密码"
prop=
"devPsw"
>
<el-input
v-model=
"passwordForm.devPsw"
:disabled=
"true"
placeholder=
"请输入设备密码"
/>
</el-form-item>
<el-form-item
label=
"设备新密码"
prop=
"newDevPsw"
>
<el-input
v-model=
"passwordForm.newDevPsw"
placeholder=
"请输入设备密码"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitPackForm"
>
确 定
</el-button>
<el-button
@
click=
"passwordCancel"
>
取 消
</el-button>
</div>
</el-dialog>
</el-drawer>
</template>
<
script
>
import
{
listByRoom
,
openOrClose
}
from
"@/api/system/device"
;
import
{
deleteRoomDevice
}
from
"@/api/system/room"
;
import
{
addDevice
,
getDevice
,
listByRoom
,
openOrClose
,
updateDevice
,
updateDevicePassword
}
from
'@/api/system/device'
import
{
deleteRoomDevice
,
getRoom
}
from
'@/api/system/room'
import
selectDevice
from
"./selectDevice"
;
import
{
insertPack
}
from
'@/api/system/pack'
export
default
{
name
:
"RoomDevice"
,
...
...
@@ -132,6 +161,8 @@ export default {
components
:
{
selectDevice
},
data
()
{
return
{
passwordTitle
:
""
,
passwordOpen
:
false
,
// 遮罩层
loading
:
true
,
// 选中数组
...
...
@@ -163,6 +194,7 @@ export default {
},
// 表单参数
form
:
{},
passwordForm
:
{},
};
},
created
()
{
...
...
@@ -193,6 +225,7 @@ export default {
}
}
},
methods
:
{
/** 查询设备信息列表 */
getList
()
{
...
...
@@ -204,11 +237,32 @@ export default {
this
.
loading
=
false
;
});
},
passwordReset
()
{
this
.
passwordForm
=
{
devName
:
null
,
devId
:
null
,
devPsw
:
null
,
newDevPsw
:
null
};
this
.
resetForm
(
"passwordForm"
);
},
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
},
passwordCancel
()
{
this
.
passwordOpen
=
false
;
this
.
passwordReset
();
},
handleUpdate
(
row
)
{
const
id
=
row
.
id
||
this
.
ids
getDevice
(
id
).
then
(
response
=>
{
this
.
passwordForm
=
response
.
data
;
this
.
passwordOpen
=
true
;
this
.
passwordTitle
=
"修改密码"
;
});
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"queryForm"
);
...
...
@@ -246,6 +300,18 @@ export default {
this
.
$modal
.
msgSuccess
(
msg
);
});
},
//修改密码
submitPackForm
()
{
this
.
$refs
[
"passwordForm"
].
validate
(
valid
=>
{
if
(
valid
)
{
updateDevicePassword
(
this
.
passwordForm
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"修改成功"
);
this
.
passwordOpen
=
false
;
this
.
getList
();
});
}
});
},
}
}
</
script
>
...
...
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