管理员开门功能

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) return http.post('/device/admin/enter/' + id)
} }
export function adminOut(id) { export function adminOut(id, pwd) {
return http.post('/device/admin/out/' + id) return http.post('/device/admin/out/' + id, { 'password': pwd })
} }
export function uploadLog(id) { export function uploadLog(id) {
return http.post('/device/upload/log/' + id) return http.post('/device/upload/log/' + id)

View File

@@ -48,12 +48,20 @@
<template scope="scope"> <template scope="scope">
<el-button size="small" type="text" @click="uploadLog(scope.row.id)">上传日志(bug)</el-button> <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="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" 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>--> <!-- <el-button size="small" v-if="scope.row.status == 0" type="text" @click="handleReconnect(scope.row.id)">重新连接</el-button>-->
</template> </template>
</el-table-column> </el-table-column>
</Pagination> </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> </div>
</template> </template>
@@ -71,9 +79,14 @@ export default {
}, },
data() { data() {
return { return {
dialogFormByDay: false,
deviceId: undefined,
params: { params: {
search_eq_d$venueId: undefined search_eq_d$venueId: undefined
}, },
form: {
password: ''
},
venues: [], venues: [],
intervalid1: undefined intervalid1: undefined
} }
@@ -105,14 +118,19 @@ export default {
}) })
}, },
handleEnter(id) { handleOutPassword(id) {
adminEnter(id).then(response => { this.deviceId = id
this.dialogFormByDay = true
},
handleEnter() {
adminEnter(this.deviceId).then(response => {
this.handleSearch() this.handleSearch()
}) })
}, },
handleOut(id) { handleOut(id) {
adminOut(id).then(response => { adminOut(this.deviceId, this.form.password).then(response => {
this.handleSearch() this.handleSearch()
}) })
}, },

View File

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