管理员开门功能

This commit is contained in:
2024-02-01 21:39:06 +08:00
parent 8999ee41ce
commit 2fc387584f
3 changed files with 26 additions and 8 deletions

View File

@@ -15,8 +15,8 @@ export function adminEnter(id) {
return http.post('/device/admin/enter/' + id)
}
export function adminOut(id) {
return http.post('/device/admin/out/' + id)
export function adminOut(id, pwd) {
return http.post('/device/admin/out/' + id, { 'password': pwd })
}
export function uploadLog(id) {
return http.post('/device/upload/log/' + id)

View File

@@ -48,12 +48,20 @@
<template scope="scope">
<el-button size="small" type="text" @click="uploadLog(scope.row.id)">上传日志(bug)</el-button>
<!-- <el-button size="small" type="text" @click="handleEnter(scope.row.id)">管理员进场</el-button>-->
<!-- <el-button size="small" type="text" @click="handleOut(scope.row.id)">管理员出场</el-button>-->
<el-button size="small" class="danger" type="text" @click="handleOutPassword(scope.row.id)">管理员开门</el-button>
<!-- <el-button size="small" type="text" @click="printCard(scope.row.id)">打印临时卡凭证</el-button>-->
<!-- <el-button size="small" v-if="scope.row.status == 0" type="text" @click="handleReconnect(scope.row.id)">重新连接</el-button>-->
</template>
</el-table-column>
</Pagination>
<el-dialog title="管理员开门" :visible.sync="dialogFormByDay">
<span>请输入开门密码</span>
<el-input v-model="form.password" placeholder="请输入密码"></el-input>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleOut">开门</el-button>
<el-button @click="dialogFormByDay = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
@@ -71,9 +79,14 @@ export default {
},
data() {
return {
dialogFormByDay: false,
deviceId: undefined,
params: {
search_eq_d$venueId: undefined
},
form: {
password: ''
},
venues: [],
intervalid1: undefined
}
@@ -105,14 +118,19 @@ export default {
})
},
handleEnter(id) {
adminEnter(id).then(response => {
handleOutPassword(id) {
this.deviceId = id
this.dialogFormByDay = true
},
handleEnter() {
adminEnter(this.deviceId).then(response => {
this.handleSearch()
})
},
handleOut(id) {
adminOut(id).then(response => {
adminOut(this.deviceId, this.form.password).then(response => {
this.handleSearch()
})
},

View File

@@ -78,10 +78,10 @@ export default {
return {
activeName: '1',
form: {
id: undefined
id: 0
},
params: {
id: undefined
id: 0
}
}
},